Constant current from buck driver, with modulation

Thread Starter

deezums

Joined Sep 26, 2019
6
Hello!

I would like to try and make a constant current source from a switching regulator to power a laser diode. I would also like to be able to adjust the output current in real time via a 0-5V signal from a DAC. Finally, I'd like to offset the output current slightly so that when the modulation signal is low there's still a little bit of current output. This would be used to set the threshold current, as most of these diodes don't do anything till over 50mA or so.

I think this should be possible using a switching regulator, I have used laser drivers in the past that work in a similar way but without the analog modulation.

I think I have something that will work, but would like to see if someone knows a better way. Here is a photo of what I have so far.



On the left is the modulation voltage source, followed by a potentiometer divider to set the main gain, then followed by another divider to drop the scale to 0-1V. On the right is the bias gain, a similar resistor divider from potentiometer. Before summing these two voltages they are passed through unity gain opamps to prevent inbalance between the resistor dividers. This final voltage represents the requested output current. I would like this driver to be able to drive up to 1A, so as configured in the photo 1A = 1V.

On the lower half is the feedback, a pretty simple current sense amplifier configured to output 1V/A.

Now I think I should compare the two voltages, if the target is higher than the feedback voltage I need a higher voltage on the feedback pin on the regulator, and if it's lower I need less. Would a comparitor and some dividers to set the output voltage to match the switching regulator be enough? Or is there a better way? With a basic comparitor circuit I am getting the expected digital output, but what can I do to get a more analog-like feedback?

Thank you for any advise, I have next to no knowledge of this analog stuff!
 

Thread Starter

deezums

Joined Sep 26, 2019
6
I think I may have come up with something. If I add the switching regulator's feedback voltage to the current feedback voltage I can then subtract the target voltage later and be left with an analog difference between the target and actual output current, I don't need a dual rail power supply. I am not 100% sure, but I feel like the switching regulator will work better with an analog feedback voltage rather than a hi/lo from a comparator.



However, with no filter on the feedback pin I can not get reliable regulation. The current will rise too quickly, the feedback current voltage is too slow and so current will way overshoot, the feedback voltage overshoots, and the regulator quits switching for ~2.5ms. I added a low pass filter to the feedback pin to try and help, seems to work okayish.



Is this a reasonable way to get what I am after?

Thank you!
 

Papabravo

Joined Feb 24, 2006
21,159
I think I may have come up with something. If I add the switching regulator's feedback voltage to the current feedback voltage I can then subtract the target voltage later and be left with an analog difference between the target and actual output current, I don't need a dual rail power supply. I am not 100% sure, but I feel like the switching regulator will work better with an analog feedback voltage rather than a hi/lo from a comparator.



However, with no filter on the feedback pin I can not get reliable regulation. The current will rise too quickly, the feedback current voltage is too slow and so current will way overshoot, the feedback voltage overshoots, and the regulator quits switching for ~2.5ms. I added a low pass filter to the feedback pin to try and help, seems to work okayish.



Is this a reasonable way to get what I am after?

Thank you!
I don't think so. The basic idea behind using the comparator is to achieve the feedback on a cycle by cycle basis with a fixed switching frequency. You want to divide the period into a charging phase where the current in the inductor is increasing and a discharging phase where the current in the inductor is decreasing. There are additional considerations around being a CCM (Continuous Conduction Mode) or a DCM (Discontinuous Conduction Mode) as well as preventing sub-harmonic oscillations.

As you have already discovered, voltage mode control is too slow at high switching frequencies. It is however very desirable for controlling the long term average output voltage.
I recommend reading Basso on this subject. It is described pretty well in chapter 2.
 

Thread Starter

deezums

Joined Sep 26, 2019
6
I think I see, splitting the detection into two halves like that should let the regulator respond quicker?

I am also not sure what Basso refers to, but with google I think they might make electric bikes?

Thank you!
 

Papabravo

Joined Feb 24, 2006
21,159
I think I see, splitting the detection into two halves like that should let the regulator respond quicker?

I am also not sure what Basso refers to, but with google I think they might make electric bikes?

Thank you!
Sorry, Christophe Basso is the author of a useful book on Switch Mode Power Supplies. The 2008 edition can be had used for a much cheaper price. At least it was for me.
https://www.amazon.com/Switch-Mode-...hristophe+Basso&qid=1611942006&s=books&sr=1-1
 

Thread Starter

deezums

Joined Sep 26, 2019
6
Dang amazon and the digital copy being more expensive than the physical...

I'll see if I can find it for less, but it's all probably too technical and will go clean over my head. I'll see if I can find any examples, I seem to learn better that way.

Thank you for the advise!
 

Papabravo

Joined Feb 24, 2006
21,159
Dang amazon and the digital copy being more expensive than the physical...

I'll see if I can find it for less, but it's all probably too technical and will go clean over my head. I'll see if I can find any examples, I seem to learn better that way.

Thank you for the advise!
In the extended LTSpice libraries from @Bordodynov there is a large collection of simulation examples from Basso's book(s). There might be enough there to give you some ideas. Mr. Basso works/worked for ON Semiconductor and has written numerous freely available app notes. You could also try writing an email to him for suggestions and advice.
 

Thread Starter

deezums

Joined Sep 26, 2019
6
I think I am in way over my head again.

I guess to use an opamp/comparator to detect the switch being on I'd need to AC couple the signal, then somehow bias the comparator output to match the feedback voltage of the regulator, probably add some hysterics. I guess I would want to offset it lower than the feedback voltage, but how much?

Setting up a constant current supply is pretty easy, just set the gain of the current monitor to match the feedback voltage. Adding modulation is where it gets tricky, and no examples I've ever found show how it should be done. I'm left trying to copy reversed schematics of never available little hobby products people no longer produce. Gladly would just buy something if that were possible.

Guess I will use a transistor in linear and deal with the voltage drop. Damn green diodes want 7+ volts while a red one still only needs ~2.5V...
 
Top