Source and drain are backwards.Can someone tell me why this is happening?

What I do is add the MOSFET model to the lib\cmp\standard.mos file (use Notepad for that).How do I properly include and use the FQP27P06 PMOS model in LTspice?
No it shouldn't, but it's a free program so it's something you just have to live with.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?
It doesn't recognize that as a PMOS device.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)
The spice model you are using is a "subckt" type model file. Therefore, it cannot be added to the standard.mos file.I was originally trying to use the FQP27P06 PMOS transistor in LTspice, but I couldn't get it to work.
Steps I Took:
Question:
- Downloaded the model file (FQP27P06.lib) from onsemi and placed it in my LTspice project folder.
- Added a SPICE directive:
.inc FQP27P06.lib- 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- 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.
- Also tried using .lib instead of .inc, but the error persisted.
- Out of frustration, I started using random PMOS transistors from the built-in LTspice library instead.
How do I properly include and use the FQP27P06 PMOS model in LTspice?
(See attached files for reference.)
4oView attachment 344167
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.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 didn’t change the prefix to Xeetech00
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
Ctl-Rht-clk the symbol. Its an attribute.Where is the prefix?