Floppy Drive Salvage: Stepper Motor Problems

Discussion in 'The Projects Forum' started by mrwest09, Mar 23, 2013.

  1. mrwest09

    Thread Starter New Member

    Mar 23, 2013
    7
    0
    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!
     
  2. Paulo540

    Member

    Nov 23, 2009
    188
    0
    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?
     
  3. mrwest09

    Thread Starter New Member

    Mar 23, 2013
    7
    0
    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?


    Code ( (Unknown Language)):
    1. import cc.arduino.*;
    2. import controlP5.*;
    3. import processing.serial.*;
    4.  
    5. ControlP5 cp5;
    6. Arduino arduino;
    7. int b= 10;
    8. int a=11;
    9. int en=5;
    10. int del=300;
    11.  
    12. void setup()
    13. {
    14.   size(200,480);
    15.   cp5=new ControlP5(this);
    16.   arduino = new Arduino(this, Arduino.list()[0], 57600);
    17.  
    18.   arduino.pinMode(b, Arduino.OUTPUT);
    19.   arduino.pinMode(a, Arduino.OUTPUT);
    20.   arduino.pinMode(en, Arduino.OUTPUT);
    21.  
    22.   arduino.digitalWrite(en, Arduino.HIGH);
    23.  
    24.   cp5.addButton("first")
    25.      .setPosition(20,20);
    26.   cp5.addButton("next")
    27.      .setPosition(20,50);
    28.   cp5.addButton("next1")
    29.      .setPosition(20,80);
    30.   cp5.addButton("next2")
    31.      .setPosition(20,110);
    32.   cp5.addButton("left")
    33.      .setPosition(20,140);
    34.   cp5.addButton("right")
    35.      .setPosition(20,170);
    36.  
    37.  
    38. }
    39. void draw()
    40. {
    41.   background(200);
    42. }
    43.  
    44. void first(){
    45.   arduino.digitalWrite(en, Arduino.LOW);
    46.   delay(del);
    47.   arduino.digitalWrite(b, Arduino.LOW);
    48.   arduino.digitalWrite(a, Arduino.LOW);
    49.   delay(del);
    50.   arduino.digitalWrite(en, Arduino.HIGH);
    51. }
    52. public void next(){
    53.   arduino.digitalWrite(en, Arduino.LOW);
    54.   delay(del);
    55.   arduino.digitalWrite(b, Arduino.HIGH);
    56.   arduino.digitalWrite(a, Arduino.LOW);
    57.   delay(del);
    58.   arduino.digitalWrite(en, Arduino.HIGH);
    59. }
    60. public void next1(){
    61.   arduino.digitalWrite(en, Arduino.LOW);
    62.   delay(del);
    63.   arduino.digitalWrite(b, Arduino.HIGH);
    64.   arduino.digitalWrite(a, Arduino.HIGH);
    65.   delay(del);
    66.   arduino.digitalWrite(en, Arduino.HIGH);
    67. }
    68. public void next2(){
    69.   arduino.digitalWrite(en, Arduino.LOW);
    70.   delay(del);
    71.   arduino.digitalWrite(b, Arduino.LOW);
    72.   arduino.digitalWrite(a, Arduino.HIGH);
    73.   delay(del);
    74.   arduino.digitalWrite(en, Arduino.HIGH);
    75. }
    76. public void right(){
    77.   for (int i=1; i>0; i--){
    78.   next2();
    79.   next1();
    80.   next();
    81.   first();
    82.   println("Iteration #: " +i);
    83. }
    84. }
    85. public void left(){
    86.   for (int i=1; i>0; i--){
    87.   first();
    88.   next();
    89.   next1();
    90.   next2();
    91.   println("Iteration #: " +i);
    92. }
    93. }
    94.  
    95.  
     
  4. mrwest09

    Thread Starter New Member

    Mar 23, 2013
    7
    0
    Just to follow up. I got it working! Turns out it was a 12V motor and not a 5V.

    That was dumb. Thanks anyways!
     
Loading...