Skip to content

Commit 42e306b

Browse files
committed
Updates to the IEEE Microgrid Example
1 parent 02167a2 commit 42e306b

16 files changed

Lines changed: 843 additions & 84 deletions

File tree

OpenIPSL/Data/PowerPlant/GenerationGroup/Generator1.mo

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,7 @@ equation
130130
fillPattern=FillPattern.Solid,
131131
textString="%name"),
132132
Line(points={{-60,-20},{-20,20},{20,-20},{60,20}},
133-
color={28,108,200}),Ellipse(extent={{-100,-100},{100,100}}, lineColor
134-
=
133+
color={28,108,200}),Ellipse(extent={{-100,-100},{100,100}}, lineColor=
135134
{28,108,200})}),
136135
Documentation(info="<html>
137136
<p>Generation group for the example that uses the IEEE421.5-based data set.</p>

OpenIPSL/Data/PowerPlant/GenerationGroup/Generator2.mo

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,7 @@ equation
127127
fillPattern=FillPattern.Solid,
128128
textString="%name"),
129129
Line(points={{-60,-20},{-20,20},{20,-20},{60,20}},
130-
color={28,108,200}),Ellipse(extent={{-100,-100},{100,100}}, lineColor
131-
=
130+
color={28,108,200}),Ellipse(extent={{-100,-100},{100,100}}, lineColor=
132131
{28,108,200})}),
133132
Documentation(info="<html>
134133
<p>Generation Group for the example that uses the Anderson-based data set.</p>

OpenIPSL/Electrical/Controls/VariableSpeedDrive/ControllerLogic/VoltsHertzController.mo

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ model VoltsHertzController "Volts/Hertz controller model"
2424
rotation=180,
2525
origin={120,40})));
2626
OpenIPSL.NonElectrical.Continuous.SimpleLag Speed_Sensor(K=1, T=Tr,
27-
y_start=Modelica.Constants.eps)
27+
y_start=1.9*Modelica.Constants.pi*SysData.fn)
2828
annotation (Placement(transformation(extent={{-38,-22},{-18,-2}})));
2929
parameter OpenIPSL.Types.Time Tr=0.01 "Time constant for speed sensor filter"
3030
annotation (Dialog(group="Control Parameters"));
@@ -36,7 +36,7 @@ model VoltsHertzController "Volts/Hertz controller model"
3636
annotation (Placement(transformation(extent={{-48,-60},{-28,-40}})));
3737
Modelica.Blocks.Continuous.Integrator integrator(k=Ki,
3838
initType=Modelica.Blocks.Types.Init.InitialState,
39-
y_start=m0*(2*Modelica.Constants.pi*SysData.fn))
39+
y_start=0)
4040
annotation (Placement(transformation(extent={{-48,-92},{-28,-72}})));
4141
Modelica.Blocks.Math.Add add1(k1=+1)
4242
annotation (Placement(transformation(extent={{-14,-76},{6,-56}})));

OpenIPSL/Electrical/Controls/VariableSpeedDrive/PowerElectronics/AC2DCandDC2AC.mo

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ model AC2DCandDC2AC "Phasor based voltage source converter model."
2727
{-64,-4}})));
2828
Modelica.Electrical.Analog.Basic.Resistor Resistor(R=Rdc) "DC link resistor"
2929
annotation (Placement(transformation(extent={{-42,-10},{-22,10}})));
30-
Modelica.Electrical.Analog.Basic.Inductor Inductor(i(start=Il0, fixed=true),
30+
Modelica.Electrical.Analog.Basic.Inductor Inductor(i(start=Il0, fixed=false),
3131
L=Ldc) "DC link inductor"
3232
annotation (Placement(transformation(extent={{-16,-10},{4,10}})));
3333
Modelica.Electrical.Analog.Ideal.IdealOpeningSwitch switch(Ron=1e-5, Goff=1e-5) "Switch enforcing no inverse current flow in DC link"
@@ -58,6 +58,7 @@ model AC2DCandDC2AC "Phasor based voltage source converter model."
5858
Modelica.Blocks.Sources.RealExpression Qmotor(y=n.vr*n.ii - n.vi*n.ir) "Reactive power for drawn motor current"
5959
annotation (Placement(transformation(extent={{24,54},{44,74}})));
6060
OpenIPSL.Types.PerUnit P "Active Power";
61+
Modelica.Units.SI.ActivePower Pdc;
6162
OpenIPSL.Types.PerUnit Q "Reactive Power";
6263
OpenIPSL.Types.PerUnit S "Motor Slip";
6364

@@ -131,7 +132,8 @@ equation
131132
Q = (-p.vr*p.ii) + p.vi*p.ir;
132133
Q = 0;
133134
S = sqrt(P^2 + Q^2);
134-
Resistor.i = smooth(0,(P*S_b)/Vd0.y);
135+
Pdc = Vd0.y*Resistor.i;
136+
P*S_b = Pdc;
135137

136138
n.vr = vr_m.y;
137139
n.vi = vi_m.y;

OpenIPSL/Electrical/Machines/PSSE/BaseClasses/baseMotor.mo

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,8 @@ equation
9494
v = sqrt(p.vr^2 + p.vi^2);
9595
anglev = atan2(p.vi, p.vr);
9696
delta = anglev;
97-
P = p.vr*p.ir + p.vi*p.ii;
98-
Q = (-p.vr*p.ii) + p.vi*p.ir;
97+
P = if Ctrl == true then (p.vr*p.ir + p.vi*p.ii)*(we_fix.y/w_b) else (p.vr*p.ir + p.vi*p.ii);
98+
Q = if Ctrl == true then ((-p.vr*p.ii) + p.vi*p.ir)*(we_fix.y/w_b) else ((-p.vr*p.ii) + p.vi*p.ir);
9999
P_motor = P/CoB;
100100
Q_motor = Q/CoB;
101101
ns = w_sync/N;

OpenIPSL/Electrical/Renewables/PSSE/BESS.mo

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ extends OpenIPSL.Electrical.Essentials.pfComponent(
1818
replaceable
1919
OpenIPSL.Electrical.Renewables.PSSE.InverterInterface.BaseClasses.BaseREGC
2020
RenewableGenerator(
21+
V_b=V_b,
2122
M_b=M_b,
2223
P_0=P_0,
2324
Q_0=Q_0,
@@ -37,6 +38,7 @@ extends OpenIPSL.Electrical.Essentials.pfComponent(
3738
replaceable
3839
OpenIPSL.Electrical.Renewables.PSSE.PlantController.BaseClasses.BaseREPC
3940
PlantController(
41+
V_b=V_b,
4042
M_b=M_b,
4143
P_0=P_0,
4244
Q_0=Q_0,

OpenIPSL/Electrical/Renewables/PSSE/PV.mo

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ extends OpenIPSL.Electrical.Essentials.pfComponent(
1818
replaceable
1919
OpenIPSL.Electrical.Renewables.PSSE.InverterInterface.BaseClasses.BaseREGC
2020
RenewableGenerator(
21+
V_b=V_b,
2122
M_b=M_b,
2223
P_0=P_0,
2324
Q_0=Q_0,
@@ -37,6 +38,7 @@ extends OpenIPSL.Electrical.Essentials.pfComponent(
3738
replaceable
3839
OpenIPSL.Electrical.Renewables.PSSE.PlantController.BaseClasses.BaseREPC
3940
PlantController(
41+
V_b=V_b,
4042
M_b=M_b,
4143
P_0=P_0,
4244
Q_0=Q_0,

OpenIPSL/Examples/Microgrids/IEEEMicrogrid/Data/LoadsMicrogrid.mo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ record LoadsMicrogrid "Data record for load power consumption"
44

55
// Load 1
66
parameter Real P1=0.02e6;
7-
parameter Real Q1=0.005e6;
7+
parameter Real Q1=0.0123e6;
88

99

1010
annotation (Documentation(info="<html>

OpenIPSL/Examples/Microgrids/IEEEMicrogrid/Data/MachinesMicrogrid.mo

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,22 @@ record MachinesMicrogrid "Data record for power generation"
33
extends Modelica.Icons.Record;
44

55
// Machine Diesel Unit
6-
parameter Real PDT=0.05e6;
7-
parameter Real QDT=-0.04e6;
6+
parameter Real PDT=0.02e6;
7+
parameter Real QDT=-0.0313e6;
8+
9+
// PV
10+
parameter Real PPV=0.035e6;
11+
parameter Real QPV=0.0115e6;
12+
13+
// BESS
14+
parameter Real PBESS=0.0055e6;
15+
parameter Real QBESS=0;
816

917
// Machine Inf
10-
parameter Real PInf=-0.02999824e6;
11-
parameter Real QInf=-0.1550323e6;
18+
parameter Real PInf=-0.0405e6;
19+
parameter Real QInf= 0.0121e6;
20+
21+
1222

1323
annotation (Documentation(info="<html>
1424
This data record has the active and reactive powers in VA and Var, respectively, that are delivered by the generation units to the system. The data is used to initialized the network in a certain operating point.

OpenIPSL/Examples/Microgrids/IEEEMicrogrid/Data/VoltagesMicrogrid.mo

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,29 @@ record VoltagesMicrogrid
99
parameter Real A1=0*pi/180;
1010

1111
// Bus LVBus
12-
parameter Real V2=1.0000;
13-
parameter Real A2=0*pi/180;
12+
parameter Real V2=1.00;
13+
parameter Real A2=0.001322568*pi/180;
1414

1515
// Bus SubBus
16-
parameter Real V3=1.000034;
17-
parameter Real A3=-0.0006039513*pi/180;
16+
parameter Real V3=1.00;
17+
parameter Real A3=0.001845621*pi/180;
1818

1919
// Bus CentralBus
20-
parameter Real V4=1.000072;
21-
parameter Real A4=-0.001997927*pi/180;
20+
parameter Real V4=1.00;
21+
parameter Real A4=0.002433209*pi/180;
2222

2323
// Bus LoadBus
24-
parameter Real V5=1.000013;
25-
parameter Real A5=-0.002251726*pi/180;
24+
parameter Real V5=1.00;
25+
parameter Real A5=0.002433209*pi/180;
2626

2727
// Bus CapBus
28-
parameter Real V6=1.000072;
29-
parameter Real A6=-0.001997927*pi/180;
28+
parameter Real V6=1.00;
29+
parameter Real A6=0.003302665*pi/180;
30+
31+
// Bus Motor
32+
parameter Real V7=1.00;
33+
parameter Real A7=0.002433209*pi/180;
34+
3035

3136
annotation (Documentation(info="<html>
3237
This data record has the voltage magnitude, in per unit, and angle, in radians, that are used to initialized the network in a certain operating point.

0 commit comments

Comments
 (0)