# Gas station without pumps

## 2017 September 2

### Correcting reasoning on buck regulators

Filed under: Robotics — gasstationwithoutpumps @ 13:10
Tags: , , ,

In More on cheap buck regulators, I wrote

We can fix the windup problem by either reducing the integrator coefficient (reducing the capacitor size on the COMP node, whose current size I’m uncertain of) or by using a larger inductor, so that the current changes less when the FET switches, and the time constant of the system is better matched to the integration time constant set by the RC value.

I was worried even as I wrote that claim that my reasoning was wrong.  Increasing the inductance would make the voltage on the output capacitor adjust more slowly, meaning that the system was even more under-actuated, resulting in more integrator windup. But I went ahead and bought some surface-mount 10µH inductors and put one on the board that I had taken the 1.5µH inductor off of.

In testing under light loads, the larger inductor works fairly well, though regulation is sometimes lost for short bursts even with a 145mA load.

resistance current 1.5 µH ripple 10 µH ripple
∞Ω 0 mA ±7mV ±18mV
40Ω 145 mA ±32–50mV ±36–45mV
32Ω 184 mA ±37mV ±36mV
24Ω 245mA ±60mV ±63mV
16Ω 374 mA ±50mV ±126mV
740mA ±65mV ±805mV
1388 mA ±435mV ±1186mV

So larger inductors give similar control at low currents, but hit the integrator windup problem at lower current levels.

I can think of two fixes:

• Making the capacitor of the compensation circuit smaller, so that there is less integrator windup.  I’m not sure what that will do to the stability of the regulator.
• Adding an LC filter to the output, to remove the ripple.  Because of the resistance of the inductor, this will entail some loss of efficiency.

I tried add a 1.5µH and 10µF low-pass filter to the output of the regulator, measuring current and voltage after the filter:

resistance current 1.5 µH ripple 10 µH ripple
∞Ω 0 mA ±7mV ±12mV
40Ω 146 mA ±3.6mV ±3.5mV
32Ω 185 mA ±4.3mV ±4.5mV
24Ω 246mA ±5mV ±8.5mV
16Ω 376 mA ±7mV ±12mV
740–760mA ±7mV ±194mV
5.3Ω 1090mA ±12mV–±220mV ±500mV
1388 mA ±314mV ±510mV

Adding LC filtering seems to be a big win, but the original 1.5µH inductor is still the better choice.  I get good regulation at 0.75A, but ripple starts gets big at 1.4A.  At 1A, I sometimes get a very steady output and sometimes a large 123kHz ripple, unpredictably

The voltage drop across the 1.5µH filter inductor is about 0.2V at 1A, so I’m losing about 3% in efficiency, but the 200mW loss is not enough to cause heating problems in the inductor.  For the application I’m looking at, I don’t expect continuous currents

Changing the compensation capacitor will be harder, as it seems to be an 1005 capacitor (0402 Imperial), which is a little small for my clumsy fingers and tweezers—changing the much larger inductor was enough of a challenge for my dexterity.  I don’t know exactly how many pF  the capacitor is, either, so I’d probably have to do a lot of trial-and-error fitting, or take the capacitor out and try measuring it not in the circuit.  Getting probes onto such a small part is going to challenging when it is not on a board.

## 2017 August 28

### More on cheap buck regulators

Filed under: Robotics — gasstationwithoutpumps @ 18:40
Tags: , , ,

A couple of days ago, I wrote about the cheap buck regulators I bought, and expressed some confusion about how poorly they were working.  I’ve spent a couple of days trying to diagnose the problem, and I think it is beginning to make some sense to me.

## 2016 February 4

### Kitchen lighting

Filed under: Data acquisition — gasstationwithoutpumps @ 19:43
Tags: , , , ,

My wife has been unhappy with the lighting in the kitchen for many years now, so I finally got around to designing a new lighting solution for the kitchen and hiring  a contractor to install it.  We previously had rather ugly fluorescent tube fixtures over the stove and over the sink. The over-sink lighting looked like it was done in the 60s and had 2 20-watt tubes; the stove lighting was a replacement in the 1980s and had 2 40-watt tubes.  The lighting on the countertops was never very good, and nothing illuminated the interior of the cabinets.

My wife thought that can lights in the ceiling might be a good solution, but I didn’t care for putting that many holes in the already poor insulation, nor for the very high price of can lights. Instead, I proposed a series of little LED pucks along the series—the sort of puck lights that are usually used for spot illumination under kitchen cabinets.

LED pucks are available in a wide range of prices, and I tried out three different ones to see which gave the best light and looked least offensive.  Then I didn’t buy more of those, because the lighting store wanted $40 per puck, not including the non-standard connectors needed for wiring it up. Those pucks claimed to have 240 lumens output, and I wanted about 3500 lumens for the kitchen, which would have meant 15 pucks ($600).

Instead I went with a cheaper set that was easier to wire up but only had 165 lumens per puck, needing 22 pucks. I bought 8 sets of 3 LED pucks from TorchStar through Amazon for a total of about \$240.  I printed a bunch of circles the same diameter of the pucks and laid them out on the ceiling, adjusting the spacing and the distance from the walls to avoid shadows. After we’d lived with the paper circles for a week, I called in my favorite contractor to install the pucks. (Of course, the labor charges for patching the old holes in the ceiling from the previous lights, repainting, installing the new lights, and replacing the wooden soffit panel where one light was removed far exceeded the cost of parts.)

There are 11 pucks on each side of the narrow kitchen, lined up across from each other.

I did not use the power supplies that came with the pucks, which are only adequate to power 3 or 4 pucks each, and which seem to be very cheaply made (and likely unreliable).  The provided power supplies take 2.5W for lighting one puck, 4.5W for 2 pucks, and 0.3W when not providing any power.

I replaced the power supplies with 2 MeanWell SGA40U12-P1J 12V power supplies each on a separate wall switch and each powering 11 LED pucks.  MeanWell claims an efficiency of 86.5% for the power supplies on their data sheet and considers these supplies “high reliability” supplies. Each power supply takes 21.7W  with a 48% power factor, according to my KillAWatt meter. A 48% power factor is pretty low, but seems common for small switched power supplies—larger supplies often have power factor over 0.9, but that requires more expensive circuitry. The 21.7W/11 pucks means that each puck accounts for 1.97W from the AC supply.

Each puck supposedly puts out 165 lm with 3000°K color, for a total illumination of 3630 lm for the kitchen, which I find a bit too bright, but which my wife finds about right—she’d like the light to be a bit yellower, though. I couldn’t find 2700°K LED pucks that were well made at a reasonable price, so we had to go with these 3000°K lights, which are OK, but not as soothing as 2700°K lights.

If the rated light output is correct, then we’re getting 83.6 lm/W, which is a pretty good efficiency—according to Epistar, these would be their premium chips (120 lm/W), not their standard chips (100 lm/W), if the system efficiency is over 80 lm/W.  (Of course, I’m having to trust TorchStar about how bright the chips are—I don’t have a calibrated illuminance meter.)

The pucks each have  18 Epistar 3528 SMD chips—in 6 chains of 3 LEDs each with a 150Ω current-limiting resistor on each chain. I was interested in characterizing the I vs. V curve for the pucks, and (with a little computation) for the individual SMD chips.

I measured the voltage and current at a number of operating points by hand with a cheap DT-9205A multimeter, and set up a circuit for measuring the current and voltage using a Teensy board and PteroDAQ.

The first circuit I tried was not successful—the LED puck would not turn all the way off! I looked at the waveforms for the voltage and the current with PteroDAQ, and determined that there was 60Hz pulsing when the LED was supposed to be off. I think that I had a ground loop problem among the three power supplies that was amplified by the bipolar transistor.

My second attempt used the transistor in a different amplifier configuration:

Here the emitter voltage follows the base voltage, and I had no problems with ground loops—there is no voltage gain from the NPN transistor, just current gain.

I did have to play around with the voltage swing on the function generator, as the base current was larger than I expected and the 50Ω output impedance of the function generator did seem to matter. I changed the 20Ω resistor to different values to get different current ranges—from 0.5Ω (which resulted in data too noisy to be useful) to 10kΩ.

Here are the I vs. V curves for the puck as a whole:

On a log scale, the different ranges of measurement for the different current sense resistors can be clearly seen. I cut off the low-voltage end of each set of measurements, where the noise got to be too large.

On a linear scale, the difference between the hand-held multimeter and PteroDAQ measurements is visible, and the roughly linear increase in current with voltage over a threshold is also clear.

I can rescale these plots to remove the effects of the serial and parallel connections and of the 150Ω current-limiting resistors, to get an approximate average I-vs-V plot for a single Epistar SMD chip:

The operating point for these chips on the puck is 24mA, which means that the chips must be the “premium” Epistar line, which goes up to 30mA. To get 30mA, we’d need 2.93V, making these chips 88mW chips.

Going back to the puck as a whole, at 12V the current would be about 139mA, for a power of  1.66W, which means that the power supply is operating at an efficiency of about 84%, slightly lower than the rated 86.5%. But the current-limiting resistors are causing a voltage drop of about 3.475V, so the puck is only 71% efficient.  The combined efficiency of the electronics is about 60%.  If the 165 lm output of the puck is correct, then the individual chips would be putting out about 140 lm/W, which is pretty impressive—I suspect that the 165lm is a slight exaggeration, as it is difficult for the customer to measure and complain about.

Blog at WordPress.com.