0% found this document useful (0 votes)
101 views

Control System - Slides

The document outlines a course on classical and modern control systems. It provides an introduction and contact information for the instructor. It then lists the main topics to be covered, including modeling, frequency analysis, time analysis, software, labs, and MATLAB commands. Example topics within the sections include integration by parts, partial fraction expansion, determinants, the adjoint and inverse of matrices, Laplace transform tables, and plotting transfer functions.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
101 views

Control System - Slides

The document outlines a course on classical and modern control systems. It provides an introduction and contact information for the instructor. It then lists the main topics to be covered, including modeling, frequency analysis, time analysis, software, labs, and MATLAB commands. Example topics within the sections include integration by parts, partial fraction expansion, determinants, the adjoint and inverse of matrices, Laplace transform tables, and plotting transfer functions.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 99

Classical and Modern Control

Qazi Ejaz Ur Rehman


Avionics Engineer

Graduate Research Assistant


Aerospace & Astronautics Department
Institute of Space Technology
Islamabad

December 18, 2015


Classical and Modern
Control Outline
Qazi Ejaz Ur Rehman
Avionics Engineer
1 Introduction
Administration
Introduction
Administration
Basic Math
Basic Math Laplace
Laplace

Overview
2 Overview
Modeling
3 Modeling
Electrical
Mechanical
Electrical
Frequency
Mechanical
(continous)
Analysis
4 Frequency (continous)
Time Analysis
(Continous)
Analysis
5 Time (Continous)
Software Analysis
Optional 6 Software
Labs 7 Optional
Matlab
Commands
8 Labs
Quiz
9 Matlab Commands
2/95 10 Quiz
Classical and Modern
Control Introduction
Qazi Ejaz Ur Rehman
Avionics Engineer Contact

Introduction
Administration
Basic Math
Laplace

Overview

Modeling
Electrical • Office No.: 051-907-5504 %
Mechanical

Frequency
• E-mail: [email protected] 1
(continous)
Analysis • Office hours: After 11:00 am
Time
(Continous)
Analysis

Software

Optional

Labs

Matlab
Commands

Quiz
1
3/95 [email protected]
Classical and Modern
Control Introduction
Qazi Ejaz Ur Rehman
Avionics Engineer Text Book

Introduction
Administration
Basic Math
Laplace

Overview

Modeling
Electrical
Mechanical

Frequency
(continous)
Analysis

Time
(Continous)
Analysis

Software

Optional

Labs

Matlab
Commands

Quiz

4/95
Classical and Modern
Control Introduction
Qazi Ejaz Ur Rehman
Avionics Engineer Text Book

Introduction
Administration
Basic Math
Laplace

Overview

Modeling
Electrical
Mechanical

Frequency
(continous)
Analysis

Time
(Continous)
Analysis

Software

Optional

Labs

Matlab
Commands

Quiz

5/95
Classical and Modern
Control Calculus
Qazi Ejaz Ur Rehman
Avionics Engineer Integration by parts

Introduction
Administration
Basic Math
Laplace

Overview

Modeling
Electrical
Mechanical

Frequency
(continous)
Analysis

Time
(Continous)
Analysis

Software 2
Optional

Labs

Matlab
Commands

Quiz
2 Link
6/95
Classical and Modern
Control Linear Algebra
Qazi Ejaz Ur Rehman
Avionics Engineer Partial fraction expansion

Introduction
Administration
Basic Math
Laplace

Overview

Modeling
Electrical
Mechanical

Frequency
(continous)
Analysis

Time
(Continous)
Analysis

Software

Optional

Labs

Matlab
Commands 3
Quiz
3 Link
7/95
Classical and Modern
Control Linear Algebra
Qazi Ejaz Ur Rehman
Avionics Engineer Determinants

Introduction
Administration
Basic Math
Laplace

Overview Here’s an easy illustration that shows why the determinant


Modeling of a matrix with linear dependent rows is 0
Electrical
Mechanical
" #
a b
Frequency
M=
(continous)
Analysis
2a 2b
Time
(Continous) ⇒ |M| = a(2b) − 2b(a) = 0
Analysis

Software Let’s look at a 3x3 example.


Optional

Labs

Matlab
Commands

Quiz

8/95
Classical and Modern
Control Linear Algebra
Qazi Ejaz Ur Rehman
Avionics Engineer Determinants
 
a b c
M = 2a 2b c 
Introduction
 
Administration
Basic Math d e f
Laplace
⇒ |M| = a(2bf − 2ce) − b(2af − 2cd) + c(2ae − 2bd) = 0
Overview

Modeling
Let’s 
change the order
 of rows
Electrical d e f
Mechanical
M =  a b c
 
Frequency
(continous) 2a 2b c
Analysis

Time
⇒ |M| = d(2bc − 2bc) − e(2ac − 2ac) + f (2ab − 2ab) = 0
(Continous) Let’s 
change the order
 of rows again
Analysis
d e f
Software
M = 2a 2b c 
 
Optional

Labs
a b c
Matlab ⇒ |M| = a(2ce − 2bf ) − b(2dc − 2af ) + c(2db − 2ae) = 0
Commands
In other words, if we have dependent rows, then the
Quiz
determinant of the matrix is 0
9/95
Classical and Modern
Control Linear Algebra
Qazi Ejaz Ur Rehman
Avionics Engineer Adjoint of matrix

Introduction
Administration
Basic Math
Laplace

Overview

Modeling
Electrical
Mechanical

Frequency
(continous)
Analysis

Time
(Continous)
Analysis

Software

Optional

Labs

Matlab
Commands
4
Quiz
4 Link
10/95
Classical and Modern
Control Linear Algebra
Qazi Ejaz Ur Rehman
Avionics Engineer Inverse of matrix

Introduction
Administration
Basic Math
Laplace

Overview

Modeling
Electrical
Mechanical

Frequency
A−1 = 1
|A| (Adjoint of A)
(continous)
Analysis

Time
(Continous)
Analysis

Software

Optional

Labs

Matlab
Commands

Quiz

11/95
Classical and Modern
Control Laplace Transform
Qazi Ejaz Ur Rehman
Avionics Engineer Tables

Introduction
Administration
Basic Math
Laplace

Overview

Modeling
Electrical
Mechanical

Frequency
(continous)
Analysis

Time
(Continous)
Analysis

Software

Optional

Labs

Matlab
Commands

Quiz

12/95
Classical and Modern
Control Laplace Transform
Qazi Ejaz Ur Rehman
Avionics Engineer Tables

Introduction
Administration
Basic Math
Laplace

Overview

Modeling
Electrical
Mechanical

Frequency
(continous)
Analysis

Time
(Continous)
Analysis

Software

Optional

Labs

Matlab
Commands
5
Quiz
5 Link
13/95
Classical and Modern
Control Laplace Transform
Qazi Ejaz Ur Rehman
Avionics Engineer Tables

Introduction
Administration
Basic Math
Laplace

Overview

Modeling
Electrical
Mechanical

Frequency
(continous)
Analysis

Time
(Continous)
Analysis

Software

Optional

Labs

Matlab
Commands
6
Quiz
6 Link
14/95
Classical and Modern
Control Laplace Transform
Qazi Ejaz Ur Rehman
Avionics Engineer Plot of simple first order equation
1
Let H(s) = s+10 ,We’ve plotted the magnitude of H(s)
Introduction below, i.e., |H(s)|. Other possible 3D plots are ∠ H(s),
Administration
Basic Math
Re(H(s)) and Im(H(s)) respectively. Notice that |H(s)|
Laplace
goes to ∞ at the pole s = -10.
Overview

Modeling
Electrical
Mechanical

Frequency
(continous)
Analysis

Time
(Continous)
Analysis

Software

Optional

Labs

Matlab
Commands

Quiz

15/95
Classical and Modern
Control Laplace Transform
Qazi Ejaz Ur Rehman
Avionics Engineer 3-D code for Transfer functions

1 a=−40;c =40; b =1;


