Commit ad44f4a0 authored by James Nutaro (1qn)'s avatar James Nutaro (1qn)
Browse files

Improved speed control by using a PD method with frequency deviation as input.

parent a4f40480
...@@ -11,8 +11,6 @@ using namespace std; ...@@ -11,8 +11,6 @@ using namespace std;
* Natarajan. * Natarajan.
*/ */
ElectricalData::genr_t::genr_t(): ElectricalData::genr_t::genr_t():
Tspd1(10.0),
Tspd2(1.0),
M(5.0), M(5.0),
R(1.0/0.05), R(1.0/0.05),
Te(10.0), Te(10.0),
......
...@@ -47,8 +47,6 @@ class ElectricalData ...@@ -47,8 +47,6 @@ class ElectricalData
/// The constructor sets some a reasonable (maybe) parameter values and /// The constructor sets some a reasonable (maybe) parameter values and
/// initial condition /// initial condition
genr_t(); genr_t();
/// Speed governor time constants
double Tspd1, Tspd2;
/// Inertia constant /// Inertia constant
double M; double M;
/// inverse of Droop /// inverse of Droop
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
CXX = g++ CXX = g++
CFLAGS = -Wall -Ofast -std=c++11 CFLAGS = -Wall -Ofast -std=c++11
LIBS = LIBS =
INCLUDE = -I/usr/include/eigen3 INCLUDE =
.SUFFIXES: .cpp .SUFFIXES: .cpp
.cpp.o: .cpp.o:
......
...@@ -174,8 +174,6 @@ string createGenerator(string busName, ElectricalData::genr_t data, double cap) ...@@ -174,8 +174,6 @@ string createGenerator(string busName, ElectricalData::genr_t data, double cap)
string varName; string varName;
string Vref = number(data.Vref); string Vref = number(data.Vref);
string Hstr = number(data.M*Freq); string Hstr = number(data.M*Freq);
string Tp1str = number(data.Tspd1);
string Tp2str = number(data.Tspd2);
string Rstr = number(data.R); string Rstr = number(data.R);
string w = omega(busName); string w = omega(busName);
string Pm = mech_power(busName); string Pm = mech_power(busName);
...@@ -204,7 +202,7 @@ string createGenerator(string busName, ElectricalData::genr_t data, double cap) ...@@ -204,7 +202,7 @@ string createGenerator(string busName, ElectricalData::genr_t data, double cap)
result += generatorSourceVoltage(busName,phase)+";\n"; result += generatorSourceVoltage(busName,phase)+";\n";
string i = generatorCurrent(busName,phase); string i = generatorCurrent(busName,phase);
stateVars.insert(state_var_init_t(i,0.0)); stateVars.insert(state_var_init_t(i,0.0));
result += "der("+i+")=("+generatorVoltage(busName,phase)+"-"+voltage(busName,phase)+"-"+number(resistance)+"*"+i+")/"+number(inductance)+"\n;"; result += "der("+i+")=("+generatorVoltage(busName,phase)+"-"+voltage(busName,phase)+"-"+number(resistance)+"*"+i+")/"+number(inductance)+";\n";
} }
result += Pe+"="+powerDraw+";\n"; result += Pe+"="+powerDraw+";\n";
stateVars.insert(state_var_init_t(generatorAngle(busName),data.T0*pi/180.0)); stateVars.insert(state_var_init_t(generatorAngle(busName),data.T0*pi/180.0));
...@@ -214,8 +212,8 @@ string createGenerator(string busName, ElectricalData::genr_t data, double cap) ...@@ -214,8 +212,8 @@ string createGenerator(string busName, ElectricalData::genr_t data, double cap)
result += "der("+generatorAngle(busName)+")="+number(Freq)+"*("+w+"-1.0);\n"; result += "der("+generatorAngle(busName)+")="+number(Freq)+"*("+w+"-1.0);\n";
result += string("der(")+w+string(")=(")+Pm+ result += string("der(")+w+string(")=(")+Pm+
string("-"+Pe+")/")+Hstr+string(";\n"); string("-"+Pe+")/")+Hstr+string(";\n");
result += string("der(")+Pm+string(")="+Tp2str+"*("+ result += string("der(")+Pm+string(")="+
Rstr+"*(1.0-"+w+")+"+Pe+"-"+Pm+");\n"); Rstr+"*(1.0-"+w+"+"+Pe+"-"+Pm+");\n");
// Useful to make the generators sit still when we are testing the network model // Useful to make the generators sit still when we are testing the network model
/* result += "der("+generatorAngle(busName)+")=0.0;\n"; /* result += "der("+generatorAngle(busName)+")=0.0;\n";
result += string("der(")+w+string(")=0.0;\n"); result += string("der(")+w+string(")=0.0;\n");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment