Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

Proceedings of the 27th Chinese Control Conference

July 16-18, 2008, Kunming,Yunnan, China

Networked Nonlinear Model Predictive Control of the Ball


and Beam System
Dong Zhe, Zheng Geng, Liu Guoping
Institute of Automation, Chinese Academy of Sciences, Beijing 100080, P. R. China
E-mail: zhe.dong@ia.ac.cn

Abstract: Aiming at ball and beam system—a typical nonlinear control plant, establish its affine nonlinear model, based on the
nonlinear model predictive control method, some amelioration is made, combined with the networked predictive control scheme,
a networked nonlinear model predictive control method is introduced, which can compensate the network induced time delay
and the packet loss, and used in the implementation of the networked control of the ball and beam system. The performance is
proved by the simulation results, that the system can be stable when the random networked induced time delay with an upper
bound is larger than one sample period. The simulation carried out in real network illustrates the availability of the method.
Key Words: Networked control systems (NCS), Nonlinear, Model predictive control (MPC), Ball and beam system

sults are presented to show the performance of the


1 INTRODUCTION scheme.
Control systems in which control loops are closed 2 MODELING AND ANALYSIS OF THE
through a serial network are called networked control
systems (NCSs). Recently, NCSs have received increas- BALL AND BEAM SYSTEM
ing attention because of their many advantages in prac-
tical applications, such as increased system flexibility 2.1 System Modeling
and the great benefits from sharing of the resources, as
well as lower cost and simpler installation and mainte- Fig.1 shows the ball and beam system, the parameter is
nance. As a result, modeling, analysis, and control of defined by the acceleration of gravity as g, the beam
NCSs with many new emerged problems, such as net- length as L, choosing the beam angle as α and ball po-
work induced delay, packet dropout, and quantization, sition as r, the radius of ball as R, the mass and moment of
have appeared to be a topic of significant interest to the inertia of beam as M and J B , the mass and moment of
control community. In order to overcome the negative
effects of network induced delay and data dropout, many inertia of ball as m and J b , respectively.
methodologies have been proposed. Liu et al. introduced
a networked predictive control scheme, in which a set of
control sequences for every possible delay time are
packed together and sent to the plant side, and on the
plant side the proper control signal corresponding to the
delay measurement is chosen. This is an effective way to
compensate for the network delay, which have been im-
plemented in the real-time control of many practical
plants. However, the above literatures have considered
only linear systems. For most of the control plants are
nonlinear, the schemes based on linear system are not
effective. Fig.1 Ball and Beam System
Ball and beam system is a typical unstable and nonlinear
system, and its relative degree is ill-defined. W.H. Chen Applying the Euler-Lagrange equation, the mathematical
et al. settled the ill-defined relative degree nonlinear model for the proposed ball and beam system is obtained
control system using analytic model predictive control DV
which has been proved to be an effective method to con- Jb
r : (m + r − mrα 2 = −mg sin α
)
trol nonlinear systems. For the method is a switch control R2 (1)
method which will bring some systems vibrant and is L
α : ( J B + J b + mr )α + 2mrrα + ( Mg + mgr ) cos α = FL cos α
2

complicated for implementation, some adaptation is 2


made and a networked nonlinear model predictive control Define state variables as:
scheme is introduced combined with the networked pre-
dictive control scheme. The method introduced in this x1 = r , x2 = r , x3 = α , x4 = α
paper is validated by emulational experiments for the The proposed system can be written in state-space form
networked control of the ball and beam system, the re- as:

469
ª x1 º ª x2 º ª0 º can be stated as: for any state x at time t, find a continuous
« x » « A( x x 2 − g sin x ) » «0 » function uˆ (τ ; x(t )) :[t , t + T ] → U , in a moving hori-
« 2» = « 1 4 3 »
+ « »U (2) zon time frame, T, such that the performance index J is
« x3 » « x4 » «0 » minimized:
« » « » « » min J Subject to (4) and (5) (6)
¬ x4 ¼ ¬ 0 ¼ ¬1 ¼ uˆ

y= x1 The performance index adopted in this paper is given by:


