You are on page 1of 5

International Conference on Computing and Control Engineering (ICCCE 2012), 12 & 13 April, 2012

LabVIEW Based PID Speed Control and System Identification of a PMDC Motor
Kiran Raj A S*, Manoj Kumar T, Mansi S Surana, Prem Kumar M P, Suchithra R , Varun K
Department of Electronics and Instrumentation, Amrita Vishwa Vidhyapeetam Amrita School of Engineering, Coimbatore, India
*

anilkiran.191@gmail.com The relation between controller output and error input in PID controller is given by: y(t)= Kpe(t)+ KpKi where, Ki= and Kd= PID controllers are tuned in terms of their P, I, and D terms. There are two ways of tuning they are + K pK d

Abstract-Speed control of DC Motor is vital in many applications. In this paper, we are trying to control the speed of the PMDC motor and finding the model of the closed loop system. The objective is achieved in two steps. First, we interface the PMDC motor to PC using NI USB-6008 DAQ card. For designing the PID controller, LabVIEW control system toolkit is used. Next, we extract the state-space model of the closed loop speed control system using LabVIEW System Identification Toolkit. The state-space model derived from this system can be used in the model based fault detection technique for finding out the faults which could occur in the system or for model based controls. Key words: DC motor, PID, USB-6008, LabVIEW, System identification, State-space.

I.

INTRODUCTION

DC Motor plays a crucial role in research and laboratory experiments because of their simplicity and low cost. The basic property of DC motor is that speed can by adjusted by varying the terminal voltage. In order to adjust the speed of the system Proportional Integral Derivative (PID) controller is widely used [1], [2]. This method is most useful when a mathematical model of the process or control is too complicated or unknown. Tuning of PID parameters should be done to get the optimal response. Many times when working with DC motors, specifications of the motor remains unknown, and hence it is imperative to go for system identification to obtain the model. The motor used for closed loop speed control and system identification is manufactured by canon precision motors with voltage rating of 12V and rated RPM of 2200. II. THEORY A. PID Controller And Tuning Algorithm: The PID controller which consists of proportional integral derivative elements is widely used in feedback control of industrial processes. It takes action on considering the past present and future errors. By tuning the three parameters (Kp, Ki , Kd) in the PID controller algorithm [3], the controller can provide control action designed for specific process requirements.

1) Ziegler Nichols method (Closed-loop): ZieglerNichols [4] is a type of continuous cycling method for controller tuning. The term continuous cycling refers to a continuous oscillation with constant amplitude and is based on the trial-and-error procedure of changing the proportional gain (Kp). The kp is reduced from larger value till the point at which the system goes to unstable state i.e. the point at which the continuous oscillations occurs. Thus the gain at which system starts oscillating is noted as ultimate gain (Ku) and period of oscillations is ultimate time period (Pu). It allows us to use the ultimate gain value, Ku, and the ultimate period of oscillation, Pu, to calculate Kc. These two parameters, Ku and Pu, are used to find the loop-tuning constants of the controller (P, PI, or PID) using the formula tabulated in Table 1.
Table I PID Controller Parameters for Ziegler-Nichols Method Controller type P PI PID Kp 0.5Ku 0.45Ku 0.6Ku Ti Pu/1.2 Pu/2 Td 0 0 Pu/8

The advantage of this method is that it is a proven online method and includes dynamics of whole process, which gives a more accurate picture of how the system is behaving. The disadvantage is that it upsets the process, uses trial and error method and has

ISBN 978-1-4675-2248-9 2012 Published by Coimbatore Institute of Information Technology

