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
Fix setting pid denom #13535
Fix setting pid denom #13535
Conversation
haslinghuis
commented
Apr 16, 2024
- Fixes CRAZYBEEF4SX1280 fixed DSHOT300 and 4kHz PID Loop when Bidirectional DShot is enabled on Betaflight 4.5 #13534
Do you want to test this code? You can flash it directly from Betaflight Configurator:
WARNING: It may be unstable. Use only for testing! |
betaflight/src/main/config/config.c Lines 719 to 732 in 7c8a552
|
I've tested it by adding #13535 as commit on flashing Betaflight 4.5 dev and for me it works! After enabling bidirectional DShot in the configurator, I am now still able to change the esc/motor protocol and I can lower the PID Loop frequency. Changes are persistent after pressing save, thank you! Tested it on 2 builds, both had the same issue and both are now fixed. |
@haslinghuis : the test for 4k loop is not necessary? |
On the test target pid_denom is set to 2 after enabling dshot telemetry. |
betaflight/src/main/config/config.c Lines 726 to 729 in 7c8a552
strange way to write 'ceil()' |
yes, that is a bug. But it will also remove test to prevent denom==1. MIN(2, pid_denom) will fix the obvious bug. The 4k test may be from old CPUs and not necessary |
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.
fixes the bug
@haslinghuis : 4000/3600 is pretty arbitrary, maybe you can keep 4000. I mixed it up with 4k PID loop time .. |
7938927
to
70fe623
Compare