Laboratorio 1 Control
Laboratorio 1 Control
Como primera actividad de familiarización con el programa se realizo una lectura donde se recomienda
el uso de algunas funciones del Tool box y la creación de variables y vectores.
numero = 2
numero = 2
vector = [ 1 2 3]
vector =
1 2 3
Comprobación del valor del vector
vector = [4 5 6]
vector =
4 5 6
Mediante el uso de la función help para cd se puede obtener una explicación detallada de como llamar la
función en el programa y su correspondiente acción luego de escribirla en el programa, así mismo para
las funciones : dir, roots, poly, conv y control.
help cd
help dir
See also what, cd, type, delete, ls, rmdir, mkdir, datenum.
help roots
help poly
Examples:
help conv
vector = [6 7 8]
vector =
6 7 8
help control
Table of Contents
-----------------
Modeling - Create and combine models of linear systems
Analysis - Analyze systems in the time or frequency domain
Design - Design and tune control systems
Plotting - Create and customize response plots
General - Preferences, linear algebra utilities
Apps - Control System Toolbox apps
Examples - Control System Toolbox examples
num = [1 0]
num =
1 0
den = [1 2 10]
den =
1 2 10
H=tf(num,den)
H =
s
--------------
s^2 + 2 s + 10
3
Continuous-time transfer function.
z=[ ]
z =
[]
p = [ 2 1+i 1-i]
p =
2.0000 + 0.0000i 1.0000 + 1.0000i 1.0000 - 1.0000i
k=[ -2 ]
k = -2
G=zpk(z,p,k)
G =
-2
--------------------
(s-2) (s^2 - 2s + 2)
help tfdata
4
See also tf, zpkdata, ssdata, idtf.
help zpkdata
[Z,P,K] = zpkdata(SYS) returns the zeros, poles, and gain for each
I/O channel of the dynamic system SYS. The cell arrays Z,P and the
matrix K have as many rows as outputs and as many columns as inputs,
and their (I,J) entries specify the zeros, poles, and gain of the
transfer function from input J to output I. SYS is first converted
to zero-pole-gain format if necessary.
[n1,d1]=tfdata(H,'v')
n1 =
0 1 0
d1 =
1 2 10
z1 = 0
p1 =
-1.0000 + 3.0000i
-1.0000 - 3.0000i
k1 = 1
[n2, d2]=tfdata(G,'v')
n2 =
0 0 0 -2
d2 =
1 -4 6 -4
[z2,p2,k2]=zpkdata(G,'v')
z2 =
5
2.0000 + 0.0000i
1.0000 + 1.0000i
1.0000 - 1.0000i
k2 = -2
tf(G)
ans =
-2
---------------------
s^3 - 4 s^2 + 6 s - 4
CONEXIÓN DE MODELOS
help series
+ ------+
v2 --- >| |
+ ------+ | M2 |-----> y2
| |------- >| |
u1 ----- >| |y1 u2 + ------+
| M1 |
| |--- > z1
+ ------+
help parallel
Parallel Algorithms
6
gather - retrieve data from the labs to the client
classUnderlying - return the class of the elements
isaUnderlying - return true if elements are of a given class
7
labSendReceive - Simultaneously send to and receive from other
labs
labBroadcast - Send data to all labs
labBarrier - Block until all labs have entered the barrier
labProbe - Test to see if messages are ready to labReceive
mpiLibConf - Location of MPI implementation
mpiSettings - Set various options for MPI communication
+------ +
v1 ---------- >| |---------- > z1
| M1 |
u1 +-- >| |---+ y1
| +------ + |
u ------>+ O------ > y
| +------ + |
u2 +-- >| |---+ y2
| M2 |
v2 ---------- >| |---------- > z2
+------ +
help feedback
8
positive feedback, use the syntax M = feedback(M1,M2,+1).
+------ +
v --------- >| |-------- > z
| M1 |
u --->O---- >| |---- +--- > y
| +------ + |
| |
+----- [ M2 ]<--- +
The vector FEEDIN contains indices into the input vector of M1 and
specifies which inputs u are involved in the feedback loop. Similarly,
FEEDOUT specifies which outputs y of M1 are used for feedback. If
SIGN=1 then positive feedback is used. If SIGN=-1 or SIGN is omitted,
then negative feedback is used. In all cases, the resulting model M has
the same inputs and outputs as M1 (with their order preserved).
parallel (H,G)
ans =
tf(parallel(H,G))
ans =
Diagrama M1
feedback(H,series(H,G))
ans =
9
s (s-2) (s^2 - 2s + 2) (s^2 + 2s + 10)
---------------------------------------------------------------------------
(s-2.012) (s^2 - 1.983s + 1.98) (s^2 + 2.2s + 10.17) (s^2 + 1.795s + 9.873)
tf(feedback(H,series(H,G)))
ans =
DIAGRAMA M1 DIAGRAMA M2
Diagrama M2
series(H,parallel(H,G))
ans =
tf(series(H,parallel(H,G)))
ans =
A =
10 s + 30
--------------
s^2 + 2 s + 10
B =
2
-----
s + 2
10
Continuous-time transfer function.
step(A)
La respuesta al Escalón unitario se puede visualizar en la siguiente imagen donde se puede
evidenciar la amplitud de la señal junto con el tiempo de subida de dicha señal y finalmente su valor
en estado estacionario
impulse(A)
De igual manera se puede obtener el tiempo de restablecimiento junto con la respuesta de pico de la
señal de impulso unitario A
11
pzmap(A)
12
step(B)
Para el modelo B al escalón de impulso unitario se pueden visualizar algunas características como
las del valor pico el tiempo de subida de la señal y su valor en estado estacionario.
impulse(B)
13
pzmap(B)
la ubicación de los polos en 0
14
EJEMPLO DE ANALISIS FISICO
rlc_gui
CASO DE ESTUDIO
En el caso de estudio se pretende relacionar las herramientas del programa con el proyecto de clase
del grupo de esta manera se aplica la teoría desarrollada en clase con un caso de estudio real.
100
-------
s + 100
%Motor y carga
numMC=Km; denMC=[1 am 0]; Motor=tf(numMC,denMC)
Motor =
2.083
------------
s^2 + 1.71 s
S1=series(Kpot,feedback(series(series(series(K,AmpPot),Motor),Kg),Kpot))
S1 =
66.24
-------------------------------
s^3 + 101.7 s^2 + 171 s + 66.24
T1=tf(S1)
T1 =
66.24
-------------------------------
s^3 + 101.7 s^2 + 171 s + 66.24
step(T1)
Luego de simular la anterior ecuación se puede apreciar la respuesta a la señal de entrada.