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

504 posts / 0 new
Last post
LightRider
LightRider's picture
Offline
Last seen: 3 years 5 months ago
Joined: 08/05/2015 - 09:52
Posts: 2007
Location: U.P. MI, USA
Lexel wrote:
LightRider wrote:
Are you using r1&2? What pin is the indicator connected too?

I am not using R1 and R2 and its connected to Pin 7

I downloaded NarsilM here
https://drive.google.com/drive/folders/0B1IxYZuk4DjcQWhOOGhTMExCNjg

I have uploaded the zip here, containing the original NarsilM files with the OTR M3 setup.h and build hex file

http://www.metronixlaser.de/bilder/flashlight/NarsilMulti.zip (link is external)

The only different file from what I’m using is the m3 setup file. I’m just using the main built in setup file. I didn’t know there was an m3setup file. Sorry, I am unable to flash your .hex file right now. That might be helpful. Idk? If your still having trouble I might be able to do that tomorrow. I’ll keep watching. Hope you get it working. Working through these details can be frustrating !

Lexel
Lexel's picture
Offline
Last seen: 10 months 1 week ago
Joined: 11/01/2016 - 08:00
Posts: 5895
Location: Germany

I found the error, the switch wires were soldered the wrong way Facepalm

Tom E
Tom E's picture
Offline
Last seen: 50 min 57 sec ago
Joined: 08/19/2012 - 08:23
Posts: 14626
Location: LI NY

surprisedlaughing Don't sweat it - no problem.

MRsDNF
MRsDNF's picture
Offline
Last seen: 1 month 5 days ago
Joined: 12/22/2011 - 21:18
Posts: 13473
Location: A light beam away from the missus in the land of Aus.

Amazing work as usual Tom. That 18 led light with all the wires is incredible. Thanks for all the pictures. Thumbs Up

 

djozz quotes, "it came with chinese lettering that is chinese to me".

                      "My man mousehole needs one too"

old4570 said "I'm not an expert , so don't suffer from any such technical restrictions".

Old-Lumens. Highly admired and cherished member of Budget Light Forum. 11.5.2011 - 20.12.16. RIP.

 

Lexel
Lexel's picture
Offline
Last seen: 10 months 1 week ago
Joined: 11/01/2016 - 08:00
Posts: 5895
Location: Germany

I did mod the Klarus G35 with the dead driver today with NarsilM driver

further testing showed that the indicator LED as locator does not shut down with low voltage when the battery gets depleeted from it
it draws not too much on my setup with green LED and 4.7kOhms about 85uA at 2.7V

so there is a parasitic drain that can kill unprotected cells if the light gets stored over a longer period of time with the locator on with almost depleeted batteries

BUT
when the light shuts down from LVP it starts to blink for low voltage warning when the light is in standby, but it does not shut down
even worse the blinking means the MCU is not in deep sleep and it draws more current
then it draws 3mA from the battery which can be within a few days lead to a overdischarged battery, as the battery is almost depleeted

Tom E
Tom E's picture
Offline
Last seen: 50 min 57 sec ago
Joined: 08/19/2012 - 08:23
Posts: 14626
Location: LI NY

Lexel wrote:

BUT

when the light shuts down from LVP it starts to blink for low voltage warning when the light is in standby, but it does not shut down

even worse the blinking means the MCU is not in deep sleep and it draws more current

then it draws 3mA from the battery which can be within a few days lead to a overdischarged battery, as the battery is almost depleted

 

By design, when the light is shut down in a low voltage state, it does the blink to indicate low voltage, as you say, but does it only for 6 minutes, then shuts down the MCU. So after 6 minutes, it should go into a "deep sleep" (power savings) mode. After the 6 minutes is up, it should turn off the Indicator LED before going into power savings mode.

So, did you wait the 6 minutes to see that occurs or not?

I'm pretty sure I tested this in the older Narsil version, but not in NarsilM, nothing was changed in this area.

 

However if your cells are pretty low but not in a low voltage state, and you leave the light with the main LED off and Indicator LED on for several months, or maybe weeks, depending, then yes - there is no smarts in the MCU running to determine low voltage, therefore it cannot shut the LED off, so it will over drain the cell(s). This parasitic drain is pretty low though, depending on what LED and LED resistor value you use. I've left several flashlights in this state with the Indicator LED on for months without noticing much battery voltage drop. 

 

Here's the code:

         //---------------------------------------------------------------------
         // Be sure switch is not pressed and light is OFF for at least 5 secs
         //---------------------------------------------------------------------
         word wWaitTicks = 310;  // 5 secs
         if (LowBattState)
            wWaitTicks = 22500;  // 6 minutes
         
         if (((!ramping && (modeIdx == 0)) || (ramping && outLevel == 0))
                            &&
             !IsPressed() && (wIdleTicks > wWaitTicks))
         {
#ifdef ONBOARD_LED
            // If the battery is currently low, then turn OFF the indicator LED before going to sleep
            //  to help in saving the battery
           #ifdef VOLT_MON_R1R2
            if (byVoltage < ADC_LOW)
           #else
            if (byVoltage < BATT_LOW)
           #endif
            if (locatorLed)
               TurnOnBoardLed(0);
#endif

            _delay_ms(1); // Need this here, maybe instructions for PWM output not getting executed before shutdown?

            SleepUntilSwitchPress();   // Go to sleep
         }

 

 

Lexel
Lexel's picture
Offline
Last seen: 10 months 1 week ago
Joined: 11/01/2016 - 08:00
Posts: 5895
Location: Germany

OK I didnt wait more than a minute in my Test
If it shuts down after 6 minutes thats OK

As I wrote with a medium resistor and 0603 LED the parasitic drain gets really low when the battery is almost depleeted which takes months to be a problem

steel_1024
steel_1024's picture
Offline
Last seen: 1 month 2 weeks ago
Joined: 10/17/2016 - 14:06
Posts: 488
Location: Taiwan

I assembled a L6.

TA LDO 30mm PCB
NarsilM V1.0
XHP70.2

I Can not turnoff by E-Switch,like below link veido.

How to check?

Sorry for my poor english.

Lexel
Lexel's picture
Offline
Last seen: 10 months 1 week ago
Joined: 11/01/2016 - 08:00
Posts: 5895
Location: Germany

It happens sometimes that a AMC7135 does not shut down completely

they are drivern over their voltage specs and their quality varies from different supplies

Solution is to unsolder them and find the damaged one

steel_1024
steel_1024's picture
Offline
Last seen: 1 month 2 weeks ago
Joined: 10/17/2016 - 14:06
Posts: 488
Location: Taiwan

I reassembled a new driver.

The situation is the same.? Crying

Sorry for my poor english.

Lexel
Lexel's picture
Offline
Last seen: 10 months 1 week ago
Joined: 11/01/2016 - 08:00
Posts: 5895
Location: Germany

Remove the single AMC7135
then opposite of the FET

One thing for sure if you remove all 7135s its most likely gone

Tom E
Tom E's picture
Offline
Last seen: 50 min 57 sec ago
Joined: 08/19/2012 - 08:23
Posts: 14626
Location: LI NY

+1 with Lexel. I think I had the same issue. For 2S, you really have to have the "good" 7135's, and even still, it's risky. The XHP70.2 can be driven at high amps, so maybe it's more likely to fail?

steel_1024
steel_1024's picture
Offline
Last seen: 1 month 2 weeks ago
Joined: 10/17/2016 - 14:06
Posts: 488
Location: Taiwan

I can not understand that all 7135 are brand new.

How to test the 7135 good or no good?

Sorry for my poor english.

Lexel
Lexel's picture
Offline
Last seen: 10 months 1 week ago
Joined: 11/01/2016 - 08:00
Posts: 5895
Location: Germany

simple test

LED does not go out, you got at least one bad
LED gets out all good

I got good expirience with this AMC source
I ordered over 1000 there and had only like 15 bad ones on 2S drivers
https://de.aliexpress.com/item/200PCS-AMC7135PKFT-AMC7135-7135-SOT-89/32425181405.html?spm=a2g0s.9042311.0.0.ImdKd5

steel_1024
steel_1024's picture
Offline
Last seen: 1 month 2 weeks ago
Joined: 10/17/2016 - 14:06
Posts: 488
Location: Taiwan

Is this the problem?

Sorry for my poor english.

JasonWW
JasonWW's picture
Offline
Last seen: 2 hours 30 min ago
Joined: 10/22/2016 - 11:41
Posts: 12856
Location: Houston Texas

steel_1024 wrote:
I can not understand that all 7135 are brand new.

How to test the 7135 good or no good?


I think the 7135 are only rated up to 6 or so volts and with 2S lights your above/out of spec.

Texas Ace Lumen Tube and JoshK Sphere calibrated with Maukka lights

Click this to go to signature links. I'm still around, just not reading many new threads.

Lexel
Lexel's picture
Offline
Last seen: 10 months 1 week ago
Joined: 11/01/2016 - 08:00
Posts: 5895
Location: Germany

-0.3V to 7V

https://www.google.de/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&ved=0ahUK...

the problem is there are many cheap AMCs that are not even the original manufactor with different quality

What I can dicover sometimes on drivers if I do thermal calibration when I heat the driver up they start to leak and when cooled down they are fine again

often its way below moonligh level, just a few are that bad like you see it

JasonWW
JasonWW's picture
Offline
Last seen: 2 hours 30 min ago
Joined: 10/22/2016 - 11:41
Posts: 12856
Location: Houston Texas

steel_1024 wrote:
Is this the problem?


Yes, they still usually work above that voltage, but every once in a while you get one that seems to stay on. (According to other people that have run into this problem)

Texas Ace Lumen Tube and JoshK Sphere calibrated with Maukka lights

Click this to go to signature links. I'm still around, just not reading many new threads.

tocirahl
Offline
Last seen: 9 months 3 weeks ago
Joined: 10/18/2016 - 13:00
Posts: 110
Location: Austin, TX

Not sure if this has already been mentioned, but I was looking through the code linked in the Google Drive and there seems to be a bug in ModeSets.h

// 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};

The 6 mode set does not seem to have the “5 “ output set correctly. Looks like 255, 0, 0 is repeated twice for both 5 and 10%

Tom E
Tom E's picture
Offline
Last seen: 50 min 57 sec ago
Joined: 08/19/2012 - 08:23
Posts: 14626
Location: LI NY

Yes, looks wrong there. Not sure without looking what table it is.

tocirahl
Offline
Last seen: 9 months 3 weeks ago
Joined: 10/18/2016 - 13:00
Posts: 110
Location: Austin, TX
Tom E wrote:

Yes, looks wrong there. Not sure without looking what table it is.

Line 127 of ModeSets.h

under OUT_CHANNELS == 3

Tom E
Tom E's picture
Offline
Last seen: 50 min 57 sec ago
Joined: 08/19/2012 - 08:23
Posts: 14626
Location: LI NY

Yea, I didn't know about this one - definite bug, though it's hard to speculate what 5% and 10% mean on a particular light mod or build, since LED's and FET's make such a huge difference. For example in a 7X parallel XPL2 light, maybe you hit 25A is 100% at 10K lumens, so 10% being 0.35A is much lower than 10%...

 I'll have to fix this/change this to something reasonable. Think I was using ~1,500 lumens max (typical max single XM-L2 or XPL moderately configured) as a guideline for rating the percentages.

I'm working on NarsilM v1.1 now (GT Buck driver support merging), so will get it in before I forget, so when it's released, it will be there.

