This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Quadrature decoder settings for motor encoder

Hello community,

I tried to read my motor encoders with the QDEC and capture the position of my motor.
Hardware: nRF52840 DK, 2 Hal motor encoders on pin 0.13 and 0.14 which are supplied with an external voltage of 3.3V.

Unfortunately, in my test setups either more edges were detected than available, or not all were detected because supposedly 2 edges occurred at the same time.

In the settings I could only find one setting at the time at which the QDEC should measure. Can this be changed so that the QDEC only reacts when it detects an edge and also recognizes this only once?

I have already experimented with different speeds, but as long as I do not come exactly to the time I have set in the QDEC come again and again errors and the Morot position does not fit.

PS: I have realized it temporarily with an interrupt when changing the state of these two pins, but this is relatively complicated by the comparison with the position of the other encoder and the detection of the direction of rotation.

Maybe one of you has already experiences with the QDEC and can tell me where I can make further settings except in the sdk_config.h.

Thanks in advance

Translated with www.DeepL.com/Translator (free version)

Related