Robot not driving straight

How do I compensate for a robot that does not drive straight in Teleop?

I checked the RMPs on both sides and the left side goes 280 RPM and the right side goes 480 RPMs going forward. Going reverse the left side goes 471 RPMs and the right side goes 376 RPMs.

Any ideas?

Thank you

Do you have encoders hooked up? They should be able to compensate for slight variations.

Also, since the variation is so large, it might be due to different loading. Check for possible points of friction, different chain tensions, different gearboxes, parts rubbing on the chain, etc.

Finally, it might be an issue with a failing motor, in which case, replacing it is the best option.

How are you checking the RPM?

How many motors do you have hooked up on each side? Is is configured like the kitbot or something else special?

If you disable a couple of the motors do you get similar numbers? We are trying motor combinations to see if we can single out one of the motor (or motor controllers) as being bad.

Is your code super basic like in the default program or are you doing something fancy.

We don’t have encoders. This is the last year’s robot and we want to use it for practice. We did check for points of friction, tensions, part rubbing, same gearboxes, and we found nothing obvious. We think it might be the motor, yes, the option is to replace it but for practice, we were hoping we didn’t have to replace it.

Thank you

We are using a Digital Non-contact Tachometer.

We have two motors on each side. Kitbot.

We did disable one motor at a time to make sure all motors were working but we did not measure the RPMs. The code is basic, no fancy calculations. We tried fancy joystick sensitivity algorithms with no luck. We also tried using an IMU with no luck.

Today, we tried using rates for each inputs to the Motor Set routine and it seemed to work, we were getting similar RPMs on both sides. The outputs will be reduced by the factors used. Since this robot is for practice only, it might be good enough.

Thank you

Another thing that often gets overlooked is wire lengths. If one side of your robot’s drivetrain has wires that are significantly longer than the other side, there will be more resistance in that wire, causing the motor to see less voltage and produce less power. Always try to keep your PDP centered on the robot, so with wires to each side are the same length without needing to artificially lengthen one side.

So the right side is faster when going forward, and slower when going backward.

Are your commanding with PWM or CAN? If PWM, recalibrate your motor controllers to your joystick.

No joy? Some times motors have a fwd/rev asymmetry. Temporarily label your motors 1, 2, 3, 4 so your can keep track of them, then try these 3 combinations:


*
*left side	right side
1,2		3,4
1,3		2,4
1,4		2,3

That is a huge difference, making me suspicious of everything. That is almost a 2:1 ratio, meaning a really sharp turn.

Not as bad in reverse, I see.

As you command the motors forward, measure the voltage each motor is receiving. If the voltages left and right are about the same, the problem is mechanical. If the voltages are notably different, the problem is in code (or your joystick)