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;
* Natarajan.
*/
ElectricalData::genr_t::genr_t():
Tspd1(10.0),
Tspd2(1.0),
M(5.0),
R(1.0/0.05),
Te(10.0),
......
......@@ -47,8 +47,6 @@ class ElectricalData
/// The constructor sets some a reasonable (maybe) parameter values and
/// initial condition
genr_t();
/// Speed governor time constants
double Tspd1, Tspd2;
/// Inertia constant
double M;
/// inverse of Droop
......
......@@ -4,7 +4,7 @@
CXX = g++
CFLAGS = -Wall -Ofast -std=c++11
LIBS =
INCLUDE = -I/usr/include/eigen3
INCLUDE =
.SUFFIXES: .cpp
.cpp.o:
......
......@@ -174,8 +174,6 @@ string createGenerator(string busName, ElectricalData::genr_t data, double cap)
string varName;
string Vref = number(data.Vref);
string Hstr = number(data.M*Freq);
string Tp1str = number(data.Tspd1);
string Tp2str = number(data.Tspd2);
string Rstr = number(data.R);
string w = omega(busName);
string Pm = mech_power(busName);
......@@ -204,7 +202,7 @@ string createGenerator(string busName, ElectricalData::genr_t data, double cap)
result += generatorSourceVoltage(busName,phase)+";\n";
string i = generatorCurrent(busName,phase);
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";
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)
result += "der("+generatorAngle(busName)+")="+number(Freq)+"*("+w+"-1.0);\n";
result += string("der(")+w+string(")=(")+Pm+
string("-"+Pe+")/")+Hstr+string(";\n");
result += string("der(")+Pm+string(")="+Tp2str+"*("+
Rstr+"*(1.0-"+w+")+"+Pe+"-"+Pm+");\n");
result += string("der(")+Pm+string(")="+
Rstr+"*(1.0-"+w+"+"+Pe+"-"+Pm+");\n");
// Useful to make the generators sit still when we are testing the network model
/* result += "der("+generatorAngle(busName)+")=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