You are on page 1of 6

2011 IEEE Student Conference on Research and Development

Multi Input Single Output Closed Loop Identification


of Two Wheel Inverted Pendulum Mobile Robot

Junainah Jahaya S.W.Nawawi Zuwairie Ibrahim


Faculty of Electrical Engineering, Faculty of Electrical Engineering, Faculty of Electrical Engineering,
Universiti Teknologi Malaysia, Universiti Teknologi Malaysia, Universiti Teknologi Malaysia,
81310 UTM Skudai, Johor Malaysia 81310 UTM Skudai, Johor Malaysia 81310 UTM Skudai, Johor Malaysia
junainahjahaya@gmail.com sophan@fke.utm.my zuwairie@fke.utm.my

Abstract—This paper presents system identification process on analyzed using linear identification models, which are ARX,
multi input single output (MISO) closed loop of Two Wheel ARMAX, BJ, and OE models.
Inverted Pendulum (TWIP) mobile robot. This study considers 4
linear models, which are ARX, ARMAX, BJ, and OE. The actual II. IDENTIFICATION PROCEDURE
input output data is used in the analysis. The ARX model shows
In system identification, the procedure to model a
the best model for TWIP system.
dynamical system is shown in Fig. 1[10].
Keywords-system identification; ARX; ARMAX; BJ; OE; A. Experiment Design
I. INTRODUCTION The design of the experiment is vital part in the system
identification. In the TWIP closed loop system showed in Fig.
The researches on two-wheeled inverted pendulum (TWIP) 2, 5-bit pseudo-random binary sequences, PRBS signal is
mobile robots or commonly known as balancing robots have injected into the system with current, u1 and u2 as input, the
gained momentum over the last decade in a number of robotic inclination angle, y, is chosen as output. The input signal that is
laboratories around the world [1-4]. The robots are distinctly rich in frequencies is required to obtain the good parameter
characterized by their ability to balance in the two wheel and identification. PRBS in Fig. 3 is a common choice of input
spin on the spot. TWIP mobile robot in this study is a system signal because the signal has easy to be generated which is
with two DC motors coupled with two wheels, which is similar to the white noise.
mounted together on the mechanical chassis and pole [1]. This
TWIP mobile robot is able to do three different tasks, which To operate the TWIP mobile robot system, ramp signal is
are self-balancing, move forward and backward, and turn left chosen as the reference input. When the PRBS is injected, the
and right. The TWIP mobile robot system must be in upright system tries to balance itself and not able to move forward and
position first before other task can be done. This TWIP and backward or turn left and right. This is due to the PRBS signal,
other two wheel balancing robots are successfully built using which makes the TWIP mobile robot not in the upright
mathematical modelling analysis [1-4]. position. Thus, the behavior of inclination angle is chosen as
output to find the balancing of TWIP mobile robot system.
Modelling is an important task in scientific studies as the
first step of any system analysis [5]. However, the process of Fig. 4 shows inclination angle behavior when the system
obtaining a model is not an easy job. Achieving model of the was injected with PRBS signal. The process to balance the
system can be done in two methods, analytical modelling and system to zero angles when the PRBS is injected to the system
system identification. Analytical modelling requires knowledge was collected. Based on Fig. 4, the set of data from 0 until 50s
about the system and applies physical law of physic to build up are the condition when the TWIP from 0.18 degree (initial state
mathematical model. The modeling can be difficult if the value) try to balance itself. The set of data will take to analysis
system is complex and the knowledge is limited. Thus, system the balancing state is from 51s until 200s, which contain 1500
identification has been introduced as an alternative modelling data with 0.1 sampling time.
approach.
Linearization process during data collection is important
The term identification has been introduced by Zadeh [6], since the TWIP system is nonlinear. Without linearization, the
which refers to the problem in determining the relationship of linear estimation of the model is difficult to achieve. The
black box model or modelling based on input and output data linearization process is done by adding an offset to the PRBS
sets. System identification is a method used to obtain signal. The part of data used in identification after linearization
mathematical model of a dynamic system from input and process is shown in Fig. 5.
output data under testing and characterizing the system
The set of input output data was divided into three parts,
behaviors [7-9]. It is very useful for modelling system that the
first part, ze1, was chosen for the estimation stage while the
parameter is unknown and difficult to represent in term of first
second and third parts, zv3 and zv4, were chosen for the
principles. In this study, the mathematical modeling of TWIP is
validation stage.

