dynamic modelling and optimal controlscheme of wheel inverted pendulum for mobile robot application

20
International Journal of Control Theory and Computer Modeling (IJCTCM) Vol.3, No.6, November 2013 DOI : 10.5121/ijctcm.2013.3601 1 DYNAMIC MODELLING AND OPTIMAL CONTROL SCHEME OF WHEEL INVERTED PENDULUM FOR MOBILE ROBOT APPLICATION Mohamad Amir Shamsudin* 1 , Rosbi Mamat* 2 , and Sophan Wahyudi Nawawi* 3 * Department of Control and Mechatronics, Faculty of Electrical, Universiti Teknologi Malaysia, Johor, Malaysia Abstract Unstable wheel inverted pendulum is modelled and controlled deploying Kane’s method and optimal partial-state PID control scheme. A correct derivation of nonlinear mathematical model of a wheel inverted pendulum is obtained using a proper definition of the geometric context of active and inertia forces. Then the model is decoupled to two linear subsystems namely balancing and heading subsystems. Afterward partial-state PID controller is proposed and formulated to quadratic optimal regulation tuning method. It enables partial-state PID to be optimally tuned and guarantees a satisfactory level of states error and a realistic utilization of torque energy. Simulation and numerical analyses are carried out to analyse system’s stability and to determine the performance of the proposed controller for mobile wheel inverted pendulum application. KEYWORDS Wheel inverted pendulum, Kane’s method, partial -state PID, quadratic optimal regulation tuning 1. INTRODUCTION The application of wheel inverted pendulum (WIP) robot gains high attention from industry and research communities. Recently, many WIP-based products are available in industry such as human transporter by Karmen and service robot by Hitachi’s Mechanical Engineering Research laboratory. They believe this high manoeuvrability wheel system will be the future urban robot and transporter and even in rural places with rough terrain. Meanwhile in research community, WIP system has been extensively studied because this simple structure robot serve complex dynamic [1]. Thus many comprehensive research materials can be found and mainly for modelling and control aspects. Over a decade, various types of WIP have been developed along with their mathematical model [2-5]. The modelling focuses either on kinematic [6, 7] or dynamic issues. In dynamic aspect, Lagrange [8, 9], Lagrage-Eular [10], and Newton-Eular [11] used to develop nonlinear WIP mathematical model. However Newton method involved the calculation of unwanted forces and Lagrange method used Lagrange multiplier in their derivation. Consequently those methods required tedious and complicated formulation of a large multibody system, hence led to inefficient computation. Thus, Kane method is the alternative because of its simpler and efficient mathematical analysis where it is based on partial velocity in multibody dynamic modelling [12]. However, less attention on torque context in term of differential drive nonholonomic and mobile system led to an unaccurate dynamic equation [13]. Thus this paper defines a proper torque

Upload: ijctcm

Post on 06-Jul-2015

322 views

Category:

Technology


4 download

DESCRIPTION

Unstable wheel inverted pendulum is modelled and controlled deploying Kane’s method and optimal partial-state PID control scheme. A correct derivation of nonlinear mathematical model of a wheel inverted pendulum is obtained using a proper definition of the geometric context of active and inertia forces. Then the model is decoupled to two linear subsystems namely balancing and heading subsystems. Afterward partial-state PID controller is proposed and formulated to quadratic optimal regulation tuning method. It enables partial-state PID to be optimally tuned and guarantees a satisfactory level of states error and a realistic utilization of torque energy. Simulation and numerical analyses are carried out to analyse system’s stability and to determine the performance of the proposed controller for mobile wheel inverted pendulum application.

TRANSCRIPT

Page 1: Dynamic modelling and optimal controlscheme of wheel inverted pendulum for mobile robot application

International Journal of Control Theory and Computer Modeling (IJCTCM) Vol.3, No.6, November 2013

DOI : 10.5121/ijctcm.2013.3601 1

DYNAMICMODELLING ANDOPTIMAL CONTROLSCHEME OFWHEEL INVERTED PENDULUM FOR

MOBILEROBOT APPLICATIONMohamad Amir Shamsudin*1, Rosbi Mamat*2, and Sophan Wahyudi Nawawi*3

*Department of Control and Mechatronics, Faculty of Electrical,Universiti Teknologi Malaysia, Johor, Malaysia

Abstract

Unstable wheel inverted pendulum is modelled and controlled deploying Kane’s method and optimalpartial-state PID control scheme. A correct derivation of nonlinear mathematical model of a wheel invertedpendulum is obtained using a proper definition of the geometric context of active and inertia forces. Thenthe model is decoupled to two linear subsystems namely balancing and heading subsystems. Afterwardpartial-state PID controller is proposed and formulated to quadratic optimal regulation tuning method. Itenables partial-state PID to be optimally tuned and guarantees a satisfactory level of states error and arealistic utilization of torque energy. Simulation and numerical analyses are carried out to analysesystem’s stability and to determine the performance of the proposed controller for mobile wheel invertedpendulum application.

KEYWORDS

Wheel inverted pendulum, Kane’s method, partial-state PID, quadratic optimal regulation tuning

1. INTRODUCTION

The application of wheel inverted pendulum (WIP) robot gains high attention from industry andresearch communities. Recently, many WIP-based products are available in industry such ashuman transporter by Karmen and service robot by Hitachi’s Mechanical Engineering Researchlaboratory. They believe this high manoeuvrability wheel system will be the future urban robotand transporter and even in rural places with rough terrain. Meanwhile in research community,WIP system has been extensively studied because this simple structure robot serve complexdynamic [1]. Thus many comprehensive research materials can be found and mainly formodelling and control aspects.

Over a decade, various types of WIP have been developed along with their mathematical model[2-5]. The modelling focuses either on kinematic [6, 7] or dynamic issues. In dynamic aspect,Lagrange [8, 9], Lagrage-Eular [10], and Newton-Eular [11] used to develop nonlinear WIPmathematical model. However Newton method involved the calculation of unwanted forces andLagrange method used Lagrange multiplier in their derivation. Consequently those methodsrequired tedious and complicated formulation of a large multibody system, hence led toinefficient computation. Thus, Kane method is the alternative because of its simpler and efficientmathematical analysis where it is based on partial velocity in multibody dynamic modelling [12].However, less attention on torque context in term of differential drive nonholonomic and mobilesystem led to an unaccurate dynamic equation [13]. Thus this paper defines a proper torque

Page 2: Dynamic modelling and optimal controlscheme of wheel inverted pendulum for mobile robot application

International Journal of Control Theory and Computer Modeling (IJCTCM) Vol.3, No.6, November 2013

2

geometric context of WIP system, eventually this definition leads to a correct solution of thenonlinear WIP mathematical model.

In control aspect, advanced and robust control schemes designed to control WIP system. It weresliding mode control (SMC) [14], backsteping control [15], fuzzy logic control (FLC) [16], andneural network control (NN) [17]. However, most of those control schemes need highcomputationally effort even for single state control [18]. This prevented it to be programmed as alow level controller in an embedded WIP system. Thus linear controller such as LQR and PIDcontrollers are more favourable for this fast system [19-21]. Many researches preferred andshowed that the LQR as a modern controller gave better performance compared to conventionalPID controller [22-24]. However the research overlooked the applicability of LQR controller ininput trajectory tracking where the significant state trajectory errors occur [25]. Thus this paperproposes partial-state PID (PSPID) controller to eliminate the aforementioned problem. Besides,the controller is formulated to quadratic optimal regulation (QOR) tuning scheme where itguarantees system stability and satisfactory level of WIP performance.

This paper is organized as follows: development of nonlinear WIP mathematical model ispresented in section 2; section 3 provides a formulation of proposed PSPID controller for theQOR tuning method; the analysis of the model and the proposed controller is demonstrated bysimulation in section 4; and the conclusion of this paper is in the last section.

2. WHEEL INVERTED PENDULUM ROBOT

Generally, the outline of Kane’s method can be found in following literatures [12, 13]. Thus thispaper will only concentrate on the development of a WIP mathematical model of Kane’s method.Notation: Throughout this section, iC and iS indicate cos and sin functions with φ== 2i and

θ== 3i . Body iB and point iP refer to bodies B , 1W , 2W and points G , C1W , and C2W .

2.1. Kinematic of WIP

As shown in Fig. 1, WIP consists of three bodies: the pendulum, B, as the main body and the twowheels, 1W and 2W . The important points where the gravitational force, g is detected are thecentre of right wheel, C1W , the centre of left wheel, C2W , and the centre of gravity of the mainbody G ; point C , the point where the torque exerted from wheels to pendulum in the form offorce. Other vital points on the right and left wheel’s surfaces are P1W and P2W . 1P

~W and 2P~W

are any point on the right and left wheels. WIP mechanical parameters tabulate in Table 1. TheWIP has 5 degrees of freedoms, hence the independent generalized coordinates are

( ) ( ) ,5;,,,,,,, 2121 =ϕϕθφ== nxqqqq WWnn (1)

The following assumptions have been made to model the WIP:

1) The linear motor model considered, motor inductance and friction on the armature areneglected.2) No slip and wheels always in contact with the ground3) At every instant, WIP experiences forward and steering forces.4) Cornering force is neglected

Page 3: Dynamic modelling and optimal controlscheme of wheel inverted pendulum for mobile robot application

International Journal of Control Theory and Computer Modeling (IJCTCM) Vol.3, No.6, November 2013

3

Based on the 2nd and 3rd assumptions, the constraints 2m = and the nonholonomic constraints are

,0ˆˆˆ

,0ˆˆˆ222

~

111~

=−−

=−−

PxPP

PxPP

WFWFWF

WFWFWF

ωωω

ωωω(2)

Table 1.WIP mechanical parameters.

Symbol Parameter Valuemb Mass of body 15kg

mw Mass of wheel 0.42kg

L Half of lateral body 0.2m

R Radius of wheel 0.106m

Ib2 Inertia of main body in n2 directional 0.63kgm2

Ib3 Inertia of main body in n3 directional 1.12kgm2

g Gravitational constant 9.81ms-2

d A distance between point C and COG of main body 0.212m

iPWF ω~ˆ is an angular velocity of point iP

~W on the right and left wheels with respect to reference

frame F. xPWF ω 1ˆ and φ1ˆ PWF ω are angular velocities of points sP1W on the right and left wheelswith respect to frame F that due to forward motion and steering motion. Based on (1) and (2), thegeneralized speeds, ru , are

( ) ( ) ,;,,,,, 21 mnrxuuuu rr −=θφ== (3)

The velocity, angular velocity and angular acceleration of point C with respect to referenceframe F are

(a) (b)

Figure 1. (a) Available WIP in UTM laboratory, and (b) free body diagram of WIP in newton FrameF.

Page 4: Dynamic modelling and optimal controlscheme of wheel inverted pendulum for mobile robot application

International Journal of Control Theory and Computer Modeling (IJCTCM) Vol.3, No.6, November 2013

4

222

222

1

2

2

1

nf

nf

n

uu

uu

uv

CF

CF

CF

==α

==ω

=

(4)

From (2), angular velocity of points 1P~W and 2P

~W with respect to reference frame F are

( )

( ) ,1ˆ

,1ˆ

31222

31222

2~

1~

nnn

nnn

31

31

RuCS

R

Lu

RuCS

R

Lu

P

P

WF

WF

−+−=ω

−+−−=ω(5)

The angular velocity of robot main body and two wheels with respect to reference frame F are

,1ˆˆˆ

,1ˆˆˆ

,ˆˆˆ

22231

22231

322

2~

2

1~

1

−++−=ω+ω=ω

+−+−=ω+ω=ω

−=ω+ω=ω

132

132

3

nnnn

nnnn

nn

R

LS

R

LCu

Ru

R

LS

R

LCu

Ru

uu

P

P

WFCFWF

WFCFWF

GCCFBF

(6)

GC ω is an angular velocity of point G with respect to robot point C . Based on a rigid bodymotion solution in 3D space, the velocity of the COG of the main body and the centre of twowheels with respect to reference frame F can be formulated as

( ),,,;ˆˆˆˆˆ 21 CCiPiCPiCFCFPiF WWGPvrvv =+×ω+= (7)

Pir and PiC v are the displacement and velocity of point iP with respect to point C . The

centre of wheels are fixed with respect to point C , i.e 0ˆ =CiWC v , Thus

( )

,ˆˆˆˆ

,ˆˆˆˆ

,ˆˆˆˆˆˆ

21

21

333321

22

11

11

11

2131

nn

nn

nnnn

LuuLvv

LuuLvv

dSdCudSuuddvv

CC

CC

WCCFCFWF

WCCFCFWF

GCGCGCCFCFGF

−=×ω+=

+=×ω+=

−+−=×ω+×ω+=

(8)

GCd and CiWC L are displacements of the COG of main body and the centre of wheels withrespect to point C . The angular acceleration of the main body and the wheels are

,ˆˆˆˆ

,ˆˆˆˆ

,ˆˆ

3221

212122

3221

212122

322

2~2

2

1~1

1

nnn

nnn

nn

2

2

3

R

LCuuu

R

uuLSu

dt

d

R

LCuuu

R

uuLSu

dt

d

uudt

d

P

P

WFCFWFWF

WFCFWFWF

BFBF

−−+

−−=ω×ω+ω=α

+−+

−=ω×ω+ω=α

−=ω=α

(9)

Page 5: Dynamic modelling and optimal controlscheme of wheel inverted pendulum for mobile robot application

International Journal of Control Theory and Computer Modeling (IJCTCM) Vol.3, No.6, November 2013

5

From (7) the acceleration of the COG of main body and centre of two wheels with respect toreference frame F can be formulated as

( ) ( ),,,;ˆˆˆˆˆˆˆˆˆˆ 21 CCiPiCPiCCFPiCFCFPiCFCFPiF WWGPavrraa =+×ω+×ω×ω+×α+= (10)

CF a is an acceleration of point C with respect to frame F and dtvda PiCPiC ˆˆ = is an

acceleration of point iP with respect to point C . Based on aforementioned fact, 0ˆ =CiWC a , thus

( )( ) ( ) ( )

( ) ( )

( ) ( ) ,ˆˆˆˆˆˆˆ

,ˆˆˆˆˆˆˆ

,

,ˆˆˆˆˆˆˆˆˆˆ

32

121

32

121

333232232

33132

32

331

2222

2111

332

nn

nn

nnn

LuLuuLLdt

vda

LuLuuLLdt

vda

dCuudSudCudSudSudSudCuu

avdddt

vda

CCC

CCC

WCCFCFWCCFCFWF

WCCFCFWCCFCFWF

GCGCCFGCCFCFGCCFCF

GF

+−=×ω×ω+×α+=

−+=×ω×ω+×α+=

+−+−−−+=

+×ω+×ω×ω+×α+=

(11)

Partial velocity and partial angular velocity of the main body and the wheels can be obtained bydifferentiating (4), (6) and (8) with ru as shown below.

( )

( ),,,,),3,2,1(;ˆ~

,,,,),3,2,1(;ˆ~

21

21

WWABBru

WWCGPru

vv

i

r

BiFBir

F

CCi

r

PiFPi

rF

==∂

ω∂=ω

==∂

∂=

(12)

2.2. Dynamic of WIP

WIP lies under differential drive type of mobile robot. Thus generated torque, τC, from the motorsto the robot can be represented as

,yawpitchC τ+τ=τ (13)

The yaw torque, yawτ , and pitch torque, pitchτ , are the torques that cause WIP steers by , ϕ, in 2f

directional and move with velocity Cv in 1n directional as shown in Fig. 1(b). However, pitchtorque exerts to robot main body in the form of force. Therefore at every instant, this robotexperiences both forward force and steering torque. Based on Fig. 1(b) and the assumptions, theactive forces are

,ˆ,ˆ,ˆ

,ˆ,ˆ

2

1

321

321

2

2

2

321

321

n

n

n

nnn

nnn

gmR

gmR

gmR

T

R

BB

Ww

Ww

C

C

−=

−=

−=

δ+δ+δ=

γ+γ+γ=

(14)

Page 6: Dynamic modelling and optimal controlscheme of wheel inverted pendulum for mobile robot application

International Journal of Control Theory and Computer Modeling (IJCTCM) Vol.3, No.6, November 2013

6

Where

( ) ( )

=τ−τ=−

=τ+τ=+=γ

otherwise,0

,2;

otherwise,0

,1;

22 iCR

LLCFF

iR

FF

wlwrwlwri

wlwrwlwr

i

(15)

CR and CT are the force and torque exerted on the main body by wheel,1

ˆwR ,

wR and BR are

forces exerted on the wheel and body by the gravity. wrF and wlF are translated forces fromthe wheels torque. The inertia force and inertia torque of the main body and the wheels are

( )

( ),,,;ˆˆˆˆˆˆ

,,,;ˆˆ

21*

21*

WWBBIIT

WWGPamR

iBiF

BiBiF

BiBiF

Bi

CCiPiF

PiPi

=ω⋅×ω−⋅α=−

=⋅−=(16)

Where BG mm = , WW mmCi

= , 3322 nnnn 32ˆ

bbBi III += and 3322 nnnn32

ˆWWW III

i+= . The inertia of

the wheels is considered as 22 42

LmRmI WWW += and 423

RmI WW = . The generalized active

force and inertia force are given as

( ) ( )

( ) ( ),,,,,,),3,2,1(;ˆ~ˆ~

,,,,,),3,2,1(;ˆ~ˆ~

2121*

1

*

1

*

2111

WWBBWWGPrTRvF

CBWWCGPrTRvF

iCCiBi

k

i

Bir

FPi

j

i

Pir

Fr

iCCiBi

k

i

Bir

FPi

j

i

Pir

Fr

===⋅ω+⋅=

===⋅ω+⋅=

∑∑

∑∑

==

== (17)

Where j is the number of points subjected to applied forces and k is the number of rigid bodiessubjected to applied torques. Three motion equations of WIP (19) are obtained by equating thedynamic equation of motion (18),

,0* =+ rr FF (18)

( )

( ) ( ) ( )

( ) ,

,222

,22

3322

332

3

3322

32

22

2222

3

322

32

3

CSdmdgSmIdmxdCm

CSdmR

LCI

R

LCIILmdSm

SdmR

CdmxR

Imm

bbbbb

bwlwrwwbwb

bwlwr

bw

wb

φ+=θ++

φθ−τ−τ=φ

++++

θ+φ+τ+τ=θ+

++

(19)

Page 7: Dynamic modelling and optimal controlscheme of wheel inverted pendulum for mobile robot application

International Journal of Control Theory and Computer Modeling (IJCTCM) Vol.3, No.6, November 2013

7

Then state space representation of the WIP (20) is solved using Cramer rule. The matrix variablesare listed as in the appendix.

,

0

0

0

0

00

00

00

00000

100000

0000

001000

0000

000010

),()(),()(),()(

4

2

6261

4241

2221

66

4644

2624

+

ττ

+

φφθθ

=

φφθθ

++=

F

F

BB

BB

BBx

x

A

AA

AAx

x

tfttttt

wl

wr

xuxBxxAx

(20)

3. PARTIAL STATE-PID CONTROLLER

Notation: Throughout this section, i index indicates the balancing and heading subsystems byequalized it to θ and φ .

3.1. Linear WIP model

To design a linear controller, the nonlinear WIP model is linearized by setting tilt angle, 0≈θ ,and heading angle, 0≈ . The linear WIP system can be represented into two subsystems, first is“balancing” subsystem which is regarding the rotation and motion about 3n and 1n directionaland second is “heading” subsystem which is describing the rotation about 2n directional. Thesesubsystems can be formulated as

( ))()(

,,);()()(

tt

ittt

iii

iiiii

xCy

uBxAx

=φθ=+=

(21)

Here iA , iB and iC are state constant system matrix, system input matrix and system output

matrix with appropriate dimension. ini R∈x and R∈iu are defined as state variable and control

input with in number of state variables. The state vector of balancing and heading subsystems are

( )θθ=θ ,,, xxx and ( )φφ=φ

,x . The characteristic polynomial of both subsystems given as

( ) ,)det( 11

10 iiii

innin

in

ii asasasas ++++=− −− AI (22)

Where ][ 10 iiniii aaa =a is a characteristic vector with coefficients 10 =ia , )det( iinia A−=

and )(1 ii tracea A−−= . Both balancing and heading subsystems are

,0

00

10

,0

0

000

1000

000

0010

61

41

21

43

23

φ

θ

+

φφ

=

φφ

+

θθ

=

θθ

uB

u

B

Bx

x

A

Ax

x

L

L

L

L

L

(23)

Page 8: Dynamic modelling and optimal controlscheme of wheel inverted pendulum for mobile robot application

International Journal of Control Theory and Computer Modeling (IJCTCM) Vol.3, No.6, November 2013

8

Equation (23) showed 4=θn for balancing subsystem and 2=φn for heading subsystem.The matrix variables are listed as in the appendix. Using decoupling technique, the relationship ofcontrol input and φu to the wheel torques are

,5.05.0

,5.05.0

φθ

φθ

−=τ

+=τ

uu

uu

wl

wr(24)

3.2. Augment subsystem with PSPID

Fig. 2 shows closed loop WIP system. In such in order system, input matrix, ir , and proposedPSPID controller are

( ) ( )

,

00

00

00

,,];00[

)1(31

)1(31

)1(31

11

=

=

φθ==

nDiDiDi

nIiIiIi

nPiPiPi

i

i

i

niiT

i

KKK

KKK

KKK

irr

D

I

P

PIDi

K

K

K

K

r

(25)

1ir , , ( )1−inir are the input variables, iPK , iIK , and iDK are proportional, integral and derivative

gain vector of PSPID controller. Based on (23) and (25), the PID controllers for the balancing and

heading subsystems are [ ]TDIP KKK 1111 θθθθ =PIDK , [ ]TDIP KKK 3333 θθθθ =PIDK and

[ ]TDIP KKK 1111 φφφφ =PIDK . The control input iu is

,)()()( iiiiiiiidt

ddtuii

yrKyrKyrK DIP −+−+−= ∫ (26)

The output matrix is )()()( tttoiniii xxCy == where T

niiin ioxx ]00[ )1(1 −= x . For simplicity,

set all input variable to zero (ini 0r = ), hence the control input is

,∫−−= dtu iiniini yKxK IPD (27)

ṡ=y is defined, hence (27) will be,iiniiniu sKxK Ip −−= (28)

The second term in (28) can be simplified to a scalar by a following formula

Figure 2. Closed loop WIP structure with PSPID.

Page 9: Dynamic modelling and optimal controlscheme of wheel inverted pendulum for mobile robot application

International Journal of Control Theory and Computer Modeling (IJCTCM) Vol.3, No.6, November 2013

9

( )

,

),sss(s

)1(13311

)1(13311

−−

−−

ς++ς+ς=

β++β+β′=′′

ii

ii

ni)Ii(niIiiIi

niniiiiiIiiIi

KKK

KK

(29)

iinβ is a coefficient with arbitrary selected value. Thus input signal iu is

[ ][ ],)(s),(),(

,

;

1

)1(11

ttxtx

KKKK

u

iniT

i

InDDPi

iii

ii

iiiii

′=

′=

−=

x

K

xK

(30)

It is obvious in (29) si’=βisi, thus

( )[ ],00

;

11 −ββ=

===

ii

i

nii

iiiiiiis

β

β

C

xCxCβsβ(31)

Based on above formulation, equivalent 1+in order subsystem dynamic can be formulated fromthe combination of the original state (23) and (31). The 1+in state vector is written as

),(0)(

)(

0

0

)(

)(

,

tuts

t

ts

t

u

ii

i

ii

i

i

iiiii

i

+

=

+=

BxC

Ax

BxAx

β

(32)

Hereiinβ is set to one. The output matrix iC is set to

;10

0

= i

i

CC (33)

The rank of controllability matrix ][ 2i

niiii

iii

BABABAB of system (32) is 1+in . This

means the linear system (32) is completely controllable.

3.3. Optimal PSPID

To apply QOR tuning method, Frobenius Canonical form of system (32) is considered byfollowing transformation.

,iii xTz = (34)

Where )1( ×ii mz and )( iii mm ×T are transformation state variable vector and transformationmatrix. Index 1+= ii nm , and iT matrix define as

,; 1

1

=

=iiini

i

cT

nii

ii

i

i

A

AWeq

q

q

q

T 1

1

1

1

(35)

1qi

is im×1 vector, ][ im

iiici

iiBABABW = and unit vector ]100[ =

iine , the

Frobenius canonical form of WIP subsystems can be express as

Page 10: Dynamic modelling and optimal controlscheme of wheel inverted pendulum for mobile robot application

International Journal of Control Theory and Computer Modeling (IJCTCM) Vol.3, No.6, November 2013

10

,iiiii uCC BzAz += (36)

Where

,

1

0

0

,

1000

0100

0010

1)2()1(

==

α−α−α−α−

==

−−

iii

imimiim

iiii

iii

BTB

TATA

c

1c

(37)

The input signal is

[ ][ ],)()(),(

,

;

21

)1(21

tztztz

KKKK

u

i

ii

imiiT

i

CimmCiCiCii

iii

=

=

−=

z

K

zKC

(38)

And also feedback gain

,1C TKK −= iii (39)

The desired m order characteristic equation of matrix iii CCC KBA − is

),()()()det( 12)1(1

1 ciimcimim

cimim

i KsKsKsAsIii

ii

i +α++α+++α+=− −− (40)

As shown, system (32) is completely controllable, then iCK can be tuned by QOR method. TheQOR problem is a quadratic performance index function for the integral function. The index is inthe form of quadratic performance of continuous-time linear time-varying function.

( )∫ ++= ft

iiTiii

Tifiif

Ti dttututtttI

0)()()()(

2

1)()(2

1 RzQzzPz f(41)

Where the final time,ft , is fix. ifP , iQ , are chosen to be symmetry positive semidefinite, and iR to

be symmetry positive definite. The QOR optimal control problem is to drive the state vector)(tiz to the origin from any nonzero initial values of states. The problem objective is to find )(tu i ;

ftt ≤≤0 , such that the objective function (41) is minimized. Choosing the appropriate weighting

matrix iQ , iR , and therefore get the optimal control rate with optimal control theory. For aninfinite time

ft , ifP must satisfy following reduced Riccati equation.

01 =+−+ −ii

Tiiiii

Tii

QPBRBPAPPA fcfcff cc(42)

Page 11: Dynamic modelling and optimal controlscheme of wheel inverted pendulum for mobile robot application

International Journal of Control Theory and Computer Modeling (IJCTCM) Vol.3, No.6, November 2013

11

With predetermined weighted matrix, optimal control is)()()( 1

fiifiiT

ii tttui

zKzPBR Cfc−=−= − (43)

The control law makes the linear feedback system stable, then by adopting Lyapunov second law,the nonlinear feedback system is stable. Weighting matrix iQ and iR are

[ ]1122

11

;

00

0

0

00

rR

q

q

q

Q

iimm

=

=

(44)

Finally, based on (39) and (30), PSPID controller is directly tuned for subsystems (23). Theformulation makes the proposed controller has both of PID controller and QOR advantages.

Following steps can be applied to tune PID controller using QOR technique:

Step 1. Construct im order system (32) from the combination of the original system (23) and (31).Step 2. Transform this im order system to a Frobenius Canonical form based on transformationformula (34).Step 3. Tune icK gain by appropriately tuning iQ and iR (44) matrices.

Step 4. Compute iK in (30) from icK by transformation formulation (14).Step 5. Lastly Based on (30), set PID gains (25) accordingly.

4. RESULT AND DISCUSSION

4.1. Model analysis

In QOR tuning scheme, )3.46565.2287,2.583,83.112,(diag=θQ , )10.01,(diag=φQ and

10×1 -3== φθ RR were set for LQR controllers. For PSPID controller, the matrices sQ are

)0.013.4656,5.2287,2.583,83.112,(diag=θQ , )0.011,0.01,(diag=φQ and 10×1 -3== φθ RR . Thus the

following LQR and PSPID controller are obtained:

euBeAe +=

K−

u x

Figure 3. Equivalent 1+in order error vector of system (2) with PID controller

Page 12: Dynamic modelling and optimal controlscheme of wheel inverted pendulum for mobile robot application

International Journal of Control Theory and Computer Modeling (IJCTCM) Vol.3, No.6, November 2013

12

[ ] [ ]

,

1.3

1.1

8.11

,

5.21

3.18

0.106

;

9.18

3.18

1.27

,12,4.493;129,4.493,8.106,2.91

1

31

=

−−

−=

−−−

=

−=−=

φ

θθ

φθ

PID

PIDPID

K

KK

KK

4.1.1. Open loop stability

The stability of WIP depends on the balancing of its main body. To investigate this behaviour, the

pole analysis of the balancing submatrix, ′θA , from constant matrix θA was conducted. The

poles are obtained by solving following equation

,01

det]det[43

=

−=′− θθ sA

ss

Ln AI (45)

Thus the poles are

( )( )( ) ( )

( )( )( ) ( )

,3

3

,3

3

23

22

23

21

dmIdmmm

dgmmms

dmIdmmm

dgmmms

BBbWB

bWB

BBbWB

bWB

−++

+−=

−++

+=

θ

θ

(46)

This showed one of its pole was positive. The fact shows, if the WIP not accelerates (ie. 0=θu ),the robot body will fall. Another fact is the mass of robot body, the mass of the wheel and theCOG of the main body will determine the magnitude of this pole.

4.1.1.1. Effect of main body COG on tilt angle, θ, control

Firstly, robot body was assumed as a point of mass, 23 dmI bb = . Therefore the unstable pole was

( )( )

,6

31

dmm

gmms

wb

wb

+

+=θ (47)

The value of the pole is tabulated in table 2 as d change, ]2,1.[od ∈ .

Table 2.Variation of unstable pole over d.

d(m) 0.1 0.3 0.5 0.7 0.9 1.1

Sθ1 9.542 5.509 4.267 3.606 3.181 2.877

From the table 1, pole became larger when d was shorter. This matches the fact that the robot willbe harder to balance when COG of the main body is lower as shown in Fig. 3. However for higherd, larger torque will be required.

Page 13: Dynamic modelling and optimal controlscheme of wheel inverted pendulum for mobile robot application

International Journal of Control Theory and Computer Modeling (IJCTCM) Vol.3, No.6, November 2013

13

Proof: To hold the pendulum at vertical, defines the displacement of point C , Cx must be equal tocircumference, dC , that had been made by θ at point d .

,dCx dC θ=≡ (48)

Thus

,22 t

dm

t

xmamF bCb

CbCθ=== (49)

It is proven by newton's law, larger force is required if d becomes larger.

4.1.1.2. Effect of mass of body on tilt angle, θ, control

Table 3 below shows that when the mass of the body increase to 20kg the unstable pole onlyincrease about 1 from its initial value. Thus the effect is less significant on the tilt angle balancingcontrol. This is true as shown in Fig. 4(a).

Table 3. Variation of unstable pole over mb.

mb(kg) 1 2 4 6 10 20

Sθ1 5.451 5.777 6.110 6.279 6.451 6.609

4.1.1.3. Effect of mass of wheel on tilt angle, θ, control

Table 4 shows that when the mass of wheel increase to 2kg the unstable pole only decreases about0.6 from its initial value. Thus the effect is less significant on the tilt angle balancing control asshown in Fig. 4(b).

Table 4. Variation of unstable pole over mw.

mw(kg) 0.2 0.4 0.6 0.8 1 2

Sθ1 6.675 6.564 6.465 6.377 6.298 5.999

4.1.1.3. Inertia forces over initial condition

From the model, the motors need to generate enough amount of torque to compensate inertiaforces, F*1, F*2, and F*3 while balancing and moving in the Cartesian plane. Thus these inertiaforces were analysed over three initial conditions of position, x, tilt angle, θ, and heading angle,ϕ. Three initial conditions are considered, (x,θ,ϕ)=(0.01745m,0,0), (x,θ,ϕ)=(0,0.01745rad,0),and (x,θ,ϕ)=(0,0,0.01745rad).

Page 14: Dynamic modelling and optimal controlscheme of wheel inverted pendulum for mobile robot application

International Journal of Control Theory and Computer Modeling (IJCTCM) Vol.3, No.6, November 2013

14

Fig. 5 shows the effect of these three initial conditions. In this work, WIP’s motors havemaximum torque Nmwr 4(max) =τ . Thus it is important to determine the radius of the wheels. Based

on force and torque relationship, the wheels radius R must be less than the ratio of maximumwheels torque and maximum heading inertia force, *

(max)1(max)2 Fwrτ . It was shown in Fig. 5(a),

maximum heading inertia force *(max)1F is about 81.22N when robot needs to compensate tilt angle

initial error. Thus, based on this fact, R should less than 0.098m.4.2. Controller analysis

4.2.1. Basic input test

A WIP system with LQR controller tested on three types of input, unit step, ramp function, andexponential function. The test showed the suitability of input to the mobile WIP systemapplication. Fig. 6 shows, LQR controller was the best on unit step input. However its

(a) (b)

Figure 3. Responses of (a) tilt angle and (b) input torque over various COG of robot main body

(a) (b)

Figure 4. Response of (a) tilt angle of over various mass of body and (b) tilt angle of overvarious mass of wheel

(a) (b) (c)

Figure 5. Responses of (a) Inertia force F 1, (b) Inertia force F 2, and (c) Inertia force F 3 due tox, θ, and ϕ initial conditions.

Page 15: Dynamic modelling and optimal controlscheme of wheel inverted pendulum for mobile robot application

International Journal of Control Theory and Computer Modeling (IJCTCM) Vol.3, No.6, November 2013

15

performance deteriorated when operates on others input function as shown in Fig. 7 and Fig. 8.Fig. 7 shows, WIP with LQR had position and heading states error on ramp input. Fig. 8 shows,WIP with LQR had position, velocity, heading angle, heading angular velocity state errors occurin exponential input. For mobile WIP application, unit step input was not suitable where itrequired tremendous large amount of torque as maximum as 45Nm as showed in Fig. 6(c). Incontrast, ramp and exponential type input functions are suitable input for the WIP system; theseinputs do not only have velocity information, it also enables the WIP system to be driven inoptimum velocity using permissible torque energy as shown in Fig. 7(c) and Fig. 8(c).

4.2.2. Cartesian motion

WIP was tested on two types of motion, rectilinear and curvilinear motions. WIP needed to beheld in a vertical while moving to a specify distance either in a straight line or in a curve. Beloware the equations of position input and heading angle input for both rectilinear and curvilinearmotions.

( )( )

( )( )

,1

,1

c

c

TtTin

TtTin

e

Heat

e

Postx

−−

−−

+−=φ

+=

(50)

The constants T=0. 3, Tc=20 for both types of motions. The constants Pos=5, Hea=0 andPos=1.25π, Hea=π/4 were respectively for rectilinear and curvilinear motions. Both inputs haves-shape trajectory and its slope is maximum time t=Tc.

From both Fig. 9 and 10, system with PSPID controller had better dynamic performance over thesystem with LQR controller. Comparatively, WIP with PSPID controller took only 40s to reach atspecified position and orientation compare to WIP with LQR controller which took twice timelonger (about 80s) as shown in Fig. 10(e). It verified that the trajectory error can be reduced tozero by adding an additional pole at zero to the system; and this process was achievable byimplementing PSPID controller to the WIP system. Moreover on QOR tuning formulation,required torque of the WIP system with PSPID can be guaranteed within permissible torquelimitation.

(a) (b) (c)

Figure 6. Responses of (a) state x, (b) state ϕ and (a) torques τwr, τwl on unit step input.

Page 16: Dynamic modelling and optimal controlscheme of wheel inverted pendulum for mobile robot application

International Journal of Control Theory and Computer Modeling (IJCTCM) Vol.3, No.6, November 2013

16

(a) (b) (c)

(d) (e)

Figure 9. Responses of (a) state x, (b) state x , (c) state θ, (d) state θ and (e) torques τwr, τwl onrectilinear motion.

(a) (b) (c)

Figure 7. Responses of (a) state x, (b) state ϕ and (c) torques τwr, τwl on ramp input.

(a) (b) (c)

Figure 8. Responses of (a) states x, x , (b) states ϕ, φ and (c) torques τwr, τwl on exponentialinput.

Page 17: Dynamic modelling and optimal controlscheme of wheel inverted pendulum for mobile robot application

International Journal of Control Theory and Computer Modeling (IJCTCM) Vol.3, No.6, November 2013

17

5. CONCLUSION

Nonlinear dynamic mathematical model of a WIP system successfully derived. Applying rightgeometric context of the active force and inertia force led to a correct derivation of the WIPsystem using Kane’s method. Furthermore, an optimal PSPID controller had been proposed tocontrol the system for better dynamic performance. The controller had both advantages of PIDand QOR tuning method.

Theoretical design, simulation and numerical results depicted that: 1) the nonlinear dynamicmodel correctly derived, 2) WIP system with proposed controller had a satisfactory dynamicperformance where the trajectory error was very small, 3) QOR tuning scheme used and thisguarantee stability of WIP system, and 4) WIP required low magnitude of torque and this permitpractical implementation.

