Go Down

Topic: Stepper Motor Speed Problem (Read 438 times) previous topic - next topic

pumpbreaks

Jan 14, 2020, 03:25 am Last Edit: Jan 14, 2020, 03:27 am by pumpbreaks
i am very new to all of this put i will try to explain as best as i can.

i am using a arduino uno with big easy driver powering a 1.5amp nema 17 with the AccelStepper library.

i am trying to run the stepper motor forward for x amount of step and then backward the same steps. i found code that works but no matter what i change i cannot get it to go any faster than about 3rps.

i know it can go alot faster because i can get it to work using the constant speed example.

here is my code, what am i missing?

Code: [Select]
// Include the AccelStepper library:
#include <AccelStepper.h>
// Define stepper motor connections and motor interface type. Motor interface type must be set to 1 when using a driver:
#define dirPin 3
#define stepPin 2
#define motorInterfaceType 1
// Create a new instance of the AccelStepper class:
AccelStepper stepper = AccelStepper(motorInterfaceType, stepPin, dirPin);
void setup() {
  // Set the maximum speed and acceleration:
  stepper.setMaxSpeed(15000);
  stepper.setAcceleration(9000);
}
void loop() {
  // Set the target position:
  stepper.moveTo(32000);
  // Run to target position with set speed and acceleration/deceleration:
  stepper.runToPosition();
  // Move back to zero:
  stepper.moveTo(0);
  stepper.runToPosition();
}


thanks for your help

jremington

#1
Jan 14, 2020, 03:54 am Last Edit: Jan 14, 2020, 04:04 am by jremington
The outdated Big Easy Driver is unsuitable for a 1.5 A stepper, but do post a link to your motor data sheet or product page, and state the current/voltage characteristics of your motor power supply.

Pololu sells much more capable stepper drivers. This one is inexpensive and would work well with a 1.5A stepper.

Be sure to follow Pololu's instructions for wiring, and especially, for setting the current limit properly. For fastest step rates, use a high voltage (e.g. 24-32V) motor power supply.

Finally, do not use a breadboard for wiring motors, or any high current device. The tracks will burn and you will probably end up destroying the driver.

pumpbreaks

#2
Jan 14, 2020, 04:39 am Last Edit: Jan 14, 2020, 04:40 am by pumpbreaks
Thanks for your help, I was hoping to use this driver as I have just paid 22GBP for it. Maybe I should return. :(


Using 12v 2amp power

3D Printer High Torque 17 Stepper Motor 300mN 1.5A 2-phase 4-wire

Specifications:

Dimensions: 42 x 42 x 34mm
Rated current (single-phase): 1.5A DC
Rated voltage: 4.8V
Power rating: 6.6W
Resistance: 3.2Ω
Step angle: 1.8 °
Static torque: 320mN.m (I = 1.5A)
Location moment: 12mN.m
Moment of inertia: 38g.cm2
The maximum load starting frequency: ≥1500pps
The maximum no-load operating frequency: ≥8000pps
Inductance: 3MH

Working conditions:

Ambient temperature: -20~50 °C
Relative humidity: 90% MAX
Mounting position: shaft horizontal or vertical mounting
Motor wiring: one meter

jremington

#3
Jan 14, 2020, 04:58 am Last Edit: Jan 14, 2020, 05:44 am by jremington
Unfortunately, many sellers of the Big Easy Driver misrepresent its capabilities, for example Sparkfun claims "2A/phase", which is simply not true.

The BED will handle at most 1A/phase continuously, above that it overheats and fully or partially shuts down, which might explain the poor performance you observe.

If you very carefully adjust the BED current limit to 1A or slightly less, and use a 24V motor power supply, it will work with your motor, but with reduced torque and speed than the motor specifications state.

JCA34F

Quote
stepper.setMaxSpeed(15000);
For a 200 step per rev motor, that would be 75 revs per second or 4500 RPM, what microstep setting are you using?

pumpbreaks

I dont think my stepper motor is 1.5a either, on the limiter I only have it about half way.

The motor runs smooth and doesnt skip. I can control the speed using the sample program constant speed, I just cannot change the speed on my program above.

I belive I am running st 1/16 step, I have no idea how to change it, maybe that's my problem.

The big easy driver powers this motor fine, I am convinced it's the code

pumpbreaks

i fixed it!

change to another example.

Code: [Select]
/*Example sketch to control a stepper motor with A4988 stepper motor driver, AccelStepper library and Arduino: number of steps or revolutions. More info: https://www.makerguides.com */
// Include the AccelStepper library:
#include <AccelStepper.h>
// Define stepper motor connections and motor interface type. Motor interface type must be set to 1 when using a driver:
#define dirPin 3
#define stepPin 2
#define motorInterfaceType 1
// Create a new instance of the AccelStepper class:
AccelStepper stepper = AccelStepper(motorInterfaceType, stepPin, dirPin);
void setup() {
  // Set the maximum speed in steps per second:
  stepper.setMaxSpeed(9000);
}
void loop() {
  // Set the current position to 0:
  stepper.setCurrentPosition(0);
  // Run the motor forward at 200 steps/second until the motor reaches 400 steps (2 revolutions):
  while(stepper.currentPosition() != 32000)
  {
    stepper.setSpeed(8000);
    stepper.runSpeed();
  }
  delay(100);
  // Reset the position to 0:
  stepper.setCurrentPosition(0);
  // Run the motor backwards at 600 steps/second until the motor reaches -200 steps (1 revolution):
  while(stepper.currentPosition() != -32000)
  {
    stepper.setSpeed(-8000);
    stepper.runSpeed();
  }
 
  delay(100);
}


i can now set the speeds,

cheers everyone

Go Up