Thyristor

model Thyristor "Simple Thyristor Model"
    parameter SI.Voltage VDRM(final min = 0) = 100 "Forward breakthrough voltage";
    parameter SI.Voltage VRRM(final min = 0) = 100 "Reverse breakthrough voltage";
    parameter SI.Current IDRM = 0.1 "Saturation current";
    parameter SI.Voltage VTM = 1.7 "Conducting voltage";
    parameter SI.Current IH = 0.006 "Holding current";
    parameter SI.Current ITM = 25 "Conducting current";
    parameter SI.Voltage VGT = 0.7 "Gate trigger voltage";
    parameter SI.Current IGT = 0.005 "Gate trigger current";
    parameter SI.Time TON = 1e-6 "Switch on time";
    parameter SI.Time TOFF = 1.5e-5 "Switch off time";
    parameter SI.Voltage Vt = 0.04 "Voltage equivalent of temperature (kT/qn)";
    parameter Real Nbv = 0.74 "Reverse Breakthrough emission coefficient";

    extends Modelica.Electrical.Analog.Interfaces.ConditionalHeatPort;

    SI.Current iGK "Gate current";
    SI.Voltage vGK "Voltage between gate and cathode";
    SI.Voltage vAK "Voltage between anode and cathode";
    SI.Voltage vControl(start = 0);
    SI.Voltage vContot;
    SI.Voltage vConmain;
    Modelica.Electrical.Analog.Interfaces.PositivePin Anode annotation (Placement(
        transformation(extent = {
            {-95, -12}, 
            {-75, 8}}),
        iconTransformation(extent = {
            {-100, -10}, 
            {-80, 10}})));
    Modelica.Electrical.Analog.Interfaces.NegativePin Cathode annotation (Placement(
        transformation(extent = {
            {80, -10}, 
            {100, 10}}),
        iconTransformation(extent = {
            {80, -10}, 
            {100, 10}})));
    Modelica.Electrical.Analog.Interfaces.PositivePin Gate annotation (Placement(
        transformation(extent = {
            {90, 90}, 
            {110, 110}}),
        iconTransformation(extent = {
            {90, 90}, 
            {110, 110}})));
protected
    parameter SI.Voltage Von = 5;
    parameter SI.Voltage Voff = 1.5;
    parameter SI.Resistance Ron = (VTM - 0.7) / ITM "Forward conducting mode resistance";
    parameter SI.Resistance Roff = VDRM ^ 2 / VTM / IH "Blocking mode resistance";
