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

Oh boy, hard to keep up here.

For the 85 in on the GT or Q8 drivers, yes - same ol process as we use for 13's, but of course, specific to the 85. For th AVRDude commands, you must specify the MCU, for example:

This dnld's the firmware:

rem 85NarsilM - downloads NarsilM (Tiny85 Multi-channel e-switch UI configurable)
rem
avrdude -p attiny85 -c usbasp -u -Uflash:w:\Tiny254585Projects\NarsilMulti\Release\NarsilM%1.hex:a

This sets the fuses:

REM BOD enabled at 1.8V:
avrdude -p t85 -c usbasp -Ulfuse:w:0xe2:m -Uhfuse:w:0xde:m -Uefuse:w:0xff:m

So using "attiny85" or "t85" says it's an ATtiny85 MCU. For 13, 25, 45 -- same thing.

Hhmm. I get this quite often - usually a bad clip engagement. Sometimes cleaning the MCU pins and clip pins with isop. alcohol does the trick.

Hmm? That weird. I soldered leads to each leg of the MCU straight to my programmer. It worked the first time but not the second and I had left the leads soldered on as I anticipated reflashing a couple times. Huh. Iā€™m starting over anyway.

I still didnā€™t get the double click to turbo working. I can get the top of the ramp reduced but then a double click only goes up about 300ma or so. Do you have that option working on any light yet?

Thanks Tom! I wish We had a way for you to share the tech support load! Iā€™ve been thinking of some ideas but donā€™t know if anyone would engage or not. Anyway if you coule just answer the do you have the ā€œreduced ramp with 2x click to turbo working for sureā€ question, that would be helpful.

@LightRider:
You might have set wrong fuse on last programming.

It works well on the BLF GT, actually, I think - pretty sure. Hhmm, I had to test it out somehow without having a GT buck driver light though, so tested on something - think a 2 or 3 channel test light. Ohh, trying to recall, think I modded up a header file to use only the first 130 or so levels of the 150, then 2X click went max, and ramping stopped at the 130 level.

Maybe you can send me your files you changed, or ZIP up the whole project? Probably be easy for me to find a problem.

Very generous of you! PM sent with a link to my zipped project :slight_smile:

Tom, in v1.2, what should I edit if I want a faster response for double clicks to turbo? It seems like double clicks to turbo has a bit slower (pauses at memorized level about half a second). compare to v1.0
Thanks.

Yes, intentionally so. I've answered this question before but dunno where. It's not as long as 1/2 sec, it's definitely quicker.

If I didn't delay it, when you do a 3X, 4X or 5X click, you would get flashed with max/turbo every time. I did not want to delay the 1 click operations, so decided to start it at 2X since the flash of max/turbo is annoying.

From what I can tell, the delay is 0.288 seconds, as defined below. If you change it to be less, you will make the multi clicks tighter timed and might get difficult:

# define SHORT_CLICK_DUR 18 // Short click max duration - for 0.288 secs

Thanks Tom :+1:

This is now updated in the repository.

Thanx TK!

Does narsilm without voltage dividers require the 85v 10Mhz?

Yes, at least two of us have implemented it now, and there is some code for it in the repository. Itā€™s included in the Emisar lights, Crescendo, and the FSM toolkitā€¦ and Iā€™ve been dragging my feet about patching something into Narsil.

While not PID, Narsil already has thermal step-down. It was tuned for the Q8, but didnā€™t respond fast enough for use on a D4 (much smaller, similar power level). This is what I measured on a D4v1 light (which was way too hot from about 30s to 4m):

Yeahā€¦ these things take an inordinate amount of time to test, and Iā€™ve found it tends to be really sensitive to small changes.

I tested a DrJones H17F driverā€™s thermal response recently, and it looks like his solution was to make the regulation response relatively slow and gradual. In my test, it took almost 8 minutes to reach a stable stateā€¦ which was fine on the heavy copper host I used, but would be way too slow for something like an Emisar D4. However, it was very smooth and had no significant oscillations or noise. It merely stepped down one PWM level at a time, one channel at a time, until it was no longer overheating. And when ice was held against it afterward, it stepped back up just as slowly. I wouldnā€™t really say itā€™s a PID algorithm though, since it didnā€™t act like one. The I term seemed to be zero, I couldnā€™t tell if there was a D term or not, and if there was a P term it seemed to have only two states ā€” two steps per second, or one step per second.

My attempts to make a more responsive PID regulator have been less than ideal. It works, but Iā€™m not totally happy with it. After reaching a stable state, itā€™s still more noise-sensitive than Iā€™d like, and occasionally Iā€™ve measured rather undesirable behavior like oscillations. The response is proportional though, and fairly heavy on the derivative term so it can anticipate and ā€œsteer intoā€ the turns, but Iā€™ve mostly only used the integral parts as a way to reduce noise. And, as already mentioned, itā€™s still not at a point where Iā€™m happy with it. Sensor readings are low-resolution and noisy and subject to thermal lag due to having the sensor in the MCU, and my attempts to deal with the lag have made it even more noise-sensitive.

Hereā€™s FSMā€™s behavior compared to a H17F:

Soā€¦ long story short: Yes, but itā€™s still a work in progress.

No, the "85V" version is not necessary.

Does double click to turbo go to turbo in mode sets as well as ramping?

I was able to get narsilm with throttle control working in ramping configuration so i assumed it was working in mode sets. However, today i was testing out the rest of the options and realized the 2x click in mode sets is not working for me. two clicks simply advances the out put two levels. Is this just me or is this the way it works?

I have the ramping mode stopping at 2amps for normal operation of the M3 clone. then a 2x click and ā€œBAM!ā€ IN YOUR FACE 7amp Max turbo. I like it! :smiley:

No, I donā€™t think you can jump to turbo while in mode sets.

Ahh. Ok, thanks. I thought it might be my inability to fast click. So good to know. It means I might still have my freakishly fast reflexes after all. Chā€™ chahhhā€¦ :laughing:

Lightrider,
no it doesnā€™t.

The command for TURBO in MODES is:
The lamp is OFF: Click&hold
Nothing else

In the cheat sheet:
The row for 2x in the MODES column is empty, as other multible click commands.

Are you sure? It seems a click&hold from OFF first goes to strobe, then goes to the menu options.

For me, click&hold goes to max, then strobe, then menu

The click&hold to max may be a new option in the latest version only. Not sure