Electronic – Transistor current limiter, microcontroller controlled

currentmicrocontrollerpower supplytransistors

I've come across a few transistor current limiter schematics, similar to this one:

enter image description here

However, I am not entirely sure how I could implement microcontroller functionality to control this. I think Rsense would cause Q2 to conduct if at a threshold (0.65V assumably) and Rbias will determine how much it will be limited, however that is unclear to me, especially if Rsense will be somewhere highside and just turning on Q2 with my uC seems to not do anything (in simulation at least)

How would I come up with the formulas for a variable limit that I can control? I would rather not have to use a digital potentiometer in place of R2, if I can somehow have sense voltage compared with a comparator with a voltage my uC defines, that'd be great! But how could I start the limiting? What do I "turn on" when the sense resistor shows enough current? Does Rbias have to be there to limit it to a certain level, and I'll end up having to use a digipot anyway?

Any solutions to a uC controlled current limiter would be great, that can be controlled easily with just a pin or two.

Best Answer

When you want a current limiter, David L. Jones provides and explaines one in his Lab Power Supply Design series. I will try to summarize his explanations (Video 1: starting at 19:45).

circuit

At \$V_{SET}\$ you provide a voltage between 0V - 1V to get the current drawn at OUT limited to 0A - 1A. Lets assume a voltage of 10V at OUT.

For 0V at \$V_{SET}\$ the voltage \$V_{Adder}\$ will be \$\frac{0 + 10}{2}V=5V\$. This is also the voltage at the non-inverting input of the opamp. The opamp tries to keep 5V at his non-inverting input by driving the transistors. When you get 5V at the non-inverting input the voltage accross the 1R resistor is 0V, because you got 10V on his left and 10V on his right side. The current will be 0A.

The circuit is linear so you get a linear relationship between the voltage \$V_{SET}\$ and the limited current.

To control the limiting of the current by a microcontroller you could apply a filtered PWM signal to \$V_{SET}\$.