Title: M.Yamakita
1Implementation of Intelligent Control onTITech
Pendulum
- M.Yamakita
- Dept. of Mechanical and Control Systems Eng.
- Tokyo Inst. Of Tech.
2Top View
TITech pendulum is a rational type pendulum
which was developed for control algorithm test
bed by prof. K.Furuta at Tokyo Institute of
Technology.
Side View
Coordinate System
3Dynamic Equation and Parameters
Non-Linear Dynamic Equation
Linearlized Dynamic Equation at Upright Position
4Stabilizing Control at Upright Position
Standard Regulator Problem
Linear Quadratic Optimal Regulator(LQR)
Optimal Feedback Control
State Observer (Minimal Order Observer)
5Swing Up Control of TITech Pendulum
Assume Input Sequence (Bang-Bang Control)
Determination of T1, T2, T3, and T4
Constrained Successive Optimization
Open Loop Control
6Reduction of Degree of the System
Assumption
Reduced Model used for Non-Linear Control
7Non-Linear State Feedback Control
Controlled Vector Field of the System
U 0
U Max
U -Max
8Control Result
Lets use this controller as a expert.
9Fuzzy Set Allocation to the Problem
10If-THEN Rule for the Problem
PM
If x is NM and y is ZO then z is PB. If x is NB1
and y is PS then z is NB. If x is NM and y is PS
then z is NB. If x is NS and y is PS then z is
NB. If x is NB1 and y is ZO then z is ZO. If x
is NS and y is ZO then z is ZO. If x is NB2 then
z is ZO. If x is ZO then z is ZO. If y is NS then
z is ZO. If y is PM the z is ZO.
PS
ZO
NS
ZO
NS
NM
NB1
NB2
11Simulation Environment
MaTX/RtMaTX Prof.Masanobu KOGA Matrix
Operation Language Useful
Functions for Control System Design
(Similar to Matlab) Free
Software Running on Windows,
Unix, DOS Download?http//www.matx.org/machines
ScherzoMr. Masaaki HARA 3D Animation
Software(Free) X WindowOpen
GL(Mesa,glut) Download?http//www.matx.org/machin
es
12(No Transcript)
13(No Transcript)
14(No Transcript)
15Matrix Element Operation Using MaTX at Glance
(Matrix) A, B A Z(2,2)B I(2,2) A(1,2)
3.0 B(2,2) A(2,2)
16Matrix Operation Using MaTX at Glance
Matrix A, B,C 1. Addition, Subtraction,
Multiplication, Division C AB C A-B
C AB C A\B (C AB) 2. Transpose, Complex
Conjugate Transpose C A C B 3.
Eignevalue, Eignevector eigenvalues(A) D,X
eig(A) 4. Determinant, Inversion, Rnak
det(A) C A rank(A) 5. Singular
Decomposition, Schur Decomposition U,S,V
svd(A) UT schur(A)
17Structure of the Simulator
Simulation Functions t,x,u
OdeAuto(ts,te,x0,diff_eqs,link_eqs) t,x,u
OdeHybrid(ts,te,T,x0,diff_eqs,link_eqs)
18Fuzzy Set Allocation on Real Line (Matrix
Representation)
x
Sx(,1) stands for fuzzy set S1
Sx(,2) stands for fuzzy set S2
1
(S1)
(S2)
(Singletons)
19IF-THEN Rules and Function Realization
R1If x is S1 and y is S1 then z is S1. R2If
x is S2 and y is S2 then z is S2.
We assume system output and control input are
real values not are fuzzy sets.
w2
w1
z
C2
C1
(Normalized weighted sum)
20Functions and Variables in the Sample Program
21Real I0,L0,C0,m1,J1,l1,C1, g Matrix f Real
Umax  Real MF, PF Integer NO_OF_RULES,
MAX_DIV Matrix FSet1, FSet2, FSet3 Â Func void
main() Matrix x0 Array tc, xc, uc
Real T, h Integer i, N Matrix A, B, D, C,
G, Q, r, P Â void diff_eqn(), link_eqn(),
Set_FSets() Integer IsNear() Â / Setting
for Fuzzy Control / Set_FSets() Â Â Umax
1.25
L0 0.215 I0 1.75e-2 C0 0.118 Â m1
5.38e-2 J1 1.98e-4 l1 0.113 C1
8.3e-5 Â g 9.81 Â D I0m1L02,
m1l1L0 m1l1L0, J1m1l12 C C0,
0 0, C1 G 0, 0 0,
-m1l1g  A Z(4,4) A(1,3) 1.0 A(2,4)
1.0 A(34,14) D-G, -C B
Z(4,1) B(34,1) D1.0,0' r
I(1,1) Q 30,0,0,00,2000,0,00,0,0.1,00,
0,0,10 Â f,P lqr(A, B, Q, r)
x0 Z(4,1) x0(2,1) -3.14 Â h
5.0e-3 Â tc, xc, uc OdeHybrid(0.0, T, h,
x0, diff_eqn, link_eqn,h,1/30.0) Â N
Cols(tc) for(i1iltNi) xc(2,i)
-xc(2,i) PI Â print tc xc uc
gtgt "results.mat" Â
22Func void diff_eqn(dx,t,x,u) Matrix dx,x,u Real
t Matrix D,C,G,th,dth Real c1,s1, s2 Â th
x(12,1) dth x(34,1) Â s1
sin(th(2,1)) c1 cos(th(2,1)) s2
sin(2th(2,1)) Â D I0 m1(L02l12s1s1),
m1l1L0c1 m1l1L0c1, J1m1l12 C
C0m1l12s2dth(2,1)/2.0,-m1l1L0s1m1l12
s2dth(2,1)/2.0 -m1l12s2dth(2,1),
C1 G 0, -m1l1gs1' Â dx dth
D(1.0,0.0'u - Cdth-G)
23Func void link_eqn(u, t, x) Real t Matrix u,
x Matrix FControl() if(IsNear(x)) u
-f(x - 0, 0, 0, 0') else u
FControl(x) Â if(u(1,1) gt Umax) u(1,1)
Umax if(u(1,1) lt -Umax) u(1,1)
-Umax Â
24Func Matrix FControl(xx) Matrix xx Integer
i Real x,y, z, m Real FIsMember(),
FAnd() Matrix FSet3d Real Defuzzy() void
FOr() Â NO_OF_RULES 9 Â x xx(2,1) y
xx(4,1) Â FSet3d FSet3 for(i1iltCols(FSe
t3d)i) FSet3d(2,i) 0.0 Â FOr(FAnd(FI
sMember(x, FSet1, 3), FIsMember(y, FSet2, 2)),
FSet3d, 1) Â FOr(FAnd(FIsMember(x, FSet1, 2),
FIsMember(y, FSet2, 3)), FSet3d,
3) FOr(FAnd(FIsMember(x, FSet1, 3),
FIsMember(y, FSet2, 3)), FSet3d,
3) FOr(FAnd(FIsMember(x, FSet1, 4),
FIsMember(y, FSet2, 3)), FSet3d,
3) Â FOr(FAnd(FIsMember(x, FSet1, 2),
FIsMember(y, FSet2, 2)), FSet3d,
2) FOr(FIsMember(y, FSet2, 1), FSet3d,
2) FOr(FIsMember(y, FSet2, 4), FSet3d,
2) FOr(FIsMember(x, FSet1, 1), FSet3d,
2) FOr(FIsMember(x, FSet1, 5), FSet3d, 2) Â z
Defuzzy(FSet3d) Â return(z) Â
Func Real Defuzzy(S) Matrix S Integer i,
n Real z, w  n Cols(S)  z 0.0 w
0.0 for(i1iltni) z z
S(1,i)S(2,i) w w S(2,i) return(z/w)
25Open Loop Control
Crisp Logic Control
Fuzzy Logic Control
26Func void Set_FSets() Integer i,j  MF
-1e8 PF 1e8 Â / Fuzzy Set / FSet1
Z(3,5) Â FSet1(,1) MF, -6.5,
-3.85' FSet1(,2) -5.3, -3.85,
-3.3' FSet1(,3) -3.5, -3.3,
-2.66' FSet1(,4) -3.3, -2.66,
-1.11' FSet1(,5) -2.66, 0.0,
PF' Â FSet2 Z(3,4) Â FSet2(,1) MF,
-26.0, 3.18' FSet2(,2) -17.53, -1.82,
5.42' FSet2(,3) 3.0, 12.17,
26.0' FSet2(,4) 17.17, 26,
PF' Â Â FSet3 Z(1,3) Â FSet3(1,1)
-Umax FSet3(1,2) 0.0 FSet3(1,3) Umax
27Simulation Results (1)
28Simulation Result (2)
29References
- K.Furuta, M.Yamakita, S.KobayashiSwing-up
control of inverted pendulum using pseudo-state
feedback, Proc. Inst. Mech. Engrs. Vol.206 (1992) - M.Koga MaTX reference manual (1995)