0

I am working on an Arduino Mega 2560 and BL-TB6560-V2.0 driver for running a stepper motor. Initially I was able to run the stepper in both direction with code given and a schematic as per this image.

schematic wiring.

int dirpin = 7;
int dirH = 12;
int steppin = 9;

void setup() {
  pinMode(dirpin, OUTPUT);
  pinMode(steppin, OUTPUT);
  pinMode(dirH, OUTPUT);
}

void loop() {
  digitalWrite(dirpin, LOW); // Set the direction.
  digitalWrite(dirH, LOW);
  delay(1000);
  for (int i = 0; i<32767; i++) {
    // Iterate for 4000 microsteps.(32767)
    digitalWrite(steppin, LOW); // This LOW to HIGH change is what creates the
    digitalWrite(steppin, HIGH); // "Rising Edge" so the easydriver knows to when to step.
    delayMicroseconds(50);
  }
  delay(1000);
  digitalWrite(dirpin, LOW); // Set the direction.
  digitalWrite(dirH, HIGH);
  for (int j = 0; j<32767; j++) {
    // Iterate for 4000 microsteps.
    digitalWrite(steppin, LOW); // This LOW to HIGH change is what creates the
    digitalWrite(steppin, HIGH); // "Rising Edge" so the easydriver knows to when to step.
    delayMicroseconds(50);
  }
}

But now when I am trying it, the same stepper is not rotating. What could be the reason? I have checked the driver voltage, it's ok, and the code and schematic is the same.

schematic Diagram

  • 2
    idownvotedbecau.se/imageofcode – gre_gor Nov 1 '17 at 12:27
  • 2
    Schematic photo is not bad by itself. It's the bad drawing, the photo angle, the bad lighting and the poor contrast. – user31481 Nov 1 '17 at 13:30
  • 1
    There is no ground connection to the arduino on the schematic, hope there is one in the real world. – Wirewrap Jan 1 '18 at 17:13
  • Why do you inverse the polarity on the 24V site ? Is this a mistake in the drawing ? – Edwin Holt Apr 3 '18 at 11:09
1

I just removed the ENE(+) pin of the driver, which was connected to the +5V. Now it's working and the stepper is rotating.

I just got a hint from this video.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.