978-1-4673-0102-2/11/$26.00 ©2011 IEEE 138


Output, y
START
0.15

Angle (theta)
0.1

Construct experiment and collect data 0.05


0
-0.05
0 50 100 150 200
Model structure/Order selection Time (s)
Input, u1
4

Parameter estimation 2

Current (A)
0

-2
Model validation
-4
0 20 40 60 80 100 120 140 160 180 200
Time (s)
Input, u2
NO 4
MODEL
ACCEPTED 2

Current (A)
0
YES
-2

-4
0 20 40 60 80 100 120 140 160 180 200
Time (s)
Figure 1. System identification flowchart
Figure 4. Output, y (inclination angle) and input, u1 and u2 (current) signal
of TWIP system

Output signal,y after linearization (range 500-2000 data)


0.04

0.02
Angle (theta)
LQR Controller

u1 0
y
-0.02
PRBS 1
u2 -0.04
50 100 150 200
Time (s)

Input signal, u1 after linearization (range 500-2000 data)


1.5

1
TWIP system
Current (A)

0.5

Figure 2. Closed loop experiment of TWIP system -0.5

-1
50 100 150 200
Time (s)
5-bit PRBS signal Input signal, u2 after linearization (range 500-2000 data)
1.5 1.5

1
1
0.5
Current (A)
Amplitude

0
0.5
-0.5
0 -1

-1.5
-0.5 50 100 150 200
0 20 40 60 80 100 120 140 160 180 200
Time (s)
Time (s)

Figure 3. 5-bit PRBS signal Figure 5. Output and input signal after linearization (range 500-2000 data)

139
B. Model Structure Selection On the other hand, MISO Output-Error (OE) model
Parametric model describes a system in terms of differential structure [7], which is shown in Fig. 8, describes the system
and transfer function. There are few structures of the model dynamics separately. The MISO OE model formulation is
that can be used to represent certain system. Generally, shown in (5).
parametric model structure used is based on equation (1) [7].
B1 (z -1 ) B 2 (z -1 )
A (z-1)y(t ) = u1
(t) + u 2 (t ) + C(z-1)e (t ) (5)
F1 (z -1 ) F2 (z -1 )
B(z -1 ) C(z -1 ) (1)
A (z-1)y(t ) = u(t) + e (t )
F(z -1 ) D(z -1 ) Finally, the MISO Box-Jenkins (BJ) structure [7, 12]
shown in Fig. 9 provides a complete model with disturbance
where A(z-1) = 1+ a1z-1 + a 2z-2 + ... + a na z-na properties modelled separately from system dynamics.
Equation (6) shows the MISO BJ model.
B(z-1) = b1 + b2z-1 + b3z-3 + ... + bnbz-nb+1-d
C(z-1) = 1+ c1z-1 + c2z-2 + ... + cncz-nc
D(z-1) = 1+ d1z-1 + d2z-2 + ... + dnd z-nd B1 (z -1 ) B (z -1 ) C(z -1 )
A (z-1)y(t ) = -1
u1(t) + 2 -1 u 2 (t ) + e (t ) (6)
F(z-1) = 1+ f1z-1 + f 2z-2 + ... + f nf z-nf F1 (z ) F2 (z ) D(z -1 )

d is delay, na is number of poles, nb is number of zeroes, u(t) is


