|
Re: Motor balancing (encoders?)
It isn't a common problem. If you are getting significantly different response on the two sides of your drive base, something is wrong with the hardware. It would be better to fix the cause rather than patch it with software.
But if you do want to mask the mechanical or electrical issue, you can use the gyro to modify the X axis input to the Arcade Drive function. Use the joystick as a rudder to determine the desired heading by applying a delta to the current heading as read from the gyro. Use that desired heading as the setpoint of a PID block that reads the current gyro angle and provides the X axis control.
When you're not calling for a turn, the PID will apply whatever turn command is necessary to keep the robot facing the same direction.
|