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: Machine Shop

Mechanical widgetry

  • Resistance Soldering: Electrodes

    With transformer, circuitry, and firmware in hand, the final step is to get juice to the workpiece. Resistance soldering depends on passing a high current through a relatively low resistance: the power varies as the square of the current, so more current is much better.

    The catch is that the transformer produces a relatively low voltage, so the initial circuit resistance must be exceedingly low. With 5 Vrms from the transformer secondary, a mere 0.5 Ω in the secondary circuit limits the maximum current to 10 A. Even with most of that in the joint, it’s not gonna work as you expect.

    I scrounged some very flexible 6-conductor signal cable with several shields that, with everything conductive crimped-and-soldered together on both ends, worked out to 1 mΩ/foot. A pair of 7-foot leads with copper lugs swaged-and-soldered on each end, bolted together to the transformer secondary, produced 280 A at 4.1 V: a bit over a kilowatt. The secondary winding and lugs evidently contribute 4 mΩ of resistance to the total.

    CAUTION – That much current makes the cables twitch in their own magnetic field. If you wear finger rings, bracelets, or metallic body jewelry, remove it. A metallic ring looks like a single shorted secondary winding that can couple magnetic flux from the cables and get surprisingly hot surprisingly quickly.

    Don’t put the rings in your pocket, either. Your pants are not a good magnetic shield.

    With that in mind, some electrodes:

    Electrodes
    Electrodes

    The black block is a slab of machinable graphite clamped to a brass plate that probably served as a wall bracket in a previous life. It serves as a nice base for most operations: conductive, non-sticky for solder, doesn’t produce nasty arc scorches. A cable from the secondary bolts firmly to the brass plate and the vast surface area provides a low-resistance contact. The cheesy plastic clamps work fine: the block doesn’t get too hot.

    The huge electrode comes from a carbon-arc spotlight. It’s actually too long, with too much resistance, and doesn’t work well at all.

    The tiny electrode is a steel welding rod (for gas welding). It works well for very small setups, but has essentially no resistance and requires low duty cycles.

    The Goldilocks electrode in the middle is a length of 5/32-inch carbon gouging rod (for arc welding). It has a copper coating that tends to burn off near the tip, but the overall resistance remains low enough that the joint heats well. The middle glows yellow-hot if you overdo things, hence the discolored section.

    To date, I’ve used a few inches off the end of one 12-inch rod. There are 49 more rods in the package. If you build one of these things and don’t want to pass a similar box along to your heirs, drop me a note and I’ll send you a rod.

    The scrap box emitted a sturdy cardboard tube that slipped over the cable so well that I simply gave up thinking about making an actual handle with a contact switch and all that stuff.

    Resistance soldering electrode handle
    Resistance soldering electrode handle

    All the electrodes terminate in homebrew clamps made from copper lugs that bolt to the transformer’s secondary terminals with 10-32 machine screws. The gouging rod has steel rings (forged from husky wire) holding the lug closed around the rod; they’re a pain to (re)move, but ensure very solid contact. The cable termination is swaged-and-soldered.

    AA Cell Clamping Pliers
    AA Cell Clamping Pliers
    Center Electrode - Front Detail
    Center Electrode – Front Detail

    I have not yet conjured up a pair of tweezers, as almost everything I’ve done has been suitable for pressing against the carbon plate.

    One exception: a pair of snap-ring pliers became a clamp for AA cell positive terminals and worked well in that capacity, along with a repurposed oil burner tungsten electrode that even provided its own ceramic handle.

    If I ever get around to building tweezers, I’d probably use chunks of that tungsten rod. It’d be easy to put a contact switch in there, too.

    Right after I got it working, I grabbed some copper junk and tried it out:

    Resistance soldering test pieces
    Resistance soldering test pieces

    Notice that there’s not enough heat in the surrounding metal to discolor it. I’m not always that lucky good, but it’s possible.

    The copper wire was instructive: even though copper is a great conductor, the joint is the lowest-resistance part of the circuit and gets all the heat. If you think of it as a parallel circuit, the ring has a relatively high resistance and sees much less current.

    Cleanliness and good joint preparation are vital, because any nontrivial resistance will reduce the heat to zilch. The tip of the carbon electrode sometimes acquires an insulating flux coating; a swipe on a file solves that problem

    Solder foil works well, because the current passes through the solder and starts the melting process in the middle of the joint. That’s easier than fiddling with solder wire, although your mileage may vary depending on what the joint looks like.

    Projects done with the equipment you’ve seen…

    It’s a great tool; I wonder how I got along without it.

    Now, I really must put that widowmaker breadboard inside an enclosure. There’s a dead dehumidifier near the bench (slated to contribute its compressor as a vacuum pump for a hold-down chuck on the mill) with a case that just might be the right size…

  • Resistance Soldering: Firmware

    Here’s the firmware driving the Atmel 89C2051 in my resistance soldering gizmo. You could substitute any 8051-style microcontroller without much difficulty at all. With a bit more difficulty, you could even use an Arduino Pro Mini.

    As you already know from recent posts, I’d jettison all the fancy gate control circuity and use a single bit driving a triac optoisolator. Redefine one of the GATE_CLAMP_x or GATE_DRIVE_x bits accordingly, then toss all but the last six Pat* timing structures overboard. That gets you duty cycle control in 1/6 increments: the triac will be turned on for one to six cycles of every six.

    You’ll probably have a serial LCD with a standard bit rate, so change the OSCILLATOR_FREQ to match your 11.0592 MHz crystal. Those of you in 50 Hz land can get 1/5 duty cycle control after you set LINE_FREQ accordingly; change the Pat* entries, too.

    Operation is straightforward: one pair of those fancy keyboard switches selects the triac trigger pulse sequence, the other selects the total burn time in 0.1 second units. You should use only patterns 11 through 16, which are the 1/6 through 6/6 duty cycles.

    Note: patterns 1 through 10 perform weird sub-cycle triggering to illustrate various topics I covered in the columns and shouldn’t be used for anything else. You don’t want to hammer your transformer with a series of half-cycle pulses, for example, because you don’t want to magnetize the core with a DC bias.

    Use the SDCC compiler to get the corresponding HEX file. I have not, in actual point of fact, recompiled this since burning the original microcontroller, so I’d expect the new HEX (actually, *.ihx) file to be completely different due to nothing more than improved optimizations and suchlike. Let me know how it works out, but, by and large, you’re on your own.

    I have a couple of tubes of 2051s, so if you want to build one of these gizmos and don’t want to use another 8051-family micro (or, better, port the code to an Arduino), send me a small box stuffed with as many dollar bills as you think appropriate and I’ll send you a programmed chip. No warranty, express or implied: you’re really on your own after that. I highly recommend that you do not take me up on this offer, OK?

    Herewith, The Source…

    // Resistance soldering unit control program
    // Circuit Cellar - June 2008
    // Ed Nisley KE4ZNU
    
    #include <8051.h>
    #include <stdio.h>
    
    //-------------------------------------------------------------------------------------------
    // I/O bits
    
    // The bit patterns in the TriacEvent_t struct match the output bit locations
    // These are low-active at the output pins, but we think of them as 1=ON here
    
    #define GATE_CLAMP_LOW		P1_4		// out - clamp low-going gate pulses to zero
    #define GATE_CLAMP_LOW_MASK	0x10
    #define GATE_CLAMP_LOW_BIT	4
    
    #define GATE_CLAMP_HIGH		P1_5		// out - clamp high-going gate pulses to zero
    #define GATE_CLAMP_HIGH_MASK	0x20
    #define GATE_CLAMP_HIGH_BIT	5
    
    #define GATE_DRIVE_LOW		P1_6		// out - drive gate low
    #define GATE_DRIVE_LOW_MASK	0x40
    #define GATE_DRIVE_LOW_BIT	6
    
    #define GATE_DRIVE_HIGH		P1_7		// out - drive gate high
    #define GATE_DRIVE_HIGH_MASK	0x80
    #define GATE_DRIVE_HIGH_BIT	7
    
    #define GATE_BIT_MASK		0xf0		// overall bitmask for these output bits
    #define GATE_BIT_PORT		P1		// which port they're on
    
    #define BUTTON_CONTACT		P1_0		// in - high when tip contact active
    #define BUTTON_FIRE		P1_1		// in - high when foot switch pressed
    #define TRACE2			P1_2		// out - toggled in loops and so forth
    #define TRACE3			P1_3		// out - toggled in IRQ handlers
    
    #define TRACE0			P3_0		// out -- toggled during burn sequence
    
    #define LINE_SYNC			P3_2		// in - INT0 from line monitor optoisolator
    #define LINE_SYNC_EDGE		IE0		//      interrupt edge detect bit
    #define LINE_SYNC_EDGE_ENABLE	IT0		//      enable edge detection for this IRQ
    
    #define BUTTON_TIME_INC		P3_3		// in - high to increment time
    #define BUTTON_TIME_DEC		P3_4		// in - high to decrement time
    #define BUTTON_PATTERN_INC	P3_5		// in - high to increment pattern index
    #define BUTTON_PATTERN_DEC	P3_7		// in - high to decrement pattern index
    
    #define TRACE_SERIAL		0		// nonzero to trace serial operations
    #define TRACE_PATTERN		1		// nonzero to trace pattern start
    
    //-------------------------------------------------------------------------------------------
    // Triac control timings
    // The ratio LINE_FREQ / TRIAC_PATTERN_CYCLES should be 10 to make decimal seconds work out nicely
    //  ... so those of you in 50-Hz land will have only five cycles per pattern...
    
    #define OSCILLATOR_FREQ		12.0000E6				// crystal frequency
    #define TIMER_TICK_FREQ		(OSCILLATOR_FREQ / 12)		// CPU instruction cycle frequency, Hz
    
    #define LINE_FREQ			60		// power line frequency, Hz
    
    #define TRIAC_PATTERN_FREQ	10		// Patterns per second
    
    #define TRIAC_PATTERN_CYCLES	(LINE_FREQ / TRIAC_PATTERN_FREQ)	// Power cycles per pattern
    
    // Because the VFL display requires about three stop bits at 9600 b/s,
    //  serial output must be paced at no more than 13 chars per power-line cycle
    //  so 8 chars per cycle (one per phase) works out perfectly well
    // If you want more phases or faster data, you must adjust accordingly
    // As it turns out, my VFL doesn't use standard serial rates anyway, but the thought was nice...
    //  and the pacing still gives a full update in about 50 chars / (8 chars / cycle) = 6 cycles = 1/10 sec
    
    #define PHASES_PER_CYCLE	8					// phases per line cycle
    
    #define PHASE_TICKS	(TIMER_TICK_FREQ / (PHASES_PER_CYCLE * LINE_FREQ))	// ticks per phase
    
    #define PHASES_PER_PATTERN	(PHASES_PER_CYCLE * TRIAC_PATTERN_CYCLES)
    
    #define TIMER_OVERHEAD		20					// IRQ handler overhead ticks
    
    #define LINE_SYNC_DELAY		(410E-6 * TIMER_TICK_FREQ)	// zero-crossing detection delay in ticks
    
    // Event records contain
    //  match EventPhase to the Phase timer: when it matches, then output bits happen
    //   0 = start of first cycle, max value = PHASES_PER_PATTERN-1
    //  output bits correctly aligned, but 1=active so they must be flipped before output
    
    typedef struct {
    	unsigned char EventPhase;
    	unsigned char TriacBits;
    } TriacEvent_t;
    
    #define PB(t,b) {t,b}
    
    TriacEvent_t __code Pat0[] = {		// 0 - all drivers off, always
    	PB(0,0)
    	};
    
    TriacEvent_t __code Pat1[] = {		// 1 - single high trigger
    	PB(0,GATE_DRIVE_HIGH_MASK),		//     similar to Figure 1 in April 2008 column
    	PB(1,0)
    	};
    
    TriacEvent_t __code Pat2[] = {		// 2 - single high, clamped second half-cycle
    	PB(0,GATE_DRIVE_HIGH_MASK),
    	PB(1,0),
    	PB(4,GATE_CLAMP_LOW_MASK | GATE_CLAMP_HIGH_MASK),
    	PB(8,0)
    	};
    
    TriacEvent_t __code Pat3[] = {		// 3 - peak +V half-cycle, then one full cycle, clamped
    	PB(2,GATE_DRIVE_HIGH_MASK),		//     similar to Figure 3 in April 2008 column
    	PB(3,0),
    	PB(4,GATE_DRIVE_LOW_MASK),
    	PB(8,GATE_DRIVE_HIGH_MASK),
    	PB(12,GATE_CLAMP_LOW_MASK | GATE_CLAMP_HIGH_MASK),
    	PB(14,0)
    	};
    
    TriacEvent_t __code Pat4[] = {		// 4 - peak +V half-cycle, then half cycle, clamped
    	PB(2,GATE_DRIVE_HIGH_MASK),		//     this gives one complete cycle
    	PB(3,0),
    	PB(4,GATE_DRIVE_LOW_MASK),
    	PB(6,GATE_CLAMP_LOW_MASK | GATE_CLAMP_HIGH_MASK),
    	PB(16,0)
    	};
    
    TriacEvent_t __code Pat5[] = {		// 5 - similar to 3 with additional half cycle
    	PB(2,GATE_DRIVE_HIGH_MASK),		//     this gives two complete cycles
    	PB(3,0),
    	PB(4,GATE_DRIVE_LOW_MASK),
    	PB(8,GATE_DRIVE_HIGH_MASK),
    	PB(12,GATE_DRIVE_LOW_MASK),
    	PB(14,GATE_CLAMP_LOW_MASK | GATE_CLAMP_HIGH_MASK),
    	PB(20,0)
    	};
    
    TriacEvent_t __code Pat6[] = {		// 6 -
    	PB(0,0)
    	};
    
    TriacEvent_t __code Pat7[] = {		// 7 -
    	PB(0,0)
    	};
    
    TriacEvent_t __code Pat8[] = {		// 8 -
    	PB(0,0)
    	};
    
    TriacEvent_t __code Pat9[] = {		// 9 -
    	PB(0,0)
    	};
    
    TriacEvent_t __code Pat10[] = {		// 10 -
    	PB(0,0)
    	};
    
    TriacEvent_t __code Pat11[] = {		// 11 - 1/6: 1 0 0 0 0 0
    	PB(2,GATE_DRIVE_HIGH_MASK),
    	PB(3,GATE_DRIVE_LOW_MASK),
    	PB(7,GATE_CLAMP_LOW_MASK | GATE_CLAMP_HIGH_MASK)
    	};
    
    TriacEvent_t __code Pat12[] = {		// 12 - 2/6: 1 0 0 1 0 0
    	PB(2,GATE_DRIVE_HIGH_MASK),
    	PB(3,GATE_DRIVE_LOW_MASK),
    	PB(7,GATE_CLAMP_LOW_MASK | GATE_CLAMP_HIGH_MASK),
    	PB(26,GATE_DRIVE_HIGH_MASK),
    	PB(27,GATE_DRIVE_LOW_MASK),
    	PB(31,GATE_CLAMP_LOW_MASK | GATE_CLAMP_HIGH_MASK)
    	};
    
    TriacEvent_t __code Pat13[] = {		// 13 - 3/6: 1 0 1 0 1 0
    	PB(2,GATE_DRIVE_HIGH_MASK),
    	PB(3,GATE_DRIVE_LOW_MASK),
    	PB(7,GATE_CLAMP_LOW_MASK | GATE_CLAMP_HIGH_MASK),
    	PB(18,GATE_DRIVE_HIGH_MASK),
    	PB(19,GATE_DRIVE_LOW_MASK),
    	PB(23,GATE_CLAMP_LOW_MASK | GATE_CLAMP_HIGH_MASK),
    	PB(34,GATE_DRIVE_HIGH_MASK),
    	PB(35,GATE_DRIVE_LOW_MASK),
    	PB(39,GATE_CLAMP_LOW_MASK | GATE_CLAMP_HIGH_MASK)
    	};
    
    TriacEvent_t __code Pat14[] = {		// 14 - 4/6: 1 1 0 1 1 0
    	PB(2,GATE_DRIVE_HIGH_MASK),
    	PB(3,GATE_DRIVE_LOW_MASK),
    	PB(7,GATE_DRIVE_HIGH_MASK),
    	PB(11,GATE_DRIVE_LOW_MASK),
    	PB(15,GATE_CLAMP_LOW_MASK | GATE_CLAMP_HIGH_MASK),
    	PB(26,GATE_DRIVE_HIGH_MASK),
    	PB(27,GATE_DRIVE_LOW_MASK),
    	PB(31,GATE_DRIVE_HIGH_MASK),
    	PB(35,GATE_DRIVE_LOW_MASK),
    	PB(39,GATE_CLAMP_LOW_MASK | GATE_CLAMP_HIGH_MASK)
    	};
    
    TriacEvent_t __code Pat15[] = {		// 15 - 5/6: 1 1 1 1 1 0
    	PB(2,GATE_DRIVE_HIGH_MASK),
    	PB(3,GATE_DRIVE_LOW_MASK),
    	PB(7,GATE_DRIVE_HIGH_MASK),
    	PB(11,GATE_DRIVE_LOW_MASK),
    	PB(15,GATE_DRIVE_HIGH_MASK),
    	PB(19,GATE_DRIVE_LOW_MASK),
    	PB(23,GATE_DRIVE_HIGH_MASK),
    	PB(27,GATE_DRIVE_LOW_MASK),
    	PB(31,GATE_DRIVE_HIGH_MASK),
    	PB(35,GATE_DRIVE_LOW_MASK),
    	PB(39,GATE_CLAMP_LOW_MASK | GATE_CLAMP_HIGH_MASK)
    	};
    
    TriacEvent_t __code Pat16[] = {		// 16 - 6/6: 1 1 1 1 1 1
    	PB(2,GATE_DRIVE_HIGH_MASK),
    	PB(3,GATE_DRIVE_LOW_MASK),
    	PB(7,GATE_DRIVE_HIGH_MASK),
    	PB(11,GATE_DRIVE_LOW_MASK),
    	PB(15,GATE_DRIVE_HIGH_MASK),
    	PB(19,GATE_DRIVE_LOW_MASK),
    	PB(23,GATE_DRIVE_HIGH_MASK),
    	PB(27,GATE_DRIVE_LOW_MASK),
    	PB(31,GATE_DRIVE_HIGH_MASK),
    	PB(35,GATE_DRIVE_LOW_MASK),
    	PB(39,GATE_DRIVE_HIGH_MASK),
    	PB(43,GATE_DRIVE_LOW_MASK),
    	PB(47,GATE_DRIVE_HIGH_MASK)
    	};
    
    __code TriacEvent_t * __code pTriacPatterns[] = {	// pointers to patterns
    	Pat0,Pat1,Pat2,Pat3,Pat4,Pat5,Pat6,Pat7,Pat8,Pat9,
    	Pat10,Pat11,Pat12,Pat13,Pat14,Pat15,Pat16
    };
    
    // Number of duty-cycle patterns (0 = all off)
    #define TRIAC_NUM_PATTERNS	(sizeof(pTriacPatterns) / sizeof( __code * ))
    
    unsigned char PatternSelection = 11;			// default selected entry in pTriacPatterns
    
    //-------------------------------------------------------------------------------------------
    // These are mostly the (dreaded) global variables modified by the IRQ handlers
    // The initial values set up for the first line sync IRQ
    
    // Phase and output control
    
    volatile unsigned char Phase = 0xff;			// phase within each pattern, init to -1
    volatile unsigned char EventIndex;				// step through TriacEvents records
    
    typedef enum {BURN_IDLE, BURN_CONTACT, BURN_ACTIVE, BURN_DONE} BurnState_t;
    
    BurnState_t BurnState = BURN_IDLE;				// what we're doing right now
    
    volatile __bit BurnEnable;					// true when output is active
    
    typedef struct {
    	unsigned char Seconds;
    	unsigned char Tenths;
    } Time_t;
    
    volatile Time_t BurnTime = {1,0};			// displayable burn time
    Time_t FullTime = {1,0};				// ditto, selected time
    
    volatile unsigned char Cycles;			// power-line cycle counter, wraps each second
    
    // Serial output
    
    #define SERIAL_RATE	62500				// which depends on the crystal, of course!
    
    volatile char SerialCharOut;				// char to send
    volatile bit SerialOutReady;				// 1 for new char, 0 when sent
    
    unsigned char Heartbeat;				// simple activity indicator
    __code unsigned char ActivityChar[8] = {"-\\|/-\\|/"};	// remember \\ is just one character
    
    // Button debouncing accumulators
    // Incremented when pressed, zeroed when released... ticks = power-line cycles
    // I used Hall-effect switches that don't bounce, so the initial delay is very short
    //  For real debouncing set ON much longer
    
    #define BUTTON_ON		3				// if continuously pressed this long, it's on!
    
    volatile unsigned char Button_Time_Inc;
    volatile unsigned char Button_Time_Dec;
    volatile unsigned char Button_Pattern_Inc;
    volatile unsigned char Button_Pattern_Dec;
    
    volatile unsigned char Button_Contact;
    volatile unsigned char Button_Fire;
    
    //-------------------------------------------------------------------------------------------
    // Utilities
    
    #define SEC_TENTHS(s,t) (60*s + 6*t)			// convert seconds+tenths to cycles
    
    void Delay(unsigned char CycleCount) {			// rough-and-ready delay by power-line cycles
    unsigned char PrevCycle;
    
    	PrevCycle = Cycles;
    
    	while (CycleCount) {
    		if (PrevCycle != Cycles) {
    			CycleCount--;
    			PrevCycle = Cycles;
    		}
    	}
    
    }
    
    void IncrementTime(Time_t *pTime) {
    
    	if (pTime->Tenths >= 9) {
    		pTime->Tenths = 0;
    		pTime->Seconds++;			// wraps at 255 and we don't care at all
    	}
    	else {
    		pTime->Tenths++;
    	}
    }
    
    void DecrementTime(Time_t *pTime) {
    
    	if (pTime->Tenths) {
    		pTime->Tenths--;
    	}
    	else {
    		if (pTime->Seconds) {		// saturate at 0.0
    			pTime->Tenths = 9;
    			pTime->Seconds--;
    		}
    	}
    
    	if ((pTime->Tenths == 0) && (pTime->Seconds == 0)) {
    		pTime->Tenths = 1;
    	}
    
    }
    
    unsigned char TestButton(unsigned char Button) {
    
    	return (Button >= BUTTON_ON);
    
    }
    
    //-------------------------------------------------------------------------------------------
    // Display controls
    // Rows and columns start at zero, of course
    
    #define DISP_ROWS	2
    #define DISP_COLS	20
    
    #define DISP_POS_CMD	'\x10'
    
    void InitDisplay(void) {
    
    	puts("Ed\x1f\x11\x14");				// filler, reset, no scroll, no cursor
    
    }
    
    void SetCursor(unsigned char row, unsigned char col) {
    
    	putchar(DISP_POS_CMD);
    	putchar(row * DISP_COLS + col);
    
    }
    
    void RefreshDisplay(void) {
    
    	SetCursor(1,19);
    	putchar(ActivityChar[Heartbeat++ & 0x07]);
    
    //	SetCursor(0,0);
    	if (BurnEnable) {
    //                       012345 67 89
    		printf_tiny("BURN %d.%d  ",BurnTime.Seconds,BurnTime.Tenths);
    	}
    	else {
    		printf_tiny("Time %d.%d  ",FullTime.Seconds,FullTime.Tenths);
    	}
    
    	SetCursor(0,10);
    //                 abcde f0123
    	printf_tiny("Patt %d ",PatternSelection);
    
    	SetCursor(1,0);
    	if (TestButton(Button_Contact))
    //                0123456789abcdef0123
    		puts("<<Ready!>>");
    	else
    		puts("No contact");
    
    }
    
    //-------------------------------------------------------------------------------------------
    // Handler for line-sync input
    // Synchronize triac bits to power line positive half-cycle
    // Forces Timer 0 interrupt after exit to ensure synchronization
    //  Timer 0 will not be running when this IRQ occurs!
    
    void LineSyncIRQ(void) __interrupt (0) __using(1) {
    
    	TRACE3 = 0;
    
    	if (Phase >= (PHASES_PER_PATTERN - 1)) {	// if this is line sync after last pattern phase IRQ
    		TRACE0 = 0;
    		Phase = 0xff;				// preload to get 0 on PhaseIRQ fallthru
    		EventIndex = 0;				// restart pattern on that phase
    
    		if ((!BurnEnable) && BurnState == BURN_ACTIVE) {	// if should be active
    			BurnEnable = 1;			//  then allow startup on this cycle
    #if TRACE_PATTERN
    			TRACE2 = 1;				// flag pattern startup
    #endif
    		}
    
    		if (BurnEnable) {				// outputs active?
    			if (BurnTime.Tenths) {			// tick time backwards
    				BurnTime.Tenths--;		// continue running on 0.1 -> 0.0 tick
    			}
    			else {
    				if (BurnTime.Seconds) {
    					BurnTime.Tenths = 9;
    					BurnTime.Seconds--;
    			     }
    			     else BurnEnable = 0;		// off after 1 tick for 0.0
    			}
    		}
    	}
    
    	if ((Phase % PHASES_PER_CYCLE) == (PHASES_PER_CYCLE - 1)) {	// if line sync after last phase in cycle
    		TRACE0 = 0;					// make a blip
    		TRACE0 = 1;
    		TRACE0 = 0;					// then leave low
    	}
    
    	TF0 = 1;				// always force Timer 0 interrupt immediately after us
    
    // Tick cycle counter
    
    	if (Cycles < (LINE_FREQ - 1)) {
    		Cycles++;
    	}
    	else {
    		Cycles = 0;
    	}
    
    // Sample switches & twiddle debounce accumulators
    // Buttons are rarely pressed, so that case goes pretty quickly
    // To get even faster, skip it all if burn is in progress
    // Remember that I'm using +active Hall-effect switches
    
    	if (BUTTON_TIME_INC) {						// switch pressed?
    		Button_Time_Inc += (Button_Time_Inc < 255);	// yes, increment and saturate
    	}
    	else {
    		Button_Time_Inc = 0;					// no, flush
    	}
    
    	if (BUTTON_TIME_DEC) {
    		Button_Time_Dec += (Button_Time_Dec < 255);
    	}
    	else {
    		Button_Time_Dec= 0;
    	}
    
    	if (BUTTON_PATTERN_INC) {
    		Button_Pattern_Inc += (Button_Pattern_Inc < 255);
    	}
    	else {
    		Button_Pattern_Inc= 0;
    	}
    
    	if (BUTTON_PATTERN_DEC) {
    		Button_Pattern_Dec += (Button_Pattern_Dec < 255);
    	}
    	else {
    		Button_Pattern_Dec = 0;
    	}
    
    	if (BUTTON_CONTACT) {					// active high
    		Button_Contact += (Button_Contact < 255);
    	}
    	else {
    		Button_Contact = 0;
    	}
    
    	if (BUTTON_FIRE) {					// active high
    		Button_Fire += (Button_Fire < 255);
    	}
    	else {
    		Button_Fire = 0;
    	}
    
    #if TRACE_PATTERN
    	TRACE2 = 0;
    #endif
    
    	TRACE3 = 1;
    
    }
    
    //-------------------------------------------------------------------------------------------
    // Handler for Timer 0
    // This meters out the triac control bits
    // Turns off Timer 0 during last phase in each cycle, so line-sync IRQ will re-sync us
    
    void PhaseIRQ(void) __interrupt (1) __using(1) {
    
    TriacEvent_t *pEvent;
    
    	TRACE3 = 0;
    
    	TR0 = 0;						// Reload phase timer
    	if (++Phase) {					// step to next phase. Is it nonzero?
    		TH0 = ((int)(-(PHASE_TICKS - TIMER_OVERHEAD)) >> 8) & 0xff;		// nonzero = normal tick
    		TL0 =  (int)(-(PHASE_TICKS - TIMER_OVERHEAD)) & 0xff;
    	}
    	else {
    		TH0 = ((int)(-(PHASE_TICKS - LINE_SYNC_DELAY)) >> 8) & 0xff;	// zero = after line sync
    		TL0 =  (int)(-(PHASE_TICKS - LINE_SYNC_DELAY)) & 0xff;
    	}
    	TR0 = 1;						// and start it up
    
    	if (! BurnEnable) {				// if outputs should not be active
    		GATE_BIT_PORT |= GATE_DRIVE_HIGH_MASK | GATE_DRIVE_LOW_MASK;	// force drive off
    		GATE_BIT_PORT &= ~(GATE_CLAMP_HIGH_MASK | GATE_CLAMP_LOW_MASK);	// force clamp on
    	}
    
    	pEvent = pTriacPatterns[PatternSelection] + EventIndex;
    
    	if (Phase == pEvent->EventPhase) {		// event time match?
    		if (BurnEnable) {				// change outputs only if in active burn time
    			GATE_BIT_PORT ^= GATE_BIT_MASK & (GATE_BIT_PORT ^ ~(pEvent->TriacBits));
    		}
    		EventIndex++;				// step to next event in pattern list
    	}
    
    	if ((Phase % PHASES_PER_CYCLE) == (PHASES_PER_CYCLE - 1)) {	// if now in last phase of cycle
    		TR0 = 0;					//  ... next line sync will restart timer
    		TRACE0 = 1;					// short blip to mark this point
    		TRACE0 = 0;
    		if (Phase == (PHASES_PER_PATTERN - 1)) {
    			TRACE0 = 1;				// flag final transition of pattern
    		}
    	}
    
    	if (SerialOutReady) {				// if char ready to send
    		SBUF = SerialCharOut;			//   do it (TI will always be clear!)
    		SerialOutReady = 0;			//   and mark it as gone
    	}
    
    	TRACE3 = 1;
    
    }
    
    //-------------------------------------------------------------------------------------------
    // Serial character I/O
    // This is utterly crude...
    
    /************
    char getchar(void) {
    
    	if (RI) {
    		RI = 0;
    		return SBUF;
    	}
    	else {
    		return (char) 0;
    	}
    
    }
    *****************/
    
    // Output must be synced to the phase IRQs to properly pace the chars to the VFL display...
    // So we hand this off to the Timer0 IRQ
    
    void putchar(char c) {
    
    	while (SerialOutReady) {
    #if TRACE_SERIAL
    		TRACE2 = ! TRACE2;
    #else
    		continue;
    #endif
    	}
    
    #if TRACE_SERIAL
    	TRACE2 = 1;
    #endif
    
    	SerialCharOut = c;
    	SerialOutReady = 1;
    
    	return;
    
    }
    
    //-------------------------------------------------------------------------------------------
    
    void main(void) {
    
    __bit SomethingChanged;
    
    // Set up hardware
    
    	TCON = 0;				// Timers off, software control
    	PCON |= SMOD;			// double the serial bit rate
    
    	TMOD = 0x21;			// Timer 1 = 8 bit auto-reload, Timer 0 = 16-bit
    
    	TL1 = TH1 = 256 - ((2 * OSCILLATOR_FREQ) / (32 * 12 * SERIAL_RATE));
    
    	SCON = 0x50;			// serial mode 1
    	TR1 = 1;				// start Timer 1
    
    // Sync to incoming power-line signal
    // Timer 0 is off so line-sync will start normally
    
    	LINE_SYNC_EDGE_ENABLE = 1;	// make INT0 edge-triggered
    	LINE_SYNC_EDGE = 0;
    
    	while (!LINE_SYNC_EDGE) {	// hang until first edge
    		TRACE3 = !TRACE3;
    	}
    	TRACE3 = 1;
    
    	IE = 0x83;				// Ints enabled, Timer0 IRQ enabled, INT0 enabled
    
    	InitDisplay();			// set up the display
    	SetCursor(0,0);			// don't know why this is needed the first time, but it is...
    
    //          0123456789abcdef0123
    	puts("CC June 08\r\n"
               "Ed Nisley 20 Feb 08");
    
    	Delay(SEC_TENTHS(3,0));
    
    	InitDisplay();			// clear the decks!
    
    // Get sane input to start... just keep rewriting the message, it's shorter
    
    	while (TestButton(Button_Fire)) {
    		SetCursor(0,0);
    //			0123456789abcdef0123
    		puts("Release tip switch!");
    	}
    
    	InitDisplay();
    
    // Repeat forever...
    
    	while (1) {
    
    // If nothing else happens, update the display about twice a second
    
    		SomethingChanged = !(Cycles % (LINE_FREQ / 2));
    
    // Handle timing and pattern-selection buttons
    
    		if (TestButton(Button_Time_Inc)) {
    			IncrementTime(&FullTime);
    			SomethingChanged = 1;
    		}
    
    		if (TestButton(Button_Time_Dec)) {
    			DecrementTime(&FullTime);
    			SomethingChanged = 1;
    		}
    
    		if (TestButton(Button_Pattern_Inc) && (PatternSelection < (TRIAC_NUM_PATTERNS - 1))) {
    			PatternSelection++;
    			SomethingChanged = 1;
    		}
    
    		if (TestButton(Button_Pattern_Dec) && PatternSelection) {
    			PatternSelection--;
    			SomethingChanged = 1;
    		}
    
    // Convert contact & footswitch buttons into output control
    // Ignore nearly all the ugly race conditions...
    
    		switch (BurnState) {
    		case BURN_IDLE :
    			if (TestButton(Button_Contact)) {		// first we need contact
    				BurnState = BURN_CONTACT;
    				SomethingChanged = 1;
    			}
    			break;
    		case BURN_CONTACT :
    			if (!TestButton(Button_Contact)) {		// no contact = restart
    				BurnState = BURN_IDLE;
    				SomethingChanged = 1;
    			}
    			else if (TestButton(Button_Fire)) {		// foot switch active?
    				BurnTime.Tenths = FullTime.Tenths;	// set up burn duration
    				BurnTime.Seconds = FullTime.Seconds;
    				BurnState = BURN_ACTIVE;
    				while (!BurnEnable) {			// wait for IRQ to activate burning
    					continue;
    				}
    				SomethingChanged = 1;
    			}
    			break;
    		case BURN_ACTIVE :
    			if (!TestButton(Button_Contact)) {		// no contact = restart
    				BurnState = BURN_IDLE;
    				BurnEnable = 0;
    			}
    			else if (!BurnEnable) {				// burn completed?
    				BurnState = BURN_DONE;
    			}
    			SomethingChanged = 1;				// always update display
    			break;
    		case BURN_DONE :
    			if (!TestButton(Button_Fire)) {		// foot switch released?
    				BurnState = BURN_IDLE;
    				SomethingChanged = 1;
    			}
    			break;
    		default :
    			BurnEnable = 0;
    			BurnState = BURN_IDLE;
    			SomethingChanged = 1;
    		}
    
    // Update display if anything interesting happened
    
    		if (SomethingChanged) {
    			RefreshDisplay();
    		}
    
    	}
    
    }
    
    
  • Resistance Soldering: Circuitry

    Because I wanted to discuss triac triggering for inductive loads, the triggering circuitry & firmware turned out to be absurdly complex. A quartet of transistors provides source and sink current, as well as source and sink clamps, with 1/8 cycle timing resolution. The transistors and their power supply must be optically isolated from the microcontroller, of course.

    None of this triggering circuitry is quite what you want, but it’ll get you started in the right direction…

    This schematic shows the driver circuitry, triac, transformer, and suchlike.

    Triac Drive Schematic
    Triac Drive Schematic

    The weird +4 V supply comes directly from the small multi-tap transformer harvested from the ‘waver; your supply will certainly be different.

    The 100 mΩ resistor in the primary is there strictly for current monitoring while debugging the thing. If you’re not doing that, leave it out.

    The optocoupler in the lower right sends the zero-crossing time back to the microcontroller; it is vitally important that you get the phase correct on this one, as the firmware is doing triggering in all four quadrants and the triac doesn’t take kindly to pulses 180 degrees out of phase.

    The microcontroller side looks pretty much like any 8051-based circuit.

    Timing Controller Schematic
    Timing Controller Schematic

    I used a surplus VFL display with a serial input that required the 12.000 MHz crystal. That had the useful benefit of giving exact 1 µs instruction timing, but otherwise I’d have gone with a 11.0592 MHz crystal to get normal serial output bit timings.

    The pushbuttons (lower left) are weird Hall-effect keyboard switches that are either open or pulled to the power supply; they do not have a low-active state. As a result, the resistors pull the inputs down in the inactive state. These switches don’t bounce, which simplified the firmware a bit. If you use mechanical switches, you must add a debouncing routine.

    The Enable switch (upper right) provides positive control over the gate drive signals: when it’s open, the triac cannot fire.

    The Contact switch (upper middle) seemed like a good idea: it’s supposed to close only when the electrodes are making firm contact. I never got around to building such a switch and it turns out to be unnecessary, so it’s bypassed by a toggle switch on the circuit board.

    The Foot switch (lower middle) is absolutely vital: you get everything set up with electrodes properly arranged, then step on the switch. The microcontroller handles the timing, the heat goes off, and then you lift your foot at your leisure… when the joint is cool.

    Here’s what all that looks like, all screwed to a piece of plywood in genuine breadboard mode:

    Timing control and triac trigger circuitry
    Timing control and triac trigger circuitry

    Straight up: this is a lethally stupid way to build the thing. Put it inside a container of some sort, so you can’t drop anything conductive across the exposed primary components. OK?

    Now, the reason I say none of this is what you want is because all resistance soldering requires is just turning the triac on for a while, then turning it off. I think duty-cycle control would be helpful, but sub-cycle timing is definitely not required.

    So, by and large, were I to rebuild this, I’d jettison the entire triac triggering board and replace it with a simple optoisolated triac trigger IC (perhaps a MOC3022, of which I have a bag, or a TLP3042), then modify the firmware to flick a single output bit to turn on the heat.

    You can download the schematics, simulation models, and source code from the Circuit Cellar FTP site: Issues 213 and 215.

    Tomorrow: the firmware.

  • Resistance Soldering: Transformer

    The idea behind resistance soldering is to stuff a tremendous amount of current through a relatively low-resistance joint, thus producing enough heat to melt the solder and bond the parts. Because power dissipation varies as the square of the current, more current is much better!

    Commercial resistance soldering units have relatively small transformers with small windings that impose a low duty cycle: you must let the transformer cool off between joints. A 50% duty cycle seems about the norm for hobbyist-grade units; you can obviously pay more to get more.

    Given that the transformer is free, getting one that can supply a kilowatt for half an hour without breaking a sweat seemed like a Good Thing. It hasn’t warmed up appreciably during any of the relatively short projects I’ve used it for… although the electrode holder can get pretty toasty.

    Find a discarded microwave oven: the bigger, the better. Our ancient Sears ‘waver went casters-up at an opportune moment; IIRC, the magnetron filament failed.

    Microwave oven interior
    Microwave oven interior

    I harvested the transformer, line fuse, triac, snubber, and a handful of other odds and ends. The magnetron shell became a really nice desk tchotchke.

    Transformers really don’t care, at least to a good first approximation, whether the secondary is producing a huge voltage at a low current (which is what ‘waver transformers do for a living) or a piddly voltage at a huge current (which is what we want). The core flux is proportional to the ampere-turns in the primary (a kilowatt is about 8 amps at 120 V) and we can rewind the secondary to get what we want.

    This transformer had separate primary and secondary windings, which made life easy. The secondary is on top, the primary below. The primary has about 120 turns of stout wire, giving a turns-per-volt of about 1; that seems to be common with relatively cheap transformers. Remember that number…

    Transformer windings
    Transformer windings

    With the transformer in hand, apply your least-favorite wood chisel to the secondary winding: chop the entire winding out. Pay very careful attention to not damaging the primary winding. You’ll probably find a few turns of relatively heavy wire for the magentron filament; chop that out, too.

    Chopping out the secondary winding
    Chopping out the secondary winding

    After a bit of beating, the secondary should come out in two hunks that you can toss in your copper recycling box. It’s pretty much solid metal:

    Removed secondary winding
    Removed secondary winding

    This transformer had a pair of flux shunts between the primary and secondary winding that stabilize the output power. We don’t care about that, so pry them out; they’re the small laminated steel blocks just above the primary winding. I also removed the cardboard liner around the core opening. The primary terminals are 1/4-inch quick-disconnect tabs, aimed straight at you so they’re hard to see.

    Transformer without secondary winding
    Transformer without secondary winding

    The primary has about 1 turn per volt, so the secondary will, too. You can use nice floppy 4 AWG silicone insulated wire, but I went with four parallel strands of 10 AWG wire stripped from a length of house wiring to get the same cross-sectional area. Five turns produces a 5 volt secondary, which may be a little high; it seems commercial units run at about 3-4 V.

    I terminated the secondary in heavy copper crimp lugs, but, not having the proper crimper, I made an open-top clamp to support the sides of the lug. Applying a punch to the top did a satisfactory job of making the lug one with the wire. I also soldered the joint, less for electrical goodness than simply excluding oxygen and improving the mechanical rigidity.

    Secondary termination lug
    Secondary termination lug

    Caution: you must use a crimped joint, because the whole point of this exercise is to put enough heat into a soldered joint to melt the solder. Think about this: if you have two soldered joints in series with the one you’re trying to make, what could possibly go wrong?

    I put some thin cardboard around the opening to prevent insulation scuffs, but, frankly, that’s not needed: this wire has really tough insulation and can take care of itself.

    And then it looks like this…

    Rewound transformer
    Rewound transformer

    The components are what you’ll need to measure & plot the B-H curve, as described there. For what it’s worth, here are three curves with 20, 60, and 120 VAC on the primary.

    BH Curve Overlays - 20 60 120 VAC
    BH Curve Overlays – 20 60 120 VAC

    The core is pretty much saturated at 120 VAC, which is a simple form of power regulation: small voltage changes won’t make much difference in the power output. The peak flux density is about 20 kG, out there on the limbs of that hysteresis curve.

    Next: put a triac in the primary circuit…

    Microwave Oven Schematic
    Microwave Oven Schematic

    [Update: Herewith, the oven schematic. The transformer core is bonded to one end of the secondary winding. The other end is capacitively coupled to the halfwave rectifier that drives the magnetron. Note that the three-turn filament winding is attached to the hot side and is floating at 4 kV off ground.

    None of that matters here, because you’re chopping those windings out and replacing them with five turns of husky wire.

    Don’t you wish all consumer electronics came with schematics?

    end update]

  • Resistance Soldering Gizmo: Overview

    My resistance soldering gizmo is sufficiently handy that I keep promising to write it up here, but sufficiently weird that I keep not doing it. Here’s a first pass at rectifying that omission…

    Resistance Soldering Breadboard Overview
    Resistance Soldering Breadboard Overview

    Back in 2007/8 I built a resistance soldering gizmo and wrote it up for my Circuit Cellar column (Feb / Apr / June 2008, issues 211, 213, 215). Those articles go into excruciating detail about transformer action, flux density, triac triggering with inductive loads, and how all the firmware works. If you want the gory details, go there to get the issues or there to get a CD.

    What you’ll see here over the next few days is a quick overview of how I built the thing, along with some suggestions & color commentary.

    The general idea is that you can get nearly all the spendy bits by harvesting parts from a kilowatt-class microwave oven. I used an ancient Sears ‘waver and I suspect older boxes will be better donors: more iron in the transformer, more robust semiconductors, bigger clearances. Use what you’ve got or can find along the side of the road.

    That gives you the right half of the board in the picture. The transformer gets rewound for low voltage and very high current, the triac controls line current through the primary as usual, and the fuse does what it’s supposed to do.

    Oh, yeah, the Vise Grip is providing a dead short to test the maximum current. It’s fine doing that; just makes the transformer buzz a bit. Remember, you don’t leave it on for hours at a time.

    I wanted to show how triacs behave when they’re controlling highly inductive loads, which the (unloaded) transformer certainly is. So I built a controller around an Atmel AT89C2051 (the good bits of an 8051 stuffed in a 20-pin DIP) that gave complete source/sink control over the gate current in 1/8-cycle increments during six complete cycles. The left side of the picture therefore has some custom circuitry to make all that happen.

    Like, for example, 2/3 duty cycle with maximum-voltage switching:

    Triac drive - 2/3 duty cycle - max V trigger
    Triac drive – 2/3 duty cycle – max V trigger

    For a resistance soldering setup, you don’t want any of that. All you need is to turn the triac on and hold it on for a specific duration. Duty cycle control would be nice, but probably doesn’t make much difference. I’ll describe what I have, provide the source code, and you can hack it to make it do what you want…

    Then I’ll show some electrodes and point to some projects I’ve soldered with the thing. It works fine and maybe you can get something useful out of it.

    Electrodes
    Electrodes

    Onward…

  • Sears Kenmore Electric Dryer: New Rear Seal

    Our ancient Sears Kenmore electric clothes dryer (which is not matched to the never-sufficiently-to-be-damned HE3 washer) started squeaking again. The last time it did that, I tore it apart and determined that the rear seal between the drum and the back panel needed replacing; I ordered the seal, buttoned up the dryer, and, amazingly, the squeak Went Away.

    The box with the new seal arrived a few days later and has been perched atop the dryer for the last few months. Never borrow trouble, sez I.

    Unlike the HE3 washer, tearing the dryer down isn’t a big deal. Two screws secure the lint trap enclosure to the top panel; be careful about not dropping them down the chute.

    Screws holding lint trap to top
    Screws holding lint trap to top

    Then push the top forward and pry it off the clips holding it in place. You do not need to remove what looks like clips holding the top to the back panel; they’re sort of hinges that let you tilt the top back. With any luck, you can let the top hang; I rested it on the nearby laundry sink.

    Door switch
    Door switch

    Two screws hold the entire front door panel in place. Before you remove those, disconnect wires from the door latch switch so you can remove the front panel. The alert reader will note I didn’t do that…

    The drum has two sliding seals that bear on the front and rear panels. There is nothing else holding the drum in place, so when you remove the front panel, the drum falls out. It’s helpful to have an assistant holding the drum in place, perhaps with a hand through the open door, while you jockey the front panel out of the way.

    Drum belt path through tensioner
    Drum belt path through tensioner

    Have your assistant continue to hold the drum while you memorize the path of the drive belt around the tensioner and motor pulleys. This is not obvious: you don’t have to take the tensioner pulley off the shaft to remove or install the belt.

    There are two sets of slots in the dryer base plate that could hold the tensioner. Only one set will work. Pay attention to the situation in your dryer.

    Hint: the drum rotates counterclockwise as you view the front of the dryer. The motor pulls the belt off the drum and the tensioner acts on the slack side of the belt. If you try rotating the drum clockwise, the tensioner and motor make graunching noises that will convince you something has gone terribly wrong. It hasn’t, you’re just turning the drum the wrong way.

    With the drum out, this is what the old seal looked like:

    Worn seal
    Worn seal

    I cut the threads at the seam holding the ends of the old seal together and peeled it off the drum. That reveals the dried adhesive all around the drum.

    Removing old seal
    Removing old seal

    I applied xylene to soften the adhesive, then used a razor knife and a vast quantity of rags to remove the goo. The key is to get enough xylene on the adhesive to get its attention without slobbering solvent all over the drum; it will soften the paint, which is a Bad Thing. Do this in the garage or outdoors to enhance Family Harmony.

    I did a trial fit of the new seal, which showed it’s a snug fit and requires careful alignment. A dozen small clamps held successive parts in place while I got it settled. The trick is to position the center part of the T-shaped seal against the rim of the drum without wrinkles. You probably can’t get it right without a dozen clamps.

    To apply the adhesive, I removed two clamps, eased that section of the seal off the rim, and ran two beads of adhesive: one along the rim where the previous adhesive had been and a smaller bead just below the folded metal edge. That pretty well smeared out as I eased the section back in place.

    Then remove the next clamp, ease that section off the rim, apply adhesive, and iterate all the way around.

    Clamping new seal to drum
    Clamping new seal to drum

    I dug a patched bicycle tube out of the drawer and eased it under the clamps around the drum, then pulled it mildly taut all the way around to apply uniform pressure to the seal. Two larger clamps held the slack ends in place.

    After supper, we declared the adhesive (which looks & smells a lot like plain old contact cement) to be cured. Off came the clamps and tube and, lo and behold, it’s all good.

    Reassembly is in the obvious reverse order. The instructions packed with the seal remind you to ease the loose end of the seal outside the drum where it can ride on the back panel. Make it so.

    While your assistant holds the drum in place, reinstall the tensioner and route the belt around it. The belt in our dryer has two possible positions on the pulley (it has ridges), so I made sure it was tracking in the same position as before.

    Attach the front panel, rotate the drum a few times to be sure everything is in place and tracking correctly, then slam the top, screw it down, and you’re done!

  • Third Eye Hardshell Mirror Repair

    Alas, the mirror I installed this spring didn’t survive our bicycling vacation; it succumbed to the second of three stuff-all-the-bikes-in-a-truck schleps arranged by the tour organizers. Being that sort of bear, I had a spare mirror, duct-taped it in place, lashed it down with some cable ties, and we completed the mission.

    So.

    Back to the Basement Laboratory Plastic Repair Wing.

    The strut broke just behind the ball at the mirror, which implies the mirror plate got stuffed against something, rather bending the strut. The ball joint still worked, so I maneuvered the stub perpendicular to the mirror.

    Drilling the strut
    Drilling the strut

    Normally I’d try to re-glue the joint as-is to get the best fit, but past experience shows that if it breaks once, it’ll break there again. I wanted to put some reinforcement into the strut, not just depend on a solvent glue joint. Some rummaging in the brass tubing stock produced a 1/16-inch diameter aluminum (!) tube about 18 mm long: just what’s needed.

    So I filed the deformed plastic flat & perpendicular to the stubs, mounted the strut in the 3-jaw chuck on the Sherline’s table, lined the spindle up with the axis, and poked a 1/16-inch hole into the strut. The alignment looks decidedly off in the picture, but it’s actually spot on: what you’re seeing is some swarf clinging to the far edge. Honest!

    Then I grabbed the mirror plate in the 3-jaw, lined up on the stub, and drilled maybe 4 mm down, which was roughly to the middle of the ball. The tubing was a firm push-fit in the hole and I hope it won’t over-stress the plastic into cracking.

    Gluing the mirror strut
    Gluing the mirror strut

    Run the spindle up, remove the drill, grab the strut in the chuck (actually, I had to swap in the larger chuck first), dab some Plastruct solvent glue on both ends, align the strut with the stub (they’re actually square in that section), run the spindle down to ram the tubing into the strut, then a bit more to apply pressure to the joint. I made the total hole depth about 2 mm longer than the tubing, so as to avoid the embarrassment of having the ends not quite meet in the middle.

    No CNC; pure manual Joggy Thing action.

    Let it cure overnight.

    It’s now back on Mary’s helmet, with a pair of black cable ties ensuring that it won’t pop off, and seems to be working fine. I’m sure the ball joint will fail later this year, although that won’t be due to this repair.

    Mirror on helmet again
    Mirror on helmet again