I E Maachuett Intitute of Technology Department of Mechanical Engineering 2.004 Dynamic and Control II Laboratory Seion 5: Elimination of Steady-State Error Uing Integral Control Action 1 Laboratory Objective: (i) To invetigate the elimination of teady-tate error through the ue of integral (I), and proportional plu integral (PI) control. (ii) To compare your experimental reult with a Simulink digital imulation. Introduction: In the previou laboratory experiment you have noted that there wa a teady-tate error to a contant angular velocity command, and that the error magnitude depended on the degree of vicou damping preent. In many control problem it i deirable to eliminate the teady-tate error, and the mot common way of doing thi i through the ue of integral control action and proportional plu integral (PI) control. A PI controller ha a tranfer function with a block-diagram 1 G c () K p + K i H J I A J F E J 2 1 + J H A H A J L J? F O J and a time domain repone t v c (t) K p e(t) + K i e(t)dt 0 where v c (t) i the controller output. A decription of how the integral component act to eliminate teady-tate error i given in Appendix A. Pleae take a few minute to read through and undertand the Appendix. 1 October 22, 2007 1
The Experimental Setup: Controller a hown below: The et-up i the ame a in Lab. 4, uing the 2.004 PID Ue the tachometer low-pa filter a you did in Lab 4. In thi lab, in addition to proportional control you will be uing integral control, adjuted by the knob labelled Int. Gain (Ki) on the front panel. In digital control ytem uch a thi, real-time integration i done through an approximate numerical algorithm, uch a rectangular integration, where the integral i repreented a a um n n n 1 + e n ΔT where e n i the error at the nth iteration, and ΔT i the time tep, or trapezoidal integration n n 1 + (e n 1 + e n ) ΔT/2 Experiment #1: Verification of Integrator Performance Verify that the integrator i functioning correctly uing the following tep: (a) Connect the computer-baed controller, but keep the power amp turned off for all part of thi experiment. (b) Set the function generator to produce a tep (quare) function of amplitude 1 volt, at a frequency of 1 Hz. (c) Open the controller, and elect a ampling rate of 100 ample/ec. (Maintain thi value for all part of the lab.) (d) Set K p 0 and K i 1 on the front panel. Start the controller and oberve the error trace. (If the tachometer i noiy, you might want to diconnect it and ground the input). Viually confirm that the error trace i the integral of the input. Either ave and plot the output, or make a ketch of it. (e) Add a 0.5 volt offet to the quare wave and repeat part (d). (f) Now et a 1 Hz. triangular wave (no offet) on to the function generator and repeat the experiment. Experiment #2: Proportional Control Obtain a baeline tep repone with proportional control. Baically repeat the Lab. 4 tep repone meaurement to demontrate the exitence of the teady-tate error: 2
(a) Set K p 3, and K i 0, with a ampling rate of 100 ample/econd. Intall one damping magnet. (b) Set the function generator to produce a DC ignal of 1 volt magnitude. (c) Record and plot the cloed-loop tep repone, and meaure the teady-tate error. Experiment #3: Pure Integral Control (a) Now invetigate pure integral control by repeating Expt. #2 with K p 0, and K i 3 o that 3 G c (). When uing integral control, make ure that the power amp i turned on before tarting the controller. Thi avoid the problem of integrator wind-up. Ha integral control helped with the teady-tate error? Can you tell? What ha happened to the tranient repone? Plot your reult. (b) Remove the damping magnet and repeat part (a). I the repone better or wore. Dicu your reult with your lab intructor. Look at the cloed-loop characteritic equation from Appendix A, and dicu how the cloed-loop root are affected by the value of B and K i. In particular, think about what happen to the cloed-loop if the vicou damping B 0. Experiment #4: PI Control: In thi experiment, ue PI Control, that i with ( ) 1 K p + K i + K i /K p G c () K p + K i K p (a) Start with K p 3, K i 1, and a ingle magnet for damping. Ue the ame function generator etting, and record and ave the tep repone. (Note ue the pan and zoom tool to elect a complete poitive tep ection of the repone before aving it to MATLAB.) I the repone more atifactory? (b) Repeat (a) with K i 5 and 10. In each cae ave the repone to MATLAB, and make a plot of the poitive tep repone. (c) Qualitatively examine the effect of integral control by uing a finger to add a contant diturbance torque to the flywheel. Oberve the controller output (blue/grey trace). Make a note of what happen. Compare your three plot. Briefly decribe how the value of K i ha affected 1) any overhoot in the tep repone, 2) the time to the peak repone, and the time to reach the teady-tate repone. Experiment #5: Compare your reult with a Simulink Simulation: Simulink i one of the mot widely ued computer tool for control ytem analyi and deign. It i an integral part of MATLAB, and i a drag-and-drop block-diagram time-domain imulation 3
language. Simulink provide a graphical work-pace where you can create very complex ytem model without writing a ingle line of code. Later in thi coure we will introduce you to programming in Simulink, but for now we provide you with a Simulink model of the lab etup and ak you to run it and compare your experimental tep-repone with the Simulink imulation. The figure above how the pre-wired Simulink imulation for thi lab. You can change the value of K p and K i by double-clicking on the appropriate block and entering the new value. You can diplay the cope by double-clicking on the icon, and then reizing the window. The input block at the far left i a Simulink tep function, o that the imulation will diplay the cloed-loop tep-repone. Many other function may be found in the ource library. Three ignal are multiplexed on to the cope (input, controller output, and tach output). In addition, the tach output i connected to a block labelled imout. Thi write a vector named imout to the MATLAB workpace o that you may acce the repone in MATLAB. You can change the name of the MATLAB variable by double clicking on the icon. To run the imulation, imply click on the right-arrow in the toolbar. (a) The Simulink model i contained in the file PIControl.mdl in the Lab 5 folder of the 2.004 Coure Locker on the lab machine. To run the model, drag the file to your dektop or home directory (Z:). Double-click on the file to tart MATLAB and open the model. (b) Run the imulation for the cae of PI control with K p 3, and K i 1, 5, 10. Save the output to a different variable name in each cae. (c) Compare your experimental and imulated data. If you can, make a ingle plot for each of the three condition with the real and imulated data. 4
E I L J Appendix A: Introduction to Integral Control Action In the previou lab we have noted that there i a teady-tate error in the angular velocity of the plant when there i a vicou diturbance torque preent. Integral control action i very commonly ued to eliminate the teady tate error. Pure Integral Control: Aume that we replace our proportional controller with an integrator with gain K i o that the controller output i t v c (t) K i e(t)dt + v c (0) 0 t K i (r(t) y(t)) dt + v c (0) 0 where e(t) r(t) y(t) i the error. For implicity alo aume that v c (0) 0. 9 H J I A J F E J 1 + J H A H A J 2 M A H ) F 2 J 6? D H A I F I A Then the tranfer function G c () of the controller i The integrator will function a follow: K i G c () If the error e(t) i poitive, that i r(t) > y(t), the controller output (and hence the torque produced by the motor) will increae at a rate proportional to the error. Similarly, if e(t) < 0, the controller output will decreae at a rate proportional to the magnitude of the error. If the error i zero, the integrator output will be maintained at a contant value. The reult i that the integrator will continually adjut the motor torque o a to drive the error to zero, at which point the upplied torque remain contant. Aume that our plant (compriing the Power Amp, Rotational Plant and Tachometer) ha a tranfer function V t () K a K m K t /N G p () V c () J + B Then the forward loop tranfer function i K i K a K m K t /N G() G c ()G p () J + B 5
E I L J The cloed-loop tranfer function i V t () G cl () R() G() 1 + G() K i K a K m K t /N J 2 + B + K i K a K m K t /N For a tep input r(t) A, the final-value theorem tate ( ) A K i K a K m K t /N lim v t (t) lim(v t ()) lim t 0 0 J 2 + B + K i K a K m K t /N A Note that the ytem ha now become econd order, and that the teady-tate error will be zero. Proportional plu Integral (PI) Control: Pure integral control i rarely ued in practice, and you will ee why in the coure of thi lab. PI control, on the other hand, i ued very often. In PI control, the controller ue a linear combination of proportional and integral control action: 1 G c () K p + K i K p + K i ( ) + K i /K p K p 9 H J I A J F E J 2 1 + J H A H A J 2 M A H ) F 2 J 6? D H A I F I A F The plant tranfer function (compriing the Power Amp, Rotational Plant and Tachometer) i V t () K a K m K t /N G p () V c () J + B The forward loop tranfer function i G() G c ()G p () K p + K i K a K m K t /N J + B 6
The cloed-loop tranfer function i G cl () V t() R() G() 1 + G() (K p K a K m K t /N) + K i K a K m K t /N J 2 + (B + K p K a K m K t /N) + K i K a K m K t /N For a tep input r(t) A, the final-value theorem tate ( ) A (K p K a K m K t /N) + K i K a K m K t /N lim v t (t) lim(v t ()) lim t 0 0 J 2 + (B + K p K a K m K t /N) + K i K a K m K t /N A o that again, the teady-tate error i zero. PI control eliminate teady-tate error, jut a doe pure I control, but the additional contant K p enable the ytem damping to be pecified. We note in paing that I control ha introduced an open-loop pole at the origin ( 0), and that PI control ha introduced a pole at the origin, and an open-loop zero at K i /K p. Appendix B: The Plant Tranfer Function In previou lab we found the plant tranfer function to be V t () K a K m K t /N G p () V c () J eq + B eq where V t () i the tachometer output voltage, and V c () i the controller output (input to the power amplifier), and we have meaured or calculated the following number: J eq 0.03N.m2 B eq 0.014N.m./rad (lab average) K a 2.0A/v K m 0.0292N.m/A (lab average) v 1 rev v K t (0.016 rev/min )(60 min )( ) 0.153 2 π rad rad/ N 44 0.244 180 7