Consider a system with a dc motor and the load, coupled by flexible shaft as shown in the next diagram

where:

: Position and speed of the load respectively.

: Position and speed of the motor shaft respectively.

: Dynamic friction coefficient of the load and the motor respectively.

: Inertia moment of the load and the motor respectively.

: Elastic torsion coefficient of the spring.

The states of system are the position and speed of the motor and the load respectively, and the input is the voltage applied. With this and using Newtons Law and the electrical equations for the motor, the system in state space is:

To control the position in a point of reference a sliding mode control with next structure is developed

Because of the implemented control the signal input to plant is not continuous, and it can be modelled as a switching signal with hysteresis, that jumps between two differences values depending of signal .

The close loop system can be modelled as a hybrid system, if an extra variable which count the time between jumps is considered and is reseted when jump occurs. the variable that jumps is called .

Where are the levels of hystereses and is the positive bounded of the switching signal.

% run.m to simulate timer with reset
clear all
global u
global r
%Reference Position [rad]
r=5;
%Initial Value for input for de switching signal
u=0;
%Define inicial conditions of the states
x0=[0;0;0;0;0;1];
%simulation horizon
TSPAN = [0 4];
JSPAN = [0 15];
%ruls for jump
%rule = 1 -> priority for jumps
%rule = 2 -> priority for flows
%rule = 3 -> ramdom priority
rule=1;
options = odeset('RelTol',1e-6,'MaxStep',.1);
%run simulation
[t j x] = HyEQsolver(@f,@g,@C,@D,x0,TSPAN,JSPAN,rule,options);
figure(1)
clf
subplot(2,1,1),plotflows(t,j,x(:,1))
grid on
ylabel('x1')
subplot(2,1,2),plotjumps(t,j,x(:,1))
grid on
ylabel('x1')
% plot hybrid arc
plotHybridArc(t,j,x)
xlabel('j')
ylabel('t')
zlabel('x')

function inD = D(x)
% Jump set
% Check if in D
global u
% Hysterisis level
hbar=1;
q=x(6);
if ((q == -1) && (u >= hbar))
inD = 1;
elseif ((q==1) && (u <= -hbar))
inD = 1;
else
inD=0;
end

function inC = C(x)
%flow set
%checck if in C
inC=1;
end

function xdot = f(x)
%flow map
global u
global r
z1=x(1);
z2=x(2);
z3=x(3);
z4=x(4);
tau=x(5);
q=x(6);
z=[z1;z2;z3;z4];
% Linear System
A=[0 1 0 0 ; -90.8 -0.7 90.8 0 ; 0 0 0 1 ; 55,41 0 -55.41 - 105.6];
B=[0 ; 0 ; 0 ; 220.7];
K=[2.2895 0.2714 0.8352 0.0045];
u = r-(K*z);
%Flow
xdot = [(A*z)+(B*(q*24)) ; 1 ; 0];
end

### Like this:

Like Loading...

*Related*