NarsilM - configurable e-switch firmware for Multi channels, new v1.2 BETA

504 posts / 0 new
Last post
Tom E
Tom E's picture
Offline
Last seen: 1 hour 15 min ago
Joined: 08/19/2012 - 08:23
Posts: 12427
Location: LI NY

I don't understand - you do want the timeout to be whether is light is ON or OFF? There is no battery check when the light is in a deep sleep - 5 seconds after its turned OFF it enters the deep sleep mode where only a button press wakes it up.

joechina
Offline
Last seen: 2 days 1 hour ago
Joined: 03/05/2016 - 08:23
Posts: 1439
Location: Germany

MRsDNF
I don’t think Narsil can moonlight from 25 to 50 lumen, that would be my default brightness.

I know Narsil starts in MOON with a click&hold. My point is, I have to think again with every lamp: What is the UI? What does a click&hold? How do I change brightness? Tap or hold?

It’s grabbing the light, one klick, enough light for within arm lenght. The next click is off.

It is about not thinking.

Like a tool, a screwdriver on the pegboard at the workbench, you grab it and use it.

My hunch is operation gets easier.

Joe

joechina
Offline
Last seen: 2 days 1 hour ago
Joined: 03/05/2016 - 08:23
Posts: 1439
Location: Germany
Tom E wrote:

I don’t understand – you do want the timeout to be whether is light is ON or OFF? There is no battery check when the light is in a deep sleep – 5 seconds after its turned OFF it enters the deep sleep mode where only a button press wakes it up.

Yes, timeout in On and Off

I didn’t know it goes direct to deep sleep, so I am sorry for writing nonsense.

Lexel
Lexel's picture
Online
Last seen: 9 min 8 sec ago
Joined: 11/01/2016 - 08:00
Posts: 5587
Location: Germany

joechina wrote:
MRsDNF
I don’t think Narsil can moonlight from 25 to 50 lumen, that would be my default brightness.

I know Narsil starts in MOON with a click&hold. My point is, I have to think again with every lamp: What is the UI? What does a click&hold? How do I change brightness? Tap or hold?

It’s grabbing the light, one klick, enough light for within arm lenght. The next click is off.

It is about not thinking.

Like a tool, a screwdriver on the pegboard at the workbench, you grab it and use it.

My hunch is operation gets easier.

Joe

you can change the code for higher moonlight
in ramping its easy just edit the ramping table
for mode operation I dont know where to start to get MM at 50 lumens

BUT if you dont care for code you could simply add a capacitor on a tiny FET to the single AMC channel
it switches on when the driver gives a signal to the single AMC channel
then just wire a resistor for 50 lumens to the LED minus

mattlward
mattlward's picture
Offline
Last seen: 11 hours 3 min ago
Joined: 06/19/2015 - 09:20
Posts: 2818
Location: Illinois, USA

How would this software react to having a tail cap on/off switch? Is there a suggested hardware that currently supports this firmware? Something in the 17 to 22mm size range?

EDC rotation:
FW1A, LH351D 4000k (second favorite)
FW3A, LH351D 3500k
FW3A, SST20 FD2 4000k
FW3A, Nichia 4000k sw40 r9080 (favorite light!)
FW3A, Cree XP-L Hi 5A3
Emisar D4V2, SST20 4000k
S2+, XM-L2 T6 4C

Tom E
Tom E's picture
Offline
Last seen: 1 hour 15 min ago
Joined: 08/19/2012 - 08:23
Posts: 12427
Location: LI NY

Was planning on adding links. Lexel has been building/selling TA boards that run Narsil. I would use either TA or DEL boards. I'll add the links to at least the driver board threads to the OP now -- links added!

 TA, DEL, and HQ board designs have the extra parts to properly support the ATtiny85, either the 85 full pad size or mounting via the bent pin method. The extra parts (from original Attiny13A designs) were developed by DEL. Standard sizes of 17, 20, and 22 mm are available in both TA's and DEL's designs.

About the tail switch, there's compile time support for one that works for mode changing but only in mode set operation, not ramping. Otherwise, a tail power switch would simply be power ON/OFF. In ramping if you power off the light, you lose the last used level.

 

ToyKeeper
ToyKeeper's picture
Offline
Last seen: 38 min 5 sec ago
Joined: 01/12/2013 - 14:40
Posts: 10147
Location: (469219) 2016 HO3

Tom E wrote:
Possible New Features
  • joechina recommended to do a quick ramp to max, maybe even quick fade to OFF

In case it helps at all, this is exactly what the soft-start code in bistro was intended for. It intercepts all brightness changes and makes the transition smooth. Bistro doesn’t use it much though, since the button cuts power. It was more about making things easier later if anyone ever made an e-switch UI based on it.

So, there may be code which can be copy/pasted if this feature is desired.

ToyKeeper
ToyKeeper's picture
Offline
Last seen: 38 min 5 sec ago
Joined: 01/12/2013 - 14:40
Posts: 10147
Location: (469219) 2016 HO3

I’ve also been meaning to sync NarsilM’s updates to my repository, but with my main PC still out of commission everything is a little awkward. I really miss having a decent keyboard, multiple screens, and enough RAM.

ToyKeeper
ToyKeeper's picture
Offline
Last seen: 38 min 5 sec ago
Joined: 01/12/2013 - 14:40
Posts: 10147
Location: (469219) 2016 HO3

mattlward wrote:
How would this software react to having a tail cap on/off switch? Is there a suggested hardware that currently supports this firmware? Something in the 17 to 22mm size range?

If you want ramping in a light which only has a tail on/off switch, there’s a separate project (Crescendo) for that. But if you want it in a dual-switch light (e-switch plus tail on/off), I’m not sure if there is currently a good option… probably a future version of Narsil.
tterev3
Offline
Last seen: 6 days 16 hours ago
Joined: 03/28/2014 - 11:22
Posts: 268
Location: NC, USA
ToyKeeper wrote:
But if you want it in a dual-switch light (e-switch plus tail on/off), I’m not sure if there is currently a good option…

Psst… MELD-x with colors disabled

JasonWW
JasonWW's picture
Offline
Last seen: 1 hour 40 min ago
Joined: 10/22/2016 - 11:41
Posts: 12172
Location: Houston Texas

Tom, does Narsil M, in a 2S configuration, do LVP and temp control at same time or do you still have to choose only one?

I think this version was supposed to let you switch between the 2 choices.

Texas Ace Lumen Tube and JoshK Sphere calibrated with Maukka lights

Click this to go to signature links.

steel_1024
steel_1024's picture
Offline
Last seen: 1 day 56 min ago
Joined: 10/17/2016 - 14:06
Posts: 486
Location: Taiwan

Thanks Tom .

Thumbs Up

Sorry for my poor english.

Tom E
Tom E's picture
Offline
Last seen: 1 hour 15 min ago
Joined: 08/19/2012 - 08:23
Posts: 12427
Location: LI NY

JasonWW wrote:
Tom, does Narsil M, in a 2S configuration, do LVP and temp control at same time or do you still have to choose only one? I think this version was supposed to let you switch between the 2 choices.

Yes - I'm using in a L6, TA L6 board, with the proper resistor values and tested it to be accurate with battery level readings, and you still have full choice of temperature or timed step down. Parasitic drain is only 62 uA - nice for an LDO 2S setup. I have support for both LVP monitoring methods:

  • internal 1.1V reference with no need for R1/R2 (1S only!)
  • external R1/R2 support (I now use it only for 2S setups, but it can still be configured for 1S if you prefer)

Both methods are interrupt driven to do the AtoD readings.

steel_1024 wrote:
Thanks Tom . :THUMBS-UP:

You're welcome, and Thank You!

steel_1024
steel_1024's picture
Offline
Last seen: 1 day 56 min ago
Joined: 10/17/2016 - 14:06
Posts: 486
Location: Taiwan

For “TA” LDO Driver series. Is the part value the same?

R1: 220 k for e-switch lights
R2: 47 k for e-switch lights
R3: 100 k
R4: 47 ohm
R5: 4.7 ohm
R6: 1206 0 ohm jumper
R7: 1206 0 ohm jumper
C1: 10 uF
C2: 0.1 uF

Sorry for my poor english.

ToyKeeper
ToyKeeper's picture
Offline
Last seen: 38 min 5 sec ago
Joined: 01/12/2013 - 14:40
Posts: 10147
Location: (469219) 2016 HO3

tterev3 wrote:
Psst… MELD-x with colors disabled

Right, I keep forgetting that MELD can be used as SELD instead. And, um, usually I just check the index file in my repository to find suitable firmware, so I tend to miss it.

Anyway, there’s lots of cool stuff lately and I hope I’ll be able to catch up on some of it soon. Smile

Tom E
Tom E's picture
Offline
Last seen: 1 hour 15 min ago
Joined: 08/19/2012 - 08:23
Posts: 12427
Location: LI NY

steel_1024 wrote:
For "TA" LDO Driver series. Is the part value the same? R1: 220 k for e-switch lights R2: 47 k for e-switch lights R3: 100 k R4: 47 ohm R5: 4.7 ohm R6: 1206 0 ohm jumper R7: 1206 0 ohm jumper C1: 10 uF C2: 0.1 uF

No, this is wrong - has a couple of problems - wrong value for R1 and C2 should be a 10 uF. Need couple minutes. PhotoBucket seems down right now.

 

Edit:

R1 should be 360K - noted in setups.h. That's what my default tables in the header file: tk-calibWight.h is set up for.

 

C2, for an LDO, is changed from a 0.1 uF to a 10 uF. Believe this is standard for our drivers when using an LDO. It's a make-do-with-what-we-got sort of thing. Be sure you use a proper LDO though. I got a part # somewhere... I know it's been mentioned, but I'm sure Lexel is using a proper one.

PhotoBucket still down - may be a long one. I got a pic of my L6 TA driver posted somewhere... That's what I was trying to get. Oh boy, should really be adding more info in the OP.

 

Oops, back up:

I should have used the SIR 404DP if I knew the XHP70.2 would be so high in amps. Can't tell, but C2 is a 10 uF cap.

steel_1024
steel_1024's picture
Offline
Last seen: 1 day 56 min ago
Joined: 10/17/2016 - 14:06
Posts: 486
Location: Taiwan

Yes,

There should be a lot of people who need a “Muggle” Assembly information.

Especially, How to flash firmware. (avrusb.bat)

Sorry for my poor english.

Lexel
Lexel's picture
Online
Last seen: 9 min 8 sec ago
Joined: 11/01/2016 - 08:00
Posts: 5587
Location: Germany

When setting up NarsilM to do triple builds I found one thing in setup.h where I am puzled

#define D1_DIODE 2 // Drop over rev. polarity protection diode: 0.2V normally, 0.3V for Q8

the value is set to 2, but comments say 0.2 or 0.3V

next mode sets for triple channel has a bug for 6. mode
5% mode and 10% mode have both 7135 bank set to 0, but 10% need a value like 60 or so

// 6 modes 0.8-2-5-10-50-max ~0.8% ~2% ~5% ~10% ~50% max
PROGMEM const byte mode7135Set6[] = { 20, 110, 255, 255, 0, 0};
PROGMEM const byte mode7135sSet6[] ={ 0, 0, 0, 0, 255, 0};
PROGMEM const byte modeFetSet6[] = { 0, 0, 0, 0, 0, 255};

for reference this is my custom mode set file

Quote:
// 1 mode (max) max
PROGMEM const byte mode7135Set1[] = { 0}; // for single 7135
PROGMEM const byte mode7135sSet1[] ={ 0}; // for 7135 bank
PROGMEM const byte modeFetSet1[] = { 255}; // FET only

// 2 modes (7135-FET) ~10% max
PROGMEM const byte mode7135Set2[] = { 255, 0};
PROGMEM const byte mode7135sSet2[] ={ 0, 0};
PROGMEM const byte modeFetSet2[] = { 0, 255};

