How to compensate for PID induced altitude gain?

Post Reply
User avatar
phenolic
Posts: 81
Joined: Fri Sep 21, 2012 10:31 pm

How to compensate for PID induced altitude gain?

Post by phenolic »

I'm currently running with the default PID settings of 4, 0.030, 23 but I'm having the problem where wind gusts will make the quad gain altitude like crazy. Trying to fly in heavy winds is very difficult because I almost have to completely cut the throttle to stop it from gaining altitude and zooming away. Using a P of 2.5 makes it fly without gaining altitude even in heavy wind but the quad is very squirrelly with that low P.

Is there any way I can keep the higher P but reduce the tendency to gain altitude? Or use a lower P but make the handling more solid?

User avatar
phenolic
Posts: 81
Joined: Fri Sep 21, 2012 10:31 pm

Re: How to compensate for PID induced altitude gain?

Post by phenolic »

Also I forgot to mention that if I shake the quad back and forth with stick movement (eg. aileron or elevator) it rapidly gains altitude also.

To me the problem seems to be a result of a high power light quad and MultiWii is not counteracting additional power on one side with low enough power on the opposite side which results in too much lift.

Can I or D be adjusted to prevent this while still keeping a high P?

tovrin
Posts: 705
Joined: Tue Sep 20, 2011 4:08 pm

Re: How to compensate for PID induced altitude gain?

Post by tovrin »

what board/sensors are you using? you will need a barometer to accurately hold alt.

Chained_Heat_##
Posts: 2
Joined: Fri Sep 28, 2012 11:53 am

How to compensate for PID induced altitude gain?

Post by Chained_Heat_## »

Might not be what you are experiencing but my quad used to randomly surge upwards due to excess vibration.

User avatar
phenolic
Posts: 81
Joined: Fri Sep 21, 2012 10:31 pm

Re: How to compensate for PID induced altitude gain?

Post by phenolic »

This isn't about altitude hold. I'm not using that nor level mode.

It's not caused by vibration as far as I can tell. My MPU-6050 is isolated by foam. In MultiWiiConf I can put max zoom on the gyros at full throttle and there is essentially no vibration whatsoever. I think I would notice problems all the time if it was vibration.

This is when the wind is blowing hard causing many gyro based corrections. Every time it corrects itself it's inducing too much lift and with constant buffeting it will gain altitude very fast. The wind can be blowing downwards on the quad and it still gain altitude very fast. Just shaking the quad will make it shoot up into the air.

Like I said, this behaviour varies with changes to the P parameter. If I set P to 2.5 or 3 it no longer has problems. The higher I make P the worse it gets. If I max P out at 20 it's very stable but any shaking of the quad makes it shoot upwards like a rocket. It seems highly likely to be caused solely by the PID corrections causing too much lift. My quad is relatively light (380g) and powerful (2208 1100kv, 8x4.5 props).
Last edited by phenolic on Sun Dec 23, 2012 3:37 pm, edited 1 time in total.

copterrichie
Posts: 2261
Joined: Sat Feb 19, 2011 8:30 pm

Re: How to compensate for PID induced altitude gain?

Post by copterrichie »

I have never used it however, there is a RATE setting shown next to the PID settings that I understand adjust the PID rate according to throttle position. That may help, but I am not sure because I never played with it.

User avatar
phenolic
Posts: 81
Joined: Fri Sep 21, 2012 10:31 pm

Re: How to compensate for PID induced altitude gain?

Post by phenolic »

copterrichie wrote:I have never used it however, there is a RATE setting shown next to the PID settings that I understand adjust the PID rate according to throttle position. That may help, but I am not sure because I never played with it.


I do use rate depending on the P I'm using. With a P of 4 I use a rate of 0.3. All this does is effectively reduce the P value with more stick input which makes the craft more responsive. For example if you max P out at 20 the craft will be very stable but extremely sluggish in response to stick input. At that level you can give full aileron or elevator and the quad will rotate very slowly. If you then increase the rate value it will remain very stable with no stick input but become more responsive with stick input. As far as I know it won't do anything for my issue though.

