four-stage inverted pendulum and its fuzzy set theory · 2013. 4. 24. · 1 four-stage inverted...

Post on 27-Aug-2020

1 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

1

Four-stage Inverted Pendulum and Its Fuzzy Set Theory

Hong-Xing Li School of Control Science and Engineering Dalian University of Technology Dalian, Liaoning, 116024, P. R. China lihx@dlut.edu.cn

2

Abstract This talk is about the use of fuzzy sets and how to

control a four-stage inverted pendulum. The talk comprises such observations :

Observation 1. A collection of inference rules is essentially equivalent with a collection of experiment data.

Observation 2. A fuzzy system is approximately equivalent with an interpolation.

Observation 3. Discover a kind of probability representation of fuzzy systems.

3

Observation 4. Obtain a very beautiful and profoundly mathematical result : Observation 5. Discover a kind of adaptive mechanism of dynamic fuzzy systems. Observation 6. Propose variable universe fuzzy control. Conclusion and observation 7. Implement controlling a four-stage inverted pendulum.

( ).f E η ξ=

4

1. Use of Fuzzy Sets 1.1 Starting a Problem A kind of open loop system referring to figure 1.1.1, where stands for a system, for input variable taking values in the universe and for output variable taking values in the universe

[ , ] ,X a b= ⊂ RxS

y[ , ] .Y c d= ⊂ R.

Fig. 1.1.1 One input one output open loop system

5

For a complicated uncertainty system, we often do some experiments to get a collection of discrete data usually describing the relationship between input and output of the system. The data set is denoted by

And input data and out data are respectively written by

in which we can assume that Actually IOD can be viewed as a mapping:

( ) IOD , 0,1, ,i ix y i n X Y= ⊂ ×

0 00,1, , , 0,1, ,i iX x i n Y y i n= =

0 1 ,min , max

n

i ii i

a x x x bc y d y= < < < == =

( )0 0: , , 0,1, ,i i ig X Y x g x y i n→ =

6

From the view of systems, is regarded as a response of the system to input However the mapping has no definition in which means that does not respond to any element in A Problem: How to get a mapping by using of the discrete mapping such that has response to every element in and satisfies the natural condition: Of course, interpolation is one of methods for solving the problem, but this method is without system view and also without operations of sets, logic and inference.

( )i iy g x=.ix g

0 0\ ,cX X X S

0 .cX

:f X Y→

0 0:g X Y→ S

( ) ( ) ( )( )0,1, , ?i ii n f x g x∀ ∈ =

X

7

We consider a schedule to solve the problem by adequately using sets, logic and inference. From this consideration, we can find some new prospects on fuzzy set theory and applications. 1.2 From IOD to FIOD A pair of data in IOD can be viewed as Because every must be with some errors, we assume that the error of is denoted by while the error of is denoted by

( ),i ix y ( ), .i ix y

( ),i ix y

ix ,iδ±.iε±

iy

8

This means that we can use a pair of intervals

to substitute a pair of one-point sets while the

interval pair is correspond-

ing to the characteristic function pair

Because may not be hold, if

then has no response to points in

[ ] [ ]( ), ,( ), ( ) .i i i i i i i ix x y yx yδ δ ε εχ χ− + − +

[ ] [ ]( ), , ,i i i i i i i ix x y yδ δ ε ε− + − +

( ), ,i ix y

[ ] [ ]( ), , ,i i i i i i i ix x y yδ δ ε ε− + − +

[ ]0

\ , ,n

i i i ii

X x xδ δ=

− + ≠ ∅

[ ]0

,n

i i i ii

x x Xδ δ=

− + ⊃

[ ]0

\ , .n

i i i ii

X x xδ δ=

− +

S

9

Fig. 1.2.1 Characteristic function [ ], ( )i i i ix x xδ δχ − +

10

By noticing the following integral can be looked upon a kind of information quantity carried by based on its error In order to make up “interspaces”, under keeping the information quantity turn a Contor set into a fuzzy set such that meet the condition

or

[ ], ( ) 2 , 0,1, ,i i i i ix xX

x dx i nδ δχ δ− + = =∫

ix2 iδ

.iδ±

( ) ( ) ,i

i ii

x b

A i Aa xx dx x dxµ δ µ= =∫ ∫

( ),iA X∈F[ ],i i i ix xδ δ− +2 ,iδ

[ ],( ) 2 ( ) .i i i i iA i x xX X