Introduction 2 g=a : b : c ;
Administration 3 h=g ;
Basic Math 4 [ r , t ]= m e s h g r i d ( g , h ) ;
Laplace 5 s=r +1 i ∗ t ;
6 Hs =1./( s +10) ; %t r a n s f e r f u n c t i o n
Overview
7 mesh ( r , t , a b s ( Hs ) ) ;
Modeling 8 h o l d on
9 f o r omega=g
Electrical
10 Hjw = 1 . / ( 1 i ∗omega + 1 0 ) ; %f r e q u e n c y domain
Mechanical
11 p l o t 3 ( 0 , omega , a b s ( Hjw ) , ’ r o ’ ) ;
Frequency 12 end
(continous) 13 g =4;
Analysis
14 l i n e ( [ a c+4∗g ] , [ 0 0 ] , [ 0 0 ] ) % x a x i s
15 l i n e ( [ 0 0 ] , [ 0 c+8∗g ] , [ 0 0 ] ) % y axis
Time 16 l i n e ([0 0] , [0 0] , [0 0.5]) ; % z axis
(Continous) 17 h o l d on ;
Analysis 18 plot3 (0 ,0 ,1)
19 %t e x t f o r x y z a x e s
Software 20 t e x t ( ’ I n t e r p r e t e r ’ , ’ l a t e x ’ , ’ S t r i n g ’ , ’ $\ sigma$ ’ , ’ Position ’ , [ c
+4∗g 0 0 ] , ’ FontSize ’ , 20) ; % x a x i s
Optional 21 t e x t ( ’ I n t e r p r e t e r ’ , ’ l a t e x ’ , ’ S t r i n g ’ , ’ $ j \ omega$ ’ , ’ P o s i t i o n ’ , [−3
c+6∗g 0 ] , ’ F o n t S i z e ’ , 2 0 ) ; % y a x i s
Labs 22 t e x t ( ’ I n t e r p r e t e r ’ , ’ l a t e x ’ , ’ S t r i n g ’ , ’ $ | H( s ) | $ ’ , ’ Position ’ , [0
Matlab 0 0.5] , ’ FontSize ’ , 20) ; % z a x i s
Commands 23 a x i s ( [ a−g c+g a−g c+g 0 0 . 4 ] )
24 view (100 ,36)
Quiz

16/95
Classical and Modern
Control Laplace Transform
Qazi Ejaz Ur Rehman
Avionics Engineer Plot of Second order equation
s+5
Let H(s) = (s+10)(s−5) . We’ve plotted the magnitude of
Introduction H(s) below, i.e., |H(s)|. Other possible 3D plots are ∠H(s),
Administration
Basic Math
Re(H(s)) and Im(H(s)), respectively. Notice that |H(s)|
Laplace
goes to ∞ at the pole s = -10 and 5 while it converges to
Overview
down at the zero s=-5.
Modeling
Electrical
Mechanical

Frequency
(continous)
Analysis

Time
(Continous)
Analysis

Software

Optional

Labs

Matlab
Commands

Quiz

17/95
Classical and Modern
Control Laplace Transform
Qazi Ejaz Ur Rehman
Avionics Engineer Laplace Transform of integration and derivative

Introduction
Administration
Basic Math
Laplace

Overview

Modeling
Electrical
For more details on how the Laplace transform for
Mechanical integration is 1/s and Laplace transform for derivative is s
Frequency
(continous)
then see
Analysis
http://www2.kau.se/yourshes/AB28.pdf
Time
(Continous)
Analysis

Software

Optional

Labs

Matlab
Commands

Quiz

18/95
Classical and Modern
Control Control Systems
Qazi Ejaz Ur Rehman
Avionics Engineer FREQUENCY (Continous) and Time

Introduction
Administration
Basic Math
Laplace

Overview

Modeling
Electrical
Mechanical

Frequency
(continous)
Analysis

Time
(Continous)
Analysis

Software

Optional

Labs

Matlab
Commands

Quiz

19/95
Classical and Modern
Control Control Systems
Qazi Ejaz Ur Rehman
Avionics Engineer Introduction

Introduction Among mechanistic systems, we are interested in linear


Administration
Basic Math systems. Here are some examples:
Laplace

