Sei sulla pagina 1di 157

2M Mechatronics

MSD Part 1

Control Systems

Dr M Ristic
Relevant 2nd year subjects

• Dynamics
– Vibrations, resonance
• Mathematics
– Linear DEs, Laplace transforms
• Mechatronics
– Electrical filters, Bode diagrams, Control
Control Systems
Autumn term Lecture Topic Tutorial Group
Week (Room 649)
3 Control #1 – Introduction, system models, block A
diagrams, Laplace transform, transfer function

4 Control #2 – complex frequency, Laplace transforms, B


poles and zeros, root locus diagram

5 Control #3 – controller design using root locus, steady A


state errors, Response analysis Aircraft roll

6 Control #4 – frequency response analysis, Bode B


diagram construction

7 Control #5 – Control system design using Bode A


diagrams, stability margins. Steady state errors.

8 Control #6 – Compensation, PID controller, motor B


control PID design using simulation

9 Control #7 – PID tuning (Ziegler-Nichols). Matlab design A


study: PID control design (time response analysis, root
locus)
Tutorial Sheets

• Some problems involve Matlab – DO TRY THEM

• Carnegie-Mellon Matlab Control Design tutorials – on


Moodle

• Tutorials periods: DO ATTEND 


Lecture 1

Introduction to control systems, system models


• Negative feedback
• Control system implementation
• Common input signals, step response
• DE models of dynamic systems
• Block diagrams
• 2nd order system response
• 3rd order system response outline
Control Systems

Open Loop Systems

• Input u(t) not influenced by the response x(t)

Negative Feedback Closed Loop Systems

• System driven by error between actual and demanded position


• The sign of e(t) such that x(t) is driven towards u(t)
Negative feedback
• Fundamental concept automatic control

e=u–x

x<u ⟹ e>0, +ve direction


x>u ⟹ e<0, -ve direction
x=u ⟹ e=0, no driving signal
External disturbance
• External load / disturbance often exists, acting as a 2nd input signal

Want to minimise disturbance response →0

• Closed loop system

1 1
N.B. superposition !

Want to minimise disturbance response: →0


Non-unity feedback

• Transfer function in feedback path


• Typically
– Sensor characteristic
– Noise filtering
• Equivalent unity feedback system, output x’(t):
A Practical Control System
Analogue remote-control positioning system
Computer Control

Control computer
Error
Power
Input + Controller D/A Plant Output
- amp

Signal
A/D Sensor
Conditioning
Control System Design

Step response of a 2nd order system (ξ≤1)

• Steady state response


- error magnitude
- disturbance rejection
• Transient response
- stability
- shape (oscillatory or not)
- overshoot
- speed of response
- settling time
Common Test Cases
• Step input
t

• Ramp Input
(constant speed)
t

• Impulse

• Sinusoid
(Frequency response)

t
SISO System Models:
Differential Equation of Motion

• We are dealing with single-input / single-output dynamic systems


that are linear, time-invariant
• Represented by constant coefficient, linear, differential equations
• General form:
d nx d n 1 x d 3x d 2x dx
an n  an 1 n 1    a3 2  a2 2  a1  a0 x(t )  u (t )
dt dt dt dt dt
‘n’= system LHS: Output and derivatives
order RHS: input

• Solution:
Natural mode of response,
Independent of u(t)

Depends on the input u(t)


Second order system
Mechanical e.g. grounded mass - spring - dashpot
F F = forcing input
Mx  cx  kx  F x(t) = output response
x c k F
M x  x  x
M M M
k c x  2 n x  n2 x  F / M
k Undamped natural frequency
n 
M
Output can
oscillate, c
  damping ratio
depending on 2 kM
value of 
d  n 1   2 Damped natural frequency

< 1, damped oscillation;


 = 1, critical damping;
 > 1 overdamped
Natural mode solution (CF)

Set forcing input 0 (e.g. released from an initial position)

2ζ 0

Form of the solution depends on 


ζ 1

ζ 1

ζ 1 cos sin

Natural mode signal is always present in the system response :


• When released from initial conditions
• Following a change in the forcing input
• When subjected to an external disturbance
Response to unit step input
 < 1 (underdamped)
Step input: t  0, F  0; t  0, F  10

F 
x (1  e nt (cos  d t  sin  d t ))
k 1  2
PI, input dependent
CF, natural mode of response

20 20

15 15
deflection (mm)

deflection (mm)
10 10

5 5
k = 1000 N/m; M = 25 kg; zeta = 0.1; k = 1000 N/m; M = 25 kg; zeta = 0.9;
step force, 10N at t = 0 step force, 10 N at t=0
0 0
0 1 2 3 4 5 0 1 2 3 4 5
time (sec) time (sec)
Second Order System Response
 = 1 (critical damping);  > 1 (overdamped)

12
 (critical damping)
10
deflection (mm)

8 

6

4

2 k = 1000 N/m; M = 25 kg
step force 10N at t = 0
0
0 2 4 6 8 10
time (sec)

Critical damping - minimum rise time with no overshoot 1.18


DC motor model
Interested in speed in response to applying voltage v R L
( t )
i(t)
Assume negligible armature inductance: →0 v(t) Vbemf J
e(t)
Back e.m.f. e(t )  K b (t ) F
f
v ( t )  e( t )
Current: i( t ) 
R
Torque generated by the motor: T( t )  K t i( t )

Mechanical equation of motion: T( t )  J  Fω( t )
dt
Combine above equations d  K K   Kt 
J  F  b t ( t )    v( t )
dt  R   R 

1st order DE, general form


DC motor block diagram
 (t )  (t )

1 1
+ + +
- -
-

Signal flow: cause → effect


Block diagram models of differential equations
dx
Consider a 1st order DE   x ( t )  Ku ( t )
dt

dx
  Ku ( t )  x ( t )
dt
dx dx

u(t) K.u ( t ) dt 1 dt x(t)
K
+
-   dt

• The concept can be applied to any linear DE


• Simulation
DC motor speed response
dx J
Natural mode solution (CF), found by solving   x(t)  0 τ
where K K
dt F b t
R

C t

x ( t )  C.e 

0.37 C

t

Step response (incorporates PI)


t
x(t)  C  C.e τ

u(t) x(t)


Pure Integration u(t) x(t)

Some examples i(t)=const v(t)
1

Ideal current source charging v(t)
a capacitor C
t

Shaft speed = (shaft angle) u(t)


(t) ( t )
x(t)

Higher Order System – combination of simple elements:


• Time constant
• Integration
• Differentiation
DC motor position response

Output speed in response to voltage input: .

Now interested in shaft angle:

DE changes to: .

1
Block diagram .

1
+
-

Response characteristic
• 2nd order, 2 natural modes
• Same form as mass/spring/dashpot: , , etc …
Higher order systems ( )
e.g. Consider 3rd order DE
3 natural modes solution (CF)
• Either 3 exponentials , ,

• Or 1 exponential and a harmonic

cos sin

• Becomes too complex


• Need better mathematical tools to analyse dynamic systems
– Laplace transforms
– Frequency response methods (Bode diagrams)
Lecture 1 Summary

• Control systems
– Negative feedback, closed loop
– Response: transient and steady-state performance
• Dynamic system models
– Linear differential equation of motion, order ‘n’
– Solution
– Block diagram representation: signal flow, transfer functions
• Natural modes of response (CF)
– Signals (functions)
– Generated whenever the dynamic system is disturbed
– Define transient response
– Can be exponential or harmonic
• Need better generic tools to analyse response of complex
(high-order) systems
Lecture 2
Laplace transforms

• Laplace transforms
• What is the ‘Laplace variable’ ?
• Laplace transforms of common signals
• Solution of diff. equation of motion
• Steady state values ( → ∞)
• Transfer function poles and zeros
• Root locus introduction
Laplace Transform

Laplace transform of is

Definition:

where is a complex variable, the Laplace variable.

Physically, the Laplace variable can be interpreted as a complex


frequency variable.
Easy solution of differential equations:
• Solve polynomial instead of differential equation
• Easy way of dealing with initial conditions
• Other “nice” properties let us analyse Control Systems without having to
solve DE explicitly
Complex Frequency ‘ ’
Physically, the Laplace variable ”s” can be interpreted as a complex frequency

Many of the signals we deal with in control are a combination of


exponential and harmonic variation.

Consider the frequency s    i

Time-signal cos sin

Pure exponential   0, e st  et


Pure harmonic   0, e st  eit  (cos t  i sin t )
(constant amplitude)
Complex Frequency Variable: The s-plane

i

 

's-plane‘
(complex conjugate)

In general, any signals f(t) may be represented by a combination of points in the s-plane
Laplace transforms of signals
In most cases of interest in control, f(t) = 0, t < 0 so

 
L f (t )   f (t )e  st dt   f (t )e  st dt
 0
a
Consider step function, amplitude a,
0, 0
i.e.
, 0 t
This image cannot currently be display ed.
Laplace Transforms of some common signals

Step: f(t) = a, t > 0


a
a
F (s) 
s t

Ramp: f(t) = bt, t > 0

b b
F (s)  2
s t

Unit impulse: f(t) = (t)


1
F (s)  1 t
Common Laplace Transforms II

Sinusoid: sin , 0 1


F (s)  2 t
s 2
Cosinusoid: cos , 0 1
s
F ( s)  2 t
s 2
Exponential: , 0
1
1
F (s) 
sa
t
Inverse Laplace Transforms

  i
1
Formally: L F ( s ) 
1
 F ( s ) e st
ds  f (t )u (t )
2i  i
u(t)

Where u(t) =1, t > 0 1


u(t) =0, t < 0

time
The complex integration is difficult in most cases.

However, Laplace transform tables give many useful cases


• we can often split a complicated expression into partial fractions,
• each of which has a relatively simple inverse transform.

Most important information about control systems is obtained in the 's plane'
so we will not deal much with inverse transforms.
Important Properties of Laplace Tranforms
d
x(t ) x( t )
1. Differentiation dt

X( s ) sX( s )

2. Integration x(t )  dt  x( t )dt


1 X( s )
X( s )
s s

3. Final value theorem


Useful for evaluating signals at lim lim .
steady state → →
Valid, provided the limit exists 
Solution of DE using Laplace transforms
Diff. equation is replaced by polynomial, all →

mass-spring-dashpot
Taking Laplace transform
0 0 0
F
x
M Assume zero initial conditions 0 0 0

k c
1

Transfer function
Response analysis
1

Let step function, magnitude F: F s


1
.

From tables use:


X 1 cos sin

Let: k = 1000 N/m; M = 25 kg; c=190 N/m/s; F=10 N

0.4 40
0.01
7.6 40 3.8 5.05

.
0.01 1 cos 5.05 0.75 sin 5.05
System response

0.01 1 . cos 5.05 0.75 sin 5.05

Steady state value of x(t)


lim 0.01

Steady state value of x(t) can be easily obtained


directly from X(s) using the Final Value
Theorem (without )
lim lim .
→ →
Hence:
0.4 0.4
lim lim . 0.01
→ → 7.6 40 40
Transfer function
mass - spring - dashpot
We have identified here that:
F F(t) = input signal
x x(t) = output signal (response)
M

k c
1

Transfer function, G(s)


1
Natural Modes of Response I

General system differential equation:

… + … +

LHS: Output and derivatives RHS: Input and derivatives

Take Laplace transform (zero initial conditions):

⋯ ⋯

Transfer function:

Ratio of two polynomials in ‘s’

Factorise top and bottom polynomials:


… Polynomial roots:
… , …

Natural Modes of Response II

Let: → … Then: →0 Transfer function ‘zeros’:

More importantly:
Let: → … Then: →∞ Transfer function ‘poles’:

Interpretation of system poles:


• Infinite output for a finite input
• Finite output for a vanishingly small input

= Natural modes of response

• Poles can be represented by points in the s-plane (signals, )


• Poles define transient response (external input, release from initial conditions)
• Fundamental property defining system dynamics
Natural modes of response
Pole Locations in ‘s plane’
i

 

Marginal
stability
Unstable
Stable region region
Example: transfer function poles and zeros
Gain K is adjustable (design parameter)
Consider the control system below.
Gain K is adjustable (the ‘design parameter’)
1
+ 1 2
-

Open loop poles: 0, 1, 2 2 1


Open loop zero:

Consider the closed loop system:

1
1 2
1 1 2
1
1 2

Closed loop poles: 1 2 0 Depend on gain !


Closed loop poles: 1 2 0
0 3 2 0
1 2 0 same as open loop pole locations
0.1 2
3 2 0.1 0
→ 0.9, 0.05, 2.04
0.3
3 2 0.3 0
→ 0.21, 0.66, 2.13 1

0.5
3 2 0.5 0
→ 0.40 0.25, 2.19

1 1
3 2 1 0 3 2 1
→ 0.34 0.56, 2.32
2
3 2 2 0
→ 0.24 0.86, 2.52 1

5
3 2 5 0
→ 0.05 1.31, 2.90
10 2
3 2 10 0
→ 0.04 1.50, 3.09
Closed loop poles: 1 2 0
0 3 2 0
1 2 0 Open loop pole locations
0.1 2
3 2 0.1 0
→ 0.9, 0.05, 2.04
0.3
3 2 0.3 0
→ 0.21, 0.66, 2.13 1

0.5
3 2 0.5 0
→ 0.40 0.25, 2.19

1 1
3 2 1 0 3 2 1
→ 0.34 0.56, 2.32
2
3 2 2 0
→ 0.24 0.86, 2.52 1

5
3 2 5 0
→ 0.05 1.31, 2.90
10 2
3 2 10 0
→ 0.04 1.50, 3.09
Root locus diagram

• Positions of closed loop poles as a function of Gain 0 ∞


• Closed loop poles = natural modes of response (transients)

Properties:
• Symmetrical about axis
• Number of branches = number of open loop poles
• Branches:
– start at open loop poles,
– end at open loop zeros or at → ∞.

• Matlab function: rlocus(transfer_function)


Lecture 3

Control systems design using Root Locus

• Producing Root Locus diagram


• Transient Response using Root Locus
• Example (Matlab)Aircraft roll control
– Simulation
– Step response
– Effect of increasing gain
• Steady state error analysis
– Final value theorem
– System class
Root locus construction methods

1. Manually find denominator roots for various K


values
– Lot of work, not practical !

2. Matlab (or similar computational tool)


Matlab function: rlocus(transfer_function)

3. Use known properties of root locus


– Find hints about the overall shape
– Evaluate key features
– Sketch
Root locus: some sketching guides

• Symmetrical about -axis


• # of branches = # of open loop poles
• Each branch:
– Starts 0 at open loop pole
– Ends → ∞ at open loop zero or at →∞
• Asymptotes for branches at →∞
– can be calculated
– Radiate from origin on -axis
– Equally spaced
• Portion of -axis occupied by RL
– On the LEFT of an ODD MUMBER of poles & zeros
• crossing = oscillation freq @ marginal stability
• RL branches in general
– Attracted by OL zeros
– Repelled by OL poles (and by each other)
Root locus: Sketching

Asymptotes
→∞
Real axis crossing
portion of RL

Open loop
poles & zeros
‘Breakaway’
points

Gain K at any selected point along RL:


• Can be found by measuring distances to OL poles & zeros
• Matlab command available: rlocfind
Root locus examples
1 1
. . . .

j
j

asymptotes


double
CL pole
Root locus examples

1
. .
. .

j
j



Root locus examples

. .

Stable
for all K Unstable
for all K
Root locus examples 1
. .
1
. . j
j

asymptotes


double
CL pole

. .
Closed Loop System Design
Adjustable gain

Closed loop transfer function:

1
K influences the position of
closed loop poles
Therefore
• gain K influences closed loop natural modes (transient response)
• Oscillatory/damped, stable/unstable

Root Locus diagram:


• Positions of closed loop poles in the s-plane
• Readily available in Matlab
Control Analysis & Design Using Root Locus
Objective: to find gain K that results in a desired transient response
Design steps:

1. Open loop system defined by


its poles and zeros
2. Plot root locus: closed loop poles for
0 ∞
3. Choose suitable closed loop pole
positions on the RL
4. Find corresponding gain

2
Design criteria is s-plane
Consider a pole pair
j
j



• Lines of constant damping ratio


• Lines of constant natural frequency
• Exponential : settling time

j j
s-plane regions
Settling time criterion
Damping ratio
criterion
 
Matlab analysis example: Aircraft Roll Control

Measured using
Schematics of a roll control system for an aircraft rate gyroscope

Adjustable gain
Integration

1 5 1
s1 s  5 s
Aircraft Roll Control II
Open loop transfer function:
5 5
1 5 6 5
Open loop poles: 0, 1, 5

Closed loop transfer function


5
6 5 5
5 6 5 5
1
6 5
Gain K influences
closed loop poles
Simulation in Matlab
5
Open loop transfer function:
6 5
% Start Matlab text editor + K
5
- 6 5
% Define open loop transfer function:
num = [5]; Coeffts of
den = [1, 6, 5,0];

