The capacitor voltage is around 1.2 volts when it should be around 10 Volts. For some reason, the Capacitor voltage only changes if I change the parameters of the control voltage, but if I change the input voltage nothing changes. I can't figure out what I'm doing wrong. I'm pretty sure that I followed the book correctly and my design is right, but I'm probably doing something wrong in PSpice since it's been a long time since I last used it.
This doesn't result in correct switching operation. V2 has to be at least 5 to 10 V above input voltage V1, which would exceed FET maximum Vgs ratings (although the simulation models possibly ignores the dangerous operation condition).
As a general question, do you intend to simulate a real-world buck converter or a simplified functional model? For the real converter, a feasible gate drive method should be included with the simulation, because the actual gate voltage waveform affects the buck converter's efficiency and switching behaviour considerably.
You need to study how to turn on P-mos to the N-mos. The left of the inductor, L1, is 20V when the switch is supposedly first turned on. For N-mos, the gate voltage needs to be higher than source voltage.
In this case, the gate voltage turns on the N-mos, but as soon as N-mos conducts, it is quickly turned off. After you study the N-mos to P-mos or how to bias them, you can go to Maxim website. There is a pretty good tutorial.
u done one mistake tat is connecting the negative end of gate pulse to ground. u have to connect Vgs instead of gnd . connect -ve of gate pulse to mosfet tat connecting to diode