Buck converter with current programmed control * example of Section B.3.2 .param Va=0.6 .param fs=200KHz .param L=35uH .ac DEC 101 10 100KHz .op * these options affect convergence *.OPTIONS RELTOL=0.01 *.OPTIONS GMIN=0.00001 *.OPTIONS ABSTOL=1u *.OPTIONS CHGTOL=0.1pC *.OPTIONS ITL4=20 *.OPTIONS ITL2=50 *.OPTIONS VNTOL=10uV *.OPTIONS STEPGMIN *.nodeset v(2)=8.1 *.nodeset v(4)=4 *.nodeset v(5)=0.5 *.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 0 ; use ac 1 to find line-to-output response Xswitch 1 2 2 0 5 CCM-DCM1 PARAMS: L={L} fs={fs} * Xswitch 1 2 2 0 5 CCM1 L1 2 3 {L} RL1 3 4 0.05 C1 4 0 100uF Rload 4 0 2 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)} Vic ctr 0 dc 1.4V ac 1 ; use ac 1 to find control-to-output response .probe .end