-
Notifications
You must be signed in to change notification settings - Fork 52
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
Servo jitter #22
Comments
Hi Ivzo, I have seen this behavior before and it was related to the servo library used and the way the library uses interrupts. Let me explain: A servo will position itself based on a pulse width generated by the servo library. The library starts a timer within the STM32 with a start value based on the required pulse width (=position of the servo) which will generate an interrupt when the pulse time is expired. Because IbusBM also uses interrupts (for communication) there may be multiple interrupts at the same exact moment. As interrupts typically can not happen at the same time, one needs to wait for the other. This may result in a pulse width that is not exactly the same. The IbusBM interrupt control routine relinquishes control back as soon as possible (allowing another interrupt to go ahead anyway, even if the interrupt of IbusBM is still busy). This is by design to reduce jitter as much as possible and IbusBM does not need to be as real time as a Servo pulse, but just needs to be able run at least once per millisecond. In most cases this works well, except maybe in your case. Other reasons this may happen is, when you are reading of writing to Flash memory. Some chips allow you to define interrupt priority: which means you can tell the processor to give priority to an interrupt that is more time critical (such as the pulse width for the servo). I think there are 4 options for you to address this issue: There was another discussion on this topic here: #20 Hope this helps regards Bart |
Thank you. I've changed the board and find another thing... |
Hi. I have WeAct 3.0 STM32F411 and when use only IBusServo connected the servo and run an example everything works perfect. But when i added IBusSens the servo started to jitter ((
Can you give some advice how to solve?
The text was updated successfully, but these errors were encountered: