Thursday, June 19, 2014

Blackshadow flashlight mod


Now that my MELD drivers are up and running, I've decided it's unacceptable to have anything less than full functionality on every light, so I've been going through and modding everything to have RGBWUV. The Blackshadow Queen is one of my favorite hosts for its size/form factor and the reflector that throws better than anything else in my collection.

This mod uses MELD firmware so the UI matches my other lights, but because it runs on rechargeable cells only I used linear regulators instead of the full MELD driver. This also allows me to run much higher current on the white LED. 

To fit all the LEDs in the reflector aperture, I have my MELD LED boards, including this XP variant. They are FR4 though, so it wasn't going to have good enough thermal conductivity for my main emitter. To solve this, I came up with this PCB sandwich arrangement. 


The first step was to slice the PCB to make it thinner. The epoxy that holds the fiberglass layers together weakens when it's hot, so I set up the heat gun to get this bare PCB really hot and then sliced the top layer off with a blade. 


Next I cut out the space for the white XP-sized part until it fit perfectly over an XP-L. After the hole was cut, I reflowed the red, green, blue, and UV emitters on to their pads. 


I then reflowed an XP-L onto a star (this happened to be a weird star that included spots for other components, I only chose it because I wanted a thicker-than-standard star). The thin PCB holding the colors was then epoxied down around the XP-L using Arctic Silver. This picture is during the electrical test after epoxy.


On to the host: I disassembled everything, including punching the brass ring out and separating it from the stock driver. 


I reuse the the daughter board that holds 6 AMC7135 regulators for my white LED. For connections and mechanics, I reuse the main PCB, but all the components need to be stripped off first. The only one I left was the tantalum input capacitor.


I wired up the LED board using 30AWG for colors and 24AWG for the white. All the solder connections need to be made as low-profile as possible, and then they are covered in kapton tape to prevent shorting against the reflector.


I then put the LED board into the head using thermal grease. There's enough trimmed off of the star to allow it to move around a bit to get perfect centering. 


Here's what it looks like after the reflector and lens are assembled. It was a bit tough to center--I had to push on the back of the star through one of the wiring holes to hold it in place as I tightened down the reflector. After a few attempts I hit the center.


On to the driver. The board in the center of this picture is cut out of a PCB I salvaged from the scrap bin--the only thing it holds is the microcontroller (PIC16F1825) and a decoupling capacitor. The only reason I used it was to save me from making connections directly to the QFN-16 part. Ideally I'd use a SOIC part for this, but I didn't have any on hand at the time. The part on the right side is a 6-pin 50mil pitch female connector, which is used for programming and so is connected to the ICSP points on the microcontroller.

The stock daughter board holds 6 regulators and is used to drive the white LED. Branching off of that I have 4 more AMC7135s for each of the colors, wired independently. These are wired free-form, but they have their grounds soldered to a fairly thick ground wire which keeps them mechanically stable.


At this point I programmed the microcontroller so I could do full hardware tests as soon as the LEDs were wired. This required a simple harness to adapt the 1x5 0.1 header on the PICkit3 to the 2x3 0.05 header in the driver. The female connector is epoxied flush in a hole cut into the main PCB.


Here's a picture of all the electronics wired up, undergoing final electrical test. Before I stuffed everything into the cavity, I wrapped all the exposed parts in kapton tape to prevent shorts.


Here's what the head looks like after the board is pressed in. The programming connector came out pretty clean, and it does't interfere with the batteries since they only contact the outer ring.


Here's a final shot of all the emitters turned on at minimum. The UV isn't on; it appears green because of a neat refraction effect in the XP-L dome. This light runs the same firmware as my MELD2 drivers, but with a few options that optimize it for linear drivers. There's a full video and description of the user interface in my post about the most recent MELD firmware update

Wednesday, June 18, 2014

MELD firmware update

Here's a video demonstrating version 2.9 of my MELD flashlight software. A lot of improvements and features were added since the last video I put up. Below is a complete description of the UI and features.





