Archived OpenModelica forums. Posting is disabled.

Alternative forums include GitHub discussions or StackOverflow (make sure to read the Stack Overflow rules; you need to have well-formed questions)


Forgot password? | Forgot username? | Register

Bad behaviour with simple power electronics

Bad behaviour with simple power electronics

The simple circuit I've tried works well on Dymola and is faulty in OpenModelica.
The problem is that the current in inductor Lf drops suddenly to zero (at 0.6, 0,16, 0,26, etc. ms) and this is incorrect, and not even physically possible!
Exactly the same code works well within Dymola.
Since the circuit is very simple it may indicate a very basic issue of OpenModelica when used with power electronics.
If my outcomes are not wrong, they may indicate that OpenModelica 1.7 cannot be used for Power Electronics circuits.

Massimo

Code:


model Chopper

Modelica.Electrical.Analog.Sources.ConstantVoltage V1(V=100)
   annotation (
      Placement(transformation(
        extent={{-10,-10},{10,10}},
        rotation=270,
        origin={-72,12})));
Modelica.Electrical.Analog.Ideal.IdealGTOThyristor idealGTOThyristor
    annotation (Placement(transformation(
        extent={{-10,-10},{10,10}},
        rotation=270,
        origin={-32,50})));
Modelica.Electrical.Analog.Ideal.IdealDiode idealDiode
   annotation (Placement(
        transformation(
        extent={{-10,-10},{10,10}},
        rotation=90,
        origin={-32,-14})));
Modelica.Electrical.Analog.Basic.Resistor Rf(R=0.1)
   annotation (Placement(transformation(extent={{-18,6},{2,26}})));
Modelica.Electrical.Analog.Basic.Inductor Lf(L=10e-3, i(start=1))
   annotation (Placement(transformation(extent={{14,6},{34,26}})));
Modelica.Electrical.Analog.Basic.Capacitor Cf(C=100e-6, v(start=70))
   annotation (Placement(
        transformation(
        extent={{-10,-10},{10,10}},
        rotation=270,
        origin={44,-12})));
Modelica.Electrical.Analog.Basic.Resistor Load(R=30)
   annotation (Placement(
        transformation(
        extent={{-10,-10},{10,10}},
        rotation=270,
        origin={72,-8})));
Modelica.Blocks.Sources.SawTooth sawTooth(period=0.001,offset=0,startTime=0)
   annotation (Placement(
        transformation(
        extent={{-9,-9},{9,9}},
        rotation=180,
        origin={31,47})));
Modelica.Blocks.Logical.LessThreshold lessThreshold(threshold=0.8)
    annotation (Placement(transformation(
        extent={{-8,-8},{8,8}},
        rotation=180,
        origin={-2,46})));
Modelica.Electrical.Analog.Basic.Ground ground
    annotation (Placement(transformation(extent={{-82,-66},{-62,-46}})));
equation
  connect(idealDiode.n, idealGTOThyristor.n) annotation (Line(
      points={{-32,-4},{-32,40}},
      color={0,0,255},
      smooth=Smooth.None));
  connect(idealGTOThyristor.p, V1.p) annotation (Line(
      points={{-32,60},{-32,68},{-72,68},{-72,22}},
      color={0,0,255},
      smooth=Smooth.None));
  connect(V1.n, idealDiode.p) annotation (Line(
      points={{-72,2},{-72,-34},{-32,-34},{-32,-24}},
      color={0,0,255},
      smooth=Smooth.None));
  connect(Rf.p, idealDiode.n) annotation (Line(
      points={{-18,16},{-32,16},{-32,-4}},
      color={0,0,255},
      smooth=Smooth.None));
  connect(Lf.p, Rf.n) annotation (Line(
      points={{14,16},{2,16}},
      color={0,0,255},
      smooth=Smooth.None));
  connect(Cf.p, Lf.n) annotation (Line(
      points={{44,-2},{44,16},{34,16}},
      color={0,0,255},
      smooth=Smooth.None));
  connect(Cf.n, idealDiode.p) annotation (Line(
      points={{44,-22},{44,-34},{-32,-34},{-32,-24}},
      color={0,0,255},
      smooth=Smooth.None));
  connect(Load.p, Lf.n) annotation (Line(
      points={{72,2},{72,16},{34,16}},
      color={0,0,255},
      smooth=Smooth.None));
  connect(Load.n, Cf.n) annotation (Line(
      points={{72,-18},{72,-34},{44,-34},{44,-22}},
      color={0,0,255},
      smooth=Smooth.None));
  connect(lessThreshold.y, idealGTOThyristor.fire) annotation (Line(
      points={{-10.8,46},{-12,46},{-12,43},{-21,43}},
      color={255,0,255},
      smooth=Smooth.None));
  connect(sawTooth.y, lessThreshold.u) annotation (Line(
      points={{21.1,47},{16,47},{16,46},{7.6,46}},
      color={0,0,127},
      smooth=Smooth.None));
  connect(ground.p, V1.n) annotation (Line(
      points={{-72,-46},{-72,2}},
      color={0,0,255},
      smooth=Smooth.None));
  annotation (uses(Modelica(version="3.2")), Diagram(graphics),
    experiment(StopTime=0.005, NumberOfIntervals=2000),
    experimentSetupOutput);
end Chopper;

Re: Bad behaviour with simple power electronics

As far as I know, the Ideal Diode is not really working in OpenModelica (gives wrong results)...

Re: Bad behaviour with simple power electronics

I've studied the issue.
First comment: the Modelica Ideal diode code is very brillant. But it is difficult to understand for a human, let alone for parsing algorithms! OpenModelica parser get confused by this code, while Dymola's does not.
Second: the problem with diodes was indeed already known since it was reported as a bug (N. 1214). However we should not expect it to get solved soon, as it has already been on the site since a year ago and has not been assigned to anyone.
Third My example not only had an ideal diode, but also an ideal thyristor, that caused itself troubles.

Workarounds for my circuit:
1) use the diode model from the Modelica "Semiconductor" library.
2) use an IdealClosingSwitch in series with a diode in stead of the Ideal Thyristor

Using similar workarounds I deem that neaqrly any power electronics cicuit can be simulated with OpenModelica.

There are 0 guests and 0 other users also viewing this topic
You are here: