Advertisements

Kenmore 158: Open-Loop Current Limiting

Although I plan to servo the motor speed to the pedal position, a quick open-loop test seems in order. The motor requires nigh onto half an amp before it can spin the sewing machine shaft, so this chunk of Arduino code scales-and-offsets ten bits of pedal position voltage into twelve bits of DAC output that produce a corresponding current limit for the motor winding:

ADCvalue = (word)analogRead(PIN_PEDAL);
DACvalue = map(ADCvalue,0x0100,0x03ff,0x0800,0x0fff);
dac.setVoltage(DACvalue,false);

Putting that in the Arduino’s main loop and holding the pedal down produces this pleasant result:

Current Sense Amp vs Tek - 200 mA-div

Current Sense Amp vs Tek – 200 mA-div

The current sense amp output in the top trace is scaled at 525 mA/V = 525 mA/div and the bottom trace is from the Tek current probe at 200 mA/div. Fiddling with the scope’s gain & offset exactly overlays the two traces and they remain overlaid through the full pedal travel, so the ferrite toroid isn’t saturating and the output remains nicely linear.

The flat tops in that picture show the ET227 transistor limiting the motor current to 600 mA, exactly the way it should.

Of course, the LM324 has a GBW = 1 MHz and, with a gain of three, a bandwidth of barely 300 kHz, so there’s a distinct lack of fuzz on that trace compared to the Tek probe’s 10 MHz bandwidth.

It’s easy to hold the sewing machine at a constant speed with a constant load, but touching the handwheel stalls the motor at a constant pedal position. Similarly, releasing the handwheel causes a runaway, unless I let up on the pedal fairly quickly.

Setting the Tek probe to 500 mA/div and triggering on a somewhat higher current while stomping on the pedal and grabbing the sewing machine’s handwheel shows the current increasing with the motor under heavier load:

Model 158 - Current sense vs Tek 500 mA-div

Model 158 – Current sense vs Tek 500 mA-div

The current limit reaches just under 2 A, over on the right side, for both traces.

So the hardware works pretty much the way it should.

Wheee-hooo!

Advertisements

,