·         All modes:
o    Turn on and off by short click
o    Mode memory in all cases (restore last mode after turning off and on)
o    Ramping by holding switch while on
o    Ramping reverses direction when initiated if it has been less than 3 seconds since the last ramp
o    Smart momentary from off (short click latches on, long press is momentary)
o    Shortcut to primary level from on by double click
§  If UV is enabled, a repeated double click will shortcut to UV. From UV, a double click will go back to primary
§  In UV mode, press and hold will make the UV strobe while held. May help to make fluorescing objects stand out
o    Shortcut to max by click-press
§  If level is currently max, shortcut to min instead
§  If primary level is set to max, shortcut to min instead
§  If held down for an extended time after click press, only do momentary maximum (restore previous brightness (or strobe/color mode) once switch is released)
§  Available from off as well (double click from off to latch on in max, click press from off to go to max in momentary mode)
o    If inactivity timer is enabled, jump to a low white level after 15 minutes of inactivity
§  Any press while in the timeout state restores the previous state
§  Works from any mode (including colors and strobes) except the two red safety flashers, the three color beacons, and any white strobes slower than 4Hz (since these modes are likely to be used long-term without user interaction)
o    State of light is stored in EEPROM and restored upon power up, enabling use in lights that have both a momentary switch and a power switch
·         White mode:
o    Ramping adjusts brightness on logarithmic profile
o    If dim to red is enabled, minimum level is replaced by dim red
o    Ramping pauses on min and max before reversing
·         Strobe mode:
o    Accessed by triple click
o    Ramping adjusts strobe speed continuously, ranging from 0.25-60Hz
o    Triple click while in strobe is a shortcut to stunner mode
·         Color mode:
o    Accessed by click-click-press
o    Continuous color mix:
§  Ramping gradually fades between colors so that any color on the spectrum can be chosen
§  Pauses on solid red, green, and blue to help select them
o    Low red: low brightness solid red output. Only available if dim to red is disabled
o    Stunner: randomized strobe that uses all colors
o    Auto fade: continuously fades through all possible color mixes
o    Flasher: triple-blink safety flasher using red
o    Flasher 2: higher-visibility safety flasher pattern using red
o    Red flash, green flash, blue flash: simple 0.5Hz beacons in three colors
o    Police: alternating blue and white to mimic police lights
o    Fire: simulates flickering firelight by calculating randomized output levels for a mix of red, green, and white
o    All low: turns on all four colors at minimum brightness so the LED can be observed directly
o    Lava lamp: a smooth-fading randomized output mode that provides interesting background lighting
o    Lightning: simulates lightning strikes using a mix of blue and white, with randomized time between strikes and randomized duration and brightness of strikes
·         Flourish mode:
o    A special color mode not included in the normal set
o    Activated by entering the color command (click-click-press) while already in a color mode
o    Performs a fun-looking sweep through colors that lasts about 2 seconds and returns to standby
o    Light is stuck in this mode once activated, exited by double click or click-press (shortcuts to white modes)
·         Configuration menu:
o    Accessed by quadruple-click
o    Set up options for light behavior. Click to cycle to next option, hold switch until green LED flashes to activate item
o    If all items are cycled through, the menu exits and returns to normal without taking any action
o    Item 1: beacon
§  Indicated by single short red blink
§  Enables or disables the locator beacon (flashes red every 4 seconds while in standby to help find the light in the dark)
o    Item 2: tactical
§  Indicated by single long blink
§  When activated, puts light into a momentary-only mode using whatever output (including strobes and color) was active before entering the config menu
§  Can only be disabled by power cycling the light
o    Item 3: lockout
§  Indicated by quick fade from bright to dim
§  When activated, the next time the light is turned off, it will be locked out. The light can then only be turned on by triple-clicking the switch.
§  Used to avoid accidental activation when the light is not in use but may have the switch bumped inadvertently
o    Item 4: auto dim
§  Indicated by white med > white low if currently disabled
§  Indicated by white low > white med if currently enabled (the light is showing what will happen if the menu item is activated—getting dimmer if you are about to turn on the feature, getting brighter if you are about to turn it off)
§  If enabled, the light will drop to a low white level after 15 minutes of inactivity
o    Item 5: set primary
§  Indicated by quick double blink on white (looks like the double click associated with the primary level)
§  When activated, the primary level is changed to the brightness level that was active before entering the config menu
§  Primary level is stored in EEPROM permanently until changed in config menu again
§  Primary can only be set to a white brightness, not color or strobe modes
o    Item 6: loaner mode
§  Indicated by a high-med-high-med-high pattern
§  When activated, the light is locked in its current mode and brightness (including colors and strobes), but smart momentary and latching on still function
§  Simplifies the UI to a single mode, useful for when the light needs to be lent to another user who doesn’t need other modes and doesn’t know how to use them
§  Disabled by power cycling
o    Item 7: dim to red
§  Indicated by a quick fading pattern from bright white down to low red
§  Enables or disables the dim to red feature
§  If dim to red is enabled, the low red color mode will be removed from the list
o    Item 8: powerup
§  Indicated by a quick fading pattern from dim to bright white
§  Enables or disables the feature to restore last mode upon power up
§  Should be enabled in lights with both a momentary switch and a power switch, but may be disabled in lights with momentary only if inadvertent power interruptions are expected
o    Item 9: set momentary max
§  Indicated by short blink then long blink on white (looks like the click-press associated with maximum)
§  When activated, any use of momentary (holding switch from off) will output maximum brightness instead of the last-used brightness or mode. Previous brightness or mode is still remembered
o    Item 10: burst mode
§  Indicated by high > medium-high > medium if currently disabled
§  Indicated by medium > medium-high > high if currently enabled (the light is showing what will happen if the menu item is activated—getting dimmer if you are about to turn on the feature, getting brighter if you are about to turn it off)
§  If activated, any time the light is turned on in white at a power level above 66% current, the output will gradually reduce output until it reaches 66% over the course of 10 seconds. This helps save power and is usually not noticeable to the user.
§  Does not affect use in momentary mode, only when latched on
o    Item 11: enable UV
§  Indicated by blue med > blue low if currently enabled
§  Indicated by blue low > blue med if currently disabled (the light is showing what will happen if the menu item is activated—getting dimmer if you are about to turn off the feature, getting brighter if you are about to turn it on)
§  Simply enables the UV mode. Included in the menu so that MELD can be used easily in lights without UV hardware by disabling the feature
o    Item 12: enable colors
§  Indicated by red > green > blue pattern
§  Enables or disables all color modes
§  If color modes are disabled, locator beacon and battery check mode will use only the white output
o    Item 13: high CRI
§  Indicated by turning on white, red, green, and blue together
§  An experimental operating mode that mixes in a small amount of red, green, and blue into the normal white operating mode. May improve color rendering
§  Only works well in lights with excellent color mixing
·         Battery check:
o    Accessed by click-click-click-press
o    Stays active and continuously updates measurement as long as switch is held
o    Measures battery voltage and reports it in blinks – blue blink for values and a long green blink for the decimal place
o    Examples:
§  Battery is 3.2V
§  Blue flashes three times
§  Green long flashes once
§  Blue flashes two times
§  2 second wait before repeating
§  Battery is 4.0V
§  Blue flashes four times
§  Green long flashes once