plant = tf (num,den);
% Define controller gain K=0.1:
contr =0.1;
% Define closed loop unity-feedback system:
system = feedback(contr*plant,1);
% Plot step response:
t = 0:0.01:60;
step (system,t) Unity feedback

num = [5];
den = [1,6,5,0];
plant = tf (num,den);
contr = 0.1;
system = feedback(contr*plant,1);
t = 0:0.01:60;
step (system,t)
Closed loop poles K=0.1

+ K
5 5
- 6 5 6 5 5

Matlab command:
>> pzmap(system)

Exponential modes
Aircraft Roll Control III
Same system, increase K=1
num = [5];
den = [1,6,5,0];
plant = tf (num,den);
contr = 1;
system = feedback(contr*plant,1);
t = 0:0.01:60;
step (system,t)
Faster response, more oscillatory

Oscillatory mode
(complex conjugate poles)
Closed loop poles
>> pzmap(system)

• Exponential mode decays faster


• Oscillatory modes are ‘dominant’

Exponential mode
Response with increasing Gain K
Try K=5 Try even larger gain K=7

Very oscillatory
Unstable

Near Imaginary axis


(In left half-plane) In right half-plane
Root locus:
Closed loop pole positions for increasing gain K

Matlab comands:

%To plot root locus for ‘plant’


>> rlocus(plant)

Increasing K

%Returns gain and selected poles:


>>(k,poles)=rlocfind(plant)
Open loop poles
K=0
Choose gain according to
Root Locus
num = [5]; 3
0.84 0.74 0.6 0.42 0.22
den = [1,6,5,0]; 0.91
plant = tf (num,den);
rlocus(plant) 2
sgrid 0.96

Imaginary Axis (seconds-1)


1
From the root locus, 0.99

0.64 corresponds to poles


0.41 0.525 0
5 4 3 2 1

Characteristic equation: 0.99


-1
1 0
5
1 0 0.96
6 5 -2
6 5 5 0
0.91
0.84 0.74 0.6 0.42 0.22
-3
-5 -4 -3 -2 -1 0
Substitute 0.41 0.525
Real Axis (seconds -1)
0.41 0.525 6 0.41 0.525 5 0.41 0.525 5
0
Equating parts: 0.0351 0.245 0.474 2.22 5 0
.
SISOtool: Matlab GUI for control design
Matlab comand >>sisotool

Root locus

System
configuration
setup
Bode diagram
(open loop)

Bode diagram Response plots


(closed loop)
Lecture 4

Frequency Response Analysis (Bode diagrams)

• Transfer function: magnitude and phase


• Cascaded transfer function
• Bode diagram construction (corner plot)
• Stability investigation
• Gain and phase margins
• Aircraft roll control: design using Bode diagrams
Frequency response analysis
• Dynamic systems can also be analysed using Bode diagrams
• System = “Signal filter”
• Most physical systems represent low-pass filters (due to inertia, friction)

Laplace transforms introduced the complex frequency variable

Let 0, so:
• constant amplitude harmonic signal angular frequency
Transfer function
Magnitude and phase relationship between input and output

x(t )

K.G ( j)



Phasor diagram representation

Vi

ωt Vo
ωt
Cascade of simple transfer functions
Overall transfer function T1*T2*T3
• Product of magnitudes (gains)
• Sum of phase shifts

Overall magnitude:

In dB (sum of logs):
20 log 20 log + 20 log + 20 log

Overall phase shift: φ φ φ +φ We can plot Individual Bode diagrams


Add them graphically
Aircraft Roll Control system
Measured using rate gyro

Adjustable gain
Integration

1 5 1
s1 s  5 s

Frequency response analysis



• Preferred form of transfer function: G s (for hand computation)
• Assume unity negative feedback

1 1 1
1  jω 1  0.2 jω jω

Bode diagram constructed for


the OPEN LOOP SYSTEM
Bode diagram
1 1 1
1  jω 1  0.2 jω jω
The open loop system
consists of:
2 x time-constant elements
(1st order low-pass filter) Integrator

 
20.log10 K * ωτ*



ωτ*

 5
 45 

 45

 90 
 90

Overall open loop system Bode diagram:


• Addition of 1st order elements (magnitude, phase)
Bode corner plot – by hand
1 1 1
1 1 0.2
1
1  jω 1
1
j 1  0.2 jω

K
j
1 1 1
Bode phase diagram 1 1 0.2
90° tan tan
90° tan tan 0.2
Bode plot using Matlab (K=1)
Matlab comands:
K>1
num = [5];
den = [1,6,5,0];
plant = tf (num,den);
bode(plant)
K=1

Increasing gain K:

• Magnitude line raised by


20log(K) dB
• Phase line unchanged
Stability Analysis of unity feedback system

u e KG ( j) x


OPEN LOOP TRANSFER FUNCTION is: K.G ( j)

while the CLOSED LOOP TRANSFER FUNCTION is

x K.G ( j)

u 1  K.G ( j)

• It is quite reasonable to expect that there exists a combination of


values K and ω , such that open loop transfer is:

NB: x/u now involves division by zero! ( → ∞ for finite u)


Visualise using phasors

• The filter KG(jω) provides magnitude change and phase shift

• When KG(jω) = -1
Closed loop: self-sustained oscillations
.

u0
1
u e
KG ( j) x


In this case
• Negative feedback makes Loop Transfer = (-1)(-1) = +1.
• Closed loop system becomes self-oscillatory,
• Once set in motion, the system will oscillate forever, even if u=0.

NB: This system has closed loop poles exactly on the -axis
Stability limits

1
e
u0 KG ( j) x


Situation above represents the marginal stability case

Consider: K.G ( j)  1 But magnitude < 1 ,


then the system is stable

but larger magnitude > 1 ,


Or if: K.G ( j)  1 then the system is unstable.
Microphone feedback
Stability Analysis
• Open loop transfer function KG(jω) is a complex number
• represented by magnitude and phase angle

