[Dprglist] Speed detection based on period between encoder transitions

Paul Bouchier paul.bouchier at gmail.com
Wed Jan 26 19:58:15 PST 2022


Pat, Doug - with the disclaimer that the code is barely tested, I've
provided my implementation of an encoder transition-period based speed
sensor on github at
https://github.com/PaulBouchier/EncoderTest

This is intended to address speed resolution issues on wheels with few
encoder-counts per control-loop cycle. Mowbot only gives 2 - 4 transitions
per cycle.

There's a README that explains how it works. I measured time in the ISR to
be 200us. I don't know if it will work decently when used in a closed loop,
but I'd welcome any comments you guys might have.

A few minor changes would be needed to make it work on standard AVR arduino
vs. the esp32 arduino in which I use some FreeRTOS calls - primarily to use
millis() and to use some other implementation of a queue (e.g. a ring
buffer).

Paul
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.dprg.org/pipermail/dprglist-dprg.org/attachments/20220126/1019a047/attachment.html>


More information about the DPRGlist mailing list