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: 31 min 2 sec ago
Joined: 01/12/2013 - 14:40
Posts: 10654
Location: (469219) 2016 HO3

FWIW, RMM posted a spreadsheet you can use to experiment with resistor values, with an approximation of how those should appear to the MCU:
https://docs.google.com/spreadsheets/d/1OFGFmolrQoM3xoGQRSz2wzirq5tuozPf...

So, for example, if you wanted a 3S light… tell it to estimate the values for 3*2.5V and 3*4.4V (7.5V and 13.2V) and adjust the resistors until they produce useful values. You probably want the results to be between 32 at 224, spread across a fairly wide range.

I don’t really know what I’m doing, but I gave it 48000 and 3300 and it produced 3S values from 111 to 196.

wight
Offline
Last seen: 1 year 2 months ago
Joined: 11/27/2013 - 16:40
Posts: 4969
Location: Virginia, USA

ToyKeeper, what was your conclusion on the effect of tweaking R1/R2 values (RE: offtime)?

Still fine, still on a break. One day I’ll catch up with you folks! previous wight catchup Wink
list of my drivers & variants (A17DD, FET+1 stuff, WIP stuff, etc)

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

I think the OTC decay is affected by far more than just the values of R1 and R2.

However, I’m still a clueless noob about circuit designs… so I’m not sure how to control the decay curve.

djozz
djozz's picture
Offline
Last seen: 4 hours 16 min ago
Joined: 09/07/2012 - 17:04
Posts: 17748
Location: Amsterdam

Last year I build a light with this driver and zener mod (S8 with XHP50, 2x18350 cells), with the normal 19.1K and 2.2K (I did not realise the problem so never worried about that), and the LVP kicks in at 3.6V/cell (resting voltage after LVP event, under load it must have been quite a bit lower) which is not that great but it is below half drainage so it is usable.

wight
Offline
Last seen: 1 year 2 months ago
Joined: 11/27/2013 - 16:40
Posts: 4969
Location: Virginia, USA

djozz wrote:

Last year I build a light with this driver and zener mod (S8 with XHP50, 2×18350 cells), with the normal 19.1K and 2.2K (I did not realise the problem so never worried about that), and the LVP kicks in at 3.6V/cell (resting voltage after LVP event, under load it must have been quite a bit lower) which is not that great but it is below half drainage so it is usable.

Did you notice any weirdness with offtime?
ToyKeeper wrote:
I think the OTC decay is affected by far more than just the values of R1 and R2. However, I’m still a clueless noob about circuit designs… so I’m not sure how to control the decay curve.
The first part is definitely true! With our current offtime setup there seem to be a lot of factors. I’m sure that there are many which I do not have a good handle on.

It does look like you did some testing which really made resistor selection seem important for the current OTC setup though, check your post #552. Does that still hold water as far as you are concerned?

I saw a few of Sharpie’s posts over in another thread RE: the A6 driver. After filtering out any confusion from those posts… These drivers have never been perfect and we’ve already discussed some of that stuff but it never hurts to rehash it again. It got the wheels turning in my head.

I’m saying this pretty blindly, but maybe a simple way to improve offtime consistency (if/when it’s a problem at least) would be to use a larger cap with a bleeder resistor. Whatever is bleeding through the ATtiny13A is doing so slowly. Moving to a 10uF X5R cap should significantly reduce whatever influence the ATtiny13A has over the cap and allow a bleeder resistor to become the dominant factor.

Still fine, still on a break. One day I’ll catch up with you folks! previous wight catchup Wink
list of my drivers & variants (A17DD, FET+1 stuff, WIP stuff, etc)

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

wight wrote:
I’m saying this pretty blindly, but maybe a simple way to improve offtime consistency (if/when it’s a problem at least) would be to use a larger cap with a bleeder resistor. Whatever is bleeding through the ATtiny13A is doing so slowly. Moving to a 10uF X5R cap should significantly reduce whatever influence the ATtiny13A has over the cap and allow a bleeder resistor to become the dominant factor.

10uf with a bleeder would be simple enough to test on current boards.

For the record, using 19.1k for R1 and X7R 1uF for OTC is reliable enough for me, even at very high temps. It’s just when you get into TK’s mode reversing that you need the extra accuracy. 22k for R1 did give more issues, for whatever reason.

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

Major Projects:  Illuminated Tailcap, TripleDown/TripleStack Driver

bdiddle
Offline
Last seen: 15 hours 1 min ago
Joined: 12/14/2012 - 14:36
Posts: 814

I’m having some problems with a 20mm zener modded driver I setup for an MTG2 / L2 combo. 4.3v zener on the pad and a 200hom resistor in place of the diode.

