Stepper Motor gets hot when using stepper.stop()

2,351 views
Skip to first unread message

larz250sx

unread,
Apr 17, 2017, 7:31:12 PM4/17/17
to accelstepper
I've tried stepper.stop()

And I've tried
stepper.setSpeed(0)
stepper.runSpeed()


Still getting power to the motor, causing it to get quite hot... is there a way to disable the pins in a stop state? I'm using a state machine

gregor

unread,
Apr 18, 2017, 3:08:50 AM4/18/17
to accelstepper
Hi, 
it is possible, but depends on the stepper motor (or driver) you are using. an example for A4988/DRV8825 stepper motor drivers:
#include <AccelStepper.h>

AccelStepper stepper(AccelStepper::DRIVER, 8, 9);

void setup() {
  // put your setup code here, to run once:
  stepper.setMaxSpeed(1000);
  stepper.setAcceleration(100);
  stepper.setEnablePin(10);
  stepper.setPinsInverted(false, false, true);

  stepper.move(10000);
}

void loop() {
  // put your main code here, to run repeatedly:
  stepper.runToPosition();
  stepper.disableOutputs();
}
connect the arduino to the driver's enable pin (in this example, using pin 10) and use AccelStepper::setEnablePin() to provide the pin number to AccelStepper. the AccelStepper::setPinsInverted() call is necessary because on A4988 and DRV8825 drivers, the enable pin is active low. 
after the movement has finished, call AccelStepper::disableOutputs() to disable the driver, cutting power to the steppers. if you want to step the stepper again you have to call AccelStepper::enableOutputs() first. 

larz250sx

unread,
Apr 19, 2017, 9:21:12 AM4/19/17
to accelstepper
Motor driver TB6612 has a stby pin... if I wrote HIGH to that pin, would that be similar to what you did with enable on the DRV8833?

gregor

unread,
Apr 19, 2017, 11:44:13 AM4/19/17
to accelstepper
according to the description here ( https://learn.adafruit.com/adafruit-tb6612-h-bridge-dc-stepper-motor-driver-breakout/pinouts ) and here ( https://www.pololu.com/product/713 ) the STBY pin seems to have the same function and logic as the enable pin on A4988 and DRV8825 drivers.

gregor

unread,
Apr 19, 2017, 11:48:07 AM4/19/17
to accelstepper
i clicked 'post' too soon again. the STBY pin has the opposite function of the enable pin. pull the STBY pin high to enable the steppers, low to disable. the setPinsInverted() call is not necessary with this driver, because STBY is active low.
Reply all
Reply to author
Forward
0 new messages