0
\$\begingroup\$

I've been working on this TB6600 design (schematic shown here). Q1 ensures that the motor remains within the current limits. The TB6600 drives the ALERT pin low when the current limit is exceeded. Q2 and Q3 are for the torque control. IF there is a step of continous pulses the TQ pin is held high and hence maintain 100% torque. Current sense resistors are 5 x 1R 1W resistors. VCC is 24V and stepper resolution is set at 1/16.

However this does not seem to be working. The motor moves a little and stops.

enter image description here

Here is the code I'm using to test the motor (a NEMA 23 stepper motor rated at 2.8A). The code is supposed to drive the motor through 200 steps and hence make one full circle. However, that does not work. I also tried driving this with grbl but I get the same results. What am I missing?

// defines pins numbers
const byte dirPinX = 5;
const byte stepPinX = 2;
const byte enablePin = 8;

void setup() {
  // Sets the two pins as Outputs
  pinMode(dirPinX, OUTPUT);
  pinMode(stepPinX, OUTPUT);
  pinMode(enablePin, OUTPUT);

  digitalWrite(enablePin, LOW);
}

void loop() {

  digitalWrite(enablePin, HIGH); 

  digitalWrite(dirPinX, HIGH); // Enables the motor to move in clockwise direction

  for(int x = 0; x < 200; x++) {
    digitalWrite(stepPinX, HIGH);
    delayMicroseconds(500);
    digitalWrite(stepPinX, LOW);
    delayMicroseconds(500);
  }
  delay(1000); // One second delay

  digitalWrite(dirPinX, LOW); // Enables the motor to move in anti-clockwise direction

  for(int x = 0; x < 200; x++) {
    digitalWrite(stepPinX, HIGH);
    delayMicroseconds(500);
    digitalWrite(stepPinX, LOW);
    delayMicroseconds(500);
  }
  delay(1000); // One second delay

}
\$\endgroup\$
2
  • \$\begingroup\$ Are you sure that Q1 is not being activated? \$\endgroup\$
    – Dave Tweed
    May 19, 2017 at 11:07
  • \$\begingroup\$ I forgot to update this post. Long story short, this now works properly. With the code above, I had messed up the microsteps. Also I had not turned off the enable pin after the rotation is complete. This meant that the chip was always on and that heated it up to a point where it would just shutdown. With grbl, the EN is active low. Once I changed that this worked great with grbl as well. \$\endgroup\$ May 19, 2017 at 12:20

1 Answer 1

1
\$\begingroup\$

If you're using 1/16 microstepping, a full circle is 200*16=3200 steps in your program.

\$\endgroup\$
2
  • \$\begingroup\$ Actually s/he is right. I did mess up the microsteps and the enable pin sequence. This is why it was not working the way it was supposed to. \$\endgroup\$ May 19, 2017 at 12:22
  • 1
    \$\begingroup\$ @electrophile Did this answer solve the problem for you? What should I do when someone answers my question? \$\endgroup\$ Jun 17, 2021 at 11:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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