-
Notifications
You must be signed in to change notification settings - Fork 0
/
motorinduccion.cpp
executable file
·163 lines (136 loc) · 4.41 KB
/
motorinduccion.cpp
1
2
3
4
5
6
7
8
9
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
#include "motorinduccion.h"
MotorInduccion::MotorInduccion()
{
// Se inicializarán los datos del motor tomando en cuenta al motor del problema 3 de clase:
// En unidades S.I.
resistenciaRotor = 0.38;
resistenciaEstator = 0.66;
reactanciaRotor = 1.71;
reactanciaEstator = 1.14;
reactanciaMotor = 33.2;
// PARÁMETROS DE PLACA
voltajeNominal = 460; // [V]
potenciaNominal = 11200; // [W]
velocidadNominal = 183.260; // [rad/s]
frecuenciaNominal = 50; // [1/s]
numeroPolos = 4;
// ENTRADAS ACTUALES
tensionFase = 0;
corriente = 0;
frecuencia = 50;
tipoConexion = 0;
// SALIDAS ACTUALES
velocidad = 0;
torque = 0;
// OTROS PARÁMETROS ELÉCTRICOS
deslizamiento = 0;
beta = 1;
relacionVF = voltajeNominal/frecuenciaNominal;
// OTROS PARÁMETROS
temperatura = 283;
}
void MotorInduccion::alimentar(double voltage, double frequency)
{
tensionFase = voltage;
frecuencia = frequency;
}
void MotorInduccion::actualizar(double sampleTime, int counter)
{
//
}
void MotorInduccion::actualizar(double sampleTime,int counter, double glide)
{
double numerador,denominador;
numerador = (1-exp(-0.5*sampleTime*counter))*tensionFase;
denominador = sqrt((resistenciaEstator+resistenciaRotor/glide)*(resistenciaEstator+resistenciaRotor/glide)+frecuencia*frecuencia*(reactanciaEstator+reactanciaRotor)*(reactanciaEstator+reactanciaRotor)/(frecuenciaNominal*frecuenciaNominal));
corriente = numerador/denominador;
}
double MotorInduccion::getSalida()
{
return corriente;
}
double MotorInduccion::respuestaTorqueDeslizamiento(double glide)
{
double numerador,denominador;
numerador = 3*resistenciaRotor*tensionFase*tensionFase;
denominador = glide*2*3.141592658*frecuenciaNominal*((resistenciaEstator+resistenciaRotor/glide)*(resistenciaEstator+resistenciaRotor/glide)+(reactanciaEstator+reactanciaRotor)*(reactanciaEstator+reactanciaRotor));
return numerador/denominador;
}
double MotorInduccion::respuestaTorqueDeslizamiento(double glide,double frequency)
{
frecuencia = frequency;
double numerador,denominador;
numerador = 3*resistenciaRotor*tensionFase*tensionFase;
denominador = glide*2*3.141592658*frequency*((resistenciaEstator+resistenciaRotor/glide)*(resistenciaEstator+resistenciaRotor/glide)+frequency/frecuenciaNominal*(reactanciaEstator+reactanciaRotor)*frequency/frecuenciaNominal*(reactanciaEstator+reactanciaRotor));
return numerador/denominador;
}
void MotorInduccion::setResistenciaEstator(double Rs)
{
resistenciaEstator = Rs;
}
double MotorInduccion::getResistenciaEstator()
{
return resistenciaEstator;
}
void MotorInduccion::setResistenciaRotor(double Rr)
{
resistenciaRotor = Rr;
}
double MotorInduccion::getResistenciaRotor()
{
return resistenciaRotor;
}
void MotorInduccion::setReactanciaEstator(double Xs)
{
reactanciaEstator = Xs;
}
double MotorInduccion::getReactanciaEstator()
{
return reactanciaEstator;
}
void MotorInduccion::setReactanciaRotor(double Xr)
{
reactanciaRotor = Xr;
}
double MotorInduccion::getReactanciaRotor()
{
return reactanciaRotor;
}
void MotorInduccion::setReactanciaMotor(double Xm)
{
reactanciaMotor = Xm;
}
double MotorInduccion::getReactanciaMotor()
{
return reactanciaMotor;
}
double MotorInduccion::getTorqueMaximo()
{
/*double numerador = 3*tensionFase*tensionFase;
double denominador = 2*2*3.141592658*frecuencia*(resistenciaEstator+sqrt(resistenciaEstator*resistenciaEstator+beta*beta*(reactanciaEstator+reactanciaRotor)*(reactanciaEstator+reactanciaRotor)));
return numerador/denominador;*/
return this->respuestaTorqueDeslizamiento(this->getDeslizamientoMaximo(),frecuencia);
}
double MotorInduccion::getDeslizamientoMaximo()
{
return resistenciaRotor/sqrt(resistenciaEstator*resistenciaEstator+beta*beta*(reactanciaEstator+reactanciaRotor)*(reactanciaEstator+reactanciaRotor));
}
double MotorInduccion::getVelocidadMaxima()
{
double desliz=getDeslizamientoMaximo();
//double par=getTorqueMaximo();
return 2*3.141592658*frecuencia*(1-desliz)/(numeroPolos/2);
}
double MotorInduccion::getFrecuenciaTrabajo()
{
return frecuencia;
}
double MotorInduccion::getFrecuenciaNominal()
{
return frecuenciaNominal;
}
double MotorInduccion::getBeta()
{
beta = frecuencia/frecuenciaNominal;
return beta;
}