CDROM drive stepper motor hack

Electronics 2010/03/05 00:25



This is not an application of CDROM drive stepper, but just a trial of controlling the stepper with Arduino controller board.

You should know about Arduino board to do this hack. Arduino is famous open source micro-controller board.

I used L293D motor driver chip in this circuit. You can drive one bipolar stepper or two DC motors with this L293D chip.
Input is variable resistance potentiometer. I connected it to the Arduino analog port 0. Potentiometer act as voltage divider. You can change input voltage into Arduino Analog 0 with the potentiometer from 0v to 5V. 

But potentiometer input is very unstable, so you have to do something to stabilize it, or the stepper is tend to clutter. There are some methods to stabilize input data. I did averaging the last 10 data. Averaging is simplest way to stabilize. But the performance is not so good. There are still some clutters in this circuit.

There are three motors in CDROM drive. One is spindle motor that is brushless DC motor and the other is pick-up motor that is stepper motor and another is tray drive motor that is normal DC motor.

The motor in this hack is pick-up motor.


 

You should connect earth of this circuit to Arduino ground(earth) port. 

And Arduino code here 

#include <Stepper.h>

int pot[10];

// change this to the number of steps on your motor
#define STEPS 100

// create an instance of the stepper class, specifying
// the number of steps of the motor and the pins it's
// attached to
Stepper stepper(STEPS, 8, 9, 10, 11);

// the previous reading from the analog input
int previous = 0;

void setup()
{
  // set the speed of the motor 
  stepper.setSpeed(200);
  Serial.begin(9600);
}

void loop()
{

  //averaging the last values to suppress clutter 
  int sum = 0;
  for (int i= 0; i<9; i ++)
  {
    pot[i]= pot[i+1];
    sum = sum + pot[i];
  }
  // get the sensor value
  pot[9] = analogRead(0);
  sum = sum+pot[9];
  int diff = sum / 100;
  Serial.print(pot[9]);Serial.print("\t");
  Serial.print(diff);Serial.print("\t");
  int val = previous - diff;
  Serial.println(val);  
  stepper.step(val);  
  // remember the previous value of the sensor
  previous = diff;
}
저작자 표시 동일 조건 변경 허락
크리에이티브 커먼즈 라이선스
Creative Commons License
Trackback 0 : Comments 13

Trackback Address :: http://blog.whattomake.co.kr/trackback/158 관련글 쓰기

  1. Favicon of http://pepsiman.tistory.com BlogIcon 펩시맨 2010/03/05 11:43 Modify/Delete Reply

    오...재밌는데요...^^
    씨디롬이 저렇게 생겼던가요? 전에 뜯었을땐 저런 모양이 아니었던걸로 기억하는데...머 제품마다 다를순 있지만요...다시한번 잘 살펴봐야 겠군요 ㅎㅎㅎ

    • Favicon of http://blog.whattomake.co.kr BlogIcon MrKiss 2010/03/05 21:49 Modify/Delete

      한참 많이 뜯어 낸 후의 모습입니다 ㅎㅎ
      제가 전에 유튜브에 이걸 올렸었는데 종종 어떻게 하냐고 물어 오는 외국 사람들이 있어서 안되는 영어로 다시 올렸습니다. ^^

  2. Favicon of http://stroysfera.com.ua BlogIcon stroy 2010/03/06 20:44 Modify/Delete Reply

    I have bipolar step motor but i can't to make it moove. Unipolar step motor is working good. I heard to bipolar it needs to be an H-bridge??? Is L293 have an this H-bridge? or it is a fake?

    • Favicon of http://blog.whattomake.co.kr BlogIcon MrKiss 2010/03/07 01:00 Modify/Delete

      http://www.datasheetcatalog.com/datasheets_pdf/L/2/9/3/L293.shtml
      As you see on the above pdf, L293 has two h-bridge circuit. H-bridge is just a circuit that can give reverse electricity to motor not so special thing.

  3. JsKim 2010/03/16 08:18 Modify/Delete Reply

    잘보고 갑니다....

  4. stroy 2010/03/26 16:23 Modify/Delete Reply

    Hello again, this weekend i have bought few L293DNE IC's and make some expereiments. Have an bipolar stepper motor from CR-ROM driver and it's WORKS!!!! :-) I spend 5 hours but with no results in fackt the problem was in capasitor i have forgot to mount in circuit, and there wasvery big interferences, because my ATTiny2313 was working not properly!

    • Favicon of http://blog.whattomake.co.kr BlogIcon MrKiss 2010/03/27 18:09 Modify/Delete

      It's curious why your circuit needs capacitor while I didn't used any capacitor in my stepper circuit.
      Any way, Is your stepper works well? Congratulations:D

  5. Vasay 2010/05/14 00:53 Modify/Delete Reply

    #include <Stepper.h>
    Where can I get this library?

    • Favicon of http://blog.whattomake.co.kr BlogIcon MrKiss 2010/05/14 11:20 Modify/Delete

      It's default library. You can use it if you just install the Arduino. In the menu Sketch-Import Library, you can see you have it already.
      If you don't have it install newest version.

  6. Vasay 2010/05/15 05:26 Modify/Delete Reply

    found, thanks!

  7. Favicon of http://fritzing.org/projects/l293-cd-stepper-driver/ BlogIcon Forvellos 2012/05/04 01:31 Modify/Delete Reply

    I did a Fritzing sketch and shared it, since I find your implementation very nice and esay to undertand for the newbies like me. I've licensed it with CC, but I don't know if it is the correct license, tell me any corrections nedded.
    Thanks.
    http://fritzing.org/projects/l293-cd-stepper-driver/

Write a comment

◀ PREV : [1] : ... [38] : [39] : [40] : [41] : [42] : [43] : [44] : [45] : [46] : ... [191] : NEXT ▶