Welcome to our site! EDAboard.com is an international Electronic Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.
Swap V1 and V2 over to begin with, or make V2 switch faster and slower to get a feel for the very rough idea of pwm. The mosfet has to switch on and off to pass more or less of a varying supply voltage to maintain a constant voltage or current at the drain, sensing feedback at the source would be easier. Mosfet switching between time on to time off has to be based on a feedback signal that senses Vout and compares it to a reference value.