I put Andúril 2.0 on a Convoy M3

9 posts / 0 new
Last post
Streamtronics
Streamtronics's picture
Offline
Last seen: 7 hours 30 min ago
Joined: 01/02/2019 - 19:14
Posts: 61
Location: Germany
I put Andúril 2.0 on a Convoy M3

Hey guys, 

I just finished putting Andúril 2.0 on a Convoy M3 and wanted to share the process with you (even if not greatly detailed, if you have any questions feel free to ask).

But first, here's a video:

 

 

Andúril really lifts this ~$30 light to a whole new level!

 

The boost driver in it looks like this: 

 

I did some reverse engineering on the driver and all I had at hand was an ATtiny85, so I went with that. Without going into great detail, the drawback of this decision was, that the ATtiny85 only supports 8 bit PWM in hardware, which means 256 brightness levels. Sounds like enough, but really isn't, because we humans don't perceive light linearly but kinda logarithmic, which means especially in the lowest brightness settings there will be large, distinguishable steps in the otherwise beautiful smooth ramp. No good. Other flashlights like the Noctigon K1 solve this by simply using a larger MCU (ATtiny 1634, which also conveniently has enough pins for RGB aux LEDs!) which has a 16 bit timer/counter on board.

But I wanted to stick with the ATtiny85. So with a little food for thought from ToyKeeper herself, I got to work on modifying Andúril in a way to "fake" 10 bit PWM on an 8 bit capable MCU. Basically jumping back and forth between adjacent PWM values allows us to e.g. add two more bits of resolution by going through four "iterations" and jumping to the next higher PWM value between zero (0b00) and three (0b11) times out of the four iterations.So, for example if we wanted a brightness step right between value 130 and 131, we'd set the PWM value to 130 for two PWM cycles, then to 131 for two cycles, rinse, repeat. This is relatively easy to do with an interrupt that gets triggered every PWM cycle.

I actually put together a quick'n'dirty prototype with a button and LED to test my code on: 

 

Unfortunately, the pinout of the ATtiny85 didn't match the existing MCU so I had to become a bit creative on the hardware side, bending the poor ATtiny's pins either down or up depending on whether the function of the pin matched the existing pad or not. For the those pins bent upwards I used enameled copper wire, which I also used to temporarily attach a pin header in order to flash the MCU (I also added longer wires to the LED and an external switch for convenience):

 

Apart from some flavor tweaks I did in Andúril, I mostly had to make sure to invert one of the enable outputs since it was going to a p-channel MOSFET, which is "active low" and calculate calibration values for the battery voltage readout (also had to change a resistor in the voltage divider used for this).

The boost driver also is slow, it wasn't able to switch fast enough for the party strobe to be effective (didn't turn on at all with reasonable on-times). I suppose I could've changed something about that if I tried hard enough, but it wasn't really worth it, so I just threw party strobe out of the rotation.

The remaining tactical strobe works fine up to a certain frequency. I'm quite annoyed I didn't catch this before re-assembling the light, but the output basically just vanishes if the strobe frequency is too high. If I ever decide to re-flash this MCU I'll make sure to limit the strobing frequency to reasonable values, too. 

 

I hope this was somewhat interesting for at least one or two people on here, who disliked the simple UI of the M3 (especially the lack of soft-lockout and voltage readout) just as much as I did.

 

Take care! 

Simon

Edited by: Streamtronics on 10/17/2020 - 19:47
Blahblahblahhuh
Offline
Last seen: 1 hour 17 min ago
Joined: 10/08/2020 - 17:27
Posts: 70

Wow. This is awesome thanks for the vid.

I hope to get to this level of modding one day. Great job!

NeutralFan
NeutralFan's picture
Offline
Last seen: 4 days 3 hours ago
Joined: 03/20/2014 - 19:22
Posts: 1110
Location: Wisconsin, USA

Nice mod Streamtronics! That’s a lot of tiny wires soldered to the driver – impressive.

I’d rather use my flashlight around the house than turn on the lights.

Quadrupel
Quadrupel's picture
Offline
Last seen: 6 hours 45 min ago
Joined: 12/03/2017 - 10:40
Posts: 345
Location: Lithuania

Wow! Looks like historical event! You made first Anduril boost driver ! Thumbs Up
This mod can become very popular if you share more details.

bilakos10
bilakos10's picture
Offline
Last seen: 7 hours 17 min ago
Joined: 08/22/2013 - 14:25
Posts: 1419
Location: ~ Earth

Wow very cool mod! The M3 is a great light and having anduril running on it makes it even greater!

Streamtronics
Streamtronics's picture
Offline
Last seen: 7 hours 30 min ago
Joined: 01/02/2019 - 19:14
Posts: 61
Location: Germany

The light reports relatively high temperatures now even if only lukewarm on the outside, probably due to the boost IC heating up the driver quite a bit. Not quite sure how to improve that. There was a sad looking thermal pad just stuck to the boost chip, but not contacting the flashlight body due to the LED and switch wires above the driver, and also too small size. And even if it did contact the body, it's so thick it might not make a huge difference. But the chip has overtemperature protection so it'll shut off if it's getting too hot anyway instead of just dying. 

 

Quadrupel wrote:
Wow! Looks like historical event! You made first Anduril boost driver ! Thumbs Up This mod can become very popular if you share more details.

Well I mean it definitely isn't the first Andúril boost driver, the Noctigon K1 with XHP35 HI has one, too - and I'm sure there's a bunch more. The principle is almost the same for Noctigon's constant current drivers, too. Those only use a single 10 bit PWM channel as well (or they might add a second direct drive channel, not sure if that's just the same channel). Basically I made a frankenstein out of the Andúril hardware definition file of the K1 12V (due to how it only uses a single 10 bit PWM channel) and the FW3A (due to that one using an ATtiny85). 

 

You're right, I probably should share more information, but it's very tedious to e.g. draw a proper circuit diagram of the driver. But if anyone reads this thread maybe even in a year or something and is interested in also modding the M3, don't hesitate to ask ^^ Now that I know how to do it I probably wouldn't mind doing that mod for someone else either.

Although, I've heard there will be a new M3 version soon anyway, with improved UI and USB charging... let's hope it at least gets a lockout and a way to decrease brightness without having to veeery slooowly cycle through the highest modes like the original firmware does. 

Focusnik
Offline
Last seen: 2 days 11 hours ago
Joined: 10/26/2020 - 13:30
Posts: 1

Hello Friend
can you share the firmware for the convoy m3?

1stein
1stein's picture
Online
Last seen: 7 min 35 sec ago
Joined: 12/24/2017 - 16:25
Posts: 770
Location: Poland

Ow man, I was reading it like the lecture of (RIP) Steven Hawking about black holes.
Every third word was understandable to me. Huge respect for your knowledge and skills.

Streamtronics
Streamtronics's picture
Offline
Last seen: 7 hours 30 min ago
Joined: 01/02/2019 - 19:14
Posts: 61
Location: Germany

Focusnik wrote:
Hello Friend can you share the firmware for the convoy m3?

I can share the hex file and pinout for the MCU later this week if that's what you want. However you'll still have to get the ATtiny85 on there in the first place (pinouts don't match, it's a PIC-style pinout) and also modify the voltage divider for the battery voltage indicator to work right. I'm not sure how to share the source code and if it'll be compatible with future updates and how to merge with future code etc... 

 

An ATtiny412 would be perfect for this but frankly I had no idea they existed. Somehow I assumed I'd need to use a PIC to get this pinout. Now I'm kinda annoyed I didn't just order some of those ATtiny412 and did "the right thing" of porting Andúril to it. The 412 also has 16 bit PWM natively btw. 

 

1stein wrote:
Ow man, I was reading it like the lecture of (RIP) Steven Hawking about black holes. Every third word was understandable to me. Huge respect for your knowledge and skills.

Thanks, but it's nowhere near that complicated ^^ Once you actually know how the firmware works and how the microcontroller is structured, it's just a little tweaking. Kinda like adding some spice to a frozen dinner. But then calling ToyKeeper's work a frozen dinner would be quite the insult. So let's say I added chocolate chips to some already perfectly balanced and well thought-out cake.