Archive for category Software

Streaming Media Player: OLED Weirdness

Of late, the OLED displays on two RPi 3 streaming players (the others are RPi 2) have occasionally gone blank, while the players continue to work fine. I checked the logs, swapped MicroSD cards, rebuilt the images, and generally screwed around, all to no avail. The SH1106 controller has a command containing a single bit to blank the display and, perhaps, an SPI data transfer error could shut it off.

This is much harder to explain:

Mirror-image OLED display

Mirror-image OLED display

There’s a hardware command to flip the display top-to-bottom, not left-to-right. The Luma OLED driver can rotate the display in 90° increments, but AFAICT not reflect it.

Yes, they’re networked, but, no, they’re not directly exposed to the Intertubes.

Changing streams had no effect. Shutting down and rebooting restored normal operation.

There’s been exactly one such failure so far, so I lack evidence.

I have no clue what’s going on.



LF DDS Sine Generator With 0.1 Hz Steps

Gutting the crystal tester program and grafting a simple joystick interface onto the corpse produces an LF sine wave generator with 0.10 Hz steps:

FG085 vs AD9850 DDS frequencies

FG085 vs AD9850 DDS frequencies

The FG085 function generator shows 60000 Hz and the AD9850 shows 60001.58 Hz, but they’re running at exactly the same frequency:

DDS 1.58 FG085 0.0

DDS 1.58 FG085 0.0

I trust the AD9850 readout, because I just finished zero-beating it against the GPS-locked 10 MHz frequency reference: it’s dead on. The scope’s frequency measurement is clearly out of its depth at this resolution.

The “user interface” doesn’t amount to much. The DDS starts at 60.000 kHz, as defined by a program constant. Push the joystick left-right to step by 0.1 Hz (actually, multiples of 0.0291 Hz, so either 0.087 or 0.116 Hz, whichever makes the answer come out closer to the next multiple of 0.1 Hz). Push it up-down to step by 1.0 Hz (insert similar handwaving here). Push the button inward to reset to 60.000 kHz.

The OLED displays the frequency (in big digits), the output of the log amplifier (which isn’t hooked up here) in dB (over 4 μV), the DDS clock oscillator temperature, and a few lines of static prompting. The camera shutter blanked the last line, which should read “Button = reset”.

There’s no amplitude adjustment, other than the DDS current-control twiddlepot and the buffer amp’s gain-setting jumpers, but I (think I can) gimmick up an adequate inductive kicker for the fake preamp antenna circuit.

Not much to look at, but now I can (manually) probe the frequency response of the 60 kHz preamp with sufficient resolution to figure out if / how the tuning fork resonator filter behaves.

The Arduino source code as a GitHub Gist:


Tour Easy Headset Wrench

The headset on my Tour Easy ‘bent worked its way loose, which led to a disturbing discovery: the headset wrench I made from a discarded flat wrench vanished with the shop tools donated to MakerSmiths.

Fortunately, we live in the future:

Tour Easy Headset Wrench - Slic3r preview

Tour Easy Headset Wrench – Slic3r preview

A thin plastic wrench is absolutely no good for torquing down the locknut, but that’s not what it’s for. Adjust the bearing race to the proper preload with this wrench, hold it in place, then torque the locknut with the BFW.

The OpenSCAD source code as a GitHub Gist:

Now, I’d like to say that was easy, but in actual point of fact …

First, I forgot to divide by cos(180/6) to convert the across-the-flats size to the diameter of OpenSCAD’s circumscribed hexagon-as-circle, which made the wrench uselessly small:

Tour Easy Headset Wrench - v1

Tour Easy Headset Wrench – v1

If you have a 28 mm nut with low torque requirements, though, I’ve got your back.

While I had the hood up, I slenderized the handle into a much shapelier figure:

Tour Easy Headset Wrench

Tour Easy Headset Wrench

Trotting off to the garage with a warm plastic wrench in hand, I discovered the blindingly obvious fact that the headset nuts have eight sides. On the upside, the number of sides became a parameter, so, should you happen to need a five-sided wrench (perhaps on Mars), you can have one.

So, yeah, it’s rapid prototyping in full effect:

Tour Easy Headset Wrench Iterations

Tour Easy Headset Wrench Iterations

Remember, kids, never design while distracted …

, ,


