Actually I built a buck-boost converter (without feedback) using PSIM. When the input voltage is changed, the duty cycle of the PWM signal (fixed frequency) needed to be adjusted to give the required output voltage. I'm thinking to build the controller so that it will adjust the duty cycle automatically depending on the input voltage and feedback voltage. I know commercial PWM controller can do the work, but I wish to try building the controller in software. May be I will look into the compensation network after I got the basic controller done first. Pls advise. Thanks.v_c said:Did you look into the second article? They show you the compensation network around the error amplifier. You are interested in the compensator R's and C's, right?