finst

  • *
  • 13
PIDs and wind.
« on: December 21, 2015, 10:17:35 pm »
Hey folks!

Recently I've been trying to bring my latest build into the air. It's a Y6 with following specs:

OP Revo FC
Tiger MT2216 800kv motors
18A KISS escs
11x4.5 (top) & 12x4.5 (bottom) CF reinforced props
8Ah battery
gimbal + gopro

I've come to a set of pids which are totally fine while I'm hovering. Stays rock solid in the air, very smooth. But as soon as there is anything closely to a little bit of wind, even a small breeze, it becomes shaky, goes all over the place and fails to maintain altitude. All in attitude mode.
Normally I'd say there's a problem with the Ki values but on pitch and roll they're 2.5 times Kp and on yaw 1.9 times Kp. Should be enough, right? And lowering the Ki on any axis doesn't change a thing. Even with all Ki values zeroed it shakes in wind. I think compensating the wind is fine (for that there's the gimbal) but this thing goes crazy with shaking. Any ideas?



Greetings from Germany,
finst

Re: PIDs and wind.
« Reply #1 on: December 22, 2015, 01:11:25 am »
First thing I worry about is that I recall that there was a problem with calculation of the hex mixer settings.  You can set them by hand though.

Next thing that comes to mind is whether you are flying it as a normal tricopter with two arms in front and one tail straight back.

After that:
You may have it tuned too "tight".  Try reducing P or I (on both roll and pitch at the same time) to see if you can get a better stability.

Also be aware that you should be running 490 PWM, PWMSync, or OneShot125 for all your esc update rates (output page).

Also, there is a thing called TPS which increases PIDs at low power and decreases them at high power that sometimes helps when you have oscillations in wind or with higher power settings.

I will point this out to some other devs that are more familiar with the hex issue.
« Last Edit: December 22, 2015, 07:34:27 am by TheOtherCliff »

Re: PIDs and wind.
« Reply #2 on: December 22, 2015, 07:04:41 am »
The above discussion assumes that you do have "Vehicle -> Air Frame Type" set to "Hexacopter Y6".  If not, make that change and press Save and test it.  :)

Also, when tuning PIDs you must be aware that pitch is stronger than roll in a Y6 because the tail has full leverage, plus both front arms have 0.5 leverage for a total of 2.0.
Roll just has two motors at 0.866 (cos(30)) for a total of 1.732
But the default mixer table seems to cut the power of pitch by a factor of 2...

If you have been through all the above checks and want something else to try, try setting Vehicle to Custom, pressing the Save button, and then setting the mix like this screenshot and pressing the Save button again.

Please test very cautiously and be aware that this is a guess based on the way that I think the mixer table should work, and I may be wrong.

Also, it may be better that the roll values are 127, 127, -127, -127 to strengthen the roll axis and allow you to use the same PIDs for roll and for pitch.

Again, this is just what makes sense to me mathematically and I may be wrong.
« Last Edit: December 22, 2015, 07:33:50 am by TheOtherCliff »

f5soh

  • *****
  • 4572
    • LibrePilot
Re: PIDs and wind.
« Reply #3 on: December 22, 2015, 11:21:03 am »
Y6 mixer values are untouched since years and looks wrong...

Using the same method used for HexaX, Hexa+ and all octocopters mixer should looks like that:

Code: [Select]
Mixer table Hexa Y6
---------------------------------------------
Motor:     1         2          3          4          5         6
ROLL   {64.00,  64.00, -64.00, -64.00,  -0.00,   -0.00}
PITCH {64.00,  64.00,  64.00,  64.00, -128.00, -128.00}
YAW   {-64.00, 64.00, -64.00,  64.00,  -64.00,   64.00}
---------------------------------------------

f5soh

  • *****
  • 4572
    • LibrePilot
Re: PIDs and wind.
« Reply #4 on: December 22, 2015, 01:14:24 pm »
You do not need to switch to Custom Mixer.

Try setting mixer sliders like that and it matches the Cliff's custom mixer.


finst

  • *
  • 13
Re: PIDs and wind.
« Reply #5 on: December 22, 2015, 09:59:26 pm »
Thank you guys for the answers! That's the spirit that's been missing from the OP forums for quite a while now! Nice to have you back! :-) :-) :-)

@post#2:
Exactly, it has two arms in front and one backwards.
Well, and of course I've not messed with the mixer configuration the GCS gave me.
Since it does the shaking with stock pids too (they're way lower) I assumed lowering either P or I doesn't help.
And sorry I forgot to mention the esc update rates. They're of course OS125.
TPS is disabled until now because that setting seemed like some kind of fine tuning to me and this behavior has nothing to do with fine tuning.

@post#3:
Yes, of course the airframe type is set to Hexa Y6.
As mentioned I used the stock mixer settings for Y6.
Having the same pids for roll and pitch is not important to me.

@post#4:
Okay, so these settings appear to be different from Cliffs settings.

@post#5:
Yeah, I think I understand the connection between the mix table and the mix level sliders.
I can get to both your and Cliffs values with them. But which one are the correct mix settings for a Y6?
« Last Edit: December 22, 2015, 10:04:08 pm by finst »

f5soh

  • *****
  • 4572
    • LibrePilot
Re: PIDs and wind.
« Reply #6 on: December 22, 2015, 10:21:15 pm »
Yeah, I think I understand the connection between the mix table and the mix level sliders.
I can get to both your and Cliffs values with them. But which one are the correct mix settings for a Y6?

Try the two settings :
Roll- Pitch- Yaw
86 - 100 - 100
50 - 100 - 50

And see if react better.


finst

  • *
  • 13
Re: PIDs and wind.
« Reply #7 on: February 17, 2016, 02:58:04 pm »
Hey folks!

I've been out testing your mix settings for a while now and I think it's time to share my conclusions.
1. Both of the new mixer settings seem to work better than the stock settings. With both settings I noticed that much, much lower pids are needed.
2. Although the cog is very much centered with the gimbal not attached, the pids with the 50-100-50 mixer where not the same on pitch and roll axis. With the 86-100-100 mixer they were.
3. Additionally with the 86-100-100 mixer the altitude drift was less than with the 50-100-50 mixer.
4. Despite the 86-100-100 settings seem to work better, it is not optimal in windy conditions (wind gusts max 15 mph, which is actually not much). Flying in attitude, pitch and roll axis both show oscillations when the hex tries to compensate a wind gust or when I induce short and fast stick input on roll or pitch. This effects smoothens when I turn rate Kp all the way down from e.g. 0.012 to 0.004 but then I guess the aircraft becomes not really flyable?! Another thing I tried was to increase rate Kd from e.g. 0.00002 to 0.00012. That gets rid of the oscillations but the hex then behaves like a noodle in a soup. The one and only purpose of this rig is to carry a gimbal and a gopro, so its not supposed to be a super snappy fpv racer but a slow, smooth and stable camera platform which remains kind of stable in light wind.

Did I miss something here?