input of the system, y(t) is output of the system and e(t) is C. Parameter Estimation
white-noise disturbance value. Parameter estimation is a process to accurately estimate the
model parameter. Least square estimator, (LSE) [13], is a
The model order, which is 5, is obtained based on Akaike’s
common estimation method to successfully solve the parameter
Information Criterion, AIC [11]. The AIC formulation in
estimation problem in linear system identification [10].The
equation (2) has produced p=10, where na=5, and nb=5
basic notion of least squares is that parameter estimates is
chosen so that the model output agrees with the data as closely
as possible as measured by the sum of the squares of the
⎡ 1 N 2 ⎤⎛ p⎞ differences between them. The least squares technique was
AIC = log ∑ e (t ) ⎜ 1 + ⎟ (2) originally developed independently by Gauss and Legendre in
⎢⎣ N t =1 ⎥⎦⎝ N ⎠
the early 19th century. The concept of least squares analysis is
explained by Gauss in Theoria Motus Corporum Coelestium
[14]. Using LSE technique, the parameter values of a model
Where e(t) is the difference between estimation and validation can be defined as follows:
data, p is the number of parameters (na+nb) and N is number
of data. −1
N
Four linear models are considered in this study. Those LSE = θˆN = ∑ [ϕ (t ) y (t )][ϕ (t )ϕ T (t )] (7)
models are ARX, ARMAX, BJ, and OE model. In this paper, 1
each model employed same model order with multi input
single output model structure (MISO).
Firstly, the ARX model structure [7] shown in Fig. 6 is one Where θN is the matrix parameter of the model, and φ(t) is the
of the simplest parametric structures. In discrete-time, the matrix of input and output regressor, y(t-1), y(t-2), ..., y(t-
general MISO ARX model is shown in equation (3). na),u(t-1),…, u(t-nb)

D. Model Validation
A (z-1)y(t ) = B1 (z-1)u1(t) + B2 (z-1)u 2 (t ) + e (t ) (3) This is the final stage of system identification process. The
model validation verifies the identified model represents the
system under consideration adequately. This normally involves
The ARMAX model structure [7] shown in Fig. 7 includes statistical analysis of the residuals and predictive capabilities of
disturbance dynamics. ARMAX models are useful when the model. Unsatisfactory results at this stage will lead to
dominating disturbances that have enter early in the process. doubts about the model structure and estimation and may
The general formulation of the MISO ARMAX model is occasionally require re-examination of the experimental
shown in equation (4). design.
Validation for the TWIP model is taken from the second
and third part of measured input-output signal, zv3 and zv4.
Model validation is considered to check the validity between
A (z-1)y(t ) = B1 (z-1)u1(t) + B2 (z-1)u 2 (t ) + C(z-1)e (t ) (4)
the measured data and desired data under a validation
requirement. There a few criteria to acceptance or rejection of

140
e certain obtained model. Based on this paper, the model can be
accepted if 4 criteria are satisfied:
1
A
1) Criteria 1

Good percentage of best fit. More than 80% of best fit, the
U1 B1 y model is accepted[8].
+
A1

U2 B2
A2 ⎡ norm( yˆ − y ) ⎤ (8)
best fit = 100 × ⎢1 − ⎥%
⎣ norm( y − y ) ⎦
Figure 6. General MISO ARX model structure

wherey is output data of the system, ŷ is estimation output data


e and is mean of the output system.

2) Criteria 2

The final prediction error, FPE[11] estimates the model-


U1 y fitting error when the model is used to predict new outputs. An
+
optimal model is the one that minimizes the following
equation:
U2
⎛ ⎞ p
1 N
⎜ 1+⎟
∑ ( y − yˆ ) ⎜
Figure 7. General MISO ARMAX model structure 2
N ⎟
FPE =
N t =1 ⎜ p ⎟ (9)
⎜1 − ⎟
e ⎝ N ⎠

C
3) Criteria 3

The simplest validity check is by observing convergence of


U1 y training errors and assessing the prediction errors for test data.
+
The errors is evaluated using means square error, MSE[15].

U2
N
1
MSE =
N
∑ ( y − yˆ )
t =1
2
(10)
Figure 8. General MISO OE model structure

e 4) Criteria 4

Autocorrelation of residuals and cross correlation analysis


are acceptable to verify the stability of the model [7].

U1 y
+ III. RESULT AND DISCUSSION
The TWIP model is obtained by using the measured input-
U2 output data of TWIP mobile robot system as a reference. From
the set of input-output data in Fig 5, the mathematical
modeling of TWIP mobile robot is obtained based on the ARX,
Figure 9. General MISO BJ model structure ARMA, BJ, and OE MISO model.

141
For parameter estimation using LSE technique, the value of
parameter for all model shown in Table I. The maximum
model order is 5. The ARX model shows the 5 order model
with na =5 for output and nb=4 for both input. The ARMAX
model has 5 order with na=5, nb=5 for both input and nc=5for
disturbance. The BJ and OE model show the same result accept
the BJ has adding one set of D parameter value.
Model validation for all models can be discussed based on
the 4 criterions. Table II summarized all the criteria. Firstly, in
terms of percentage of best fit, more than 80% of best fit is
chosen as an indicator to accept a model. As shown in Fig. 10 Figure 10. Comparison graph between ARX, ARMAX, BJ and OE model
and Fig. 11, only ARX model is accepted as good percentage from validation data, zv3
of best fit.
According to Akaike’s, a model is selected based on the
smallest value of FPE. In this case, ARX model gives smallest
value of FPE, which confirm the second criteria discussed
above. The simplest validity check is by observing
convergence of training errors and assessing the prediction
errors for test data. The errors will be evaluated using MSE.
For the third criteria, the smallest error calculate by MSE is
given by ARX model.
The last criterion is regarding the autocorrelation and cross
correlation analysis. For autocorrelation analysis, graph of Figure 11. Comparison graph between ARX, ARMAX, BJ and OE model
correlation coefficients relating two versions of the same signal from validation data, zv4
plotted against a shift in time. Cross correlation analysis consist
a graph of correlation coefficients relating two different signals
plotted against the amount of time shift between them. The
both analysis is considered good when the signal response is
withinin the range set. From all the results, the ARX model has
fulfilled both analyses. Fig. 12 shows the cross correlation and
residual analysis for ARX model.
IV. CONCLUSION
Instead of the traditional approach, a mathematical model
of a TWIP mobile robot can be obtained using system
identification approach. From all analysis, the 5th order MISO
ARX model is the best model that satisfies all the criteria
needed for modelling the TWIP mobile robot using linear
identification.
ACKNOWLEDGEMENT
These authors are grateful to the Ministry of Higher
Education (MOHE) and Universiti Teknologi Malaysia for the
financial support through the GUP research fund, Vote Figure 12. Cross correlation and residual analysis for ARX model
Q.J130000.7123.02J71.

REFERENCES [4] Ha, Y.S. and Yuta, S, “Trajectory Tracking Control for Navigation of
the Inverse Pendulum Type Self-contained Mobile Robot”. Robotic and
[1] S. W. Nawawi, M. N. Ahmad, and J. H. S. Osman, “Real-Time Control Autonomous System, 17, pp. 65-80, 1996.
of a Two-Wheeled Inverted Pendulum Mobile Robot”, Proceedings Of
World Academy Of Science, Engineering And Technology vol.29, May [5] G. H. Shakouri and H. R. Radmanesh, “Identification of a continuous
2008, pp. 214-220. time nonlinear state space model for the extenal power system dynamic
equivalent by neural network,” Electrical Power and Energy Systems,
[2] Pathak, Kaustubh. Franch, Jaume. Agrawal, Sunil K, “Velocity and vol. 31, pp. 334-344, 2009.
position control of a wheeled inverted pendulum by partial feedback”
IEEE Transactions on Robotics, v 21, n 3, June, 2005, pp. 505-513. [6] L. A. Zadeh, “On the Identification Problem,” IEEE Transactions On
Circuit Theory, vol. 3, no 4, pp.277-281.1956.
[3] Grasser, F., D’Arrigo, A., Comlombi, S., and Rufer, A, “Joe: A mobile
inverted pendulum”, IEEE Trans. Electronics, vol. 49, no 1, Feb 2002, [7] L. Ljung, System Identification Theory for the User, 2nd ed., Prentice
pp. 107-114. Hall, CA: Linkoping University Sweden, 1999.

142
TABLE I. MATHEMATICAL MODELING OF ARX, ARMAX, BJ, AND OE
Model Mathematical modeling
ARX
A(z-1 ) = 1 - 2.41z-1 + 1.80z-2 - 0.20z-3 - 0.23z-4 +0.06z-5
A z-1 y t =B1 z-1 u1 t +B2 z-1 u2 t +e t
(z-1 ) = 0.01 - 0.02 z -1 + 0.02 z -2 + 0.01 z -3

B2 (z-1 ) = - 0.01 + 0.02 z -1 - 0.01z -2 - 0.01 z -3

