如何用 SMPM 和逆变器修复 "Model is not globally balanced"

How to fix "Model is not globally balanced" with SMPM and inverter

基于示例 Modelica.Electrical.Machines.Examples.SynchronousInductionMachines.SMPM_VoltageSource,我正在尝试使用来自 Modelica.Electrical.PowerConverters.DCAC.MultiPhase2Level 的逆变器为 SMPM 供电。 不幸的是我得到了错误

Simulation model is not globally balanced, having 337 variables and 335 equations

但我不知道哪两个方程式丢失了。

更让我困惑的是,如果我删除 signalPWMinverterconstantVoltage 来源,模型是平衡的。

model SMPM_VoltageSource_Inverter
  import Modelica.Constants.pi;
  constant Integer m = 3 "Number of phases";
  parameter Modelica.SIunits.Frequency f = 1000 "Switching frequency";
  parameter Modelica.SIunits.Frequency f1 = 50 "Fundamental wave AC frequency";
  parameter Modelica.SIunits.Current Idq[2] = {-53.5, 84.6} "Desired d- and q-current";
  parameter Modelica.SIunits.AngularVelocity wNominal = 2 * pi * smpmData.fsNominal / smpmData.p "Nominal speed";
  parameter Modelica.SIunits.Torque TLoad = 181.4 "Nominal load torque";
  parameter Modelica.SIunits.Inertia JLoad = 0.29 "Load's moment of inertia";
  Modelica.Electrical.Machines.BasicMachines.SynchronousInductionMachines.SM_PermanentMagnet smpm(phiMechanical(start = 0, fixed = true), wMechanical(start = 0, fixed = true), useSupport = false, useThermalPort = false, p = smpmData.p, fsNominal = smpmData.fsNominal, Rs = smpmData.Rs, TsRef = smpmData.TsRef, Lszero = smpmData.Lszero, Lssigma = smpmData.Lssigma, Jr = smpmData.Jr, Js = smpmData.Js, frictionParameters = smpmData.frictionParameters, statorCoreParameters = smpmData.statorCoreParameters, strayLoadParameters = smpmData.strayLoadParameters, VsOpenCircuit = smpmData.VsOpenCircuit, Lmd = smpmData.Lmd, Lmq = smpmData.Lmq, useDamperCage = smpmData.useDamperCage, Lrsigmad = smpmData.Lrsigmad, Lrsigmaq = smpmData.Lrsigmaq, Rrd = smpmData.Rrd, Rrq = smpmData.Rrq, TrRef = smpmData.TrRef, permanentMagnetLossParameters = smpmData.permanentMagnetLossParameters, TsOperational = 293.15, alpha20s = smpmData.alpha20s, TrOperational = 293.15, alpha20r = smpmData.alpha20r) annotation(Placement(transformation(extent = {{-20, -50}, {0, -30}}, origin = {-0, -10}, rotation = 0), visible = true));
  Modelica.Blocks.Sources.Constant iq(k = Idq[2]) annotation(Placement(transformation(extent = {{-90, 20}, {-70, 40}}, origin = {-0, -10}, rotation = 0), visible = true));
  Modelica.Blocks.Sources.Constant id(k = Idq[1]) annotation(Placement(transformation(extent = {{-90, 60}, {-70, 80}}, origin = {-0, -10}, rotation = 0), visible = true));
  Modelica.Electrical.Machines.Utilities.TerminalBox terminalBox(terminalConnection = "Y") annotation(Placement(transformation(extent = {{-20, -34}, {0, -14}}, origin = {-0, -10}, rotation = 0), visible = true));
  Modelica.Mechanics.Rotational.Sensors.AngleSensor angleSensor annotation(Placement(transformation(extent = {{-10, -10}, {10, 10}}, rotation = 90, origin = {20, -10}), visible = true));
  Modelica.Mechanics.Rotational.Components.Inertia inertiaLoad(J = JLoad) annotation(Placement(transformation(extent = {{50, -50}, {70, -30}}, origin = {-0, -10}, rotation = 0), visible = true));
  Modelica.Mechanics.Rotational.Sources.QuadraticSpeedDependentTorque quadraticSpeedDependentTorque(tau_nominal = -TLoad, w_nominal(displayUnit = "rad/s") = wNominal) annotation(Placement(transformation(extent = {{100, -50}, {80, -30}}, origin = {-0, -10}, rotation = 0), visible = true));
  Modelica.Electrical.MultiPhase.Sensors.CurrentSensor currentSensor(m = m) annotation(Placement(transformation(extent = {{-10, -10}, {10, 10}}, rotation = 270, origin = {-10, -10}), visible = true));
  Modelica.Electrical.Machines.Utilities.VoltageController voltageController(p = smpm.p, Ld = smpm.Lssigma + smpm.Lmd, Lq = smpm.Lssigma + smpm.Lmq, Rs = Modelica.Electrical.Machines.Thermal.convertResistance(smpm.Rs, smpm.TsRef, smpm.alpha20s, smpm.TsOperational), fsNominal = smpm.fsNominal, VsOpenCircuit = smpm.VsOpenCircuit) annotation(Placement(transformation(extent = {{-50, 40}, {-30, 60}}, origin = {-0, -10}, rotation = 0), visible = true));
  Modelica.Mechanics.Rotational.Sensors.TorqueSensor torqueSensor annotation(Placement(transformation(extent = {{10, 10}, {-10, -10}}, rotation = 180, origin = {40, -70}), visible = true));
  Modelica.Mechanics.Rotational.Sensors.SpeedSensor speedSensor annotation(Placement(transformation(extent = {{-10, -10}, {10, 10}}, rotation = 90, origin = {50, -10}), visible = true));
  Modelica.Electrical.Machines.Sensors.RotorDisplacementAngle rotorDisplacementAngle(p = smpm.p) annotation(Placement(transformation(origin = {20, -50}, extent = {{-10, 10}, {10, -10}}, rotation = 270), visible = true));
  Modelica.Electrical.Analog.Basic.Ground groundM annotation(Placement(transformation(origin = {-80, -38}, extent = {{-10, -10}, {10, 10}}, rotation = 270), visible = true));
  Modelica.Electrical.MultiPhase.Basic.Star starM(final m = m) annotation(Placement(transformation(extent = {{-10, -10}, {10, 10}}, rotation = 180, origin = {-60, -20}), visible = true));
  Modelica.Electrical.Machines.Sensors.VoltageQuasiRMSSensor voltageQuasiRMSSensor annotation(Placement(transformation(extent = {{-10, 10}, {10, -10}}, rotation = 180, origin = {-30, -20}), visible = true));
  parameter Modelica.Electrical.Machines.Utilities.ParameterRecords.SM_PermanentMagnetData smpmData(useDamperCage = false) annotation(Placement(transformation(extent = {{-20, -80}, {0, -60}}, origin = {-0, -10}, rotation = 0), visible = true));
  Modelica.Electrical.Machines.Sensors.CurrentQuasiRMSSensor currentQuasiRMSSensor annotation(Placement(transformation(origin = {-10, 10}, extent = {{-10, -10}, {10, 10}}, rotation = 270), visible = true));
  Modelica.Electrical.PowerConverters.DCDC.Control.SignalPWM signalPWM[m](each useConstantDutyCycle = false, each f = f) annotation(Placement(transformation(extent = {{-10, -10}, {10, 10}}, origin = {-4.866, 46.285}, rotation = 0), visible = true));
  Modelica.Electrical.Analog.Sources.ConstantVoltage constantVoltage_n(V = 50) annotation(Placement(transformation(extent = {{-10, -10}, {10, 10}}, rotation = 270, origin = {87.166, 41.725}), visible = true));
  Modelica.Electrical.PowerConverters.DCAC.MultiPhase2Level inverter(useHeatPort = false, m = m) annotation(Placement(transformation(extent = {{50, 20}, {30, 40}}, origin = {-3.885, 35.399}, rotation = 0), visible = true));
  Modelica.Electrical.Analog.Basic.Ground ground1 annotation(Placement(transformation(extent = {{-10, -10}, {10, 10}}, rotation = 180, origin = {67.166, 71.725}), visible = true));
  Modelica.Electrical.Analog.Sources.ConstantVoltage constantVoltage_p(V = 50) annotation(Placement(transformation(extent = {{-10, -10}, {10, 10}}, rotation = 270, origin = {87.166, 81.725}), visible = true));
initial equation
  smpm.is[1:2] = zeros(2);
equation
  connect(terminalBox.plug_sn, smpm.plug_sn) annotation(Line(points = {{0, 0}, {0, 0}, {0, 0}}, color = {0, 0, 255}, visible = true, origin = {-16, -40}));
  connect(terminalBox.plug_sp, smpm.plug_sp) annotation(Line(points = {{0, 0}, {0, 0}, {0, 0}}, color = {0, 0, 255}, visible = true, origin = {-4, -40}));
  connect(quadraticSpeedDependentTorque.flange, inertiaLoad.flange_b) annotation(Line(points = {{80, -40}, {70, -40}}, visible = true, origin = {-0, -10}, color = {64, 64, 64}));
  connect(smpm.flange, angleSensor.flange) annotation(Line(points = {{-6.667, -10}, {3.333, -10}, {3.333, 20}, {13.333, 20}}, visible = true, origin = {6.667, -40}, color = {64, 64, 64}));
  connect(currentSensor.plug_n, terminalBox.plugSupply) annotation(Line(points = {{-10, -10}, {-10, -28}}, color = {10, 90, 224}, visible = true, origin = {-0, -10}));
  connect(id.y, voltageController.id_rms) annotation(Line(points = {{-69, 70}, {-60, 70}, {-60, 56}, {-52, 56}}, color = {1, 37, 163}, visible = true, origin = {-0, -10}));
  connect(iq.y, voltageController.iq_rms) annotation(Line(points = {{-69, 30}, {-60, 30}, {-60, 44}, {-52, 44}}, color = {1, 37, 163}, visible = true, origin = {-0, -10}));
  connect(angleSensor.phi, voltageController.phi) annotation(Line(points = {{20, 11}, {20, 34}, {-34, 34}, {-34, 38}}, color = {1, 37, 163}, visible = true, origin = {0, -10}));
  connect(currentSensor.i, voltageController.iActual) annotation(Line(points = {{-21, 0}, {-46, 0}, {-46, 38}}, color = {1, 37, 163}, visible = true, origin = {-0, -10}));
  connect(inertiaLoad.flange_a, torqueSensor.flange_b) annotation(Line(points = {{50, -40}, {50, -60}}, visible = true, origin = {-0, -10}, color = {64, 64, 64}));
  connect(torqueSensor.flange_a, smpm.flange) annotation(Line(points = {{30, -60}, {30, -40}, {0, -40}}, visible = true, origin = {-0, -10}, color = {64, 64, 64}));
  connect(speedSensor.flange, smpm.flange) annotation(Line(points = {{23.333, 20}, {13.333, 20}, {13.333, -10}, {-26.667, -10}}, visible = true, origin = {26.667, -40}, color = {64, 64, 64}));
  connect(rotorDisplacementAngle.flange, smpm.flange) annotation(Line(points = {{10, -40}, {0, -40}}, visible = true, origin = {-0, -10}, color = {64, 64, 64}));
  connect(rotorDisplacementAngle.plug_p, smpm.plug_sp) annotation(Line(points = {{14, -30}, {-4, -30}}, color = {10, 90, 224}, visible = true, origin = {-0, -10}));
  connect(rotorDisplacementAngle.plug_n, smpm.plug_sn) annotation(Line(points = {{26, -30}, {26, -20}, {-16, -20}, {-16, -30}}, color = {10, 90, 224}, visible = true, origin = {-0, -10}));
  connect(voltageQuasiRMSSensor.plug_p, currentSensor.plug_n) annotation(Line(points = {{-20, -10}, {-10, -10}}, color = {10, 90, 224}, visible = true, origin = {-0, -10}));
  connect(starM.plug_p, voltageQuasiRMSSensor.plug_n) annotation(Line(points = {{-50, -10}, {-40, -10}}, color = {10, 90, 224}, visible = true, origin = {-0, -10}));
  connect(groundM.p, starM.pin_n) annotation(Line(points = {{-70, -28}, {-70, -10}}, color = {10, 90, 224}, visible = true, origin = {-0, -10}));
  connect(currentQuasiRMSSensor.plug_n, currentSensor.plug_p) annotation(Line(points = {{0, 0}, {0, 0}, {0, 0}}, color = {0, 0, 255}, visible = true, origin = {-10, 0}));
  connect(signalPWM.fire, inverter.fire_p) annotation(Line(points = {{-24.66, 1.943}, {-24.66, 6.943}, {-3.66, 6.943}, {-3.66, -6.943}, {28.321, -6.943}, {28.321, -1.943}}, color = {190, 52, 178}, visible = true, origin = {13.794, 55.342}));
  connect(constantVoltage_n.n, inverter.dc_n) annotation(Line(points = {{-32.834, 6.725}, {-73.885, 6.725}, {-73.885, 30.399}}, color = {10, 90, 224}, visible = true, origin = {120, 25}));
  connect(signalPWM.notFire, inverter.fire_n) annotation(Line(points = {{-12.66, 1.943}, {-12.66, 6.943}, {-3.66, 6.943}, {-3.66, -6.943}, {16.321, -6.943}, {16.321, -1.943}}, color = {190, 52, 178}, visible = true, origin = {13.794, 55.342}));
  connect(constantVoltage_p.n, constantVoltage_n.p) annotation(Line(points = {{-70, 40}, {-70, 20}}, color = {10, 90, 224}, visible = true, origin = {157.166, 31.725}));
  connect(constantVoltage_p.p, inverter.dc_p) annotation(Line(points = {{-70, 60}, {-111.051, 60}, {-111.051, 43.673}}, color = {10, 90, 224}, visible = true, origin = {157.166, 31.725}));
  connect(inverter.ac, currentQuasiRMSSensor.plug_p) annotation(Line(visible = true, origin = {2.038, 50.266}, points = {{24.077, 15.133}, {-12.038, 15.133}, {-12.038, -30.266}}, color = {10, 90, 224}));
  connect(voltageController.y[1], signalPWM[1].dutyCycle) annotation(Line(visible = true, origin = {-23.467, 43.142}, points = {{-5.533, -3.142}, {-0.533, -3.142}, {-0.533, 3.142}, {6.6, 3.142}}, color = {1, 37, 163}));
  connect(ground1.p, constantVoltage_p.n) annotation(Line(points = {{-10, 0}, {-10, -5}, {10, -5}, {10, 10}}, color = {10, 90, 224}, visible = true, origin = {77.166, 61.725}));
  annotation(experiment(StopTime = 2.0, Interval = 0.001), Documentation(info = "<html>
<p>
A synchronous induction machine with permanent magnets accelerates a quadratic speed dependent load from standstill.
The rms values of d- and q-current in rotor fixed coordinate system are controlled by the voltageController,
and the output voltages fed to the machine. The result shows that the torque is influenced by the q-current,
whereas the stator voltage is influenced by the d-current.</p>
<p>
Default machine parameters of model <a href=\"modelica://Modelica.Electrical.Machines.BasicMachines.SynchronousInductionMachines.SM_PermanentMagnet\">SM_PermanentMagnet</a> are used.
</p>
</html>"));
end SMPM_VoltageSource_Inverter;

有人知道如何解决这个问题,这样我就可以制作这个模型了吗运行?

非常感谢任何帮助!

您使用 m=3 个实例对组件 componentsignalPWM 进行了向量化。但只有第一个实例连接了输入。

更改连接

connect(voltageController.y[1], signalPWM[1].dutyCycle)

connect(voltageController.y, signalPWM.dutyCycle)

voltageController 的三个输出连接到三个 signalPWM 块的输入。