I am trying to control a Nema 23 with a ST-6600 (Very similar to TB-6600) stepper driver and an Arduino Uno. I have never used an Arduino so this is fairly new to me. I read through a couple forums and came up with the following setup for connecting the stepper driver to the Arduino:
Pul+ = 9
Pul - = GND
Dir + = 8
Dir - = GND
Ena + = 7
Ena - = GND
I have attached the code I used to test the motor. Every time I try to run the code nothing happens and the motor doesn't run. Is there something wrong with the pins I used or maybe the code? Any guidance or information would be extremely helpful.
For short programs it makes life much easier if you post the code directly
int dirpin = 8;
int steppin = 9;
int enable = 7;
void setup() {
// put your setup code here, to run once:
pinMode(dirpin, OUTPUT);
pinMode(steppin, OUTPUT);
digitalWrite(enable, HIGH);
}
void loop() {
// put your main code here, to run repeatedly:
int i;
digitalWrite(dirpin, HIGH); //Set the direction
delay(100);
for (i=0;i<4000;i++) {
digitalWrite(steppin, LOW);
delayMicroseconds(400);
digitalWrite(steppin, HIGH);
delayMicroseconds(400);
}
digitalWrite(dirpin, LOW);
delay(100);
for (i=0;i<4000;i++) {
digitalWrite(steppin, LOW);
delayMicroseconds(400);
digitalWrite(steppin, HIGH);
delayMicroseconds(400);
}
}
At first glance it looks like your code should work. I would make the delay()s much longer to start with - perhaps 100 millisecs. If that works then you can try for higher speeds.
You only need a very short pulse so I would rearrange your code like this
You need to read the datasheet to find out if Enable should be HIGH or LOW to make the motor work - or try both options. OOPS, I just noticed you have no pinMode() for your enable pin.
You have not said what power supply (volts and amps) you are using for the motor.
The power supply we have is 24V and 10A. The power supply is connected to the stepper driver at the DC+ and DC- ports. I have also seen examples where the stepper driver is connected to the arduino's power supply pins, do you recommend trying this instead?
Hmm ok I changed the code and tried both HIGH or LOW but the motor still won't run. How would I configure the pinMode() for enable? Is it an input or an output?