PID controllers / autopilot stability

A quiet place for budding model makers to share thoughts, get answers to questions and request and share references.

Moderators: Guru's, The Ministry

User avatar
TobyV
Vintage Pair
Vintage Pair
Posts: 2862
Joined: 26 Jun 2004, 20:41
Location: Halfway up a hill

PID controllers / autopilot stability

Post by TobyV »

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.

Image

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.

Image

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.

User avatar
speedbird591
Battle of Britain
Battle of Britain
Posts: 4038
Joined: 24 Jun 2004, 05:56
Location: Wiltshire, UK
Contact:

Post by speedbird591 »

And your point being, Toby? :lol:

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 :smile:

User avatar
DaveB
The Ministry
Posts: 30457
Joined: 17 Jun 2004, 20:46
Location: Pelsall, West Mids, UK
Contact:

Post by DaveB »

Seconded Ian. Haven't a clue what its about but second time of looking, I see bits of paper with sine waves on. Impresses me no end :lol:

ATB

DaveB :tab:
ImageImage
Old sailors never die.. they just smell that way!

User avatar
Garry Russell
The Ministry
Posts: 27180
Joined: 29 Jan 2005, 00:53
Location: On the other side of the wall

Post by Garry Russell »

:k:

Garry
Garry

Image

"In the world of virtual reality things are not always what they seem."

User avatar
speedbird591
Battle of Britain
Battle of Britain
Posts: 4038
Joined: 24 Jun 2004, 05:56
Location: Wiltshire, UK
Contact:

Post by speedbird591 »

Garry Russell wrote::k:

Garry
Garry's just worried whether it's in the correct forum :lol:

User avatar
MALTBY D
The Gurus
Posts: 1491
Joined: 18 Jun 2004, 19:40
Contact:

Post by MALTBY D »

Ha ha, wasted on this uncultured lot. :lol:

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...
ImageImage

User avatar
MALTBY D
The Gurus
Posts: 1491
Joined: 18 Jun 2004, 19:40
Contact:

Post by MALTBY D »

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
ImageImage

User avatar
AlexP
Trident
Trident
Posts: 347
Joined: 24 Mar 2006, 17:07
Location: Bomber County, England

Post by AlexP »

:smile: :shock: :worried: :redface: :dunno:

Might take a few passes (and a few less beers) to fully grasp this!!!

AlexP
Image

User avatar
speedbird591
Battle of Britain
Battle of Britain
Posts: 4038
Joined: 24 Jun 2004, 05:56
Location: Wiltshire, UK
Contact:

Post by speedbird591 »

MALTBY D wrote:If you look in aircraft.cfg you will see mention of proportional, integral & derivative in the [autopilot] section.
OK, done that. I chose the Tinmouse as it is excellent at intercepting the ILS without weaving. Here is the relevant excerpt:

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 :worried:

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.

User avatar
TobyV
Vintage Pair
Vintage Pair
Posts: 2862
Joined: 26 Jun 2004, 20:41
Location: Halfway up a hill

Post by TobyV »

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 :smile: :wink:

Post Reply