Cleanflight CLI Commands to Improve your Naze32 Performance – Aug 2015

For those using Cleanflight, here are a few CLI commands that might help you improve your multicopter’s performance! Many people are running these now and having good feedback.

I shared this in the MI group originally (Multicopter International – my facebook group), but some people complained searching for it is impossible, so i am putting them here on my blog too.

Please read what these commands do before applying on your Naze32 flight controller.

set deadband=6
set yaw_deadband=6
set emf_avoidance = 1
set acc_hardware=1

Both “deadband” settings can reduce TX yaw, pitch and roll jitters (either caused by user error or problematic hardware), making your quad fly smoother when there is no user input. Depends on how bad your sticks fluctuates, value 4 or 6 should be enough.

“emf_avoidance” was originally designed to avoid electro-magmatic interference that are harmonic frequency to the Flight controller processor speed. When this parameter is set to 1, it changes your processor speed (increases it, to be exact). Be aware that this setting will disable the USB port on a CC3D, so all settings can only be done via mainport with an USB-serial adapter. I don’t have a CC3D to test this.

“acc_hardware”, when set to 1, it disables your ACC (Accelerometer sensor), therefore your horizon/angle modes WILL STOP WORKING! But it frees up more processing power for calculations! Do not use this command if you have to rely on self-level mode for flying.

As an interesting experiment, I set “looptime” to 0 in CLI. It doesn’t mean looptime will be 0, but the Naze32 will run at the lowest possible looptime, which normally is around 1200. with “acc_hardware” set to 1, the lowest looptime dropped all the way to around 320! I then set “emf_avoidance” to 1 as well, looptime dropped further to 290.

naze32-hand-size-compare

However, it doesn’t mean you can run your looptime this low. With lower looptime you will have more noise problems, not to mention gyro sensor can only get a new sample value every 1000us, when your looptime is lower than 1000 you will be likely to reuse the previous old gyro value, so there is no obviouls benefit of using lower looptime than 1000 at the moment. I recommend running looptime higher than 1200 on the current stable cleanflight release (1.9), for more reliable performance.

So what’s the point of increase the processing speed of the Naze32 if you cannot go very low in looptime? The answer is stable looptime. You will notice at any looptime greater than 1000, it’s become very stable, and doesn’t fluctuate up and down like crazy before.

Having said that, some newer FC like the Dodo or SPRacing F3 claim to have much better processing power than the Naze32, but how useful is that going to be if looptime is limited by the gyro sampling rate? Correct me if I am wrong, maybe it allows you to run more hardware and do more stuff at the same time. But if I am just going to fly acro without any other gadgets, then I don’t see I need to move away from Naze32 just yet.

42 thoughts on “Cleanflight CLI Commands to Improve your Naze32 Performance – Aug 2015

  1. Keith Palazzola

    Hi Oscar- My micro 130 armattan flips violently as I increase throttle. Naze32 has arrow forward, props on correct.

    I was told to disable the barometer in cleanflight to see if this stops the madness. I can’t find a way to disable the baro. Any ideas?

    Reply
  2. R0b

    Oscar, you’re site has been very useful for me as a beginner. I appreciate your time, efforts and contributions (as I’m sure others do, as well).

    Reply
  3. Paul Wieland

    Hi Oscar,

    Are you certain the naze32s gyro can only refresh at 1khz?

    The datasheet for the MPU6050 says it can refresh at 8khz. If thats true then there could be a reason to run a naze32 in 2 or 4khz mode (which it supposedly can do if all extra processes are disabled)

    Reply
    1. Oscar Post author

      it’s always been the case hasn’t it? :)
      lastly, i would really appreciate it if you could post your questions on the forum in the future: http://intoFPV.com … I don’t want to miss your comment, because I only check my blog comments once a week, but I use the forum daily!

      Reply
  4. Garth

    Hi Oscar,

    I’m getting a cycle time of 212 on my CC3D using your settings. I found that luxfloat PID controller gives me 290 and mwrewrite gives me 212.

    Reply
  5. Stefan

    set emf_avoidance = 1 is only needed when using a UHF long range system.
    It overclocks the µC from 72MHz to 80MHz, because the 6th hamonic of 72MHz is 432MHz which is right at the UHF frequency.
    It’s only to reduce the noise floor at the UHF band.

    Reply
  6. Relic

    Hi Oscar,

    Is the value for deadband/yaw_deadband for each side, or the whole range? For example, will “set deadband = 6” zero all stick values from -3 to +3, or from -6 to +6? Thanks for all the great info!

    Reply
    1. Oscar Post author

      with the cleanflight 1.10, try disabling ACC and set looptime at 1000… if you want to keep ACC on, set looptime at 2000 should be pretty good too.

      Reply
  7. Giorgi

    Hi Oscar,

    Just wanted to point out that acc_hardware needs to be set to *5* according to Cleanflight docs to disable accelerometer

    Reply
  8. Daz

    Hi Oscar.
    Great write up as usual. I’ve been thinking of creating a glossary of all of the Cleanflight commands so that it is easy to reference and program via the CLI. You have created a good starting point with your blog.

    Reply
  9. Papayou

    Hi Oscar,
    I try lower looptime to 1200 but i do not see any difference vs 2000.
    Setup
    cleanflight 1.9
    pid controller 1
    naze32
    kiss esc one shot
    one shot enable in naze32
    flight mode acro
    Papayou

    Reply
  10. Greg W

    Hi, great info; I will try these settings out. I flashed a cc3d with cleanflight and got it to work via PWM with the latest firmware. Waiting on a PPM receiver but still wanted to get get PWM to work so all my ships/equipment can migrate to cleanflight. I have a nighthawk running emax blheli 12A esc’s and have them programmed for bi-directional to achieve 3d flight. I am having trouble calibrating the esc’s and am not getting that great song we love to hear so much once calibration is done. They are spinning in both directions, shut off switch is working and I think I have my throttle set correctly; but when I give a little throttle, the motors begin to slowly wind on their own. Any advice?

    Thank you,

    G W

    Reply
    1. Oscar Post author

      sorry i don’t have any experience in 3D flying or related ESC settings… please join the facebook group and see if anyone in there knows anything about it (Multicopter International, link: multicopterfpv.com)

      Reply
    1. Oscar Post author

      HI Zapf
      i tested it with latest version of Firefox looks fine to me? what version are you using? and what OS? have you tried clear browser cache maybe?

      Reply
      1. mikymouse

        Hi Oscar, same here, I had to copy/paste your code on a text editor to see the text. I’m running firefox 40.0.3 on the latest MAC OSX

      1. Kevin Yang

        I had great success tail pid because of your new cli.
        Tail performance is really better than before.
        Thank you very much Oscar.

    1. Oscar Post author

      HI Mihael,
      i think that depends on how many LEDs, i haven’t done any testing on this so unable to answer. But if you turn ACC off, and set looptime larger than 1000, the effect should be negligible.

      Reply
  11. Nicholas

    I set my CLI as you mention above

    set deadband=6
    set yaw_deadband=6
    set emf_avoidance = 1
    set acc_hardware=1
    set looptime = 0
    save

    Lowest Cycle time only 1000 ? did u miss something ?

    Reply

Leave a Reply

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

Are you Robot? *

I don't look at blog comments very often (maybe once or twice a week), so if you have any questions related to multirotor please post it on this forum IntoFPV.com... You're likely to get a response from me faster on there.