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

Max speed #10

Closed
yo90bosses opened this issue Mar 7, 2020 · 1 comment
Closed

Max speed #10

yo90bosses opened this issue Mar 7, 2020 · 1 comment

Comments

@yo90bosses
Copy link

I'm working on a self balancing robot and it will have encoders on motors (two of them) and my choice is between a 13 and 500 cpr encoder and the motors will spin at a max of 20000rpm.
So I'm expecting up to 250000 pulses per motor to the ESP32. Can the library handle the 500cpr encoder or is that too fast?

@madhephaestus
Copy link
Owner

madhephaestus commented Mar 7, 2020

Runt pulses will be filtered out that last less than 250 ticks of APB_CLK cycles. APB_CLK usually runs at 80mhz a 4x divisor off the system frequency. you need to do some math on your end based on your configuration, but the library's critical value is 250 ticks of the APB_CLK is the minimum pulse time, and assume at least double that speed to be stable. So the minimum pulse is calculates
(250*2)/APB_CLK = minimumUs per pulse

See https://docs.espressif.com/projects/esp-idf/en/latest/api-reference/peripherals/pcnt.html#filtering-pulses for more information on filtering.

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

No branches or pull requests

2 participants