International Conference on Computing and Control Engineering (ICCCE 2012), 12 & 13 April, 2012 a very aggressive tuning. This closed-loop tuning stimulus and response data to estimate the parameters of the method is limited to tuning processes that cannot run plant. in an open-loop environment. System identification is a process that includes acquiring, 2) Process reaction curve (Open-loop): In the process formatting, processing, and identifying mathematical models reaction curve, the variables being measured are those based on raw data from a real-world system. Then the result is of a system that is already in place. A disturbance is validated such that the resulting model fits the observed introduced into the system and data can then be system behaviour. System identification is used in a wide obtained from this curve. First the system is allowed range of applications including mechanical engineering, to reach steady state, and then a disturbance, Xo, is biology, physiology, meteorology, economics, and modelintroduced to it. The percentage of disturbance to the based control design. system can be introduced by a change in either the set The identification of models in closed loop systems can be point or process variable From the data logged the three parameters are done in three ways. They are direct identification, indirect calculated by using the process reaction curve for a identification and joint input-output approach. step change in input for open loop system. The dead Direct identification is used when only time (dead), the time for response to change () and the knowledge about the stimulus and response ultimate value the response reaches at steady state signal is present. This can be used for SISO, (Mu) for a step change of xo. MISO and MIMO systems. Indirect identification approach is used when Ko= knowledge about the response signal, reference signal and controller information is present. This Ko and dead are used to find the tuning constants Joint identification approach is used when the by using the formula Table 2. knowledge about stimulus signal, response signal and reference signal is present. Table II
PID Controller Parameters for Process Reaction Curve Method Controller Type P PI PID Kc Ko 0.9Ko 1.2Ko Ti 3.3dead 2dead Td 0 0 0.5dead

Both the Indirect and Joint identification can be used only for SISO systems. In our project, only information on stimulus and response signal is known hence only direct identification approach is used. In this, State space estimation method is used since it does not assume zero correlation between input signal and output noise. III. EXPERIMENTAL SETUP A. Hard Ware 1) Optical Switch Arrangement: Moc7811 is a slotted opto-isolator module with an IR transmitter and a photo diode mounted on it. When the light emitted by the transmitter is blocked by the slotted disc, logic level of the photo diode changes. The optical switch for producing pulse for speed measurement is shown in Fig. 1.

The advantage of this method is that quick and easier to use than other methods and it is a robust and popular method and the disadvantages are it depends upon purely proportional measurement to estimate I and D controllers and approximations for the Kc, Ti, and Td values might not be entirely accurate for different systems. So on analysing both the methods, we decided to use Ziegler Nichols method (Closed-loop), since it is very accurate and works on the dynamic data of the system. The PID parameters we got are as follows:
Kp=0.00038 Ti=0.0026 s Td=0.01 s

Fig.1 Optical Switch Circuit

B. System Identification In order to obtain a well defined model, a numerical process known as system identification is used. This process involves acquiring data from a plant and then numerically analyzing

2) Frequency To Voltage Converter: LM2907 is a frequency to voltage converter IC which is used for measuring the speed of the motor. Input to this converter is given as pulses which are produced from the optical switch. LM2907 converts the given input

ISBN 978-1-4675-2248-9 2012 Published by Coimbatore Institute of Information Technology

International Conference on Computing and Control Engineering (ICCCE 2012), 12 & 13 April, 2012 pulse frequency to a proportional voltage. The circuit system identification to simulation verification can be done on connection for 2907 is shown in Fig. 2. the same platform.
1) Closed Loop PID Speed Control: The desired speed is obtained from the user and the actual speed of the motor is received through the DAQ card from the speed measurement circuitry. The desired speed, the actual speed and the PID gains calculated from the ultimate gain method [6] are given as inputs to the PID controller which in turn produces the controller output in the range of 0-5V through the DAQ card. The set up for controlling the speed of the motor is done as shown in functional block diagram of closed loop system in Fig. 4.

Fig. 2 Frequency to Voltage Converter Circuit

3) Motor Driver Circuit: The PID controller output is given as an analog signal of range 0-5V through the motor driving circuitry for driving the motor. This circuit consists of 2 stages. Voltage amplification Current amplification First, IC 741 is used to amplify the voltage signal from DAQ card which in the range of 0-5V to 0-12V range for meeting the voltage specification of the motor. Since the output current of the IC 741 is in the range of milli Amperes, we need to amplify the current for driving the motor. This amplification is done by connecting the TIP122 NPN power transistor in common collector configuration. The property of the common collector configuration is that the voltage gain is unity and the current gain is equal to the maximum current gain of the transistor. Therefore, the current amplified output is given to the motor from the emitter junction of the TIP122. By this way, the motor can be driven properly and circuit connection is made as shown in Fig. 3.

