Tải bản đầy đủ (.pdf) (11 trang)

On line tuning of a neural PID controller based on variable structure RBF network

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (378.39 KB, 11 trang )

On-Line Tuning of a Neural PID Controller
BasedonVariableStructureRBFNetwork
Jianchuan Yin, Gexin Bi, and Fang Dong
College of Navigation, Dalian Maritime University,
1 Linghai Road, Dalian 116026, China
, ,
Abstract. This paper presents the use of a variable structure radial
basis function (RBF) network for identification in PID control scheme.
The parameters of PID control are on-line tuned by a sequential learn-
ing RBF network, whose hidden units and connecting parameters are
adapted on-line. The RBF-network-based PID controller simplifies mod-
eling procedure by learning input-output samples while keep the advan-
tages of traditional PID controller simultaneously. Simulation results of
ship course control simulation demonstrate the applicability and effec-
tiveness of the intelligent PID control strategy.
Keywords: Radial basis function network, Variable structure, PID
control.
1 Introduction
The design of ship motion controller presents challenges because ship’s motion
is a complex nonlinear system with time-varying dynamics [1]. The dynamics of
ship motion varies in case of any changes in sailing conditions such as speed,
loading conditions, trim, etc. Similar changes may also be caused by environ-
mental disturbances, such as waves, wind, current, etc. So it is hard to obtain
a suitable physically founded ship motion model due to the complexity of the
time-varying dynamics and the underlying processes.
In recent years, neural networks have been used to model unknown nonlinear
systems for a broad variety of control problems [2]. Whereas, most satisfactory
performances of neural-network-based intelligent controller are achieved when
applied to systems with static dynamics. When applied to systems with non-
stationary dynamics, a neural network with static structure is less satisfactory
[3] in representing time-varying dynamics. So it is desirable to develop variable


structure neural networks whose structure and connecting weights can adapt to
changes of system dynamics.
Sequential learning algorithms are designed for on-line constructing variable
structure network. They are featured by low computational burden and par-
simonious network structure. Radial basis function (RBF) neural network has
gained much popularity due to its features such like simple topological struc-
ture and best approximation [4]. These features enables RBF network suitable
W. Yu, H. He, and N. Zhang (Eds.): ISNN 2009, Part II, LNCS 5552, pp. 1094–1104, 2009.
c
 Springer-Verlag Berlin Heidelberg 2009
On-Line Tuning of a Neural PID Controller 1095
for sequential learning scheme. The most widely used sequential learning algo-
rithm are resource allocation network (RAN) [5], RAN with extended kalman
filter (RANEKF) [6], Minimal-RAN (MRAN) [7] and generalized growing and
pruning RBF (GGAP-RBF) [8].
In this paper, we introduce a sequential learning algorithm for RBF network
referred to as dynamic orthogonal structure adaptation (DOSA) algorithm. The
algorithm can achieve compact network structure by employing a small num-
ber of parameters. It takes advantage of a sliding data window for monitoring
system dynamics, and improve the well-known idea of error reduction ratio as
contribution criteria for network pruning. First-order derivative information is
also included in the network to trace the trend of system dynamics.
Conventional PID control is still the most widely used control scheme in in-
dustrial applications attribute to its merits such as strong robustness, under-
standability and simple structure. But it may become laborious when applied
to practical systems which are usually both nonlinear and nonstationary. By in-
corporating the neural network in the PID control scheme, resulting intelligent
adaptive PID controller simplifies the modeling procedure by merely learning
input-output samples as well as keep the advantages of conventional PID con-
troller simultaneously.