ARMAX
A(z-1 ) = 1 - 1.94 z-1 + 0.49 z-2 + 1.14 z-3 - 0.79 z-4 + 0.14 z-5
-1 -1 -1 -1
A z y t =B1 z u1 t +B2 z u2 t +C(z )e t
(z-1 ) = 0.06 - 0.12 z-1 + 0.03 z-2 + 0.09 z-3 - 0.05 z-4

(z-1 ) = - 0.06 + 0.12 z-1 - 0.02 z-2 - 0.09 z-3 + 0.05 z-4

C(z-1 ) = 1 + 0.90 z-1 + 0.78 z-2 + 0.64 z-3 + 0.64 z-4 + 0.50 z-5

BJ
B1 (z-1 )=0.24 - 0.50 z-1 + 0.04 z-2 + 0.46 z-3 - 0.24 q-4

B2 (z-1 ) = -0.24 + 0.37 z-1 - 0.05 z-2 - 0.09 z-3

C(z-1 ) = 1 - 0.39 z-1 - 0.54 z-2 + 0.30 z-3 + 0.73 z-4- 0.47 z-5

D(z-1 ) = 1 - 0.82 z-1 - 0.40 z-2 + 0.48 z-3 + 0.61z-4 - 0.71 z-5

(z-1 ) = 1 - 1.71 z-1 - 0.19 z-2 + 1.57 z-3 - 0.66 z-4

(z-1 ) = 1 - 1.25 z-1 + 0.09 z-2 + 0.19 z-3 + 0.03 z-4 + 0.017 z-5

OE
B1 (z-1 )=0.24 - 0.50 z-1 + 0.04 z-2 + 0.46 z-3 - 0.24 q-4

B2 (z-1 ) = -0.24 + 0.37 z-1 - 0.05 z-2 - 0.09 z-3

C(z-1 ) = 1 - 0.39 z-1 - 0.54 z-2 + 0.30 z-3 + 0.73 z-4- 0.47 z-5

(z-1 ) = 1 - 1.71 z-1 - 0.19 z-2 + 1.57 z-3 - 0.66 z-4

(z-1 ) = 1 - 1.25 z-1 + 0.09 z-2 + 0.19 z-3 + 0.03 z-4 + 0.017 z-5

TABLE II. SUMMARY ANALYSIS OF ARX, ARMAX, BJ AND OE MODEL IN SYSTEM IDENTIFICATION FOR VALIDATION
Model Validation Criteria
FPE MSE Best Fit, zv1 (%) Best Fit, zv2 (%) Autocorrelation Cross correlation
ARX 9.85e-007 9.30e-007 81.32 83.15 Good Good
ARMAX 1.06-e-006 9.84e-006 79.78 79.98 Bad Good
BJ 2.12e-005 1.90e-005 69.55 65.06 Good Bad
OE 4.57e-005 4.21e-005 69.55 65.06 Bad Bad

[8] H. J. Palanth, S. Lacy, J. B. Hoagg and D. S. Bernstein, “Subspacebased Transactions on Automatic Control, vol.19, no. 6, pp. 716–723, 1974.
Identification for Linear and Nonlinear Systems,” American Control [12] Box, G. E. P. And Jenkins, G. M.,1970, Time Series Analysis,
Conference, pp. 2320-2334, 2005. Forecasting and Control,3rd ed., Holden-Day, San Francisco, 1970.
[9] T. G. Ling, M. F. Rahmat, A. R. Husain, R. Ghazali, “System [13] L,Ljung., “Consistency of the least-squares identification method” IEEE
Identification of Electro-Hydraulic Actuator Servo System” Trans. Automatic Control, AC-21 :779-78, 1976b.
International Conference on Mechatronics (ICOM), 2011.
[14] Gauss, K. G., "Theory of Motion of Heavenly Bodies." Dover, New
[10] Mohd Fahmy Izwan (2009), “System identification and estimation of a York, 1963.
hot air blower system using parametric method” Universiti Teknologi
Malaysia: Thesis. [15] L,Ljung., “Asymptotic variance expressions for identified black-box
transfer function models” IEEE Trans. Automatic Control, AC-30 :834-
[11] H. Akaike, “A new look at the statistical model identification,” IEEE 844, 1985b.

143

You might also like