Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

POSENC - Quadrature and step/direction encoder

The POSENC block handles the Quadrature and step/direction encoding

Fields

NameTypeDescription
ENABLEbit_muxHalt on falling edge, reset and enable on rising
INPpos_muxOutput position
PERIODparam timeMinimum time between Quadrature transitions of step pulses
PROTOCOLparam enumQuadrature or step/direction
Abit_outQuadrature A/Step output
Bbit_outQuadrature B/Direction output
STATEread enumState of quadrature output

Quadrature

When in the quadrature mode, the module will output signals A and B in different states as it counts up or down. When counting up B will follow A and when counting down A will follow B. The period is the time between an edge on one signal to the next edge of the other signal.

The input is initially set as the value of the INP line when ENABLE goes high. The system will then count to the current value on the INP line, and when it reaches this value the output signals will stay as they are.

The state output is ‘0’ while ENABLE is low, ‘1’ when the count is equal to the signal on the INP line and ‘2’ while it is counting towards the INP value.

Quadrature rising and fallingLonger Period Quadrature

Step/Direction

In the Step/Direction mode the A output becomes a step output. This goes high on every period for one clock cycle and is low for the remainder of the period. The B output becomes the direction output, it is ‘0’ when the internal counter is lower than the inputted target value (it is counting up), and ‘1’ when it is greater or equal to.

Step/DirectionLonger Period Step/Direction