M.Sc. Ricar Ricardo do Rodrí Rodríguez guez Bustin Bustinza. za. 2009 M.Sc. Ricardo Rodriguez B.
1
Motivación
Usar un Código de Programa Obtener la DATA usando la NIDAQ Aplicar la Teoría de Control Digital Construir los Circuitos M.Sc. Ricardo Rodriguez B.
2
Motor DC
M.Sc. Ricardo Rodriguez B.
3
Modelo T L (t ) T (t ) R
ω (t ) L
+
V (t ) −
i (t )
V b (t )
B
+
J
T L (t )
−
T (t )
ω (t )
M.Sc. Ricardo Rodriguez B.
4
sistema electromecánico.
.
las bases para construir el siguiente diagrama de bloques. T L ( s )
1
V ( s )
Ls + R
+
s
s K t
1 +
Js + B
− b
s K b
La forma estándar de un sistema de segundo orden es dado por:
estacionario K m, la frecuencia natural ωn y el factor de amortiguamiento ζ en términos
SIMULINK ara el Modelo Motor DC para el Control e os c n
Controlador Di ital
=
450( z − 0.85)( z − 0.85) ( z + 0.98)( z − 0.7)
T = 0.001s
Modelo Motor DC con SIMULINK
Modelo Motor DC con Toolkits de LabVIEW
Discretizando el Discretizando Modelo Motor DC con oo s e a
Identificando Parámetr Parámetros os de un Motor DC
figure muestr muestra a _ident= ident=idd iddata ata dat datos os_ ident ident plot(muestra_ident,'r','LineWidth',2)
Ecuación en difer diferencias encias de Motor DC y (k ) + a1 y (k − 1) + a2 y (k − 2) = b1u (k − 1) + b2u (k − 2) oa a am c 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)]; datos_vald=[v(tam/2+1:tam % Identificación Identificación Paramét Paramétrica rica Modelos Modelos ARX th=a th =arx rx datos_ datos_id iden ent, t, 2 2 1 ; present(th) % Discrete-time Discrete-time IDPOLY IDPOLY model: A(q)y(t) A(q)y(t) = B(q)u(t) B(q)u(t) + e(t) = - . - . ^. - . ^% B(q) = 0.3746 (+-0.004756) q^-1 + 0.3746 (+-0.004756) q^-2 % Estima Estimated ted using using ARX from data set datos_id datos_ident ent
T=1; G=tf([0.3746 0.3746],[1 -1.63 0.6681],T); [nd,dd]=tfdata(G,'v'); = yd=dstep(nd,dd,201); stairs(tk,yd) ' ' ylabel('yd')
y ( k ) − 1.63 y ( k − 1) + 0.6681 y ( k − 2) = 0.3746u (k − 1) + 0.3746u
Estructura Optima hold plot datos_ident :,1 legend('Ident','Data',4)
nn=struc([1:4],[1:4],[1:4]); v=arxstruc(datos_ident,datos_valid,nn); nn=selstruc(v) % nn = % 1 2 1
th=sett(th,0.01); present(th) % A(q) A(q) = 1 - 1.6 1.63 3 (+-0.0 (+-0.0050 05044) 44) q^-1 q^-1 + 0.6 0.6681 681 (+-0.00 (+-0.00462 4624) 4) q^-2 % B(q) = 0.3746 (+-0.004756) q^-1 + 0.3746 (+-0.004756) q^-2 u _ % Loss function 0.000113658 and FPE 0.000118297 % Sampling interval: 0.01 % B(q) = 0.3746q^-1 + 0.3746q^-2 % A(q) A(q) = 1 - 1.63q^1.63q^-1 1 + 0.6681q^ 0.6681q^-2 -2
1
−
G ( z ) =
1
−
A( z )
=
. 1 1 63 z
1
−
1
−
. +
0 6881 z
2
−
−
2
D=tf([0.3746 0.3746 0],[1 -1.63 0.6681],0.01); C=d2c(D); % Transfer function: % 0.3746 s^2 + 87.74 s + 9139 % --------------------------^ . . thc=thd2thc(th); , = printsys(numc,denc,'s') % num/den = % -3.0809 s + 9140.7463 % ---------------------------------------
=
H (s) =
2 n
s
2
+
2 n
2ζω n s + ω
gure compare(datos_ident,th);
M.Sc. Ricardo Rodriguez B.
28
figure resid(datos_valid,th);
M.Sc. Ricardo Rodriguez B.
29
[email protected] rrodri uez@ iscia.com
M.Sc. Ricardo Rodriguez B.
30