So I can get some super cheap unipolar stepper motors here:
http://www.mpja.com/prodinfo.asp?number=4315+MS
It's wired with a common center tap for the coils:
I can't use a regular motor shield (for bipolars) with this motor, but that's half the fun I put up four power MOSFETs driven by four digital pins in the proper cadence. I feed in 12V in the common, and have the MOSFETs ground out the other wires as appropriate (with suitable snubbing diodes pointing "up" towards the 12V rail) I verified the cadence by hooking up LEDs and driving it slowly.
However, the motor just jerks back and forth. No matter if I run it at five steps a second or a hundred steps a second, all I get is vibration. I'm pretty sure I wired it correctly, but I also permuted various connections to test all possible permutations, with the same result (no rotation, just vibration/back-and-forth.)
I feel like this is one of those noob problems, except I tried everything I can find and think of, and it still doesn't work. I tried two of the motors, so it's not just one bum motor. Do I have multiple bum motors, or is there some mechanical thing I'm missing? (something like "oh, it needs a specific load/inertia to actually pull it around to the next phase" -- that'd be crazy, though, based on what I know)
I've measured the windings, they all have continuity and all seem to have the same resistance. The power supply shows exactly the expected amount of current drawn (0.15A per winding at 12.0V.) I've run only one winding at a time, and it jerks back and forth as expected, weaker than with both windings, but in a similar way. It's like I can't pull the rotor sideways to make it turn instead of vibrate...
Also, code:
void setup()
{
for (int i = 2; i < 14; ++i)
{
pinMode(i, OUTPUT);
digitalWrite(i, LOW);
}
}
bool on = true;
int sdelay = 200;
int delaydelay = 3000;
void ctl(bool a, bool b) {
if (a) {
digitalWrite(8, LOW);
digitalWrite(7, HIGH);
}
else {
digitalWrite(7, LOW);
digitalWrite(8, HIGH);
}
if (b) {
digitalWrite(10, LOW);
digitalWrite(9, HIGH);
}
else {
digitalWrite(9, LOW);
digitalWrite(10, HIGH);
}
}
void loop()
{
ctl(true, true);
delay(sdelay);
ctl(true, false);
delay(sdelay);
ctl(false, false);
delay(sdelay);
ctl(false, true);
delay(sdelay);
digitalWrite(13, on ? HIGH : LOW);
on = !on;
delaydelay -= sdelay;
if (delaydelay < 0) {
delaydelay = 3000;
if (sdelay == 200) {
sdelay = 10;
}
else {
sdelay = 200;
}
}
}
And a schematic of my driver attached.