On Fri, Jun 9, 2023 at 7:53 AM raiden00pl wrote: > The index signal (Z index) should be used to reset the encoder position. > You can miss an encoder step for various reasons, and without periodically > checking the absolute position (index pin), you will accumulate errors. > Then, if you set the maximum count of an encoder timer to encoder > resolution, the values [0, encoder_resolution] map to the position of the > motor rotor. > Your app should be responsible for handling zero position crossing and any > calculation regarding the distance traveled by the rotor. > > There are ioctls to handle this (QEIOC_SETPOSMAX, QEIOC_SETINDEX) but ESP32 > doesn't support them.
Thanks Raiden! Can you hint a complete implementation that I can base on the ESP32 work? :-) -- CeDeROM, SQ7MHZ, http://www.tomek.cedro.info