Electronic – causing the oscillation in the feedback loop of an SMPS

constant-currentfeedbackoperational-amplifierswitch-mode-power-supply

I am trying to make a switching constant current regulator for a Ni-MH charger. It accepts a current set input from the microcontroller using a PWM DAC. I basically want to source 2000mA and 200mA for 1C and 0.1C relatively for charging the 2700mAh battery.

The way that I've tried to accomplish this is as follows:

An OP-AMP which is configured in negative feedback, takes Vset (PWM DAC) as non-inverting input and Vsense (the voltage on sense resistor) as inverting input. It drives a small signal MOSFET with its output so that buck converter's voltage output is for desired current at the load.

However, I am getting oscillations on TP1, which affects the whole system.

Here is the schematic, I am sorry that it is 3500 x 2500px :

Schematic

I have connected a short instead of R6, since Rdson of Q2 is about 50mohms. Also, I have connected a 1R 11W ceramic power resistor instead of a battery. Q3 is set off and Q2 is ON. I have connected an ampere meter and it shows about 1.9A through the resistor.

Here are some scope-shots of various test points which I have used very short ground lead on the probe to capture.

  • Test Point 5; non-inverting input of the OP-AMP:

TP5

  • Test Point 6; inverting input of the OP-AMP, voltage on the sense resistor:

TP6

AC Coupled:

TP6-AC

  • Test Point 1; Vsense pin of the switcher, drain of Q1:

TP1

  • Test Point 2; switch node:

TP2

  • Test Point 4 – Test Point 6; probe on TP4, ground clip on TP6, or in other words, voltage on P3 connector, or output voltage:

TP4-TP6

AC Coupled:

TP4-TP6 AC

Best Answer

Fundamentally, you have way too much gain in your feedback loop, along with enough phase shift to create a very nice ~50 kHz oscillator.

First, I would simplify the circuit by eliminating the MOSFET Q1; instead I would consider swapping the inputs of the LM393 and using its open-collector output to drive the Vref node directly. Secondly, I would add a significant amount of negative feedback around the LM393, along with a capacitor to roll off the frequency response. You really do not need a lot of bandwidth in your control loop for a battery charger — a battery is not a highly dynamic load.

Edit #1, incorporating comments:

I understand about limiting the voltage swing on Vsense; that's what R1 and R2 are for. I'm saying eliminate Q1 and R3 and connect the LM393 to the junction of R1 and R2. Then, you need to swap the inputs to the LM393 in order to preserve the correct polarity of the feedback.

For negative feedback, just connect a capacitor between pins 1 and 2 of the LM393. Since pin 2 is now connected to your reference source, you'll also need a resistor between C7 and pin 2. Together, these components will roll off the frequency response of the comparator. I would start with values like 10K and 100 nF, giving a corner frequency of about 160 Hz. I don't know if this will be enough to make the system stable, but at least it gets you started in the right direction.

Edit #1, additional thoughts:

Let's take a step back for a moment. If we ignore PWM_Vset for the moment, what's really needed is to take the 200 mV that appears across the sense resistor and translate this to the 1.221 V that the regulator expects on its Vsense pin. This requires a simple noninverting amplifier with a gain of a little more than 6.

Based on the new circuit, it would be an interesting experiment to short out C7 and reduce R3 to 51K (gain = 6.1) and see if the regulator is now stable. If it is, we can then think about ways to make the setpoint adjustable.