Overview
1 Filters (analog and digital
Modeling 2 Control sysytems
Electrical
Mechanical
• A control system is an interconnection of components
Frequency forming a system configuration that will provide a
(continous) desired system response
Analysis
• An open loop control system utilizes an actuating
Time
(Continous) device to control the process directly without using
Analysis
feedback uses a controller and an actuator to obtain
Software
the desired response
Optional • A closed loop control system uses a measurement of
Labs the output and feedback of this signal to compare it
Matlab with the desired output (reference or command)
Commands

Quiz

20/95
Classical and Modern
Control Control Systems
Qazi Ejaz Ur Rehman
Avionics Engineer Introduction

Introduction
Administration • To understand and control complex systems, one must
Basic Math
Laplace obtain quantitative mathematical models of these
Overview systems
Modeling
Electrical
• It is therefore necessary to analyze the relationships
Mechanical
between the system variables and to obtain a
Frequency
(continous)
mathematical model
Analysis
• Because the systems under consideration are dynamic
Time
(Continous) in nature, the descriptive equations are usually
Analysis
differential equations
Software

Optional
• Furthermore, if these equations are linear or can be
Labs linearized, then the Laplace Transform can be used to
Matlab simplify the method of solution
Commands

Quiz

21/95
Classical and Modern
Control Control Systems
Qazi Ejaz Ur Rehman
Avionics Engineer Introduction

Introduction
Administration
Basic Math Control system analysis and design focuses on three things:
Laplace

Overview 1 transient response


Modeling 2 stability
Electrical
Mechanical
3 steady state errors
Frequency
(continous) For this, the equation (model), impulse response and step
Analysis

Time
response are studied. Other important parameters are
(Continous) sensitivity/robustness and optimality. Control system
Analysis

Software
design entails tradeoffs between desired transient response,
Optional
steady-state error and the requirement that the system be
Labs stable.
Matlab
Commands

Quiz

22/95
Classical and Modern
Control Control Systems
Qazi Ejaz Ur Rehman
Avionics Engineer Analysis
The analysis of control systems can be done in the
Introduction following nine ways:
Administration
Basic Math
1 equation
2 poles/zeros/controllability/observability
Laplace

Overview
3 stability
Modeling
Electrical 4 impulse response
Mechanical
5 step response
Frequency
(continous) 6 steady-state response
Analysis

Time 7 transient response


(Continous)
Analysis
8 sensitivity
Software 9 optimality
Optional The design of control systems can be done in the following
Labs ways:
Matlab
Commands 1 Pole placement (PID in frequency and time, state
Quiz feedback in time)
23/95 Back to immediate slide
Classical and Modern
Control Modeling
Qazi Ejaz Ur Rehman
Avionics Engineer RLC Circuit

Introduction
Administration
Basic Math
Laplace

Overview

Modeling
Electrical
Mechanical

Frequency
(continous)
Analysis
di(t) 1
Time L + Ri(t) + q(t) = v (t) (1)
(Continous) dt C
Analysis
dq(t)
Software i(t) = (2)
Optional
dt
Labs d 2 q(t) dq(t) 1
Matlab ⇒L 2
+R + q(t) = v (t)
Commands dt dt C
Quiz
1
⇒ Lq̈(t) + R q̇(t) + q(t) = v (t)
24/95 C
Classical and Modern
Control Modeling Series RLC Circuit
Qazi Ejaz Ur Rehman
Avionics Engineer State Space Representation
Let,
Introduction
Administration
Basic Math
Laplace x1 = q(t)
Overview x2 = x˙1 = q̇(t)
x˙2 = q̈(t)
Modeling
Electrical
Mechanical Substituting,

Frequency
(continous) 1
Lq̈(t) + R q̇(t) + q(t) = v (t)
Analysis C
1
Time Lx˙2 + Rx2 + x1 = v (t)
(Continous) C
Analysis
Now Write,
Software

Optional x˙1 = x2

Labs 1 R 1
x˙2 = − x1 − x2 + v (t)
Matlab h i h LC L
i h Li h i
Commands x˙1 0 1 x1 0
= 1 + 1 v (t)
x˙2 − LC − RL x2 L
Quiz

25/95
Classical and Modern
Control Modeling
Qazi Ejaz Ur Rehman
Avionics Engineer C parallel with RL circuit

Introduction
Administration
Basic Math
Laplace

Overview

Modeling
Electrical
Mechanical

Frequency
(continous) iC = −iL + u(t)
Analysis
dvC
Time ⇒C = −iL + u(t)
(Continous) dt
Analysis
dvC 1 1
Software ⇒ = − iL + u(t)
Optional
dt C C
VC = VL + iL R
Labs
diL
Matlab =L + iL R
Commands dt
Quiz
diL
26/95
solve for dt
Classical and Modern
Control Modeling
Qazi Ejaz Ur Rehman
Avionics Engineer C parallel with RL circuit

Introduction
Administration
Basic Math
Laplace
Starting off with differential equations, we go to state space
Overview

Modeling dvC 1
Electrical = − C1 iL + u(t)
Mechanical dt C
Frequency diL 1 1
(continous) = L vC − iL R
Analysis
" # dt " #" # " # L
Time
V˙C 0 − C1 VC 1
C u(t)
(Continous)
= 1 R +
Analysis
i˙L L −L iL 0
Software

Optional

Labs

Matlab
Commands

Quiz

27/95
Classical and Modern
Control Modeling
Qazi Ejaz Ur Rehman
Avionics Engineer Constant acceleration model
s̈(t) = a

Introduction
Administration Z t Z t
Basic Math
Laplace s̈(τ ) dτ = a dτ
t0 t0
Overview
t t
ṡ(τ )|t = a τ |t
Modeling 0 0
Electrical ṡ(t) − ṡ(t0 ) = at − at0
Mechanical

Frequency
(continous) Z t Z t Z t Z t
Analysis
ṡ(τ )dτ − ṡ(t0 )dτ = aτ dτ − at0 dτ
Time
t0 t0 t0 t0
(Continous)
Analysis t 1 2 t t t
s(τ )|t − ṡ(t0 )τ |t =
a τ |t − at0 τ |t
0 2 0 0 0
Software
1 2 1 2 2
s(t) − s(t0 ) − ṡ(t0 )t + ṡ(t0 )t0 = at − at0 − at0 t + at0
Optional 2 2
Labs
let initial time t0 = 0, initial distance s(t0 ) = 0, and some initial velocity ṡ(t0 ) = vi , to get the
Matlab familiar equation,
Commands 1 2
s(t) = vi t + at
Quiz 2

28/95 If we take the derivative with respect to t, we get vf = vi + at


Classical and Modern
Control Modeling
Qazi Ejaz Ur Rehman
Avionics Engineer Constant acceleration model

Introduction
Administration • The equations s = vi t + 21 at 2 and vf = vi + at can be
Basic Math
Laplace written in state space as,
Overview " # " #" # " #
1 2 f
Modeling s 0 t si 2t
Electrical = +
Mechanical vf 0 1 vi t m
Frequency
(continous)
Analysis
and writing in terms of states x and input u, we get,
Time " # " #" # " 1 2#
(Continous) t
x 0 t xt−1 2
Analysis
xt = t = + m
t
u
Software ẋt 0 1 ẋt−1
m
Optional

Labs • Note that we have used f = ma, and the input u is the
Matlab force f
Commands

Quiz

29/95
Classical and Modern
Control Modeling
Qazi Ejaz Ur Rehman
Avionics Engineer DC Motor cont..

Laplace Domain
Introduction
Administration
Basic Math
Laplace LsI(s) + RI(s) = V (s) − Vb (s) (3)
Overview 2
J s θ + bsθ = Km I(s) (4)
Modeling
Electrical
Mechanical Differential equations where Vb (s) = Kb ω(s) = Kb sθ
solving equation 3 and 4 simultaneously
Frequency angular distance (rad)
(continous)
Analysis
di Km
Time L + Ri = v − vb 1 θ(s)
dt G1 (s) = =
(Continous) V (s) [( Ls + R)( Js + b) + Kb Km ]
Analysis v b = Kb ω J θ̈ + b θ̇ = Km i 2

Software = Kb θ̇
angular rate (rad/sec)
Optional R: electrical resistance 1 ohm
L: electrical inductance 0.5H ω(s)
Labs Gp (s) = = sG1 (s) =
J: moment of inertia 0.01 kg.m2 V (s)
Matlab b: motor friction constant 0.1 N.m.s
Commands = Kb
Kb : emf constant 0.01 V/rad/sec
Quiz Lab 2 Km: torque constant 0.01 N.m/Amp L J s2 + ( L b + R J )s + ( R b + Kb Km )
30/95
Classical and Modern
Control Modeling
Qazi Ejaz Ur Rehman
Avionics Engineer DC Motor cont..

Introduction
Administration
Basic Math
Laplace

Overview

Modeling
Electrical
Mechanical

Frequency
(continous)
Analysis

Time
(Continous)
Analysis
θ(s) 1 Km
Software G1 (s) = =
V (s) s [(Ls + R)(Js + b) + Kb Km ]
Optional

Labs θ̇(s) Km
Gp (s) = =
Matlab V (s) [(Ls + R)(Js + b) + Kb Km ]
Commands

Quiz Note that we have set Td , TL , TM = 0 for calculating G1 (s) and Gp (s).

31/95
Classical and Modern
Control Modeling
Qazi Ejaz Ur Rehman
Avionics Engineer DC Motor cont..

Introduction
Administration
Basic Math
Laplace

Overview

Modeling
A motor can be represented simply as an integrator. A
Electrical voltage applied to the motor will cause rotation. When the
Mechanical

Frequency
applied voltage is removed, the motor will stop and remain
(continous) at its present output position. Since it does not return to
Analysis

Time
its initial position, we have an angular displacement output
(Continous) without an input to the motor.
Analysis

Software

Optional

Labs

Matlab
Commands

Quiz

32/95
Classical and Modern
Control Frequency (continous) : analysis
Qazi Ejaz Ur Rehman
Avionics Engineer Introduction

Introduction
Administration
Basic Math
Laplace

Overview

Modeling
Electrical
• Known as classical control, most work is in Laplace
Mechanical
domain
Frequency
(continous) • You can replace s in Laplace domain with jω to go to
Analysis

Time
frequency domain
(Continous)
Analysis

Software

Optional

Labs

Matlab
Commands

Quiz

33/95
Classical and Modern
Control Frequency (continous): analysis
Qazi Ejaz Ur Rehman
Avionics Engineer Test Waveform

Introduction
Administration
Basic Math
Laplace

Overview

Modeling
Electrical
Mechanical

Frequency
(continous)
Analysis

Time
(Continous)
Analysis

Software

Optional

Labs

Matlab
Commands

Quiz

34/95
Classical and Modern
Control Frequency (continous): analysis
Qazi Ejaz Ur Rehman
Avionics Engineer Systems: 1st order

Introduction
dy
Administration
+ a 0 y = b0 r
Basic Math
Laplace
dt
Overview sY (s) − y (0̄) + a0 Y (s) = b0 R(s)
Modeling
Electrical
sY (s) + a0 Y (s) = b0 R(s) − y (0̄)
Mechanical
b0 y (0̄)
Frequency Y (s) = R(s) +
(continous) s + a0 s + a0
Analysis

Time
(Continous) • It is considered stable if the natural response decays to
Analysis
0, i.e., the roots of the denominator must lie in LHP,
Software

Optional
so a0 > 0
Labs • The time constant τ of a stable first order system is
Matlab
1/a0
Commands
• In other words, the time constant is the negative of
Quiz
the reciprocal of the pole
35/95
Classical and Modern
Control Frequency (continous): analysis
Qazi Ejaz Ur Rehman
Avionics Engineer Systems: 1st order

Introduction
Administration
Basic Math
Laplace

Overview

Modeling
Electrical
Mechanical

Frequency
(continous)
Analysis

Time
(Continous)
Analysis

Software

Optional

Labs

Matlab
Commands

Quiz

36/95
Classical and Modern
Control Frequency (continous): analysis
Qazi Ejaz Ur Rehman
Avionics Engineer Systems: 1st order

Introduction
Administration
Basic Math
Laplace

Overview

Modeling
Electrical
Mechanical

Frequency
(continous)
Analysis

Time
(Continous)
Analysis

Software

Optional

Labs

Matlab
Commands

Quiz

37/95
Classical and Modern
Control Frequency (continous): analysis
Qazi Ejaz Ur Rehman
Avionics Engineer Systems: 2nd order

Introduction
Administration
Basic Math
Laplace

Overview

Modeling
Electrical
Mechanical

Frequency
(continous) ω2
n
Let G(s) = s(s+2ζω
Analysis
n)
Time  
(Continous)
Y (s) = X (s) − Y (s) G(s)
Analysis

Software Y (s) = E (s)G(s)

Optional Y (s) + Y (s)G(s) = X (s)G(s)


Y (s) G(s)
Labs ⇒ =
X (s) 1 + G(s)
Matlab
Commands ωn2 b0
= =
s 2 + 2ζωn2 s + ωn2 s 2 + 2ζωn2 s + ωn2
Quiz

38/95 ζ is dimensionless damping ratio and ωn is the natural frequency or undamped frequency
Classical and Modern
Control Frequency (continous): analysis
Qazi Ejaz Ur Rehman
Avionics Engineer Systems: 2nd order

Introduction The poles can be found by finding the roots of the


Administration
Basic Math
denominator of YX (s)
(s)

Laplace

Overview
q
Modeling
−(2ζωn ) ± (2ζωn )2 − 4ωn2
s1,2 =
q2
Electrical
Mechanical

Frequency
(continous)
−(2ζωn ) ± (4ζ 2 ωn2 ) − 4ωn2
=
Analysis
2p
Time
(Continous) −(2ζωn ) ± 2ωn ζ 2 − 1
Analysis =
2
Software q
Optional = −ζωn ± ωn ζ 2 − 1
Labs
q
Matlab
= −ζωn ± jωn 1 − ζ 2
Commands

Quiz

39/95
Classical and Modern
Control Frequency (continous): analysis
Qazi Ejaz Ur Rehman
Avionics Engineer Systems: 2nd order

Introduction
Administration
Basic Math
Laplace

Overview
Formulas:

Modeling
Electrical
Mechanical

−ζπ/ 1−ζ 2
Frequency
(continous)
Analysis
%OS = e × 100
Time
(Continous) Notice that % OS only depends on the damping ratio ζ
Analysis

Software

Optional

Labs

Matlab
Commands

Quiz

40/95
Classical and Modern
Control Frequency (continous): analysis
Qazi Ejaz Ur Rehman
Avionics Engineer Systems: 2nd order: Damping

Introduction
Administration
Basic Math
Laplace

Overview

Modeling
Electrical
Mechanical

Frequency
(continous)
Analysis

Time
(Continous)
Analysis

Software

Optional

Labs

Matlab
Commands

Quiz

41/95
Classical and Modern
Control Frequency (continous): analysis
Qazi Ejaz Ur Rehman
Avionics Engineer Systems: 2nd order: Damping
Underdamped system
Introduction
Administration
Basic Math
• Pole positions for an underdamped
p (ζ < 1) second
Laplace
order system s1 , s2 = −ζωn ± jωn 1 − ζ 2
Overview

Modeling when plotted on the s-plane


Electrical
Mechanical

Frequency
(continous)
Analysis

Time
(Continous)
Analysis

Software

Optional

Labs

Matlab
Commands

Quiz

42/95
Classical and Modern
Control Frequency (continous): analysis
Qazi Ejaz Ur Rehman
Avionics Engineer Systems: 2nd order

Introduction
Administration
Basic Math
Laplace

Overview

Modeling
Electrical
Mechanical

Frequency
(continous)
Analysis

Time 1 Rise Time Tr : The time required for the waveform to go from 0.1 of
(Continous) the final value to 0.9 of the final value
Analysis
2 Peak Time Tp : The time required to reach the first, or maximum,
Software
peak
Optional • % overshoot: The amount that the waveform
Labs overshoots the steady-state or final, value at the peak
Matlab time, expressed as a percentage of the steady-state
Commands
value
Quiz
3 The time required for the transient’s damped oscillations to reach and
43/95 stay within 2% of the steady-state value
Classical and Modern
Control Frequency (continous): analysis
Qazi Ejaz Ur Rehman
Avionics Engineer Systems: types

Introduction
Administration
Basic Math
Laplace

Overview

Modeling
Electrical
Mechanical

Frequency
(continous)
Analysis

Time
(Continous)
Analysis

Software

Optional
Relationships between input, system type, static error
Labs
constants and steady-state errors.
Matlab
Commands

Quiz

44/95
Classical and Modern
Control Frequency (continous): analysis
Qazi Ejaz Ur Rehman
Avionics Engineer The Characteristics of P, I, and D Controllers

Introduction
Administration • A proportional controller (Kp ) will have the effect of
Basic Math
Laplace reducing the rise time and will reduce but never
Overview eliminate the steady-state error.
Modeling
Electrical
• An integral control (Ki ) will have the effect of
Mechanical
eliminating the steady-state error for a constant or step
Frequency
(continous) input, but it may make the transient response slower.
Analysis
• A derivative control (Kd ) will have the effect of
Time
(Continous) increasing the stability of the system, reducing the
Analysis

Software
overshoot, and improving the transient response.
Optional The effects of each of controller parameters, Kp , Kd , and
Labs
Ki on a closed-loop system are summarized in the table
Matlab
Commands below.
Quiz

45/95
Classical and Modern
Control Frequency (continous): analysis
Qazi Ejaz Ur Rehman
Avionics Engineer The Characteristics of P, I, and D Controllers

Introduction
Administration
Basic Math
Laplace

Overview CL RESPONSE RISE TIME OVERSHOOT SETTLING TIME S-S ERROR


Kp Decrease Increase Small Change Decrease
Modeling Ki Decrease Increase Increase Eliminate
Electrical Kd Small Change Decrease Decrease No Change
Mechanical Note that these correlations may not be exactly accurate, because Kp , Ki , and Kd are dependent on
each other. In fact, changing one of these variables can change the effect of the other two. For this
Frequency reason, the table should only be used as a reference when you are determining the values for Ki , Kp
(continous) and Kd .
Analysis
Z
de
Time u(t) = Kp e(t) + Ki e(t)dt + Kp
dt
(Continous)
Analysis

Software

Optional

Labs

Matlab
Commands

Quiz

46/95
Classical and Modern
Control Frequency (continous): analysis
Qazi Ejaz Ur Rehman
Avionics Engineer Effect of poles and zeros

Introduction
Administration
Basic Math
Laplace

Overview

Modeling
Electrical
Mechanical

Frequency
(continous)
Analysis

Time
(Continous)
Analysis

Software

Optional

Labs

Matlab
Commands

Quiz

47/95
Classical and Modern
Control Frequency (continous): analysis
Qazi Ejaz Ur Rehman
Avionics Engineer Effect of poles and zeros
• The zeros of a response affect the residue, or
Introduction amplitude, of a response component but do not affect
Administration
Basic Math the nature of the response, exponential, damped,
Laplace
sinusoid, and so on
Overview

Modeling
Electrical
Mechanical

Frequency
(continous)
Analysis

Time
(Continous)
Analysis

Software

Optional

Labs

Matlab
Commands Starting with a two-pole system with poles at -1 ± j2.828,
Quiz we consecutively add zeros at -3, -5 and -10. The closer
48/95 the zero is to the dominant poles, the greater its effect on
Classical and Modern
Control Frequency (continous): analysis
Qazi Ejaz Ur Rehman
Avionics Engineer Effect of poles and zeros

Introduction
Administration
Basic Math
(s + a) A B
Laplace
T (s) = = +
(s + b)(s + c) s +b s +c
Overview
(−b + a)/(−b +
Modeling =
Electrical
Mechanical
s +b
Frequency
(continous)
if zero is far from the poles, then a is large compared to b
Analysis
and c, and
Time
(Continous) " #
Analysis 1/(−b + c) 1/(−c + b) a
T (s) ≈ a + =
Software
s +b s +c (s + b)(s + c)
Optional

Labs
If the zero is far from the poles, then it looks like a simple
Matlab
Commands gain factor and does not change the relative amplitudes of
Quiz the components of the response.
49/95
Classical and Modern
Control Frequency (continous): analysis
Qazi Ejaz Ur Rehman
Avionics Engineer Root locus

Introduction
Administration
Basic Math
Laplace

Overview

Modeling
Electrical
Mechanical
Representation of paths of closed loop poles as the gain is
Frequency
(continous)
varied.
Analysis

Time
(Continous)
Analysis

Software

Optional

Labs

Matlab
Commands

Quiz

50/95
Classical and Modern
Control Frequency (continous): analysis
Qazi Ejaz Ur Rehman
Avionics Engineer Root locus

• The root locus graphically displays both transient


Introduction
Administration response and stability information
Basic Math
Laplace • The root locus can be sketched quickly to get an idea
Overview
of the changes in transient response generated by
Modeling
Electrical
changes in gain
Mechanical
• The root locus typically allows us to choose the proper
Frequency
(continous) loop gain to meet a transient response specification
Analysis

Time
• As the gain is varied, we move through different
(Continous)
Analysis
regions of response
Software • Setting the gain at a particular value yields the
Optional transient response dictated by the poles at that point
Labs on the root locus
Matlab
Commands • Thus, we are limited to those responses that exist
Quiz along the root
51/95
Classical and Modern
Control Frequency (continous): analysis
Qazi Ejaz Ur Rehman
Avionics Engineer Nyquist

Introduction
Administration
Basic Math
Laplace

Overview

Modeling
Electrical
Mechanical
Determine closed loop system stability using a polar plot of
Frequency the open-loop frequency responseG(jω)H(jω) as ω
(continous)
Analysis
increases from -∞ to ∞
Time
(Continous)
Analysis

Software

Optional

Labs

Matlab
Commands

Quiz

52/95
Classical and Modern
Control Frequency (continous): analysis
Qazi Ejaz Ur Rehman
Avionics Engineer Routh Hurwitz

Introduction
Administration
Basic Math
Laplace

Overview

Modeling
Electrical
Mechanical
Find out how many closed-loop system poles are in LHP
Frequency (left half-plane), in RHP (right half-plane) and on the jω
(continous)
Analysis
axis
Time
(Continous)
Analysis

Software

Optional

Labs

Matlab
Commands

Quiz

53/95
Classical and Modern
Control Frequency (continous): analysis
Qazi Ejaz Ur Rehman
Avionics Engineer Performance Indeces cont.

Introduction
Administration
Basic Math
Laplace

Overview • A performance index is a quantitative measure of the


Modeling
Electrical
performance of a system and is chosen so that
Mechanical emphasis is given to the important system
Frequency
(continous)
specifications
Analysis
• A system is considered an optimal control system when
Time
(Continous) the system parameters are adjusted so that the index
Analysis
reaches an extremum, commonly a minimum value
Software

Optional

Labs

Matlab
Commands

Quiz

54/95
Classical and Modern
Control Frequency (continous): analysis
Qazi Ejaz Ur Rehman
Avionics Engineer Performance Indeces cont.
Z T
Introduction
Administration ISE = e 2 (t)dt integral of square of error
Basic Math 0
Laplace Z T
Overview ITSE = te 2 (t)dt integral of time multiplied by square of error
Modeling 0
Electrical
Z T
Mechanical
IAE = |e(t)|dt absolute magniture of error
Frequency 0
(continous) Z T
Analysis
ITAE = t|e(t)|dt integral of time multiplied by absolute of errorr
Time 0
(Continous)
Analysis

Software

Optional • The upper limit T is a finite time chosen somewhat


Labs
arbitrarily so that the integral approaches a
Matlab
Commands steady-state value
Quiz • It is usually convenient to choose T as the settling
55/95 time Ts
Classical and Modern
Control Frequency (continous): analysis
Qazi Ejaz Ur Rehman
Avionics Engineer Performance Indeces cont.

Introduction
Administration
Basic Math
Optimum coefficients of T(s) based on the ITAE criterion
Laplace for a step input
Overview

Modeling
Electrical
s − ωn
Mechanical

Frequency
s 2 + 1.4ωn s + ωn2
(continous)
Analysis s 3 + 1.75ωn s 2 + 2.15ωn2 s + ωn3
Time
(Continous)
Analysis
s 4 + 2.1ωn s 3 + 3.4ωn2 s 2 + 2.7ωn3 s + ωn4
Software s 5 + 2.8ωn s 4 + 5.0ωn2 s 3 + 5.5ωn3 s 2 + 3.4ωn4 s + ωn5
Optional

Labs s 6 +3.25ωn s 5 +6.60ωn2 s 4 +8.60ωn3 s 3 +7.45ωn4 s 2 +3.95ωn5 s+ωn6


Matlab
Commands

Quiz

56/95
Classical and Modern
Control Frequency (continous): analysis
Qazi Ejaz Ur Rehman
Avionics Engineer Performance Indeces cont.

Introduction
Administration
Basic Math
Laplace
Optimum coefficients of T(s) based on the ITAE criterion
Overview
for a ramp input
Modeling
Electrical
Mechanical s 2 + 3.2ωn s + ωn2
Frequency
(continous)
Analysis s 3 + 1.75ωn s 2 + 3.25ωn2 s + ωn3
Time
(Continous) s 4 + 2.41ωn s 3 + 4.93ωn2 s 2 + 5.14ωn3 s + ωn4
Analysis

Software s 5 + 2.19ωn s 4 + 6.50ωn2 s 3 + 6.30ωn3 s 2 + 5.24ωn4 s + ωn5


Optional

Labs

Matlab
Commands

Quiz

57/95
Classical and Modern
Control Frequency (continous): analysis
Qazi Ejaz Ur Rehman
Avionics Engineer Block diagram

Introduction
Administration
Basic Math
Laplace

Overview

Modeling
Electrical
Mechanical

Frequency Open loop transfer function


(continous)
Analysis

Time
Y1 (s)
(Continous) T1 (s) = = Gc (s) Gp (s) H(s)
Analysis
R(s)
Software
Closed loop transfer function
Optional

Labs
Y (s)
Matlab T1 (s) = = Gc (s) Gp (s) H(s)
Commands R(s)
Quiz

58/95
Classical and Modern
Control Time (Continous)
Qazi Ejaz Ur Rehman
Avionics Engineer Introduction

Introduction Write your models in the form below:


Administration
Basic Math
Laplace

Overview

Modeling
ẋ (t) = Ax (t) + Bu(t)
Electrical
Mechanical
y (t) = Cx (t) + Du(t)
Frequency
(continous)
Analysis Here,
Time A is called the system matrix
(Continous)
Analysis B is called the Input matrix
Software C is called the output matrix
Optional D is is called the Disturbance matrix
Labs

Matlab
Commands A & B are also called as Jacobin matrix
Quiz

59/95
Classical and Modern
Control Time (Continous)
Qazi Ejaz Ur Rehman
Avionics Engineer Overview

Introduction
Administration
In the next few slides, let’s look at some aspects of analysis
Basic Math
Laplace
in TIME (continuous). During this analysis, the
Overview relationship between classical control vs modern control will
Modeling also become clear:
Electrical
Mechanical
' classical control vs modern control
Frequency ( transfer function vs state space (matrix)
(continous)
Analysis
( poles vs eigen values
Time
( asymptotic stability vs BIBO stability
(Continous)
Analysis
' Other aspects, only possible in modern control include:
Software

Optional ( controllability
Labs ( observability
Matlab
( senstivity
Commands

Quiz

60/95
Classical and Modern
Control Time (Continous)
Qazi Ejaz Ur Rehman
Avionics Engineer Overview
1. transfer function vs state space
Introduction
Administration
Basic Math ẋ (t) = Ax (t) + Bu(t)
Laplace

Overview y (t) = Cx (t) + Du(t)


Modeling
Electrical
Mechanical

Frequency
(continous)
sX = AX + BU Take Laplace Transform
Analysis
sX − AX = BU
Time
(Continous) (sI − A)X = BU
Analysis

Software
⇒ X = (sI − A)−1 BU
Optional ⇒ Y = C(sI − A)−1 BU + DU
Labs Y
G(s) = = C(sI − A)−1 BU + D
Matlab
Commands
U
adjoint(sI − A)
Quiz =C B+D
61/95
det(sI − A)
Classical and Modern
Control Time (Continous)
Qazi Ejaz Ur Rehman
Avionics Engineer Overview

Introduction
2. poles vs eigen values
Administration
Basic Math
Laplace
Normally, D = 0, and therefore,
Overview
adjoint(sI − A)
Modeling G(s) = C B
Electrical det(sI − A)
Mechanical

Frequency
(continous)
Analysis • The poles of G(s) come from setting its denominator,
Time
(Continous)
equal to 0, i.e., let det(sI-A) = 0 and solve for roots
Analysis
• But this is also the method for finding the eigenvalues
Software
of A!
Optional

Labs
• Therefore, (in the absence of pole-zero cancellations),
Matlab transfer function poles are identical to the system
Commands
eigenvalues
Quiz

62/95
Classical and Modern
Control Time (Continous)
Qazi Ejaz Ur Rehman
Avionics Engineer Overview

Introduction
Administration
3. asymptotic stability vs BIBO stability
Basic Math
Laplace

Overview

Modeling
Electrical
Mechanical • In classical control, we say that a system is stable if all
Frequency poles are in LHP (left-half plane of Laplace domain)
(continous)
Analysis • This is called Asymptotic stability
Time
(Continous)
• In modern control, a system is stable if the system
Analysis output y(t) is bounded for all bounded inputs u(t)
Software • This is called BIBO stability
Optional
• Considering the relationship between poles and
Labs
eigenvalues, then eigenvalues of A must be negative
Matlab
Commands

Quiz

63/95
Classical and Modern
Control Time (Continous)
Qazi Ejaz Ur Rehman
Avionics Engineer Overview

Introduction
Administration
Basic Math 4. controllability
Laplace

Overview

Modeling
Electrical The property of a system when it is possible to take the state
Mechanical
from any initial state x (t0 ) to any final state x (tf ) in a finite
Frequency
(continous) time, tf − t0 by means of the input vector u(t), t0 ≤ t ≤ tf
Analysis

Time
(Continous)
Analysis

Software
A system is completely controllable if the system state x (tf ) at
Optional
time tf can be forced to take on any desired value by applying a
Labs control input u(t) over a period of time from t0 to tf
Matlab
Commands

Quiz

64/95
Classical and Modern
Control Time (Continous)
Qazi Ejaz Ur Rehman
Avionics Engineer Overview
4. controllabilitycont..
Introduction
Administration
Basic Math
Laplace

Overview

Modeling
Electrical
Mechanical

Frequency
(continous)
Analysis

Time
(Continous)
Analysis

Software

Optional

Labs

Matlab
Commands

Quiz

65/95
Classical and Modern
Control Time (Continous)
Qazi Ejaz Ur Rehman
Avionics Engineer Overview

Introduction 4. controllability cont..


Administration
Basic Math
Laplace

Overview

Modeling
Electrical
Mechanical

Frequency
(continous)
Analysis

Time
(Continous)
Analysis

Software

Optional

Labs

Matlab
Commands

Quiz

66/95
Classical and Modern
Control Time (Continous)
Qazi Ejaz Ur Rehman
Avionics Engineer Overview

Introduction
Administration 4. controllability cont..
Basic Math
Laplace

Overview

Modeling
Electrical
• The Solution to u(t), u̇(t), ..., u n−2 (t), u n−1 (t) can
Mechanical only be found if Pc is invertible
Frequency • Another way to say this is that Pc is full rank
(continous)
Analysis
• x (n) (t)
is the state that results from n transitions of
Time
(Continous) the state with input present
Analysis

Software
• An x(t) is the state that results from n transitions of
Optional
the state with no input present
Labs • PC is therefore called the controllability matrix
Matlab
Commands

Quiz

67/95
Classical and Modern
Control Time (Continous)
Qazi Ejaz Ur Rehman
Avionics Engineer Overview
4. controllability cont..
Simple example with 2 states, i.e., n = 2,
Introduction    
Administration
−2 1 1
Basic Math A= ,B =
Laplace −1 −3 0
Overview
 
1 −2
Modeling PC = [B AB] =
0 −3
Electrical
Mechanical
|PC | = −1 6= 0 ⇒ controllable
Frequency
(continous) In Matlab,
Analysis

Time
(Continous) 1 A=i n p u t ( ’A= ’ ) ;
Analysis
2 B=i n p u t ( ’B= ’ ) ;
Software 3 P=c t r b (A , B) ; %r a n k (P)
Optional 4 unco=l e n g t h (A)−r a n k (P) ;
Labs 5 i f unco == 0
Matlab 6 d i s p ( ’ System i s c o n t r o l l a b l e ’ )
Commands 7 else
Quiz 8 d i s p ( ’ System i s u n c o n t r o l l a b l e ’ )
68/95 9 end
Classical and Modern
Control Intro. to Matlab
Qazi Ejaz Ur Rehman
Avionics Engineer

Introduction
Administration
Basic Math
Laplace
1 The name MATLAB stands for MATrix LABoratory.
Overview 2 MATLAB was written originally to provide easy access
Modeling to matrix software developed by the LINPACK (linear
Electrical
Mechanical
system package) and EISPACK (Eigen system
Frequency package) projects.
(continous)
Analysis
3 MATLAB has a number of competitors. Commercial
Time competitors include Mathematica, TK Solver, Maple,
(Continous)
Analysis
and IDL.
Software 4 There are also free open source alternatives to
Optional MATLAB, in particular GNU Octave, Scilab, FreeMat,
Labs Julia, and Sage which are intended to be mostly
Matlab compatible with the MATLAB language.
Commands

Quiz
5 MATLAB was first adopted by researchers and
69/95
practitioners in control engineering.
Classical and Modern
Control Intro. to Matlab
Qazi Ejaz Ur Rehman
Avionics Engineer

Introduction
Administration
Basic Math
Laplace
1 The name MATLAB stands for MATrix LABoratory.
Overview 2 MATLAB was written originally to provide easy access
Modeling to matrix software developed by the LINPACK (linear
Electrical
Mechanical
system package) and EISPACK (Eigen system
Frequency package) projects.
(continous)
Analysis
3 MATLAB has a number of competitors. Commercial
Time competitors include Mathematica, TK Solver, Maple,
(Continous)
Analysis
and IDL.
Software 4 There are also free open source alternatives to
Optional MATLAB, in particular GNU Octave, Scilab, FreeMat,
Labs Julia, and Sage which are intended to be mostly
Matlab compatible with the MATLAB language.
Commands

Quiz
5 MATLAB was first adopted by researchers and
69/95
practitioners in control engineering.
Classical and Modern
Control Intro. to Matlab
Qazi Ejaz Ur Rehman
Avionics Engineer

Introduction
Administration
Basic Math
Laplace
1 The name MATLAB stands for MATrix LABoratory.
Overview 2 MATLAB was written originally to provide easy access
Modeling to matrix software developed by the LINPACK (linear
Electrical
Mechanical
system package) and EISPACK (Eigen system
Frequency package) projects.
(continous)
Analysis
3 MATLAB has a number of competitors. Commercial
Time competitors include Mathematica, TK Solver, Maple,
(Continous)
Analysis
and IDL.
Software 4 There are also free open source alternatives to
Optional MATLAB, in particular GNU Octave, Scilab, FreeMat,
Labs Julia, and Sage which are intended to be mostly
Matlab compatible with the MATLAB language.
Commands

Quiz
5 MATLAB was first adopted by researchers and
69/95
practitioners in control engineering.
Classical and Modern
Control Intro. to Matlab
Qazi Ejaz Ur Rehman
Avionics Engineer

Introduction
Administration
Basic Math
Laplace
1 The name MATLAB stands for MATrix LABoratory.
Overview 2 MATLAB was written originally to provide easy access
Modeling to matrix software developed by the LINPACK (linear
Electrical
Mechanical
system package) and EISPACK (Eigen system
Frequency package) projects.
(continous)
Analysis
3 MATLAB has a number of competitors. Commercial
Time competitors include Mathematica, TK Solver, Maple,
(Continous)
Analysis
and IDL.
Software 4 There are also free open source alternatives to
Optional MATLAB, in particular GNU Octave, Scilab, FreeMat,
Labs Julia, and Sage which are intended to be mostly
Matlab compatible with the MATLAB language.
Commands

Quiz
5 MATLAB was first adopted by researchers and
69/95
practitioners in control engineering.
Classical and Modern
Control Intro. to Matlab
Qazi Ejaz Ur Rehman
Avionics Engineer

Introduction
Administration
Basic Math
Laplace
1 The name MATLAB stands for MATrix LABoratory.
Overview 2 MATLAB was written originally to provide easy access
Modeling to matrix software developed by the LINPACK (linear
Electrical
Mechanical
system package) and EISPACK (Eigen system
Frequency package) projects.
(continous)
Analysis
3 MATLAB has a number of competitors. Commercial
Time competitors include Mathematica, TK Solver, Maple,
(Continous)
Analysis
and IDL.
Software 4 There are also free open source alternatives to
Optional MATLAB, in particular GNU Octave, Scilab, FreeMat,
Labs Julia, and Sage which are intended to be mostly
Matlab compatible with the MATLAB language.
Commands

Quiz
5 MATLAB was first adopted by researchers and
69/95
practitioners in control engineering.
Classical and Modern
Control Intro. to Simulink
Qazi Ejaz Ur Rehman
Avionics Engineer An essential part of Matlab

Introduction
Administration
Basic Math
Laplace

Overview

Modeling
Electrical
Mechanical

Frequency
(continous)
Analysis
1 The name Simulink stands for Simulations and links
Time 2 Old name was Simulab
(Continous)
Analysis
3 Simulink is widely used in automatic control and
Software
digital signal processing for multidomain simulation
Optional
and Model-Based Design.
Labs

Matlab
Commands

Quiz

70/95
Classical and Modern
Control Intro. to Matlab
Qazi Ejaz Ur Rehman
Avionics Engineer

Introduction
Administration
Basic Math
Laplace Toolboxes to be used in this course are
Overview 1 Simulink
Modeling 2 Mupad (Symbolic math toolbox)
Electrical
Mechanical 3 Control System toolbox
Frequency • Sisotool / rltool
(continous)
Analysis
• PID tunner
Time
• LtiView
(Continous)
Analysis
4 System Identification toolbox
Software 5 Aerospace toolbox
Optional 6 Simulink Control Design
Labs 7 Simulink Design Optimization
Matlab
Commands
8 Simulink 3D animation
Quiz
9 GUI development
71/95
10 Report Generation
Classical and Modern
Control Plotting step response manually
Qazi Ejaz Ur Rehman Instead of using the step command to plot step response,
Avionics Engineer the following manual method can be used for better
understanding:
Introduction
Administration
1 %t i m e
Basic Math 2 tstart = 0 ;
Laplace 3 tstep = 0.01 ;
4 tstop = 3 ;
Overview
5 t = tstart : tstep : tstop ;
Modeling 6 %s t e p r e s p o n s e
7 CF . SR_b = CF . TF_b ;
Electrical
8 CF . SR_a = [ CF . TF_a 0 ] ; %n o t i c e t h a t we ’ v e added a z e r o a s t h e
Mechanical
l a s t term t o c a t e r f o r m u l t i p l i c a t i o n w i t h 1/ s
Frequency 9 CF . SR_eqn = t f ( CF . SR_b , CF . SR_a ) ;
(continous) 10 [ CF . SR_r , . . .
Analysis
11 CF . SR_p , . . .
12 CF . SR_k ] = r e s i d u e ( CF . SR_b , CF . SR_a ) ;
Time 13 %a m p l i t u d e o f s t e p r e s p o n s e
(Continous) 14 CF . SR_y =CF . SR_r ( 1 ) ∗e xp ( CF . SR_p ( 1 ) ∗ t )+ . . .
Analysis 15 CF . SR_r ( 2 ) ∗e xp ( CF . SR_p ( 2 ) ∗ t ) + . . .
16 CF . SR_r ( 3 ) ∗e xp ( CF . SR_p ( 3 ) ∗ t ) ;
Software 17
18 p l o t ( t , CF . SR_y ) ;
Optional 19 g r i d on
20 x l a b e l ( ’ Time ( s e c ) ’ )
Labs
21 y l a b e l ( ’ Wheel a n g u l a r v e l o c i t y r a d / s e c ) ’ ) ;
Matlab 22 t i t l e ( ’DC motor s t e p r e s p o n s e ’ ) ;
Commands

Quiz

72/95 Back to the slide 58


Classical and Modern
Control Lab1
Qazi Ejaz Ur Rehman
Avionics Engineer
Learn to Record and Share Your
Results Electronically
Introduction
Administration
Basic Math
Laplace

Overview • Learn how to make a website and put your results on


Modeling it
Electrical
Mechanical • Website files must not be path dependent, i.e, if I copy
Frequency them to any location such as a USB, or different
(continous)
Analysis
directory, the website must still work
Time
• The main file of the website must be index.html
(Continous)
Analysis
• Many tools are available, but a good cross-platform
Software open source software is kompozer available from
Optional http://www.kompozer.net/
Labs

Matlab
Commands

Quiz

73/95
Classical and Modern
Control Lab1
Qazi Ejaz Ur Rehman
Avionics Engineer
Learn to Extend Existing Work in a
Controls Topic
Introduction
Administration
Basic Math
Laplace
Make groups, pick a research topic, create a website with
Overview
following headings:
Modeling
Electrical
Mechanical
1 Introduction
Frequency 2 Technical Background
(continous)
Analysis 3 Expected Experiments
Time
(Continous) 4 Expected Results
Analysis

Software
5 Expected Conclusions
Optional Present your website. Every group member will be quizzed
Labs randomly. Your final work will count towards your lab exam.
Matlab
Commands

Quiz

74/95
Classical and Modern
Control Lab1
Qazi Ejaz Ur Rehman
Avionics Engineer Gain Effect on Systems

Introduction
Administration
Basic Math
Laplace

Overview

Modeling
Electrical
Mechanical

Frequency
(continous)
Analysis

Time
(Continous)
Analysis

Software

Optional

Labs

Matlab
Commands

Quiz

75/95
Classical and Modern
Control Lab1
Qazi Ejaz Ur Rehman
Avionics Engineer Second order Systems Vs Third order systems

Introduction
Administration
Basic Math
Laplace

Overview

Modeling
Electrical
Mechanical

Frequency
(continous)
Analysis

Time
(Continous)
Analysis

Software

Optional

Labs

Matlab
Commands

Quiz

76/95
Classical and Modern
Control Lab2
Qazi Ejaz Ur Rehman
Avionics Engineer Mathematical Modeling of Motor

Introduction
Administration
• The model we will use will be for a DC motor as given
Basic Math
Laplace
in this slides on Back to Motor Modelling Slide

Overview • Use the following default values for the 6 constants


Modeling needed to model the DC motor:
Electrical
Mechanical

Frequency
Km 0.01 Nm/Amp
(continous)
Analysis
Kb 0.01 V/rad/s
Time L 0.5 H
(Continous)
Analysis
R 1 ω
Software J 0.01 kg m2
Optional b 0.1 N m s
Labs

Matlab
Commands • Enter in Matlab
Quiz

77/95
Classical and Modern
Control Lab2
Qazi Ejaz Ur Rehman
Avionics Engineer Mathematical Modeling of Motor

Introduction
Administration
Basic Math 1 %( a ) t r a n s f e r f u n c t i o n
Laplace
2 CF . TF_b = Km; %n u m e r a t o r
Overview

Modeling
3 CF . TF_a = [ L∗ J L∗b+R∗ J R∗b+Kb∗Km ] ; %
Electrical denominator
Mechanical

Frequency
4 CF . TF_eqn = t f ( CF . TF_b , CF . TF_a ) ; %
(continous) equation
Analysis

Time
5 %( b ) f i n d i m p u l s e r e s p o n s e
(Continous) 6 i m p u l s e ( CF . TF_eqn ) ;
Analysis

Software
7 %( c ) f i n d s t e p r e s p o n s e
Optional
8 s t e p ( CF . TF_eqn ) ;
Labs

Matlab
Commands Optionally, see this slide on plotting step response manually

Quiz

78/95
Classical and Modern
Control Lab 2
Qazi Ejaz Ur Rehman
Avionics Engineer Parameters identification

Introduction 1 u=i n p u t ( ’ u= ’ ) ; % how many t i m e s you want


Administration
Basic Math to run loop
Laplace
2 f o r g =1: u
Overview
3 kd=i n p u t ( ’ kd= ’ ) ;
Modeling
Electrical
4 kp=i n p u t ( ’ kp= ’ ) ;
Mechanical 5 k i=i n p u t ( ’ k i= ’ ) ;
Frequency 6 s=t f ( ’ s ’ ) ;
(continous)
Analysis
7 b=[ kd ∗ s ^2+kp ∗ s+k i ] / [ s ] ; %[ kd ∗ s ^2+kp ∗ s+k i
Time ]/[ s ];
(Continous) 8 G=b / ( s ^2+10∗ s+20+b )
Analysis
9 %f i g u r e ( g )
Software
10 s t e p (G) , g r i d on
Optional
11 [ wn , z ]=damp (G) ;
Labs
12 l=s t e p i n f o (G) ;
Matlab
Commands 13 end
Quiz

79/95
Classical and Modern
Control Lab
Qazi Ejaz Ur Rehman
Avionics Engineer Disturbance Rejection Phenomenon

Introduction
Administration 1 clear all
Basic Math 2 clc
Laplace 3 %% w i t h o u t d i s t u r b a n c e
4 f o r ka = 5 0 : 5 0 : 3 0 0
Overview
5 q=ka ∗ 5 0 0 ;
Modeling 6 f r =t f ( [ q ] , [ 1 1020 20000 0 ] ) ;
7 h=t f ( [ 1 ] ) ;
Electrical
8 a=f e e d b a c k ( f r , h ) ;
Mechanical
9 %s t e p ( a ) , t i t l e ( ’ w i t h o u t d i s t u r b a n c e ’ ) ;
Frequency 10 %% w i t h d i s t u r b a n c e
(continous) 11 f r 1=t f ( [ 1 ] , [ 1 20 0 ] ) ;
Analysis
12 h1=t f ( [ q ] , [ 1 1 0 0 0 ] ) ;
13 b=f e e d b a c k ( f r 1 , h1 ) ;
Time 14 e=q +1000;
(Continous) 15 g=t f ( [ 1 e ] , [ 1 1020 20000 q ] ) ;
Analysis 16 f i g u r e ( ka )
17 step (g)
Software 18 l=s t e p i n f o ( g )
19 pause
Optional 20 clear all
21 clc
Labs 22 end
Matlab
Commands

Quiz

80/95
Classical and Modern
Control Lab2
Qazi Ejaz Ur Rehman
Avionics Engineer Mathematical Modeling

Introduction
Administration
Basic Math
Laplace

Overview

Modeling
Electrical
Mechanical

Frequency
Figure : Figure : Free body diagram
(continous) Train system
Analysis

Time
(Continous)
Analysis
In this example, we will consider a toy train consisting of an
Software
engine and a car. Assuming that the train only travels in
Optional one dimension (along the track), we want to apply control
Labs to the train so that it starts and comes to rest smoothly,
Matlab and so that it can track a constant speed command with
Commands
minimal error in steady state.
Quiz

81/95
Classical and Modern
Control Lab2
Qazi Ejaz Ur Rehman
Avionics Engineer Mathematical Modeling

Introduction
Administration
Basic Math
Laplace

Overview

Modeling
Electrical
Mechanical

Frequency
(continous)
Analysis

Time
(Continous)
Analysis

Software
ΣF1 = F − k(x1 − x2 ) − µM1 g ẋ1 = M1 ẍ1 (1)
Optional

Labs
ΣF2 = k(x1 − x2 ) − µM2 g ẋ2 = M2 ẍ2 (2)
Matlab
Commands

Quiz

82/95
Classical and Modern
Control Lab2
Qazi Ejaz Ur Rehman
Avionics Engineer Mathematical Modeling in Simulink

Introduction
Administration
Basic Math
Laplace

Overview

Modeling
Electrical
Mechanical

Frequency
(continous)
Analysis

Time
(Continous)
Analysis

Software

Optional

Labs

Matlab
Commands
Parameters are: M1 =1 kg; M2 =0.5kg; k=1; F=1; µ=0.02;
Quiz
g=9.8;
83/95
Classical and Modern
Control Lab2
Qazi Ejaz Ur Rehman
Avionics Engineer Mathematical Modeling

Introduction
Administration
Basic Math
Laplace

Overview

Modeling
Electrical
Mechanical

Frequency
(continous)
Analysis
Figure : Boeing
Time
(Continous)
Analysis
Assume that the aircraft is in steady-cruise at constant
Software altitude and velocity; thus, the thrust and drag cancel out
Optional and the lift and weight balance out each other. Also,
Labs assume that change in pitch angle does not change the
Matlab speed of an aircraft under any circumstance (unrealistic but
Commands

Quiz
simplifies the problem a bit). Under these assumptions, the
84/95
longitudinal equations of motion of an aircraft can be
Classical and Modern
Control Lab2
Qazi Ejaz Ur Rehman
Avionics Engineer Mathematical Modeling

α̇ = µΩσ[−(CL + CD0 )α + (1/µ − CL )q − (Cw Sinγe )θ + CL ]


Introduction
Administration

Basic Math q̇ = µΩ/2in [CM − η(CL + CD0 )]α + [CM + σCM (1 − µCL )]q
Laplace

Overview

Modeling +(ηCW sinγe )δ3 ) (1)
Electrical
Mechanical
θ̇ = Ωq
Frequency
(continous) Where:
Analysis α=Angle of attack, q=Pitch rate, θ=Pitch angle, δ=Elevator deflection
Time angle, µ = ρSc̄
4m
, CT =Coefficient of thrust, CD =Coefficient of Drag,
(Continous) CL =Coefficient of lift, CW =coefficient of weight, CM =coefficient of pitch
Analysis
moment , γe = Flight path angle
Software ρ = Density of air
Optional S = Planform area of the wing
Labs
c̄ = Average chord length
m= Mass of aircraft
Matlab
Commands
Ω = 2Uc̄
1
Quiz U =equilibrium flight speed, σ = , i =Normalized
1+µCL n
moment of inertia,
85/95 η = µσC = constant nu
Classical and Modern
Control Lab2
Qazi Ejaz Ur Rehman
Avionics Engineer Mathematical Modeling

Introduction
Before finding transfer function and the state-space model,
Administration let’s plug in some numerical values to simplify the modeling
Basic Math
Laplace equations (1) shown in previous slide.
Overview

Modeling α̇ = −0.313α + 56.7q + 0.232δe


Electrical
Mechanical q̇ = −0.0139α − 0.426q + 0.0203δe (2)
Frequency
(continous) θ̇ = 56.7q
Analysis

Time
(Continous) These values are taken from the data from one of the
Analysis
Boeing’s commercial aircraft.
Software
Obtained open-loop transfer function will be
Optional

Labs θ(s) 1.151s + 0.1774


= 3
Matlab
Commands
δe (s) s + 0.739s 2 + 0.921s
Quiz

86/95
Classical and Modern
Control Lab2
Qazi Ejaz Ur Rehman
Avionics Engineer Closed loop tf...
Closed loop transfer function will be
Introduction
Administration θ(s) Kp (1.151s + 0.1774)
Basic Math = 3 2
Laplace δe (s) s + 0.739s + (1.151KP + 0.921)s + 0.1774KP
Overview

Modeling commands to be used are conv and cloop i.e.


Electrical
Mechanical code
Frequency
(continous)
Analysis
1 Kp = [ 1 ] ; % E n t e r any n u m e r i c a l v a l u e
Time
(Continous)
f o r the p r o p o r t i o n a l gain
Analysis
2 num= [ 1 . 1 5 1 0 . 1 7 7 4 ] ;
Software
3 num1=conv ( Kp , num) ;
Optional
4 den1 =[1 0 . 7 3 9 0 . 9 2 1 0 ] ;
Labs
5 [ numc , denc ]= c l o o p ( num1 , den1 ) ;
Matlab
Commands 6 s t e p ( numc , denc )
Quiz

87/95
Classical and Modern
Control Lab2
Qazi Ejaz Ur Rehman
Avionics Engineer Proportional Controller Design
The design requirements are
Introduction • Overshoot: Less than 10%
Administration
Basic Math • Rise time: Less than 2 seconds
Laplace
• Settling time: Less than 10 seconds
Overview

Modeling
• Steady-state error: Less than 2%
Electrical
Mechanical
As it is known
Frequency 4.6
(continous) ζωn ≥
Analysis Ts
Time 1.8
(Continous) ωn ≥
Analysis Tr
Software
s
(lnMp /π)2
Optional ζ≥
Labs
1 + (lnMp /π)2
Matlab
Commands
where
Quiz Mp =Maximum overshoot
88/95 values found to be are ωn = 0.9 and ζ = 0.52
Classical and Modern
Control Lab2
Qazi Ejaz Ur Rehman
Avionics Engineer Root locus

Introduction
Administration
Basic Math
Laplace
code
Overview

Modeling 1 num= [ 1 . 1 5 1 0 . 1 7 7 4 ] ;
Electrical
Mechanical
2 den =[1 0 . 7 3 9 0 . 9 2 1 0 ] ;
Frequency 3 Wn= 0 . 9 ;
(continous)
Analysis
4 zeta =0.52;
Time 5 r l o c u s ( num , den )
(Continous)
Analysis 6 s g r i d ( z e t a ,Wn)
Software 7 a x i s ([ −1 0 −2.5 2 . 5 ] )
Optional

Labs

Matlab
Commands

Quiz

89/95
Classical and Modern
Control Lab2
Qazi Ejaz Ur Rehman
Avionics Engineer Lead Compensator in editer
s − z0
Introduction Gc (s) = Kc
Administration s − p0
Basic Math
Laplace
Z0 =zero
Overview
p0 =pole
Modeling
Electrical
Z 0 < P0
Mechanical

Frequency
code
(continous)
Analysis
1 num1 = [ 1 . 1 5 1 0 . 1 7 7 4 ] ;
Time 2 den1 =[1 0 . 7 3 9 0 . 9 2 1 0 ] ;
(Continous) 3 num2=[1 0 . 9 ] ; den2 =[1 2 0 ] ;
Analysis
4 num=c o n v ( num1 , num2 ) ;
5 den=c o n v ( den1 , den2 ) ;
Software 6 Wn= 0 . 9 ; zeta =0.52;
7 r l o c u s ( num , den )
Optional 8 a x i s ([ −3 0 −2 2 ] )
9 s g r i d ( z e t a ,Wn)
Labs 10 [ K , p o l e s ]= r l o c f i n d ( num , den )
11 de = 0 . 2 ;
Matlab
12 [ numc , d e n c ]= c l o o p (K∗num , den , −1) ;
Commands
13 s t e p ( de∗numc , d e n c )
Quiz

90/95
Classical and Modern
Control Lab2
Qazi Ejaz Ur Rehman
Avionics Engineer Lead Compensator design using sisotool

Introduction
Administration
Basic Math
Laplace

Overview

Modeling
Electrical
Mechanical

Frequency
(continous)
Analysis
Sisotool for designing PD compensater, lead compensater
Time
(Continous) or lead-lag compensater
Analysis

Software

Optional

Labs

Matlab
Commands

Quiz

91/95
Classical and Modern
Control Matlab Commands Used
Qazi Ejaz Ur Rehman
Avionics Engineer Commonly

Introduction For Help in Matlab type doc command_name (etc. doc


Administration
Basic Math
linspace)
Laplace

Overview • linspace, logspace


• roots, poly, polyval
Modeling
• inv, max, det
Electrical
Mechanical
• tf, ss, tf2ss, ss2tf, zp2tf,
• edit, who, ls, dir, cd
Frequency • residue, series, parallel,
(continous) • plot, subplot, meshgrid
Analysis • feedback, step, impulse,
Time • contour, bar, mesh, surf lsim
(Continous)
Analysis • clear all, delete, clc, • cloop, bode, rlocus,
Software close all, clf, cla margin, canon
Optional
• xlabel, ylabel, grid, hold • laplace, diff, int, fourier
Labs

Matlab
on/off, axis
Commands
for more commands visit Link
Quiz

92/95
Classical and Modern
Control Quiz
Qazi Ejaz Ur Rehman
Avionics Engineer Total time of 10-15 min.

Introduction
Administration
Basic Math
Laplace

Overview

Modeling
Electrical
Mechanical
where
Frequency
(continous)
1 X 1
• (M)=mass of the cart=0.5 kg
Analysis ẍ = Fx = (F − N − b ẋ ) (1) • (m)= mass of the pendulum= 0.2 kg
M M
Time cart • (b)=coefficient of friction for cart=0.1
(Continous) N/m/sec
1 X 1
Analysis
θ̈ = τ = (−Nlcosθ − Plsinθ) (2) • (l)=length to pendulum center of
Software
I I mass=0.3 m
pend
• (I)= mass moment of inertia of the
Optional
N = m(ẍ − l θ̇2 sinθ + l θ̈cosθ) (3) pendulum= 0.006 kg.m2
Labs • (F)=force applied to the cart
P = m(l θ̇2 cosθ + l θ̈sinθ) + g (4)
Matlab • (x)=cart position coordinate
Commands • (theta)=pendulum angle from vertical
(down)
Quiz

93/95 Alternative Quiz Link


Classical and Modern
Control Quiz
Qazi Ejaz Ur Rehman
Avionics Engineer Solution

Introduction
Administration
Basic Math
Laplace

Overview

Modeling
Electrical
Mechanical

Frequency
(continous)
Analysis

Time
(Continous)
Analysis

Software

Optional

Labs

Matlab
Commands

Quiz

94/95
Classical and Modern
Control

Qazi Ejaz Ur Rehman


Avionics Engineer

Introduction
Administration
Basic Math

Thank you
Laplace

Overview

Modeling
Electrical
Mechanical

Frequency
(continous)
Analysis

Time
(Continous)
Analysis

Software

Optional Email
Labs

Matlab
Commands

Quiz

95/95

You might also like