x dx x dxδ δµ δ χ − += =∫ ∫

11

Fig. 1.2.2 Membership function

Example 1.2.1 Showing as figure 1.2.2, we give a kind of simple form of fuzzy set, where

( )iA xµ

1 1

, .i ii i

i i i ix x x xδ δα β

− +

= =− −

12

[ )( )

( )( ) [ )

( )( )( ) [ )

( )( )( )

1

11

1 1

21

11

1

1

0, , ,

, , ,

, , ,( )

1 , i

i

i ii i i

i i i i i

i i i i i ii i i

i i iA

i i i i

i i i

x a x

x xx x x

x x x x

x x x xx x x

x xx

x x x xx x

δδ

δ

δ δ δδ

δµ

δδ

−−

− −

−−

+

+

−∈ −

− − −

− − − + +∈ −

−=

− − −−

−[ )

( )( )( ) [ )

[ ]

1

11

1 1

1

, ,

, , ,

0, ,

i i i

i ii i i

i i i i i

i

x x x

x xx x x

x x x x

x x b

δ

δδ

δ

+−

+ +

+

∈ − −

∈ − − − + ∈

13

can be regarded as a fuzzy number made from . Fuzzy numbers can also be made from For the data set do not generally meet we should take a permutation such that So we can assume that Obviously we have

0 1

0 1

n

nk k k

σ

=

0 1 ,ny y y< < <

0,1, ,iy i n=

.iy( )iB Y∈F.ix( )iA X∈F

0 1.

nk k kc y y y d= ≤ ≤ ≤ =

0 1.

nk k kc y y y d= < < < =

( ) ( ) , 0,1, , , 0,1, , .j jk k i iA B j n A B i n= = =

14

We list a serie of one-to-one correspondences beginning from the data set IOD as the following: If write then there is one-to-one mapping between IOD and FIOD

( ) FIOD , 0,1, , ,i iA B i n=

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

, ,

, , ,

, .

i i i i

i i i i i i i i

i i

x y x y

x x y y

A B

δ δ ε ε

↔ ↔

− + − +

15

Any fuzzy relation can induce a fuzzy set transformation:

This equation is a very important tool.

[ ]( ) [ ]( )

: ( ) ( )( ) ( ) ,

( ) ( ) ( , ) .

Y

B A Rx X

F X YA B F A A R A Y R

y Y y x x yµ µ µ∈

= ×

∀ ∈ = ∨ ∧

F F

( )R X Y∈ ×F

Fig. 1.2.3 The transformation induced by R

16

Because IOD can be viewed as a mapping and this mapping may also be regarded as a collection of inferences: By noticing we immediately get a collection of fuzzy inferences as the following:

0 0

1 1

If is then is ,

orIf is then is ,

or orIf is then isn n

x x y y

x x y y

x x y y

( ) ( ), , ,i i i ix y A B↔

( )0 0: , , 0,1, , ,i i ig X Y x y g x i n→ = =

17

0 0

1 1

If is then is ,

orIf is then is ,

or orIf is then isn n

x A y B

x A y B

x A y B

(1.2.1)

A question: How to get a collection of fuzzy inference relations such that This means that we can get a inference relation by solving relation equations (1.2.1).

( ), 0,1, , ,iR X Y i n∈ × = F( )( )0,1, , ?i i ii n A R B∀ ∈ =

18

1.3 Structure of Fuzzy Inference Relation When and is the envelope of all minimum solutions of while is the unique maximum solution.

( ) ( )ci i iA B A Y× ×

( )iA X∈P ( ),i i iB Y A B∈ ×P,i iA R B=

Fig. 1.3.1 Solutions of i iA R B=

19

There is another tool to get a fuzzy inference relation, that is, fuzzy implication relation or operator. A fuzzy relation is called a fuzzy implication relation or fuzzy implication operator, if it meets (I1) (I2) And if a fuzzy implication relation also satisfies another extra condition (I3) then is called a regular fuzzy implication relation. A fuzzy implication relation being not regular is called an irregular fuzzy implication relation.

θ

( ) ( )(1,0) 0 (0,0) (0,1) (1,1) 1 ,θ θ θ θ= ∧ = = =

( )( )2( , ) [0,1] ( , ) 0 .c d c dθ∃ ∈ =

( )( )2( , ) [0,1] ( , ) 1 ,a b a bθ∃ ∈ =

( )2[0,1]θ ∈F

20

1.4 Fuzzy Set Transformation From data IOD to fuzzy data FIOD, we get a fuzzy inference relation where By using a fuzzy implication relation we can form a fuzzy set transformation induced by a fuzzy inference relation as

0,n

iiR R

==

: ( ) ( )F X Y→F F

( )( , ) ( ), ( ) .i i iR A Bx y x yµ θ µ µ=

,θR

[ ]

( )0

: ( ) ( ), ( ) ( ) ,

( ) ( ) ( ), ( ) ,i i

Y

n

B A A Bx X i

F X YA B F A A R A Y R

y x x y y Yµ µ θ µ µ∈ =

= = = ×

= ∨ ∧ ∨ ∈

F F

21

1.5 From IOD to a function From the fuzzy set transformation We obtain a point-to-set transformation:

If is viewed as a variable taking its values in then when the fuzzy set obtained by above way can be written as that is,

:ns X Y→

[ ]: ( ) ( ),

( ) ( ) ,Y

F X YA B F A A R A Y R

= = = ×

F F

[ ]: ( ),

( ) ( ) .Y

f X Yx B f x x R x Y R→

= = = ×

F

,XXξ ∈

( ),B xξ =( )B Y∈F,x Xξ = ∈

22

By means of center of gravity in physics, can be turned to a point in denoted by as follows.

[ ]

( )( ) 0

( ) ( ) ,

( ) ( ), ( ) ,i i

Yn

B x A Bi

B x x Y R

y x y y Yξ

ξ

µ θ µ µ= =

= = ×

= ∨ ∈

( )B xξ =( )y xY

( )

( )

( )

( )

0

0

( )( )

( )

( ), ( )

( ), ( )

i i

i i

d

B xcd

B xc

nd

A Bc i

nd

A Bc i

y ydyy x

y dy

x y ydy

x y dy

ξ

ξ

µ

µ

θ µ µ

θ µ µ

=

=

=

=

=

∨ = ∨

∫∫

23

Fig. 1.5.1 turning into a point ( )B xξ = ( )y x

24

Thus we can change point-to-fuzzy set transformation into a point-to-point function: We have finished the task from data set IOD to a function The function makes the system have an unique response for every

The function is often called a fuzzy system.

.x X∈: .ns X Y→

( )

( )

: ,

( )( ) ( )

( )

nd

B xcn d

B xc

s X Y

y ydyx s x y x

y dy

ξ

ξ

µ

µ

=

=

= ∫∫

[ ]: ( ),

( ) ( )Y

f X Yx B f x x Y R→

= = ×

F

(1.5.1)

( )ns x Y∈

:ns X Y→

25

1.6 Approximate Computing on Fuzzy Systems

Based on the definition of definite integral, we have we get where

( )( )

( )1

1( )

1

( ) ( ) ,j j j

j j

j j

n

B x k k k nj

n k knj

B x k kj

y y ys x x y

y y

ξ

ξ

µϕ

µ

==

==

=

∆≈ =

∑∑

( )

( )

( ) ( )1

( ) ( )1

( ) ,

( ) ,

j j j

j j

nd

B x B x k k kcj

nd

B x B x k kcj

y ydy y y y

y dy y y

ξ ξ

ξ ξ

µ µ

µ µ

= ==

= ==

≈ ∆

≈ ∆

∑∫

∑∫

26

This means that is approximately expressed as the following

Obviously is an interpolation regarding as its base functions. ( ) 1,2, ,

jk x j nϕ =

1( ) ( )

j j

n

n k kj

s x x yϕ=

=∑1

( ) ( ) ( ) ,j j

n

n n k kj

s x s x x y x Xϕ=

≈ ∈∑

( )

( )

( )( )

( )

d

B xcn d

B xc

y ydys x

y dy

ξ

ξ

µ

µ

=

=

= ∫∫

(1.6.1)

( )( )( )( )

0

01

( ),( ) , 1, ,

( ),

k k j jp p

j

k k q qp p

n

A B k kp

k n n

A B k kpq

x y yx j n

x y y

θ µ µϕ

θ µ µ

=

==

∨ ∆ = ∨ ∆

27

2. Probability Representation of Fuzzy Systems 2.1 Probability Significance of Fuzzy Systems Here we review (1.5.1), rewritten as follows We easily learn that the response about input is relating with so we should rewrite as where is regarded as a variable taking its values in

x( )B y

