Tour Easy Running Lights: Mechanics

The running lights have the same general structure as before and fit into the same front and rear holders:

Tour Easy Running Light - rear installed
Tour Easy Running Light – rear installed

I made the recess slightly deeper to provide a bit more protection to the lens:

Tour Easy Running Light - front installed
Tour Easy Running Light – front installed

The lenses have a 10° beam angle, so a few more millimeters of sidewall doesn’t intercept much light.

The layout doodle grew a few more notes:

Tour Easy running light - housing dimensions
Tour Easy running light – housing dimensions

I had the good idea of boring the tube, knurling the rod, then epoxying the two together before cutting the rod:

Tour Easy Running Light - heatsink curing
Tour Easy Running Light – heatsink curing

Which let the lathe hold them in perfect alignment during curing:

Tour Easy Running Light - heatsink plug alignment
Tour Easy Running Light – heatsink plug alignment

The rod fits through the lathe spindle and I intended to use it as an arbor while turning the tube exterior, then cut the finished heatsink off flush.

Which really good idea lasted until the next morning, when I looked at the setup and immediately cut the rod flush with the tube. Because reasons, perhaps excess blood in my caffeine stream.

So I had to finish the heatsink on hard mode right up against the chuck:

Tour Easy Running Light - turning heatsink rebate
Tour Easy Running Light – turning heatsink rebate

Flipping it around and gripping that little rebate to skim the OD down to 25 mm seemed fraught with peril, so I stabilized the open end with a chuck and plenty of oil; the live center was just too big around for the job.

Dang, I hate it when I screw up a nice plan.

Then drill various holes on the Sherline and epoxy the circuit support plate:

Tour Easy Running Light - circuit plate curing
Tour Easy Running Light – circuit plate curing

After boring the PVC pipe to 23 mm ID, I made a pair of Delrin fixtures to simplify turning the exterior to 25 mm before parting it off:

Tour Easy Running Light - turning body OD
Tour Easy Running Light – turning body OD

The PVC is so thin the Arduino’s LEDs shine right through:

Tour Easy Running Light - installed top view
Tour Easy Running Light – installed top view

The radioactive green endcap is ordinary laser-cut fluorescent edge-lit acrylic with sunlight through the garage door on the left. I used red acrylic for the taillight to encourage their separate identities.

The knockoff Arduino Nano fits on one side of the support plate:

Tour Easy Running Light - Arduino view
Tour Easy Running Light – Arduino view

And the current regulator on the other:

Tour Easy Running Light - current regulator
Tour Easy Running Light – current regulator

Because these run from a dedicated 6.3 V step-down regulator, rather than the Bafang controller’s headlight output, the 2.0 Ω sense resistor sets the LED current to 0.8 V / 2.0 Ω = 400 mA, which is pretty close to the LED 1 W spec.

The white blob at the end of the two ribbon cable wires is the optoisolator pulling down a pin when the LIGHT signal is active, telling the firmware to stop the normal blink pattern and just turn the LED on all the time. This will come in handy if I ever do any night riding.

The LED is epoxied to the aluminum shell (with metal-filled JB Weld) and the whole affair never gets more than comfortably warm even with the LED running constantly.

I think they came out All Good™, despite various blunders along the way.

Tour Easy Running Lights: Same, But Different

Having just finished another set of daytime running lights, we once again have a matched pair of Tour Easy recumbents:

Tour Easy Running Light - two tail lights
Tour Easy Running Light – two tail lights

Although both ‘bents have Bafang 750 W motors with 48 V lithium batteries and both motor controllers have “light” outputs, they are different.

The controller on Mary’s bike (on the right) has a 6.3 V output that goes active when you press the 500C display’s + button for a few seconds. Those running lights simply use the light output for power, with a bit of tweakage to keep their current draw within the 500 mA limit.

The controller on my bike (on the left) has a 12 V output that goes active when I press-and-hold the headlight button on the DPC-18 display’s pad. Unlike the 500C, however, the DPC-18 dims its display when the lights are on, rendering it completely illegible in sunlight.

