Advanced autopilot tuning tips: Difference between revisions

From FlightGear wiki
Jump to navigation Jump to search
m (copy/paste editing (verbatim copy from mailing list discussion) http://www.mail-archive.com/flightgear-devel@lists.sourceforge.net/msg25859.html)
 
m (Robot: Cosmetic changes)
Line 9: Line 9:
iteration the controller sees an error but has no 'trend history'  
iteration the controller sees an error but has no 'trend history'  
to know how effective its correction is, and so may command the max  
to know how effective its correction is, and so may command the max  
correction. As the aircraft responds to the initial correction  
correction. As the aircraft responds to the initial correction  
though, the controller gets feedback upon which it then gauges the  
though, the controller gets feedback upon which it then gauges the  
correction for the next iteration.
correction for the next iteration.
Line 49: Line 49:
airspeeds you might need the Pitch-hold controller to be pretty  
airspeeds you might need the Pitch-hold controller to be pretty  
brutal and almost driving into oscillation but at high speeds you  
brutal and almost driving into oscillation but at high speeds you  
need it to be much more delicate. However, judicious use of  
need it to be much more delicate. However, judicious use of  
filters and variable gains can usually get you around most  
filters and variable gains can usually get you around most  
problems.
problems.
Line 58: Line 58:
initially worked, I think it may have become broken at some point  
initially worked, I think it may have become broken at some point  
and the rate at which the controllers and filters operate depends  
and the rate at which the controllers and filters operate depends  
more upon the frame rate than anything else. Because the rate at  
more upon the frame rate than anything else. Because the rate at  
which the controllers work is critical, depending upon the gains  
which the controllers work is critical, depending upon the gains  
used, a controller that might be stable on one system might become  
used, a controller that might be stable on one system might become  
unstable on a slower, or even sometimes a faster system (I've seen  
unstable on a slower, or even sometimes a faster system (I've seen  
this sort of problems happen both ways).
this sort of problems happen both ways).

Revision as of 20:45, 30 November 2010

This article is a stub. You can help the wiki by expanding it.

In response to this question, see [1] for original response:

Note: For the time being, this is taken verbatim from the FG-Devel mailing list archives.

The large initial deflections you can get when switching between different controller cascades seems to occur because on the first iteration the controller sees an error but has no 'trend history' to know how effective its correction is, and so may command the max correction. As the aircraft responds to the initial correction though, the controller gets feedback upon which it then gauges the correction for the next iteration.

There are a number of ways around this, from limiting the flight control surface rate, either in the FDM config, or by inserting a filter between the output from the controller and the control axis input of the FDM, to filtering the target inputs, to using common pid controllers in the control hierarchy.

I ended up using a three controller hierarchy in some aircraft, with the same lower-level controllers being used by all modes and which were always engaged; only the top level controllers were switched.

For example, for altitude-hold I might have the following hierarchy:

       Altitude-hold: generates a target climb-rate in FPS from the
       difference between the current altitude and the target altitude.
               Climb-rate-hold: generates a target pitch angle from the
               difference between the current climb-rate and the target
               climb rate generated by the Altitude-hold controller.
                       Pitch-hold: generates an elevator deflection from the
                       difference betwen the current pitch and the target
                       pitch generated by the Climb-rate-hold controller.

but then I'd use the same Climb-rate-hold and Pitch-hold controllers for the glideslope-hold hierarchy and just switch the Top level Altitude hold controller off instead of duplicating the entire hierarchy again.

Because the lower-level controllers are running continuously and are not switched on and off they've got some trend history data to be working with and this seems to ameliorate the problem by effectively buffering the top-level input change.

This type of hierarchy isn't without its own problems though; at low airspeeds you might need the Pitch-hold controller to be pretty brutal and almost driving into oscillation but at high speeds you need it to be much more delicate. However, judicious use of filters and variable gains can usually get you around most problems.

There is one type of autopilot problem that's more difficult fix though: the autopilot controllers and filters should run at a constant rate and although a <rate> parameter was added and initially worked, I think it may have become broken at some point and the rate at which the controllers and filters operate depends more upon the frame rate than anything else. Because the rate at which the controllers work is critical, depending upon the gains used, a controller that might be stable on one system might become unstable on a slower, or even sometimes a faster system (I've seen this sort of problems happen both ways).