// 3 modes (7135-7135s-max) ~10% ~50% max
PROGMEM const byte mode7135Set3[] = { 255, 0, 0};
PROGMEM const byte mode7135sSet3[] ={ 0, 255, 0};
PROGMEM const byte modeFetSet3[] = { 0, 0, 255};

// 4 modes (1.2-10-50-max) ~1.2% ~10% ~60% max
PROGMEM const byte mode7135Set4[] = { 25, 255, 255, 0};
PROGMEM const byte mode7135sSet4[] ={ 0, 0, 255, 0};
PROGMEM const byte modeFetSet4[] = { 0, 0, 0, 255};

// 5 modes (1.2-5-10-50-max) ~1.2% ~4,5% ~10% ~60% max
PROGMEM const byte mode7135Set5[] = { 22, 100, 255, 255, 0};
PROGMEM const byte mode7135sSet5[] ={ 0, 0, 0, 255, 0};
PROGMEM const byte modeFetSet5[] = { 0, 0, 0, 0, 255};

// 6 modes 0.8-2-5-10-50-max ~0.8% ~2% ~5% ~10% ~60% max
PROGMEM const byte mode7135Set6[] = { 17, 80, 255, 255, 255, 0};
PROGMEM const byte mode7135sSet6[] ={ 0, 0, 0, 100, 255, 0};
PROGMEM const byte modeFetSet6[] = { 0, 0, 0, 0, 0, 255};

// 7 modes (0.5-2.5-5-10-25-50-max) ~0.4% ~2% ~8% ~20% ~50% ~80% max
PROGMEM const byte mode7135Set7[] = { 10, 50, 200, 255, 255, 0, 0};
PROGMEM const byte mode7135sSet7[] ={ 0, 0, 0, 75, 175, 255, 0};
PROGMEM const byte modeFetSet7[] = { 0, 0, 0, 0, 0, 65, 255};

// 2 modes (all 7135s-FET) ~60% max
PROGMEM const byte mode7135Set8[] = { 255, 0};
PROGMEM const byte mode7135sSet8[] ={ 255, 0};
PROGMEM const byte modeFetSet8[] = { 0, 255};

Ramping table has still only 12 values for FET on 7135*8 set up

this is my customized ramp table which works better

Quote:

#ifdef TRIPLE_8_7135
#define RAMP_SIZE 150
#define TURBO_DROP_MIN 112
// min level in ramping the turbo timeout will engage,
// level 115 = 106 PWM, this is ~43%
#define TURBO_DROP_SET 102
// the level turbo timeout will set,
// level 102 = 71 PWM, this is ~32%

#define BANK_START_LVL 63
#define FET_START_LVL 113

// Ramping Modes, 150 total entries (2.4 secs)
// level_calc.py 3 150 7135 3 0.3 150 7135 3 2.0 800 FET 1 1 1200
// (manually edited to add 255 max entries without an overlap)
PROGMEM const byte ramp_7135[] = { 3,3,3,4,4,4,5,5, 5,6,6,7,7,8,8,9, 10,11,12,14,16,18,20,22, 25,28,31,34,37,41,45,49, 53,57,61,66,71,76,81,86, 92,98,104,110,116,125,132,139, 146,153,161,169,177,185,194,203, 212,221,231,241,251,255,255,255, 255,255,255,255,255,255,255,255, 255,255,255,255,255,255,255,255, // 63 entries, 0-62 255,255,255,255,255,255,255,255, 255,255,255,255,255,255,255,255, 255,255,255,255,255,255,255,255, 255,255,255,255,255,255,255,255, 255,255,255,255,255,255,255,255, 255,255,255,255,255,255,255,255, 255,255,255,255,255,255,255,255, 255,255,255,255,255,255,255,255, 255,255,255,255,255,0
};
PROGMEM const byte ramp_7135s[] = { 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,5,7,10, 13,16,19,23,26,30,33,37, 40,44,48,52,56,60,64,69, 73,78,82,87,92,96,101,106, 111,117,122,127,133,139,144,150, 156,162,168,174,181,187,194,201, 207,214,221,228,236,245,255,255, 255,255,255,255,255,255,255,255, 255,255,255,255,255,255,255,255, 255,255,255,255,255,255,255,255, 255,255,255,255,255,255,255,255, // 50 entries, 63-112 255,255,255,255,255,0
};
PROGMEM const byte ramp_FET[] = { 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,5,7, 10,14,17,20,24,28,32,36, 40,45,50,55,60,65,71,77, 83,89,95,102,109,116,123,130, 138,146,154,162,170,179,188,197, // 36 entries, 113-149 206,215,225,235,245,255
};
#endif

