Log in

View Full Version : Encoders


Ian McShane
17-02-2011, 16:52
What will encoders do, how will they help us in teleop, and how do i program them?

AllenGregoryIV
17-02-2011, 17:03
Encoders measure the rotation of an axle. You can put them on your drive wheels and they will measure how far you have turned the wheels. Some encoders (called quadrature encoders) are able to give you direction of rotation while other are just able to tell you that the shaft has turned. With that information you can figure out how fast your wheels are spinning by determining how much they have rotated during a certain time interval.

During teleop it is possible to use them to control the velocity of your wheels using a control loop (like a PID controller) this will allow you to ensure that all of your wheels are spinning at the correct speed. You could also travel a certain distance or determine if your wheels are spinning at different rates and correct that to help you keep your robot strait. You could also use them on an arm(though a potentiometer might be better) or a lift so that you could know what position they are in during teleop.

How to program them is more complicated because I don't know what language you are using but WPILIB has built in support for encoders, so you should be able to get readings rather quickly with any language.

Ian McShane
17-02-2011, 17:11
labview is what i am programming them in, hence me posting it in the labview forum.

Doug Norman
18-02-2011, 09:13
What will encoders do, how will they help us in teleop, and how do i program them?

For programming (and physical wiring) you can look at examples. From the LabVIEW Getting Started Window click on Find FRC Examples...

Ian McShane
18-02-2011, 16:12
I can't find any examples of encoder programs, i would love it if someone could send me an example.

Baconfly
19-02-2011, 15:10
If you go down to find FRC Examples on the mainpage of the LabVIEW program there is an example there.