CleanFlight better performance

I am currently experimenting how to get better performance of my CC3D and CleanFlight. I will share my experience so far and which settings can you change in order to improve your copter’s flight performance. Please note, that I am not an expert like Dominic, Boris or all others CleanFlight developers. Big Thumbs Up for their work on CleanFlight firmware! If you find something wrong, please do not hesitate to correct me.

Main goal is to achieve a the lowest working loop time value. The loop time (in μs) is the time, while:

  • Read data from flight controller sensors (Gyro/Acc etc.)
  • PID calculations done
  • Signal output to the ESC

Your goal in a nutshell: get all three things done in less time.

Disable Accelerometer

If you don’t need the self-level modes like “Angle” or “Horizon” and only fly in Rate mode (Acro), you can disable the accelerometer. How this helps to achieve a lower loop time value? I think it is because of the output data rate of the accelerometer. It has an output data rate of 1kHz. Otherwise the gyroscope has much better output rate of 8kHz. So instead of getting new sensor data at every 1000μs, the MCU get new data at every 125μs. Your flight controller have the most fresh gyro data, which give you much better flight performance. To disable the accelerometer, go to the “CLI”-Tab and type following:

set acc_hardware=1

Save

Overclock Processor

The processor speed of all F1 and F3 flight controllers, like the Naze32 or CC3D, is 72MHz. You can overclock the processor to 80MHz. You should get slightly lower looptime by doing this. In the “CLI”-Tab type following:

set emf_avoidance=ON

Save

This setting has completely other purpose*, but is useful for our goal.

* Some pilots use modules on 433MHz. However the 6th harmonic of 72MHz is 432MHz. So your radio module can cause electromagnetic interference and affects the work of your processor. By overclocking it to 80MHz, the 6th harmonic is 480MHz and should not interference with 433MHz modules.

Overclock I2C

This feature is merged from Betaflight. You need the latest Cleanflight firmware 1.11 RC1 to overclock the I2C bus speed. This will allow faster communication with the gyro. Standard bus speed is 100kHz and fast-mode bus speed is 400kHz. If you do have a CC3D flight controller, you don’t need to set this feature. The CC3D has a MPU6000 connected over the faster 1MHz SPI bus. For Naze32 type this:

set i2c_overclock=ON

Save

By setting all these features I got a loop time of 191μs, which is awesome.

Cleanflight_Set_Looptime

So far I have only tested a loop time of 1200μs in flight, but will set the loop time to 250μs and test it in flight. If you have already done it, share you loop time and experience.

  1. I’m no stranger to the Naze32 /CC3D probably been through 15-20 FC’s so far! Lots of crashing/lost quads in various places, I’m persistant! But I fly LOS acro and never saw the need to bother with loop times. Now I’m interested since I’m now into FPV.
    Two questions. I’m assuming this will work with a Naze32 since its the same processor, and have you had to retune your PID’s after changing loop times?
    Thanks

    1. If you are using the Luxfloat PID controller, then – no. On any other PID controller you will need to retune. If you dont want to tune and do all the things manually, you can also try the Cleanflight fork – Betaflight from BorisB.

Leave a Reply

Your email address will not be published. Required fields are marked *