Below is a very simple circuit to extract the transconductance value of the MOSFET.
As it is known, transconductance is known as Delta (Id) / Delta (Vgate).
For the gate voltage, I defined it as .step param X 0 12 0.5.
To make ΔID/ΔVGS and get the result of transconductance ı write dot parameters as follow:
.param Vhigh {X}
.param Vlow {X-0.5}
.save V(Vg) Id(M1)
.meas TRAN Id_high FIND Id(M1) WHEN V(Vg)=Vhigh
.meas TRAN Id_low FIND Id(M1) WHEN V(Vg)=Vlow
.meas TRAN gm PARAM (Id_high-Id_low)/(Vhigh-Vlow)
.print gm
When ı check the Spice error log , Id_high - Id_low and gm values are negative. Why ? What is wrong with my dot parameters ?
Source: https://www.mouser.com.tr/datasheet/2/240/media-3322045.pdf