정보나눔

오픈소스하드웨어 프로젝트에 대한 다양한 정보를 나누는 공간입니다.

모터쉴드와 스테핑모터 연결 좀 봐주실 수 있을까요..?
유나 | 2015-06-01
-스테핑 모터
 
-모터쉴드
 
이렇게 둘이 호환시키려고 하는데요
데이터시트를 봐도 어떻게 연결을 해야하는지 모르겠습니다ㅠㅠ
모터쉴드 제작사 사이트에서는 http://www.adafruit.com/product/324 이 스테핑 모터를 사용하는데요
제가 사용하는 거랑 같은 모터가 아닌가요..?
 
이게 사이트에서 제공하는 쉴드-스테핑 모터 예제 소스이구요
 
/* 
This is a test sketch for the Adafruit assembled Motor Shield for Arduino v2
It won't work with v1.x motor shields! Only for the v2's with built in PWM
control
 
For use with the Adafruit Motor Shield v2 
*/
 
 
#include <Wire.h>
#include <Adafruit_MotorShield.h>
#include "utility/Adafruit_PWMServoDriver.h"
 
// Create the motor shield object with the default I2C address
Adafruit_MotorShield AFMS = Adafruit_MotorShield(); 
// Or, create it with a different I2C address (say for stacking)
// Adafruit_MotorShield AFMS = Adafruit_MotorShield(0x61); 
 
// Connect a stepper motor with 200 steps per revolution (1.8 degree)
// to motor port #2 (M3 and M4)
Adafruit_StepperMotor *myMotor = AFMS.getStepper(200, 2);
 
 
void setup() {
  Serial.begin(9600);           // set up Serial library at 9600 bps
  Serial.println("Stepper test!");
 
  AFMS.begin();  // create with the default frequency 1.6KHz
  //AFMS.begin(1000);  // OR with a different frequency, say 1KHz
  
  myMotor->setSpeed(10);  // 10 rpm   
}
 
void loop() {
  Serial.println("Single coil steps");
  myMotor->step(100, FORWARD, SINGLE); 
  myMotor->step(100, BACKWARD, SINGLE); 
 
  Serial.println("Double coil steps");
  myMotor->step(100, FORWARD, DOUBLE); 
  myMotor->step(100, BACKWARD, DOUBLE);
  
  Serial.println("Interleave coil steps");
  myMotor->step(100, FORWARD, INTERLEAVE); 
  myMotor->step(100, BACKWARD, INTERLEAVE); 
  
  Serial.println("Microstep steps");
  myMotor->step(50, FORWARD, MICROSTEP); 
  myMotor->step(50, BACKWARD, MICROSTEP);
}
 
 
 
 
 
이렇게 연결을 해봤으니 작동이 되지 않았습니다ㅠㅠ
포트 연결이 틀린 걸까요..?
전원은 9V전원 연결했습니다. 아두이노 기판은 그냥 노트북 전원으로 연결했구요.
다른 센서로 테스트해본 결과 아두이노와는 정상 호환됩니다.
프로필사진

Klant 2015-06-01 09:19:01

M3에 A와 C 선을 M4에 B와 D 선을 연결해보시겠어요? 

즉 M3에 검은색과 초록색 선을 

M4에 빨간색선과 파란색 선을 연결하시면 될 것 같네요. 

 

프로필사진

SaBo 2015-06-01 09:41:26

스텝모터 구동 튜토리얼 링크 걸어드립니다.

스텝모터 사용하기

일단 스텝모터의 구동원리를 파악하시고 연결하시는게 더 정확할 것 같습니다.

튜토리얼에서 사용한 모터 쉴드는 다른 제품이지만 똑같은 4핀 구조로 원리를 알면

질문자님께서 사용하고 계신 모터쉴드에도 동일하게 접속 가능합니다.

이전글   |    아두이노 스토리에서 추천 받고 왔습니다.... 2015-05-30
다음글   |    http://kocoafab.cc/tutorial/view/297 관련 문의입니다.... 2015-06-02