Ed Nisley's Blog: Shop notes, electronics, firmware, machinery, 3D printing, laser cuttery, and curiosities. Contents: 100% human thinking, 0% AI slop.
Category: Software
General-purpose computers doing something specific
Contemporary vacuum cleaner dust brush heads have bristles in some combination of [long | short] with [flexy | stiff]. The long + flexy combination results in the bristles jamming the inlet and the short + stiff combo seems unsuited for complex surfaces. Shaking the Amazonian dice brought a different combination:
Vacuum cleaner dust brush assortment – with adapters
That’s the new one on the bottom and, contrary to what you might think from the picture, it is not identical to the one just above it.
In particular, the black plastic housing came from a different mold (the seam lines are now top-and-bottom) and required a new adapter for the Kenmore Progressive vacuum cleaner’s complicated wand / hose inlet, with a 3/4 inch PVC pipe reinforcement inside.
Early reports indicate it works fine, so I’ll declare a temporary victory in the war on entropy.
The NYS DOT has been improving the pedestrian crossings at the Burnett – Rt 55 intersection. I expect this will be a bullet item in their Complete Streets compliance document, with favorable job reviews for all parties. The situation for bicyclists using the intersection, which provides the only access from Poughkeepsie to the Dutchess Rail Trail, hasn’t changed in the slightest. No signal timing adjustments, no bike-capable sensor loops, no lane markings, no shoulders, no nothing.
Here’s what NYS DOT’s Complete Streets program looks like from our perspective, with the four-digit frame numbers ticking along at 60 frame/sec.
We’re waiting on Overocker Rd for Burnett traffic to clear enough to cross three lanes from a cold start:
Burnett Signal – 2020-09-25 – front 0006
That building over there across Burnett is the NYS DOT Region 8 Headquarters, so we’re not in the hinterlands where nobody ever goes.
About 1.5 seconds later, the vehicles have started moving and we’re lining up for the left side of the right-hand lane:
Burnett Signal – 2020-09-25 – front 0752
There’s no traffic behind us, so we can ride a little more to the right than we usually do, in the hopes of triggering the signal’s unmarked sensor loop:
Burnett Signal – 2020-09-25 – front 1178
We didn’t expect anything different:
Burnett Signal – 2020-09-25 – front 1333
We’re rolling at about 12 mph and it’s unreasonable to expect us to jam to a stop whenever the signal turns yellow. Oh, did you notice the truck parked in the sidewalk over on the left?
As usual, 4.3 seconds later, the Burnett signals turn red, so we’re now riding in the “intersection clearing” delay:
One second later, we’re still proceeding through the intersection, clearing the lethally smooth manhole cover by a few inches, and approaching the far side:
Burnett Signal – 2020-09-25 – front 1771
Here’s what the intersection looks like behind me:
Burnett Signal – 2020-09-25 – rear 1
Another second goes by and we’re pretty much into the far right lane , with the westbound traffic beginning to move:
Burnett Signal – 2020-09-25 – front 1831
The pedestrian crossing ladder has fresh new paint. They milled off the old paint while reconstructing the crossing, so the scarred asphalt will deteriorate into potholes after a few freeze-thaw cycles. Not their problem, it seems.
Although it’s been three seconds since Rt 55 got a green signal, the eastbound drivers remain stunned by our presence:
Burnett Signal – 2020-09-25 – rear 2
After another second, we’re almost where we need to be:
Burnett Signal – 2020-09-25 – front 1891
There’s a new concrete sidewalk on the right, with a wheelchair-accessible signal button I can now hit with my elbow when we’re headed in the other direction. It’s worth noting there is no way to reach Overocker by bicycle, other than riding the sidewalk; there’s only one “complete” direction for vehicular cyclists.
One second later puts us as far to the right as we can get, given all the gravel / debris / deteriorated asphalt along the fog line near the curb:
Burnett Signal – 2020-09-25 – front 1957
Which is good, because four seconds after the green signal for Rt 55, the pack has overtaken us:
Burnett Signal – 2020-09-25 – rear 3
If you were the driver of the grayish car in the middle lane, directly behind the black one giving us plenty of room, you might be surprised at the abrupt lane change in front of you. Maybe not, because you had a front-row seat while we went through the intersection.
Elapsed time from the green signal on Burnett: 25 seconds. My point is that another few seconds of all-red intersection clearing time wouldn’t materially affect anybody’s day and would go a long way toward improving bicycle safety.
Unlike the pedestrian crossing upgrade, NYS DOT could fix this with zero capital expenditure: one engineer with keys to the control box, a screwdriver or keyboard (depending on the age of the controls), and the ability to do the right thing could fix it before lunch tomorrow.
As far as I can tell, Raspberry Pi cases are a solved problem, so 3D printing an intricate widget to stick a Pi on the back of an HQ camera seems unnecessary unless you really, really like solid modeling, which, admittedly, can be a thing. All you really need is a simple adapter between the camera PCB and the case of your choice:
The plate has recesses to put the screw heads below the surface. I used nylon screws, but it doesn’t really matter.
The case has all the right openings, slots in the bottom for a pair of screws, and costs six bucks. A pair of M3 brass inserts epoxied into the plate capture the screws:
RPi HQ Camera – case adapter plate – screws
Thick washers punched from an old credit card go under the screws to compensate for the case’s silicone bump feet. I suppose Doing the Right Thing would involve 3D printed spacers matching the cross-shaped case cutouts.
Not everyone agrees with my choice of retina-burn orange PETG:
RPi HQ Camera – 16 mm lens – case adapter plate
Yes, that’s a C-mount TV lens lurking in the background, about which more later.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Applesauce is completely optional. Should you prefer a softer & sweeter loaf, give it a try.
Conversely, reduce the sugar by about half if you’ve accustomed yourself to a keto-oid diet; the raisins carry enough sweetness for us. You can use brown sugar if you like.
However, it’s worth noting my original, butt-ugly Az-El mounts lasted for all of those nine years, admittedly with adjustments along the way, which is far more than the commercial mountsmaking me unhappy enough to scratch my itch.
Scaling it down for a 10 mm polypropylene ball around the base of the 30 mm inspection mirror’s shaft simplified everything:
Helmet Mirror Ball Mount – drilled ball test
I’m reasonably sure I couldn’t have bought 100 polypro balls for eight bucks a decade ago, but we’ll never know. Drilling the hole was a complete botch job, about which more later. The shaft came from a spare mirror mount I made up a while ago; a new shaft appears below.
The solid model, like Gaul, is in three parts divided:
Helmet Mirror Ball Mount – Slic3r
The helmet plate (on the right) has a slight indent more-or-less matching the helmet curvature and gets a layer of good double-stick foam tape. The clamp base (on the left) has a pair of brass inserts epoxied into matching recesses below the M3 clearance holes:
Helmet Mirror Ball Mount – inserts
A layer of epoxy then sticks the helmet plate in place, with the inserts providing positive alignment:
Helmet Mirror Ball Mount – plates
The clamp screws pull the inserts against the plastic in the clamp base, so they can’t pull out or through, and the plates give the epoxy enough bonding surface that (I’m pretty sure) they won’t ever come apart.
I turned down a 2 mm brass insert to fit inside the butt end of the mirror shaft and topped it off with a random screw harvested from a dead hard drive:
Helmet Mirror Ball Mount – assembled – rear view
At the start, it wasn’t obvious the shaft would stay stuck in the ball, so I figured making it impossible to pull out would eliminate the need to find it by the side of the road. As things turned out, the clamp exerts enough force to ensure the shaft ain’t goin’ nowhere, so I’ll plug future shafts with epoxy.
The front side of the clamp looks downright sleek:
Helmet Mirror Ball Mount – assembled – front view
Well, how about “chunky”?
The weird gray-black highlights are optical effects from clear / natural PETG, rather than embedded grunge; it looks better in person. I should have used retina-burn orange or stylin’ black.
This mount is much smaller than the old one and should, in the event of a crash, not cause much injury. Based on how the running light clamp fractures, I expect the clamp will simply tear out of the base on impact. In the last decade, neither of us has crashed, so I don’t know what the old mount would do.
The clamp is 7 mm thick (front-to-back), set by the M3 washer diameter, with 1.5 mm of ball sticking out on each side. The model has a kerf one thread high (0.25 mm) between the pieces to add clamping force and, with the screws tightened down, moving the ball requires a disturbingly large effort. I added a touch of rosin and that ball straight-up won’t move, which probably means the shaft will bend upon droppage; I have several spare mirrors in stock.
On the other paw, the ball turns smoothly in the clamp and it’s easy to position the shaft as needed: much better than the old Az-El mount!
The inspection mirror hangs from a double ball joint which arrives with a crappy screw + nut. I epoxied the old mirror mount nut in place, but this time around I drilled the plates for a 3 mm stainless SHCS, used a wave washer for a bit of flexible force, and topped it off with a nyloc nut:
Helmet Mirror Ball Mount – mirror joint
I’m unhappy with how it looks and don’t like how the washer hangs in free space between those bumps, so I may eventually turn little brass fittings to even things out. It’s either that or more epoxy.
So far, though, it’s working pretty well and both units meet customer requirements.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The LM3909 IC boosted a single 1.5 V cell enough to fire a red(-ish) LED, even with the cell well under 1 V. I want to blink a blue(-ish) LED from a pair of AA alkaline cells (with the right size & heft to serve as a base for the hairball circuitry), so the voltage ranges from just over 3 V down to maybe 1.5 V. Although the original circuit works, the LED pulse is long enough to put a reverse bias on the timing capacitor; a 470 µF electrolytic cap (positive terminal on the right at node P2-OUT) produces a pulse every few seconds.
A slightly tweaked version of the circuitry puts -400 mV across C1 (green trace) by the end of the pulse:
Discrete LM3909 – basic circuit – 3.0 V simulation
The App Note describes the negative feedback loop from the collector of “power transistor” Q3 through Q4 and Q1, closing through the Q2 current mirror. The base-emitter drops of Q4 and Q1 set the trip point where Q1 starts to conduct and the LED turns on.
Q3 is on when the LED is on, with C1 reverse-charging through R1 and the LED. The voltage at the top of R2 rises from the negative voltage at the start of the pulse, carrying the emitter of Q1 along with it. The LED pulse will end when the rising emitter voltage shuts off Q1 and, thus, the Q2 current mirror driving Q3. Because Q3 holds the bottom of R5 close to 0 V, the base of Q4 is at about half the supply voltage, so Q1 remains on until its emitter rises to about 2 forward drops (handwavingly ignoring the R6 + R7 voltage divider) below the supply.
If the LED pulse is longer than required to completely discharge C1, the poor cap gets reverse-biased and suffers indigestion. Aluminum electrolytics can withstand a little reverse bias, but it’s Bad Practice.
When Q3 and the LED are off, C1 forward-charges through (R4 + R5) + R2, with most of the initial voltage across R2, because C1 should start with a little more than 0 V across it. This holds the current mirror off until C1 charges enough to raise the base of Q4 about two forward drops above Q1’s emitter, shove current through Q4 and Q1, turn on the Q2 current mirror, Q3, and light the LED.
Around and around it goes!
The worst case for reverse charge happens at higher supply (a.k.a. battery) voltages and higher LED currents. Reducing the reverse charge time requires more forward drop through Q4 + Q1 to soak up the higher voltage and lower the trip voltage at Q1’s emitter, which suggests putting another forward-biased junction in series.
Putting a diode in Q1’s base lead doesn’t produce much improvement:
Discrete LM3909 – Q1 B diode – 3.0 V
Perhaps because the 27 µA current at the trip point is so low the diode doesn’t actually have much forward drop; the simulation says 400 mV.
Putting the diode in the emitter runs the current mirror’s 5 mA through it:
Discrete LM3909 – Q1 E diode – 3.0 V
The overall period remains about 2 s, but the LED pulse = reverse charge time drops by a factor of two and the cap voltage bottoms out at 0 V, so that’s good.
A Darlington transistor provides far more gain to compensate for the reduced base drive:
Discrete LM3909 – Darl Q1 – 3.0 V
The LED pulse is slightly shorter and its current goes up a smidge, but the cap voltage remains above zero.
A line in the LM3909 App Note mentions that the Q2 current mirror amplifies Q1’s emitter current by a factor of three: “This current will be amplified by about 3 by Q2 and passed to the base of Q3”. An IC current mirror’s designer can scale its output by varying the collector area, but out here in the discrete world we must splice multiple transistors in parallel:
Discrete LM3909 – Darl Q1 3xQ2- 3.0 V
More base drive in Q3 doesn’t buy much, because it’s already pretty well saturated during the pulse, but the current goes up enough to push C1 slightly into reverse charge territory again. As far as I can tell, the factor-of-three gain was required to make up for the relatively poor performance of IC technology around 1970; things have definitely improved since then.
It’s worth mentioning that the actual circuitry (in particular, the LEDs!) will differ from the simulations, so the pretty plots are more along the lines of serving suggestions than actual predictions. Verily, a simulation can’t prove that a circuit will work, but can sometimes help show why it won’t.
All the LTSpice simulation files tucked into a GitHub Gist:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
LTSpice includes a bunch of LEDs I’ll never own, so finding a tabulation of their forward voltages helped match them against various LEDs on hand. The table was sorted by the forward voltage at the diode’s rated average current, which wasn’t helpful for my simple needs, so I re-sorted it on the Vf @ If = 20 mA column over on the right:
The currents come from plugging the various constants into the Schockley Diode Equation and turning the crank.
One could, of course, measure the constants for the diodes on hand to generate a proper Spice model, but that seems like a lot of work for what’s basically a blinking LED.