@@ -15,6 +15,8 @@ extends OpenIPSL.Electrical.Essentials.pfComponent(
1515 parameter Integer QFunctionality = 0 "BESS Reactive Power Control Options" annotation (Dialog(group= "Reactive Power Control Options" ), choices(choice=0 "Constant local PF control" , choice=1 "Constant local Q control" , choice=2 "Local V control" , choice=3 "Local coordinated V/Q control" , choice=4 "Plant level Q control" , choice=5 "Plant level V control" , choice=6 "Plant level Q control + local coordinated V/Q control" , choice=7 "Plant level V control + local coordinated V/Q control" ));
1616 parameter Integer PFunctionality = 0 "BESS Real Power Control Options" annotation (Dialog(group= "Active Power Control Options" , enable=(QFunctionality >=4)), choices(choice=0 "No governor response" , choice=1 "Governor response with up and down regulation" ));
1717
18+ // Irradiance to Power parameter selection
19+ parameter Boolean Irr2Pow = false "Irradiance to Power Options" annotation (Dialog(group= "Irradiance to Power Add-On Capability" ));
1820 replaceable
1921 OpenIPSL.Electrical.Renewables.PSSE.InverterInterface.BaseClasses.BaseREGC
2022 RenewableGenerator(
@@ -46,7 +48,7 @@ extends OpenIPSL.Electrical.Essentials.pfComponent(
4648 refflag= refflag) if QFunctionality > = 4 annotation (choicesAllMatching=true,
4749 Placement(transformation(extent={{-78,-20},{-38,20}})));
4850 Modelica.Blocks.Math.Gain gain(k= 1 )
49- if QFunctionality < 4
51+ if QFunctionality < 4 and not Irr2Pow
5052 annotation (Placement(transformation(
5153 extent={{-6,-6},{6,6}},
5254 rotation=180,
@@ -59,8 +61,10 @@ extends OpenIPSL.Electrical.Essentials.pfComponent(
5961 origin={-6,-80})));
6062 Modelica.Blocks.Sources.Constant freq_ref(k= SysData.fn) if QFunctionality > = 4
6163 annotation (Placement(transformation(extent={{-70,-60},{-80,-50}})));
62- Modelica.Blocks.Interfaces.RealInput FREQ if QFunctionality > = 4 "Connection Point Frequency"
63- annotation (Placement(transformation(extent={{-140,-20},{-100,20}})));
64+ Modelica.Blocks.Interfaces.RealInput FREQ if QFunctionality > = 4
65+ "Connection Point Frequency"
66+ annotation (Placement(transformation(extent={{-140,-60},{-100,-20}}),
67+ iconTransformation(extent={{-140,-60},{-100,-20}})));
6468
6569 Modelica.Blocks.Interfaces.RealInput branch_ir if QFunctionality > = 4 "Measured Branch Real Current"
6670 annotation (Placement(transformation(
@@ -94,6 +98,27 @@ extends OpenIPSL.Electrical.Essentials.pfComponent(
9498 extent={{-20,-20},{20,20}},
9599 rotation=270,
96100 origin={60,100})));
101+ Modelica.Blocks.Interfaces.RealInput i2p if Irr2Pow
102+ "Irradiance to Power input" annotation (Placement(transformation(extent={{-140,
103+ 20},{-100,60}}), iconTransformation(extent={{-140,20},{-100,60}})));
104+ Modelica.Blocks.Math.Gain gain2(k= 1 )
105+ if Irr2Pow and QFunctionality < 4
106+ annotation (Placement(transformation(
107+ extent={{-6,-6},{6,6}},
108+ rotation=0,
109+ origin={-86,80})));
110+ Modelica.Blocks.Math.Gain gain3(k= 1 )
111+ if Irr2Pow and QFunctionality > = 4
112+ annotation (Placement(transformation(
113+ extent={{-6,-6},{6,6}},
114+ rotation=0,
115+ origin={-86,60})));
116+ Modelica.Blocks.Math.Gain gain4(k= 1 )
117+ if QFunctionality > = 4 and not Irr2Pow
118+ annotation (Placement(transformation(
119+ extent={{-6,-6},{6,6}},
120+ rotation=180,
121+ origin={-60,-86})));
97122protected
98123 parameter Boolean pfflag = (if QFunctionality == 0 then true else false );
99124 parameter Boolean vflag = (if QFunctionality == 3 or QFunctionality == 6 or QFunctionality == 7 then true else false );
@@ -102,8 +127,8 @@ protected
102127 parameter Boolean fflag = (if PFunctionality == 1 then true else false );
103128equation
104129 connect (RenewableController.Iqcmd, RenewableGenerator.Iqcmd)
105- annotation (Line(points={{20.6667,11.3333},{23.9048,11.3333},{23.9048,
106- 11.4286}, {27.1429,11.4286}}, color={0,0,127}));
130+ annotation (Line(points={{20.6667,11.3333},{23.9048,11.3333},{23.9048,11.4286},
131+ {27.1429,11.4286}}, color={0,0,127}));
107132 connect (RenewableGenerator.IQ0, RenewableController.iq0) annotation (Line(
108133 points={{32.8571,-21.4286},{32.8571,-28},{16,-28},{16,-21.3333}},
109134 color={0,0,127}));
@@ -140,28 +165,23 @@ equation
140165 {-58,-36},{0,-36},{0,-21.3333}}, color={0,0,127}));
141166 connect (PlantController.q0, RenewableController.q0) annotation (Line(points={{-46,-22},
142167 {-46,-40},{-8,-40},{-8,-21.3333}}, color={0,0,127}));
143- connect (gain.u, RenewableGenerator.p_0) annotation (Line(points={{1.2,-60},{
144- 67.1429,-60},{67.1429,-21.4286}},
145- color={0,0,127}));
146- connect (gain1.y, RenewableController.Qext) annotation (Line(points={{-12.6,
147- -80},{-32,-80},{-32,-5.33333},{-21.3333,-5.33333}},
148- color={0,0,127}));
168+ connect (gain.u, RenewableGenerator.p_0) annotation (Line(points={{1.2,-60},{67.1429,
169+ -60},{67.1429,-21.4286}}, color={0,0,127}));
170+ connect (gain1.y, RenewableController.Qext) annotation (Line(points={{-12.6,-80},
171+ {-32,-80},{-32,-5.33333},{-21.3333,-5.33333}}, color={0,0,127}));
149172 connect (gain.y, RenewableController.Pref) annotation (Line(points={{-12.6,-60},
150173 {-30,-60},{-30,-10.6667},{-21.3333,-10.6667}}, color={0,0,127}));
151- connect (gain1.u, RenewableGenerator.q_0) annotation (Line(points={{1.2,-80},{
152- 58.5714,-80},{58.5714,-21.4286}},
153- color={0,0,127}));
174+ connect (gain1.u, RenewableGenerator.q_0) annotation (Line(points={{1.2,-80},{58.5714,
175+ -80},{58.5714,-21.4286}}, color={0,0,127}));
154176 connect (freq_ref.y, PlantController.Freq_ref) annotation (Line(points={{-80.5,
155177 -55},{-88,-55},{-88,-12},{-80,-12}}, color={0,0,127}));
156- connect (PlantController.Plant_pref, RenewableGenerator.p_0) annotation (Line(
157- points={{-80,4},{-96,4},{-96,-92},{67.1429,-92},{67.1429,-21.4286}},
158- color={0,0,127}));
159178 connect (PlantController.Qref, RenewableGenerator.q_0) annotation (Line(points={{-80,12},
160179 {-98,12},{-98,-98},{58.5714,-98},{58.5714,-21.4286}}, color={
161180 0,0,127}));
162181 connect (RenewableGenerator.p, pwPin)
163182 annotation (Line(points={{70,0},{100,0}}, color={0,0,255}));
164- connect (PlantController.Freq, FREQ) annotation (Line(points={{-80,-4},{-92,-4},{-92,0},{-120,0}},
183+ connect (PlantController.Freq, FREQ) annotation (Line(points={{-80,-4},{-92,-4},
184+ {-92,-40},{-120,-40}},
165185 color={0,0,127}));
166186 connect (PlantController.branch_ii, branch_ii) annotation (Line(points={{-62,22},{-62,96},{-40,96},{-40,120}},
167187 color={0,0,127}));
@@ -173,6 +193,20 @@ equation
173193 color={0,0,127}));
174194 connect (RenewableController.Ipcmd, RenewableGenerator.Ipcmd) annotation (Line(points={{20.6667,
175195 -11.3333},{23.9048,-11.3333},{23.9048,-11.4286},{27.1429,-11.4286}}, color={0,0,127}));
196+ connect (i2p, gain2.u)
197+ annotation (Line(points={{-120,40},{-98,40},{-98,80},{-93.2,80}},
198+ color={0,0,127}));
199+ connect (gain2.y, RenewableController.Pref) annotation (Line(points={{-79.4,80},
200+ {-36,80},{-36,22},{-34,22},{-34,-10.6667},{-21.3333,-10.6667}},
201+ color={0,0,127}));
202+ connect (gain3.u, i2p) annotation (Line(points={{-93.2,60},{-98,60},{-98,40},{-120,
203+ 40}}, color={0,0,127}));
204+ connect (gain4.u, RenewableGenerator.p_0) annotation (Line(points={{-52.8,-86},
205+ {-40,-86},{-40,-94},{67.1429,-94},{67.1429,-21.4286}}, color={0,0,127}));
206+ connect (gain4.y, PlantController.Plant_pref) annotation (Line(points={{-66.6,-86},
207+ {-94,-86},{-94,4},{-80,4}}, color={0,0,127}));
208+ connect (gain3.y, PlantController.Plant_pref) annotation (Line(points={{-79.4,60},
209+ {-76,60},{-76,32},{-88,32},{-88,4},{-80,4}}, color={0,0,127}));
176210 annotation (Icon(graphics={ Ellipse(
177211 extent={{-100,100},{100,-100}},
178212 lineColor={0,0,0},
0 commit comments