Download presentation
Presentation is loading. Please wait.
Published byKrystian Czarnecki Modified over 5 years ago
1
ERT 210 DYNAMICS AND PROCESS CONTROL CHAPTER 11 – MATLAB TUTORIAL
Prepared by: Miss Hairul Nazirah Abdul Halim
2
Transfer function To model a transfer function in MATLAB, define the numerator and denominator polynomials as 1-row matrices first. Then use the ‘ tf ’ command in Matlab.
3
Example 1 Transfer function is given by:
Model the transfer function in MATLAB. Solution Using MATLAB, define the denominator and numerator as matrices: >> num = 1; >> den = [1 2 3]; >> G = tf(num,den) OR >> G = tf(1, [1 2 3])
4
Example 2 Model the following transfer function in MATLAB. Solution
Using MATLAB, define the denominator and numerator as matrices: >> num = 1; >> den = [1e-9 1e-6 1]; >> G = tf(num,den) OR >> G = tf(1, [1e-9 1e-6 1])
5
Exercise 1 1) 2)
6
Model interconnections
Multiple models can be manipulated using normal mathematical functions (addition and multiplication) For models in series, multiply them For models in parallel, add them
7
Model interconnections
8
Model interconnections
9
Model interconnections
Example 3 Given that Find the total transfer function if both of them are: a) Connected in series (multiply) b) Connected in parallel (add)
10
Model interconnections
Solution >> G1 = tf([1 4], [1 3 2]) >> G2 = tf(1, [1 5]) >> G_series = G1*G2 >> G_parallel = G1+G2
11
Model interconnections
Example 4 For feedback loop above, overall transfer function is
12
>> gl = tf ([1 4] , [1 3 2]) >> g2 = tf (1, [1 5]); >> g_closed = feedback(gl,g2)
13
Example 5 In the diagram above, it is given that
Find the overall transfer function using MATLAB
14
Solution >> g1=tf(1, [1 2]); >> g2=tf([1 3] , [1 4 5]); >> g3=tf(4, [1 0]); >> g4=tf(10, [1 10]); >> g12=g1+g2; >> g123=g12*g3; >> g_overall=feedback(g123,g4);
15
Analyzing Dynamic System
Poles and Zeros Characteristic equation System stability System Performance
16
Effects of Poles and Zeros
Poles and zeros determine the performance of a system, especially poles For a transfer function, zeros are the roots of the numerator and poles are the roots of the denominator To find zeros, make the numerator equal to zero, and solve for s. To find poles, make the denominator equal to zero and solve for s.
17
Poles and zeros To find zeros, equate numerator to zero
To find poles, equate denominator to zero
18
Poles and zeros Example 6
Poles and zeros can be automatically found in MATLAB using the ‘pole’ and ‘zero’ command >> g=tf ([1 1] , [ ]) >> z=zero(g) >> p=pole(g)
19
Poles and zeros Exercise 3 Find the poles and zeros of the following
transfer function using MATLAB
20
Poles and zeros Complicated polynomials
Multiplying and solving complicated polynomials can be very difficult The operation above can be done using The ‘conv’ command >> conv([1 3 1], [ ])
21
Complicated polynomials
The solution of the equation above can be calculated using the ‘roots’ command >> roots([ ])
22
Characteristic equation
‘denominator = 0’ has a special name: THE CHARACTERISTIC EQUATION It determines the main characteristics of the system
23
Characteristic equation
The characteristic equation of the system above is The poles of the system are the solutions of the characteristic equation.
24
System Stability If all the poles are negative then the output will go towards D when t goes towards infinity. If any of the poles are positive then the output will go towards infinity when t goes towards infinity (unstable). Therefore, for a stable response, the poles must all lie in the negative left half plane.
25
System Stability Stability of system by pole location
26
System Stability Effect of poles and zeros
Poles of a system can be classified into 2 categories: • Real s = -1, -1.5, -5 • Complex conjugate (always appear in pairs with imaginary part) s = -1 ± j3, -2 ± j(2)-1/2
27
System Stability Real and complex poles
28
Effect of real poles
29
Effect of real poles • Will get an ‘aperiodic’ (no oscillation) response • No overshoot • Will converge exponentially towards a final value • If the pole has a bigger ‘magnitude’, the convergence will be faster
30
Effect of complex poles
• Will have overshoot • Converges with oscillation (decaying sine wave) towards a final value for stable systems
31
Effect of complex poles
32
Zeros Zeros have not been studied in great details in Control. Rule of thumb - if a zero is near a pole, it will ‘cancel’ out the effect of the pole, depending on how near it is. The nearer it is, the less is the effect of the pole.
33
Poles and zeros Exercise 4
Check the stability of the following systems and verify it with the ‘step’ response
34
Example 7 Perform the step response of the following system:
35
>> g1 = tf(1, [1 1]) >> step(g1)
36
>> g2 = tf(4, [1 4 8]) >> step(g2)
37
Root Locus Used to graphically show the movement of the closed loop poles when the system gain is changed from 0 to infinity
38
Root Locus For the system above: The closed loop transfer function is
39
Root Locus To find the poles of the closed loop system
The closed loop characteristic equation depends on K. So the closed loop poles will also depend on K. The root locus technique shows the locus of the closed-loop poles as K is changed.
40
Root Locus Example 8 Draw the root locus of the following system:
41
Solution >> num=10; >> den1=[1 0]; >> den2=[1 3]; >> den3=[1 5]; >> denl2=conv(den1,den2); >> den=conv(denl2,den3); >> g=tf(num,den); >>r1ocus(g)
42
Root Locus
43
Root Locus Interpretation of the root locus plot
• When the gain K = 0, the closed loop poles are the open loop poles at s = 0, -3, -5. • As the gain K is increased, the poles at 0 and -3 move towards each other, while the pole at -5 moves further into the LHP. • When K = 0.821, the poles from 0 and -3 meet at -1.21, and move upwards. • When K = 12, the upward moving poles reach the imaginary axis at If the gain K is increased any further, the closed loop system goes unstable. • To get those points, click on the root locus plot and drag along. The information is given.
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.