![]() |
Sensor Info
Hi all!
Why do digital encoders need two inputs? Also what is the difference between analog sensors and digital sensors? |
Re: Sensor Info
Digital sensors report a binary (on/off, 0/1, etc) value back to the robot. Analog sensors will report a voltage back from the robot (usually something between 0 and 5 volts). That's why things like switches, buttons, proximity sensors are digital, but things like potentiometers that measure angle are analog.
Now by that logic, an encoder (which measure the distance the shaft has spun) should be analog, since it's not measuring something that is simply on or off. However, it's actually a digital sensors, just by the nature of how the sensor works. Inside an encoder, there's a little disk with slits in it, and a little light sensor reading the disk. If the light sensor is over a slit, it returns a 1, if it's not over a slit, it returns a 0. As the shaft spins, it'll rapidly switch between 1 and 0. The robot counts how many times this switch happens (and knowing how many slits are on the disk) you can figure out how much the disk has rotated. However, this doesn't tell us which direction the encoder shaft is spinning. If we spin it backwards, we would get the same sequence of 0 and 1. Therefore, quadrature encoders (which are most FRC encoders) have two light sensors on them. They're spaced such that (if we label the two A and B), you'll get this sequence when you spin the encoder shaft. Code:
Aon Bon Aoff Boff Aon Bon Aoff BoffCode:
Bon Aon Boff Aoff Bon Aon Boff AoffMore information: http://www.creative-robotics.com/quadrature-intro |
Re: Sensor Info
Thank you so much! :D
|
| All times are GMT -5. The time now is 02:26. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi