# Control design for PWM converter

Baluncore
The comparator and saw wave oscillator can use a Texas Instruments LMV7219 which is a 7-ns 5Volt Comparator with Rail-to-Rail Output. $2 each. You only need a single op-amp. Attached is the schematic showing comparator, saw wave generator and a higher current gate driver. #### Attachments • 70.9 KB Views: 409 Hubert Tchio @Baluncore Thank you so much, I must admit it has not been an easy affair. Please I still count on you to complete this task. I have simulated your design but the LED current still stay high "closed to 4A" the reason why is not working. Please can you help? I have tried many values for the resistor on the integrator, i have also reduced the reference voltage. Here attached is the design and the simulation Best regards Hubert #### Attachments • 162.4 KB Views: 130 Baluncore Science Advisor Maybe you have the wrong control loop polarity ? Follow the closed loop, is this sequence correct ? If LED current rises. INA210 Vout rises. LM334s are disconnected. Current flows into U73, C1-c, so V(U73)out falls. U74 voltages rises. Vgate rises. MOSFET turns on. D5 conducts. LED current rises. Does that appear to be a positive feedback loop ? You need negative feedback to regulate so reverse the input connections to U74. Does the circuit now work ? If you need to further diagnose the bug you may need to isolate where it is happening in the simulation. I would take the output from the INA210 and feed it along with the 2.5Vref directly to the final comparator, with comparator polarity correct for negative feedback. Hubert Tchio Baluncore Science Advisor Note: You are using a comparator with built-in hysteresis as an op-amp integrator. That will not work. You need to use an op-amp there. Hubert Tchio @Baluncore, thank you so much. I will look at it. Have a great weekend Best regards Hubert Baluncore Science Advisor For the integrating op-amp you might consider an AD8615 which is a precision, 20 MHz, CMOS, Rail-to-Rail Input/Output Operational Amplifier. It has low bias current, (less than 1nA), and will run on a single 5V supply. Digikey sell them for about US$3.

Hubert Tchio
@Baluncore
Thank you so much. The circuit is perfectly what I wish to have. I will then proceed to design the PCB.
sharing a grass of beer would have been a nice idea.
Once more thank you.

Best wishes
Hubert