Skip to content

Commit

Permalink
Merge pull request #216 from dietmarw/fixWind
Browse files Browse the repository at this point in the history
Fix wind models
  • Loading branch information
dietmarw committed Oct 13, 2020
2 parents d66f6c5 + ebf0dfe commit 1e2e64a
Show file tree
Hide file tree
Showing 14 changed files with 588 additions and 530 deletions.
4 changes: 2 additions & 2 deletions OpenIPSL/Electrical/Machines/PSSE/BaseClasses/baseMachine.mo
Expand Up @@ -23,7 +23,7 @@ partial model baseMachine
annotation (Dialog(group="Machine parameters"));
parameter SI.Time Tppd0 "d-axis sub-transient open-circuit time constant"
annotation (Dialog(group="Machine parameters"));
parameter SI.Time Tppq0 "q-axis transient open-circuit time constant"
parameter SI.Time Tppq0 "q-axis sub-transient open-circuit time constant"
annotation (Dialog(group="Machine parameters"));
parameter SI.Time H "Inertia constant"
annotation (Dialog(group="Machine parameters"));
Expand All @@ -45,7 +45,7 @@ partial model baseMachine
annotation (Dialog(group="Machine parameters"));
parameter SI.PerUnit S12 "Saturation factor at 1.2 pu"
annotation (Dialog(group="Machine parameters"));
parameter SI.PerUnit R_a=0 "Amature resistance"
parameter SI.PerUnit R_a=0 "Armature resistance"
annotation (Dialog(group="Machine parameters"));
//Initialization
OpenIPSL.Interfaces.PwPin p(
Expand Down
60 changes: 30 additions & 30 deletions OpenIPSL/Electrical/Wind/PSSE/Submodels/CCL.mo
@@ -1,10 +1,10 @@
within OpenIPSL.Electrical.Wind.PSSE.Submodels;
model CCL
parameter Real Qmax;
parameter SI.PerUnit Qmax;
parameter Boolean pqflag;
parameter Real ImaxTD "Converter current limit";
parameter Real Iphl "Hard active current limit";
parameter Real Iqhl "Hard reactive current limit";
parameter SI.PerUnit ImaxTD "Converter current limit";
parameter SI.PerUnit Iphl "Hard active current limit";
parameter SI.PerUnit Iqhl "Hard reactive current limit";
Modelica.Blocks.Interfaces.RealOutput IQmin annotation (Placement(
transformation(
extent={{-10,-10},{10,10}},
Expand Down Expand Up @@ -78,22 +78,32 @@ model CCL
Modelica.Blocks.Math.Gain gain1(k=-1) annotation (Placement(transformation(
extent={{-5,-5},{5,5}},
rotation=90,
origin={75,47})));
origin={45,51})));
Modelica.Blocks.Interfaces.RealInput Vt annotation (Placement(transformation(
extent={{-20,-20},{20,20}},
rotation=270,
origin={0,78}), iconTransformation(
extent={{-10,-10},{10,10}},
origin={-100,0})));
protected
Modelica.Blocks.Sources.Constant const3(k=ImaxTD)
annotation (Placement(
transformation(
extent={{7,-7},{-7,7}},
origin={-43,-17})));
Modelica.Blocks.Sources.Constant const4(k=ImaxTD)
annotation (Placement(
transformation(
extent={{-7,-7},{7,7}},
origin={31,-17})));
protected
Modelica.Blocks.Interfaces.RealInput Iqmax annotation (Placement(
transformation(
extent={{-20,-20},{20,20}},
rotation=270,
origin={0,40}), iconTransformation(
extent={{-9,-9},{9,9}},
origin={-101,5})));
protected
protected
Modelica.Blocks.Interfaces.RealOutput IQmin1 annotation (Placement(
transformation(
extent={{-10,-10},{10,10}},
Expand Down Expand Up @@ -146,7 +156,7 @@ protected
"sqrt(ImaxTD^2 - IpCMD^2)" annotation (Placement(transformation(
extent={{-16,-16},{16,16}},
rotation=180,
origin={76,-18}), iconTransformation(
origin={76,-14}), iconTransformation(
extent={{-9,-9},{9,9}},
rotation=90,
origin={55,-35})));
Expand All @@ -157,7 +167,7 @@ protected
extent={{-9,-9},{9,9}},
rotation=90,
origin={55,-35})));
equation
equation
Available_remain1 = sqrt(ImaxTD^2 - IpCMD^2);
Available_remain2 = sqrt(ImaxTD^2 - IqCMD^2);
Iqmax = (Qmax - 1.6)*(Vt - 1) + Qmax;
Expand Down Expand Up @@ -202,10 +212,6 @@ equation
points={{44,-44.6},{44,-68}},
color={0,0,127},
smooth=Smooth.None));
connect(min4.y, IQmin1) annotation (Line(
points={{44,12.6},{44,80}},
color={0,0,127},
smooth=Smooth.None));
connect(gain.u, min2.y) annotation (Line(
points={{-83,45},{-83,14.6},{-54,14.6}},
color={0,0,127},
Expand All @@ -214,34 +220,28 @@ equation
points={{-83,56.5},{-83,65.25},{-82,65.25},{-82,80}},
color={0,0,127},
smooth=Smooth.None));
connect(gain1.y, IQmax1) annotation (Line(
points={{75,52.5},{75,61.25},{74,61.25},{74,80}},
color={0,0,127},
smooth=Smooth.None));
connect(gain1.u, min4.y) annotation (Line(
points={{75,41},{75,12.6},{44,12.6}},
points={{45,45},{45,12.6},{44,12.6}},
color={0,0,127},
smooth=Smooth.None));
connect(Iqmax, min5.u2) annotation (Line(
points={{0,40},{0,15.2},{-0.4,15.2}},
color={0,0,127},
smooth=Smooth.None));
connect(min4.u1, Available_remain1) annotation (Line(
points={{47.6,-1.2},{47.6,-18},{76,-18}},
color={0,0,127},
smooth=Smooth.None));
connect(min3.u2, Available_remain1) annotation (Line(
points={{47.6,-30.8},{47.6,-18},{76,-18}},
color={0,0,127},
smooth=Smooth.None));
connect(Available_remain2, min2.u2) annotation (Line(
points={{-90,-20},{-57.6,-20},{-57.6,0.8}},
color={0,0,127},
smooth=Smooth.None));
connect(min1.u1, Available_remain2) annotation (Line(
points={{-55.6,-30.8},{-55.6,-20},{-90,-20}},
color={0,0,127},
smooth=Smooth.None));
connect(const3.y, min2.u2) annotation (Line(points={{-50.7,-17},{-57.6,-17},{-57.6,
0.8}}, color={0,0,127}));
connect(const4.y, min3.u2) annotation (Line(points={{38.7,-17},{47.6,-17},{47.6,
-30.8}}, color={0,0,127}));
connect(Available_remain1, min4.u1) annotation (Line(points={{76,-14},{47.6,-14},
{47.6,-1.2}}, color={0,0,127}));
connect(gain1.y, IQmin1)
annotation (Line(points={{45,56.5},{45,80},{44,80}}, color={0,0,127}));
connect(IQmax1, min4.y) annotation (Line(points={{74,80},{74,18},{45,18},{45,12.6},
{44,12.6}}, color={0,0,127}));
annotation (
Icon(coordinateSystem(preserveAspectRatio=true, extent={{-100,-100},{100,
100}}), graphics={Rectangle(
Expand Down
4 changes: 2 additions & 2 deletions OpenIPSL/Electrical/Wind/PSSE/Submodels/HVRCL.mo
@@ -1,8 +1,8 @@
within OpenIPSL.Electrical.Wind.PSSE.Submodels;
model HVRCL
//The 'High Voltage Reactive Current Management' block limits the reactive current injected into the network equations such that the terminal voltage of the machine never exceeds Volim of nominal, as long as the converter is within current limits."
parameter Real VHVRCR "Threthod voltage for HVRCL";
parameter Real CurHVRCR "Max. reactive current at VHVRCR";
parameter SI.PerUnit VHVRCR "Threshold voltage for HVRCL";
parameter SI.PerUnit CurHVRCR "Max. reactive current at VHVRCR";
Modelica.Blocks.Interfaces.RealInput Vt annotation (Placement(transformation(
extent={{-9,-9},{9,9}},
rotation=90,
Expand Down
4 changes: 2 additions & 2 deletions OpenIPSL/Electrical/Wind/PSSE/Submodels/LVPL.mo
@@ -1,7 +1,7 @@
within OpenIPSL.Electrical.Wind.PSSE.Submodels;
model LVPL "Low voltage power logic"
parameter Real VLVPL1 "LVPL voltage 1 (Low voltage power logic)";
parameter Real VLVPL2 "LVPL voltage 2";
parameter SI.PerUnit VLVPL1 "LVPL voltage 1 (Low voltage power logic)";
parameter SI.PerUnit VLVPL2 "LVPL voltage 2";
parameter Real GLVPL "LVPL gain";
parameter Real K=GLVPL/(VLVPL2 - VLVPL1);
Modelica.Blocks.Interfaces.RealInput Vt annotation (Placement(transformation(
Expand Down
146 changes: 71 additions & 75 deletions OpenIPSL/Electrical/Wind/PSSE/WT3G/WT3E1.mo
Expand Up @@ -12,42 +12,41 @@ model WT3E1
choice=0 "Disable terminal voltage control",
choice=1 "Enable terminal voltage control ",
choice=2 "Fixed limits for Eqcmd"));
parameter Real Tfv=0.15000 "Filter time constant in voltage regulator (sec)";
parameter Real Kpv=18.000 " Proportional gain in voltage regulator (pu)";
parameter Real KIV=5.0000 " Integrator gain in voltage regulator (pu)";
parameter Real Xc=0.0000 " Line drop compensation reactance (pu)";
parameter Real TFP=0.50000E-01 " Filter time constant in torque regulator";
parameter Real Kpp=3.0000 " Proportional gain in torque regulator (pu) ";
parameter Real KIP=0.60000 " Integrator gain in torque regulator (pu)";
parameter Real PMX=1.1200 " Max limit in torque regulator (pu)";
parameter Real PMN=0.10000 " Min limit in torque regulator (pu)";
parameter Real QMX=0.29600 " Max limit in voltage regulator (pu)";
parameter Real QMN=-0.43600 " Min limit in voltage regulator (pu)";
parameter Real IPMAX=1.1000 " Max active current limit";
parameter Real TRV=0.50000E-01 " Voltage sensor time constant";
parameter Real RPMX=0.45000 " Max power order derivative";
parameter Real RPMN=-0.45000 " Min power order derivative";
parameter Real T_Power=5.0000 " Power filter time constant";
parameter Real Kqi=0.50000E-01 " MVAR/Voltage gain";
parameter Real VMINCL=0.90000 " Min voltage limit";
parameter Real VMAXCL=1.2000 " Max voltage limit";
parameter Real Kqv=40.000 " Voltage/MVAR gain";
parameter Real XIQmin=-0.50000;
parameter Real XIQmax=0.40000;
parameter Real Tv=0.50000E-01 " Lag time constant in WindVar controller";
parameter Real Tp=0.50000E-01 " Pelec filter in fast PF controller";
parameter Real Fn=1.0000 " A portion of online wind turbines";
parameter Real wPmin=0.69000 " Shaft speed at Pmin (pu)";
parameter Real wP20=0.78000 " Shaft speed at 20% rated power (pu) ";
parameter Real wP40=0.98000 " Shaft speed at 40% rated power (pu)";
parameter Real wP60=1.1200 " Shaft speed at 60% rated power (pu)";
parameter Real Pmin=0.74000
" Minimum power for operating at P100 speed (pu)";
parameter Real wP100=1.2000 " Shaft speed at 100% rated power (pu)";
parameter Real Vref " Remote bus ref voltage";
parameter Real v0;
parameter Real p0;
parameter Real q0;
parameter SI.Time Tfv=0.15000 "Filter time constant in voltage regulator";
parameter SI.PerUnit Kpv=18.000 "Proportional gain in voltage regulator";
parameter SI.TimeAging KIV=5.0000 "Integrator gain in voltage regulator";
parameter SI.PerUnit Xc=0.0000 "Line drop compensation reactance";
parameter SI.Time TFP=0.50000E-01 "Filter time constant in torque regulator";
parameter SI.PerUnit Kpp=3.0000 "Proportional gain in torque regulator";
parameter SI.TimeAging KIP=0.60000 "Integrator gain in torque regulator";
parameter SI.PerUnit PMX=1.1200 "Max limit in torque regulator";
parameter SI.PerUnit PMN=0.10000 "Min limit in torque regulator";
parameter SI.PerUnit QMX=0.29600 "Max limit in voltage regulator";
parameter SI.PerUnit QMN=-0.43600 "Min limit in voltage regulator";
parameter SI.PerUnit IPMAX=1.1000 "Max active current limit";
parameter SI.Time TRV=0.50000E-01 "Voltage sensor time constant";
parameter SI.PerUnit RPMX=0.45000 "Max power order derivative";
parameter SI.PerUnit RPMN=-0.45000 "Min power order derivative";
parameter SI.Time T_Power=5.0000 "Power filter time constant";
parameter SI.PerUnit Kqi=0.50000E-01 "MVAR/Voltage gain";
parameter SI.PerUnit VMINCL=0.90000 "Min voltage limit";
parameter SI.PerUnit VMAXCL=1.2000 "Max voltage limit";
parameter SI.PerUnit Kqv=40.000 "Voltage/MVAR gain";
parameter SI.PerUnit XIQmin=-0.50000;
parameter SI.PerUnit XIQmax=0.40000;
parameter SI.Time Tv=0.50000E-01 "Lag time constant in WindVar controller";
parameter SI.Time Tp=0.50000E-01 "Pelec filter in fast PF controller";
parameter Real Fn=1.0000 "A portion of online wind turbines";
parameter SI.PerUnit wPmin=0.69000 "Shaft speed at Pmin";
parameter SI.PerUnit wP20=0.78000 "Shaft speed at 20% rated power";
parameter SI.PerUnit wP40=0.98000 "Shaft speed at 40% rated power";
parameter SI.PerUnit wP60=1.1200 "Shaft speed at 60% rated power";
parameter SI.PerUnit Pmin=0.74000 "Minimum power for operating at P100 speed";
parameter SI.PerUnit wP100=1.2000 "Shaft speed at 100% rated power";
parameter SI.PerUnit Vref "Remote bus ref voltage";
parameter SI.PerUnit v0;
parameter SI.PerUnit p0;
parameter SI.PerUnit q0;
Modelica.Blocks.Interfaces.RealInput PELEC annotation (Placement(
transformation(extent={{-210,30},{-190,50}}), iconTransformation(
extent={{10,-10},{-10,10}},
Expand Down Expand Up @@ -96,7 +95,7 @@ model WT3E1
outMax=1 + XIQmax,
outMin=XIQmin - 1)
annotation (Placement(transformation(extent={{138,30},{158,50}})));
Modelica.Blocks.Interfaces.RealInput ITERM "magenitute of terminal current"
Modelica.Blocks.Interfaces.RealInput ITERM "magnitude of terminal current"
annotation (Placement(transformation(extent={{-210,88},{-190,108}}),
iconTransformation(
extent={{10,-10},{-10,10}},
Expand Down Expand Up @@ -186,13 +185,13 @@ protected
function Speed
extends Modelica.Icons.Function;
input Real x;
input Real PMN " Min limit in torque regulator (pu)";
input SI.PerUnit PMN "Min limit in torque regulator";
input Real wmin;
input Real w20;
input Real w40;
input Real w60;
input Real w100;
input Real Pmin " Minimum power for operating at wP100 speed (pu)";
input SI.PerUnit Pmin "Minimum power for operating at wP100 speed";
output Real y;
protected
parameter Real K1=(w20 - wmin)/(0.2 - PMN);
Expand Down Expand Up @@ -284,10 +283,10 @@ protected
y_start=p0,
T=Tp)
annotation (Placement(transformation(extent={{-120,-10},{-100,10}})));
parameter Real Tp=0.50000E-01 " Pelec filter in fast PF controller";
parameter SI.Time Tp=0.50000E-01 " Pelec filter in fast PF controller";
parameter Real PFA_ref=atan2(q0, p0) "PF angle reference if PFAFLG=1";
parameter Real p0;
parameter Real q0;
parameter SI.PerUnit p0;
parameter SI.PerUnit q0;
Modelica.Blocks.Interfaces.RealInput u annotation (Placement(transformation(
extent={{-214,-10},{-194,10}})));
Modelica.Blocks.Interfaces.RealOutput Q_REF_PF
Expand Down Expand Up @@ -382,22 +381,21 @@ protected
Modelica.Blocks.Interfaces.RealInput WNDSP_1
annotation (Placement(transformation(extent={{-210,-70},{-190,-50}})));
public
parameter Real TFP=0.50000E-01 " Filter time constant in torque regulator";
parameter Real Kpp=3.0000 " Proportional gain in torque regulator (pu) ";
parameter Real KIP=0.60000 " Integrator gain in torque regulator (pu)";
parameter Real PMX=1.1200 " Max limit in torque regulator (pu)";
parameter Real PMN=0.10000 " Min limit in torque regulator (pu)";
parameter Real IPMAX=1.1000 " Max active current limit";
parameter Real RPMX=0.45000 " Max power order derivative";
parameter Real RPMN=-0.45000 " Min power order derivative";
parameter Real T_Power=5.0000 " Power filter time constant";
parameter Real wPmin=0.69000 " Shaft speed at Pmin (pu)";
parameter Real wP20=0.78000 " Shaft speed at 20% rated power (pu) ";
parameter Real wP40=0.98000 " Shaft speed at 40% rated power (pu)";
parameter Real wP60=1.1200 " Shaft speed at 60% rated power (pu)";
parameter Real Pmin=0.74000
" Minimum power for operating at P100 speed (pu)";
parameter Real wP100=1.2000 " Shaft speed at 100% rated power (pu)";
parameter SI.Time TFP=0.50000E-01 "Filter time constant in torque regulator";
parameter SI.PerUnit Kpp=3.0000 "Proportional gain in torque regulator";
parameter SI.TimeAging KIP=0.60000 "Integrator gain in torque regulator";
parameter SI.PerUnit PMX=1.1200 "Max limit in torque regulator";
parameter SI.PerUnit PMN=0.10000 "Min limit in torque regulator";
parameter SI.PerUnit IPMAX=1.1000 "Max active current limit";
parameter SI.PerUnit RPMX=0.45000 "Max power order derivative";
parameter SI.PerUnit RPMN=-0.45000 "Min power order derivative";
parameter SI.Time T_Power=5.0000 "Power filter time constant";
parameter SI.PerUnit wPmin=0.69000 "Shaft speed at Pmin";
parameter SI.PerUnit wP20=0.78000 "Shaft speed at 20% rated power";
parameter SI.PerUnit wP40=0.98000 "Shaft speed at 40% rated power";
parameter SI.PerUnit wP60=1.1200 "Shaft speed at 60% rated power";
parameter SI.PerUnit Pmin=0.74000 "Minimum power for operating at P100 speed";
parameter SI.PerUnit wP100=1.2000 "Shaft speed at 100% rated power";
parameter Real k20;
parameter Real k30;
parameter Real k50;
Expand Down Expand Up @@ -513,14 +511,13 @@ protected
T=Tfv,
y_start=k0)
annotation (Placement(transformation(extent={{160,-10},{180,10}})));
Modelica.Blocks.Math.Gain XC(k=Xc) "Line drop compensation reactance (pu)"
Modelica.Blocks.Math.Gain XC(k=Xc) "Line drop compensation reactance"
annotation (Placement(transformation(extent={{-180,-30},{-160,-10}})));
Modelica.Blocks.Math.Add add3(k2=-1)
annotation (Placement(transformation(extent={{-48,-10},{-28,10}})));
Modelica.Blocks.Sources.Constant VARL(k=Vref)
annotation (Placement(transformation(extent={{-98,40},{-78,60}})));
Modelica.Blocks.Math.Gain portion(k=1/Fn)
"Line drop compensation reactance (pu)"
annotation (Placement(transformation(extent={{-18,-10},{2,10}})));
NonElectrical.Continuous.SimpleLag K1(
y_start=k10,
Expand All @@ -536,21 +533,20 @@ protected
T=Tv,
y_start=k80,
K=1) annotation (Placement(transformation(extent={{22,20},{42,40}})));
parameter Real Tfv=0.15000
"Filter time constant in voltage regulator (sec)";
parameter Real Kpv=18.000 " Proportional gain in voltage regulator (pu)";
parameter Real KIV=5.0000 " Integrator gain in voltage regulator (pu)";
parameter Real Xc=0.0000 " Line drop compensation reactance (pu)";
parameter Real QMX=0.29600 " Max limit in voltage regulator (pu)";
parameter Real QMN=-0.43600 " Min limit in voltage regulator (pu)";
parameter Real TRV=0.50000E-01 " Voltage sensor time constant";
parameter Real Tv=0.50000E-01 " Lag time constant in WindVar controller";
parameter Real Fn=1.0000 " A portion of online wind turbines";
parameter Real Vref " Remote bus ref voltage";
parameter Real k0;
parameter Real k10;
parameter Real k40;
parameter Real k80;
parameter SI.Time Tfv=0.15000 "Filter time constant in voltage regulator";
parameter SI.PerUnit Kpv=18.000 "Proportional gain in voltage regulator";
parameter SI.TimeAging KIV=5.0000 "Integrator gain in voltage regulator";
parameter SI.PerUnit Xc=0.0000 "Line drop compensation reactance";
parameter SI.PerUnit QMX=0.29600 "Max limit in voltage regulator";
parameter SI.PerUnit QMN=-0.43600 "Min limit in voltage regulator";
parameter SI.Time TRV=0.50000E-01 "Voltage sensor time constant";
parameter SI.Time Tv=0.50000E-01 "Lag time constant in WindVar controller";
parameter Real Fn=1.0000 "A portion of online wind turbines";
parameter SI.PerUnit Vref "Remote bus ref voltage";
parameter SI.PerUnit k0;
parameter SI.PerUnit k10;
parameter SI.PerUnit k40;
parameter SI.PerUnit k80;
Modelica.Blocks.Interfaces.RealInput ITERM annotation (Placement(
transformation(extent={{-210.5,-30},{-189.5,-10}}),
iconTransformation(extent={{-200,30},{-180,50}})));
Expand Down

0 comments on commit 1e2e64a

Please sign in to comment.