got it flying now want to tune it.
« on: February 10, 2016, 04:29:18 am »
Hi:
I have built a emax 250 nighthawk. It has a CC3D FC, I used Openpilot to set it up.
I used settings from a 250 racer for the initial pids that was in Openpilot, so not defaults.

I am still learning to fly it in attitude mode, but have tried rate mode as well.
Both modes seems fairly stable to quick changes to pitch/yaw/roll and it can hover nicely. (Mostly attitude mode because I am not good enough to fly in rate mode yet).
I am not into flips and rolls, just something stable relatively easy to fly (I can fly a Syma X5C pretty easliy)

As I get better at flying it I am noticing that changing the roll/pitch/yaw will cause the quad to go up or down quite a bit by 8ft or so.
I am not sure its not just pilot error or it needs some tuning.

For example I can have it hovering 6ft off the ground really stable, give a little roll then straigten out. This can have a big effect on the altitude,
mostly likely it will drop, then I give a tiny bit of throttle and will go up about 8 ft, and it takes a bit to get the up/down movement under control.

Can anyone tell me if some tuning is necessary or if this is normal.
If tuning is necessary which to tune first P, I or D. I have read tons on things about tuning, seems like black magic.

I have attached a photo of the drone. I think its pretty well balanced.

The weights in the front are taking the place of a run cam thats on order.

It weighs 550g with the battery.
Currently has 5/3 props but waiting for replacement 6/3 props (crashed on first flght)

The current pids are
Rate Mode (should not matter cause I am only trying attitude mode)
Roll Pitch Yaw
P: .00240 .00330 .00810
I: .0070 .00950 .01060
D: .000032 .000043 .000050

Attitude Mode
Roll Pitch Yaw
P: 2.3 2.6 2.5
I: 0.0 0.0 0.0

Attitiude Response is
Roll Pitch Yaw
55 55 35

Throttle curve is default.

Maybe none of these matter since it seems stable just goes up and down?
« Last Edit: February 10, 2016, 04:59:02 am by just4fun »

Re: got it flying now want to tune it.
« Reply #1 on: February 10, 2016, 06:37:25 am »
Switch over to Libre pilot. It's the same interface but a better firmware plus they have an Emax pre setup template instead of using the zmr or mxp230 or qav pids.
5" alien 4s 596grams with battery and GoPro FPV
Lantian LT210 4s 604grams with batt and GoPro FPV
GE X220 4s 6" 513grams with batt and HD cam FPV
Homemade acro X copter. 6" 4s - like a warpquad LOS

Mateusz

  • *
  • 808
Re: got it flying now want to tune it.
« Reply #2 on: February 10, 2016, 08:50:59 am »
Few things to try
  • I would try CruiseControl mode on the thrust instead of Manual.  It attempts to maintain a steady altitude when turning or banking by slightly increasing the rpm to counter the slight decrease in lift.
  • Retune your PIDs with LP, do not alter outerloop (attitude), just tune inner loop (rate). As I understand this outerloop is a combination of inner and outer, so you always tune inner one even if you fly only Attitude mode only. I see you have interval (I) all set to zero, not sure how it affects altitude, but it seems wrong to me.
    Please check table at the bottom of this page https://librepilot.atlassian.net/wiki/display/LPDOC/Stabilization+Configuration
    It shows which coefficients are used for which mode. Just leave outerloop default and tune inner.

I also saw you use rubber bumpers under flight controller. If that works for you fine don't bother :) but from my little experience it was making things worst for me. Although this might be irrelevant for your altitude problem, you might want to try using nylon screws and tightening your frame(be careful not to break it). I think it might be better than bumpers. If that does not solve your vibrations problem, you can increase filtering (AccelTau). Are these bumpers really good idea ?

About tuning "black magic" the order of PIDs you tune is explained in this tutorial

There is also EasyTune module which makes tuning simpler
https://librepilot.atlassian.net/wiki/display/LPDOC/TxPID

But try CruiseControl first and fix those "I" PIDs :)
« Last Edit: February 10, 2016, 08:56:34 am by Mateusz »

