Electronic – Graphing an N-channel MOSFET’s characteristic curve in LTSpice: Am I doing it wrong

ltspicemosfetspice

I was trying to replicate the characteristic curve of an N-channel MOSFET in LTSpice. I wanted to achieve something like this:

NChannel

but I end up getting this graph instead:

The drain current Id is in the negatives

in which the drain current are in the negatives. I am not really that familiar with SPICE syntax so pointing out where I did get it wrong would be a great help.

The SPICE Directive I've constructed:

MOS   100 1 0 0 MOS
Vbias 1 0 DC 1.5
Vd    110 0 DC 1.5
Vid   110 100 DC 0
 
.MODEL MOS NMOS
 
.DC Vd 0 12 .0001 Vbias 0 5 1
.PROBE          DC I(Vd)
*.PRINT DC  V(1,XIS.2) V(XIS.2,0) V(XIS.23) V(XIS.46) V(1)I(Vid)
.OP
.END

Was it the circuit I've constructed, or was it my syntax/semantics that was wrong? I was pretty sure I used an N-type enhancement mode MOSFET.

Best Answer

Component in SPICE, even symmetrical ones like resistors, have pre-assigned current polarity when measuring current through them.

If you are measuring current through the voltage source it is negative via passive sign convention. If you want it to read positive you will need to add in a current sense resistor and position it the correct way and read the current through that.