Hi, curious if anyone has tried “nudging” the drivetrain during autonomous to try to absorb slop in the gearing before issuing a drivetrain move command?
We spent a bunch of time fine tuning robot turns, only to then find out the robot takes off at a different angle when subsequently driving forwards or backwards. This is all dead-reckoning (no tracking wheels, but optional IMU).
I figured this was probably related to the amount of mechanical slop in the gearing including the motors (cartridges mostly I’m guessing?). How this impacts the robot would be dependent on the previous command issued, but for example if you just completed a left (counterclockwise) turn, the left side of the robot would be spinning backwards and the right side forwards. At which point the motors, gears and wheels stop. Ignoring things like rebound from braking, PID, etc. for now.
What happens then when a subsequent drive forward command is issued? Seeing as the left side of the robot was previously reversing, the motors on the left side would need to absorb any slop in gearing before the wheels start to spin forward. The right side on the other hand is already “primed” to spin forwards and the wheels will engage immediately. Say you have 10 degrees of slop in your gearing (ie left motors in this example needs to spin10 degrees before wheels spin), you’re now off course as a result (regardless of how your accurate your proceeding turn was).
This resulted in seemingly random numbers used for each turn to get the robot to subsequently drive in the right direction. Note you will have a related issue when turning after driving straight. E.g. after driving forward and then making a left turn, the motors on the left side need to go into reverse and remove slop that way (the right side would not have to). The effect is to move the pivot point of the turn (briefly) towards the stationary side of the robot.
One solution seems to be to figure out which side of the robot needs a nudge before issuing the next command. In the case of TURN_LEFT then DRIVE_FORWARD, the motors on the left side of the robot would need a gentle nudge forward of a few degrees. At least empirically, it seems our drivetrain needs about a 6 degree nudge (any more than this and the wheels start to spin).
So at least for relatively slow robot turns (25-33% velocity), issuing a nudge to the left motors in this case seems to take a lot of variability out a sequence of commends, e.g.:
drivetrain.turn_for(LEFT, 90, DEGREES)
left_motor_group.spin_for(FORWARD, 6, DEGREES) # nudge
drivetrain.drive_for (FORWARD, 24, INCHES)
To take care of effects such as rebound when moving faster ideally the code would have some way of detecting when power (torque) is increasing and stop the motors at the right “nudge” point - this would also make the code more general.
Anyway, curious what everyone thinks.
Regards,
Nick.