PMOS LTSpice issue

Thread Starter

PickyBiker

Joined Aug 18, 2015
144
I'm seeing a problem with my project on LTSpice. The PMOS circuit is powered by 14VDC and is using a 2n3904 to switch the Gate on the PMOS. The gate is going from 14v to 0 v, but the Drain is only going from 13.98v to 13.38v. Can someone tell me why this is happening?
LTSpice.png
 

crutschow

Joined Mar 14, 2008
38,418
As dl324 noted, it's not an LTspice issue, as it's showing you the proper results for your circuit, which has an error.
As connected the MOSFET substrate diode is carrying the current when the MOSFET is off.

If LTspice is showing you unexpected results, then it's highly likely you have an error in your circuit.
 
Last edited:

crutschow

Joined Mar 14, 2008
38,418
Use a specific model for the MOSFET, not the generic device, which can be flaky.

It's not good practice to change more than one thing when fixing errors in a circuit.
Why did you change from the MOSFET model in your first post?
 
Last edited:

Thread Starter

PickyBiker

Joined Aug 18, 2015
144
I was originally trying to use the FQP27P06 PMOS transistor in LTspice, but I couldn't get it to work.

Steps I Took:
  1. Downloaded the model file (FQP27P06.lib) from onsemi and placed it in my LTspice project folder.
  2. Added a SPICE directive:
    .inc FQP27P06.lib
  3. Ran the simulation, but got the following error:
    LTspice 24.1.4 for Windows
    Circuit: C:\Users\Mike\Documents\LTspice\VStar Directional\Draft1.net
    Start Time: Sun Mar 9 18:38:27 2025
    C:\Users\Mike\Documents\LTspice\VStar Directional\Draft1.net(10): Node or model name expected.
    M1 N004 N003 N001 N001 FQP27P06
  4. Tried an alternative approach:
    • Removed the .inc directive.
    • Instead, added a new .inc directive containing the full content of the .lib file.
    • Still got the same error.
  5. Also tried using .lib instead of .inc, but the error persisted.
  6. Out of frustration, I started using random PMOS transistors from the built-in LTspice library instead.
Question:
How do I properly include and use the FQP27P06 PMOS model in LTspice?
(See attached files for reference.)

4oFQP.png
 

crutschow

Joined Mar 14, 2008
38,418
How do I properly include and use the FQP27P06 PMOS model in LTspice?
What I do is add the MOSFET model to the lib\cmp\standard.mos file (use Notepad for that).
That way it shows up as a pmos selection when you right-click the PMOS icon, and you don't need the .include command.

Don't include the Thermal Model info.
 
Last edited:

Thread Starter

PickyBiker

Joined Aug 18, 2015
144
Started clean by uninstalling ltspice, erasing all ltspice related folder in program files, documents, and mike\AppData\Local\LTSpice.

reinstalled LTspice and added the FQP27P06 model to the file at C:\Users\Mike\AppData\Local\LTspice\lib\cmp\standard.mos.
This is the model that AI created from the FQP27P06.lib file:

.model FQP27P06 VDMOS(Rg=1.58 Rd=18m Rs=2m mtriode=1.9 lambda=0.01 Vto=-3.1 Ksubthres=100m Kp=10.4 Cgdmax=1.56n Cgdmin=240p A=1.5 Cgs=990p Cjo=1.38n M=0.44 Is=3.0E-13 Rb=3m mfg=Fairchild Vds=60 Ron=18m Qg=50n)

Started LTSpice, installed the pmos, picked a new mosfet and FQP27P06 is not in the list.

This is the relevant portion of the standard.mos file
.model FQB55N10 VDMOS(Rg=3 Rd=1m Rs=18m Vto=3.8 mtriode=2 theta=.5 Kp=150 Cgdmax=5n Cgdmin=10p A=.5 Cgs=2n cjo=3n M=.48 Is=3.9p Rb=6m ksubthres=.1 mfg=Fairchild Vds=100 Ron=21m Qg=75n)
.model FQP27P06 VDMOS(Rg=1.58 Rd=18m Rs=2m mtriode=1.9 lambda=0.01 Vto=-3.1 Ksubthres=100m Kp=10.4 Cgdmax=1.56n Cgdmin=240p A=1.5 Cgs=990p Cjo=1.38n M=0.44 Is=3.0E-13 Rb=3m mfg=Fairchild Vds=60 Ron=18m Qg=50n)
.model HAT1023R VDMOS(pchan Rg=3 Vto=-1.4 Rd=12m Rs=9m Rb=15m Kp=50 Cgdmax=1.2n Cgdmin=.3n Cgs=2n Cjo=.6n Is=60p ksubthres=.1 mfg=Renesas Vds=-20 Ron=30m Qg=30n)

Just a note: Adding a part to LTSPICE should not be this hard. I have at least 5 hours of work on this and still have no good result.
So where do I go from here?
 

crutschow

Joined Mar 14, 2008
38,418
Adding a part to LTSPICE should not be this hard. I have at least 5 hours of work on this and still have no good result.
So where do I go from here?
No it shouldn't, but it's a free program so it's something you just have to live with. :rolleyes:
This is the relevant portion of the standard.mos file
.model FQB55N10 VDMOS(Rg=3 Rd=1m Rs=18m Vto=3.8 mtriode=2 theta=.5 Kp=150 Cgdmax=5n Cgdmin=10p A=.5 Cgs=2n cjo=3n M=.48 Is=3.9p Rb=6m ksubthres=.1 mfg=Fairchild Vds=100 Ron=21m Qg=75n)
.model FQP27P06 VDMOS(Rg=1.58 Rd=18m Rs=2m mtriode=1.9 lambda=0.01 Vto=-3.1 Ksubthres=100m Kp=10.4 Cgdmax=1.56n Cgdmin=240p A=1.5 Cgs=990p Cjo=1.38n M=0.44 Is=3.0E-13 Rb=3m mfg=Fairchild Vds=60 Ron=18m Qg=50n)
It doesn't recognize that as a PMOS device.
Try changing VDMOS(Rg=1.58 to VDMOS(pchan Rg=1.58

It would be nice if LTspice recognized a minus voltage for Vto as a PMOSFET, but it doesn't.
 
Last edited:

eetech00

Joined Jun 8, 2013
4,704
I was originally trying to use the FQP27P06 PMOS transistor in LTspice, but I couldn't get it to work.

Steps I Took:
  1. Downloaded the model file (FQP27P06.lib) from onsemi and placed it in my LTspice project folder.
  2. Added a SPICE directive:
    .inc FQP27P06.lib
  3. Ran the simulation, but got the following error:
    LTspice 24.1.4 for Windows
    Circuit: C:\Users\Mike\Documents\LTspice\VStar Directional\Draft1.net
    Start Time: Sun Mar 9 18:38:27 2025
    C:\Users\Mike\Documents\LTspice\VStar Directional\Draft1.net(10): Node or model name expected.
    M1 N004 N003 N001 N001 FQP27P06
  4. Tried an alternative approach:
    • Removed the .inc directive.
    • Instead, added a new .inc directive containing the full content of the .lib file.
    • Still got the same error.
  5. Also tried using .lib instead of .inc, but the error persisted.
  6. Out of frustration, I started using random PMOS transistors from the built-in LTspice library instead.
Question:
How do I properly include and use the FQP27P06 PMOS model in LTspice?
(See attached files for reference.)

4oView attachment 344167
The spice model you are using is a "subckt" type model file. Therefore, it cannot be added to the standard.mos file.

The procedure:

1. Place the downloaded model file in the same folder as the schematic.
2. Place a PMOS symbol on the schematic (orient it correctly).
3. Ctl-RhtClk the PMOS symbol, then set the attributes of the symbol:

(Prefix) X
(Value) FQP27P06
(OK) to apply the changes to the symbol

4. Place the following directive on the schematic:

.inc FQP27P06.lib

5. Done.
 

Thread Starter

PickyBiker

Joined Aug 18, 2015
144
Just changed VDMOS(Rg=1.58 to VDMOS(pchan Rg=1.58, and that worked! Now the FQP27P06 is selectable as a device in the Pick New Mosfet.

Thank you so much for the HELP!
 

crutschow

Joined Mar 14, 2008
38,418
Glad you finally got it to work. :cool:
When working with LTspice it often helps to look at the syntax used for other similar models to determine what is needed.

I assume that also solved the problem you were having with the circuit(?).
 

eetech00

Joined Jun 8, 2013
4,704
Started clean by uninstalling ltspice, erasing all ltspice related folder in program files, documents, and mike\AppData\Local\LTSpice.

reinstalled LTspice and added the FQP27P06 model to the file at C:\Users\Mike\AppData\Local\LTspice\lib\cmp\standard.mos.
This is the model that AI created from the FQP27P06.lib file:

.model FQP27P06 VDMOS(Rg=1.58 Rd=18m Rs=2m mtriode=1.9 lambda=0.01 Vto=-3.1 Ksubthres=100m Kp=10.4 Cgdmax=1.56n Cgdmin=240p A=1.5 Cgs=990p Cjo=1.38n M=0.44 Is=3.0E-13 Rb=3m mfg=Fairchild Vds=60 Ron=18m Qg=50n)

Started LTSpice, installed the pmos, picked a new mosfet and FQP27P06 is not in the list.

This is the relevant portion of the standard.mos file
.model FQB55N10 VDMOS(Rg=3 Rd=1m Rs=18m Vto=3.8 mtriode=2 theta=.5 Kp=150 Cgdmax=5n Cgdmin=10p A=.5 Cgs=2n cjo=3n M=.48 Is=3.9p Rb=6m ksubthres=.1 mfg=Fairchild Vds=100 Ron=21m Qg=75n)
.model FQP27P06 VDMOS(Rg=1.58 Rd=18m Rs=2m mtriode=1.9 lambda=0.01 Vto=-3.1 Ksubthres=100m Kp=10.4 Cgdmax=1.56n Cgdmin=240p A=1.5 Cgs=990p Cjo=1.38n M=0.44 Is=3.0E-13 Rb=3m mfg=Fairchild Vds=60 Ron=18m Qg=50n)
.model HAT1023R VDMOS(pchan Rg=3 Vto=-1.4 Rd=12m Rs=9m Rb=15m Kp=50 Cgdmax=1.2n Cgdmin=.3n Cgs=2n Cjo=.6n Is=60p ksubthres=.1 mfg=Renesas Vds=-20 Ron=30m Qg=30n)

Just a note: Adding a part to LTSPICE should not be this hard. I have at least 5 hours of work on this and still have no good result.
So where do I go from here?
You've added it the wrong way and it will not behave as intended by its design because you've left out sections of the model.

Use it the way I've shown in post #11
 

Thread Starter

PickyBiker

Joined Aug 18, 2015
144
eetech00

Okay, it tried it again:
I remove the FQP27P06 and the FQP30N06from the standard.mos file
Then I deleted the mosfet in the schematic
added the pmos, rotated it twice and mirrored it
CTRL-RightClicked the PMOS symbol and changed the name to FQP27P06
added .inc FQP27P06 to the schematic
Ran it

The error is:
LTspice 24.1.4 for Windows
Circuit: C:\Users\Mike\Documents\LTspice\Draft1\Draft1.net
Start Time: Mon Mar 10 17:48:58 2025
C:\Users\Mike\Documents\LTspice\Draft1\Draft1.net(10): Node or model name expected.
M1 N004 N003 N001 N001 FQP27P06
^^^^^^^^^

This is the contents of the .lib file:
**************** Power Discrete MOSFET Electrical Circuit Model *****************
* Product Name: FQP27P06
* 60V P-Channel MOSFET and TO-220
*--------------------------------------------------------------------------------
.SUBCKT FQP27P06 20 10 30
Rg 10 1 1.58
M1 2 1 3 3 DMOS L=1u W=1u
.MODEL DMOS PMOS (VTO={-3.10*{-0.00096*TEMP+1.024}} KP={{-0.0068*TEMP}+10.4}
+ THETA=0.0576 VMAX=3.0E5 ETA=0.004 LEVEL=3)
Cgs 1 3 990p
Rd 20 4 0.018 TC=0.0055
Dds 4 3 DDS
.MODEL DDS D(BV={60*{0.000975*TEMP+0.975625}} M=0.44 CJO=1380p VJ=0.76)
Dbody 20 3 DBODY
.MODEL DBODY D(IS=3.0E-13 N=1.0 RS=0.036 EG=1.18 TT=105n)
Ra 4 2 0.018 TC=0.0055
Rs 3 5 0.002
Ls 5 30 2.6n
M2 1 8 6 6 INTER
E2 8 6 4 1 2
.MODEL INTER PMOS (VTO=0 KP=10 LEVEL=1)
Cgdmax 7 4 1560p
Rcgd 7 4 1E7
Dgd 4 6 DGD
Rdgd 4 6 1E7
.MODEL DGD D(M=0.42 CJO=1560p VJ=0.24)
M3 7 9 1 1 INTER
E3 9 1 4 1 -2
.ENDS
*-------------------------------------------------------------------------------
**** Power Discrete Thermal Model ****
* 60V P-Channel MOSFET and TO-220
*----------------------------------------------------------------------------
.SUBCKT FQP27P06_THERMAL TH TL
CTHERM1 TH 6 8.8e-4
CTHERM2 6 5 3.1e-3
CTHERM3 5 4 1.8e-2
CTHERM4 4 3 5.6e-2
CTHERM5 3 2 1.8e-1
CTHERM6 2 TL 7.2e-1
RTHERM1 TH 6 9.4e-3
RTHERM2 6 5 5.1e-2
RTHERM3 5 4 2.2e-1
RTHERM4 4 3 2.5e-1
RTHERM5 3 2 3.2e-1
RTHERM6 2 TL 4.0e-1
.ENDS

What am I doing wrong?

Clipboard01.png
 

eetech00

Joined Jun 8, 2013
4,704
eetech00

Okay, it tried it again:
I remove the FQP27P06 and the FQP30N06from the standard.mos file
Then I deleted the mosfet in the schematic
added the pmos, rotated it twice and mirrored it
CTRL-RightClicked the PMOS symbol and changed the name to FQP27P06
added .inc FQP27P06 to the schematic
Ran it

The error is:
LTspice 24.1.4 for Windows
Circuit: C:\Users\Mike\Documents\LTspice\Draft1\Draft1.net
Start Time: Mon Mar 10 17:48:58 2025
C:\Users\Mike\Documents\LTspice\Draft1\Draft1.net(10): Node or model name expected.
M1 N004 N003 N001 N001 FQP27P06
^^^^^^^^^

This is the contents of the .lib file:
**************** Power Discrete MOSFET Electrical Circuit Model *****************
* Product Name: FQP27P06
* 60V P-Channel MOSFET and TO-220
*--------------------------------------------------------------------------------
.SUBCKT FQP27P06 20 10 30
Rg 10 1 1.58
M1 2 1 3 3 DMOS L=1u W=1u
.MODEL DMOS PMOS (VTO={-3.10*{-0.00096*TEMP+1.024}} KP={{-0.0068*TEMP}+10.4}
+ THETA=0.0576 VMAX=3.0E5 ETA=0.004 LEVEL=3)
Cgs 1 3 990p
Rd 20 4 0.018 TC=0.0055
Dds 4 3 DDS
.MODEL DDS D(BV={60*{0.000975*TEMP+0.975625}} M=0.44 CJO=1380p VJ=0.76)
Dbody 20 3 DBODY
.MODEL DBODY D(IS=3.0E-13 N=1.0 RS=0.036 EG=1.18 TT=105n)
Ra 4 2 0.018 TC=0.0055
Rs 3 5 0.002
Ls 5 30 2.6n
M2 1 8 6 6 INTER
E2 8 6 4 1 2
.MODEL INTER PMOS (VTO=0 KP=10 LEVEL=1)
Cgdmax 7 4 1560p
Rcgd 7 4 1E7
Dgd 4 6 DGD
Rdgd 4 6 1E7
.MODEL DGD D(M=0.42 CJO=1560p VJ=0.24)
M3 7 9 1 1 INTER
E3 9 1 4 1 -2
.ENDS
*-------------------------------------------------------------------------------
**** Power Discrete Thermal Model ****
* 60V P-Channel MOSFET and TO-220
*----------------------------------------------------------------------------
.SUBCKT FQP27P06_THERMAL TH TL
CTHERM1 TH 6 8.8e-4
CTHERM2 6 5 3.1e-3
CTHERM3 5 4 1.8e-2
CTHERM4 4 3 5.6e-2
CTHERM5 3 2 1.8e-1
CTHERM6 2 TL 7.2e-1
RTHERM1 TH 6 9.4e-3
RTHERM2 6 5 5.1e-2
RTHERM3 5 4 2.2e-1
RTHERM4 4 3 2.5e-1
RTHERM5 3 2 3.2e-1
RTHERM6 2 TL 4.0e-1
.ENDS

What am I doing wrong?

View attachment 344235
you didn’t change the prefix to X
 
Top