[go: up one dir, main page]

0% found this document useful (0 votes)
13 views7 pages

My HW4

Uploaded by

weiliemabubakar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views7 pages

My HW4

Uploaded by

weiliemabubakar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

NATIONAL TAIWAN UNIVERSITY OF SCIENCE AND TECHNOLOGY

MECHANICAL ENGINEERING DEPARTMENT

NONLINEAR CONTROL SYSTEM


HOMEWORK SET#4

Instructor: HUANG AN-CHYAU


Student: NGUYEN VAN TRUONG
ID. Student: D10403807
Consider the control of the mechanism in Figure 1, which represents a link driven by motor
through a torsional spring (a single-link flexible-joint robot), in the vertical plane. Its equations
of motion can be easily devived as:
Iq1  MgL sin q1  k (q1  q2 )  0 (1)

Jq2  k (q1  q2 )  u (2)

With I  0.0234(kgm2 ), M  0.5(kg ), L  0.75(m), k  50( Nm / rad ) and J  0.02(kgm2 )

Fig. 1: A flexible-joint mechanism


The state vector of the system dynamics:

x   q1 q1 q2 q2 
T
(3)

The corresponding vector fields f and g can be written


T
 MgL k k 
f   x2 - sinx1 - (x1 -x3 ) x4 (x1 -x3 )  (4)
 I l J 
T
 1
g  0 0 0  (5)
 J
The controllability matrix is obtained by simple computation
 1
0 0 0 
lJ 
 
0 0
1
0 
 lJ 
 g ad f g ad 2f g ad 3f g     (6)
0 1 1 
 0
 J J2 
1 1 
 0  0 
J J2 
The state transformation:
 z1  x1
z  x
 2 3
 MgL k
 z3   sin x1  ( x1  x3 ) (7)
 I I
 MgL k
 z4   cos x1  ( x2  x4 )
 I I

1
The input transformations is:
IJ
u (v  a( x)) (8)
k
Where
MgL MgL k k k k MgL
a ( x)  sin x1 ( x22  cos x1  )  ( x1  x3 )(   cos x1 ) (9)
I I I I I J I
The control law:
v  e(4)  a3e(3)  a2e  a1e  a0e (10)

Where e  z1  zd 1 - the tracking error dynamics

e(4)  a3e(3)  a2e  a1e  a0e  0 (11)

Choose the positive constants ai, i=0,1,2,3 such that the equation
s 4  a3 s3  a2 s 2  a1s1  a0  0 (12)

has the roots on the lelf-half of complex plane.


Suppose that s1 = -1; s2 = -3; s3 = -4; s4 = -5;
 (s+1)(s+3)(s+4)(s+5) = 0
 s 4  13s3  59s 2  107s  60  0 (13)
Therefore, we have:
a0  60; a1  107; a2  59; a3  13; (14)

In the X-space, the linear equation is: x  f ( x)  g ( x).u


x  f ( x)  g ( x).u (15)

 x1  x2

 x2   MgL sin x1  k ( x1  x3 )
 I I
  (16)
 x3  x4
 k 1
 x4  ( x1  x3 ) + u
 J J
This equation system (16) is described by the following function file "F4.m" in Matlab:
Matlab commands
function xdt=F4(t,x)
xdt=zeros(4,1);
z=zeros(4,1);
%Create parameters
I=0.0234;
M=0.5;
J=0.02;

2
L=0.75;
k=50;
g=9.81;
zd=1;zd1=0;zd2=0;zd3=0;zd4=1;
a0=60;a1=107;a2=59;a3=13;
%State transformation
z(1)=x(1);
z(2)=x(2);
z(3)=-M*g*(L/I)*sin(x(1)) -(k/I)*(x(1)-x(3));
z(4)=-M*g*(L/I)*x(2)*cos(x(1)) -(k/I)*(x(2)-x(4));
e=z(1) -zd;
ed=z(2) -zd1;
edd=z(3) -zd2;
eddd=z(4) -zd3;
%The control law
v=zd4 - a3*eddd - a2*edd - a1*ed - a0*e;
a=M*g*(L/I)*sin(x(1))*(x(2)^2+M*g*(L/I)*cos(x(1))+k/I)+(k/I)*(x(1
) -x(3))*(k/I+k/J+M*g*(L/I)*cos(x(1)));
%The input u
u=I*(J/k)*(v-a);
%Linear system in X-space
xdt(1,1)=x(2);
xdt(2,1)=-M*g*(L/I)*sin(x(1)) -(k/I)*(x(1) -x(3));
xdt(3,1)=x(4);
xdt(4,1)=(k/J)*(x(1) -x(3))+u/J;
end
To perform simulation system and plot the phase portrait, we use the “main3.m” file:
Matlab commands
clear all;
clc;
time=[0 50];
%Creat parameter
I=0.0234;
M=0.5;
J=0.02;
L=0.75;

3
k=50;
g=9.81;
x0=[0;0;0;0]; %initial conditions
[t,x]=ode45('F4' ,time,x0);
%X-SPACE
z1=x(:,1);
z2=x(:,2);
z3=(-M*g*L*(1/I))*sin(x(:,1)) -(k/I)*(x(:,1) -x(:,3));
z4=(-M*g*L*(1/I))*x(:,2).*sin(x(:,3)) -(k/I)*(x(:,2) -x(:,4));
figure(1);
legend1=plot(t,x(:,1),'-.b','linewidth',1);
hold on;
legend2=plot(t,x(:,2),'--r','linewidth',1);
legend3=plot(t,x(:,3),'-xm','linewidth',0.5);
legend4=plot(t,x(:,4),'b','linewidth',0.5);
grid;
xlabel('Time'); % name of horizontal axis
ylabel('X(t)'); % name of vertical axis
title('The time response of x'); % name of graph
legend([legend1,legend2,legend3,legend4],'x1','x2','x3','x4');
figure(2);
legend11=plot(t,z1,'-.b','linewidth',1);
hold on;
legend22=plot(t,z2,'--r','linewidth',1);
legend33=plot(t,z3,'b','linewidth',0.5);
legend44=plot(t,z4,'-xm','linewidth',0.5);
grid;
xlabel('Time'); % name of horizontal axis
ylabel('Z'); % name of vertical axis
title('The time response of Z'); % name of graph
legend([legend11,legend22,legend33,legend44],'z1','z2','z3','z4');

4
Results:

The time response of x


1.4
x1
x2
1.2
x3
x4
1

0.8
X(t)

0.6

0.4

0.2

0
0 1 2 3 4 5 6 7 8 9 10
Time

Fig. 2: Response of X

The time response of Z


60
z1
z2
50
z3
z4
40

30
Z

20

10

-10
0 1 2 3 4 5 6 7 8 9 10
Time

Fig. 3: Response of Z

5
Comments:
From Fig. 2, in X-Space with the initial condition (X0 = [0; 0; 0; 0] ) the linear system is stable
after a short period of time. The system is stable with the controller that was designed.

You might also like