Fig. 4 Functional Block Diagram of Closed Loop Speed Control System of Dc Motor

The LabVIEW block diagram of closed loop speed control system is shown in Fig 5 and hardware setup and result is shown in Fig.6 and Fig. 7 respectively.

Fig. 5 LabVIEW Block Diagram of Closed Loop Speed Control System

Fig. 3 Voltage and Current Amplification Circuit

B. Software A LabVIEW platform is used to interface the PID controller with the DC motor for controlling the speed of the motor through NIDAQ card USB-6008 [5]. The main advantage of LabVIEW is that it offers a variety of toolkits for control purposes so that the entire steps of the design process from

Fig. 6 Hardware Setup

ISBN 978-1-4675-2248-9 2012 Published by Coimbatore Institute of Information Technology

International Conference on Computing and Control Engineering (ICCCE 2012), 12 & 13 April, 2012

Fig 7 Speed Controlled Motor Output shown in LabVIEW Front Panel

2) System Identification: System identification [7] procedure is used to identify the model of the closed loop speed control system. Since the parameters of the PMDC motor and the system is unknown, we perform the subspace system identification method. This procedure includes 3 steps. They are Data logging Model estimation Model validation Procedure is as follows.

Fig. 8 LabVIEW Block Diagram of System Identification of Closed Loop Speed Control System

From the speed control system, the actual speed (i.e.) the input (u) and the desired speed (i.e) output (y) are logged into the measurement file. From the measurement file, the input and the output are extracted. These extracted data are given to the split signal block for splitting the data into user defined proportions. The first proportion of data is given to the state space estimation.vi and the output will be the state space model of the system. This completes the model estimation stage. The identified model and is given as the input to the model simulation.vi, the output of the simulation and the real-time logged data are compared in waveform graphs. By changing the user defined order, the optimum model can be obtained and model validation is done.

Fig. 9 Model Simulation Output

The output state space model determined from the system identification procedure is as follows: A= B= C= D= We have chosen the order of the state space model as 2 because when the order is increased, the peak overshoot of the system increases. This makes the system more unstable sometimes and also by the theory of control system order of motor is 1 and when it is used in closed loop feedback system, the order becomes 2.

System identification block diagram and model simulation output are shown in Fig. 8 and Fig. 9 respectively.

IV.

CONCLUSION

In this paper we designed PID controller to control the speed of DC motor using Ziegler Nichols method .The parameters were tuned to meet the requirements of the quarter amplitude decay ratio and the state space model of the closed loop system is found by sub space or black box method in LabVIEW. The model estimated can be used in Model-Based controls.

ISBN 978-1-4675-2248-9 2012 Published by Coimbatore Institute of Information Technology

International Conference on Computing and Control Engineering (ICCCE 2012), 12 & 13 April, 2012 REFERENCES
[1] R.Isermann, Fault-diagnosis systems - An introduction from Fault Detection to Fault Tolerance, New York: Springer-Verlag, 2006, pp. 369390. [2] Guoshing Huang and Shuocheng Lee, PC-based PID speed control in DC motor, Audio, Language and Image Processing, 2008.ICALIP 2008. International Conference on, 2008, pp. 400 407. [3] LabVIEW PID Control Toolset User Manual, National Instruments, 2001. [4] Curtis D. Johnson, Process control instrumentation technology,PrenticeHall,2006 [5] LabVIEW DAQ USB-6008/6009 User Manual, National Instruments, 2008. [6]George Stephanopolous, Chemical process control- An Introduction to Theory and Practise, New Delhi: Prentice-Hall, 2009, pp.258-279,352-355. [7] LabVIEW System Identification Toolkit User Manual, National Instruments,2006.

ISBN 978-1-4675-2248-9 2012 Published by Coimbatore Institute of Information Technology

You might also like