National Institute of Technology Warangal EE306 Control Systems Lab Manual PDF
Document Details
Uploaded by AdaptableKnowledge
National Institute of Technology Warangal
2024
Tags
Summary
This document is a lab manual for EE 306 Control Systems Lab at the National Institute of Technology Warangal. It covers various experiments related to control systems design, modelling, analysis, and simulation, including time response, frequency response, and PID controllers using MATLAB and Simulink.
Full Transcript
NATIONAL INSTITUTE OF TECHNOLOGY WARANGAL (Institute of National Importance, Ministry of Education, Govt. of India) Warangal - 506 004, Telangana State. III B.TECH SEM-I (ELECTRICAL and ELECTRONICS ENGINEERING) AY:20...
NATIONAL INSTITUTE OF TECHNOLOGY WARANGAL (Institute of National Importance, Ministry of Education, Govt. of India) Warangal - 506 004, Telangana State. III B.TECH SEM-I (ELECTRICAL and ELECTRONICS ENGINEERING) AY:2024-2025 EE306 : CONTROL SYSTEMS LABORATORY MANUAL ELECTRICAL ENGINEERING DEPARTMENT NATIONAL INSTITUTE OF TECHNOLOGY, WARANGAL-506004 EE 306 Control Systems Lab List of Experiments Page no 1. Time response of first and second order systems 1-3 2. Frequency response of second order system 4-6 3. P, PI & PID Controllers : Performance assessment 7-10 4. Design and implement the Phase lead compensator 11-15 5. Performance Analysis of DC Servo Motor control 16-26 a) Determination of transfer function of DC Servo Motor b) Stability analysis of the DC Servo Motor for Speed and Position Output functions c) Analysis the second order response of the DC Servo Motor d) Evalution of position control of DC Servo motor using PV controller 6. Modelling and Controller design for Thermal System 27-32 7. Time Domain Analysis of LTI System using MATLAB/SIMULINK 33-37 8. Stability analysis of feedback systems using MATLAB/SIMULINK 38-41 9. Design of P, PI and PID Controller using MATLAB-SISO Tool. Experiment No: 1 Time-Response of First and Second Order Systems Aim: To Study the time response of first order and second order systems under step input. Verification of steady state error of a first order system for different gains and compare the theoretical and practical results. Also, verification of percentage peak overshoot, rise time and settling time of a second order system and compare the theoretical and practical results. Equipments required: 1. PID Controller module 2. D.S.O and probes 3. Patch chord. Theory: For the above-mentioned objectives, step response of first and second order systems is studied. The relevant mathematical expressions are given along with block diagrams. Definitions: 1. Delay Time: It is the time required for the response to reach half of its final value from the zero instant. It is denoted by 𝑡𝑑. 2. Rise Time: It is the time required for the response to rise from 0% to 100% of its final value. This is applicable for the under-damped systems. For the over-damped systems, consider the duration from 10% to 90% of the final value. Rise time is denoted by 𝑡𝑟. 3. Peak Time: It is the time required for the response to reach the peak value for the first time. It is denoted by 𝑡𝑝. 4. Peak overshoot: It is defined as the deviation of the response at peak time from the final value of response. It is also called the maximum overshoot. It is denoted by 𝑀𝑝. 5. Settling Time: It is the time required for the response to reach the steady state and stay within the specified tolerance bands around the final value. In general, the tolerance bands are 2% and 5%. The settling time is denoted by 𝑡𝑠 Firs order system: Fig 1: Closed loop block diagram of the first order system T =0.0155 sec, and K=gain, it is varied 1 Steady state error: R( s ) 1 lim ess (t ) lim S E ( s) lim S t s 0 s 0 1 G( s) H ( s) 1 K Time constant (T) = 63.2% of the Steady State Value Second order system: Fig 2: Closed loop block diagram of the Second order system (Type-0 and Type-1) Formula used: 1 2 tan 1 ; d n 1 2 1 2 RiseTime (tr ) ; %Peakovershoot (M p ) e d 4 PeakTime (t p ) ; SettlingTime (ts ) d n Procedure: 1. The above shown block diagrams for first order and second order system with unity feedback are built on the PID control system Module by connecting the P-control alone with the gain of 1. 2. A square wave with suitable pulse width and frequency is used as an input signal. 3. The magnitude may be taken as VP-P. The time periods are adjusted such that the output comes to the steady state in every pulse width. 2 Precautions: 1. Frequency and time-period of square wave should be properly selected so that response comes to steady state. 2. Settings for values of K and measurements on C.R.O should be properly done for accuracy in the results. Observations: First order system: Table 1: Time domain specification on first order response Sl.No Different Gain Practical Steady State Computed ess = 1/(1+K) (K) Error ess Sample Calculations Table 2: Time domain specifications of Second order system response S. td tr tp ts % overshoot ess K ωn No Theo Prac Theo Prac Theo Prac Theo Prac Theo Prac Theo Prac Sample Calculations Results and Conclusions 3 Experiment No: 2 Frequency-Response of Second Order System Aim: To determine the frequency response of a given second order system and evaluate its frequency domain specifications. Equipment required: 1. Frequency response module 2. Patch Cords 3. D.S.O Formulae used: 1. Gain in dB = 20 log (Vo /Vi ) 2. Phase angle φ = sin −1 (Y1/Y2) deg for the lissajous curve shown in fig (a) Phase angle φ = 180- sin −1 (Y1/Y2) deg for the lissajous curve shown in fig (b) Fig. 1: Lissajous Curve at some frequency Sine Wave DSO Output Second order Input system (Build inFig. 2: Block diagram of Frequency response for second order system source) Procedure: 1. Connections are made as per the block diagram. 2. Switch on the Frequency response module and set the amplitude of sine wave signal input to 1 V (peak to peak). 3. Now observe the output of the system in DSO using both YT plot and lissajous figures. 4 4. Vary the input frequency of the sine wave from low frequency (say, 25 Hz) to high frequency (1 kHz) in steps and tabulate the corresponding output voltage. 5. Compute the gain and phase angles for all the input frequencies using the formulae listed above. 6. Plot the Bode plot i.e. graphs of Magnitude (dB) Vs frequency and phase angle(deg) Vs frequency in a semi-log sheet. 7. Compute the frequency domain specifications such as phase margin, gain margin and bandwidth. Tabular Column: Sample Calculations: Model Frequency response (Bode) plots: 5 Results and Conclusions: 6 Experiment No: 3 P, PI & PID Controllers: Performance assessment Aim: To study the performance of P, PI and PID controllers for first and second order system. Equipment required: 1. PID controller module, 2. Patch cords, 3. DSO Theory: The time-domain characteristics of a control system are represented by the transient and steady-state responses of the system. When certain test signals are applied, to satisfy performance specifications use some controller along with system. The control system may be placed either in series with the process or it may place in feedback resulting in series or cascade compensation and feed-back compensation respectively. If the controller is in parallel to the feedback path it is known as feed-forward compensation. Feed-forward compensation is not in the loop of the system and does not affect the roots of the characteristics equation. Series or cascade compensation is commonly used. Its block diagram is shown below: R(s) Error C(s)=Output + GC(S) System _ Feedback Fig 1: Closed loop Control system Configuration 𝑘𝑖 Where, Gc (s) = 𝑘𝑝 + + 𝑘𝑑 𝑠 𝑠 Controller is a device that may contain components such as adder, amplifier, attenuator, differentiators and integrator. Best known controller used in practice is PID controller is shown below 7 KP + PID Output KI/S + Error + KD*S Fig 2: PID Controller transfer function Structure Proportional controller: Proportional controller is mainly an amplifier with a controllable gain K. The output and input of the controller are related by K. The effects of this controller are: a) Increase in K reduced the speed of response. b) Increase in K increase the settling time. c) Increases overshoots and affects the stability of the system for very large value of K. d) Increase in K decrease the steady state error. Derivative controller: It differentiates the error signal and produces the actuating signal. a) Derivative control is an anticipatory control b) As it differentiates the error signal, it has influence only on transient response but not on steady state response. c) As it increases the damping of the system, overshoot reduces. d) When the derivative control along with proportional controller. It is known as PD controller with suitable of values KP and KD; it gives fast response and little overshoot. Integral Controller: a) It is a low pass filter and increase rise time. b) It increases the order and type of the system by one. c) It produces the zero steady state error response. d) As order increases stability reduces. e) When type I system is converted into type II system by PI controller. The proportional controller KP no longer fixes the steady state error and the latter is always zero for a ramp 8 function input. Then the problem is to choose the problem compensation of KP and KI so that the transient response is satisfactory. Procedure: First order system 1) Make the connections for a process with first order time constant with unity feedback using the PID controller training kit. 2) Adjust the P, I and D controllers for optimum step response. Second Order System 1) Make the connections for a process with second order system (Time constant x Time constant) with unity feedback using the PID controller training kit. 2) Connect P controller to the process. Test the system for three different KP values and tabulate the results. 3) Connect PI controller to the process. Test the system for three different Ki values and tabulate the results by keeping KP value constant. 4) Connect PID controller to the process. Test the system for three different Kd values and tabulate the results by keeping KP and Ki values constant. Observation: Tabulate the time domain performance indices for different system with different controller configurations. The first order transfer function considered in the module is as follows 1 G(s) = 1+0.0155 𝑆 Table 1: PID control of First Order Process Peak Rise Settling Steady Kp Ki Kd Input output overshoot time time state (%) (ms) (ms) error Sample Calculations: The Second order transfer function considered is given as follows 1 G(s) = (1+0.0155 𝑆)(1+0.0155 𝑆) 9 Table 2: P Control of Second Order System Peak Rise time Settling Steady Kp Input output overshoot (ms) time (ms) state error (%) Table 3: PI control of second order system Peak Steady Rise time Settling Kp Ki Input output overshoot state (ms) time (ms) (%) error Table 4: PID control of second order system Peak Rise Settling Steady Kp Ki Kd Input output overshoot time time state (%) (ms) (ms) error Sample Calculations: Results and Conclusions: 10 Experiment No: 4 Design and Implement the Phase lead compensator Aim: To design and implement the phase lead compensator for a given system using frequency response method. Observe the step response of the compensated system. Apparatus required: S. No. NAME OF THE APPARATUS RANGE QUANTITY 1. Compensation Module - 1 as required (Decade 2 Resistors and capacitor as required box) 3. D.S.O. with probes - 1 4. Patch cards as required as required Formulae used: 𝑌 1. Phase angle 𝜑 = sin−1 𝑌1 deg for the Lissajous fig (a) shown below. 2 𝑌 2. Phase angle 𝜑 = 180 − sin−1 𝑌1 deg for the Lissajous fig (b) shown below. ° 2 Fig 1: Lissajous or XY Plot 11 The plant/system considered is of second order in nature with the transfer function (obtained through the frequency response) as 4.466 𝐺 (𝑠 ) = (1 + 0.001768𝑠)2 Background on design of the Phase lead compensator Step 1: The specifications are 40 deg phase margin and steady state error (SSE) of 5% and Consider the phase margin of given second order system is 24 deg. Compute the phase lead (φm ) required with the safety margin of 10 deg. Step 2: To meet the SSE specifications, the required error coefficient Kp is 19. The gain K needed is 19/4.466 = 5. The gain setting of 5 is fixed by varying the Variable gain block available in the module. 1−sin φm Step 3: Compute the constant factor using the formula 𝛼 = 1+sin φm Step 4: Calculate the new gain cross-over frequency (f) such that |𝐺 |𝑓 = 10 log 𝛼. This step ensures that maximum phase lead shall be added at the new gain cross-over frequency. Here, f = 420 Hz. Step 5: Compute the maximum frequency in rad/sec at which maximum phase lead occurs using the formula ωm = 2 ∗ π ∗ f = 2638.93 rad/sec. Step 6: The lead network is shown in figure 2. The transfer function is expressed as 𝑉0(𝑠) 𝑅2 𝑅1 𝐶𝑠 + 1 𝐺𝑐 (𝑠) = = 𝑉𝑖 (𝑠) 𝑅1 + 𝑅2 𝑅1 𝑅2 𝐶𝑠 + 1 𝑅1 + 𝑅2 𝑅2 Take 𝑅1 𝐶 = 𝜏, and = 𝛼, then 𝑅1 +𝑅2 𝛼(𝜏𝑠 + 1) 𝐺𝑐 (𝑠) = (𝜏𝛼𝑠 + 1) 1 Step 7: Compute the time constant using the formula (Geometric mean of m corner frequencies) Step 8: Assume the value of C as 0.01 µF, then compute the value of R1 using the time constant formula = R1 ∗ C 12 R2 Step 9: Using the formula of constant factor , compute the value of R2. The R1 R2 obtained values of R1 and R2 are 62 KΩ and 39 KΩ, respectively. Fig 2: Lead Network Fig 3: Sample Frequency response plot of Lead compensator 13 Procedure: Implementation of the Phase lead compensator 1. A passive RC lead compensating network is connected via the network portion available in the module. 2. Switch on the compensation module and set the amplitude of sine wave signal to 1 V (peak to peak) which is supplied as the input to the RC lead compensator. 3. A DSO is connected at the output of the lead compensator. 4. The input frequency of the circuit is varied in steps and the corresponding output voltage is tabulated in every steps observed from the DSO. 5. In addition to this, the phase angle is calculated in every step using Lissajous figures in DSO. 6. The voltage gain is calculated using the formula as given in the table I. 7. Plot the Bode plot i.e. graphs of Magnitude (dB) Vs frequency(Hz) and phase angle(deg) V frequency(Hz) in a semi-log sheet. 8. Now, connect the output of lead compensator to the input of plant and the negative feedback connection is established. 9. Apply the pulse signal (different level) as the reference to closed loop system to observe the response of the compensated system. 10. Tabulate (Table 2) the different time domain specifications of the closed loop compensated system. Table I: Frequency response of the phase lead compensator Input Voltage (Vin) = V (p-p) Frequency Output voltage Magnitude in Phase angle S.NO Y1 Y2 Hz (Vo) mV dB=20log(Vo/Vin) (φ) degrees Sample calculations: 14 Table 2: Time Response of the closed loop uncompensated system Rise time Peak S.NO Settling time (ms) Overshoot (%) SSE (ms) time (ms) Table 3: Time Response of the closed loop compensated system Rise time Peak SSE S.NO Settling time (ms) Overshoot (%) (ms) time (ms) % Sample calculations: Results and conclusion: 15 Experiment No: 5 Position control of DC servo motor using PV controller (QUBE Servo) (i) BUMP TEST Aim: To obtain the first order speed transfer function of DC servo motor (QUBE-Servo) using the bump test method. 𝜔(𝑠) 𝐾 Speed Transfer Function = = 𝑉(𝑠) (1 + 𝑠τ) Apparatus/Software : 1. MATLAB Simulink with QUARC Toolbox 2. Quarc QUBE Servo set-up 3. Inertial disc module 4. 15V, 2 A Power supply 5. USB cable Specifications of DC Servo Motor: 18 volts, 7 watts, 540mA, 3050RPM. Specifications of Optical Encoder: Input: - 5 volt DC, Output: - 512 cycles/rev and 2048 quadrature states/rev. Background Theory: DC servo motors are coupled to the output shaft i.e., load through gear train and used to convert applied electrical signal into the angular velocity (or) shaft movement. DC servo motor behaves like mechanical transducer which converts DC voltage into mechanical signal i.e., angular displacement. DC servo motor is separately excited type and ensure linear torque-speed characteristics. Quanser QUBE-servo is a compact rotary servo system that can be used to perform a variety of classic servo control based experiments. Configuring a Simulink Model for the QUBE-Servo: 1. Make sure the QUBE-Servo is connected to your PC USB port and powered ON (the Power LED should be lit). 2. Load the MATLAB software. 3. Create a new Simulink diagram by going to File | New | Model item in the menu bar. 4. Open the Simulink Library Browser window by clicking on the View | Library Browser item in the Simulink menu bar or clicking on the Simulink icon. 16 5. From the Simulink Library Browser expand the QUARC Targets item and go to the Data Acquisition | Generic | Configuration folder 6. Click-and-drag the HIL Initialize block from the library window into the blank Simulink model. This block is used to configure your data acquisition device. 7. Double-click on the HIL Initialize block. 8. In the Board type field, select qube_servo_usb. 9. Go to the QUARC | Set default options item to set the correct Real-Time Workshop parameters and setup the Simulink model for external use (as opposed to the simulation mode). 10. Select the QUARC | Build item. Various lines in the MATLAB Command Window should be displayed as the model is being compiled. This creates a QUARC executable (.exe) file which we will commonly refer to as a QUARC controller. 11. Run the QUARC controller. To do this, go to the Simulink model tool bar, shownFig8.3, and click on the Connect to target icon and then on the Run icon. You can also go QUARC | Start to run the code. The Power LED on the QUBE-Servo (or your DAQ card) should be blinking. 12. If you successfully ran the QUARC controller without any errors, then you can stop the code by clicking on the Stop button in the tool bar (or go to QUARC | Stop). Fig 1. Simulink model of bump test NOTE: Draw the Simulink Model where ever is applicable 17 Procedure: 1) Connect the model as shown in Fig 1 in MATLAB-Simulink. 2) Double click on the Step block. In the properties apply step time 1 and final value 1. 3) Set simulation time 3 seconds. Build the model by clicking on the build icon. 4) Click on the Connect to target icon and then click on Run icon. 5) Observe the output scope and tabulate the steady state speed and the time elapsed by the motor to reach 63.2% of its final speed from the initiation of the step input. 6) Repeat the steps 2 to 5 by incrementing the final value of step signal by 1. Fig 2. QUBE-Servo Bump Test Response (Sample Plots) Observation Table: Sl Amplitude of Steady state speed Speed Gain of the Time No. step Input Av(V) Wms (rad/s) Wms Constant motor K= Av (rad/(V-s)) τ(s) 18 Validating bump test model: 1) Connect the model as shown in the fig 3.in MATLAB-Simulink. 2) Enter the calculated gain (K) and time constant (τ) from above table in to the qube model transfer function. 3) Validate the both actual and model results in the scope. Fig 3. Simulink model to validate the bump test model 19 (ii) STABILITY ANALYSIS Aim: To verify the stability of the DC servo motor (QUBE Servo) for speed and position output functions. Procedure: 1) Connect the model as shown in Fig 4 in MATLAB-Simulink. 2) Double click on the Step block. In the properties apply step time 1 and final value 1. 3) Set simulation time 3 seconds. Build the model by clicking on the build icon. 4) Click on the Connect to target icon and then click on Run icon. 5) Observe the speed and position responses in the scope. Fig 4.Simulink model to measure speed and position when applying a step signal 20 Observations: Function Transfer Function Poles Theoretically From simulation Stable or Not Stable or Not Speed 𝜔(𝑠) 𝐾 = 𝑉(𝑠) (1 + 𝑠τ) Position Θ𝑚(𝑠) 𝐾 = 𝑉(𝑠) 𝑠(1 + 𝑠τ) (iii) SECOND-ORDER SYSTEMS Aim: To analyse the second order response of the DC Servo (QUBE Servo) Motor to step input. Procedure: 1) Connect the model as shown in Fig 5 in MATLAB-Simulink. 2) Double click on the Step block. In the properties apply step time 1 and final value 1. 3) Set simulation time _ seconds. Build the model by clicking on the build icon. 4) Click on the Connect to target icon and then click on Run icon. 5) Observe the output and error signals in the respective scopes 21 Fig 5.Unity feedback second order system Simulink model of DC servo motor Observation & Analysis: The transfer function of unity feedback control system is 𝐾 Θ𝑚(𝑠) τ 𝑤𝑛 2 = = 2 Θ𝑑(𝑠) 𝑠 2 + 1 s + 𝐾 𝑠 + 2𝜉𝑤𝑛 s + 𝑤𝑛 2 τ τ From the above equation: 𝐾 1 Natural frequency wn=√ τ (rad/s); Damping ratio (ξ) = 2τ𝑤𝑛 𝜋ξ (− ) 𝜋 √1−𝜉2 Peak time (tp) = (s); Peak overshoot (PO) =𝑒 𝑤𝑛 √1−𝜉 2 22 Use K and τ from bump test results. Parameter Description Theoretical value Simulation value Peak time (s) Peak Overshoot (%) Fig 6. Model output graphs (Sample Plots) 23 (iv) Position control using PV controller Aim: To control position of DC Servo motor (QUBE Servo) using Proportional Velocity (PV) controller. Procedure: 1) Connect the model as shown in Fig 7 in MATLAB-Simulink. 2) Double click on the Signal generator. In the properties enter the desired position. 3) Set simulation time as inf. Build the model by clicking on the build icon. 4) Click on the Connect to target icon and then click on Run icon. 5) Observe the output and error signals in the respective scopes Fig 7. PV control on QUBE-Servo 24 Fig 8. Block diagram of PV control Observation & Analysis: The transfer function of PV position control is Θ𝑚(𝑠) 𝐾k𝑝 𝑤𝑛 2 = = Θ𝑑(𝑠) τ 𝑠 2 +(1+𝐾k𝑑 )s+𝐾k𝑝 𝑠 2 +2𝜉𝑤𝑛 s+𝑤𝑛 2 From the above equation 𝐾k𝑝 1+𝐾k𝑑 Natural frequency wn=√ τ (rad/s); Damping ratio (ξ) = 2τ𝑤𝑛 𝑤𝑛2 τ (V/rad); 2𝜉𝑤𝑛τ−1 Proportional Gain (kp) = Derivative Gain (kd) = (V-s/rad) 𝐾 𝐾 25 Parameter Description Theoretical value Simulation value Peak time (s) Peak Overshoot (%) Fig 9. Sample output graphs (Explain the obtained plots) Overall Conclusion: 26 Experiment No: 6 Modelling and Controller design for Thermal system Aim: To obtain the model of thermal system from the open loop response. Implement and analyse the effect of P, PI and PID controller for controlling the temperature of the system using Zeigler-Nichols method. Apparatus Required: 1. Temperature controller module 2. Electric Oven. System description Temperature control is one of the most common industrial control systems that are employed in present scenario. The plant to controller is an electric oven, the temperature of which must adjust itself in accordance with the reference. The temperature of the oven is measured using the solid state IC temperature sensor with the operating range of -50℃ to 150 ℃ like AD590. These sensors are linear and have a good sensitivity i.e. 1𝜇A/K. 27 Procedure: Identification of oven parameters: 1. Connect the oven to temperature controller module. 2. Before switch ON of the controller keep toggle switch in SET position and other toggle switch in PAUSE position and connect P output to the driver input. 3. After Switch ON of the controller keep P-amplifier knob at 50% and adjust reference potentiometer to read 50 on the DVM. 4. Keep toggle switch to MEASURE and note down room temperature. 5. Keep oven switch in HEAT position and other toggle switch in RUN position and note temperature readings every 10 sec. 6. Plot the graph as shown in model graph (Figure 1) and obtain the approximate First order plus time delay (FOPTD) transfer function of the oven. Ambient temperature = Table 1: Experimental (Temperature) Data under Open loop S.No Time(sec) Temperature of oven(°C) 01 02 03 04 05 06 07 08 From this experimental data given in Table 1, plot the graph between Time (sec) Vs Temperature (℃). The model graph is shown in Figure 1. 28 Model Graph: Figure 1: Open loop experimental response plot The FOPTD transfer function of the thermal system which relates the temperature T (℃) output to the rate of heat flow (𝜑 -Joule/sec) as input is given by T(𝑠) K𝑒 −𝑠T2 𝐺 (𝑠) = 𝜑(𝑠) = -----------------------(1) 1+𝑠T1 Here, T1 & T2 in sec Constant K for Oven plus driver controller is given by 𝐹𝑖𝑛𝑎𝑙 𝑜𝑣𝑒𝑛 𝑡𝑒𝑚𝑝𝑒𝑟𝑎𝑡𝑢𝑟𝑒−𝐴𝑚𝑏𝑖𝑒𝑛𝑡 𝑡𝑒𝑚𝑝𝑒𝑟𝑎𝑡𝑢𝑟𝑒 K= ----------(2) 𝐼𝑛𝑝𝑢𝑡 𝑣𝑜𝑙𝑡𝑠 Steps to obtain T1 and T2 from the graph: 1. Draw a line parallel to X-axis at maximum temperature value on the graph. 2. Draw a tangent at the linear portion of the curve. 3. Measure the time from starting of X-axis to the point at which tangent cuts the line mentioned in point 1.The measured time will be T1. 29 4. T2 is the delay time for which system is not responding to the input which is shown in model graph. Table 2: PID controller coefficients from Ziegler and Nichols method Type of controller KP KI KD P 1 𝑇1 - - ( )∗( ) 𝐾 𝑇2 PI 0.9 𝑇1 1 - ( )∗( ) 𝐾 𝑇2 3.3𝑇2 PID 1.2 𝑇1 1 ( )∗( ) 𝐾 𝑇2 2𝑇2 0.5𝑇2 Procedure for controlling oven temperature using P, PI and PID controller: 1. Proportional Controller: Before switch ON of the controller keep toggle switch in SET position and other toggle switch in PAUSE position and connect P output to the driver input and short feedback terminals. With calculated value of KP from table 2 and KPmax of 0.2 calculate P potentiometer % setting and adjust P potentiometer to obtained value. After Switch ON of the controller adjust reference potentiometer to required temperature say 60. Keep toggle switch to MEASURE. Keep oven switch in HEAT position and other toggle switch in RUN position and note temperature readings every 10 sec (enter it in Table 3). Plot the graph of time versus temperature (as Figure 2) and obtain time response performance characteristics as given in table 4. 30 2. Proportional-Integral Controller: Before switch ON of the controller cool the oven keep toggle switch in SET position and other toggle switch in PAUSE position and connect P and I outputs to the driver input and short feedback terminals. With calculated value of KP & KI from table 2 and KPmax & KImax of 0.2 & 0.036 respectively calculate P and I potentiometers % settings and adjust P and I potentiometers to obtained values. After Switch ON of the controller adjust reference potentiometer to required temperature say 60. Keep toggle switch to MEASURE. Keep oven switch in HEAT position and other toggle switch in RUN position and note temperature readings every 10 sec (enter it in Table 3). Plot the graph of time versus temperature (as Figure 3) and obtain time response performance characteristics as given in table 4. 3. Proportional-Integral- Derivative Controller: Before switch ON of the controller cool the oven and keep toggle switch in SET position and other toggle switch in PAUSE position and connect P , I and D outputs to the driver input and short feedback terminals. With calculated value of KP, KI & KD from table 2 and KPmax, KImax & KDmax of 0.2 & 0.036 and 23.5 respectively calculate P,I and D potentiometers % settings and adjust P,I and D potentiometers to obtained values. After Switch ON of the controller adjust reference potentiometer to required temperature say 60. Keep toggle switch to MEASURE. Keep oven switch in HEAT position and other toggle switch in RUN position and note temperature readings every 10 sec (enter it in Table 3). Plot the graph of time versus temperature (as Figure 4) and obtain time response performance characteristics as given in table 4. 31 Table 3: Experimental (Temperature) Data under closed loop Sl.no Time (sec) Oven Oven Oven Temperature with Temperature with Temperature with P-controller PI-controller PID-controller Table 4: Performance Specifications Controller used KP KI KD Settling Peak Rise Steady state time (sec) overshoot (%) time error (s) P PI PID Sample Calculations Results and Conclusion 32 Experiment No: 7 Time Domain Analysis of LTI System using MATLAB/SIMULINK 1. Enter the transfer function in MATLAB 2 s 3 5 s 2 3s 6 G (s) s 3 6 s 2 11s 6 Matlab Code : num1=[2 5 3 6]; den1=[1 6 11 6]; sys1=tf(num1,den1) sys2= zpk(sys1); % % To display the factored form of the transfer function 2. Transfer function to zero-pole conversion (tf2zp): Consider the transfer function from above question. Matlab Code : [z,p,k]=tf2zp(num1,den1) pzmap(num1,den1); %To obtain the pole-zero map [num2,den2] = zp2tf(z,p,k) % Reverse Transformation to get the transfer function 3. To find the Partial Fractions of the Transfer function (from question 1) Matlab Code : [r,p,k]=residue (num1, den1) 4. Transfer-function to state-space conversion (tf2ss) Matlab Code : [A,B,C,D]=tf2ss (num1, den1) [num3,den3] = ss2tf (A,B,C,D) % State space to transfer function 33 5. To find the overall Transfer-function of systems connected in series and in parallel 3 2𝑠+4 Let 𝐺1 (𝑠) = and 𝐺2 (𝑠) = 𝑠+4 𝑠2 +2𝑠+3 The transfer function of the systems connected in cascade Matlab Code : For series n_g1 = 3; d_g1 = [1 4]; n_g2 = [2 4]; d_g2 = [1 2 3]; [n_gc,d_gc] = series (n_g1,d_g1,n_g2,d_g2) G(s)= tf(n_gc,d_gc) For Parallel [n_gc,d_gc] = parallel (n_g1,d_g1,n_g2,d_g2) P(s)= tf(n_gc,d_gc) 6. To find the closed loop transfer-function of the systems connected with negative feedback 𝑠+1 The system transfer function 𝐺 (𝑠) = 2 ; and the sensor transfer function 𝑠 +2𝑠+5 𝑠 𝐻 (𝑠) = 𝑠+1 Matlab Code : n_g1 = [1 1]; d_g1 = [1 2 5]; n_h1 = [1 0]; d_h1 = [1 1]; sys1=tf(n_g1,d_g1); sys2=tf(n_h1,d_h1); systf = feedback (sys1,sys2) 7. Obtain the closed loop transfer function of the given block diagram. R(s) C(s) + + 4 1 1 1 0.5 - - - s4 s2 s3 1 2 3 4 5 2 6 5 7 8 34 Matlab Code : % To find the transfer function of the given block diagram. clear; clc; n1 = 1; d1 = 1; n2 = 0.5; d2 = 1; n3 = 4; d3 = [1 4]; n4 = 1; d4 = [1 2]; n5 = 1; d5 = [1 3]; n6 = 2; d6 = 1; n7 = 5; d7 = 1; n8 = 1; d8 = 1; nblocks = 8; blkbuild % Connection matrix q=[1 0 0 0 0 2 1 -6 -7 -8 3 2 0 0 0 4 3 0 0 0 5 4 0 0 0 6 3 0 0 0 7 4 0 0 0 8 5 0 0 0]; iu = ; % input vector iy = ; % output vector [A B C D] = connect(a,b,c,d,q,iu,iy); % State space model [num,den] = ss2tf(A,B,C,D) ; % TF model sys1 = tf(num,den) % Overall system transfer function 35 8. Obtain the closed loop transfer function of the below block diagram. 2 R(s) + C(s) + 1 10 _ s2 _ s( s 1) 1 0. 5 s MATLAB Code: clear; clc; n1 = 1; d1 = 1; n2 = 1; d2 = [1 2]; n3 = 10; d3 = [1 1 0]; n4 = 2; d4 = 1; n5 = 1; d5 = [0.5 0]; n6 = 1; d6 = 1; nblocks=6; blkbuild % Connection matrix q=[1 0 0 0 2 -6 1 0 3 2 4 -5 41 0 0 5 3 0 0 6 3 0 0]; iu = ; % input vector iy = ; % output vector [A B C D] = connect(a,b,c,d,q,iu,iy); % State space model [num,den] = ss2tf(A,B,C,D) ; % TF model sys1 = tf(num,den) % Overall system transfer function 36 9. Obtain the unit step response and the time domain specifications for the system whose closed loop TF is given by C ( s) n2 a) where 0.4 and n 5 R( s) s 2 2 n s n2 C ( s) 25(1 0.4s) b) R( s) (1 0.16s)(s 2 6s 25) 10. Obtain the unit step response of the system whose system matrices are A = [-1 -1;6.5 0], B = [1 1; 1 0], C = [1 0; 0 1], and D = [0 0; 0 0]. 1 11. Obtain the unit impulse response of the system whose TF is given as G ( s) s 2s 1 2 where is varied from 0.2 to 1.0 in steps of 0.2. Plot all the response curves in single figure window. Hint: impulse (sys): Impulse response of LTI systems 37 Experiment No: 8 Stability analysis of feedback systems using MATLAB/SIMULINK 1. Plot the time domain responses of the step, ramp, & parabolic functions for the unity feedback control systems with following open-loop transfer functions. 5( s 4) a) G ( s) s( s 1)( s 2)( s 5) 10 b) G ( s ) 2 s 14s 50 For Case a) MATLAB CODE: num=[5 20]; den=[conv(conv([1 0],[1 1]),conv([1 2],[1 5]))]; sys=tf(num,den); sys1=feedback(sys,1); %%% To get the closed loop transfer function figure(1) step(sys1);% STEP s=tf(,[1 0]) % 's' term sys2=sys1*s; figure(2) step(sys2);% RAMP sys3=sys2*s; figure(3) step(sys3);% PARABOLIC K 2. Check the stability of a unity feedback control system with G ( s) s( s s 1)(s 2) 2 for K=1 & K=3 by plotting the pole-zero map. For K=1 case: (MATLAB Code) num=1; den= [conv([1 1 1 0],[1 2])]; sys1=tf(num,den); clsys1=feedback(sys1,1) figure(1) 38 pzmap(clsys1) 3. Plot Zero-pole map and hence, check the stability of the system whose state space representation matrices are 𝟎 𝟏 𝟎 𝑨= [ 𝟎 𝟎 𝟏 ] −𝟏𝟔𝟎 −𝟓𝟔 −𝟏𝟒 𝟎 𝑩= [ 𝟏 ] −𝟏𝟒 C=[ 1 0 0], and D= Compare the pole values with the theoretical calculation. (Hint: Transfer function = (C(sI-A)-1B+D)) Code: A= [0 1 0; 0 0 1;-160 -56 -14]; B=[0;1;-14]; C=[1 0 0]; D= [num,den]=ss2tf(A,B,C,D) % To convert state space representation into transfer function pzmap(num,den) 4. Check the stability of the system with characteristic equation s 10s 36s 60s 59s 50s 24 0 by finding its roots. 6 5 4 3 2 2 Code: roots([1 10 36 60 59 50 24]) %%%% Coefficient of the polynomial 5. Obtain the Bode plot, gain and phase margins for the unity feedback control systems with the open loop transfer function 320( s 2) 1300 (a) G( s) (b) G( s) s( s 1)(s 2 8s 24) s( s 2)(s 50) For Case a) MATLAB code : clear;clc;clf; num=[320 640]; den=[conv([1 0],conv([1 1],[1 8 24]))]; sys=tf(num,den); figure(1); margin(sys); [Gm,Pm,Wcg,Wcp] = margin(sys) 39 6. Obtain the root locus for K >0 for the system with open loop transfer function. K ( s 5) K (a) G ( s) H ( s) (b) G( s) H ( s) s( s 1) s( s 1)(s 5) K (c) G ( s) H ( s) ( s 1)(s 6s 13) 2 Find the range of K for which the systems are stable. Compare with the theoretical results. For Case a) MATLAB Code : clear;clc;clf; sysGS=tf([1 5],conv([1 0],[1 1])); rlocus(sysGS); 7. An RLC series circuit with R = 1, L = 1H, & C = 10mF is connected to a dc source of 10V through a switch. Plot the inductor current and the capacitor voltage for time, 0 t 10s, if the switch is closed at t = 1s & the circuit elements are initially relaxed. 𝐼𝐿 (𝑠) 𝐼𝑛𝑑𝑢𝑐𝑡𝑜𝑟 𝑐𝑢𝑟𝑟𝑒𝑛𝑡 The transfer function : = 𝑉(𝑠) 𝐼𝑛𝑝𝑢𝑡 𝑉𝑜𝑙𝑡𝑎𝑔𝑒 𝐼𝐿 (𝑠) 𝐶𝑠 = 2 𝑉(𝑠) 𝐿𝐶𝑠 + 𝑅𝐶𝑠 + 1 1 The capacitor voltage 𝑣𝑐 (𝑡) = ∫ 𝑖𝐿 (𝑡)𝑑𝑡 𝐶 1 1 𝑣𝑐 (𝑠) = 𝑖𝐿 (𝑠) 𝐶 𝑠 40 Simulink Model 0.01s 1/s -K- Mux y 0.01s2 +0.01s+1 Step Input Integrator Gain To Workspace Transfer Fcn Mux Scope1 1 Here, the gain K = 𝐶 Step input: Initial time: 1, Final value =10 Results and Conclusion 41