Beruflich Dokumente
Kultur Dokumente
Chapter
9
system with decoupling algorithm
In the paper [1,2], a general decoupling algorithm for under actuated
system was proposed, refer to this paper, in this chapter, two sections are
introduced as follows:
In Section 9.1, general decoupling algorithm for underactuated system is
introduced, an example is given. In Section 9.2, consider a single inverted
pendulum dynamic model, the standard decoupling algorithm is used to
decouple the system, a sliding mode controller is designed by using
Hurwitz, an example is given. In Section 9.3, consider a translational
oscillator with rotational actuator (TORA) system, the standard decou-
pling algorithm is used to decouple the system, a sliding mode controller
is designed by using Hurwitz, an example is given.
q_1 5 p1
p_1 5 f1 ðq; pÞ 1 g1 ðq2 Þu
; ð9:1Þ
q_2 5 p2
p_2 5 f2 ðq; pÞ 1 g2 ðq2 Þu
where q 5 ½ q1 q2 , p 5 ½ p1 p2 .
g1 ðq2 Þ 2 ml
I 1 ml 2
and g2 ðq2 Þ5 ðM 1mÞI 1Mml2 , then g2 ðq2 Þ 5
ðM 1 mÞI 1 Mml2
I 1ml2
52I 1mlml2 .
ðM 1 mÞI 1 Mml2
z_1 5 z2
z_2 5 T1 q1
: ð9:7Þ
ξ_ 1 5 ξ 2
ξ_ 2 5 T2 q1 1 T3 ðu 1 dðtÞÞ
z_1 5 z2
z_2 5 T1 z1 1 T1 T4 ξ 1
: ð9:8Þ
ξ_ 1 5 ξ 2
ξ_ 2 5 T2 z1 1 T2 T4 ξ 1 1 T3 ðu 1 dðtÞÞ
310 CHAPTER 9 Sliding mode control for underactuated system with decoupling algorithm
σ 5 μ1 2 Cµ2 ; ð9:9Þ
where C 5 c1 c2 c3 .
Then we have
_ 2 5 T2 z1 1 T2 T4 ξ 1 1 T3 ðu 1 dðtÞÞ 2 Cµ
σ_ 5 μ_ 1 2 Cµ _ 2:
1
u5 _ 2 2 hsgnðσÞÞ;
ð2T2 z1 2 T2 T4 ξ 1 1 Cµ ð9:10Þ
T3
where h $ dðtÞ.
Design the Lyapunov function as
1
V 5 σ2 ;
2
then
From σσ_ # 0, under controller (9.10), the system can reach and thereafter
stay on the manifold σ 5 0 in finite time ts. On the manifold, we have
σ 5 μ1 2 Cµ2 5 0, i.e., μ1 5 Cµ2 .
9.2.4 C design
When t $ ts , we have
2 3
z2
_ 2 5 4 T1 z1 1 T1 T4 ξ 1 5 5 A1 μ1 1 A2 µ2 5 ðA1 C 1 A2 Þµ2 ;
µ ð9:11Þ
ξ2
2 3
0 1 0
where A1 5 0 0 1 Τ , A2 5 4 T1 0 T1 T4 5.
0 0 0
From μ1 5 ξ 2 ; µ2 5 z1 z2 ξ 1 Τ , we know if t-N, we have z1 -0,
_
z2 -0, ξ 2 -0 and ξ 2 -0, that is, θ-0, θ-0, _
x-0 and x-0.
2 3
0 1 0
6 7
A1 C 1 A2 5 0 0 1 Τ c1 c2 c3 1 6
4 T1 0 T1 T4 7
5
0 0 0
2 3 2 3 2 3:
0 0 0 0 1 0 0 1 0
6 7 6 7 6 7
56
40 0 07 6
5 1 4 T1
7 6
0 T1 T4 5 5 4 T1 0 T1 T4 7
5
c1 c2 c3 0 0 0 c1 c2 c3
0.2
th
0.1
Angle
0
–0.1
–0.2
0 5 10 15 20
Time/(s)
0.8
dth
0.6
Angle speed
0.4
0.2
–0.2
0 5 10 15 20
Time/(s)
0.3
x
0.2
Cart position
0.1
–0.1
0 5 10 15 20
Time/(s)
0.2
dx
0
Cart speed
–0.2
–0.4
–0.6
0 5 10 15 20
Time/(s)
–1
Control input u
–2
–3
–4
–5
–6
–7
–8
0 2 4 6 8 10 12 14 16 18 20
Time (s)
Matlab programs:
T4 5 2 m*l/(I 1 m*l^2);
T2 5 2 m^2*g*l^2/[(m 1 M)*I 1 M*m*l^2];
T3 5 (I 1 m*l^2)/[(m 1 M)*I 1 M*m*l^2];
T1 5 m*(M 1 m)*g*l/[(M 1 m)*I 1 M*m*l^2] 2 T4*T2;
th 5 u(1);dth 5 u(2);
x 5 u(3);dx 5 u(4);
q1 5 th;q2 5 x;
p1 5 dth;p2 5 dx;
z1 5 q1 1 m*l/(I 1 m*l^2)*q2;
z2 5 p1 1 m*l/(I 1 m*l^2)*p2;
kesi1 5 q2;
kesi2 5 p2;
9.2 Sliding Mode Control for an Inverted Pendulum 315
miu1 5 kesi2;
miu2 5 [z1 z2 kesi1]';
%%%%%%%%%%%%%%%%%%%%%%;
k 5 5;
c3 5 2 3*k;
c2 5 2 (3*k^2 1 T1)/(T1*T4);
c1 5 2 (k^3 2 T1*c3)/(T1*T4);
C 5 [c1 c2 c3];
%%%%%%%%%%%%%%%%%%%%%%%
sigma 5 miu1 2 C*miu2;
h 5 1.5;
fai 5 0.01;
if abs(sigma) , 5 fai
sat 5 sigma/fai;
else
sat 5 sign(sigma);
end
ut 5 1/T3*( 2 T2*z1 2 T2*T4*kesi1 1 C*dmiu2 2 h*sat);
sys(1) 5 ut;
3. S function for the plant: chap9_1plant.m
function [sys,x0,str,ts] 5 spacemodel(t,x,u,flag)
switch flag,
case 0,
[sys,x0,str,ts] 5 mdlInitializeSizes;
case 1,
sys 5 mdlDerivatives(t,x,u);
case 3,
sys 5 mdlOutputs(t,x,u);
case {2,4,9}
sys 5 [];
otherwise
error(['Unhandled flag 5 ',num2str(flag)]);
end
function [sys,x0,str,ts] 5 mdlInitializeSizes
sizes 5 simsizes;
sizes.NumContStates 5 4;
sizes.NumDiscStates 5 0;
sizes.NumOutputs 5 4;
sizes.NumInputs 5 1;
316 CHAPTER 9 Sliding mode control for underactuated system with decoupling algorithm
sizes.DirFeedthrough 5 0;
sizes.NumSampleTimes 5 1;
sys 5 simsizes(sizes);
x0 5 [ 2 10/57.3,0,0.20,0];
%x0 5 [0.01,0,0.020,0];
str 5 [];
ts 5 [0 0];
function sys 5 mdlDerivatives(t,x,u)
%Single Link Inverted Pendulum Parameters
g 5 9.8;M 5 1.0;m 5 0.1;L 5 0.5;
I 5 1/12*m*L^2;
l 5 1/2*L;
t1 5 m*(M 1 m)*g*l/[(M 1 m)*I 1 M*m*l^2];
t2 5 2 m^2*g*l^2/[(m 1 M)*I 1 M*m*l^2];
t3 5 2 m*l/[(M 1 m)*I 1 M*m*l^2];
t4 5 (I 1 m*l^2)/[(m 1 M)*I 1 M*m*l^2];
ut 5 u(1);
sys(1) 5 x(2);
sys(2) 5 t1*x(1) 1 t3*(ut 1 sin(t));%ddth
sys(3) 5 x(4);
sys(4) 5 t2*x(1) 1 t4*(ut 1 sin(t));%ddx
function sys 5 mdlOutputs(t,x,u)
sys(1) 5 x(1); %th
sys(2) 5 x(2);
sys(3) 5 x(3); %x
sys(4) 5 x(4);
4. Plot program: chap9_1plot.m
close all;
figure(1);
subplot(211);
plot(t,x(:,1),'r','linewidth',2);
legend('th');xlabel('time/(s)');ylabel('angle');
grid on;
subplot(212);
plot(t,x(:,2),'r','linewidth',2);
legend('dth');xlabel('time/(s)');ylabel('angle speed');
grid on;
figure(2);
subplot(211);
plot(t,x(:,3),'r','linewidth',2);
9.3 Sliding Mode Control for a TORA System 317
legend('x');xlabel('time/(s)');ylabel('cart position');
grid on;
subplot(212);
plot(t,x(:,4),'r','linewidth',2);
legend('dx');xlabel('time/(s)');ylabel('cart speed');
grid on;
figure(3);
plot(t,ut(:,1),'k','linewidth',2);
xlabel('time(s)');ylabel('control input u');
grid on;
Define
x1 5 z1 1 ε sin θ1 ; x2 5 z2 1 εθ2 cos θ1 ; x3 5 θ1 ; x4 5 θ2 : ð9:15Þ
318 CHAPTER 9 Sliding mode control for underactuated system with decoupling algorithm
From Eq. (9.15), we can see that the control goals z1 -0, z2 -0, θ1 -0,
and θ2 -0 are equivalent to xi -0, i 5 1; 2; 3; 4.
Since
@f1
Then @x 3
5 ε cos x3 1 11ε, and Eq. (9.17) becomes
x_1 5 x2
x_2 5 f1 ðx1 ; x3 Þ 2 11εx3
: ð9:18Þ
x_3 5 x4
x_4 5 u
where ci . 0, i 5 1; 2; 3.
@f1
From dtd @x 1
5 0, we have
@f1 @f1
Let M 5 c1 x2 1 c2 ðf1 2 11εx3 Þ 1 c3 e4 1 @x1 ð f1 2 11εx3 Þ 1 d
dt @x3 x4 , and
design the sliding mode controller as
21
@f1
u5 ð2M 2 ηsgns 2 ksÞ; ð9:22Þ
@x3
where η . 0 and k . 0.
320 CHAPTER 9 Sliding mode control for underactuated system with decoupling algorithm
Substituting Eq. (9.22) into s_, we have s_ 5 2ηsgnðsÞ 2 ks. Design the
Lyapunov function V 5 12 s2 , then
Defining E5 e1 e2 e3 T , d2 5 211εx3 , from e3 5 f1 ðx1 ; x3 Þ 5 2x1 1
εsin x3 1 11εx3 , then d2 5 211εx3 5 2 e3 2 x1 1 εsin x3 .
Considering sin x3 , x3 , we then have
To guarantee that E 5 e1 e2 e3 T -0, A must be Hurwitz, i.e., the
real part of the characteristic value of A must be negative.
2λ 1 0
From jA 2 λIj 5 0 2λ 1 5 λ2 ð2 c3 2 λÞ 2 c1 2 c2 λ 5 2 λ3 2
2c1 2c2 2c3 2λ
c3 λ2 2 c2 λ 2 c1 5 0, i.e., λ3 1 c3 λ2 1 c2 λ 1 c1 5 0. From ðλ1aÞ3 5 0, we
have λ3 1 3aλ2 1 3a2 λ 1 a3 5 0.
9.3 Sliding Mode Control for a TORA System 321
_ T PE1ET PE5
V_ 1 5 E _ ðAE1DÞT PE1 ET PðAE1DÞ
z1 0.5
–0.5
–1
0 10 20 30 40 50 60 70 80 90 100
Time (s)
0.5
dz1
–0.5
–1
0 10 20 30 40 50 60 70 80 90 100
Time (s)
2
th1
–2
–4
0 10 20 30 40 50 60 70 80 90 100
Time (s)
0
dth1
–5
–10
–15
0 10 20 30 40 50 60 70 80 90 100
Time (s)
50
–50
–100
v
–150
–200
–250
0 10 20 30 40 50 60 70 80 90 100
Time (s)
Matlab programs:
x1 5 z1 1 epc*sin(theta1);
x2 5 z2 1 epc*theta2*cos(theta1);
x3 5 theta1;
x4 5 theta2;
f1 5 2 x1 1 epc*sin(x3) 1 11*epc*x3;
f1_x1 5 2 1;
f1_x3 5 epc*(cos(x3) 1 11);
dt_f1_x1 5 0;
dt_f1_x3 5 2 epc*sin(x3)*x4;
9.3 Sliding Mode Control for a TORA System 325
e1 5 x1;
e2 5 x2;
e3 5 f1;
e4 5 f1_x1*x2 1 f1_x3*x4;
a 5 3.0;
c1 5 a^3;c2 5 3*a^2;c3 5 3*a;
s 5 c1*e1 1 c2*e2 1 c3*e3 1 e4;
k 5 5;xite 5 0.5;
fai 5 0.10;
if abs(s), 5 fai
sat 5 s/fai;
else
sat 5 sign(s);
end
sys(1) 5 v;
3. S function for the plant: chap9_2plant.m
function [sys,x0,str,ts] 5 s_function(t,x,u,flag)
switch flag,
case 0,
[sys,x0,str,ts] 5 mdlInitializeSizes;
case 1,
sys 5 mdlDerivatives(t,x,u);
case 3,
sys 5 mdlOutputs(t,x,u);
case {2, 4, 9}
sys 5 [];
otherwise
error(['Unhandled flag 5 ',num2str(flag)]);
end
function [sys,x0,str,ts] 5 mdlInitializeSizes
sizes 5 simsizes;
sizes.NumContStates 5 4;
sizes.NumDiscStates 5 0;
sizes.NumOutputs 5 4;
326 CHAPTER 9 Sliding mode control for underactuated system with decoupling algorithm
sizes.NumInputs 5 1;
sizes.DirFeedthrough 5 0;
sizes.NumSampleTimes 5 0;
sys 5 simsizes(sizes);
x0 5 [1;0;pi;0];
str 5 [];
ts 5 [];
function sys 5 mdlDerivatives(t,x,u)
z1 5 x(1);
theta1 5 x(3);
theta2 5 x(4);
epc 5 0.1;
v 5 u(1);
den 5 1 2 epc^2*(cos(theta1))^2;
dz2 5 ( 2 z1 1 epc*theta2^2*sin(theta1) 2
epc*cos(theta1)*v)/den;
dth2 5 (epc*cos(theta1)*(z1 2 epc*theta2^2*
sin(theta1)) 1 v)/den;
sys(1) 5 x(2);
sys(2) 5 dz2;
sys(3) 5 x(4);
sys(4) 5 dth2;
function sys 5 mdlOutputs(t,x,u)
sys(1) 5 x(1);
sys(2) 5 x(2);
sys(3) 5 x(3);
sys(4) 5 x(4);
4. Plot program: chap9_2plot.m
close all;
figure(1);
subplot(211);
plot(t,x(:,1),'r','linewidth',2);
xlabel('time(s)');ylabel('z1');
subplot(212);
plot(t,x(:,2),'r','linewidth',2);
xlabel('time(s)');ylabel('dz1');
figure(2);
subplot(211);
plot(t,x(:,3),'r','linewidth',2);
References 327
xlabel('time(s)');ylabel('th1');
subplot(212);
plot(t,x(:,4),'r','linewidth',2);
xlabel('time(s)');ylabel('dth1');
figure(3);
plot(t,ut(:,1),'r','linewidth',2);
xlabel('time(s)');ylabel('v');
REFERENCES
[1] R.O. Saber, Global configuration stabilization for the VTOL aircraft with strong
input coupling, IEEE Trans. Autom. Control. 47 (11) (2002) 19491959.
[2] R.O. Saber, Normal forms for underactuated mechanical systems with symmetry,
IEEE Trans. Autom. Control. 47 (2) (2002) 305308.
[3] X. Rong, U. Ozguner, Sliding mode control of a class of underactuated systems,
Automatica 44 (2008) 233248.