[[ GXB20 Driver – Homemade Constant Current Programmable XHP50 Single-Cell Boost Driver! ]]

Thanks for your comments and suggestions - here's a quick response to your questions. I say quick because I'm about done with a more detailed write up, though as I've found, the documentation is taking -wayy- more time than I had expected, and certainly much more than actually making the driver in the first place. I'm glad to have found this forum since it's given me a lot more motivation to work on this project and to hopefully make a 'commercial quality' product in the end instead of just an experimental hobby project.

About the digital potentiometer, - that's correct, when I was first designing the GXB20, keep in mind I did the entire schematic and layout all in a single day when I had nothing to do... I wasn't really expecting this to work as well as it did, but I didn't put as much thought into in as I would have for a product like this (since I was just making it for fun). Back then I wasn't aware of the flashlight community so I didn't think too much about the levels, and ramping etc.

The digi-pot works in conjunction with an op-amp as a variable gain amplifier. There are some limitations as I have found, i.e. the gain adjustment was a little too cramped at the low end. I found that values 0 to 20 get you about the full range to 3A output. However you can increase this further by changing the current sense resistor to say 60mR, which would give you 0 to 40 but twice as much power dissipation in the sense resistor. Regardless, I do have plans to re-do this section to make use of the full 256 taps :). I also need to analyze the feedback more carefully to ensure that the system keeps within regulation and the loop response is kept in check.

The limit of the driver depends on various factors - power / heat dissipation, saturation of the inductor, PCB trace thickness etc. But as-is, the limit is currently set by the input current limit which is set via the 115kR resistor for just about 9A input. So it should be able to handle ~4A+ output, so I haven't tested it just yet. As for why it's 2770mA, that was due to a modification I made to the driver to test! Nominally writing 20 to the digipot with the default schematic values should give around 3A out. One of the main limitations I found with the digipot is the very high wiper resistance, especially at low drive voltages. So I'm looking to replace this part with another one. I'll update the firmware to reflect more accurate values. :)

[edit] - My page has been updated with refined V0.9 firmware and code. Please discard the older one which was still under development.

As for boosting to 6V to 12V or 3V to 12V, this is all possible with this driver but I don't have a simple answer for it, since I'll have to redo the math on the magnetics to make sure they check out ok. But is it possible with some modifications, yes.

I prefer Atmel Studio as well, but I decided to do it in the Arduino IDE because it's much more hobbyist friendly, so I thought that would be useful. Regardless this should be very straightforward to just port to use in Atmel Studio, or in fact any of your favourite IDEs.

Finally, your last question on PWM - no the LED receives a regulated constant current supply. You are right in that the switching state of the FETs in the converter operates like a PWM at the switching frequency. However the inductor in the boost circuit is key - it resists sudden changes in current flowing through it. So while the voltage across the inductor can look like a PWM, the output is sustained by both the output capacitor and the inductor current. As long as the time constant of the RC output is high compared to the switch period, the output voltage approaches a constant DC output voltage.

As you can see above, the cyan line shows the output voltage, and you can see that the ripple looks to be fairly decent with no PWM :).

If you'd be interested in boards I can certainly send them to Sweden in a regular envelope. Drop me a PM if you'd like :)

To conclude - I understand that there are certainly many improvements I can do to the GXB20 and I welcome all criticism and comments! I'm definitely not the best firmware and/or electrical engineer since I'm just doing this for fun, but it's been a lot of fun and if I can make something that the community can use, I think it's a worthwhile endeavor and hopefully people better than myself can use the details I've released as a starting point or even just for inspiration. Thanks!

Thanks for your detailed answer. I know all about writing documentation :confounded:

I didn’t think about the inductor. My knowledge of these things are very limited. But yeah, great news on the constant current.

PM inbound.

There are other well-known highly efficient drivers which make use of low ohmic value sense resistors: the LD-29 and LD-29S buck drivers. You may want to take a peek at the way these resolve the digipot + operational amplifier dyad, since they equip R025 and R020s.

Efficiency is key to power handling. Since usually only a reduced amount of power can be wasted in the driver, it becomes clear high efficiency is a must for high power output drivers (and hell, preferably for any power level). This remembers me I'd been thinking in a way to get rid of the sense resistor. Please bear in mind I may speak some bollocks due to lack of proper technical background but, wouldn't it be possible to use the actual inductor direct current resistance (DCR) to feed the operational amplifier? This, of course, would require placing the inductor on the low side, or switching to difference/instrumentation amplifier setups.

By the way, 80mΩ on the torch's switch sucks. It may be time for a change to FET tail switches, there are some good & cheap small FETs with very low ESR which could be parallelled and gate driven with tiny button cells (a couple in series CR1620s, for example). Sounds right?

Cheers ^:)

To quickly answer the question if I could drive the LED higher, I quickly did a test. I wanted to see what would happen with ~24W into the driver.

Driver seems to work just fine. This was with a measured 3.8V in at 6.32A, and as you can see an LED current of 3.26A with ~1850+ lumens of CRI90 light. Total efficiency was just around 88-89% including some LED wire loss, which is not too bad but still significant ~2.6+W dissipated just in the driver and wires! Things get warm fast, but the driver seems to handle it ok :)

This is awesome!
This driver is also perfect for driving high power UV led from one Li-Ion as they have high Vf.

Good, but I'd prefer to see how the figures are under a worst-case scenario.

Can it handle its duty well when the input voltage is barely above cutoff? At 3.01V, let's say. :-)

For these high drain duties, it'd be also a nice idea to set the cutoff a bit lower than usual, maybe 2.9 - 2.8V.

Cheers ^:)

Great job Loneoceans! Very impressive! Welcome to BLF! BTW, I do have small springs if you need some. Let me know what size you are looking for. You can PM me and I could send them to you free if you’re in the USA. :smiley:

Willie

Nice work, thanks for sharing. Sitting under a hot LED encased in a host with no air flow. I think drivers bleeding out that much heat might need potting. A few good materials out there should nip frying in the bud.

I bought a bunch of ATtiny84A MCUs :). Let me know if anyone is interested in a board with populated and programmed MCU (only MCU, you need to solder on the rest yourself) :). The rest of the details and BOM can be found here: www.loneoceans.com/labs/sales/gxb20v1

i am! :D

Yes please!

Very interested too! :slight_smile:

Sounds good. I am in for one.

if you could make 17mm version, i’m IN

So... I made a whole bunch of improvements to the GXB20 V1..

I just received the news PCBs for it... introducing the new GXB20 V2!

Still writing the (improved) firmware with a lot more additional and optional functionality, this time with 3 extra mode selection jumpers or E-switch control. And a complete layout redesign, on-board programming connection which will hopefully be a lot easier to use, and improved power electronics.

More to come soon! :)

V2 looks nice!

WOW very professionally built. Great looking with plenty of retaining ring clearance.

Different components used? Besides layout, any hardware changes that I can take when I eventually get around to building the previous versions I have?

Hello, yes there were some slight changes in the feedback and digital potentiometer allowing for more variations in brightness. I also conducted some experiments in the power section but I don't think there are any hardware changes needed to be made so far (some changes I made resulted in same or slightly less efficient results so the original is good enough :) )

Another quick update and thanks again to everyone who's been following this project!

GXB20 Version 2

In short, the changes I've made for the V2 version turned out to be an improvement over the original by a small amount, and after a little more testing I think I'm happy with the result for now, and the GXB20 driver has achieved all the goals I had set out at the beginning of the project!

By no means is this a complete nor 'commercial' driver, which will certainly require a little more optimization and better firmware, but I think I'm quite happy with how it is as-is, for a hobby project. Currently I'm working on finishing a more complete write-up on this driver, and will be publishing everything open-source for all to use and to fabricate boards (e.g. from OSHpark).

Some notes on the additional improvements of the GXB20 V2:

  • Better placement and layout (I hope!)
  • Much more levels of constant current brightness (256, adjustable using 1 resistor)
  • Improved lowest level of CC brightness (just around 1mA - true 'firefly' mode)
    • Modes for my own firmware: 1 = firefly <1mA, 2 = low ~180mA, 3 = mid ~600mA, 4 = ~1.8A (~1000 lumens), 5 = 3A (turbo)
  • Measured efficiency of 92% at 3A (~6.5V) output
  • Two new solder-bridge mode jumpers + extra GPIO for easy mode selections
    • (needs more firmware work to take advantage of all of these)
  • New 0.4mm pitch micro programming header for ATtiny84A
  • Works better at lower voltages when approaching 2.5V
  • + maintains all the features of the original GXB20 V1

I did some experiments in the power section but it turns out that they didn't make too much of a difference (e.g. in the previous post you can see I used a bigger inductor but didn't see much benefit). The final improvement I'd probably want to do with this driver is to fabricate using half-thickness (0.8mm) PCB and 2oz copper, and of course continual work on the firmware to improve things further like adding more modes and improving EEPROM performance using a random hopping scheme.

Finally, above is another view of the GXB20 V2 driver.