当我尝试使用库Spice3的NMOS模型时,我遇到了Open中的一个问题,同时还使用了标准的Modelica电压源模型。关于带有RL负载的简单半桥配置的示例,我模拟了以下情况:
( a)在低端source(Modelica.Electrical.Spice3.Sources.V_pulse) NMOS(Modelica.Electrical.Spice3.Semiconductors.M_NMOS)的栅极上使用Spice3脉冲电压Spice3,-> Spice3 Spice模型。
( b)采用模型卡脉冲源( source(Modelica.Electrical.Analog.Sources.SignalVoltage) )和信号控制电压源(Modelica.Blocks.Sources.Pulse)对低侧NMOS (Modelica.Electrical.Spice3.Semiconductors.M_NMOS)、->混合栅进行Spice模型和Modelica模型的混合。
在A种情况下,模拟工作正常,预期结果(电流认为电感负载和“内”低和高侧NMOS模型,作为漏/源/体电流值)。相反,在情况b),模拟有收敛问题。此外,负载电流的部分结果似乎是预期的,但从两个NMOS模型的内部看,漏/源/体电流值是不期望的。
有人能帮我解决"Test_NMOS_nok“原理图中的问题吗?有人知道Spice3模型和Modelica模型之间是否存在兼容性问题吗?
链接模型案例a):https://drive.google.com/file/d/1CkaMiwzZ_Q1jOfuYO0k4-JqKoZi0f8pt/view?usp=sharing
链接模型案例b):https://drive.google.com/file/d/1iT8ssJwAzViCcXwuda4R_cNzbKLgSlwN/view?usp=sharing
提前感谢!
发布于 2020-12-21 07:32:36
总结对原问题的评论:
下面,找到问题中的谷歌驱动链接中的代码,以防它们在将来的某个时候不起作用。所有示例都是由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;( b)原非工作模式:
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;https://stackoverflow.com/questions/65324723
复制相似问题