Further research should concern on: 1) variable type of WIP model since it is closer to humantransporter and WIP service robot application and 2) design and implementation of the proposedcontroller in a microcontroller based system as a standalone and low level controller since of itssimple and easy realization.

(a) (b) (c)

(d) (e) (f)

(g)

Figure 10. Responses of (a) state x, (b) state x , (c) state θ, (d) state θ , (e) state ϕ, (f) state φ

and (g) torques τwr, τwl on curvilinear motion.

Page 18: Dynamic modelling and optimal controlscheme of wheel inverted pendulum for mobile robot application

International Journal of Control Theory and Computer Modeling (IJCTCM) Vol.3, No.6, November 2013

18

APPENDIX

Nonlinear and linear WIP state variables

( )( ) ( ) ,cos3 23

21 θ−++= dmIdmmmD bBbwbIP

( ) ( ) ,cos2

4sin 2222

22 wbbIP mLRLIdmD

φ++++θ=

( ),

sin

1

32

24

IP

bbb

D

dmIdmA

θθ+= ( )( )

,sincos1

1

322

26

IP

bbb

D

dmIdmA

φθ+θ−=

( ),

cossin

1

2

44

IP

b

D

dmA

θθθ−=

,cossin3

1

2

46

IP

bw

D

dmmA