1
Where x1 is ball position on beam, x2 is the ball speed, J = μ1 ( yˆ (t + T ) − yˆ d (t + T )) 2
2 (7)
x3 is beam angle and x4 is beam angular velocity. 1 T
+ ³ [ μ 2 ( yˆ (t + τ ) − yˆ d (t + τ )) 2 + μ3uˆ (t + τ ) 2 ]dτ
2 0
2.2 System Analysis Where T is the predictive horizon, μ1 , μ 2 and μ3 are
The system denoted by Eq. (2) is an affine nonlinear positive weights, indicate the output terminal restrain,
system, which can be written in following form: the output error restrain and the control input restrain,
x = f ( x) + g ( x)u respectively.
(3) To avoid the difficulties in solving optimization problem
y = h( x ) online, some analytic methods has been proposed. The
Relative degree is an important parameter for analyzing key point to obtain the analytic law is to predict the
the nonlinear systems by differential geometry, see output of the system. In moving horizon, the system
Ref.[1]. The relative degree of the system shown in Eq. (2) output can be calculated from Taylor expansion, as
will be analyzed here. For the ball and beam system, the ª y (t ) º
( 0 0 0 ) . At
T
expectative stable point is x = x
0 0 « »
1 ª τ N º « y (t ) »
yˆ (t + τ ) = «1 τ " » « # » + o(τ )
N
(8)
the stable point, Lg L f h( x ) = 2bx1 x4 |x0 = 0 , where
2 0
¬ N ! ¼
« (N ) »
Lkf h( x) denotes the Lie derivative. In arbitrarily small ¬ y (t ) ¼
0 For brief, it can be written as:
neighbourhood of x , there exists x which can make
yˆ (t + τ ) ≈ t (τ )T Y (t ) (9)
Lg L h( x) = 0 , therefore, the ball and beam system is
2

Similarly, the prescribed reference yˆ d (t + τ ) and the


f
ill-defined relative degree nonlinear system. Moreover, it
2 predictive control input uˆ (t + τ ) can be approximated
can be easily proved that Lg L f h( x ) subject to
as:
o( x, u ) 2 and Lg L3f h( x) subject to o(1) , so the ball and yˆ d (t + τ ) = t (τ )T Yd (t )
beam system’s robust relative degree is 4. (10)
uˆ (t + τ ) = t (τ )T Uˆ ′(t )
3 NETWORKED NONLINEAR MODEL Thus, the performance index (7) can be approximated as
PREDICTIVE CONTROL OF ILL-DE- 1 1
J = (Y − Yd )T M (Y − Yd ) + Uˆ ′TTUˆ ′ (11)
FINED RELATIVE DEGREE NONLIN- 2 2
EAR SYSTEMS Where
T i + j −2 μ2T
M (i , j ) = ( μ1 + ) (12)
3.1 Problem Description (i − 1)!( j − 1)! i + j −1
μ3T i + j −1
Consider the SISO nonlinear system in the form of (3), T(i , j ) = (13)
where x ∈ \ , u ∈ \ and y ∈ \ are the state, control
n (i − 1)!( j − 1)!(i + j − 1)
input and output value, respectively. f, g and h are all In this paper, the following assumptions are imposed on
smooth functions. To distinguish the real variables from the nonlinear system (3):
the variables in the moving horizon time frame, hated (A1) All states are available.
variables are used in the moving horizon time frame in (A2) The relative degree of system (3) is ill-defined, and
this paper, thus we have: its robust relative degree is r.
­° xˆ(t + τ ) = f ( xˆ(t + τ )) + g ( xˆ(t + τ ))uˆ(t + τ ) (A3) The output y(t) and the reference yd (t ) are suffi-
® ,τ ∈[0, T ] (4) ciently many times continuously differentiable with re-
°̄ yˆ (t + τ ) = h( xˆ(t + τ )) spect to t.
Where the initial value equals to the current state value: (A4) The control input û is sufficiently many times con-
xˆ (t + τ ) = x(t ),τ = 0 (5) tinuously differentiable within the predictive horizon.
According to (4) and (5), the system output from t to t+T
can be predicted. In general, a nonlinear MPC problem

