E-switch UI Development / FSM

TK mentioned a ‘defective lightbulb’ mode a while back. :+1:

I love the candle idea! A few thousand flickering lumens in this year’s Jack-O’-Lanterns sounds awesome! :partying_face:

Hmm. It already has a lightning storm thingy, and I probably shouldn’t fill it up with “broken light” modes. Candle in a pumpkin sounds nice but anything placed in a pumpkin has a pretty high risk of getting trashed by cruising drunks after the younger kids go home. Candles are nice other places too, though… I wonder what would be necessary to make it look good.

(Edit: this is the 2nd version of my post, the first one was too confusing, I guess.)

May I describe the E-switch user interface I am currently testing in my D4 and SRK mod?

My main goals when creating this UI were:
1.) Full brightness ramping as in D4.
2.) A momentary function from OFF for both “ON with memorized level” and “turbo”.
3.) A garantueed moon level when switching ON, followed by ramping up when switch is pressed and hold (as D4).
4.) A fast and comfortable software lock out/in option especially for D4 since I don’t want to carry this hot rod in my trouthers pocket without lockout.
5.) A true tactical mode which also allows sending morse codes.
6.) A momentary turbo from OFF and ON.

I realized I can’t have 2.) and 3.) at the same time, so I made them configurable. By simply clicking short-short-short-long I toogle between this modes, the selected state is saved in EEPROM and remembered on power up.
So in the momentary configuration the light goes ON when switch is pressed and hold and returns to OFF when switch is released. In the “guaranteed moonlight” configuration it starts at moonlight when pressed and hold and ramps up after a short break (as D4).

When ON the light ramps up and down similar to the D4.
A short clicks always switches the light ON (with memorized level) and OFF.

In addition to the tactical mode I also added an emergency mode which allows to use all of the battery capacity - of course with the risk of damaging them.
Both tactical and emergency mode can only be left by disconnecting power.

Here is a diagram what happens on different click patterns:

From OFF:
s (short click): switches the light ON with memorized brightness.
s-l (short long): momentary turbo, when releasing the switch the light goes OFF.
s-s-s: unlock light.

From ON and OFF:
s: switches the light ON/OFF.
s-s: maximum brightness (turbo), the next double click returns to last used brightness.
s-s-s: tactical strobe.
s-s-s-s: bike strobe.
s-s-s-s-s: blinks out voltage.
s-l: momentary turbo, returns to previous brightness (and/or strobe) when released.
s-s-l: lock out.
s-s-s-l: toggles momentary and “guaranteed moonlight” mode (see above).
s-s-s-s-s-s-s-l: switches to momentary mode (see below).
s-s-s-s-s-s-s-s-l: switches to emergency mode (see below).
s-s-s-s-s-s-s-s-s-l: configuration.

Special modes:

Tactical mode:
light goes ON with last memorized brightness when switched is pressed and hold, and OFF when switch is released. Nothing else, no LVP and no temperature control. Can be used for sending morse codes. You can drain your battery completely. To leave this mode you have to disconnect power.

Emergency mode:
light goes ON with predefined brightness when clicked and OFF at next click. Nothing else, no LVP and no temperature control. You can drain your battery completely. To leave this mode you have to disconnect power.

Cool. Are you planning to share the code? :slight_smile:

How did you decide on two momentary modes — one with and one without other modes available?
(edit: momentary and tactical modes)

Might be. It’s still experimental and lacks a configuration interface for the common user. I thought some of the ideas might be interesting for your project.

I rewrote my previous post to make it better understandable, hope it answers your question. I can configure two options for “press and hold” from OFF. In the “momentary” configuration it switches the light ON - and OFF when the switch is released. Like a morse switch. In the “guaranteed moonlight (and ramping)” version it behaves exactly like the Emisar D4 when “pressed and hold” from OFF. This two configurations are toggled by a triple click followed by “press and hold” (short-short-short-long).
Everything else is equal for both.

Edit:
the tactical and emergency mode are complete separated. They are just short loops in the very beginning of the code and lack - by intention - LVP and temperature control. You can’t leave this modes without disconnecting power and it’s not possible to do anything else than ON/OFF.

HDS lights have a “candle mode”. Its like an undocumented easter egg. Here’s a video on it. The guy making the video is a bit…eccentric (or more honestly likes to play a character), but you get the idea: https://www.youtube.com/watch?v=GCC3h4gz5LY. Its…okay, not bad. Its not terribly realistic as you’d imagine, but its a pretty good facsimile. I can take more video of mine if you want, but really its just a randomized strobe mode.

The number of clicks required has changed through firmware revisions as Henry adds new features to his lights. Current HDS lights are now 9 clicks to candle.

Must subscribe :smiley: not sure when I am going to read all this :confused:

I like the nice graphical UI diagrams created by toykeeper.
Would like to know if there is some free software which helps to create them.
I tend to forget how to operate my own UIs after a while not using it.

TK uses Inkscape and it’s free

google for tutorials

Wikipedia about Inkscape

Thanks!
I know inkscape, used it a couple of years ago. I hoped there is a even easier and faster software for this purpose.

You can use of course MS Word, but it’s not easier, more fiddly and you want a vector image as output.

The last two versions of Inkscape got better.

In Inkscape

  1. create a grid by help lines. Drag them out of the rulers
  2. place boxes and shapes
  3. place connection lines, change end to arrow
  4. place some text boxes
  5. save your pic as SVG, export as jpg, png, …

ToyKeeper

As a K9 SAR handler/trainer I’m always looking for the next advancement in searchlights. Right now I’m loving my new D4 and can’t wait to get hold of my D1. The ramping is so user friendly, but as a search light they have a long way before they catch up in the throw department. What I need is a way to use this type of feature in a light like my Olight M3XS-UT or better yet, a right angle type light (high lumen high throw) which would be more hands free.

What are my chances?

I’m not the tech person to do the job, this seems a little over my head. Do you think these things are or will be in the pipeline any time soon? Any suggestions?

You want a search light with ramping? Have you heard of the BLF GT?

If you hurry, you can still get one.

For headlamps, Tom E has modded a few with Narsil. Perhaps you could too?

Or there’s the Nitecore HC90.

ToyKeeper

Thanks for the reply.

I think the giga thrower’s is way too big/heavy. :weary:

As for the Nitecore HC90, I’d be better off with my D4 on the bill of my hat… more than 4X brighter. I need a right angle light with that kind of brightness with the e-switch on the top. Something like the XTAR Warboy H3 (it has the switch on the top) only with ramping, and the brightness of my D4.

Could the Warboy be modded?

Almost anything can be modded… it’s just a matter of how much effort it requires.

For example, the Coke can light:

I can’t really recommend using 4000 lumens on one’s forehead though, at least not for more than short amounts of time. The output is mostly limited by heat and thermal properties, and increasing that generally requires adding a lot of mass. So, for anything small enough to be used as a forehead light, the performance at ~1000 lm or less is generally going to be a lot more important than how bright its turbo/burst mode is.

If a headlamp isn’t reaching far enough, it’s generally more practical to change it to a throwier beam pattern than to double or triple the lumens. Switching from XM-L2 to XP-G2 will generally reduce the lumens but increase the throw, which makes it appear brighter.

ToyKeeper

I guess I’m not making my point clear (my fault :nerd_face: ). I’m talking about 2 different lights. First, a thrower (like my Olight M3XS-UT) with ramping. Or an EDC similar to the D4, only more tactical.

I’m not suggesting it either. But as an EDC, a 4000 lumen right angle light with an e-switch on the top of the light would be much easier to manipulate under stress in a tactical situation.

The D1 and D1S are compact throwers with ramping. The D1S isn’t out yet, but it should be soon. It is estimated at about 120 kcd though, not 250 kcd like the M3XS-UT. So, it should get about 700m throw instead of 1000m. Or the D1 gets about 425 m.

ToyKeeper

Wow, D1S 700 meters? It was going to be my next purchase anyway. That’s more than I expected, (right up there with my old M31 Triton).

My D1 arrived yesterday and I played around a little with it this morning. I wasn’t expecting that much (over 400 m?) either, I was thinking maybe 200 m. I’ll have to give it a better workout tonight.

Thanks!

I finally put a development branch up with the current FSM code:

http://bazaar.launchpad.net/~toykeeper/flashlight-firmware/fsm/files/head:/ToyKeeper/spaghetti-monster/

I still have some things to do before making a “1.0” release and merging it into trunk, but it’s already at a pretty usable state.

Things which still need to be done:

  • Finish more example UIs.
  • Add a half-sleep mode for things like a locator flash or alarm clock mode.
  • Add a waking idle mode for lower power use at moon/low levels.
  • Add support for voltage-divider style measurements on pin 7.
  • Add indicator LED support.
  • Add an option to use short-click/long-click/hold instead of just click/hold, because it’s needed for compatibility with UIs from fonarevka.
  • Test thermal regulation on a wider range of hardware, to ensure it “just works” on hosts of many different sizes and power levels.
  • Better documentation.
  • Hopefully make the fourth PWM channel less funky. It works, but not quite as well as the first three.

After “1.0”, it should probably also add support for newer MCUs, buck/boost drivers, more than one e-switch, and power-disconnect switches.

Oh, um, I also settled on a name for the “unnamed” UI. It’s called Andúril, because it’s inspired by Narsil. Narsil was the sword of Elendil and Isildur, which defeated Sauron. Andúril is Aragorn’s sword, the flame of the west, the blade Narsil reforged. Granted, it didn’t defeat Sauron — it only scared some ghosts. But still. I thought it would be appropriate, and Tom seemed okay with the idea, so that’s what it’s called now.

I don’t understand most of the things spoken in this thread, I confess, but I do appreciate your work and efforts - TK - along with the one of other members! Thanks for making better UIs and for putting your imagination “at the service of the Light”!!! :+1:

Now, following your last post, I just wanna suggest that the first BLF light with the “Andúril” UI be named “Mithril”, being a “impenetrable” maybe “bullet proof” flashlight!! A flashlight for knights that can be kings of the Light! Just saying :crown:

This forum is getting better and better (and I’m just a noob here) due to people that are working and investing time, money, intelligence and other resources to make things (lights, components, UIs, drivers….) that somewhere in time seemed impossible and that now are just cool and feasible realities!

I’ll keep on reading, and trying to learn a bit from this work!
Keep it up :+1: