Hi, VM.
I don't know if I can help, but I did an experience with a bipolar stepper motor last month. Just to test if it works. And it works!
The blog is in Portuguese, but you can see a clip it here:
It is an old and damaged Epson Inkjet Printer motor, 48v., 4 wired., controled by an LB1847 IC (original of the printer). I used the whole printer board, just because I needed the power source of the printer. Looks like a monster, but don't worry.
I just disconnected half IC pins and soldered in wires, connecting them to arduino outs 0 to 11 (pins 27 to 16 of IC, respectively), and Vcc and GND.
There is also a potencimeter (to control speed), a Infra Red receiver (to change the rotation direction - you can use a simple switch), and 2 leds (to indicate the direction) connected to arduino.
I got the sequence table on the the Datasheet of IC (LB1847 Datasheet pdf - LB1847-D.PDF - ON Semiconductor)
Wrote a simple code using Port D (0 to 7 out) and Port B (8 to 13 out) command.
Take a look, compare with what you've done, and verify if it is useful.
/* Stepper Bipolar Epson 740 LB1847 Controller
* -------------------------
*
* Program to drive a stepper motor coming from an Epson 740i Inkjet Printer (CR Motor)
* using a simple TV RC to control the rotation direction.
* It is a bipolar stepper motor with 4 wires.
*
* @author: Adilson Akashi
* @date: 12 Nov. 2007
*/
int irRem = 0; // variable for reading the pin status
int valPot = 0; // variable to store the value coming from the potenciometer
int dirCW = 1;
int count = 0;
int motorPin[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11};
int ledPin1 = 12;
int ledPin2 = 13;
int potPin = 1;
void motorSpeed() {
valPot = analogRead(potPin); // read the value from the sensor
valPot *= 10;
if (valPot < 250) {
valPot = 250;
}
}
void clockWise() {
dirCW = 1;
motorSpeed();
PORTD = B11001010;
delayMicroseconds(valPot);
PORTB = B100011;
delayMicroseconds(valPot);
PORTD = B01100100;
delayMicroseconds(valPot);
PORTB = B100010;
delayMicroseconds(valPot);
PORTD = B00111100;
delayMicroseconds(valPot);
PORTB = B101110;
delayMicroseconds(valPot);
PORTD = B01100100;
delayMicroseconds(valPot);
PORTB = B101010;
delayMicroseconds(valPot);
PORTD = B11001011;
delayMicroseconds(valPot);
PORTB = B001011;
delayMicroseconds(valPot);
PORTD = B01100101;
delayMicroseconds(valPot);
PORTB = B001010;
delayMicroseconds(valPot);
PORTD = B00111101;
delayMicroseconds(valPot);
PORTB = B000110;
delayMicroseconds(valPot);
PORTD = B01100101;
delayMicroseconds(valPot);
PORTB = B000010;
delayMicroseconds(valPot);
}
void counterClockWise() {
dirCW = 0;
motorSpeed();
PORTB = B010010;
delayMicroseconds(valPot);
PORTD = B01100101;
delayMicroseconds(valPot);
PORTB = B010110;
delayMicroseconds(valPot);
PORTD = B00111101;
delayMicroseconds(valPot);
PORTB = B011010;
delayMicroseconds(valPot);
PORTD = B01100101;
delayMicroseconds(valPot);
PORTB = B011011;
delayMicroseconds(valPot);
PORTD = B11001011;
delayMicroseconds(valPot);
PORTB = B001010;
delayMicroseconds(valPot);
PORTD = B01100100;
delayMicroseconds(valPot);
PORTB = B001110;
delayMicroseconds(valPot);
PORTD = B00111100;
delayMicroseconds(valPot);
PORTB = B000010;
delayMicroseconds(valPot);
PORTD = B01100100;
delayMicroseconds(valPot);
PORTB = B000011;
delayMicroseconds(valPot);
PORTD = B11001010;
delayMicroseconds(valPot);
}
void setup()
{
DDRD = DDRD | B11111111; // sets Arduino pins 7 – 0 as outputs
DDRB = DDRB | B111111; // sets Arduino pins 13 – 8 as outputs
for (count = 0; count < 12; count++) {
pinMode(motorPin[count], OUTPUT);
}
pinMode(ledPin1, OUTPUT);
pinMode(ledPin2, OUTPUT);
}
void loop()
{
dirCW == 1;
do {
irRem = analogRead(0); // read IR input value
clockWise();
}
while (irRem > 200 && dirCW == 1);
delay(200);
dirCW == 0;
do {
irRem = analogRead(0); // read IR input value
counterClockWise();
}
while (irRem > 200 && dirCW == 0);
delay(200);
}