( )

( )

( ): , ( ) ( ) .

( )

d

B xcn n d

B xc

y ydys X Y x s x y x

y dy

ξ

ξ

µ

µ

=

=

→ = ∫∫

,x ( )B y( | ) ( ),B y x B yξ = (2.1.1)

.Xξ

28

Because of arbitrariness of can be written as a binary function as follows Then (1.5.1) turns into the following expression

Now we extend the definition domain of onto and denote it as

( )0

: , ( , ) ( , ),

( , ) ( | ) ( ), ( )i i

n

A Bi

p X Y x y p x y

p x y B y x x yξ θ µ µ=

× →

= = ∨

( ) ( , ) ( , )n Y Ys x yp x y dy p x y dy= ∫ ∫

, ( | )x X B y xξ∈ =

(2.1.2)

(2.1.3) 2( , )p x y

( , ), ( , )( , )

0, ( , ) ,p x y x y X Y

q x yx y X Y

∈ × ∉ ×

(2.1.4)

29

Then put called H function with a quadruple parameter

If then write

It is easy to learn that (2.1.3) can be changed as Here we should find out (2.1.7) being quite similar to conditional mathematical expectation in probability theory.

(2, , , ).n θ ∨

(2, , , ) ( , ) ,H n q x y dxdyθ+∞ +∞

−∞ −∞∨ ∫ ∫ (2.1.5)

(2, , , ) 0,H n θ ∨ >( , ) ( , ) (2, , , ).f x y q x y H n θ ∨ (2.1.6)

( ) ( , ) ( , ) .ns x yf x y dy f x y dy+∞ +∞

−∞ −∞= ∫ ∫ (2.1.7)

30

Theorem 2.1.1 For a one-input one-output fuzzy system the symbols used here have been mentioned above. For a given fuzzy implication operator if

then there exist a probability space and a random vector defined on such that

This means that the function value of at is just the conditional mathematical expectation of under the condition

( ),ns x

( , )ξ η

( | ) ( ), .nE x s x x Xη ξ = = ∈

| | ( , ) , 0 ( , ) ,Y Y

y p x y dy p x y dy< +∞ < < +∞∫ ∫( , , )PΩ F

( , , )PΩ F(2.1.10)

( )ns x ns x

( | )E xη ξ = η

.xξ =

31

Corollary (an important mathematical result) For some kinds of function spaces, for example, we have

Note. is very like Einstein's equation

Theorem 2.1.2 The fuzzy system obtained by the method of center of gravity (MCOG) is the optimal approximation to in the sense of least squares. So MCOG is reasonable.

Another important result: Any fuzzy system can be turned into a stochastic system, and vice versa.

The unified theory of uncertainty systems

( ), ,C X X ⊂

( )( ) ( )( )( ) ( , ) .f C X f Eξ η η ξ∀ ∈ ∃ =

( )ns x( )s x

( )f E η ξ= 2.E mc=

32

3. Variable Universe Fuzzy Control and Its Adaptive Mechanism 3.1 Stochastic Process Representation of Dynamic Fuzzy Systems Figure 3.1.1 shows a dynamic open loop system with one-input one-output where input variable taking values in and output variable taking values in

Fig. 3.1.1 Dynamic system with open loop

( )x t X( )y t .Y

33

When is an uncertainty system, for any we have got above method to structure a fuzzy system: Let That is used to express a collection of fuzzy inference rules as the following about the fuzzy system:

( , ) : , ( ) ( ) ( , ( )),n ns t X Y x t y t s t x t⋅ →

,t T∈S

(3.1.1)

( ) ( ) 0,1, , ,

( ) ( ) 0,1, ,t i

t i

A t X i n

B t Y i n

∈ =

∈ =

A F

B F

t t→A B

If ( ) is ( ) then ( ) is ( ), 0, , .i ix t A t y t B t i n= (3.1.2)

34

By using (2.1.7), means the following equation: Then is just the probability density of random vector defined on probability space Now that we have got a family of probability densities as we have turned a dynamic fuzzy system into a stochastic process.

( )( , ( )) ( )

( , ( ), ( )) ( ),

( , ( ), ( ))

( , ( ), ( )) ( ( ), ( )) (2, , , ) ,

n t t

Y

Y

t t

s t x t E x t

f t x t y t y t dy

f t x t y t dy

f t x t y t p x t y t H nt T

η ξ

θ

= =

=

∫∫

