Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Odometry: RPM estimation improvements #146

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

ShadedSelf
Copy link
Contributor

@ShadedSelf ShadedSelf commented Aug 22, 2023

The problem:
RPM is calculated sampling ticks in a given amount of time, 50 ms in this case.
This gives aliased data and, in some cases, no data at all, for my 150 ticks per revolution motor at 0.1m/s the ticks per sampling time oscilate between 1 and 0, that can give the PID controller an oscillation of 100% speed to work with, even at higher RPMs the difference can still be 25% between measured and actual speed.
This makes the wheels very jittery at low speeds.

Soution:
Instead of using ticks per time, use time per tick and take its reciprocal, we have an accurate reprentation of time per tick recording the time that happens between each interrupt.
For low tick count motors like mine this makes a world of a difference and the wheels turn A LOT smoother.

I cant test Alfred but the changes to the firmware should basically be the same, I could add that If you want to merge this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant