Stepper motor low torque

I have a problem, i'm use stepper motor for robot car..motor is rotate but its wheel i touch then motor is stuck and vibration with noise..like this video left side motor AMCSTI - Source Two NeverStall Stepper Motor Controller vs Standard Driver Controller - YouTube please how to solve this problem..using A4988 driver.. (my english is not good :slight_smile: )

motor spec :
2 phase NEMA17 42mm 4-wire stepper motor.
Rated voltage: 12-24V
Power: 5W
Current: 1.7A
Rated Speed: 0-1500 RPM
Rated torque: 0.42 NM
Step angel: 1.8°
Ambient temperature: -20 ℃ -50 ℃
Insulation resistance:100MΩmin.(500V DC)
Dielectric strength: 500VAC for 1 minute
Shaft Radial Play: 0.02 Max. (450g-load)
Shaft Axial Play: 0.08 Max. (450g-load)
Max. radial force: 28N (20mm from the flange)
Max. axial force: 10N
Motor length: 40 (L) mm
Rated current: 1.68A
Resistence per phase: 1.5Ω
Inductance per phase: 2.3mH
Holding torque: 4.2 kg.cm
Number of motor leads.: 4
Detent torque: 150 g.cm
Rotor interia: 54 g.cm

code

// Define Constants

// Connections to A4988
const int dirPin = 2; // Direction
const int stepPin = 3; // Step

// Motor steps per rotation
const int STEPS_PER_REV = 200;

void setup() {

// Setup the pins as Outputs
pinMode(stepPin,OUTPUT);
pinMode(dirPin,OUTPUT);

pinMode (8, OUTPUT);//ms1
pinMode (9, OUTPUT);//ms2
pinMode (10, OUTPUT);//ms3
digitalWrite(8, HIGH);//ms1
digitalWrite(9, HIGH);//ms2
digitalWrite(10, HIGH);//ms3

}
void loop() {

// Set motor direction clockwise
digitalWrite(dirPin,HIGH);

// Spin motor one rotation slowly
for(int x = 0; x < STEPS_PER_REV; x++) {
digitalWrite(stepPin,HIGH);
delayMicroseconds(500);
digitalWrite(stepPin,LOW);
delayMicroseconds(500);
}

// Pause for one second
// delay(1000);

// Set motor direction counterclockwise
// digitalWrite(dirPin,LOW);

// Spin motor two rotations quickly
//for(int x = 0; x < (STEPS_PER_REV * 2); x++) {
///digitalWrite(stepPin,HIGH);
//delayMicroseconds(500);
//digitalWrite(stepPin,LOW);
//delayMicroseconds(500);
// }

// Pause for one second
//delay(1000);
}

a4988 diagram.png

Firstly, did you know you can comment out multiple lines of code with
/*
buncha code
*/

instead of using // before every single line?

For stepper motors, the amount of available torque is affected by what kind of stepping you are utilizing- half, full, micro, wave step. Otherwise your stepper just doesn't have much torque by design.

An A4988 is not really suitable for a motor that requires 1.7 amps. If you set the current limit for 1.7A you will almost certainly find the stepper driver overheating and cutting out. A Pololu DRV8825 would be better, but may still be too close to its limit for comfort.

If you set the current limit at about 1A the A4988 would probably be happy but then your motor could not develop its full torque.

You have not told us what stepper motor power supply you have (volts and amps).

These links may help.
Stepper Motor Basics
Simple Stepper Code

also look up the AccelStepper library

...R

thanx for all replies.. :slight_smile: :slight_smile: i'm use 11.1v(12.6v) 2.2A lipo battery

Stepper motors are very inefficient and are not really suited to battery power because they draw almost the full current even when stationary.

That said, I would expect an 11v power supply to be able to make your motor work well - until the battery discharges.

Be VERY CAREFUL not to over-discharge a LiPo battery.

...R

thanks Mr.Robin2..

For large stepper motors you cannot get away with trying to suddenly drive them at full speed, the
speed must be ramped up slowly enough for the motor inertia - in practice that means using the
AccelStepper library and experimenting with the maximum values to setMaxSpeed() and setAcceleration(),
both of which are experimentally determined for any given mechanical setup.

Use a moderate amount of microstepping in the first instance, x8 or x16 for instance, full steps are
definitely going to get you into trouble in any setup without mechanical viscous damping, due to the
heavy resonances of an undamped stepper motor rotor.

thanx mr.MarkT

this is not about the " Stepper motor low torque "..but i have some trouble with using the accelstepper library..

#include <AccelStepper.h>


AccelStepper LeftMotor(1, 37, 39); // pin 37 = step, pin 39 = direction
AccelStepper RightMotor(1, 36, 38); // pin 36 = step, pin 38 = direction


void setup() {
  LeftMotor.setMaxSpeed(400);
  RightMotor.setMaxSpeed(400);
 

pinMode (42, OUTPUT);//ms2 R
pinMode (40, OUTPUT);//ms3 R

  digitalWrite(42, LOW);//ms1 R
  digitalWrite(40, LOW);//ms2 R
  digitalWrite(38, LOW);//ms3 R

pinMode (45, OUTPUT);//ms1 L
pinMode (43, OUTPUT);//ms2 L
pinMode (41, OUTPUT);//ms3 L

  digitalWrite(45, LOW);//ms1 L
  digitalWrite(43, LOW);//ms2 L
  digitalWrite(41, LOW);//ms3 L


 
}

void FrontSstraight(){
    
  LeftMotor.setSpeed(400);
  RightMotor.setSpeed(400);

   LeftMotor.runSpeed();
   RightMotor.runSpeed();

   }

void ReversSstraight(){
     LeftMotor.setSpeed(-400);
     RightMotor.setSpeed(-400);

      LeftMotor.runSpeed();
   RightMotor.runSpeed();
  }
void Break(){
     LeftMotor.setSpeed(0);
     RightMotor.setSpeed(0);

     
      LeftMotor.runSpeed();
   RightMotor.runSpeed();
  
}
  

void loop() {  
   ReversSstraight();
   delay(3000);

   FrontSstraight();
   delay(3000);
   }

this code i upload but motors didn"t work..(motors are lock )

one by one methode uplode separately like this its work..

void loop() {  
   ReversSstraight();///////////// or FrontSstraight(); or Break();/////////
  
   }

how can i do

ReversSstraight in 3 seconds and after FrontSstraight in 3 seconds ?

You need to read the documentation and examples - you should be calling the run() method everytime round
loop() and never use delay() - that's the way the library works.

thanks mr. MarkT :slight_smile: :slight_smile: :slight_smile: :slight_smile: