# How can I find the drain transfer function of a MOSFET on LTSpice?

I am trying to get the drain transfer function of a MOSFET by setting the drain to source voltage as the input and the gate to source voltage as the output. I created the following circuit in LTSpice:

When I run an AC simulation, the Bode plot shows no change in the gain with an increase in the frequency.

However, when I change the gate to the input and the drain-source as the output, I get the waveform that I am expecting.

Does anyone know why this is happening? Is the circuit even set up in the right way to get the transfer function of the drain?

Edit 1: The circuit I am trying to model is below. I am trying to find the transfer function where Vd is the input and Vg is the output.

Updated LTSpice schematic:

I won't say anything about you circuit, but if what you want is a MOSFET equivalent model, then I'd first look here, for example, or similar places. Otherwise I have to wonder what's the purpose of that 1 A current source in there (or why there are two grounds).

That said, you should know that a voltage source, in SPICE, has zero (or machine zero) internal resistance. That means that a capacitor placed across it will be useless, and an inductor across will cause an error (if there is no resistance involved). So in your first case you are placing the input source, Vo, across Cds, which makes Cds useless. You are also reading the voltage right across your input source (as I presume the Vo node does), so you are reading the flat response of an .AC source. No surprises here.

If you were to read the voltage at the Vg node, then R1 and Lg would be useless since you have no load, i.e. there is no current through them, and all you'd be measuring would be a capacitive divider formed by Cgd and Cgs. Adding a (say) 1 MΩ resistor to ground from the Vg node would make the response include the series RL, too.

In the 2nd case, you have a valid reading, for the given circuit.

As a minor conclusion, remember this: GIGO = Garbage In, Garbage Out. Which is the equivalent model for you reap what you sow.

• Firstly, thanks for your reply! I was basically trying to model the circuit shown in the post edit. – syz May 22 '20 at 19:16
• The current source is in my small-signal equivalent circuit to mimic the current through the transistor. I tried your suggestion and I get a resonant peak when the load across Vg is a capacitor, but not when it is a resistor. I tried different resistor values but I end up with a constant gain with the phase changing with frequency. I'm at a deadend at this point - do you have any other suggestions? Also I completely forgot that LTSpice has ideal sources - thanks for the reminder! – syz May 22 '20 at 19:22
• @syz In the link I provided the current source has a different value. Yours is just generating a constant DC current of 1 A (before), and 24 A (after), but it should have $g_mV_{GS}$, which means a VCCS with $g_m$ as value, and its inputs connected to G and S. If a circuit has a capacitance first (even though there should also be a shunt resistor in there, for the output resistance), then a current source is a better choice; otherwise, insert a series resistance high enough not to damp everything, but small enough to not influence the rest of the circuit. Try 1 k&Omega;. – a concerned citizen May 23 '20 at 9:32
• I tried your suggestion but still not getting it, thanks anyways! – syz May 24 '20 at 20:53