02-23-2018 03:41 PM
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
02-23-2018 05:26 PM
A few questions are
If you are sending the same value and using the same motor controller and getting 280 on one and 480 on the other I would try to fix the problem mechanically first. There seems to be a huge drag on the one side and may cause other problem later like burning up the controller or motor.
One way in software to fix the problem is to create closed loop code. using a commanded velocity and real velocity read by a sensor. The code would compare the 2 values and generate the motor value to match the target. This is called a control or PID loop.
02-24-2018 12:10 AM
@MarkBalla wrote:
A few questions are
- What type of motor controllers are you using?
- Are you sending the same value to each motor controller in your code?
- How are you measuring the RPMs?
- Do you have encoders on both wheels?
- Does your robot have a gyro.
If you are sending the same value and using the same motor controller and getting 280 on one and 480 on the other I would try to fix the problem mechanically first. There seems to be a huge drag on the one side and may cause other problem later like burning up the controller or motor.
One way in software to fix the problem is to create closed loop code. using a commanded velocity and real velocity read by a sensor. The code would compare the 2 values and generate the motor value to match the target. This is called a control or PID loop.
We are using Talon's SRX and we are sending the same value to both sides. We are using a Digital non-contact tachometer to measure the RPMs. We don't have encoders and we do have a gyro.
We are trying to use last years robot so the drivers can practice. We have been looking at the bands, gearboxes, motors and making adjustments with no change. Other than replacing gearboxes and motor, we were hoping to just compensate using rates.
We do have an IMU, but we are not sure how to use it to fix this. I tried using the z angle with no luck.
Today, we tried using rates for each input 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.