Sunteți pe pagina 1din 13

1

Mark Molloy
********
4/27/06

Linear Controls Systems PROJECT:
Design of PID and Lead/Lag Compensators







This one still has the old tagger on it
-Nigel Tuffnell, - Spinal Tap



2
Controls Project


Introduction:

The purpose of this project is to take a given transfer function (in the s-domain), with
unity feedback, and design compensators to improve (speed up) the transient response
and drive the steady-state error towards zero.
We analyze two examples from the Norman Nise textbook:

Example 9.5 The given specs are 20% O.S. and a reduction of uncompensated peak
time by a factor of 0.6 as well as zero positional steady-state error.

Skill Assessment Exercise 9.3 The given specs are 20% O.S. and a reduction of
uncompensated settling time by 2 times (a factor of 0.5).
We are also asked to reduce velocity steady-state error by 10 times (a factor of 0.1).



Controls Project PID Compensator (Example 9.5)


Results:

Our uncompensated transfer function is:

( )
) 10 )( 6 )( 3 (
8
) (
+ + +
+
=
s s s
s
s
K
G
U


Constant percent over shoot corresponds to a line drawn from the origin at an angle
given by the damping ratio of the O.S.
We calculate the following:

=
=
=

13 . 117
) 45595 . ( cos
45595 .
1
u
u



We find the intersection of our functions root locus with the line: s = -5.4 10.5j
The value of gain (K) at this point is 120.05.

Designing the PD compensator:
We use the s value above to calculate an uncompensated peak time of .2981 seconds.
Multiplying by .6 we obtain .17884 seconds as the desired (compensated) peak time.

3
We then use the compensated peak time to derive a new s coordinate for our
compensated system.
The intercept must be such that the new s coordinate is also on the 20% O.S. line.
We find s = -9.003 17.57j satisfies these requirements.
Summing the angles from the open-loop zeros and poles to this point, adding the total to
180 degrees, and subtracting multiples of 360, we find the angle to the derivative
compensator zero is 22.5 degrees. Using these values we find the zero at = -51.42
Thus our PD compensator is:

) 42 . 51 ( ) ( + = s s
PD
G



Designing the PI compensator:
This part is relatively easy: An ideal integral compensator must have a single s in the
denominator. We chose the arbitrary pole close to the origin for cancellation purposes,
= -0.1
Thus our PI compensator is:

s
s
s
) 1 . (
) (
+
=
PI
G



Designing the PID compensator:
s
s s
s s s
) 42 . 51 )( 1 . (
) ( ) ( ) (
+ +
= =
K
G G G
PI PD PID


Where K is the gain of the entire PID compensated system at the design point.

However, the design point of the PID will be slightly different from the design point of
the PD. This is because we now include the zero at 51.42 in the angle summation.
Searching the 20% O.S. line again, summing all the angles of the 4 poles and 3 zeros
we arrive at a PID design point of s = -8.4 16.48j.

Calculating the gain of the entire PID compensated system at the new design point:
K = 6.326
The PID gains are:
K3 = 6.326
K2 = 32.53
K1 = 3225.92

The table on the following page summarizes our calculated values:



4
Uncompensated PD PID

Plant/Compensator

Dominant Poles
K

n
e
% OS
S
T
P
T
P
K
) ( e
( )
) 10 )( 6 )( 3 (
8
+ + +
+
s s s
s K


-5.4 10.5j
120.05
.45595
11.84
20
.741
.2981
5.33
.1578
( )
) 10 )( 6 )( 3 (
) 42 . 51 ( 8
+ + +
+ +
s s s
s s K


-9.003 17.57j
7.21
.45595
19.75
20
.4443
.1788
16.477
.0572
( ) ( )
) 10 )( 6 )( 3 (
1 . ) 42 . 51 ( 8
+ + +
+ + +
s s s s
s s s K


-8.4 16.48j
6.326
.45595
18.42
20
.4762
.1906

0


Simulations:

In this section we run simulations, using our hand-calculated values.
We use Matlab to plot a root locus of the final PID compensated system.
We used Simulink to plot the time response of the uncompensated system,
as well as the PD and PID compensated systems.


The figure below shows the M file used to plot the root locus:




5
The figure below shows the root locus of the final PID compensated system.
The dominant poles on the 20% OS line (s = -8.58 16.4j) are very close to the
calculated values (s = -8.4 16.48j).





The figure below shows the Simulink schematic for plotting the three time responses.
It contains transfer functions for all three cases listed in the table on page 3:


6
Peak Time:
The table below shows the calculated values vs. simulink values for the peak time design
spec 1788 . =
P
T
As we can see, the PD and PID values exceed the spec:
Calc. Values Simulink
2981 . =
Uncomp P
T
1788 . =
PD P
T
1906 . =
PID P
T
2972 . =
Uncomp P
T
1562 . =
PD P
T
1682 . =
PID P
T

The figure below shows the transient response of the three cases. This is the source of the
values listed on the right side of the table.
Yellow Uncompensated
Purple PD Compensated
Blue PID Compensated



Error:
The final figure (on the following page) is the steady-state positional error, as depicted by
simulink for the three cases.
As we can see the error is never driven completely to zero (although it is improved
immensely). The following table summarizes calculated vs. simulink values with regard
to the design spec of error = 0:
7
Calc. Values Simulink
0 ) (
0572 . ) (
1578 . ) (
=
=
=
PID P
PD P
Uncomp P
e
e
e

0510 . ) (
0570 . ) (
1570 . ) (
=
=
=
PID P
PD P
Uncomp P
e
e
e


The uncompensated and PD simulink values are nearly identical to the calculated values.
However, the PID simulink value does not equal zero.

The figure below shows a zoom used to obtain the values on the right side of the table:







Conclusion:

This was a very successful simulation.
All detail calculations are included in the end of this report.






8
Controls Project Lead/Lag Compensator (Skill Assessment Ex 9.3)

Results:
Here we are to design a Lead / Lag compensator for the following transfer function:

) 7 (
) (
+
=
s s
s
K
G
U


Coincidentally we have the same line drawn at 117 degrees as the previous section.
(Corresponding to a 20% OS):

=
=
=

13 . 117
) 45595 . ( cos
45595 .
1
u
u



We find the intersection of our functions root locus with the line is s = -3.5 6.8j
The value of gain (K) at this point is 58.49.
From the = -3.5 value, we calculate the uncompensated settling time as 1.1429 seconds.
Our design spec is to reduce this by half (1.1429/2 = .57143 seconds).
We use this new settling time to calculate design point of the -intercept of the new
dominant pole locations, s = -7 13.5j.

Lead Design:
The instructions of this exercise specify the lead zero to be at = -3.
Summing angles we find the angle to the lead pole is 79 degrees and its location is
= -9.53. Thus our lead compensator takes the form:

) 53 . 9 (
) 3 (
) (
+
+
=
s
s
s
Lead
G

Lag Design:
Multiplying the uncompensated function by the lead compensator and calculating the
gain at the lead compensated design point, we find K = 200.3
Using this value to calculate the velocity error, we find a modest improvement over the
uncompensated error (see table).
We find an improvement still needed factor of 9.276.
We use this, along with a chosen lag pole location of .01 to calculate the lag zero location
of = -.09276. Thus our lag compensator takes the form:

) 01 . (
) 09276 . (
) (
+
+
=
s
s
s
Lag
G
So our lead/lag compensator takes the form:
) 53 . 9 )( 01 . (
) 09276 . )( 3 (
) ( ) ( ) (
+ +
+ +
= =
s s
s s
s s s
K
G G G
Lag Lead LLC

9

Where K = 200.03 at the design point.
The table below summarizes the calculated values:

Uncompensated Lead/Lag

Plant/Compensator

Dominant Poles
K

n
e
% OS
S
T
P
T
V
K
) ( e

) 7 ( + s s
K


-3.5 6.8j
58.49
.45595
7.67
20
1.143
.4620
8.356
.11968
( )
) 53 . 9 )( 7 )( 01 . (
) 09276 . ( 3
+ + +
+ +
s s s s
s s K


-7 13.5j
200.03
.45595
15.35
20
.571
.2327
83.44
.01197

Simulations:
In this section we ran simulations, using our hand-calculated values.
We used Matlab to do a root locus of the final Lead/Lag compensated system.
We used Simulink to plot the time responses of the uncompensated and
Lead/Lag systems. The figure below shows the M file used to plot the root locus:


The figure below shows the root locus of the final Lead/Lag compensated system.
10
The dominant poles on the 20% OS line (s = -6.93 13.5j) are virtually identical to the
calculated values (s = -7 13.5j).




The figure below shows the simulink schematic for plotting the time response.
It contains transfer functions for both cases listed in the table on page 9:



11
Settling Time:

The table below shows the calculated vs. simulink values for the design spec of
5710 . =
S
T
As we can see, the simulink compensated value is slightly longer than the spec:

Calc. Values Simulink
143 . 1 =
Uncomp S
T
5710 . =
LL S
T

095 . 1 =
Uncomp S
T
6300 . =
LL S
T


The figure below shows the transient response of the three cases. This is the source of the
values listed on the right side of the table above.
Yellow Uncompensated
Purple Lead/Lag Compensated






12
Error:

The following figure depicts the steady-state velocity error. The traces are color coded as
follows:
Yellow Input Ramp
Purple Uncompensated,
Blue Lead/Lag Compensated
As we can see below, the initial improvement in error is miniscule.
What is happening is this: The lag open-loop pole is very close to the origin, which
produces a very long transient response.



The following two figures make this very clear.
The figure below shows the three traces from 2 to 2.5 seconds. The error of the
compensated system shows little improvement over the uncompensated system during this
time. However in the figure on the next page, (showing the three traces around 196
seconds) we can see the ramp error is vastly improved and within specs.

13





Calc. Values Simulink
0119 . ) (
1190 . ) (
=
=
LL V
Uncomp V
e
e

0120 . ) (
1200 . ) (
=
=
LL V
Uncomp V
e
e







Conclusion:

The was a successful simulation in that it was very close to specs (settling time / steady
state velocity error), however, if this were a real device, the 2 minute delay in reaching
error specs would be most likely unacceptable and require further revision.
See detail calculations included.

S-ar putea să vă placă și