Content uploaded by Desineni Subbaram Naidu
Author content
All content in this area was uploaded by Desineni Subbaram Naidu on Nov 07, 2014
Content may be subject to copyright.
Experimental Validation for Real Time Control of
DC Motor Using Novel FiniteHorizon Optimal
Technique
Ahmed Khamis
Department of Electrical Engineering
Idaho State University
Pocatello, Idaho, USA
Email: khamahme@isu.edu
D. Subbaram Naidu
Department of Electrical Engineering
Idaho State University
Pocatello, Idaho, USA
Email: naiduds@isu.edu
Abstract—DC motors are widely used in industrial applica
tions. Controlling of DC motor is a great challenge for control
engineers. Precise equations describing DC motors are nonlinear.
Accurate nonlinear control of the motion of the DC motors
is required. In this paper, a novel online technique for ﬁnite
horizon nonlinear tracking problems is presented. The idea of
the proposed technique is the change of variables, that converts
the nonlinear differential Riccati equation to a linear Lyapunov
differential equation. The proposed technique is effective for a
wide range of operating points. Simulation results and experi
mental implementation of a DC motor are given to illustrate the
effectiveness of the proposed technique.
I. INT RO DU CTION
The need to improve performance in control systems re
quires more and more accurate modeling. However, if a model
is a good representation of the real system over a wide range
of operating points, it is most often nonlinear [1]. Traditional
technique to control, nonlinear systems is to linearize the
nonlinear system in a small region around the operating point
and then design linear controllers. These controllers with
constant gains can be expected to perform satisfactorily in the
neighborhood of the operating point. However, they may not
be capable of dealing with a situation over a large range of
operating points.
The competitive era of rapid technological change has
motivated the rapid development of nonlinear control theory
for application to challenging, complex dynamical realworld
problems [2]. There exist many nonlinear control design
techniques, each has beneﬁts and weaknesses. Most of them
are limited in their range of applicability, and use of certain
nonlinear control technique for a speciﬁc system usually
demands choosing between different factors, e.g. performance,
robustness, optimality, and cost. Some of the wellknown non
linear control techniques are feedback linearization, adaptive
control, nonlinear predictive control, sliding mode control,
and approximating sequence of Riccati Equations. One of
the highly promising and rapidly emerging techniques for
nonlinear optimal controllers designing is the State Dependent
Riccati Equation (SDRE) technique [3]. The SDRE technique
can be used for regulation or tracking of inﬁnitehorizon
nonlinear systems [4]. The SDREbased techniques have very
important properties, such that applicability to a large class
of nonlinear systems, and the control designer opportunity to
make tradeoffs between the state errors and the control effort
[1].
In this paper, we address the problem of ﬁnitehorizon
position control of a permanent magnet DC motor based on the
nonlinear system dynamics. A novel technique for tracking of
ﬁnitehorizon nonlinear systems is utilized. This technique is
based on the change of variable [5], that converts the nonlinear
differential Riccati equation (DRE) to a linear differential
Lyapunov equation [6], which can be solved in real time at
each time step [7]. Hardware in the loop Simulation (HILS)
system using a real DC motor is used to validate the theoretical
analysis.
The remainder of this paper is organized as follows: the
nonlinear mathematical model of the DC motor is discussed in
Section II. Section III presents the nonlinear tracking technique
via ﬁnitehorizon SDRE. In Section IV, the HILS setup is
presented. Simulation results and experimental validation are
discussed in Section V. Finally, the conclusions of this paper
are given in Section VI.
II. MO DELIN G
The DC motor used in this paper is carbonbrush permanent
magnet 12v DC motor (see Fig. 1). The system model is shown
in Fig. 2, where Ris the armature resistance, Lis the armature
inductance, Vis the voltage applied to the motor, iis the
current through the motor, eis the back emf voltage, Jis
the moment of inertia of the load, Bis the viscous friction
coefﬁcient,
τ
is the torque generated by the motor,
θ
is the
angular position of the motor,and
ω
is the angular velocity of
the motor.
The dynamic equations for the DC motor are:
ω
(t) = d
θ
(t)
dt ,(1)
V(t) = Ldi(t)
dt +Ri(t) + kw
ω
(t),(2)
kii(t) = Jd
ω
(t)
dt +B
ω
(t) +Csgn(
ω
),(3)
where kwis the back emf constant, kiis the torque constant of
the motor, and Cis the motor static friction.
9781479936687/14/$31.00 © 2014 IEEE
67
The 4th Annual IEEE International Conference on
Cyber Technology in Automation, Control and Intelligent Systems
June 47, 2014, Hong Kong, China
Fig. 1. Permanent Magnet DC Motor
Fig. 2. Permanent Magnet DC Motor System Model
The signum function sgn(
ω
)is deﬁned as
sgn(
ω
) = (−1 for
ω
<0
0 for
ω
=0
1 for
ω
>0
(4)
or it can be written in this form:
sgn(
ω
) = 
ω

ω
.(5)
The nonlinear state equations can be written in the form:
˙x1=x2,(6)
˙x2=−B
J−−C
Jx2x2+ki
Jx3,(7)
˙x3=−kw
Lx2−R
Lx3+1
Lu,(8)
y=x1,(9)
where:
θ
=x1,˙
θ
=x2,i=x3,V=u.
III. NON LI NE AR FINIT EHO RIZ ON TR AC KI NG US ING
SDRE
Finitehorizon optimal control of nonlinear systems is a
challenging problem in the control ﬁeld due to the complexity
of timedependency of the Hamilton JacobiBellman (HJB)
differential equation. In ﬁnitehorizon optimal nonlinear con
trol problem, the DRE can not be solved in real time by
backward integration from tfto t0because we do not know
the value of the states ahead of present time step. To overcome
the problem, an approximate analytical approach is used [8]
to convert the original nonlinear Ricatti equation to a linear
differential Lyapunov equation that can be solved in closed
format each time step.
A. Problem Formulation
The nonlinear system considered in this paper is assumed
to be in the form:
˙
x(t) = f(x) + g(x)u(t),(10)
y(t) = h(x).(11)
That nonlinear system can be expressed in a statedependent
like linear form, as:
˙
x(t) = A(x)x(t) + B(x)u(t),(12)
y(t) = C(x)x(t),(13)
where f(x) = A(x)x(t),B(x) = g(x),h(x) = C(x)x(t).
Let z(t)be the desired output. The goal is to ﬁnd a state
feedback control law that minimizes a cost function given by
[9]:
J(x,u) = 1
2e0(tf)Fe(tf)(14)
+1
2Ztf
t0e0(t)Q(x)e(t) + u0(x)R(x)u(x)dt,
where e(t) = z(t)−y(t),Q(x)and Fare symmetric positive
semideﬁnite matrices, and R(x)is a symmetric positive def
inite matrix. Moreover, x0(t)Q(x)x(t)is a measure of control
accuracy and u0(x)R(x)u(x)is a measure of control effort [1].
B. Solution for FiniteHorizon SDRE Tracking
To minimize the above cost function (14), a feedback
control law can be given as
u(x) = −R−1(x)B0(x)[P(x)x(t)−g(x)],(15)
where P(x)is a symmetric, positivedeﬁnite solution of the
statedependent Differential Riccati Equation (SDDRE) of the
form
−˙
P(x) = P(x)A(x) + A0(x)P(x)(16)
−P(x)B(x)R−1B0(x)P(x) + C0(x)Q(x)C(x),
with the ﬁnal condition
P(x,tf) = C0(tf)FC(tf).(17)
The resulting SDREcontrolled trajectory becomes the solution
of the statedependent closedloop dynamics
˙x(t) = [A(x)−B(x)R−1(x)B0(x)P(x)]x(t)(18)
+B(x)R−1(x)B0(x)g(x),
where g(x)is a solution of the statedependent non
homogeneous vector differential equation
˙g(x) = −[A(x)−B(x)R−1(x)B0(x)P(x)]0g(x)(19)
−C0(x)Q(x)z(x),
with the ﬁnal condition
g(x,tf) = C0(tf)Fz(tf).(20)
As the SDRE function of (x,t), we do not know the value of
the states ahead of present time step. Consequently, the state
dependent coefﬁcients cannot be calculated to solve (16) with
the ﬁnal condition (17) by backward integration from tfto t0.
To overcome this problem, an approximate analytical approach
68
is used [5], [6], [7]. which converts the original nonlinear
Ricatti equation to a linear differential Lyapunov equation.
At each time step, the Lyapunov equation can be solved in
closed form. In order to solve the DRE (16), and the non
homogeneous differential equation (19), one can follow the
following steps:
•Solve Algebraic Riccati Equation (ARE) to calculate
the steady state value Pss (x)
Pss(x)A(x) + A0(x)Pss (x)−
Pss(x)B(x)R−1(x)B0(x)Pss(x) + Q(x) = 0.(21)
•Use change of variables technique and assume that
K(x,t) = [P(x,t)−Pss(x)]−1.
•Calculate the value of Acl (x)as
Acl(x) = A(x)−B(x)R−1B0(x)Pss (x).
•Calculate the value of Dby solving the algebraic
Lyapunov equation [10]
AclD+DA0
cl −BR−1B0=0.(22)
•Solve the differential Lyapunov equation
˙
K(x,t) = K(x,t)A0
cl(x) + Acl(x)K(x,t)(23)
−B(x)R−1(x)B0(x).
The solution of (23) is given by [11]
K(t) = eAcl(t−tf)(K(x,tf)−D)eAcl0(t−tf)+D.(24)
•Calculate the value of P(x,t)from the equation
P(x,t) = K−1(x,t) + Pss(x).(25)
•Calculate the steady state value gss(x)from the equa
tion
gss(x) = [A(x)−B(x)R−1(x)B0(x)Pss(x)]0−1(26)
C0(x)Q(x)z(x).
•Use change of variables technique and assume that
Kg(x,t) = [g(x,t)−gss(x)].
•Solve the differential equation
Kg(t) = e−(A−BR−1B0P)0(t−tf)[g(x,tf)−gss(x)].(27)
•Calculate the value of g(x,t)from the equation
g(x,t) = Kg(x,t) + gss(x).(28)
•Calculate the value of the optimal control u(x,t)as
u(x,t) = −R−1(x)B0(x)[P(x,t)x(t)−g(x,t)].(29)
Fig. 3 summarized the overview of the process of ﬁnite
horizon SDDRE tracking technique
Note : It is easily seen that this technique with ﬁnitehorizon
SDDRE can be used for linear systems and the resulting
SDDRE becomes the standard DRE [9].
Fig. 3. Overview of The Process of FiniteHorizon SDDRE Tracking
IV. HARDWAR E INTHE LOOP SI M UL ATIO N
Traditional softwarebased simulation has the disadvantage
of being unable to accurately imitate real operational envi
ronment. One way to bridge the gap between simulation and
real conditions is the HILS. Realtime HILS replaces some
simulation models of a system by one or several real hardware
subsystems, that interacts with the computer models. This
increases the realism of the simulation and provides access
to some features not accessible in softwareonly simulation
models [12].
The basic principle of HILS is that some subsystems are
physically embedded within a realtime simulation model.
Realtime means the simulation of each component performed
such that input and output signals show the same time depen
dent values as in real world dynamic operation. In HILS, the
embedded system is fooled into thinking that it is operating
with real world inputs and outputs, in realtime. A computer
software with realtime simulation capabilities and communi
cation abilities is necessary to perform HILS [13].
This section describes the HILS setup and the implemen
tation of the ﬁnitehorizon SDRE designed in Section III to
control the DC motor given its mathematical model in Section
II.
A. Hardware In The Loop Simulation Setup
The experimental setup used in this paper, as shown in Fig.
4, consists of a Hilink microcontroller board manufactured by
Zeltom Educational and Industrial Control System Company
[14], a corresponding Simulink library for Matlab/Simulink,
DC motor with encoder, and current sensor. The realtime
control board is based on a dsPIC30F2012 digital signal
controller. It has a total number of 8x16 bit inputs and 8x16
69
Fig. 4. Hardware In The Loop Experimental Setup
bit outputs capability. The board is interfaced to the main
computer that runs Matlab through a serial port. The HILINK
platform offers a seamless interface between physical plants
and Matlab/Simulink for implementation of hardwareinthe
loop realtime control systems and it is fully integrated into
Matlab/Simulink.
V. SIMULATIO N AN D EXPERIME NTAL RESULTS
In this section simulation results in Matlab/Simulink are
presented and compared with the realtime hardware exper
imental results via experimental setup illustrated in Section
IV. Thus, the veriﬁcation of our proposed method is more
effective.
A. Simulation Results
The system nonlinear state equations of the DC motor (68)
can be rewritten in state dependent form:
"˙x1
˙x2
˙x3#=
0 1 0
0−B
J−−C
Jx2ki
J
0−kw
L−R
L
"x1
x2
x3#+
0
0
1
L
u,(30)
where:
θ
=x1,˙
θ
=x2,i=x3,V=u.
Let the reference angle is
z(t) = 90o,(31)
and the selected weighted matrices are
Q=diag(60,0,0),R=0.7,F=diag(1,1,1).(32)
The simulations are performed for ﬁnal time of 10 seconds
and the resulting angle trajectories is shown in Fig. 5, where
the dashdot line denotes the reference angle trajectory, and the
solid line denotes the actual trajectory. The optimal control is
shown in Fig. 6.
Comparing these trajectories in Fig. 5, it’s clear that the
propose algorithm gives very good results as the actual optimal
angle is making a very good tracking to the reference angle
with standard deviation error of 0.02o, which is acceptable in
that system.
012345678910
−10
0
10
20
30
40
50
60
70
80
90
100
Time [sec]
Optimal Angles [deg]
Actual Angle
Desired Angle
Fig. 5. Optimal Position Tracking for The Simulated DC Motor
012345678910
−25
−20
−15
−10
−5
0
5
10
15
20
25
Time [sec]
Optimal Control [V]
Fig. 6. Optimal Control Voltage for The Simulated DC Motor
B. Experimental Results
Once the algorithms have been developed and tested in
software, the next step is to bridge the gap between software
simulation and real world applications. Here, the method of
HILS is applied by using the experimental setup introduced in
Section IV.
A schematic diagram of the experimental setup is given
in Fig. 7. The experiment is performed for ﬁnal time of 10
seconds and the resulting angle trajectories is shown in Fig. 8,
where the dashdot line denotes the reference angle trajectory,
and the solid line denotes the actual trajectory. Comparing
these trajectories in Fig. 8, it’s clear that the propose algorithm
gives very good results as the actual optimal angle is making
a very good tracking to the reference angle with standard
deviation error of 0.025o.
For further demonstration, the performance of the DC
motor with the ﬁnitehorizon SDRE controller to track a multi
step reference is shown in Fig 9. It can be seen that the
controller gives almost the same performance regardless the
value of the step reference.
70
Fig. 7. Hardware In The Loop Simulation Schematic Diagram
Fig. 8. Optimal Position Tracking for The HILS System
VI. CON CL US IO N
The paper presented a new ﬁnitehorizon tracking tech
nique for nonlinear systems. This technique based on change
of variables that converts the nonlinear differential Riccati
equation to a linear Lyapunov equation.The Lyapunov equation
is solved in a closed form at the given time step. The consis
tency of the experimental results with the simulation results
demonstrates the effectiveness of the developed technique.
REFEREN CE S
[1] T. C¸ imen, “Survey of statedependent Riccati equation in nonlinear op
timal feedback control synthesis,” AIAA Journal of Guidance, Control,
and Dynamics, vol. 35, no. 4, pp. 1025–1047, 2012.
[2] ——, “Recent advances in nonlinear optimal feedback control design,”
Proceedings of the 9th WSEAS International Conference on Applied
Mathematics, Istanbul, Turkey, pp. 460–465, May 2006.
[3] J. R. Cloutier, “Statedependent Riccati equation techniques: An
overview,” Proc. American Control Conference, vol. 2, pp. 932–936,
1997.
[4] T. C¸ imen, “Development and validation of a mathematical model for
control of constrained nonlinear oil tanker motion,” Mathematical and
Computer Modeling of Dynamical Systems, vol. 15, no. 1, p. 1749,
2009.
[5] T. Nguyen and Z. Gajic, “Solving the matrix differential riccati equa
tion: a Lyapunov equation approach,” IEEE Trans. Automatic Control,
vol. 55, no. 1, pp. 191–194, 2010.
[6] J. Nazarzadeh, M. Razzaghi, and K. Nikravesh, “Solution of the
matrix Riccati equation for the linear quadratic control problems,”
Mathematical and Computer Mo delling, vol. 27, no. 7, pp. 51–55, 1998.
[7] A. Khamis and D. Naidu, “Nonlinear optimal tracking using ﬁnite
horizon state dependent Riccati equation ( SDRE),” Proceedings of
the 4th International Conference on Circuits, Systems, Control, Signals
(WSEAS), pp. 37–42, August 2013, valencia, Spain.
Fig. 9. Multi Step Position Reference Tracking With The FiniteHorizon
SDRE Controller
[8] A. Heydari and S. N. Balakrishnan, “Path planning using a novel
ﬁnitehorizon suboptimal controller,” Journal of Guidance, Control, and
Dynamics, pp. 1–5, 2013.
[9] D. S. Naidu, Optimal Control Systems. CRC Press, 2003.
[10] Z. Gajic and M. Qureshi, “The lyapunov matrix equation in system
stability and control,” New York: Dover Publications, 2008.
[11] A. Barraud, “A new numerical solution of xdot=a1*x+x*a2+d, x(0)=c,”
IEEE Transaction on Automatic Control, vol. 22, no. 6, pp. 976–977,
Dec. 1977.
[12] B. Lu, A. Monti, and R. A. Dougal, “Realtime hardwareinthe
loop testing during design of power electronics controls,” in Industrial
Electronics Society, 2003. IECON’03. The 29th Annual Conference of
the IEEE, vol. 2. IEEE, 2003, pp. 1840–1845.
[13] M. Short and M. J. Pont, “Hardware in the loop simulation of embedded
automotive control system,” in Intelligent Transportation Systems, 20 05.
Proceedings. 2005 IEEE. IEEE, 2005, pp. 426–431.
[14] “Zeltom. educational and industrial control systems.” [Online].
Available: http://zeltom.com/
71