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

Finally, I compiled a .hex file, NarsilM V1.0 3C1S
Did not change any CODE……

NarsilM.c
Channels.h
ModeSets.h
RampingTables.h
RegisterSettings.h

Setups-31S.h rename to Setups.h

tk-calibMTN17DDm.h
tk-calibWight.h
tk-delay.h
tk-random.h

I will flash to the ATtiny85 to test

Hi Tom,

Working on the UI vid today. Most everything seems to be going fine, but I have one hiccup. In the “modes” group the count seems to be off some how. On the ref sheet I see that the default when switched to modes should be group 4, but I get 5 mode as default. I tried switching to the first group and I got 2 mode, the second group I get 3 mode. I thought maybe the whole thing was just off by one click but group 5 for me is single mode.

I did try resetting to default, but the result is the same after ward. As far as I can tell everything else works as described in the sheet. I was able to change the moon mode levels etc. Any ideas?

Matt , is moonlight mode enabled ?

If yes , modes are counted without the moonlight .

Ohhh - think the mode sets are "unique" for the GT buck driver build.

I got all the info here. I'll post.

This is directly from the code:

//---------------------------------------------------------------------
//  Buck driver 2 channel modes
//---------------------------------------------------------------------

// 2.0 A max modes
// 1 mode 2.0A
PROGMEM const byte modeFetSet1 = { 201}; // for analog control
PROGMEM const byte mode7135Set1 = { 255}; // for LM3409 enable/PWM

// 2 modes /4 25% 2.0A
PROGMEM const byte modeFetSet2 = { 42, 201}; // for analog control
PROGMEM const byte mode7135Set2 = { 255, 255}; // for LM3409 enable/PWM

// 3 modes /3 11% 33% 2.0A
PROGMEM const byte modeFetSet3 = { 26, 53, 201}; // for analog control
PROGMEM const byte mode7135Set3 = { 255, 255, 255}; // for LM3409 enable/PWM

// 4 modes /2 12.5% 25% 50% 2.0A
PROGMEM const byte modeFetSet4 = { 27, 42, 77, 201}; // for analog control
PROGMEM const byte mode7135Set4 = { 255, 255, 255, 255}; // for LM3409 enable/PWM

// 5 modes cube-oot 1% 7% 22% 52% 2.0A
PROGMEM const byte modeFetSet5 = { 25, 25, 39, 80, 201}; // for analog control
PROGMEM const byte mode7135Set5 = { 24, 170, 255, 255, 255}; // for LM3409 enable/PWM

// 6 modes cube-root 1% 5% 15% 32% 60% 2.0A
PROGMEM const byte modeFetSet6 = { 25, 25, 30, 51, 94, 201}; // for analog control
PROGMEM const byte mode7135Set6 = { 24, 126, 255, 255, 255, 255}; // for LM3409 enable/PWM

// 2.5 A max modes
// 1 mode 2.5A
PROGMEM const byte modeFetSet7 = { 255}; // for analog control
PROGMEM const byte mode7135Set7 = { 255}; // for LM3409 enable/PWM

// 2 modes /4 25% 2.5A
PROGMEM const byte modeFetSet8 = { 45, 255}; // for analog control
PROGMEM const byte mode7135Set8 = { 255, 255}; // for LM3409 enable/PWM

// 3 modes /3 11% 33% 2.5A
PROGMEM const byte modeFetSet9 = { 27, 58, 255}; // for analog control
PROGMEM const byte mode7135Set9 = { 255, 255, 255}; // for LM3409 enable/PWM

// 4 modes /2 12.5% 25% 50% 2.5A
PROGMEM const byte modeFetSet10 = { 29, 45, 86, 255}; // for analog control
PROGMEM const byte mode7135Set10 = { 255, 255, 255, 255}; // for LM3409 enable/PWM

// 5 modes cube-oot 1% 7% 22% 52% 2.5A
PROGMEM const byte modeFetSet11 = { 25, 25, 41, 90, 255}; // for analog control
PROGMEM const byte mode7135Set11 = { 26, 185, 255, 255, 255}; // for LM3409 enable/PWM

// 6 modes cube-root 1% 5% 15% 32% 60% 2.5A
PROGMEM const byte modeFetSet12 = { 25, 25, 31, 56, 106, 255}; // for analog control
PROGMEM const byte mode7135Set12 = { 26, 136, 255, 255, 255, 255}; // for LM3409 enable/PWM

So what does all this mean?

First 6 sets max out at 2 amps, 2nd set of 6 are full power at 2.5A.

DEL's cube root is percentages calculated,similar to TK's python script that calculates lumens.

All these sets exclude moon mode. If you have moon mode enabled, then you'll get the modes above, but also starting with your currently set moon mode level.

Does this help?

What Giorgoskok wrote.
If you choose only mode #1 and enable moonlight you end up with two modes.

If you choose mode set #7 (which has 7 values in the table) and enable moonlight you will end up with 8 brightness levels.

