Real Time DSP Based PID and State Feedback Control of a Brushed DC Motor Ersin Yolacan, Serkan Aydin and H.Metin Ertunc Mechatronics Engineering Department Kocaeli University Kocaeli, Turkey hmertunc@kocaeli.edu.tr Abstract In this paper, real time position, trajectory and speed controls are implemented for a serial excited brushed DC motor using PID and state feedback control methods. The purpose of this study is to keep the position and speed on desired references. The control blocks are designed on Matlab-Simulink and applied by F28335 DSP control board. The experimental results of PID and state feedback methods are compared and discussed. Keywords-real time; DSP; PID; state feedback;, brushed DC motor I. INTRODUCTION DC motors are the torque transducer that converts electrical energy into mechanical energy. Therefore, they are one of the most widely used prime movers in industry. The torque required for the motion is developed on the motor shaft and it is directly proportional to the field flux and the armature current [1]. Recently, small size and high speed DC motors are produced based on developing technologies. The DC motors which have different power, size and speed values are widely used in industrial applications such as automotive, trains, electric vehicle, robotic and automation. Furthermore, serial excited DC motor is commonly employed in some electric traction applications [2]. The brushed DC motors are one of the earliest designed and produced motors. The simplicity of design and theoretical substructure, besides conveniently speed and torque control features are the advantages of this type of motors. On the other hand, the controllability and reliability of DC motors reduces at low speeds. Besides, their dimensions are larger than AC motors which have the same power. Proportional-Integral-Derivative (PID) control is frequently used in industrial applications [3]. The most important advantages of PID control method are its simple structure and stability [4]. Despite these advantages, the basic problems of this method are the insensitivity to the systems having highly nonlinear components and easy effectiveness by disturbance [5]. In modern control, H control, sliding mode control, fuzzy logic, neural networks, state feedback control methods are used to reduce the nonlinear effects of the system and parameter variation of the control algorithms [6-9]. In this study, real time DSP based PID and state feedback control methods are performed for position, trajectory and speed variables. The obtained results are compared due to various input signals for evaluating the performances of the control methods. II. MATHEMATICAL MODEL OF DC MOTOR In this study, a serial excited brushed DC motor is used to evaluate performances of two well-known control algorithms, namely PID and state feedback control methods. The motor parameters are given in Table I. TABLE I. PARAMETERS OF DC MOTOR USED IN THE STUDY Symbol Description Value J Inertia of the motor [kgm 2 ] 4.9e-6 R Armature resistance [ ] 5.5 L Armature inductance[h] 8.5e-4 K Motor constant [Nm/A] 4.1e-2 B Viscose damping [Mms/rad] 3.56e-4 The equivalent circuit of a serial excited brushed DC motor is shown Fig.1. The mathematical model of DC motor can be easily computed by using Kirchhoff current law: di V = Ri + L + e (1) dt where V is the supply voltage, R is the armature resistance, L is the armature inductance, i is the armature current and e is the back electromotor force. The mechanical equation of DC motor can be given as follows: dω J + Bω + T = T (2) dt L where J is the moment of inertia, B is the viscose damping Figure 1. Electric equivalent circuit of a brushed DC motor 978-1-4577-746-9/11/$26. 211 IEEE
Figure 4. Main structure of PID control Figure 2. Simulink Block scheme of the DC motor coefficient, T L is the load torque, T is the motor torque and is the rotational speed of motor. The Matlab-Simulink block scheme of DC motor based on the equations given in (1) and (2) is depicted in Fig.2. III. A CONTROLLER DESIGN FOR DC MOTOR In this section, a controller structure which is related to PID and state feedback methods was developed and performed for position, trajectory and speed control of a brushed DC motor. The real time control blocks are analyzed using Texas Instrument TMS F28335 DSP controller board. The system designed for the control of the brushed DC motor is shown in Fig.3. Figure 3. Texas Instrument TMS F28335DSP control board A. PID Control The PID controller is a simple three-term controller that the letters P, I and D stand for proportional, derivative and integral, respectively. In classical control, PID control method is frequently used in industrial applications because of its simplicity and satisfactory control performance. The classical PID controller structure based on block diagrams is depicted in Fig.4 and the control signal, u, created by PID block is given in (3). d u( = K pe( + K I e( dt + K D e( d (3) e( = r( y( where e( is error between reference input, r(, and output, y(. In addition K P, K D and K I are PID parameters which need to be tuned. In this method, e( is the error variable that is reduced to zero upon parameter tune. Thus, the system response is adjusted to desired reference. In general, the effects of K P, K D and K I PID parameters on system response are shown in Table II. Using this table, one can tune the all system without extensive background in controls, unlike many other control methods that are much more complex but often provide only marginal improvement. A procedure for designing a PID controller based on the Table II can be summarized just as a recipe at four typical steps: Determine the transient response parameters (rise time, overshoot and settling time) and steady state error to improve the characteristics of the system. Use K P to decrease the rise time. Use K D to reduce the overshoot and settling time. Use K I to eliminate the steady state error. In order to determine a suitable starting point before adjusting the PID parameters, Ziegler-Nichols tuning rules such as reaction curve method and frequency response method can be employed. In this study, the optimum value of the parameters could be reached by trial and error approach following the steps described at the above recipe. TABLE II. EFFECT OF PID PARAMETERS ON SYSTEM RESPONSE Rise Time Overshoot Settling Time Steady State Error K Reduce Increase Small Reduce p Change K Small Reduce Reduce Small D Change Change K Reduce Increase Increase Eliminate i t Real time PID position control of the system was implemented at Matlab-Simulink; its block diagram is shown in Fig.5. The reference position command is sent from PC to DSP control board via serial communication interface. In fact, actual position of the rotor is obtained by special Simulink blocks of the F28335 DSP board.
F28335 ezdsp Reference_Position Reference_Info Pos ref DMC out fdb PID PID Controller PWM PWM Output and D is the direct feed matrix. To solve this differential equation, initial condition values of the states x() and control input u must be known. But this system may not produce satisfactory closed loop system response in terms of overshoot, rise time and steady state error. Moreover the system may be unstable, i.e. the output may be unbounded for bounded input. In this case, if the system is controllable, every state variable can be reached to a certain objective in finite time by some unconstrained variable u. For a better closed loop system performance, the system is formed by feeding back the state variables through a constant feedback gain matrix K. Figure 7 illustrates this control scheme which is so called state feedback control or pole- placement design through state feedback. Encoder_Position Figure 5. Matlab-Simulink block of PID position control In Figure 6, Matlab-Simulink block for real time PID speed control is shown. The main difference between speed and position control is the feedback block. It can be easily seen from the Fig.6 that the reference and feedback data are speed values. The main problem of the speed control is the correct calculation of the motor speed. The special speed measurement Simulink block of F28335 DSP card is used to obtain the speed value doing some mathematical calculations. For both position and speed control of the system, output signals of the controller blocks are directed to the PWM block. DSP control board supply the required PWM signal for the motor control by the PWM output block. Figure 7. Main structure of State feedback control Thus, from Fig.7, (6) where K is a feedback matrix with constant elements and r is the reference input. The closed loop system is thus described by (7) F28335 ezdsp Reference Speed Reference Block C28x/C28x3x IQmath qposcnt In3 Out2 A Y IQN Speed Measurement Float to IQN eqep Encoder Block Ref_Spd Control Signal Enc_Meas PID Controller PWM PWM Output The design objective is to find the feedback matrix K such that eigenvalues of the closed loop system are of certain prescribed values. In other words, by changing the values of K matrix, one can place the system eigenvalues to arbitrarily assigned values. Therefore, the parameters that determine system performance can be controlled. In Fig.8. Matlab-Simulink block for real time state feedback speed and position control is shown. Figure 6. Matlab-Simulink block of PID speed control F28335 ezdsp B. State Feedback Control As an alternative to transfer function representation of the systems, many physical systems can be shown by the linear time invariant (LTI) state-variable system equations: Position Speed Position Position Err Speed Speed Err Position Err Speed Err Control Signal PWM (4) (5) where x is the internal state vector, u is the control input and y is the measured output vector. The system or plant matrix is A, B is the control matrix, C is the output or measurement matrix, Measurement Actual Position/Speed State Feedback Controller Figure 8. Matlab-Simulink block of State feedback control. PWM Output IV. EXPERIMENTAL RESULTS AND COMPARISION In this study, real time position, trajectory and speed controls are performed for PID and state feedback control
methods. The experimental results are compared both two methods for various reference signals. The test results of PID position control are given in Figs. 9-12. As seen from the Fig.9, rotor position is tracking the reference signal with zero steady state error. Despite, it is possible to reduce the overshoot using different PID coefficients, optimum coefficients which have the best results whole reference signals are used in this study. 15 1 5-5 -1 Step Response Based on PID Position Control -15.5 1 1.5 2 2.5 3 3.5 4 Figure 9. Step response of PID position control In Fig.11, arbitrary trajectory tracking response is given for PID position control. Despite there is small deflection, rotor position is tracking the reference signal as desired. Error [degree] 1 5-5 -1-15 Error Signal of PID Step Response Figure 12. Error signal of PID step response Error Signal -2.5 1 1.5 2 2.5 3 3.5 4 The error signal of PID step response is shown in Fig.12. As seen from the figure, oscillation and overshoot amount is less than that of state feedback control. The experimental test results of PID speed control are given in Figs.13-14. 5 Trajectory Tracking Based on PID Position Control 41 4 39 38 37 1 1.5 4 3 2 1-1 Step Response Based on PID Speed Control -5 1 2 3 4 5 6 7 8 9 1 Figure 1. Sine trajectory tracking of PID position control The sine trajectory tracking response is given in Fig.1. As seen from the figure, rotor position is generally tracking the reference signal as desired. However, there is a deflection occur at changing times. According to the experimental result, maximum deflection amount is.71 degree. 8 6 4 2-2 -4 Trajectory Tracking Based on PID Position Control 72 7 68 66 64.75.8.85.9.95-6 Reference -8 1 2 3 4 5 6 7 8 9 Figure 11. Arbitrary trajectory tracking of PID position control -2-3 -4 2 4 6 8 1 12 Figure 13. Step response of PID speed control As seen from the Fig.13, rotor speed is tracking the reference signal with zero steady state error. We obtained better step response which has small amount overshoot and oscillation using different PID coefficients. On the other hand, optimum coefficients are selected for best results for whole reference signals. 9 75 6 45 3 Sine Trajectory Response Based on PID Speed Control 85 8 795 79 785 78 4.6 4.8 5 5.2 1 2 3 4 5 6 7 Figure 14. Trajectory tracking of PID speed control
In Fig.14, sine trajectory tracking response of PID speed control is given. As seen from the Fig.14, satisfactory test result is obtained for speed control. Although there exists a deflection, the rotor speed is tracking the reference signal. The maximum deflection amount measured for this case is 5 rpm. The experimental results of state feedback position control which is the second control method in this study are given in Figs.15-18. 15 1 5-5 -1 Step Response Based on State Feedback Position Control -15.5 1 1.5 Figure 15. Step response of State feedback position control As seen from the Fig.15, rotor position is tracking the reference signal with zero steady state error. However, the measuring overshoot and oscillation amounts are more than PID control methods. Posistion [degree] 15 1 5-5 Sine Trajectory Tracking Based on State Feedback Position Control 12 115 11 15.15.2.25.3.35-1 -15.5 1 1.5 Figure 16. Sine trajectory tracking of State feedback position control In Fig.16, sine trajectory tracking response of state feedback position control is given. Despite, rotor position is generally tracking the reference signal; deflection amount is more than that of PID control method through whole trajectory. 3 2 1-1 Trajectory Tracking Based on State Feedback Position Control -2-3.2.4.6.8 1 1.2 1.4 1.6 1.8 Figure 17. Arbitrary trajectory tracking of State feedback position control The arbitrary trajectory tracking response of state feedback position control is given in Fig.17. Although the obtained result is satisfactory, there is occurring some deflection on rotor position. It can be seen easily from the figure, test result is not better than that of PID method. Error [degree] 1 5-5 -1-15 21 2 19 18.1.15.2 Error Signal of State Feedback Step Response -2.5 1 1.5 Figure 18. Error signal of step response of state feedback control In Fig.18, the error signal of state feedback control is given. It can be seen easily from the figure both overshoot and oscillation amount is more than that of PID control. The experimental results of state feedback speed control are given in Figs.19-2. 25 2 15 1 5 Step Response Based on State Feedback Speed Control 155 15 1495 149 1485 Figure 19. Step response of State feedback speed control Error Signal 6.35 6.4 6.45 5 1 15 2 25 3 35 4 As seen from the Fig.19, rotor speed is tracking the reference signal with zero steady state error. As shown from the figure, despite the reference signal is higher than PID s
reference, there is no oscillation occur and overshoot is less than that of the PID control method. 8 6 4 2 Sine Trajectory Response Based on State Feedback Speed Control 8.8 1 1.2 1.4 1 2 3 4 5 6 7 8 9 Figure 2. Trajectory tracking of State feedback speed control In Fig.2, sine trajectory tracking of state feedback speed control is given. Generally, rotor speed is tracking the reference signal as desired. Despite, the obtained result is similar with PID control; the deflection amount is less than PID method. V. CONCLUSIONS In this study, real time PID and state feedback control methods are performed and compared due to different reference signals for serial excited brushed DC motor. The different reference signals are applied for position, trajectory and speed control. Real time control blocks which are implemented with Matlab-Simulink, are analyzed for Texas Instrument TMS F28335 DSP controller board. It can be concluded that both control method have almost the same performance when real-time controlling of DC motor using DSP and Matlab. However, each control methods have advantages and disadvantages. According to the overshoot, oscillation and deflection values, results of state feedback control method are much better than that of PID control method for DC motor speed control. However, experimental results of PID position and trajectory control are more satisfactory. ACKNOWLEDGMENT The work has been done at Sensor Laboratory in Mechatronics Engineering Department, Kocaeli University. The authors want to thank the Sensor Laboratory personnel. REFERENCES [1] B.C. Kuo, Automatic Control Systems, Prentice-Hall, Inc. A Simon &Schuster Company. [2] R. D. Begamudre, Electro-Mechanical Energy Conversion with Dynamics of Machines, New York: Wiley, 1988. [3] K. Ogata, Modern Control Engineering, Prentice-Hall, Inc. A Simon&Schuster Company. [4] J. Zhang, Structural research of fuzzy PID controllers, in Proc. International Conference on Control and Automation, ICCA25, Northeastern University, Qinhuangdao Hebei China 25. [5] A Visioli, Fuzzy Logic Based Set-Point Weight Tuning of PID Controllers, IEEE Transaccions on Systems, man and cybernetics-part A: Systems and Humans, Vol.29, No.6,1999. [6] H. S. Choi, Y. H. Park, Y. Cho, and M. Lee, Global sliding-mode control: improved design for a brushless DC motor, IEEE Control Systems Magazine, vol. 21, no. 3, pp. 27 35, 21. [7] A. Rubaai and R. Kotaru, Online identification and control of a DC motor using learning adaptation of neural networks, IEEE Transactions on Industry Applications, vol. 36, no. 3, pp.935 942, 2. [8] S. Aydemir, S. Sezen, H.M. Ertunc, "Fuzzy logic speed control of a DC motor," Power Electronics and Motion Control Conference, 24. IPEMC 24. The 4th International, vol.2, no., pp.766-771 Vol.2, 14-16 Aug. 24 [9] N. C. Shieh, P. C. Tung, and C. L. Lin, Robust output tracking control of a linear brushless DC motor with time-varying disturbances, IEE Proceedings - Electric Power Applications, vol. 149, no. 1, pp. 39 45, 22.