Implemention - 2023.2 English

Vitis Libraries

Release Date
2023-12-20
Version
2023.2 English

In our implemenation, we are acting on counter at every transition of either A or B, thus following X4 encoding. And we should choose the encoder type of direction for Channel A leading B or B leanding A. The detail algorithm implemention is illustrated as below:

desigh of qei

As it is shown in the aboved pictures, the whole QEI have 3 functions and dataflow between these functions.

  • filterIn: This module uses digital noise filters to reject noise on the incoming quadrature phase signals and index pulse. The input signal needs “max_filtercount” consecutive cycles to output valid signal. The variable of “max_filtercount” can be initialized to 16, or other values.
  • catchingEdge: This module captures valid signal by catching on the rising and falling edges of the pulse train. We can mark the state and type of the pulse and filter out invalid signals.
  • calcCounter: This module calculates edges feature by counting the leading and trailing edges, the counter monitors the transition in its relationship to the state of the opposite channel, and can generate reliable position and speed. The user can initialize the variable mode, and it represents encoding mode, B leading A is represented by 0 and A leading B is represented by 1. The direction of system, clockwise is represented by 1 and counterclockwise is represented by 0 both two encoding mode.