( , )ns t ⋅

(3.1.3)

( , , ).PΩ F

( , ( ), ( )), ,f t x t y t t T∈

( ),t tξ η( , ( ), ( ))f t x t y t

35

Thus we have got a two-dimension stochastic process as

Let be the conditional variance of

Its standard deviation is as follows Figure 3.1.1 shows the intuitional meanings about

and sample functions etc.

( ) , .t t t Tξ η ∈

( | ( )), ,tt tE x t ηη ξ σ=

( ) ( )( ) ( ) .t t t t tx t D x tησ σ η ξ η ξ= = =

( )( )t tD x tη ξ = .t t Tη ∈

1 2, ,t tη η

36

Fig 3.1.1 Dynamic fuzzy systems

37

3.2 Adaptive Mechanism of Dynamic Fuzzy Systems as Fuzzy Controllers If a fuzzy system is used to be a fuzzy controller, where input is viewed as error while is regarded as the controlling quantity at then is the mean function of all the sample functions In general, for some simple cases, being used as a controlling function may fulfill some tasks. But for the cases which need higher controlling precision, it is hard to reach the requirement if we still use

How to improve its controlling precision on

( )x t( )( )t tE x tη ξ =

( ),tε,t

.it

η

( , ( ))ns t x t

( )( )t tE x tη ξ =

( )( ) .t tE x tη ξ =

( )( ) ?t tE x tη ξ =

38

We have such an idea that, two dynamic parameters denoted

as and are added in where acts

on input variable and on output variable. Then

and are rewritten as the following

It means that, for any given sample and there exists

such that, when we have 0 (0, ),t ∈ +∞

( )tα

( ), ( ) ( ), ( ) .it t tE t x t tη β ξ α η ε = − <

( , ( ))ns t x t

0,ε >itη

( )( ) ,t tE x tη ξ =

0 ,t t≥

( )tβ

( )( , ( ), ( ), ( )) , ( ) ( ), ( ) .n t ts t x t t t E t x t tα β η β ξ α =

( )( )t tE x tη ξ =

( )tα

( )tβ

(3.2.1)

(3.2.2)

39

Fig. 3.2.2 Intuitional meaning of ( ), ( ) ( ), ( ) .t tE t x t tη β ξ α =

40

An important problem: How to actualize above idea as follows 3.3 Structure of Variable Universe Fuzzy Control Variable universe fuzzy control may be one of methods of actualizing above idea. For a dynamic system, we need a collection of dynamic fuzzy inferences as to describe the system, where How to get and

( ) ( ) 0,1, , ,

( ) ( ) 0,1, , ,

If ( ) is ( ) then ( ) is ( ), 0, , .

t i

t i

i i

A t X i n

B t Y i n

x t A t y t B t i n

= ∈ =

= ∈ =

=

A F

B F

( )( )( , ( ), ( ), ( )) , ( ) ( ), ( ) ?n t ts t x t t t E t x t tα β η β ξ α= =

t t→A B

?tBtA

41

Suppose be respectively fuzzy set families on original universes and and form a collection of original static fuzzy inferences

X ( ) 0, , , ( ) 0, ,i iA X i n B Y i n= ∈ = = ∈ = A F B F

If is then is , 0,1, , .i ix A y B i n=

,Y

Fig. 3.3.1 Fuzzy sets on original universe

42

When is used as a fuzzy controller, the input of this controller is often regarded as error Assume take values in interval where so we should take as input universe of the fuzzy system.

Controll task is to make so in a control process, the bound of should be changing according to the changing of error meaning that is proportional to

Because is a function of should also change depending on that is, Thus the fuzzy set family becomes a family of dynamic fuzzy sets defined on the dynamic universe as follows

0,E >[ , ]X E E= −

[ , ] ,E E− ⊂

E .εE±

( ) ( | )ns x E xη ξ= =

0,ε →

.ε ε

ε,ε

,t E( )tε ε=,t ( ) 0, , ,iA X i n= ∈ = A F

( ).E E t=

( ) [ ( ), ( )]X t E t E t= −

43

In order to actualize we introduce an important tool, by the name of expanding-contracting factor denoted by Let Then we have So the dynamic universe has a kind of performance of expanding-contracting, seeing to figure 3.3.2.

( ) ( ) .E t t Eα=

( ),E E t=

( ) ( ) 0,1, ,t iA t X i n= ∈ = A F

( )X t

