PID Controllers
 General PIDs
Why
Do You Need PID Controllers?
What
is a PID Controller?
Properties
Of PID Controllers
Using
PID Controllers  An Example
You are at: Design Techniques
 The PID Family of Controllers  General PID Controllers
Click
here to return to the Table of Contents
Why
Do You Need PID Controllers? What is a PID Controller?
PID controllers are a family of controllers. PID controllers are
sold in large quantities and are often the solution of choice when a controller
is needed to close the loop.
The reason PID controllers are so popular is that using PID gives the designer
a larger number of options and those options mean that there are more possibilities
for changing the dynamics of the system in a way that helps the designer.
If the designer works it right s/he can get the advantages of several effects.
In particular, starting with a proportional controller, and adding integral
and derivative terms to the control the designer can take advantage of
the following effects.

An integral controller
gives zero SSE for a step input.

A derivative control terms
often produces faster response.
A PID controller operates on the error in a feedback system and does the
following:

A PID controller calculates
a term proportional to the error  the P
term.

A PID controller calculates
a term proportional to the integral of the error  the I
term.

A PID controller calculates
a term proportional to the derivative of the error  the D
term.

The three terms  the
P, I and D terms, are added together to produce a control signal that is
applied to the system being controlled.
Goals
Of This Lesson
PID controllers are widely used for control of many kinds of systems.
Your goals for this lesson are as follows:
Given a system you want to control with a PID controller,
Be able to use common methods of analysis for a system with a PID controller
in order to predict the behavior of the system + controller, and to be
able to choose PID parameters.
Why
Use PID Controllers? What Are They?
You may need a PID controller in many situations, particularly in the following
cases.

A proportional controller
may not give SSE performance needed in a system.

An integral controller
may give SSE performance, but slow a system down.

Adding a derivative term
may help cure both of those problems.
Properties
Of PID Controllers
PID controllers
can be viewed as three terms  a proportional term, and integral term and
a derivative term  added together. PID controllers are also known
as threeterm controllers and threemode controllers. Here's a block
diagram representation of the PID.

There are three controllers
acting in concert.

The three controllers
are:

A proportional
(top),

An Integral
(center),

A Derivative
(bottom).

The proportional, integral
and derivative outputs are added together.
The PID controller can be thought of as having a transfer function.

The PID controller transfer
function can be obtained by adding the three terms.

PID(s) = K_{p}
+ K_{i}/s+ sK_{d}

The transfer function
can be combined into a polezero form.

PID(s) = [sK_{p}
+ K_{i}+ s^{2}K_{d}]/s

Since there is a quadratic
in the numerator, there are two zeroes in this transfer function as well
as the obvious pole at the origin, s = 0.
Now, here's a good way to think about the effect of using a PID controller.

The PID controller transfer
function really adds a pole at the origin, and two zeroes that can be anywhere
in the splane that the designer wants, depending upon the designer's choice
of the three gains.

PID(s) = [sK_{p}
+ K_{i}+ s^{2}K_{d}]/s

This gives the designer
an incredibly large number of possibilities.
Examples
Here are some of the possible polezero configurations the designer can
add.
E1
Two imaginary zeroes with the pole at the origin.
E1
Two real zeroes with the pole at the origin.
The designer's challenge is to choose a set of controller gains that produces
a system response within specifications. Above we can see that this
is equivalent to choosing one gain and a polezero pattern  staying within
the allowable configurations. The polezero pattern is really a zero
pattern you can control and a pole that is constrained to be at the origin.
Using
PID Controllers
Example
E2
Let us look at some examples in which you might want to use PID controllers.
In the lessons on proportional control and integral control, we considered
this system with these numbers. Here
is a link to the problem and system description.

For the engine + load:

G_{L} =
1, t_{L}
= 2 sec.

For the controller:

G_{C} =
K_{I} (variable), t_{C}
= 1 sec.

For the sensor:
G_{S}
= 1, t_{S}
= .2 sec.
There were several conclusions that we drew from investigations of proportional
control (Click here for the specifications.) (Click here for the conclusions.)and
integral control used with this system. (Click on the hot words to
go to the sections where this system was investigated.)
We found, generally,
that proportional control would not work, but integral control could be
used to meet the SSE specifications. However, integral control had
response times on the order of ten to twenty seconds. The question
we want to look at here is "Can we get faster response with a general PID?".
Let's review the root locus for this system with an integral controller.
Here is the root locus for the system with a proportional controller.

The problem with this
system is the two branches that start at s = 0.5 (There is a 2 second
time constant in the plant that produces this pole.) and at s = 1 (And,
this is the pole from the controller.)

Those two branches are
the cause of the slow response and the general limitations on response
time in this system.

Those branches come together
and eventually move into the right half of the splane  where the system
becomes unstable.

Those two branches are
the cause of the slow response and the general limitations on response
time in this system.
With a PID controller we get a pole at s = 0 and two zeroes anywhere we
want them. Basically, we can add zeroes two different ways.

The zeroes could be real,
in which case they would be in positions like those seen below.

The zeroes could be complex,
in which case they would be in positions like those seen below.
Which situation would
you like to try? We will arbitrarily try a few ideas so that we can
see what happens in the different situations that are possible.

We'll give you two real
zeroes at 2
and 8.

We'll give you two complex
zeroes at 2 + j3
and 2  j3.

These are obviously not
the only choices there are, but we'll start with one of these.

And, don't forget when
we do this we will add a pole at the origin as well  in both cases.
The original root locus looks like this. This root locus has three
black dots marking the pole positions when the root locus gain is 50.
Now, add the two zeroes (at 2 and 8) and the pole at the origin.
Here is the resulting root locus.

