D4(S)V2 - Lower Lows by Firmware

Hello BLF community! I’ve been looking into a way to get lows to be lower on the new dual-channel Emisar lights and I think things are at the point where I’m ready to make a thread.

First of all here’s a link to the firmware you can try out: anduril.2022-01-21.moonmod.unified-tintramp.hex - Google Drive

Here’s a version that I’ve compiled later for a single-channel light (w/ a constant current driver, not FET + 1): anduril.2022-08-06.moonmod.noctigon-kr4.hex - Google Drive

Features:

  • Significantly lower lows on levels 1/150 (~5-10% of the lowest lows on stock) and slightly lower lows on 2/150 (~50% of the lowest lows on stock; this level should be roughly equivalent to the moon mode in a single-channel light); 3/150 is equivalent to 1/150 on the stock firmware

Stock config moonlight (now level 3/150):

Leakage-only (i.e. 0/511 + channel on, level 2/150):

Leakage-only + PWR_DOWN (level 1/150):

Limitations:

  • The ultra-low low on 1/150 can only be achieved when the button is released and will immediately ramp back up to 2/150 any time the button is pressed; this is technically fixable, but I really don’t feel like figuring it out as there are some significant assumptions in the firmware that need to be broken
  • Because of the above, 1H in lockout mode will not be able to achieve the ultra-low low
  • Since the lowest levels are achieved by leakage only with no PWM control, enabling both channels in 1/150 and 2/150 will be twice as bright as only having a single channel enabled. For the lowest lows, use only one channel on moonlight
  • Right now because of the way the firmware is written, this special ultra-low low can only be activated after a click and hold; so you can get to it by doing one of the following - 1H from off to get to moonlight, 1H or 2H from on to ramp down to it, 3H to tint ramp will drop you back down to ultra-low if you’re already there, 4H to unlock from lockout mode. If ultra-low moonlight gets memorized, a 1C from off will not trigger it correctly
  • Thermal regulation and LVP are disabled when this special mode is activated as the microcontroller is unable to execute any instructions
  • Reminder that there’s a decent chance that 1/150 or 2/150 will not work depending on your exact light and driver; same disclaimer that applies to normal Anduril firmware. For me, 1/150 works fine on my D4V2 with W2s, but doesn’t even light up the LEDs on my D4SV2 with W1s + LH351Ds.

For those interested in the details, here’s what I did:

  • First I modified the firmware to remove the 2/16383 that was present on level 1/150 on the default firmware and add a few tricks to make sure the LEDs don’t turn off when fed a signal of 0
  • Next I noticed that with leakage only, the LEDs were WAY dimmer when the microcontroller is put into SLEEP_MODE_PWR_DOWN instead of SLEEP_MODE_IDLE
  • Unfortunately we cannot execute any instructions when in SLEEP_MODE_PWR_DOWN, so I had to play some tricks to get things to work; this is the reason that this mode doesn’t work on clicks and only on holds as activating it prematurely will cause the driver to hang

This looks very interesting! I love my dual channel lights, but wish they had a better low mode. I would be happy to test with some of my D4V2s. I’m not sure if the 1/150 mode will work with some LEDs, since the w2 has a very low Vf, so it might only be possible with that emitter. However the 2/150 mode still looks to be an improvement. Do you have a github or similar link to the code changes?

Unfortunately I don’t have a link for the code changes at the moment, but the pre-compiled binaries should work fine for testing. I can provide the code changes once I have time to do a diff. I’m out of town for the weekend and don’t have access to the code.

I like this idea, a lot. I wish all of my light would have that ultra-ultra-low mode, sort of a tritium vial glow. It’s the perfect mode not to light things up but it’s a ‘’find me’’ mode. Perfect to leave your light on in the tent or bedside table and not being blinded.

Too technical for my little brain however, I wouldn’t be able to flash the firmware on my D4V2 but I would probably buy a new one if they came stock with this firmware. I love your work. :+1:

I’m also interested it seeing the code needed to accomplish this. That would also let me build the firmware for other lights.

Really love the idea and thank you for making this possible. However I suspect how useful it goes really depends on what LED and variation of hardware components. May I know what LED is on those photos? I’ve tested this firmware on my E21A 2000k/5000k D4v2 and the level 1 is too unstable (flickering a lot) but is remarkably dim. Dimmer than the aux LED on low which is awesome. Level 2 isn’t that obviously dimmer than the original on mine though.

Looking forwards to the code change whenever you have it available. Thanks again.

Just tested on my other 2-ch D4v2 with 2700/4500 219b and the level 1 is much more stable than the E21A one tested above. Level 1 per-LED brightness is visually the same as my 219b 3500k single channel D4v2 on level 1. On stock firmware lower levels flicker a bit too so this firmware is great on this 219b 2-ch light that I have.

Sorry for not having a github link, but here’s a zip with the patches:

Interesting. Is your single-channel light Linear + FET or the old 7135 + FET? If Linear, how many amps?

I would suspect that my firmware should be substantially dimmer than even a single-channel Linear + FET.

It is a 9A linear + FET driver on that 219b 3500K. I used my own firmware but it was based on the latest Anduril2 rev 650 and I didn’t change the moonlight part of code. On my E21A tint ramping D4v2 it is indeed substantially dimmer though.
May I ask on what rev of Anduril2 your patches are based? Thanks.

It was downloaded on 1/7/2022; sorry I don’t have the revision number.

Based on the date downloaded it could be rev 642. I’ve created a gist to make reading the change more easily:

I haven’t got time to check your modification though. Thanks for sharing the code.

I tested this with my two tint ramp lights.

  • D4V2 with 219B 2700k and 219B 4500k I could not get level 1 to light up on either channel.
  • D4V2 with E21A 2000k and E21A 3500k I could get the 2000k channel to light up (very faintly, almost too low to be useful), and the 3500k failed to stay on.

However I think there is an advantage in the new level 2 (vs. level 1 stock).

Looking at the code that seems to be entirely down to adjustments to the PWM levels.

How did you generate these? It looks like the entire ramp has been adjusted. I would like to include this into my builds, but I think I’ll just include the adjusted level 2 as the new level 1.

There’s a bunch of adjustments to make the DEV SLEEP mode, but for level 2 yes it’s mostly just adjustments to the PWM level plus some other small changes.

I regenerated the levels using the levels.py script in the repo

Thanks! Are the other small changes you refer to the changes to `fsm-ramping.c`?

Yup that sounds right!

Does this work on single channel 9amp cc linear driver d4v2?

Theoretically it should, but it’s not compiled for a single-channel light; you’d have the make the modifications on your own and re-compile.

I noticed something else weird and interesting when I flashed this to my D2: the lowest moonlight (that puts the controller to standby) still lights up the white emitter (519A 5700K) like I’d expect, but at the same level the red (SST-20 660nm) fades out completely over a second or two. Notably, my DW4 with the same emitters doesn’t do this and the lowest mode for red works fine. If anyone has made a fork that stores the brightness limits separately for each channel, I might use that as the base of a workaround.