( ) [ ( ), ( )] [ ( ) , ( ) ].X t E t E t t E t Eα α= − = −

( ).tα

44 Fig. 3.3.2 dynamic universe of performance of expanding-contracting ( )X t

45

A function is called an expanding-contracting factor on if it meets the axioms: 1) even function: 2) near zero: where is sufficiently small; 3) monotone function: is strictly monotone on 4) harmonization:

For any let It is called a variable universe with respect to the origin universe

( )( )(0,1) (0) ,δ α δ∃ ∈ =

α [0, ];E

( )( )( ) ( ) ;x X x xα α∀ ∈ = −,X

: [ , ] [0,1], ( )X E E x xα α− →

( )( ) ( ) .x X x x Eα∀ ∈ ≤

[ ] ( ) ( ) ( ) , ( ) ( ) .X x x X x E x E x y y Xα α α α− = ∈

,x X∈

[ , ].E E−

δ

46

Example 3.3.1 Let fuzzy sets on the original universe be taken as triangle membership functions as follows

( ) ( ) [ ]

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

( )

0

1

1 0 1 0 1

1 1 1

1 1 1

1

, , ;( )

0 , otherwise

, , ;

( ) , , ;0 otherwise;

1,2, , 1,

( )n

A

i i i i i

A i i i i i

nA

x x x x x x xx

x x x x x x x

x x x x x x x x

i n

x x xx

µ

µ

µ

− − −

+ + +

− − ∈= − − ∈

= − − ∈= −

−=

,

,  

( ) [ ]1 1, , ;0, otherwise,

n n n nx x x x− − − ∈

[ , ]X E E= − ( ) 0, ,iA X i n= ∈ = A F

47

where

For the variable universe

we have

Thus 0 1( ) ( ) ( ) ( ) ( ) .nt E t x t x t x t Eα α α α α− = < < < =

( ) [ ( ) , ( ) ],X t t E t Eα α= −

0 1 .nE x x x E− = < < < =

48

( ) [ ]

( ) [ )

( )

0

1

1 0 1 0 1

1 1 1

1 1

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

( )0 , otherwise

( )( ) , , ;( ) ( )

( ) ( ) ,( ) ( )

A

i i i i i

A i i i

x tx t x x x x xx t t tt

x tx t x x x x xt t

x t x t x x xt t

µ α αα

α α

µα α

− − −

+ +

− − ∈ =

− − ∈

= − −

,

[ ]

( ) [ ]

1

1 1 1

( ) , ;( )

0, otherwise; 1,2, , 1,

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

( )0, otherwise

n

i i

n n n n nA

x t x xt

i n

x tx t x x x x xx t t tt

α

µ α αα

+

− − −

= −

− − ∈ =

  

,

49

By noticing expression (1.6.1), we obtain Based on Liapunov stability theory, we can get which is called an integral adjustment factor. In this case, because of only having one input, we have while is a constant. nP

0( ) ( ) (0),

t TI nt K x P dβ τ τ β= +∫

2

1

0.5 ( )

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

( ) 1 (1 ) .

j j

n

n n k kj

kx t

x ts x t s x t t yt

t e

β ϕα

α δ

=

≈ =

= − −

∑ (3.3.1)

(3.3.2)

( ) ( ),Tx xτ τ=

50

4. Stable Control of Four-stage Inverted Pendulum 4.1 Mathematical Model Describing Four-stage Inverted Pendulum A four-stage inverted pendulum is formed by a cart, rod 1,

rod 2, rod 3 and rod 4, which are linked freely, seeing to figure

4.1.1.

51

Fig. 4.1.1 Four-stage inverted pendulum

52

Its model is described by a collection of nonlinear differential equations as follows

( )( )

1 2 3

1 2 3 4

3 1 1 2 2 3 3 4 4

,

, , , , ,

, sin , sin , sin , sin ,

T

T

H z H z H

z x

H u a g a g a g a g

θ θ θ θ

θ θ θ θ

= +

=

=

( ) ( ) ( )( ) ( ) ( )( ) ( ) ( )( ) ( )

0 1 1 2 2 3 3 4 4

1 1 1 2 1 2 1 3 1 3 1 4 1 4 1

2 2 2 1 2 1 2 3 2 3 2 4 2 4 21

3 3 3 1 3 1 3 2 3 2 3 4 3 4 3

4 4 4 1 4 1 4 2 4 2

