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.

Category: Electronics Workbench

Electrical & Electronic gadgets

  • Kenmore Model 158 Speed Control: Carbon Disk Replacement

    The speed control pedal on Mary’s sewing machine once again started racing away from a dead stop, which we now know means more disks inside the carbon pile rheostat have disintegrated. It looked pretty much the same as when I took it apart in 2009:

    Rheostat graphite wafers and contacts
    Rheostat graphite wafers and contacts

    This time, it had one cracked wafer and several thin ones, reducing the length of the stacks so much that the pedal exerted very little force (thus, not starting the motor) before the shorting contacts caused a runaway.

    Back then, I’d machined two brass disks to fill the empty space:

    Rheostat with brass spacer button
    Rheostat with brass spacer button

    A rough measurement showed I’d have to double their thickness to about 7 mm each, but it seemed like replacing high-resistance carbon with low-resistance brass wasn’t a Good Idea, at least when taken to an extreme. Not knowing what would count as an extreme in this situation, I decided to replace the brass disks with graphite cylinders sized to fill up the empty space.

    The Little Box o’ Machinable Graphite produced a small bar, from which I sliced a square with jeweler’s pull saw:

    Machineable Graphic - rough-sawn slab
    Machineable Graphic – rough-sawn slab

    Cutting that in half, then one of the bars in half, produced a pair of cubes:

    Machineable Graphic - cubes
    Machineable Graphic – cubes

    I tried sanding off the corners:

    Machineable Graphic - sanded cube
    Machineable Graphic – sanded cube

    After it became painfully obvious that process would take just slightly less than forever, I deployed the Dremel sanding drum:

    Machineable Graphic - cylinders
    Machineable Graphic – cylinders

    Much to my surprise, the shop vacuum didn’t quite inhale the cloth, I didn’t drop either of the cylinders into its gaping maw or sand away my fingertips, and the cylinders emerged more-or-less good looking. I sanded the faces reasonably smooth and parallel, removed a few high spots left by the Dremel, and the cylinders slid neatly into the holes in the ceramic rheostat.

    I felt a definite kinship with those guys in the rackets (not squash, as I once knew) court under the stadium seats…

    I put the cylinders at the end of the stacks, against the graphite buttons (shown in the top picture), and left the disks to settle themselves against the brass contacts. In retrospect, I should have put the cylinders against the brass, so that the inevitable erosion will chew on the (relatively) easily replaced bulk cylinders.

    Each graphite cylinder displaced six disks, so now I have some spares for next time. I’m certain that the graphite has lower resistance than the equivalent length of disks, but it’s probably higher than the same length of brass. I was not going to slice those cylinders into disks.

    After vigorous and repeated handwashing with gritty cleaner after leaving the Basement Laboratory Workshop, the pedal assembly went back together smoothly and, once again, operates the way it should: controllable smooth low speeds, crazy-fast high speeds, and a steady transition between the two. Mary has resumed quilting up a storm.

    That shop vacuum may never forgive me, but it totally eliminated all the carbon dust from the work area. The filter started out coated with a generous layer of dust and crud, so I’m pretty sure it collected most of the very fine dust, too.

    I briefly considered using the lathe, but came to my senses.

    The cheap way to do AC motor speed control involves a triac chopping the sine wave, so as to produce all manner of hash above and beyond the usual motor commutation noise. It occurs to me that the sewing machine has a universal motor that would run just as happily on 120 V DC as it does on AC, so a cheap 120 V DC supply (around 2 A should suffice) from the usual eBay supplier and a high voltage MOSFET on a generous heatsink would work even better. One might even get by with just a full-wave rectifier bridge and pulsating DC.

    The rheostat doesn’t dissipate more than a few watts, I think, so thermal management should not pose a serious problem.

    The motor rating says it’s good for 1 A, which means the power should be less than a few tens of watts. Some resistance and current measurements are in order.

    You can actually buy replacement pedals, but what’s the fun in that?

  • Sewing Machine Bulb: LED Replacement Doodle

    Mary wants more light directly around the needle of her Kenmore Model 158 sewing machine, as the existing light (a 120 V 15 W incandescent bulb tucked inside the end housing) casts more of a diffuse glow than a directed beam:

    Kenmore Model 158 Sewing Machine - lamp
    Kenmore Model 158 Sewing Machine – lamp

    The end cap fits snugly around the bulb, but I thought a pair of 10 mm white LEDs, mounted side-by-side and aimed downward at the cover plate, would work. Of course, plugging a pair of white LEDs into a 120 VAC socket won’t work, but some judicious rewiring and a new 12 V DC wall wart will take care of that.

    The bulb has a dual-contact bayonet base, with both pins isolated from the shell and connected to the non-polarized (!) line cord through the power switch. I didn’t know it was called a BA15d base, but now I do.

    A 12 V automotive brake/taillight bulb (type 1157, I think) pulled from the Big Box o’ Bulbs has a slightly different pin arrangement that keys the filaments (which are not isolated from the shell) to the surrounding reflector:

    BA15d Bayonet Bulb Bases - 120V vs. 12V pins
    BA15d Bayonet Bulb Bases – 120V vs. 12V pins

    So I conjured a mockup to see if it would fit, using 2-56 screws to mimic whatever hardware might be practical:

    BA15d Bulb - LED Adapter
    BA15d Bulb – LED Adapter

    The solid model shows how it all fits together:

    Sears Lamp LED Adapter - Show view
    Sears Lamp LED Adapter – Show view

    The two tiny ruby-red pins represent filament snippets in alignment holes, barely visible in real life:

    LED holder parts
    LED holder parts

    I glued those pieces together, using a tiny machinist’s square as a jig to keep them perpendicular:

    LED holder clamping
    LED holder clamping

    Some random 10 mm LEDs served for testing:

    BA15d Bulb - 10 mm LEDs
    BA15d Bulb – 10 mm LEDs

    It actually fit pretty well, ignoring the fact that the LEDs point 90° from the intended direction (so I could see how the holes came out inside the pivot, honest), and lit up the area quite well, but it’s such a delicate affair that removing the entire socket and replacing it with a dedicated metal bracket / heatsink for two high-power SMD LEDs will be better.

    The OpenSCAD source code:

    // Adapter for LEDs in Sears sewing machine lamp socket
    // Ed Nisley - KE4ZNU - January 2014
    
    Layout = "Show";		// Build Show LEDTab LEDPlate ShellMount
    
    //- Extrusion parameters must match reality!
    //  Print with 2 shells and 3 solid layers
    
    ThreadThick = 0.20;
    ThreadWidth = 0.40;
    
    HoleWindage = 0.2;			// extra clearance
    
    Protrusion = 0.1;			// make holes end cleanly
    Gap = 2.0;					// spacing between Show parts
    
    AlignPinOD = 1.70;			// assembly alignment pins: filament dia
    
    inch = 25.4;
    
    //----------------------
    // Dimensions
    
    //-- LED mounting plate
    
    LEDDia = 10.0;				// LED case OD
    LEDFlangeOD = 10.7;
    
    LEDPlateThick = 2.0;		// mounting plate thickness
    LEDMargin = 2.0;
    
    LEDSpaceOC = LEDDia + LEDMargin;		// LED center-to-center distance (single margin between!)
    
    LEDTabLength = 15.0;		// base to screw hole center
    
    LEDTabThick = 4.0;			// tab with hole for mounting screw
    LEDTabScrewOD = 2.0;
    LEDTabWidth = (3.0*2) + LEDTabScrewOD;
    
    LEDMountHeight = 25.0;		// estimated mounting screw centerline to bottom of LEDs
    
    //-- Lamp base adapter
    //		hard inch dimensions!
    
    ShellOD = 0.600 * inch;				// dia of metallic shell
    ShellOAL = 0.66 * inch;				//  ... total length
    ShellInsert = 7/16 * inch;			//  ... length engaging socket
    
    ShellSides = 4*4;
    
    BulbOD = 0.75 * inch;				// glass bulb
    BulbLength = 1.14 * inch;
    
    InsulOD = 0.485 * inch;				// insulating stub around contact pins
    InsulThick = 0.070 * inch;			//  ... beyond end of shell
    
    ContactOD = 2.0;					// contact holes through base (not heads)
    ContactOC = 0.300 * inch;			//  ... center-to-center spacing
    
    BayonetOD = 0.080 * inch;			// bayonet pin diameter
    BayonetOffset = 0.125 * inch;		// from end of metal base
    
    LampOAL = InsulThick + ShellOAL + BulbLength;
    echo(str("Overall Length: ",LampOAL));
    
    //-- Miscellany
    
    //----------------------
    // Useful routines
    
    module PolyCyl(Dia,Height,ForceSides=0) {			// based on nophead's polyholes
    
      Sides = (ForceSides != 0) ? ForceSides : (ceil(Dia) + 2);
    
      FixDia = Dia / cos(180/Sides);
    
      cylinder(r=(FixDia + HoleWindage)/2,
               h=Height,
               $fn=Sides);
    }
    
    module ShowPegGrid(Space = 10.0,Size = 1.0) {
    
      Range = floor(50 / Space);
    
    	for (x=[-Range:Range])
    	  for (y=[-Range:Range])
    		translate([x*Space,y*Space,Size/2])
    		  %cube(Size,center=true);
    }
    
    //-- Tab for screw mounting LED holder
    //		AddLength remains below Z=0 for good union
    
    module LEDTab() {
    
    	difference() {
    		linear_extrude(height=LEDTabThick)
    			hull() {
    				circle(d=LEDTabWidth);
    				translate([LEDTabLength/2,0,0])
    					square([LEDTabLength,LEDTabWidth],center=true);
    			}
    		translate([0,0,-Protrusion])
    			rotate(180/6)
    				PolyCyl(LEDTabScrewOD,(LEDTabThick + 2*Protrusion),6);
    		for (i=[-1,1])
    			translate([LEDTabLength/2,i*LEDTabWidth/4,LEDTabThick/2])
    				rotate([0,90,0]) rotate(180/4)
    					PolyCyl(AlignPinOD,(LEDTabLength/2 + Protrusion),4);
    	}
    }
    
    //-- Plate holding LEDs
    
    module LEDPlate() {
    
    	difference() {
    		union() {
    			linear_extrude(height=LEDPlateThick)
    				hull() {
    					for (i=[-1,1])
    						translate([i*LEDSpaceOC/2,0,0])
    							circle(d=(LEDDia + 2*LEDMargin));
    					translate([0,(LEDFlangeOD/2 + LEDTabWidth/2),0])
    						square([LEDTabThick,LEDTabWidth],center=true);
    				}
    		}
    		for (i=[-1,1])
    			translate([i*LEDSpaceOC/2,0,-Protrusion])
    				rotate(180/12)
    					PolyCyl(LEDDia,(LEDPlateThick + 2*Protrusion),12);
    		for (i=[-1,1])
    			translate([0,(i*LEDTabWidth/4 + LEDFlangeOD/2 + LEDTabWidth/2),3*ThreadThick]) rotate(180/4)
    				PolyCyl(AlignPinOD,(LEDTabLength/2 + Protrusion),4);
    
    	}
    }
    
    //-- Bulb shell mounting adapter
    
    module ShellMount() {
    
    	difference() {
    		union() {
    			cylinder(r1=InsulOD/2,r2=ShellOD/2,h=(InsulThick + Protrusion),$fn=ShellSides);
    			translate([0,0,InsulThick])
    				cylinder(r=ShellOD/2,h=(LampOAL - LEDMountHeight + LEDTabWidth/2),$fn=ShellSides);
    		}
    
    		translate([0,ShellOD,(InsulThick + BayonetOffset)])		// bayonet pin hole
    			rotate([90,0,0]) rotate(180/4)
    				PolyCyl(BayonetOD,2*ShellOD,4);
    
    		translate([0,ShellOD,(InsulThick + LampOAL - LEDMountHeight)])		// LED mount screw hole
    			rotate([90,0,0])
    				PolyCyl(LEDTabScrewOD,2*BulbOD,6);
    
    		translate([0,0,(InsulThick + ShellOAL + LampOAL/2)])		// slot for LEDTab mount
    			cube([2*ShellOD,(LEDTabThick + 2*Protrusion),LampOAL],center=true);
    
    		for (i=[-1,1])											// contact pin holes
    			translate([i*ContactOC/2,0,-Protrusion])
    				rotate(180/6)
    					PolyCyl(ContactOD,2*LampOAL,6);
    	}
    
    }
    
    //- Build it
    
    ShowPegGrid();
    
    if (Layout == "LEDTab")
    	LEDTab();
    
    if (Layout == "LEDPlate")
    	LEDPlate();
    
    if (Layout == "ShellMount")
    	ShellMount();
    
    if (Layout == "Show") {
    	LEDPlate();
    	translate([-LEDTabThick/2,(LEDFlangeOD/2 + LEDTabWidth/2),(LEDTabLength + LEDPlateThick + Gap)])
    		rotate([0,90,0])
    			LEDTab();
    	for (i=[-1,1])
    #	translate([0,(i*LEDTabWidth/4 + LEDFlangeOD/2 + LEDTabWidth/2),(LEDPlateThick + Gap/4)])
    		rotate(180/4)
    		cylinder(r=AlignPinOD/2,h=Gap/1,$fn=4);		// fake the pins
    
    	translate([0,(LEDFlangeOD/2 + LEDTabWidth/2),(LampOAL - LEDTabWidth/2)])
    		rotate([0,180,0]) rotate(90)
    			ShellMount();
    }
    
    if (Layout == "Build") {
    	translate([0,LEDDia,0])
    		LEDPlate();
    
    	translate([-10,-(LEDMargin + LEDTabWidth),0])
    		rotate(-90)
    			LEDTab();
    
    	translate([10,-(LEDMargin + LEDTabWidth),0])
    		ShellMount();
    }
    

    The original doodles for the bulb dimensions and adapter layout:

    Bulb dimensions - adapter doodles
    Bulb dimensions – adapter doodles
  • NP-BX1 Lithium-ion Batteries: Sony vs. Wasabi

    With this NP-BX1 battery test fixture in hand:

    Sony NP-BX1 battery holder
    Sony NP-BX1 battery holder

    The discharge tests run at 250 mA, which is probably a bit low, as the HDR-AS30V camera can capture video for about two hours on a single battery. Given the Sony’s nominal 1.24 A·h (love that precision!) capacity and derating the Wasabi’s ambitious 1.6 A·h, two hours suggests a current around 500 mA would be more appropriate, but we’ll go with a lower current for now.

    Oddly, the two Wasabi batteries (green & blue traces) outperform the Sony OEM battery (red and purple) in terms of voltage:

    Sony NP-BX1 - OEM Wasabi - 2014-01-28
    Sony NP-BX1 – OEM Wasabi – 2014-01-28

    I can’t explain the small kink just before the big dropoff for both Wasabi batteries. Perhaps the protection circuitry behind the battery terminals has a slight peculiarity?

    Looking at the total energy delivered, however:

    Sony NP-BX1 - OEM Wasabi - Wh - 2014-01-28
    Sony NP-BX1 – OEM Wasabi – Wh – 2014-01-28

    The Sony battery says it’ll deliver 4.5 W·h and actually produces 4.8 W·h. The Wasabi batteries claim 5.7 W·h and don’t even come close at 4.25 W·h.

    I cross-checked those results by importing the CSV data into a spreadsheet, computing the point-by-point power, finding the average, and then multiplying by the total test time in hours. Doing it a couple different ways says you can eyeball a reasonable value by multiplying the median voltage by the test current to get average wattage, then multiplying by the total test time to get W·h. That’s within a few percent, which is good enough for me.

    The camera’s power supply undoubtedly has a low-voltage cutoff, but it’s a single-cell battery and they might just run it down around 2.8 V; in that case, the Sony batteries will last longer. If the voltage cutout is 3.5 V, similar to the Canon camera, then the Wasabi batteries win.

    I don’t have enough experience with the camera or the batteries to predict anything based on actual use.

  • HRECOS Display: Forecast Calls For Continued Condensation

    They may have added a block heater since I took that picture, but warm moist air will always condense on cold metal and glass:

    HRECOS display - condensation
    HRECOS display – condensation

    It really needs a dehumidifier…

  • Sony NP-BX1 Battery Test Fixture

    The Sony HDR-AS30V “action camera” uses NP-BX1 lithium batteries (3.7 V @ 1.24 A·h = 4.6 W·h) that are, of course, a completely different size and shape than any other lithium battery on the planet.

    So.

    Tweaking a few dimensions in the Canon NB-6L source code, tinkering with the layout of the contact pins, and shazam Yet Another 3D Printed Battery Test Fixture:

    NP-BX1 Holder - show layout
    NP-BX1 Holder – show layout

    It builds nicely, although the contact pin tunnels are a bit too close to the top of the case:

    Sony NP-BX1 Holder - on platform
    Sony NP-BX1 Holder – on platform

    After reaming out the contact pin holes to the proper diameters & depths, then gluing the plugs in place, it works just as you’d expect:

    Sony NP-BX1 battery holder
    Sony NP-BX1 battery holder

    It’s worth noting that the Wasabi charger accepts the batteries upside-down, with the conspicuous chevron against the charger body. It’s definitely not the way all the other chargers work. The keying recesses on the battery (corresponding to the blocks in the solid model) lie along the bottom edge of the contact surface, so flipping the battery over means they’ll hold it in place, but … oh, well.

    That grotty Powerpole connector last saw use in some random benchtop lashup. At some point I’ll be forced to start making more of those.

    The OpenSCAD source code:

    // Holder for Sony NP-BX1 Li-Ion battery
    // Ed Nisley KE4ZNU January 2013
    
    include <MCAD/boxes.scad>
    
    // Layout options
    
    Layout = "Show";					//  Show Build Fit Case Lid Pins Plugs AlignPins
    
    //- Extrusion parameters - must match reality!
    //  Print with +2 shells and 3 solid layers
    
    ThreadThick = 0.20;
    ThreadWidth = 0.40;
    
    HoleWindage = 0.2;
    
    function IntegerMultiple(Size,Unit) = Unit * ceil(Size / Unit);
    
    Protrusion = 0.1;			// make holes end cleanly
    
    inch = 25.4;
    
    BuildOffset = 3.0;			// clearance for build layout
    
    Gap = 8.0;					// separation for Fit parts
    
    //- Battery dimensions - rationalized from several samples
    //  Coordinate origin at battery corner by contact plates on bottom surface
    
    BatteryLength = 43.0;
    BatteryWidth = 30.0;
    BatteryThick =  9.5;
    
    ContactWidth = 2.90;
    ContactLength = 4.30;
    ContactRecess = 0.90;
    
    ContactOC = 10.0;			// center-to-center across contact face
    ContactOffset = 6.20;		// offset from battery edge
    ContactHeight = 6.30;		// offset from battery bottom plane
    
    AlignThick = 2.75;			// alignment recesses on contact face
    AlignDepth = 1.70;			// into face
    AlignWidth1 = 3.70;			// across face at contacts
    AlignWidth2 = 3.60;			//  ... other edge
    
    //- Pin dimensions
    
    PinTipDia = 1.6;
    PinTipLength = 10.0;
    
    PinTaperLength = 2.3;
    
    PinShaftDia = 2.4;
    PinShaftLength = 6.8;
    
    PinFerruleDia = 3.1;
    PinFerruleLength = 2.0;
    
    PinLength = PinTipLength + PinTaperLength + PinShaftLength + PinFerruleLength;
    
    ExtendRelax = 1.5 + ContactRecess;		// pin extension when no battery is present
    ExtendOvertravel = 1.0;					//  ... beyond engaged position
    
    //- Spring dimensions
    
    SpringDia = 3.1;						// coil OD
    SpringMax = 9.3;
    SpringLength = SpringMax - 0.5;			// slightly compressed
    SpringMin = 4.5;
    
    SpringPlugOD = IntegerMultiple(5.0,ThreadWidth);		// plug retaining the spring
    SpringPlugID = 2.0;
    SpringPlugLength = IntegerMultiple(4.0,ThreadWidth);
    SpringPlugSides = 3*4;
    
    SpringTravel = ExtendRelax + ExtendOvertravel;
    
    //- Holder dimensions
    
    GuideRadius = ThreadWidth;			// friction fit ridges
    GuideOffset = 7;					// from compartment corners
    WallThick = 4*ThreadWidth;			// holder sidewalls
    
    BaseThick = 6*ThreadThick;			// bottom of holder to bottom of battery
    TopThick = 6*ThreadThick;			// top of battery to top of holder
    
    ThumbRadius = 10.0;			// thumb opening at end of battery
    
    CornerRadius = 3*ThreadThick;			// nice corner rounding
    
    CaseLength = SpringPlugLength + SpringLength + PinLength - ExtendRelax
    			+ BatteryLength + GuideRadius + WallThick;
    CaseWidth = 2*WallThick + 2*GuideRadius + BatteryWidth;
    CaseThick = BaseThick + BatteryThick + TopThick;
    
    AlignPinOD = 1.75;			// lid alignment pins - filament snippets
    AlignPinLength = 5.0;
    AlignPinInset = 7.0;
    AlignPinOffset = -3.75;		//  from centerline - choose to miss contact pins
    
    //- XY origin at front left battery corner, Z on platform below that
    
    CaseLengthOffset = -(SpringPlugLength + SpringLength + PinLength - ExtendRelax);
    CaseWidthOffset = -(WallThick + GuideRadius);
    CaseThickOffset = BaseThick;
    
    LidLength = ExtendRelax - CaseLengthOffset;
    
    echo(str("Contact pin tip dia: ",PinTipDia));
    echo(str("Drill depth to taper end: ",
    		 (SpringPlugLength + SpringLength + PinFerruleLength + PinShaftLength + PinTaperLength),
    		 " -- Dia: ",PinShaftDia));
    echo(str("            to ferrule end: ",
    		  (SpringPlugLength + SpringLength + PinFerruleLength),
    		 " -- Dia: ",PinFerruleDia));
    echo(str("            to plug end: ",SpringPlugLength,
    		 " -- Dia: ",SpringPlugOD));
    
    //----------------------
    // Useful routines
    
    module PolyCyl(Dia,Height,ForceSides=0) {			// based on nophead's polyholes
    
      Sides = (ForceSides != 0) ? ForceSides : (ceil(Dia) + 2);
    
      FixDia = Dia / cos(180/Sides);
    
      cylinder(r=(FixDia + HoleWindage)/2,
               h=Height,
    	   $fn=Sides);
    }
    
    module ShowPegGrid(Space = 10.0,Size = 1.0) {
    
      Range = floor(50 / Space);
    
    	for (x=[-Range:Range])
    	  for (y=[-Range:Range])
    		translate([x*Space,y*Space,Size/2])
    		  %cube(Size,center=true);
    
    }
    
    //-------------------
    
    //-- Guides for tighter friction fit
    
    module Guides() {
      	  translate([GuideOffset,-GuideRadius,CaseThickOffset])
    		PolyCyl(2*GuideRadius,(BatteryThick - Protrusion),4);
    	  translate([GuideOffset,(BatteryWidth + GuideRadius),CaseThickOffset])
    		PolyCyl(2*GuideRadius,(BatteryThick - Protrusion),4);
    	  translate([(BatteryLength - GuideOffset),-GuideRadius,CaseThickOffset])
    		PolyCyl(2*GuideRadius,(BatteryThick - Protrusion),4);
    	  translate([(BatteryLength - GuideOffset),(BatteryWidth + GuideRadius),CaseThickOffset])
    		PolyCyl(2*GuideRadius,(BatteryThick - Protrusion),4);
    	  translate([(BatteryLength + GuideRadius),GuideOffset/2,CaseThickOffset])
    		PolyCyl(2*GuideRadius,(BatteryThick - Protrusion),4);
    	  translate([(BatteryLength + GuideRadius),(BatteryWidth - GuideOffset/2),CaseThickOffset])
    		PolyCyl(2*GuideRadius,(BatteryThick - Protrusion),4);
    
    }
    
    //-- Contact pins (holes therefore)
    
    module PinShape() {
    
      union() {
    	cylinder(r=(PinTipDia + HoleWindage)/2,h=(PinTipLength + Protrusion),$fn=6);
    
    	translate([0,0,PinTipLength])
    	  cylinder(r=(PinShaftDia + HoleWindage)/2,
    			   h=(PinTaperLength + PinShaftLength + Protrusion),$fn=6);
    
    	translate([0,0,(PinLength - PinFerruleLength)])
    	  cylinder(r=(PinFerruleDia + HoleWindage)/2,
    				h=(PinFerruleLength + Protrusion),$fn=6);
    
    	translate([0,0,(PinLength)])
    	  cylinder(r=(SpringDia + HoleWindage)/2,
    				h=(SpringLength + Protrusion),$fn=6);
    
    	translate([0,0,(PinLength + SpringLength - HoleWindage)])	// windage for hole length
    	  cylinder(r=(SpringPlugOD + HoleWindage)/2,h=3*SpringPlugLength,$fn=SpringPlugSides);
    
    //	  translate([0,0,(PinLength + SpringLength + SpringPlugLength)])
    //	  cylinder(r=(SpringPlugOD + HoleWindage)/2,h=2*SpringPlugLength,$fn=SpringPlugSides);	// extend hole
      }
    
    }
    
    module PinAssembly() {
    
      translate([ExtendRelax,ContactOffset,CaseThickOffset + ContactHeight]) {
    	rotate([0,270,0]) {
    	  PinShape();												// pins
    	  translate([0,(1*ContactOC),0])
    		PinShape();
    	}
      }
    
    }
    
    //-- Alignment pins
    
    module AlignPins() {
    
    	for (x=[-1,1])
    		translate([x*(LidLength - 2*AlignPinInset)/2,AlignPinOffset,0])
    			rotate(45)
    			PolyCyl(AlignPinOD,AlignPinLength);
    }
    
    //-- Case with origin at battery corner
    
    module Case() {
    
      difference() {
    
    	union() {
    
    	  difference() {
    		translate([(CaseLength/2 + CaseLengthOffset),
    				  (CaseWidth/2 + CaseWidthOffset),
    				  (CaseThick/2)])
    		  roundedBox([CaseLength,CaseWidth,CaseThick],CornerRadius); 	// basic case shape
    
    		translate([-ExtendOvertravel,-GuideRadius,CaseThickOffset])
    		  cube([(BatteryLength + GuideRadius + ExtendOvertravel),
    				(BatteryWidth + 2* GuideRadius),
    				(BatteryThick + Protrusion)]);						// battery space
    
    	  }
    
    	  Guides();
    
    	  translate([-ExtendOvertravel,-GuideRadius,BaseThick])
    		cube([(AlignDepth + ExtendOvertravel),
    			  (AlignWidth1 + GuideRadius),
    			  AlignThick]);											// alignment blocks
    	  translate([-ExtendOvertravel,
    				 (BatteryWidth - AlignWidth2),
    				 BaseThick])
    		cube([(AlignDepth + ExtendOvertravel),
    			  (AlignWidth2 + GuideRadius),
    			  AlignThick]);
    
    	}
    
    	translate([(-ExtendOvertravel),
    			   (CaseWidthOffset - Protrusion),
    			   (CaseThickOffset + BatteryThick)])
    	  cube([CaseLength,
    		    (CaseWidth + 2*Protrusion),
    		    (TopThick + Protrusion)]);								// battery access
    
    	translate([(CaseLengthOffset - Protrusion),
    			   (CaseWidthOffset - Protrusion),
    			   (CaseThickOffset + BatteryThick)])
    	  cube([(CaseLength + 2*Protrusion),
    		    (CaseWidth + 2*Protrusion),
    		    (TopThick + Protrusion)]);								// battery insertion allowance
    
    	translate([(BatteryLength - Protrusion),
    			    (CaseWidth/2 + CaseWidthOffset),
    			    (CaseThickOffset + ThumbRadius)])
    	  rotate([90,0,0])
    		rotate([0,90,0])
    		  cylinder(r=ThumbRadius,
    				   h=(WallThick + GuideRadius + 2*Protrusion),
    				   $fn=22);											// remove thumb notch
    
    	PinAssembly();
    
    	translate([-LidLength/2,BatteryWidth/2,CaseThick - TopThick - (AlignPinLength - TopThick/2)])
    		AlignPins();
      }
    
    }
    
    module Lid() {
    
      difference() {
    	translate([0,0,(CaseThick/2 - BaseThick - BatteryThick)])
    	  roundedBox([LidLength,
    				 CaseWidth,CaseThick],CornerRadius);
    
    	translate([0,0,-(CaseThick/2)])
    	  cube([(LidLength + 2*Protrusion),
    		    (CaseWidth + 2*Protrusion),
    		    (CaseThick)],center=true);
    
    	translate([-ExtendRelax,0,-(AlignPinLength - TopThick/2)])
    		AlignPins();
      }
    
    }
    
    module PlugShape() {
    
      difference() {
    	cylinder(r=SpringPlugOD/2,h=SpringPlugLength,$fn=SpringPlugSides);
    	translate([0,0,-Protrusion])
    	  PolyCyl(SpringPlugID,(SpringPlugLength + 2*Protrusion),SpringPlugSides);
      }
    }
    
    module Plugs() {
      translate([0,ContactOC,0])
    	PlugShape();
      translate([0,-ContactOC,0])
    	PlugShape();
    }
    
    //-------------------
    // Build it!
    
    ShowPegGrid();
    
    if (Layout == "Case")
      Case();
    
    if (Layout == "Lid")
      Lid();
    
    if (Layout == "Plugs")
    	for (i=[-1:1])
    		translate([i*1.5*SpringPlugOD,0,0])
    			Plugs();
    
    if (Layout == "Pins")
      PinShape();
    
    if (Layout == "AlignPins")
      AlignPins();
    
    if (Layout == "Show") {								// reveal pin assembly
      difference() {
    	Case();
    
    	translate([(CaseLengthOffset - Protrusion),
    			   (CaseWidthOffset - Protrusion + WallThick + ContactOffset + ContactOC),
    			   (BaseThick + ContactHeight)])
    	  cube([(-CaseLengthOffset + Protrusion),
    			 (CaseWidth + 2*Protrusion),
    			 CaseThick + BaseThick - ContactHeight + Protrusion]);
    
    	translate([(CaseLengthOffset - Protrusion),
    			   (CaseWidthOffset - Protrusion),
    			   -Protrusion])
    	  cube([(-CaseLengthOffset + Protrusion),
    			 (WallThick + GuideRadius + ContactOffset + Protrusion),
    			 CaseThick]);
      }
    
      translate([ExtendRelax,ContactOffset,(CaseThickOffset + ContactHeight)]) {	// pins
    	rotate([0,270,0]) {
    	  %PinShape();
    //	  translate([0,(2*ContactOC),0])
    //		%PinShape();
    	}
      }
    
      translate([CaseLengthOffset,ContactOffset,(CaseThickOffset + ContactHeight)])
    	rotate([0,90,0])
    	  PlugShape();
    }
    
    if (Layout == "Build") {
      translate([-(CaseLength/2 + CaseLengthOffset),-(CaseWidthOffset - BuildOffset),0])
    	Case();
      translate([CaseWidth/2,(CaseLengthOffset/2 - BuildOffset),0])
    	rotate([0,0,90])
    	  Lid();
      for (i=[-1:1])
    	translate([CaseLengthOffset/2 + i*1.5*SpringPlugOD,-CaseWidth/2,0])
    		Plugs();
    }
    
    if (Layout == "Fit") {
      Case();
      translate([(-LidLength/2 + ExtendRelax),
    			(CaseWidth/2 + CaseWidthOffset),
    			(BaseThick + BatteryThick + Gap)])
    	  Lid();
      translate([ExtendRelax,ContactOffset,CaseThickOffset + ContactHeight]) {	// pins
    	rotate([0,270,0]) {
    	  %PinShape();
    	  translate([0,(1*ContactOC),0])
    		%PinShape();
    	}
      }
    
      translate([CaseLengthOffset,
    			(ContactOffset + ContactOC),
    			(CaseThickOffset + ContactHeight)])
      rotate([0,90,0])
    	Plugs();
    
      translate([-LidLength/2,BatteryWidth/2,CaseThick])
    #	AlignPins();
    
    }
    
  • Using a 3-way X10 Wall Switch As a 2-way Switch

    The pushbutton on the X10 wall switch controlling the fiercely incandescent lamp over the kitchen table has gotten erratic, so I dug into the Big Box o’ X10 Crap for a replacement. Turns out The Box has only 3-way switches, but the lamp needs a standard two-wire switch.

    The instruction sheet shows this diagram:

    X10 3-way Wall Switch Wiring
    X10 3-way Wall Switch Wiring

    The pushbutton on the CS277 “Companion” switch connects the red lead to the two blue leads. The blue leads are always connected together and carry the lamp current, so the red lead is just a signal from the remote button.

    The WS477 “Master” switch will work as an ordinary switch if you cap the red lead with a wire nut and tuck it into the box.

    Done!

  • Plastic Stress in Polarized Light

    Here’s what the (cracked) faceplate of the FC1002 Frequency Meter looks like, through polarizing filters that reveal the internal stress.

    A circular polarizer screwed on the lens:

    FC1002 Frequency Counter - faceplate - circular polarizer
    FC1002 Frequency Counter – faceplate – circular polarizer

    A sheet of linear polarizing film held in front of the lens:

    FC1002 Frequency Counter - faceplate - linear polarizer
    FC1002 Frequency Counter – faceplate – linear polarizer

    For reference, none of the other instrument faceplates on the bench show anything other than uniform gray, with one exception that points directly to the plastic injection point.

    I’d say this plate cracked due to unrelieved internal stresses and not anything I did or didn’t do.