1 / 27

ERT 210 DYNAMICS AND PROCESS CONTROL CHAPTER 11 – MATLAB TUTORIAL

ERT 210 DYNAMICS AND PROCESS CONTROL CHAPTER 11 – MATLAB TUTORIAL. Prepared by: Puan Hairul Nazirah Abdul Halim. 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.

lilli
Download Presentation

ERT 210 DYNAMICS AND PROCESS CONTROL CHAPTER 11 – MATLAB TUTORIAL

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. ERT 210DYNAMICS AND PROCESS CONTROLCHAPTER 11 – MATLAB TUTORIAL Prepared by: Puan 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. Refer to Appendix C – Use of MATLAB in Process Control

  16. COMPUTER SIMULATION WITH SIMULINK

  17. Consider a dynamic system consisting of a single output Y and two inputs U and D: Y(s) =Gp(s) U(s) + Gd(s) D(s) Where: Then, draw a Simulink block diagram (Figure C.1).

  18. Figure C.1 Simulink block diagram

  19. Figure C.2 Response for simultaneous unit step change at t = 0 in U and D from the simulink diagram in Fig. C1

  20. Figure C.4 Closed loop diagram

  21. Closed-loop response with Setpoint Changes • Click block D • Set the Final Value to 0 (zero) • Click Ysp • Set te Final Value to 1 (one) • Set the Stop time = 50 (In the simulation parameter menu) • Click Start from the Simulation menu • Type plot(t,y) to view the response.

  22. Figure C.5 Unit set-point response for the closed-loop system in Fig. C4 with P = 1.65, I = 0.23, D = 2.97

  23. Figure C.5 Unit set-point response for the closed-loop system in Fig.C4 with P = 1.65, I = 0.23, D = 2.97

  24. Closed-loop response with Disturbance Changes • Click block Ysp • Set the Final Value to 0 (zero) • Click D • Set the Final Value to 1 (one) • Set the Stop time = 50 (In the simulation parameter menu) • Click Start from the Simulation menu • Type plot(t,y) to view the response.

  25. Figure C.6 Closed loop response for a unit step disturbance (Stop time = 50)

  26. Figure C.6 Closed loop response for a unit step disturbance (Stop time = 150)

  27. Tuning by Ziegler-Nicholas Method What is Kcu and Pu? Calculate Kc, τI and τD for PID setting.

More Related