-
Notifications
You must be signed in to change notification settings - Fork 553
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
[FEATURE] Hall sensor without interrupt #418
Comments
Looks good to me. I don't think you can drive faster than one update per sector anyway, since the lagging stator field will start decelerating the rotor instead of accelerating it. You have to miss at least 2 pulses before the position is lost, so it would require some fast backdriving before it's a problem. The main place I can see that happening is rolling down a hill on an electric skateboard, and that doesn't need to keep track of absolute position. The main thing you'll lose is accurate timestamps for velocity calculation. May need higher lowpass Tf to average it out, resulting in slower velocity PID response time. Probably not enough to be a problem, though. |
Thanks a lot for your very valid comments. This is more like a fallback mode but I want to make sure it works. |
This is awesome. I can use 41F halls now, which don't need any filtering capacitors. They generate excessive interrupts even if I do add capacitors, but work effortlessly with this new code. I'm getting about 190rad/s top speed. Loop time is around 400us, so 2.5kHz. With 7 pole pairs that's 2500/7/6=59.5 revolutions per second, or 374rad/s theoretical top speed. I don't think nyquist frequency applies here, so I'm not sure why it's maxing out at half, but IIRC that's been about my top speed with other configurations too. |
Happy to hear it's useful, I will check if I can get it in the next release. |
This was released. Thanks again for the feedback. |
I wrote this code some time ago but I haven't published it because I wasn't sure it was useful enough. I am posting it here to get your opinion, specially you @dekutree64 as you did a lot of work on this sensor.
What it does is:
The user can choose if he wants to run it with or without interrupts.
Benefits:
Downside:
The text was updated successfully, but these errors were encountered: