Skip to content

Commit 3902890

Browse files
committed
Updating WTDTA1.mo and Renewable Model Base Classes
The updates are as follows: 1) Eliminated intermediate variable in WTDTA1.mo model that was being used to make initial equation T0 = P0; 2) Eliminated start values from realinputs and realoutputs. This was done in all renewable components that had such thing. 3) Fixed one error on the REECB1 model. 4) All renewable test examples are configured to start the default simulation with QFunctionality=4.
1 parent f080052 commit 3902890

16 files changed

Lines changed: 88 additions & 101 deletions

File tree

OpenIPSL/Electrical/Renewables/PSSE/BESS.mo

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,7 @@ equation
174174
color={0,0,127}));
175175
connect(PlantController.regulate_vi, regulate_vi) annotation (Line(points={{-44,22},{-44,92},{80,92},{80,120}},
176176
color={0,0,127}));
177-
annotation (Icon(graphics={
178-
Ellipse(
177+
annotation (Icon(graphics={ Ellipse(
179178
extent={{-100,100},{100,-100}},
180179
lineColor={0,0,0},
181180
fillColor={255,170,85},

OpenIPSL/Electrical/Renewables/PSSE/ElectricalController/BaseClasses/CurrentLimitLogicREECB.mo

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,8 @@ model CurrentLimitLogicREECB "Current Limit Logic for REECB"
55
parameter OpenIPSL.Types.PerUnit start_ir "Starting current value from Ipcmd (comes from power flow simulation)";
66
parameter OpenIPSL.Types.PerUnit Imax "Maximum limit on total converter current";
77

8-
Modelica.Blocks.Interfaces.RealInput Iqcmd(start = -start_ii) annotation (Placement(
9-
transformation(extent={{140,30},{100,70}})));
10-
Modelica.Blocks.Interfaces.RealInput Ipcmd(start = start_ir) annotation (Placement(
11-
transformation( extent={{140,-70},{100,-30}})));
8+
Modelica.Blocks.Interfaces.RealInput Iqcmd annotation (Placement(transformation(extent={{140,30},{100,70}})));
9+
Modelica.Blocks.Interfaces.RealInput Ipcmd annotation (Placement(transformation( extent={{140,-70},{100,-30}})));
1210
Modelica.Blocks.Interfaces.RealOutput Iqmin annotation (Placement(
1311
transformation(
1412
extent={{-10,-10},{10,10}},

OpenIPSL/Electrical/Renewables/PSSE/ElectricalController/BaseClasses/CurrentLimitLogicREECC.mo

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,8 @@ model CurrentLimitLogicREECC "Current limit logic for REECC"
1111
transformation(extent={{-140,-20},{-100,20}})));
1212
Modelica.Blocks.Interfaces.RealInput VDL2_out annotation (Placement(
1313
transformation(extent={{-140,-80},{-100,-40}})));
14-
Modelica.Blocks.Interfaces.RealInput Iqcmd(start = -start_ii) annotation (Placement(
15-
transformation(extent={{140,40},{100,80}})));
16-
Modelica.Blocks.Interfaces.RealInput Ipcmd(start = start_ir) annotation (Placement(
17-
transformation(extent={{140,-80},{100,-40}})));
14+
Modelica.Blocks.Interfaces.RealInput Iqcmd annotation (Placement(transformation(extent={{140,40},{100,80}})));
15+
Modelica.Blocks.Interfaces.RealInput Ipcmd annotation (Placement(transformation(extent={{140,-80},{100,-40}})));
1816
Modelica.Blocks.Interfaces.RealOutput Iqmax annotation (Placement(
1917
transformation(
2018
extent={{-10,-10},{10,10}},

OpenIPSL/Electrical/Renewables/PSSE/ElectricalController/REECA1.mo

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
within OpenIPSL.Electrical.Renewables.PSSE.ElectricalController;
22
model REECA1 "Electrical control model for large scale wind"
3-
extends OpenIPSL.Electrical.Renewables.PSSE.ElectricalController.BaseClasses.BaseREECA(
4-
Iqcmd(start=Iq0), Ipcmd(start=Ip0));
3+
extends
4+
OpenIPSL.Electrical.Renewables.PSSE.ElectricalController.BaseClasses.BaseREECA(
5+
Iqcmd, Ipcmd);
56

67
parameter OpenIPSL.Types.PerUnit Vdip = -99 "Low voltage threshold to activate reactive current injection logic (0.85 - 0.9)";
78
parameter OpenIPSL.Types.PerUnit Vup = 99 "Voltage above which reactive current injection logic is activated (>1.1)";
@@ -369,8 +370,10 @@ equation
369370
annotation (Line(points={{-261,220},{-242,220}}, color={0,0,127}));
370371
connect(VFilter.u, Vt) annotation (Line(points={{-284,220},{-290,220},{-290,200},
371372
{-320,200}}, color={0,0,127}));
372-
connect(variableLimiter1.y, Ipcmd) annotation (Line(points={{81,-172},{288,-172},{288,-140},{310,-140}}, color={0,0,127}));
373-
connect(variableLimiter.y, Iqcmd) annotation (Line(points={{281,80},{290,80},{290,140},{310,140}}, color={0,0,127}));
373+
connect(variableLimiter1.y, Ipcmd) annotation (Line(points={{81,-172},{288,-172},
374+
{288,-170},{310,-170}}, color={0,0,127}));
375+
connect(variableLimiter.y, Iqcmd) annotation (Line(points={{281,80},{290,80},{
376+
290,170},{310,170}}, color={0,0,127}));
374377
connect(VLogic.y, pI_No_Windup.voltage_dip) annotation (Line(points={{2,160},{20,160},{20,138},{82,138}}, color={255,0,255}));
375378
connect(VLogic.y, pI_No_Windup_notVariable.voltage_dip) annotation (Line(points={{2,160},{20,160},{20,140},{-100,140},{-100,128},{-90,128}}, color={255,0,255}));
376379
annotation (Documentation(info="<html>

OpenIPSL/Electrical/Renewables/PSSE/ElectricalController/REECB1.mo

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ within OpenIPSL.Electrical.Renewables.PSSE.ElectricalController;
22
model REECB1 "Electrical control model for large scale photovoltaic"
33
extends
44
OpenIPSL.Electrical.Renewables.PSSE.ElectricalController.BaseClasses.BaseREECB(
5-
Iqcmd(start=Iq0), Ipcmd(start=Ip0));
5+
Iqcmd, Ipcmd);
66

77
parameter OpenIPSL.Types.PerUnit Vdip = -99 "Low voltage threshold to activate reactive current injection logic (0.85 - 0.9)";
88
parameter OpenIPSL.Types.PerUnit Vup = 99 "Voltage above which reactive current injection logic is activated (>1.1)";
@@ -187,6 +187,10 @@ model REECB1 "Electrical control model for large scale photovoltaic"
187187
origin={-230,-130})));
188188
Modelica.Blocks.Math.Product product6
189189
annotation (Placement(transformation(extent={{-190,-176},{-170,-156}})));
190+
Modelica.Blocks.Sources.RealExpression VReF0(y=Vref0) annotation (Placement(
191+
transformation(
192+
extent={{-10,10},{10,-10}},
193+
origin={-44,-32})));
190194
protected
191195
parameter Real pfaref = p00/sqrt(p00^2 +q00^2) "Power Factor of choice.";
192196
parameter OpenIPSL.Types.Angle pfangle = if q00 > 0 then acos(pfaref) else -acos(pfaref);
@@ -360,8 +364,8 @@ equation
360364
{-212,-172},{-192,-172}}, color={0,0,127}));
361365
connect(product6.y, integrator3.u)
362366
annotation (Line(points={{-169,-166},{-154,-166}}, color={0,0,127}));
363-
connect(VFlag.u3, limiter1.u) annotation (Line(points={{-4,46},{-8,46},{-8,
364-
-64},{-170,-64},{-170,66},{-164,66}}, color={0,0,127}));
367+
connect(VReF0.y, VFlag.u3)
368+
annotation (Line(points={{-33,-32},{-4,-32},{-4,46}}, color={0,0,127}));
365369
annotation (Documentation(info="<html>
366370
<p>
367371
The REECB1 component used to represent the electrical controls of photovoltaic generation. The electrical controller actuates on the active and reactive power

OpenIPSL/Electrical/Renewables/PSSE/ElectricalController/REECCU1.mo

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ model REECCU1
33
"Electrical control model for utility scale battery energy storage"
44
extends
55
OpenIPSL.Electrical.Renewables.PSSE.ElectricalController.BaseClasses.BaseREECC(
6-
Iqcmd(start=Iq0), Ipcmd(start=Ip0));
6+
Iqcmd, Ipcmd);
77

88
parameter OpenIPSL.Types.PerUnit Vdip = -99 "Low voltage threshold to activate reactive current injection logic (0.85 - 0.9)";
99
parameter OpenIPSL.Types.PerUnit Vup = 99 "Voltage above which reactive current injection logic is activated (>1.1)";
@@ -303,7 +303,7 @@ equation
303303
connect(Paux, add7.u2) annotation (Line(points={{-320,-160},{-26,-160},{-26,-136},
304304
{-20,-136}}, color={0,0,127}));
305305
connect(variableLimiter2.y, Ipcmd)
306-
annotation (Line(points={{249,-160},{288,-160},{288,-140},{310,-140}},
306+
annotation (Line(points={{249,-160},{288,-160},{288,-170},{310,-170}},
307307
color={0,0,127}));
308308
connect(add7.y,variableLimiter2. u) annotation (Line(points={{3,-130},{114,-130},
309309
{114,-160},{226,-160}}, color={0,0,127}));
@@ -444,15 +444,15 @@ equation
444444
connect(VDL1.y[1], ccl_reecc.VDL1_out) annotation (Line(points={{77,-50},{77,-50.4},
445445
{88.8,-50.4}}, color={0,0,127}));
446446
connect(PQFLAG.y, ccl_reecc.pqflag)
447-
annotation (Line(points={{147,-60},{127.2,-60}}, color={255,0,255}));
447+
annotation (Line(points={{147,-60},{88.8,-60}}, color={255,0,255}));
448448
connect(IQCMD.y, ccl_reecc.Iqcmd) annotation (Line(points={{147,-38},{132,-38},{132,-50.4},{127.2,-50.4}},
449449
color={0,0,127}));
450450
connect(IPCMD.y, ccl_reecc.Ipcmd) annotation (Line(points={{147,-82},{132,-82},{132,-69.6},{127.2,-69.6}},
451451
color={0,0,127}));
452452
connect(limiter.y, add9.u1)
453453
annotation (Line(points={{-107,234},{230,234},{230,166}},color={0,0,127}));
454454
connect(variableLimiter.y, Iqcmd)
455-
annotation (Line(points={{287,160},{294,160},{294,140},{310,140}},
455+
annotation (Line(points={{287,160},{294,160},{294,170},{310,170}},
456456
color={0,0,127}));
457457
connect(Vt, simpleLag.u)
458458
annotation (Line(points={{-320,240},{-290,240}}, color={0,0,127}));

OpenIPSL/Electrical/Renewables/PSSE/InverterInterface/BaseClasses/BaseREGC.mo

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,9 @@ partial model BaseREGC "Base renewable generator/converter for PSSE models"
3939
vi(start=vi0),
4040
ir(start=-ir0*CoB),
4141
ii(start=-ii0*CoB)) annotation (Placement(transformation(extent={{130,-10},{150,10}})));
42-
Modelica.Blocks.Interfaces.RealInput Iqcmd(start=-Iq0) "Imaginary Command Current"
43-
annotation (Placement(transformation(extent={{-180,60},{-140,100}})));
44-
Modelica.Blocks.Interfaces.RealInput Ipcmd(start=Ip0) "Real Command Current"
45-
annotation (Placement(transformation(extent={{-180,-100},{-140,-60}})));
42+
Modelica.Blocks.Interfaces.RealInput Iqcmd "Imaginary Command Current"
43+
annotation (Placement(transformation(extent={{-180,60},{-140,100}})));
44+
Modelica.Blocks.Interfaces.RealInput Ipcmd "Real Command Current" annotation (Placement(transformation(extent={{-180,-100},{-140,-60}})));
4645
Modelica.Blocks.Interfaces.RealOutput IQ0 "Initial Reactive Power" annotation (Placement(
4746
transformation(
4847
extent={{-10,-10},{10,10}},

OpenIPSL/Electrical/Renewables/PSSE/InverterInterface/REGCA1.mo

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ equation
8787
connect(LVACM.y,IP. u2) annotation (Line(points={{83,-70},{92,-70},{92,-22},{98,-22}},
8888
color={0,0,127}));
8989
connect(switch1.u1,LVPL. y)
90-
annotation (Line(points={{-68,-82},{-56,-82},{-56,-69.9},{-11.1,-69.9}},
90+
annotation (Line(points={{-68,-82},{-56,-82},{-56,-70},{-11,-70}},
9191
color={0,0,127}));
9292
connect(Lvplsw_logic.y,switch1. u2) annotation (Line(points={{-51,-90},{-68,-90}},
9393
color={255,0,255}));
@@ -113,10 +113,10 @@ equation
113113
{-92,56},{-92,68},{-88,68}}, color={0,0,127}));
114114
connect(gain.y,add3. u1) annotation (Line(points={{-99,80},{-88,80}},
115115
color={0,0,127}));
116-
connect(gain.u, Iqcmd) annotation (Line(points={{-122,80},{-134,80},{-134,60},{-160,60}},
117-
color={0,0,127}));
118-
connect(Ipcmd,add2. u1) annotation (Line(points={{-160,-60},{-122,-60},{-122,-24},{-112,-24}},
119-
color={0,0,127}));
116+
connect(gain.u, Iqcmd) annotation (Line(points={{-122,80},{-134,80},{-134,80},
117+
{-160,80}}, color={0,0,127}));
118+
connect(Ipcmd,add2. u1) annotation (Line(points={{-160,-80},{-122,-80},{-122,
119+
-24},{-112,-24}}, color={0,0,127}));
120120
connect(Constant.y, switch1.u3) annotation (Line(points={{-51,-114},{-62,-114},
121121
{-62,-98},{-68,-98}}, color={0,0,127}));
122122
connect(limiter4.y, integrator1.u)

OpenIPSL/Electrical/Renewables/PSSE/PV.mo

Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,8 @@ protected
9999
parameter Boolean fflag = (if PFunctionality == 1 then true else false);
100100
equation
101101
connect(RenewableController.Iqcmd, RenewableGenerator.Iqcmd)
102-
annotation (Line(points={{20.6667,11.3333},{23.9048,11.3333},{23.9048,11.4286},{27.1429,11.4286}},
103-
color={0,0,127}));
102+
annotation (Line(points={{20.6667,11.3333},{23.9048,11.3333},{23.9048,
103+
11.4286},{27.1429,11.4286}}, color={0,0,127}));
104104
connect(RenewableGenerator.IQ0, RenewableController.iq0) annotation (Line(
105105
points={{32.8571,-21.4286},{32.8571,-28},{16,-28},{16,-21.3333}},
106106
color={0,0,127}));
@@ -117,8 +117,8 @@ equation
117117
points={{67.1429,-21.4286},{67.1429,-44},{-16,-44},{-16,-21.3333}},
118118
color={0,0,127}));
119119
connect(RenewableGenerator.V_t, RenewableController.Vt) annotation (Line(
120-
points={{38.5714,21.4286},{38.5714,26},{-26,26},{-26,10.6667},{-21.3333,10.6667}},
121-
color={0,0,127}));
120+
points={{38.5714,21.4286},{38.5714,26},{-26,26},{-26,10.6667},{-21.3333,
121+
10.6667}}, color={0,0,127}));
122122
connect(RenewableGenerator.Pgen, RenewableController.Pe) annotation (Line(
123123
points={{50,21.4286},{50,30},{-28,30},{-28,5.33333},{-21.3333,5.33333}},
124124
color={0,0,127}));
@@ -131,27 +131,30 @@ equation
131131
connect(PlantController.Pref, RenewableController.Pref) annotation (Line(
132132
points={{-37,-10},{-38,-10},{-38,-10.6667},{-21.3333,-10.6667}}, color={
133133
0,0,127}));
134-
connect(PlantController.p0, RenewableController.p0) annotation (Line(points={{-70,-22},{-70,-44},{-16,-44},{-16,-21.3333}},
135-
color={0,0,127}));
136-
connect(PlantController.v0, RenewableController.v0) annotation (Line(points={{-58,-22},{-58,-36},{0,-36},{0,-21.3333}},
137-
color={0,0,127}));
138-
connect(PlantController.q0, RenewableController.q0) annotation (Line(points={{-46,-22},{-46,-40},{-8,-40},{-8,-21.3333}},
139-
color={0,0,127}));
140-
connect(gain.u, RenewableGenerator.p_0) annotation (Line(points={{1.2,-60},{67.1429,-60},{67.1429,-21.4286}},
134+
connect(PlantController.p0, RenewableController.p0) annotation (Line(points={{-70,-22},
135+
{-70,-44},{-16,-44},{-16,-21.3333}}, color={0,0,127}));
136+
connect(PlantController.v0, RenewableController.v0) annotation (Line(points={{-58,-22},
137+
{-58,-36},{0,-36},{0,-21.3333}}, color={0,0,127}));
138+
connect(PlantController.q0, RenewableController.q0) annotation (Line(points={{-46,-22},
139+
{-46,-40},{-8,-40},{-8,-21.3333}}, color={0,0,127}));
140+
connect(gain.u, RenewableGenerator.p_0) annotation (Line(points={{1.2,-60},{
141+
67.1429,-60},{67.1429,-21.4286}},
141142
color={0,0,127}));
142-
connect(gain1.y, RenewableController.Qext) annotation (Line(points={{-12.6,-80},{-32,-80},{-32,-5.33333},{-21.3333,-5.33333}},
143-
color={0,0,127}));
144-
connect(gain.y, RenewableController.Pref) annotation (Line(points={{-12.6,-60},{-30,-60},{-30,-10.6667},{-21.3333,-10.6667}},
143+
connect(gain1.y, RenewableController.Qext) annotation (Line(points={{-12.6,
144+
-80},{-32,-80},{-32,-5.33333},{-21.3333,-5.33333}},
145145
color={0,0,127}));
146-
connect(gain1.u, RenewableGenerator.q_0) annotation (Line(points={{1.2,-80},{58.5714,-80},{58.5714,-21.4286}},
146+
connect(gain.y, RenewableController.Pref) annotation (Line(points={{-12.6,-60},
147+
{-30,-60},{-30,-10.6667},{-21.3333,-10.6667}}, color={0,0,127}));
148+
connect(gain1.u, RenewableGenerator.q_0) annotation (Line(points={{1.2,-80},{
149+
58.5714,-80},{58.5714,-21.4286}},
147150
color={0,0,127}));
148151
connect(freq_ref.y, PlantController.Freq_ref) annotation (Line(points={{-80.5,
149152
-55},{-88,-55},{-88,-12},{-80,-12}}, color={0,0,127}));
150153
connect(PlantController.Plant_pref, RenewableGenerator.p_0) annotation (Line(
151154
points={{-80,4},{-96,4},{-96,-92},{67.1429,-92},{67.1429,-21.4286}},
152155
color={0,0,127}));
153-
connect(PlantController.Qref, RenewableGenerator.q_0) annotation (Line(points={{-80,12},{-98,12},{-98,-98},{58.5714,-98},{58.5714,-21.4286}},
154-
color={
156+
connect(PlantController.Qref, RenewableGenerator.q_0) annotation (Line(points={{-80,12},
157+
{-98,12},{-98,-98},{58.5714,-98},{58.5714,-21.4286}}, color={
155158
0,0,127}));
156159
connect(RenewableGenerator.p, pwPin)
157160
annotation (Line(points={{70,0},{100,0}}, color={0,0,255}));
@@ -165,9 +168,9 @@ equation
165168
color={0,0,127}));
166169
connect(PlantController.regulate_vi, regulate_vi) annotation (Line(points={{-44,22},{-44,92},{80,92},{80,120}},
167170
color={0,0,127}));
168-
connect(RenewableController.Ipcmd, RenewableGenerator.Ipcmd) annotation (Line(points={{20.6667,-11.3333},{23.9048,-11.3333},{23.9048,-11.4286},{27.1429,-11.4286}}, color={0,0,127}));
169-
annotation (Icon(graphics={
170-
Ellipse(
171+
connect(RenewableController.Ipcmd, RenewableGenerator.Ipcmd) annotation (Line(points={{20.6667,
172+
-11.3333},{23.9048,-11.3333},{23.9048,-11.4286},{27.1429,-11.4286}}, color={0,0,127}));
173+
annotation (Icon(graphics={ Ellipse(
171174
extent={{-100,100},{100,-100}},
172175
lineColor={0,0,0},
173176
fillColor={255,255,170},

OpenIPSL/Electrical/Renewables/PSSE/PlantController/BaseClasses/BaseREPC.mo

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ partial model BaseREPC
3232
Modelica.Blocks.Interfaces.RealInput Freq_ref "Plant Controller Frequency Reference"
3333
annotation (Placement(
3434
transformation(extent={{-240,-140},{-200,-100}})));
35-
Modelica.Blocks.Interfaces.RealOutput Qext(start=q0) "Reactive Power output signal"
35+
Modelica.Blocks.Interfaces.RealOutput Qext "Reactive Power output signal"
3636
annotation (Placement(transformation(extent={{200,90},{220,110}})));
37-
Modelica.Blocks.Interfaces.RealOutput Pref(start=p0) "Real Power output signal"
37+
Modelica.Blocks.Interfaces.RealOutput Pref "Real Power output signal"
3838
annotation (Placement(transformation(extent={{200,-110},{220,-90}})));
3939

4040
Modelica.Blocks.Interfaces.RealInput p0 "Initial Active Power" annotation (Placement(transformation(

0 commit comments

Comments
 (0)