Currently the width of the Z-index pulse is not taken into account. As soon as a rising flank is detected the count value is reset. This leads to a different index position depending on whether the encoder is moving clockwise or counter-clockwise. The behavior of the clock-pulse should be dependent on the direction:
- when rotating CW, the index pulse should be detected with a rising flank;
- when rotating CCW, the index pulse should be detected with falling flank.
Proposed changes:
Currently the width of the Z-index pulse is not taken into account. As soon as a rising flank is detected the count value is reset. This leads to a different index position depending on whether the encoder is moving clockwise or counter-clockwise. The behavior of the clock-pulse should be dependent on the direction:
Proposed changes:
directionwith width 2. Possible values are b'00 (reset, not moved), b'01 (CW), b'10 (CCW);