NarsilM - configurable e-switch firmware for Multi channels, v1.3

Well i posted too soon. it works with 2 channels, but not 3.

Did you specify 3 channels in the header? Located the tables at the right place for 3 channels?

You mean the first entry in the string or somewhere in the code?

Just to be clear the script works with three channels as is but the code I modified is only working with an entry if 2 channels.

Or, I say working but I don’t know if the generated ramp is smooth or not

You are using setups-31S.h, right? Then in RampingTables.h, it has to be under the banner:

//---------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------
#elif OUT_CHANNELS == 3    // Triple Channel
//---------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------

And under 3 channels, there are two separate tables, depending on what compile switch is set, TRIPLE_3_7135 or TRIPLE_8_7135.

So, you have to have everything set up properly in the "Setups" header file you are using.

I am probably assuming wayy too much knowledge to do all this setup and configurations, but what you are trying to do is pretty advanced customization, and I did build in a lot of provisions for customizing things withkeeping the main source code in tact.

Just finished all the bug fixes and couple features/enhancements for the next release. I need to get more testing in on it, but so far all the changes tested ok.

Of course it's not everything I wanted to get in, but running out of time at this point. Here's a brief list:

  • ADDED : (from MAD777, maybe others) if strobes are disabled, a 2X click from 2X turbo should restore the previous level you were at
  • FIXED: 4X clicks in modes operation engages lockout - not supposed to
  • ADDED: operation change: make click&hold in MODES or STROBES wrap from 1st mode to last
  • FIXED: in LVP switch LED control: the LED sometimes is left on after an LVP drop, and is not blinking the way it should be. The "bug" is that I'm trying to control the switch LEDs from multiple places so it's getting turned off quickly after turned on, and left on when it should be left off. It's a timing thing, so has sort of a random pattern - sometimes left on, sometimes left off. The 8 sec LVP blink need to be qualified better, and should not be calling Setlevel() as is because it wants to control the LED
  • FIXED: temp stepdown should not happen right away from turn ON. Delay it by 15 seconds
  • FIXED: for temperature stepdown, in moon mode, a temp stepdown is actually done because moon mode is marked as special level 255, which is considered as a high level of output instead of very low. The stepdown results in the light switching much brighter. This should only happen id the temperature threshold is set to a low temp, or the light is still hot and not cooled down when moon mode is chosen. It can also result in an immediate jump to the stepdown level as soon as the light is turned on in moon mode. Might appear as a bright flash when ramping first starts.

There's more previously implemented:

  • ADDED: momentary/tactical mode via 5X clicks - only active til a power reset 2X or 5X clicks exit tactical mode (full turbo only when switch is held down)
  • full BLF GT buck driver support
  • capability of setting max ramping to less than full max FET (Hi mode), while the 2X click still goes to full FET turbo. This is being used for the GT buck driver configuration.
  • added more compile switches, little better custom configuration of the source in header files

Nice work Tom. :+1:

Yeah, great job!

Excellent!

Wow, once you drill out the driver screw holes and put decent screws in there, extend the LED wires to 67-70 mm, the Q8 is one of, maybe the easiest light around to upgrade firmware with. I find it easier and quicker than even driver retaining rings.

The 2nd round production Q8's should be easier with the screws, but looks like they shortened the LED wires in some, maybe all, so I haven't tried one of those yet.

That’s a nice list of updates! Do you have it available yet? It would save me trying to finish trying to mod the code for ramping to less than full max. I’m close, but flashing testing, flashing testing to fully figure it out could take me a while yet. :slight_smile:

Ahhh, got the source code pushed to my google share drive, but was hoping to get more testing time in. Actually could use whatever help I can get. Hoping Lexel and anyone else. Don't have any official type manual update on it yet though.

Here it is: https://drive.google.com - NarsilM V1.2 BETA

It's v1.2 because v1.1 was used in the BLF GT proto. The default code/hex file are set to the Q8, meaning 2 Channel, 1S cells, indicated by "2C1S". This is my new convention for header files.

I've only tested it so far on a couple Q8's, so didn't even try a "3C" configuration yet, but should work.

Again this is early, it might still change, but if you do want to give it a go, let me know how it works out. Again, I tested the LVP and temp regulation issues on the list above, and all seems to be working well. The strobe mode wrap around works well, and also applies to MODES operation.

Ok. Thanks Tom! I’ll let you know how it goes. If I have any trouble I’ll probably just go back to v1. I’m using it in the m3 clone and thinking about it, there won’t be any reflashing once the light is put together so I’ll need to trust whatever firmware I decide to use. :slight_smile:

Hhhmmm - might pay to wait til I try out a triple - think your M3 clone is a triple channel, like my M3. I got a couple test lights, easy to dnld to, like the SupFire M2-Z, SupFire L5, etc. Got quite a few lights running Narsil that are not so easy to dnld to, many have the old e-switch or early Narsil versions.

I still left some open issues on the triple channel ramping tables in my notes, but think I resolved those issues by re-gening the tables - not sure now. I know the mode sets for MODES operation are not the same as 2 channel setups.

Ya, I’m using a triple channel. 1+3+FET. I’ll try to pay attention to the possible problems. Actually, I think I’m going to build two drivers. One to test with and one for the final use. The final driver won’t be reflashable unless I solder leads to the MCU pins. Hmm? That would be possible but probably still easier to make two drivers. I’ll be able to use the extra driver in another light soon enough anyway.

So, I guess:

- momentary works only in RAMPING

  • you can use momentary if the lamp is ON or OFF

1 - Yes, for now, only accessible from ramping

2 - not sure what that means. Momentary/tactical turns the lamp ON and OFF - ON while holding the switch in, OFF when released. A lamp is the main LED or LEDs?

I don’t understand tactical mode.

After 5x clicks, can I push the button in morse code as fast, till the button melts?
To exit tactical mode I would unscrew the tailcap.

The % ist not clear, does that mean more than two clicks?
Is that another way to exit tac. mode?
But that would prevent fast morse code.

Toykeeper has in Andúril:
Momentary mode is permanent until power is disconnected.

What I mean is
The lamp is off: I click 5x and I am in tactical mode.

The lamp is switched on: I click 5x and I am in tactical mode.

Yes lamp is the main LEDs

"%x" must be a typo - as said in other places, it's "5X" clicks.

No bout the super fast morse code currently.

I see I'll have to remove the 2X clicks to exit tactical mode - way too easy to inadvertently hit, but the 5X is not as easy to trip up on. Dunno - maybe I could just remove the 5X click method to exit, then yes, it would work like Andúril then - power cycle to exit.

If this is preferred, it's basically removing code - easy to do.

Ok, understand now -- Yes, you can enter tactical mode via 5X clicks when the main LEDs are ON or OFF.

Also the 4X click lockout works with the main LEDs ON or OFF, as does 3X and 2X clicks.