470
3.2 The Control of ill-Defined Relative Degree ª1º
Nonlinear System: an Analytic NMPC Method « uˆ »
Y (t ) = [q*,0 ( x) q*,1 ( x) " q*,L ( x)] « »  Q( x)Uˆ (18)
For the nonlinear systems which relative degree is «#»
ill-defined, W.H Chen et. al introduced an analytic « L»
¬uˆ ¼
switch NMPC method, which request to a proper switch
Minimize the performance index (15)
space point, if not well designed, it will make some sys-
∂Y T
tem vibration; moreover, the switch method is compli- ( ) M (Y − Yd ) + μ3Tuˆ = 0 (19)
cated, can not fit the demands of networked control. ∂uˆ
Therefore, in this section, we raise a non-switch analytic Yields:
NMPC control method for ill-defined systems. ª0 0 " 0 0 º
In the derivation of the analytic NMPC law, the differ- «1 0 " 0 0 »
ential of û make the analysis and calculation much ∂Y ∂Uˆ « » (20)
= Q( x ) = Q( x) «0 2 " 0 0» Uˆ  Q( x)VUˆ
complicated. Considering that the NMPC law is deter- ∂uˆ ∂uˆ « »
mine by the initial value of uˆ (t + τ ) , the value of «# # % # # »
«¬0 0 " L 0»¼
uˆ (t + τ ) when τ ∈ (0, T ] is not so important, because
they are middle process in derivation, so we can make Substituting (18), (20) into Eq. (19), yields:
following assumption instead of (A4). (Q( x)VUˆ )T M (Q( x)Uˆ − Yd ) + μ3Tuˆ = 0 (21)
(A4)* In prediction horizon [t,t+T], the control input is a Eq. (21) is a 2L-1th exponential equation of optimal
constant value, namely: control. Consider that in the stable point, the control input
uˆ (t + τ ) ≡ u (t ),τ ∈ [0, T ] (14) is 0, thus it is only necessary to solve the equation near 0.
Obviously, on this assumption, û ’s any order derivative For simplicity, we ignore the 2nd and higher order of
will be 0, which make it easy to solve the analytic NMPC û ,let:
law. ª I 2 º ª1 º
The approximation of the performance index J can be Uˆ ≈ « »« »
rewritten as: ¬ 0( N −1)×2 ¼ ¬uˆ ¼
1 1 Then:
J = (Y − Yd )T M (Y − Yd ) + μ3Tuˆ 2 (15)
2 2 q*,1 ( x)T M (q*,0 ( x) − Yd ) + [q*,1 ( x)T Mq*,1 ( x) + μ3T ]uˆ = 0 (22)
In the moving time frame, differentiate the system’s From Eq. (22), we can get the optimal analytic law of
output yˆ (t + τ ) , τ ∈ [0, T ] from order 0 up to order N NMPC:
with respect to t, in order to make control input obviously q*,1 ( x)T M (q*,0 ( x) − Yd )
included in Y, N should be larger than r, the 0 to Nth uˆ * = − (23)
q*,1 ( x)T Mq*,1 ( x) + μ3T
derivatives of yˆ (t + τ ) are:
The actual control input, u(t), is given by the initial value
yˆ ( t + τ ) = h ( xˆ )  q 0 ,0 ( xˆ ) *
of the optimal control input û . Because there is no
yˆ ( t + τ ) = L h ( xˆ )  q ( xˆ )
f 1,0 singular point, the controller is continuous in the state
# space.
yˆ ( r − 2 ) ( t + τ ) = L f r − 2 h ( xˆ )  q r − 2 ,0 ( xˆ )
3.3 Networked Nonlinear Model Predictive Control
yˆ ( r −1) ( t + τ ) = L f r −1 h ( xˆ ) + L g Lrf− 2 h ( xˆ ) uˆ
(16) In networked control system, the sensor, actuator and the
 q r −1,0 ( xˆ ) + q r −1,1 ( xˆ ) uˆ
controller are located distributive, they communicate
yˆ ( r ) ( t + τ ) = L f r h ( xˆ ) + [ L g Lrf−1 h ( xˆ ) with each other through networks. The use of network
induce time delay and data dropout in the control system
+ L f L g Lrf− 2 h ( xˆ )]uˆ + L2g Lrf− 2 h ( xˆ ) uˆ 2
which will degrade the performance of the control system.
 q r −1,0 ( xˆ ) + q r −1,1 ( xˆ ) uˆ In this section, we discuss how to compensate the net-
worked induced delay and data loss. For the sake of
#
simplicity, the following assumptions are imposed:
yˆ (N )
( t + τ ) = q N ,0 ( xˆ ) + q N ,1 ( xˆ ) uˆ (A5) The transmission delay is discretized to integral
+ q N , 2 ( xˆ ) uˆ 2 + " + q N , L ( xˆ ) uˆ L times of sample time, k and f are delay of forward and
feedback channel, respectively, which are random num-
The 0 to Nth derivatives of the predictive output bers with upper bound.
yˆ (t + τ ) can be denoted by polynomials of û , the co- (A6) The number of consecutive data drops in the for-
efficient of the polynomials according to: ward channel is not greater than N1 , the round trip time
qi ,0 ( x) = L f qi −1,0 ( x), i = 1," , N
(17) delay (k+f) is not greater than N, N1 and N are both
qi , j ( x) = Lg qi −1, j −1 ( x) + L f qi −1, j ( x), i = 1," , N , j = 1,", L
Thus, Y(t) can be written as: positive integer, satisfy N1 <N.

471
(A7) In networked control system, the data transmitted by sends them to the actuator. In actuator side, a buffer and a
packets, which including a data sequence with a time networked delay compensator are located. In the scheme,
stamp. under the assumption (A5) ~ (A7), it can be guaranteed
The scheme of the networked predictive control is shown that there exists at least one control sequence in the buffer
is Fig.2, including a control prediction generator and a that include the control value for current time. The func-
networked delay compensator. Control prediction se- tion of the networked delay compensator is to check the
quence consists of the current control value and the pre- time stamp and choose the latest prediction sequence
dictive control value for next N steps. At each sample which contains the control value for current time. The
cycle, control prediction generator receives the feedback following part will discuss the calculation of the predic-
states and generates the control predictive sequence, then tive control sequence.

Fig.2 The Scheme of Networked Predictive Control

In section 3.2, we have derived the local NMPC control


law as Eq. (23), at time t, the control input for time t+ τ 4 NETWORKED CONTROL OF BALL
can be predicted by: AND BEAM SYSTEM
q ( xˆ (t + τ ))T M (q*,0 ( xˆ (t + τ )) − Yd )
uˆ(t + τ | t ) = − *,1 (24) In section 2, we modeled and analyzed the ball and beam
q*,1 ( xˆ (t + τ ))T Mq*,1 ( xˆ (t + τ )) + μ3T system, the robust relative degree is 4, equal to the system
In Eq. (24), xˆ (t + τ ) is the state prediction for the time order. In order to obtain the controller of the system, it is
t+ τ at time t, it can be approximately predicted by necessary to determine the coefficient in Eq. (22). Cal-
culates the 0 to 4th derivatives of the system as follow:
Taylor series expansion:
ª x (t ) º k=0: h( x) = x1 , Lg h( x) = 0
« »
ª τ º « x ( t ) »
N
k=1: L f h( x) = x2 , Lg L f h( x) = 0
xˆ( t + τ ) ≈ «1 τ " » « # » = t (τ ) X ( t ) (25)
¬ N !¼
k=2: L f h( x ) = bx1 x4 − bg sin x3 , Lg L f h( x) = 0
2 2 1
« (N ) »
¬ x (t ) ¼
k=3:
The state prediction sequence for next N p step is:
L3f h( x) = bx1 x42 − bgx4 sin x3 , Lg L2f h( x) = 2bx1 x4
T
ª¬ xˆ(t | t ) xˆ(t + Ts | t ) " xˆ(t + N p <Ts | t )º¼ = Γ X (t ) (26) k=4:
Where L4f h( x) = b 2 x1 x44 + (b − b 2 ) gx42 sin x3 , Lg L3f h( x)
ª TsN º
«1 Ts "
N!
» = 4bx2 x4 − bg cos x3
« »
« 2 TsN
N
» 5
1 2Ts " Where b= , g=9.81
Γ =« N! » 7
« »
«# # % # » The prescribe reference Yd = [ yd 0 0 0]T ,
« N p N TsN »»
«1 N pTs " Yields:
¬« N ! ¼» ª x1 − yd º
From Eq. (24) and Eq. (26), the control sequence at « x2 »
time t can be calculate as: « »
T q*,0 ( x) − Yd = « bx1 x42 − bg sin x3 »
ª¬uˆ (t | t ) uˆ (t + Ts | t ) " uˆ (t + N p <Ts | t ) º¼ (27) « »
« bx1 x4 − bgx4 sin x3
2
»
Where Ts is the sample time of the system, N p is «¬b 2 x1 x44 + (b − b 2 ) gx42 sin x3 »¼
the predictive horizon.

472
ª 0 º
« 0 »
« » (28)
q*,1 ( x ) = « 0 »
« »
« 2 bx x
1 4 »
«¬ 4 bx 2 x 4 − bg cos x3 »¼

Let μ1 =1, μ2 =0.1, μ3 =0, moving time frame T=0.9s,


sample time Ts =0.04s, predictive horizon N p =10, from Fig.4 4 step constant delay without compensation
Eq. (12), the matrix M can be calculated as:
ª1.1000 1.0500 0.5167 0.1708 0.0425º
«1.0500 1.0333 0.5125 0.1700 0.0424 »
« » (29)
M = «0.5167 0.5125 0.2550 0.0847 0.0211»
« »
« 0.1708 0.1700 0.0847 0.0282 0.0211»
«¬ 0.0425 0.0424 0.0211 0.0070 0.0018»¼
The coefficient matrix of the prediction sequence is:
Fig.5 Network control without compensation
ª1 0.04 0.0008º
«1 0.08 0.0032 »
Γ =« »
«# # # »
« »
¬1 0.4 0.08 ¼
In the simulation, the plant and the controller are simu-
lated in 2 ARM9 chips which located separately, they
communicate with each other by local area network, the
average round trip delay is 3.47 steps. Set the reference Fig.6 Network control with compensation
yd=0.2, the results is shown in Fig.3, Fig.4, Fig.5 and
Fig.6. Fig.3 is the result of the local NMPC control, it can 5 CONCLUSION
be seen that the system output tracks the reference rapidly. In this paper, we Aim at ball and beam system—a typical
In Fig.4, the controller is same as Fig.3, while 4 step nonlinear control plant, establish its affine nonlinear
constant delay has been added to the system, influenced model. Based on the nonlinear model predictive control
by the delay, the vibration of the system becomes violent. theory, some amelioration is made, combined with the
Fig.5 shows the response of the system when simulated in networked predictive control scheme, a networked
real network, the controller remains same as before, nonlinear model predictive control method is introduced,
because of the random delay, the system can not be stable. which can compensate the network induced time delay
In Fig.6, the network is same as Fig.5, the networked and the packet loss. The method presented is used in the
nonlinear predictive control scheme has been adopted, it networked control of the ball and beam system. The
can be seen that the performance is similar with Fig.3, simulation results validate the performance of the scheme,
which proves the validity of the scheme. that the bounded random network delay and package loss
can be compensated by the networked nonlinear predic-
tive control scheme.

REFERENCES
[1] ALBERTO I. Nonlinear Control Systems, 3th ed. London:
Springer-Verlag, 1995.
[2] CHEN W H, BALANCE D J. On a Switching Control
Scheme for Nonlinear System with ill-Defined Relative De-
gree. Systems and Control Letters, 2002.
[3] CHEN W H, BALANCE D J, GAWTHROP P J. Optimal
Fig.3 local nonlinear model predictive control control of nonlinear systems:a predictive control approach.
Automatica, 2003.
[4] LIU G P, MU J X ,REES D.Design and Stability of networked
predictive control systems with random network transmission
delay- a polynomial approach.
[5] LIU G P, XIA Y Q, REES D. Design and stability criteria of
networked predictive control systems with random network
delay in the feedback channel.

473

You might also like