There is that TPA value which also effectively reduces the PID depending on how much throttle you're using. This one I'm not sure if it could help or not because I don't think it's really intended for multirotors. It can be used if you have oscillations at high speed, for example on a plane. On a multirotors it might have the opposite effect, making the quad unstable at high speed.

User avatar
phenolic
Posts: 81
Joined: Fri Sep 21, 2012 10:31 pm

Re: How to compensate for PID induced altitude gain?

Post by phenolic »

I think what I need is simply less force on the opposite side of corrections.

Lets say the left side of the quad is pushed down. In order to correct itself it's going to apply power to the left motors and I don't know if it simultaneously reduces power on the right motors but that's what I need or I need even more reduction than what it's currently doing. The problem is my quad is so light the applied corrective force causes the whole quad to move upwards but if it could simultaneously reduce power by the proper amount on the opposite side of the correction then it maybe wouldn't cause as much lift.

I don't know, maybe there is nothing that can be done. My quad is so light that a single motor can easily lift the whole quad. Maybe reducing the opposing corrective force would make it unstable.

User avatar
KasparsL
Posts: 75
Joined: Wed May 16, 2012 3:31 pm

Re: How to compensate for PID induced altitude gain?

Post by KasparsL »

Hi,
i have a thought about this issue. I have experienced something similar, when the minimum throttle for the ESCs was too high - motors spinning too fast in idle. Maybe because of this you get unbalanced corrections?

User avatar
phenolic
Posts: 81
Joined: Fri Sep 21, 2012 10:31 pm

Re: How to compensate for PID induced altitude gain?

Post by phenolic »

KasparsL wrote:Hi,
i have a thought about this issue. I have experienced something similar, when the minimum throttle for the ESCs was too high - motors spinning too fast in idle. Maybe because of this you get unbalanced corrections?


Interesting idea. I wonder what a "correct" idle speed should be. I'm running simonk firmware on my ESC's and have some issues with the motors starting if it's too low. I'm currently using the default MINTHROTTLE of 1150. Maybe I should try the "simonk" 1064 value. Not sure if my motors will start very well with it that low, I'm thinking they may not start at all.

I have about 20 MPH winds right now so I'll test it.

User avatar
phenolic
Posts: 81
Joined: Fri Sep 21, 2012 10:31 pm

Re: How to compensate for PID induced altitude gain?

Post by phenolic »

Well I didn't have any issues with my motors starting although they "knock" a bit when idling that low. However, it did seem to do a whole lot better in the wind. It was still buffeted around a lot but was more "normal" in that it both gained and lost altitude with strong gusts. The throttle also seemed more linear although that could be my imagination.

I'll have to do more testing before I know for sure. I'll really know when I can test in 30 MPH winds again.

Seems good so far, lets hope this fixes it. Thanks!

scrat
Posts: 925
Joined: Mon Oct 15, 2012 9:47 am
Location: Slovenia

Re: How to compensate for PID induced altitude gain?

Post by scrat »

First try 1064 if motors don't turn then try 1080 and then 1100.

Newquadandtri
Posts: 16
Joined: Wed Mar 27, 2013 10:13 am

Re: How to compensate for PID induced altitude gain?

Post by Newquadandtri »

I have this same issue. I did up my minimum throttle in config.h. I'll try to bring it down and test. With P down to 2.5 it is smoother throttle, but slow response and over shoots.

AnthonysQuad
Posts: 54
Joined: Thu Apr 11, 2013 7:37 am

Re: How to compensate for PID induced altitude gain?

Post by AnthonysQuad »

New here but maybe cover baro from wind?

Newquadandtri
Posts: 16
Joined: Wed Mar 27, 2013 10:13 am

Re: How to compensate for PID induced altitude gain?

Post by Newquadandtri »

I fixed my same issue by recalibrating ESC in config.h and going down one on the gyro low pass filter. It flies very good now. No problems whatsoever.

Post Reply