Export to GitHub

ardupirates - issue #38

GPS Hold: Integrator limiter evaluation


Posted on Jun 18, 2011 by Massive Hippo

Here I provide a little analysis and discourse of what I think is incorrect about the way how the I-term is limited.

I flew with settings P:0.015, I:0.005 and D:0.010. I noticed that the quad is very nervous and overshoots significantly. With I:0.005 I could not keep the GPS Hold on, because it was swaying 15 meters side to side. Dangerous. I:0.001 significantly reduced this condition, but it was now hovering around the setpoint in a circle of a certain radius between 1-2 meters.

The I-term is formed by multiplying the accumulated error with the I-gain. The accumulated error is limited to some value X. In my experiments, I recorded the gps_lon_I and gps_lat_I on the DataFlash, together with the gps_lon_D terms.

MOD:GPS Hold mode GPS:20.00,1.00,102.00,6.00 GPS:80.00,-40.00,40.00,-43.00 GPS:120.00,-88.00,-19.00,-6.00 GPS:230.00,-130.00,69.00,6.00 GPS:300.00,-221.00,-40.00,-50.00 GPS:360.00,-269.00,-9.00,42.00 GPS:350.00,-249.00,-69.00,67.00 GPS:360.00,-168.00,20.00,62.00 GPS:470.00,-13.00,101.00,75.00 GPS:690.00,159.00,109.00,18.00 GPS:980.00,333.00,69.00,0.00 GPS:1200.00,427.00,-49.00,-79.00 GPS:1200.00,385.00,-99.00,-134.00

The first two terms are the integrated values, the last two terms are the D-terms. The P and D settings here are not ideal, so that must be taken into account. Weather was relatively quiet, so more aggressive P and lower D would have been better.

In gusty wind conditions however it is not unlikely that the quad temporarily reaches 1 meter difference, especially at some higher altitudes. The way it returns (or fails to return) is I believe mostly attributable to the I-term development. The I-term @ 1m difference saturates in 10 iterations the way the limiter is currently set to 1200. An I-gain of 0.005 then results in a fixed tilt angle of 6 degrees, which only reduces in size as soon as the quad overshoots. 0.001 results in a tilt angle of 1.2 degrees. These angles are only reduced as soon as the quad overshoots (and it can be observed and calculated that it will overshoot). I think this is too aggressive a setting, so there are two issues I dealt with.

The I-term is supposed to resolve bias and to speed up the return to a particular setpoint. ( bias occurs when for example there is wind and a certain angle is needed to remain in position. This will be downwind when only a P-term is used, but the I-term will slowly bring the quad back to the real intended position. With P-term decreasing there, it shows how P and I work together to remain roughly at the right spot all the time).

I intend to resolve this (so have not yet tested) by setting the limiter max value to 12,000 and pre-multiplying the I-gain with 0.1. This should provide a better settings range for the I-term that can be set by the configurator, should reduce overshoot and should increase stability.

Status: New

Labels:
Type-Defect Priority-Medium