Dc Motor Speed Control_2

8
 978-1-4244-1724-7/08/$25.00 ©2008 IEEE ICALIP2008 400 PC-based PID Speed Control in DC Motor Guoshing Huang, Shuocheng Lee  Department of Electronic Engineering, National Chin-Yi University of Technology, 35, Lane 215, Chung-Shan Rd., Sec. 1, Taiping, Taichung, Taiwan, 41111, ROC  E-mail:[email protected] Abstract This paper presents a LabVIEW-aided PID designed controller to monitor DC motor speed and uses the software simulation of VisSim to analysis its response. First, design the drive circuit of DC motor and as the feedback signal through the photo sensor and 8051 chip modules to produce rotational speed  signal, and show from SEG7 displays. To take out the analog signal through D/A converter at the same time, acquire the signal via the NI DAQ USB-6008 card. By the LabVIEW-aided PID controller, the parameters are adjusted to control the motor speed. The front  panel will display the speed of DC motor on the  screen. The simulati on results are quite match with the theoretical prediction for the behavior of the PID controller. In this proposed paper, it demonstrates the humanized operation interface that not only can replace the traditional instrument, but also facilitate the amateur engineer's operation under the remote control and monitor. 1. Introduction The DC motors have been popular in the industry control area for a long time, because they have many good characteristics, for example: high start torque characteristic, high response performance, easier to be linear control…etc.[1]. The different control approach depends on the different performance of motors. Because the peripheral control devices are enough, there is the more extensive application in the industry control system. Therefore, the DC motor control is riper than other kinds of motors no matter in the theoretic study or in the research and development of the application technology and internet, the measurement and the control system can be achieved  by PC-based today. However, the technique of instrument design also moves forward the times of “virtual instrument”, not only the designing time is shorten, but also the designing space is more elastic extension. This paper presents to guide the motor speed control field with the various advanced computer technology and the development platform of software/hardware. Let the dynamic state response of motor have a better efficiency. This paper is to design PID controller to supervise and control the speed response of the DC motor with the virtual instrument graphic monitor software LabVIEW. To control the speed of motor and display the changes of rotational speed of motor, the better response of the system can be obtained. By the NI USB-6008 [2] data acquisition (DAQ) card scratches the data of D/A converter to transmit the signal in real time to PC to be the speed response of DC motor real- time supervision. Because the DAQ card has the capability of the data storage and calculating, analysis and A/D, D/A conversion …etc., matches with the LabVIEW virtual instrument characteristic applying to detect the revolution of DC motor. This mode can substitute the traditional instruments, for instance, oscilloscope, signal generator, power supply … etc. and the test operation is convenient. It is not easy to be influenced by the component ageing and the maintain management…etc., and can be as the supervision basis of the machine normal operation or not. However, National Instruments increases the  productivity of engineers and scientists in developing test, control, and design systems by providing software  products for a wide range of functionality. NI LabVIEW is the graphical development environment for creating flexible and scalable test, measurement, and control applications rapidly and at minimal cost. Using LabVIEW, the interface between engineers and scientists with real-world signals, analyze data for meaningful information, and share results and applications. The intuitive block diagrams in NI LabVIEW make it be easy to develop the custom design applications while taking advantage of the PC

Transcript of Dc Motor Speed Control_2

Page 1: Dc Motor Speed Control_2

7/27/2019 Dc Motor Speed Control_2

http://slidepdf.com/reader/full/dc-motor-speed-control2 1/8

978-1-4244-1724-7/08/$25.00 ©2008 IEEE ICALIP2008400

PC-based PID Speed Control in DC Motor

Guoshing Huang, Shuocheng Lee Department of Electronic Engineering, National Chin-Yi University of Technology,

35, Lane 215, Chung-Shan Rd., Sec. 1, Taiping, Taichung, Taiwan, 41111, ROC

E-mail:[email protected]

Abstract

This paper presents a LabVIEW-aided PID

designed controller to monitor DC motor speed and

uses the software simulation of VisSim to analysis its

response. First, design the drive circuit of DC motor

and as the feedback signal through the photo sensor

and 8051 chip modules to produce rotational speed

signal, and show from SEG7 displays. To take out the

analog signal through D/A converter at the same time,

acquire the signal via the NI DAQ USB-6008 card. By

the LabVIEW-aided PID controller, the parameters

are adjusted to control the motor speed. The front

panel will display the speed of DC motor on the

screen. The simulation results are quite match with the

theoretical prediction for the behavior of the PID

controller. In this proposed paper, it demonstrates the

humanized operation interface that not only can

replace the traditional instrument, but also facilitate

the amateur engineer's operation under the remotecontrol and monitor.

1. Introduction

The DC motors have been popular in the industrycontrol area for a long time, because they have manygood characteristics, for example: high start torquecharacteristic, high response performance, easier to belinear control…etc.[1]. The different control approachdepends on the different performance of motors.Because the peripheral control devices are enough,there is the more extensive application in the industry

control system. Therefore, the DC motor control isriper than other kinds of motors no matter in thetheoretic study or in the research and development of the application technology and internet, themeasurement and the control system can be achieved by PC-based today. However, the technique of instrument design also moves forward the times of “virtual instrument”, not only the designing time is

shorten, but also the designing space is more elasticextension. This paper presents to guide the motor speed control field with the various advanced computer technology and the development platform of software/hardware. Let the dynamic state response of motor have a better efficiency.

This paper is to design PID controller to superviseand control the speed response of the DC motor withthe virtual instrument graphic monitor softwareLabVIEW. To control the speed of motor and displaythe changes of rotational speed of motor, the better response of the system can be obtained. By the NIUSB-6008 [2] data acquisition (DAQ) card scratchesthe data of D/A converter to transmit the signal in realtime to PC to be the speed response of DC motor real-time supervision. Because the DAQ card has thecapability of the data storage and calculating, analysisand A/D, D/A conversion …etc., matches with the

LabVIEW virtual instrument characteristic applying todetect the revolution of DC motor. This mode cansubstitute the traditional instruments, for instance,oscilloscope, signal generator, power supply … etc.and the test operation is convenient. It is not easy to beinfluenced by the component ageing and the maintainmanagement…etc., and can be as the supervision basisof the machine normal operation or not.

However, National Instruments increases the productivity of engineers and scientists in developingtest, control, and design systems by providing software products for a wide range of functionality. NILabVIEW is the graphical development environment

for creating flexible and scalable test, measurement,and control applications rapidly and at minimal cost.Using LabVIEW, the interface between engineers andscientists with real-world signals, analyze data for meaningful information, and share results andapplications. The intuitive block diagrams in NILabVIEW make it be easy to develop the customdesign applications while taking advantage of the PC

Page 2: Dc Motor Speed Control_2

7/27/2019 Dc Motor Speed Control_2

http://slidepdf.com/reader/full/dc-motor-speed-control2 2/8

401

for processing, display, and device connectivity[3][4][5][6].

The structure of this paper is mainly divided intothe DC motor speed control system, the mathematicmodel of DC motor and its control theory, the softwareand hardware program, the computer software

simulation results, actual measurement results andconclusions.

2. DC motor speed control system of the

structure

2.1 System structure

The speed control system of the DC motor is shownin Figure1. The main purpose is to link PC via USBtransmission line and data acquisition module (NIDAQ USB-6008), then control the motor system to

achieve the speed control of motor and analyze theresponse of the motor by software.

Fig. 1 The structure of speed control systemof DC motor.

2.2 System functional block diagram system

structure

This system is to generate a pulse signal through the

disc of the rotary shaft and the photo interrupt modulein DC motor. And compute the numbers of pulses received in unit time with 8051[7], then calculate thespeed of motor. We display the motor currently speedusing four SEG7 display, compare the output feedback signal with the input signal through D/A converter[8],then execute the parameter adjustment of the PIDcontroller through the designed program under the

LabVIEW environment in order to reduce the outputerror, as shown in Figure 2.

Fig. 2 PID speed control system of DC motorfunctional block diagram.

3. DC motor mathematics model and the

control theory

3.1 DC motor mathematic model

This DC motor system is a separately excited DCmotor, which is often used to the velocity tuning andthe position adjustment. This paper focuses on thestudy of DC motor linear speed control, therefore, theseparately excited DC motor is adopted. Make use of the armature voltage control method to control the DCmotor velocity, the armature voltage controls thedistinguishing feature of method as the flux fixed, isalso a field current fixedly. The control equivalentcircuit of the DC motor by the armature voltage controlmethod is shown in Figure 3.

