|
Re: Bizarre Driving Issue
I'm pretty sure your current problems are caused by overflowing unsigned variables, however, if you're like us, the next problem you'll have is with your robot listing to one side or another as it drives. We fixed it by collecting data about the pwms and making a lookup table that relates desired wheel speeds and actual pwms.
We collected this data by hooking the robot to the computer and cycling through all the possible pwms. The units on wheel speeds are not actually RPMs, but encoder counts per 115 program loops, because there was no need to convert units.
Note the fact that the maximum speeds in each direction are not the same and also the fact that the dead zone is centered about 132. This was causing our robot to drift, because wheels that were supposed to be going in the same speeds with opposite directions weren't. Also, notice that the slope gets really steep in the middle and flatten out at the end. We wanted our robot to accelerate linearly.
To fix this, we made a list of what the motor speeds would be if they were increasing linearly from 0 - the maximum and put it in a new column lining up with the old columns. We made our lookup table by looking at our list of "desired speeds" and finding a pwm setting that would create that speed. Unfortunately, that work is on the computer at school, but I'll post it soon.
I'm actually considering putting together a whitepaper on the topic of holonomic driving, assuming ours works out.
|