Tour Easy Daytime Running Light: Now with Chirality!

In the unlikely event our bikes need two running lights or, perhaps, a running light and a headlight, the solid model now builds mounts for the right side of the fairing, as before:

Fairing Flashlight Mount - Right side - solid model

Fairing Flashlight Mount – Right side – solid model

And for the left side:

Fairing Flashlight Mount - Left side - solid model

Fairing Flashlight Mount – Left side – solid model

Ahhh, chirality: love that word.

Those pix come from a cleaned-up version of the OpenSCAD code that finally gets the 3-axis rotations right, after a rip-and-replace rewrite to deliver the ball model with its origin in the center of the ball where it belonged and rotate the ring about its geometric center. Then the rotations become trivially easy and a slight hack job spits out a completely assembled model:

if (Component == "Complete") {
  mirror(TiltMirror) {
    translate([0,0,ClampOD/2]) {

However, putting the center of rotation directly over the center of the base plate means the ToeIn rotation shifts the bottom of the clamp ring along the X axis, where it can obstruct the mounting holes. Shifting the ring by a little bit:


… keeps the ring more-or-less centered on the top of the plate. That’s not quite the correct geometry, but it’s close enough for the small angles needed here.

Aiming the beam slightly higher makes a 400 lumen flashlight about as bright as any single LED in new car running lights:

Fairing Flashlight Mount - Mary approaching

Fairing Flashlight Mount – Mary approaching

You can just barely make out the snazzy new blue plate on the left side of the fairing.

A bike’s natural back-and-forth handlebar motion sweeps the beam across the lane, so I think there’s no real benefit from blinking.

The OpenSCAD source code as a GitHub Gist:

, ,


Tour Easy Daytime Running Light: Annotation

The flashlight mount need not be symmetric after applying all the rotations, so recording how it’s aimed and which end goes forward seemed appropriate:

Fairing Flashlight Mount - Mount Annotation

Fairing Flashlight Mount – Mount Annotation

Optionally, with rounded ends just for pretty:

Fairing Flashlight Mount - Mount Annotation - rounded

Fairing Flashlight Mount – Mount Annotation – rounded

Because the rounding comes from resized spheres, the plate gets a ridge along the top to (maybe) lock the nylon screws / wing nuts in place:

Fairing Flashlight Mount - Mount - rounded

Fairing Flashlight Mount – Mount – rounded

Or discourage them from turning, which would be OK, too. After the second tightening, they don’t seem to come loose, so this may be overthinking the problem.

All in all, they look pretty good in cyan PETG:

Fairing Flashlight Mount - rounded

Fairing Flashlight Mount – rounded

Believe it or not, that’s aimed so the top edge of the beam is roughly horizontal to keep the hot spot out of oncoming traffic. They’re plenty bright, even on the “low power” setting.

The flashlight mounting balls produce a decorative brim that ought to be useful for something:

Slotted ball on platform

Slotted ball on platform

Maybe earrings?

The OpenSCAD source code as a GitHub Gist:



Leave a comment

Tour Easy Daytime Running Light: Improved Ball Mount

The original ball around the flashlight consisted of two identical parts joined with 2 mm screws and brass inserts:

Flashlight Ball Mount - flattening fins

Flashlight Ball Mount – flattening fins

Providing enough space for the inserts made the ball bigger than it really ought be, so I designed a one-piece ball with “expansion joints” between the fingers:

Fairing Flashlight Mount - Finger Ball - solid model

Fairing Flashlight Mount – Finger Ball – solid model

Having Slic3r put a 3 mm brim around the bottom almost worked. Adding a little support flange, then building with a brim, kept each segment upright and the whole affair firmly anchored.

Fairing Flashlight Mount - Finger Ball - solid model - support fins

Fairing Flashlight Mount – Finger Ball – solid model – support fins

Those had to be part of the model, because I also wanted to anchor the perimeter threads to prevent upward warping. Worked great and cleanup was surprisingly easy: apply the flush cutter, introduce the ball to Mr Belt Sander, then rotate the ball around the flashlight wrapped with fine sandpaper to wear off the nubs.

The joints between the fingers provide enough flexibility to expand slightly around the flashlight body:

Flashlight Mount - finger ball

Flashlight Mount – finger ball

I made that one the same size as the original screw + insert balls to fit the original clamp, where it worked fine. The clamp ring applies enough pressure to the ball to secure the flashlight and prevent the ball from rotating unless you (well, I) apply more-than-incidental force.

Then I shrank the ball to the flashlight diameter + 10 mm (= 5 mm thick at the equator) and reduced the size of the clamp ring accordingly, which made the whole mount much more compact:

Flashlight Mount - LC40 - finger ball - side

Flashlight Mount – LC40 – finger ball – side

Here’s what the larger mount looks like in action:

The flashlights allegedly puts out 400 lumen in a fairly tight beam. The fairings produce a much larger and brighter glint in full sunlight than the flashlights, so I think they’re about the right brightness.

The OpenSCAD source code for the new ball as a GitHub Gist:

, ,


Torchiere Lamp Shade

A pair of torchiere lamps lit the living room for many, many years:

Torchiere Lamp Shade - original

Torchiere Lamp Shade – original

During their tenure, they’ve gone from 100 W incandescent bulbs to 100 W equivalent” CFL curlicues to 100 W equivalent” warm-white LED bulbs. The LEDs aren’t up to the brightness of the original incandescents, but you can get used to anything if you do it long enough.

After so many years,  the plastic shades / diffusers became brittle:

Torchiere Lamp Shade - original broken

Torchiere Lamp Shade – original broken

That’s after a bump, not a fall to the floor. So it goes.

Some casual searching didn’t turn up any likely replacements. The shade measures 14 inch = 355 mm across the top, far too large for the M2’s platform, but maybe a smaller shade in natural PETG would work just as well.

ACHTUNG! This is obviously inappropriate for the original incandescent bulbs and would be, IMO, marginal with CFL tubes. Works fine with LEDs. Your mileage may vary.

OpenSCAD to the rescue:

Torchiere Lamp Shade - section

Torchiere Lamp Shade – section

That’s a section down the middle. The top is 180 mm across, leaving 20 mm of general caution on the 200 mm width of the platform. The section above the sharply angled base is 90 mm tall to match the actual LED height, thereby putting them out of my line-of-sight even when standing across the room.

I ran off a short version, corrected the angles and sizes for a better fit, tweaked the thickness to fuse three parallel threads into a semitransparent shell, and …

Torchiere Lamp Shade - M2 platform

Torchiere Lamp Shade – M2 platform

Producing what looks like thin flowerpot required just shy of seven hours of print time, as it’s almost entirely perimeter, goin’ down slow for best appearance. The weird gold tone comes from the interaction of camera flash with warm-white CFL can lights over the desk.

If you hadn’t met the original, you’d say the new shade grew there:

Torchiere Lamp Shade - no epoxy

Torchiere Lamp Shade – no epoxy

It’s definitely a Brutalist design, not even attempting to hide its 3D printed origin and glorying in those simple geometric facets.

Those three threads of natural PETG makes a reasonably transparent plate, clear enough that the bulb produced an eye-watering glare through the shade:

Torchiere Lamp Shade - no epoxy - lit

Torchiere Lamp Shade – no epoxy – lit

So I returned it to the Basement Laboratory, chucked it up in the lathe (where it barely clears the bed), dialed the slowest spindle speed (150 rpm according to the laser tach, faster than I’d prefer), and slathered a thin layer of white-tinted XTC-3D around the inside:

Torchiere Lamp Shade - lathe spinning

Torchiere Lamp Shade – lathe spinning

For lack of anything smarter, I mixed 2+ drops of Opaque White with 3.1 g of Part A (resin), added 1.3 g of Part B (Hardener), mixed vigorously, drooled the blob along the middle of the rotating shade, spread it across the width using the mixing stick, smoothed it into a thin layer with a scrap of waxed paper, and ignored it for a few hours.

If the lathe perspective looks a bit weird, it’s perfectly natural: I raised the tailstock end enough to make the lower side of the shade just about horizontal. Given the gooey nature of XTC-3D, it wasn’t going anywhere, but I didn’t want a slingout across the lathe bed.

The lit-up result isn’t photographically different from the previous picture, but in person the epoxy layer produces a much nicer diffused light and no glare.

I might be forced to preemptively replace the other shade, just for symmetry, but we’ll let this one age for a while before jumping to conclusions.

The OpenSCAD source code as a GitHub Gist:


, , ,