H17F - programmable driver with full thermal regulation

265 posts / 0 new
Last post


DrJones's picture
Last seen: 6 years 1 month ago
Joined: 01/05/2011 - 13:30
Posts: 1044
Location: Frankfurt, Germany
H17F - programmable driver with full thermal regulation

Over a year ago, Mattaus and I started to develop a new driver, something like a better NANJG105C. Mattaus took some time off, so I designed my own board, and later wrote the firmware for it. I had already thought about a 3 channel driver with 1*AMC for lower lows + 7*AMC for med&high + FET for Turbo for my F6 board (#181) nearly 2 years ago, but decided against the FET then in favour of having 2 status LEDs (the early F6 had a window for that, and I found the F6 too small for a DD then). However for this driver i wanted that 1+7+FET setup (hence the name H17F).
The firmware and the driver prototype have lain around on my desk only partially tested for months now (I had a leisure and motivational low-point for a while, didn't even read the forum or answer PMs) - but recently I found time for it again and finally tested it (and fixed a glitch).

So what's new? It's basically a 17mm driver with a single 7135 for lower lows plus a FET for direct drive turbo modes - in my test setup (no switch, but with longer wires and a current measurement shunt) I got 5.8A with an XM-L and an XM-L2, but only 4.4A withe an XP-L HI I had lying around, and 10A with a Nichia219C-triple in a host (tailcap measurement).
Having moon and turbo results in a quite high dynamic range (~12bit, ~4000:1). The firmware is similar to lucidrv (i.e. 2 fully programmable mode groups, mode lock, battery monitoring etc.), but with some more flexibility (blinky modes can have any brightness, and there's a bike blink mode like in mobydrv). Also very short power interruptions (e.g. from bumps while riding a bike) are ignored. The manual is here.

And I wanted thermal regulation in it - not just a step down when the light gets too hot, but a full thermal regulation as in PID controller, like a few newer lights feature, i.e. the power continuously adapts to (changing) cooling conditions to keep the (user configurable !) temperature at a certain value, while avoiding overshoot and oscillations.
I had quite some fun with that: I learned about PID controller theory, I wrote a thermal simulation for flow and dynamical behaviour of heat in a simplified model of a typical flashlight, implemented the normal PID algorithm and chose some suitable parameters, and it looked really fine. Then I adapted the PID implementation to MCU conditions: integer math and limited temperature resolution with some inaccuracy - and things went mayhem. Don't get me wrong: PID controllers are known to work well in much worse conditions, and indeed the temperature (process variable) was held very well, but the heating power (control variable) jumped around a lot; that's not a problem for a simple heating element, but quite unpleasant for a flashlight, where heating power corresponds to LED current and thus brightness. I played around for hours to make an algorithm that keeps the temperature constant by smoothly adapting the power (i.e. brightness) without overshooting or oscillations for hosts of various sizes until I finally was pleased.

There's also a little giveaway: Guess what programming language I used for the thermal simulation. The first to guess right will win a H17F driver. Only one guess per person, posted here, only users with 100+ 50+ posts.

EDIT: It seems I underestimated the difficulty of this question, programming languages were mentioned that I never heard of...
However, a third round starts: Everyone again has one guess. Also now open for everyone with 50+ posts.

It's a programming language, and it's not specialized on (thermal or other) simulations.
It's a programming language, not an IDE/application.
I use a text editor to write the code.
It does run on my PC.
It's actually quite common, though that hint might be misleading...
It's well older than 15 years.

And another edit:
Clearly more difficult that I anticipated. I didn't intend to push up this thread over and over with this little giveaway. Sorry!
It has to end... so: next (and hopefully last) round.
It is in this list: Timeline_of_programming_languages
It's several years older than Java, but younger than Modula-2. More precisely: It is more older than Java than it is younger than Modula-2. 
It still is quite common in some way. However: While it runs on my PC and I code in it, both is quite uncommon, the latter even rare.
While quite many computer-related people know about it, few know about it's full potential.
It is usually not used for simulations of any kind (nor for programming in general), but it has quite some capabilities regarding graphics.

and EDIT again: That was quick, the answer is PostScript, and the giveaway is closed. Smile

Edited by: DrJones on 02/02/2016 - 15:13
Last seen: 5 years 1 month ago
Joined: 11/11/2015 - 22:12
Posts: 116
Location: TX

Sweet driver.
Was it FloTHERM?

Last seen: 2 weeks 8 hours ago
Joined: 04/25/2015 - 22:52
Posts: 2668
Location: Between the Mexico's


Not only is the driver interesting in function, but it looks great too…

I will guess Sinda for your thermal simulations…

saypat's picture
Last seen: 5 months 4 weeks ago
Joined: 07/13/2011 - 20:32
Posts: 3580
Location: Calif


Last seen: 5 days 4 hours ago
Joined: 11/06/2015 - 02:26
Posts: 316


MRsDNF's picture
Last seen: 5 months 4 days ago
Joined: 12/22/2011 - 21:18
Posts: 13473
Location: A light beam away from the missus in the land of Aus.

You sir are an amazing fellow. Your abilities and what you do I do not understand but do benefit from. Thanks for the effort and welcome back.Smile


djozz quotes, "it came with chinese lettering that is chinese to me".

                      "My man mousehole needs one too"

old4570 said "I'm not an expert , so don't suffer from any such technical restrictions".

Old-Lumens. Highly admired and cherished member of Budget Light Forum. 11.5.2011 - 20.12.16. RIP.


pilotdog68's picture
Last seen: 1 year 2 months ago
Joined: 05/30/2013 - 23:31
Posts: 6422
Location: Held against my will in IOWA, USA

I had started working on a similar pcb accomplish the same effect, but you “beat me to market”! Though I wouldn’t have had the fantastic fw to accompany it anyways. Nice!

My Favorite Modded Lights: X6R, S8 , X2R , M6, SP03

Major Projects:  Illuminated Tailcap, TripleDown/TripleStack Driver

DrJones's picture
Last seen: 6 years 1 month ago
Joined: 01/05/2011 - 13:30
Posts: 1044
Location: Frankfurt, Germany

Thanks! Embarassed

So far, no hits on the giveaway question. Hint: The programming language I used is not specialized in thermal simulations or similar.



bmwsancho's picture
Last seen: 1 year 1 week ago
Joined: 05/08/2015 - 12:56
Posts: 520
Location: California, USA & EU

Matlab, Simulink

djozz's picture
Last seen: 6 days 15 hours ago
Joined: 09/07/2012 - 17:04
Posts: 18269
Location: Amsterdam

Very nice driver, and I agree with pd68: it looks good too!

Since I have no programming knowledge whatsoever, my guess is: BASIC

M4D M4X's picture
Last seen: 10 months 2 weeks ago
Joined: 03/19/2014 - 05:17
Posts: 8821
Location: Austria (GMT + 1)

i am no programmer (any more) but i used basic and turbopascal once…

but my first (and guess for that post) was LOGO

i do not work in "reviews, deals and codes" for the time being
maybe M4D M4X will return one day, but until then:


bugsy36's picture
Last seen: 10 months 3 weeks ago
Joined: 07/11/2014 - 18:15
Posts: 2475
Location: Florida USA

I am not a coder but I can honestly say that you do great work Sir!

It's the simple things that we take for granted that cost us the most

Ευκαιρία λέει πιάσε με από το μέτωπο γιατί μόλις έχω περάσει δεν θα με πιάσειs

raccoon city
raccoon city's picture
Last seen: 20 min 18 sec ago
Joined: 10/06/2010 - 02:35
Posts: 18886
Location: Palm Desert CA ~ West Coast is the best coast

Every time I open this thread I get this Avast warning:


totilde's picture
Last seen: 2 months 3 weeks ago
Joined: 12/27/2012 - 12:22
Posts: 1157
Location: spain

my vote goes to C++, since basic is already posted
your firmware and driver looks amazing


hank's picture
Last seen: 1 month 3 weeks ago
Joined: 09/04/2011 - 21:52
Posts: 9638
Location: Berkeley, California


Henk4U2's picture
Last seen: 8 hours 42 min ago
Joined: 02/13/2014 - 17:52
Posts: 4357
Location: The heart of the Netherlands (GMT+1)
hank wrote:

You beat me to it. So I’m stuck with Cobol.

You are a flashaholic if you are forced to come out of the closet, to make room for more flashlights.

DrJones's picture
Last seen: 6 years 1 month ago
Joined: 01/05/2011 - 13:30
Posts: 1044
Location: Frankfurt, Germany

Thanks! Smile 

Ah, some good guesses... But no hit yet.  

Stupid Avast... URL:MAL seems to refer to a URL blacklist, it probably blacklists all nerdcamp.net, which actually is only a dynamic DNS hoster. Probably some other nerdcamp.net user got infected and Avast blocked the whole domain.
That image is just an image (h17f.jpg). And my site does not contain any active code at all, just static HTML. It might be a good idea to report a false positive.

Hestbech's picture
Last seen: 1 year 3 weeks ago
Joined: 01/21/2015 - 19:40
Posts: 332
Location: Denmark

Hmmm ... must be Plankalkül

It would be dandy if birds pooped candy ::
emarkd's picture
Last seen: 2 weeks 14 hours ago
Joined: 04/14/2015 - 22:04
Posts: 1608
Location: Georgia, USA

Looks awesome, I’m gonna want one to play with whether I win it or not, but let’s guess python.

hank's picture
Last seen: 1 month 3 weeks ago
Joined: 09/04/2011 - 21:52
Posts: 9638
Location: Berkeley, California

mmmfff. One guess per person.

DEL's picture
Last seen: 4 years 4 months ago
Joined: 06/28/2015 - 08:35
Posts: 559
Location: Canada

Has to be Fortran?

I like the idea of 1+X drivers. Apart from the low moon mode the single 7135 provides well regulated low and low-medium modes due to the low Vf at 350 mA.

Buwuve's picture
Last seen: 5 years 1 month ago
Joined: 02/11/2011 - 14:49
Posts: 1975
Location: Germany

I have no clue about progarmming. Maybe you used Node (don't know many programming languages and most others where named before).

Light up the darkness.

SIGShooter's picture
Last seen: 4 hours 54 min ago
Joined: 07/14/2013 - 02:10
Posts: 2439
Location: northern california

How about C

viperbart's picture
Last seen: 3 months 1 week ago
Joined: 07/22/2014 - 15:17
Posts: 436
Location: USA

I know nothing of programming languages. Totally stabbing in the dark.

raccoon city
raccoon city's picture
Last seen: 20 min 18 sec ago
Joined: 10/06/2010 - 02:35
Posts: 18886
Location: Palm Desert CA ~ West Coast is the best coast

Commodore BASIC FTW!   Big Smile

sandalian's picture
Last seen: 1 year 9 months ago
Joined: 05/05/2012 - 19:23
Posts: 508
Location: Indonesia

I’m guessing that you’re using Assembly to program the board.
This, I believe, make you able to put a lot of features into a single and limited capacity of board.

I'm switching my BLF account into LumenZilla. Thanks!

Gunga's picture
Last seen: 21 min 49 sec ago
Joined: 11/28/2014 - 16:56
Posts: 2127
Location: Vancouver, Canada

No idea. C? Will these go up for sale?

Boaz's picture
Last seen: 2 days 6 hours ago
Joined: 11/07/2010 - 09:31
Posts: 7925
Location: Birthplace of Aviation


                 υμεις εστε το φως του κοσμου ου δυναται πολις κρυβηναι επανω ορους κειμενη

                            Dc-fix diffuser film  >…  http://budgetlightforum.com/node/42208

KeepingItLight's picture
Last seen: 2 hours 31 min ago
Joined: 06/15/2015 - 14:52
Posts: 932
Location: California

Let's try Delphi.

Jubeldum's picture
Last seen: 6 years 4 months ago
Joined: 11/02/2014 - 09:20
Posts: 2057
Location: Michigan


Last seen: 1 day 13 hours ago
Joined: 12/01/2011 - 03:20
Posts: 2262
Location: Lost Islands ™

I have absolutely no clue what the hell you wrote this beauty with. I don’t care. Nor do I care about winning. Thanks for being back Smile

I’ll go something with c++ …..

Never ever forget and forgive. Niwal**er new kid on the block trying to act tough.
Do not support this brand.