PID controllers / autopilot stability
Moderators: Guru's, The Ministry
PID controllers / autopilot stability
I was thinking of posting this a while ago, but since an issue to do with autopilot stability was brought up in another thread, I thought it might be useful to make a short post on Proportional Integral & Derivative (PID) controllers. I cant claim to be an expert in this area or that what I have put here is 100% accurate, but hopefully it might help some people to sort autopilot niggles. A PID controller is a very common form of control device containing three terms; proportional, integral and derivative. As part of a closed loop (feedback) control system, these terms each have a "gain" which determines how they effect the control system. If the gain is zero, it is equivalent to that term being missing from the controller. In the real world, they could be implemented by various circuits built around a 741 Operational Amplifier (Op-Amp) chip.
On the x axis of all four graphs is time, t=0 being when the desired level (this could be an altitude, heading speed etc in the case of the autopilot) is selected. On the y axis is the variable to be set, the "desired level" being what has been asked of it, e.g. 20,000ft on an autopilot. The proportional term is the basic term of the controller. If used alone it will never quite achieve the desired level, but will have a steady state error. The addition of the integral term eliminates the steady state error but may introduce an overshoot/ undershoot of the desired level. An integral term can be used alone to bring the variable to its desired level slowly but with no overshoot. The introduction of the derivative term in a PI controller can help to alleviate overshoot and undershoot and bring the variable to its desired level quicker.
If the gains are set incorrectly then an instability may occur. Possible undesirable situations include the failure of the control to acquire the desired level at all, a steady oscillation about the desired level or worst off, oscillating divergence.
To reduce the time taken for the desired level to be achieved, try increasing the Proportional gain.
To reduce the time taken for the desired level to be achieved when it is already close to it, try increasing the integral gain.
To reduce the time taken for the variable to settle out to its desired level, try increasing the derivative gain.
To alleviate a large overshoot of the desired level, try reducing the proportional and integral gains.
If an instability occurs, try reducing all gains and start over!
Obviously there are other factors that influence the whole control system and so there are no magic combinations of gains that will work for all systems!
On the x axis of all four graphs is time, t=0 being when the desired level (this could be an altitude, heading speed etc in the case of the autopilot) is selected. On the y axis is the variable to be set, the "desired level" being what has been asked of it, e.g. 20,000ft on an autopilot. The proportional term is the basic term of the controller. If used alone it will never quite achieve the desired level, but will have a steady state error. The addition of the integral term eliminates the steady state error but may introduce an overshoot/ undershoot of the desired level. An integral term can be used alone to bring the variable to its desired level slowly but with no overshoot. The introduction of the derivative term in a PI controller can help to alleviate overshoot and undershoot and bring the variable to its desired level quicker.
If the gains are set incorrectly then an instability may occur. Possible undesirable situations include the failure of the control to acquire the desired level at all, a steady oscillation about the desired level or worst off, oscillating divergence.
To reduce the time taken for the desired level to be achieved, try increasing the Proportional gain.
To reduce the time taken for the desired level to be achieved when it is already close to it, try increasing the integral gain.
To reduce the time taken for the variable to settle out to its desired level, try increasing the derivative gain.
To alleviate a large overshoot of the desired level, try reducing the proportional and integral gains.
If an instability occurs, try reducing all gains and start over!
Obviously there are other factors that influence the whole control system and so there are no magic combinations of gains that will work for all systems!
Last edited by TobyV on 26 Oct 2006, 23:25, edited 1 time in total.
- speedbird591
- Battle of Britain
- Posts: 4038
- Joined: 24 Jun 2004, 05:56
- Location: Wiltshire, UK
- Contact:
And your point being, Toby?
Actually, I'm seriously impressed here. Dunno what you're talking about or what I ought to do about it, but I'm seriously impressed, sir.
Ian
Actually, I'm seriously impressed here. Dunno what you're talking about or what I ought to do about it, but I'm seriously impressed, sir.
Ian
visit Speedbird 747.com
- Garry Russell
- The Ministry
- Posts: 27180
- Joined: 29 Jan 2005, 00:53
- Location: On the other side of the wall
- speedbird591
- Battle of Britain
- Posts: 4038
- Joined: 24 Jun 2004, 05:56
- Location: Wiltshire, UK
- Contact:
Garry's just worried whether it's in the correct forumGarry Russell wrote::k:
Garry
visit Speedbird 747.com
Ha ha, wasted on this uncultured lot.
I should point out that I asked Toby to post his explaination of PID systems in another thread way over yonder ->
I didn't even know what a PID was, but I do now.
If you look in aircraft.cfg you will see mention of proportional, integral & derivative in the [autopilot] section.
Now, what was the first bit again...
I should point out that I asked Toby to post his explaination of PID systems in another thread way over yonder ->
I didn't even know what a PID was, but I do now.
If you look in aircraft.cfg you will see mention of proportional, integral & derivative in the [autopilot] section.
Now, what was the first bit again...
BTW most FS aircraft use proportional & integral, which may explain why the average FS aircraft captures the ILS like in the second of the four pictures.
Not bad, but it could perhaps be better.
I tried using the derivative settings before (Trident autoland), but it never seemed to do much.
Never really knew what it was for though.
DM
Not bad, but it could perhaps be better.
I tried using the derivative settings before (Trident autoland), but it never seemed to do much.
Never really knew what it was for though.
DM
- speedbird591
- Battle of Britain
- Posts: 4038
- Joined: 24 Jun 2004, 05:56
- Location: Wiltshire, UK
- Contact:
OK, done that. I chose the Tinmouse as it is excellent at intercepting the ILS without weaving. Here is the relevant excerpt:MALTBY D wrote:If you look in aircraft.cfg you will see mention of proportional, integral & derivative in the [autopilot] section.
nav_proportional_control=15.00
nav_integrator_control=0.125
nav_derivative_control=9.0
nav_integrator_boundary=0.50
nav_derivative_boundary=5.0
gs_proportional_control=25.00
gs_integrator_control=1.00
gs_derivative_control=0.00
gs_integrator_boundary=0.50
gs_derivative_boundary=0.00
So is this all the FDE writer has done to improve this aspect of FS9? I guess it can't be quite so straightforward otherwise everybody would have done it
EDIT: The Tinmouse does rely on using the FSUIPC module quite a bit. Perhaps this is the magic ingredient.
Ian
Last edited by speedbird591 on 26 Oct 2006, 23:35, edited 1 time in total.
visit Speedbird 747.com
Ok to sum it up in a nutshell, and I'm typing this after a few beers, this stuff is in the aircraft.cfg and it affects the way your autopilot works (in each a/c). If you select a particular altitude and it takes a long time to achieve that alt, e.g. perhaps your a/p overshoots its designated altitude or is slow to repsond or perhaps it oscillates about the altitude you have input; these variables control how your autopilot behaves and assuming M$ have defined the mathematics correctly, it should behave like a real-world PID controller... which is how a basic analogue autopilot would probably behave. If the likes of DM and RP understand it, you have nothing to worry about