Skip to content

Commit 3308d13

Browse files
committed
Updated the DPIM model once again. Now the model contains an integer that allows the user to choose between split phase and capacitor start motor models.
1 parent de149b1 commit 3308d13

1 file changed

Lines changed: 209 additions & 2 deletions

File tree

MicroGrid/Microgrid_Test.mo

Lines changed: 209 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6669,8 +6669,8 @@ import Buildings;
66696669
rotation=0,
66706670
origin={450,-60})));
66716671
ThermalPower.TwoPhase.Sensors.MassFlowRate massFlowRate(redeclare
6672-
package
6673-
Medium = Modelon.Media.PreDefined.TwoPhase.WaterIF97)
6672+
package Medium =
6673+
Modelon.Media.PreDefined.TwoPhase.WaterIF97)
66746674
annotation (Placement(transformation(extent={{322,66},{342,86}})));
66756675
replaceable
66766676
MicroGrid.Mechanical.ThermalFluid_Sources.Models.Gas_Turbines.ThermalPower_GasTurbine
@@ -11286,6 +11286,57 @@ The results can be verified against any tool that calculates a hybrid positive-s
1128611286
__Dymola_NumberOfIntervals=10000,
1128711287
__Dymola_Algorithm="Dassl"));
1128811288
end TwoPhase_example;
11289+
11290+
model TwoPhase_example_2
11291+
extends Modelica.Icons.Example;
11292+
11293+
OpenIPSL.Electrical.Buses.Bus bus(
11294+
V_b = 230)
11295+
annotation (Placement(transformation(extent={{-30,-10},{-10,10}})));
11296+
OpenIPSL.Electrical.Machines.PSSE.GENCLS gENCLS(
11297+
V_b = 230)
11298+
annotation (Placement(transformation(extent={{-60,-10},{-40,10}})));
11299+
OpenIPSL.Electrical.Buses.Bus bus1(
11300+
V_b = 230)
11301+
annotation (Placement(transformation(extent={{30,-10},{50,10}})));
11302+
OpenIPSL.Electrical.Branches.PwLine pwLine2(
11303+
G=0,
11304+
B=0,
11305+
R=2.50000E-3,
11306+
X=2.50000E-3)
11307+
annotation (Placement(transformation(extent={{0,-10},{20,10}})));
11308+
inner OpenIPSL.Electrical.SystemBase SysData(fn=60, S_b=100000000) annotation (Placement(transformation(extent={{48,72},
11309+
{88,92}})));
11310+
Electrical.MultiDomain.InductionMotor.SinglePhase.DPIM_correction dPIM_correction(
11311+
V_b=230,
11312+
init=2,
11313+
Lmainr=0.000588,
11314+
Lmain=0.0806,
11315+
Lauxr=0.000909,
11316+
Laux=0.196,
11317+
Lr=0.0000047,
11318+
Rmain=0.58,
11319+
Rr=0.0000376,
11320+
Raux=3.37,
11321+
Cc(displayUnit="F") = 0.001,
11322+
H=0.0001,
11323+
a=0.00001,
11324+
b=0,
11325+
c=0) annotation (Placement(transformation(extent={{60,-10},{80,10}})));
11326+
equation
11327+
connect(gENCLS.p, bus.p)
11328+
annotation (Line(points={{-40,0},{-20,0}}, color={0,0,255}));
11329+
connect(pwLine2.n, bus1.p)
11330+
annotation (Line(points={{19,0},{40,0}}, color={0,0,255}));
11331+
connect(bus.p, pwLine2.p)
11332+
annotation (Line(points={{-20,0},{1,0}}, color={0,0,255}));
11333+
connect(bus1.p, dPIM_correction.p)
11334+
annotation (Line(points={{40,0},{60,0}}, color={0,0,255}));
11335+
annotation ( experiment(
11336+
StopTime=10,
11337+
__Dymola_NumberOfIntervals=10000,
11338+
__Dymola_Algorithm="Dassl"));
11339+
end TwoPhase_example_2;
1128911340
end SinglePhaseInductionMotor;
1129011341

