Changes between Version 10 and Version 11 of ControlSystems/SoftwareTeam/Training/GettingStarted/Encoders


Ignore:
Timestamp:
Oct 31, 2019, 1:15:10 PM (6 years ago)
Author:
David Albert
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ControlSystems/SoftwareTeam/Training/GettingStarted/Encoders

    v10 v11  
    3535  }}}
    3636
     37For more information and examples of using an encoder connected to DIOs, see the [https://mililanirobotics.gitbooks.io/frc-electrical-bible/content/Sensors/opticalencoder.html FRC Electrical Bible]
     38
    3739=== Encoder connected to a TalonSRX smart motor controller (Hazelnut)
    3840Create another program using the !TimedRobot java template and name it SRXencoderTest. Modify the generated code as follows:
     
    6365Note: you'll need to manually turn the left wheel forward and backward to see the Encoder values change. Try turning the wheel 360 degrees to see what value is equivalent to a full revolution of the wheel. 
    6466
    65 Notice that the raw count reports the sum of both A and B channels of the quadrature encoder.  A quadrature encoder works like the optical encoder shown above, but with two rows of slits in the disk, each slightly offset from the other (overlapping) and each with its own light source/detector.  This allows you to determine not just distance and speed but also direction.  The light detectors are labeled A and B; because the slots overlap, the sequence of detected light as the wheel rotates forward is:  A, AB, B, off, A, AB, etc.  When the wheel rotates backwards, the sequence is B, AB, A, off, B, AB, A, off.  [[Image(encAB.gif,right,250px,margin=10)]]
     67
     68
     69[[Image(encAB.gif,right,250px,margin=10)]]Notice that the raw count reports the sum of both A and B channels of the quadrature encoder.  A quadrature encoder works like the optical encoder shown above, but with two rows of slits in the disk, each slightly offset from the other (overlapping) and each with its own light source/detector.  This allows you to determine not just distance and speed but also direction.  The light detectors are labeled A and B; because the slots overlap, the sequence of detected light as the wheel rotates forward is:  A, AB, B, off, A, AB, etc.  When the wheel rotates backwards, the sequence is B, AB, A, off, B, AB, A, off. 
     70
     71You can read more about quadrature encoders [https://robu.in/quadrature-encoder/ here] [[Image(quadEncoder.gif,right,250px,margin=10)]]
    6672
    6773