• the stability condition KG(jω)= -1 can be defined as:


Magnitude condition K.G ( j)  1

Phase condition K.G ( j)  180

Both conditions can be readily investigated using the Bode diagrams


Bode diagram of KG(jω):
Marginally stable closed loop system
u e KG ( j) x

KG ( j )

0dB

Note:

We plot:
• Bode diagram of the
open loop TF KG(jω)
0.1 1 10

In order to analyse
• closed loop system
response

-180

0.1 1 10
Increased gain K:
Unstable closed loop system
u e KG ( j) x


Increased gain K:

N.B.
• Gain change
only affects the
magnitude plot
• up/down by
20log10(K) dB
Reduced gain K
Stable closed loop system

e KG ( j) x
u

KG ( j )

Reduced gain K: 0dB

0.1 1 10

-180

0.1 1 10
e
u

KG ( j) x
Stability Margins

Gain Margin:
ADDITIONAL GAIN that
can be introduced before Gain Margin
the onset of instability

Phase Margin:
ADDITIONAL PHASE LAG
that can be introduced
before the onset of Phase Margin
instability
Problem sheet 4 Q1
1. Figures below show Bode magnitude corner plots for some transfer
functions . In each case:
(i) Estimate the gain .
(ii) Estimate the frequency dependent part by considering
the slopes and the corner frequencies.
a) As → 0, → 30

∴ 20 log 30
30 31.6

Consider corner frequencies and slopes


• Below both corner frequencies 0
• At 1 20 / ∴Integration time constant

• At 5 40 / ∴Integration time constant

Overall transfer function: K


As → 0, →
b)
Low-freq. asymptote:
When 1, 0 1
∴ 1

Consider corner frequencies and slopes


• At low frequencies 20 / ∴Integration

• At 1 0 / ∴Diff. time constant 1 , numerator

• At 4 20 / ∴Integration time constant

• At 10 40 / ∴Integration time constant

Overall transfer function:


As → 0, →
c)
Low-freq. asymptote:
When 10, 0 1
∴ 10

Consider corner frequencies and slopes


• At low frequencies 20 / ∴Integration

• At 1 40 / ∴Integration time constant

• At 2 20 / ∴Diff. time constant 1 , numerator

• At 20 20 / ∴Integration time constant

Overall transfer function:


Lecture 5

Control design using Bode diagrams

• Stability margins vs. damping ratio (2nd order)


• Phase margin as a design criterion
• Aircraft roll control: design using Bode diagrams

Steady state errors


• Final value theorem
• System ‘Class’
Consider a 2nd order system
(e.g. permanent magnet DC motor)
Open Loop transfer function
u e KG ( j) x

1

Closed Loop transfer function

1

1 1 1
1

In the 2nd order standard form:


where: is damping ratio
2 is undamped natural frequency
and is determine all transient response parameters for a
2nd order system e K
u x
j1  j

Step response

Time to reach first peak:


1
2
/
% Overshoot: % . . 100

Settling time: 4
(2% of final value)
Frequency response (2nd order system)
e K
u x
j1  j

Damped resonant
frequency: d   n 1   2

Resonance peak 1
M
magnitude: 2
e K
… but for control design we plot the u x
j1  j
open loop Bode diagram

Closed Loop transfer function

Corresponding
open loop transfer function

Closed loop performance:

• is related to phase
margin (how oscillatory)
• is closely related to
bandwith (how fast)
Phase Margin is used as a useful measure of
transient performance

Response parameters for a 2nd order dynamic system

ξ M % O/S Phase 
Margin (deg)
100
0 ∞ 100 0 90
0.1 5.0 73 12.5 80

0.2 2.5 53 25.9 70

0.3 1.7 37 38.6 60

50

PM
0.4 1.3 25 49.1
40
0.5 1.0 16 57.2 30
0.6 0.8 9 63.4 20

0.7 0.7 5 68.0 10

0.8 ‐ 2 71.5 0
0 0.5 1 1.5 2 2.5 3 3.5
1.0 ‐ 0 76.3 Damping ratio
1.2 ‐ 0 79.4
1.3 ‐ 0 80.6
What do we do for system higher than 2nd order?

• Assume 2nd order behaviour (dominant modes of response)


• Additional modes typically decay much faster
– Small effect on the overall response curve

• e.g. 3rd order system, natural modes: exponential and a harmonic

cos sin
Aircraft roll control example

1 5 1
s1 s  5 s

Convenient form for Root Locus

Rewrite open loop transfer function by replacing ‘ ’ with ’ ’


5 1
1 5 1 1 0.2

1 1 1
1  jω 1  0.2 jω jω

Convenient form for Bode diagrams


Bode diagram: design analysis

1 1 1
1  jω 1  0.2 jω jω

a) Plot the Bode diagram for the open loop system, assuming K=1.
Estimate the frequency at which the phase is −180°
Find Gain Margin, Phase Margin

b) Estimate the maximum amplifier gain K for which the closed loop system is stable.

c) Estimate the gain K for which the closed loop system will be critically damped (ξ=1).
Bode plot K=1

ξ Phase 

GM=15.6 dB Margin 
(deg)
0 0
0.1 12.5
0.2 25.9
0.3 38.6
0.4 49.1
0.5 57.2
0.6 63.4
0.7 68.0
0.8 71.5
1.0 76.3
1.2 79.4
1.3 80.6
PM=43 deg
Step response, K=1

Settling time ~ 12 seconds


Overshoot ~25%
From the Bode plot
(a) Plot the Bode diagram for the open loop system, assuming K=1.
Estimate the frequency at which the phase is −180°
Find Gain Margin, Phase Margin

• phase is −180° at
frequency ω=2.2 rad.s-1 GM=15.6 dB

• corresponding magnitude
is −15.6 dB

• Gain Margin =15.6 dB


• Phase Margin = 43 deg

PM=43 deg
From the Bode plot
(b) Estimate the maximum amplifier gain K for which the closed loop system is stable

Maximum gain for stability is


GM=15.6 dB
15.6dB = 20log10(K)

or K=6.03

PM=43 deg
(c) ξ=1 corresponds to Phase Margin ≈76 deg
ξ Phase 
Margin 
(deg)
0 0
0.1 12.5 New 0dB line
0.2 25.9 K=0.25
0.3 38.6 12dB
0.4 49.1
0.5 57.2
0.6 63.4
0.7 68.0
0.8 71.5
1.0 76.3
Bode plot for K=1
1.2 79.4
1.3 80.6

Gain has to be reduced


from K=1 (0dB) by 12dB 76 deg

Hence:
−12dB= 20log10(K)

or K=0.25
Step response

K=1
Position

Error

K = 0.25

Critical damping
• Fast response
• No overshoot
Steady state errors

u + e x
Consider the control system:
- 1 1 2

1
. →
1 .

Error e in response to input u


1 1 1 1 2
1 . 1 1 1 2
1 1 2

Final value theorem of Laplace transform:


lim lim . (provided the limit exists, i.e. stable system )
→ →

Therefore steady state error:


1 1 2
lim lim . lim .
→ → → 1 1 2
Steady state errors /2

u + e x
- 1 1 2

1
Let u(t) = unit step

1 1 2 1 1 1 2 1
lim lim . . lim
→ → 1 1 2 → 1 1 2 1

1
1
1 K
Need → ∞ to achieve zero
steady state error

t
Steady state errors /3
Consider now similar system u + e x
- 1 1 2

1 1 1 1 2
1 . 1 1 1 2
1 1 2
1
Unit step input

1 1 2 1 1 1 2
lim lim . . lim 0
→ → 1 1 2 → 1 1 2

Zero steady state error, owing to integration in the forward path!

1
Unit ramp input
1 1 2 1 1 1 2 1
lim lim . . lim
→ → 1 1 2 → 1 1 2
Response to a ramp input

u, x
1
E ss 
K

t
System Class
• System class is equal to the number of ‘free integrators’ in the open loop transfer function.
• Determines the steady state errors that the system will exhibit in response to different types of
input.
• ‘Class 0’ – no free integrators and it will exhibit a finite positional error in response to a step input
(droop)
• ‘Class 1’ – zero steady state error due to step, but a finite steady state error due to ramp.

Input signal  U(s)  Steady state error for class 


  0 1  2 3
Unit step  1 1
  E ss    0  0  0 
 
s 1 K
Unit ramp  1 1
  E ss     E ss    0  0 
 
s2 K
1 1
n
Unit acc  
  E ss     E ss     E ss    0 
 
s3 K
Steady state errors summary

In general:
• Aim to maximise DC gain, K
– Reduced steady state errors
– Improved disturbance rejection
– Upper limit: system may become too oscillatory or even unstable
• Integrator holds a constant output value for zero input
– ‘Infinite DC gain’
• Output of a time constant reduces to zero for zero input
Lecture 6

Compensation

PD, PI, PID controller


• overall principles
• filter characteristics

Matlab example
• PID control design
using simulation
Compensation

• Filter combined with open loop transfer function


• Reshapes the error signal to achieve improved response
– Reduce (or eliminate) steady state errors
– Better transient response (stability, speed of response, settling time)
• Various filter types are found in practice
– Low pass, high pass, integration, differentiation
• Usually implemented as:
– Electronic filters: Active (using op-amps) or passive (R-L-C network)
– Digital filters (software algorithm)
• We shall focus on Proportional + Integral + Derivative controller
PID Controller

KDs

KP
G( s )
KI
s

Controller transfer function is expressed as:

or
1
1 TI = integration time constant
TD = differentiation time constant
PID implementation: op-amps
PID component
signals during step
response

Provides the correct sign (+/-) for the


control signal
– Drives the system towards the target

Initial ‘kick’, then becomes negative


– Fast response, improved settling time
(damping)

Can hold constant value for zero error


– Reduces steady state errors
e
u

KG ( j) x
Improving Bode diagram shape 2/2

Improve transient response = Increase stability margins


e
u

KG ( j) x
Improving Bode diagram shape 1/2

Reduce steady state error = Increase low-frequency gain


PID filter characteristics 1/3

PD – high-pass filter

G PD

Kp

Kp 
Kd
Phase advance at high frequencies:
• Improved stability margins  90
• Improved damping Phase
angle

0 
PID filter characteristics 2/3

PI – low-pass filter

G PI

High gain @ low-frequency :


• Reduced steady state errors  Kp
• Integrator:
• DC magnitude → ∞ KI 
• Steady state error→ 0 Kp

0 
Negative phase
• Reduced stability margins   90
• More oscillatory response 
PID filter characteristics 2/3

PID – notch filter

GPID

High gain @ low-frequency :


• Reduced steady state errors 
Phase
angle
 90

Phase advance at high frequencies:


• Improved damping 
0 

 90
Matlab: DC Motor Position Control
PID Design using simulation
J = 3.2284E-6 kg.m2/s2
b = 3.5077E-6 Nms
K=Ke=Kt = 0.0274 Nm/Amp
R = 4 ohm
L = 2.75E-6 H
V: Source Voltage, input
: position of shaft, output

Differential Equations

Transfer function:

Laplace transforms of DEs

Θ
Θ
Design requirements


 

• Settling time less than 40 milliseconds


• Overshoot less than 16%
• No steady-state error due to step input
• No steady-state error due to a disturbance
Matlab model: motor
J=3.2284E‐6;

b=3.5077E‐6;
 
K=0.0274;
R=4;
L=2.75E‐6;
num=K;
den=[(J*L) ((J*R)+(L*b)) ((b*R)+K^2) 0];
motor=tf(num,den);

Plot open loop step response


step(motor,0:0.001:0.2)
Closed loop: proportional control
Try using a proportional controller with KP=1.7.

Kp=1.7;  
contr=Kp;
sys_cl=feedback(contr*motor,1);

Response to step input R, D=0


t=0:0.001:0.2;
step(sys_cl,t)
Proportional control 2

Response to step disturbance D, R=0
 

Rearrange the control loop

dist_cl=feedback(motor,contr);
step(dist_cl,t)

From the simulations we see that


• the steady-state error due to step looks good
• the steady-state error due to a disturbance is
large
• the settling time is too large
• the overshoot is too large.
PID Control
Recall that :
• adding an integral term will eliminate the steady-state

error and
 
• a derivative term will reduce the overshoot.

First try a PI controller to get rid of the disturbance steady


state error
Kp=1.7 (as before) 1.7 20
Ki =20.

J=3.2284E‐6;
b=3.5077E‐6;
K=0.0274;
R=4;
L=2.75E‐6;
num=K;
den=[(J*L) ((J*R)+(L*b)) ((b*R)+K^2) 0];
motor=tf(num,den);
Kp=1.7;
Ki=20;
contr=tf([Kp Ki],[1 0]);
sys_cl=feedback(contr*motor,1);
PI control performance
Response to step input R, D=0
t=0:0.001:0.4;
step(sys_cl,t)

Response to step disturbance D, R=0


figure
dist_cl=feedback(motor,contr);
step(dist_cl,t)

From the plots:


• PI control has reduced the steady state error
to zero
• Overshoot too large
• Settling time is still too long
Tuning PI gains
Increase the both P and I gains in order to speed up the
response
Kp=17
Ki =200.

1.7 20 17 200
10

Note
• the zero introduced by PI is still at 11.8,
.
• loop gain has increased 10

• The response is faster than before,


• The overshoot has worsened (large)
PID Control
Add derivative term Kd=0.15
to reduce the overshoot

200
17 0.15
Kp=17;
Ki=200;
Kd=0.15;
contr=tf([Kd Kp Ki],[1 0]);
sys_cl=feedback(contr*motor,1);
t=0:0.001:0.1;
step(sys_cl,t)

From the plots:


• step response looks really good - less than 16%
overshoot, settling time is ~40ms,
• no steady-state error.
• Step disturbance response is now really slow

D-term ‘applies the brakes’ as the system approaches


the target.
Tuning PID gains
Increase Ki from 200 to 600 to speed up the disturbance response.

600
17 0.15

We can see that


• settling time of ~40ms, less than 16% overshoot
• no steady state error.
• step disturbance response no steady state error, settles to within 2% in 40 ms.

All design requirements satisfied with Kp=17, Ki=600, Kd=0.15


Lecture 7

PID controller design


• Ziegler-Nichols PID tuning guide
• PID control design using root locus
PID Tuning: Ziegler-Nichols method
1
1

• Selecting even the initial values of the three PID parameters is in practice often
difficult.
• Ziegler-Nichols empirical method has been shown to work well in practice.
• 2 separate cases: oscillatory and non-oscillatory systems

1. Oscillatory systems (low damping)

Assume that the system to be controlled is:


• Predominantly oscillatory
o E.g. fast electromechanical systems
• Under P-control it is stable for gains in the range 0 < K < Kc
• Becomes unstable in an oscillatory manner for gains K > Kc.
P control K = 0.5 Kc
PID tuning procedure:
1. P-control: Increase gain K until the onset of continuous K = 0.45 Kc
PI control
oscillations. TI = 0.833 T
2. Note the gain value Kc and the period of oscillations T.
K = 0.6 Kc
3. The recommended initial controller settings are:
PID control TI = 0.5 T
Td = 0.125 T
PID Tuning: Ziegler-Nichols method 2
2. Non-Oscillatory systems
• Systems that do not exhibit oscillatory behaviour
• Possibly significant response delay.
• typical for process plants with large inertias (e.g. temperature control for a boiler or
room heating).
Output
R
PID tuning procedure:
• Generate a step response for the open 
loop plant. 
• Measure the slope of the response R (at 
the point of inflection) and the time lag L.

P control 1/

0.9/ t
PI control L
3.3
1.2/
PID control 2
0.5
Root Locus Plot
Adjustable gain

Closed loop transfer function:

1
K influences the position of
closed loop poles

• Lines in s-plane where closed loop poles lie


• Position along lines depends on K
Root locus construction methods

1. Matlab (or similar computational tool)


2. Manually find denominator roots for various K values
– Lot of work, not practical !
3. Use known properties of root locus
– Get hints about its shape
– Evaluate key features
– Sketch
Root locus: some sketching guides

• Symmetrical about -axis


• # of branches = # of open loop poles
• Each branch:
– Starts 0 at open loop pole
– Ends → ∞ at open loop zero or at →∞
• Asymptotes for branches at →∞
– can be calculated
– Radiate from origin on -axis
– Equally spaced
• Portion of -axis occupied by RL
– On the LEFT of an ODD MUMBER of poles & zeros
• crossing = oscillation freq @ marginal stability
• RL branches in general
– Attracted by OL zeros
– Repelled by OL poles (and by each other)
Root locus: Sketching

Asymptotes
→∞
Real axis crossing
portion of RL

Open loop
poles & zeros
‘Breakaway’
points

Gain K at any selected point along RL:


• Can be found by measuring distances to OL poles & zeros
• Matlab command available: rlocfind
Root locus examples
1 1
. . . .

j
j

asymptotes


double
CL pole
Root locus examples

1
. .
. .

j
j



Root locus examples

. .

Stable
for all K Unstable
for all K
PID Controller design using Root Locus