Re: got it flying now want to tune it.
« Reply #3 on: February 10, 2016, 10:56:35 pm »
Switched to LibrePilot, used emax pids.
Seems a bit more stable and more friendly.

I have not tried cruise control for throttle yet, but will try that next.

A question, to slow the responsivness  (to learn to fly the thing), I would just reduce the attitude responsivenes slider to make the QUAD not react so fast to controls, correct?


Re: got it flying now want to tune it.
« Reply #4 on: February 10, 2016, 11:28:01 pm »
Yes. Correct. On the basic tab the sliders kind of describe the response you should expect. Like snappy or insane. You want it slid to the left mostly. But the Emax pids in auto level/attitude are pretty docile already in bank one.

Maybe try the expo(also in the basic tab) and try 15-30% on pitch and roll. None or 15% on yaw. Some people like expo some don't. Personally I need to have it. Especially with the high rates I run.
Negative numbers increase the response.(more response with less stick) and positive kind of softens the reaction when you move it. Especially around the mid stick area. making it easier to control if you have heavy thumbs.

When I was learning. The throttle expo or curve was the biggest help to me cause I was finally able to really control my altitude precisely. And I dropped the attitude numbers to like 35 or 45 and ran 30% expo, so I could go full stick forward and get a feel for turns. And some speed without being out of control.  Then it's a good idea to start to increase them because you will never fly around with your stick pegged forward. But that got me confident enough that I could fly patters (circles and fig. 8s). Then once I was getting ballsy and started to do dumb stuff I would turn up the rates till it was kind of awkward again and get comfortable with it again. Repete as necessary.
« Last Edit: February 10, 2016, 11:51:55 pm by NicholasDavid »
5" alien 4s 596grams with battery and GoPro FPV
Lantian LT210 4s 604grams with batt and GoPro FPV
GE X220 4s 6" 513grams with batt and HD cam FPV
Homemade acro X copter. 6" 4s - like a warpquad LOS

Re: got it flying now want to tune it.
« Reply #5 on: February 11, 2016, 12:09:16 am »
Nicholas
When you say 15-30% expo on pitch and roll what does that mean.?
I think there are 2 or 3 values you can adjust on those curves, but everyone just refers to a single number for expo, I am a little confused.
« Last Edit: February 11, 2016, 12:48:34 am by just4fun »

Re: got it flying now want to tune it.
« Reply #6 on: February 11, 2016, 12:50:03 am »
Set the pitch/roll/yaw expo and flattened out the throttle curve around 50% mark.
Much easier to fly, now I can learn without worrying about crashing or losing control all the time.

Re: got it flying now want to tune it.
« Reply #7 on: February 11, 2016, 04:00:21 am »
Yes on the right hand side of the basic tab you will see a graph and some small slider below, set pitch and roll to 30-ish 35 %(some like more, some like none) and yaw to a little less and save.

And set the throttle expo/curve, the graph on the vehicle tab, hit advanced. It should be a stright line to 90. You want the first and last ball to read 0.00 and 90.0. And the other 3 you want around the hover point. So when you take off your hovering and your at say just under half throttle. Set the 5 balls to  something like 0.00-40.0-50.0-60.0-90.0. Example; One of my quads runs 6045 props and hover is like 1/4,1/3 throttle so that curve goes 0.00-30.0-40.0-50.0-90.0.
5" alien 4s 596grams with battery and GoPro FPV
Lantian LT210 4s 604grams with batt and GoPro FPV
GE X220 4s 6" 513grams with batt and HD cam FPV
Homemade acro X copter. 6" 4s - like a warpquad LOS

Re: got it flying now want to tune it.
« Reply #8 on: February 13, 2016, 03:25:32 pm »
Glad I found this post. Just built a Qav250...Tried flying it and it was a disaster. Found this post, made some adjustments as you stated.... 100% difference. Question now, My roll and pitch are set at 30 and my yaw is 15...my throttle is set at .00 .30 .40 .50 .90, as you stated yours were. If you decrease your numbers towards zero, does that make it respond quicker, or do I need to go more the other way. I also have an F450, will these numbers also work with that or would they be a little different because it is a bigger bird? Thanks in advance.

Also, on the basic configuration, the Attitude, rate and rate yaw sliders, what should those be started out at?
« Last Edit: February 13, 2016, 03:30:53 pm by TonyO511 »

f5soh

  • *****
  • 4572
    • LibrePilot
Re: got it flying now want to tune it.
« Reply #9 on: February 13, 2016, 03:33:20 pm »
The 90% max for Throttle curve comes from templates, you can set the max to 100% now.

Go into Vehicle tab en hit the Reset button for curve or change the max manually.

Re: got it flying now want to tune it.
« Reply #10 on: February 13, 2016, 06:02:20 pm »
Glad I found this post. Just built a Qav250...Tried flying it and it was a disaster. Found this post, made some adjustments as you stated.... 100% difference. Question now, My roll and pitch are set at 30 and my yaw is 15...my throttle is set at .00 .30 .40 .50 .90, as you stated yours were. If you decrease your numbers towards zero, does that make it respond quicker, or do I need to go more the other way. I also have an F450, will these numbers also work with that or would they be a little different because it is a bigger bird? Thanks in advance.

Also, on the basic configuration, the Attitude, rate and rate yaw sliders, what should those be started out at?


I would just use the sliders on basic tab and move them up.

Re: got it flying now want to tune it.
« Reply #11 on: February 13, 2016, 07:33:46 pm »
Look at the bottom and left side of the throttle expo graph. One says input and one say output. The first bubble is at 25 stick I believe so if you set the second bubble to 30. At 25% stick input you get 30% actual throttle output and so on. You just want the three middle numbers to be around your hover point when it was a stright line graph. The third number should be close to where your your stick is when you hover. I usually just go 10-15 up and set that number and down 10-15 and set that number. And that's it.
   Higher attitude slider will make it quicker to your stick movements(roll/pitch). Negative expo will make it more sensitive to your stick movements. More P gain will make it more responsive as well. But that's getting into tuning and it needs to be set right.
    I would just play around in the basic tab until you see how changes effect things. Keep one of your flight modes all slow and docile so if you get into trouble you can hit a switch and have simple easy control again.

The expo and throttle curve settings for the other copter may be just fine with the larger 450 but you may have to adjust a little because it's much larger craft.
I would start with defaults with the 450. either a 350 size or the 400 size , or even the 500 size defaults on the templates in the wizard setup. Then adjust the sliders and the roll/pitch/yaw expo and throttle expo/curve to what you want.
5" alien 4s 596grams with battery and GoPro FPV
Lantian LT210 4s 604grams with batt and GoPro FPV
GE X220 4s 6" 513grams with batt and HD cam FPV
Homemade acro X copter. 6" 4s - like a warpquad LOS

Re: got it flying now want to tune it.
« Reply #12 on: February 13, 2016, 07:51:45 pm »
Thank you....I'll give it a shot.

Re: got it flying now want to tune it.
« Reply #13 on: February 19, 2016, 08:11:46 pm »
If you get an increase in altitude when you move the sticks, and that is usually noticed when you move the sticks around a lot, it is caused by ESC firmware.

Essentially the ESC is much quicker in speeding up the motor than in slowing it down.  If you increase one motor and slow down another, the altitude should stay the same, but result is the FC says:
left=high right=low
left=low  right=high (left was high and starts slowly coming down, right goes high immediately)
left=high right=low  (right was high and starts slowly coming down, left goes high immediately)

You can see that the motors that should be slow are too fast and the fast motors are fast
The result is that it climbs.

For the ESC/s and ESC firmware that you have, you need to use the fastest update rate you can.
490Hz PWM Sync or OneShot or PWM at least.

If you can flash or configure your ESC's, use "light damping" or "active braking", etc.  That tells the ESC that it needs to actually use brakes to slow the RPM down as opposed to just coasting down to a slower speed.