modelica / ModelicaStandardLibrary

Free (standard conforming) library to model mechanical (1D/3D), electrical (analog, digital, machines), magnetic, thermal, fluid, control systems and hierarchical state machines. Also numerical functions and functions for strings, files and streams are included.
https://doc.modelica.org
BSD 3-Clause "New" or "Revised" License
470 stars 167 forks source link

Adding new diode model to Modelica.Electrical.Analog #1413

Closed modelica-trac-importer closed 7 years ago

modelica-trac-importer commented 7 years ago

Modified by dietmarw on 18 Jun 2014 16:00 UTC The existing diode model in Modelica.Electrical.Analog.Semiconductors has some shortcomes:

For all these reasons Stefan Vorkoetter proposed an improved diode model which addresses the mentioned shortcomes.The Modelica code of this model is:

#!div style="font-size: 80%"
  ```mo
model Diode_improved "Improved diode model"
    import Modelica.SIunits;
    extends Modelica.Electrical.Analog.Interfaces.OnePort;
    parameter SIunits.Voltage Vf = 0.7 "Forward voltage";
    parameter SIunits.Current Ids = 1.e-13 "Reverse saturation current";
    parameter SIunits.Resistance Rs = 16 "Ohmic resistance";
    parameter SIunits.Voltage Vt = 0.026 "Thermal voltage (kT/q)";
    parameter Real N = 1 "Emission coefficient";
    parameter SIunits.Voltage Bv = 100 "Reverse breakdown voltage";
protected 
    parameter SIunits.Voltage VdMax = Vf + (N\*Vt) 
    "Linear continuation threshold";
    parameter SIunits.Voltage iVdMax = Ids \* (exp(VdMax/(N\*Vt)) - 1) 
    "Current at threshold";
    parameter SIunits.Conductance diVdMax = Ids \* exp(VdMax/(N\*Vt))/(N\*Vt) 
    "Conductance at threshold";
    SIunits.Voltage Vd "Voltage across pure diode part";
equation 
    i = smooth(1,
               if Vd < -Bv / 2 then 
                   -Ids \* (exp(-(Vd+Bv)/(N\*Vt)) + 1 - 2\*exp(-Bv/(2\*N*Vt)))
               elseif Vd < VdMax then 
                   Ids \* (exp(Vd/(N\*Vt)) - 1)
               else 
                   iVdMax + (Vd - VdMax) \* diVdMax);
                   /\* Lower half of reverse biased region including
                      breakdown. \*/
                   /\* Upper half of reverse biased region, and forward
                      biased region before conduction. \*/
                   /\* Forward biased region after conduction. \*/
    v = Vd + i \* Rs;
end Diode_improved;

}}} Nevertheless this diode model also has a small shortcome. It has no parallel conductance in order to ensure a small currentflow when the diode is closed in order to avoid singularity. Therefore, compared to the diode model of Stefan Vorkoettter, we propose the following slightly improved diode model:

#!div style="font-size: 80%"
  {{{#!mo
model Diode_improved "Improved diode model"
    import Modelica.SIunits;
    extends Modelica.Electrical.Analog.Interfaces.OnePort;
        parameter SIunits.Voltage Vf = 0.7 "Forward voltage";
    parameter SIunits.Current Ids = 1.e-13 "Reverse saturation current";
    parameter SIunits.Resistance Rs = 16 "Ohmic resistance";
    parameter SIunits.Voltage Vt = 0.026 "Thermal voltage (kT/q)";
    parameter Real N = 1 "Emission coefficient";
    parameter SIunits.Voltage Bv = 100 "Reverse breakdown voltage";
    parameter SIunits.Conductance Gp = 1e-6 
    "Parallel conductance for numerical stability";
protected 
    parameter SIunits.Voltage VdMax = Vf + (N\*Vt) 
    "Linear continuation threshold";
    parameter SIunits.Voltage iVdMax = Ids \* (exp(VdMax/(N\*Vt)) - 1) 
    "Current at threshold";
    parameter SIunits.Conductance diVdMax = Ids \* exp(VdMax/(N\*Vt))/(N\*Vt) 
    "Conductance at threshold";
    SIunits.Voltage Vd "Voltage across pure diode part";
    SIunits.Current id "diode current";
equation 
    id = smooth(1,
               if Vd < -Bv / 2 then 
                   -Ids \* (exp(-(Vd+Bv)/(N\*Vt)) + 1 - 2\*exp(-Bv/(2\*N*Vt)))
               elseif Vd < VdMax then 
                   Ids \* (exp(Vd/(N\*Vt)) - 1)
               else 
                   iVdMax + (Vd - VdMax) \* diVdMax);
                   /\* Lower half of reverse biased region including
                      breakdown. \*/
                   /\* Upper half of reverse biased region, and forward
                      biased region before conduction. \*/
                   /\* Forward biased region after conduction. \*/
    v = Vd + id \* Rs;
    i = id + v\*Gp;
end Diode_improved;

}}} We are planning to add (i.e. additional to the existing diode models) this improved diode model in Modelica.Electrica.Analog.Semiconductors. It will be named Diode_improved. We would like to discuss our plans here. Is anyone against adding this improved diode model? Best regards Kristin Majetta


----

**Reported by majetta on 6 Feb 2014 10:46 UTC**
The existing diode model in Modelica.Electrical.Analog.Semiconductors has some shortcomes:

 * it does not model reverse breakdown (this is done in the ZDiode model in the same package)
 * the  behaviour of the model is controlled by the physically-meaningless  parameter Maxexp, for which it is difficult to supply an apropriate  value
 * it does not model an internal series resistance

For  all these reasons Stefan Vorkoetter proposed an improved diode model  which addresses the mentioned shortcomes.The Modelica code of this model  is:

!div style="font-size: 80%"

model Diode_improved "Improved diode model"
    import Modelica.SIunits;
    extends Modelica.Electrical.Analog.Interfaces.OnePort;
    parameter SIunits.Voltage Vf = 0.7 "Forward voltage";
    parameter SIunits.Current Ids = 1.e-13 "Reverse saturation current";
    parameter SIunits.Resistance Rs = 16 "Ohmic resistance";
    parameter SIunits.Voltage Vt = 0.026 "Thermal voltage (kT/q)";
    parameter Real N = 1 "Emission coefficient";
    parameter SIunits.Voltage Bv = 100 "Reverse breakdown voltage";
protected 
    parameter SIunits.Voltage VdMax = Vf + (N\*Vt) 
    "Linear continuation threshold";
    parameter SIunits.Voltage iVdMax = Ids \* (exp(VdMax/(N\*Vt)) - 1) 
    "Current at threshold";
    parameter SIunits.Conductance diVdMax = Ids \* exp(VdMax/(N\*Vt))/(N\*Vt) 
    "Conductance at threshold";
    SIunits.Voltage Vd "Voltage across pure diode part";
equation 
    i = smooth(1,
               if Vd < -Bv / 2 then 
                   -Ids \* (exp(-(Vd+Bv)/(N\*Vt)) + 1 - 2\*exp(-Bv/(2\*N*Vt)))
               elseif Vd < VdMax then 
                   Ids \* (exp(Vd/(N\*Vt)) - 1)
               else 
                   iVdMax + (Vd - VdMax) \* diVdMax);
                   /\* Lower half of reverse biased region including
                      breakdown. \*/
                   /\* Upper half of reverse biased region, and forward
                      biased region before conduction. \*/
                   /\* Forward biased region after conduction. \*/
    v = Vd + i \* Rs;
end Diode_improved;

}}} Nevertheless this diode model also has a small shortcome. It has no parallel conductance in order to ensure a small currentflow when the diode is closed in order to avoid singularity. Therefore, compared to the diode model of Stefan Vorkoettter, we propose the following slightly improved diode model:

#!div style="font-size: 80%"
  {{{#!python
model Diode_improved "Improved diode model"
    import Modelica.SIunits;
    extends Modelica.Electrical.Analog.Interfaces.OnePort;
        parameter SIunits.Voltage Vf = 0.7 "Forward voltage";
    parameter SIunits.Current Ids = 1.e-13 "Reverse saturation current";
    parameter SIunits.Resistance Rs = 16 "Ohmic resistance";
    parameter SIunits.Voltage Vt = 0.026 "Thermal voltage (kT/q)";
    parameter Real N = 1 "Emission coefficient";
    parameter SIunits.Voltage Bv = 100 "Reverse breakdown voltage";
    parameter SIunits.Conductance Gp = 1e-6 
    "Parallel conductance for numerical stability";
protected 
    parameter SIunits.Voltage VdMax = Vf + (N\*Vt) 
    "Linear continuation threshold";
    parameter SIunits.Voltage iVdMax = Ids \* (exp(VdMax/(N\*Vt)) - 1) 
    "Current at threshold";
    parameter SIunits.Conductance diVdMax = Ids \* exp(VdMax/(N\*Vt))/(N\*Vt) 
    "Conductance at threshold";
    SIunits.Voltage Vd "Voltage across pure diode part";
    SIunits.Current id "diode current";
equation 
    id = smooth(1,
               if Vd < -Bv / 2 then 
                   -Ids \* (exp(-(Vd+Bv)/(N\*Vt)) + 1 - 2\*exp(-Bv/(2\*N*Vt)))
               elseif Vd < VdMax then 
                   Ids \* (exp(Vd/(N\*Vt)) - 1)
               else 
                   iVdMax + (Vd - VdMax) \* diVdMax);
                   /\* Lower half of reverse biased region including
                      breakdown. \*/
                   /\* Upper half of reverse biased region, and forward
                      biased region before conduction. \*/
                   /\* Forward biased region after conduction. \*/
    v = Vd + id \* Rs;
    i = id + v\*Gp;
end Diode_improved;

}}} We are planning to add (i.e. additional to the existing diode models) this improved diode model in Modelica.Electrica.Analog.Semiconductors. It will be named Diode_improved. We would like to discuss our plans here. Is anyone against adding this improved diode model? Best regards Kristin Majetta



----

Migrated-From: https://trac.modelica.org/Modelica/ticket/1413
modelica-trac-importer commented 7 years ago

Modified by jmattsson on 18 Jun 2014 11:50 UTC

modelica-trac-importer commented 7 years ago

Modified by dietmarw on 18 Jun 2014 16:00 UTC

modelica-trac-importer commented 7 years ago

Comment by dietmarw on 18 Jun 2014 16:08 UTC Namewise I would not go for such long name but keeping to the same principle that is already used in other places of the MSL, i.e., adding an increment to the name:

model Diode2 "Improved version of 'Diode' model"
...
end Diode2;
modelica-trac-importer commented 7 years ago

Comment by majetta on 19 Jun 2014 05:49 UTC I added the improved diode model called Diode2 to the trunk (368044865de4f237765eddd44f31fea8676863f4).

modelica-trac-importer commented 7 years ago

Comment by beutlich on 19 Jun 2014 06:31 UTC It's no longer undecided then.

modelica-trac-importer commented 7 years ago

Comment by beutlich on 6 Oct 2015 09:49 UTC So it's fixed then, I suppose?

modelica-trac-importer commented 7 years ago

Changelog modified by beutlich on 6 Oct 2015 09:49 UTC Added an improved diode model (Modelica.Electrical.Analog.Semiconductors.Diode2)

modelica-trac-importer commented 7 years ago

Modified by beutlich on 29 Oct 2015 15:02 UTC