(On the Q8 product page is under product detail a table where it is clear that moonlight is included, when switched on BLF Q8 4x XP-L 5000LM professionelle Mehrfachbedienung Verfahren super helle LED Sale - Banggood Deutschland sold out-arrival notice-arrival notice )

Tom E
I guess the cube root modes are the evenly spread ones?

What is the reason for 2A instead of 2.5A max? Reduced wear?

2A gives a longer in regulation run time while 2.5 amps is available with a double click. From memory the difference in output was somewhere around 13%.

Previous post has the GT mode sets. The Q8 is different.

As the Mrs said (Steve), the intent is prolonged runtime to max at 2.0A. If you want the full 2.5A, there's a duplicate set of modes available shown above, plus in ramping, ramping max's out at 2.0A but a 2X click goes to turbo at 2.5A.

Tom,
The Q8 in MODES:
What is the lock out comand?
(I thought 2x + click&hold )

But on my Q8 it is 4 clicks like in RAMPING.

Edit: I already did a reset to factory.

joechina, According to your cheat sheet it is 4 clicks for lockout in both ramping and discrete mode, I just verified with one of mine as well.
[edit]It does work this way, but I read the UI cheat sheet wrong. Tom has verified this is a bug.[/edit]

In MODES operation:

  • 2 quick clicks followed by click&hold works for me (as designed)
  • 4X clicks though will restore it from lockout, as well as 2X clicks + click&hold (as designed, both ways work).
  • Just tried it: the 4X clicks to enter lockout in MODES is also working -- this was unintended. I did not want it to function like this because someone can click quickly through modes and unintentionally lockout the light. Granted though, I made the multi click operations pretty quick, so it's harder to get it occur unintentionally, but it can happen.

Ok, another bug

fyi: Don't have a Q8 with me, but I'm using a Manker U11 modded with NarsilM v1.0, so exactly the same as the Q8, or should be?

Thanks for acknowledge Lazy-R-us.

But I wrote in the cheat sheet for MODES you can only lock out if the lamp is off, with 2 clicks and a click&hold.

I noted that a year ago, so maybe Tom changed it.
Tom answered above

Hey, you put a lot of work into that sheet, and it has helped me figure out how to use this great light. But, apparently, I need to print it even BIGGER, because I neglected to read that the left two tables differ based on “from on” or “from off” and have left/right sections for ramping or modes.

I’ll go edit my post above.

I am sorry for the small size!

Your printer should have a poster mode. Print it in double size and glue it together.

Another way to use:

- put the PDF on your smartphone. There you can zoom in.

  • view the PDF on your computer screen.

Yes the left part has the clicks for

- Lamp is OFF for RAMPING

- Lamp is ON for RAMPING

- Lamp is OFF for MODES

  • Lamp is ON for MODES
    Each row has the same klicks, it is sorted by clicks, not by actions: You see there is double click for RAMPING, but not for MODES. And if you want battery check when you are in MODES you can see you reach it only if the lamp is off.

Let me start by saying thanks so much to you all for helping me.
.

Thank you, I will be sure to incorporate these points.

Yes, that is definitely part of the problem I had. Didn’t realize that.

YES! That definitely looks like what I am seeing. Will you be making a ref sheet with this outlined in it? I want to direct people to the sheets you an JoeChina have made right form the start.

Think we should be doing the docs - dunno how far off we are, or how finalized all this is. Waiting on replies from our contact.

awesome, thanks

OK, my switch LEDs are off.

What I did:

  1. Was in MODES and got “temporarily locater LED OFF” with 1x + click&hold
  2. Switch to RAMPING
  3. Switch LED still off

From a strict logik it’s ok this way.
As a user it would be nice if the SW LED start working.
But its also garbage user input.

I don’t know, if people fumble to much they should reset!?

Sometimes I think the complications and issues associated with the indicator light in the side switch are just not worth it. I’m mainly referring to mass production lights like the Q8.

Would it be a step backwards or an improvement to just have the side switch light stay on whenever the batteries are connected?

I’ve got two narsil lights that I’ve wired up so the switch always stays lit and it’s been super simple. No funny blinks, you always know when power is applied or if the light is locked.

Since Narsil can be quite complex, why make it even more complex with indicator functionality?

Well it's open source. It's easy to add a simple compile switch to just turn it on upon power up and stay on. I could also add this to the switch configuration settings UI. You lose some functionality of course - channel use indicator blinks, LVP blinks, etc.

To Tom or any eaqually intelligent individual:
What has been the go to way if limiting max output?

I am using the otr m3 setup and have tweaked some settings in narsilm.c but the only thing I need to do now is limit output some how. I guess I could adjust the pwm values in the mode sets but it would be hard to scale them down to keep the modes balanced. Also, That wouldn’t work for ramping.

I read somewhere along the line that mode groups and ramping can be scaled back while at the same time leaving the double click to turbo at full 255 value. This would be my preferred way of setting up this light if possible.

So, I’m sure it’s been covered but if someone can refresh me or get me started or point me to a previous discussion I will be grateful! :slight_smile: