Buck converter with duty-cycle control * example of Section B.3.2 .param Va=0.6 .param fs=200KHz .param L=35uH .param D=0.676 ; use the quiescent duty cycle found from B.3.2.cpm.cir .ac DEC 101 10 100KHz .op *.options RELTOL=0.01 *.options GMIN=0.000001 *.nodeset v(2)=8.1 *.nodeset v(4)=10 *.nodeset v(nd)=0.68 *.nodeset v(ni)=0.8 *.nodeset v(nm1)=3.9 iout 0 4 ac 0 ; use ac 1 to find output impedance .lib switch.lib Vg 1 0 12V ac 1 ; use ac 1 to find line-to-output response Xswitch 1 2 2 0 5 CCM-DCM1 PARAMS: L={L} fs={fs} L1 2 3 {L} RL1 3 4 0.05 C1 4 0 100uF Rload 4 0 10 Vduty 5 0 dc {D} *Xcpm ctr ni nm1 nm2 5 CPM PARAMS: L={L} fs={fs} va={Va} Rf=1 *Ei ni 0 value={i(L1)} *Em1 nm1 0 value={V(1)-V(3)} *Em2 nm2 0 value={V(3)} *Vc ctr 0 dc 1.4V ac 0 ; use ac 1 to find control-to-output response .probe .end