Thread: Sensor Info
View Single Post
  #2   Spotlight this post!  
Unread 28-05-2016, 22:11
Knufire Knufire is offline
Rose-Hulman Institute of Technology
no team
Team Role: College Student
 
Join Date: Sep 2009
Rookie Year: 2010
Location: Terre Haute, IN
Posts: 736
Knufire has a reputation beyond reputeKnufire has a reputation beyond reputeKnufire has a reputation beyond reputeKnufire has a reputation beyond reputeKnufire has a reputation beyond reputeKnufire has a reputation beyond reputeKnufire has a reputation beyond reputeKnufire has a reputation beyond reputeKnufire has a reputation beyond reputeKnufire has a reputation beyond reputeKnufire has a reputation beyond repute
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 Boff
But now, when you spin this backwards, you get a slightly different sequence

Code:
Bon Aon Boff Aoff Bon Aon Boff Aoff
By using two digital inputs, we can now tell which direction the encoder is spinning as well as how fast it has spun.

More information:
http://www.creative-robotics.com/quadrature-intro
__________________
Team 469: 2010 - 2013
Team 5188: 2014 - 2016
NAR (VEX U): 2014 - Present
Reply With Quote