Our drive train has an issue: when telling both sides to go forward at the same voltage for a period, the left side moves less distance than the right side.
We have 3 CIM motors on each side, in a “West Coast” configuration, each connected to a CAN Talon SRX motor controller. In the code (using java), for each side we have 2 motors set as slaves to follow one master motor, and we are sure (90% sure) that each motor is being run the correct direction and that none are disconnected (but we should double check).
With the robot on the ground, we told both sides to go forward at 50% voltage for 5 seconds. We recorded the distance the left side and right side drove using the encoders after the 5 second run, then reset the encoders.
We repeated this process 3 times for each direction, going forwards - measuring - backwards - measuring - forwards - etc. Then we averaged the ratio of the left distance divided by the right distance to get a number we’ll call the scaling factor (it was about 96%). Then when sending the output voltage to the master motor for each side, we do
leftMaster.set(output);
rightMaster.set(output * scaling factor);
This fixed the problem for the most part, but I would like to know other / better ways to fix this (programmatically and mechanically and electrically).
For auto commands, we also used the encoders to keep going straight by keeping track of the left error - right error difference from a setpoint (only if the left and right encoder setpoints were the same). We multiply the difference in error by a proportion then add / subtract this proportion from the left / right sides. This works decently as well. Still wondering if there are better ways to fix this / ways to fix it permanently.