for the temp calibration values I got also some drivers qith positive value
but for NarsilM is the temp calibration value just wasted space as it uses the config menu to read temp value when you stop heating the light?

Lexel
Lexel's picture
Online
Last seen: 9 min 8 sec ago
Joined: 11/01/2016 - 08:00
Posts: 5587
Location: Germany

two questions

#define D1_DIODE 2 // Drop over rev. polarity protection diode: 0.2V normally, 0.3V for Q8

if I use R1/R2 on a 2S LDO board do I need to comment this out?

in config menu, is it possible to add a timed+temperature?
and how does it work 2 settings in one menu point

3
Thermal/timed stepdown
1=disable, 2= Temperature, 3=timed
Timed: 1=60secs, 2=90secs, 3=2 mins, 4=3 mins, 5=5 mins, 6=7 mins
3-4

Lexel
Lexel's picture
Online
Last seen: 9 min 8 sec ago
Joined: 11/01/2016 - 08:00
Posts: 5587
Location: Germany

so first try to compile NarsilM for TA triple board using R1/R2 reference

I got a ton of errors

Tom E
Tom E's picture
Offline
Last seen: 1 hour 15 min ago
Joined: 08/19/2012 - 08:23
Posts: 12427
Location: LI NY

Maybe not enough time now to answer all this.

  • The last errors - works for me. I've been using R1/R2 for 2S. No need to use it for 1S, so I don't, plus not having R1/R2 reduces parasitic drain. Are you sure you uncommented either the 220K or 360K define? 

// For voltage monitoring on pin #7, only uncomment one of the two def's below:
//#define USING_220K // for using the 220K resistor
//#define USING_360K // for using a 360K resistor (LDO and 2S cells)

 

  • I'll drop in your ramping table - sounds/looks much better!
  • The D1_DIODE value is in 10th's of a volt - thought that was obvious and commented as such?
  • The 3-4, is 3 for timed, then 4 for the 4th timed choice. Again, thought this was obvious - 2 settings, 2 default values, maybe not?
Lexel
Lexel's picture
Online
Last seen: 9 min 8 sec ago
Joined: 11/01/2016 - 08:00
Posts: 5587
Location: Germany

I uncommented 360k

but those
TIMED_STEPDOWN_SET
byInitADCTimer

errors are still there

Quote:
Severity Code Description Project File Line Error ‘TIMED_STEPDOWN_SET’ undeclared (first use in this function) NarsilM B:\Bilder\Export\Flashlight\NarsilMulti\NarsilM.c 1522 Message each undeclared identifier is reported only once for each function it appears in NarsilM B:\Bilder\Export\Flashlight\NarsilMulti\NarsilM.c 1522 Error ‘byInitADCTimer’ undeclared (first use in this function) NarsilM B:\Bilder\Export\Flashlight\NarsilMulti\NarsilM.c 1597
Tom E
Tom E's picture
Offline
Last seen: 1 hour 15 min ago
Joined: 08/19/2012 - 08:23
Posts: 12427
Location: LI NY

The only way I see 'byInitADCTimer' is undeclared is if you commented out VOLTAGE_MON:

#define VOLTAGE_MON // Comment out to disable - ramp down and eventual shutoff when battery is low

Is it commented out? Commenting out disables stuff, but not everything I see. I'll have to see about fixing that. I've never built firmware without LVP, so not sure why you'd want to do that.

 

Lexel
Lexel's picture
Online
Last seen: 9 min 8 sec ago
Joined: 11/01/2016 - 08:00
Posts: 5587
Location: Germany

I commented this out as I thought its ok when I enable R1/R2

one error still there
Severity Code Description Project File Line
Error ‘TIMED_STEPDOWN_SET’ undeclared (first use in this function) NarsilM B:\Bilder\Export\Flashlight\NarsilMulti\NarsilM.c 1522

Message each undeclared identifier is reported only once for each function it appears in NarsilM B:\Bilder\Export\Flashlight\NarsilMulti\NarsilM.c 1522

Tom E
Tom E's picture
Offline
Last seen: 1 hour 15 min ago
Joined: 08/19/2012 - 08:23
Posts: 12427
Location: LI NY

Lexel wrote:
I commented this out as I thought its ok when I enable R1/R2 one error still there Severity Code Description Project File Line Error 'TIMED_STEPDOWN_SET' undeclared (first use in this function) NarsilM B:\Bilder\Export\Flashlight\NarsilMulti\NarsilM.c 1522 Message each undeclared identifier is reported only once for each function it appears in NarsilM B:\Bilder\Export\Flashlight\NarsilMulti\NarsilM.c 1522

Ok, so far so good.

The TIMED_STEPDOWN_SET is defined in the RampingTables.h file. Could it some how got deleted or commented out? It's needed. I see it's there for two 3 channel table definitions, so should work. Did you add in your own table? If so, maybe you left out the TIMED_STEPDOWN_SET #define?

Lexel
Lexel's picture
Online
Last seen: 9 min 8 sec ago
Joined: 11/01/2016 - 08:00
Posts: 5587
Location: Germany

I just copied that ramping table I posted above in the ramping table file

it seems that in previous Narsil it was defined as TURBO_DROP_SET

changing it to TIMED_STEPDOWN_SET compiles the project

one thing for 2S LVP over R1/R2 maybe do automatically ignore the diode compensation?
I got there an odd pheonmen that SD is set 0.1V per cell below ramp down, but its a bit over 0.2V per cell above

I also discovered that the modeset file has for triple channel has only 7 modegroups, thats not like the 2 channel with 12 modes that are described in the manual

Tom E
Tom E's picture
Offline
Last seen: 1 hour 15 min ago
Joined: 08/19/2012 - 08:23
Posts: 12427
Location: LI NY

I dropped in your triple (8x7135) ramping table last night, downloaded into a Lumintop SD26 and a Manker U11. Looking very good, better than mine. There's still slight pauses at the channel transition points, but I haven't been able to completely eliminate that in the past. I had better luck with the 2 channel ramping table. I haven't been able to figure that out on the triples.

I see it's not documented, but a quick search will tell you the D1_DIODE setting is only used in 1.1V ref method (no R1/R2), and not used at all if you are using R1/R2. When using the R1/R2 resistors, look up tables are used to convert the AtoD readings to a voltage level.

I don't know what this means: I got there an odd pheonmen that SD is set 0.1V per cell below ramp down ??

For mode groups, yes - only 8 mode groups for triple channel configurations - I stopped there. I'll have to re-visit this. My priority has been for the two channel projects.

Of course in defining mode groups and giving them some sort of % output rating, it gets pretty impossible to be accurate for the multitudes of possible hardware builds out there. I based the percentages on approximately 1,500 lumens output on the full FET. Of course on a full FET, a BLF Q8 can do 6,000 lumens, while the OTR M3 does only 1,400 lumens, or my 16X super light can do 37,000 lumens. A max level of a single 7135 is ~10% (150 lumens) given the max level on the FET is 1,500 lumens, but it's only ~0.4% on the 16X super light.

In triples, it's worse because of the additional bank of 7135's - it could be 8 7135's, or 6, or 12. You could also stack a 7135 on the single 7135, so that will throw off everything as well.

In your case, you are building the driver so you have a canned set configuration, and it could be documented accordingly. I can't write a manual for every possible user of the firmware. For ratings of % output, even you can't define that because the modder buying your driver is the one that knows the light design - what kind of LED's, how many LED's, cells used, etc. I really don't want to get into writing manuals for every possible modded light out there.

