EXPERIMENTS IN IC312 CONTROL ENGG LABORATORY Dr. R. Ayyagari Dept. of Instr. & Control Engg., National Institute of Technology Tiruchirappalli
2
Chapter 1 Introduction In this booklet, we describe the following experiments that would reinforce the theory behind control systems courses you have learnt so far. 1. Plant Characteristics, 2. Gain Compensation, 3. Lead Compensation, 4. Lag Compensation, 5. Lead-Lag Compensation, 6. Lag-Lead Compensation, 7. State Feedback Compensation, and 8. Design of State Observer For the sake of convenience, we choose a simple electrical network, viz. a second order passive RC network,as a plant. In the first experiment, we describe how to obtain the time and frequency responses of the plant. We presume that these responses are 3
4
CHAPTER 1. INTRODUCTION
not satisfactory and proceed to design controllers in the subsequent experiments. Of particular interest are experiments 7 and 8 where seemingly abstract concepts, e.g., state variable feedback and reduced order observers, are given a concrete form amenable to experimentation. The specs given for each of the experiments may be varied to conduct several experiments. The controllers designed may be implemented using Op-Amps, resistors, and capacitors. Each of the experiments has two parts – theory and practial. For the theory part c or MATLAB c for quick plots/computations. For the the reader may use LabVIEW practical part, we consider the two-section passive RC network having R1 = R2 = R and C1 = C2 = C. Further, we assume that the product R × C = 0.33 milliseconds for the all the experiments. Students may try several other possibilities, thereby exploring a multitude of experiments.
References [1 ] A. Ramakalyan, Control Engineering: A Comprehensive Foundation, Vikas Publishing House, New Delhi, 2003, ISBN: 81 - 259 - 1432 - 3. [2 ] K. Ogata, Modern Control Engineering, 4/e, Pearson Education Asia, 2002, ISBN: 81 - 7808 - 579 - 8.
Chapter 2 Plant Characteristics 2.1
Aim
To study the time and frequency characteristics of the plant (electrical network) given in figure E1.
2.2
Procedure
1. Theory: • Obtain the transfer function Y (s)/U (s) of the circuit assuming that the product R × C = 0.33 milliseconds. 5
6
CHAPTER 2. PLANT CHARACTERISTICS • Determine the damping factor ζ and natural frequency ωn of the system. • Determine and sketch the response of the system to a unit step input. • Determine the rise time, the settling time, and the steady-state error from the step response. • Sketch the Bode plot of the system showing the corner frequencies, cross-over frequencies, and the gain and phase margins. You may use LabVIEW/MATLAB for the above computations. 2. Practical 1: • Make the circuit. • Apply a square wave signal of frequency about 100 Hz. (Why ?) • Trace the input and the output of the circuit on a dual trace CRO. Adjust the scales on the CRO such that half of a cycle is depicted in detail. This is the practical depiction of step response. • Make a note of all the scales accurately. • Measure the rise time, the settling time, and the steady-state error. • Compare these results with the theoretical results in step 1. 3. Practical 2: • Apply a 2 V p-p sinusoidal signal to the circuit. Vary the frequency gradually from very low frequency (0 - 10 Hz) to a high frequency, say 100 KHz. • At each applied frequency, observe the amplitude (p-p) and phase difference of the output sinusoid on the dual trace CRO and tabulate as follows.
2.2. PROCEDURE
7
S. No.
Input
Output
Gain
Output
Freq.
Amplitude
dB
Phase
(rad/sec)
(Volts)
(degrees)
The gain is calculated as 20 log10
output magnitude input magnitude
• Using the table above obtain a Bode plot marking the corner and cross-over frequencies. • Measure the gain and phase margins and compare with the theoretical results in step 1.
8
CHAPTER 2. PLANT CHARACTERISTICS
Chapter 3 Gain Compensation 3.1
Aim
To design a gain (proportional) compensator K for the plant P studied in experiment #1 so that the closed-loop system in figure E2 meets the following specifications.
• Peak overshoot ≈ 20%
• Settling time ≈ 1 millisecond
9
10
CHAPTER 3. GAIN COMPENSATION
3.2
Procedure
1. Theory: • From the open-loop transfer function P (s) of the plant derived in the previous experiment, sketch the root locus neatly on a graph sheet indicating all the necessary parameters. Choose the scales carefully in terms of the time-constant. • Given the performance specifications above obtain the location of the desired (closed-loop) poles on the root-loci. • Determine the gain K for the poles obtained in the previous step to lie on the root-loci. • Determine and sketch the step response of the closed-loop system. • Verify the peak overshoot, the peak time, the settling time, the rise-time and the steady-state error from the step response. • Sketch the Bode plot of the loop-transfer function K ·P (s) showing the corner frequencies, cross-over frequencies, and the gain and phase margins. • Compare these results with those of the previous experiment (plant characteristics). You may use LabVIEW/MATLAB for the above computations. 2. Practical 1: • Make the circuit with an Op-Amp circuit (a difference amplifier) for the comparator and gain K in the block diagram of figure E2. • Trace the step response of the closed-loop system on a dual trace CRO.
3.2. PROCEDURE
11
• Measure the peak overshoot, the peak time, the settling time, the rise time, and the steady-state error. • Compare these results with those given in the specifications and also with those in step 1. 3. Practical 2: • With the compensator K in place, remove the feedback path. • Obtain the frequency response of the loop-transfer function K · P (s), and measure the gain and phase margins and compare with the theoretical results in step 1 and also with the results of the previous experiment (plant characteristics).
12
CHAPTER 3. GAIN COMPENSATION
Chapter 4 Lead Compensation 4.1
Aim
To design a lead compensator C(s) for the plant P studied in experiment #1 so that the closed-loop system in figure E3 meets the following specifications. • Peak overshoot ≤ 12%, • Settling time ≤ 0.8 ms, and • Rise time as small as possible
13
14
CHAPTER 4. LEAD COMPENSATION
4.2
Procedure
1. Theory: • From the specifications determine the location of the closed-loop poles sd and s∗d on the s - plane. • A lead compensator is given by C(s) = K
s+α s+β
K > 1, |α| < |β|
(4.1)
• For the root-loci of the loop transfer function K · C(s) · P (s) to pass through the desired poles in step 1, we need to choose the zero − α and the pole − β of the lead compensator such that the net angle contribution at the desired poles is ± 180o , i.e., 6
C(s) +
• Determine graphically the gle 6
6
6
P (s) |s = sd = ± 180o
(4.2)
P (s) contributed by the plant so that the an-
C(s) to be contributed by the compensator is known from the above
equation eqn. 4.2. • Applying simple geometry locate α and β on the s-plane. • Obtain the root-loci of the loop transfer function C(s) · P (s) and determine the gain K at the desired poles. • Determine and sketch the step response of the closed-loop system and verify the peak overshoot etc. • Sketch the Bode plot of K · C(s) · P (s). • Compare these results with those in experiment #1.
4.2. PROCEDURE
15
2. Practical 1: • Make the circuit with an Op-Amp circuit for the comparator and the compensator in the block diagram of figure E3. (For the Op-Amp circuit, refer Ogata [2].) • Trace the step response of the closed-loop system. • Measure the peak overshoot, the peak time, the settlilng time, the rise time, and the steady-state error. • Compare these results with those given in the specifications and also with those in step 1. 3. Practical 2: • Obtain the frequency response of K · C(s) · P (s), and measure the gain and phase margins and compare with the theoretical results in step 1 and also with the results of experiment #1. 4. Question: Is this design unique?
16
CHAPTER 4. LEAD COMPENSATION
Chapter 5 Lag Compensation 5.1
Aim
To design a lag compensator C(s) for the plant P studied in experiment #1 so that the closed-loop system (as shown in figure E3, pp.13) meets the following specifications. • Steady-state position error ≤ 5% • Gain margin ≥ 60 dB, and • Phase marge ≥ 80o
5.2
Procedure
1. Theory: • Determine the gain K so that the closed-loop system meets the specification on position error. • With the gain in the previous step obtain the Bode plot K P (s), and determine the gain and phase margins. 17
18
CHAPTER 5. LAG COMPENSATION • A lag compensator is given by C(s) =
1 + aT s a < 1 1 + Ts
(5.1)
• Determine the new gain cross-over frequency ωp∗ at which the phase curve has the desired phase margin plus 6o . • Measure the attenuation α (in dB) required to push the magnitude curve down so that the gain cross-over frequency is ωp∗ . This attenuation will be supplied by the lag compensator with ‘a’ computed as 20 log a = − α
(5.2)
• It is generally recommended that the zero of the compensator is located one decade below ωP∗ , i.e., ωzero =
1 ∗ ω 10 p
(5.3)
• From the transfer function in eqn. 5.1, the pole of the compensator is related to its zero as ωpole = a · ωzero
(5.4)
• From the loop transfer function K ·C(s)·P (s), obtain the closed-loop transfer function and hence the step response. Verify the transient specifications and compare the results with those of the previous experiments. • Obtain the Bode plot of K · C(s) · P (s) and verify the margins and the steady-state position error. Compare the results with those of the previous experiments. 2. Practical 1: • Make the circuit with an Op-Amp circuit for the comparator and the compensator in the block diagram of figure E3. (For the Op-Amp circuit, refer Ogata [2].)
5.2. PROCEDURE
19
• Trace the step response of the closed-loop system and measure the transient characteristics. • Compare these results with those given in the specifications and also with those in step 1 and those in the previous experiments. 3. Practical 2: • Obtain the frequency response of K · C(s) · P (s), and measure the gain and phase margins. • Compare with the theoretical results in step 1 and also with the results of previous experiments. 4. Questions: • Is this design unique? • In the design, why did you not account for the gain margin? • Why did you add 6o to the required phase margin while locating ωp∗ ?
20
CHAPTER 5. LAG COMPENSATION
Chapter 6 Lead - Lag Compensation 6.1
Aim
To design a lead - lag compensator for the plant P studied in experiment #1 so that the closed-loop system, as shown in figure E5, meets the following specifications.
• Peak overshoot ≤ 10%
• Settling time ≤ 1 ms
• Rise time as small as possible
• Steady-state position error ≤ 5%
• Gain margin ≥ 60 dB, and
• Phase marge ≥ 80o 21
22
CHAPTER 6. LEAD - LAG COMPENSATION
6.2
Procedure
1. Theory: • Refer to fig. E5 above. • Design a lead compensator Clead (s) (procedure as outlined in expt. #3) that would take care of the transient specs. • Design a lag compensator Clag (s) (procedure as outlined in expt. #4) for the “plant together with the lead compensator” that would take care of the steady-state specs. • Notice that there are two negative feedback loops. The lead compensator is inside the inner loop and hence is to be designed taking into account the plant alone. The innermost loop may be reduced to T1 (s) =
Clead (s) · P (s) 1 + Clead (s) · P (s)
(6.1)
The lag compensator is inside the outer loop and hence is to be designed as if it is driving a modified plant T1 (s). • Obtain the overall closed-loop transfer function T (s) =
Clag (s) · T1 (s) 1 + Clag (s) · T1 (s)
(6.2)
6.2. PROCEDURE
23
and hence the step response. Verify the transient specifications and compare the results with those of the previous experiments. • Obtain the Bode plot of the loop transfer function L(s) = Clag (s) · T1 (s)
(6.3)
and verify the margins and the steady-state position error. Compare the results with those of the previous experiments. 2. Practical 1: • Make the circuit for the comparators and the compensators in the block diagram of figure E5. • Trace the step response of the closed-loop system T (s) and measure the transient characteristics. • Obtain the frequency response of the loop transfer function L(s), and measure the gain and phase margins. • Compare these results with those given in the specifications, with those in step 1, and with those in the previous experiments. 3. Practical 2: • Repeat the experiment by first designing the lag compensator in the innermost loop and a lead compensator in the outer loop. • Compare the results with those in theory and in practical 1.
24
CHAPTER 6. LEAD - LAG COMPENSATION
Chapter 7 State Feedback Compensation 7.1
Aim
To design a state feedback compensator for the plant P studied in experiment #1 so that the closed-loop system shown in figure E6 meets the following specifications. • Peak overshoot ≤ 10% • Settling time ≤ 1 ms • Rise time as small as possible • Steady-state position error ≤ 5%
25
26
CHAPTER 7. STATE FEEDBACK COMPENSATION
7.2
Procedure
1. Theory: • Using the capacitor voltages as the variables x1 and x2 , obtain the state-space model x˙ = A x + B u y = Cx
(7.1)
of the plant. • For RC = 0.33 milliseconds,
−3000 3000 A = , 3000 −6000
B =
0 3000
,
C =
1 0
• Verify that the plant is controllable. • Given the time response specs, determine the pair of desired poles s1 and s2 . Typically, you may use the same desired poles as those in expt. #3. • For each of the desired poles si , i = 1, 2, form the composite matrix Mc = [si I − A : −B]
(7.2)
where I is the identity matrix of dimension 2 × 2. • Solve Mc Θi = ¯0 for
µi1
Θi = µi2
νi1
Choose µ ¯1∗ and µ ¯2∗ independent of each other.
(7.3)
7.2. PROCEDURE
27
• The state feedback matrix F1 = [F11 F12 ] may be solved from the linear system of equations:
µ11 µ21 F1 = ν11 ν21 µ12 µ22
(7.4)
• Verify that the eigenvalues of A + BF1 are the desired poles. • Obtain the step response and hence the steady-state error. • Design an post-amplifier F2 such that y1 = F2 ·y lies within 5% of the desired steady-state. 2. Practical: • Make the circuit for the amplifiers F1 , F2 , and the comparator in the block diagram of figure E6. (Identify the state variables correctly.) • Trace the step response of the closed-loop system and measure the transient characteristics. • Compare these results with those given in the specifications, and with those in the previous experiments. 3. Questions: • Why do you need a post-amplifier F2 ? • What happens if the amplifier F2 is placed before the comparator on the left hand side? • What is it you particularly notice when compared with the lead compensation of experiment #3?
28
CHAPTER 7. STATE FEEDBACK COMPENSATION
Chapter 8 Design of State Observer 8.1
Aim
To design a state observer for the plant P studied in experiment #1 and provide the state feedback control using the estimated state.
8.2
Procedure
1. Theory:
• From the state-space model of experiment #6, we see that the output y is no other than the state x1 and hence is readily available. Assuming that the internal circuitry of the plant is not accessible, we need to extract the second state variable x2 as fast as possible. This is the idea of a reduced-order observer. • Verify that the plant is observable. 29
30
CHAPTER 8. DESIGN OF STATE OBSERVER • Partition the A and B matrices as
A
A11 = ··
A21
B1 B = ··
: A12 ··
··
: A22
(8.1)
B2
• Assume a negative large sL , and form the composite matrix Mo = [sL − A22 : A12 ]
(8.2)
• Solve Mc ΦL = ¯0 for ΦL
µL1 = ··
νL1
• The state observer gain matrix L may be solved from the linear equation: Lr [µL1 ] = [νL1 ] • The dynamics of the reduced-order observer are xˆ˙ 2 = (A22 − Lr A12 ) xˆ2 + A21 y + B2 u + Lr (y˙ − A11 y − B1 u)
(8.3)
• Typically, for sL = −15000, Lr = 3. • For practical implementation, rewrite eqn. 8.3 as d (ˆ x2 − 3 y) = − 15000 xˆ2 + 12000 y + 3000 u dt
(8.4)
using the fact that y = x1 . • Compute xˆ2 using the following schematic with a Deboo (non-inverting) integrator having a gain of 3000 (= 1/(R × C)).
8.2. PROCEDURE
31
2. Practical: • Cascade the observer schematic in figure E7 at the output of the plant. • Apply a step input and trace x2 and xˆ2 on a dual trace CRO. • Make the closed-loop circuit with the plant, the amplifiers F1 and F2 of the previous experiment, and the observer schematic as shown in figure E7. Identify the state variables correctly – the state variable x1 is the output y of the plant, while the state variable x2 is the output of the observer, i.e., xˆ2 . • Trace the step response of the closed-loop system and measure the transient characteristics. • Compare these results with those in experiment #6. 3. Questions: • Derive the general forms of eqn. 8.2 and eqn. 8.3. • What is sL in eqn. 8.2? Why should it be large? • Is there any other possibility of extracting x2 ?