Hello all
I bought this motor with driver included, Anaheim Automation Stepper Motor + Nema23 23MD Driver (z) -CNC DIY Kit Mach3, 23MD106S-00-00-00, INPUTS SINKING, here is the manual.
The problem I have is that I always rotates one side only, counterclockwise facing him, can not get to spin clockwise.
I connect this way:
Motor Pin = Arduino Port
1 = 8
2 = 9
3 = 10
Here is my Arduino code:
int DirPin = 8;
int StepPin = 9;
int EnnablePin=10;
void setup(){
pinMode(DirPin, OUTPUT);
pinMode(StepPin, OUTPUT);
pinMode(EnnablePin, OUTPUT);
digitalWrite(EnnablePin, HIGH);
}
void loop() {
//turn left
digitalWrite(DirPin, LOW);
stepMotor();
delay(2000);
//turn right
digitalWrite(DirPin, HIGH);
stepMotor();
delay(2000);
}
void stepMotor(){
int i;
for (i = 0; i<(1000) ; i++){
digitalWrite(StepPin, HIGH);
digitalWrite(StepPin, LOW);
delayMicroseconds(200);
}
}
When the pin direction is off, turns smoothly, but when on, and should turn the opposite direction, turn the same side, but with difficulty, as if to cancel her movement.
Another thing is that you only need to connect the Arduino pin 9 (clock) and 10 (on / off), that engine will turn, connect to pin 9 of the motor 2 and 10 can be connected to any remaining pin, I work just as the 4 pin.
If someone have an example of how to run this engine with its scheme would be very grateful, because I found nowhere an example.
greetings
Farrop