Hello everyone
I have a project that consists of the speed control of a stepper motor nema 17 using an application via Bluetooth, it has been working very well until I changed the motor another nema 17 even more powerful, now in the application the motor varies all speeds except 50 rpm, it takes lower and higher speeds but only with that presents problems
I set up the current for the new motor (I am using a cnc shield with the a4988 driver) the calculation looks like this: 1.8A*(8*0.1)*0.7=1.001v
The last motor was 42HD4027-01 and the new one is 17hs8401b single shaft
if I increse voltage from A4988 it will get 50 rpm but the motor and the driver get so hot I don't want to damage them.
#include <SoftwareSerial.h>
#include <AccelStepper.h>
// Definimos los pines utilizados
const int pinStep = 2; // esta configurado en x
const int pinDir = 5;
const int pinEnable = 8;
// Creamos un objeto de tipo AccelStepper
AccelStepper stepper = AccelStepper(1, pinStep, pinDir);
SoftwareSerial BTSerial(10, 11); // Creamos un objeto SoftwareSerial para la comunicación Bluetooth
float rpm = 0;
const int dir = -1; // 1 para CW, -1 para CCW
void setup() {
// Configuramos los pines
pinMode(pinEnable, OUTPUT);
digitalWrite(pinEnable, LOW); // Habilitamos el driver
// Configuramos el objeto AccelStepper
stepper.setMaxSpeed(2000); // Velocidad máxima en RPM
BTSerial.begin(38400); // Iniciamos la comunicación Bluetooth
}
void loop() {
char c;
if(BTSerial.available()) {
c = BTSerial.read();
if (c == '1') {
rpm = 50;
}
if (c == '2') {
rpm = 100;
}
if (c == '3') {
rpm = 150;
}
if (c == '4') {
rpm = 200;
}
if (c == '5') {
rpm = 250;
}
if (c == '6') {
rpm = 300;
}
if (c == '7') {
rpm = 350;
}
if (c == '8') {
rpm = 0;
}
if (c == '9') {
rpm = 10;
}
if (c == 'A') {
rpm = 20;
}
if (c == 'B') {
rpm = 30;
}
if (c == 'C') {
rpm = 40;
}
stepper.setSpeed((dir * (float) rpm / 60.0) * 200.0);
}
stepper.runSpeed();
}
it is a very strange situation, what do you think I should do, it is very important to use the 50 rpm.