Driver seemed to work fine initially, but now it will randomly not turn on when I press the switch(including cycling modes, ie low->med1->off->high->turbo), will turn itself off while on, go super dim and then blink while on a moonlight mode (I don’t have moonlight programmed), really slow strobe on any brightness level at any time etc. Just basic random crazyness. Not usable at all.

Any suggestions on what I did wrong? I’m going to r2 the 200ohm resistor and reflow the board tomorrow, but I am thinking I might have cooked the tiny13 somehow. The driver worked fine, super bright, until I put a pair of powerizer 26650’s in the light in place of KK cells.

Newb

wight
Offline
Last seen: 1 year 2 months ago
Joined: 11/27/2013 - 16:40
Posts: 4969
Location: Virginia, USA

Possibly cooked the Zener? Please:

  • Take detailed pics.
  • Measure voltage at MCU pin 8 (Vcc).

Also what do you mean by saying that you are going to “r2 the 200ohm resistor” tomorrow?

Still fine, still on a break. One day I’ll catch up with you folks! previous wight catchup Wink
list of my drivers & variants (A17DD, FET+1 stuff, WIP stuff, etc)

bdiddle
Offline
Last seen: 15 hours 1 min ago
Joined: 12/14/2012 - 14:36
Posts: 814

Sorry, in a prior career r2 meant remove and replace.

I’ll pull the driver and measure voltage at pin 8 before I do anything

Newb

wight
Offline
Last seen: 1 year 2 months ago
Joined: 11/27/2013 - 16:40
Posts: 4969
Location: Virginia, USA

Sounds good. [Depending in part on the tools you have available] I’m sure that there are other things to check – I just can’t think of them right now.

What specific Zener are you running? 200 ohms is possibly a little low for really strong batteries and a “low” mode with MMSZ5229B I think (for example). Again – I’m pretty rusty on this information and I never did much with Zener modded stuff.

Still fine, still on a break. One day I’ll catch up with you folks! previous wight catchup Wink
list of my drivers & variants (A17DD, FET+1 stuff, WIP stuff, etc)

bdiddle
Offline
Last seen: 15 hours 1 min ago
Joined: 12/14/2012 - 14:36
Posts: 814

Diode I used is one of these

Your comment about the resistor made me test some things. With two KK ICR cells at 3.65volts each, the driver appears to work as normal.
With fully charged cells the driver acts crazy……I need to do some extended testing with the lower volt cells to make sure the driver is 100%, but I think it just needs something more than 200ohm.

Newb

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

wight wrote:
It does look like you did some testing which really made resistor selection seem important for the current OTC setup though, check your post #552. Does that still hold water as far as you are concerned?

There were more differences between those drivers than just the resistor. It seemed that the resistor was relevant, but not as big a factor as I had thought. To really quantify it, someone would have to build identical drivers with only that part changed.
giorgoskok
giorgoskok's picture
Offline
Last seen: 4 hours 43 min ago
Joined: 11/13/2015 - 10:46
Posts: 2671
Location: Greece

Received my pcbs today from Oshpark ! Anyway , I’m still waiting for some components.. Wink

RotorHead64
RotorHead64's picture
Offline
Last seen: 7 months 2 days ago
Joined: 10/31/2015 - 02:49
Posts: 430
Location: United States

Hello guys and gals,

I'm pretty new to modifying and building flashlights and pretty much all I know about it so far has been learned from the majority of you guys right here. I've been lurking and absorbing info from this place for 2-3 years and repairing and modifying for a year or so. I'm getting way better and still learning and having a good time at it.

I started ordering the DIY kits from RMM a while back and have had really good luck with them. 

I ordered a few of the MTN17dd kits and assembled 3 of them all at the same time in the same manner. (Guppydrv rev1)

The first one is operating fine.

The 2nd has no off time memory. It always goes to the next mode no matter how long it's off. I can program it like normal. I changed out the otc and no change.

The third one has no off time memory and it can't be programmed. It'll go into configuration mode but when i tap in the mode group I want it just keeps blinking in configuration mode till it times out never recognizing the mode group selection. It just stays in the default L-M-H . 

I need help! 

giorgoskok
giorgoskok's picture
Offline
Last seen: 4 hours 43 min ago
Joined: 11/13/2015 - 10:46
Posts: 2671
Location: Greece

Hello guys , and sorry for being a noob (question is coming!)…

for this driver , what the following numbers on pwm should be ? on toykeeper’s starry-offtime

Quote:

// PWM levels for the big circuit (FET or Nx7135)

#define MODESNx 0,0,0,70,255

// PWM levels for the small circuit (1×7135)

// (if the big circuit is a FET, use 0 for high modes here instead of 255)

#define MODES1x 3,15,128,0,0

Also , is this designed for attiny 25 ? Beacause i get a memory overflow error

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

giorgoskok wrote:
Hello guys , and sorry for being a noob (question is coming!)…

for this driver , what the following numbers on pwm should be ? on toykeeper’s starry-offtime

Quote:

// PWM levels for the big circuit (FET or Nx7135)

#define MODESNx 0,0,0,70,255

// PWM levels for the small circuit (1×7135)

// (if the big circuit is a FET, use 0 for high modes here instead of 255)

#define MODES1x 3,15,128,0,0

Only one of the two PWM channels is used on this driver.
So set the one array to numbers you like from 1 to 255, the other one will not be used.
(IIRC the first array is for PWM channel 1, which this driver is using).

Try something like this:
#define MODESNx 1,4,16,64,255

DEL
DEL's picture
Offline
Last seen: 3 years 3 months ago
Joined: 06/28/2015 - 08:35
Posts: 559
Location: Canada
giorgoskok wrote:
Also , is this designed for attiny 25 ? Beacause i get a memory overflow error

No idea about the intended target MCU.

What is your compiled size? Make sure the -Os compiler option is set.

giorgoskok
giorgoskok's picture
Offline
Last seen: 4 hours 43 min ago
Joined: 11/13/2015 - 10:46
Posts: 2671
Location: Greece

DEL wrote:

Only one of the two PWM channels is used on this driver.
So set the one array to numbers you like from 1 to 255, the other one will not be used.
(IIRC the first array is for PWM channel 1, which this driver is using).

Try something like this:
#define MODESNx 1,4,16,64,255

Thanks for your help DEL.

giorgoskok
giorgoskok's picture
Offline
Last seen: 4 hours 43 min ago
Joined: 11/13/2015 - 10:46
Posts: 2671
Location: Greece
DEL wrote:
giorgoskok wrote:
Also , is this designed for attiny 25 ? Beacause i get a memory overflow error

No idea about the intended target MCU.

What is your compiled size? Make sure the -Os compiler option is set.

I get this :

Error Program Memory Usage : 1088 bytes 106,3 % Full (Memory Overflow)

Data Memory Usage : 39 bytes 60,9 % Full GccApplication5 GccApplication5 0

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

giorgoskok wrote:

I get this :

Error Program Memory Usage : 1088 bytes 106,3 % Full (Memory Overflow)

Data Memory Usage : 39 bytes 60,9 % Full GccApplication5 GccApplication5 0

That is close to fitting. You have to get the 1088 below 1024.
I do not use AVR Studio, but you should have a selection somewhere to ‘optimize compilation for size or -Os’. That should bring you in under the limit.

wight
Offline
Last seen: 1 year 2 months ago
Joined: 11/27/2013 - 16:40
Posts: 4969
Location: Virginia, USA

DEL wrote:
giorgoskok wrote:

I get this :

Error Program Memory Usage : 1088 bytes 106,3 % Full (Memory Overflow)

Data Memory Usage : 39 bytes 60,9 % Full GccApplication5 GccApplication5 0

That is close to fitting. You have to get the 1088 below 1024.
I do not use AVR Studio, but you should have a selection somewhere to ‘optimize compilation for size or -Os’. That should bring you in under the limit.

In AVR Studio right click on the name of the project (in the project tree on the righthand side) and click properties then head to “ toolchain / compiler / optimization / optimization level” via HarleyQuin here.

Still fine, still on a break. One day I’ll catch up with you folks! previous wight catchup Wink
list of my drivers & variants (A17DD, FET+1 stuff, WIP stuff, etc)

giorgoskok
giorgoskok's picture
Offline
Last seen: 4 hours 43 min ago
Joined: 11/13/2015 - 10:46
Posts: 2671
Location: Greece

DEL wrote:
giorgoskok wrote:

I get this :

Error Program Memory Usage : 1088 bytes 106,3 % Full (Memory Overflow)

Data Memory Usage : 39 bytes 60,9 % Full GccApplication5 GccApplication5 0

That is close to fitting. You have to get the 1088 below 1024.
I do not use AVR Studio, but you should have a selection somewhere to ‘optimize compilation for size or -Os’. That should bring you in under the limit.

Hmm i didn’t find something…

Edit : Thanks wight , i’m going to try it
Edit2: Thanks wight!!!!!!!! It’s ok now Smile Still have to study a lot about writing/modifying firmwares….

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

RotorHead64 wrote:
DIY kits from RMM … I ordered a few of the MTN17dd kits and assembled 3 of them all at the same time in the same manner. (Guppydrv rev1)

The first one is operating fine. The 2nd has no off time memory. The third one has no off time memory and it can’t be programmed.


If they’re running the same code and behave differently, it pretty much has to be a hardware problem. You’ve probably got a short or broken connection or burnt component or something.

There are some tools to measure some of this, but if you reflash your MCU you won’t be able to put guppydrv back on. So, that makes things a bit harder.

Anyway, I’d suggest looking for physical problems on those drivers.

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

giorgoskok wrote:
… starry-offtime … is this designed for attiny 25 ? Beacause i get a memory overflow error

No, I don’t think it’s even compatible with tiny25. It sounds like you already got it working though.

If anyone knows a portable way to make the Windows atmel tools get the right build settings, it’d be nice to include that in the repository. This sort of thing comes up a lot. I’ve got the settings in build scripts for CLI-based OSes, but that doesn’t help in Windows. And if I understand correctly, WinAVR’s project files work on a per-directory basis and aren’t portable, so including those is generally not a very good solution. If it might be possible to include just one set though, and apply them everywhere… is there an option for that?

RotorHead64
RotorHead64's picture
Offline
Last seen: 7 months 2 days ago
Joined: 10/31/2015 - 02:49
Posts: 430
Location: United States

ToyKeeper wrote:
RotorHead64 wrote:
DIY kits from RMM ... I ordered a few of the MTN17dd kits and assembled 3 of them all at the same time in the same manner. (Guppydrv rev1) The first one is operating fine. The 2nd has no off time memory. The third one has no off time memory and it can't be programmed.
If they're running the same code and behave differently, it pretty much has to be a hardware problem. You've probably got a short or broken connection or burnt component or something. There are some tools to measure some of this, but if you reflash your MCU you won't be able to put guppydrv back on. So, that makes things a bit harder. Anyway, I'd suggest looking for physical problems on those drivers.

Thanks for the reply TK. It turns out that my d1 was a zener instead of shottky. I swapped in the correct diode and all is fine. I'm just a noob learning new tricks.

I'd like to apologize to everyone for hijacking this thread. After reading it thru it dawned on me that I should've asked my question in another thread or started my own. 

 

Tom E
Tom E's picture
Offline
Last seen: 4 hours 27 min ago
Joined: 08/19/2012 - 08:23
Posts: 14199
Location: LI NY
ToyKeeper wrote:
If anyone knows a portable way to make the Windows atmel tools get the right build settings,…

Oops, only just noticed this. I should investigate this, but @work now. I’ve been through this of course, tweaking build settings. Guess we could at least document the Atmel Studio settings by screen grabs, etc. – would make it a lot easier for setting up.

giorgoskok
giorgoskok's picture
Offline
Last seen: 4 hours 43 min ago
Joined: 11/13/2015 - 10:46
Posts: 2671
Location: Greece

I had some issues getting a 10uf capacitor(ordered now) and the 19.1k resistor…
So , i used a 4.7uf capacitor and a 19.6k resistor (one 22k ohm and one 180k ohm resistors , parallel).

I flashed starry offtime , but my modes are weird.
I get (with half clicks): low, medium1, medium2, high1, high2, blank(flashlight does nothing) , strobe , and turbo(?) .

If i unnderstand right , where i get the “blank” mode , i should getting battcheck.

Why did this happen? thanks

Bonus question : If i want memory enabled , i should connect “star 3” to ground ?

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

Uhhh – parts list in the OP calls for a 22K ohm resistor for R1, so why didn’t you use the one you had? Also the parts list calls for a 4.7 uF cap – should be fine I’m think’n (didn’t try myself though).

Not sure bout the blank mode, but sounds like the battcheck isn’t working – check those R1 and R2’s. Not sure bout the stars in starry offtime.

giorgoskok
giorgoskok's picture
Offline
Last seen: 4 hours 43 min ago
Joined: 11/13/2015 - 10:46
Posts: 2671
Location: Greece

I might be wrong about the resistors i combined to get R1. I remember for sure i got like 19.5-19.6k ohms.

In the last pages , people suggested 19.1k ohms for R1 and 10uf capacitor , that’s why i had my doubts Tom E.
Thanks for your answer… Wink

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

You might want to try battcheck.hex as a sanity check, to make sure your voltage calibration is good.

Also, I think the starry-offtime code uses only the 7135 channel for its blinks, meaning it won’t light up at all on a FET-only driver. It’s a simple one-line change though, if you want to fix that.

Starry-offtime was basically an early prototype of blf-a6, and you might find blf-a6/tk-otc.c a little more robust. It’s blf-a6 minus the soft config mode; configure it at build time instead.

In any case, a FET-only driver will likely require some adjustments to make everything work on just one channel.

Pages