Sie sind auf Seite 1von 21

Sliding mode control for underactuated

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.

9.1 GENERAL DECOUPLING ALGORITHM FOR


UNDERACTUATED SYSTEM
R.O. Saber proposed a general decoupling algorithm for under actuated
system [1,2].
Consider the following coupled under actuated system

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 .

Sliding Mode Control Using MATLAB. DOI: http://dx.doi.org/10.1016/B978-0-12-802575-8.00009-6


Copyright © 2017 Tsinghua University Press Limited. Published by Elsevier Inc. All rights reserved. 307
308 CHAPTER 9 Sliding mode control for underactuated system with decoupling algorithm

Model decoupling algorithm is designed as [1]:


ð q2
g1 ðsÞ
x1 5 q1 2 ds
0 g2 ðsÞ
g1 ðq2 Þ
x2 5 p1 2 p2 : ð9:2Þ
g2 ðq2 Þ
x3 5 q2
x4 5 p2

The essence of decoupling algorithm is to remove u in x_2 . From Eq. (9.2)


we can get
 0  
g1 g1
x_2 5 p_1 2 p2 2 p_
g2 g2 2
 0
g1 g1
5 f1 1 g 1 u 2 p2 2 ð f2 1 g2 uÞ :
g2 g2
 0
g1 g1
5 f1 2 p2 2 f2
g2 g2
Then Eq. (9.1) can be decoupled as
x_1 5 x2
 0
g1 g1
x_2 5 f1 2 p2 2 f2 : ð9:3Þ
g2 g2
x_3 5 x4
x_4 5 f2 1 g2 u

9.2 SLIDING MODE CONTROL FOR AN INVERTED


PENDULUM
9.2.1 System description
Consider a single inverted pendulum dynamic model, near the equilib-
rium point, we have sin θ  θ, cos θ  1, then we can get a linear
equation for the single inverted pendulum as
mðm 1 MÞgl ml
θ€ 5 θ2 ðu 1 dðtÞÞ
ðM 1 mÞI 1 Mml2 ðM 1 mÞI 1 Mml2
; ð9:4Þ
m2 gl2 I 1 ml2
x€ 5 2 θ1 ðu 1 dðtÞÞ
ðM 1 mÞI 1 Mml 2 ðM 1 mÞI 1 Mml2

where M is the mass of cart, m is the mass of pendulum, x is the position


of cart, θ is the pendulum angle, L denotes the pendulum length, l 5 12 L,
u is the control input, I 5 13 ml2 is the moment of inertia for the pendulum
around its center of gravity and d(t) is disturbance.
_
The control goals are x-0, x-0, _
θ-0 and θ-0.
9.2 Sliding Mode Control for an Inverted Pendulum 309

9.2.2 Model decoupling


In order to design the sliding mode controller, model (9.4) needs to be
decoupled. Define q1 5 θ, q2 5 x, then p1 5 θ, _ p2 5 x, _ define
1 MÞgl 2 2
f1 ðq; pÞ5 ðMmðm
1mÞI 1 Mml2 q1 , g1 ðq2 Þ52 ðM 1mÞI 1Mml2 , f2 ðq;pÞ52 ðM 1mÞI 1Mml2 q1
ml m gl

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

Using the standard decoupling algorithm (9.2), we can get a decoupling


algorithm as
ð q2
g1 ðsÞ ml
z1 5 q1 2 ds 5 q1 1 q2
0g2 ðsÞ I 1 ml2
g1 ðq2 Þ ml
z2 5 p1 2 p2 5 p1 1 p2 : ð9:5Þ
g2 ðq2 Þ I 1 ml2
ξ 1 5 q2
ξ 2 5 p2
_
Then the balance point of the inverted pendulum θ-0, x-0, θ-0 and
_x-0 is equivalent to z1 -0, z2 -0 and ξ 1 -0, ξ 2 -0.
Using the decoupling algorithm, we obtain
z_1 5 z2
 
mðm 1 MÞgl ml m2 gl2
z_2 5 2 q1
ðM 1 mÞI 1 Mml2 I 1 ml2 ðM 1 mÞI 1 Mml2
: ð9:6Þ
ξ_ 1 5 ξ 2
m2 gl2 I 1 ml2
ξ_ 2 5 2 q1 1 ðu 1 dðtÞÞ
ðM 1 mÞI 1 Mml 2 ðM 1 mÞI 1 Mml2

mðm 1 MÞgl m2 gl2 2 2


Defining T1 5 ðM 1 mÞI 1 Mml2 2 I 1 ml2 ðM 1 mÞI 1 Mml2 ,
ml
T2 5 2 ðM 1 mÞI
m gl
1 Mml2
I 1 ml2
and T3 5 ðM 1 mÞI 1 Mml2 , Eq. (9.6) then becomes

z_1 5 z2
z_2 5 T1 q1
: ð9:7Þ
ξ_ 1 5 ξ 2
ξ_ 2 5 T2 q1 1 T3 ðu 1 dðtÞÞ

Considering q1 5 z1 2 I 1mlml2 q2 5 z1 2 I 1mlml2 ξ 1 5 z1 1 T4 ξ 1 and


T4 5 2 I 1 ml2 , then Eq. (9.7) becomes
ml

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

9.2.3 Sliding mode controller design



For Eq. (9.8), define μ1 5 ξ 2 ; µ2 5 z1 z2 ξ 1 Τ , design the sliding
mode controller as

σ 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:

Design the sliding mode controller as

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

σσ_ 5 σð2hsgnðσÞ 1 dðtÞÞ # 0:

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

To guarantee µ2 -0, A1 C 1 A2 should be Hurwitz, thus we can get


μ1 5 Cµ2 -0.
9.2 Sliding Mode Control for an Inverted Pendulum 311


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

The poles of A1 C 1 A2 can be designed by the following:


 
 s 21 0 
   

sI 2 ðA1 C 1 A2 Þ 5  2T1 s 2T1 T4 
 
 2c 2c2 s2c 
1 3 : ð9:12Þ
5 s 2 c3 s 2 T1 T4 c1 2 c2 T1 T4 s 2 T1 ðs 2 c3 Þ
3 2

5 s3 2 c3 s2 2 ðc2 T1 T4 1T1 Þs 2 T1 T4 c1 1T1 c3 5 0

From ðs1kÞ3 5 0, k . 0, we have s3 1 3ks2 1 3k2 s 1 k3 5 0; comparing


with Eq. (9.12), we can get
8
< 2c3 5 3k
2c T T 2 T1 5 3k2 :
: 2 1 4
2T1 T4 c1 1T1 c3 5 k3

To make A1 C 1 A2 Hurwitz, the sliding mode parameters are designed as


follows:
8
> c3 5 2 3k
>
>
>
< 3k2 1T1
c2 5 2
T1 T4 : ð9:13Þ
>
>
>
: c1 5 2 2 T1 c3
3
> k
T1 T4

9.2.5 Simulation example


Considering plant as (9.4), choose M 5 1, m 5 0.10, L 5 0.50, the initial
_ 5 0, xð0Þ 5 0:20, xð0Þ
states are set as θð0Þ 5 2108, θð0Þ _ 5 0, and set
dðtÞ 5 sint.
Use controller (9.10), design C by Eq. (9.13), choose k 5 5 and h 5 1.5.
Use the saturation function instead of the switch function, and set
Δ 5 0.01. We can then obtain the simulation results, which are shown in
Figs. 9.19.3.
312 CHAPTER 9 Sliding mode control for underactuated system with decoupling algorithm

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)

■ FIGURE 9.1 Angle and angle speed of pendulum.

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)

■ FIGURE 9.2 Position and speed of cart.


9.2 Sliding Mode Control for an Inverted Pendulum 313

–1
Control input u

–2

–3

–4

–5

–6

–7

–8
0 2 4 6 8 10 12 14 16 18 20
Time (s)

■ FIGURE 9.3 Control input.

Matlab programs:

1. Simulink main program: chap9_1sim.mdl


314 CHAPTER 9 Sliding mode control for underactuated system with decoupling algorithm

2. S function for controller; chap9_1ctrl.m