Really, all these mode sets should be tweaked build/mod by build/mod since there's so many variations of build/mods. Unfortunately this is what you get when working with fixed amp output (7135's) and variable amp output (FET's) combined in one driver.

It was discussed to not use percentages, but just state what it is: one max 7135, 20% of a 7135, 45% of the FET, etc.

 

tocirahl
Offline
Last seen: 9 months 3 weeks ago
Joined: 10/18/2016 - 13:00
Posts: 110
Location: Austin, TX

Yup completely understand the percentages are guesstimates. Just wanted to bring this to your attention since it seems obvious that two modes shouldn’t be identical.

Tom E
Tom E's picture
Offline
Last seen: 50 min 57 sec ago
Joined: 08/19/2012 - 08:23
Posts: 14626
Location: LI NY

tocirahl wrote:
Yup completely understand the percentages are guesstimates. Just wanted to bring this to your attention since it seems obvious that two modes shouldn't be identical.

Definite appreciate it! Thanks!!!

Only no code has no bugs smile

steel_1024
steel_1024's picture
Offline
Last seen: 1 month 2 weeks ago
Joined: 10/17/2016 - 14:06
Posts: 488
Location: Taiwan

I try to make another use of the NarsilM firmware driver.
Not working properly still.
After installing the battery, direct light high, and then will not light up again.

7135 using A705NGT-350 SOT-89

Flash firmware on Attiny85
FET 404

85fuses.bat:
REM BOD disabled:
Wp hvc

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

85M.bat:
Rem 85NarsilM – downloads NarsilM (Tiny85 Multi-channel e-switch UI configurable)
Rem
Avrdude -p t85 -c usbasp -u -Uflash: w: NarsilM.hex: a

All 100%

Sorry for my poor english.

Tom E
Tom E's picture
Offline
Last seen: 50 min 57 sec ago
Joined: 08/19/2012 - 08:23
Posts: 14626
Location: LI NY

Lots of questions, but I'll start with: Exactly how to you have it setup/configured? I need all the details.

Not familiar with the MF01 driver, or exactly how it's set up. I assume its 3 channels, and 2S? I see the LDO. there.

I see lots of variables - new driver, not sure if you ever worked with NarsilM before, not sure if you know the details of setting up a 2S light.

 

steel_1024
steel_1024's picture
Offline
Last seen: 1 month 2 weeks ago
Joined: 10/17/2016 - 14:06
Posts: 488
Location: Taiwan

No NarsilM worked before, L6 with NarsilM can not e-switch turnOFF also not to deal with

Setup for 2S e-switch

I guess, will it be 7135 wrong?

R1 : 360k
R2 : 47K
R3 : 100 k
R4 : 47 ohm
R5 : 4.7 ohm
R6 : 0 ohm
R7 : 0 ohm
C1 : 10uF
C2 : 10uf

U1 : ATtiny85
U2 : R404

LDO : Designed around the MIC5235-5.0YM5 LDO voltage regulator

7135 : A705NGT-350

LED arrangement, 2S3P, 3 groups, a total of 18 219C LED

Sorry for my poor english.

Tom E
Tom E's picture
Offline
Last seen: 50 min 57 sec ago
Joined: 08/19/2012 - 08:23
Posts: 14626
Location: LI NY

Maybe you can send me the source code you have? I assume you configured/set it up yourself?

You really, really need the raptor claw 7135's - I don't trust any other out there, but what you have happening - not sure if that's the problem.

I assume you have the Mateminco from Alibaba or taobao?

 

Again -- I would only use raptor claw 7135's, but also with this super high amps, I would only use FET+1 designs, never a 3 channel design - these 7135's can't take it. DEL has proposed using a C3 and C4 cap as well to handle spike from the FET hitting the 7135's. Our simple designs actually don't run the 7135's properly to the spec.

Truthfully if you can't get the raptorclaw 7135's, I would use only one channel for this light - the 404 FET, or maybe the better Hyperion.

steel_1024
steel_1024's picture
Offline
Last seen: 1 month 2 weeks ago
Joined: 10/17/2016 - 14:06
Posts: 488
Location: Taiwan
Tom E wrote:

Maybe you can send me the source code you have? I assume you configured/set it up yourself?

No, I’m not configured NarsilM.hex
Download from your link

Sorry for my poor english.

steel_1024
steel_1024's picture
Offline
Last seen: 1 month 2 weeks ago
Joined: 10/17/2016 - 14:06
Posts: 488
Location: Taiwan

I bought some different types of 7135.
Which is raptor claw?

Sorry for my poor english.

Pages