hi all!
i m building a buck converter with peak current control... so...from a sensing resistor that pass my output current and after a small circuit i get a voltage that has the shape of the current (triangle) and amplitude between 5 and 8 volt... the next step is to add a compensation ramp to this voltage...i made another circuit that produces this sawtooth wave and i have to add it... then the next step is to get an error amplifier and at the input to put a reference for my output voltage (from a zener) and my output voltage after a voltage divider...at the same level of 5 to 8 volts ...and the output of the error amplifier i have to take it to the one input of a comparator, and to the other input of the comparator i have to put the other voltage with the compensation ramp added...
this is how it should be done...but i dont know how... i mean...i dont know how to setup the error amplifier and how i can add the sawtooth to the voltage that is my "current image"...
if you could give me an example to simulate in spice it would be great!