Quadrature Encoder

What is it?

Quadrature encoders are devices that count shaft rotation and can sense direction. The output of the encoder class is an integer that can count either up or down, and can go negative for reverse direction counting. Quadrature encoders have two digital outputs, an A Channel and a B Channel that are out of phase with each other to allow the FPGA to do direction sensing.

Properties

Channel A Port (Digital)
The DIO port on the roboRIO or MXP that channel A of the encoderis plugged into.
Channel B Port (Digital)
The DIO Port on the roboRIO or MXP that channel B of the encoder is plugged into.
Reverse Direction
Whether or not to reverse the direction considered positive by the encoder.
Encoding Type
Either k1X, k2X, or k4X to indicate 1X, 2X or 4X decoding. If 4X is selected, then an encoder FPGA object is used and the returned counts will be 4x the encoder spec'd value since all rising and falling edges are counted. If 1X or 2X are selected then a counter object will be used and the returned value will either exactly match the spec'd count or be double (2x) the spec'd count.
Distance Per Pulse
Conversion factor to convert pulses to meaninful distance.
PID Source
Whether this encoder is being used for position or velocity PID.

See Also