# Floppy Drive Salvage: Stepper Motor Problems

#### mrwest09

Joined Mar 23, 2013
7
I am looking to use a bipolar stepper motor salvaged from a 3.5in floppy drive (used to control the read/write head) for a project I'm working on with a couple classmates.

We are using these motors in conjunction with some other motors we have purchased and have designed a fairly standard driver circuit for them to be controlled by an Arduino.

The problem that has arisen is that we can get the floppy drive motors to step appropriately in the counter clockwise direction, however when rotating in the clockwise direction the motor will fail to step properly at the same point in it's 360 degree rotation every time. At this point in it's rotation the motor will step (rather weakly) two CCW and one large step CW so that it is back to it's original location.

We are feeding the motor roughly 5V and the resistance in the coils is 27 ohms. Any thoughts would be greatly appreciated!

#### Paulo540

Joined Nov 23, 2009
191
Have you tried a different motor with the same hardware/code?

It kinda sounds like there is an offset in the ground reference. Maybe you could post the Sketch?

Are you using any sort of indexing?

#### mrwest09

Joined Mar 23, 2013
7
We have another identical floppy drive that we have salvaged a motor from and we are seeing nearly identical issues with the same code/driver setup. The code/driver setup has worked with three other bipolar stepper motors that we purchased from ebay with no problems.

I have posted the Processing sketch used to control the Arduino below. I really have to apologize in advance, this code was made in the lab as we were working with these motors so I'm sure it would probably make most programmers sick to their stomach. Also, ControlP5 is a GUI library I am using. If you're not familiar they are simply just buttons that call methods later on in the code

Not sure what you mean by indexing. Are you talking about tracking what current state the motors are in?

Rich (BB code):
import cc.arduino.*;
import controlP5.*;
import processing.serial.*;

ControlP5 cp5;
Arduino arduino;
int b= 10;
int a=11;
int en=5;
int del=300;

void setup()
{
size(200,480);
cp5=new ControlP5(this);
arduino = new Arduino(this, Arduino.list()[0], 57600);

arduino.pinMode(b, Arduino.OUTPUT);
arduino.pinMode(a, Arduino.OUTPUT);
arduino.pinMode(en, Arduino.OUTPUT);

arduino.digitalWrite(en, Arduino.HIGH);

.setPosition(20,20);
.setPosition(20,50);
.setPosition(20,80);
.setPosition(20,110);
.setPosition(20,140);
.setPosition(20,170);

}
void draw()
{
background(200);
}

void first(){
arduino.digitalWrite(en, Arduino.LOW);
delay(del);
arduino.digitalWrite(b, Arduino.LOW);
arduino.digitalWrite(a, Arduino.LOW);
delay(del);
arduino.digitalWrite(en, Arduino.HIGH);
}
public void next(){
arduino.digitalWrite(en, Arduino.LOW);
delay(del);
arduino.digitalWrite(b, Arduino.HIGH);
arduino.digitalWrite(a, Arduino.LOW);
delay(del);
arduino.digitalWrite(en, Arduino.HIGH);
}
public void next1(){
arduino.digitalWrite(en, Arduino.LOW);
delay(del);
arduino.digitalWrite(b, Arduino.HIGH);
arduino.digitalWrite(a, Arduino.HIGH);
delay(del);
arduino.digitalWrite(en, Arduino.HIGH);
}
public void next2(){
arduino.digitalWrite(en, Arduino.LOW);
delay(del);
arduino.digitalWrite(b, Arduino.LOW);
arduino.digitalWrite(a, Arduino.HIGH);
delay(del);
arduino.digitalWrite(en, Arduino.HIGH);
}
public void right(){
for (int i=1; i>0; i--){
next2();
next1();
next();
first();
println("Iteration #: " +i);
}
}
public void left(){
for (int i=1; i>0; i--){
first();
next();
next1();
next2();
println("Iteration #: " +i);
}
}