Arduino Due, Easy Driver, Stepper with AccelStepper Issues

280 views
Skip to first unread message

Michael Rencheck

unread,
May 17, 2018, 5:09:44 PM5/17/18
to accelstepper
Hi all,

So I have been having some trouble getting my set up working together with the AccelStepper library. I am using an Arduino Due, an Easy Driver, and a NEMA 14 BiPolar stepper. 

I was trying some of my own code implementing the library and could get it to work so I checked all of my wire connections to rule that out  and then I started backtracking the code complexity. I tried the example 3 on the Easy Driver site (http://www.schmalzhaus.com/EasyDriver/Examples/EasyDriverExamples.html) and I could hear the stepper wine as the loop runs through and can feel the steps at slower speeds, but not actual rotation. Then just tried the Constant example sketch provided with the library. At a setSpeed(100); I was able to get the motor to spin, but it was super slow (like 5 rpm). Also when I used a low value in setSpeed(), like setSpeed(2) i could feel the coils activate twice per second and it would spin. 

I wrote a quick manual program instead of using the AccelStepper library and everything worked!

I also have an Uno laying around, so I uploaded example 3 sketch to it and was also able to get the stepper to run as expected with the library. 

So based on that, I think there is something I am missing to have library compatible with the Due and the driver/stepper. Is there something special that I need to do account for the different procession and logic wrt. the library? Any thoughts are appreciated!


A few caveats:
-I have closed the jumper on the Easy Driver that lets it operate on 3.3V instead of 5V
-I have played around with the current potentiometer on the driver
-I have verified that the stepper wires are attached to the proper points.
-I am not using any of the micro stepping connection points or the enable or rst connections on the driver.
-Power supply is 12V, 3A

Here is the code I am trying to run (It's just Example 3)

#include <AccelStepper.h>

int pos = 3600;

AccelStepper stepper(AccelStepper::DRIVER, 47, 46);

void setup() {

  stepper.setMaxSpeed(3000);
  stepper.setAcceleration(1000);

}

void loop() {

  if (stepper.distanceToGo() == 0)
    {
      delay(500);
      pos = -pos;
      stepper.moveTo(pos);
    }
    stepper.run();
}
Reply all
Reply to author
Forward
0 new messages