Documentos de Académico
Documentos de Profesional
Documentos de Cultura
Aplica Toolbox de Identificacion Con Matlab
Aplica Toolbox de Identificacion Con Matlab
de Parmetros de un
Motor DC con Matlab
Motivacin
Usar un Cdigo
de Programa
Obtener la DATA
usando la NIDAQ
Aplicar la Teora
de Control Digital
Construir los
Circuitos
M.Sc. Ricardo Rodriguez B.
Motor DC
Modelo
v(t )
MOTOR
T (t )
R
(t )
L
V (t
()
TL (t
()
LOAD
i (t )
Vb (t
()
TL (t
()
T (t ) (t )
1
Ls + R
V (s )
+
T ( s)
I (s
( )
Kt
1
Js + B
( s )
Vb ( s )
Kb
SIMULINK p
para el Modelo
Motor DC para el Control
d P
de
Posicin
i i
Modelo
M
Motor
DC
(Posicin)
Modelo
Motor DC
(Velocidad)
Controlador Digital
g
10
11
12
13
Discretizando el
Modelo Motor DC con
T lkit de
Toolkits
d LabVIEW
L bVIEW
14
15
Identificando Parmetros
de un Motor DC
16
load datamdc
who
ho
tt=muestra_datos(:,1); % tiempo
xx=muestra_datos(:,2); % posicion
uu=muestra datos(: 3); % entrada
uu=muestra_datos(:,3);
vv=muestra_datos(:,4); % velocidad
17
Datos=[N t u x v]
18
tam=length(u);
datos_ident=[v(1:tam/2) u(1:tam/2)];
datos_vald=[v(tam/2+1:tam) u(tam/2+1:tam)];
figure
plot(
l t( datos_ident,
d t
id t k')
xlabel(' # muestras')
19
figure
muestra ident=iddata(datos
muestra_ident
iddata(datos_ident);
ident);
plot(muestra_ident,'r','LineWidth',2)
20
Ecuacin en diferencias
de Motor DC
y (k ) + a1 y (k 1) + a2 y (k 2) = b1u (k 1) + b2u (k 2)
load datamdc
tam=length(u);
datos_ident=[v(1:tam/2) u(1:tam/2)];
datos_vald=[v(tam/2+1:tam) u(tam/2+1:tam)];
% Identificacin Paramtrica Modelos ARX
(
_
,[ 2 1]);
]);
th=arx(datos_ident,[2
present(th)
% Discrete-time IDPOLY model: A(q)y(t) = B(q)u(t) + e(t)
% A(q) = 1 - 1.63
1 63 (+
(+-0
0.005044)
005044) q
q^-1
1 + 0.6681
0 6681 (+
(+-0
0.004624)
004624) q
q^-2
2
% B(q) = 0.3746 (+-0.004756) q^-1 + 0.3746 (+-0.004756) q^-2
% Estimated using ARX from data set datos_ident
% Loss function 0.000113658
0 000113658 and FPE 0.000118297
0 000118297
% Sampling interval: 1
% B(q) = 0.3746q^-1 + 0.3746q^-2
% A(q)
A( ) = 1 - 1.63q^-1
1 63 ^ 1 + 0.6681q^-2
0 6681 ^ 2
M.Sc. Ricardo Rodriguez B.
21
Modelo ARX
T=1;
G=tf([0.3746 0.3746],[1 -1.63 0.6681],T);
[nd,dd]=tfdata(G,'v');
tk 0:T:200;
tk=0:T:200;
yd=dstep(nd,dd,201);
stairs(tk,yd)
xlabel('#
xlabel(
# Muestras
Muestras'))
ylabel('yd')
22
Eleccin de la
Estructura Optima
hold
plot(datos_ident(:,1))
(
( 1))
legend('Ident','Data',4)
23
nn=struc([1:4],[1:4],[1:4]);
v=arxstruc(datos_ident,datos_valid,nn);
nn=selstruc(v)
% nn =
%
1 2 1
24
th=sett(th,0.01);
present(th)
% Discrete-time IDPOLY model: A(q)y(t) = B(q)u(t) + e(t)
% A(q) = 1 - 1.63 (+-0.005044) q^-1 + 0.6681 (+-0.004624) q^-2
% B(q) = 0.3746 (+-0.004756) q^-1 + 0.3746 (+-0.004756) q^-2
% Estimated using
sing ARX from data set datos_ident
datos ident
% Loss function 0.000113658 and FPE 0.000118297
% Sampling interval: 0.01
% B(q) = 0.3746q^-1 + 0.3746q^-2
% A(q) = 1 - 1.63q^-1 + 0.6681q^-2
B( z 1 ) 0.3746 z 1 + 0.3746 z 2
G( z) =
=
1
A( z ) 1 1.63z 1 + 0.6881z 2
25
26
K
= H (s) = 2
2
s + 2n s + n
2
n
27
Validando el Modelo
fi
figure
compare(datos_ident,th);
28
29
Preguntas?
robust@uni.edu.pe
rrodriguez@giscia.com
g
@g
30