Skip to content

Commit c8dc628

Browse files
GiuseppeLaeradietmarw
authored andcommitted
Update August 2024
1 parent 8269930 commit c8dc628

53 files changed

Lines changed: 3756 additions & 53 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
within OpenIPSL.Electrical.Controls.PSSE;
2+
package COMP
3+
model IEEEVC
4+
import Modelica.Units.SI;
5+
import Modelica.ComplexMath.j;
6+
import 'abs' =
7+
Modelica.ComplexMath.abs;
8+
parameter SI.PerUnit RC;
9+
parameter SI.PerUnit XC;
10+
OpenIPSL.Interfaces.PwPin Gen_terminal annotation (Placement(transformation(
11+
extent={{-90,50},{-70,70}}), iconTransformation(extent={{-90,50},{
12+
-70,70}})));
13+
OpenIPSL.Interfaces.PwPin Bus annotation (Placement(transformation(extent={{50,50},
14+
{70,70}}), iconTransformation(extent={{50,50},{70,70}})));
15+
Modelica.Blocks.Interfaces.RealOutput VCT annotation (Placement(
16+
transformation(extent={{80,-16},{112,16}}), iconTransformation(extent={{
17+
80,-16},{112,16}})));
18+
protected
19+
Complex V_T;
20+
Complex I_T;
21+
equation
22+
VCT = 'abs'(V_T + (RC + j*XC)*I_T);
23+
V_T = Gen_terminal.vr + j*Gen_terminal.vi;
24+
I_T = Gen_terminal.ir + j*Gen_terminal.ii;
25+
connect(Gen_terminal,Bus) annotation (Line(points={{-80,60},{60,60}},
26+
color={0,0,255}));
27+
annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,
28+
-60},{80,80}}), graphics={Rectangle(extent={{-100,80},{80,-60}},
29+
lineColor={28,108,200})}), Diagram(
30+
coordinateSystem(preserveAspectRatio=false, extent={{-100,-60},{80,80}})),
31+
experiment(
32+
Interval=0.0001,
33+
Tolerance=1e-06,
34+
__Dymola_Algorithm="Dassl"),
35+
conversion(noneFromVersion=""));
36+
end IEEEVC;
37+
end COMP;
Lines changed: 294 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,294 @@
1+
within OpenIPSL.Electrical.Controls.PSSE.ES;
2+
model AC7B
3+
extends OpenIPSL.Electrical.Controls.PSSE.ES.BaseClasses.BaseExciter;
4+
import OpenIPSL.Electrical.Controls.PSSE.ES.BaseClasses.invFEX;
5+
import OpenIPSL.NonElectrical.Functions.SE;
6+
parameter Real T_R "Filter time constant (s)";
7+
parameter Real K_PR "Voltage regulator proportional gain (pu)";
8+
parameter Real K_IR "Voltage regulator integral gain (pu)";
9+
parameter Real K_DR "Voltage regulator derivative gain (pu)";
10+
parameter Real T_DR "Lag time constant (s)";
11+
parameter Real V_RMIN "Minimum voltage regulator output (pu)";
12+
parameter Real V_RMAX "Maximum voltage regulator output (pu)";
13+
parameter Real K_PA "Voltage regulator proportional gain (pu)";
14+
parameter Real K_IA "Voltage regulator integral gain(pu)";
15+
parameter Real VA_MIN "Minimum voltage regulator output (pu)";
16+
parameter Real VA_MAX "Maximum voltage regulator output (pu)";
17+
parameter Real K_P "Potential circuit gain coefficient (pu)";
18+
parameter Real K_L "Exciter field voltage lower limit parameter (pu)";
19+
parameter Real T_E "Exciter time constant, integration rate associated with exciter
20+
control (s)";
21+
parameter Real K_C "Rectifier loading factor proportional to commutating reactance(pu)";
22+
parameter Real K_D "Demagnetizing factor, a function of exciter alternator
23+
reactances(pu)";
24+
parameter Real K_E "Exciter constant related to self-excited field(pu)";
25+
parameter Real K_F1 "Excitation control system stabilizer gain(pu)";
26+
parameter Real K_F2 "Excitation control system stabilizer gain(pu)";
27+
parameter Real K_F3 "Excitation control system stabilizer gain(pu)";
28+
parameter Real T_F3 "Excitation control system stabilizer time constant (s)";
29+
parameter Real VE_MIN "Minimum exciter voltage output(pu)";
30+
parameter Real VFEMAX "Exciter field current limit reference(pu)";
31+
parameter Real E_1 "Exciter alternator output voltages back of commutating
32+
reactance at which saturation is defined (pu)";
33+
parameter Real S_EE_1 "Exciter saturation function value at the corresponding exciter
34+
voltage, E1, back of commutating reactance (pu)";
35+
parameter Real E_2 "Exciter alternator output voltages back of commutating
36+
reactance at which saturation is defined (pu)";
37+
parameter Real S_EE_2 "Exciter saturation function value at the corresponding exciter
38+
voltage, E2, back of commutating reactance(pu)";
39+
40+
Modelica.Blocks.Continuous.Derivative imDerivativeLag(
41+
k=K_F3,
42+
T=T_F3,
43+
y_start=0,
44+
initType=Modelica.Blocks.Types.Init.InitialOutput)
45+
annotation (Placement(transformation(extent={{-54,-114},{-74,-94}})));
46+
Modelica.Blocks.Math.Add3 add3_2
47+
annotation (Placement(transformation(extent={{-114,36},{-94,56}})));
48+
OpenIPSL.NonElectrical.Continuous.SimpleLag
49+
TransducerDelay(
50+
K=1,
51+
T=T_R,
52+
y_start=ECOMP0)
53+
annotation (Placement(transformation(extent={{-168,-10},{-148,10}})));
54+
Modelica.Blocks.Math.Add add1(k2=-1)
55+
annotation (Placement(transformation(extent={{20,100},{40,120}})));
56+
Modelica.Blocks.Math.Add add annotation (Placement(transformation(
57+
extent={{-10,-10},{10,10}},
58+
rotation=90,
59+
origin={-6,46})));
60+
Modelica.Blocks.Math.Gain gain1(k=K_F2) annotation (Placement(
61+
transformation(
62+
extent={{-10,-10},{10,10}},
63+
rotation=90,
64+
origin={16,-44})));
65+
Modelica.Blocks.Math.Gain gain2(k=K_F1) annotation (Placement(
66+
transformation(
67+
extent={{-10,-10},{10,10}},
68+
rotation=90,
69+
origin={-6,-70})));
70+
Modelica.Blocks.Math.Product product
71+
annotation (Placement(transformation(extent={{174,100},{194,120}})));
72+
Modelica.Blocks.Math.Gain gain4(k=K_P)
73+
annotation (Placement(transformation(extent={{106,130},{126,150}})));
74+
OpenIPSL.Electrical.Controls.PSSE.ES.BaseClasses.RotatingExciterWithDemagnetizationVarLim
75+
rotatingExciterWithDemagnetizationVarLim(
76+
T_E=T_E,
77+
K_E=K_E,
78+
E_1=E_1,
79+
E_2=E_2,
80+
S_EE_1=S_EE_1,
81+
S_EE_2=S_EE_2,
82+
Efd0=VE0,
83+
K_D=K_D,
84+
EFD(start=VE0),
85+
outMax(start=max_lim0))
86+
annotation (Placement(transformation(extent={{52,-50},{82,-20}})));
87+
Modelica.Blocks.Sources.Constant lowLim(k=VE_MIN)
88+
annotation (Placement(transformation(extent={{116,-16},{96,4}})));
89+
Modelica.Blocks.Sources.Constant FEMAX(k=VFEMAX)
90+
annotation (Placement(transformation(extent={{-74,-24},{-54,-4}})));
91+
Modelica.Blocks.Math.Add DiffV2(k2=-1)
92+
annotation (Placement(transformation(extent={{-38,-34},{-18,-14}})));
93+
OpenIPSL.NonElectrical.Functions.ImSE
94+
se1(
95+
SE1=S_EE_1,
96+
SE2=S_EE_2,
97+
E1=E_1,
98+
E2=E_2) annotation (Placement(transformation(
99+
extent={{-9,-6},{9,6}},
100+
rotation=180,
101+
origin={157,30})));
102+
Modelica.Blocks.Sources.Constant const(k=K_E)
103+
annotation (Placement(transformation(extent={{10,-10},{-10,10}},
104+
rotation=0,
105+
origin={162,0})));
106+
Modelica.Blocks.Math.Add DiffV3
107+
annotation (Placement(transformation(extent={{114,18},{94,38}})));
108+
Modelica.Blocks.Math.Division division annotation (Placement(transformation(
109+
extent={{-10,-10},{10,10}},
110+
rotation=270,
111+
origin={52,6})));
112+
Modelica.Blocks.Math.Gain gain5(k=K_D) annotation (Placement(
113+
transformation(
114+
extent={{-10,-10},{10,10}},
115+
rotation=90,
116+
origin={-28,-150})));
117+
Modelica.Blocks.Interfaces.RealInput VT annotation (Placement(transformation(
118+
extent={{-122,68},{-100,90}}), iconTransformation(extent={{-122,68},{-100,
119+
90}})));
120+
Modelica.Blocks.Math.Add add3(k2=-1)
121+
annotation (Placement(transformation(extent={{-10,-10},{10,10}},
122+
rotation=90,
123+
origin={-76,102})));
124+
NonElectrical.Continuous.PID_No_Windup_AC7B pID_No_Windup(
125+
K_IR=K_IR,
126+
K_DR=K_DR,
127+
T_DR=T_DR,
128+
V_RMAX=V_RMAX,
129+
V_RMIN=V_RMIN,
130+
K_PR=K_PR,
131+
VR0=VR0)
132+
annotation (Placement(transformation(extent={{-36,110},{-14,126}})));
133+
Modelica.Blocks.Nonlinear.VariableLimiter variableLimiter annotation (
134+
Placement(transformation(
135+
extent={{-10,10},{10,-10}},
136+
rotation=180,
137+
origin={120,64})));
138+
Modelica.Blocks.Sources.Constant Upper_Limit(k=Modelica.Constants.inf)
139+
annotation (Placement(transformation(
140+
extent={{-10,-10},{10,10}},
141+
rotation=180,
142+
origin={180,82})));
143+
Modelica.Blocks.Math.Gain gain(k=-K_L) annotation (Placement(transformation(
144+
extent={{-10,-10},{10,10}},
145+
rotation=180,
146+
origin={172,46})));
147+
OpenIPSL.Electrical.Controls.PSSE.ES.BaseClasses.RectifierCommutationVoltageDrop
148+
rectifierCommutationVoltageDrop(K_C=K_C)
149+
annotation (Placement(transformation(extent={{150,-68},{184,-34}})));
150+
151+
NonElectrical.Continuous.PI_No_Windup pI_No_Windup(
152+
K_P=K_PA,
153+
K_I=K_IA,
154+
V_RMAX=VA_MAX,
155+
V_RMIN=VA_MIN,
156+
y_start=VA0)
157+
annotation (Placement(transformation(extent={{78,100},{100,120}})));
158+
protected
159+
parameter Real VA0(fixed=false);
160+
parameter Real VR0(fixed=false);
161+
parameter Real VFE0(fixed=false);
162+
parameter Real Ifd0(fixed=false);
163+
parameter Real VE0(fixed=false);
164+
parameter Real VT0(fixed=false);
165+
parameter Real Efd0(fixed=false);
166+
parameter Real max_lim0(fixed=false);
167+
168+
initial equation
169+
// Finding initial value of excitation voltage, VE0, via going through conditions of FEX function
170+
VE0 = invFEX(
171+
K_C=K_C,
172+
Efd0=Efd0,
173+
Ifd0=Ifd0);
174+
// Case IN>0 not checked because it will be resolved in the next iteration
175+
VFE0 = VE0*(SE(
176+
VE0,
177+
S_EE_1,
178+
S_EE_2,
179+
E_1,
180+
E_2) + K_E) + Ifd0*K_D;
181+
VA0 = VFE0/(K_P*VT0);
182+
VR0 = Efd0*K_F1 + VFE0*K_F2;
183+
V_REF = ECOMP0;
184+
VT0 = VT;
185+
Ifd0 = XADIFD;
186+
max_lim0 = (VFEMAX - K_D*Ifd0)/(K_E + SE(VE0,S_EE_1,S_EE_2,E_1,E_2));
187+
188+
equation
189+
connect(DiffV.u2, TransducerDelay.y) annotation (Line(points={{-122,-6},{-134,
190+
-6},{-134,0},{-147,0}}, color={0,0,127}));
191+
connect(TransducerDelay.u, ECOMP)
192+
annotation (Line(points={{-170,0},{-200,0}}, color={0,0,127}));
193+
connect(gain1.y, add.u2)
194+
annotation (Line(points={{16,-33},{16,16},{0,16},{0,34}},
195+
color={0,0,127}));
196+
connect(add.y, add1.u2) annotation (Line(points={{-6,57},{-6,104},{18,104}},
197+
color={0,0,127}));
198+
connect(product.u1, gain4.y) annotation (Line(points={{172,116},{172,128},{127,
199+
128},{127,140}}, color={0,0,127}));
200+
connect(gain2.y, add.u1) annotation (Line(points={{-6,-59},{-6,-12},{-12,-12},
201+
{-12,34}}, color={0,0,127}));
202+
connect(FEMAX.y,DiffV2. u1) annotation (Line(points={{-53,-14},{-40,-14},{-40,
203+
-18}}, color={0,0,127}));
204+
connect(gain5.y, DiffV2.u2) annotation (Line(points={{-28,-139},{-28,-94},{-44,
205+
-94},{-44,-30},{-40,-30}},
206+
color={0,0,127}));
207+
connect(se1.VE_OUT, DiffV3.u1) annotation (Line(points={{147.46,30},{132,30},{
208+
132,34},{116,34}}, color={0,0,127}));
209+
connect(const.y, DiffV3.u2) annotation (Line(points={{151,0},{136,0},{136,22},
210+
{116,22}},color={0,0,127}));
211+
connect(DiffV2.y, division.u1) annotation (Line(points={{-17,-24},{22,-24},{22,
212+
46},{58,46},{58,18}},
213+
color={0,0,127}));
214+
connect(DiffV3.y, division.u2)
215+
annotation (Line(points={{93,28},{46,28},{46,18}}, color={0,0,127}));
216+
connect(rectifierCommutationVoltageDrop.V_EX,
217+
rotatingExciterWithDemagnetizationVarLim.EFD) annotation (Line(points={{148.3,
218+
-51},{146,-51},{146,-48},{138,-48},{138,-34},{118,-34},{118,-35},{83.875,
219+
-35}}, color={0,0,
220+
127}));
221+
connect(gain2.u, EFD) annotation (Line(points={{-6,-82},{196,-82},{196,0},{210,
222+
0}}, color={0,0,127}));
223+
connect(rotatingExciterWithDemagnetizationVarLim.V_FE, gain1.u) annotation (
224+
Line(points={{50.125,-44.375},{50.125,-52},{50,-52},{50,-60},{16,-60},{16,
225+
-56}}, color={0,0,127}));
226+
connect(VOTHSG, add3_2.u1) annotation (Line(points={{-200,90},{-124,90},{-124,
227+
54},{-116,54}}, color={0,0,127}));
228+
connect(VUEL, add3_2.u2) annotation (Line(points={{-130,-200},{-130,-78},{-128,
229+
-78},{-128,46},{-116,46}}, color={0,0,127}));
230+
connect(DiffV.y, add3_2.u3) annotation (Line(points={{-99,0},{-94,0},{-94,22},
231+
{-124,22},{-124,38},{-116,38}}, color={0,0,127}));
232+
connect(add3_2.y, add3.u1) annotation (Line(points={{-93,46},{-82,46},{-82,90}},
233+
color={0,0,127}));
234+
connect(imDerivativeLag.y, add3.u2) annotation (Line(points={{-75,-104},{-82,-104},
235+
{-82,10},{-70,10},{-70,90}},
236+
color={0,0,127}));
237+
connect(add3.y, pID_No_Windup.u)
238+
annotation (Line(points={{-76,113},{-76,120},{-38,120}}, color={0,0,127}));
239+
connect(VT, gain4.u) annotation (Line(points={{-111,79},{-96,79},{-96,140},{104,
240+
140}}, color={0,0,127}));
241+
connect(gain.u, rotatingExciterWithDemagnetizationVarLim.V_FE) annotation (
242+
Line(points={{184,46},{190,46},{190,18},{126,18},{126,-60},{50.125,-60},{50.125,
243+
-44.375}}, color={0,0,127}));
244+
connect(product.y, variableLimiter.u) annotation (Line(points={{195,110},{198,
245+
110},{198,64},{132,64}}, color={0,0,127}));
246+
connect(pID_No_Windup.y, add1.u1) annotation (Line(points={{-13,120},{6,120},
247+
{6,116},{18,116}}, color={0,0,127}));
248+
connect(imDerivativeLag.u, gain1.u) annotation (Line(points={{-52,-104},{50,-104},
249+
{50,-60},{16,-60},{16,-56}}, color={0,0,127}));
250+
connect(Upper_Limit.y, variableLimiter.limit1) annotation (Line(points={{169,82},
251+
{152,82},{152,72},{132,72}}, color={0,0,127}));
252+
connect(gain.y, variableLimiter.limit2) annotation (Line(points={{161,46},{152,
253+
46},{152,56},{132,56}}, color={0,0,127}));
254+
connect(se1.VE_IN, rotatingExciterWithDemagnetizationVarLim.EFD) annotation (
255+
Line(points={{166.9,30},{182,30},{182,-20},{138,-20},{138,-34},{118,-34},{
256+
118,-35},{83.875,-35}}, color={0,0,127}));
257+
connect(lowLim.y, rotatingExciterWithDemagnetizationVarLim.outMin)
258+
annotation (Line(points={{95,-6},{92,-6},{92,-23.75},{83.875,-23.75}},
259+
color={0,0,127}));
260+
connect(division.y, rotatingExciterWithDemagnetizationVarLim.outMax)
261+
annotation (Line(points={{52,-5},{52,-14},{50.125,-14},{50.125,-23.75}},
262+
color={0,0,127}));
263+
connect(rectifierCommutationVoltageDrop.EFD, EFD) annotation (Line(points={{185.7,
264+
-51},{196,-51},{196,0},{210,0}}, color={0,0,127}));
265+
connect(gain5.u, XADIFD) annotation (Line(points={{-28,-162},{-28,-172},{80,
266+
-172},{80,-200}}, color={0,0,127}));
267+
connect(rotatingExciterWithDemagnetizationVarLim.XADIFD, XADIFD) annotation (
268+
Line(points={{67,-51.875},{67,-146},{80,-146},{80,-200}}, color={0,0,127}));
269+
connect(rectifierCommutationVoltageDrop.XADIFD, XADIFD) annotation (Line(
270+
points={{167,-69.7},{167,-172},{80,-172},{80,-200}}, color={0,0,127}));
271+
connect(variableLimiter.y, rotatingExciterWithDemagnetizationVarLim.I_C)
272+
annotation (Line(points={{109,64},{68,64},{68,60},{32,60},{32,-35},{50.125,
273+
-35}}, color={0,0,127}));
274+
connect(pI_No_Windup.y, product.u2) annotation (Line(points={{101,110},{164,
275+
110},{164,104},{172,104}}, color={0,0,127}));
276+
connect(add1.y, pI_No_Windup.u)
277+
annotation (Line(points={{41,110},{78,110}}, color={0,0,127}));
278+
annotation (Diagram(coordinateSystem(extent={{-200,-200},{200,160}})),
279+
Icon(coordinateSystem(extent={{-200,-200},{200,160}}), graphics={
280+
Text(
281+
extent={{-96,-60},{-26,-80}},
282+
lineColor={28,108,200},
283+
textString="
284+
285+
"), Text(
286+
extent={{-104,90},{-22,70}},
287+
lineColor={28,108,200},
288+
textString="ETERM"),
289+
Text(
290+
extent={{-16,80},{86,46}},
291+
textColor={28,108,200},
292+
textString="AC7B")}),
293+
conversion(noneFromVersion=""));
294+
end AC7B;

0 commit comments

Comments
 (0)