In this study, we apply the PID controller with variable structure RBF net-
work in ship course control simulation. The RBF network was on-line constructed
by DOSA algorithm. Simulation of ship course control was finally conducted to
demonstrate the applicability and effectiveness of the RBF-network-based PID
controller.
2 DOSA Algorithm for RBF Network
2.1 Algorithm Description
By combining a sequential learning mode with the subset selection scheme of
orthogonal least squares (OLS) algorithm [9], we introduce a learning algorithm
referred to as dynamic orthogonal structure adaptation (DOSA) algorithm. The
network structure becomes variable by adding the newly received observation as
hidden unit directly, while pruning units which contribute little to output over a
number of observations. The contribution of each hidden unit is measured by its
normalized error reduction ratio, which generalized from error reduction ratio in
orthogonal least squares (OLS) algorithm [9].
We employ in this algorithm a sliding window which is a first-in-first-out
sequence. When a new observation is received, the sliding window is updated by
incorporating the new observation and discarding the foremost one.
window =[(x
1
,y
1
), (x
2
,y
2
), ···, (x
N
,y
N

)] (1)
where N is the width of the sliding data window. The data in the sliding window
are used to represent the dynamics of system with input X ∈ R
n×N
and output
Y ∈ R
N×m
. n and m are dimensions of the input and output, respectively.
1096 J. Yin, G. Bi, and F. Dong
For nonlinear systems involving variants of local mean and trend, the dynam-
ics of system can be easily tracked by applying a suitable difference on the signal
[3]. Here we use the first order differences of the sliding window input X

∈ R
n×N
and output Y

∈ R
N×m
as input and output to the network, respectively.
X

=[x
1
− x
0
, ,x
N
− x
N−1

]=



x
1,1
− x
1,0
··· x
1,N
− x
1,N−1
.
.
.
.
.
.
.
.
.
x
n,1
− x
n,0
··· x
n,N
− x
n,N −1




∈ R
n×N
(2)
is the difference of sliding data window input and
Y

=[y
1
−y
0
, ,y
N
−y
N−1
]
T
=



y
1,1
− y
0,1
y
1,m
− y
0,m

.
.
.
.
.
.
.
.
.
y
N,1
− y
N−1,1
y
N,m
− y
N−1,m



∈ R
N×m
(3)
is the difference of desired output matrix of the sliding data window.
The learning procedure begins with no hidden unit. At each step, the differ-
ence of new observation input is directly added into the hidden layer as a new
hidden unit. By Calculating the Gaussian functions of the Euclidean distance
between X

and the candidate hidden units, we have response matrix of the

hidden units to the input of sliding data window Φ ∈ R
N×M
with
φ
j,k
=exp(−
x
j
− c
k

2

2
)1≤ j ≤ N, 1 ≤ k ≤ M (4)
where c
k
are known as the k-th hidden units, σ a width constant and ·the
Euclidean norm.
In order to avoid multicollinearity and evaluate the individual contribution of
each hidden units, we transform the set of basis vectors Φ into a set of orthogonal
basis vectors using Gram-Schmidt method by decomposing Φ into Φ = WA.The
space spanned by the set of w
k
is the same space spanned by the set of φ
k
.
The error reduction ratio of each vector w
k
is then calculated:

[err]
ki
=
(w
T
k
y
i
)
2
(w
T
k
w
k
)(y
T
i
y
i
)
(5)
According to vector space theory,

M
k=1
cos
2
θ
k

= 1 in single-output condition.
This explains why

M
k=1
[err]
k
= 1 in OLS algorithm under single output condi-
tion. Different from the square response matrix in OLS algorithm, the response
matrix in DOSA algorithm is generally not square because the size of sliding
data window input is generally not the same as the number of hidden units. We
can find that

M
k=1
[err]
k
> 1whenM>Nand

M
k=1
[err]
k
< 1whenM<N.
For evaluating the contribution of hidden units to the trend of system dynamics
directly, the normalized error reduction ratio (nerr) is obtained by
[nerr]
k
=
[err]

k

M
k=1
[err]
k
(6)
On-Line Tuning of a Neural PID Controller 1097
This transformation makes

