SIMULINK for Proce Control Simulink for Control MATLAB, which tand for MATrix LABoratory, i a technical computing environment for high-performance numeric computation and viualization. SIMULINK i a part of MATLAB that can be ued to imulate dynamic ytem. To facilitate model definition, SIMULINK add a new cla of window called block diagram window. In thee window, model are created and edited primarily by moue-driven command. Part of matering SIMULINK i to become familiar with manipulating model component within thee window.. Start Matlab and then the Simulink environment by typing imulink to the matlab prompter.. Open a new Simulink model window from File New Model Page of 9
3. You can contruct your block diagram by drag-and-dropping the appropriate block from the main Simulink widow. Some of the mot commonly ued block: From the Continuou block (double click on the Continuou button) you can ue the typical block to contruct dynamic ytem (e.g. tranfer function, time delay, etc.). Time derivative of ignal Integration of input ignal Tranfer function Time delay From the Sink we often ue the Scope block to plot the reult. Plot ignal Sink block collection Page of 9
From the Source the Step function i ued to imulate tep change in the input: Simulink for Control Select Source Step block From the Signal Routing block the Mux block i often ued to concatenate ignal into a bu e.g. for plotting multiple ignal in Scope. Select Signal Routing Mux block The Math Operation et of block provide the uual mathematical operation: Addition Multiplication with a calar (gain) Page 3 of 9
EXERCISE. Typical tep repone of Firt order Sytem E Step. Start the Simulink environment by typing imulink to the matlab prompter. E Step. Open a new imulink mode from the File New Model E Step 3. Drag and drop the block below from the Simulink window into the model window (elect tranfer function from the Continuou group; Step from Source ; Scope from Sink, Mux from Signal Routing, etc.) E Step 4. Double click the block the et up different firt order tranfer function. Oberve the effect of gain and time contant on the dynamic repone of the ytem. (A) (B) (C) E Step 5. Identify which repone belong to which tranfer function: Tranfer function ha repone ; Tranfer function ha repone ; Tranfer function 3 ha repone ; E Step 6. INDIVIDUAL EXERCISE Simulate variou firt, econd and higher order tranfer function: (a) ; (b) ; (c) ; (d); 3 3 0. (e); ; (g) ; (e) 3 3 Page 4 of 9
EXERCISE. Typical open-loop dynamic repone of econd order ytem Simulink for Control E Step. Start the Simulink environment by typing imulink to the matlab prompter. E Step. Open a new imulink mode from the File New Model E Step 3. Drag and drop the block below from the Simulink window into the model window E Step 4. Double click the block the et up different econd order tranfer function. Define one overdamped, one critically damped and one under damped ytem. Page 5 of 9
E Step 5. Connect the block together a hown below: E Step 6. Set the imulation time to 30 ec from the menu Simulation Configuration parameter E Step 7. Simulate the proce by preing the Run button and then how the reult by double clicking on the Scope block: Run imulation Autocale figure E Step 8. INDIVIDUAL EXERCISE Change the form of the tranfer function to imulate (i) an untable behaviour and (ii) a ytem at the limit of intability (with utained ocillation). Page 6 of 9
EXERCISE 3. Simulate time repone of higher order tranfer function baed on lower order tranfer function mode If the pole and zero of a TF are given a complex tranfer function can be imulated a the combination of the lower order tranfer function, which can be obtained from the pole and zero. For example the tranfer function below, ha the pole - and - and a zero of 3. By contructing the block diagram below, how that the erie of TF baed on the baic mode given by the zero and pole have an identical repone with the original TF. G () 3 EXERCISE 4. Repone of Firt and Second order ytem to inuoidal By contructing and imulating the block diagram below how that the time repone of a linear (firt order ytem) to a inuoidal input i a inuoidal ignal with the ame frequency and maller amplitude. Verify that the amplitude of the output ignal decreae when the frequency of the input ignal increae or the time contant of the ytem increae. INDIVIDUAL EXERCISE Analyze the time repone of the econd order ytem given below to an inuoidal input ignal. Show that if the frequency of the input ignal equal the natural frequency of the ytem the ytem become untable, wherea for frequencie maller or larger than the natural frequency the ytem i table. Show that at frequencie cloe to the natural frequency the ytem i table but exhibit ocillation with amplified amplitude. G () Page 7 of 9
EXERCISE 5. PID controller tuning uing practical Ziegler-Nichol technique. Conider the following third order proce (cacade of three reactor from the lecture Topic 3) G () p 6 ( )(4 )(6 ) Tune a PID controller uing a practical method and the Ziegler-Nichol tuning rule. The method i often ued in indutry becaue it doe not require knowing the proce tranfer function. E5 Step. Download the Simulink block diagram model_3rdorder_pid.mdl from the LearnServer and ave it in the current Matlab folder. E5 Step. Set the controller to a P-only controller (by etting tau_i very large, e.g. tau_i = 00000; and tau_d = 0). E5 Step3. Start to give value to Kc until the cloed loop ytem i at the verge of intability (utained ocillation are obtained) Zoom button E5 Step 4. Determine from the figure the ultimate period (T u ). Ue the zoom button in the figure window and obtain the ultimate period (the time interval for one entire ocillation). E5 Step 5. With the ultimate gain and period determined at tep 3 and 5 compute the parameter of a PID controller uing the ZN tuning rule. E5 Step 6. Introduced the PID parameter in the imulink PID controller and perform a imulation to tet the cloed loop performance. Compare the value of the ultimate gain and frequency and the tuning parameter obtained with the practical approach with thoe obtained uing the analytical method (direct ubtitution) in the lecture (Topic 3). Ultimate period Page 8 of 9
EXERCISE 6. PID controller tuning uing the Proce Reaction Curve baed Ziegler Nichol approximate model approach. Conider the ame ytem a in EXERCISE 5. We will apply the approximate model baed ZN technique for the PID controller tuning. According to thi approach (ee lecture on Topic 3) firt an approximate FOPTD repreentation of the proce i identified baed on the proce reaction curve and then the PID controller parameter are obtained uing the appropriate ZN tuning rule. E6 Step. Download the Simulink program model_3rdorder_foptd.mdl and ave it in the current Matlab folder. E6 Step. Open the model and change the gain, time contant and time-delay of the approximate model to obtain a repone which i a cloe a poible to the original proce repone. After each change imulate the two ytem by preing the run Button. E6 Step 3. Ue the effective time contant, effective gain and effective time delay obtained in Step (which provide the bet approximation of the original third order ytem) and calculate the PID controller parameter uing the ZN tuning rule (lecture Topic 3, lide 5) E6 Step 4. Ue the calculated tuning parameter in the block diagram from Exercie 5 to imulate the cloed loop repone. Compare the tuning parameter obtained in thi cae with thoe reulted in Exercie 5. Compare the cloed loop performance in the two cae. Page 9 of 9