Guide: How to set up the RPM filtering
This is short guide on how to set up the bidirectional DSHOT and RPM filtering in Betaflight.
What is RPM filtering?
Technical definition: RPM filtering is a set of 36 notch filters on gyro and (optionally) on Dterm which uses the RPM telemetry data to remove motor noise with surgical precision. By default it runs 12 notch filters each on pitch, roll, and yaw, covering the first 3 harmonics of each motor’s noise signature.
In simple words: RPM filtering is filtering precisely the vibrations of the each of the motor – the main source of the vibrations on quadcopter.
Many pilots say that RPM filtering is by far the best filtering method in Betaflight.
What is bidirectional DSHOT?
Bidirectional DSHOT is a new feature in Betaflight 4.x which lets the flight controller receive accurate RPM telemetry over each motor’s ESC signal line. No additional wiring or additional telemetry back-channel is needed. Telemetry packet is sent back to the flight controller after the each DSHOT command sent to ESC.
Bidirectional DSHOT requires ESC with 32-bit BLHeli_32 firmware or ESC with BLHeli_S and special firmware, supporting the DSHOT telemetry.
BLHeli_32 ESCs have ability to send the ESC telemetry (temperature, eRPM, current) through the separate telemetry wire. But this native BLHeli_32 telemetry is sent in relatively slow speed and cannot be used for RPM filtering. Contrary, the bidirectional DSHOT telemetry data is sent over the signal wire at a much higher speed/pace then the standard telemetry.
Requirements for RPM filtering
You will need the following:
- Betaflight version 4.1 or newer
- BLHeli_32 ESC’s or BLHeli_S with JazzMaveric BLHeli_S patch
- Set up bidirectional DSHOT settings in Betaflight
- Set up the RPM filter settings in Betaflight
Bidirectional DSHOT on BLHeli_32 ESCβs
You need to have BLHeli_32 firmware version 32.7.0 on your ESC’s to turn on the bidirectional DSHOT. To check the version of your ESC firmware you can run the BLHeliSuite32 and read the ESC information.
If your ESC has the firmware less than 32.7, then you’ll need to update BLHeli_32 firmware.
Bidirectional DSHOT on BLHeli_S ESC’s
You need to have special BLHeli_S firmware with bidirectional DSHOT support on you ESC’s. Read the Guid: How to flash BLHeli_S firmware with bidirectional DSHOT.
Selecting the right DFSHOT protocol
Bidirectional DSHOT works with the DSHOT 150, 300, 600 and 1200 protocols. The preferred protocol should be chosen depending on the ESC firmware type, MCU and pid loop time used.
You may select the ESC protocol DSHOT600 if you are using BLHeli_32. Select DSHOT300/150 if you are using BLHeli_S ESC.
For 4k PID loops, eg 8k/4k or 4k/4k, use DSHOT 300 for greatest reliability. For 8k8k setups, you may use DSHOT600. With 8k PID loops, DSHOT300 will only update the motors every second PID loop so this configuration would be not the optimas. With 4k pid loop, DSHOT600 will be updating the motors twice every PID loop with the same values, so this combination does not make sense to use also.
On “H” type ESCs (efm8bb2) DSHOT300 and a loop time of 4k/4k is recommended.
On “L” type ESCs (efm8bb1) DSHOT150 and a loop time of 2k/2k is strongly recommended for highest performance.
Enabling the Bidirectional DSHOT in Betaflight
Now you can turn the bidirectional DSHOT in the betaflight. Just turn the “Bidirectional DShot (requires supported ESC firmware)” slider to On position:
Alternatively you can enable the bidirectional DSHOT by using Betaflight CLI command:
set dshot_bidir = ON
You might need to turn the clock scheduler rate optimization to ON and dshot burst to OFF in the Betaflight CLI:
set dshot_burst = OFF set scheduler_optimize_rate = ON
Don’ t forget to set the motor poles!
ESC telemetry reports the eRPM – the RPM of the motor multiplied by the amount of motor polar pairs. Betaflight needs to know how many poles does your motor have in order to calculate the right RPM. Motor poles means magnetic poles (magnets), so you have to count the number of the magnets in the motor bell.
Alternatively you can set the motor poles in the Betaflight CLI tab:
motor_poles = 14
If you are running the 2205, 2206, 2207 or 2306 motors, then default setting of the 14 motor poles is most likely correct. Smaller motors, like 080x, 110x, 120x most likely will have 12 magnet poles. Anyway to be sure, you need to count the magnets in the motor bell. The number must be even!
Filter settings
By default the RPM filtering enables the 3 harmonics (3 resonant frequencies) filters for every motor and every axis. This makes the total 36 RPM filters. Keep the default settings: 3 RPM filters and 100 Hz minimum frequency.
Lets say the motor spins at 100Hz (100 revolutions per second or 6000 revolutions per minute). RPM filtering adds notch on the 100Hz, 200Hz and 300Hz frequencies (so called fundamental frequency and harmonics).
The RPM filtering will effectively remove almost all the noise from the motors, but some noise from other sources like, wind turbulence bearings or frame resonance will not. So we still need Dynamic Notch filter to be active. Set Dynamic Notch filter range to Medium, Dynamic Notch Width percent to Zero, Dynamic Notch Q to 250 and Dynamic Notch Min Hz to 150.
Setting Dynamic Notch Width Percent to 0 runs only one single narrow notch. This minimizes the filter latency.
These are only the startup recommendations and not necessarily will give you the best results. You should refer to the Betaflight tuning guides or resources on the YouTube for further filter tuning.
Sources used in writing this article:
https://github.com/betaflight/betaflight/wiki/Bidirectional-DSHOT-and-RPM-Filter
2020-01-06 Article created
2020-02-06 DShot protocol recommendations updated
2020-03-02 Basic RPM filter settings
you didnt go over the filter settings
Thanks for the feedback. I’ve added the basic (startup) filter settings.
Thank so much for the great article! Do the specific settings apply to micros (2.5″ in my case) or larger 5″? I have a toothpick build and not sure how to set the Gyro Rpm Filter and Dynamic Notch Filter.
Thanks!
Hi, try with the settings, proposed in the article. Please give back your results as others may also find it interesting.
Hello, sorry for my english… I use a Mamba F722 with ESC 4in1 Diatone official stack (MAMBA F722S STACK-F50PRO 3-6S) when I set bidirectional on BLHeli, when I put a big up throttle stick, I have stop of the fc and the drone fall. I have make all itβs explain in youβre TUTO but this not resolved my problem.
Thanks
Hi, not sure what is causing your problem. Try to disable Bi-directional DSHOT and try again. This will tell you if the Bi-directional DSHOT is to be blamed.
Thanks!
You have a bit of a typo:
“You will need to turn the clock scheduler rate optimization and dshot burst off in the Betaflight CLI:”
Your instruction is to turn these OFF then in the code you say ON. I figured out that you cannot enable bidirectional DSHOT with clock scheduler rate optimization turned off though.
Thanks for your feedback. I’ll double check the article.
‘Lets say the motor spins at 100Hz (100RPM).’
No, 100hz != 100rpm. 100hr = 100 cycles per SECOND. RPM is per revolutions per MINUTE, so *=60. 100hz = 6000rpm.
You are right and I was wrong! 100Hz (cycles per second) = 100 RPS (revolutions per second) = 6000 RPM (revolutions per minute).
Thanks for noticing!
I am running 2 quads with 4.2, rpm filtering, and dshot burst = on, and scheduler rate = Auto. Haven’t had any problems. Where does this apply?
I can’t change filter range from high to med it won’t save.an one no why an what I need to do
Hi! I have an Emax Buzz, I’ve updated the esc to 32.7 successfully, but when I go to Betaflight it just doesn’t allow me to enable bidirectional dshot.. I mean, I can enable and “save”, but after reboot its disabled again. Do you have any idea on what could be the issue?
Thank you very much in advance.
Try entering these commands in the Configurator CLI window:
set scheduler_optimize_rate=on
set dshot_burst=off
set dshot_bidir=on
You’re a genius! It worked… but not it gives me an arming flag DSHOT_BBANG saying: “Likely caused by a timer conflict with other features enabled on the flight controller”..
Is there anything else that I have to disable? (Is it safe?)
Once again, thank you so much for your fast response and your time. π
Try to disable DSHOT bitbang by issuing command:
dshot_bitbang=off
IT WORKED!! π π
Thank you SO MUCH!
I apologize for my ignorance, and I’m sure if you suggested it is because whats going on but, is getting this feature disabled risky by any mean? (I don’t even know what it is to be honest)
It is safe if you get 100% error free rpm telemetry. Check the motors tab.
You can also try to set the
dshot_burst=auto
anddshot_bitbang=auto
alsodshot_bitbang_timer=auto
and let the Betaflight decide what is the best for it. Or you can leave it as it is now if it just works.Other possible options:
dshot_burst = ON
Allowed values: OFF, ON, AUTO
dshot_bidir = ON
Allowed values: OFF, ON
Default value: OFF
dshot_bitbang = AUTO
Allowed values: OFF, ON, AUTO
dshot_bitbang_timer = AUTO
Allowed values: AUTO, TIM1, TIM8
I reply to you here because it doesn’t allow me to reply in the previus conversation for some reason.
It gives me 0% error, so I’ve left it as is. I was able to fly a few packs today and tried to push it a little and everything went well. π
Thank you for all your help!
In an semi-related subject: I have flash a brand new F4 FC with JazzMaverick 16.73 today to be able to use RPM filtering, but after flashing it one of the ESC shows a really weird version and the quad flips over when I armed.
https://www.reddit.com/r/FPVFreestyle/comments/l7xkmh/i_tried_to_install_jazzmaverick_1673_on_my_brand/
I have tried reflashing it but without success.. I keep getting this message:
https://ibb.co/7gHF4zM
do you have any idea is there is a way to “reset” the whole thing?
Thank you so much in advance, and I hope I’m not abusing of your kindness.
Try to flash the BLHeli_s firmware using BLHeliSuite (BLHeli Suite and BLHeli Configurator How To) or JESC Configurator (JESC-Configurator GitHUB)
Hi! I was able to flash it by checking the box on the very last step. Thank you very much!
But unfortunately the quad is still flipping when armed. The motor twitches and doesn’t start spinning no matter how much I raise the throttle.
I’ve switched the position of the motors but the issue remains in the same spot. I’m guessing I have a bad FC. π
Anyways, thank you for all your help!
you got the props on in the right direction?
I hope so. Not sure why do you ask?