Re: Encoder Guidance Needed
Quote:
Originally Posted by l0stboy
Hello, my team is planning on using encoders, specifically the ones that were in FIRST Choice. I've looked though all the Java threads on them, but I can't make sense of how the Encoder class really works.
My team plans on using the encoder to move to desired set positions in autonomous and to prevent from going too fast.
For instance, I really don't know how the getDistancePerPulse() and how to use the other methods accordingly to get distance calculations. Samples code on setting up an encoder would be awesome!
|
Encoders work by detecting little sprockets on a wheel inside the encoder usually using optic sensors or anything along those lines. The encoders you have 360 of these bumps or sprockets meaning that every revolution of the shaft the encoder is mounted on, the encoder pulses 360 times. Using the libraries provided you can set the distance per pulse. Therefore by calculating how far, say your robot drives per revolution of the output shaft your encoder is mounted on, you can get how far your robot has travelled and how fast its moving.
__________________
2012: Buckeye Regional, Queen City Regional, Human Player
2013: Queen City Regional, Buckeye Regional, Crossroads Regional
Shooter Operator
2014: Crossroads Regional, Queen City Regional
Catapult Operator
2015: Georgia Southern Classic Regional (Winner), Queen City Regional
Chainsaw Operator
Want to talk? TeamSpeak: team3266.noip.me
Last edited by Team3266Spencer : 03-02-2013 at 23:44.
|