FIRST Tech Challenge Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Autonomous Motor Encoders

Hey guys we are an FTC rookie team and we are having trouble with our encoders. Everytime we start the autonoumous program the robot does not drive straight when it is programmed to do so. We have 4 motors, one for each wheel. The two motors on the left side are dual linked and the two motors on the right side are dual linked. We have 2 encoders on the robot, one on each of the front wheels. Based on our situation, we are trying to figure out what our problem is. If you think you know the problem, let us know.

Thanks,

Alston 

0 Kudos
Message 1 of 7
(5,531 Views)

Hey Alston,

If you use the MotorStatus VI when running your code in interactive mode (so that you are getting output on the front panel) you should be able to see the encoder values for each motor as you drive. When the robot drives straight are the encoders incrementing evenly? Even if the encoders are spinning at the same speed there are a lot of reasons the robot might not drive straight (one side might not be making good contact with the ground). Which motor drive method are you using? Fixed speed? Fixed distance?

Kevin Fort
Principal Software Engineer
NI
0 Kudos
Message 2 of 7
(3,976 Views)

I'm not sure if the encoders are incrementing evenly or not. But our drive method is fixed distance. Would it be beneficial for us to have encoders on each wheel, or are we perfectly fine using just encoders on the front wheels?

0 Kudos
Message 3 of 7
(3,976 Views)

Having encoders on all the wheels would improve the accuracy but I am not sure this is your entire issue. I would first take a look at how the encoders are incrementing to see if you can get a better idea of where the issue is. If you need additional instructions on how to set up that debug just post back here.

Kevin Fort
Principal Software Engineer
NI
0 Kudos
Message 4 of 7
(3,976 Views)

Alright. Thank you!

0 Kudos
Message 5 of 7
(3,976 Views)

What do you mean by "increments" and how would we set those up to be working at the same amount? What happens if I set the distance to "1440" is the robot goes forward and at the end of it's run it kind of curves to the right. Then it jerks backwards a little bit and puts some stress on the motors for about a second somehow, I'm not entirely sure what's happening when it does that.

How do you think we can fix this "increment" problem? Assuming we can't put encoders on the back motors as well. That is out of the question at this point.

0 Kudos
Message 6 of 7
(3,976 Views)

Hey Jots,

What I meant by increments was to actually just watch the number of encoder ticks on the left and right motors when you set the motor to just drive in a straight line. Shown below is the block you will probably have to add with indicators showing the position of the left and right encoders.

encodercode.png

This will give you some information on how the encoders increment as you drive. You may also be able to observe if there are any anomolies in these values during the time period where the robot curves and then jerks backwards. I suspect that when the robot jerks backwards it is because you have travelled the set distance and the motors are braking but without your code and robot I can't be sure.

Kevin Fort
Principal Software Engineer
NI
0 Kudos
Message 7 of 7
(3,976 Views)