Here is a link to a circuit that uses an op-amp to amplify the voltage from the current sense resistor to be fed to an ATtiny13A.
Although those circuits appear interesting I won’t be using any method that requires changing resistors to change current (the main reason why I’m still on my 7135 design).
If you decide to make one, make sure you test that you can flash the MCU with all these components connected before you design a driver board. I’ve had to scrap a few driver boards because of components on some pins (mostly capacitors) have prevented me from being able to flash. I’ve had to remove components, flash, and then solder them back on… not fun.
This one would be interesting to try.
Just lower the current sense resistor to .01 ohm to get a 5 A operating range.
Note that it only gives a resolution of about 0.1 A. So no low-low modes and the control might be somewhat unstable below 1 A.
This article is not exactly an idea, but it’s something like what I was wondering about:
Basically, a DAC that can be controlled by an MCU and the output of the DAC (an analog signal) feeding into a MOSFET where the MOSFET is in the linear phase.
That article also has an op-amp between the output of the DAC and the input of the MOSFET, but maybe there’s a different DAC (or MOSFET) that would allow direct DAC-to-MOSFET, which would eliminate the need for the op-amp and also the +15V supply?
The other thing I don’t know about is that the DAC in the PDF uses a serial-type interface. I’ve been trying to find a small (6-8 pin SOIC) DAC that has parallel input to avoid needing the MCU to do serial I/O, but maybe one of the Atmel MCUs can do the serial I/O natively?
Just throwing out ideas in this thread…
The current sense resistor has to be selected initially for the maximum current that you need.
After that the FET gate is controlled by a ‘pseudo’ analog value in a closed loop control algorithm to get the desired current, as programmed in software.
These small Altmel MCUs do not actually have analog output pins (DAC). The signal is generated using regular PWM and then filtering the result with a hardware (RC) filter to get an (almost) smooth value between 0 and Vcc.
A kind of control loop needs to be programmed in the MCU. Classic control theory uses PID loops (proportional/integral/derivative) where the output of the loop corresponds proportionally to the difference in the set point and actual current (the error), and the integral of the error and the derivative of the error. The loop is tuned by adjusting the weights of these three 3 components. For something simple like this we can probably get pretty good results using just a ‘PI’ loop.
Yeah, I know about them designs too. I got a bit of feedback when I asked in this thread: Methods for constant current (no PWM) in driver design (not existing drivers). Post #14 looks a little like what you describe, and I got an even more advanced drawing sent to me by PM… but it all gave me a headache…
Can confirm - nothing like control theory to give a good headache
That post 14 is a more typical and safer way to do it.
A software or MCU glitch at most changes the set-point of the control loop, the final control is with that op-amp.
Never closely looked at an LD-1 or LD-2. Maybe this is how it is done?
That opamp circuit will not be stable as shown, depending on the components used and physical circuit layout.
It will need ‘compensation’ - another great generator of headaches.
Even better is to use the FET as a sense resistor
Would somthing like this work
A 3.3v 10A LDO?
Only problem…don’t know where to get em
What about a 500mA constant current LDO (its just a little bit more than 350ma…)
Another problem - it is a 10A capable voltage regulator, not current regulator.
It could be wired as up a current source according to the datasheet, but then back to square one on how to modulate the current.
That’s where you run it thru a FET PWM’d by an Attiny
The thing with these components (or at least with a lot of them I’ve been looking at) is the voltage loss over them. The AMC7135s have a specified voltage drop of 120 mV, that LT3085 has a specified voltage drop of 275 mV. So I’m wondering why this would be better than AMC7135s?
Disclaimer: I don’t know crap about these things, and could be way off in my assumptions…
EDIT: I didn’t see your post about adding the FET, so it’s probably a non-issue.
Isn’t what we are all looking for a driver that is pwm-less and high current and controlled by attiny?
I personally don’t mind fast PWM if it means a simpler driver. I don’t like stacking 7135’s, but I want something that fills the gap between 3amps and 8-10amps for triples and low Vf emitters.
I’m happy to do the pcb work in Eagle, I just don’t know enough about circuits/components to do that part.
After studying the MIC5156, I really like it. It requires a small external parts count to be configured as a current limiter. It is PWM-controllable with the EN pin (Figure 4a). It looks like for current-limiter application, any voltage version of MIC5156 can be used, so the least expensive one will do.
The 7135 works so well because all of the other parts on the board are associated with mcu operation, it can be paralleled in large numbers, it readily accepts pwm control, it comfortably operates with a variety of input voltages, and is simple enough to use that even a boob like me can figure it out.
Don’t forget, you have to make it all fit in a flashlight. Playing around with an application like TI’s Webench produces interesting results, until it is realized that the circuit is quoted at 400 - 500 mm square (without the mcu and its associated components) and one side of a 17mm board is only 227 mm square, not taking into account stuff like ground ring and connection points. It doesn’t take long to see the advantages of using the 7135 for regulation.
The LD2 is about as good as it gets. It uses an opamp to run the FET in the linear region based on feedback from the sense resistor. The MCU is used to further bias the signal to get different mode levels with no PWM. Great design--and it fits on a single-sided 17mm board. He chooses to use PIC, but you could also build one with an Atmel MCU.
You can convert almost any constant voltage converter into a constant current converter by adding a sense resistor as part of the voltage divider. The problem then is that most of the feedback voltages are quite high: anywhere from 0.6V to 1.2V. While that high of a feedback voltage will provide great accuracy, the efficiency will be horrible because the sense resistor will burn off a ton of power. The solution is to bias the feedback voltage to something closer to 0.2V; you can do this by supplying an external constant voltage passing across R1 then using the sense resistor along with R2 to form the bottom half of the divider. As current passes along the sense resistor a voltage differential is generated and you get regulation. This is relatively easy, and proven (I've done it on several different buck and boost converters now), but the hard part is getting working modes.
Getting working modes with a usable dimming range is difficult on most non-dedicated CV converted to CC converters. There are several methods to doing this, including pulsing the EN pin, biasing the SS/TRK pin (if present), or running an FET inline with the R2 part of the feedback divider circuit. None of these that I've tried will give you good dimming results, even at slow (< 1 kHz) dimming frequencies: they are almost always noisy at high currents, and the dimming ratio is poor. The solution to this problem is obviously to use an opamp to bias the feedback using an analog signal instead of pulsing it with pure PWM. You can convert the PWM into an analog voltage with an LC filter that can then be fed into the opamp.
You can see now why a dedicated LED driver is a much simpler solution than converting a CV converter. Eagle work is the easy part; making a reliable working circuit the the hard part. Stacking 7135 chips is a piece of cake and cheaper than any of these solutions. Also, remember that if you are truly doing even a little regulation on an 8-10A driver you are going to be generating a decent amount of heat.
Just out of curiosity I did a search on DIY chip manufacturing. It seems is is done somewhat like Oshpark does our pcb’s but in silicon wafer form instead for prototyping and university research projects that have access to grant moneys. Even in batch runs it’s still WAY, WAY more expensive though and by the time you have it packaged it’s still in the hundred$ per chip so even if we could design a better chip than the 7135 it wouldn’t pay to make it. Keep looking though, you never know when a chip will be made that offers something we can repurpose.