[Dprglist] Speed detection based on period between encoder transitions

Doug Paradis paradug at gmail.com
Mon Jan 31 09:44:49 PST 2022


Paul,
    My first thought would be that the ISRs would only include a count
increment and the messaging would be handled in the loop.
Regards,
Doug P.

On Wed, Jan 26, 2022 at 9:58 PM Paul Bouchier via DPRGlist <
dprglist at lists.dprg.org> wrote:

> 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
>
> _______________________________________________
> DPRGlist mailing list
> DPRGlist at lists.dprg.org
> http://lists.dprg.org/listinfo.cgi/dprglist-dprg.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.dprg.org/pipermail/dprglist-dprg.org/attachments/20220131/204e8c1c/attachment.html>


More information about the DPRGlist mailing list