1129111342
package PowerElectronicsInterface
@@ -18347,6 +18398,162 @@ solution)" annotation (Placement(transformation(
1834718398
extent={{-56,-56},{55.932,56}})}), Diagram(
1834818399
coordinateSystem(preserveAspectRatio=false)));
1834918400
end DPIM;
18401+
18402+
model DPIM_correction
18403+
"This model is the steady-state circuit model of the single phase induction motor model initialized by a split-phase auxiliary circuit."
18404+
OpenIPSL.Interfaces.PwPin p
18405+
annotation (Placement(transformation(extent={{-110,-10},{-90,10}})));
18406+
18407+
extends OpenIPSL.Electrical.Essentials.pfComponent(
18408+
final enabledisplayPF=false,
18409+
final enablefn=false,
18410+
final enableV_b=false,
18411+
final enableangle_0=true,
18412+
final enablev_0=true,
18413+
final enableQ_0=true,
18414+
final enableP_0=true,
18415+
final enableS_b=true);
18416+
18417+
parameter Integer init "Initialization Method: (1) Split-Phase Motor, (2) Capacitor-Start Motor" annotation (choices(choice=1, choice=2));
18418+
parameter Modelica.SIunits.Inductance Lmainr;
18419+
parameter Modelica.SIunits.Inductance Lmain;
18420+
parameter Modelica.SIunits.Inductance Lauxr;
18421+
parameter Modelica.SIunits.Inductance Laux;
18422+
parameter Modelica.SIunits.Inductance Lr;
18423+
parameter Modelica.SIunits.Resistance Rmain;
18424+
parameter Modelica.SIunits.Resistance Rr;
18425+
parameter Modelica.SIunits.Resistance Raux;
18426+
parameter Modelica.SIunits.Capacitance Cc annotation(Dialog(enable = (init==2)));
18427+
parameter OpenIPSL.Types.PerUnit H;
18428+
parameter Real a;
18429+
parameter Real b;
18430+
parameter Real c;
18431+
18432+
OpenIPSL.Types.PerUnit Pc;
18433+
OpenIPSL.Types.PerUnit Qc;
18434+
OpenIPSL.Types.PerUnit s(start = s0);
18435+
OpenIPSL.Types.PerUnit Te1 "First Component of the Electrical Torque";
18436+
OpenIPSL.Types.PerUnit Te2 "Second Component of the Electrical Torque";
18437+
OpenIPSL.Types.PerUnit Te "Total Electrical Torque";
18438+
OpenIPSL.Types.PerUnit Tm "Mechanical Torque of the Load";
18439+
Modelica.SIunits.Power P;
18440+
18441+
//Modelica.SIunits.Torque Tele;
18442+
Modelica.SIunits.Current Iaux_real;
18443+
Modelica.SIunits.Current Iaux_imag;
18444+
Modelica.SIunits.Current Imain_real;
18445+
Modelica.SIunits.Current Imain_imag;
18446+
Modelica.SIunits.Current Itotal;
18447+
Modelica.SIunits.Voltage Vmain_real;
18448+
Modelica.SIunits.Voltage Vmain_imag;
18449+
Modelica.SIunits.Voltage Vaux_real;
18450+
Modelica.SIunits.Voltage Vaux_imag;
18451+
Real K1_real;
18452+
Real K1_imag;
18453+
Real K2_real;
18454+
Real K2_imag;
18455+
Real K3_real;
18456+
Real K3_imag;
18457+
Real KplusK_real;
18458+
Real KplusK_imag;
18459+
Real KminusK_real;
18460+
Real KminusK_imag;
18461+
Real Kden_real;
18462+
Real Kden_imag;
18463+
Modelica.SIunits.Conductance Cond1_aux_real;
18464+
Modelica.SIunits.Conductance Cond1_aux_imag;
18465+
Modelica.SIunits.Conductance Cond2_aux_real;
18466+
Modelica.SIunits.Conductance Cond2_aux_imag;
18467+
Modelica.SIunits.Conductance Cond1_main_real;
18468+
Modelica.SIunits.Conductance Cond1_main_imag;
18469+
Real Constant1;
18470+
Real Constant2;
18471+
18472+
protected
18473+
parameter OpenIPSL.Types.PerUnit vr0=v_0*cos(angle_0);
18474+
parameter OpenIPSL.Types.PerUnit vi0=v_0*sin(angle_0);
18475+
parameter OpenIPSL.Types.PerUnit ir0=(P_0/S_b*vr0 + Q_0/S_b*vi0)/(vr0^2 + vi0^2);
18476+
parameter OpenIPSL.Types.PerUnit ii0=(P_0/S_b*vi0 - Q_0/S_b*vr0)/(vr0^2 + vi0^2);
18477+
parameter Modelica.SIunits.AngularVelocity we = 2*Modelica.Constants.pi*fn;
18478+
parameter Real A = a + b + c;
18479+
parameter Real B = -b - 2*c;
18480+
parameter Real C = c;
18481+
parameter OpenIPSL.Types.PerUnit s0 = 1;
18482+
parameter Real switch_open_speed = 0.2;
18483+
Modelica.SIunits.Impedance Zb = V_b^2/S_b;
18484+
Modelica.SIunits.Current I_b = S_b/V_b;
18485+
Modelica.SIunits.Torque Tb = S_b/we;
18486+
initial equation
18487+
//der(s) = 0;
18488+
18489+
equation
18490+
18491+
// Calculation of the coeficients of the two-phase motor
18492+
18493+
KplusK_real = Rr*we*(Rr^2 - Lr^2*(s-2)*s*we^2)/(((Lr*(s-2)*we)^2 + Rr^2)*((Lr*s*we)^2 + Rr^2));
18494+
KplusK_imag = Lr*we^2*((Lr*(s-2)*s*we)^2 + Rr^2*(s^2-2*s+2))/(((Lr*(s-2)*we)^2 + Rr^2)*((Lr*s*we)^2 + Rr^2));
18495+
KminusK_real = Rr*(s-1)*we*(Lr^2*(s-2)*s*we^2 + Rr^2)/(((Lr*(s-2)*we)^2 + Rr^2)*((Lr*s*we)^2 + Rr^2));
18496+
KminusK_imag = 2*Lr*Rr^2*(s-1)*we^2/(((Lr*(s-2)*we)^2 + Rr^2)*((Lr*s*we)^2 + Rr^2));
18497+
18498+
K1_real = Rmain + we*Lmainr^2*KplusK_real;
18499+
K1_imag = we*Lmain - we*Lmainr^2*KplusK_imag;
18500+
18501+
K2_real = we*Lmainr*Lauxr*KminusK_imag;
18502+
K2_imag = we*Lmainr*Lauxr*KminusK_real;
18503+
18504+
K3_real = Raux + we*Lauxr^2*KplusK_real;
18505+
K3_imag = if init == 1 then we*Laux - we*Lauxr^2*KplusK_imag else we*Laux - we*Lauxr^2*KplusK_imag - 1/(we*Cc);
18506+
18507+
Kden_real = (K2_real^2 - K2_imag^2 + K1_real*K3_real - K1_imag*K3_imag);
18508+
Kden_imag = (2*K2_real*K2_imag + K1_real*K3_imag + K3_real*K1_imag);
18509+
18510+
Cond1_aux_real = (K2_real*Kden_real + K2_imag*Kden_imag)/(Kden_real^2 + Kden_imag^2);
18511+
Cond1_aux_imag = (K2_imag*Kden_real - K2_real*Kden_imag)/(Kden_real^2 + Kden_imag^2);
18512+
Cond2_aux_real = (K1_real*Kden_real + K1_imag*Kden_imag)/(Kden_real^2 + Kden_imag^2);
18513+
Cond2_aux_imag = (K1_imag*Kden_real - K1_real*Kden_imag)/(Kden_real^2 + Kden_imag^2);
18514+
Cond1_main_real = K1_real/(K1_real^2 + K1_imag^2);
18515+
Cond1_main_imag = K1_imag/(K1_real^2 + K1_imag^2);
18516+
Constant1 = (K2_real*K1_real + K2_imag*K1_imag)/(K1_real^2 + K1_imag^2);
18517+
Constant2 = (K2_imag*K1_real - K2_real*K1_imag)/(K1_real^2 + K1_imag^2);
18518+
18519+
Vmain_real = p.vr*V_b;
18520+
Vmain_imag = p.vi*V_b;
18521+
Vaux_real = if s > switch_open_speed then p.vr*V_b else 0;
18522+
Vaux_imag = if s > switch_open_speed then p.vi*V_b else 0;
18523+
18524+
Iaux_real = Cond1_aux_real*Vmain_real - Cond1_aux_imag*Vmain_imag + Cond2_aux_real*Vaux_real - Cond2_aux_imag*Vaux_imag;
18525+
Iaux_imag = Cond1_aux_real*Vmain_imag + Cond1_aux_imag*Vmain_real + Cond2_aux_real*Vaux_imag + Cond2_aux_imag*Vaux_real;
18526+
Imain_real = if s > switch_open_speed then Cond1_main_real*Vmain_real - Cond1_main_imag*Vmain_imag - Constant1*Iaux_real + Constant2*Iaux_imag else Cond1_main_real*Vmain_real - Cond1_main_imag*Vmain_imag;
18527+
Imain_imag = if s > switch_open_speed then Cond1_main_imag*Vmain_real + Cond1_main_real*Vmain_imag - Constant2*Iaux_real - Constant1*Iaux_imag else Cond1_main_imag*Vmain_real + Cond1_main_real*Vmain_imag;
18528+
Itotal = sqrt((Imain_real + Iaux_real)^2 + (Imain_imag + Imain_imag)^2);
18529+
p.ir = if s > switch_open_speed then Imain_real/I_b + Iaux_real/I_b else Imain_real/I_b;
18530+
p.ii = if s > switch_open_speed then Imain_imag/I_b + Iaux_imag/I_b else Imain_imag/I_b;
18531+
18532+
Pc = p.vr*p.ir + p.vi*p.ii;
18533+
Qc = (-p.vr*p.ii) + p.vi*p.ir;
18534+
P = Pc*S_b;
18535+
18536+
Te1 = if s > switch_open_speed then ((Lmainr^2*(Imain_real^2 + Imain_imag^2) + Lauxr^2*(Iaux_real^2 + Iaux_imag^2))*KminusK_real)/Tb else ((Lmainr^2*(Imain_real^2 + Imain_imag^2))*KminusK_real)/Tb;
18537+
Te2 = if s > switch_open_speed then (-2*Lmainr*Lauxr*KplusK_real*(Imain_real*Iaux_imag - Imain_imag*Iaux_real))/Tb else 0;
18538+
Te = Te1 + Te2;
18539+
Tm = A + B*s + C*s^2;
18540+
18541+
der(s) = (Tm - Te)/(2*H);
18542+
annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={
18543+
Rectangle(
18544+
extent={{-100,100},{100,-100}},
18545+
lineColor={0,0,0}),
18546+
Text(
18547+
extent={{-100,-52},{100,-92}},
18548+
lineColor={28,108,200},
18549+
textString="Single Phase"), Text(
18550+
extent={{-50,50},{50,-50}},
18551+
lineColor={0,0,0},
18552+
textString="M"), Ellipse(
18553+
fillColor={255,255,255},
18554+
extent={{-56,-56},{55.932,56}})}), Diagram(
18555+
coordinateSystem(preserveAspectRatio=false)));
18556+
end DPIM_correction;
1835018557
end SinglePhase;
1835118558

1835218559
package VariableSpeedDrive

0 commit comments

Comments
 (0)