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!
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:
2020-01-06 Article created
2020-02-06 DShot protocol recommendations updated
2020-03-02 Basic RPM filter settings