Spice3 NMOS模型与标准Modelica模型的接口

Spice3 NMOS模型与标准Modelica模型的接口,modelica,openmodelica,Modelica,Openmodelica,在尝试使用Spice3库的NMOS模型和标准Modelica电压源模型时,我在OpenModelica中遇到了一个问题。参考带有RL负载的简单半桥配置示例,我模拟了以下情况: a) 在低端NMOS(Modelica.Electrical.Spice3.Semiconductors.M\NMOS)的栅极上使用Spice3脉冲电压源(Modelica.Electrical.Spice3.Sources.V\u pulse)->所有Spice模型 b) 在低端NMOS(Modelica.Electri

在尝试使用Spice3库的NMOS模型和标准Modelica电压源模型时,我在OpenModelica中遇到了一个问题。参考带有RL负载的简单半桥配置示例,我模拟了以下情况:

a) 在低端NMOS(Modelica.Electrical.Spice3.Semiconductors.M\NMOS)的栅极上使用Spice3脉冲电压源(Modelica.Electrical.Spice3.Sources.V\u pulse)->所有Spice模型

b) 在低端NMOS(Modelica.Electrical.Spice3.Semiconductors.M_NMOS)的栅极上使用Modelica脉冲源(Modelica.Blocks.Sources.pulse)和信号控制电压源(Modelica.Electrical.Analog.Sources.SignalVoltage)->Spice模型和Modelica模型的混合

在案例a)中,模拟工作正常,结果符合预期(电流值为电感负载,“在”低侧和高侧NMOS模型内,作为漏极/源极/体电流值)。 相反,在案例b)中,模拟存在收敛问题。此外,负载电流的部分结果似乎是预期的,但从两个NMOS模型内部看,漏极/源极/体电流值不是预期的

有人能帮我解决“测试”示意图中的问题吗? 有人知道Spice3模型和Modelica模型之间是否存在兼容性问题吗

链接模型(案例a):

链接模式(案例b):


提前谢谢

总结原始问题的评论:

  • MSL和SPICE3之间没有兼容性问题
  • 该问题特定于模型,即使用的SPICE3模型,结合理想矩形电压作为激励
下面,从问题的谷歌驱动器链接中查找代码,以防它们在将来某个时候不起作用。所有示例都是由Know83创建的

a) 原始工作模式:

model Test_NMOS_ok
  Modelica.Electrical.Spice3.Semiconductors.M_NMOS m_nmos(modelcard = mos_model) annotation(
    Placement(visible = true, transformation(origin = {0, -10}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
  Modelica.Electrical.Spice3.Sources.V_constant v_constant(V = 13.5)  annotation(
    Placement(visible = true, transformation(origin = {-80, 56}, extent = {{-10, -10}, {10, 10}}, rotation = -90)));
  Modelica.Electrical.Spice3.Basic.Ground ground1 annotation(
    Placement(visible = true, transformation(origin = {0, -62}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
  Modelica.Electrical.Spice3.Basic.Ground ground annotation(
    Placement(visible = true, transformation(origin = {-80, 30}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
  Modelica.Electrical.Spice3.Basic.R_Resistor r_Resistor(R = 2.4)  annotation(
    Placement(visible = true, transformation(origin = {62, 52}, extent = {{-10, -10}, {10, 10}}, rotation = -90)));
  parameter Modelica.Electrical.Spice3.Semiconductors.ModelcardMOS mos_model( CBD = 1e-12, CBS = 1e-12,KP = 20, LAMBDA = 0.001, NSUB = 1e15, VTO = 2.48) annotation(
    Placement(visible = true, transformation(origin = {-38, -74}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
  Modelica.Electrical.Spice3.Basic.L_Inductor l_Inductor(IC = 0, L = 1.4e-03)  annotation(
    Placement(visible = true, transformation(origin = {62, 26}, extent = {{-10, -10}, {10, 10}}, rotation = -90)));
  Modelica.Electrical.Spice3.Semiconductors.M_NMOS m_nmos1(modelcard = mos_model) annotation(
    Placement(visible = true, transformation(origin = {1, 42}, extent = {{-9, -10}, {9, 10}}, rotation = 0)));
  Modelica.Electrical.Spice3.Sources.V_constant v_constant1(V = 0)  annotation(
    Placement(visible = true, transformation(origin = {-32, 26}, extent = {{-10, -10}, {10, 10}}, rotation = -90)));
  Modelica.Electrical.Spice3.Sources.V_pulse v_pulse(PER = 1e-03, PW = 0.5e-03, TD = 1e-03, TF = 50e-09, TR = 50e-09, V1 = 0, V2 = 5) annotation(
    Placement(visible = true, transformation(origin = {-34, -22}, extent = {{10, -10}, {-10, 10}}, rotation = 90)));
equation
  connect(m_nmos.B, m_nmos.S) annotation(
    Line(points = {{10, -10}, {16, -10}, {16, -20}, {0, -20}}, color = {0, 0, 255}));
  connect(ground1.p, m_nmos.S) annotation(
    Line(points = {{0, -52}, {0, -20}}, color = {0, 0, 255}));
  connect(v_constant.n, ground.p) annotation(
    Line(points = {{-80, 46}, {-80, 40}}, color = {0, 0, 255}));
  connect(r_Resistor.p, v_constant.p) annotation(
    Line(points = {{62, 62}, {62, 72}, {-80, 72}, {-80, 66}}, color = {0, 0, 255}));
  connect(r_Resistor.n, l_Inductor.p) annotation(
    Line(points = {{62, 42}, {62, 36}}, color = {0, 0, 255}));
  connect(l_Inductor.n, m_nmos.D) annotation(
    Line(points = {{62, 16}, {62, 7}, {0, 7}, {0, 0}}, color = {0, 0, 255}));
  connect(m_nmos1.S, m_nmos.D) annotation(
    Line(points = {{1, 32}, {1, 15}, {0, 15}, {0, 0}}, color = {0, 0, 255}));
  connect(m_nmos1.D, v_constant.p) annotation(
    Line(points = {{1, 52}, {1, 72}, {-80, 72}, {-80, 66}}, color = {0, 0, 255}));
  connect(m_nmos1.B, m_nmos1.S) annotation(
    Line(points = {{10, 42}, {10, 32}, {1, 32}}, color = {0, 0, 255}));
  connect(v_constant1.p, m_nmos1.G) annotation(
    Line(points = {{-32, 36}, {-32, 42}, {-8, 42}}, color = {0, 0, 255}));
  connect(v_constant1.n, m_nmos1.S) annotation(
    Line(points = {{-32, 16}, {0, 16}, {0, 22}, {2, 22}, {2, 32}}, color = {0, 0, 255}));
  connect(v_pulse.n, ground1.p) annotation(
    Line(points = {{-34, -32}, {-34, -52}, {0, -52}}, color = {0, 0, 255}));
  connect(v_pulse.p, m_nmos.G) annotation(
    Line(points = {{-34, -12}, {-10, -12}, {-10, -10}}, color = {0, 0, 255}));
  annotation(
    uses(Modelica(version = "3.2.3")));
end Test_NMOS_ok;
model Test_NMOS_nok
  Modelica.Electrical.Spice3.Semiconductors.M_NMOS m_nmos(modelcard = mos_model) annotation(
    Placement(visible = true, transformation(origin = {0, -10}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
  Modelica.Electrical.Spice3.Sources.V_constant v_constant(V = 13.5)  annotation(
    Placement(visible = true, transformation(origin = {-80, 56}, extent = {{-10, -10}, {10, 10}}, rotation = -90)));
  Modelica.Electrical.Spice3.Basic.Ground ground1 annotation(
    Placement(visible = true, transformation(origin = {0, -62}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
  Modelica.Electrical.Spice3.Basic.Ground ground annotation(
    Placement(visible = true, transformation(origin = {-80, 30}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
  Modelica.Electrical.Spice3.Basic.R_Resistor r_Resistor(R = 2.4)  annotation(
    Placement(visible = true, transformation(origin = {62, 52}, extent = {{-10, -10}, {10, 10}}, rotation = -90)));
  parameter Modelica.Electrical.Spice3.Semiconductors.ModelcardMOS mos_model( CBD = 1e-12, CBS = 1e-12,KP = 20, LAMBDA = 0.001, NSUB = 1e15, VTO = 2.48) annotation(
    Placement(visible = true, transformation(origin = {-38, -74}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
  Modelica.Electrical.Spice3.Basic.L_Inductor l_Inductor(IC = 0, L = 1.4e-03)  annotation(
    Placement(visible = true, transformation(origin = {62, 26}, extent = {{-10, -10}, {10, 10}}, rotation = -90)));
  Modelica.Electrical.Spice3.Semiconductors.M_NMOS m_nmos1(modelcard = mos_model) annotation(
    Placement(visible = true, transformation(origin = {1, 42}, extent = {{-9, -10}, {9, 10}}, rotation = 0)));
  Modelica.Electrical.Spice3.Sources.V_constant v_constant1(V = 0)  annotation(
    Placement(visible = true, transformation(origin = {-32, 26}, extent = {{-10, -10}, {10, 10}}, rotation = -90)));
  Modelica.Blocks.Sources.Pulse pulse(amplitude = 5, offset = 0, period = 1e-03, startTime = 1e-03, width = 50) annotation(
    Placement(visible = true, transformation(origin = {-78, -24}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
  Modelica.Electrical.Analog.Sources.SignalVoltage signalVoltage annotation(
    Placement(visible = true, transformation(origin = {-38, -24}, extent = {{-14, 14}, {14, -14}}, rotation = -90)));
equation
  connect(m_nmos.B, m_nmos.S) annotation(
    Line(points = {{10, -10}, {16, -10}, {16, -20}, {0, -20}}, color = {0, 0, 255}));
  connect(ground1.p, m_nmos.S) annotation(
    Line(points = {{0, -52}, {0, -20}}, color = {0, 0, 255}));
  connect(v_constant.n, ground.p) annotation(
    Line(points = {{-80, 46}, {-80, 40}}, color = {0, 0, 255}));
  connect(r_Resistor.p, v_constant.p) annotation(
    Line(points = {{62, 62}, {62, 72}, {-80, 72}, {-80, 66}}, color = {0, 0, 255}));
  connect(r_Resistor.n, l_Inductor.p) annotation(
    Line(points = {{62, 42}, {62, 36}}, color = {0, 0, 255}));
  connect(l_Inductor.n, m_nmos.D) annotation(
    Line(points = {{62, 16}, {62, 7}, {0, 7}, {0, 0}}, color = {0, 0, 255}));
  connect(m_nmos1.S, m_nmos.D) annotation(
    Line(points = {{1, 32}, {1, 15}, {0, 15}, {0, 0}}, color = {0, 0, 255}));
  connect(m_nmos1.D, v_constant.p) annotation(
    Line(points = {{1, 52}, {1, 72}, {-80, 72}, {-80, 66}}, color = {0, 0, 255}));
  connect(m_nmos1.B, m_nmos1.S) annotation(
    Line(points = {{10, 42}, {10, 32}, {1, 32}}, color = {0, 0, 255}));
  connect(v_constant1.p, m_nmos1.G) annotation(
    Line(points = {{-32, 36}, {-32, 42}, {-8, 42}}, color = {0, 0, 255}));
  connect(v_constant1.n, m_nmos1.S) annotation(
    Line(points = {{-32, 16}, {0, 16}, {0, 22}, {2, 22}, {2, 32}}, color = {0, 0, 255}));
  connect(signalVoltage.v, pulse.y) annotation(
    Line(points = {{-55, -24}, {-66, -24}}, color = {0, 0, 127}));
  connect(signalVoltage.p, m_nmos.G) annotation(
    Line(points = {{-38, -10}, {-10, -10}}, color = {0, 0, 255}));
  connect(signalVoltage.n, ground1.p) annotation(
    Line(points = {{-38, -38}, {-38, -52}, {0, -52}}, color = {0, 0, 255}));
  annotation(
    uses(Modelica(version = "3.2.3")),
    Diagram);
end Test_NMOS_nok;
b) 原始不工作模式:

model Test_NMOS_ok
  Modelica.Electrical.Spice3.Semiconductors.M_NMOS m_nmos(modelcard = mos_model) annotation(
    Placement(visible = true, transformation(origin = {0, -10}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
  Modelica.Electrical.Spice3.Sources.V_constant v_constant(V = 13.5)  annotation(
    Placement(visible = true, transformation(origin = {-80, 56}, extent = {{-10, -10}, {10, 10}}, rotation = -90)));
  Modelica.Electrical.Spice3.Basic.Ground ground1 annotation(
    Placement(visible = true, transformation(origin = {0, -62}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
  Modelica.Electrical.Spice3.Basic.Ground ground annotation(
    Placement(visible = true, transformation(origin = {-80, 30}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
  Modelica.Electrical.Spice3.Basic.R_Resistor r_Resistor(R = 2.4)  annotation(
    Placement(visible = true, transformation(origin = {62, 52}, extent = {{-10, -10}, {10, 10}}, rotation = -90)));
  parameter Modelica.Electrical.Spice3.Semiconductors.ModelcardMOS mos_model( CBD = 1e-12, CBS = 1e-12,KP = 20, LAMBDA = 0.001, NSUB = 1e15, VTO = 2.48) annotation(
    Placement(visible = true, transformation(origin = {-38, -74}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
  Modelica.Electrical.Spice3.Basic.L_Inductor l_Inductor(IC = 0, L = 1.4e-03)  annotation(
    Placement(visible = true, transformation(origin = {62, 26}, extent = {{-10, -10}, {10, 10}}, rotation = -90)));
  Modelica.Electrical.Spice3.Semiconductors.M_NMOS m_nmos1(modelcard = mos_model) annotation(
    Placement(visible = true, transformation(origin = {1, 42}, extent = {{-9, -10}, {9, 10}}, rotation = 0)));
  Modelica.Electrical.Spice3.Sources.V_constant v_constant1(V = 0)  annotation(
    Placement(visible = true, transformation(origin = {-32, 26}, extent = {{-10, -10}, {10, 10}}, rotation = -90)));
  Modelica.Electrical.Spice3.Sources.V_pulse v_pulse(PER = 1e-03, PW = 0.5e-03, TD = 1e-03, TF = 50e-09, TR = 50e-09, V1 = 0, V2 = 5) annotation(
    Placement(visible = true, transformation(origin = {-34, -22}, extent = {{10, -10}, {-10, 10}}, rotation = 90)));
equation
  connect(m_nmos.B, m_nmos.S) annotation(
    Line(points = {{10, -10}, {16, -10}, {16, -20}, {0, -20}}, color = {0, 0, 255}));
  connect(ground1.p, m_nmos.S) annotation(
    Line(points = {{0, -52}, {0, -20}}, color = {0, 0, 255}));
  connect(v_constant.n, ground.p) annotation(
    Line(points = {{-80, 46}, {-80, 40}}, color = {0, 0, 255}));
  connect(r_Resistor.p, v_constant.p) annotation(
    Line(points = {{62, 62}, {62, 72}, {-80, 72}, {-80, 66}}, color = {0, 0, 255}));
  connect(r_Resistor.n, l_Inductor.p) annotation(
    Line(points = {{62, 42}, {62, 36}}, color = {0, 0, 255}));
  connect(l_Inductor.n, m_nmos.D) annotation(
    Line(points = {{62, 16}, {62, 7}, {0, 7}, {0, 0}}, color = {0, 0, 255}));
  connect(m_nmos1.S, m_nmos.D) annotation(
    Line(points = {{1, 32}, {1, 15}, {0, 15}, {0, 0}}, color = {0, 0, 255}));
  connect(m_nmos1.D, v_constant.p) annotation(
    Line(points = {{1, 52}, {1, 72}, {-80, 72}, {-80, 66}}, color = {0, 0, 255}));
  connect(m_nmos1.B, m_nmos1.S) annotation(
    Line(points = {{10, 42}, {10, 32}, {1, 32}}, color = {0, 0, 255}));
  connect(v_constant1.p, m_nmos1.G) annotation(
    Line(points = {{-32, 36}, {-32, 42}, {-8, 42}}, color = {0, 0, 255}));
  connect(v_constant1.n, m_nmos1.S) annotation(
    Line(points = {{-32, 16}, {0, 16}, {0, 22}, {2, 22}, {2, 32}}, color = {0, 0, 255}));
  connect(v_pulse.n, ground1.p) annotation(
    Line(points = {{-34, -32}, {-34, -52}, {0, -52}}, color = {0, 0, 255}));
  connect(v_pulse.p, m_nmos.G) annotation(
    Line(points = {{-34, -12}, {-10, -12}, {-10, -10}}, color = {0, 0, 255}));
  annotation(
    uses(Modelica(version = "3.2.3")));
end Test_NMOS_ok;
model Test_NMOS_nok
  Modelica.Electrical.Spice3.Semiconductors.M_NMOS m_nmos(modelcard = mos_model) annotation(
    Placement(visible = true, transformation(origin = {0, -10}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
  Modelica.Electrical.Spice3.Sources.V_constant v_constant(V = 13.5)  annotation(
    Placement(visible = true, transformation(origin = {-80, 56}, extent = {{-10, -10}, {10, 10}}, rotation = -90)));
  Modelica.Electrical.Spice3.Basic.Ground ground1 annotation(
    Placement(visible = true, transformation(origin = {0, -62}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
  Modelica.Electrical.Spice3.Basic.Ground ground annotation(
    Placement(visible = true, transformation(origin = {-80, 30}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
  Modelica.Electrical.Spice3.Basic.R_Resistor r_Resistor(R = 2.4)  annotation(
    Placement(visible = true, transformation(origin = {62, 52}, extent = {{-10, -10}, {10, 10}}, rotation = -90)));
  parameter Modelica.Electrical.Spice3.Semiconductors.ModelcardMOS mos_model( CBD = 1e-12, CBS = 1e-12,KP = 20, LAMBDA = 0.001, NSUB = 1e15, VTO = 2.48) annotation(
    Placement(visible = true, transformation(origin = {-38, -74}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
  Modelica.Electrical.Spice3.Basic.L_Inductor l_Inductor(IC = 0, L = 1.4e-03)  annotation(
    Placement(visible = true, transformation(origin = {62, 26}, extent = {{-10, -10}, {10, 10}}, rotation = -90)));
  Modelica.Electrical.Spice3.Semiconductors.M_NMOS m_nmos1(modelcard = mos_model) annotation(
    Placement(visible = true, transformation(origin = {1, 42}, extent = {{-9, -10}, {9, 10}}, rotation = 0)));
  Modelica.Electrical.Spice3.Sources.V_constant v_constant1(V = 0)  annotation(
    Placement(visible = true, transformation(origin = {-32, 26}, extent = {{-10, -10}, {10, 10}}, rotation = -90)));
  Modelica.Blocks.Sources.Pulse pulse(amplitude = 5, offset = 0, period = 1e-03, startTime = 1e-03, width = 50) annotation(
    Placement(visible = true, transformation(origin = {-78, -24}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
  Modelica.Electrical.Analog.Sources.SignalVoltage signalVoltage annotation(
    Placement(visible = true, transformation(origin = {-38, -24}, extent = {{-14, 14}, {14, -14}}, rotation = -90)));
equation
  connect(m_nmos.B, m_nmos.S) annotation(
    Line(points = {{10, -10}, {16, -10}, {16, -20}, {0, -20}}, color = {0, 0, 255}));
  connect(ground1.p, m_nmos.S) annotation(
    Line(points = {{0, -52}, {0, -20}}, color = {0, 0, 255}));
  connect(v_constant.n, ground.p) annotation(
    Line(points = {{-80, 46}, {-80, 40}}, color = {0, 0, 255}));
  connect(r_Resistor.p, v_constant.p) annotation(
    Line(points = {{62, 62}, {62, 72}, {-80, 72}, {-80, 66}}, color = {0, 0, 255}));
  connect(r_Resistor.n, l_Inductor.p) annotation(
    Line(points = {{62, 42}, {62, 36}}, color = {0, 0, 255}));
  connect(l_Inductor.n, m_nmos.D) annotation(
    Line(points = {{62, 16}, {62, 7}, {0, 7}, {0, 0}}, color = {0, 0, 255}));
  connect(m_nmos1.S, m_nmos.D) annotation(
    Line(points = {{1, 32}, {1, 15}, {0, 15}, {0, 0}}, color = {0, 0, 255}));
  connect(m_nmos1.D, v_constant.p) annotation(
    Line(points = {{1, 52}, {1, 72}, {-80, 72}, {-80, 66}}, color = {0, 0, 255}));
  connect(m_nmos1.B, m_nmos1.S) annotation(
    Line(points = {{10, 42}, {10, 32}, {1, 32}}, color = {0, 0, 255}));
  connect(v_constant1.p, m_nmos1.G) annotation(
    Line(points = {{-32, 36}, {-32, 42}, {-8, 42}}, color = {0, 0, 255}));
  connect(v_constant1.n, m_nmos1.S) annotation(
    Line(points = {{-32, 16}, {0, 16}, {0, 22}, {2, 22}, {2, 32}}, color = {0, 0, 255}));
  connect(signalVoltage.v, pulse.y) annotation(
    Line(points = {{-55, -24}, {-66, -24}}, color = {0, 0, 127}));
  connect(signalVoltage.p, m_nmos.G) annotation(
    Line(points = {{-38, -10}, {-10, -10}}, color = {0, 0, 255}));
  connect(signalVoltage.n, ground1.p) annotation(
    Line(points = {{-38, -38}, {-38, -52}, {0, -52}}, color = {0, 0, 255}));
  annotation(
    uses(Modelica(version = "3.2.3")),
    Diagram);
end Test_NMOS_nok;
c) 固定有回转率限制器的型号:

model Test_NMOS_nok_corrected_with_slew_reate   Modelica.Electrical.Spice3.Semiconductors.M_NMOS m_nmos(modelcard = mos_model) annotation(
    Placement(visible = true, transformation(origin = {0, -10}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));   Modelica.Electrical.Spice3.Sources.V_constant v_constant(V = 13.5)  annotation(
    Placement(visible = true, transformation(origin = {-176, 56}, extent = {{-10, -10}, {10, 10}}, rotation = -90)));   Modelica.Electrical.Spice3.Basic.Ground ground1 annotation(
    Placement(visible = true, transformation(origin = {0, -62}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));   Modelica.Electrical.Spice3.Basic.Ground ground annotation(
    Placement(visible = true, transformation(origin = {-176, 30}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));   Modelica.Electrical.Spice3.Basic.R_Resistor r_Resistor(R = 2.4)  annotation(
    Placement(visible = true, transformation(origin = {62, 52}, extent = {{-10, -10}, {10, 10}}, rotation = -90)));   parameter Modelica.Electrical.Spice3.Semiconductors.ModelcardMOS mos_model( CBD
= 1e-12, CBS = 1e-12,KP = 20, LAMBDA = 0.001, NSUB = 1e15, VTO = 2.48) annotation(
    Placement(visible = true, transformation(origin = {46, -72}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));   Modelica.Electrical.Spice3.Basic.L_Inductor l_Inductor(IC = 0, L =
1.4e-03)  annotation(
    Placement(visible = true, transformation(origin = {62, 26}, extent = {{-10, -10}, {10, 10}}, rotation = -90)));   Modelica.Electrical.Spice3.Semiconductors.M_NMOS m_nmos1(modelcard = mos_model) annotation(
    Placement(visible = true, transformation(origin = {1, 42}, extent = {{-9, -10}, {9, 10}}, rotation = 0)));   Modelica.Blocks.Sources.Pulse pulse(amplitude = 5, offset = 0, period
= 1e-03, startTime = 1e-03, width = 50) annotation(
    Placement(visible = true, transformation(origin = {-182, -24}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));   Modelica.Electrical.Analog.Sources.SignalVoltage signalVoltage annotation(
    Placement(visible = true, transformation(origin = {-38, -24}, extent = {{-14, 14}, {14, -14}}, rotation = -90)));   Modelica.Blocks.Nonlinear.SlewRateLimiter slewRateLimiter(Rising = 5 / 1e-6, Td = 1e-07) annotation(
    Placement(visible = true, transformation(origin = {-128, -24}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));   Modelica.Electrical.Analog.Sources.SignalVoltage signalVoltage1 annotation(
    Placement(visible = true, transformation(origin = {-70, 28}, extent = {{10, -10}, {-10, 10}}, rotation = 90)));   Modelica.Blocks.Sources.Constant const(k = 0) annotation(
    Placement(visible = true, transformation(origin = {-122, 28}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); equation   connect(m_nmos.B, m_nmos.S) annotation(
    Line(points = {{10, -10}, {16, -10}, {16, -20}, {0, -20}}, color = {0, 0, 255}));   connect(ground1.p, m_nmos.S) annotation(
    Line(points = {{0, -52}, {0, -20}}, color = {0, 0, 255}));   connect(v_constant.n, ground.p) annotation(
    Line(points = {{-176, 46}, {-176, 40}}, color = {0, 0, 255}));   connect(r_Resistor.p, v_constant.p) annotation(
    Line(points = {{62, 62}, {62, 72}, {-176, 72}, {-176, 66}}, color = {0, 0, 255}));   connect(r_Resistor.n, l_Inductor.p) annotation(
    Line(points = {{62, 42}, {62, 36}}, color = {0, 0, 255}));   connect(l_Inductor.n, m_nmos.D) annotation(
    Line(points = {{62, 16}, {62, 7}, {0, 7}, {0, 0}}, color = {0, 0, 255}));   connect(m_nmos1.S, m_nmos.D) annotation(
    Line(points = {{1, 32}, {1, 15}, {0, 15}, {0, 0}}, color = {0, 0, 255}));   connect(m_nmos1.D, v_constant.p) annotation(
    Line(points = {{1, 52}, {1, 72}, {-176, 72}, {-176, 66}}, color = {0, 0, 255}));   connect(m_nmos1.B, m_nmos1.S) annotation(
    Line(points = {{10, 42}, {10, 32}, {1, 32}}, color = {0, 0, 255}));   connect(signalVoltage.p, m_nmos.G) annotation(
    Line(points = {{-38, -10}, {-10, -10}}, color = {0, 0, 255}));   connect(signalVoltage.n, ground1.p) annotation(
    Line(points = {{-38, -38}, {-38, -52}, {0, -52}}, color = {0, 0, 255}));   connect(pulse.y, slewRateLimiter.u) annotation(
    Line(points = {{-170, -24}, {-140, -24}}, color = {0, 0, 127}));   connect(slewRateLimiter.y, signalVoltage.v) annotation(
    Line(points = {{-116, -24}, {-54, -24}}, color = {0, 0, 127}));   connect(const.y, signalVoltage1.v) annotation(
    Line(points = {{-111, 28}, {-83, 28}}, color = {0, 0, 127}));   connect(signalVoltage1.p, m_nmos1.G) annotation(
    Line(points = {{-70, 38}, {-70, 42}, {-8, 42}}, color = {0, 0, 255}));   connect(signalVoltage1.n, m_nmos1.S) annotation(
    Line(points = {{-70, 18}, {0, 18}, {0, 32}, {2, 32}}, color = {0, 0, 255}));   annotation(
    uses(Modelica(version = "3.2.3")),   Diagram(coordinateSystem(extent = {{-200, -100}, {100, 100}})),   Icon(coordinateSystem(extent = {{-200, -100}, {100, 100}})),   version
= ""); end Test_NMOS_nok_corrected_with_slew_reate;

Modelica标准库(MSL/Modelica)与SPICE3之间不应存在兼容性问题。不幸的是,根据我的经验,SPICE3似乎不是最稳定的软件包。因此,在案例a)中,从具有坡度的坡道变为案例b)中的理想矩形可能是模型断裂的原因。顺便说一句:Dymola的问题也是一样的……你完全正确。我在理想脉冲源和信号电压发生器之间添加了一个转换速率限制器(Modelica.Blocks.Nonlinear.swileratelimiter),现在流过负载和MOS的电流与预期一致。总之,将Spice3与MSL模型连接不是一个问题,而是为MOS的栅极提供正确的转换。希望它能帮助别人。以下是修正后的模型: