Thread Tools
This thread is privately moderated by Cervanchez, who may elect to delete unwanted replies.
Dec 27, 2012, 03:22 AM
Habitual Line Stepper
Cervanchez's Avatar
Thread OP
Discussion

Naza Gain Effects


Background:

So, this part of the Naza manual has always baffled me:

STEP1: Basic Parameters
“To the gains of Pitch and Roll, if you release the Pitch or Roll stick after command stick, multi-rotor should be back to hovering state. If the reaction of multi-rotor in this procedure is too soft (large delay), please increase the basic gain slowly (10%-15% each time) until vibration emerges after you release the stick. Then decrease the gain a little until vibration just disappears. Now the gain is perfect, but the reaction of the attitude change is slow. You can follow the way introduced at the end of this section to tune the attitude gains….

…Attitude gains determine the reaction speed of attitude from command stick, the bigger the value the quicker the reaction. Increase it for sharper and quicker leveling action after command stick released. Unstable shaking flying and the control feeling will be stiffness and rigid if the value is too high; and sluggish leveling action and slow braking if too small.”


So, my understanding from explanations on rcgroups of the Naza basic and attitude gains were that the basic gains affect the reaction of the multi to outside influences (like wind), and the attitude gains affect the reaction to stick input. This was, however, hard for me to see or feel while tuning in flight. Then re-reading the manual several times it seemed to contradict itself. In both paragraphs about basic gains and attitude gains it mentions reaction of the multi AFTER RELEASING COMMAND STICK. This also was different from any other multi FC’s I’ve flown, where normally the basic gains affect the reaction from the gyros and give the basic angular rate stability, and the second set of gains affect the reaction to the accelerometers controlling leveling action. In this setup, the basic gains can affect flight performance in both modes, but only the accelerometer gains affect flight performance in Attitude mode. See link for reference PID tuning info.
http://wiki.openpilot.org/display/Do...ng++Multirotor
The Naza gains seemed to be an intertwined mixture of the two. So I set out to analyze what exactly each gain affects.

Test setup:

I constrained the multi to rotate about the roll axis only, by tying it between supports on strings. I then attached an accelerometer to the Naza, and fed the output into my EagleTree data logger in hopes of producing charts like the first attachment.


This shows a PID controller response to a step input. The setpoint is the desired output, and the three plots show different responses. The response on the left would correspond to high gains, with fast response but fast oscillations. The one on the right would correspond to low gains, with slow, sluggish response. The middle is the ideal response, quick, with minimal overshoot, and good stability. The problem with the Naza is determining what the setpoint is.

My initial hypothesis would be that the basic gain’s setpoint is the angular rate or rate of rotation about an axis, so not necessarily how fast it rolls, but how fast it gets to and stabilizes at the desired roll rate. The attitude gain’s setpoint, I would hypothesize, is the tilt angle of the multi.

To maintain consistency and create a step input, I programmed mixes for my throttle and aileron channels to switches on my tx. One switch I mixed so that when I flip it I get about 40% throttle, this would ensure the same throttle setting for each test run. The second one I mixed to a 3 position switch so that middle position is center stick, and when I flip it in either direction I get about +/-75% deflection of the roll stick. This gives instant and consistent roll inputs for each test run.

I programmed my basic and att gains to sliders for easy adjustment while testing. The plan consists of varying each gain setting independently and testing at 50, ~75, 100, ~150, and 200% settings and for each and every combination thereof.

Results:
The results of the test runs are best summarized by a video showing first: holding attitude gains constant at 100%, while varying the basic gains, then second: holding basic gains constant at 100%, while varying the att gains.

Video of the runs:
Naza Gain Effects (0 min 0 sec)


For those that cannot view due to copy write issues, heres the non-music version:
Naza Gain Effects sans music (10 min 52 sec)


Graphs:
The graphs did not pan out like I had hoped but they still give some insight into the workings of a multi fc and why they need more than just accelerometers to accurately measure tilt. The problem was, that the g-forces felt by the accelerometer due to bouncing and rotational accelerations were too large in relation to the gravitational constant g-force, which I am using to measure tilt angle. The resulting graph is shown in the second attachment.

A more complex setup would be needed with the following improvements:
1) Constrain the multi better to reduce bouncing,
2) Add a gyro to measure angular acceleration and remove those effects from the plot.
3) Faster sample rate
4) Add filtering to reduce vibration and bouncing noise in the data.

Regardless, I think the video is enough to draw some very useful conclusions.

Conclusions:

Basic gains:
I believe the basic gains affect the fc’s control of maintaining the current state, i.e. angular position as well as rate …. Effect of varying basic gains are: The lower the gains, the slower (delayed) the reaction to any inputs, outside or pilot. The higher, the quicker and more responsive it is to all inputs,

Attitude Gains:
It is pretty obvious that the att gains affect the reaction to control stick inputs. This includes both deflection of a stick as well as release of the stick. So, the higher the gain, the faster it will tilt when the stick is tilted and the faster it will return to level, when the stick is released, even if not fully released. For lower gains it’s the opposite. These gains only affect attitude mode.

Pro’s:
Naza is very good at leveling and maintaining a steady heading.
Only allowing two tuning parameters keep it simple and easy for beginners.

Con’s:
There is no independent adjustment to reaction to stick input and stick release. Therefore, if you want fast stick response, the multi will level just as quickly when you release the stick even a little. If you want slow leveling, your reaction to stick inputs decreases dramatically. If you want slow leveling with fast stick input response like I do, then you’re SOL. This is the Naza’s major drawback from my perspective with the type of flying I do. The Naza is no good for sport flying (FFF and banked turns) because it always wants to level and fights against you. This would seem to be an easy FW upgrade to allow this adjustment, but it may be part of DJI’s mysterious master plan, who knows. But, in my opinion, this simple addition would make the naza unbeatable, with the best of all worlds.

[Update: It flies much better in Att mode for me than GPS, I've realized. GPS mode is where I feel it fighting against me. I use att mode for most my flying now and only switch to GPS if I want to stay in one spot. I'm pretty happy with how it flies in att mode now, although a little more tune-ability would be great.]

Overall:
Don't get me wrong I love my naza, but now I know to only use it for slow and level AP flying where it shines. It's ease of setup and GPS functionality are the best currently out there in the same price range. The addition of a couple more tuning parameters would make it unbeatable. You can still get around pretty good with it, you just won't get smooth, fluid turns while in forward flight, unless you don't let off the stick throughout the entire turn. There's still always manual mode, where you can do most any type of flying you want. It will even do flips and rolls pretty well, although, with no angular rate adjustment, you wont get quick, Warthox style flips. Still pretty fun though and I would still recommend this fc to anyone getting into multis.
Last edited by Cervanchez; Jun 23, 2013 at 02:48 PM. Reason: Add overall conclusion
Sign up now
to remove ads between posts
Jan 18, 2013, 10:21 PM
Registered User

Sweet!


Thanks man, this is definately the info I needed. I appreciate the time you put into this.

Sin
Jan 22, 2013, 04:57 PM
Habitual Line Stepper
Cervanchez's Avatar
Thread OP
Glad I could help
Jan 27, 2013, 12:10 PM
Registered User
How can I see difrence between high gain and low gain in the "vertical basic gain" I feel that my quad goes up and down and cant stay at the same altitud. Then, I am trying to do some videos and the wind afects alot the flight. It shakes alot. My basic gains are 140 for pitch and roll, 100 for yaw and vertical, 100 for atti gains. Maybe should I lower the pitch and roll and increase the vertical. Its hard to see a diference. When you mean that the atti gains dont afect in manual mode and just in Atti mode does that include GPS mode? thanks
Sorry for my bad english
Jan 28, 2013, 07:47 AM
Habitual Line Stepper
Cervanchez's Avatar
Thread OP
Yes you are on the right path. If its shaking, try lowering pitch and roll basic gains. And for vertical, try increasing your gain. There is also an issue with light affecting the barometer, (and therefore altitude hold) that is fixed by placing black electrical tape on the left side of the naza. And yes, atti gains affect both Atti mode and GPS mode, just not manual mode. Hope this helps.
Feb 13, 2013, 08:53 PM
RC Aircraft Noob Since 01-2012
I am having problems with Vertical Oscilations; here is a video:
Naza Quad Vertical Oscilation - Diagnosis? (0 min 0 sec)


