               What you should know for this experiment You should write down details of your preparation in your log book and ask a demonstrator to sign it before you can start this experiment.  If not you are not allowed to do this experiment. Proportional and Integral (PI) control is one of the most commonly used industrial controller.  The I control increases accuracy of the control system in steady state and the P control can be used to adjust transient performance of the control system.    For the DC motor control system the PI controller increases the the steady state error characteristic from type 1 to type 2. If you would like to learn frequency domain controller design using Matlab you can visit the Control Tutorials at http://ctms.engin.umich.edu/ and study the DC Motor Position: CONTROL Frequency section for lead controller design by clicking on MOTOR POSITION at the top and FREQUENCY on the left. Preparation Questions Task 1 PI controller design A PI controller is to be designed for a position control system as shown in the following figure.  The control system should have a phase margin of at least 40  degrees.  Considering the inaccuracy of the estimated model we use a phase margin of 45 degree for the design which provides an additional lead angle of 5 degree. Open Simulink and construct a Simulink program as shown below, where the PID controller is replaced using the PI controller to be designed and the Motor Position block is replaced using the estimated DC motor transfer function for position output in radians obtained in Experiment 3. In this preparation the PI controller can be designed either with or without a Matlab controller design tool.  You can choose one of them for your design. A. Design using Matlab 1)  Type sisotool in Matlab Command Window to activate sisotool for PI controller design.  Import the transfer function obtained in Experiment 3 for position output in degrees and a PI controller.  Initially the PI controller can have a unit gain and a corner frequency that is about 10% of the lower corner frequency of the DC motor.  Drag the corner frequency of the controller and the gain for 45 degree phase margin in the Open-loop Bode Editor for Open loop windows as follows: a) Adjust the gain for the peak phase margin at a frequency that is lower than and close to the cross over frequency.  b) If it is higher than 45 degrees increase the corner frequency and repeat a) c) If it is lower than 45 degrees decrease the corner frequency and repeat a) d) Repeat the above process until the desired phase margin of 45 degree is achieved.  Click on Analysis-->Response to Step Command on the toolbar of sisotool in order to open LTI viewer to view the step response and other characteristics.   B. Design without using Matlab  Noting that the PI controller has the form, The reduced motor transfer function has the form The open loop transfer function of the PI control system is the product of the above two transfer functions and has the form where the open loop gain and the transfer function The phase margin can be determined using the open loop transfer function as follows Thus, the phase of GL(jw) is the phase margin.  The design problem is therefore:  a) Choose an appropriate GL(s) such that it can provide a phase lead of 45 degrees.  b)  Choose a gain such that the cross over frequency is where the phase lead is 45 degrees. Noting that GL(s) is in the form of a lead network we can design the controller as follow.        (1)     The attenuation factor for a phase lead of 45 degrees is (2)     Letting where is the corner frequency of the DC motor determined in Experiment 3 for the reduced model of the motor.  The lower corner frequency, and the frequency for maximum phase lead can be determined as follows. (3)     Draw bode plots of the lead network and the open loop system Comment on similarity and difference of the two bode plot.   (4)  The open loop gain K can now be determined in order to set the gain cross over frequency to be the frequency for maximum phase lead, .   K can be determined by substituting the frequency for maximum phase lead for s  in the open loop transfer function and solving for K when the magnitude of the open loop transfer function is unit.         Another way to determine the open loop gain K is to use Matlab command margin  by try and error such that the following open loop transfer function has the maximum phase margin. (5)     The gain of the PI controller can be determined using where Km is the gain of the DC motor in reduced form with position as output determined in  Experiment 4.  The PI controller is therefore (6) Draw bode plots of the PI controller, the motor transfer function and the open loop transfer function that is the product of the PI controller and the motor transfer function and determine the phase margin of the PI control system using the bode plot of the open loop function.  It should be very close to 45 degree.  You can use Matlab command margin for the analysis and design. (7) Replace the reduced model using the 3rd DC motor transfer function obtained in Experiment 3 and determine the phase margin.   Measure the phase margin to see if it is greater than or equal to 40 degree.  If not redesign the controller using a phase margin greater than 45 degree.    Task 2 PI controller simulation Change the gain and zero of the PI controller in sisotool by dragging the zero and the gain of the bode plot in order to study the effects of the P and I parameter of the PI controller on characteristics of the control system.   Comment on their effects on rise time, settling time, overshoot, phase margin and gain margin.  Summarize your data using a table or graph in order to support your comments. 