Skip to content

Commit

Permalink
dynawo#32 Try to improve numerical stability of GFM controls with an …
Browse files Browse the repository at this point in the history
…output time delay

Signed-off-by: FredericSabot <[email protected]>
  • Loading branch information
FredericSabot committed Oct 18, 2024
1 parent e427500 commit f1eb73a
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ model CurrentLoop "Current loop control for grid forming and grid following conv

parameter Types.PerUnit Kpc "Proportional gain of the current loop";
parameter Types.PerUnit Kic "Integral gain of the current loop";
parameter Types.Time Te "Output state time constant in s";
parameter Types.PerUnit LFilter "Filter inductance in pu (base UNom, SNom)";
parameter Types.PerUnit RFilter "Filter resistance in pu (base UNom, SNom)";

Expand Down Expand Up @@ -78,6 +79,10 @@ model CurrentLoop "Current loop control for grid forming and grid following conv
parameter Types.PerUnit IqConv0Pu "Start value of q-axis current in the converter in pu (base UNom, SNom) (generator convention)";
parameter Types.PerUnit UdConv0Pu "Start value of d-axis modulation voltage in pu (base UNom)";
parameter Types.PerUnit UqConv0Pu "Start value of q-axis modulation voltage in pu (base UNom)";
Modelica.Blocks.Continuous.FirstOrder firstOrderOutd(T = Te) annotation(
Placement(visible = true, transformation(origin = {120, 86}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Blocks.Continuous.FirstOrder firstOrderOutq(T = Te) annotation(
Placement(visible = true, transformation(origin = {120, -86}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));

equation
connect(feedbackd.u1, idConvRefPu) annotation(
Expand All @@ -102,12 +107,8 @@ equation
Line(points = {{-32, -80}, {-49, -80}}, color = {0, 0, 127}));
connect(feedbackLwd.u2, addq1.y) annotation(
Line(points = {{38, -86}, {-9, -86}}, color = {0, 0, 127}));
connect(addd2.y, udConvRefPu) annotation(
Line(points = {{101, 86}, {150, 86}}, color = {0, 0, 127}));
connect(addq2.u1, feedbackLwd.y) annotation(
Line(points = {{78, -80}, {61, -80}}, color = {0, 0, 127}));
connect(addq2.y, uqConvRefPu) annotation(
Line(points = {{101, -86}, {150, -86}}, color = {0, 0, 127}));
connect(idConvPu, product.u1) annotation(
Line(points = {{-150, 50}, {-120, 50}, {-120, 31}, {-102, 31}}, color = {0, 0, 127}));
connect(omegaPu, product.u2) annotation(
Expand Down Expand Up @@ -136,6 +137,14 @@ equation
Line(points = {{1, 25}, {10, 25}, {10, -74}, {38, -74}}, color = {0, 0, 127}));
connect(uqFilterPu, addq2.u2) annotation(
Line(points = {{-150, -130}, {70, -130}, {70, -92}, {78, -92}}, color = {0, 0, 127}));
connect(addd2.y, firstOrderOutd.u) annotation(
Line(points = {{101, 86}, {108, 86}}, color = {0, 0, 127}));
connect(firstOrderOutd.y, udConvRefPu) annotation(
Line(points = {{131, 86}, {150, 86}}, color = {0, 0, 127}));
connect(addq2.y, firstOrderOutq.u) annotation(
Line(points = {{101, -86}, {108, -86}}, color = {0, 0, 127}));
connect(firstOrderOutq.y, uqConvRefPu) annotation(
Line(points = {{131, -86}, {150, -86}}, color = {0, 0, 127}));

annotation(
Icon(coordinateSystem(grid = {1, 1})),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ model GridFormingControlDroopControl "Grid forming control with droop control"
parameter Types.PerUnit Kic "Integral gain of the current loop";
parameter Types.PerUnit LFilter "Filter inductance in pu (base UNom, SNom)";
parameter Types.PerUnit RFilter "Filter resistance in pu (base UNom, SNom)";
parameter Types.Time Te "Output state time constant in s";

Modelica.Blocks.Interfaces.RealInput idPccPu(start = IdPcc0Pu) "d-axis current at the PCC in pu (base UNom, SNom) (generator convention)" annotation(
Placement(visible = true, transformation(origin = {-130, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0), iconTransformation(origin = {60, 105}, extent = {{-5, -5}, {5, 5}}, rotation = -90)));
Expand Down Expand Up @@ -75,7 +76,7 @@ model GridFormingControlDroopControl "Grid forming control with droop control"
Modelica.Blocks.Interfaces.RealOutput omegaPu(start = SystemBase.omegaRef0Pu) "Converter's frequency in pu (base omegaNom)" annotation(
Placement(visible = true, transformation(origin = {130, 70}, extent = {{-10, -10}, {10, 10}}, rotation = 0), iconTransformation(origin = {105, -90}, extent = {{-5, -5}, {5, 5}}, rotation = 0)));

Dynawo.Electrical.Controls.Converters.BaseControls.CurrentLoop currentLoop(IdConv0Pu = IdConv0Pu, IqConv0Pu = IqConv0Pu, Kic = Kic, Kpc = Kpc, LFilter = LFilter, RFilter = RFilter, UdConv0Pu = UdConv0Pu, UdFilter0Pu = UdFilter0Pu, UqConv0Pu = UqConv0Pu, UqFilter0Pu = UqFilter0Pu) annotation(
Dynawo.Electrical.Controls.Converters.BaseControls.CurrentLoop currentLoop(IdConv0Pu = IdConv0Pu, IqConv0Pu = IqConv0Pu, Kic = Kic, Kpc = Kpc, LFilter = LFilter, RFilter = RFilter, UdConv0Pu = UdConv0Pu, UdFilter0Pu = UdFilter0Pu, UqConv0Pu = UqConv0Pu, UqFilter0Pu = UqFilter0Pu, Te = Te) annotation(
Placement(visible = true, transformation(origin = {80, 80}, extent = {{-20, -20}, {20, 20}}, rotation = 0)));
Dynawo.Electrical.Controls.Converters.BaseControls.VoltageLoop voltageLoop(CFilter = CFilter, IdConv0Pu = IdConv0Pu, IdPcc0Pu = IdPcc0Pu, IqConv0Pu = IqConv0Pu, IqPcc0Pu = IqPcc0Pu, Kiv = Kiv, Kpv = Kpv, UdFilter0Pu = UdFilter0Pu, UqFilter0Pu = UqFilter0Pu) annotation(
Placement(visible = true, transformation(origin = {20, 80}, extent = {{-20, -20}, {20, 20}}, rotation = 0)));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ model GridFormingControl_INIT "Initialization model for the grid forming control
equation
/* External loop */
PRef0Pu = PFilter0Pu;
UdFilter0Pu = UFilterRef0Pu - Kff*IdPcc0Pu - DeltaVVId0;
UdFilter0Pu = UFilterRef0Pu - Kff*IdPcc0Pu;
QRef0Pu = QFilter0Pu;
UqFilter0Pu = - Kff*IqPcc0Pu - DeltaVVIq0;
UqFilter0Pu = - Kff*IqPcc0Pu;

/* DC voltage control */
IdcSourceRef0Pu = IdcSource0Pu;
Expand Down

0 comments on commit f1eb73a

Please sign in to comment.