From dc5d2c01d178d70c3234896f160c2dfc914fae3b Mon Sep 17 00:00:00 2001 From: FredericSabot Date: Fri, 15 Mar 2024 15:47:09 +0100 Subject: [PATCH] #30 Add rate limiter to PLLfreeze Signed-off-by: FredericSabot --- .../Dynawo/Electrical/Controls/PLL/PLLFreeze.mo | 10 ++++++---- .../Electrical/InverterBasedGeneration/GenericIBG.mo | 4 ++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/dynawo/sources/Models/Modelica/Dynawo/Electrical/Controls/PLL/PLLFreeze.mo b/dynawo/sources/Models/Modelica/Dynawo/Electrical/Controls/PLL/PLLFreeze.mo index c3b1a906244..15f7f0a053c 100644 --- a/dynawo/sources/Models/Modelica/Dynawo/Electrical/Controls/PLL/PLLFreeze.mo +++ b/dynawo/sources/Models/Modelica/Dynawo/Electrical/Controls/PLL/PLLFreeze.mo @@ -52,7 +52,8 @@ model PLLFreeze "Phase-Locked Loop whose angle can be frozen" //Initial parameter parameter Types.ComplexVoltagePu u0Pu "Start value of complex voltage at PCC in pu (base UNom)"; - + Modelica.Blocks.Nonlinear.Limiter limiter(limitsAtInit = true, uMax = 0.5/SystemBase.omegaNom) annotation( + Placement(visible = true, transformation(origin = {116, 44}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); equation connect(add2.y, omegaPLLPu) annotation( Line(points = {{81, -84}, {170, -84}}, color = {0, 0, 127})); @@ -76,9 +77,10 @@ equation Line(points = {{80.5, -8}, {87.5, -8}}, color = {0, 0, 127})); connect(freeze, switch1.u2) annotation( Line(points = {{-150, -49}, {60, -49}, {60, 0}, {88, 0}}, color = {255, 0, 255})); - connect(switch1.y, integrator.u) annotation( - Line(points = {{111, 0}, {128, 0}}, color = {0, 0, 127})); - + connect(switch1.y, limiter.u) annotation( + Line(points = {{111, 0}, {104, 0}, {104, 44}}, color = {0, 0, 127})); + connect(limiter.y, integrator.u) annotation( + Line(points = {{127, 44}, {127, 22}, {128, 22}, {128, 0}}, color = {0, 0, 127})); annotation( preferredView = "diagram", Documentation(info = "

The PLL calculates the frequency of the grid voltage by synchronizing the internal phase angle with measured voltage phasor. q-component of internal voltage phasor is therefore controlled to be zero.

diff --git a/dynawo/sources/Models/Modelica/Dynawo/Electrical/InverterBasedGeneration/GenericIBG.mo b/dynawo/sources/Models/Modelica/Dynawo/Electrical/InverterBasedGeneration/GenericIBG.mo index 8c9a5c81725..7044580c731 100644 --- a/dynawo/sources/Models/Modelica/Dynawo/Electrical/InverterBasedGeneration/GenericIBG.mo +++ b/dynawo/sources/Models/Modelica/Dynawo/Electrical/InverterBasedGeneration/GenericIBG.mo @@ -108,7 +108,7 @@ model GenericIBG "Generic model of inverter-based generation (IBG)" Placement(visible = true, transformation(origin = {-90, -386}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); Dynawo.NonElectrical.Blocks.NonLinear.StandAloneRampRateLimiter iPSlewLimit(DuMax = IpSlewMaxPu, Y0 = Id0Pu, tS = tRateLim) annotation( Placement(visible = true, transformation(origin = {150, -160}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); - Dynawo.NonElectrical.Blocks.NonLinear.StandAloneRampRateLimiter iQSlewLimit(DuMax = IqSlewMaxPu, Y0 = Iq0Pu, tS = tRateLim) annotation( + Dynawo.NonElectrical.Blocks.NonLinear.StandAloneRampRateLimiter iQSlewLimit(DuMax = IqSlewMaxPu, Y0 = Iq0Pu, tS = tRateLim) annotation( Placement(visible = true, transformation(origin = {150, -280}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); Modelica.Blocks.Continuous.FirstOrder iPcmdFirstOrder(T = tG, y_start = Id0Pu) annotation( Placement(visible = true, transformation(origin = {110, -160}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); @@ -120,7 +120,7 @@ model GenericIBG "Generic model of inverter-based generation (IBG)" Placement(visible = true, transformation(origin = {77, -189}, extent = {{-3, -3}, {3, 3}}, rotation = -90))); Modelica.Blocks.Math.Feedback feedback annotation( Placement(visible = true, transformation(origin = {180, -160}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); - Modelica.Blocks.Continuous.Derivative derivative(T = tf, k = Kf, x_start = Id0Pu) annotation( + Modelica.Blocks.Continuous.Derivative derivative(T = tf, k = Kf, x_start = Id0Pu) annotation( Placement(visible = true, transformation(origin = {230, -160}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); // Initial values