Slideshare uses cookies to improve functionality and performance, and to provide you with relevant advertising. If you continue browsing the site, you agree to the use of cookies on this website. See our User Agreement and Privacy Policy.

Slideshare uses cookies to improve functionality and performance, and to provide you with relevant advertising. If you continue browsing the site, you agree to the use of cookies on this website. See our Privacy Policy and User Agreement for details.

Successfully reported this slideshow.

Like this presentation? Why not share!

1,822 views

Published on

Slides on Classical Control Theory with an introduction to Modern Control Theory

Published in:
Engineering

No Downloads

Total views

1,822

On SlideShare

0

From Embeds

0

Number of Embeds

11

Shares

0

Downloads

86

Comments

0

Likes

7

No embeds

No notes for slide

- 1. Classical and Modern Control Qazi Ejaz Ur Rehman Avionics Engineer Graduate Research Assistant Aerospace & Astronautics Department Institute of Space Technology Islamabad December 18, 2015
- 2. Classical and Modern Control Qazi Ejaz Ur Rehman Avionics Engineer Introduction Administration Basic Math Laplace Overview Modeling Electrical Mechanical Frequency (continous) Analysis Time (Continous) Analysis Software Optional Labs Matlab Commands Quiz 2/95 Outline 1 Introduction Administration Basic Math Laplace 2 Overview 3 Modeling Electrical Mechanical 4 Frequency (continous) Analysis 5 Time (Continous) Analysis 6 Software 7 Optional 8 Labs 9 Matlab Commands 10 Quiz
- 3. Classical and Modern Control Qazi Ejaz Ur Rehman Avionics Engineer Introduction Administration Basic Math Laplace Overview Modeling Electrical Mechanical Frequency (continous) Analysis Time (Continous) Analysis Software Optional Labs Matlab Commands Quiz 3/95 Introduction Contact • Oﬃce No.: 051-907-5504 ¤ • E-mail: qejaz@cae.nust.edu.pk 1 • Oﬃce hours: After 11:00 am 1 ejaz.rehman@ist.edu.pk
- 4. Classical and Modern Control Qazi Ejaz Ur Rehman Avionics Engineer Introduction Administration Basic Math Laplace Overview Modeling Electrical Mechanical Frequency (continous) Analysis Time (Continous) Analysis Software Optional Labs Matlab Commands Quiz 4/95 Introduction Text Book
- 5. Classical and Modern Control Qazi Ejaz Ur Rehman Avionics Engineer Introduction Administration Basic Math Laplace Overview Modeling Electrical Mechanical Frequency (continous) Analysis Time (Continous) Analysis Software Optional Labs Matlab Commands Quiz 5/95 Introduction Text Book
- 6. Classical and Modern Control Qazi Ejaz Ur Rehman Avionics Engineer Introduction Administration Basic Math Laplace Overview Modeling Electrical Mechanical Frequency (continous) Analysis Time (Continous) Analysis Software Optional Labs Matlab Commands Quiz 6/95 Calculus Integration by parts 2 2 Link
- 7. Classical and Modern Control Qazi Ejaz Ur Rehman Avionics Engineer Introduction Administration Basic Math Laplace Overview Modeling Electrical Mechanical Frequency (continous) Analysis Time (Continous) Analysis Software Optional Labs Matlab Commands Quiz 7/95 Linear Algebra Partial fraction expansion 3 3 Link
- 8. Classical and Modern Control Qazi Ejaz Ur Rehman Avionics Engineer Introduction Administration Basic Math Laplace Overview Modeling Electrical Mechanical Frequency (continous) Analysis Time (Continous) Analysis Software Optional Labs Matlab Commands Quiz 8/95 Linear Algebra Determinants Here’s an easy illustration that shows why the determinant of a matrix with linear dependent rows is 0 M = a b 2a 2b ⇒ |M| = a(2b) − 2b(a) = 0 Let’s look at a 3x3 example.
- 9. Classical and Modern Control Qazi Ejaz Ur Rehman Avionics Engineer Introduction Administration Basic Math Laplace Overview Modeling Electrical Mechanical Frequency (continous) Analysis Time (Continous) Analysis Software Optional Labs Matlab Commands Quiz 9/95 Linear Algebra Determinants M = a b c 2a 2b c d e f ⇒ |M| = a(2bf − 2ce) − b(2af − 2cd) + c(2ae − 2bd) = 0 Let’s change the order of rows M = d e f a b c 2a 2b c ⇒ |M| = d(2bc − 2bc) − e(2ac − 2ac) + f (2ab − 2ab) = 0 Let’s change the order of rows again M = d e f 2a 2b c a b c ⇒ |M| = a(2ce − 2bf ) − b(2dc − 2af ) + c(2db − 2ae) = 0 In other words, if we have dependent rows, then the determinant of the matrix is 0
- 10. Classical and Modern Control Qazi Ejaz Ur Rehman Avionics Engineer Introduction Administration Basic Math Laplace Overview Modeling Electrical Mechanical Frequency (continous) Analysis Time (Continous) Analysis Software Optional Labs Matlab Commands Quiz 10/95 Linear Algebra Adjoint of matrix 4 4 Link
- 11. Classical and Modern Control Qazi Ejaz Ur Rehman Avionics Engineer Introduction Administration Basic Math Laplace Overview Modeling Electrical Mechanical Frequency (continous) Analysis Time (Continous) Analysis Software Optional Labs Matlab Commands Quiz 11/95 Linear Algebra Inverse of matrix A−1 = 1 |A| (Adjoint of A)
- 12. Classical and Modern Control Qazi Ejaz Ur Rehman Avionics Engineer Introduction Administration Basic Math Laplace Overview Modeling Electrical Mechanical Frequency (continous) Analysis Time (Continous) Analysis Software Optional Labs Matlab Commands Quiz 12/95 Laplace Transform Tables
- 13. Classical and Modern Control Qazi Ejaz Ur Rehman Avionics Engineer Introduction Administration Basic Math Laplace Overview Modeling Electrical Mechanical Frequency (continous) Analysis Time (Continous) Analysis Software Optional Labs Matlab Commands Quiz 13/95 Laplace Transform Tables 5 5 Link
- 14. Classical and Modern Control Qazi Ejaz Ur Rehman Avionics Engineer Introduction Administration Basic Math Laplace Overview Modeling Electrical Mechanical Frequency (continous) Analysis Time (Continous) Analysis Software Optional Labs Matlab Commands Quiz 14/95 Laplace Transform Tables 6 6 Link
- 15. Classical and Modern Control Qazi Ejaz Ur Rehman Avionics Engineer Introduction Administration Basic Math Laplace Overview Modeling Electrical Mechanical Frequency (continous) Analysis Time (Continous) Analysis Software Optional Labs Matlab Commands Quiz 15/95 Laplace Transform Plot of simple ﬁrst order equation Let H(s) = 1 s+10,We’ve plotted the magnitude of H(s) below, i.e., |H(s)|. Other possible 3D plots are ∠ H(s), Re(H(s)) and Im(H(s)) respectively. Notice that |H(s)| goes to ∞ at the pole s = -10.
- 16. Classical and Modern Control Qazi Ejaz Ur Rehman Avionics Engineer Introduction Administration Basic Math Laplace Overview Modeling Electrical Mechanical Frequency (continous) Analysis Time (Continous) Analysis Software Optional Labs Matlab Commands Quiz 16/95 Laplace Transform 3-D code for Transfer functions 1 a=−40;c =40;b=1; 2 g=a : b : c ; 3 h=g ; 4 [ r , t ]= meshgrid (g , h ) ; 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 7 mesh ( r , t , abs ( Hs ) ) ; 8 hold on 9 f o r omega=g 10 Hjw = 1./(1 i ∗omega + 10) ; %frequency domain 11 p l o t 3 (0 , omega , abs (Hjw ) , ’ ro ’ ) ; 12 end 13 g=4; 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 a x i s 16 l i n e ( [ 0 0 ] , [0 0 ] , [0 0 . 5 ] ) ; % z a x i s 17 hold on ; 18 p l o t 3 (0 ,0 ,1) 19 %t e x t f o r xyz axes 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$ ’ , ’ P o s i t i o n ’ , [ c +4∗g 0 0 ] , ’ FontSize ’ , 20) ; % x a x i s 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 ] , ’ FontSize ’ , 20) ; % y a x i s 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 ) | $ ’ , ’ P o s i t i o n ’ , [0 0 0 . 5 ] , ’ FontSize ’ , 20) ; % z a x i s 23 a x i s ( [ a−g c+g a−g c+g 0 0 . 4 ] ) 24 view (100 ,36)
- 17. Classical and Modern Control Qazi Ejaz Ur Rehman Avionics Engineer Introduction Administration Basic Math Laplace Overview Modeling Electrical Mechanical Frequency (continous) Analysis Time (Continous) Analysis Software Optional Labs Matlab Commands Quiz 17/95 Laplace Transform Plot of Second order equation Let H(s) = s+5 (s+10)(s−5) . We’ve plotted the magnitude of H(s) below, i.e., |H(s)|. Other possible 3D plots are ∠H(s), Re(H(s)) and Im(H(s)), respectively. Notice that |H(s)| goes to ∞ at the pole s = -10 and 5 while it converges to down at the zero s=-5.
- 18. Classical and Modern Control Qazi Ejaz Ur Rehman Avionics Engineer Introduction Administration Basic Math Laplace Overview Modeling Electrical Mechanical Frequency (continous) Analysis Time (Continous) Analysis Software Optional Labs Matlab Commands Quiz 18/95 Laplace Transform Laplace Transform of integration and derivative For more details on how the Laplace transform for integration is 1/s and Laplace transform for derivative is s then see http://www2.kau.se/yourshes/AB28.pdf
- 19. Classical and Modern Control Qazi Ejaz Ur Rehman Avionics Engineer Introduction Administration Basic Math Laplace Overview Modeling Electrical Mechanical Frequency (continous) Analysis Time (Continous) Analysis Software Optional Labs Matlab Commands Quiz 19/95 Control Systems FREQUENCY (Continous) and Time
- 20. Classical and Modern Control Qazi Ejaz Ur Rehman Avionics Engineer Introduction Administration Basic Math Laplace Overview Modeling Electrical Mechanical Frequency (continous) Analysis Time (Continous) Analysis Software Optional Labs Matlab Commands Quiz 20/95 Control Systems Introduction Among mechanistic systems, we are interested in linear systems. Here are some examples: 1 Filters (analog and digital 2 Control sysytems • A control system is an interconnection of components forming a system conﬁguration that will provide a desired system response • An open loop control system utilizes an actuating device to control the process directly without using feedback uses a controller and an actuator to obtain the desired response • A closed loop control system uses a measurement of the output and feedback of this signal to compare it with the desired output (reference or command)
- 21. Classical and Modern Control Qazi Ejaz Ur Rehman Avionics Engineer Introduction Administration Basic Math Laplace Overview Modeling Electrical Mechanical Frequency (continous) Analysis Time (Continous) Analysis Software Optional Labs Matlab Commands Quiz 21/95 Control Systems Introduction • To understand and control complex systems, one must obtain quantitative mathematical models of these systems • It is therefore necessary to analyze the relationships between the system variables and to obtain a mathematical model • Because the systems under consideration are dynamic in nature, the descriptive equations are usually diﬀerential equations • Furthermore, if these equations are linear or can be linearized, then the Laplace Transform can be used to simplify the method of solution
- 22. Classical and Modern Control Qazi Ejaz Ur Rehman Avionics Engineer Introduction Administration Basic Math Laplace Overview Modeling Electrical Mechanical Frequency (continous) Analysis Time (Continous) Analysis Software Optional Labs Matlab Commands Quiz 22/95 Control Systems Introduction Control system analysis and design focuses on three things: 1 transient response 2 stability 3 steady state errors For this, the equation (model), impulse response and step response are studied. Other important parameters are sensitivity/robustness and optimality. Control system design entails tradeoﬀs between desired transient response, steady-state error and the requirement that the system be stable.
- 23. Classical and Modern Control Qazi Ejaz Ur Rehman Avionics Engineer Introduction Administration Basic Math Laplace Overview Modeling Electrical Mechanical Frequency (continous) Analysis Time (Continous) Analysis Software Optional Labs Matlab Commands Quiz 23/95 Control Systems Analysis The analysis of control systems can be done in the following nine ways: 1 equation 2 poles/zeros/controllability/observability 3 stability 4 impulse response 5 step response 6 steady-state response 7 transient response 8 sensitivity 9 optimality The design of control systems can be done in the following ways: 1 Pole placement (PID in frequency and time, state feedback in time) Back to immediate slide
- 24. Classical and Modern Control Qazi Ejaz Ur Rehman Avionics Engineer Introduction Administration Basic Math Laplace Overview Modeling Electrical Mechanical Frequency (continous) Analysis Time (Continous) Analysis Software Optional Labs Matlab Commands Quiz 24/95 Modeling RLC Circuit L di(t) dt + Ri(t) + 1 C q(t) = v(t) (1) i(t) = dq(t) dt (2) ⇒ L d2q(t) dt2 + R dq(t) dt + 1 C q(t) = v(t) ⇒ L¨q(t) + R ˙q(t) + 1 C q(t) = v(t)
- 25. Classical and Modern Control Qazi Ejaz Ur Rehman Avionics Engineer Introduction Administration Basic Math Laplace Overview Modeling Electrical Mechanical Frequency (continous) Analysis Time (Continous) Analysis Software Optional Labs Matlab Commands Quiz 25/95 Modeling Series RLC Circuit State Space Representation Let, x1 = q(t) x2 = ˙x1 = ˙q(t) ˙x2 = ¨q(t) Substituting, L¨q(t) + R ˙q(t) + 1 C q(t) = v(t) L ˙x2 + Rx2 + 1 C x1 = v(t) Now Write, ˙x1 = x2 ˙x2 = − 1 LC x1 − R L x2 + 1 L v(t) ˙x1 ˙x2 = 0 1 − 1 LC − R L x1 x2 + 0 1 L v(t)
- 26. Classical and Modern Control Qazi Ejaz Ur Rehman Avionics Engineer Introduction Administration Basic Math Laplace Overview Modeling Electrical Mechanical Frequency (continous) Analysis Time (Continous) Analysis Software Optional Labs Matlab Commands Quiz 26/95 Modeling C parallel with RL circuit iC = −iL + u(t) ⇒ C dvC dt = −iL + u(t) ⇒ dvC dt = − 1 C iL + 1 C u(t) VC = VL + iLR = L diL dt + iLR solve for diL dt
- 27. Classical and Modern Control Qazi Ejaz Ur Rehman Avionics Engineer Introduction Administration Basic Math Laplace Overview Modeling Electrical Mechanical Frequency (continous) Analysis Time (Continous) Analysis Software Optional Labs Matlab Commands Quiz 27/95 Modeling C parallel with RL circuit Starting oﬀ with diﬀerential equations, we go to state space dvC dt = − 1 C iL + 1 C u(t) diL dt = 1 L vC − 1 L iLR ˙VC ˙iL = 0 − 1 C 1 L −R L VC iL + 1 C 0 u(t)
- 28. Classical and Modern Control Qazi Ejaz Ur Rehman Avionics Engineer Introduction Administration Basic Math Laplace Overview Modeling Electrical Mechanical Frequency (continous) Analysis Time (Continous) Analysis Software Optional Labs Matlab Commands Quiz 28/95 Modeling Constant acceleration model ¨s(t) = a t t0 ¨s(τ) dτ = t t0 a dτ ˙s(τ)| t t0 = a τ| t t0 ˙s(t) − ˙s(t0) = at − at0 t t0 ˙s(τ)dτ − t t0 ˙s(t0)dτ = t t0 aτdτ − t t0 at0dτ s(τ)| t t0 − ˙s(t0)τ| t t0 = 1 2 a τ 2 | t t0 − at0τ| t t0 s(t) − s(t0) − ˙s(t0)t + ˙s(t0)t0 = 1 2 at 2 − 1 2 at0 2 − at0t + at0 2 let initial time t0 = 0, initial distance s(t0) = 0, and some initial velocity ˙s(t0) = vi , to get the familiar equation, s(t) = vi t + 1 2 at 2 If we take the derivative with respect to t, we get vf = vi + at
- 29. Classical and Modern Control Qazi Ejaz Ur Rehman Avionics Engineer Introduction Administration Basic Math Laplace Overview Modeling Electrical Mechanical Frequency (continous) Analysis Time (Continous) Analysis Software Optional Labs Matlab Commands Quiz 29/95 Modeling Constant acceleration model • The equations s = vi t + 1 2at2 and vf = vi + at can be written in state space as, s vf = 0 t 0 1 si vi + 1 2t2 t f m and writing in terms of states x and input u, we get, xt = xt ˙xt = 0 t 0 1 xt−1 ˙xt−1 + 1 2 t2 m t m u • Note that we have used f = ma, and the input u is the force f
- 30. Classical and Modern Control Qazi Ejaz Ur Rehman Avionics Engineer Introduction Administration Basic Math Laplace Overview Modeling Electrical Mechanical Frequency (continous) Analysis Time (Continous) Analysis Software Optional Labs Matlab Commands Quiz 30/95 Modeling DC Motor cont.. vb = Kbω = Kb ˙θ Diﬀerential equations L di dt + Ri = v − vb 1 J ¨θ + b ˙θ = Km i 2 R: electrical resistance 1 ohm L: electrical inductance 0.5H J: moment of inertia 0.01 kg.m2 b: motor friction constant 0.1 N.m.s Kb: emf constant 0.01 V/rad/sec Km: torque constant 0.01 N.m/AmpLab 2 Laplace Domain LsI(s) + RI(s) = V (s) − Vb(s) (3) Js 2 θ + bsθ = Km I(s) (4) where Vb(s) = Kbω(s) = Kb sθ solving equation 3 and 4 simultaneously angular distance (rad) G1(s) = θ(s) V (s) = Km [( Ls + R)( Js + b) + KbKm] angular rate (rad/sec) Gp(s) = ω(s) V (s) = sG1(s) = = Kb L Js2 + ( L b + R J)s + ( R b + KbKm )
- 31. Classical and Modern Control Qazi Ejaz Ur Rehman Avionics Engineer Introduction Administration Basic Math Laplace Overview Modeling Electrical Mechanical Frequency (continous) Analysis Time (Continous) Analysis Software Optional Labs Matlab Commands Quiz 31/95 Modeling DC Motor cont.. G1(s) = θ(s) V (s) = 1 s Km [(Ls + R)(Js + b) + KbKm] Gp(s) = ˙θ(s) V (s) = Km [(Ls + R)(Js + b) + KbKm] Note that we have set Td , TL, TM = 0 for calculating G1(s) and Gp(s).
- 32. Classical and Modern Control Qazi Ejaz Ur Rehman Avionics Engineer Introduction Administration Basic Math Laplace Overview Modeling Electrical Mechanical Frequency (continous) Analysis Time (Continous) Analysis Software Optional Labs Matlab Commands Quiz 32/95 Modeling DC Motor cont.. A motor can be represented simply as an integrator. A voltage applied to the motor will cause rotation. When the applied voltage is removed, the motor will stop and remain at its present output position. Since it does not return to its initial position, we have an angular displacement output without an input to the motor.
- 33. Classical and Modern Control Qazi Ejaz Ur Rehman Avionics Engineer Introduction Administration Basic Math Laplace Overview Modeling Electrical Mechanical Frequency (continous) Analysis Time (Continous) Analysis Software Optional Labs Matlab Commands Quiz 33/95 Frequency (continous) : analysis Introduction • Known as classical control, most work is in Laplace domain • You can replace s in Laplace domain with jω to go to frequency domain
- 34. Classical and Modern Control Qazi Ejaz Ur Rehman Avionics Engineer Introduction Administration Basic Math Laplace Overview Modeling Electrical Mechanical Frequency (continous) Analysis Time (Continous) Analysis Software Optional Labs Matlab Commands Quiz 34/95 Frequency (continous): analysis Test Waveform
- 35. Classical and Modern Control Qazi Ejaz Ur Rehman Avionics Engineer Introduction Administration Basic Math Laplace Overview Modeling Electrical Mechanical Frequency (continous) Analysis Time (Continous) Analysis Software Optional Labs Matlab Commands Quiz 35/95 Frequency (continous): analysis Systems: 1st order dy dt + a0y = b0r sY (s) − y(¯0) + a0Y (s) = b0R(s) sY (s) + a0Y (s) = b0R(s) − y(¯0) Y (s) = b0 s + a0 R(s) + y(¯0) s + a0 • It is considered stable if the natural response decays to 0, i.e., the roots of the denominator must lie in LHP, so a0 > 0 • The time constant τ of a stable ﬁrst order system is 1/a0 • In other words, the time constant is the negative of the reciprocal of the pole
- 36. Classical and Modern Control Qazi Ejaz Ur Rehman Avionics Engineer Introduction Administration Basic Math Laplace Overview Modeling Electrical Mechanical Frequency (continous) Analysis Time (Continous) Analysis Software Optional Labs Matlab Commands Quiz 36/95 Frequency (continous): analysis Systems: 1st order
- 37. Classical and Modern Control Qazi Ejaz Ur Rehman Avionics Engineer Introduction Administration Basic Math Laplace Overview Modeling Electrical Mechanical Frequency (continous) Analysis Time (Continous) Analysis Software Optional Labs Matlab Commands Quiz 37/95 Frequency (continous): analysis Systems: 1st order
- 38. Classical and Modern Control Qazi Ejaz Ur Rehman Avionics Engineer Introduction Administration Basic Math Laplace Overview Modeling Electrical Mechanical Frequency (continous) Analysis Time (Continous) Analysis Software Optional Labs Matlab Commands Quiz 38/95 Frequency (continous): analysis Systems: 2nd order Let G(s) = ω2 n s(s+2ζωn) Y (s) = X(s) − Y (s) G(s) Y (s) = E(s)G(s) Y (s) + Y (s)G(s) = X(s)G(s) ⇒ Y (s) X(s) = G(s) 1 + G(s) = ω2 n s2 + 2ζω2 ns + ω2 n = b0 s2 + 2ζω2 ns + ω2 n ζ is dimensionless damping ratio and ωn is the natural frequency or undamped frequency
- 39. Classical and Modern Control Qazi Ejaz Ur Rehman Avionics Engineer Introduction Administration Basic Math Laplace Overview Modeling Electrical Mechanical Frequency (continous) Analysis Time (Continous) Analysis Software Optional Labs Matlab Commands Quiz 39/95 Frequency (continous): analysis Systems: 2nd order The poles can be found by ﬁnding the roots of the denominator of Y (s) X(s) s1,2 = −(2ζωn) ± (2ζωn)2 − 4ω2 n 2 = −(2ζωn) ± (4ζ2ω2 n) − 4ω2 n 2 = −(2ζωn) ± 2ωn ζ2 − 1 2 = −ζωn ± ωn ζ2 − 1 = −ζωn ± jωn 1 − ζ2
- 40. Classical and Modern Control Qazi Ejaz Ur Rehman Avionics Engineer Introduction Administration Basic Math Laplace Overview Modeling Electrical Mechanical Frequency (continous) Analysis Time (Continous) Analysis Software Optional Labs Matlab Commands Quiz 40/95 Frequency (continous): analysis Systems: 2nd order Formulas: %OS = e−ζπ/ √ 1−ζ2 × 100 Notice that % OS only depends on the damping ratio ζ
- 41. Classical and Modern Control Qazi Ejaz Ur Rehman Avionics Engineer Introduction Administration Basic Math Laplace Overview Modeling Electrical Mechanical Frequency (continous) Analysis Time (Continous) Analysis Software Optional Labs Matlab Commands Quiz 41/95 Frequency (continous): analysis Systems: 2nd order: Damping
- 42. Classical and Modern Control Qazi Ejaz Ur Rehman Avionics Engineer Introduction Administration Basic Math Laplace Overview Modeling Electrical Mechanical Frequency (continous) Analysis Time (Continous) Analysis Software Optional Labs Matlab Commands Quiz 42/95 Frequency (continous): analysis Systems: 2nd order: Damping Underdamped system • Pole positions for an underdamped (ζ < 1) second order system s1, s2 = −ζωn ± jωn 1 − ζ2 when plotted on the s-plane
- 43. Classical and Modern Control Qazi Ejaz Ur Rehman Avionics Engineer Introduction Administration Basic Math Laplace Overview Modeling Electrical Mechanical Frequency (continous) Analysis Time (Continous) Analysis Software Optional Labs Matlab Commands Quiz 43/95 Frequency (continous): analysis Systems: 2nd order 1 Rise Time Tr : The time required for the waveform to go from 0.1 of the ﬁnal value to 0.9 of the ﬁnal value 2 Peak Time Tp: The time required to reach the ﬁrst, or maximum, peak • % overshoot: The amount that the waveform overshoots the steady-state or ﬁnal, value at the peak time, expressed as a percentage of the steady-state value 3 The time required for the transient’s damped oscillations to reach and stay within 2% of the steady-state value
- 44. Classical and Modern Control Qazi Ejaz Ur Rehman Avionics Engineer Introduction Administration Basic Math Laplace Overview Modeling Electrical Mechanical Frequency (continous) Analysis Time (Continous) Analysis Software Optional Labs Matlab Commands Quiz 44/95 Frequency (continous): analysis Systems: types Relationships between input, system type, static error constants and steady-state errors.
- 45. Classical and Modern Control Qazi Ejaz Ur Rehman Avionics Engineer Introduction Administration Basic Math Laplace Overview Modeling Electrical Mechanical Frequency (continous) Analysis Time (Continous) Analysis Software Optional Labs Matlab Commands Quiz 45/95 Frequency (continous): analysis The Characteristics of P, I, and D Controllers • A proportional controller (Kp) will have the eﬀect of reducing the rise time and will reduce but never eliminate the steady-state error. • An integral control (Ki ) will have the eﬀect of eliminating the steady-state error for a constant or step input, but it may make the transient response slower. • A derivative control (Kd ) will have the eﬀect of increasing the stability of the system, reducing the overshoot, and improving the transient response. The eﬀects of each of controller parameters, Kp, Kd , and Ki on a closed-loop system are summarized in the table below.
- 46. Classical and Modern Control Qazi Ejaz Ur Rehman Avionics Engineer Introduction Administration Basic Math Laplace Overview Modeling Electrical Mechanical Frequency (continous) Analysis Time (Continous) Analysis Software Optional Labs Matlab Commands Quiz 46/95 Frequency (continous): analysis The Characteristics of P, I, and D Controllers CL RESPONSE RISE TIME OVERSHOOT SETTLING TIME S-S ERROR Kp Decrease Increase Small Change Decrease Ki Decrease Increase Increase Eliminate Kd Small Change Decrease Decrease No Change 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 eﬀect of the other two. For this reason, the table should only be used as a reference when you are determining the values for Ki , Kp and Kd . u(t) = Kpe(t) + Ki e(t)dt + Kp de dt
- 47. Classical and Modern Control Qazi Ejaz Ur Rehman Avionics Engineer Introduction Administration Basic Math Laplace Overview Modeling Electrical Mechanical Frequency (continous) Analysis Time (Continous) Analysis Software Optional Labs Matlab Commands Quiz 47/95 Frequency (continous): analysis Eﬀect of poles and zeros
- 48. Classical and Modern Control Qazi Ejaz Ur Rehman Avionics Engineer Introduction Administration Basic Math Laplace Overview Modeling Electrical Mechanical Frequency (continous) Analysis Time (Continous) Analysis Software Optional Labs Matlab Commands Quiz 48/95 Frequency (continous): analysis Eﬀect of poles and zeros • The zeros of a response aﬀect the residue, or amplitude, of a response component but do not aﬀect the nature of the response, exponential, damped, sinusoid, and so on Starting with a two-pole system with poles at -1 ± j2.828, we consecutively add zeros at -3, -5 and -10. The closer the zero is to the dominant poles, the greater its eﬀect on
- 49. Classical and Modern Control Qazi Ejaz Ur Rehman Avionics Engineer Introduction Administration Basic Math Laplace Overview Modeling Electrical Mechanical Frequency (continous) Analysis Time (Continous) Analysis Software Optional Labs Matlab Commands Quiz 49/95 Frequency (continous): analysis Eﬀect of poles and zeros T(s) = (s + a) (s + b)(s + c) = A s + b + B s + c = (−b + a)/(−b + s + b if zero is far from the poles, then a is large compared to b and c, and T(s) ≈ a 1/(−b + c) s + b + 1/(−c + b) s + c = a (s + b)(s + c) If the zero is far from the poles, then it looks like a simple gain factor and does not change the relative amplitudes of the components of the response.
- 50. Classical and Modern Control Qazi Ejaz Ur Rehman Avionics Engineer Introduction Administration Basic Math Laplace Overview Modeling Electrical Mechanical Frequency (continous) Analysis Time (Continous) Analysis Software Optional Labs Matlab Commands Quiz 50/95 Frequency (continous): analysis Root locus Representation of paths of closed loop poles as the gain is varied.
- 51. Classical and Modern Control Qazi Ejaz Ur Rehman Avionics Engineer Introduction Administration Basic Math Laplace Overview Modeling Electrical Mechanical Frequency (continous) Analysis Time (Continous) Analysis Software Optional Labs Matlab Commands Quiz 51/95 Frequency (continous): analysis Root locus • The root locus graphically displays both transient response and stability information • The root locus can be sketched quickly to get an idea of the changes in transient response generated by changes in gain • The root locus typically allows us to choose the proper loop gain to meet a transient response speciﬁcation • As the gain is varied, we move through diﬀerent regions of response • Setting the gain at a particular value yields the transient response dictated by the poles at that point on the root locus • Thus, we are limited to those responses that exist along the root
- 52. Classical and Modern Control Qazi Ejaz Ur Rehman Avionics Engineer Introduction Administration Basic Math Laplace Overview Modeling Electrical Mechanical Frequency (continous) Analysis Time (Continous) Analysis Software Optional Labs Matlab Commands Quiz 52/95 Frequency (continous): analysis Nyquist Determine closed loop system stability using a polar plot of the open-loop frequency responseG(jω)H(jω) as ω increases from -∞ to ∞
- 53. Classical and Modern Control Qazi Ejaz Ur Rehman Avionics Engineer Introduction Administration Basic Math Laplace Overview Modeling Electrical Mechanical Frequency (continous) Analysis Time (Continous) Analysis Software Optional Labs Matlab Commands Quiz 53/95 Frequency (continous): analysis Routh Hurwitz Find out how many closed-loop system poles are in LHP (left half-plane), in RHP (right half-plane) and on the jω axis
- 54. Classical and Modern Control Qazi Ejaz Ur Rehman Avionics Engineer Introduction Administration Basic Math Laplace Overview Modeling Electrical Mechanical Frequency (continous) Analysis Time (Continous) Analysis Software Optional Labs Matlab Commands Quiz 54/95 Frequency (continous): analysis Performance Indeces cont. • A performance index is a quantitative measure of the performance of a system and is chosen so that emphasis is given to the important system speciﬁcations • A system is considered an optimal control system when the system parameters are adjusted so that the index reaches an extremum, commonly a minimum value
- 55. Classical and Modern Control Qazi Ejaz Ur Rehman Avionics Engineer Introduction Administration Basic Math Laplace Overview Modeling Electrical Mechanical Frequency (continous) Analysis Time (Continous) Analysis Software Optional Labs Matlab Commands Quiz 55/95 Frequency (continous): analysis Performance Indeces cont. ISE = T 0 e2 (t)dt integral of square of error ITSE = T 0 te2 (t)dt integral of time multiplied by square of error IAE = T 0 |e(t)|dt absolute magniture of error ITAE = T 0 t|e(t)|dt integral of time multiplied by absolute of errorr • The upper limit T is a ﬁnite time chosen somewhat arbitrarily so that the integral approaches a steady-state value • It is usually convenient to choose T as the settling time Ts
- 56. Classical and Modern Control Qazi Ejaz Ur Rehman Avionics Engineer Introduction Administration Basic Math Laplace Overview Modeling Electrical Mechanical Frequency (continous) Analysis Time (Continous) Analysis Software Optional Labs Matlab Commands Quiz 56/95 Frequency (continous): analysis Performance Indeces cont. Optimum coeﬃcients of T(s) based on the ITAE criterion for a step input s − ωn s2 + 1.4ωns + ω2 n s3 + 1.75ωns2 + 2.15ω2 ns + ω3 n s4 + 2.1ωns3 + 3.4ω2 ns2 + 2.7ω3 ns + ω4 n s5 + 2.8ωns4 + 5.0ω2 ns3 + 5.5ω3 ns2 + 3.4ω4 ns + ω5 n s6 +3.25ωns5 +6.60ω2 ns4 +8.60ω3 ns3 +7.45ω4 ns2 +3.95ω5 ns+ω6 n
- 57. Classical and Modern Control Qazi Ejaz Ur Rehman Avionics Engineer Introduction Administration Basic Math Laplace Overview Modeling Electrical Mechanical Frequency (continous) Analysis Time (Continous) Analysis Software Optional Labs Matlab Commands Quiz 57/95 Frequency (continous): analysis Performance Indeces cont. Optimum coeﬃcients of T(s) based on the ITAE criterion for a ramp input s2 + 3.2ωns + ω2 n s3 + 1.75ωns2 + 3.25ω2 ns + ω3 n s4 + 2.41ωns3 + 4.93ω2 ns2 + 5.14ω3 ns + ω4 n s5 + 2.19ωns4 + 6.50ω2 ns3 + 6.30ω3 ns2 + 5.24ω4 ns + ω5 n
- 58. Classical and Modern Control Qazi Ejaz Ur Rehman Avionics Engineer Introduction Administration Basic Math Laplace Overview Modeling Electrical Mechanical Frequency (continous) Analysis Time (Continous) Analysis Software Optional Labs Matlab Commands Quiz 58/95 Frequency (continous): analysis Block diagram Open loop transfer function T1(s) = Y1(s) R(s) = Gc(s) Gp(s) H(s) Closed loop transfer function T1(s) = Y (s) R(s) = Gc(s) Gp(s) H(s)
- 59. Classical and Modern Control Qazi Ejaz Ur Rehman Avionics Engineer Introduction Administration Basic Math Laplace Overview Modeling Electrical Mechanical Frequency (continous) Analysis Time (Continous) Analysis Software Optional Labs Matlab Commands Quiz 59/95 Time (Continous) Introduction Write your models in the form below: ˙x(t) = Ax(t) + Bu(t) y(t) = Cx(t) + Du(t) Here, A is called the system matrix B is called the Input matrix C is called the output matrix D is is called the Disturbance matrix A & B are also called as Jacobin matrix
- 60. Classical and Modern Control Qazi Ejaz Ur Rehman Avionics Engineer Introduction Administration Basic Math Laplace Overview Modeling Electrical Mechanical Frequency (continous) Analysis Time (Continous) Analysis Software Optional Labs Matlab Commands Quiz 60/95 Time (Continous) Overview In the next few slides, let’s look at some aspects of analysis in TIME (continuous). During this analysis, the relationship between classical control vs modern control will also become clear: w classical control vs modern control v transfer function vs state space (matrix) v poles vs eigen values v asymptotic stability vs BIBO stability w Other aspects, only possible in modern control include: v controllability v observability v senstivity
- 61. Classical and Modern Control Qazi Ejaz Ur Rehman Avionics Engineer Introduction Administration Basic Math Laplace Overview Modeling Electrical Mechanical Frequency (continous) Analysis Time (Continous) Analysis Software Optional Labs Matlab Commands Quiz 61/95 Time (Continous) Overview 1. transfer function vs state space ˙x(t) = Ax(t) + Bu(t) y(t) = Cx(t) + Du(t) sX = AX + BU Take Laplace Transform sX − AX = BU (sI − A)X = BU ⇒ X = (sI − A)−1 BU ⇒ Y = C(sI − A)−1 BU + DU G(s) = Y U = C(sI − A)−1 BU + D = C adjoint(sI − A) det(sI − A) B + D
- 62. Classical and Modern Control Qazi Ejaz Ur Rehman Avionics Engineer Introduction Administration Basic Math Laplace Overview Modeling Electrical Mechanical Frequency (continous) Analysis Time (Continous) Analysis Software Optional Labs Matlab Commands Quiz 62/95 Time (Continous) Overview 2. poles vs eigen values Normally, D = 0, and therefore, G(s) = C adjoint(sI − A) det(sI − A) B • The poles of G(s) come from setting its denominator, equal to 0, i.e., let det(sI-A) = 0 and solve for roots • But this is also the method for ﬁnding the eigenvalues of A! • Therefore, (in the absence of pole-zero cancellations), transfer function poles are identical to the system eigenvalues
- 63. Classical and Modern Control Qazi Ejaz Ur Rehman Avionics Engineer Introduction Administration Basic Math Laplace Overview Modeling Electrical Mechanical Frequency (continous) Analysis Time (Continous) Analysis Software Optional Labs Matlab Commands Quiz 63/95 Time (Continous) Overview 3. asymptotic stability vs BIBO stability • In classical control, we say that a system is stable if all poles are in LHP (left-half plane of Laplace domain) • This is called Asymptotic stability • In modern control, a system is stable if the system output y(t) is bounded for all bounded inputs u(t) • This is called BIBO stability • Considering the relationship between poles and eigenvalues, then eigenvalues of A must be negative
- 64. Classical and Modern Control Qazi Ejaz Ur Rehman Avionics Engineer Introduction Administration Basic Math Laplace Overview Modeling Electrical Mechanical Frequency (continous) Analysis Time (Continous) Analysis Software Optional Labs Matlab Commands Quiz 64/95 Time (Continous) Overview 4. controllability The property of a system when it is possible to take the state from any initial state x(t0) to any ﬁnal state x(tf ) in a ﬁnite time, tf − t0 by means of the input vector u(t), t0 ≤ t ≤ tf A system is completely controllable if the system state x(tf ) at time tf can be forced to take on any desired value by applying a control input u(t) over a period of time from t0 to tf
- 65. Classical and Modern Control Qazi Ejaz Ur Rehman Avionics Engineer Introduction Administration Basic Math Laplace Overview Modeling Electrical Mechanical Frequency (continous) Analysis Time (Continous) Analysis Software Optional Labs Matlab Commands Quiz 65/95 Time (Continous) Overview 4. controllabilitycont..
- 66. Classical and Modern Control Qazi Ejaz Ur Rehman Avionics Engineer Introduction Administration Basic Math Laplace Overview Modeling Electrical Mechanical Frequency (continous) Analysis Time (Continous) Analysis Software Optional Labs Matlab Commands Quiz 66/95 Time (Continous) Overview 4. controllability cont..
- 67. Classical and Modern Control Qazi Ejaz Ur Rehman Avionics Engineer Introduction Administration Basic Math Laplace Overview Modeling Electrical Mechanical Frequency (continous) Analysis Time (Continous) Analysis Software Optional Labs Matlab Commands Quiz 67/95 Time (Continous) Overview 4. controllability cont.. • The Solution to u(t), ˙u(t), ..., un−2(t), un−1(t) can only be found if Pc is invertible • Another way to say this is that Pc is full rank • x(n)(t) is the state that results from n transitions of the state with input present • Anx(t) is the state that results from n transitions of the state with no input present • PC is therefore called the controllability matrix
- 68. Classical and Modern Control Qazi Ejaz Ur Rehman Avionics Engineer Introduction Administration Basic Math Laplace Overview Modeling Electrical Mechanical Frequency (continous) Analysis Time (Continous) Analysis Software Optional Labs Matlab Commands Quiz 68/95 Time (Continous) Overview 4. controllability cont.. Simple example with 2 states, i.e., n = 2, A = −2 1 −1 −3 , B = 1 0 PC = [B AB] = 1 −2 0 −3 |PC | = −1 = 0 ⇒ controllable In Matlab, 1 A=input ( ’A= ’ ) ; 2 B=input ( ’B= ’ ) ; 3 P=c t r b (A,B) ; %rank (P) 4 unco=leng th (A)−rank (P) ; 5 i f unco == 0 6 d i s p ( ’ System i s c o n t r o l l a b l e ’ ) 7 e l s e 8 d i s p ( ’ System i s u n c o n t r o l l a b l e ’ ) 9 end
- 69. Classical and Modern Control Qazi Ejaz Ur Rehman Avionics Engineer Introduction Administration Basic Math Laplace Overview Modeling Electrical Mechanical Frequency (continous) Analysis Time (Continous) Analysis Software Optional Labs Matlab Commands Quiz 69/95 Intro. to Matlab 1 The name MATLAB stands for MATrix LABoratory. 2 MATLAB was written originally to provide easy access to matrix software developed by the LINPACK (linear system package) and EISPACK (Eigen system package) projects. 3 MATLAB has a number of competitors. Commercial competitors include Mathematica, TK Solver, Maple, and IDL. 4 There are also free open source alternatives to MATLAB, in particular GNU Octave, Scilab, FreeMat, Julia, and Sage which are intended to be mostly compatible with the MATLAB language. 5 MATLAB was ﬁrst adopted by researchers and practitioners in control engineering.
- 70. Classical and Modern Control Qazi Ejaz Ur Rehman Avionics Engineer Introduction Administration Basic Math Laplace Overview Modeling Electrical Mechanical Frequency (continous) Analysis Time (Continous) Analysis Software Optional Labs Matlab Commands Quiz 69/95 Intro. to Matlab 1 The name MATLAB stands for MATrix LABoratory. 2 MATLAB was written originally to provide easy access to matrix software developed by the LINPACK (linear system package) and EISPACK (Eigen system package) projects. 3 MATLAB has a number of competitors. Commercial competitors include Mathematica, TK Solver, Maple, and IDL. 4 There are also free open source alternatives to MATLAB, in particular GNU Octave, Scilab, FreeMat, Julia, and Sage which are intended to be mostly compatible with the MATLAB language. 5 MATLAB was ﬁrst adopted by researchers and practitioners in control engineering.
- 71. Classical and Modern Control Qazi Ejaz Ur Rehman Avionics Engineer Introduction Administration Basic Math Laplace Overview Modeling Electrical Mechanical Frequency (continous) Analysis Time (Continous) Analysis Software Optional Labs Matlab Commands Quiz 69/95 Intro. to Matlab 1 The name MATLAB stands for MATrix LABoratory. 2 MATLAB was written originally to provide easy access to matrix software developed by the LINPACK (linear system package) and EISPACK (Eigen system package) projects. 3 MATLAB has a number of competitors. Commercial competitors include Mathematica, TK Solver, Maple, and IDL. 4 There are also free open source alternatives to MATLAB, in particular GNU Octave, Scilab, FreeMat, Julia, and Sage which are intended to be mostly compatible with the MATLAB language. 5 MATLAB was ﬁrst adopted by researchers and practitioners in control engineering.
- 72. Classical and Modern Control Qazi Ejaz Ur Rehman Avionics Engineer Introduction Administration Basic Math Laplace Overview Modeling Electrical Mechanical Frequency (continous) Analysis Time (Continous) Analysis Software Optional Labs Matlab Commands Quiz 69/95 Intro. to Matlab 1 The name MATLAB stands for MATrix LABoratory. 2 MATLAB was written originally to provide easy access to matrix software developed by the LINPACK (linear system package) and EISPACK (Eigen system package) projects. 3 MATLAB has a number of competitors. Commercial competitors include Mathematica, TK Solver, Maple, and IDL. 4 There are also free open source alternatives to MATLAB, in particular GNU Octave, Scilab, FreeMat, Julia, and Sage which are intended to be mostly compatible with the MATLAB language. 5 MATLAB was ﬁrst adopted by researchers and practitioners in control engineering.
- 73. Classical and Modern Control Qazi Ejaz Ur Rehman Avionics Engineer Introduction Administration Basic Math Laplace Overview Modeling Electrical Mechanical Frequency (continous) Analysis Time (Continous) Analysis Software Optional Labs Matlab Commands Quiz 69/95 Intro. to Matlab 1 The name MATLAB stands for MATrix LABoratory. 2 MATLAB was written originally to provide easy access to matrix software developed by the LINPACK (linear system package) and EISPACK (Eigen system package) projects. 3 MATLAB has a number of competitors. Commercial competitors include Mathematica, TK Solver, Maple, and IDL. 4 There are also free open source alternatives to MATLAB, in particular GNU Octave, Scilab, FreeMat, Julia, and Sage which are intended to be mostly compatible with the MATLAB language. 5 MATLAB was ﬁrst adopted by researchers and practitioners in control engineering.
- 74. Classical and Modern Control Qazi Ejaz Ur Rehman Avionics Engineer Introduction Administration Basic Math Laplace Overview Modeling Electrical Mechanical Frequency (continous) Analysis Time (Continous) Analysis Software Optional Labs Matlab Commands Quiz 70/95 Intro. to Simulink An essential part of Matlab 1 The name Simulink stands for Simulations and links 2 Old name was Simulab 3 Simulink is widely used in automatic control and digital signal processing for multidomain simulation and Model-Based Design.
- 75. Classical and Modern Control Qazi Ejaz Ur Rehman Avionics Engineer Introduction Administration Basic Math Laplace Overview Modeling Electrical Mechanical Frequency (continous) Analysis Time (Continous) Analysis Software Optional Labs Matlab Commands Quiz 71/95 Intro. to Matlab Toolboxes to be used in this course are 1 Simulink 2 Mupad (Symbolic math toolbox) 3 Control System toolbox • Sisotool / rltool • PID tunner • LtiView 4 System Identiﬁcation toolbox 5 Aerospace toolbox 6 Simulink Control Design 7 Simulink Design Optimization 8 Simulink 3D animation 9 GUI development 10 Report Generation
- 76. Classical and Modern Control Qazi Ejaz Ur Rehman Avionics Engineer Introduction Administration Basic Math Laplace Overview Modeling Electrical Mechanical Frequency (continous) Analysis Time (Continous) Analysis Software Optional Labs Matlab Commands Quiz 72/95 Plotting step response manually Instead of using the step command to plot step response, the following manual method can be used for better understanding: 1 %time 2 t s t a r t = 0 ; 3 t s t e p = 0.01 ; 4 t s t o p = 3 ; 5 t = t s t a r t : t s t e p : t s t o p ; 6 %step response 7 CF . SR_b = CF . TF_b ; 8 CF . SR_a = [ CF . TF_a 0 ] ; %n o t i c e that we ’ ve added a zero as the l a s t term to c a t e r f o r m u l t i p l i c a t i o n with 1/ s 9 CF . SR_eqn = t f (CF . SR_b , CF . SR_a) ; 10 [ CF . SR_r , . . . 11 CF . SR_p , . . . 12 CF . SR_k ] = r e s i d u e (CF . SR_b , CF . SR_a) ; 13 %amplitude of step response 14 CF . SR_y =CF . SR_r (1)∗exp (CF . SR_p(1)∗t )+ . . . 15 CF . SR_r (2)∗exp (CF . SR_p(2)∗t ) + . . . 16 CF . SR_r (3)∗exp (CF . SR_p(3)∗t ) ; 17 18 p l o t ( t , CF . SR_y) ; 19 g r i d on 20 x l a b e l ( ’ Time ( sec ) ’ ) 21 y l a b e l ( ’ Wheel a n g u l a r v e l o c i t y rad / sec ) ’ ) ; 22 t i t l e ( ’DC motor step response ’ ) ; Back to the slide 58
- 77. Classical and Modern Control Qazi Ejaz Ur Rehman Avionics Engineer Introduction Administration Basic Math Laplace Overview Modeling Electrical Mechanical Frequency (continous) Analysis Time (Continous) Analysis Software Optional Labs Matlab Commands Quiz 73/95 Lab1 Learn to Record and Share Your Results Electronically • Learn how to make a website and put your results on it • Website ﬁles must not be path dependent, i.e, if I copy them to any location such as a USB, or diﬀerent directory, the website must still work • The main ﬁle of the website must be index.html • Many tools are available, but a good cross-platform open source software is kompozer available from http://www.kompozer.net/
- 78. Classical and Modern Control Qazi Ejaz Ur Rehman Avionics Engineer Introduction Administration Basic Math Laplace Overview Modeling Electrical Mechanical Frequency (continous) Analysis Time (Continous) Analysis Software Optional Labs Matlab Commands Quiz 74/95 Lab1 Learn to Extend Existing Work in a Controls Topic Make groups, pick a research topic, create a website with following headings: 1 Introduction 2 Technical Background 3 Expected Experiments 4 Expected Results 5 Expected Conclusions Present your website. Every group member will be quizzed randomly. Your ﬁnal work will count towards your lab exam.
- 79. Classical and Modern Control Qazi Ejaz Ur Rehman Avionics Engineer Introduction Administration Basic Math Laplace Overview Modeling Electrical Mechanical Frequency (continous) Analysis Time (Continous) Analysis Software Optional Labs Matlab Commands Quiz 75/95 Lab1 Gain Eﬀect on Systems
- 80. Classical and Modern Control Qazi Ejaz Ur Rehman Avionics Engineer Introduction Administration Basic Math Laplace Overview Modeling Electrical Mechanical Frequency (continous) Analysis Time (Continous) Analysis Software Optional Labs Matlab Commands Quiz 76/95 Lab1 Second order Systems Vs Third order systems
- 81. Classical and Modern Control Qazi Ejaz Ur Rehman Avionics Engineer Introduction Administration Basic Math Laplace Overview Modeling Electrical Mechanical Frequency (continous) Analysis Time (Continous) Analysis Software Optional Labs Matlab Commands Quiz 77/95 Lab2 Mathematical Modeling of Motor • The model we will use will be for a DC motor as given in this slides on Back to Motor Modelling Slide • Use the following default values for the 6 constants needed to model the DC motor: Km 0.01 Nm/Amp Kb 0.01 V/rad/s L 0.5 H R 1 ω J 0.01 kg m2 b 0.1 N m s • Enter in Matlab
- 82. Classical and Modern Control Qazi Ejaz Ur Rehman Avionics Engineer Introduction Administration Basic Math Laplace Overview Modeling Electrical Mechanical Frequency (continous) Analysis Time (Continous) Analysis Software Optional Labs Matlab Commands Quiz 78/95 Lab2 Mathematical Modeling of Motor 1 %( a ) t r a n s f e r f u n c t i o n 2 CF . TF_b = Km; %numerator 3 CF . TF_a = [ L∗J L∗b+R∗J R∗b+Kb∗Km] ; % denominator 4 CF . TF_eqn = t f (CF . TF_b, CF . TF_a) ; % equation 5 %(b) f i n d impulse response 6 impulse (CF . TF_eqn) ; 7 %( c ) f i n d step response 8 step (CF . TF_eqn) ; Optionally, see this slide on plotting step response manually
- 83. Classical and Modern Control Qazi Ejaz Ur Rehman Avionics Engineer Introduction Administration Basic Math Laplace Overview Modeling Electrical Mechanical Frequency (continous) Analysis Time (Continous) Analysis Software Optional Labs Matlab Commands Quiz 79/95 Lab 2 Parameters identiﬁcation 1 u=input ( ’u=’ ) ; % how many times you want to run loop 2 f o r g=1:u 3 kd=input ( ’ kd=’ ) ; 4 kp=input ( ’ kp=’ ) ; 5 k i=input ( ’ k i=’ ) ; 6 s=t f ( ’ s ’ ) ; 7 b=[kd∗ s^2+kp∗ s+k i ] / [ s ] ; %[ kd∗ s^2+kp∗ s+k i ] / [ s ] ; 8 G=b/( s^2+10∗s+20+b) 9 %f i g u r e ( g ) 10 step (G) , g r i d on 11 [ wn , z]=damp(G) ; 12 l=s t e p i n f o (G) ; 13 end
- 84. Classical and Modern Control Qazi Ejaz Ur Rehman Avionics Engineer Introduction Administration Basic Math Laplace Overview Modeling Electrical Mechanical Frequency (continous) Analysis Time (Continous) Analysis Software Optional Labs Matlab Commands Quiz 80/95 Lab Disturbance Rejection Phenomenon 1 c l e a r a l l 2 c l c 3 %% without d i s t u r b a n c e 4 f o r ka =50:50:300 5 q=ka ∗500; 6 f r=t f ( [ q ] , [ 1 1020 20000 0 ] ) ; 7 h=t f ( [ 1 ] ) ; 8 a=feedback ( fr , h ) ; 9 %step ( a ) , t i t l e ( ’ without dis tu rb an ce ’ ) ; 10 %% with d i s t u r b a n c e 11 f r 1=t f ( [ 1 ] , [ 1 20 0 ] ) ; 12 h1=t f ( [ q ] , [ 1 1000]) ; 13 b=feedback ( fr1 , h1 ) ; 14 e=q+1000; 15 g=t f ( [ 1 e ] , [ 1 1020 20000 q ] ) ; 16 f i g u r e ( ka ) 17 step ( g ) 18 l=s t e p i n f o ( g ) 19 pause 20 c l e a r a l l 21 c l c 22 end
- 85. Classical and Modern Control Qazi Ejaz Ur Rehman Avionics Engineer Introduction Administration Basic Math Laplace Overview Modeling Electrical Mechanical Frequency (continous) Analysis Time (Continous) Analysis Software Optional Labs Matlab Commands Quiz 81/95 Lab2 Mathematical Modeling Figure : Train system Figure : Free body diagram In this example, we will consider a toy train consisting of an engine and a car. Assuming that the train only travels in one dimension (along the track), we want to apply control to the train so that it starts and comes to rest smoothly, and so that it can track a constant speed command with minimal error in steady state.
- 86. Classical and Modern Control Qazi Ejaz Ur Rehman Avionics Engineer Introduction Administration Basic Math Laplace Overview Modeling Electrical Mechanical Frequency (continous) Analysis Time (Continous) Analysis Software Optional Labs Matlab Commands Quiz 82/95 Lab2 Mathematical Modeling ΣF1 = F − k(x1 − x2) − µM1g ˙x1 = M1¨x1 (1) ΣF2 = k(x1 − x2) − µM2g ˙x2 = M2¨x2 (2)
- 87. Classical and Modern Control Qazi Ejaz Ur Rehman Avionics Engineer Introduction Administration Basic Math Laplace Overview Modeling Electrical Mechanical Frequency (continous) Analysis Time (Continous) Analysis Software Optional Labs Matlab Commands Quiz 83/95 Lab2 Mathematical Modeling in Simulink Parameters are: M1=1 kg; M2=0.5kg; k=1; F=1; µ=0.02; g=9.8;
- 88. Classical and Modern Control Qazi Ejaz Ur Rehman Avionics Engineer Introduction Administration Basic Math Laplace Overview Modeling Electrical Mechanical Frequency (continous) Analysis Time (Continous) Analysis Software Optional Labs Matlab Commands Quiz 84/95 Lab2 Mathematical Modeling Figure : Boeing Assume that the aircraft is in steady-cruise at constant altitude and velocity; thus, the thrust and drag cancel out and the lift and weight balance out each other. Also, assume that change in pitch angle does not change the speed of an aircraft under any circumstance (unrealistic but simpliﬁes the problem a bit). Under these assumptions, the longitudinal equations of motion of an aircraft can be
- 89. Classical and Modern Control Qazi Ejaz Ur Rehman Avionics Engineer Introduction Administration Basic Math Laplace Overview Modeling Electrical Mechanical Frequency (continous) Analysis Time (Continous) Analysis Software Optional Labs Matlab Commands Quiz 85/95 Lab2 Mathematical Modeling ˙α = µΩσ[−(CL + CD0 )α + (1/µ − CL)q − (Cw Sinγe)θ + CL] ˙q = µΩ/2in [CM − η(CL + CD0 )]α + [CM + σCM (1 − µCL)]q +(ηCW sinγe)δ3) (1) ˙θ = Ωq Where: α=Angle of attack, q=Pitch rate, θ=Pitch angle, δ=Elevator deﬂection angle, µ = ρS¯c 4m , CT =Coeﬃcient of thrust, CD=Coeﬃcient of Drag, CL=Coeﬃcient of lift, CW =coeﬃcient of weight, CM =coeﬃcient of pitch moment , γe = Flight path angle ρ = Density of air S = Planform area of the wing ¯c = Average chord length m= Mass of aircraft Ω = 2U ¯c U =equilibrium ﬂight speed, σ = 1 1+µCL , in=Normalized moment of inertia, η = µσC = constant nu
- 90. Classical and Modern Control Qazi Ejaz Ur Rehman Avionics Engineer Introduction Administration Basic Math Laplace Overview Modeling Electrical Mechanical Frequency (continous) Analysis Time (Continous) Analysis Software Optional Labs Matlab Commands Quiz 86/95 Lab2 Mathematical Modeling Before ﬁnding transfer function and the state-space model, let’s plug in some numerical values to simplify the modeling equations (1) shown in previous slide. ˙α = −0.313α + 56.7q + 0.232δe ˙q = −0.0139α − 0.426q + 0.0203δe (2) ˙θ = 56.7q These values are taken from the data from one of the Boeing’s commercial aircraft. Obtained open-loop transfer function will be θ(s) δe(s) = 1.151s + 0.1774 s3 + 0.739s2 + 0.921s
- 91. Classical and Modern Control Qazi Ejaz Ur Rehman Avionics Engineer Introduction Administration Basic Math Laplace Overview Modeling Electrical Mechanical Frequency (continous) Analysis Time (Continous) Analysis Software Optional Labs Matlab Commands Quiz 87/95 Lab2 Closed loop tf... Closed loop transfer function will be θ(s) δe(s) = Kp(1.151s + 0.1774) s3 + 0.739s2 + (1.151KP + 0.921)s + 0.1774KP commands to be used are conv and cloop i.e. code 1 Kp=[1]; % Enter any numerical value f o r the p r o p o r t i o n a l gain 2 num=[1.151 0 . 1 7 7 4 ] ; 3 num1=conv (Kp , num) ; 4 den1=[1 0.739 0.921 0 ] ; 5 [ numc , denc]= cloop (num1 , den1 ) ; 6 step (numc , denc )
- 92. Classical and Modern Control Qazi Ejaz Ur Rehman Avionics Engineer Introduction Administration Basic Math Laplace Overview Modeling Electrical Mechanical Frequency (continous) Analysis Time (Continous) Analysis Software Optional Labs Matlab Commands Quiz 88/95 Lab2 Proportional Controller Design The design requirements are • Overshoot: Less than 10% • Rise time: Less than 2 seconds • Settling time: Less than 10 seconds • Steady-state error: Less than 2% As it is known ζωn ≥ 4.6 Ts ωn ≥ 1.8 Tr ζ ≥ (lnMp/π)2 1 + (lnMp/π)2 where Mp=Maximum overshoot values found to be are ωn = 0.9 and ζ = 0.52
- 93. Classical and Modern Control Qazi Ejaz Ur Rehman Avionics Engineer Introduction Administration Basic Math Laplace Overview Modeling Electrical Mechanical Frequency (continous) Analysis Time (Continous) Analysis Software Optional Labs Matlab Commands Quiz 89/95 Lab2 Root locus code 1 num=[1.151 0 . 1 7 7 4 ] ; 2 den=[1 0.739 0.921 0 ] ; 3 Wn=0.9; 4 zeta =0.52; 5 r l o c u s (num , den ) 6 s g r i d ( zeta ,Wn) 7 a x i s ([−1 0 −2.5 2 . 5 ] )
- 94. Classical and Modern Control Qazi Ejaz Ur Rehman Avionics Engineer Introduction Administration Basic Math Laplace Overview Modeling Electrical Mechanical Frequency (continous) Analysis Time (Continous) Analysis Software Optional Labs Matlab Commands Quiz 90/95 Lab2 Lead Compensator in editer Gc(s) = Kc s − z0 s − p0 Z0=zero p0=pole Z0 < P0 code 1 num1=[1.151 0 . 1 7 7 4 ] ; 2 den1 =[1 0.739 0.921 0 ] ; 3 num2=[1 0 . 9 ] ; den2 =[1 2 0 ] ; 4 num=conv (num1 , num2) ; 5 den=conv ( den1 , den2 ) ; 6 Wn=0.9; zeta =0.52; 7 r l o c u s (num , den ) 8 a x i s ([−3 0 −2 2 ] ) 9 s g r i d ( zeta ,Wn) 10 [K, p o l e s ]= r l o c f i n d (num , den ) 11 de =0.2; 12 [ numc , denc]= cloop (K∗num , den ,−1) ; 13 step ( de∗numc , denc )
- 95. Classical and Modern Control Qazi Ejaz Ur Rehman Avionics Engineer Introduction Administration Basic Math Laplace Overview Modeling Electrical Mechanical Frequency (continous) Analysis Time (Continous) Analysis Software Optional Labs Matlab Commands Quiz 91/95 Lab2 Lead Compensator design using sisotool Sisotool for designing PD compensater, lead compensater or lead-lag compensater
- 96. Classical and Modern Control Qazi Ejaz Ur Rehman Avionics Engineer Introduction Administration Basic Math Laplace Overview Modeling Electrical Mechanical Frequency (continous) Analysis Time (Continous) Analysis Software Optional Labs Matlab Commands Quiz 92/95 Matlab Commands Used Commonly For Help in Matlab type doc command_name (etc. doc linspace) • linspace, logspace • inv, max, det • edit, who, ls, dir, cd • plot, subplot, meshgrid • contour, bar, mesh, surf • clear all, delete, clc, close all, clf, cla • xlabel, ylabel, grid, hold on/oﬀ, axis • roots, poly, polyval • tf, ss, tf2ss, ss2tf, zp2tf, • residue, series, parallel, • feedback, step, impulse, lsim • cloop, bode, rlocus, margin, canon • laplace, diﬀ, int, fourier for more commands visit Link
- 97. Classical and Modern Control Qazi Ejaz Ur Rehman Avionics Engineer Introduction Administration Basic Math Laplace Overview Modeling Electrical Mechanical Frequency (continous) Analysis Time (Continous) Analysis Software Optional Labs Matlab Commands Quiz 93/95 Quiz Total time of 10-15 min. ¨x = 1 M cart Fx = 1 M (F − N − b ˙x) (1) ¨θ = 1 I pend τ = 1 I (−Nlcosθ − Plsinθ) (2) N = m(¨x − l ˙θ2 sinθ + l ¨θcosθ) (3) P = m(l ˙θ2 cosθ + l ¨θsinθ) + g (4) where • (M)=mass of the cart=0.5 kg • (m)= mass of the pendulum= 0.2 kg • (b)=coeﬃcient of friction for cart=0.1 N/m/sec • (l)=length to pendulum center of mass=0.3 m • (I)= mass moment of inertia of the pendulum= 0.006 kg.m2 • (F)=force applied to the cart • (x)=cart position coordinate • (theta)=pendulum angle from vertical (down) Alternative Quiz Link
- 98. Classical and Modern Control Qazi Ejaz Ur Rehman Avionics Engineer Introduction Administration Basic Math Laplace Overview Modeling Electrical Mechanical Frequency (continous) Analysis Time (Continous) Analysis Software Optional Labs Matlab Commands Quiz 94/95 Quiz Solution
- 99. Classical and Modern Control Qazi Ejaz Ur Rehman Avionics Engineer Introduction Administration Basic Math Laplace Overview Modeling Electrical Mechanical Frequency (continous) Analysis Time (Continous) Analysis Software Optional Labs Matlab Commands Quiz 95/95 Thank you Email

No public clipboards found for this slide

Be the first to comment