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.
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.
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?
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.
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?
motors connection are in the right order? Try to take off in Acro mode?
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).
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)
set emf_avoidance = on now increase processor speed
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!
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.
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.
Will this also work on Betaflight by BorisB? =)
not necessary on betaflight. But the deadband would still be useful.
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!
it’s the whole range around centre, so for 6 it’s -3 to +3
What looptime would you recommend for RG20As and cobra 2300kv on a naze32?
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.
Just wanted to point out that acc_hardware needs to be set to *5* according to Cleanflight docs to disable accelerometer
Hi Giorgi, I suggest you check again :)
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.
I try lower looptime to 1200 but i do not see any difference vs 2000.
pid controller 1
kiss esc one shot
one shot enable in naze32
flight mode acro
if that’s the case, keep your looptime at 2000 for a better reliability
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?
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)
Something is up with your code tags on firefox. They make the text unreadably small.
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?
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
Do you think this will work with cc3d board with Cleanflight?
yes, should work fine, but don’t use set emf_avoidance = 1
Thank you for your great info!
Pid setting will be same after your new cli?
depends, but think for most cases you can probably tune the PID up a bit :)
So set the looptime=1200 is better than looptime=0(cleanflight 1.9.0)
Is it correct?
it’s safer to use 1200.
I had great success tail pid because of your new cli.
Tail performance is really better than before.
Thank you very much Oscar.
How much driving rgb leds with naze32 add to looptime?
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.
I set my CLI as you mention above
set emf_avoidance = 1
set looptime = 0
Lowest Cycle time only 1000 ? did u miss something ?
you running custom CF firmware?
I am using 1.10 BETA.
that’s why, they limited looptime to min 1000 on that firmware. i was using the official 1.9
great info and article. your flying has improved so much in such short time.
Anyways do u speak 中文？
yes i do :)