I am running the following Tesla coil circuit in Open Modelica:
I have implemented the circuit with Open Modelica like this:
But the problem is that the R9 register is not having any voltage or current. I have tested connecting the R9 port to ground, and it gains voltage and current. But when it is connected to an N-MOSFET it gets no voltage or current. Is this related to the threshhold voltage of the N-MOSFET?
And R3's voltage is fine like this:
This is my code:
model SSTC
Modelica.Electrical.Analog.Semiconductors.NPN Q1_NPN annotation(
Placement(visible = true, transformation(origin = {-46, -38}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Electrical.Analog.Semiconductors.NPN Q2_npn annotation(
Placement(visible = true, transformation(origin = {12, -32}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Electrical.Analog.Basic.Resistor R3(R = 10) annotation(
Placement(visible = true, transformation(origin = {-16, -32}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Electrical.Analog.Basic.Ground ground annotation(
Placement(visible = true, transformation(origin = {22, -94}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Electrical.Analog.Basic.Resistor R1(R = 7500) annotation(
Placement(visible = true, transformation(origin = {-78, -38}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Electrical.Analog.Sources.PulseVoltage pulseVoltage(V = 12, period = 1) annotation(
Placement(visible = true, transformation(origin = {-124, -48}, extent = {{-10, -10}, {10, 10}}, rotation = -90)));
Modelica.Electrical.Analog.Basic.Resistor R8(R = 150) annotation(
Placement(visible = true, transformation(origin = {22, 60}, extent = {{-10, -10}, {10, 10}}, rotation = -90)));
Modelica.Electrical.Analog.Sources.ConstantVoltage constantVoltage(V = 18) annotation(
Placement(visible = true, transformation(origin = {-30, 60}, extent = {{-10, -10}, {10, 10}}, rotation = -90)));
Modelica.Electrical.Analog.Basic.Resistor R9(R = 10) annotation(
Placement(visible = true, transformation(origin = {60, -26}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Electrical.Analog.Basic.Resistor R10(R = 10) annotation(
Placement(visible = true, transformation(origin = {56, 70}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Electrical.Analog.Semiconductors.NMOS nMOS annotation(
Placement(visible = true, transformation(origin = {108, -20}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Electrical.Analog.Basic.Capacitor capacitor(C = 0.00000001) annotation(
Placement(visible = true, transformation(origin = {76, 34}, extent = {{-10, -10}, {10, 10}}, rotation = -90)));
Modelica.Electrical.Analog.Basic.Transformer transformer(L1 = 50, L2 = 5000, M = 10) annotation(
Placement(visible = true, transformation(origin = {128, 40}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Electrical.Analog.Basic.Ground ground1 annotation(
Placement(visible = true, transformation(origin = {142, -94}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Blocks.Sources.BooleanPulse booleanPulse(period = 0.1, width = 50) annotation(
Placement(visible = true, transformation(extent = {{84, 82}, {104, 102}}, rotation = 0)));
Modelica.Electrical.Analog.Ideal.CloserWithArc switch2(V0 = 100, Vmax = 1000, dVdt = 10000, off(fixed = true)) annotation(
Placement(visible = true, transformation(extent = {{164, 40}, {184, 60}}, rotation = 0)));
Modelica.Electrical.Analog.Sources.ConstantVoltage constantVoltage1(V = 12) annotation(
Placement(visible = true, transformation(origin = {-156, -16}, extent = {{-10, -10}, {10, 10}}, rotation = -90)));
Modelica.Electrical.Analog.Basic.Resistor R7(R = 180) annotation(
Placement(visible = true, transformation(origin = {-86, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
equation
connect(pulseVoltage.p, R1.p) annotation(
Line(points = {{-124, -38}, {-88, -38}}, color = {0, 0, 255}));
connect(R1.n, Q1_NPN.B) annotation(
Line(points = {{-68, -38}, {-56, -38}}, color = {0, 0, 255}));
connect(Q1_NPN.C, R3.p) annotation(
Line(points = {{-36, -32}, {-26, -32}}, color = {0, 0, 255}));
connect(R3.n, Q2_npn.B) annotation(
Line(points = {{-6, -32}, {2, -32}}, color = {0, 0, 255}));
connect(Q1_NPN.E, ground.p) annotation(
Line(points = {{-36, -44}, {-32, -44}, {-32, -84}, {22, -84}}, color = {0, 0, 255}));
connect(pulseVoltage.n, ground.p) annotation(
Line(points = {{-124, -58}, {-124, -84}, {22, -84}}, color = {0, 0, 255}));
connect(Q2_npn.C, R8.n) annotation(
Line(points = {{22, -26}, {22, 50}}, color = {0, 0, 255}));
connect(constantVoltage.p, R8.p) annotation(
Line(points = {{-30, 70}, {22, 70}}, color = {0, 0, 255}));
connect(constantVoltage.n, ground.p) annotation(
Line(points = {{-30, 50}, {-140, 50}, {-140, -84}, {22, -84}}, color = {0, 0, 255}));
connect(Q2_npn.C, R9.p) annotation(
Line(points = {{22, -26}, {50, -26}}, color = {0, 0, 255}));
connect(R8.p, R10.p) annotation(
Line(points = {{22, 70}, {46, 70}}, color = {0, 0, 255}));
connect(nMOS.B, ground.p) annotation(
Line(points = {{118, -20}, {118, -84}, {22, -84}}, color = {0, 0, 255}));
connect(nMOS.S, ground.p) annotation(
Line(points = {{118, -26}, {118, -84}, {22, -84}}, color = {0, 0, 255}));
connect(R10.n, capacitor.p) annotation(
Line(points = {{66, 70}, {76, 70}, {76, 44}}, color = {0, 0, 255}));
connect(capacitor.n, nMOS.D) annotation(
Line(points = {{76, 24}, {76, 2}, {118, 2}, {118, -14}}, color = {0, 0, 255}));
connect(transformer.n1, nMOS.D) annotation(
Line(points = {{118, 30}, {118, -14}}, color = {0, 0, 255}));
connect(R10.n, transformer.p1) annotation(
Line(points = {{66, 70}, {118, 70}, {118, 50}}, color = {0, 0, 255}));
connect(transformer.n2, ground1.p) annotation(
Line(points = {{138, 30}, {142, 30}, {142, -84}}, color = {0, 0, 255}));
connect(transformer.p2, switch2.p) annotation(
Line(points = {{138, 50}, {164, 50}}, color = {0, 0, 255}));
connect(switch2.n, ground1.p) annotation(
Line(points = {{184, 50}, {178, 50}, {178, -84}, {142, -84}}, color = {0, 0, 255}));
connect(booleanPulse.y, switch2.control) annotation(
Line(points = {{105, 92}, {174, 92}, {174, 62}}, color = {255, 0, 255}));
connect(constantVoltage1.n, ground.p) annotation(
Line(points = {{-156, -26}, {-156, -84}, {22, -84}}, color = {0, 0, 255}));
connect(constantVoltage1.p, R7.p) annotation(
Line(points = {{-156, -6}, {-156, 0}, {-96, 0}}, color = {0, 0, 255}));
connect(R7.n, Q1_NPN.C) annotation(
Line(points = {{-76, 0}, {-36, 0}, {-36, -32}}, color = {0, 0, 255}));
connect(Q2_npn.E, ground.p) annotation(
Line(points = {{22, -38}, {22, -84}}, color = {0, 0, 255}));
connect(R9.n, nMOS.G) annotation(
Line(points = {{70, -26}, {98, -26}}, color = {0, 0, 255}));
annotation(
uses(Modelica(version = "4.0.0")));
end SSTC;