I need help in increasing the RPM of my stepper motor.
- I am using a 0.9 degree bi-polar stepper motor (17HM08-1204S)
- I am using a Pololu A4988 driver with a voltage reference at 0.544V for 1A
- I have connected the A4988 driver to an Arduino Mega
My goal is to achieve about 1000 RPM and as high as 2000 RPM if possible (the torque does not matter to me, I just want to achieve the speed for now).
Circuit is hooked up as per: https://a.pololu-files.com/picture/0J3360.600.png?d94ef1356fab28463db67ff0619afadf (with 12V going into the VMOT of the A4988)
I then tried using the “BasicStepperDriver” example from the Arduino Library linked by the reference of the A4988 driver page (https://github.com/laurb9/StepperDriver), and used the code:
#include <Arduino.h>
#include "BasicStepperDriver.h"
// Motor steps per revolution.
#define MOTOR_STEPS 400
#define RPM 120
// Since microstepping is set externally, make sure this matches the selected mode
// If it doesn't, the motor will move at a different RPM than chosen
// 1=full step, 2=half step etc.
#define MICROSTEPS 1
// All the wires needed for full functionality
#define DIR 8
#define STEP 9
// 2-wire basic config, microstepping is hardwired on the driver
BasicStepperDriver stepper(MOTOR_STEPS, DIR, STEP);
void setup() {
stepper.begin(RPM, MICROSTEPS);
// if using enable/disable on ENABLE pin (active LOW) instead of SLEEP uncomment next line
// stepper.setEnableActiveState(LOW);
}
void loop() {
// energize coils - the motor will hold position
// stepper.enable();
/*
* Moving motor one full revolution using the degree notation
*/
stepper.rotate(360);
delay(5000);
}
I am able to get the motor rotating up until 300 rpm, but the motor only vibrates at rpm higher than that.
I then tried using the “AccelTest” example from the Arduino Library linked by the reference of the A4988 driver page, and used the code:
#include <Arduino.h>
// Motor steps per revolution.
#define MOTOR_STEPS 400
// Target RPM for cruise speed
#define RPM 120
// Acceleration and deceleration values are always in FULL steps / s^2
#define MOTOR_ACCEL 2000
#define MOTOR_DECEL 1000
// Microstepping mode. If you hardwired it to save pins, set to the same value here.
#define MICROSTEPS 16
#define DIR 8
#define STEP 9
/*
* Choose one of the sections below that match your board
*/
#include "A4988.h"
#define MS1 10
#define MS2 11
#define MS3 12
A4988 stepper(MOTOR_STEPS, DIR, STEP, MS1, MS2, MS3);
void setup() {
stepper.begin(RPM, MICROSTEPS);
stepper.enable();
/*
* Set LINEAR_SPEED (accelerated) profile.
*/
stepper.setSpeedProfile(stepper.LINEAR_SPEED, MOTOR_ACCEL, MOTOR_DECEL);
/*
* Using non-blocking mode to print out the step intervals.
* We could have just as easily replace everything below this line with
* stepper.rotate(360);
*/
stepper.startRotate(360);
}
void loop() {
}
(I have connected MS1, MS2, and MS3 accordingly to my arduino board)
The problem I am having with this is that the motor only vibrates when it should at least rotate once at the set-up part of the code. I tried changing the step resolution to 16, 8, and 2 while keeping the RPM at 120 but the motor will not turn at all. The driver also gets very hot.
Is there a way for me to increase the RPM?
- Do I need to increase the voltage at VMOT of the driver to 24V? (I find the driver getting very hot at just 12 V so I am reluctant to try this as I might burn out the driver)
- Am I on the right track in stepping at a higher resolution with acceleration and deceleration to achieve higher speeds?