function [sys,x0,str,ts] 5 s_function(t,x,u,flag)
switch flag,
case 0,
[sys,x0,str,ts] 5 mdlInitializeSizes;
case 3,
sys 5 mdlOutputs(t,x,u);
case {1, 2, 4, 9}
sys 5 [];
otherwise
error(['Unhandled flag 5 ',num2str(flag)]);
end
function [sys,x0,str,ts] 5 mdlInitializeSizes
sizes 5 simsizes;
sizes.NumDiscStates 5 0;
sizes.NumOutputs 5 1;
sizes.NumInputs 5 4;
sizes.DirFeedthrough 5 1;
sizes.NumSampleTimes 5 1;
sys 5 simsizes(sizes);
x0 5 [ ];
str 5 [];
ts 5 [0 0];
function sys 5 mdlOutputs(t,x,u)
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;

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;

dmiu2 5 [z2;T1*z1 1 T1*T4*kesi1;kesi2];

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;

9.3 SLIDING MODE CONTROL FOR A TORA SYSTEM


A translational oscillator with rotational actuator (TORA) system has
been constructed as a benchmark system to evaluate the performance of
various nonlinear controllers.

9.3.1 System description


The dynamics of the TORA system are described as
z_1 5 z2
2z1 1 εθ22 sin θ1 ε cos θ1
z_2 5 2 v
1 2ε2 cos2 θ1 1 2 ε2 cos2 θ1
; ð9:14Þ
θ_ 1 5 θ2
ε cos θ1 ðz1 2 εθ22 sin θ1 Þ 1
θ_ 2 5 1 v
1 2 ε2 cos2 θ1 1 2 ε2 cos2 θ1
where z1 is the normalized displacement of the platform from the equilib-
rium position, z2 5 z_1 , θ1 is the angle of the rotor, z2 5 z_1 and v is control
input.
The control goals are z1 -0, z_1 -0, θ1 -0 and θ_ 1 -0 as t-N.

9.3.2 Model decoupling


Apply the decoupling algorithm in Eq. (9.2) to Eq. (9.14), and let
2 z1 1 εθ22 sin θ1 ε cos θ1 ðz1 2 εθ22 sin θ1 Þ
f1 5 1 2ε2 cos2 θ1 , g1 5 2 1 2εεcos θ1
2 cos2 θ ,
1
f2 5 1 2 ε2 cos2 θ1 and
g2 5 2 1 2ε2 1cos2 θ1 . We then have g1
g2 5 ε cos θ1 .

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

x_2 5 z_2 1 εθ_ 2 cos θ1 2 εθ22 sin θ1

2z1 1 εθ22 sin θ1 ε cos θ1


5 2 v
1 2 ε2 cos2 θ1 1 2 ε2 cos2 θ1
  !
ε cos θ1 z1 2 εθ22 sin θ1 1
1ε 1 v cos θ1 2 εθ22 sin θ1
1 2 ε2 cos2 θ1 1 2 ε2 cos2 θ1
;
2z1 1 εθ22 sin θ1 ε2 cos θ1 ðz1 2 εθ22 sin θ1 Þ
5 1 2 εθ22 sin θ1
1 2 ε cos θ1
2 2 1 2 ε2 cos2 θ1
2z1 ð1 2 ε2 cos θ1 Þ 1 εθ22 sin θ1 ð1 2 ε2 cos θ1 Þ
5 2 εθ22 sin θ1
1 2 ε2 cos2 θ1
5 2z1 5 2x1 1 ε sin x3

ε cos θ1 ðz1 2 εθ22 sin θ1 Þ


let u 5 1 2 ε2 cos2 θ1 2 1 2 ε2 1cos2 θ1 v, i.e., v 5 ε cos θ1 ðz1 2 εθ22 sin θ1 Þ 2
ð1 2 ε2 cos2 θ1 Þu, from z1 5 x1 2 εsinx3 , we have

v 5 ε cos x3 ðx1 2 ð1 1 x24 Þ ε sin x3 Þ 2 ð1 2 ε2 cos2 x3 Þu: ð9:16Þ

From the above analysis, Eq. (9.14) can be decoupled as


x_1 5 x2
x_2 5 f1 ðx1 ; x3 Þ
; ð9:17Þ
x_3 5 x4
x_4 5 u

where f1 ðx1 ; x3 Þ 5 2x1 1 ε sin x3 .


In paper [3], a sliding mode controller is designed for a kind of underac-
tuated system, in which f1 ðx1 ; x3 Þ must be satisfied as three assumptions
as follows:
Assumption 1: f1 ð0; 0Þ-0;
@f1
Assumption 2: @x 3
is invertible;
Assumption 3: if f1 ð0; x3 Þ-0, then x3 -0.
@f1
Obviously if Eq. (9.17), @x3
is not satisfied by Assumption 2, we can rede-
fine f1 ðx1 ; x3 Þ as
f1 ðx1 ; x3 Þ 5 2x1 1 ε sin x3 1 11εx3 :
9.3 Sliding Mode Control for a TORA System 319

@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

9.3.3 Sliding mode controller design


To realize xi -0, define the error equation as
e1 5 x1
e2 5 e_1 5 x2
e3 5 f1 ðx1 ; x3 Þ : ð9:19Þ
@f1 @f1
e4 5 e_3 5 f_1 ðx1 ; x3 Þ 5 x2 1 x4
@x1 @x3
In the above equation, to prevent singularity in the controller design, we
do not let e3 5 e_2 .
Design the sliding mode function as
s 5 c1 e1 1 c2 e2 1 c3 e3 1 e4 ; ð9:20Þ

where ci . 0, i 5 1; 2; 3.

@f1
From dtd @x 1
5 0, we have

s_ 5 c1 e_1 1 c2 e_2 1 c3 e_3 1 e_4


 
d @f1 @f1 ; ð9:21Þ
5 c1 x2 1 c2 ðf1 2 11εx3 Þ 1 c3 e4 1 x2 1 x4
dt @x1 @x3
 
@f1 @f1 @f1 @f1 @f1
where dtd @x1 x2 1 @x3 x4 5 @x1 ð f1 2 11εx3 Þ 1 d
dt @x3 x4 1 @x3 u.
Then
 
@f1 d @f1 @f1
s_ 5 c1 x2 1 c2 ðf1 2 11εx3 Þ 1 c3 e4 1 ðf1 2 11εx3 Þ 1 x4 1 u
@x1 dt @x3 @x3


@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

V_ 5 s_s 52ηjsj 2 ks2 # 0:

9.3.4 Convergence analysis


From Eq. (9.19), we have e_1 5 e2 , e_2 5 e3 1 11εx3 , e_3 5 e4 . From s_s # 0,
under controller (9.22), the system can reach and thereafter stay on the
manifold s 5 0 in finite time. On the manifold s 5 0, we have
e4 5 2c1 e1 2 c2 e2 2 c3 e3 .
2 3
0 1 0
Define A54 0 0 1 5 and design ci to guarantee that A is
2c1 2c2 2c3
Hurwitz; we then get the error state equation as
e_1 5 e2
e_2 5 e3 2 11εx3 : ð9:23Þ
e_3 5 2c1 e1 2 c2 e2 2 c3 e3


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

jd2 j 5 11εjx3 j 5 j2e3 2x1 1 ε sin x3 j # je3 j 1 je1 j 1 εjx3 j:

Then 10εjx3 j # je3 j 1 je1 j, and

jd2 j 5 11εjx3 j 5 1:1 3 10εjx3 j # 1:1ðje3 j 1 je1 jÞ # 2:2jjEjj2 :



Let D 5 0 d2 0 T ; we have jjDjj2 # γjjEjj2 , γ 5 2:2. From Eq. (9.23),
we have
_ 5 AE 1 D:
E ð9:24Þ


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

If we choose c1 5 a3 , c2 5 3a2 , c3 5 3a, and let a . 0, then A will be


Hurwitz. Defining Q 5 QT . 0, there exists a Lyapunov equation
AT P 1 PA 5 2Q, P 5 PT . 0.
Design the Lyapunov function as V1 5 ET PE, then we have

_ T PE1ET PE5
V_ 1 5 E _ ðAE1DÞT PE1 ET PðAE1DÞ

5 ET AT PE1DT PE1ET PAE 1ET PD5 ET ðAT P1PAÞE1DT PE1ET PD


;
52ET QE1 DT PE1 ET PD# 2λmin ðQÞjjEjj22 12λmax ðPÞγjjEjj22
5 ð2λmin ðQÞ12λmax ðPÞγÞjjEjj22

where DT PE 1 ET PD # 2λmax ðPÞγjjEjj22 , λmin ðQÞ is the minimum eigen-


value of positive definite matrix Q and λmax ðPÞ is the maximum
eigenvalue of positive definite matrix P.
λmin ðQÞ
Let 2λmax ðPÞ
. γ, then we have V_ 1 , 0.

If we let Q 5 I3 , we have λmin ðQÞ 5 1, λmax ðPÞ 5 1


2λleft ð2 AÞ, then
λmin ðQÞ
2λmax ðPÞ . γ becomes λleft ð2AÞ . γ, which can be guaranteed by A
design.

Since A is Hurwitz, then E 5 e1 e2 e3 T -0 will be satisfied,
i.e., e1 -0, e2 -0 and e3 -0; moreover, from s-0, we have e4 -0.
From e1 -0 and e2 -0, we can get x1 -0, x2 -0, from
e3 5 f1 ð0; 0; x3 Þ-0, Assumption 3 and Eq. (9.19), we can get x3 -0,
x4 -0.

9.3.5 Simulation example


For a TORA system as
z_1 5 z2
2z1 1 εθ22 sin θ1 ε cos θ1
z_2 5 2 v
1 2 ε2 cos2 θ1 1 2 ε2 cos2 θ1
;
θ_ 1 5 θ2
ε cos θ1 ðz1 2 εθ22 sin θ1 Þ 1
θ_ 2 5 2 v
1 2 ε2 cos2 θ1 1 2 ε2 cos2 θ1

the initial states are set as 1 0 π 0 . To satisfy λleft ð2AÞ . γ,
choose a 5 3:0, then we have c1 5 a3 and c2 5 3a2 , c3 5 3a.
Using control law (9.16) and Eq. (9.22), set k 5 5.0, η 5 0.50, use the
saturation function instead of the switch function and let Δ 5 0.10.
The simulation results are shown in Figs. 9.49.6.
322 CHAPTER 9 Sliding mode control for underactuated system with decoupling algorithm

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)

■ FIGURE 9.4 Response of z1 and _z 1 .

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)

■ FIGURE 9.5 Response of θ1 and θ_ 1 .


9.3 Sliding Mode Control for a TORA System 323

50

–50

–100
v

–150

–200

–250
0 10 20 30 40 50 60 70 80 90 100
Time (s)

■ FIGURE 9.6 Control input.

Matlab programs:

1. Simulink main program: chap9_2sim.mdl


324 CHAPTER 9 Sliding mode control for underactuated system with decoupling algorithm

2. S function for controller; chap9_2ctrl.m


function [sys,x0,str,ts] 5 s_function(t,x,u,flag)
switch flag,
case 0,
[sys,x0,str,ts] 5 mdlInitializeSizes;
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 0;
sizes.NumDiscStates 5 0;
sizes.NumOutputs 5 1;
sizes.NumInputs 5 4;
sizes.DirFeedthrough 5 1;
sizes.NumSampleTimes 5 1;
sys 5 simsizes(sizes);
x0 5 [];
str 5 [];
ts 5 [0 0];
function sys 5 mdlOutputs(t,x,u)
epc 5 0.1;
z1 5 u(1);
z2 5 u(2);
theta1 5 u(3);
theta2 5 u(4);

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;

M 5 c1*x2 1 c2*(f1 2 11*epc*x3) 1 c3*e4 1 f1_x1*


(f1 2 11*epc*x3) 1 dt_f1_x3*x4;

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

ut 5 1/f1_x3*(2 M 2 k*s 2 xite*sat);


v 5 (1 2 epc^2*(cos(theta1))^2)*ut 2 epc*cos(theta1)*
(z1 2 epc*theta2^2*sin(theta1));

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.

Das könnte Ihnen auch gefallen