In order to run 32KHz gyro sampling rate on F4 flight controllers, you first need to overclock your FC. In this article I will how you how to do it, and explain the pro’s and con’s of doing it.
Update (Feb 2019): From Betaflight 4.0, it will no longer support 32KHz. There are benefits of running 32KHz, it reduces latency but it also increases noise. In order to reduce noise we’d have to use additional filtering, which introduce latency back (or even more latency than non-32khz). So the devs think 32KHz is not really worth it as it also uses more processing power we could use for something else.
Enabling 32KHz Gyro Sampling and PID Looptime
You can enable “Gyro 32KHz sampling mode” in Betaflight Configurator, then select the Gyro update frequency and PID loop frequency of your choice.
By increasing the Gyro update rate and PID Loop Frequency (looptime), you will notice an increase in CPU load too.
If you can’t set Gyro Sampling Rate to 32KHz without maxing out CPU load to 100%, then you might want to overclock the flight controller.
Overclock FC in Betaflight
It’s recommended to only overclock if you have CPU load higher than 50% or so. Overclocking FC doesn’t give you any benefits apart from the overhead.
F4 FC runs on 166MHz normally, and it can be overclocked by typing this command in CLI:
set cpu_overclock = 192MHZ save
Allowed clock speed values are: OFF, 192MHZ, 216MHZ, 240MHZ
At the moment, vverclocking isn’t supported in F3 and F7 FC.
Downsides of Overclocking Flight Controller
The downside is that the processor can get a bit warmer (even hot). When the STM32 chip overheats it can “freeze”. It usually shouldn’t be a problem for mini quad because there is adequate amount of air flow to cool it down when flying.
However, you might void the warranty of your FC by overclocking.
At the moment FC overclocking is only meaningful if you run 32KHz Gyro Sampling mode. For FC’s that have MPU6000 gyro, or those who only run 8KHz or slower gyro rate and looptime, there is no benefit of overclocking the flight controller.