Motomatic via Bode by Frank Owen, PhD, PE Mechanical Engineering Department California Polytechnic State University San Luis Obispo The purpose of this lecture is to show how to design a controller for the Motomatic that uses Bode plots to evaluate the system and design the controller. The original system is shown in the following figure. We want to design a PID controller for the Motomatic, which requires running the system with computer control. This can be easily done by interfacing the computer directly to the system. An analog output from the computer is fed into the input to the voltage amplifier. And the voltage out of the potentiometer for output shaft is fed into the analog input of the computer. Ideally, this voltage should be stepped down from ±15 volts to ±10 volts. With this configuration, the Motomatic loop becomes G OL is then = ( + 1) Units-wise, GC is volts/deg, K A is volts/volt, and KR is rpm/rpm. The units on the bottom are sec-1 for the s s and sec for T M. So the units overall are volts/deg from GC, (rev/min)/volt from K M, and sec from 1/s: volt deg rev min volt sec 360 deg rev min 60 sec = 6 Thus we put deg in and get deg out. We must multiply the G OL with the quantities in their native units by 6 to get deg/deg. We do not have the sign inversions that we had with the op-amp comparator, and K A is negative, so we need to put in a -1 for stability. Thus we simply consider K A to be positive. Run a Matlab script file to initialize the parameters: KA = 5; KM = 175; TM = 0.3; KR = 1/9; %v/v %rpm/v %sec %rpm/rpm Then we create G OL with a K P = 1: >> s = tf( s ) 1 P a g e
>> gol = KA*KM*KR/(s*(TM*s+1)) To see where we stand, we draw a Bode plot: >> bode(gol) >> grid on From this we can see that the system is, indeed, type 1. The system has no phase cross-over frequency, since is never < -180. The system also has almost no phase margin. If we blow up the above diagram, we see that the gain cross-over frequency is 44 rad/sec, and at this frequency = -176. So M = 14. 2 P a g e
This would cause quite a bit of overshoot. We can calculate this. With M = 14, So = Φ 100 = 0.14 We can verify this by calculating the G CL and inputting a unit step. The modified Motomatic is unity feedback, so >> gcl = gol/(1+gol) >> figure(2) >> step(gcl) The step response is, indeed, wiggly, as shown below. The overshoot is actually more than 64%. It looks as if it is more like 90%. The simplified relationship between M and is just an approximation. 3 P a g e
The system is type 1. We can see that with the step, the system does actually wind up at 1.0. We need to reduce the phase margin to knock the overshoot down some. We could de-tune the system. If we did this and, say, aimed for 45 of phase margin: We look at the phase curve and find the frequency where = -135. In a blown-up view, we see that that occurs at a = 3.35 rad/sec. 4 P a g e
There the log mag curve is at a value of 41 or 42 db. Thus 20 log = 42 We actually need to lower the log mag curve by this amount so So 5 P a g e
This has, indeed, cut down on the wiggling. Also it seems that in both cases, the system gets to 1.0 in about 2 to 2.5 sec. So even though the peak time for the de-tuned controller is much longer, the time it takes to get to the final value is about the same. Let s try another approach, where we perform a phase lift on the original system. This is equivalent to designing a PD controller. Remember, we do not need a PID at this point (for a step input), because we already have a type 1 system. It s like the system is already providing the I-part, all we need to do is provide the D-part to speed the system up. Our strategy will be to place the zero (lead) and then use the gain to fine tune the result. If we look at the Bode plot of the original system, let s add the lead to lift the curve up on the right hand end. At = 100 rad/sec, is getting pretty close to -180. So to get the complete lift, put the break frequency for the lead one decade before that, i.e. B = 10 rad/sec. Thus the lead is and the Matlab commands are 1 10 + 1 6 P a g e
This gives obviously a big improvement. Let s then just take advantage of 90 of phase lift and adjust the system gain so that the gain cross-over frequency is 1000 rad/sec. If we look at the Bode plot, at 1000 rad/sec the log mag value of the system with a lead is around -30 db. So 20 log = 30 We need to raise the log mag curve by this amount, so We install this gain and then have a PD controller. Let s check out the Bode and then the step response. 7 P a g e
This had the desired effect. Note that now the gain cross-over frequency is 1000 rad/sec and the phase margin is 90. Let s see what this does to the closed-loop step response. At first glance, it looks as if the system is, yes, without overshoot, but very slow. But then if we look more carefully, we see that the time scale is in milliseconds instead of in seconds. So the system responds very, very quickly also with no overshoot. 8 P a g e
Remember, however, that the controller talks to the actuator, and the actuator may not be powerful enough to effect this. The way to see that would be to build a Simulink model and put a saturation block in it, then simulate that system. Now we have a controller From this you can figure out the values of K D and K P. = 31.6 (0.1 + 1) = + 9 P a g e