Stepper Motor Bluetooth RPM controller

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.


image

Please post links to the steppers datasheet, especially the new stepper.

The A4988 driver is rated for 1A with no heat sink and 1.5A with a heat sink and fan cooling. And that is for a quality unit. Chinese clones may (probably) not meet that spec.

The first thing thst needs done is to get a proper stepper driver. The DRV8825 will do 1.5A with no heat sink and 2A with heat sink and fan cooling. The DRV8825 will directly replace the A4988 in the CNC shield.

What does that mean? How did you increase voltage?

I mean using the potentiometer of the driver

Hi I change the driver to DRV 8825 but the problem is the same, only with 50 rpm the stepper starts to vibrate but not with 40 or 100 rpm

Are you using microstepping? If not you may be a victim of resonance. See this page >> What is stepper motor resonance and how can it be avoided?

Try setting the driver to, at least, x4 microstepping. You will have to adjust your math for RPM to steps per second. The DRV8825 page that I linked has a table of jumper settings for microstepping.

Make sure to properly set the stepper drive coil current limit. It is very important. Do not just twiddle the pot. I likely will not do any good, but could easily cause damage to the motor or driver. The Pololu page that I linked has good instructions.

1 Like

Thank you men I'll do what you say
what temperature do you think is normal in the heat sink of the driver? ,I need all stepper torque so I can't do microstepping so I'm gonna try to reach the minumum current to work with 50 rpm

What is the voltage of your stepper motor power supply? To get more torque, use a motor power supply of higher voltage, up to the maximum allowed by the driver (45V for DRV8825). That may allow you to add some microstepping.

If you change the power supply voltage, you must also re-set the driver coil current limit.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.