-
Notifications
You must be signed in to change notification settings - Fork 18.2k
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
AP_Periph: add ESC_RATE parameter to RC_OUT peripherals #27406
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will need careful testing of dshot. set_freq() can easily mess with the DMA setup resulting in dshot issues. In particular the order of calls is important
How would issues manifest? |
I'm not a fan of the param name. Feels like it needs a "PWM" in it instead of RC |
It is slightly wonky but I took the name from the other vehicles. If we are changing the name I personally would call it ESC_SPEED to fit with the other parameters on periph. |
6a60683
to
27b6db2
Compare
Rebased on top of #27444 . It looks like the call to In any case, the new version has been tested in flight using both 400Hz Normal PWM and DShot600 with a BLHeli_S ESC and performed great in both cases. I also had a 50Hz servo attached to a different timer on the periph to make sure that functionality still worked. Verified the correct PWM waveforms on the scope too. |
Like other vehicles (which use RC_SPEED), ESC_RATE is used to set the PWM output rate for outputs whose functions are set to MotorN so that ESCs can be driven at a fast speed (400Hz, same default as aerial vehicles) while servos still run at normal speed (50Hz, controlled by OUT_RATE).
27b6db2
to
4888500
Compare
Like other vehicles (which use RC_SPEED), ESC_RATE is used to set the PWM output rate for outputs whose functions are set to MotorN so that ESCs can be driven at a fast speed (400Hz, same default as aerial vehicles) while servos still run at normal speed (50Hz, controlled by OUT_RATE).
Tested the PWM outputs with real devices and a scope. Also tested that PWM and DShot600 still fly well.