Could it be that my power setup is too much? I did not have this problem with the 2212-900kv 1045 prop combo on the same setup.

Tried vertical gains from 60-140. most controllable at around 85 but still bouncy.

Flies great on the horizontal. This last bit to tweak and this quad is done. Thanks for any input.

And GREAT POST btw! Thanks so much!
Feb 13, 2013, 11:22 PM
Habitual Line Stepper
Cervanchez's Avatar
Thread OP
Well it would appear that the gains are too low. Usually slow oscillations like that are because the copter is not responding quick enough. Although 140 seems pretty high, I would keep trying higher. Program the vertical gains to a knob or slider on your tx and set it up so you can go higher to like 200. Then raise it in flight to see if you can get it to shake, then back off a little until the shakes go away.
I've never had to do this with vertical gains because the stock settings worked fine for me, but that is the standard procedure for gain tuning on all multicopters. It's also how the manual explains it. Hope that helps.
Apr 03, 2013, 08:04 PM
Alien Invader!
I was looking for clear gains descriptions, and not only are these clear, they're realistic about clear things can get - or not Great job on the experiments & vid. Thank you!
Apr 15, 2013, 10:20 AM
Registered User
Hi, I just finished a scratch built frame with NAZA/GPS and I was just trying to fine-tune the gains since the wind has finally died down (0mph). I set the gains to a pot on my TX with the center position at my guess for the correct figures. Then I hovered about 15' up and began testing. With the pot set to the pitch gain, I turned the gain all the way up and then put the right stick in the full forward position and let it snap back to center. When it tried to recover, it would oscillate a lot. I reduced gain until this quit and it recovered into a very stable state. I repeated this for roll and yaw. The yaw axis was a little different. What I found easiest was to turn the gain all the way up and push the throttle up quickly. This caused a very unstable climb with the quad violently tipping. I reduced the gain until it was stable.
What I'm having trouble with is the altitude gain. There doesn't seem to be any real significant difference when I change the value. I notice that if I put the quad into a pretty extreme maneuver, like a spiral induced by left rudder and left aileron, the altitude drops and gradually seems to recover. I was playing with gains up to maybe 200. I think I settled around 140, but there was no clear indication that this was correct. What is the process for setting the best altitude gain?

For the attitude gain, I did the same thing by increasing the gain and then giving full stick letting it snap back and reducing gains until it was stable and smooth. Everything seemed clear except for the altitude.

Any ideas?
Apr 15, 2013, 01:09 PM
Habitual Line Stepper
Cervanchez's Avatar
Thread OP
Actually I haven't done much with the altitude gain because I was pretty happy with how it was performing with my first setting. I am geatting a steady altitude hold although it does vary when maneuvering. From what I've read, that's normal and I never really expected it to stay locked in altitude all the time. As long as it isn't oscillating up and down when stationary I would say its about as good as you're going to get it.

I wish I could be more help but maybe others on the Naza thread have more to add.
Jun 01, 2013, 11:10 AM
Registered User
First off, great thread. The gains were a complete mystery to me based on the manual alone, so thank you for posting this!

I'm running 20A Simonk ESCs + 1200kv motors and 8x4.5 props on a HT Flip FPV 450 frame.

My first question is, what effect should the vertical basic gain have? I tried everything from 50 - 200% and it didn't appear to have an effect at all while just hovering in ATTI mode. It never oscillated up and down or anything. I set it to 150%, but I have no idea if it's right. What symptoms would the quad have if the gain were too high? Should I just set it all the way up?

My second question is that it seems like the goal is to set the gains as high as possible without having any oscillation in any direction. Since the remote gain channels are limited, is it best to adjust them one at a time? Is there a particular order that they should be adjusted in? Should I isolate each gain by setting all gains at 100% and adjust just one to a value then put them back to 100% and go to the next one, etc? I'm not sure if one gain can have an effect over another...

Last, I was able to set the attitude pitch & roll gains all the way at 260% before I got any oscillation after stick input (I guess this is because of simonK firmware). The quad is super responsive, but my gopro video quality is pretty bad. So is it fair to say that the gains should be a balance for those of us doing FPV or shooting video?

Sorry for so many questions!
Jun 04, 2013, 04:51 PM
Habitual Line Stepper
Cervanchez's Avatar
Thread OP
1st question: Well I can't help much on the vertical gain because I never really messed with it much but it sounds like the effect is not as pronounced as the other gains, so as long as it holds altitude within the published specs, I would not worry about it. You can try going all the way up and see if it does anything and let me know.

2nd question: I start with the recommended gains per the Naza manual and start with adjusting basic gains,. I put roll/pitch on a slider or knob, then increase in the air until it oscillates/shakes, then back off a little. For yaw, I increase until it doesn't wander and then leave it there. If you go too high on yaw it will affect pitch/roll/altitude. You can increase it until you see it start to "jump" or do wierd things when you yaw , then back off a little. Then after the basic gains feel good, then adjust your att gains to your flying preference. Higher att gains will make the quad handle snappy and will be very responsive to stick inputs, while lower gains will make it mellow and docile.

BTW, there is a way to adjust the limits of the remote gains, but I forget exactly how and am not in front of my setup right now. I think you can set your knob/slider to the mid position, then manually set the gain midpoint to where you want in the assistant sw, say 100 for example, then when you enable remote gains that is your midpoint and you can adjust +/- 50% with the knob/slider. If thats not enough adjustment, disable remote gains, then repeat, but this time set the midpoint at say 150%, then you can adjust +/- 50% from there. Hopefully that makes sense.

Last question: refer to the 2nd paragraph regarding att gains.

Hope that helps. Good luck
Jun 21, 2013, 04:43 PM
Registered User
Hi guys, very good post!
I have my nasa for almost 2 years now, I have tried many different frames but I am having a hard time with my new QAV400...
When I yaw a bit hard to the right and only the right, left is good, it starts to drop very badly like if the front right motor was stopping...

Any idea?

here is my setup:


roxxy 2827-34 , graupner 10", lipo zippy compact 35C 2700mah

last gains 140% 155% 75% 190% et atti 115% 125%

Cheers.

Pierre
Jun 24, 2013, 08:13 PM
Registered User
I discovered what vertical gain affects: descending!

I noticed when I would descend straight down (throttle at 1/4 or less), my quad rotor would oscillate badly. I turned the vertical gain down and it got much better. It seems to have no affect on ascending, only descending...
Jun 25, 2013, 10:08 AM
Habitual Line Stepper
Cervanchez's Avatar
Thread OP
That's interesting. Thanks I'll keep that in mind to try if I get that problem.


Quick Reply
Message:
Thread Tools

Similar Threads
Category Thread Thread Starter Forum Replies Last Post
Discussion Gain adjustment on dji Naza bembill Multirotor Drone Talk 10 Jul 18, 2014 12:30 AM
Help! NAZA Basic and ATTI mode gain question, which one do I use on AUX3 on my DX8 jasper7821 Multirotor Drone Talk 48 Mar 22, 2013 08:33 PM
Question gyro gain has huge effect on piro rate?! js32257 Mini Helis 4 Aug 16, 2012 10:44 PM
Question Prop Type - Any Effect On Gain? UPDATE: RESULTS Earl E Adobtr Aerial Photography 5 May 19, 2012 12:12 PM
Discussion The Naza FC and Gains % adjustments SeniorSpan Multirotor Drone Talk 1 Mar 08, 2012 10:44 AM