φθθ=

,cossin

2

2

66

IP

b

D

dmA

θθθ−=

( ),

1

32

2221RD

IdmBB

IP

bb +== ,cos

1

4241RD

dmBB

IP

b θ−== ,cos

2

6161RD

LBB

IP

φ=−=

( ),

cossin2

2

IP

b

D

gdmF

θθ−= ( ),

3sin4

IP

wbb

D

mmdgmF

+θ=

( )( ) ( ) ,3 23

21 dmIdmmmD bbbwBIPL −++=

,2

522

22 wbIPL mRLID

++=

( ),

1

2

23

IPL

bL

D

gdmA

−= ( ),

3

1

43

IPL

bwbL

D

dgmmmA

+=

( ),

1

32

2221RD

IdmBB

IPL

BbLL

+== ,1

4241RD

dmBB

IPL

bLL

−== ,2

6261RD

LBBIPL

LL =−=

REFERENCES

[1] Z. Kausar, K. Stol, and N. Patel, "The Effect of Terrain Inclination on Performance and the StabilityRegion of Two-Wheeled Mobile Robots," International Journal of Advanced Robotic Systems, vol. 9,no. 218, pp. 1-11, 2012.

[2] S. H. Miao, "Modeling of self-tilt-up motion for a two-wheeled inverted pendulum," Industrial Robot-an International Journal, vol. 38, no. 1, pp. 76-85, 2011.

[3] F. Grasser, A. D’Arrigo, S. Colombi, and A. C. Rufer, "JOE: a mobile, inverted pendulum," IEEETransactions on Industrial Electronics, vol. 49, no. 1, pp. 107-114, 2002.

[4] L. Jingtao, X. Gao, H. Qiang, D. Qinjun, and D. Xingguang, "Mechanical Design and DynamicModeling of a Two-Wheeled Inverted Pendulum Mobile Robot," Automation and Logistics, 2007IEEE International Conference on, Jinan, China, pp. 1614-1619, 2007.

[5] M. Baloh and M. Parent, "Modeling and Model Verification of an Intelligent Self-Balancing Two-Wheeled Vehicle for an Autonomous Urban Transportation System," Conference on ComputationalIntelligence, Robotics, and Autonomous Systems, Singapore, pp. 1-7, 2003.

[6] J. S. Noh, G. H. Lee, and S. Jung, "Position control of a mobile inverted pendulum system usingradial basis function network," International Journal of Control, Automation and Systems, vol. 8, no.1, pp. 157-162, 2010.

[7] H. Ozaki, T. Ohgushi, T. Shimogawa, and C.-J. Lin, "Position and orientation control of a wheeledinverted pendulum," JSME International Journal, Series C: Mechanical Systems, Machine Elementsand Manufacturing, vol. 44, no. 1, pp. 188-195, 2001.

[8] K. Teeyapan, J. Wang, T. Kunz, and M. Stilman, "Robot Limbo: Optimized Planning and Control forDynamically Stable Robots Under Vertical Obstacles," 2010 IEEE International Conference onRobotics and Automation, Anchorage, Alaska, USA, pp. 4519-45 S. H. Jeong and T. Takahashi,

Page 19: Dynamic modelling and optimal controlscheme of wheel inverted pendulum for mobile robot application

International Journal of Control Theory and Computer Modeling (IJCTCM) Vol.3, No.6, November 2013

19

"Wheeled inverted pendulum type assistant robot: inverted mobile, standing, and sitting motions,"IEEE/RSJ International Conference on Intelligent Robots and Systems 2007, San Diego, CA, USA.,pp. 1932-1937, 2007.

[10] M. L. Chen, "Analysis and design of robust feedback control systems for a nonlinear two-wheelinverted pendulum system," 2012 International Symposium on Computer, Consumer and Control,Taichung City, Taiwan, pp. 949-953, 2012.

[11] K. M. Goher, M. O. Tokhi, and N. H. Siddique, "Dynamic modelling and control of a two wheeledrobotic vehicle with a virtual payload," Journal of Engineering and Applied Sciences, vol. 6, no. 3, pp.7-41, 2011.

[12] A. Bajodah, D. Hodges, and Y.-H. Chen, "Nonminimal Kane's Equations of Motion for MultibodyDynamical Systems Subject to Nonlinear Nonholonomic Constraints," Multibody System Dynamics,vol. 14, no. 2, pp. 155-187, 2005.

[13] Y. Kim, S. Kim, and Y. Kwak, "Dynamic analysis of a nonholonomic two-wheeled invertedpendulum robot," Journal of Intelligent and Robotic Systems, vol. 44, no. 1, pp. 25-46, 2005.

[14] H. Jian, G. Zhi-Hong, T. Matsuno, T. Fukuda, and K. Sekiyama, "Sliding-Mode Velocity Control ofMobile-Wheeled Inverted-Pendulum Systems," Robotics, IEEE Transactions on, vol. 26, no. 4, pp.750-758, 2010.

[15] C. H. Chiu and C. H. Lin, "A WIP control based on an intelligent controller," World Academy OfScience Engineering and Technology vol. 54, no. 126, pp. 656-661, 2011.

[16] C. H. Huang, W. J. Wang, and C. H. Chiu, "Design and implementation of fuzzy control on a two-wheel inverted pendulum," IEEE Transactions on Industrial Electronics, vol. 58, no. 7, pp. 2988-3001, 2011.

[17] C. C. Tsai, H. C. Huang, and S. C. Lin, "Adaptive Neural Network Control of a Self-Balancing Two-Wheeled Scooter," Industrial Electronics, IEEE Transactions on, vol. 57, no. 4, pp. 1420-1428, 2010.

[18] E. Minnaert, B. Hemmelman, and D. Dolan, "Inverted pendulum design with hardware fuzzy logiccontroller," 11th World Multi-Conference on Systemics, Cybernetics and Informatics, (Wmsci 2007),Orlando, pp. 76-81, 2007.

[19] T. Ren, T. C. Chen, and C. J. Chen, "Motion control for a two-wheeled vehicle using a self-tuningPID controller," Control Engineering Practice, vol. 16, no. 3, pp. 365-375, 2008.

[20] M. Fallahi and S. Azadi, "Adaptive Control of an inverted pendulum using adaptive PID neuralnetwork," Proceedings of the 2009 International Conference on Signal Processing Systems, LosAlamitos, CA, USA, pp. 589-593, 2009.

[21] S. Liang and G. Jiafei, "Researching of Two-Wheeled Self-Balancing Robot Base on LQR Combinedwith PID," 2nd International Workshop on Intelligent Systems and Applications (ISA), pp. 1-5, 2010.

[22] A. N. K. Nasir, M. A. Ahmad, and R. M. T. R. Ismail, "The control of a highly nonlinear two-wheelsbalancing robot: A comparative assessment between LQR and PID-PID control schemes," WorldAcademy Of Science Engineering and Technology, vol. 46, no. 44, pp. 227-232, 2010.

[23] S. Ahmad and M. O. Tokhi, "Linear Quadratic Regulator (LQR) approach for lifting and stabilizing oftwo-wheeled wheelchair," 4th International Conference On Mechatronics (ICOM), pp. 1-6, 2011.

[24] S. Y. Seo, S. H. Kim, S.-H. Lee, S. H. Han, and H. S. Kim, "Simulation of attitude control of awheeled inverted pendulum," International Conference on Control, Automation and Systems, (ICCAS'07), pp. 2264-2269, 2007.

[25] T. Takei, R. Imamura, and S. Yuta, "Baggage Transportation and Navigation by a Wheeled InvertedPendulum Mobile Robot," IEEE Transactions on Industrial Electronics, vol. 56, no. 10, pp. 3985-3994, 2009.

Page 20: Dynamic modelling and optimal controlscheme of wheel inverted pendulum for mobile robot application

International Journal of Control Theory and Computer Modeling (IJCTCM) Vol.3, No.6, November 2013

20

Authors

Mohamad Amir Shamsudin was born in Johor, Malaysia, in 1983. He received the B.Sand M.S degrees in mechatronics engineering from Universiti Teknologi Malaysia(UTM) respectively in 2007 and 2009. He is currently a PhD student in the Faculty ofElectrical Engineering, UTM. His research is on Modelling and Control of WheelInverted Pendulum system.

Rosbi Mamat is Associate Professor at Department of Control and Mechatronic UTM,Malaysia. His research interests include control and intelligent systems, mechatronicsystem, and embedded system.

Sophan Wahyudi Nawawi received his PhD from UTM, Malaysia in 2006. His PhDresearch was in Control area. His research interests include nonlinear system andcontrol, robust control and robotic system.