E-switch UI Development / FSM

212 posts / 0 new
Last post
ToyKeeper
ToyKeeper's picture
Offline
Last seen: 11 hours 2 min ago
Joined: 01/12/2013 - 14:40
Posts: 6400
Location: (469219) 2016 HO3
Tom E wrote:
looks like the Olight Baton mode is identical to what I have in Narsil/NarsilM ramping?

The Olight Baton UI is one click for on or off, but it’s more of a staircase than a ramp… and it only goes up. Normally their lights only have moon, low, med, and high. Holding the button cycles between them in that order, with a loop from high to low. I gave my Baton clone 7 levels instead of 4, but otherwise it’s mostly the same.

It’s a very simple UI and the code for it is simple too. I include it with FSM because it makes a nice reference example, and because it’s kind of nice despite how basic it is. The plan is to include clones of several popular interfaces and at least one or two unique ones.

A big goal here is to keep the interface logic separated from the hardware support code, so that most of the interfaces “just work” on most of the hardware. Adding a new driver, or adding a new interface, should be mostly independent of each other. I guess it’s similar to how traditional software separates hardware drivers from software applications, only scaled down to fit in a flashlight.

Tom E wrote:
Not familiar at all with OKLuma, or the DC2. Just saw the DC1 on his website though: https://okluma.com/ Weird, never heard of them before. Guess the DC2 is not yet for sale…

I hadn’t heard of him either until a few months ago. He does premium hand-made lights in relatively small quantities. They’re similar to Sinner’s lights, but a bit longer and narrower with different styling. He has been working on his own custom firmware lately and used bistro as a base, so he sent me a sample of his new DC2 to say thanks. I really should put up a photo review soon since it’s a beautiful light, but I’ve been preoccupied just trying to keep up with all the BLF projects lately.

emarkd
emarkd's picture
Offline
Last seen: 41 min 9 sec ago
Joined: 04/14/2015 - 22:04
Posts: 1409
Location: Georgia, USA
Tom E wrote:

Not familiar at all with OKLuma, or the DC2. Just saw the DC1 on his website though: https://okluma.com/


Weird, never heard of them before. Guess the DC2 is not yet for sale…

Jeff has been making lights for a couple of years now. His design is really a continuation of the TriEDC that Mac popularized on CPF years ago. He’s a machinist in Oklahoma who kinda jumped in to fill the gap left after Mac disappeared, if you followed any of that drama. Jeff makes great lights, super clean machining and nice to hold and use, but with simple off-the-shelf guts (so far). The DC2 is his newest design, basically a stretched DC1 to fit an 18650. He just shipped the first batch. I didn’t buy one, but I do have one of his DC1 lights (earlier run, back when he called them the TinyDC). I basically treated mine like a host though – stripped all the guts out and rebuilt it, because that’s the BLF way Smile

ToyKeeper
ToyKeeper's picture
Offline
Last seen: 11 hours 2 min ago
Joined: 01/12/2013 - 14:40
Posts: 6400
Location: (469219) 2016 HO3
emarkd wrote:
I basically treated mine like a host though – stripped all the guts out and rebuilt it, because that’s the BLF way Smile

I’m kind of anxious to do that too. The H17F driver is very practical, but it doesn’t have any of the fun stuff I like to put on my personal lights. However, that will have to wait. It’s my only H17F light and I’m not done poking it.

emarkd
emarkd's picture
Offline
Last seen: 41 min 9 sec ago
Joined: 04/14/2015 - 22:04
Posts: 1409
Location: Georgia, USA
ToyKeeper wrote:
emarkd wrote:
I basically treated mine like a host though – stripped all the guts out and rebuilt it, because that’s the BLF way Smile

I’m kind of anxious to do that too. The H17F driver is very practical, but it doesn’t have any of the fun stuff I like to put on my personal lights. However, that will have to wait. It’s my only H17F light and I’m not done poking it.

Understandable. The H17f is really a great driver. Mine was early production, just a basic Qlite driver, nothing exciting. Besides, I really wanted to build a lighted tailswitch onto a McClicky, so I did.

I’m almost certain he switched to reverse-clicky omtens when he switched to H17f’s though, because McClickies don’t really take high currents very well. I put a mtnelec FET+1/Bistro in mine, but I’m really kinda…careful with my light and never run it on turbo for long. If I melt the McClicky then I ruin all the work that went into that switch mod, and I do not want to do that.

patmurris
patmurris's picture
Offline
Last seen: 4 hours 59 min ago
Joined: 12/22/2014 - 15:54
Posts: 823
Location: Nice, France

@TK: Not sure where i read your comments regarding party strobes and frozen motion, but that rang a bell. There are several kind of strobes i would be glad to have in a powerful flashlight.

One would be a ‘motion freezing’ mode with adjustable timing. Not sure how short you can expect the pulse to be or whether it can be used for photography but that would be really cool, at least up to some scale and speed of motion. It may not work at catching real fast things though?

Another would be a really wild party strobe, cycling through different patterns, possibly with ‘tap tempo’ feature to sync on the music.

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

I have the adjustable motion-freezing strobe already working. It changes the pulse width depending on the frequency, and works pretty well for things like spinning fans and falling water. At the moment it only has two pulse widths though… 1ms and 0.3ms. I’ve been meaning to check if it’s a good idea to use more, but it works reasonably well as-is.

The “wild party strobe” may be best left to other devices though, particularly ones which have a microphone so it can respond to music. I mean, who wants to spend their time at a party messing with a flashlight to keep it synced to the beat?

* looks around, realizes where she is *

Er, nevermind. Don’t answer that. Smile

On a related note, did I mention there’s a momentary mode? It could be used for flashing to the beat.

patmurris
patmurris's picture
Offline
Last seen: 4 hours 59 min ago
Joined: 12/22/2014 - 15:54
Posts: 823
Location: Nice, France

…how about a ‘flickering candle’ mode…? or ‘flickering neon’ mode? or ‘defective old school light’ mode? Big Smile

goshdogit
goshdogit's picture
Offline
Last seen: 16 min 45 sec ago
Joined: 12/03/2015 - 21:28
Posts: 402

patmurris wrote:
…how about a ‘flickering candle’ mode…? or ‘flickering neon’ mode? or ‘defective old school light’ mode? Big Smile
TK mentioned a ‘defective lightbulb’ mode a while back. Thumbs Up

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

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

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.

Flashy Mike
Flashy Mike's picture
Offline
Last seen: 4 hours 4 min ago
Joined: 01/14/2016 - 16:38
Posts: 753
Location: Germany

