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 158: NEMA 23 Motor Adapter

    After removing the AC motor from the sewing machine, I wondered if a NEMA 23 stepper motor would fit:

    Kenmore 158 - NEMA 23 stepper - trial fit
    Kenmore 158 – NEMA 23 stepper – trial fit

    Huh. Who’d’a thunk it? That’s just too good to pass up…

    Although you wouldn’t use PLA for the real motor mount, this was easy:

    Drive Motor Mount - solid model
    Drive Motor Mount – solid model

    And the whole affair fits pretty much like you’d expect:

    Kenmore 158 - NEMA 23 stepper - on adapter
    Kenmore 158 – NEMA 23 stepper – on adapter

    The NEMA 23 motor doesn’t have the same end profile as the AC motor and the adapter plate gets in the way of the pulley, but flipping the pulley end-for-end perfectly aligned the belt.

    For whatever it’s worth, here’s how I removed the pressed-on gear from the shaft:

    NEMA 23 Stepper - removing gear
    NEMA 23 Stepper – removing gear

    I’m pretty sure I have a little gear puller somewhere, but it’s not where I expected to find it, which means it could be anywhere.

    Much to my astonishment, the shafts on both motors are exactly 1/4″ inch. I filed a flat on the shaft to avoid having the setscrew goober the poor thing.

    A stepper isn’t the right hammer for this job, because it can’t possibly reach 8000 rpm, but it’ll be good enough to explore the parameter space and weed out the truly stupid mistakes. A brushless DC motor from halfway around the planet would fit in the same spot.

    The OpenSCAD source code:

    // NEMA 23 Stepper Mounting Plate
    // Ed Nisley - KE4ZNU - June 2014
    
    Layout = "Build";			// Build Show 
    
    //- Extrusion parameters must match reality!
    //  Print with 4 shells and 3 solid layers
    
    ThreadThick = 0.20;
    ThreadWidth = 0.40;
    
    HoleWindage = 0.2;			// extra clearance
    
    Protrusion = 0.1;			// make holes end cleanly
    
    AlignPinOD = 1.70;			// assembly alignment pins: filament dia
    
    inch = 25.4;
    
    function IntegerMultiple(Size,Unit) = Unit * ceil(Size / Unit);
    
    //----------------------
    // Dimensions
    // Origin at bottom front corner of plate as mounted on machine
    //	motor mounted on rear surface, so recess is on that side
    
    PlateThick = 4.0;				// overall plate thickness
    
    SlotOffset = [10.0,13.0,0];		// center nearest origin, motor in X+,Y+ direction
    SlotSize = [8.0,25.0];			// diameter of mounting screw , overall end-to-end length
    
    CutoutOffset = [0.0,40.0,0];	// cutout around machine casting
    CutoutSize = [18.0,18.0];
    
    MotorBase = 58.0;				// square base plate side
    MotorHoleOC = 47.2;				// hole center-to-center spacing
    MotorHoleOffset = MotorHoleOC/2;
    MotorHoleDia = 5.0;
    MotorBaseCornerRadius = (MotorBase - MotorHoleOC)/2;
    
    FlangeWidth = 20.0;				// mounting flange
    
    MotorCenter = [(FlangeWidth + MotorBase/2),(MotorBase/2),0];		// XY of shaft centerline
    
    MotorShaftDia = 7.0;			// allow some clearance
    
    HubDia = 38.5;					// allow some clearance
    HubHeight = 1.8;
    
    //----------------------
    // 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) {
    
      RangeX = floor(100 / Space);
      RangeY = floor(125 / Space);
    
    	for (x=[-RangeX:RangeX])
    	  for (y=[-RangeY:RangeY])
    		translate([x*Space,y*Space,Size/2])
    		  %cube(Size,center=true);
    
    }
    
    //----------------------
    // Build it!
    
    module BasePlate() {
    
    	difference() {
    //		cube([(MotorCenter[0] + MotorBase/2),MotorBase,PlateThick],center=false);
    		linear_extrude(height = PlateThick) {
    			hull() {
    				translate([MotorBaseCornerRadius,MotorBaseCornerRadius])
    					circle(r=MotorBaseCornerRadius);
    				translate([MotorBaseCornerRadius,MotorBase - MotorBaseCornerRadius])
    					circle(r=MotorBaseCornerRadius);
    				translate([FlangeWidth + MotorBase - MotorBaseCornerRadius,MotorBase - MotorBaseCornerRadius])
    					circle(r=MotorBaseCornerRadius);
    				translate([FlangeWidth + MotorBase - MotorBaseCornerRadius,MotorBaseCornerRadius])
    					circle(r=MotorBaseCornerRadius);
    			}
    		}
    
    		translate(MotorCenter - [0,0,Protrusion]) {
    			rotate(180/8)
    				PolyCyl(MotorShaftDia,(PlateThick + 2*Protrusion),8);		// shaft hole
    			PolyCyl(HubDia,(HubHeight + Protrusion));						// hub recess
    			for (x=[-1,1] , y=[-1,1]) {
    				translate([x*MotorHoleOffset,y*MotorHoleOffset,0])
    					rotate(180/8)
    						PolyCyl(MotorHoleDia,(PlateThick + 2*Protrusion),8);
    			}
    		}
    
    		translate(SlotOffset - [0,0,Protrusion]) {							// adjustment slot
    			linear_extrude(height = (PlateThick + 2*Protrusion))
    				hull() {
    					circle(d=SlotSize[0]);
    					translate([0,(SlotSize[1] - SlotSize[0])])
    						circle(d=SlotSize[0]);
    
    				}
    		}
    
    		translate(CutoutOffset - [Protrusion,0,Protrusion])
    			linear_extrude(height = (PlateThick + 2*Protrusion))
    				square(CutoutSize + [Protrusion,Protrusion]);
    	}
    }
    
    ShowPegGrid();
    
    if (Layout == "Show") {
    	BasePlate();
    }
    
    if (Layout == "Build") {
    	translate([-(SlotOffset[0] + MotorBase/2),MotorBase/2,PlateThick])
    		rotate([180,0,0])
    			BasePlate();
    }
    
    
  • USB Micro-B Adapters

    The Sony HDR-AS30V camera has a USB Micro-B jack. One might think all three of these cables / adapters should work:

    USB Micro-B adapters
    USB Micro-B adapters

    But no:

    • The blocky Mini-to-Micro adapter on the top has no data lines
    • The Mini-to-Micro adapter cable works
    • The lower cable produces dependable disconnects

    There is, of course, no way to determine any of that, except by trying each one to see what happens; the product descriptions diverge from the truth in myriad ways.

    The camera came with a Micro-B cable that undoubtedly worked, but you try keeping track of one particular USB cable amid all the others.

  • Makergear M2: Heating Times

    With the platform and extruder starting at the 19.5 °C = 67 °F Basement Laboratory ambient …

    The extruder takes 1 minute to reach 175 °C, overshoots to about 180 °C, crosses 175 °C going downward at 1:30, then gets up to 174 °C again at 3:15. I ran a PID tuning session quite a while ago with inconclusive results. Reducing the initial overshoot would probably increase the time-to-get-ready, with no net improvement.

    The platform, which isn’t the stock Makergear hardware, requires 3:30 to reach 69 °C, just under the 70 °C target, at which point it’s ready to start. There’s no insulation under the PCB-trace heater, but some previous tinkering implies that running bare doesn’t make much difference, particularly with a fan blowing on the top surface of the glass.

    M2 - Improved HBP - bottom view
    M2 – Improved HBP – bottom view

    The modified platform runs from a 40 V supply with an initial power of 250-ish W at ambient. A quick measurement at 75 °C during a print:

    • 40 V @ 5.8 A = 230 W peak
    • 10 s on / 30 s off = 25% duty cycle
    • 230 W × 0.25 = 58 W average

    Remember that’s with an outboard SSR to unload the RAMBo’s MOSFET.

    By and large, the M2 is ready to print in under 5 minutes from a standing start, which is just about enough time to spritz hair spray on the platform, load the G-Code into Pronterface, and so forth and so on.

  • Introduction to Arduino I/O: Computing Beyond the Pins

    Last week I gave a class at Squidwrench that helped bootstrap folks from new-to-Arduino to won’t-blow-it-up, showing how the I/O pins work in digital and analog mode with a bit of hands-on experimentation:

    Potentiometer - analog input
    Potentiometer – analog input

    We also covered some setup, how the whole compiler thing works, and suchlike.

    You don’t get my patter, but the PDF file (Arduino IO Intro for Squidwrench – 2014-06) should provide an idea of what went on.

    The parts kit contains a 10 kΩ pot (with detents!), a green LED (with resistor!), and a jumper that serves as both a switch and a short antenna for an input without a pullup. They’re all terminated in header pins with heatstink tubing for strain relief.

    The ZIP file with all the source code (ArduinoIOIntro-2014-06.zip.odt) masquerades as an OpenDocument text file, because WordPress prohibits ZIP files. Just rename it to remove the ODT suffix, unzip it, and there you are. It also includes the PDF, because none of the Arduino files have any comments at all…

    A good time was had by all!

  • Makergear M2 Build Platform: Moah Powah!

    A surplus Mean Well PSP-600-48 48 V 12.5 A power supply just arrived, I dialed it back to 40 V, and swapped it with the 36 V brick I’d been using to drive the M2’s improved heated build platform.

    The improved platform was designed for a 30 V supply that would run it at about 150 W, which took slightly less than forever to reach operating temperature.

    With the 36 V supply set to 38.6 V, the platform drew 6.2 A at room temperature, which worked out to 6.2 Ω and 240 W. It was a tad pokey getting up to temperature

    At 40 V, the platform starts at 6.3 A / 6.3 Ω / 250 W from a bit over room temperature and drops to 5.8 A / 6.9 Ω / 232 W at 70 °C.

    At about 250 W, the platform takes about three times longer to reach operating temperature than the extruder, but it doesn’t require calling down to the engine room for more coal before maneuvering. I must run some numbers on it, now that I have a power supply with a useful range.

    There’s obviously an upper limit to the peak power the PCB traces under the glass can handle, but it runs at the same average power (to produce the same average temperature) and, at least so far, hasn’t shown any signs of distress. The few additional watts at 40 V won’t make any difference.

    Note that you must use an external DC-to-DC solid state relay, because the Rambo controller board can’t handle anything over 24 VDC and high current loads tend to melt its Phoenix-style connectors. When you add the SSR, replace the HBP connectors with Anderson Powerpoles, use fat wires, and be done with it.

    M2 HBP SSR Wiring
    M2 HBP SSR Wiring

    The M2’s Marlin firmware uses bang-bang control and tends to overshoot the setpoint; I’m not sure a few degrees makes all that much difference, particularly because it’s not measuring the temperature at the top of the glass plate.

  • Dell Dimension 2300: Capacitor Plague

    While scrubbing a hard drive and decommissioning an old Dell Dimension 2300, I spotted a failed capacitor:

    Dell 2300 failed capacitors - 1
    Dell 2300 failed capacitors – 1

    And another:

    Dell 2300 failed capacitors - 2
    Dell 2300 failed capacitors – 2

    The board sported many of those little caps, well over half showing signs of distress.

    A progression of victims, from I’m-not-dead-yet to phew:

    Dell 2300 failed capacitors - grouped
    Dell 2300 failed capacitors – grouped

    According to its Service Tag, this Dimension 2300 came off the line in late November 2002. All of the other caps on the board seemed OK, so apparently the plague affected just this lot of Hermei 470 µF 6.3 V capacitors.

    Or, hey, they’re not supposed to last a dozen years and this is perfectly normal …

  • Hall Effect LED Current Control: Crisp Gate Drive Shaping

    Because the current control loop closes through the Arduino loop(), the code’s path length limits the bandwidth. Worse, the PWM filter imposes a delay while the DC value catches up with the new duty cycle. Here’s what that looks like:

    LoopStatus ILED 50 mA div - 200 50 150 25 mA
    LoopStatus ILED 50 mA div – 200 50 150 25 mA

    The setpoint current for this pulse is 200 mA, ramping upward from 50 mA. It should have started from 25 mA, but the loop really wasn’t under control here.

    The top trace goes low during the drain current measurement, which occurs just before the code nudges the gate drive by 1 PWM count to reduce the error between the setpoint and the measurement. A delay(1) after each PWM change, plus the inherent delay due to all the program statements, produces an update every 1.7 ms, more or less.

    Even at that low rate, the current overshoots by 50 mA before the loop can tamp it down again. The current varies by 200 mA for 7 PWM counts, call it 30 mA per count at the high end, so overshooting by 50 mA comes with the territory. There’s just not a lot of resolution available.

    The program reads each pulse duration and amplitude from an array-of-structs, so it’s a simple matter of software to save the gate drive voltage at the end of each pulse and restore it when that pulse comes around on the guitar again:

    	if (millis() >= (EventStart + (unsigned long)Events[EventIndex].duration)) {
    		Events[EventIndex].drive_a = VGateDriveA;						// save drive voltages
    		Events[EventIndex].drive_b = VGateDriveB;
    
            if (++EventIndex > MAX_EVENT_INDEX)								// step to next event
    		    EventIndex = 0;
    
    		VGateDriveA = Events[EventIndex].drive_a;						// restore previous drives
    		VGateDriveB = Events[EventIndex].drive_b;
    
    		SetPWMVoltage(PIN_SET_VGATE_A,VGateDriveA);
    		SetPWMVoltage(PIN_SET_VGATE_B,VGateDriveB);
    
    		delay(PWM_Settle);
    
    		digitalWrite(PIN_ENABLE_A,Events[EventIndex].en_a);				// enable gates for new state
    		digitalWrite(PIN_ENABLE_B,Events[EventIndex].en_b);
    
            NeedHallNull = !(Events[EventIndex].en_a || Events[EventIndex].en_b);	// null sensor if all off
    
    		EventStart = millis();                                          // record start time
    	}
    

    … which produces this happy result, with a different time scale to show all four pulses in the array:

    I Sense Amp  ILED 50 mA div - 200 100 150 50 mA
    I Sense Amp ILED 50 mA div – 200 100 150 50 mA

    The top trace shows the current amp output that goes into the Arduino analog input and the bottom trace shows the MOSFET drain current. Notice those nice, crisp edges with a nearly complete lack of current adjustment.

    The small bumps in the amp output just after the LED turns off happen while the the code nulls the Hall effect sensor offset. Whenever the LEDs turn off, the code nulls the sensor, which is probably excessive; it really doesn’t have much else to do, so why not?

    This trickery doesn’t improve the loop bandwidth at all, because the code must still drag the current to meet each setpoint, but now that happens only when the pulse first appears. After a few blinks, the current stabilizes at the setpoint and the loop need handle only slight variations due to temperature or battery voltage changes.

    Speaking of voltages:

    VDS ILED 50 mA div - 200 100 150 50 mA
    VDS ILED 50 mA div – 200 100 150 50 mA

    The top trace now shows the MOSFET drain voltage and the bottom still has the LED current. There’s only 650 mV of difference at the drain for currents of 50 mA and 200 mA through the LEDs, with about 1 V of headroom remaining at 200 mA.

    The power supply delivers 7.4 V to the anode end of the LEDs, so they drop 6.3 V @ 200 mA and 5.7 V @ 50 mA. Some informal knob twiddling suggests that the MOSFET loses control authority at about 6.5 V, so, given that there’s not much energy in the battery below 7.0 V anyway, the program could limit the  maximum current to 50 mA when the battery hits 7 V, regain 650 mV of headroom, and run at reduced brightness (and perhaps a different blink pattern) until the battery drops to 6.5 V, at which point the lights go out.

    There’s more improvement to be had in the code, but those pulses look much better.

    (If you’re keeping track, as I generally don’t, this is Post Number 2048: love those round numbers!)