Analysis of Lag Compensator Design for Robotic Elbow Joint Control System Using MATLAB Htwe Htwe Thein Myint Department of Electronic Engineering Mandalay Technological University Email: htwehtwetheinmyint@gmail.com Abstract: The paper describes the result comparisons that were developed for the phase lag compensator design using MATLAB. The implementation of classical experiment as MATLAB m-files is described. Flexible robot arm controllers can be designed to gain insight into a variety of concepts, including stabilization of unstable systems, compensation properties, Bode analysis and Root locus analysis. The analysis has resulted in a number of important conclusions for the design of a new generation of control support systems. 1. Introduction The purpose of phase lag compensator design in the frequency domain generally is to satisfy specifications on steady-state accuracy and phase margin. There may also be a specification on gain crossover frequency or closed-loop bandwidth. A phase margin specification can represent a requirement on relative stability due to pure time delay in the system, or it can represent desired transient response characteristics that have been translated from the time domain into the frequency domain. The overall philosophy in the design procedure presented here is for the compensator to adjust the system’s Bode magnitude curve to establish a gain-crossover frequency, without disturbing the system’s phase curve at that frequency and without reducing the zerofrequency magnitude value. In order for phase lag compensation to work in this context, the following two characteristics are needed. If the compensation is to be performed by a single-stage compensator, then it must also be possible to drop the magnitude curve down to 0 db at that frequency without using excessively large component values. Multiple stages of compensation can be used, following the same procedure as shown below. More is said about this later. The gain crossover frequency and closed-loop bandwidth for the lag-compensated system will be lower than for the uncompensated plant (after the steady-state error specification has been satisfied), so the compensated system will respond more slowly in the time domain. The slower response may be regarded as a disadvantage, but one benefit of a smaller bandwidth is that less noise and other high frequency signals (often unwanted) will be passed by the system. The smaller bandwidth will also provide more stability robustness when the system has unmodeled high frequency dynamics, such as the bending modes in aircraft and spacecraft. Thus, there is a trade-off between having the ability to track rapidly varying reference signals and being able to reject highfrequency disturbances. The design procedure presented here is basically graphical in nature. All of the measurements needed can be obtained from accurate Bode plots of the uncompensated system. If data arrays representing the magnitudes and phases of the system at various frequencies are available, then the procedure can be done numerically, and in many cases automated. The examples and plots presented here are all done in MATLAB, and the various measurements that are presented in the examples are obtained from the various data arrays. The primary references for the procedures described in this paper are [1]–[6]. Other references that contain similar material are [4] – [13]. 2. Compensator Structure The basic phase lag compensator consists of a gain, one pole, and one zero. Based on the usual electronic implementation of the compensator [6], the specific structure of the compensator is: (1 s) (1 α s) 1(s z c ) G c (s) α(s p c ) G c (s) (1) where R 2 C and α (R 1 R 2 ) R2 In this case, because of α > 1, the pole lies closest to the origin of the s-plane. The characteristics of the phase-lag compensation network are summarized in the Figure 1. Generally this operational amplifier circuits are provided for phase-lead or phase-lag compensation networks. If R1C1 is greater than R2C2, this circuit can be used as a phase-lead compensator and if R1C1 is less than R2C2, this may be a phase-lag compensator. C2 C1 R1 _ + R2 R4 R3 _ + Figure 1. Lead or Lag Compensator Design The major characteristics of the lag compensator are the constant attenuation in magnitude at high frequencies and the zero phase shifts at high frequencies. The large 2 negative phase shift that is seen at intermediate frequencies is undesired but unavoidable. Proper design of the compensator requires placing the compensator pole and zero appropriately so that the benefits of the magnitude attenuation are obtained without the negative phase shift causing problems. The following article show how this can be accomplished. The first step in the design procedure is to determine the value of the gain K c . In the procedure, the gain is used to satisfy the steadystate error specification. Therefore, the gain can be computed from ess - plant K x - required (2) Kc ess -specified K x - plant where ( ess ) is the steady-state error for a particular type of input, such as step or ramp, and K x is the corresponding error constant of the system. Defining the number of open-loop poles of the system G (s ) that are located at s 0 to be the System Type N , and restricting the reference input signal to having Laplace transforms of the form R(s) A s q the steadystate error and error constant are ; (3) where K x lim [s N G(s) ] Kx (s/z c 1) (N req - N sys ) (s/p c 1) s (5) where N req is the total required number of poles at the origin to satisfy the steady-state error specification, and N req is the number of poles at the origin in G p (s) . At the stage of making the bode plots of the design, the system whose frequency response is being plotted. 3. Design Procedure for Compensated Plant As N 1 q e lim N s0 s K x G c -lag (s) (4) s0 For N 0 , the steady-state error for a step input (q 1) is ess A (1 K x ) . For N 0 and q 1 , the steady-state error is infinitely Kx (N req - N sys ) (6) s The compensated gain crossover frequency ωx -compensate d is that frequency where G(s) = ∠ s Kc (N req - N sys ) × G p (s) = 180 + PM specified + 10 (7) If G(jωx -compensate d ) is expressed in dB, then the value of α is computed from ( G ( jω x - compensate d ) dB 20 α = 10 and G(jω x -compensate d ) ) (8) is expressed as an dB absolute value, the value of α is computed from (9) α G(jω x -compensate d ) absolute - value 3.1. Design Calculation The control system for the robot arm actuator is shown in Figure 2(b). The controller gain will be K(s 1) . The elbow joint actuator is a two-phase motor and its gain will be 2 / s(s + 4) . Joint torque control can be substantially improved by sensory feedback. So in this model the second order poles compensator is used as a joint torque feedback sensor and its measuring gain will be 3 /(s 2 + 2s + 5) . large. For N 0 , the steady-state error is for the input type that ess A K x has q N 1 . If q N 1 , the steady-state error is infinite. The calculation of the gain assumes that the given system G p (s) is of the correct Type N to satisfy the steady-state error specification. Once this is recognized, the compensator poles at s 0 can be included with the plant G p (s) during the rest of the design of (a) the lag compensator. The values of K x and of K c in would then be computed based on G p (s) (b) Figure 2(a). A robot arm actuated at the joint elbow (b). The control system of the robot arm being augmented with these additional poles at the origin. Once the compensator design is completed, the total compensator will have the transfer function. The elbow joint of the robot arm to be controlled is described by the transfer function. G p (s ) G1 (s) 1 G1 (s) H(s) 3 And then by solving this equation to get the simplest term, 2K(s3 3s 2 7s 5) Kc s 6s3 13s2 (20 6K)s 6K 4 2(s 1)(s 1 j2)(s 1 - j2) (s 0.2609)(s 4.3083)(s 0.7154 j0.1969)(s 0.7154 - j0.1969) G(s) We must assume the one root of denominator for this control system will be s because of very small value 0.2609. So this is a Type 1 system, so the closed-loop system will have zero steady-state error for a step input, and a non-zero, finite steady-state error for a ramp input (assuming that the closed-loop system is stable). As shown in the next section, the error constant for a ramp input is Kx-plant 0.434812404. At low frequencies, the plant has a magnitude slope of-20 db/decade, and at high frequencies the slope is -60db/decade. The phase curve starts at -0⁰ and ends at -90⁰. The specifications that must be satisfied are: 1. Steady-state error for a ramp input e ss -specified ≤ 0.02 and 2. Phase margin PMspecified ≥ 90 . These specifications do not impose any explicit requirements on the gain crossover frequency or on the type of compensator that should be used. It may be possible to use either lag or lead compensation for this problem, or a combination of the two, but we will use the phase lag compensator design procedure described above. The following paragraphs will illustrate how the procedure is applied to design the compensator for this system that will allow the specifications to be satisfied. 3.2. Compensator Gain Calculation The given plant is Type 1, and the steady-state error specification is for a ramp input, so the compensator does not need to have any poles at s = 0. Only the gain needs to be computed for steady-state error. The steady-state error for a ramp input for the given plant is 2(s3 + 3s2 + 7s + 5) K x = lim s s(s + 4.3083)(s + 0.7154 + j2.1969)(s + 0.7154 - j2.1969) s→0 = lim s→0 10 4.3083(0.7154 + j2.1969)(0.7154 j2.1969) 0.434812404 And then the steady-state error is ess = 1 1 = = 2.29984239 K x 0.434812404 The steady-state error of the plant is very large. It seems to become the system will be unstable at infinity. Since the specified value of the steady-state error is 0.02, the required error constant is Kx- required = 50. Therefore, the compensator gain is ess - plant ess -specified K x - required K x - plant 2.299842394 114.9921197 0.02 50 114.9921197 0.434812404 This value for Kc will satisfy the steady-state error specification, and the rest of the compensator design will focus on the phase margin specification. 3.3. The Bode Structure The magnitude and phase plots for KcGp(s) are shown in Figure3. The dashed magnitude curve is for Gp(s) and illustrates the effect that Kc has on the magnitude. Specifically, K cG p (jω ) is 20 log 114.992119 7 = 41.21336159 dB above the curve for G p (jω ) at all frequencies. The phase curve is unchanged when the steady-state error specification is satisfied since the compensator does not have any poles at the origin. The horizontal dashed line at -80⁰ is included in the Figure to indicate the phase shift that will satisfy the phase margin specification (+10⁰) when the frequency at which this phase shift occurs is made the gain crossover frequency. The vertical dashed line indicates that frequency. Bode for Compensator Gain Kc and Gp 40 23.9062dB magnitude(dB) G p (s) Kc 0 -40 14.141rad/sec -80 -100 -4 10 10 -3 10 -2 -1 0 10 10 10 frequency(rad/sec) 1 10 2 10 3 10 Figure 3. Bode plots for the plant after the steady-state error specification has been satisfied Note that the gain crossover frequency of KcGp(s) is larger than that forGp(s); the crossover frequency has moved to the right in the graph. The closed-loop bandwidth will have increased in a similar manner. The phase margin has decreased due to Kc, so satisfying the steadystate error has made the system less stable in fact increasing Kc in order to decrease the steadystate error can even make the closed-loop system unstable. Maintaining stability and achieving the desired phase margin is the task of the pole–zero combination in the compensator. Our ability to 4 4 graphically determine values for ωx-compensated and α obviously depends on the accuracy and resolution of the Bode plots of K cG p (jω ) . High resolution plots like those obtained from MATLAB allow us to obtain reasonably accurate measurements. Rough, hand-drawn sketches would yield much less accurate results and might be used only for first approximations to the design. Being able to access the actual numerical data allows for even more accurate results than the MATLAB-generated plots. The procedure that I use when working in MATLAB generates the data arrays for frequency, magnitude, and phase from the following instructions: w = logspace(N1,N2,1+100*(N2-N1)); [mag,ph] = bode(num1,den1,w); [mag2,ph2] = bode(num2,den2,w); semilogx(w,20*log10(mag1),w,ph1,w,20*log10 (mag2),w,ph2),grid where N1=log10 (ωmax), N2= log10 ( ωmin), and num, den are the numerator and denominator polynomials, respectively, of KcGp(s) . For this example, N1= -4; N2= 4; num1= 2* [ 1 3 7 5]; den1=[1 6 13 26 6]; num2=2*114.850658057*[1 3 7 5]; den2=[1 6 13 26 6]; The data arrays mag, ph, and w can be searched to obtain the various values needed during the design of the compensator. 3.4. Gain Crossover Frequency As mentioned above, the compensated gain crossover frequency is selected to be the frequency at which the phase shift of K cG p (jω ) = -80⁰. This value of phase shift was computed from (7), which allows the phase margin specification to be satisfied, taking into account the non-ideal characteristics of the compensator. From the phase curve plotted in Figure 3, this value of phase shift occurs approximately midway between 10r/s and 20r/s. Since the midpoint frequency on a log scale is the geometric mean of the two end frequencies, an estimate of the desired frequency is ω= √10*20=14.14r/s. Searching the MATLAB data arrays storing the frequency and phase information gives the value ω=14.14r/s (using 100 equally-spaced values per decade of frequency), so the estimate obtained from the graph is very accurate in this example. 3.5. Calculation α The lag compensator must attenuate K c G p (jω ) so that it has the value 0 dB at frequency ω 14.141rad/s . From the magnitude curve in Figure 3, it is easy to see that is between 20 dB and 30 dB. K c G p (j14.141 ) dB K c G p (j14.141 ) dB 20 log 10 114.9921197 20 log 0.434825989 20 log 14.14 2 1 20 log 1 (0.4 14.14) 2 (0.2 14.142 ) 2 - 20log 14.14 - 20log (0.2321 14.14) 2 1 - 20log 1 (0.268 14.14)2 (0.1873 14.142 ) 2 33 .97967146 23 .03065 32 .12726 - 23 .00698819 - 10.7084 - 31.5160 dB 23.9062 24dB ( 24 / 20 ) 10 15.84893192 An accurate measurement of the graph would provide a value of 41.21336159 dB for the magnitude. The corresponding value of α is calculated by using (9) and the result is α = 15.84893192 ; which can be easily implemented with a single stage of compensation. dB 3.6. Compensator Zero and Pole Now that the values for ω x -compensate d and α is obtained, it can be determined the values for the compensator’s zero and pole [6]. 14.14 z= = 1.414 10 p= z 1.414 = = 0.0892 α 15.84893192 The values that is and p c 0.0892 . z c 1.414 compensator for this design is obtained are The final s 114.9921197 1 1.414 G c-lag1 (s) s 1 0.0892 114.9921197 (0.7072s 1) (11.2086s 1) 114.9921197 0.0631 7.2555 (s 1.414) (s 0.0892) ( s 1.414) ( s 0.0892) 3.7. Evaluation of the Design The frequency response magnitude and phase of the compensated system Gc-lag (s) Gp(s) are shown in Figure 4. The magnitude is attenuated at high frequencies, passing through 0 db at approximately 14.14r/s, so the compensated gain crossover frequency has been established at the desired value. The compensated phase curve is seen to be nearly back to the uncompensated curve at ωx-compensated. The lag compensator is contributing approximately -4.9 at that frequency, so the phase margin specification is satisfied. To illustrate the effects of the compensator on 5 closed-loop bandwidth, the magnitudes of the closed-loop systems are plotted in Figure 4. The smallest bandwidth occurs with the plant Gp(s). Including the compensator gain Kc > 1 increases the bandwidth and the size of the resonant peak. Significant overshoot in the time-domain step response should be expected from the closedloop system with Kc =114.9921197. Including the entire lag compensator reduces the bandwidth and the resonant Magnitude (dB) 60 Phase (deg) Bode Diagram Gm = Inf , Pm = 96.3 deg (at 14.1 rad/sec) Magnitude (dB) 20 0 -45 -90 -4 10 40 -2 10 10 Frequency (rad/sec) 0 10 2 Figure 5. Gain Margin and Phase Margin for Lag Compensator 2 The drawbacks to using the third compensator are the increased values of the electronic components (a problem particularly with the capacitors) and the increase in the settling time of the ramp response. The time it takes to reach the unit ramp response is a value 0.02 less than the input (e ss - specified ) that increases 20 0 -20 0 Phase (deg) 40 -20 0 60 -45 -90 -135 -3 10 Bode Diagram Gm = Inf , Pm = 101 deg (at 14 rad/sec) 10 -2 -1 0 10 10 Frequency (rad/sec) 10 1 10 Figure 4. Gain Margin and Phase Margin with lag Compensator 1 2 from approximately 15 seconds with G c-lag2 (s) while the time it takes for G c - lag1 (s) is about 4 seconds to reach a value 0.02 ≥ e ss -specified . So it is chosen G c - lag1 (s) that can be obtained a better 4. Compare with Other Compensator Designs To see some of the effects of the value of the compensator’s zero, a second lag compensator was designed. The same specifications were used; the only difference between these designs is that the zero of the new compensator was placed two decades in frequency below the compensated gain crossover frequency, rather than one decade. The value of the compensator pole also changed as a result. The new compensator is s 114.9921197 1) 0.1414 G c-lag2 (s) s 1 0.00892 114.9921197 (7.072s 1) (112.086s 1) 7.2555(s 0.1414) (s 0.00892) This new compensator reduces the percent overshoot to a step input and provides additional phase margin. The added phase margin is due to the fact that the compensator’s phase shift is virtually zero at a frequency two decades above z c . Both of these characteristics are good. performance for this elbow joint control system. Trade-offs such as this typically has to be made during the design of any control system. R.C. Dorf [6] presents a table showing analog circuit implementations for various types of compensators. The circuit for phase lag is the series combination of two inverting operational amplifiers. The first amplifier has input impedance that is the parallel combination of resistor R 1 and capacitor C1 and feedback impedance that is the parallel combination of resistor R 2 and capacitor C 2 . The second amplifier has input and feedback resistors R 3 and R 4 , respectively. Assuming that the opamps are ideal, the transfer function for this circuit as shown in Figure 1 is Vout (s) R 2 R 4 (sR 1C1 1) Vin (s) R 1R 3 (sR 2C 2 1) R 2 R 4 R 1C1 (s 1/R 1C1 ) R 1R 3 R 2 C 2 (s 1/R 2 C 2 ) Comparing with G c - lag (s) in (5) shows that the following relationships hold: K (R 2 R 4 )/(R1R 3 ) τ R1C1 , ατ R 2C2 z c 1 / R1C1 6 p c 1/ R 2 C 2 [2] α z c /p c R 2C2 /R1C1 To implement the compensator using the circuit in [6], note that there are six unknown circuit elements (R1 , C1 , R 2 , C2 , R 3 , R 4 ) and three compensator parameters (K c , z c , pc ) .So, three of the circuit elements can be chosen to have convenient values. To implement the original lag compensator G c - lag1 (s) in this thesis, it will be used the following values C1 C2 0.47μ F and R 3 10 kΩ that are assumed. Thus, these values are obtained for the phase-lag compensator design. [3] [4] [5] [6] R 1 1 /( z c C1 ) 1 /(1.414 0.47 μ ) 1.5047097415 R 2 1 /( p cC 2 ) 1 /( 0.0892 0.47 μ ) 2.38526858 Kc [7] R 2R 4 C R R C 2 4 , where 1 α 1 R2 C2 R 1R 3 αC 1R 3 R 4 (R 3 K c /α) (10 K 114.992119 7)/15.8489 3192 72.5551225 [8] 5. Summary In this example, the phase lag compensator is able to satisfy both of the specifications of the system. In addition to satisfying the phase margin and steady-state error specifications, the lag compensator also produced a step response with shorter settling time. In summary, phase lag compensation can provide steady-state accuracy and necessary phase margin when the Bode magnitude plot can be dropped down at the frequency chosen be the compensated gain crossover frequency. The philosophy of the lag compensator is to attenuate the frequency response magnitude at high frequencies without adding additional negative phase shift at those frequencies. ACKNOWLEDGEMENT I would wish to acknowledge the many colleagues at Mandalay Technological University who have contributed to the development of this paper. In particular, I would like to thank Yai Win Aung, my brother and Wai Mar, my closed friend, for their complete support. REFERENCES [1] Zhi Hong Mao, February 2008, Linear Control Systems, Lecture 12: Phase-lead and Phase-lag Compensators and April 2008, Lecture 21: Frequency Response Design (3), University of Pittsburgh, PA. [9] [10] [11] [12] [13] Venkata Sonti, March 2008, Lecture 6: Gain, Phase Margins, designing with Bode Plots, Compensators, Indian Institute of Science, India. Katsuhiko Ogata, 1997, Modern Control Engineering, 3rd Edition, Prentice Hall, Upper Saddle River, NJ.[2] Dr. K. P. Mohandas, 2006, Modern Control Engineering, NIT Campus PO, Calicut, printed by Sanguine Technical Publishers, Bangalore, India. MathWorks, 2001, Introduction to MATLAB, the MathWorks, Inc. Richard C. Dorf and Robert H. Bishop, 2001, Modern Control Systems, Ninth Edition, Prentice Hall Inc, A Simon and Schuster Company, New Jersey[1] Lawrence E. Pfeffer, O. Khatib, and J. Hake, August 1989, “Joint Torque Sensory Feedback in the Control of a PUMA Manipulator”, IEEE Transaction on Robotics and Automation, VOL. 5, NO.4. J.J. D’Azzo and C.H. Houpis, Linear Control System Analysis and Design, McGraw-Hill, New York, 4th edition, 1995. MathWorks, 2001, SIMULINK, the MathWorks, Inc. MathWorks, 2001, What is SIMULINK, the MathWorks, Inc. David F. Griffiths, August 2001, An Introduction to MATLAB (version 2.2), Stockholm, Sweden. Sathish K. Shanmugasundram, 2000, Control System Design for an Autonomous mobile Robot, PSG College of Technology, India. Natick, January 1990, MA 01760, MATLAB User’s Guide, The Math Works, Inc.
0
You can add this document to your study collection(s)
Sign in Available only to authorized usersYou can add this document to your saved list
Sign in Available only to authorized users(For complaints, use another form )