The Smell of Molten Projects in the Morning

Ed Nisley's Blog: Shop notes, electronics, firmware, machinery, 3D printing, laser cuttery, and curiosities. Contents: 100% human thinking, 0% AI slop.

Tag: Improvements

Making the world a better place, one piece at a time

  • Amber 1 Watt LED: MP1584 Hackery

    Amber 1 Watt LED: MP1584 Hackery

    The PCB wrapping a buck regulator around an MP1584 chip uses a tiny trimpot to set the output voltage:

    MP1584 buck regulator PCB
    MP1584 buck regulator PCB

    The 01D resistors use the EIA-96 identifier series and are 100 kΩ.

    Based on simpleminded testing, a 1 W amber LED drops about 2.5 V at 430 mA. A 1 Ω ballast resistor drops another half volt and burns a quarter of a watt, sufficient to cover some LED forward drop variation.

    The trimpot is entirely too twitchy, so I replaced it with an SMD resistor:

    Amber 1W LED - fixed voltage SMD
    Amber 1W LED – fixed voltage SMD

    The trimpot read 26.5 kΩ after I extracted it, but I surely nudged it a smidgen in the process.

    For the record (first column is SMD topmark, second is measured resistance):

    • 3012 = 29.9 kΩ (!!) → 3.67 V into a 100 Ω resistor
    • 2492 = 24.9 kΩ → 3.19 V : 2.63 V @ 550 mA = 1.45 W
    • 2362 = 22.6 kΩ → 2.97 V : 2.52 V @ 450 mA = 1.13 W
    • 223 = 22.0 kΩ → 2.91 V : 2.484 V @ 425 mA = 1.06 W

    With 6.3 V @ 210 mA = 1.3 W from the bench regulator, the resistor now burns 180 mW at 425 mA and the LED burns 82% of the input power.

    Letting it cook overnight settled out with the LED at 2.47 V and 440 mA = 1.09 W, with 6.3 V at 220 mA = 1.4 W from the bench supply. The LED dissipates 78% of the input power and the resistor burns 190 mW = 14%, so the regulator uses 120 mW = 8%.

    I can come close to the final output voltage by plugging the new resistor value and the 8.2 kΩ resistor (on the PCB) into the MP1584 datasheet equations, but figuring the resistor to get a specific output voltage seems largely empirical.

  • Amber 1 Watt LED: First Light

    Amber 1 Watt LED: First Light

    After the rather disappointing results of the truck side marker LED light, this seems more promising:

    Amber 1W LED - test heatsink
    Amber 1W LED – test heatsink

    The 1 watt amber LED is soldered to an aluminum heat spreader stuck to a scrap heatsink with thermally conductive tape. The PCB is a buck converter build around an MP1584 regulator. The lens on the left claims a 5° beam angle, which seems aspirational at best.

    Not counting the heatsink, you’re looking at less than three bucks of parts; living in the future is great.

    Fitting the lens over the LED produces a shatteringly bright beam, at least in the Basement Laboratory:

    Amber 1W LED - lens test
    Amber 1W LED – lens test

    The lens has a conical cavity surrounding the LED lens to capture the light and redirect it to the beam forming reflector. It’s done with total internal reflection, there are no coatings, and it’s a wonder to behold: one-shot molded aspheric optics at work.

    Not seating the lens firmly against the LED produces a dark spot in the middle of the beam. I soldered the leads directly to the LED and cut out the sides of the black lens holder, as soldering them to the convenient side pads would prevent the lens from seating properly.

    The LED drops about 2.5 V at 430 mA (1.08 W). The bench supply delivered 6.3 V at 190 mA (1.2 W) to simulate the headlight output of the Bafang motor controller.

    The headlight output is good for 6-ish V and 3 W = 500-ish mA, so burning half the power in a simple dropping resistor or linear current regulator is a Bad Idea™. You can get constant current LED drivers, but apparently not with 6 V input and 1 W output, so stepping the voltage down makes more sense. You’d want at least a little ballast resistor in there to soak up small forward drop changes with temperature variations.

    The regulator can handle up to 28 V input and the tiny trimpot must cover nearly that range of output voltages, so the 2.5 V output jams it near the minimum end of its rotation (which is, of course, backwards). This calls for a fixed resistor to eliminate the effects of vibration on a trimpot at 10% of its range.

  • Amber Side Marker Light Hackery

    Amber Side Marker Light Hackery

    Start with the amber side marker light sporting a cataract and distorted beam:

    Side Marker - beam test - E
    Side Marker – beam test – E

    Part off the lens:

    Side Marker E - cutting case
    Side Marker E – cutting case

    The cut is just in front of the PCB and went slowly to avoid clobbering the SMD resistors very near the edge.

    The cataract turned out to be crud adhered to the LED lens:

    Side Marker E - LED cataract
    Side Marker E – LED cataract

    Brutal surgery removed the LED and installed a replacement:

    Side Marker E - replacement LED
    Side Marker E – replacement LED

    The PCB had two 150 Ω SMD resistors for use with 12-ish V automotive batteries. While I had the hood up, I removed one and shorted across its pads to make the LED work with the 6 V switched headlight supply from the Bafang motor.

    In round numbers, 6 V minus 2.2 V forward drop divided by 150 Ω is about 25 mA. The original LED ran at 35-ish mA, but it’s close enough.

    Glue the lens back in place:

    Side Marker E - clamping case
    Side Marker E – clamping case

    The bubbly stuff is solid epoxy from the original assembly, which is why removing the PCB is not an option.

    The new LED is no more off-center than any of the others:

    Side Marker E - new LED - front
    Side Marker E – new LED – front

    It does, however, sit much closer to the lens, due to the ring of plastic I cut away to get inside. As a result, the beam is mostly a single centered lobe with only hints of the five side lobes; there isn’t much waste light from the side of the LED into those facets.

    Replace the one I originally put in the new fairing mount:

    Side Marker E rebuilt - installed
    Side Marker E rebuilt – installed

    However, it’s still not much more than a glowworm in the daytime, so we need more firepower …

  • Bafang Charger Cord Anchor

    Bafang Charger Cord Anchor

    The Bafang battery charger uses an AC line cord “binocular” connector with what must be the weakest spring contacts ever made, which finally annoyed me enough to fix:

    Bafang charger - AC line cord anchor
    Bafang charger – AC line cord anchor

    Also, the case now sports four thick fuzzy felt feet to keep it from sliding around quite so easily.

    Another customer-does-the-last-ten-percent product …

  • Bafang BBS02: Improved Motor Reaction Spacer

    Bafang BBS02: Improved Motor Reaction Spacer

    The original BBS02 reaction spacer for Gee’s Terry Symmetry didn’t work quite the way I expected:

    Bafang BBS02 - reaction block displacement
    Bafang BBS02 – reaction block displacement

    The motor evidently vibrates enough to propel the block forward, shearing the double-sticky foam tape which was never intended to resist force in that plane. I thought the block was located at the point where the motor casing was tangent to the frame tube, so as to equalize the forces in both directions, but … nope.

    A revised design based on measurements informed by new knowledge:

    Terry - Bafang motor spacer - improved - solid model
    Terry – Bafang motor spacer – improved – solid model

    The upper curve is now symmetric and the whole block mounts more rearward under the bottom bracket lug, where some tedious work with a machinists square located the real tangent point:

    Bafang BBS02 - reaction block improvement
    Bafang BBS02 – reaction block improvement

    The motor sure doesn’t look like it’s tangent, but a dry fit showed all the curves laid against the case and tubes.

    The brazing fillet means the step fitting the downtube can’t sit snug against the edge of the lug, but most of the reaction force should go through the section into the lug, near the center of the block.

    A crude marker will keep track of any motion:

    Bafang BBS02 - reaction block marker
    Bafang BBS02 – reaction block marker

    I think the symmetric curve against the motor has enough projection to keep the block from wandering off, even if I haven’t gotten the location exactly right.

    Stipulated: Hope is not a strategy.

    The OpenSCAD source code:

    MotorOD = 111;              // motor frame dia
    MotorOffset = 10.0;         // motor OD tangent wrt lug edge
    ShiftSpace = 6.0;           // motor to frame space
    
    LugLength = 25.0;           // length of section over BB lug
    
    Spacer = [5.0 + LugLength,DownTube[ID]/2,4*ShiftSpace];
    SpaceAngle = 0*atan(1.8/Spacer.x);            // tilt due to non-right-angle meeting
    echo(str("Spacer angle: ",SpaceAngle));
    
    module MotorSpacer() {
    
        difference() {
            translate([LugLength - Spacer.x/2,0,0])
               cube(Spacer,center=true);
            translate([0,0,DownTube[ID]/2])
                rotate([0,90 + SpaceAngle,0]) rotate(180/FrameSides)
                    cylinder(d=DownTube[ID],h=DownTube[LENGTH],$fn=FrameSides,center=true);
            translate([DownTube[LENGTH]/2,0,DownTube[ID]/2 - DownTube[LENGTH]*sin(SpaceAngle)/2])       // concentric with ID
                rotate([0,90 + SpaceAngle,0]) rotate(180/FrameSides)
                    cylinder(d=DownTube[OD],h=DownTube[LENGTH],$fn=FrameSides,center=true);
            translate([MotorOffset,0,-(MotorOD/2 + ShiftSpace)])
                rotate([90,0,0]) rotate(180/48)
                    cylinder(d=MotorOD,h=2*Spacer.y,$fn=48,center=true);
        }
    
    }
    

    Nothing like actual riding to reveal what needs more thought!

  • Seedling Shelter Frame Deployment

    Seedling Shelter Frame Deployment

    Mary bound up a mesh cover for the shelter frame and deployed it to protect some yummy seedlings:

    Seedling Mesh Shelter - installed
    Seedling Mesh Shelter – installed

    Those will become the next round of lunchtime sandwiches:

    Turkey Sandwich with Excessive Lettuce
    Turkey Sandwich with Excessive Lettuce

    It’s a quarter-pounder: 4 oz of turkey, 4 oz of lettuce, and a layer of Swiss and good stinky Provolone cheese. Yum!

  • Tour Easy: Amber Running Light

    Tour Easy: Amber Running Light

    Having seen a few bikes with amber “headlights” and being desirous of reducing the number of batteries on Mary’s bike, this seems like an obvious first step:

    Fairing Mounted Side Marker - First Light
    Fairing Mounted Side Marker – First Light

    It descends from the fairing flashlight mount with an entry to suit a 15 mm truck side marker body:

    LightBodies = [
      ["AnkerLC90",26.6,48.0],
      ["AnkerLC40",26.6,55.0],
      ["J5TactV2",25.0,30.0],
      ["InnovaX5",22.0,55.0],
      ["Sidemarker",15.0,20.0],
      ["Laser",10.0,30.0],
    ];
    

    The rest of the code gets a few cleanups you’d expect when you compile code untouched for a few years using the latest OpenSCAD.

    The markers are allegedly DOT rated, which matters not for my use case: SAEP2PCDOT.

    The mount is grossly overqualified for a wide-beam light with little need for aiming:

    Fairing Mounted Side Marker - test light
    Fairing Mounted Side Marker – test light

    Eventually, the marker should slip into a prealigned cylindrical holder, with a dab of epoxy to keep it there.

    The lights are a buck apiece, so there’s no reason to form a deep emotional attachment. They are the usual poorly molded and badly assembled crap, although the next step up from a nominally reputable supplier is a factor of five more expensive.

    It’s generated for the left side of the fairing, although I think having a pair of them would improve conspicuity:

    Fairing Mounted Side Marker - installed
    Fairing Mounted Side Marker – installed

    Being automotive, it runs from a 12 V supply, which comes from a boost converter driven by the Bafang 6 V headlight output. The absurdity of bucking a 48 V lithium battery to a 6V switched headlight output, then boosting it to 12 V to drive a single amber LED with a 1.5 V forward drop does not escape me.

    It’s possible to slice the lens off (using a lathe), remove / replace the resistor, then glue it back together, which would be worthwhile if you were intending to drive it from, say, an Arduino-ish microcontroller to get a unique blink pattern.

    Given the overall lack of build quality, it might make more sense to slap a condenser lens in front of a Piranha LED.

    Bonus: contrary to what you (well, I) might expect, the black lead is positive and the white lead is negative.