목차

DVD Stepper Motor 구동

재료

  1. Arduino UNO
  2. L293d shield
    i.imgur.com_bootnrz.jpg
  3. DVD Writer에서 떼어 낸 Stepper Motor
    cdn.hackaday.io_images_9129671474387091351.jpg

DVD Writer에서 떼어낸 Stepper Motor의 핀 배열

i.imgur.com_k2q5otp.jpg

Motor Shield와 DVD Writer Stepper Motor 연결하기

i.imgur.com_4tf4jko.jpg
i.imgur.com_nutqdiy.jpg

테스트용 소스 코드

#include <AFMotor.h>
// Motor with 200 steps per rev (1.8 degree)
// to motor port #1 (M1 and M2)
AF_Stepper motor_2(200, 2);
AF_Stepper motor_1(200, 1);
 
void setup() {
// set up Serial library at 9600 bps
Serial.begin(9600);
Serial.println("Stepper test!");
motor_1.setSpeed(400); // 50 rpm
motor_2.setSpeed(400); // 50 rpm
}
void loop() {
 
Serial.println("Micrsostep steps");
motor_1.step(50, FORWARD, MICROSTEP);
motor_2.step(50, FORWARD, MICROSTEP);
 
motor_1.step(50, BACKWARD, MICROSTEP);
motor_2.step(50, BACKWARD, MICROSTEP);
 
motor_1.step(100, FORWARD, MICROSTEP);
motor_2.step(100, FORWARD, MICROSTEP);
 
motor_1.step(100, BACKWARD, MICROSTEP);
motor_2.step(100, BACKWARD, MICROSTEP);
 
motor_1.step(200, FORWARD, MICROSTEP);
motor_2.step(200, FORWARD, MICROSTEP);
 
motor_1.step(200, BACKWARD, MICROSTEP);
motor_2.step(200, BACKWARD, MICROSTEP);
 
motor_1.step(250, FORWARD, MICROSTEP);
motor_2.step(250, FORWARD, MICROSTEP);
 
motor_1.step(250, BACKWARD, MICROSTEP);
motor_2.step(250, BACKWARD, MICROSTEP);
 
}