Could use some help tuning my altitude pid

This forum is dedicated to all issues and questions related to your individual setups and configurations
Post Reply
brandon3055
Posts: 16
Joined: Fri Aug 01, 2014 6:47 am
Location: Tasmania

Could use some help tuning my altitude pid

Post by brandon3055 »

Im hoping someone can help me out with this i am trying to set the altitude pid but it seems the tutorials i am finding are ether outdated ore inaccurate.

This is the tutorial i have been trying to follow.
http://www.multiwii.com/wiki/index.php?title=Altitude_PID
I have looked at a few others but they are essentially the same.

The First problem is it says to increase D from 0 in 0.2 increments until you start to get a slow yo yo movement. But D has increments of 1 not 0.1
I tried to follow the instructions anyway with increments of 2 instead of 0.2 but i cant get the mentioned yo yo movement i even tried setting it as high as 70 just to see what would happen and it seemed to hold its altitude fairly well but that's about it. (I was almost tempted to just leave it at that but i want to do it properly)

Im hoping someone can help me out with this or point me to an updated tutorial.

brandon3055
Posts: 16
Joined: Fri Aug 01, 2014 6:47 am
Location: Tasmania

Re: Could use some help tuning my altitude pid

Post by brandon3055 »

Is there none who can help me with this?
Im really stuck any help would be much appreciated.

brewski
Posts: 483
Joined: Tue Apr 29, 2014 12:04 am
Location: Cleveland Qld Australia

Re: Could use some help tuning my altitude pid

Post by brewski »

brandon3055 wrote:Is there none who can help me with this?
Im really stuck any help would be much appreciated.
\

Tuning Altitude hold in Multiwii
The Barometer sensor is used to detect the altitude of your multirotor aircraft and is used for altitude hold mode. As the barometer sensor is not very precise and is quite noisy, detection of small up and down movements is impossible.

So small up and down movements are detected by the accelerometer Z axis. Combination of these two sensors gives good altitude hold.
PID settings for ALT works like this:

P - Is how much the multirotor should rely on the barometer sensor. The higher the value is the stronger the multirotor relys on the Barometer reading.
I - Is used to compensate for drift caused by battery voltage drop during the flight. The higher the value is more the multirotor will react to voltage drops ( or other varying factors over time).
D - Is how strong the multirotor should react to data from the accelerometer Z axis. It is used to react to small up and down movements that the barometer cannot accurately sense. The higher the value is the stronger the multirotor will react to small altitude changes.

Tuning:

We need to start from settings the Accelerometer.

1. So set the P and I to 0

2. Start to play with D value only. To high D may cause yoyo effect (up and down oscillations). With to low D copter will be not able to react strong/fast enough to hold altitude. Your goal here is to set D to the value when copter don't oscillate up and down and also holds altitude quite well for a not very long period of time. Copter will not hold altitude perfectly at this point during long periods. It will slowly drift up or down, but altitude should be quite stable in short periods.

3. Start to increase P to the point where copter holds altitude over long time period. If the value is to small the copter will drift slowly up and down. If the value is to high yoyo effect may appear. Goal here is to set it to the point where copter holds altitude for quite some time. Copter will still go slowly down due to battery voltage drop over time.

4. "I" is used to compensate the voltage drop. So start to increase the "I" value slowly until you get a perfect position hold during a very long time.
Now your altitude hold should be good enough.
Logged



brandon3055
Posts: 16
Joined: Fri Aug 01, 2014 6:47 am
Location: Tasmania

Re: Could use some help tuning my altitude pid

Post by brandon3055 »

Thankyou that is all the information i need

Post Reply