Failed Odometry Test AT+E - Stops Turning Too Soon

rothnic

New member
Hi, I purchased an Ardumower kit with 1.4 PCB and brushed motors about a year ago. We ended up having something come up where I had to work on our house, which delayed me putting the kit together until this last weekend. I've managed to get it mostly together, but am running into issues with the odometry testing.

The config.h for the m4 grand central controller is setup to disable GPS and the IMU. The ticks per revolution chosen is the 696/2, which matches the brushed motors I have. The sunray fw version is the latest official release from late 2022, which is v1.0.298. I disabled everything I saw that

My battery was recently charged, but is now sitting at around 28v after some testing. I think it was right below 29v fully charged. The wheels have nothing brushing against them and it seems they have no trouble moving.

First of all, I used the app connected via BT to the esp32 to test the motors using the joystick control. This works as expected after I got the directions figured out. I ended up having to enable the MOTOR_RIGHT_SWAP_DIRECTION setting to get the directions working correctly.

Next, I submit the AT+E command. It rotates the wheels forward for a while, but the test never completes. The motors seem to stop just before 10 rotations are completed. I found similar posts from a year or two ago, but they didn't seem to address my problem. Here is the output:

15:49:24.119 -> CON:AT+E
15:49:24.119 -> engine test - 10 revolutions
15:49:24.119 -> t=0 ticks Left=0 Right=0 current Left=0.00 Right=0.00
15:49:25.108 -> t=1 ticks Left=215 Right=212 current Left=0.15 Right=0.31
15:49:26.103 -> t=2 ticks Left=433 Right=428 current Left=0.21 Right=0.05
15:49:27.134 -> t=3 ticks Left=652 Right=645 current Left=0.14 Right=0.25
15:49:28.134 -> t=4 ticks Left=871 Right=862 current Left=0.13 Right=0.31
15:49:29.132 -> t=5 ticks Left=1090 Right=1079 current Left=0.06 Right=0.22
15:49:30.139 -> t=6 ticks Left=1309 Right=1296 current Left=0.18 Right=0.24
15:49:31.138 -> t=7 ticks Left=1528 Right=1513 current Left=0.23 Right=0.21
15:49:32.165 -> t=8 ticks Left=1747 Right=1730 current Left=0.14 Right=0.22
15:49:33.166 -> t=9 ticks Left=1966 Right=1947 current Left=0.14 Right=0.06
15:49:34.165 -> t=10 ticks Left=2185 Right=2164 current Left=0.19 Right=0.20
15:49:35.173 -> t=11 ticks Left=2404 Right=2381 current Left=0.23 Right=0.21
15:49:36.189 -> t=12 ticks Left=2623 Right=2598 current Left=0.13 Right=0.21
15:49:37.200 -> t=13 ticks Left=2842 Right=2816 current Left=0.05 Right=0.15
15:49:38.214 -> t=14 ticks Left=3062 Right=3033 current Left=0.06 Right=0.05
15:49:39.214 -> t=15 ticks Left=3281 Right=3250 current Left=0.11 Right=0.31
15:49:40.226 -> t=16 ticks Left=3289 Right=3259 current Left=0.01 Right=0.01
15:49:41.221 -> t=17 ticks Left=3289 Right=3259 current Left=0.03 Right=0.00
15:49:42.215 -> t=18 ticks Left=3289 Right=3259 current Left=0.00 Right=0.01
15:49:43.235 -> t=19 ticks Left=3289 Right=3259 current Left=0.01 Right=0.01
15:49:44.258 -> t=20 ticks Left=3289 Right=3259 current Left=0.01 Right=0.01
15:49:45.264 -> t=21 ticks Left=3289 Right=3259 current Left=0.01 Right=0.00
15:49:46.258 -> t=22 ticks Left=3289 Right=3259 current Left=0.01 Right=0.00
15:49:47.273 -> t=23 ticks Left=3289 Right=3259 current Left=0.01 Right=0.01
15:49:48.272 -> t=24 ticks Left=3289 Right=3259 current Left=0.01 Right=0.01
15:49:49.283 -> t=25 ticks Left=3289 Right=3259 current Left=0.01 Right=0.01
15:49:50.278 -> t=26 ticks Left=3289 Right=3259 current Left=0.01 Right=0.01
15:49:51.273 -> t=27 ticks Left=3289 Right=3259 current Left=0.01 Right=0.01
15:49:52.286 -> t=28 ticks Left=3289 Right=3259 current Left=0.01 Right=0.00
15:49:53.295 -> t=29 ticks Left=3289 Right=3259 current Left=0.01 Right=0.00
15:49:54.298 -> t=30 ticks Left=3289 Right=3259 current Left=0.01 Right=0.01
15:49:55.323 -> t=31 ticks Left=3289 Right=3259 current Left=0.01 Right=0.00
15:49:56.325 -> t=32 ticks Left=3289 Right=3259 current Left=0.01 Right=0.01
15:49:57.321 -> t=33 ticks Left=3292 Right=3259 current Left=0.04 Right=0.02
15:49:58.324 -> t=34 ticks Left=3292 Right=3259 current Left=0.02 Right=0.02
15:49:59.335 -> t=35 ticks Left=3292 Right=3259 current Left=0.03 Right=0.02

Attaching my config.h file for reference.
 
Das sieht eigentlich gut aus. Die Ticks werden gezählt und beide Motoren liegen in etwa gleich.
Die letzte Umdrehung erfolgt ganz langsam. Dreh mal am Ende des Test die Moten noch etwas, dann wird der Test abgeschlossen. Mach ein Klebchen an die Achse und zähle mit. Es müssen genau 10 Umdrehungen werden. In der Config.h die Ticks anpassen.
Du kann noch mal mit der 230 Version testen.
 
The wheels appeared to rotate about 9.25 times or so then just stops suddenly. I tried adjusting the ticks per revolution to "757 / 2", which is what I calculated would give me 10 full revolutions. I ran the test again and one wheel completed about 10.1 revolutions and the other pretty much exactly 10 revolutions, but maybe 9.9 revolutions or so. However, the test keeps running and running. By manually turning both wheels another 1 full revolution or so (11 total revolutions), the test finally completed.

I'm just confused on how this test is supposed to work and how the adjustments should work. It seems odd that the test thinks my motors haven't rotated enough no matter the ticks per revolution setting I apply.
 
Not sure how I missed that thread, but changing the pwm to 30 when the test goes into the slow mode worked. With it set at 20 the wheels don't continue to turn at all, but 30 works fine.

Now, the only issue I see is that one of the wheels turns slightly more than the other. One wheel ends at 10 revolutions, and the other ends where it is 1 notch of the wheel in front of the other.

In the attached picture, both started with the white sticker pointed straight up, then the picture shows the ending position. The wheel on the far side is about 1 notch ahead. I'm not sure if this is ok, or something requiring more adjustment.