cos cos cos coscos cos cos coscos cos cos coscos cos cos coscos cos cos

a a a a aa b a L a L a La a L b a L a LHa a L a L b a La a L a L a

θ θ θ θθ θ θ θ θ θ θθ θ θ θ θ θ θθ θ θ θ θ θ θθ θ θ θ θ

− − −− − −=− − −− − ( )

( ) ( ) ( )( ) ( ) ( )

4 3 4 3 4

0 1 1 1 2 2 2 3 3 3 4 4 4

1 2 2 1 2 2 1 2 3 1 3 3 1 4 1 4 4 1

2 2 1 2 2 1 2 2 3 3 2 3 3 2 3 4 2 4 4 2

3 1 1

,

cos

sin sin sin sin0 sin sin sin0 sin sin sin0 s

L b

f a a a af f a L f a L a L

H a L f f f a L f a La L

θ θ

θ θ θ θ θ θ θ θθ θ θ θ θ θ θ θ θ

θ θ θ θ θ θ θ θ θθ

−− − − + − −

= − − + − − − + −−

( ) ( ) ( )( ) ( ) ( )

3 1 3 2 2 3 1 3 4 4 3 4 4 3 4

4 1 1 4 1 4 2 2 4 2 4 3 3 4 3 4 4

in sin sin0 sin sin sin

a L f f a L fa L a L a L f f

θ θ θ θ θ θ θ θθ θ θ θ θ θ θ θ θ

− − − − − − + − − − − − − + −

(4.1.1)

53

in which are all friction factors, is

the mass of the cart, is the mass of rod, and

where is the distance from to the center of mass of rod, is the length of rod, and is the moment of inertia of rod. For the convenience, in neighborhood of balance position of the pendulum, (4.1.1) is turned into a group of linearized differential equations

im

4

0 00

,jj

a m m=∑0 4, ,f f

4

1

42 2

1

, 1,2,3,4;

, 1,2,3,4

i i i j ij i

i i i i j ij i

a m l m l i

b J m l m L i

= +

= +

+ =

+ + =

thi −

ilthi − thi −iL

iO

0z z= =

iJthi −

54

where while 0 (1,0,0,0,0) ,Th =0 ,M z Nz Gz h u= + + (4.1.2)

0 1 2 3 4

1 1 2 1 3 1 4 1

2 2 1 2 3 2 4 2

3 3 1 3 2 3 4 3

4 4 1 4 2 4 3 4

0

2 1 2

2 1 2 3 3

3 2 3 4 4

4 4

,

0 0 0 00 0 0

,0 00 00 0 0

a a a a aa b a L a L a L

M a a L b a L a La a L a L b a La a L a L a L b

ff f f

N a L f f fa L f f f

f f

= − − − = − − − − −

55

1

2

3

4

0a g

G a ga g

a g

=

Next, we want to get a collection of state equations. Let Then put and

1 2 1 1 1

5

, , , 2,3,4;, 1, ,5

i i i

i i

x x x x ix x i

θ θ θ+ −

+

− =

=

( ) ( )1 6 10 1 5 6 10, , , , , , , , ,T Ty x x x x x x x

56

Then we have Substitute (4.1.3) into (4.1.2), and get

, ,z Wy z Wy z Wy= = =

1 0 0 0 00 1 0 0 00 1 1 0 00 1 1 1 00 1 1 1 1

W

(4.1.3)

0

1 1 01 1 1 1 1 1

1 1 0

,,

MW y NWy GWy h uMWy NWy GWyh uy W M NMy W M GWy W M h u− − − − − −

= + += +

= + +

57

Then we have obtained the linear state equation of the four-stage or quadruple inverted pendulum: where 4.2 Design on the Controller of Four-stage Inverted Pendulum First of all, we consider a design of the controller of four-stage inverted pendulum, which is used for simulation.

5 15 51 11 1 1 1

0

, .OO I

A BW M hW M GW W M NW

×− −− − − −

= =

,x Ax Bu= + (4.1.4)

58

In simulation, controlling task is make by forcing to the cart, and simultaneously move cart movement to a pre-given position . These parameters that we use as the following: The state vector is as follows

0, 1,2,3,4i iθ → =

0 1 2 3 42

1 2 32

4 1 2 3 4

1 2 3 0

1 2 3 4

1.3282 , 0.2200 , 0.1870 ;

9.8 9.8; 0.004963 ,

0.004824 ; 0.304 , 0.226 ;0.49 ; 22.9147 ,

0.007056 , 0.002546 .

m kg m m m kg m kgg m J J J kg mJ kg m l l l m l mL L L m f N s mf N s m f f f N s m

= = = = =

= = = = ⋅

= ⋅ = = = == = = = ⋅ ⋅= ⋅ ⋅ = = = ⋅ ⋅

xu

59

Substituting above concrete data into (4.1.4), we get

( )5 5

1 2

1

0,0,0,0,0,0.72771, 1.79072,2.15893, 0.4424,0.09094 ,

,

0 5.7127 0.8526 0.10838 0.006920 38.1727 78.8881 10.02722 0.640360 46.0218 195.9291 69.27865 4.42430 9.4314 140.6432 141.5611 22.30882

TB

O IA

A A

A

= − −

=

− −− −

= − −− −

,

0 1.9385 28.9074 100.8414 69.4735

− −

,x Ax Bu= +

( ) ( )

( )1 2 10 1 5 1 5

1 2 1 3 2 4 3 1 2 1 3 2 4 3

, , , , , ,

, , , , , , , , ,

T T

T

d

x x x x x x x x

x x xθ θ θ θ θ θ θ θ θ θ θ θ θ θ

= =

= − − − − − − −

(4.1.5)

60

2

16.6754 0.012635 0.005713 0.00117 0.00024141.0338 0.22528 0.17462 0.10831 0.022261849.4712 0.46565 0.4435 0.39443 0.15381

10.13825 0.28883 0.39443 0.56524 0.4216552.08378 0.059365 0.15381 0.421655 0.73395

A

− − −− −

= − − −− −

− −

It is easy to know that the state equation (4.1.5) is perfectly controllable. Because the system is of multivariable, for the convenience, we can transform the multidimensional variable into one dimensional variable. For example, we can turn into a synthetical error, denoted by that is, put

( ) ( )1 2 10 1 5 1 5( ), ( ), , ( ) ( ), ( ), ( ), , ( )T Tx x t x t x t x t x t x t x t= =

( ),E t

61

where are all undetermined coefficients. Now we use linear quadratic optimal control method to design a state feedback matrix for the state equation (4.1.5). For doing this, consider an optimal control functional index where is a positive semi-definite matrix, and positive definite matrix (degenerating into constant).

0

1 ( ) ( ) ( ) ( )2

T TJ x t Qx t u t Ru t dt+∞ = + ∫

1 10, ,k k

( )

1

21 2 10

10

( )( )

( ) , , , ,

( )

x tx t

E t k k k

x t

( )diag 10,100,200,300,400,0,0,0,0Q =1R =

62

Solve the following Riccati equation and we get a state feedback matrix So We take a synthetical coefficient vector as follows Let the universe of be and the output universe of the controller be and they are respectively divided as the following

()

1 3.16, 339.91,1166.46, 4056.266,

6126.169, 4.6208, 257.411, 231.416, 91.038, 754.54

T TK R B P−= = −

27494.33.K =

( )1 102

, ,TKk k K

1 0T TPA A P PBR B P Q−− − + − =

[ 1,1]X = −E[ 1,1]Y = −

63

0 1 2

3 4 5 6

0 1 2

3 4 5 6

1, 0.3333, 1.667,0, 0.1667, 0.3333, 1;

1, 0.3333, 1.667,0, 0.1667, 0.3333, 1.

x x xx x x x

y y yy y y y

= − = − = −= = = =

= − = − = −= = = =

From these we form triangle fuzzy sets to be A variable universe fuzzy controller is designed as follows where

0 1 6 0 1 6, , , , , , , .A A A B B B

0( ) ( ) ( ( )) ( ) ,

t

Iu t t E t P E dβ ω τ τ= + ∫

64

( )

6

0

2

2

*

0*

( )( ( )) ,( )

7494.33,

( ( )) 1 0.6exp 10 ( ) ,

( ) ( ( )) ( ) (0),

( ) ( ) , 5,(0) 1, [5,30], [1,10]

iA ii

t

I

n n

I I

E tE t U yE

U K

E t E t

t K E e d

e t E t P PK P

ω µα

α

β ω τ τ τ β

β

=

=

= =

= − −

= +

= == ∈ ∈

65

Photo of the stable quadruple inverted pendulum

66

spherical quadruple inverted pendulum

67

swing-up for double inverted pendulum

top related