equation
    Anode.i + Gate.i + Cathode.i = 0;
    LossPower = Anode.i * Anode.v + Cathode.i * Cathode.v + Gate.i * Gate.v;
    iGK = Gate.i;
    vAK = Anode.v - Cathode.v;
    vConmain = if IH < Anode.i or VDRM < vAK then Von else 0;
    vContot = vConmain + smooth(0, if iGK < 0.95 * IGT then 0 else if iGK < 0.95 * IGT + 0.001 then 10000 * (iGK - 0.95 * IGT) * vAK else 10 * vAK);
    vGK = Gate.v - Cathode.v;
    vGK = smooth(0, if vGK < 0.65 then VGT / IGT * iGK else 0.4225 / VGT + iGK * (VGT - 0.65) / IGT);
    Anode.i = smooth(1, if vAK < -VRRM then -VRRM / Roff * exp(-(vAK + VRRM) / (Nbv * Vt)) else if vControl < Voff then vAK / Roff else if vControl < Von then vAK / (sqrt(Ron * Roff) * (Ron / Roff) ^ (0.5 * (3 * ((2 * vControl - Von - Voff) / (2 * (Von - Voff))) - 4 * ((2 * vControl - Von - Voff) / (2 * (Von - Voff))) ^ 3))) else vAK / Ron);
    der(vControl) = (vContot - vControl) / (if 0 < vContot - vControl then 1.87 * TON else 0.638 * TOFF);

    annotation (
        Documentation(
            info = "<html>\n<p>This is a simple thyristor model with three pins: Anode, Cathode and Gate. There are three operating modes:conducting, blocking and reverse breakthrough.\n<br>As long as the thyristor is in blocking mode it behaves like a linear resistance Roff=VDRM^2/(VTM*IH). But if the voltage between anode and cathode exceeds VDRM or a positive gate current flows for a sufficient time the mode changes to conducting mode. The model stays in conducting mode until the anode current falls below the holding current IH. There is no way to switch off the thyristor via the gate. If the voltage between anode and cathode is negative, the model represents a diode (parameters Vt, Nbv) with reverse breakthrough voltage VRRM.</p>\n<p>The dV/dt switch on is not taken into account in this model. The gate circuit is not influenced by the main circuit.</p>\n</html>",
            revisions = "<html>\n<ul>\n<li><em>May 12, 2009   </em>\n       by Matthias Franke\n       </li>\n</ul>\n</html>"),
        Icon(
            coordinateSystem(
                preserveAspectRatio = true,
                extent = {
                    {-100, -100}, 
                    {100, 100}}),
            graphics = {
                Polygon(
                    points = {
                        {30, 0}, 
                        {-30, 40}, 
                        {-30, -40}, 
                        {30, 0}},
                    lineColor = {0, 0, 255},
                    fillColor = {255, 255, 255},
                    fillPattern = FillPattern.Solid), 
                Line(
                    points = {
                        {-90, 0}, 
                        {40, 0}},
                    color = {0, 0, 255}), 
                Line(
                    points = {
                        {40, 0}, 
                        {90, 0}},
                    color = {0, 0, 255}), 
                Line(
                    points = {
                        {30, 40}, 
                        {30, -40}},
                    color = {0, 0, 255}), 
                Line(
                    points = {
                        {30, 20}, 
                        {100, 90}, 
                        {100, 100}},
                    color = {0, 0, 255}), 
                Line(
                    points = {
                        {40, 50}, 
                        {60, 30}},
                    color = {0, 0, 255}), 
                Text(
                    extent = {
                        {-150, -40}, 
                        {150, -80}},
                    textString = "%name",
                    lineColor = {0, 0, 255})}),
        Diagram(
            coordinateSystem(
                preserveAspectRatio = true,
                extent = {
                    {-100, -100}, 
                    {100, 100}}),
            graphics = {
                Line(
                    points = {
                        {-80, 0}, 
                        {80, 0}},
                    color = {128, 128, 128}), 
                Polygon(
                    points = {
                        {70, 4}, 
                        {80, 0}, 
                        {70, -4}, 
                        {70, 4}},
                    lineColor = {128, 128, 128},
                    fillColor = {128, 128, 128},
                    fillPattern = FillPattern.Solid), 
                Line(
                    points = {
                        {0, 80}, 
                        {0, -80}},
                    color = {128, 128, 128}), 
                Polygon(
                    points = {
                        {-4, 70}, 
                        {0, 80}, 
                        {4, 70}, 
                        {-4, 70}},
                    lineColor = {128, 128, 128},
                    fillColor = {128, 128, 128},
                    fillPattern = FillPattern.Solid), 
                Text(
                    extent = {
                        {5, 81}, 
                        {15, 71}},
                    lineColor = {128, 128, 128},
                    textString = "i"), 
                Text(
                    extent = {
                        {70, -10}, 
                        {80, -20}},
                    lineColor = {128, 128, 128},
                    textString = "v"), 
                Line(
                    points = {
                        {20, 9}, 
                        {20, 0}},
                    color = {128, 128, 128},
                    pattern = LinePattern.Dot), 
                Text(
                    extent = {
                        {25, 64}, 
                        {45, 54}},
                    lineColor = {128, 128, 128},
                    textString = "Ron"), 
                Line(
                    points = {
                        {14, 20}, 
                        {25, 73}},
                    thickness = 0.5), 
                Line(
                    points = {
                        {-57, -11}, 
                        {55, 9}},
                    thickness = 0.5), 
                Line(
                    points = {
                        {-57, -11}, 
                        {-59, -13}, 
                        {-60, -18}, 
                        {-63, -65}},
                    thickness = 0.5), 
                Text(
                    extent = {
                        {-67, 11}, 
                        {-47, 1}},
                    lineColor = {128, 128, 128},
                    textString = "VRRM"), 
                Text(
                    extent = {
                        {44, -2}, 
                        {64, -12}},
                    lineColor = {128, 128, 128},
                    textString = "VDRM"), 
                Line(points = {
                    {-57, 1}, 
                    {-57, -1}}), 
                Line(points = {
                    {54, 1}, 
                    {54, -1}}), 
                Line(
                    points = {
                        {55, 9}, 
                        {54, 11}, 
                        {50, 13}, 
                        {17, 17}, 
                        {15, 18}, 
                        {14, 20}},
                    pattern = LinePattern.Dot), 
                Text(
                    extent = {
                        {-28, -9}, 
                        {-8, -19}},
                    lineColor = {128, 128, 128},
                    textString = "Roff"), 
                Line(points = {
                    {2, 20}, 
                    {-2, 20}}), 
                Text(
                    extent = {
                        {-14, 23}, 
                        {-2, 16}},
                    lineColor = {128, 128, 128},
                    textString = "IH")}));
end Thyristor;