Amplitude Amplitude CDS / Homework #7 Solution Problem (CDS, CDS ): (5 points) From (.), k i = a = a( a)2 P (a) Note that the above equation is unbounded, so it does not make sense to talk about maximum in general. In this problem, we will assume that a. Then, the maximum is given by a = /3 which gives k i =.48. The closed loop poles of the system are /3, and 4/3. The open loop poles are an. Note that /3 is larger than in magnitude, therefore it is not a dominant closed loop pole. From (.7), k i =.25..9.8.8.7.6.6.5.4.4.3.2.2. 5 5 2 25 3 35 4 (a) Using a = /3 -.2 5 5 2 25 (b) Using (.7) Note that there is a small overshoot when using k i. Code: s = tf('s'); P = (s+)ˆ(-2); % When a = /3 a = /3; ki = a*(-a)ˆ2; C = ki/s; CLP = /(+P*C);
Responses figure step(clp) % When using (.7) ki2 =.25; C2 = ki2/s; CLP2 = /(+P*C2); figure step(clp2) Problem 2 (CDS, CDS ): (5 points) The systems are simulated using Simulink. (c) Without anti-windup (d) With anti-windup Figure : Block diagram of the feedback systems in Simulink The responses are shown below when k t = Without windup protection (solid), with windup protection (dashed) 6 Step = Step =.5 5 Step = 3 4 3 2 5 5 2 Time With windup protection, the responses have a smaller overshoot. Furthermore, the responses are similar 2
when the step input magnitude is because the controller is not saturated in this case. When the step input magnitude becomes larger, the overshoot due to integral windup becomes larger, thus, the windup protection plays an more important role. Code: kt = ; stoptime = '2'; stepmagnitude = ; simout = sim('problem a','returnworkspaceoutputs','on',... x=(outputs.getelement().values); simout = sim('problem b','returnworkspaceoutputs','on',... y=(outputs.getelement().values); stepmagnitude =.5; simout = sim('problem a','returnworkspaceoutputs','on',... x2=(outputs.getelement().values); simout = sim('problem b','returnworkspaceoutputs','on',... y2=(outputs.getelement().values); stepmagnitude = 3; simout = sim('problem a','returnworkspaceoutputs','on',... x3=(outputs.getelement().values); simout = sim('problem b','returnworkspaceoutputs','on',... y3=(outputs.getelement().values); cp = lines(3); figure plot(x,'color',cp(,:)); hold on; plot(x2, 'Color',cp(2,:)); plot(x3, 'Color',cp(3,:)); plot([ 2],[ ],':','Color',cp(,:)); plot([ 2],[.5.5],':','Color',cp(2,:)); plot([ 2],[3 3],':','Color',cp(3,:)); plot(y,'--','color',cp(,:)); plot(y2,'--','color',cp(2,:)); plot(y3,'--','color',cp(3,:)); title('without windup protection (solid), with windup protection (dashed)') xlabel('time'); ylabel('responses'); legend('step = ', 'Step =.5', 'Step = 3') Problem 3 (CDS ): (3 points) 3
Phase (deg) Magnitude (db) (a) The bode plot of the plant P (s) is given by the blue line Figure 2. The triangle shows the steady state requirement at 2 log 2dB. The blue box shows the tracking error requirement up to 2π rad/s at 2 log db. The red box shows the phase margin requirement at 3 degree. (b) We want to design a controller such that L(s) = P (s)c(s) is above the blue box with zero frequency gain at the triangle, and a phase margin above the read box. The steady state frequency of the P (s) is approximately db. So, we can set the proportional gain to k p = 3 5dB so that L(s) is approximately 4dB in steady state. To obtain the required phase margin, we can include a derivative term into the controller at frequency ω d = 2π rad/s (i.e. k d = k p /ω d = 5/π) that will shift the phase margin to approximately 36 degree. So, controller is C(s) = 3 + 5/πs. We do not need the integral term in this case. The yellow line in Figure 2 shows that L(s) satisfies all the requirements drawn for part(a). Bode Diagram Gm = Inf, Pm = 36.4 deg (at 44. rad/s) 5-5 - 9 45-45 -9-35 P C L = PC -8-2 3 Frequency (rad/s) Figure 2 (c) The frequency response and step response are shown in the figure. 4
Phase (deg) Amplitude Magnitude (db) Bode Diagram Gm = Inf, Pm = 85.4 deg (at 55.8 rad/s).5 - -2-3 -4-45.5-9 -35 2 3 Frequency (rad/s) (a) Frequency response.5..5.2.25.3.35.4.45 (b) Step response The steady state under step input is given by lim s L(s) + L(s) = lim s Thus, the steady state error is less than %..567s 3 + 3.622s 2 + 4.627s + 55.3.2256s 4 +.645s 3 + 3.695s 2 + 4.7s + 55.67.993 The rise time is.259s (% - 9%), the overshoot is 4.8, and the settling time is.2656s (2%). These values can be estimated from the step response. Code: s = tf('s'); g = 9.8; m =.5; c =.5; l =.5; J =.475; r =.25; P = r/(j*sˆ2 + c*s + m*g*l); % part (a) figure() margin(p) % part (b) kp = 3; wd = 2*pi*; kd = kp/wd; wi = ; ki = kp*wi; C = kp+kd*s+ki/s; 5
Phase (deg) Magnitude (db) figure(2) margin(p*c) % part (c) CLP = P*C/(+P*C); figure(3) margin(clp) figure(4) step(clp) stepinfo(clp) Problem 4 (CDS ): (2 points) The transfer function of the full system is given by P (s) = C(sI A) B = k I (cs + k) s 2 (J J 2 s 2 + k d (J + J 2 )s + k(j + J 2 )) For low frequencies (s is small), the transfer function can be approximated by P (s) = k I (J + J 2 )s 2 b p s 2 5 Bode Diagram -5 - -5-2 -25-8 -225-27 -35-36 - 2 3 Frequency (rad/s) Figure 3: Blue - real model, red - approximate model Note that the approximated model and the real model are pretty similar up to about ω =.2 rad/s. A PD controller has the form C(s) = k p + k d s. Thus, the characteristics polynomial of the closed loop transfer function is given by the numerator of + P (s)c(s) which is s 2 + b p k d s + b p k p 6
Amplitude Imaginary Axis The desired closed loop characteristic polynomial from the given poles is s 2 + 2ζω s + ω 2. Thus, k p = ω2 o b p k d = 2ζω b p With low pass filter, the controller becomes C(s) = k p + k d s + st f + s 2 T 2 f /2 where T f = k d /(Nk p ) and N = 5 is chosen for the simulation. This is arbitrary. To obtain a well damped response we choose ζ =.8 and it remains to find a suitable value of the design parameter ω. A large value of ω gives a fast response. When the second order approximated model is valid, response time increases inversely with ω and so does the control signal, because the real part of the poles of both P (s) and C(s) scale linearly with ω. The frequency range where the model is valid (ω.2) gives a bound on possible values of ω. Note the oscillation frequency is ω.82 =.6ω. Requiring that this frequency be less than.2 we find that a reasonable upper limit of the design parameter is ω =.2 and a 2% settling time of about 5s. To check the results, simulate the closed loop system with full model when ω =.8,.2. 2 2 Nyquist Diagram.8.6.5.4.2.5.8 -.5.6.4.2 2 3 4 5 6 7 (a) Step response - -.5-2 -2-2 3 Real Axis (b) Nyquist diagram Figure 4: Blue - ω =.8, red - ω =.2 You can see that the systems are stable for both cases but less so when ω is larger. Oscillation is observed when ω =.2. The stability margin is smaller when ω =.2. The settling time is aprroximately 47s when ω =.8, and 5s when ω =.2. We can conclude that the system can be controlled with a PD controller provided that the requirements on the response time are not too stringent. Comparing with the step response using state feedback from Exercise 7.2, the response time using state feedback is approximately one order of magnitude smaller. 7
Amplitude.9.8.7.6.5.4.3.2. 2 3 4 5 6 7 Figure 5: Step response from Exercise 7.2 Note that the model used for state feedback is valid for higher frequency. Therefore, the controller can make the system response faster with larger magnitude of u. 8