-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
BF3.2 on BFF3 FC 100% CPU load with dynamic filter #3585
Comments
@stellarhopper , dynamic filter is very processor intensive, so if you want to use it on F3 you'll probably need to reduce your gyro/pid loop. Try 8K/4k or 4K/4K. |
Gyro loop of 4k is max when using dynamic filtering. |
We could indeed add a guard against it
Op 21 jul. 2017 12:41 schreef "rav-rav" <notifications@github.com>:
… Gyro loop of 4k is max when using dynamic filtering.
This seems to happen a lot, maybe the gyro loop should be adjusted
automatically.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#3585 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AKQlhIIb_YhRrjQLyFkpCBFTmyjcRkuMks5sQIA7gaJpZM4OfEhn>
.
|
I'm using Betaflight F3 FC on BF 3.2 with Dynamic Filtering, 8k/8k, DShot600, several features enabled (telemetry, LED strip and OSD). CPU usage at 55% and it is flying without any issue. |
I'm using Airmode too, but on switch. CPU usage might be higher, but everything seems to be okay. |
I noticed this in your snapshot, it might actually caused you the problem? Filesystem: Fatal - no FAT MBR partitions |
Hm, maybe you are right. This does not seem right though: Edit: Sorry average load for SERIAL is 0.5%, only max was high. |
@wolverin3 could you please upload your diff dump? |
@rav-rav , not 8kHz gives 125us per gyro loop. Which means that gyro runtime + max other runtime must be less than 125. So this won't work at 8kHz. The |
@lunohod , here it is: diffBetaflight / BETAFLIGHTF3 3.2.0 Jul 18 2017 / 20:57:50 (cd5e57e)name Wolverine feature LED_STRIP set dterm_lowpass_type = PT1 set rc_rate = 150 tasks00 - ( SYSTEM) 9 7 2 0.5% 0.5% 2 versionBetaflight / BETAFLIGHTF3 3.2.0 Jul 18 2017 / 20:57:50 (cd5e57e) |
@borisbstyle et al. Is it really necessary to adjust notch filters at full rate ? Min limit can be enforced to eliminate bandwidth reduction. |
@Saxin What do you mean with "adjust notch filters at full rate"? |
I didn't looked at the code... yet from this issue I got impression that you are performing FFT and adjusting dynamic notch at each PID loop cycle - this is what I mean when saying "adjust notch filters at full rate" |
@Saxin FTT is done with each Gyro Cycle |
Ok, so my proposal holds even more now - is this needed ? what are you doing with all that bandwidth ? |
Feel free to Implement FTT unsynced from Gyro Loop! |
FFT is not calculated in each loop cycle as a whole. The calculation is already split into 4 steps in order to reduce CPU time per cycle. One such step takes up to 25µs. If you run at 8kHz all operations (gyro, pid, rx, osd,...) need to finish in 125µs. If you don't use each cycle to calculate a step but for example every second step, you'd still hit the time restriction every second cycle. FFT is also already calculated on downsampled gyro data at 1kHz to reduce complexity. |
@Saxin , as @rav-rav says, FFT calculation is already split into steps and each step must complete within one gyro loop. Splitting it into more steps would make the calculation less efficient and so detriment the performance on F4 and F7 processors. If you want to use dynamic notch on F3, then you need to reduce your gyro update rate to 4kHz or less. I'm closing this issue, since it is a limitation of the performance of the F3 processor and not a problem with the implementation. |
Okay thanks for the clarification. |
If I turn off dynamic_filter, the load drops to ~45%. I have most other features turned off. I did have crash_recovery set to on, but even without that, the load fluctuates between 95% and 100%.
Full config dump:
https://hastebin.com/yamexowene.pas
Commit ID: e955fa9
The text was updated successfully, but these errors were encountered: