Bistro for Texas Avenger drivers officially released! Still taking suggestions for future mode groups

Cool. So is.5 lumens the lowest Low?

Not technically, TomE got the LED to light up with a PWM of 1 and said it just bearly lit up the die, must be due to the new DEL components or I just happened to hit the design right (just luck if that is the case). So who knows how low that is.

I have the ramp setup for a PWM of 3 in moon mode as it is right now, mostly due to the fact that I find that to be the best compromise overall. 2 was a bit low to be useful except is pitch black and 4 more was starting to leave moon mode. I actually need to measure the exact moon mode lumens, I have not tested it in a complete flashlight yet since getting the ramp sorted.

When I was choosing the FW for my commuting bike light, which is also my EDC (convoy S2+ with XPL HI), I wanted the highest output that wouldn’t overheat the light. I currently am using the 5 mode group of Bistro, where the 2nd highest mode is ~40% of the highest mode. This mode works pretty well for cycling, but ideally, sometimes, I would like more modes between 40% and 100. So one idea for a mode group that would maybe have more emphasis on the modes being equally power spaced, rather than being based on apparent brightness. So 20, 40, 60, 80, 100. Just an idea.

Edit: maybe some of your current mode groups already do something effectively like this, like the bike mode group or the groups for triple lights.

It has more modes that are closer together, I am just not using them at the moment. If someone would have a use for this I can make a mode group with this option such as the low mode special above. I suppose I could make a high mode speical but the modes would be so close visually that you could not even be able to see a differnce with your eyes.

The triple emitter mode groups do have a few modes between the bank of 7135’s (about 2.5-3amps depending on driver size and how many you install).

Honestly the triplechannel drivers and this version of bistro would be perfect for bike lights. The bank of 7135’s could be sized to fit your exact output desires in a regulated non-PWM mode. I doubt you would need more then 2.5 amps for 90% of bike riding but I don’t do night riding so I would not know.

You then have the FET for higher modes.

Right now mode 8 would give you 5 modes between moon and the 2.5A bank of 7135’s on the 17mm driver. It would then have 3 evenly spaced modes on the FET.

Is this what you are wanting? Or would it be something differnt? Like I said I have no clue what you would want for night bike riding.

This brings up another question, the biking mode right now using the single 7135 as the contact mode and flashes turbo. This could be changed tot he bank of 7135’s and you then adjust the number of 7135’s to your desired output and it still flash turbo.

I was not sure what people would want although I think I am leaning towards the bank of 7135’s since that can be adjusted by simply removing some of the 7135’s from the bottom of the driver to get the right output.

So I just tested it and yes, on moon with a PWM of 3 it is right around .5 lumens depending on LED ect. It will work with a PWM of 2 but 7135’s vary some and sometimes they won’t lite with low PWM, as such I figured 3 is a safer option for the masses.

Plus I personally like the amount of light more, it is enough to go into a dark room and see enough to get around without having to wait for yours eyes to fully adjust.

That said it can be used with a PWM of 2 and even 1 for “firefly?” mode. If people want a super low moon mode I can release a second version of the firmware with the moon set to 2 PWM for those that want it.

Your mode group 8 probably has modes close to what I was thinking. What are the modes 15-20 in terms of duty cycle on the FET?

The motivation for wanting the equal power spaced modes was to have access to the brightest mode without overheating the light. So with my current Bistro setup, if 5.5A is too hot, my next lower mode is 2.2A. This is usually fine, but sometimes I want a bit more light, say, 3.5A worth. More light but not too much heat.

With my current setup that emphasises equal apparent brightness changes between the modes, the difference between the brightest and second brightest mode is a large change in power. If you are trying to manage heat output and battery life it is nice to have more modes in that space.

The nice thing about the Triple channel drivers is that the current can be easily fine tuned to exactly what you want by removing or adding 7135’s.

Here is the ramp table:

#define RAMP_7135 3,7,20,35,55,100,160,255,255,255,255,255,255,255,255,255,255,255,255,0
#define RAMP_7135s 0,0,0,0,0,0,0,0,35,64,95,122,180,255,255,255,255,255,255,0
#define RAMP_FET 0,0,0,0,0,0,0,0,0,0,0,0,0,0,35,69,108,152,201,255

So the last 5 modes before turbo are all the 7135’s + FET @ 14, 27, 42, 60, 79% then of course turbo is 100%

I can make a group with all of these modes if you think that would be useful. In fact that sounds like a pretty good idea unless we suddenly have an influx of other ideas.

Also unless people say otherwise I think I will change the bike flash mode to use all of the 7135’s thus allowing you to adjust the output by adjusting the number of 7135’s.

Ok, I added a “super sneaker low mode group” that has modes of 5 modes (if you have moon turned on) between .5 lumens and ~25 lumens. Mode group # 19

I also added a group with lots of close modes for biking or other uses. It can be fined tuned by adjusting the number of 7135’s installed on the bottom of the driver (usually accessible even when installed in a light. Although I was debating on weather I should worry with the lower modes (10 and 12) since those fall in the regulated 7135’s and you could simply remove some 7135’s to adjust the output at that point. I could have the full range of FET modes if I eliminate those.

Also, remember that the Texas Avenger drivers have thermal management, while not perfect it should keep things from getting out of hand. Mode group 17

Are these what ya’ll were looking for?

Looks good, thanks.

BTW, I didn’t think of it yesterday, but it’s worth mentioning that you’ll hit a barrier if you try to extend beyond 31 mode groups. It’s using 8-bit integers to index all this stuff, so the table of mode groups must be 255 bytes or less. Divide that by 8 bytes per group and we get almost 32. Or you could do 25 groups of 10 modes each. Or 21 groups of 12 modes each. Etcetera. Any more than that and it needs a bigger integer type, which uses extra ROM space.

The Narsil project has correct fuses for tiny85, or I’ve got some in bin/flash-85.sh too but I haven’t investigated it nearly as much as Tom E has. My only tiny85 driver is the Narsil one he sent me. :slight_smile:

The strobe frequency in Hz is 1000 / (ontime+offtime).

So, strobe(50,50) is 1000/100 = 10 Hz. Or strobe(20,40) is 1000/(20+40) = 16.6 Hz. Personally, I like strobe(1,41) = 23.8 Hz, because it makes real life look like an old movie. Or strobe(1,82) while walking indoors in the dark because it makes everything look like a haunted house or low-FPS game. The shorter the ontime, the better it is at freezing motion. However, even 1ms is too long for some things, so I also do a ~0.3ms ontime for some of the faster settings.

Will take a look.

Only in e-switch firmware, for noise elimination while detecting button presses.

A potential benefit of clearing space is making the ramp longer, to allow for more low modes and a smoother “soft start” (if that’s still enabled).

Or of course there’s also doing like Narsil and using a smooth ramp on an e-switch. It makes most of this mode group nonsense irrelevant. :slight_smile:

Double tap is a double-edged sword. On the one hand, it can provide a shortcut. On the other hand, it prevents the user from changing modes quickly. I personally don’t use it on clicky switch lights because I very frequently turn the light on then tap immediately to get to the mode I wanted. Click-tap or click-tap-tap are common and happen in less than half a second.

OTOH, I use double-tap on some e-switch lights. One tap to turn the light on or off, two taps to go to/from turbo, three taps for strobe or battcheck, and simply holding the button to adjust the mode up or down.

I work as campus security at a university and I only ever really want two or maybe three modes from a light. I am hard user and my general rule as a night worker is to always have three lights on me at anyone time. I only really ever have two uses for them though. I either need to see everything and damn quick or just enough to sort out my keys to gain entry to a building or room. I rarely use strobe so favor lights that require a long press to make them work rather than searching for hidden settings which is a bind at three in the morning when I am tired especially if I have not used it for a while. My ideal light would be : low > 5 to 15 lumens and then maximum with step down to about 700 lumens. A memory mode is a no brainer for me and I hate it when I have not got one. I took delivery of an Atrolux S3 yesterday and have not had chance to alter the settings. The default setting it comes with is a work of evil it caused me no end of frustration last night. It slowed down my work rate and even caused a minor accident. Thankfully I had my Olight S10R as my backup and switched to that for the rest of my shift.

In brief my “real world” setting would be

Memory on
5/10% - low
100% - High with stepdown
Long press for strobe (if electric switch no strobe without one)

This doesn’t need to be so long. If the mode groups are up to 8 modes long, it only needs to be 9 plus HIDDENMODES. So, you should be able to free up 13 bytes here:

uint8_t modes[] = { 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22, HIDDENMODES };

… or free even more space by defining it in a different way:

uint8_t modes[9 + sizeof(hiddenmodes)];

I did a first pass at merging biscotti’s changes into bistro. I haven’t actually tested it yet, but what I’ve got reduced the size from 2048 bytes to 1894 or 1918 bytes. Will have to test it to find out if I broke anything in the process. :slight_smile:

If you’re curious, here’s the diff:
http://toykeeper.net/torches/x6v2/bistro-reduction.diff

Assuming at least some of the changes apply, it likely provides enough extra room to allow 31 mode groups or make the ramp longer or add extra blinkies or … whatever. It’s potentially up to ~150 extra bytes.

The original bistro code offers something very close to that:

  • Memory on
  • Moon off
  • Mode group 7 (~10, 100, strobe)

That mode group was included specifically because security folks requested it. You should be able to configure your Astrolux S3 that way.

Good info to know, I will keep that in mind. I am thinking that 25 modes would be the max that would be practical, heck running out of groups to use already lol. Although like you said before, having it blink out the 10 digit and then the 1 digit would make it easier to select the modes but not sure how much extra space that would take.

That tidbit about being able to use more then 8 modes is quite interesting, so I can setup more then 8 modes, just not less? The way the comments read I was under the assumption that it was 8 modes or nothing. That means I can extend a few of those groups with some extra modes. Cool!

Ok, that makes more sense, I could not figure out which number was on time and which was off (and have not had time to test it to find out). Given some extra space another faster strobe mode or 2 would be fun to add. I have no idea how to add a sub ms option. If you want to toss that into the code while in there that would be great. :blush:

Soft start is disabled, I just didn’t notice a differnce with it honestly.

A longer ramp would be nice, the 40 ramp was about right IMHO.

Doing a ramp in bistro would be very neat, like was suggested to have the ramp it already has except when you click the switch it locks in the mode. Something for later….

That sounds reasonable, I think that would make a good group. So a 2 mode with a low mode and turbo. The step down in bistro is by default thermally controlled (you can configure the temp in the menu as well). I think it has a turbo stepdown option in the code if that is needed?

Memory can be used with any group through the menu with bistro. You can also reverse any mode group along with enable or disable moon mode.

Very interesting, as you can tell, I am firmly in coding 101.

So it only needs 9 modes defined and it figures out the rest, I like that second option, nice and simple, I knew there had to be a better way then what I was doing but had no clue how to do it.

I glanced at the diff file, I am sure it is easier to read in something other then notepad but what I saw and could understand looked good, creative ideas. Looks like you added a few options that can be “comment selected”. I LOVE THESE FYI, I can understand them and they allow for tons of options with simple changes.

Hmmm, 150 bytes….so much that can be done….then I will just want another 150 lol.

I think the changes should net a very nice combo of features for a pre-made firmware with buttloads of options for those that get under the hood.

Like normal great work TK!

Ok, I added a mode with ~12-15 lumens and then turbo for the security guards out there.

Or would you prefer to use the bank of regulated 7135’s instead of turbo for the high mode? Turbo can still be accessed in the hidden modes by long clicking from low if you need it. I am not sure if runtime is an issue in your situation when using turbo or not.

Can you implement the quick double tap to turbo from any mode?

With the hot triple builds I've found that the majority of people (in an everyday work environment) prefer the light to come on in a level that's used the most. Basically a no fuss or fumbling, No memory mode group.

Click on to 2100ma(750lm)- next mode full (1) 7135 power .350a or .380(150lm)- next mode .034a (10lm)- next mode .003a (0.5lm). Double tap to turbo (or other output setting) from any mode. A quick, click-tap to turbo from off.

This is a safer way because if the light gets accidentally turned on in a pocket or bag it doesn't instantly start burning holes in said pocket or bag.

Anyway, is that possible?

The mode group is already taken care of by reversing the mode order of mode group 13.

Turbo is accessible with a long click from the low mode.

I am with TK, I don’t care for a double click to turbo in a clicky light, the majority of the time that I turn on my light I start tapping to the mode I want off the bat.

That said I am not sure if it is something that could be implemented in the menu as an option without taking up a ton of room?

It is TK that would have to program it either way, so it is up to her if it is possible/worth it. If it was available in the code but not as a menu item it could be released as a separate Hex file as well.

Wow, I just skimmed the first 25 or so posts and never studied the mode group chart. You've really done a great job with all the different stuff to choose from.

You hit the nail square on the head with mode group 13. Love the humor. It's like you knew I was gonna come along and ask about it without ever even reading through the OP.

I like the double tap mainly because I can access turbo from anywhere super quick.

Thanks man. This is cool stuff. I'm now trying to figure out how to flash my own firmware.