model PMOS "Simple MOS Transistor"
Interfaces.Pin D "Drain"
annotation (Placement(
transformation(extent = {
{90, 50},
{110, 70}}),
iconTransformation(extent = {
{90, 50},
{110, 70}})));
Interfaces.Pin G "Gate"
annotation (Placement(
transformation(extent = {
{-90, -50},
{-110, -70}}),
iconTransformation(extent = {
{-90, -50},
{-110, -70}})));
Interfaces.Pin S "Source"
annotation (Placement(
transformation(extent = {
{90, -50},
{110, -70}}),
iconTransformation(extent = {
{90, -50},
{110, -70}})));
Interfaces.Pin B "Bulk"
annotation (Placement(transformation(extent = {
{90, -10},
{110, 10}})));
parameter SI.Length W = 2e-5 "Width";
parameter SI.Length L = 6e-6 "Length";
parameter SI.Transconductance Beta = 1.05e-5 "Transconductance parameter";
parameter SI.Voltage Vt = -1 "Zero bias threshold voltage";
parameter Real K2 = 0.41 "Bulk threshold parameter";
parameter Real K5 = 0.839 "Reduction of pinch-off region";
parameter SI.Length dW = -2.5e-6 "Narrowing of channel";
parameter SI.Length dL = -2.1e-6 "Shortening of channel";
parameter SI.Resistance RDS = 1e+7 "Drain-Source-Resistance";
extends Modelica.Electrical.Analog.Interfaces.ConditionalHeatPort(T = 293.15);
protected
Real v;
Real uds;
Real ubs;
Real ugst;
Real ud;
Real us;
Real id;
Real gds;
equation
assert(0 < L + dL, "PMOS: Effective length must be positive");
assert(0 < W + dW, "PMOS: Effective width must be positive");
v = Beta * (W + dW) / (L + dL);
LossPower = D.i * (D.v - S.v);
gds = if RDS < 1e-20 and -1e-20 < RDS then 1e+20 else RDS ^ (-1);
id = smooth(0, if 0 <= ugst then uds * gds else if ugst < uds then -v * uds * (ugst - 0.5 * uds) + uds * gds else -0.5 * (v * ugst * ugst) + uds * gds);
ubs = smooth(0, if B.v < us then 0 else B.v - us);
ud = smooth(0, if S.v < D.v then S.v else D.v);
uds = ud - us;
ugst = (G.v - us - Vt + K2 * ubs) * K5;
us = smooth(0, if S.v < D.v then D.v else S.v);
B.i = 0;
D.i = smooth(0, if S.v < D.v then -id else id);
G.i = 0;
S.i = smooth(0, if S.v < D.v then id else -id);
annotation (
Documentation(
info = "<html>\n<p>\nThe PMOS model is a simple model of a p-channel metal-oxide semiconductor\nFET. It differs slightly from the device used in the SPICE simulator.\nFor more details please care for H. Spiro.\n</p>\n<p>\nThe model does not consider capacitances. A high drain-source resistance RDS\nis included to avoid numerical difficulties.\n<br><br>\n<strong>Please note:</strong>\nIn case of useHeatPort=true the temperature dependence of the electrical\nbehavior is <strong>not</strong> modelled yet. The parameters are not temperature dependent.\n</p>\n<dl>\n<dt><strong>References:</strong></dt>\n<dd>Spiro, H.: Simulation integrierter Schaltungen. R. Oldenbourg Verlag\n Muenchen Wien 1990.</dd>\n</dl>\n<p>\nSome typical parameter sets are:\n</p>\n<pre>\n W L Beta Vt K2 K5 DW DL\n m m A/V^2 V - - m m\n 50.e-6 8.e-6 0.0085e-3 -0.15 0.41 0.839 -3.8e-6 -4.0e-6\n 20.e-6 6.e-6 0.0105e-3 -1.0 0.41 0.839 -2.5e-6 -2.1e-6\n 30.e-6 5.e-6 0.0059e-3 -0.3 0.98 1.01 0 -3.9e-6\n 30.e-6 5.e-6 0.0152e-3 -0.69 0.104 1.1 -0.8e-6 -0.4e-6\n 30.e-6 5.e-6 0.0163e-3 -0.69 0.104 1.1 -0.8e-6 -0.4e-6\n 30.e-6 5.e-6 0.0182e-3 -0.69 0.086 1.06 -0.1e-6 -0.6e-6\n 20.e-6 6.e-6 0.0074e-3 -1. 0.4 0.59 0 0\n</pre>\n\n</html>",
revisions = "<html>\n<ul>\n<li><em> March 11, 2009 </em>\n by Christoph Clauss<br> conditional heat port added<br>\n </li>\n<li><em>December 7, 2005 </em>\n by Christoph Clauss<br>\n error in RDS calculation deleted</li>\n<li><em> 1998 </em>\n by Christoph Clauss<br> initially implemented<br>\n </li>\n</ul>\n</html>"),
Icon(
coordinateSystem(
preserveAspectRatio = true,
extent = {
{-100, -100},
{100, 100}}),
graphics = {
Line(
points = {
{-90, -60},
{-10, -60}},
color = {0, 0, 255}),
Line(
points = {
{-10, -60},
{-10, 60}},
color = {0, 0, 255}),
Line(
points = {
{10, 80},
{10, 39}},
color = {0, 0, 255}),
Line(
points = {
{10, 20},
{10, -21}},
color = {0, 0, 255}),
Line(
points = {
{10, -40},
{10, -81}},
color = {0, 0, 255}),
Line(
points = {
{10, 60},
{91, 60}},
color = {0, 0, 255}),
Line(
points = {
{10, 0},
{90, 0}},
color = {0, 0, 255}),
Line(
points = {
{10, -60},
{90, -60}},
color = {0, 0, 255}),
Polygon(
points = {
{60, 0},
{40, 5},
{40, -5},
{60, 0}},
fillColor = {0, 0, 255},
fillPattern = FillPattern.Solid,
lineColor = {0, 0, 255}),
Text(
extent = {
{-150, 130},
{150, 90}},
textString = "%name",
lineColor = {0, 0, 255}),
Line(
visible = useHeatPort,
points = {
{0, -90},
{0, 0}},
color = {127, 0, 0},
pattern = LinePattern.Dot)}));
end PMOS;