§  2 second wait before repeating

Custom camp knife


With all these tiny electronics projects going on, I had to take a break to do something with steel, power tools, and brute force. For many years I’ve used a Benchmade Nimravus as my wilderness knife, but a few things frustrated me about it: handle too large for my hands, uncomfortable thumb ramp, tip too steep, and semi serrated. I decided to make one from scratch to be exactly the way I wanted.


I started with sketches. The design borrows a lot from various knife designs that I like (including the Nimravus). I drew it 1:1 scale so I could hold my hand to the paper to design the handle to fit me. I went through a lot of iterations until it looked right. The final design has a 4” handle and a 4” blade, very wide flat grind, a fairly blunt tip, and slight concavity in the lower half of the blade. I was able to be pretty aggressive with finger notches in the handle since I knew it would fit my hand and didn’t need to be generic.

I wanted some parts to be recycled/repurposed materials, but I couldn’t find anything with dimensions that would work for my blade, so I bought 154CM steel. It will make a better knife in the end than a saw blade or file anyway. I wanted it to be indestructible since I will use it for heavy duty work like splitting logs, so I bought 0.125” thickness. I decided the handle scales at least should be recycled, and I found an old Pelican case to cut material from. I also used the stainless steel pivot pins as my handle pins.

When my steel arrived, I had to cut it to length since I bought it long enough for two. After wearing out two hacksaw blades trying to cut it and resorting to scoring and snapping, I figured the steel must have arrived already hardened. I was too excited to take the time to make a forge from concrete, so I just set up the outlet of my shop vac to blow into the bottom of my charcoal grill to do heat treat. It worked well enough to get the steel to critical temperature, then I let it air cool to soften.