Because the running lights must operate with the headlight output inactive, a buck converter from a randomly named Amazon seller steps the 48 V battery down to 6.3 V. Note that the usual buck converters have a 36 V upper limit, so you want one with an LM2596HV regulator.

Because the regulator should be turned off when the motor controller is off, it must have a control input to enable / disable it; even if the regulator has the input pin, most boards don’t bring it out to a pad. The PCB I used has a SW input that must be low to enable the regulator, as shown in the middle doodle amid these scratches:

Tour Easy running light - buck converter SW control doodles
Tour Easy running light – buck converter SW control doodles

The SW pad on the PCB drives a voltage divider made from a 3.3 kΩ and a 10 kΩ resistor, with the regulator’s control (pin 5) looking at the junction. Running the numbers suggested a 220 kΩ resistor from the battery + terminal would provide enough current to hold the pin high, while not drawing more than a few hundred microamps, and a transistor could pull it low to turn the regulator on.

The DPC-18 display has a USB port to charge your phone on the go, so I hijacked that to get +5 V when the controller is turned on:

Tour Easy Running Light - Bafang DPC-18 USB plug
Tour Easy Running Light – Bafang DPC-18 USB plug

It’s a cut-down USB breakout board with two 24 AWG wires stripped from a ribbon cable soldered in place and coated with epoxy. The silicone port cover sticks out on the left; I eventually jammed it under the display panel in lieu of cutting it off.

Although I want the running lights on whenever the controller is on, It Would Be Nice™ to have a steady headlight / taillight in the unlikely event I ever ride after dark. With that in mind, the USB power pair joins another pair from the motor controller’s LIGHT connector (via a red 2-pin Juliet plug), so the firmware can tell when the headlights should be on, and the resulting 4-wire ribbon cable wanders off to the battery mounting plate:

Tour Easy running light - wire routing doodle
Tour Easy running light – wire routing doodle

The connectors along the way are 4-pin JST-SM 2.5 mm, which are most certainly not watertight. We’re fortunate in being able to not ride in the rain whenever we want, so the connectors won’t be exposed to water very often.

The battery mounting plate has an aluminum casting with a small compartment, probably intended for a complete e-bike controller, that just barely holds the hardware required to produce the 6.3 V supply:

Tour Easy Running Light - Bafang battery base circuitry - detail
Tour Easy Running Light – Bafang battery base circuitry – detail

Yes, those exposed battery terminals with soldered-on wires got a silicone tape wrap. No, there are no fuses involved. The two steel brackets holding the main power cable in place came pre-bent and pre-drilled in a random piece of scrap harvested from some dead equipment; they’re screwed into pre-tapped holes intended for the six TO-220 style power transistors of the missing motor driver.

The perfboard in the upper left holds an optoisolator for the USB power → SW input and a pair of resistors for the LIGHT signal to the headlight and taillight:

Tour Easy running light - control doodles
Tour Easy running light – control doodles

The optoisolators come from an ancient surplus deal; the bag I thought contained unmarked SFH615 parts apparently got mixed with some unmarked SFH6106 parts with the opposite transistor pinout.

The sketched trimpot in the lower right was on the buck regulator board, where it stood just an itsy too tall to fit the space available. Given that I would never adjust it, I set it for 6.3 V, removed it, measured the resistances, substituted fixed resistors, and the board should produce 6.3-ish V forevermore.

The regulator sits atop heatsink tape on a brass sheet with more heatsink tape isolating it from the housing and two nylon screws holding the stack in place.

With the various cables soldered in place:

Tour Easy Running Light - Bafang battery base circuitry - wired
Tour Easy Running Light – Bafang battery base circuitry – wired

The layout of all those cables:

Tour Easy running light - cable sections doodle
Tour Easy running light – cable sections doodle

Surprisingly, It Just Worked™:

Tour Easy Running Light - installed top view
Tour Easy Running Light – installed top view

More details to follow …

Gooseneck LED: First Failure

Twelve years ago I rebuilt a gooseneck lamp to carry a surplus LED head:

Finished LED Floodlight
Finished LED Floodlight

One of its three LEDs just failed:

LED Gooseneck lamp - first failure
LED Gooseneck lamp – first failure

Given that I very deliberately glued the whole thing together in the sure knowledge “the lamp should outlast me” and much later built the other LED head into a desk lamp, well, it’s like that and that’s the way it is.

The Sherline will be just a little bit dimmer in all those photos …

Mini-Lathe Chuck Stops: Better Next Time

The story so far:

Daubing urethane adhesive into each pocket, sliding a tiny magnet atop the goo, and flipping them over onto a sheet of plastic atop the surface plate to let them cure went about the way you’d expect. Given the state of my fingertips, however, I was not about to fiddle with the phone / camera / anything, but it really did happen.

The final result:

Lathe Chuck Stops - on-lathe storage
Lathe Chuck Stops – on-lathe storage

The alert reader will notice the slight gap under the left leg of the first orange stop, which provides a good introduction for a few things that should happen differently the next time I do something like this.

To my credit, I got all but one of the 54=3×6×3 magnets into their pockets in the same orientation. That’s gotta count for something and, hey, that orange stop sticks to the chuck just fine.

That one also suffered from my failure to switch the Axis UI to metric units before touching off the Z axis at 0.1 mm, thereby putting the Z=0.0 level 2.53 mm below the surface. Fortunately, the 3 mm MDF baseplate prevented that error from creating three pockets in the tooling plate, although it did produce holes instead of pockets in the stop.

I dropped the magnets into the thru-cut stop on the surface plate and dabbed some adhesive atop the magnets to bond them into their holes. This worked fine and led me to suspect the easiest way to make these stops would be to just laser-cut the holes and skip the whole CNC thing.

The disadvantage of cutting the holes through is that adhesive will inevitably ooze out around the magnet and mess up the bottom surface of the stop. Sticking both the stop and the magnets onto kapton tape seems like it should seal well, but liquid always finds a way.

In any event, the two-part urethane adhesive (JB Plastic Bonder) expands slightly as it cures, which is great for gap filling and not so good for precision bonding. With the pockets in the other 17 stops arranged open-side down, the magnets held themselves firmly to the plastic sheet atop the surface plate and the expanding urethane pushed the acrylic stop upward, leaving the magnets standing slightly proud of the stop’s surface:

Lathe Chuck Stops - protruding magnet
Lathe Chuck Stops – protruding magnet

Not by much, mind you, but not what I wanted, having painstakingly cut the pockets 2.2 mm deep for a 2.0 mm magnet.

Next time, dot some slow-cure clear pouring epoxy in each pocket, put the stop on the surface plate with the pocket facing up, then drop the magnet in place. The magnet pulls itself into the pocket, the epoxy doesn’t expand, any overflow will fill in over the magnet, and anything sticking out can be sanded off.

The fixtures worked well and aligned perfectly on the Sherline’s tooling plate. The 0.1 mm outset around the stops in the chipboard probably wasn’t needed, although the total repeatability seemed to be around 0.2 mm and pocket position errors are visible only on the smallest (red) stops:

Lathe Chuck Stops - misaligned pocket
Lathe Chuck Stops – misaligned pocket

All in all, this turned out pretty well. Next time will be even better!

And, perhaps, making the stops with 3D printing would be even better than that, at the cost of the usual gnarly surface finish.

Mini-Lathe Chuck Stops: CNC Pocketing

With the fixture aligned and the chuck stop blank clamped down, all that’s left is to make three little pockets:

Lathe Chuck Stop - Pocketing - LinuxCNC backplot
Lathe Chuck Stop – Pocketing – LinuxCNC backplot

Although Javascript may be the gom jabbar of programming, the blinding syntactic noise of raw G-Code puts you in a similar world of hurt:

#<chuckrad>=20.000                  (radius to center of magnet)
#<chuckjaws>=3                      (number of jaws)
#<chuckang>=[360.0/#<chuckjaws>]    (angle between jaws)

#<bitrad>=[2.900/2]                 (cutter radius)

#<pocketrad>=[4.100/2]              (magnet pocket radius)
#<pocketdeep>=2.200                 ( … depth)
#<xoffs>=[#<pocketrad>-#<bitrad>]   (pocket center to cutter center)

#<safez>=20.0                   (above all the clamps & gadgets)

G21 G54 G80 G90 G94             (metric!)

F600                            (full speed for the Sherline)

G0 Z#<safez>

Obviously, those magic numbers must match the laser-cut blanks, the magnets, the cutting bit in the spindle, the clamps on the table, the speed of the machine, and everything else you overlooked.

So. Much. Pain.

Knowing the angle to the current pocket, polar coordinate notation gets to the center point, with a jaunt in relative motion to the starting point for the helix into the pocket:

#<ang>=[#<chuckang>/2]          (set starting angle)
O100 REPEAT [#<chuckjaws>]

G0 @#<chuckrad> ^#<ang>         (to hole center)
G91                             (relative motion …)
G0 X#<xoffs>                    ( … to helix start …)
G90                             ( … and done)

G0 Z0                           ( to surface)

Each pocket consists of a helix cut to the bottom, two clearing passes, and another helix back to the surface:

G2 I[-#<xoffs>] Z[-#<pocketdeep>] P[1+FUP[#<pocketdeep>]]   (into hole)
G2 I[-#<xoffs>] P2                                          (clean bottom)
G3 I[-#<xoffs>] Z0 P[1+FUP[#<pocketdeep>]]                  (shave sides)

That dance produced rounder pockets with cleaner bottoms than just a single helix down and a straight pull upward.

Then set up for the next hole and clean up after the last one:

G0 @#<chuckrad> ^#<ang>         (back to center)
G0 Z#<safez>

#<ang>=[#<ang>+#<chuckang>]     (set up next hole)
O100 ENDREPEAT

G0 Z[2*#<safez>]
G0 X0 Y0

M2

I ran the Sherline XY axes at their 600 mm/min top speed, the spindle at 10 kRPM with a shiny new 3 mm (nominal!) cutter, ramped into the helix at ≅10° (on a 1 mm circle!), and it sliced the acrylic into nice chips without getting all melty.

Unlike with Javascript, when you get something wrong in G-Code, you can hear the crash.

The LinuxCNC pocketing code as a GitHub Gist:

(Magnet pockets for laser-cut lathe chuck stops)
(2023-07 Ed Nisley)
#<chuckrad>=20.000 (radius to center of magnet)
#<chuckjaws>=3 (number of jaws)
#<chuckang>=[360.0/#<chuckjaws>] (angle between jaws)
#<bitrad>=[2.900/2] (cutter radius)
#<pocketrad>=[4.100/2] (magnet pocket radius)
#<pocketdeep>=2.200 ( … depth)
#<xoffs>=[#<pocketrad>-#<bitrad>] (pocket center to cutter center)
#<safez>=20.0 (above all the clamps & gadgets)
G21 G54 G80 G90 G94 (metric!)
F600 (full speed for the Sherline)
G0 Z#<safez>
#<ang>=[#<chuckang>/2] (set starting angle)
O100 REPEAT [#<chuckjaws>]
G0 @#<chuckrad> ^#<ang> (to hole center)
G91 (relative motion …)
G0 X#<xoffs> ( … to helix start …)
G90 ( … and done)
G0 Z0 ( to surface)
G2 I[-#<xoffs>] Z[-#<pocketdeep>] P[1+FUP[#<pocketdeep>]] (into hole)
G2 I[-#<xoffs>] P2 (clean bottom)
G3 I[-#<xoffs>] Z0 P[1+FUP[#<pocketdeep>]] (shave sides)
G0 @#<chuckrad> ^#<ang> (back to center)
G0 Z#<safez>
#<ang>=[#<ang>+#<chuckang>] (set up next hole)
O100 ENDREPEAT
G0 Z[2*#<safez>]
G0 X0 Y0
M2

Mini-Lathe Chuck Stops: Pocketing Fixture

Putting pockets in the legs of the mini-lathe chuck stop blanks requires a fixture to align them in the Sherline mill:

Lathe Chuck Stops - pocketing setup
Lathe Chuck Stops – pocketing setup

Because it need not withstand much lateral force and will get used only a dozen-ish times, the base is MDF and the stop alignment happens in three matching chipboard layers:

Lathe Chuck Stops - Pocketing Fixture - LB layout
Lathe Chuck Stops – Pocketing Fixture – LB layout

The three stops (over on the right) are copy-pasta from the originals. A 0.1 mm outset in the chipboard (center) lets the acrylic shapes drop into the chipboard sheets with Good Enough™ alignment accuracy. The MDF layer (left) provides some overshoot comfort below the chipboard.

The chipboard layers each have four alignment targets at (±30,±20):

Lathe Chuck Stops - pocketing fixture touchoff
Lathe Chuck Stops – pocketing fixture touchoff

Touch off the lower-left target at (-30,-20) and G0 X30 Y30 should drop the laser dot in the middle of the upper-right target. With the (0,0) origin at the geometric center of the stop, LinuxCNC’s polar notation picks out the three pockets:

G0 @20 ^-60
G0 @20 ^180
G0 @20 ^60

The plywood disk under the Sherline’s clamp has a glued ring to put the clamping force out near the ends of the legs. I started with just the aluminum clamp, but the legs needed a bit more stability; a laser cutter makes impromptu widgets like that trivially easy.

Next: write the G-Code to make the pockets.

The LightBurn SVG layout as a GitHub Gist:

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Mini-lathe Chuck Stops

Having occasionally been in need of a lathe chuck stop, I finally cleared that project off the heap:

Lathe Chuck Stops - demo setup
Lathe Chuck Stops – demo setup

These are definitely not up to commercial standards, but also don’t cost fifty bucks each. A trio of 4×2 mm neodymium disk magnets stick the stop to the chuck (and to each other) with enough force to hold it there, but not enough to make removing it a hassle.

I imported the Z axis orthogonal view of the chuck jaws from the ball fixture for the running lights:

Lathe Chuck Jaws - solid model axial
Lathe Chuck Jaws – solid model axial

Trace the right-side jaw, clean it up, put the tip a known distance from the origin, make a circular array, and draw a comfort circle the size of the chuck OD.

The stop geometry comes from a hull wrapped around a circle a few millimeters larger than the 4 mm magnet (out 20 mm from the center) and a circle at the center sized so the hull clears the jaws:

Lathe Chuck Stops - LB layout
Lathe Chuck Stops – LB layout

Then a small circle at the center allows me to drop the stop atop a known coordinate and rotate it around the circle, because the XY coordinate center is not at the geometric center.

I cut out a few chipboard samples to verify the sizes, a few more from scrap acrylic to set up the pocketing operation, then half a dozen of each in cheerful kindergarten colors:

Lathe Chuck Stops - on-lathe storage
Lathe Chuck Stops – on-lathe storage

The 5 mm stop is obviously too fragile for commercial success, but I figured it’ll survive long enough around here. Worst case, I can make another handful as needed.

Although I have laser-engraved pockets in plywood, a few experiments in acrylic confirmed the surface finish is terrible and the depth control is iffy, at best. Given that I need a 2.2 mm deep pocket in 3 mm acrylic, a CNC mill seems the right way to poke the pockets:

Lathe Chuck Stops - pocketing setup
Lathe Chuck Stops – pocketing setup

More on that tomorrow.

The LightBurn SVG layout as a GitHub Gist:

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.