# Sanity checking an LM2596-ADJ constant current supply design for driving LEDs

I've designed, in simulation, an adjustable constant-current supply based on an LM2596-ADJ buck converter IC.

I chose STW8B12C LEDs for simulation because three of them in series roughly matches up with the I/V curve of the LEDs I'll be using in practice, which don't have a model available. In practice there'll be 24 pairs of two series LEDs, constituting a total maximum continuous load of 2.4A. The schematic above is trimmed down to a smaller array just for convenience.

R_sense is just for simulation purposes. AD820 was chosen arbitrarily for simulation but I'm pretty sure any jellybean rail-to-rail opamp will work here. Input capacitors were omitted for simulation since they have no effect when V1 has no internal resistance and there are no inline parasitics.

The operating principle of the circuit is fairly simple:

• R1 provides the feedback for constant-current operation. The value for 2.4A max operation is 500mΩ.
• The supply current is controlled by a 0-3.3V input from a DAC. This is simulated by V3 here.
• The opamp on the left operates in a positive-offset, negative-gain configuration. This turns the 0V to 3.3V range from a DAC (simulated here by V3) into a 3.3V to 1.27V output. Technically the opamp could be omitted and the DAC output could be used directly, but the opamp ensures the voltage remains between 3.3V and 1.27V during boot or MCU failure, and lets the full DAC range be utilised.
• The output of the opamp "pulls" the sensed current value away from the LM2596-ADJ's nominal feedback voltage (~1.25V) via the R2/R3 divider. Technically the opamp should be outputting a range of 3.3V to 1.25V, but 1.27V makes the resistor selection easier and the 20mV delta is so tiny that it can be ignored.
• When DIM is at 3.3V, FB_shift is at 1.27V, and the LM2596-ADJ operates normally.
• When DIM is at 0V, FB_shift is at 3.3V, and the LM2596-ADJ drops the operating current down to around 10mA.
• The operating current scales (close to) linearly with the DIM voltage.

This appears to work very well, at least in simulation. There's a small nonlinearity at the low end of the control scale, but it's acceptable. There's also a power-on transient where the LEDs get around 30mA through them for 1-2ms, but this is well within spec and also acceptable.

The use-case is for stage lighting fixtures controlled over Art-Net. The 24V supply will come from an off-the-shelf AC/DC SMPS module. A separate buck converter will supply the 5V rail, and the 3.3V rail for the MCU will be linearly regulated from there too. The LEDs will be on their own dedicated aluminium PCB, whereas the rest of the circuit will be on a standard FR4 board mounted behind. Interconnection between the PCBs will be via a header.

At full power R1 will dissipate around 3W, so I'll construct it from a number of larger value resistors in parallel (probably 6x 3Ω 1W) to keep the thermal dissipation manageable. I'll probably put those resistors on the aluminium PCB too, since it doesn't really affect the length (and inductance) of the feedback path.

I'm looking for general feedback on the design, to see if I've made any glaring errors, and also some input with design questions I still haven't fully resolved:

• Should I add small value resistors (e.g. 200mΩ) to each chain, to help with current balancing and uniformity? Perfect visual uniformity across the LED array isn't critical; I'm more concerned about lifetime impact from overdriving a chain.
• 1N5819 for D1 was chosen arbitrarily based on other LM2596 designs I saw. From simulation I suspect that it is possibly on the limits of being in-spec for this task. While the RMS power looks to be about 200mW max, the RMS current is around 1A, which seems a bit close for comfort. The peak current spikes are still well within the peak rating of the part. Should I consider a different fast Schottky with a higher If(AV)?
• LTspice's estimation of the RMS power dissipation in L1 is 13W, which is clearly incorrect. I suspect it is mischaracterising the energy stored in the inductor as dissipated energy. I've seen this occur before in other simulations, too. Am I correct in my assessment? Given that most power inductors are specified at 100kHz and the LM2596 switches at 150kHz, I presume any shielded inductor rated for ≥3A and with ≤150mΩ DC resistance will be fine here and I don't need to derate?
• In simulation the ripple current on C1 (set to 0.5Ω ESR) is very low (<100mA RMS) during steady state operation, with a short power-on transient averaging 3A for 2ms. Based on this and a rule of thumb that 10x the ripple current is ok for short transients, I'm assuming that pretty much any 35V ≥300mA rated aluminium electrolytic capacitor should be fine here?
• Given the input voltage of 24V and an output voltage of around 20V, the graph on page 5 of the LM2596-ADJ datasheet indicates that I should expect above 90% efficiency at 3A load. In simulation I'm seeing around 91.5%. My intuition is that I should expect around 85% efficiency in practice. This would yield a worst case power dissipation of 0.15×2.4A×(24V-20V)=1.44W. If all of that was dissipated in the LM2596 itself, with a θJA of 30°C/W for the TO-263 package on a reasonable sized plane, there would be a 43°C rise above ambient. However, since I'm deriving the power loss numbers from efficiency graphs, it seems to me that a non-insignificant portion of that power is dissipated in the diode and passives rather than the chip's internal switch. Would 800-900mW be a reasonable estimate of the maximum continuous power dissipation in the chip?
• The LM2596 has internal thermal power dissipation limiting. I would like to add additional thermal throttling to the design to help prevent the LEDs overheating. The obvious answer is to have the MCU sense the temperature, via a sensor IC or a thermistor on an ADC pin, and handle it in software. However, I could instead add an NTC thermistor pullup (e.g. 470kΩ, β=4750K) to the FB line so that the feedback voltage is pulled up as the LED temperature rises. There are benefits to both approaches. The software approach gives me more control over thermal throttling behaviour, but if the MCU crashes it won't do anything, and there's additional cost associated if I go with a temperature sensor IC for better precision. The NTC pullup approach is reliable even if the MCU crashes, but is less flexible and somewhat less precise. Are there any additional upsides/downsides I missed?

I've uploaded the LTspice simulation file (.asc) to Gist. I created the LM2596-ADJ model based on the answer to this question.

Since asking this question I've had some great input from the fine folks on Twitter and Mastodon, plus on another question here. I've also done a bunch of additional analysis myself. I'm going to summarise all the details and changes. Hopefully this will be of use to others in future.

Shunt resistor:

R1 provides the feedback for constant-current operation. The value for 2.4A max operation is 500mΩ.

[...]

At full power R1 will dissipate around 3W, so I'll construct it from a number of larger value resistors in parallel (probably 6x 3Ω 1W) to keep the thermal dissipation manageable. I'll probably put those resistors on the aluminium PCB too, since it doesn't really affect the length (and inductance) of the feedback path.

It is actually pretty important to keep the feedback loop fairly tight. Putting the feedback resistors on the aluminium PCB would've been a mistake for a couple of reasons. First, the wide loop would certainly cause EMI issues. Second, the transient response (as much as there needs to be one for an LED load) would have been poor due to stray inductance.

Moving the shunt resistors onto the FR4 board near the LM2596 comes with significant thermal management concerns when the power dissipation is 3W. Luckily, I can sidestep that problem by using an opamp to scale up the voltage.

A rail-to-rail input and output (RRIO) opamp with a low offset voltage can be used. The necessary slew rate can be calculated based on the largest expected feedback voltage change per switching period:

$$t=\frac 1 {150000}$$

$$\frac {dV} {dt} = \frac {2.56V} {t} = 0.384 V {\mu s}^{-1}$$

The switching frequency of the LM2596-ADJ is somewhat variable, but 150kHz is the highest specified frequency.

This assumes a worst-case feedback voltage change of twice the maximum nominal reference voltage (1.28V) in a single switching cycle. To absolutely guarantee correct operation I'll spec for twice this slew rate, so 0.768V/us or higher.

I'll likely use a COS722 since it's an affordable dual RRIO opamp with a slew rate of 7.5V/µs and a low typical offset voltage.

Nominal voltage:

The output of the opamp "pulls" the sensed current value away from the LM2596-ADJ's nominal feedback voltage (~1.25V) via the R2/R3 divider.

The nominal voltage is actually 1.23V, not 1.25V. I misread the datasheet.

Dimming voltage range:

The opamp on the left operates in a positive-offset, negative-gain configuration. This turns the 0V to 3.3V range from a DAC (simulated here by V3) into a 3.3V to 1.27V output. Technically the opamp could be omitted and the DAC output could be used directly, but the opamp ensures the voltage remains between 3.3V and 1.27V during boot or MCU failure, and lets the full DAC range be utilised.

I changed the output range of the dimming opamp circuit to get a better range of dimming. If I recall correctly it's now outputting a range of around 1.25V-4.1V.

Current balancing resistors:

Should I add small value resistors (e.g. 200mΩ) to each chain, to help with current balancing and uniformity? Perfect visual uniformity across the LED array isn't critical; I'm more concerned about lifetime impact from overdriving a chain.

I had clearly forgotten the process for evaluating the correct current balancing resistance when I suggested 200mΩ. I should've calculated it as $$\R_{b}=\frac{V_{f(max)}-V_{f(min)}} {I_{\delta(max)}}\$$, where $$\I_{\delta(max)}\$$ is the maximum tolerable current variation between chains.

The forward voltage variation is quite significant for the LEDs I'm using; the datasheet shows a range of 8.4V to 10.4V at 100mA. By stepping the N parameter in the LED diode model, I was able to simulate the variation in the I/V curve in a circuit containing two parallel pairs of series LEDs. I then graphed the difference in current between the two parallel chains.

No series resistors:

With 10Ω series resistors:

With 20Ω series resistors:

With 30Ω series resistors:

These simulations were made by generating four SPICE model diode directives where the N values for the four models could be stepped through all permutations of the values required to produce the minimum, typical, and maximum forward voltages at 100mA. The graphs were generated as a stepped DC operating point simulation across the table of parameters. The parameter tables each contain 81 entries, on account of three N values over four positions, or $$\3^4\$$.

Any higher series resistance increases the maximum worst-case forward voltage for a chain beyond 24V. This means that if I want better uniformity than ±7.5% across chains, I have to trade off maximum brightness. In this case I think 30Ω is a reasonable choice. This makes the worst-case power dissipation through the resistors $$\(0.1A \times 1.075)^2 \times 30\Omega = 0.3467W\$$, which is manageable.

Schottky diode:

1N5819 for D1 was chosen arbitrarily based on other LM2596 designs I saw. From simulation I suspect that it is possibly on the limits of being in-spec for this task. While the RMS power looks to be about 200mW max, the RMS current is around 1A, which seems a bit close for comfort. The peak current spikes are still well within the peak rating of the part. Should I consider a different fast Schottky with a higher If(AV)?

1N5819 is probably a bit under spec. I'll probably go with something with a higher $$\I_{F(AV)}\$$. MBRD835L was suggested, but it's a bit overkill. I'll probably go with B540C-13-F or SS54.

Inductor:

LTspice's estimation of the RMS power dissipation in L1 is 13W, which is clearly incorrect. I suspect it is mischaracterising the energy stored in the inductor as dissipated energy. I've seen this occur before in other simulations, too. Am I correct in my assessment?

Yes, this is erroneous behaviour from LTspice.

Given that most power inductors are specified at 100kHz and the LM2596 switches at 150kHz, I presume any shielded inductor rated for ≥3A and with ≤150mΩ DC resistance will be fine here and I don't need to derate?

The inductor should ideally be rated for twice the forward current. Since the average current is as high as 2.4A, the inductor ideally wants to be rated for 5A or higher.

The chosen inductor value of 47µH is not optimal for the load; 68µH is better for an expected max output of 18-20V at up to 2.4A.

Output capacitor:

In simulation the ripple current on C1 (set to 0.5Ω ESR) is very low (<100mA RMS) during steady state operation, with a short power-on transient averaging 3A for 2ms. Based on this and a rule of thumb that 10x the ripple current is ok for short transients, I'm assuming that pretty much any 35V ≥300mA rated aluminium electrolytic capacitor should be fine here?

This is mostly true, but a closer reading of the datasheet tells me that 220µF is a better value. For safety a 50V rating is better than 35V. 300mA ripple current is probably a little on the low side. Something like VKME1651K221MV (220uF 80V 1.04A@100kHz) would be more than good enough.

A good quality 10µF MLCC in parallel (e.g. CL31A106KBHNNN) helps keep the ripple down a little, and handles the higher frequency switching components better than the aluminium electrolytic. It's worth noting that 150kHz switching rate does not mean that the highest frequency component of the current waveform is 150kHz; the frequency composition is dependent on the switcher's output slew rate.

Efficiency:

Given the input voltage of 24V and an output voltage of around 20V, the graph on page 5 of the LM2596-ADJ datasheet indicates that I should expect above 90% efficiency at 3A load. In simulation I'm seeing around 91.5%. My intuition is that I should expect around 85% efficiency in practice. This would yield a worst case power dissipation of 0.15×2.4A×(24V-20V)=1.44W.

This is correct; typical efficiency should be 85-92%.

If all of that was dissipated in the LM2596 itself, with a θJA of 30°C/W for the TO-263 package on a reasonable sized plane, there would be a 43°C rise above ambient. However, since I'm deriving the power loss numbers from efficiency graphs, it seems to me that a non-insignificant portion of that power is dissipated in the diode and passives rather than the chip's internal switch. Would 800-900mW be a reasonable estimate of the maximum continuous power dissipation in the chip?

This is correct. The LM2596-ADJ will probably run at around 50°C without a heatsink.

Thermal throttling:

The two thermal throttling implementations (analog NTC and digital temperature sensor) each had their own problems. An alternative is to buffer an NTC thermistor voltage divider with an opamp so that the input voltage can be read with an ADC pin as well as provide hardware thermal throttling.

The dimming voltage and the thermal throttling voltage can be passed through a pair of opamps in a highest-voltage-passthrough configuration.

This has several benefits:

• protection is applied even if the MCU crashes
• the MCU can fully cut off the LEDs in an extreme overtemperature situation
• the throttling doesn't start affecting brightness until a minimum temperature (e.g. 50°C)
• only the maximum brightness is affected
• I can report the current temperature over RDM using the MCU

Shifting feedback voltage:

The 18kΩ/10kΩ resistive divider works fine and doesn't need to be changed. The 10kΩ side goes to the current shunt opamp output, and the 18kΩ side goes to the output of the dimming/throttling opamp circuit.

Feedforward capacitor:

In a design I made in the interim, I mistakenly placed a feedforward capacitor from the reference design over the shunt resistor. The feedforward capacitor is supposed to negate the feedback resistance for high frequency components, so placing it over the shunt has the opposite of the intended effect. Instead, the feedforward capacitor should be placed over the 18kΩ side of the resistive divider. To prevent this from causing excessively sharp changes to the feedback voltage, a 2.2kΩ resistor is in series with the 560pF feedforward cap.

Here's the overall schematic I ended up with, minus the per-chain series resistors that I'll be adding. Part numbers are still not finalised but the design behaviour itself is complete.