From f1eb73a8e42ce4ac11515f302d2a65f0fda3652f Mon Sep 17 00:00:00 2001 From: FredericSabot Date: Fri, 18 Oct 2024 11:26:53 +0200 Subject: [PATCH] #32 Try to improve numerical stability of GFM controls with an output time delay Signed-off-by: FredericSabot --- .../Converters/BaseControls/CurrentLoop.mo | 17 +++++++++++++---- .../GridFormingControlDroopControl.mo | 3 ++- .../Converters/GridFormingControl_INIT.mo | 4 ++-- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/dynawo/sources/Models/Modelica/Dynawo/Electrical/Controls/Converters/BaseControls/CurrentLoop.mo b/dynawo/sources/Models/Modelica/Dynawo/Electrical/Controls/Converters/BaseControls/CurrentLoop.mo index 0d72c27484e..205468191ac 100644 --- a/dynawo/sources/Models/Modelica/Dynawo/Electrical/Controls/Converters/BaseControls/CurrentLoop.mo +++ b/dynawo/sources/Models/Modelica/Dynawo/Electrical/Controls/Converters/BaseControls/CurrentLoop.mo @@ -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)"; @@ -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( @@ -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( @@ -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})), diff --git a/dynawo/sources/Models/Modelica/Dynawo/Electrical/Controls/Converters/GridFormingControlDroopControl.mo b/dynawo/sources/Models/Modelica/Dynawo/Electrical/Controls/Converters/GridFormingControlDroopControl.mo index 213a357a1e3..46ae2e276d9 100644 --- a/dynawo/sources/Models/Modelica/Dynawo/Electrical/Controls/Converters/GridFormingControlDroopControl.mo +++ b/dynawo/sources/Models/Modelica/Dynawo/Electrical/Controls/Converters/GridFormingControlDroopControl.mo @@ -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))); @@ -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))); diff --git a/dynawo/sources/Models/Modelica/Dynawo/Electrical/Controls/Converters/GridFormingControl_INIT.mo b/dynawo/sources/Models/Modelica/Dynawo/Electrical/Controls/Converters/GridFormingControl_INIT.mo index 3b19f3fc0c8..518298d53ae 100644 --- a/dynawo/sources/Models/Modelica/Dynawo/Electrical/Controls/Converters/GridFormingControl_INIT.mo +++ b/dynawo/sources/Models/Modelica/Dynawo/Electrical/Controls/Converters/GridFormingControl_INIT.mo @@ -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;