Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Nutaro, James J
agm
Commits
ad44f4a0
Commit
ad44f4a0
authored
Oct 01, 2020
by
James Nutaro (1qn)
Browse files
Improved speed control by using a PD method with frequency deviation as input.
parent
a4f40480
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/ElectricalData.cpp
View file @
ad44f4a0
...
...
@@ -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
),
...
...
src/ElectricalData.h
View file @
ad44f4a0
...
...
@@ -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
...
...
src/Makefile
View file @
ad44f4a0
...
...
@@ -4,7 +4,7 @@
CXX
=
g++
CFLAGS
=
-Wall
-Ofast
-std
=
c++11
LIBS
=
INCLUDE
=
-I
/usr/include/eigen3
INCLUDE
=
.SUFFIXES
:
.cpp
.cpp.o
:
...
...
src/main.cpp
View file @
ad44f4a0
...
...
@@ -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");
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment