Professional Documents
Culture Documents
Engineering
Journal
Al-Khwarizmi Engineering Journal, Vol. 10, No. 1, P.P. 72- 82 (2014)
Abstract
In this paper, the speed control of the real DC motor is experimentally investigated using nonlinear PID neural
network controller. As a simple and fast tuning algorithm, two optimization techniques are used; trial and error method
and particle swarm optimization PSO algorithm in order to tune the nonlinear PID neural controller's parameters and to
find best speed response of the DC motor. To save time in the real system, a Matlab simulation package is used to carry
out these algorithms to tune and find the best values of the nonlinear PID parameters. Then these parameters are used in
the designed real time nonlinear PID controller system based on LabVIEW package. Simulation and experimental
results are compared with each other and showed the effectiveness of the proposed control algorithm in terms of fast
and smooth dynamic response for the speed control of the real DC motor.
Keywords: Nonlinear PID Controller, DC Motor, Particle Swarm Optimization, Neural Networks, MATLAB, LabVIEW.
and it was applied to control the speed of a three, the proposed nonlinear PID neural
nonlinearized DC motor and the control algorithm controller approach and tuning algorithm are
was that it covers the situation where the magnetic derived. The simulation results (MATLAB) of the
flux continuously varies was presented in [7]. proposed controller are presented in section four.
In addition to that, DC series motors were Hardware design and real time results based on
preferred for mechatronic applications requiring LabVIEW package are presented in section five
high torque/speed ratios. The design and and the conclusions are drawn in section six.
implementation of an open loop DC motor speed
control that was based on a micro-controller and
Insulated-Gate_Bipolar_Transistor (IGBT) drive 2. Permanent Magnet DC Motor Model
stage that can predict the dynamic behavior of
systems consisting of mechanical and electronic A permanent magnet DC motor model can be
modules was very desirable as explained in [8]. derived using the linear dynamic equations with a
There is other technique for speed control of two mass model equivalent system [10]:
the DC motor, a new method of tuning dia
Proportional Integral (PI) coefficients for a va Raia La Kbm (1)
dt
permanent magnet DC motor drives was
explained in [9], where artificial neural network dwm (2)
Jm Bmm m Kt ia
was used to identify the whole system using dt
maximum overshoot and settling time. where
The fundamental essence of the motivation of Ra, La, Kb, Kt are the DC motor parameters.
this work is that the tuning of the nonlinear PID va, ia are the DC motor voltage and current
controller in the real time requires a great effort respectively.
and needs more time; therefore, the nonlinear PID m is motor speed.
controller is first carried out using the Matlab m the motor torque.
simulation package which is very time saving and Jm the motor inertia.
gives close parameter approximation for Bm the damping coefficient.
application in the real time system based on By taking the Laplace transformation of the
LabVIEW package at the end. equations (1 and 2).
In this paper, experimental investigation is
carried out for the appropriate tuning parameters Va (s) Ra I a (s) La SI a (s) Kbm (s) (3)
of the nonlinear PID neural controller that where
controls the speed of a DC motor using two Kbm (s) is e.m.f.
techniques: trial and error method and PSO to
obtain the best speed response achievable based Va (s) Kbm (s) I a (s)( Ra La S ) (4)
on a Matlab simulation package. These
parameters are then applied in the designed real J m Sm (s) Bmm (s) m (s) Kt I a (s) (5)
time nonlinear PID controller based on LabVIEW (6)
m (s)( J m S Bm ) m (s)
package and the results obtained are compared
against those of the simulation. The block diagram of the DC motor model is
The remainder of this paper is organized as shown in Fig. 1.
follows: section two, describes the mathematical
model of the DC motor speed system. In section
Kb
73
Ahmed Sabah Al-Araji Al-Khwarizmi Engineering Journal, Vol. 10, No. 1, P.P. 72- 82 (2014)
Particle Swarm
Optimization
Algorithm
Kp Ki Kd
Desired Speed
Speed e(k) Nonlinear PID Output
Controller u(k) Gain mapping DC Motor
+ Model
-
u(k-1)
The proposed nonlinear PID neural controller The proposed nonlinear PID neural controller
has the characteristics of control agility, strong scheme is based on the discrete-time PID as
adaptability, good dynamic characteristic and equation (8).
robustness because it is based on a conventional u(k ) u(k 1) Kp[e(k ) e(k 1)] Ki[e(k )]
PID controller that consists of three terms:
Kd[e(k ) 2e(k 1) e(k 2)] (8)
proportional, integral and derivative where the
standard form of a PID controller is given in the s- Therefore, the tuning PID input vector consists of
domain as equation (7) [12]. e(k ) , e(k 1) , e(k 2) and u(k 1) , where e(k ) and
Ki (7) u (k 1) denote the input error signals and the PID
Gc(s) P I D K p Kd s
s output signal respectively.
where Kp, Ki and Kd are called the proportional The nonlinear PID neural controller for speed
of DC motor system can be shown in Fig. 3.
gain, the integral gain and the derivative gain
respectively.
74
Ahmed Sabah Al-Araji Al-Khwarizmi Engineering Journal, Vol. 10, No. 1, P.P. 72- 82 (2014)
Scaling Factor
u(k 1) +1
+1
Kp
e(k ) +
-1
+1
Ki O u (k )
e(k 1)
-2 +1
+ H
+1
Kd
e(k 2)
+
The proposed control law of the feedback The nonlinear PID neural controller with nine
control signal ( u ) can be proposed as follows: weights parameters and the matrix is rewritten as
an array to form a particle. Particles are then
u(k ) 5O (9)
initialized randomly and updated afterwards
o is the output of the neural network that can be according to equations (12, 13, 14, 15, 16 and 17)
obtained from non-linear sigmoid activation in order to tune the PID parameters:
function and multiple by scaling factor that is Kpmk 1 (Kpmk ) c1r1 ( pbest mk Kpmk ) c2 r2 ( gbest k Kpmk )
equal to 5. The nonlinear relationship of the (12)
sigmoid function can be presented in the
following equation: Kpmk 1 Kpmk Kpmk 1 (13)
o
2
1 (10) Kimk 1 (Kimk ) c1r1 ( pbest mk Kimk ) c2 r2 ( gbest k Kimk )
1 e net
(14)
net is calculated from this equation:
Kimk 1 Kimk Kimk 1 (15)
net (k ) Kp[e(k ) e(k 1)] Kie(k )
Kd mk 1 (Kd mk ) c1r1 ( pbest mk Kd mk ) c2 r2 ( gbest k Kd mk )
Kd[e(k ) 2e(k 1) e(k 2)] ...(11)
(16)
The control parameters Kp, Ki and Kd of the
Kd k 1
Kd Kd
k k 1
(17)
nonlinear PID neural controller are adjusted using m m m
...(18)
75
Ahmed Sabah Al-Araji Al-Khwarizmi Engineering Journal, Vol. 10, No. 1, P.P. 72- 82 (2014)
where N is the number of samples and equal to the motor speed by 1 rad/sec with reference to its
1000. speed at the initial condition which is equal to
The number of dimension in particle swarm zero rad/sec. The settling time for the speed of the
optimization is equal to three because the DC motor is equal to 1.2sec and the time constant
nonlinear PID has three parameters. The mean is equal to 0.082sec. Therefore the sampling
square error function is chosen as criterion for interval for the DC motor speed control is chosen
estimating the model performance as in equation to be 0.01sec using Shannon theory.
(18).
The steps of PSO for nonlinear PID neural
1.2
controller can be described as follows:
1
Step1 Initial searching points
76
Ahmed Sabah Al-Araji Al-Khwarizmi Engineering Journal, Vol. 10, No. 1, P.P. 72- 82 (2014)
From the simulation results, the closed loop The error between the desired speed and the
time response of the DC motor speed control actual speed output of the DC motor is shown in
system with nonlinear PID neural controller based Fig. 5c and it is very small in the transient and
on PSO algorithm is illustrated in Figs. 5a, 5b and becomes very close to zero in steady state.
5c for the initial speed of zero rad/sec.
6
14
Actual Speed Output
Desired Speed 4
12
Speed of DC Motor (rad/sec)
8
0
6
-2
4
-4
2
-6
0 0 1 2 3 4 5 6 7 8 9 10
0 1 2 3 4 5 6 7 8 9 10 Samples (sec)
Samples (sec)
Fig. 5a. The speed output of the DC motor. Fig. 5c. The speed error.
8
with trial and error method in terms of time saving
6 and obtaining an optimal control parameters of the
nonlinear PID neural controller with best speed
4
response.
2
Fig. 5b. The control action. In this section, the experimental setup for the
real-time speed control of the DC motor is shown
in Fig. 6. The setup consists of:
Figure 5a shows the response of the DC motor
speed output to a steps change, it had small over The permanent magnet DC motor and DC
shoot at first step (2.82) rad/sec and no over Tacho generator with a sensitivity figure equal
shoots in the other steps as well as the steady-state to 20mV/rad/sec. The motor has a speed range
error is equal to zero in each steps when the of operation "0 rad/sec to 26 rad/sec".
desired change in speed is (25, 75, 125, 75 and DC power supply that provides power to the
25) r.p.m as (2.84, 8.52, 14.2, 8.52 and 2.84) motor and the rest of the circuitry.
rad/sec respectively. The data acquisition device from National
The nonlinear PID neural control action Instrument NI Company.
response is shown in Fig. 5b that it had few spikes Motor drive board based on LM324
in response to the desired step change in motor operational amplifiers.
speed with very small oscillation in order to keep
the speed output of the DC motor within desired
range.
77
Ahmed Sabah Al-Araji Al-Khwarizmi Engineering Journal, Vol. 10, No. 1, P.P. 72- 82 (2014)
Front Panel
Diagram of
LabVIEW
Package
NI-DAQmx-USB
6009 Device
Electronic Circuit Digital AVO Meter
In the real time computer control system based controller with sampling time equal to 0.01sec.
on LabVIEW package, the fine tuned parameters The computer code and front panel diagram of the
of the nonlinear PID neural controller that have control algorithm have been written in the
been obtained from the simulation based on PSO LabVIEW, as shown in Fig. 7.
algorithm are applied in the real time computer
Fig. 7. LabVIEW control algorithm (a) Front panel diagram; (b) Computer code program.
78
Ahmed Sabah Al-Araji Al-Khwarizmi Engineering Journal, Vol. 10, No. 1, P.P. 72- 82 (2014)
Figure 8 shows the electronic circuit diagram components possible to occur in the sensor
design for the speed control system and it consists outputs especially within mains supply frequency
of multi-stage as follows: the first stage is signal at 50Hz. This filter removes noise components
conditioning circuit that includes a voltage within mains frequency effectively from the
follower with unity gain to avoid the attenuation Tacho generator output prior to delivering it to the
in the feedback signal of the Tacho generator and level conditioning amplifier with unity gain. This
the first order low pass filter stage that has a amplifier is built using LM324 quad operational
cutoff frequency of 10Hz which will remove noise amplifier [15].
Bus1 Bus1Bus1
Bus3 11
11 U1A 9 U1C
Signal from 2
R1 8
VCC 12V
R10
4k
11 U2B
6
7
C3 DZ
5volt 50% 5
10F 10k 4
LM324AD
Key=A
The output of this amplifier is fed to the analog The output of this amplifier is fed to the motor
to digital converter ADC 14 bit high speed low drive stage to furnish the final output required to
power successive approximation converter of the drive the DC motor as sixth stage. The motor
NI-DAQmx-USB 6009 device with range of input accepts drive voltages ranging from "0V to 12V"
voltage from 0 to 5 volt as second stage. which will drive the motor through the speed
Inside the personal computer, LabVIEW range of "0 rad/sec to 26 rad/sec".
software instructions compares the sensed speed The speed response of the DC motor in real
signal received via this interface with the set point time is shown in Fig.9a. It can be seen that it is a
desired speed. The resulting error is given as an fast response with oscillation output value in the
input to the nonlinear PID neural controller that range of ( 0.02(rad / sec)) .
has been built in the LabVIEW package. The response of the feedback nonlinear PID
The nonlinear PID neural controller attempts neural control action is shown in Fig. 9b. It has
to reduce the error to zero by changing the control many spikes during the step change in the desired
action input voltage to the DC motor which is in speed and a small oscillation can also be
the form of real data varying within "0 to 5". observed. This action of the controller has kept
These data are sent to the motor drive electronics the speed of the DC motor within the desired
through the USB connector to digital to analog value with minimum tracking speed error.
converter DAC 12 bit of the NI-DAQmx-USB The tracking error between the desired speed
6009 device with range of output voltage from 0 and the actual speed output of the DC motor
to 5 volt as third stage. The output of this DAC is which was very small in the transient state and
sent to an op-amp based amplifier that has a gain had steady state value equal to 0.02(rad / sec)) , is
of "2.4" as fourth stage. shown in Fig. 9c.
This amplifier is also built using LM324 In fact, there are small differences in results
operational amplifier. To remove the nonlinear between the real time control action and the
effect dead zone in the modeling of the DC simulation control action because in the real time
motor system, a small dc drive voltage is added to there were accumulation errors such as
the motor in order to minimize its effect as shown undesirable characteristics of speed sensor (tacho
in the motor drive electronic circuit design in the generator) "non-linearity, drift, and offset", offset
fifth stage.
79
Ahmed Sabah Al-Araji Al-Khwarizmi Engineering Journal, Vol. 10, No. 1, P.P. 72- 82 (2014)
in the operational amplifier output, and the the actual speed output of the DC motor as it is
quantization error of the analog to digital and equal to 0.02(rad / sec)) .
digital to analogue converters; therefore, the .
results in the real time have small oscillation in
Fig. 9. (a) Actual speed of DC motor; (b) Actual control action; (c) Speed error of DC motor.
80
Ahmed Sabah Al-Araji Al-Khwarizmi Engineering Journal, Vol. 10, No. 1, P.P. 72- 82 (2014)
81
10 1 )2014( 82 -72
/
ahmedsas2040@yahoo.com :
.
.
, ( )Matlab
(.)LabVIEW
.
82