Are you sure you want two NMOS's to do this? It would be much simpler if you used a PMOS. Otherwise, it's not terribly surprising you're getting cross conduction since Vgs depends on the source voltage as well as the gate voltage. Even if the gate pulse goes negative, if the source voltage on the top MOSFET goes even lower than that, then you'll still get conduction when you didn't want it to.
If you want to stick with two NMOS's then you'll need to ensure that the gate voltage of the top NMOS stays at the source voltage if you want it off. You may want to add plots to this question showing Vg and Vs of both MOSFETs so that we can make a more concise answer.
If I simply save that PSpice file to a ntk3139p.lib
file and import it in LTspice, it all works fine:
The Rds(on) looks in line with the datasheet for that part.
What you need to keep in mind is to change the PMOS statement line to X (because it's a subcircuit) and match the name to the subckt name declared in that lib. Ctrl-click to access the advanced properties page for the FET:
This is actually explained in detail at http://www.linear.com/solutions/1083
And if you actually want to import that model into LTspice so that you don't have to use an .include
statement, what you need to do is
- Copy the aforementioned
ntk3139p.lib
into LTspiceIV\lib\sub
; this directory can [and does] contain both .lib
and .sub
files.
- Create a
ntk3139p.asy
in LTspiceIV\lib\sym
(or in one of its subfolders, in which case the component will show up in the corresponing category in the F2
select component dialog). This .asy
file is initially a copy of pmos.asy
that comes with LTspice in this case. Now you need to edit this ntk3139p.asy
file either in a text editor or using LTspice itself (via Edit->Attributes
or Ctrl+A
) so that it reads:
Now you can add the new component, but since we're using X as type it automatically get labelled as an IC (U
) rather than MOSFET as before. But we don't need an .inc
line anymore for the simulation to work:
Honestly this procedure is usually not worth the hassle for me... and if you reinstall LTspice or load your schematic on a different machine, you have to do it all over again, never mind that it becomes less clear in the schematic what components you need[ed] extra libraries for. Furthermore, you can no longer change the MOSFET by right-clicking on it an picking a new model. If you try that with your custom asy
file, you get:
Which for me is the most annoying part. So I don't recommend doing this import procedure for MOSFETS; I think it's only worth the hassle for ICs.
I honestly don't know exactly what the .sub
files are restricted to contain in LTspice, but the ones that come with the program are all binary files containing LT's proprietary models, some of which also make use of LT's extensions like steady and so forth. I don't think the .sub
binary format that LTspice uses is publicly documented anywhere.
Best Answer
Look at your node naming. That “GGL” on both will short them or draw an invisible line between them. It’s intended to make your schematic less crowded and human readable, but if you take a look in your netlist which any SPICE uses behind the scenes, they are shorted.
Solution: remove the “GGL” statement for one of the nodes or just rename it.