Documentos de Académico
Documentos de Profesional
Documentos de Cultura
C02 ProgramaCM
C02 ProgramaCM
1uF
+
R1
1k
V1
0/5V
L1 PROGRAMACION
PLATAFORMA DE
C2
1H
+
R2
100
1uF
100 Hz
R3
100
L2
1H
C6
1uF
Vi(t)
R6
1k
Vc(t)
C8
1uF
+
Funcin de Transferencia:
R8
1k
C7
1uF
R10
100
L3
1H
G (s)
1
RC
s
s2
C5
1uF
1
1
s
RC
LC
Diagrama de Bloques:
SIMULACION DE CIRCUITO SERIE-PARALELO
Step
E_Sistema
Escalon
T ransfer Fcn
01
02
03
04
05
06
07
08
09
S_Sistema
Transfer Fcn2
%***********************************************************************
% Programa
: analisis_rlc_sp.m
% Descripcin : Analiza el Sistema Lineal
%
Vc(s)
1
s
%
G(s)= --------- = ------ --------------------------%
Vi(s)
RC s^2 + s/RC + 1/LC
Stepp
ES_Sistema
%
Transfer Fcn1
% Autor: FreedySotelo V.
%***********************************************************************
Seno Wave
_______________________________________________________________________
DR.ING. FREEDY SOTELO V.
PAG.17
PID C
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
_______________________________________________________________________
DR.ING. FREEDY SOTELO V.
PAG.18
>>analisis_rlc_sp
Parametros del Sistema...
R= 1
L= 1
C= 1
Funcion de Transferencia del Sistema...
num =
0 1 0
den =
1 1 1
num/den =
s
--------------s^2 + s + 1
Raices del Sistema...
ans =
-0.5000 + 0.8660i
-0.5000 - 0.8660i
Presione tecla para continuar...
Presione tecla para continuar...
Presione tecla para continuar...
Presione tecla para continuar...
Presione tecla para continuar...
Espacio de Estado del Sistema...
A=
-1 -1
1 0
B=
1
0
_______________________________________________________________________
DR.ING. FREEDY SOTELO V.
PAG.19
C=
1
D=
0
0.6
0.5
Amplitude
0.4
0.3
0.2
0.1
-0.1
10
12
Time (sec)
Entrada 10*Step
Amplitude
-1
10
12
Time (sec)
_______________________________________________________________________
DR.ING. FREEDY SOTELO V.
PAG.20
1.2
1
0.8
0.6
0.4
0.2
0
-0.2
10
Root Locus
1
0.8
0.6
Imaginary Axis
0.4
0.2
0
-0.2
-0.4
-0.6
-0.8
-1
-1.4
-1.2
-1
-0.8
-0.6
-0.4
-0.2
Real Axis
Bode Diagram
Magnitude (dB)
-10
-20
-30
-40
-50
Phase (deg)
-60
90
45
0
-45
-90
-2
10
-1
10
10
10
10
Frequency (rad/sec)
Respuesta en Frecuencia.
_______________________________________________________________________
DR.ING. FREEDY SOTELO V.
PAG.21
G (s)
1
RC
s
s2
1
1
s
RC
LC
a1
x1 0
u
x 2 b1
x 1 0
x. a 2
2
x
y 0 1 1 0 u
x2
a1
1
RC
a2
1
LC
b1
1
RC
%***********************************************************************
% Programa
: ed2rlc_sp.m
% Descripcion : Analiza el Sistema Lineal
%
Vc(s) 1
s
%
G(s)= -------- = ----- -------------------------%
Vi(s) RC s^2 + s/RC + 1/LC
%
%
Para: a1=1/RC a2=1/LC b1=1/RC
%
%
Modelo de Espacio de Estado
%
Ecuaciones Diferenciales Lineales
%
x1'(t,x1,x2,u) = x2(t)
%
x2'(t,x1,x2,u) = -a2x1(t) - a1x2(t) +b1u(t)
%
Vc(t) = x2(t)
%
%
u(0) = 1 x1(0) = 0 x2(0) = 0
%
%
Por Metodo de Euler
%
%
x1(i+1)=x1(i)+h*x1'(i); % Solucion Euler
%
x2(i+1)=x2(i)+h*x2'(i); % Solucion Euler
%
% Autor
: FreedySotelo V.
%***********************************************************************
_______________________________________________________________________
DR.ING. FREEDY SOTELO V.
PAG.22
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
_______________________________________________________________________
DR.ING. FREEDY SOTELO V.
PAG.23
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
>> ed2rlc_sp
Parametros del Sistema...
R= 1
L= 1
C= 1
Tiempo de Evaluacion [Escalon] : 12
Periodo de Muestreo [h=0.1]
: .1
Frecuencia de Evaluacion [f_seno]: 1
Periodos de Evaluacion [Ts_seno] : 3
Periodo de Muestreo [h=0.01] : .01
Funcion de Transferencia del Sistema...
num =
0 1 0
den =
1 1 1
num/den =
s
-----------s^2 + s + 1
t
u
x1
x2
ans =
0 1.0000
0
0
0.1000 1.0000
0 0.1000
0.2000 1.0000 0.0100 0.1900
0.3000 1.0000 0.0290 0.2700
0.4000 1.0000 0.0560 0.3401
_______________________________________________________________________
DR.ING. FREEDY SOTELO V.
PAG.24
Step Response
0.6
0.5
Amplitude
0.4
0.3
0.2
0.1
-0.1
10
12
Time (sec)
u(t),x1(t),x2(t)
0.8
t vs u [Vi(t)]
t vs x1 [I(x2)]
t vs x2 [Vc(t)]
0.6
0.4
0.2
0
0
6
t
10
_______________________________________________________________________
DR.ING. FREEDY SOTELO V.
PAG.25
t vs u [Vi(t)]
t vs x1 [I(x2)]
t vs x2 [Vc(t)]
0.8
0.6
u(t),x1(t),x2(t)
0.4
0.2
0
-0.2
-0.4
-0.6
C1
1uF
+
R1
1k
-0.8
V1
0/5V
-1
R2
100
0.5
1.5
t
2.5
L1 Mediante Mtodo
Respuesta al Seno
C2 de Euler.
1H
1uF
100 Hz
R3
100
L2
1H
+
C6
1uF
Vi(t)
R6
1k
Vc(t)
C7
1uF
R10
100
L3
1H
C8
1uF
+
C5
1uF
PAG.26
G (s)
1
RC
s
s2
1
1
s
RC
LC
Kd s2 K p s Ki
Ki
K (s) K p
Kd s
s
s
Funcin de Transferencia de la Realimentacin:
H (s) 1
Hallando la Funcin de Transferencia del Sistema de Control:
1
K ( s )G ( s )
RC
C ( s)
1
R ( s ) RC
Kd s3 K p s2 Ki s
1 2
1
s3
s
s
RC
LC
Kd s3 K p s 2 Ki s
1 2
1
( K d 1) s 3 ( K p
)s (K i
)s
RC
LC
Para:
a1 K d 1
b1
1
Kd
RC
a2 K p
b2
1
RC
1
Kp
RC
a3 K i
b3
1
LC
1
Ki
RC
Modelo en el Tiempo:
Para:
_______________________________________________________________________
DR.ING. FREEDY SOTELO V.
PAG.27
a1 K d 1
c1
a3
a1
c2
b1 a3
a1
a2 K p
b3
a1
c3
1
RC
a2
a1
a3 K i
c4
a 2 b1
a1
1
LC
b2
a1
c5
x1 c1 x2 c2u
.
x 2 x1 c3 x2 c4 u
y x 2 c5 u
Forma Matricial:
x 1 0 c1 x1 c 2 u
x. 1 c3 x 2 c 4
2
.
x
y 0 1 1 c5 u
x2
Programa de Anlisis del Sistema:
01
02
03
04
05
06
07
08
09
10
11
12
13
14
%************************************************************************
% Programa
: ed2rlc_sp_pid.m
% Descripcion : Analiza el Sistema Lineal Controlado
%
%
PlantaBajo Control
%
Vc(s) 1
s
%
G(s)= ------- = ---- -------------------------%
Vi(s) RC s^2 + s/RC + 1/LC
%
%
Controlador
%
Ki
%
K(s)= Kp + ---- + Kd s [20,50,1]
%
s
%
_______________________________________________________________________
DR.ING. FREEDY SOTELO V.
PAG.28
b1
a1
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
%
Kd s^2 + Kp s + Ki
%
K(s)= ----------------------------%
s
%
%
Sistema de Control
%
C(s) 1
Kd s^3 + Kp s^2 + Ki s
%
------ = ---- --------------------------------------------------------%
R(s) RC (Kd+1)s^3 + (Kp+1/RC)s^2 + (Ki+1/LC)s
%
%
Para: a1=(Kd+1) a2=(Kp+1/RC) a3=(Ki+1/LC)
%
1
1
1
%
b1=----- Kd b2=----- Kp
b3=----- Ki
%
RC
RC
RC
%
%
Luego: a3
b1 a3
b3
%
c1=----- c2=----------- - ---%
a1
a1^2
a1
%
%
a2
a2 b1
b2
b1
%
c3=------ c4=----------- - ---- c5=----%
a1
a1^2
a1
a1
%
%
Modelo de Espacio de Estado
%
Ecuaciones Diferenciales Lineales
%
x1'(t,x1,x2,u) = c1 x2(t) + c2 u(t)
%
x2'(t,x1,x2,u) = -x1(t) - c3 x2(t) - c4 u(t)
%
Vc(t) = x2(t) + c5 u(t)
%
%
u(0) = 1 x1(0) = 0 x2(0) = 0
%
%
Por Metodo de Euler
%
%
x1(i+1)=x1(i)+h*x1'(i); % Solucion Euler
%
x2(i+1)=x2(i)+h*x2'(i); % Solucion Euler
%
% Autor
: FreedySotelo V.
%***********************************************************************
clear all; clc
fprintf('Parametros del Sistema...\n');
R=input('R= ');
L=input('L= ');
C=input('C= ');
57
58
59
60
_______________________________________________________________________
DR.ING. FREEDY SOTELO V.
PAG.29
_______________________________________________________________________
DR.ING. FREEDY SOTELO V.
PAG.30
111
112
113
114
115
116
117
xlabel('t'), ylabel('u(t),Vc(t),Err(t)')
mx=0;
Mx=max(t);
my=min([min(u) min(Vc) min(Error)]);
My=max([max(u) max(Vc) max(Error)]);
axis([mx Mx my My])
%**********************************************************************
>>ed2rlc_sp_pid
Parametros del Sistema...
R= 1
L= 1
C= 1
Parametros del Controlador...
Kp[20]= 20
Ki[50]= 50
Kd[ 1]= 1
Periodo de Muestreo [h=0.1] : .1
Tiempo de Evaluacion [Escalon]: 12
Funcin de Transferencia del Sistema...
num/den =
s
--------------s^2 + s + 1
Funcin de Transferencia del Controlador...
num/den =
s^2 + 20 s + 50
-------------------s
F.T. del Sistema de Control...
num/den =
s^3 + 20 s^2 + 50 s
----------------------------2 s^3 + 21 s^2 + 51 s
>>
_______________________________________________________________________
DR.ING. FREEDY SOTELO V.
PAG.31
1.2
Vc(t)CC&SC
0.8
0.6
Vc S/C
Vc C/C
0.4
0.2
-0.2
10
12
t (sec)
u(t),Vc(t),Err(t)
0.4
0.2
0
-0.2
-0.4
-0.6
-0.8
-1
6
t
10
_______________________________________________________________________
DR.ING. FREEDY SOTELO V.
PAG.32
_______________________________________________________________________
DR.ING. FREEDY SOTELO V.
PAG.33
_______________________________________________________________________
DR.ING. FREEDY SOTELO V.
PAG.34
_______________________________________________________________________
DR.ING. FREEDY SOTELO V.
PAG.35
V1
0/5V
R2
100
1000 Hz
L1
1H
100 Hz
V3
0/5V
R1
1k
C2
1uF
A: v1_1
B: c2_1
5.000 V
4.000 V
3.000 V
2.000 V
1.000 V
0.000 V
-1.000 V
-2.000 V
-3.000 V
0.000ms
5.000ms
10.00ms
15.00ms
20.00ms
25.00ms
30.00ms
35.00ms
40.00ms
45.00ms
50.00ms
D
Diagrama
de un Circuito Derivador:
R
1k
C1
1uF
+
R1
1k
V3
0/5V
V2
0/5V
V1
0/5V
R2
100
C
1uF
1000 Hz
1000 Hz
L
1
100 Hz
A: v3_1
B: c1_2
5.000 V
3.000 V
1.000 V
-1.000 V
-3.000 V
-5.000 V
0.000ms
1.000ms
2.000ms
3.000ms
4.000ms
5.000ms
6.000ms
7.000ms
8.000ms
9.000ms
10.00ms
_______________________________________________________________________
DR.ING. FREEDY SOTELO V.
PAG.36
C1
1uF
+
B
V3
0/5V
V2
0/5V
+
R2
100
C
1uF
1000 Hz
1000 Hz
A: v2_1
B: d_a
5.000 V
4.000 V
3.000 V
2.000 V
C1
1uF
+
R
1k
1.000 V
V3
0/5V
V2
0/5V
1.000ms
2.000ms
3.000ms
4.000ms
0.000 V
0.000ms
C
1uF
V1
0/5V
5.000ms
6.000ms
8.000ms
R2
7.000ms
100
1000 Hz
100 Hz
C3
1uF
+
V5
0/5V
+
R3
100
C4
1uF
1000 Hz
A: v5_1
B: c3_1
5.000 V
4.000 V
3.000 V
2.000 V
1.000 V
0.000 V
0.000ms
1.000ms
2.000ms
3.000ms
4.000ms
5.000ms
6.000ms
7.000ms
8.000ms
_______________________________________________________________________
DR.ING. FREEDY SOTELO V.
PAG.37
C1
1uF
+
R
1k
V3
0/5V
V2
0/5V
V1
0/5V
CONTROL MODERNO
R2 Y OPTIMO
C
1uF
1000 Hz
R1
1k
L1
1H
100
1000 Hz
100 Hz
C3
1uF
+
R6
1k
D
+
V5
0/5V
C4
1uF
1000 Hz
R
1k
R3
100
L2
1H
+
A: v5_1
B: c3_1
5.000 V
C6 C1
1uF 1uF
V3
0/5V
V2
0/5V
D2
R4
1k
R2
100
1000 Hz
1000 Hz
R5
1k
4.000 V
V4
0/5V
D1
C5
1uF
3.000 V
1000 Hz
C3
1uF
+
R4
1k
2.000 V
R3
100
+
1.000ms
2.000ms
1000 Hz
3.000ms
C4
1uF
4.000ms
5.000ms
6.000ms
7.000ms
8.000ms
R5
1k
V4
0/5V
R7
1k
1000 Hz
Circuito Proporcional.
A: v4_1
B: r5_2
5.000 V
4.000 V
3.000 V
2.000 V
1.000 V
0.000 V
0.000ms
1.000ms
2.000ms
3.000ms
4.000ms
5.000ms
6.000ms
7.000ms
_______________________________________________________________________
DR.ING. FREEDY SOTELO V.
PAG.38
8.000ms
L2
1H
V5
0/5V
1.000 V
0.000 V
0.000ms
R6
1k
D1
C3
1uF
+
R4
1k
R6
1k
UNIVERSIDAD
NACIONAL DE INGENIERA
V5
R3
100
C4
1uF
1000 Hz
0/5V
L2
1H
C6
1uF
R5
1k
C8
1uF
+
R9
1k
R8
1k
1000 Hz
R10
100
R7
1k
C7
1uF
V4
0/5V
L3
1H
A: v4_1
B: r5_2
5.000 V
4.000 V
3.000 V
2.000 V
1.000 V
R3
1
R2
1
Vi
10V
+
-
1.000ms
L1
1H
2.000ms
3.000ms
0.000 V
0.000ms
4.000ms
5.000ms
6.000ms
7.000ms
8.000ms
C1
1F
R6
1
1k
L3
1H
R4
1
C3
1F
IDEAL
2V
-
_______________________________________________________________________
DR.ING. FREEDY SOTELO V.
PAG.39
C5
1uF
Circuito Proporcional.
Circuito Integrador.
Circuito Derivador.
Circuito Sumador.
_______________________________________________________________________
DR.ING. FREEDY SOTELO V.
PAG.40
Circuito Inversor.
_______________________________________________________________________
DR.ING. FREEDY SOTELO V.
PAG.41