2016年3月15日 星期二

TB6560 研究筆記





   http://goods.ruten.com.tw/item/show?21529132593035

57步進馬達 套裝 57BYGH51 兩相4線 含驅動器 TB6560










arduino + TB6560  :


Step 1: connection

Connection to arduino
pin 9 (Step pin) to CLK+,
pin 8 (Dir pin) to CW+,
CLK- and CW- connect to GND arduino.
Do not connect EN+ and EN- to any ARDUINO PIN.
Stepper motor connection, you need to know which color is A+, A-, B+ and B-, according to the stepper motor spec. sheet.
It only works for 1/8 step ( S3 on and S4 on) and 1/16 step (S4 only on, S3 off), half and full bridge does not work (for my case).
Amp setting can be change according to the table on the DRIVER.

Step 2: THE CODE

int Distance = 0; // Record the number of steps we've taken 
void setup() {
pinMode(8, OUTPUT);  //   direction
pinMode(9, OUTPUT); //  step 
digitalWrite(8, LOW);
digitalWrite(9, LOW);
}
void loop() {
digitalWrite(9, HIGH);
delayMicroseconds(100);
digitalWrite(9, LOW);
delayMicroseconds(100);
Distance = Distance + 1; // record this step // Check to see if we are at the end of our move
// two rotation for 1/8 bridge and 1 rotation for 1/6 bridge (for this code)
if (Distance == 3200) { // We are! Reverse direction (invert DIR signal)
if (digitalRead(8) == LOW) {
digitalWrite(8, HIGH); }
else {
digitalWrite(8, LOW);
} // Reset our distance back to zero since we're // starting a new move
Distance = 0; // Now pause for half a second delay(500);
}
}



Reference : http://www.electrodragon.com/w/TB6560_3A_Stepper_Motor_Driver_Board_Single-Axis

Reference : http://world.taobao.com/item/43795521964.htm?fromSite=main&spm=a1z3o.7695460.0.0.RDMGep

Reference : http://www.instructables.com/id/ARDUINO-UNO-TB6560-Stepper-motor-driver/

沒有留言:

張貼留言