Professional Documents
Culture Documents
Controllability: In order to be able to do whatever we We assume a reference 𝑟(𝑡) , then we get the
want with the given Dynamic system under control characteristics the control law:
input, the system must be controllable. If the system
is controllable, we can find a control input that Will 𝑢 = −𝐾𝑥 + 𝐾𝐼 𝜉
transfer our system from any initial state to any final
state. To know controllability be having to apply the Where 𝜉 is the output of the integrator, K is the
following expressions: proportional gain vector and 𝐾𝐼 is the integral gain.
𝑆 = [𝐵 𝐴𝐵 𝐴2 𝐵 … 𝐴𝑛−1 𝐵]
𝜉̇ = 𝑟 − 𝑦
The system Will be controllable if and only if 𝜉̇ = 𝑟 − (𝐶𝑥 + 𝐷𝑢)
𝐶 𝑥𝑒(𝑡)
𝐶𝐴 𝑒(𝑡) = [ 𝜉 ]
𝑒(𝑡)
𝑉 = 𝐶𝐴2
⋮
[𝐶𝐴𝑛−1 ] We obtain a new control law:
𝑟𝑎𝑛𝑘(𝑉 ) = 𝑛 Where:
𝑥
𝑦 = [𝐶 0] [𝜉 ] + [𝐷]𝑢 𝑒𝑠𝑠 = |𝑒∞ − 𝑟𝑒𝑓|
Where:
𝐿: 𝐺𝑎𝑖𝑛 𝑣𝑒𝑐𝑡𝑜𝑟
𝑥̃: 𝐸𝑠𝑡𝑖𝑚𝑎𝑡𝑒𝑑 𝑠𝑡𝑎𝑡𝑒𝑠 𝑣𝑒𝑐𝑡𝑜𝑟
𝑦̃: 𝐸𝑠𝑡𝑖𝑚𝑎𝑡𝑒𝑑 𝑜𝑢𝑡𝑝𝑢𝑡
First, we start by calculating the maximum Because the encoder has noise, the signal is altered
overshoot, because with it we can determine the in amplitude, for this reason, it was decided to
damping factor. develop a digital low-pass filter, which removes
high-frequency signals and smooths it out.
𝑧𝑒𝑡𝑎
−( )𝜋
𝑀𝑝 = 𝑒 √1−𝑧𝑒𝑡𝑎 2
𝑋̇ 0 1 0
[ 1] = [ ][ ]
𝑋̇2 −0.7224 −0.4930 1.8144
0
𝑦 = [1 0] [ ] + [0]𝑢
1.8144
Fig 6: Motor current comparison When the poles of the feedback state controller
change and become more negative, that is, moving to
III. CONCLUSIONS
the left of the coordinate axes, the system becomes
Finally, a comparison is made by assigning more faster to reach the reference which is π as shown in
negative poles to the controller and the observer as figure 7.
shown below.
When the observer's poles shift and become more 𝑝𝑑𝑐 = [−4 − 4 − 4]
negative, that is, they move to the left, the system 𝑝𝑑𝑜 = [−10 − 10]
tracks the state variables faster as shown in figure 7.
IV. BIBLIOGRAPHY
[1] Enrique Arnáez Braschi, Enfoque práctico del control
moderno, Primera edición. Lima: Metrocolor S.A., 2014.
% controlador subplot(212)
pdc = -4*ones(3,1) plot(T,X2-Xo2);grid on;ylabel('Error X2')
grid on
Km = acker(Am,Bm,pdc);
K = Km(1,1:2); figure(5)
kI = -Km(1,3); subplot(1,2,1),plot(T,Y,'y','LineWidth',4
);hold on
%Observador subplot(1,2,1),plot(T,X1,'LineWidth',1);h
pdo = -4*ones(2,1) old on
L = acker(A',C',pdo)'; subplot(1,2,1),plot(T,Xo1,'LineWidth',2);
hold on
subplot(1,2,1),plot(T,X1-
% Tiempo Xo1,'LineWidth',1);grid on
ti = 0; grid on;
dt = 0.001; ylabel('Radianes');xlabel('Tiempo(s)');ti
tf = 5; tle('Posición angular con referencia de
pi radianes')
% condiciones iniciales legend('Posicion','estado X1','estado
x = [0 0 0]'; Xo1','X1-Xo1','Location','best')
xo = [0.2 2]'; %%%%%%%%%%%%%%%%%%%%%%%%% subplot(1,2,2),plot(T,X2);hold on
u = 2.5; title('ESTADO
r = pi; X2'),xlabel('Tiempo(s)'),ylabel('Amperios
');
% Simulaciones subplot(1,2,2), plot(T,Xo2); hold on
k = 1; subplot(1,2,2),plot(T,X2-Xo2);grid on;
for t = ti:dt:tf legend('X2','Xo2', 'X2 -Xo2');
X1(k,1) = x(1,1);
X2(k,1) = x(2,1);
X3(k,1) = x(3,1);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Xo1(k,1) = xo(1,1); %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Xo2(k,1) = xo(2,1); %% Comparación de pdc =4 y pdc=10 del
controlador
T(k,1) = t;
% controlador
xp = Am*x + Bm*u + Wm*r; pdc = -4*ones(3,1);
y = Cm*x + Dm*u;
Km = acker(Am,Bm,pdc);
Y(k,1) = y; K = Km(1,1:2);
kI = -Km(1,3);
yo = C*xo + D*u;
xop = A*xo + B*u + L*(y-yo); %Observador
pdo = -4*ones(2,1);
L = acker(A',C',pdo)'; % controlador
pdc = -10*ones(3,1);
% Tiempo
ti = 0; Km = acker(Am,Bm,pdc);
dt = 0.001; K = Km(1,1:2);
tf = 5; kI = -Km(1,3);
subplot(2,2,[3,4]),plot(T,Y,'g');hold on k = k + 1;
ylabel('Radianes');xlabel('Tiempo(s)'); end
title('Posición angular con referencia de subplot(2,2,1), plot(T,X1,'-r');hold on
pi radianes'); legend('Posición pdc = 4','Posición pdc =
grid on; 10','Location','Southeast')
subplot(2,2,[3,4]),plot(T,Y,'-r');hold on
subplot(2,2,2),plot(T,X2,'g');hold on legend('Posición pdc = 4','Posición pdc =
ylabel('Amperios');xlabel('Tiempo(s)'); 10','Location','Southeast')
title('ESTADO X2'); grid on
grid on; subplot(2,2,2),plot(T,X2,'-r');hold on
%ylabel('Radianes');xlabel('Tiempo(s)');
%title('Posición angular con referencia
de pi radianes') k = k + 1;
legend('Corriente pdc = 4','Corriente pdc end
= 10','Location','Southeast')
figure(7)
subplot(2,2,1),plot(T,X1,'g');hold on
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% title('Estado
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% X1');xlabel('Tiempo(s)');ylabel('Posición
%% Comparación de pdo =4 y pdo=4 del ');
observador grid on;
subplot(2,2,[3,4]),plot(T,Y,'g');hold on
% controlador title('Posición angular con referencia de
pdc = -4*ones(3,1); pi
radianes');ylabel('Radianes');xlabel('Tie
Km = acker(Am,Bm,pdc); mpo(s)');
K = Km(1,1:2); %legend('Posición pdo = 4','Posición pdo
kI = -Km(1,3); = 10','Location','Southeast');
grid on;
subplot(2,2,2),plot(T,X2,'g');hold on
%Observador title('Estado X2'),
pdo = -4*ones(2,1); ylabel('Amperios');xlabel('Tiempo(s)');
L = acker(A',C',pdo)'; grid on;
% Tiempo % controlador
ti = 0; pdc = -4*ones(3,1);
dt = 0.001;
tf = 5;
Km = acker(Am,Bm,pdc);
K = Km(1,1:2);
% condiciones iniciales kI = -Km(1,3);
x = [0 0 0]';
xo = [0.2 2]'; %%%%%%%%%%%%%%%%%%%%%%%%%
u = 2.5; %Observador
r = pi; pdo = -10*ones(2,1);
L = acker(A',C',pdo)';
% Simulaciones
k = 1; % Tiempo
for t = ti:dt:tf ti = 0;
X1(k,1) = x(1,1); dt = 0.001;
X2(k,1) = x(2,1); tf = 5;
X3(k,1) = x(3,1);
% condiciones iniciales
Xo1(k,1) = xo(1,1); x = [0 0 0]';
Xo2(k,1) = xo(2,1); xo = [0.2 2]'; %%%%%%%%%%%%%%%%%%%%%%%%%
u = 2.5;
r = pi;
T(k,1) = t;
% Simulaciones
xp = Am*x + Bm*u + Wm*r; k = 1;
y = Cm*x + Dm*u; for t = ti:dt:tf
X1(k,1) = x(1,1);
Y(k,1) = y; X2(k,1) = x(2,1);
X3(k,1) = x(3,1);
yo = C*xo + D*u;
xop = A*xo + B*u + L*(y-yo); Xo1(k,1) = xo(1,1);
Xo2(k,1) = xo(2,1);
u = -K*xo + kI*x(3,1);
T(k,1) = t;
x = x + xp*dt;
xo = xo + xop*dt; xp = Am*x + Bm*u + Wm*r;
y = Cm*x + Dm*u;
Y(k,1) = y;
yo = C*xo + D*u;
xop = A*xo + B*u + L*(y-yo);
u = -K*xo + kI*x(3,1);
x = x + xp*dt;
xo = xo + xop*dt;
k = k + 1;
end
subplot(2,2,1),plot(T,X1,'-r');hold on
grid on
legend('Posición pdo = 4','Posición pdo =
10','Location','Southeast')
subplot(2,2,[3,4]),plot(T,Y,'-r');hold on
grid on
legend('C pdo = 4','Posición pdo =
10','Location','Southeast')
subplot(2,2,2),plot(T,X2,'-r');hold on
grid on
%ylabel('Radianes');xlabel('Tiempo(s)');
%title('Posición angular con referencia
de pi radianes')
legend('Corriente pdo = 4','Posición pdo
= 10','Location','Southeast')