17mm & 20/26/27mm single-sided DD/FET driver release: A17DD-SO8 / A20DD-SO8 / etc

731 posts / 0 new
Last post
ToyKeeper
ToyKeeper's picture
Offline
Last seen: 8 hours 37 min ago
Joined: 01/12/2013 - 14:40
Posts: 10654
Location: (469219) 2016 HO3

Each driver build seems to behave a little differently, especially if you change the components used to build it. However, the firmware should work if you do a little calibration on it. Or it might work without any changes.

I generally calibrate firmware for a few things on each light:

  • OTC values for ~0.5s and ~1.5s button presses.
  • Voltage detection hardcoded values for 4.2V, 4.0V, 3.8V, 3.5V, 3.0V, 2.8V, and 2.7V. Makes LVP and battcheck work.
  • Lowest usable PWM level, for moon mode.
  • Other PWM levels, if needed.

For the OTC, I flash offtime-cap.hex and measure a few button presses, then plug those values into my target firmware.

For voltage, I flash battcheck.hex and hook the light up to a variable power supply plus DMM, then adjust it to each desired level. It blinks out values I can plug into other firmwares.

For moon mode, I put my best guess into the target firmware, measure it, then adjust up or down and reflash until it’s how I want it.

For other PWM levels, I can usually just plug in some lumen estimates into level_calc.py and it’ll give me the numbers I need.

Stock store-bought drivers will probably “just work” with the default values, but custom-built drivers tend to vary more and need more calibration.

nofear87
Offline
Last seen: 6 months 4 weeks ago
Joined: 03/07/2015 - 05:40
Posts: 114

ToyKeeper wrote:
Each driver build seems to behave a little differently, especially if you change the components used to build it. However, the firmware should work if you do a little calibration on it. Or it might work without any changes.

I generally calibrate firmware for a few things on each light:

  • OTC values for ~0.5s and ~1.5s button presses.
  • Voltage detection hardcoded values for 4.2V, 4.0V, 3.8V, 3.5V, 3.0V, 2.8V, and 2.7V. Makes LVP and battcheck work.
  • Lowest usable PWM level, for moon mode.
  • Other PWM levels, if needed.

For the OTC, I flash offtime-cap.hex and measure a few button presses, then plug those values into my target firmware.

For voltage, I flash battcheck.hex and hook the light up to a variable power supply plus DMM, then adjust it to each desired level. It blinks out values I can plug into other firmwares.

For moon mode, I put my best guess into the target firmware, measure it, then adjust up or down and reflash until it’s how I want it.

For other PWM levels, I can usually just plug in some lumen estimates into level_calc.py and it’ll give me the numbers I need.

Stock store-bought drivers will probably “just work” with the default values, but custom-built drivers tend to vary more and need more calibration.

Wow…nice guide. Thank you! I will flash the driver tomorrow with offtime…maybe it works out of the box. If not, I do your hints step by step. But nice to know that there are different “tools” which help to customize the firmware.

sinner
sinner's picture
Offline
Last seen: 1 week 13 hours ago
Joined: 05/14/2013 - 18:33
Posts: 329
Location: UAE

I’m using star off-time with stock adc values and a 22k ohm resistor, need to set a lower adc value or use 19.1k should work better.

contact(at)sinnercustoms.com

nofear87
Offline
Last seen: 6 months 4 weeks ago
Joined: 03/07/2015 - 05:40
Posts: 114

This driver also works with star momentary? Where I have to solder the e-switch then?

finges
Offline
Last seen: 1 day 15 hours ago
Joined: 11/19/2014 - 14:50
Posts: 504
Location: Germany

nofear87 wrote:
This driver also works with star momentary? Where I have to solder the e-switch then?

Yes, for connection see this picture http://drjones.nerdcamp.net/lumodrv-connect.jpg
pilotdog68
pilotdog68's picture
Offline
Last seen: 1 month 2 weeks ago
Joined: 05/30/2013 - 23:31
Posts: 6422
Location: Held against my will in IOWA, USA

nofear87 wrote:
This driver also works with star momentary? Where I have to solder the e-switch then?

Solder it to the OTC pads

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

Major Projects:  Illuminated Tailcap, TripleDown/TripleStack Driver

ToyKeeper
ToyKeeper's picture
Offline
Last seen: 8 hours 37 min ago
Joined: 01/12/2013 - 14:40
Posts: 10654
Location: (469219) 2016 HO3

If I recall correctly, this driver has an unused pin, pin 3 (a.k.a. PB4). At least, that’s the unused pin on wight’s FET+1 driver. I think he used the same pin layout here, except for not using the second PWM channel.

So, if you configure your firmware to put the switch on PB4, and solder the switch wires to pin 3 and ground, it should work without sacrificing the OTC.

In the OP, it shows pin 3 next to the “W” in “WELLS”.

Or, of course, if you don’t care about the OTC, use those pads instead. OTC isn’t normally used with e-switches, and this will make it a lot easier to flash the driver again later.

nofear87
Offline
Last seen: 6 months 4 weeks ago
Joined: 03/07/2015 - 05:40
Posts: 114

Ok, thank you! Can I use the Standard firmware when I use the OTC pad? OTC goes to Pin2? I have to solder the switch to both ends of the otc place?

Maybe reprogramming to pin3 is also a good idea, I will think about it. Thank you very much!

ToyKeeper
ToyKeeper's picture
Offline
Last seen: 8 hours 37 min ago
Joined: 01/12/2013 - 14:40
Posts: 10654
Location: (469219) 2016 HO3

Not sure if stock uses that pin the way you want, but changing a pin is usually as easy as changing one line of #define near the top of the file.

nofear87
Offline
Last seen: 6 months 4 weeks ago
Joined: 03/07/2015 - 05:40
Posts: 114
ToyKeeper wrote:
Not sure if stock uses that pin the way you want, but changing a pin is usually as easy as changing one line of #define near the top of the file.

Ok I found it, but sodering to the pins of the attiny makes flashing on the board complicated. So using the otc pad is for me the way to go I think.

But I am not sure with the otc pads, are they connected to pin2 (#define SWITCH_PIN PB3)?

nofear87
Offline
Last seen: 6 months 4 weeks ago
Joined: 03/07/2015 - 05:40
Posts: 114
vestureofblood wrote:

nofear87 wrote:
Next Question: For Zener-Mod I have to place C1 at zener-spot and place the zener diode on top. Thats clear to me. But what about C1? I have to leave C1 empty? I have to change some resistors or other components for zener-mod, too? Thank you!


If the version of the board you ordered is one of the early desings then yes.    The old boards had a defect in the layout so in order to make them work the 10uf cap has to be placed on the zener diode pad with the zerner diode over the top.   Make sure you get the diode placed on it in the correct direction.   The end with the little stripe on it goes toward the inside of the board.

The other components that need to be changed for the zener mod are R1 and D1.

R1 will be replaced with a 36K ohm resistor and D1 will be replaced with a 200 ohm resistor.    Notice that all resistors accept the D1 are in K ohm, and the D1 is just 200 ohm.

I hope this helps.

I found this picture: http://budgetlightforum.com/node/35507?page=11#comment-708125

Is it necessary to leave c1 in place when i place a 10uF Cap on the zener place with a zener stacked on top?

Why is it better to replace R1 with 36K, the picture show a 22k resistor?

Thanks!

seasam
Offline
Last seen: 4 years 11 months ago
Joined: 01/31/2015 - 13:15
Posts: 189
Location: GA, USA

nofear87 wrote:

I found this picture: http://budgetlightforum.com/node/35507?page=11#comment-708125

Is it necessary to leave c1 in place when i place a 10uF Cap on the zener place with a zener stacked on top?

Why is it better to replace R1 with 36K, the picture show a 22k resistor?

Thanks!

Which board revision are you building? You shouldn’t need two 10uF caps but I haven’t tried just one on wight’s board. I use RMM’s boards (from his MTN store) and you only place one 10uF.

The 36k resistor isn’t required if you already have a 22k. It just gives you more options with the ADC calculation for the LVP (low voltage protection). With the 22k and 2S (~8.4V) you end up being in the upper range of the ADC (limit of 255) with 6V LVP. If you wanted to have something higher for your LVP like 6.4V you would need the 36k resistor. You can see the calculations on RMM’s Google sheet that he so nicely shared with us before:

https://docs.google.com/spreadsheets/d/1OFGFmolrQoM3xoGQRSz2wzirq5tuozPf...

If you look, the 36k brings the ADC values more into the middle rather than the upper limit.

nofear87
Offline
Last seen: 6 months 4 weeks ago
Joined: 03/07/2015 - 05:40
Posts: 114

seasam wrote:
nofear87 wrote:

I found this picture: http://budgetlightforum.com/node/35507?page=11#comment-708125

Is it necessary to leave c1 in place when i place a 10uF Cap on the zener place with a zener stacked on top?

Why is it better to replace R1 with 36K, the picture show a 22k resistor?

Thanks!

Which board revision are you building? You shouldn’t need two 10uF caps but I haven’t tried just one on wight’s board. I use RMM’s boards (from his MTN store) and you only place one 10uF.

The 36k resistor isn’t required if you already have a 22k. It just gives you more options with the ADC calculation for the LVP (low voltage protection). With the 22k and 2S (~8.4V) you end up being in the upper range of the ADC (limit of 255) with 6V LVP. If you wanted to have something higher for your LVP like 6.4V you would need the 36k resistor. You can see the calculations on RMM’s Google sheet that he so nicely shared with us before:

https://docs.google.com/spreadsheets/d/1OFGFmolrQoM3xoGQRSz2wzirq5tuozPf...

If you look, the 36k brings the ADC values more into the middle rather than the upper limit.

Ahh I understand. Then 36k seems to be very usefull! And the calculations, too Wink Thanks!

I use this Layout (should be the same like in the picture here: http://budgetlightforum.com/node/35507?page=11#comment-708125):
https://oshpark.com/shared_projects/TrEN1wLB

I’am not sure now, if one cap 10uF is enough….

RMM
RMM's picture
Offline
Last seen: 1 year 3 months ago
Joined: 07/23/2013 - 13:47
Posts: 4006
Location: USA

One 10uF should work.  On the board you linked to, place the 10uF on the zener pads then stack the zener on top of the capacitor.

Mountain Electronics : batteries, Noctigon, and much more! What's new? 

nofear87
Offline
Last seen: 6 months 4 weeks ago
Joined: 03/07/2015 - 05:40
Posts: 114
RMM wrote:

One 10uF should work.  On the board you linked to, place the 10uF on the zener pads then stack the zener on top of the capacitor.

Thanks Richard! I will give it a try Wink

nofear87
Offline
Last seen: 6 months 4 weeks ago
Joined: 03/07/2015 - 05:40
Posts: 114
RMM wrote:

One 10uF should work.  On the board you linked to, place the 10uF on the zener pads then stack the zener on top of the capacitor.

The Zener direction is the same like printed on the layout? Cathode points to R2?

RMM
RMM's picture
Offline
Last seen: 1 year 3 months ago
Joined: 07/23/2013 - 13:47
Posts: 4006
Location: USA

Yes, same as printed.  

Mountain Electronics : batteries, Noctigon, and much more! What's new? 

nofear87
Offline
Last seen: 6 months 4 weeks ago
Joined: 03/07/2015 - 05:40
Posts: 114
RMM wrote:

Yes, same as printed.  

Works like a charm! Thanks

nofear87
Offline
Last seen: 6 months 4 weeks ago
Joined: 03/07/2015 - 05:40
Posts: 114

https://oshpark.com/shared_projects/OODIn7Cf

Can somebody confirm this as a working zener-layout? (no workaround)

vestureofblood
vestureofblood's picture
Offline
Last seen: 22 hours 7 min ago
Joined: 08/17/2012 - 15:21
Posts: 1980
Location: Missouri

Does anyone happen to know what could be causing one of these drivers to change modes on its own?

I made 50 of these last batch and they all work fine normally.    I had even used one of them with an eswitch in the past and it was fine.    However recently I tried using JohnnyCs dual switch firmware with them and this is what I get.
https://youtu.be/vw5rxIBh7_M

It will just sit there and skip upward in modes at random on its own.    I tried multiple drivers and even assembled a brand new one and the result is exactly the same.   I tried both 6 and 12v configs too with no luck.

I tried using the default firmware from JC and TomEs eswitch one and they both skipped.   I had used toms before too and did not have this issue so the only thing I can think is that I was shipped a bad batch of components.    Problem is I have no idea which part could cause this Sad


Any one got an idea?

In Him (Jesus Christ) was life; and the life was the light of men. And the light shineth in darkness; and the darkness comprehended it not.
http://asflashlights.com/ Everyday Carry Flashlights, plus Upgrades for Maglite.

Tom E
Tom E's picture
Offline
Last seen: 3 hours 19 min ago
Joined: 08/19/2012 - 08:23
Posts: 14199
Location: LI NY

Hhmm. I watched the video 3X, not sure wut could be goin on. It seems very periodic and relatively slow, I think... What kind of setup to you have there? Think I saw 4 cells in series, so 16V going into the driver? Wow... With an e-switch, I assume you are using an LDO?

The pace seems like LVP is kicking in, but it's going up not down...  But if it's acting like a click is happening, I suspect something unreliable bout the switch input, but you are grounding it manually. Dunno, I'm no expert there in electronics. Maybe the voltage the MCUU is getting? If so, maybe the LDO that supposed to regulate that voltage? Again, I'm not sure exactly how an LDO works, but it's supposed to deliver the correct voltage to the MCU. Maybe you can check that voltage level on the MCU VCC pin #8?

mattlward
mattlward's picture
Offline
Last seen: 4 hours 14 min ago
Joined: 06/19/2015 - 09:20
Posts: 2851
Location: Illinois, USA

Is this still the preferred parts list for a 1S V044 board?

http://www.mouser.com/ProjectManager/ProjectDetail.aspx?AccessID=48a3801cb6

Thanks Matt

EDC rotation:
FW1A, LH351D 4000k (second favorite)
FW3A, LH351D 3500k
FW3A, SST20 FD2 4000k
FW3A, Nichia 4000k sw40 r9080 (favorite light!)
FW3A, Cree XP-L Hi 5A3
Emisar D4V2, SST20 4000k
S2+, XM-L2 T6 4C

RMM
RMM's picture
Offline
Last seen: 1 year 3 months ago
Joined: 07/23/2013 - 13:47
Posts: 4006
Location: USA

I've almost always only seen that happen when the driver is glitching due to a dirty VCC signal.  How is your circuit set up?  

Mountain Electronics : batteries, Noctigon, and much more! What's new? 

vestureofblood
vestureofblood's picture
Offline
Last seen: 22 hours 7 min ago
Joined: 08/17/2012 - 15:21
Posts: 1980
Location: Missouri

RMM wrote:

I've almost always only seen that happen when the driver is glitching due to a dirty VCC signal.  How is your circuit set up?  



By dirty VCC you mean like a trace that is too close to something else?    By circuit setup you just mean a picture of the underlying traces right?   If so I will try to do that tomorrow.


I also have one other pressing question if you don't mind.


I have tried to use firmware that has a strobe function with these drivers, and on both the 1 and 2 cell board the strobe and SOS sequences are very very slow.    I have tried 2 different firmware's which I know to be good with 7135 boards and the result is the same.

Any idea why that might be?

In Him (Jesus Christ) was life; and the life was the light of men. And the light shineth in darkness; and the darkness comprehended it not.
http://asflashlights.com/ Everyday Carry Flashlights, plus Upgrades for Maglite.

RMM
RMM's picture
Offline
Last seen: 1 year 3 months ago
Joined: 07/23/2013 - 13:47
Posts: 4006
Location: USA

When you're pulling high amps with an FET you can make the MCU glitch if the layout and components aren't just right.

About the SOS speed: there is no reason why the speed would be different on an FET driver than it would be on any other driver with the same MCU. Are you sure that you're flashing the same file and fuses?

Mountain Electronics : batteries, Noctigon, and much more! What's new? 

vestureofblood
vestureofblood's picture
Offline
Last seen: 22 hours 7 min ago
Joined: 08/17/2012 - 15:21
Posts: 1980
Location: Missouri

Ya the firmware is the same and I tried it on like 5 boards.     I know for sure the code is good to, its my Sport UI from DrJones.

I may pick up a few boards from you and try installing my components on that and see what happens.    If all my problems go away then we will know where to look for the trouble.

In Him (Jesus Christ) was life; and the life was the light of men. And the light shineth in darkness; and the darkness comprehended it not.
http://asflashlights.com/ Everyday Carry Flashlights, plus Upgrades for Maglite.

hank
hank's picture
Offline
Last seen: 4 days 2 hours ago
Joined: 09/04/2011 - 21:52
Posts: 9569
Location: Berkeley, California

I have been wondering if some drivers are too sensitive to RFI — it’s hard to test.
And with WiFi there’s plenty of radio noise around.

With the lens opening and wires from LED exposed there that could act like short little antennas, could electronic smog be a problem?

I’ve taken some dubious lights (LDCH-20 and LDCH-30 drivers with 1xNiMH) on long walks to see if their behavior jumping modes was any different.
Couldn’t really tell.

I suppose I could put them in a Faraday cage ….

mattlward
mattlward's picture
Offline
Last seen: 4 hours 14 min ago
Joined: 06/19/2015 - 09:20
Posts: 2851
Location: Illinois, USA

I did not get an answer a few posts back and want to make sure before I order…

Is this still the preferred parts list for a 1S V044 board?

http://www.mouser.com/ProjectManager/ProjectDetail.aspx?AccessID=48a3801cb6

Thanks Matt

EDC rotation:
FW1A, LH351D 4000k (second favorite)
FW3A, LH351D 3500k
FW3A, SST20 FD2 4000k
FW3A, Nichia 4000k sw40 r9080 (favorite light!)
FW3A, Cree XP-L Hi 5A3
Emisar D4V2, SST20 4000k
S2+, XM-L2 T6 4C

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

mattlward wrote:
I did not get an answer a few posts back and want to make sure before I order…

Is this still the preferred parts list for a 1S V044 board?

http://www.mouser.com/ProjectManager/ProjectDetail.aspx?AccessID=48a3801cb6

Thanks Matt


preferred? No.

compatible? Yes.

I recommend switching the 22k resistor to a 19.1k version. Other than that, most people have their own preferred FET model they think is best.

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

Major Projects:  Illuminated Tailcap, TripleDown/TripleStack Driver

mattlward
mattlward's picture
Offline
Last seen: 4 hours 14 min ago
Joined: 06/19/2015 - 09:20
Posts: 2851
Location: Illinois, USA

I will need to run thru LVP setting in the firmware for that change?

EDC rotation:
FW1A, LH351D 4000k (second favorite)
FW3A, LH351D 3500k
FW3A, SST20 FD2 4000k
FW3A, Nichia 4000k sw40 r9080 (favorite light!)
FW3A, Cree XP-L Hi 5A3
Emisar D4V2, SST20 4000k
S2+, XM-L2 T6 4C

Pages