M
k=1
[nerr]
k
= 1 under any condition and enables
the direct application of nerr for evaluation purpose.
After the network growing process by adding the new observation, the pruning
process is conducted by pruning units which contribute little to the output. First,
we select hidden units whose sum of nerr value falls below an preset accuracy
threshold ρ at each step. Assume that [nerr]
k
1
=max{[nerr]
k
, 1 ≤ k ≤ M }.
If [nerr]
k
1
<ρ, then select [nerr]
k

2
=max{[nerr]
k
, 1 ≤ k ≤ M,k = k
1
}.The
same selection is made for [nerr]
k
S
=max{[nerr]
k
, 1 ≤ k ≤ M, k = k
1
,k =
k
2
, ,k = k
S−1
}.
The selection procedure continues until the sum

k=k
S
+1
k=k
1
[nerr]
k
≥ ρ. Select
k

1
, ,k
S
and the corresponding hidden units are marked with S
k
={k
1
, ,k
S
}
and considered as contributing little to the output at this step. The selection
is made at each step. When some hidden units are selected for consecutive M
S
times, certain units will be pruned from network. That is, remove the units in
the intersection of sets selected in the past M
S
observations.
I = {S
k

S
k−1



S
k+M
S
−1
} (7)

After hidden units being added or pruned at each step, the weights between
the hidden layer and output layer are adapted to the difference of the sliding
data window output using the linear least mean squares estimation (LLSE) [10]:
Θ = Φ
+
Y

=(Φ
T
Φ)
−1
Φ
T
Y

(8)
When the difference of output y

N+1
is obtained according to input x

N+1
,the
output can be finally achieved by
y
N+1
= y
N
+ y


N+1
(9)
2.2 Performance Results of DOSA Algorithm
In this section, DOSA algorithm is implemented to prediction of Mackey-Glass
chaotic time series whose dynamics are both nonlinear and nonstationary [11].
The Mackey-Glass series is governed by the following time-delay ordinary
differential equation:
ds(t)
dt
= −bs(t)+a
s(t − τ)
1+s(t − τ)
10
(10)
with a =0.2, b =0.1andτ = 17. Integrating the equation over the time interval
[t, t + Δt] by the trapezoidal rule yields
x(t+Δt)=
2 − bΔt
2+Δt
x(t)+[
x(t + Δt − τ)
1+x
10
(t + Δt − τ)
+
x(t − τ)
1+x
10
(t − τ)
]

aΔt
2+bΔt
(11)
Set Δt = 1, the time series is generated under the condition x(t − τ)=0.3for
0 ≤ t ≤ τ(τ = 17). The series is predicted with μ = 50 sample steps ahead using
1098 J. Yin, G. Bi, and F. Dong
four past samples: s
n−μ
,s
n−μ−6
,s
n−μ−12
,s
n−μ−18
. Hence, the n-th input-output
data pair for the network to learn are expressed as
x
n
=[s
n−μ
,s
n−μ−6
,s
n−μ−12
,s
n−μ−18
]
T
(12)
and

y
n
= s
n
. (13)
whereas the predicted value at time n is given by
z
n
= f(x
n
). (14)
where f(x
n
) is the network prediction and the μ-step-ahead prediction error is

n
= s
n
− z
n
. (15)
This experiment is designed to evaluate the on-line prediction capability of the
RBF obtained by DOSA algorithm, so after learning at each step, the unlearned
next value in the series s
n+1
is predicted using f(x
n
) and get the predicted value
z
n+1

:
z
n+1
= f(x
n+1
) (16)
and the prediction error was got

n+1
= s
n+1
− z
n+1
. (17)
The exponentially weighted prediction error (EWPE) is chosen as a measure
of the performance of the network prediction. The value of EWPE at time n can
be recursively computed as
e
2
WPE
(n)=λe
2
WPE
(n − 1) + (1 − λ)
n

2
(18)
where 0 <λ<1. Here λ is chosen as λ =0.95.
5000 data were generated from (11) for the prediction experiment of proposed

