Associate II
November 1, 2021
Question
Possible bug in HAL quadrature encoder implementation
- November 1, 2021
- 3 replies
- 1575 views
HI
We bought a AMT102-V encoder from CUI devices. It is a 1024 pulses per rev encoder.
We are using a STM32H745 nucleo board and the HAL library with inbuilt pulse detection for quadrature encoders. Code is being run on the CM7 core.
Every pulse increments the counter (Motor is rotating in only one direction) and when an index pulse is detected, the counter is reset to 0.
As this video shows, the number of pulses per revolution detected varies quite significantly (From 955 to 1024). Clearly something is wrong and seems to indicate that pulses are being missed.
The code with the HAL initialisation is attached. Please let me know what is wrong .