I traced my design onto the blank and started roughing out the outline. I was very glad to have my angle grinder with a cutoff wheel for this, as it was still tough to cut with the hacksaw after softening. I either didn’t soften it enough, or 1/8th is just really thick, or both. After roughing, I spent a lot of time at the bench grinder setting the outline. After it matched my sketch, I spent a lot of time at this stage refining the handle profile since I could actually hold it. I also made slight tweaks to the blade edge shape.




I built a filing jig using a design I saw in a few places online. It holds a flat file at an exact angle through the whole process so you can make a precise grind. I didn’t bother to take measurements for the angle, I just played with it until it looked right. After the first filing session, I could tell it was going to take way too long to remove all the material by hand. To speed it up I went back to the bench grinder and very carefully did a rough grind to get a big portion of the material off quickly.


Even after that, the filing took forever. After the first couple hours I was getting worn out and had to stop. Later that night I went out and did a 20-minute filing session about once an hour for 3 or 4 cycles, and then the next day I finished the filing in one 2-hour session. Everything I read online says it should have taken less time, so I probably didn’t do the first heat treatment correctly. Towards the end I scribed some center lines along the edge so I could make corrections when I started grinding unevenly. Once the leading edge was down to 0.025” I decided the grind was done.





After that I set the edge using the same filing jig set to a steeper angle (eyeballed it again). I was really nervous about going too far and ruining the edge profile, so I left more than I probably should have before the final heat treat. It wasn’t really an issue though, since it was such a small amount of material to remove after hardening. The last step before heat treat was to drill holes for the handle pins. At this step too I was reminded that I didn’t soften it enough when I broke a drill bit. I think the fact that I was able to drill at all means it was softened to some degree, though.'


For the hardening heat treatment I set up the grill forge again, and it was easier to work this time since I only needed to get half of the piece to critical temperature. I quenched the blade in a soda can full of used motor oil. The motor oil left the surface darkly stained, even after thorough cleaning. I was disappointed since I had decided to do the surface finishing after heat treat, but I loved the look of the dark coating. I sanded it slightly and then decided to just leave it as-is. You can still see file marks but it feels completely smooth, plus it’s probably better if I don’t need to worry about scratching it up when I use it. After heat treat I did the tempering step in the oven at 400°.

I used a hand saw to rough cut the handle scales to shape, then drilled the holes in them. The holes were drilled slightly undersized in both the steel and the scales, so everything held together pretty well even before glue. I applied epoxy to both sides and then clamped the whole thing together. After the epoxy had partially set, I cut off the excess on the pins and ground them flush, then put the whole thing in the vise to apply more even pressure and left it for a few hours.




I was really wishing I had a belt sander to do handle shaping; I ended up doing all the rough shaping with a rasp and the sanding drum on my Dremel. I did the finer detail for finger grooves with a half-round file, and then finished everything with sandpaper.



I had to go back to the filing jig to set the final edge, which wasn’t too bad. After that, I used a combination of diamond whetstone and carbide sharpener to get a rough edge before moving on to ceramic sticks. It took an edge nicely, we’ll see how well it holds up with use. Next up is making a kydex sheath, and I’m thinking about trying some dye on the handle since the color isn’t exactly what I wanted.