Increase RPM of NEMA34 86HS9860A4 1.8 degree 6amp stepper motor

hi,

i have a project. i want to run stepper in two configuration one is slow 1mm/sec linear movement. I achieved this. another one is rapid motion. I tried many options and settings still not fast enough. is there an rpm limit for this stepper. if yes whats it. I'm using DM860 as stepper driver and arduino mega as controller and Accelstepper library


any help will be really appreciated.

here is the full code

#include <AccelStepper.h>

// Define pin numbers
const int stepPin = 30; // Step pin
const int dirPin = 31; // Direction pin
const int upPin = 8; // Clockwise switch
const int downPin = 9; // Anticlockwise switch
const int topLimitPin = 2; // Top limit switch
const int bottomLimitPin = 4; // Bottom limit switch
const int stopPin = 10;

#define GEAR_RATIO 5
#define STEPPER_RPM 50
#define MICRO_STEPS 2
#define STEPS_PER_REV 200

// Create AccelStepper instance
AccelStepper stepper(1, stepPin, dirPin);

const long long stepsPerRevolution = static_cast<long>(STEPS_PER_REV) *
static_cast<long>(MICRO_STEPS) *
static_cast<long>(STEPPER_RPM) /
static_cast<long>(GEAR_RATIO); // Adjust based on stepper motor specifications



void setup() {
// Set up inputs and outputs
pinMode(upPin, INPUT_PULLUP);
pinMode(downPin, INPUT_PULLUP);
pinMode(topLimitPin, INPUT_PULLUP);
pinMode(bottomLimitPin, INPUT_PULLUP);
pinMode(stopPin, INPUT_PULLUP);


stepper.setCurrentPosition(0); // Set the initial position to zero

Serial.begin(9600);


Serial.print("stepsPerRevolution: " );
Serial.println(static_cast<long>(stepsPerRevolution));



}

void loop() {
// Check for clockwise movement until top limit switch is pressed
if (digitalRead(upPin) == LOW && digitalRead(topLimitPin) == HIGH) {
move_up();
while ((digitalRead(topLimitPin) == HIGH) && (digitalRead(stopPin) == HIGH)) {
stepper.move(stepsPerRevolution); // Move a full rotation in the clockwise direction
stepper.runSpeed(); // Run at the set speed
}

stepper.stop();
stepper.setCurrentPosition(0);
delay(1000); // Add a delay for debugging
}

// Check for anticlockwise movement until bottom limit switch is pressed
if (digitalRead(downPin) == LOW && digitalRead(bottomLimitPin) == HIGH) {
move_down();
while ((digitalRead(bottomLimitPin) == HIGH) && (digitalRead(stopPin) == HIGH)) {

stepper.move(-40000); // Move a full rotation in the anticlockwise direction
stepper.runSpeed(); // Run at the set speed
}

stepper.stop();
stepper.setCurrentPosition(0);
delay(1000); // Add a delay for debugging
}
}


void move_down(){
stepper.setMaxSpeed(40000);
stepper.setAcceleration(40000);
}

void move_up(){
// Set initial motor speed and acceleration
stepper.setMaxSpeed(stepsPerRevolution);
stepper.setAcceleration(stepsPerRevolution);

}
 
Have you set the Pulse / Rev to the lowest setting on the DM860 ?
I achieved speed by using fastaccel library. No the problem is I want to run stepper and get reading from loadcell simultaneously. But the problem is when stepper is running I'm not getting reading from loadcell voce versa. How can I run multiple task simultaneously in Arduino
 
Top