Lab 1 Modelling of a DC Motor System Purpose To form a mathematical model of a direct current motor system based on a known dynamical relationship and experimental results Theory Review Modelling a system in terms of mathematical expressions is the first step in designing a controller In this experiment, we will find the mathematical model of a real physical system: a DC motor servo system The equation of motion of a rigid body rotating about a fixed axis comes directly from Newton s Law: τ(t) = Jα(t) (11) where τ(t) is the applied torque, J is the rotational inertia constant, and α(t) is the angular acceleration: α(t) = dω(t) dt where ω(t) denotes the angular velocity Consider an electrical motor system, the applied torque results from a magnetic torque and a friction torque The magnetic force is linearly proportional (K t ) to the current i a (t) flowing through the motor coil There are two types of friction: Coulomb friction and viscous friction The viscous friction torque is in the opposite direction of the motion and is linearly proportional (K f ) to the angular velocity ω(t) The Coulomb friction f c (t) is often modelled as an external constant torque, in the opposite direction of the motion, that must be overcome by the magnetic torque before the motor starts to spin: F ω(t) > 0 f c (t) = 0 ω(t) = 0 F ω(t) < 0 1
2 LAB 1 MODELLING OF A DC MOTOR SYSTEM Putting these torques into equation (11), we have K t i a (t) K f ω(t) f c (t) = Jα(t) (12) or α(t) = 1 J [K f ω(t) f c (t) + K t i a (t)] (13) In frequency domain, (13) becomes sω(s) = 1 J [K f Ω(s) F c (s) + K t I a (s)] As shown in Figure 11, the current flow through the motor coil is I a (s) = V a(s) V b (s) L a s + R a (14) where v a (t) is the applied voltage across the motor terminals, R a is the DC resistance of the motor winding, L a is the inductance of the motor coil, and v b (t) is the back emf voltage that is linearly proportional (K b ) to the angular velocity of the motor i a R a L a v a v b DC Motor Figure 11: DC motor armature circuit Now substitute equation (14) into (13), to give the complete motor system equation (15) in the frequency domain: sω(s) = 1 J [ ] K t K f Ω(s) F c (s) + (V a (s) K b Ω(s)) (15) L a s + R a Finally, the motor speed Ω(s) is given by Ω(s) = K t JL a s 2 + (JR a + K f L a )s + (K f R a + K t K b ) V a(s) L a s + R a JL a s 2 + (JR a + K f L a )s + (K f R a + K t K b ) F c(s) Figure 12 is the block diagram of this motor system
3 v a 1 i a L a s + R K t τ 1 α a J f c 1 s ω K f K b Figure 12: Block diagram of the DC motor system Motor Load Belt DISC Figure 13: DC motor with a load General Information: In this lab, we will model the motor system shown in Figure 13 The following table contains the system parameters we will determine R a (Ω) motor coil DC resistance L a (mh) motor coil inductance F (N m) Coulomb friction torque K b (V/(rad/sec)) motor back emf constant J (Kg m 2 ) system inertia The motor torque constant K t is known to be 0065 Nm/A The viscous friction constant K f is often very small and can be approximated by zero To identify the system parameters, it is necessary to excite the system with various inputs Since the output of a function generator is not capable of driving a motor, a power amplifier is also used The voltage gain of the power amplifier is 2 In this lab, the output velocity is measured by a tachometer The gain of the tachometer in the lab is K = 0264 V/(rad/sec) (eg, if the velocity is 1 rad/sec, the tachometer will generate 0264 V)
4 LAB 1 MODELLING OF A DC MOTOR SYSTEM Detailed Procedure: Connect all relevant circuits in the lab to a ±15 V power supply 1 Determine R a : Disconnect motor connector and measure the DC resistance across the motor terminals with a digital multimeter Remember to short-circuit the motor terminals first and then reopen it before taking actual measurements in order to eliminate any generated back EMF Please find the minimum resistance value as the shaft is manually rotated and different readings are taken since the DC motor resistance is different at different shaft positions 2 Determine L a : (a) Connect a 25Ω resistor in series with the motor as in Figure 14 Vout MOTOR A 069A t t i/p o o Power Amp R=25 L a R a Figure 14: Determination of L a (b) Input a 2V peak to peak square wave to the power amplifier and observe the voltage across the 25Ω resistor R (c) Calculate the motor inductance with following equation L a = (R a + R) t ln(1 069) (16) (d) Explain why the above equation will give the motor inductance 3 Determine F : (a) Set the output voltage of a variable power supply to zero and then connect it to the motor terminals directly (b) Gradually increase the voltage input until the motor starts to turn Measure and record the motor current i a The Coulomb friction F is K t i a (Nm) (c) Describe why the above procedure will determine the friction constant F
5 4 Determine K b : (a) Vary the power amp input voltage until the motor system spins at 350 rpm (How do you check this?) (b) Measure the voltage across the motor v a and motor current i a (c) Calculate K b as follows: K b = v a i a R a 3665 V/(rad/sec) (17) (d) Explain in the lab report why the above equation gives K b 5 Determine J: (a) Apply a 2 V peak to peak sine wave with 25 V DC offset to the power amp input and to the channel A input of a scope Connect the tachometer output to the channel B input (b) Make sure that the scope inputs are set at DC for both channels (c) Record the tachometer output amplitude and phase lag at frequencies range from 02 to 1 Hz Find the frequency (f 45 ) at which the phase lag is about 45 o Record the amplitude at this frequency also (d) Calculate the system inertia as follows J = 1 2πf 45 K t R a K b (18) (e) Explain why the above equation gives J Hint: since the frequency (in step c) is very low relative to the -3db frequency of the motor inductor and resistance circuit (equation (14)), we can ignore these dynamics The block diagram in Figure 15 shows the motor system without the motor coil dynamics It is easy to see that the entire system is then simply a first order system What is the -3db frequency of the system? Ignore f c v a 1 i a R K t τ 1 α a J f c 1 s ω K f K b Figure 15: DC motor system without motor coil dynamics
6 LAB 1 MODELLING OF A DC MOTOR SYSTEM Review Questions (1) Ignore K f Derive the motor system transfer function M 1 (s) from v a to ω as in Figure 12 With the experimental data, write down the numerical expression for M 1 (s) (2) Take out the dynamic of the coil and rewrite the transfer function of the motor M 2 (s) Show that M 2 (s) can be given by a system shown in Figure 16 Determine the values of K 1 and K 2 v a K 1 1 s ω K 2 Figure 16: Simplied first order motor system (3) Consider f c (t) in the Figure 15 as an input of the system (assume v a (t) = 0) and motor velocity as the output Derive the transfer function M d (s) for this input-output pair With the data from the experiment, evaluate M d (0) Then evaluate the velocity of the disk when v a = 2 V Note that M d (0) is DC gain from the disturbance to the output (4) With the DC motor model parameters measured in this lab, please go on to study the Theory Review section of the next lab PID Control of a DC Motor Servo System, complete the Matlab simulations and include the results in your report as required by the Pre-Lab section of the next lab Pre-lab 1 Explain why (16) gives L a 2 Explain why (17) gives K b
Lab 2 PID Control of a DC Motor Servo System Purpose To learn and apply the common PID control schemes Theory Review A simplified DC motor system with position output has block diagram shown in Figure 21 Here we omitted the motor coil inductance and the viscous friction, ie, we assumed L a = 0 and K f = 0 f c v a 1 i a R τ K t 1 α 1 ω 1 θ a J s s K b Figure 21: Simplified DC motor system with position output This system can then be put in the form shown in Figure 22 d u K V 1 Js + F 1 s y Figure 22: The equivalent form of Figure 21 Here K V = K t R a, F = K tk b R a respectively and the variables v a, f c, θ are renamed as u, d, y 7
8 LAB 2 PID CONTROL OF A DC MOTOR SERVO SYSTEM A typical unity feedback position control system using DC motor is shown in Figure 23 d r K P K A K V 1 Js + F 1 s y Figure 23: A DC motor position control system P control Here K A is the gain of the power amplifier The controller used is a proportional controller (P controller) with gain K P The transfer function in the feedforward path is G(s) = K P K A K V s(js + F ) Hence the transfer function from r to y is where and G ry (s) = K P K A K V /J s 2 + F J s + K P K A K V J ζ = ω 2 n = K P K A K V J F 2 K P K A K V J ω 2 n = s 2 + 2ζω n s + ωn 2 The position error constant of the feedback system is K p = G(0) = Hence the steady state error due to a unit step reference input is 1 1 + K p = 1 = 0 The velocity error constant of the feedback system is K v = lim sg(s) = K P K A K V s 0 F Hence the steady state error due to a unit ramp reference input is 1 K v = The transfer function from d to y is G dy (s) = F K P K A K V 1 Js 2 + F s + K P K A K V
9 Hence for unit step disturbance, the steady state error is G dy (0) = 1 K P K A K V On summarizing, we make the following observations: 1 The steady state position error due to step reference input is zero 2 The steady state position error due to unit ramp reference input is proportional to 1/K P 3 The undamped natural frequency ω n of the system, which corresponds to the speed of response, is proportional to K P 4 The damping ratio ζ is proportional to 1/ K P 5 The effect of the disturbance is also proportional to 1/K P The observations show that the steady state response and the speed of the response improve when K P increases, whereas the damping becomes worse when K P increases Thus a P control cannot be used to improve all aspects of the closed loop performance Other methods of compensation are needed To improve the transient response, one of the methods is to use proportional plus derivative control (PD control) as shown in Figure 24 r d K P (1 + T D s) K A K V 1 Js + F 1 s y Figure 24: A DC motor position control system PD control In this case, the open loop feedforward path transfer function is The transfer function from r to y is G ry (s) = G(s) = (1 + T Ds)K P K A K V s(js + F ) K P K A K V (1 + T D s) Js 2 = ω2 n(1 + T D s) + (F + K P K A K V T D )s + K P K A K V s 2 + 2ζω n s + ωn 2 where and ω 2 n = K P K A K V /J ζ = F + K P K A K V T D 2 K P K A K V J
10 LAB 2 PID CONTROL OF A DC MOTOR SERVO SYSTEM The position error constant is still and the velocity error constant is still K P K A K V F Hence the steady state errors due to step and ramp reference inputs are the same as in the P control case The transfer function from d to y in this case is G dy (s) = 1 Js 2 + (F + K P K A K V T D )s + K P K A K V Hence the steady state error due to the unit step disturbance input is G dy (0) = 1 K P K A K V (21) It is seen that with a PD controller, the steady state performance, as well as the undamped natural frequency, remains unchanged as in the P control case but the possibly small damping ratio caused by large K P can be fixed by choosing T D In order to improve the steady state performance, a proportional plus integral controller (PI controller) as shown in Figure 25 can be used d r K P (1 + 1 T I s ) K A K V 1 Js + F 1 s y Figure 25: A DC motor position control system PI control In this case, the open loop feedforward path transfer function is The transfer function from r to y is G ry (s) = G(s) = K P K A K V (1 + T I s) s 2 (T I Js + T I F ) K P K A K V (1 + T I s) T I Js 3 + T I F s 2 + T I K P K A K V s + K P K A K V Now the open loop system is of type II, so its position error constant and velocity error constant are both infinity This implies that the steady state errors due to step reference input and ramp reference input are both zero The acceleration error constant is K a = lim s 2 G(s) = K P K A K V s 0 T I F Hence the steady state error due to unit parabolic reference input is T I F K P K A K V
11 The transfer function from d to y is G dy (s) = T I s T I Js 3 + T I F s 2 + T I K P K A K V s + K P K A K V Then the steady state error caused by a unit step disturbance input is G dy (0) = 0 It is seen that if a PI control is used, the steady state errors due to ramp reference input and step disturbance input are completely eliminated However the PI control has turned the system into a third order system which may become unstable One can also combine PD and PI control to form a PID control as shown in Figure 26 Generally speaking, the I term is good for steady state performance whereas the D term is good for transient performance d r K P (1 + 1 T I s + T Ds) K A K V 1 1 Js+F s y Figure 26: A DC motor position control system PID control General Information The parameters for the motor are given in the following table motor resistance(r a ) *Ω Torque constant(k t ) 0065 Nm/A Position signal constant 16 V/rad Power amp voltage gain(k A ) * motor damping term(f ) *N m s 1 Inertia(J) * kg m 2 Table 21: *obtained by system identification in the last lab Pre-Lab 1 Using the parameters for the motor given in the General Information, write down the numerical expression for P (s), the plant transfer function, ie, the open loop transfer function excluding the controller Is P (s) stable? Draw the block diagram as in Figure 23 with the additional positional signal constant so that both the system input and output are in voltage
12 LAB 2 PID CONTROL OF A DC MOTOR SERVO SYSTEM 2 For the P control scheme, determine the gain K P that will result in damping ratio of 05 and then simulate the step response of the closed loop system using MATLAB with d = 001 3 Show and print out the step response of the closed loop system and determine the steady state error (SE), the rise time (t r ), percentage overshoot (PO) and the settling time (t s ) 4 Design a PD compensation by adding T D term such that the percentage overshoot is reduced to 15% 5 Show and print out the step response of the new closed loop system and compare the SE, T r, PO and T s with the P controlled system 6 For the same P controlled system, add an integral term with T I = 10 7 Repeat step 5 and observe that the stead state error is completely eliminated 8 Add an integral term to your PD controller Decrease T I starting from 100 and observe your step response for different T I Find the value of T I such that the system becomes unstable Also choose an T I so that you think the overall performance of the step response is optimal Detailed procedure 1 Ensure that the experiment kit is switched off 2 Check that the set-point is 0v 3 Construct the proportional control scheme specified in the Pre-lab step 2 and record your observations (step response) Note: you should examine the step response to see if (a) the motor traveled to its final level monotonically; (b) the motor overshoot on the way to its final level; (c) the motor oscillated before setting to its final level 4 Using the motor kit and op-amp, construct the PD control schemes specified in the Pre-lab step 4 Compare your actual step response with the computer simulation 5 Construct the PI control scheme specified in the pre-lab step 6 Compare your actual step response with the computer simulation 6 Construct the optimal PID control scheme specified in the pre-lab step 8 Compare your actual step response with the computer simulation
13 Review Questions 1 How does the integral term affect the transient response and the steady state performance? Also, if both intergal and derivative terms are implemented together, ie, a PID controller, can both the transient and steady state performance be improved? 2 If the step response of the motor system is required to have less than 009 second rise time and 10% overshoot, can it be achieved by the PD control scheme?