(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.

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

Cool. Are you planning to share the code? Smile

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

Flashy Mike
Flashy Mike's picture
Offline
Last seen: 4 hours 4 min ago
Joined: 01/14/2016 - 16:38
Posts: 753
Location: Germany

ToyKeeper wrote:
Cool. Are you planning to share the code? Smile
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.
ToyKeeper wrote:
How did you decide on two momentary modes — one with and one without other modes available?
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.

emarkd
emarkd's picture
Offline
Last seen: 41 min 9 sec ago
Joined: 04/14/2015 - 22:04
Posts: 1409
Location: Georgia, USA
ToyKeeper wrote:
Candles are nice other places too, though… I wonder what would be necessary to make it look good.

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.

Sirius9
Sirius9's picture
Offline
Last seen: 3 hours 56 min ago
Joined: 03/04/2012 - 19:23
Posts: 4233
Location: South Europe

Must subscribe Big Smile not sure when I am going to read all this :/

 

Flashy Mike
Flashy Mike's picture
Offline
Last seen: 4 hours 4 min ago
Joined: 01/14/2016 - 16:38
Posts: 753
Location: Germany

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.

joechina
Offline
Last seen: 15 hours 11 min ago
Joined: 03/05/2016 - 08:23
Posts: 561

TK uses Inkscape and it’s free

google for tutorials

Wikipedia about Inkscape
https://en.m.wikipedia.org/wiki/Inkscape

Flashy Mike
Flashy Mike's picture
Offline
Last seen: 4 hours 4 min ago
Joined: 01/14/2016 - 16:38
Posts: 753
Location: Germany

joechina wrote:
TK uses Inkscape and it’s free
Thanks!
I know inkscape, used it a couple of years ago. I hoped there is a even easier and faster software for this purpose.
joechina
Offline
Last seen: 15 hours 11 min ago
Joined: 03/05/2016 - 08:23
Posts: 561

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, …

Deputy Dog
Deputy Dog's picture
Offline
Last seen: 5 hours 23 min ago
Joined: 09/15/2017 - 07:53
Posts: 68
Location: behind you

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?

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

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

http://budgetlightforum.com/node/50303

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.

Deputy Dog
Deputy Dog's picture
Offline
Last seen: 5 hours 23 min ago
Joined: 09/15/2017 - 07:53
Posts: 68
Location: behind you

ToyKeeper

Thanks for the reply.

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

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?

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

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

For example, the Coke can light:
http://budgetlightforum.com/node/22207

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.

Deputy Dog
Deputy Dog's picture
Offline
Last seen: 5 hours 23 min ago
Joined: 09/15/2017 - 07:53
Posts: 68
Location: behind you

ToyKeeper

I guess I’m not making my point clear (my fault Glasses ). 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.

Quote:
I can’t really recommend using 4000 lumens on one’s forehead though, at least not for more than short amounts of time.

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.

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

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.

Deputy Dog
Deputy Dog's picture
Offline
Last seen: 5 hours 23 min ago
Joined: 09/15/2017 - 07:53
Posts: 68
Location: behind you

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!

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

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

http://bazaar.launchpad.net/~toykeeper/flashlight-firmware/fsm/files/hea...

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.

MascaratumB
MascaratumB's picture
Offline
Last seen: 24 min 2 sec ago
Joined: 10/29/2016 - 12:12
Posts: 787
Location: Portugal

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”!!! Thumbs Up

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 Thumbs Up

DB Custom said: "Hide your billfold, cut up your credit cards... you're a perfect candidate for full blown flashaholism and will soon need dedicated flashlight cabinets. [...] Have fun! Modding is next... :P" 

Reviews : Amutorch S3 - XPG3-S3 /  AM S3 vs Neal 219c  /  Amutorch AM30 - XHP70.2 / Nitefox UT20 / Sofirn SF14 & SP10A 

Mods and tricks: 1 / 2 / 3 / 4 / 5                                                                    Convoy S2+ TIR Lenses on: XML2 / XPL-HI

 

joechina
Offline
Last seen: 15 hours 11 min ago
Joined: 03/05/2016 - 08:23
Posts: 561

Mithril o_O
well, the FW3A colour is silver. That would fit.

The accent in Andúril is bad for searching. I think a simple u would be better.

MascaratumB
MascaratumB's picture
Offline
Last seen: 24 min 2 sec ago
Joined: 10/29/2016 - 12:12
Posts: 787
Location: Portugal

joechina wrote:
Mithril o_O
well, the FW3A colour is silver. That would fit.

The accent in Andúril is bad for searching. I think a simple u would be better.

Hum, don’t know if the FW3A creators/developers team would agree/appreciate that but…why not? Big Smile
Sharp inside with Anduril firmware, armored and blasted outside with a silver “shining” look as Mithril, aiming to protect us from darkness Blushing

If it wasn’t a long name, “Light of Earendil” would also be appropriate Cool

(well, just hope these names wouldn’t raise Copyright or whatever issues)

DB Custom said: "Hide your billfold, cut up your credit cards... you're a perfect candidate for full blown flashaholism and will soon need dedicated flashlight cabinets. [...] Have fun! Modding is next... :P" 

Reviews : Amutorch S3 - XPG3-S3 /  AM S3 vs Neal 219c  /  Amutorch AM30 - XHP70.2 / Nitefox UT20 / Sofirn SF14 & SP10A 

Mods and tricks: 1 / 2 / 3 / 4 / 5                                                                    Convoy S2+ TIR Lenses on: XML2 / XPL-HI

 

ToyKeeper
ToyKeeper's picture
Offline
Last seen: 11 hours 2 min ago
Joined: 01/12/2013 - 14:40
Posts: 6400
Location: (469219) 2016 HO3
MascaratumB wrote:
Hum, don’t know if the FW3A creators/developers team would agree/appreciate that but…why not? Big Smile

I checked first. Part of why I waited was to make sure people didn’t mind.

Pages