J = 3.2284E-6 kg.m2/s2
b = 3.5077E-6 N/m/s
K=Ke=Kt = 0.0274 Nm/Amp 
 
R = 4 ohm
L = 2.75E-6 H
V: Source Voltage, input
: position of shaft, output
Design requirements
• Settling time < 40 ms
• Overshoot <16%
• No steady-state error due to step input
• No steady-state error due to a steady disturbance (step)

Settling time = 40 ms to decay to 2%


closed loop natural modes decay according to 2%
0.04 log 0.02 3.91
100

Overshoot <16%  damping ratio 0.5


Desirable s-plane regions for CL poles

sin

j j

 

Lines
Drawing the root locus: P–control

 

Root Locus
6
J=3.2284E‐6; 40 x 10 Root Locus
2.5 0.5
b=3.5077E‐6; 0.5
K=0.0274;
R=4; 30 2
L=2.75E‐6;
num=K; 1.5
den=[(J*L) ((J*R)+(L*b)) ((b*R)+K^2) 0];
20
motor=tf(num,den) 1

Imaginary Axis (seconds-1)


10 0.5

0
0
rlocus(motor) NB: very
-0.5 fast decaying mode,
1.5 10
%lines of constant -10 -1
%(radial through origin) -1.5
sgrid(.5,0) sigrid(100)
-20
-2
%lines of constant
0.5
%in (vertical) -30 -2.5
-4 -3 -2 -1 0 1 2
-1 6
0.5 )
Real Axis (seconds x 10
-40
-70 -60 -50 -40 -30 -20 -10 0 10
Model reduction
Assume L→0

In Matlab we can automatically find fastest pole and eliminate it


1

J=3.2284E‐6;
b=3.5077E‐6;
K=0.0274;
R=4;
L=2.75E‐6;
num=K;
den=[(J*L) ((J*R)+(L*b)) ((b*R)+K^2) 0];
poles=roots(den);
%deconvolution (polynomial division)
den2=deconv(den,[1/max(abs(poles)) 1]);
motor=tf(num,den2);
rlocus(motor)
sgrid(.5,0)
sigrid(100)
Integral Control

1 
 

• never stable
• another controller must be
used

Now:
Double pole @
origin
PI Control
20

20 
 

contr=tf([1 20],[1 0]);

• System is stable
• Zero steady-state error
to a disturbance,
• Response still not fast
enough
• Poor damping
PID Control


60 70 60 70
 

130 4200
Root Locus

0.5

numc=conv([1 60],[1 70]); 100

denc=[1 0];
contr=tf(numc,denc);
50
Imaginary Axis (seconds-1)

-50

-100

0.5

-300 -250 -200 -150 -100 -50 0 50


Real Axis (seconds -1)
Finding the gain (rlocfind command)
[k,poles] = rlocfind(contr*motor)

Root Locus

0.5

100

selected_point = -99.7038 +63.5070i


50

Imaginary Axis (seconds-1)


k = 0.0945

-50

-100

0.5
-300 -250 -200 -150 -100 -50 0 50
Real Axis (seconds -1)
Response, K=0.0945

Step input Step disturbance


Step Response Step Response
1.4 0.07

1.2 0.06

1 0.05

0.8 0.04
Amplitude

p
0.6 0.03

0.4 0.02

0.2 0.01

0 0
0 0.05 0.1 0.15 0.2 0.25 0 0.05 0.1 0.15 0.2 0.25
Time (seconds) Time (seconds)

Satisfactory Satisfactory

sys_cl=feedback(k*contr*motor,1);
Try higher gain

[k,poles] = rlocfind(contr*motor)
sys_cl=feedback(k*contr*motor,1);

Root Locus

0.5

100
selected_point =
‐1.3943e+02+ 1.8502e+01i
k = 0.1309
poles = Imaginary Axis (seconds-1) 50

1.0e+06 * ‐1.4542
‐0.0001 + 0.0000i
‐0.0001 ‐ 0.0000i 0
‐0.0001

-50

-100

0.5
-300 -250 -200 -150 -100 -50 0 50
Real Axis (seconds -1)
PID Control – time response, K=0.13
Step input Step disturbance
Step Response Step Response
1.4 0.05

0.045
1.2
0.04

1
0.035

0.03
0.8
Amplitude

Amplitude
0.025

0.6
0.02

0.4 0.015

0.01
0.2
0.005

0 0
0 0.05 0.1 0.15 0.2 0.25 0 0.05 0.1 0.15 0.2 0.25
Time (seconds) Time (seconds)

• All the design requirements have been met


• The final form of the PID controller is

60 70 0.13 16.9 546


0.13
Problem sheet 4 Q1
1. Figures below show Bode magnitude corner plots for some transfer
functions . In each case:
(i) Estimate the gain .
(ii) Estimate the frequency dependent part by considering
the slopes and the corner frequencies.
a) As → 0, → 30

∴ 20 log 30
30 31.6

Consider corner frequencies and slopes


• Below both corner frequencies 0
• At 1 20 / ∴Integration time constant

• At 5 40 / ∴Integration time constant

Overall transfer function: K


As → 0, →
c)
When 10, 0 1
∴ 10

Consider corner frequencies and slopes


• At low frequencies 20 / ∴Integration

• At 1 40 / ∴Integration time constant

• At 2 20 / ∴Diff. time constant 1 , numerator

• At 20 20 / ∴Integration time constant

Overall transfer function: K


END
External load
Consider the error signal in response to u and d
1 1
1 1 2 s 1  s 1  2 s 

. . .
→ . . .
1
. .
1 . 1 .
1
1 1 1 2
. .
1 1
1 1 2 1 1 2

1 1 2 1
. .
1 1 2 1 1 2

Let u=0, constant, so a step function applied at 0


1
lim lim . .
→ → 1 1 2

Potrebbero piacerti anche