Things were much simpler back in the day of straight use of one channel of 7135's.

 

Lexel
Lexel's picture
Online
Last seen: 9 min 8 sec ago
Joined: 11/01/2016 - 08:00
Posts: 5587
Location: Germany

I set
#define BATT_LOW 31 // Cell voltage to step light down = 3.0 V
#define BATT_CRIT 30 // Cell voltage to shut the light off = 2.8 V

on 2 Channel NarsilM 2S LDO this was tested on 6 drivers
ramp down voltage= Batt_low was 6.33-6.37V
SD voltage=Batt_crit was 5.87-5.9V

with this numbers I expected 0.2V between ramp down and shut down in a 2S light

if doing a ModeSet table for all lights
I would simply not use % levels that are related to the max light level, as you said it depends single LED or quad light build

I would just say this mode has 50% of 7135 bank
or another level 100% AMC bank+50% FET

for triple Modegroups I just added the 5 special modes you got in 2 channel and manual as well
so the triple channel is then consistent with the manual, easier to add there some code than doing different manuals for 2 and 3 channels

// #8: 3 modes (10-25-50) ~10% ~25% ~50%
PROGMEM const byte mode7135Set8[] = { 255, 255, 255};
PROGMEM const byte mode7135sSet8[] ={ 0, 110, 255};
PROGMEM const byte modeFetSet8[] = { 0, 0, 0};

// #9: 3 modes (2-20-max) ~2% ~20% max
PROGMEM const byte mode7135Set9[] = { 40, 255, 0};
PROGMEM const byte mode7135sSet9[] ={ 0, 40, 0};
PROGMEM const byte modeFetSet9[] = { 0, 0, 255};

// #10: 3 modes (2-40-max) ~2% ~40% max
PROGMEM const byte mode7135Set10[] = { 40, 0, 0};
PROGMEM const byte mode7135sSet10[] ={ 0, 200, 0};
PROGMEM const byte modeFetSet10[] = { 0, 0, 255};

// #11: 3 modes (10-35-max) ~10% ~35% max
PROGMEM const byte mode7135Set11[] = { 255, 255, 0};
PROGMEM const byte mode7135sSet11[] ={ 0, 170, 0};
PROGMEM const byte modeFetSet11[] = { 0, 0, 255};

// #12: 4 modes – copy of BLF A6 4 mode
PROGMEM const byte mode7135Set12[] = { 20, 230, 255, 0};
PROGMEM const byte mode7135sSet12[] ={ 0, 0, 200, 0};
PROGMEM const byte modeFetSet12[] = { 0, 0, 0, 255};

Tom E
Tom E's picture
Offline
Last seen: 1 hour 15 min ago
Joined: 08/19/2012 - 08:23
Posts: 12427
Location: LI NY

Ahh, I see the problem. In setups.h, it says:

 

  #ifndef VOLT_MON_R1R2 // if using R1/R2, change the LVP settings in the calibration header file
  #define BATT_LOW 30 // Cell voltage to step light down = 3.0 V
  #define BATT_CRIT 28 // Cell voltage to shut the light off = 2.8 V
  #endif

So if you use R1/R2, you have to set the LVP voltage values in the calibration header file: tk-calibWight.h

I forgot about this. These might not be so simple to move to the setups.h file, but I should have documented it more clearly.

The settings currently are:

  #define ADC_LOW ADC_32 // When do we start ramping down
  #define ADC_CRIT ADC_30 // When do we shut the light off

 

Edit: For the mode set levels, I thought about that but for the end user, it sure would be confusing. Guess it all depends who the NarsilM reference manual is targeted for - a user or an integrator/modder.

Lexel
Lexel's picture
Online
Last seen: 9 min 8 sec ago
Joined: 11/01/2016 - 08:00
Posts: 5587
Location: Germany

ok got it with the LVP settings

to get the 3 channel modes to match the manual you can add the 5 modes,
I am sure some more code lines need to be changed to get it to 12 from 8 modes

of course if people want to adjust the modes for their lights to match they have to edit the values for the channels,
but at least the modecount should be the same on all version

Pages