11:09:51.752 -> CON:AT+E
11:09:51.752 -> motor test - 10 revolutions
11:09:51.752 -> t=0 ticks Left=0 Right=0 current Left=0.00 Right=0.00
11:09:52.763 -> t=1 ticks Left=213 Right=210 current Left=0.22 Right=0.27
11:09:53.764 -> t=2 ticks Left=429 Right=426 current Left=0.14 Right=0.21
11:09:54.781 -> t=3 ticks Left=647 Right=641 current Left=0.15 Right=0.29
11:09:55.781 -> t=4 ticks Left=864 Right=857 current Left=0.26 Right=0.26
11:09:56.765 -> t=5 ticks Left=1081 Right=1073 current Left=0.08 Right=0.06
11:09:57.773 -> t=6 ticks Left=1299 Right=1288 current Left=0.23 Right=0.29
11:09:58.782 -> t=7 ticks Left=1516 Right=1504 current Left=0.16 Right=0.20
11:09:59.802 -> t=8 ticks Left=1734 Right=1720 current Left=0.06 Right=0.03
11:10:00.807 -> t=9 ticks Left=1951 Right=1936 current Left=0.22 Right=0.28
11:10:01.815 -> t=10 ticks Left=2168 Right=2152 current Left=0.10 Right=0.23
11:10:02.836 -> t=11 ticks Left=2386 Right=2368 current Left=0.14 Right=0.05
11:10:03.813 -> t=12 ticks Left=2604 Right=2584 current Left=0.00 Right=0.18
11:10:04.826 -> t=13 ticks Left=2821 Right=2800 current Left=0.04 Right=0.06
11:10:05.834 -> t=14 ticks Left=3039 Right=3016 current Left=0.18 Right=0.13
11:10:06.843 -> t=15 ticks Left=3256 Right=3232 current Left=0.25 Right=0.04
11:10:07.840 -> t=16 ticks Left=3278 Right=3255 current Left=0.04 Right=0.00
11:10:08.847 -> t=17 ticks Left=3290 Right=3269 current Left=0.05 Right=0.01
11:10:09.862 -> t=18 ticks Left=3303 Right=3283 current Left=0.05 Right=0.01
11:10:10.858 -> t=19 ticks Left=3315 Right=3297 current Left=0.05 Right=0.02
11:10:11.864 -> t=20 ticks Left=3328 Right=3311 current Left=0.06 Right=0.00
11:10:12.902 -> t=21 ticks Left=3340 Right=3325 current Left=0.03 Right=0.00
11:10:13.886 -> t=22 ticks Left=3353 Right=3339 current Left=0.02 Right=0.02
11:10:14.890 -> t=23 ticks Left=3365 Right=3353 current Left=0.04 Right=0.02
11:10:15.903 -> t=24 ticks Left=3378 Right=3367 current Left=0.11 Right=0.01
11:10:16.923 -> t=25 ticks Left=3390 Right=3381 current Left=0.04 Right=0.02
11:10:17.908 -> t=26 ticks Left=3403 Right=3395 current Left=0.04 Right=0.01
11:10:18.943 -> t=27 ticks Left=3415 Right=3409 current Left=0.05 Right=0.01
11:10:19.945 -> t=28 ticks Left=3428 Right=3423 current Left=0.05 Right=0.01
11:10:20.952 -> t=29 ticks Left=3441 Right=3437 current Left=0.03 Right=0.00
11:10:21.931 -> t=30 ticks Left=3453 Right=3451 current Left=0.04 Right=0.05
11:10:22.940 -> t=31 ticks Left=3466 Right=3466 current Left=0.04 Right=0.01
11:10:23.957 -> t=32 ticks Left=3478 Right=3480 current Left=0.05 Right=0.06
11:10:24.969 -> t=33 ticks Left=3491 Right=3480 current Left=0.04 Right=0.00
11:10:24.969 -> motor test done - please ignore any IMU/GPS errors
 
Which one? Left?
3491 left > 3480 right

Everything works fine. You can go to the next step

The motor hooked up to the left side. Somehow my image didn't get attached. You can see hopefully this time that the wheel furthest away is the one that rotated slightly more than the other and is hooked up to the left motor connections.

PXL_20230812_161450490.jpeg

To be honest, I haven't seen a clear picture of what is considered the right motor vs the left motor. Is it when I'm looking at the front of the robot, or is it looking down on top of the robot from its perspective? Since you can potentially switch the wires and alter the direction in the config.h file, it makes it kind of hard to understand. I originally thought it was when looking overhead from the robot's perspective, but I had to actually swap them to make the control work correctly.

I'll move on to the next step. Currently working on solid mounting options for the IMU and GPS, plus the wiring for them.
 
Oben