Fig. 3 The control equivalent circuit of the DCmotor using the armature voltage control

method

where

aR : the armature resistance

aL : the armature inductance

ai : the armature current

f i: the field current

Page 3: Dc Motor Speed Control_2

7/27/2019 Dc Motor Speed Control_2

http://slidepdf.com/reader/full/dc-motor-speed-control2 3/8

402

ae: the input voltage

be: the back electromotive force (EMF)

Tm: the motor torque

ω : an angular velocity of rotor

J : rotating inertial measurement of motor bearing

B : a damping coefficient

Because the back EMF be is proportional to speed ω

directly, then

)t(ωK dt

)t(θdK )t(e b b b == (1)

Making use of the KCL voltage law can get

(t)edt

(t)diL(t)iR (t)e baaaaa ++= (2)

From Newton law, the motor torque can obtain

)t(iK dt

dB

dt

)t(dJ)t(T aT2

2

m =θ

=(3)

Take (1), (2), and (3) into Laplace transform,respectively, the equations can be formulated asfollows:

)s(E)s(I)sLR ()s(E baaaa ++= (4)

)s(ΩK )s(E b b = (5)

)s(IK )s(ΩJs)s(ΩB)s(TaTm =+= (6)

Fig. 4 describes the DC motor armature control systemfunction block diagram from equations (1) to (6).

Fig. 4 DC motor armature voltage control

system function block diagram

The transfer function of DC motor speed withrespect to the input voltage can be written as follows,

T baa

T

a K K )BJs)(R sL(

K

)s(E

)s(Ω)s(G

+++==

(7)

From equation (7) the armature inductance is verysmall in practices, hence, the transfer function of DCmotor speed to the input voltage can be simplified asfollows,

1sτ

K

)s(E

)s(Ω m

a += (8)

Where

T ba

Tm

K K BR

K K

+= is a motor gain,

T ba

a

K K BR

JR

+=τ is the motor time constant

From equation (8), the transfer function can be drawnthe DC motor system block diagram which is shown inFigure 5.

Fig. 5 Simplified block diagram of DC motorarmature voltage control system

3.2 PID control theory

The development of PID control theories has already60 years so far, PID control has been one of the controlsystem design method of the longest history. However,this method is still extensively used now[9][10][11][12]. The PID controller includes a proportional term, integral term and derivative term,where the proportional term is to adjust the output of

controller according to all of the magnitude of error,the integral term is used to remove the steady stateerror of control system and improve the steady stateresponse, the derivative term is used to predict a trendof error and improve the transient response of thesystem. These functions have been enough to the mostcontrol processes. Because the structure of PIDcontroller is simple, it is the most extensive controlmethod to be used in industry so far. The PIDcontroller is mainly to adjust an appropriate proportional gain (K P), integral gain (K I), anddifferential gain (K D) to achieve the optimal control performance. The PID controller system block diagram

of this paper is shown in Figure 6.

Page 4: Dc Motor Speed Control_2

7/27/2019 Dc Motor Speed Control_2

http://slidepdf.com/reader/full/dc-motor-speed-control2 4/8

403

Fig. 6 PID controller system block diagram

The relationship between the input e(t ) and outputu(t ) can be formulated in the fol lowing,

∫ +⋅+⋅=t

0DIP

dt

)t(deK dt)t(eK )t(eK )t(u (9)

The transfer function is expressed as fol lows,

sK s

K K

)s(E

)s(U)s(C D

IP ++== (10)

The controlled plant in this paper is a DC motor. ThePID DC motor speed control system block diagram isshown in Figure 7.

Fig. 7 PID DC motor speed control systemblock diagram

The closed loop transfer function of DC motor speed control system expresses as follows,

sτ1

K )SK

S

K K (1

sτ1

K )SK

S

K K (

)s(R

)s(Ω)s(G

mD

IP

mD

IP

++++

+++

==

mImP2

mD

mIP2

D

K K S)K K 1(S)τK K (

K )K SK SK (

++++

++= (11)

The system pattern is type1 in this case, the steadystate error ess= 0 which is with respect to the stepsignal input. The differential controller raises a K D value while the step signal inputs, then will let the

transient response of system become slow down. Itcannot improve a steady state error of system, has not a bigger function for the system. But this phenomenon isonly to limit in the first order control system. Theintegral controller can remove a steady state error while the step inputs, but it will be unstable if theintegral gain is excessive.

4. Hardware and software program

4.1 Structure of the hardware circuit

The hardware structure program in this paper isshown in Figure 8. Using the analog output port andthe analog input port (AO/AI) of the DAQ Card, sendout signal to the error detector in order to control thespeed of motor. At the same time, scratch Vo of D/Aconverter of the hardware circuit indicator on front panel, can control the DC motor rotational speed, and

analyze the systems response, as shown in Fig. 9.

Fig. 8 The structure of DC motor speed control

hardware system

Page 5: Dc Motor Speed Control_2

7/27/2019 Dc Motor Speed Control_2

http://slidepdf.com/reader/full/dc-motor-speed-control2 5/8

404

Fig. 9 PC-based speed monitor system

4.2 Monitor system design

The Design of this monitor system is used of PC andDAQ card as the speed measurement and control unitof the motor. Utilizing the LabVIEW software todesign the PID controller, applies on the DC motor speed control. All the monitor point status and thesetting of monitor condition all can be executed anddisplayed on the screen menu in real time. Figure 10shows the structure diagram of DC motor speed controlmonitor system. The interface between man andmachine of PC-Based PID DC motor speed controlsystem of this paper is shown in Figure 11, and the program block diagram is shown in Figure 12.

Fig. 10 The structure diagram of DC motorspeed control monitor system

Fig. 11 Front panel of PC-based PID DC motorspeed control system.

Fig. 12 Program block diagram of PC-basedPID DC motor speed control system

5. Simulation result of the software

In the following, apply the real gain of PID control parameters K P, K I, K D to VisSim build-in visionsoftware (Ker, D. S., 2004), simulate the PID control

of DC motor speed control system according to thehardware connected wire and the system function block diagram to draw the PID DC motor speedcontrol system and verify with the actual systemresponse. The simulation results of the response of PID speed control in DC motor are shown in Figure13(a)-(e).

Page 6: Dc Motor Speed Control_2

7/27/2019 Dc Motor Speed Control_2

http://slidepdf.com/reader/full/dc-motor-speed-control2 6/8

405

Fig.13 (a) The simulation response PID speedcontrol in DC motor for R=1, K

P=3, K

I=2, K

D=0.01

Fig.13 (b) The simulation response PID speed controlin DC motor for R=1, K

P=3, K

I=3, K

D=0.1

Fig.13 (c) The simulation response PID speed controlin DC motor for R=1, K

P=5, K

I=2, K

D=0.01

Fig.13 (d) The simulation response PID speed controlin DC motor for R=1, K

P=5, K

I=4, K

D=0.01

Fig.13 (e) The simulation response PID speed controlin DC motor for R=1, K

P=5, K

I=5, K

D=0.01

From above simulation response results shown asFigure 13.(a)-(e), we know when the system is joinedthe integral control, it can be accelerated the steadystate response time. To make use of simulation results,can be verified as a result of basis with the actualmeasurement.

6. Actual measurement results

This paper makes use of the PC-Based to be acontrol the interface with the LabVIEW softwaredesign program. With the PID controller, modulate the parameters. By adjusting the gains of the K P, K I, K D,acquire the best response of the satisfied system.Through the actual adjusting K P, K I, K D gains, theresponses of this system can be obtain under thedifferent condition. After we take the actual control parameters into VisSim to simulate, the results withactual response and theories are rather near.

The following is the experimental comparisonexplanation which is with respect to PID to physicallyadjust gains K P, K I and K D...etc. to voltage feedback

response diagram. The unit of the transversal axis isthe time (second) and unit of the ordinate axis is avoltage feedback response (V) as shown in Fig. 14. Inthese experimental results, the input command R isdefault to 1, in other words, the system response issteady in 1V. Figure 14(a)-(e) show the systemresponses of DC motor speed control by PID controlapproach.

Fig.14 (a) The response of the DC motor speedcontrol for R=1, K

P=3, K

I=2, K

D=0.01

Page 7: Dc Motor Speed Control_2

7/27/2019 Dc Motor Speed Control_2

http://slidepdf.com/reader/full/dc-motor-speed-control2 7/8

406

Fig.14 (b) The response of the DC motor speedcontrol for R=1, K

P=3, K

I=3, K

D=0.1

Fig.14 (c) The response of the DC motor speed controlfor R=1, K

P=5, K

I=2, K

D=0.01

Fig.14 (d) The response of the DC motor speedcontrol for R=1, K

P=5, K

I=4, K

D=0.01

Fig.14 (e) The response of the DC motor speed

control for R=1, KP

=5, KI=5, K

D=0.01

To compare with Figure 14 (a) to (e), can berelatively obtain, if raise K P then can get a quicker transient response, and can reduce a steady state error of the system in PID controller. To raise K D, will make

the transient response become slower, but cannotimprove a steady state error. Raising the K I can remove

a margin of the steady state error. Through the

experimental results, we can know that the system will produce an unstable phenomenon when K P is greater than 7, K I is greater than 8. Therefore, the best control

parameters of this system are chosen as R=1, K P =5,K I=5, K D=0.01.

7. Conclusions

This paper proposes to design PID controller tocontrol the speed of DC motor using the LabVIEWsoftware program, and display the speed of motor inreal-time in order to obtain the system response of PIDcontroller. Then assist this system to simulate with thesoftware of VisSim. Because the DAQ card has thecapabilities of data scratch and transmission, matcheswith the LabVIEW virtual instrument characteristicand analysis. The real-time monitor of application onthe motor not only can substitute the traditionalinstrument but also can be as the monitor basis of themachine operating normally or not. This programmingsystem is based on a structure of the PC, and combinesthe DC motor supervision needed instrument, and thenreplaces other hardware equipments with the cheaper and more efficient method to provide operators withthe graphical interface of an easy and kind operation. Through the actual tuning K P, K I, K D gains, theresponses of this system can be obtained under thedifferent condition. After the actual control parameterstransfer into VisSim for simulation, to compare theresults of actual response with its theory is rather near.

The development system can be set up afundamental to supervise and control the outdoor factory from the indoor office. We can supervise andcontrol all motors in the factory or instrumentequipment indoors, and also monitor the factoryoperational condition from the outside. In other words,this system can monitor the motor currently, and alsocan join all equipments which are desired to superviseand control to perform a whole supervision system inearly future.

8. References

[1] Wang, J. B., Control of Electric Machinery. Gau LihBook co., Ltd, Taipei Taiwan, 2001.

[2] DAQ USB-6008 User Manual., National Instruments,1999

[3] Shiau, T. J., J. L. Wang and S. W. Chu., ProgramDesign of Virtual Instrument Control LabVIEW 7X.Gau Lih Book co., Ltd, Taipei Taiwan, 2004

Page 8: Dc Motor Speed Control_2

7/27/2019 Dc Motor Speed Control_2

http://slidepdf.com/reader/full/dc-motor-speed-control2 8/8

407

[4] Liau, J. C., A Study of LabVIEW Aided in DC Motor

Speed Monitoring System. National Taiwan OceanUniversity Department of Mechanical & MechatronicEngineering, 2000.

[5] LabVIEW Basics I Course Manual., National

Instruments, 1999.

[6] Srinivasan, M. B., A. Shirkhodaie, and M. Malkani,LabVIEW program design for on-linedataacquisionand dpredictive maintenance. Proceedings of theThirtieth IEEE Souteastern Symposinm on SystemTheory, 1998, pp.520-524.

[7] Li, K. Y., S. S. Huang and R. C. Chen, 8051/52Application of Microcontroller. Skinfo Book co., Ltd,Taipei Taiwan, 1998.

[8] Deng, M. F., Application of ISP Single Chip

Microcomputer. Knowledge and Execution Co., Ltd.Taichung, Taiwan, 2002.

[9] Yang, K. C., Remote Fuzzy Control in DC Motor Speed Monitoring System. National Taiwan OceanUniversity Department of Mechanical & MechatronicEngineering, 2001.

[10] Huang, J. M., University Automatic Control,University City Books Enterprise Inc, KaohsiungTaiwan, 2004.

[11] Baek, S. M. and T. Y. Kuc., “An adaptive PID learning

control of DC motor ”, IEEE International , Volume.3,

1997, pp.2877-2882.

[12] Ker, D. S., Automatic Control Simulation Analysis.Gau Lih Book co., Ltd, Taipei, Taiwan, 2004.