modelicadymolasystemmodeler

Wrong simulation results when connecting an inverter with a smpm in Modelica


I'm using SystemModeler from Wolfram to investigate the system behaviour of an inverter connected to a permanent magnet synchronous machine. Unfortunately I get wrong simulation results eventhough I only used components from the Modelica Standard Library.

I tried several settings so far with my model below.

model InverterSMPM
  import Modelica.Constants.pi;
  parameter 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.Torque TLoad = 181.4 "Nominal load torque";
  parameter Modelica.SIunits.Inertia JLoad = 0.29 "Load's moment of inertia";
  Modelica.Electrical.Analog.Sources.ConstantVoltage constantVoltage_n(V = 50) annotation(Placement(transformation(extent = {{-10, -10}, {10, 10}}, rotation = 270, origin = {-105, 4}), visible = true));
  Modelica.Electrical.PowerConverters.DCAC.MultiPhase2Level inverter(useHeatPort = false, m = m) annotation(Placement(transformation(extent = {{-50, 20}, {-30, 40}}, origin = {-35, -6}, rotation = 0), visible = true));
  Modelica.Electrical.Analog.Basic.Ground ground annotation(Placement(transformation(extent = {{-10, -10}, {10, 10}}, rotation = 180, origin = {-125, 34}), 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 = {-75, -26}, rotation = 0), visible = true));
  Modelica.Electrical.Analog.Sources.ConstantVoltage constantVoltage_p(V = 50) annotation(Placement(transformation(extent = {{-10, -10}, {10, 10}}, rotation = 270, origin = {-105, 44}), visible = true));
  Modelica.Blocks.Sources.Sine sine[m](phase = -Modelica.Electrical.MultiPhase.Functions.symmetricOrientation(m), startTime = zeros(m), amplitude = fill(0.5, m), offset = fill(0.5, m), freqHz = fill(f1, m)) annotation(Placement(transformation(extent = {{-30, -64}, {-50, -44}}, origin = {-35, -6}, rotation = 0), visible = true));
  Modelica.Electrical.Machines.BasicMachines.SynchronousInductionMachines.SM_PermanentMagnet smpm(Jr = 0.29, p = 8, fsNominal = f1, VsOpenCircuit = 100, TsOperational = 293.15, TrOperational = 293.15, Rs = 4.7, TsRef = 293.15, alpha20s = Modelica.Electrical.Machines.Thermal.Constants.alpha20Aluminium, Lssigma = 0.001, Lmd = 0.0133, Lmq = 0.0133, useDamperCage = false) annotation(Placement(visible = true, transformation(origin = {5, -15}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
  Modelica.Electrical.Machines.Utilities.TerminalBox terminalBox1(terminalConnection = "Y") annotation(Placement(visible = true, transformation(origin = {5, 2.209}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
  Modelica.Mechanics.Rotational.Components.Inertia inertia1(J = JLoad) annotation(Placement(visible = true, transformation(origin = {35, -15}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
  Modelica.Mechanics.Rotational.Sources.TorqueStep torqueStep1(stepTorque = -TLoad, offsetTorque = 0, startTime = 2, useSupport = false) annotation(Placement(visible = true, transformation(origin = {76.657, -15}, extent = {{10, -10}, {-10, 10}}, rotation = 0)));
  Modelica.Mechanics.Rotational.Sensors.SpeedSensor speedSensor1 annotation(Placement(visible = true, transformation(origin = {35, 20}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
equation
  connect(constantVoltage_p.n, constantVoltage_n.p) annotation(Line(points = {{-70, 40}, {-70, 20}}, color = {10, 90, 224}, visible = true, origin = {-35, -6}));
  connect(constantVoltage_p.p, inverter.dc_p) annotation(Line(points = {{-70, 60}, {-50, 60}, {-50, 40}}, color = {10, 90, 224}, visible = true, origin = {-35, -6}));
  connect(constantVoltage_n.n, inverter.dc_n) annotation(Line(points = {{-70, -0}, {-50, 0}, {-50, 20}}, color = {10, 90, 224}, visible = true, origin = {-35, -6}));
  connect(ground.p, constantVoltage_p.n) annotation(Line(points = {{-90, 30}, {-70, 30}, {-70, 40}}, color = {10, 90, 224}, visible = true, origin = {-35, -6}));
  connect(sine.y, signalPWM.dutyCycle) annotation(Line(points = {{-51, -54}, {-60, -54}, {-60, -20}, {-52, -20}}, color = {1, 37, 163}, visible = true, origin = {-35, -6}));
  connect(signalPWM.fire, inverter.fire_p) annotation(Line(points = {{-46, -9}, {-46, 18}}, color = {190, 52, 178}, visible = true, origin = {-35, -6}));
  connect(signalPWM.notFire, inverter.fire_n) annotation(Line(points = {{-34, -9}, {-34, 18}}, color = {190, 52, 178}, visible = true, origin = {-35, -6}));
  connect(terminalBox1.plug_sn, smpm.plug_sn) annotation(Line(visible = true, origin = {-1, -4.396}, points = {{0, 0.604}, {0, -0.604}}, color = {10, 90, 224}));
  connect(terminalBox1.plug_sp, smpm.plug_sp) annotation(Line(visible = true, origin = {11, -4.396}, points = {{0, 0.604}, {0, -0.604}}, color = {10, 90, 224}));
  connect(smpm.flange, inertia1.flange_a) annotation(Line(visible = true, origin = {20, -15}, points = {{-5, 0}, {5, 0}}, color = {64, 64, 64}));
  connect(inertia1.flange_b, torqueStep1.flange) annotation(Line(visible = true, origin = {55.828, -15}, points = {{-10.828, 0}, {10.828, 0}}, color = {64, 64, 64}));
  connect(speedSensor1.flange, smpm.flange) annotation(Line(visible = true, origin = {20, 2.5}, points = {{5, 17.5}, {0, 17.5}, {0, -17.5}, {-5, -17.5}}, color = {64, 64, 64}));
  connect(inverter.ac, terminalBox1.plugSupply) annotation(Line(visible = true, origin = {-18.333, 15.403}, points = {{-46.667, 8.597}, {23.333, 8.597}, {23.333, -17.194}}, color = {10, 90, 224}));
  annotation(experiment(StartTime = 0.00, StopTime = 5, NumberOfIntervals = 5000, __Wolfram_Algorithm = "dassl", Tolerance = 1e-6, __Wolfram_SynchronizeWithRealTime = false), Diagram(coordinateSystem(extent = {{-150, -90}, {150, 90}}, preserveAspectRatio = true, initialScale = 0.1, grid = {5, 5})));
end InverterSMPM;

Can someone may tell me what I'm doing wrong with my model and why the simulation results are wrong?

I also tried some examples from the library but they never use an inverter together with a motor. But I want to investigate on the PWM and don't want to work with ideal sine voltages and currents as in the examples...

Thank you for any help!!


Solution

  • What you are trying to do in you model is, to let a synchronous machine operate at nominal electrical frequency directly from standstill. This will make the machine "fall out of step", which is the reason for the machine not to operate as you would expect, but just oscillate in a seemingly random manner.

    Try to reduce sine[*].freqHz to fill(0.01*f1, m) and you will see that there it will - after some oscillations - start to operate at one percent of its nominal frequency. It's just that the machine cannot overcome the oscillations for the jump to the nominal frequency.

    There are multiple possibilities to work around that issue:

    1. Initialize the machine properly: This can be done by setting at least smpm.wMechancial.start and smpm.phiMechancial.start to the correct values. Additionally it would be good to also initialize the phase currents correctly. This can be pretty tedious to do. But gives the advantage that you don't have to ramp up the speed.
    2. It's likely easier to copy parts of the example Modelica.Electrical.Machines.Examples.SynchronousInductionMachines.SMPM_Inverter, where a voltage-frequency-controller is used to start the machine.
    3. Many synchronous machines are actually controlled (e.g. by field-orientation or direct-torque control). For this some clues can be taken from Modelica.Electrical.Machines.Examples.SynchronousInductionMachines.SMPM_CurrentSource and Modelica.Electrical.Machines.Examples.SynchronousInductionMachines.SMPM_VoltageSource.

    Additionally I would suggest to first try to get your example running with a continuous inverter like in Modelica.Electrical.Machines.Examples.SynchronousInductionMachines.SMPM_Inverter. If that works asexpected, move on the switched one.

    Some things that look suspicious to me: