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

Motor encoder // Fast EXTI #18

Open
Usioumeo opened this issue May 20, 2024 · 1 comment
Open

Motor encoder // Fast EXTI #18

Usioumeo opened this issue May 20, 2024 · 1 comment

Comments

@Usioumeo
Copy link

Good morning.
Firstly I would like to thank you for this great library.
I'm implementing a motor driver using this lib as a foundation.

Now I have to read the encoder, which consist of 4 wires on which I have to listen to changes (fast changes. Like 40khz). Because of that I don't think the correct way to do this is to get 4 exti-input, await on any change, select them with futures::select and then read what actually changed.
This approach is unstable because rely on embassy task executor, and from one CPU and another could elapse lots of cycles.

Another approach could be to use an embassy interrupt driven executor, but I think isn't supported for this architecture.

Another approach could be to override the exti interrupts handler(if it is possible). But with this I risk to break the other exti interrupts.

In the end I could even remove embassy and implement what I need from scratch, but of course it is one "reinvent thr wheel" approach.

Let me know if I haven't listed all approaches, or if there is one clear winner in your mind.

Keep on the great work👍

@andelf
Copy link
Contributor

andelf commented May 20, 2024

Thanks.

IMHO, using a Timer(encoder) is the correct way to handle motor encoders.

@andelf andelf changed the title Fast EXTI Motor encoder // Fast EXTI May 29, 2024
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