Adding the two zeroes
does produce a change in the locus  not all for the better, although now
only two branches go to infinity.

The two zeroes in the
LHP move the centroid (Center of Gravity) to the right, and while the closed
loop poles do not move as quickly into the RHP, they get there. And,
we should have thought of that before we tried it, but now we know.

Make a mental note that
adding poles and zeroes will always have an effect
on the center of gravity (centroid).
The plot does raise some questions.

Would we be better off
with zeroes further to the right? If the zeroes are further to the
right, the center of gravity will be changed  and for the better since
it will move to the left!

This root locus plot shows
the same system with one change. Instead of a zero at s = 8, that
zero is now at s = 1.5.

Now the center of gravity
is in the LHP, so when the two poles go to infinity they head off in a
direction that keeps them in the LHP.

When the two poles come
together, they do so at about s = 0.5.

As the poles become complex,
they move gradually to the left producing a system that is probably faster.

As the poles move to the
left, the damping ratio deteriorates.

That's another thing to
keep in mind. When we make changes we need to examine what possibilities
the system allows. In the system above, either the speed of response
is poorer (when there are closed loop poles on the segment between 0 and
0.5) or the damping ratio is poor (when the poles do move a little further
into the left half of the splane.) Got to remember to check
the damping ratio  especially if there is
a requirement on damping or overshoot.

All of the above raises
another question:

Should we consider complex
zeroes? We need to consider how using complex zeroes might affect
the issues we are concerned about above.
This root locus plot shows the system with two complex zeroes at 2 + j3
and at 2  j3.

This looks pretty disastrous.

The two poles closest
to the RHP move to the RHP fairly quickly.

Time response is slow
to begin with, and it gets worse as you increase the gain.

Instability is even worse
than a low damping ratio. Actually, you can view instability as a
negative damping ratio, so possibly this can be considered a damping ratio
problem also.

At higher gains those
poles get back into the LHP, but it doesn't look like there is any gain
that produces faster, better damped responses.
It's time to evaluate where we are. We have tried the following:

Zeroes at 2 and 8.

Zeroes at 2 and 1.5,

Two complex zeroes at
2 + j3 and at 2  j3.
These pairs of zeroes were all added in conjunction with a pole at the
origin, using a general PID approach. In all cases we see the following.

There is a problem because
it seems to be difficult to move the closed loop poles very far into the
left half of the complex plane  in order to produce a fast system.

In all of these cases
there is always a pole that is slow, or when the poles become complex,
it is not possible to get much damping.

However, we can see that
we have a substantial amount of control over where we can get the closed
loop poles to locate. It might be that we just haven't explored this
completely enough.
Before we give up on this, let's try some other zero locations. We
are going to choose some complex zero locations that are a little further
to the right. This root locus plot shows the system with two complex
zeroes at 1 + j3 and at 1  j3. Paradoxically, moving the zero
location to the right permits the poles emanating from s = 0 and s = 0.5
to move further to the left.

Now, the zeroes "capture"
the poles closest to the RHP.

The first time we used
complex zeroes, the root locus branches captured by the zeroes were the
branches further to the left.

The capture takes place
only after a little excursion into the RHP.

If we built this system,
we would need a high enough gain to ensure those two poles were in the
LHP.

We would always have the
problem that a lower gain would make the system unstable.
Overall, the idea of two complex zeroes looks like it can yield some interesting
results. It's the best we've had to this point. We can "tweak"
the zero location just a bit more. Here is the root locus with zeroes
at 1 + j and
1
 j. The black dots are located at a
root locus gain of 20.

This choice looks halfway
promising.

The closed loop poles
are as far into the left half plane as we have had them.

The damping ratio is decent
also. It looks like we might be able to get a damping ratio of 0.6
or better in both pairs of complex closedloop poles. That's an indicator
of a system without too much overshoot.

We need to simulate the
system to get a better idea of behavior.

We might explore zeroes
located differently yet. Here is an example that shows some other
possibilities.

After looking at these
systems, look again at using two real zeroes.
We really do need to do simulations to get a feel for how the system behaves.
To do a simulation we need to complete the PID design.

If we expand the zeroes,
we get a factor [s^{2} + 2s + 2].

We will need to remember
that the root locus gain is 20 (note the black dots on the root locus plot
above.

The root locus gain is
K_{rl}= 2.5 K_{i}, so K_{i}
= 8.

We need to adjust for
the gains of the three blocks when they are expressed in root locus form.

To get a transfer function
of 8 [s^{2} + 2s + 2]/s, we need to have:

8[s^{2}
+ 2s + 2]/s = [sK_{p} + K_{i}+ s^{2}K_{d}]/s,
or

K_{d }=
8,

K_{p }=
16,

K_{i }=
16,
This system was simulated using Simulink/Matlab using the system below.
Here is the computed
response. (We did this using two different integration algorithms.
Using the 4th order RungeKutta produces an unstable calculation unless
the user coerces the time interval small enough. The time interval
here was 0.05 sec.)
Questions
And Conclusions/Comments on the extended example
What can we conclude about general PID controllers, drawing especially
on the extended example above? Here are some conclusions we think
are appropriate.

Using a general PID controller
can give you performance that is better than using proportional or integral
alone, or even a PI or PD.

The improvement comes
because you can locate two zeroes where you want them.

In the example getting
two complex zeroes at a good location was critical. It might not
be possible to get the kind of improvement we got using a PI which would
give you a real zero in either case.

Using a PID gives you
the zero error behavior you get from integral control.

PID controllers are no
panacea, but used wisely can help you design control systems that work
well.
Links
To Related Lessons
Other Lessons On PID
Controllers
Material That You Might
Want To Review
Moving Along  More Advanced
Material
Send
us your comments on these lessons.