FIRST Robotics Competition Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Robot not driving straing in Teleop

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

0 Kudos
Message 1 of 3
(2,979 Views)

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.

 

Champion CLA

Making senseless computers do
intelligent real world things
is NOT easy. SO MAKE IT FUN!
0 Kudos
Message 2 of 3
(2,964 Views)

@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.

0 Kudos
Message 3 of 3
(2,953 Views)