DOSA algorithm. The MRAN algorithm is a popular sequential learning algo-
rithm, so the same experiment was performed by MRAN algorithm for compar-
ison. The parameter values for DOSA algorithm are selected as follows: N = 10,
ρ =0.00002, M
S
= 3. We notice that there are only three parameters, which
facilitate its practical applications. Parameter values for MRAN algorithm are
selected as: 
max
=0.7, 
min
=0.07, γ =0.999, e
min
=0.095, e

min
=0.078,
κ =0.87, P
0
= R
n
=1.0, Q =0.0002, η =0.02, δ =0.01, M = 90.
The evolution of hidden units number, prediction error and value of lg(e
WPE
)
with different algorithms are shown in Figs. 1- 3.Figure 1 shows that the hidden
units number of network generated by DOSA algorithm initiates with 0 and
remains between 5−8 after 29-th step, while that of network generated by MRAN
algorithm remains at 16 which is much larger than that of DOSA algorithm.
We can see from Figs. 2 and 3 that the prediction error of DOSA algorithm is

much smaller than that of MRAN algorithm. It shows that the DOSA algorithm
can quickly track the changes of system dynamics with parsimonious network
structure, is an efficient modelling method to sequentially construct a variable
network structure.
On-Line Tuning of a Neural PID Controller 1099
0 500 1000 1500 2000 2500 3000 3500 4000 4500 5000
0
2
4
6
8
10
12
14
16
18
Number of Observations
Number of Hidden Units
DOSA
MRAN
Fig. 1. Comparison of hidden units number curve
0 500 1000 1500 2000 2500 3000 3500 4000 4500 5000
−0.2
0
0.2
0.4
0.6
Number of Observations
Prediction Error
0 500 1000 1500 2000 2500 3000 3500 4000 4500 5000

−0.5
0
0.5
1
Number of Observations
Prediction Error
DOSA
MRAN
Fig. 2. Comparison of prediction error curve
0 500 1000 1500 2000 2500 3000 3500 4000 4500 5000
−3
−2.5
−2
−1.5
−1
−0.5
Number of Observations
Value of lg(WPE)
Fig. 3. Comparison of WPE value curve
1100 J. Yin, G. Bi, and F. Dong
3 The Neural PID Controller
In this study, sequential DOSA algorithm is used for RBF network training. The
PID control parameters K
p
, K
i
and K
d
can be adjusted online through RBF
network self-training. And the best values of them can be obtained corresponding

to the outputs of RBF network with a certain optimal control law.
The general configuration of the neural network PID controller is shown in
Fig. 4. In the control scheme, neural network act for system identification, here
Fig. 4. Configuration of RBF network PID control scheme
we use the RBF network constructed by the DOSA algorithm. Ship model is set
as the plant, and the PID control parameters are tuned on-line.
The conventional increment PID algorithm is given by
u(k)=u(k − 1) + Δu(k) (19)
Δu(k)=K
p
[e(k) − e(k − 1)] + K
i
e(k)+K
d
[e(k) − 2e(k − 1) + e(k − 2) (20)
e(k)=r(k) − y(k) (21)
where K
p
is the proportional coefficient, K
i
the integral coefficient, K
d
is the
differential coefficient, u is the control variable, r is the expected output value
and y is the actual output value obtained during evaluation.
So we can calculate u(k)ifweknowu(k −1), y(k), e(k), e(k −1) and e(k − 2).
A performance function is given by
E(k)=
1
2

[r(k) − y(k)]
2
(22)
The three control coefficients are updated according to gradient-descent algo-
rithm:
ΔK
p
= −η
∂E
∂K
p
= −η
∂E
∂y
∂y
∂u
∂u
∂K
p
= ηe(k)
∂y
∂u
(e(k) − e(k − 1)) (23)
ΔK
i
= −η
∂E
∂K
i
= −η

∂E
∂y
∂y
∂u
∂u
∂K
i
= ηe(k)
∂y
∂u
e(k) (24)
On-Line Tuning of a Neural PID Controller 1101
ΔK
d
=−η
∂E
∂K
d
=−η
∂E
∂y
∂y
∂u
∂u
∂K
d
=ηe(k)
∂y
∂u
(e(k) − 2e(k − 1) + e(k − 2)) (25)

where
∂y
∂u
is the Jacobian message of the controlled plant. Here we employ
∂ ˆy
∂u
to
approximate it and
∂ ˆy
∂u
is achieved from the RBF network identification.
The Jacobian matrix is
∂y(k)
∂u(k)

∂ˆy(k)
∂u(k)
=
M

j=1
w
j
h
j
c
j
− x
1
b

2
j
(26)
with x
1
= u(k)andj is the index of the hidden units.
4 Ship Course Control Simulation
The proposed neural network PID control strategy was experimented by Matlab
simulation. Ship motion is a typical nonlinear system with unstable dynamics,
so examine the performance of the control strategy by applying it in ship track-
keeping control. The simulation is based on ship ”Mariner” [12] via Abkowitz
type mathematical model [13] expression. The ship’s hydrodynamic coefficients
are acquired from [13].
The objective of our simulation was to steer a ship on setting courses with
small deviations as well as avoiding large control actions. The desired course
are set as −10

during [0s, 300s], 10

during [301s, 600s], 20

during [601s,900s]
and 0

during [901s,1200s]. To make the simulation more realistic, influence
of wind, wave were both considered [14]. Wind force is set to Beaufort scale
4 with speed ranging from [0m/s, 14m/s], speed and direction changes every
10 and 50 seconds, respectively. Wave direction was set as 30

during [1s,600s]

and 60

during [601s,1200s]. Influences of wind and wave on ship motion were
calculated according to [13]. Here the ship motion control input-output data pair
for the network to learn are expressed using nonlinear autoregressive model with
exogenous inputs NARX system expression [15]:
ˆy(k)=f(y(k − 1), , y(k − n
y
),u(k), , u(k − n
u
)) (27)
where y(·)andu(·) are discrete sequences of output and input. n
y
and n
u
are
the maximum lags in the output and input, d is the delay of system, f(·)isthe
unknown function.
In the simulation, ship speed was set to 15 knot, rudder angle and rate were
constrained to ±20

and ±5

/s separately. The parameters were chosen as fol-
lows: n
u
=1,n
y
=2,η =10,N =10,M
S

=3,ρ=0.0005. DOSA algorithm was
implemented to construct RBF network on-line. Simulation results are shown in
Fig. 5. The upper figure of Fig. 5 shows the desired ship heading course and the
actual heading course, the lower figure of Fig. 5 shows the rudder actions during
simulation. For comparison, the conventional PID control is also implemented
1102 J. Yin, G. Bi, and F. Dong
0 200 400 600 800 1000 1200
−20
−10
0
10
20
30
time (s)
Heading Angle (degree)
0 200 400 600 800 1000 1200
−20
−10
0
10
20
time (s)
Rudder Angle (degree)
Fig. 5. Ship heading course and rudder angle (RBF-network-based PID control)
0 200 400 600 800 1000 1200
−20
−10
0
10
20

30
time (s)
Heading Angle (degree)
0 200 400 600 800 1000 1200
−20
−10
0
10
20
time (s)
Rudder Angle (degree)
Fig. 6. Ship heading course and rudder angle (PID control)
under the same condition and the results are shown in Fig. 6. The parameters
of conventional PID controller are tuned as: K
P
=8,K
I
=0.01, K
D
= 80.
Our control goal is to steer the ship continues to follow the desired courses with
small tracking errors. We can see from Figs. 5 and 6 that, although both method
can track the desired course well, the proposed RBF network-based PID control
strategy uses much less rudder action, and the heading course curve is smooth
either. The effects of wind and wave are both eliminated to a considerably low
level. It indicates that the controller can react fast to the environmental changes
with smooth rudder actions, it also shows that the RBF network which is on-
line constructed by DOSA algorithm can react to the change of ship dynamics
adaptively.
On-Line Tuning of a Neural PID Controller 1103

5Conclusion
With regard to the problems of controlling nonlinear system with unstable dy-
namics, an RBF-network-based intelligent PID control algorithm is introduced.
The RBF network is on-line constructed by DOSA algorithm. Simulation re-
sults show that the proposed control strategy is featured by quick response, high
stability and satisfactory anti-interference ability. It is demonstrated that the
proposed control scheme is a promising alternative to conventional autopilots.
Acknowledgements
This work is supported by Application Fundamental Research Foundation of
China Ministry of Communications under grant 200432922505.
References
1. Roberts, G.N., Sutton, R., Zirilli, A., et al.: Intelligent Ship Autopilots-A Historical
Perspective. Mechatr. 13, 1091–1103 (2003)
2. Apostolikasn, G., Tzafestas, S.: On-line RBFNN Based Identification of Rapidly
Time-Varying Nonlinear Systems with Optimal Structure-Adaptation. Math. and
Comp. in Simulation 63, 1–13 (2003)
3. Chng, E.S., Chen, S., Mulgrew, B.: Gradient Radial Basis Function Networks for
Nonlinear and Nonstationary Time Series Prediction. IEEE Trans. Neur. Netw. 7,
190–194 (1996)
4. Ghosh, J., Nag, A.: An Overview of Radial Basis Function Networks: New Advances
in Design. Physica-Verlag, Heidelberg (2001)
5. Platt, J.: A Resource Allocating Network for Function Interpolation. Neur. Com-
put. 3, 213–225 (1991)
6. Kadirkamanathan, V., Niranjan, M.: A Function Estimation Approach to Sequen-
tial Learning with Neural Network. Neur. Comput. 5, 954–975 (1993)
7. Lu, Y.W., Sundararajan, N., Saratchandran, P.: Identification of time-varying non-
linear systems using minimal radial basis function neural networks. IEE Proc.
Contr. Theor. Appl. 144, 202–208 (1997)
8. Huang, G.B., Saratchandran, P., Sundararajan, N.: A Generalized Growing and
Pruning RBF (GGAP-RBF) Neural Network for Function Approximation. IEEE

Trans. Neur. Netw. 16, 57–67 (2005)
9. Chen, S., Cowan, C.F.N., Grant, P.M.: Orthogonal Least Squares Learning Algo-
rithm for Radial Basis Function Networks. IEEE Trans. Neur. Netw. 2, 302–309
(1991)
10. Jang, J.S.R., Sun, C.T., Mizutani, E.: Neuro-Fuzzy and Soft Computing: A Com-
putational Approach to Learning and Machine Intelligence. Prentice-Hall, Upper
Saddle River (1997)
11. Lu, Y.W., Sundararajan, N., Saratchandran, P.: A Sequential Learning Scheme
for Function Approximation by Using Minimal Radial Basis Function Neural Net-
works. Neur. Comput. 9, 461–478 (1997)
12. Chislett, M.S., Strom, J.T.: Planar Motion Mechanism Tests and Full-Scale Steer-
ing and Manoeuvring Predictions for a Mariner Class Vessel. Technical Report,
Hydro and Aerodynamics Laboratory (1965)
1104 J. Yin, G. Bi, and F. Dong
13. Jia, X.L., Yang, Y.S.: The Mathematic Model of Ship Motion. Dalian Maritime
University Press, Dalian (1999)
14. Zhang, Y., Hearn, G.E., Sen, P.: A Neural Network Approach to Ship Track-
Keeping Control. IEEE J. Ocean. Eng. 21, 513–527 (1996)
15. Chen, S., Wang, X.X., Harris, C.J.: NARX-Based Nonlinear System Identification
Using Orthogonal Least Squares Basis Hunting. IEEE Trans. Contr. Syst. Tech. 16,
78–84 (2008)

×