Cleanflight CLI Commands to Improve your Naze32 Performance – Aug 2015

by Oscar

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.

Some of the links on this page are affiliate links. I receive a commission (at no extra cost to you) if you make a purchase after clicking on one of these affiliate links. This helps support the free content for the community on this website. Please read our Affiliate Link Policy for more information.

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.

Leave a Comment

By using this form, you agree with the storage and handling of your data by this website. Note that all comments are held for moderation before appearing.

44 comments

Claudio Duvivier 10th July 2017 - 12:52 pm

Hi Oscar, first thanks for all your posts.
They are very clear and I read them all.

One question I have is that if you run a quadcopter with accelerometer disabled for a long time (let’s say 20 minutes), would the drift of the gyro to grow up to a rate where it could became impossible to fly?

Reply
Oscar 10th July 2017 - 6:10 pm

I can’t answer that question as the longest flight time I have on a mini quad doesn’t usually exceed 8 mins.
But I don’t imagine that would be a problem.

Reply
Keith Palazzola 28th May 2016 - 7:41 pm

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
Oscar 1st June 2016 - 2:47 pm

motors connection are in the right order? Try to take off in Acro mode?

Reply
R0b 20th May 2016 - 5:03 pm

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
Paul Wieland 8th April 2016 - 1:23 pm

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
dudlik 21st January 2016 - 7:38 pm

set emf_avoidance = on now increase processor speed

Reply
Oscar 25th January 2016 - 8:22 pm

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
Garth 4th January 2016 - 11:51 am

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
Stefan 7th December 2015 - 8:37 pm

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
SirHaugen 20th November 2015 - 7:31 pm

Will this also work on Betaflight by BorisB? =)

Reply
Oscar 24th November 2015 - 5:16 pm

not necessary on betaflight. But the deadband would still be useful.

Reply
Relic 3rd November 2015 - 1:51 pm

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
Oscar 4th November 2015 - 7:22 pm

it’s the whole range around centre, so for 6 it’s -3 to +3

Reply
Nerun 26th October 2015 - 5:49 pm

Hi Oscar,

What looptime would you recommend for RG20As and cobra 2300kv on a naze32?

Reply
Oscar 28th October 2015 - 5:26 pm

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
Giorgi 11th October 2015 - 8:01 am

Hi Oscar,

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

Reply
Oscar 12th October 2015 - 11:34 am

Hi Giorgi, I suggest you check again :)

Reply
Daz 15th September 2015 - 1:53 pm

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
Papayou 14th September 2015 - 6:14 am

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
Oscar 14th September 2015 - 5:18 pm

if that’s the case, keep your looptime at 2000 for a better reliability

Reply
Greg W 13th September 2015 - 10:58 pm

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
Oscar 14th September 2015 - 5:14 pm

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
Zapf 2nd September 2015 - 7:44 pm

Hi Oscar

Something is up with your code tags on firefox. They make the text unreadably small.

Reply
Oscar 3rd September 2015 - 5:03 pm

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
mikymouse 10th September 2015 - 10:38 am

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

Reply
Bol2riz 2nd September 2015 - 3:08 pm

Hi Oscar,

Do you think this will work with cc3d board with Cleanflight?

Cheers.

Reply
Oscar 3rd September 2015 - 4:57 pm

yes, should work fine, but don’t use set emf_avoidance = 1

Reply
Kevin Yang 1st September 2015 - 5:53 pm

Thank you for your great info!

Reply
Kevin Yang 1st September 2015 - 5:58 pm

Pid setting will be same after your new cli?

Reply
Oscar 3rd September 2015 - 4:38 pm

depends, but think for most cases you can probably tune the PID up a bit :)

Reply
Kevin Yang 2nd September 2015 - 5:19 am

So set the looptime=1200 is better than looptime=0(cleanflight 1.9.0)
Is it correct?

Reply
Oscar 3rd September 2015 - 4:55 pm

it’s safer to use 1200.

Reply
Kevin Yang 4th September 2015 - 2:33 am

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

Reply
mihael 1st September 2015 - 2:28 pm

Hi Oscar

How much driving rgb leds with naze32 add to looptime?

Reply
Oscar 3rd September 2015 - 3:54 pm

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
Nicholas 30th August 2015 - 2:59 pm

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
Oscar 30th August 2015 - 5:37 pm

you running custom CF firmware?

Reply
Nicholas 31st August 2015 - 4:25 pm

I am using 1.10 BETA.

Reply
Oscar 1st September 2015 - 11:16 am

that’s why, they limited looptime to min 1000 on that firmware. i was using the official 1.9

Reply
michael lee 30th August 2015 - 6:35 am

great info and article. your flying has improved so much in such short time.

Reply
Oscar 30th August 2015 - 5:37 pm

thanks :)

Reply
Nicholas 29th August 2015 - 6:07 pm

Great information.
Anyways do u speak 中文?

Reply
Oscar 30th August 2015 - 5:40 pm

yes i do :)

Reply