Simulation produces incorrect results in basic MOSFET circuit?
complete
A
Alnis Smidchens
I'm trying to build a basic circuit that switches power over a low resistance/high current load using a P-channel MOSFET.
However, the circuit simulator produces results that disagree with Falstad's circuit simulator, as well as the source documentation I'm using.
The P-channel MOSFET seems to always have Vd = 2.44 V, with Vs = 3.3 V, and Vg being either 3.3 V or 0 V (switching has no effect). Maybe I am using Flux wrong? But this does not seem correct, seeing as Falstad circuit simulator disagrees, as does the example circuit I'm working off of.
See the attached project for the issue - includes the source circuit design, as well as text for a working Falstad circuit.
Thanks!
A
Alnis Smidchens
Jharwin thanks for looking into this so quickly.
I updated the component, and now the behavior of the circuit is a bit different (but still doesn't match Falstad/what I'd expect). When the load has a very high resistance (1 megaohm) the circuit behaves kind of like I'd expect, but at small load resistances (like the 1 ohm load I'd like to design for), it seems there is a lot of voltage drop over the MOSFET.
Within Falstad circuit simulator, there is a parameter "beta" for MOSFETs which sort of corresponds to the R_ds(on) (that is, the resistance between drain & source when driven to saturation):
https://www.falstad.com/circuit/mosfet-beta.html
Based on messing around with different resistor values, it seems like R_ds(on) for this MOSFET model in Flux is around 15 kiloohms, but for a typical signal MOSFET I believe it's on the order of ohms, and for a power MOSFET it's on the order of 10s of milliohms.
Would it be possible to expose more of the MOSFET model to the end user so we can specify not just threshold voltage, but other parameters like something for R_ds(on), too? Unfortunately, in its current state, the MOSFET model isn't particularly useful due to its high R_ds(on).
Or if exposing it to users of the component is challenging, something that could work as a stopgap is decreasing R_ds(on) to a value suitable for power circuits. For example, FQP27P06 has R_ds(on) of maximum 70 milliohms:
https://cdn-shop.adafruit.com/datasheets/1794datasheet.pdf
And SSM6J505NU,LF has 12 milliohms:
https://www.digikey.com/en/products/detail/toshiba-semiconductor-and-storage/SSM6J505NU-LF/3863573
I've attached screenshots comparing the behavior (off and on states for 1 ohm and 1 megaohm).
Thank you for your help with this!
Jharwin
complete
Jharwin
Hey Alnis Smidchens , I'm really sorry about the issue you ran into. Big thanks for the detailed report and the steps to reproduce it – super helpful!
I built this part a year ago and just pushed a fix for the issue with the P channel MOSFET simulation model. You'll get an alert about this update. When you do, could you give it a test run and let me know how it goes?
A
Alnis Smidchens
Here is a comparison of the simulation in Falstad Circuit Simulator and Flux.
File > Import from text... > paste the following:
$ 1 0.000005 10.20027730826997 50 5 50 5e-11
S 272 352 192 352 0 0 false 0 2
r 272 352 336 352 0 1000
w 384 368 384 432 0
r 448 288 448 352 0 1
370 448 240 448 288 1 0 0
w 448 288 496 288 0
p 496 288 496 352 3 0 0
w 448 352 496 352 0
f 384 160 448 160 33 1.5 80
r 384 96 384 160 0 10000
w 384 160 384 336 0
w 384 96 448 96 0
w 448 96 448 144 0
v 96 432 96 336 0 0 40 3.3 0 0 0.5
p 128 336 128 432 3 0 0
w 96 432 128 432 0
w 96 336 128 336 0
w 192 368 192 432 0
w 192 432 384 432 0
w 192 432 128 432 0
w 128 336 192 336 0
t 336 352 384 352 0 1 -3.299999928600001 3.399999928434549e-9 100 default
w 96 336 96 96 0
w 96 96 384 96 0
w 448 240 448 176 0
w 448 352 448 432 0
w 384 432 448 432 0