I'm trying to design a cheap way to pull current from the feedback node of a SMPS in order to dynamically control the output voltage, as explained in this application note:http://www.ti.com/lit/an/slva861/slva861.pdf. The DAC of my microcontroller is unable to provide enough current to drive the BJT so I'm using an op amp to drive the base of the BJT.

Here is what I have so far:


simulate this circuit – Schematic created using CircuitLab

I want to control Q1 in its saturation region so that it behaves like a resistor that decreases in resistance as VDAC increases, but I'm not sure which resistance values to use for R3 and R4. I tested the circuit with R3 = 500 and R4 = 500, but the saturation region of the BJT only lasted between VDAC = 2.28V and VDAC = 2.35V, at which point the BJT enters forward active mode. My question is this: what resistance values for R3 and R4 should I use to increase the range of values of VDAC in which the BJT will operate in saturation mode?

  • \$\begingroup\$ Just a passing note while not advising for it, but you could also simply modify the voltage or current divider (within reason). So far, it happened twice for me, and the worse it was when in the field, many miles from humanity, very few tools at hand, the output cap was failing, so I just brute forced the divider, while adding, in the same gross manner, two more turns to the inductor (voltage mode)... It did work and saved the day, until it was replaced and then properly fixed. Again, not saying you should, only that you could. \$\endgroup\$ Apr 13, 2018 at 10:56
  • \$\begingroup\$ I spent far too much time working out actual working math for my answer.. I started with Thevenin's equation and realized I'm overthinking it on my side. \$\endgroup\$
    – Barleyman
    Apr 13, 2018 at 14:39
  • 1
    \$\begingroup\$ The circuit doesn't work at all. Your TL081 opamp common mode range is VSS + 3V. Try LM358 or LM2904. \$\endgroup\$
    – Barleyman
    Apr 13, 2018 at 15:20

4 Answers 4


I want to control Q1 in its saturation region so that it behaves like a resistor that decreases in resistance as VDAC increases

The SMPS is a closed loop system which needs to be properly compensated for stability. What you want to do is similar to inserting a potentiometer in the feedback, and creates a variable feedback factor, and thus the loop will need to be compensated properly for all settings. It might work... or not...

It is much easier to inject a current into the feedback node. This current can be positive or negative depending on which way you want to adjust the voltage. This works by addition (or substraction) instead of your proposed multiplication, it does not modify the feedback factor or the stability, or the loop gain, etc.

In other words, just do what Andy says (resistor from DAC output to FB node). This answer is only to explain about the loop gain and compensation gotcha.

  • 2
    \$\begingroup\$ Sinking current from the FB node works just as well, e.g. LED drivers use that method to adjust SMPS voltage to match actual LED voltages. \$\endgroup\$
    – Barleyman
    Apr 12, 2018 at 17:06
  • \$\begingroup\$ Note that a variable resistor from the feedback pin to ground is a current sink because the feedback voltage is constant in closed loop operation. \$\endgroup\$ Apr 13, 2018 at 10:48
  • \$\begingroup\$ @OlinLathrop well, the FB voltage is the constant ref voltage plus the error voltage... so using a variable resistor will change feedback factor, transient response, noise, maybe require compensation, etc. \$\endgroup\$
    – bobflux
    Apr 13, 2018 at 11:44

The TL081 used in OP diagram does not work at all in this application unless you can supply it with at least +/- 5V. LM358 or LM2904 are much better choices.

If you really have your heart set to using this circuit, you're overthinking it. Whatever your opamp positive node sees is what it tries to adjust the transistor emitter to produce by adjusting the base current.

So figure out what you'd like your output voltage adjustment range to be and set the emitter resistor to a suitable level WRT min/max output from DAC.

You basically have a maximum incoming current from R1, \${12V \over 280k} = 43µA\$ (if R2 is shorted) that will be split between R2 and R4. You max voltage is with R2 and R4 in parallel (transistor active) and your min voltage is R2 alone (Transistor switched off).

43 microamps is very very small, consider scaling the resistors to e.g. 14k and 1k. Note that this will mess your feedback loop if you don't adjust capacitors to match, which is beyond the scope here. But the same scaling factor applies, in this case you'd want a 20x larger compensation capacitor to keep the pole frequency. Other figures will work out as well of course. Whatever part value is convenient.

A worked out example

It's not immediately obvious how to deal with the relationships so I'll go over these for you. This is career-advancing stuff. We'll work this out from bottom to top.

I'll keep the 20k + 280k voltage divisor here and use 20k as R4.

If we denote transistor current as \$I_{Q1}\$, the relationship between the DAC and the transistor current is \$I_{Q1} = {V_{DAC} \over R4}\$.

We're ignoring the base current here. In normal operation the base current should be about 1% of the collector current i.e. not matter much. However, when you drive the circuit out of range the base current will start "lifting" the R4 voltage

The reference voltage for the SMPS is \$V_{ref}={12V * 20k \over (280k+20k)} = 0.8V\$

This should be found in datasheet, I just put in the values from the circuit diagram.

Since we know the current flowing through the transistor and the reference voltage at the top of the transistor, it's easy enough to calculate series resistance of Q1 and R4.

\$R_{Q1}+R_{R4}={V_{ref} \over I_{Q1}}=R_{bias}\$

Armed with relationship from the \$V_{DAC}\$ to \$R_{bias}\$ it becomes rather easy to work out relationship from \$V_{DAC}\$ to \$U_{out}\$, keeping in mind \$R_{bias}\$ is in parallel with R2 for the reference voltage division.

I'll leave working out the figures how to do that for the reader.

When when \$V_{DAC}\$ rises high enough, \$R_{bias}\$ becomes less than \$R4\$ and as negative resistors were sold out, this is not possible. With a transistor this is masked by the bias current, with mosfet the gate voltage will go to max. The maximum usable current is \$ V_{ref}\over R4\$

So as an example, 0.3V \$V_{DAC}\$ results in effective bias resistor of 53.3k. This then will adjust output voltage to 16.2V.

A second homework assignment is to adjust R2 and R4 to produce different output voltage ranges.

Usable output voltage range with 20k R2 and R4.

Output voltage vs VDAC

  • \$\begingroup\$ Before some smart alec jumps in, the "incoming" current is of course a combination of high and low resistors versus voltage. So minimum current is 12v / (280 k + 20k) = 40µA. Depending on the R4 size maximum current is more than that. \$\endgroup\$
    – Barleyman
    Apr 13, 2018 at 8:59

It looks like a bit of overkill - why don't you use the output of your DAC to feed the VFB pin via 10 kohm. So, as the DAC output voltage lowers, it convinces the regulator chip to provide more output voltage in order to restore the correct voltage at VFB.

Ultimately, with 10 kohm as your DAC output and given the values in your circuit, you should be able to get a decent control range both above the nominal set position and below (DAC voltage > VFB (nominal).

Don't bother with op-amps unless you need a few hundred ohms for driving the VFB pin - then use an op-amp as a voltage buffer.

  • \$\begingroup\$ Does the regulator power the processor that has the DAC? If so, this needs to be thought out to make sure it can start up properly. \$\endgroup\$
    – user57037
    Apr 12, 2018 at 16:50
  • \$\begingroup\$ Beware of current loops when doing this. It's easy to get things oscillating if your DAC is referenced to a different Power/GND plane than the SMPS supply. \$\endgroup\$
    – Barleyman
    Apr 12, 2018 at 17:05

There are some issues you seem to be overlooking.

You first have to find what the voltage of Vfb is. According to the 12 V output, R1, and R2, that is 800 mV. That leaves rather little room for a current sink to operate. Due to the low voltage, I'd use a FET instead of a BJT.

R4 needs to be sized so that the current thru it with a bit less than 800 mV on it is what it takes to get to the maximum output voltage you want. Let's say you target 780 mV. If you want to double the output voltage, for example, then R4 needs to draw the same amount that flows thru R1 at the unadjusted voltage. That is (11.2 V)/(280 kΩ) = 40 µA. Using Ohm's law, (780 mV)/(40 µA) = 19.5 kΩ.

The opamp then needs to regulate the top end of R4 from 0 to 780 mV to adjust the output voltage. Since your A/D output is probably higher than that, you put a resistor divider before the input of the opamp to scale the A/D output to the 0 - 780 mV range.

  • 1
    \$\begingroup\$ @MCG: I rolled back the edit here too, although I kept the one genuine typo you found. This time you actually broke things by deleting all the spaces between the numbers and their following units. Those spaces are supposed to be there. NIST has a good publication on this. Go read it. Even if you don't agree, it's not your call, particularly in my posts. Knock it off! \$\endgroup\$ Apr 13, 2018 at 10:44
  • \$\begingroup\$ I was unaware of the NIST publication explaining spaces. So apologies on that, however, the 'thru' spelling is still incorrect. As for 'particularly my posts', yours aren't more special than any others. I tend to change most posts I see with grammatical errors, yours just happen to contain the same one repeatedly. There's nothing special that prevents 'your posts' from being immune to edits \$\endgroup\$
    – MCG
    Apr 13, 2018 at 10:51
  • 1
    \$\begingroup\$ @MCG: Now you're just being a jerk on purpose. Your last edit I just rolled back changed three words to exactly the same spelling, and changed one word that you were already told was the author's intent. If you keep doing this, I will have to notify the mods of your rogue edits. \$\endgroup\$ Apr 13, 2018 at 12:13
  • \$\begingroup\$ If I intended to spell every 'you' as 'u' would you have a problem with someone editing that? Even though I intended it? Wouldn't think so. As far as I know, there is nothing against the rules for correcting poor grammar and spelling \$\endgroup\$
    – MCG
    Apr 13, 2018 at 12:22
  • \$\begingroup\$ Thru: North American, informal, non standard spelling of the word 'through'. Same as spelling 'you' as 'u'. Essentially, it is lazy and incorrect, so I believe it is valid to correct it \$\endgroup\$
    – MCG
    Apr 13, 2018 at 13:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.