I'm trying to simulate an LC filter for a PWM output and I'm having problems with MOSFET used for controlling the voltage. I'm using LTSpice for simulation. When I filter the PWM output directly, it works OK, nicely smoothing out voltage. The schematic looks like that in that situation:
When I want to use N channel MOSFET, however, it doesn't work at all, ie. I only see noise on R1 resistor. The schematic in this case looks like that:
What's wrong with the second schematic? And if it's not a proper way of handling PWM with MOSFET, how should it work? I saw similar circuits for filtering PWM output in an H-Bridge and it looks like the same situation - in H-Bridge PWM is supplied to lower side MOSFETs.