My stepper motor isn't working properly( its taking less steps then it should)(Arduino)

bertus

Joined Apr 5, 2008
21,451
Hello,

Looking at the drawing, you are powering the steppermotor is powered with 5 Volts.
What is the stepper motor data?

Bertus
 

Thread Starter

filipmr

Joined Jan 2, 2021
64
Hello,

Looking at the drawing, you are powering the steppermotor is powered with 5 Volts.
What is the stepper motor data?

Bertus
What do you mean with stepper motor data? I am a beginner, so i am not sure. This is my code:
C-like:
#include <Stepper.h>
int motorPin1=8;
int motorPin2=9;
int motorPin3=10;
int motorPin4=11;


Stepper motor(360,motorPin2,motorPin4,motorPin3,motorPin1);
void setup() {
  motor.setSpeed(75);

}

void loop() {
   motor.step(1000);
  delay(1000);
// motor.step(-100);
}
I put motor.step(-100) in // beacause I was testing if that was the problem.
 

Thread Starter

filipmr

Joined Jan 2, 2021
64
I know that the voltage is 5V, but I am not sure about the current, I am trying to find documentation online on my stepper(model 28byj-48 ). Thank you
 

shortbus

Joined Sep 30, 2009
8,717
First off, the 5Volts may work OK if it isn't moving a load. A 20V power supply would give much better proformance from a 5V stepper motor. The thing about steppers is the current is much more important than the voltage on them. The voltage rating comes from having one coil activated with no stepping at all.

Now to why it's not moving the way you are expecting. That motor has a built in gear box, see how the output shaft is offset? It has a 64 to 1 gear reduction, so it will take 4096 steps to go a full 360 degree rotation.
Steps= (360°/5.625°) * 64 = 4096 steps
From - http://embark360.weebly.com/byj48-stepper-motor.html
 

MaxHeadRoom

Joined Jul 18, 2013
23,369
The rated voltage is OK for up to a few hundred RPM, as the inductive reactance increases, and hence current decreases, the torque starts to drop fairly rapidly.
A much higher P.S. voltage is required for higher RPM, in order for the drive to automatically control the plate rated current of the motor to a constant level. Neither higher or lower.
Max.
 

MrSoftware

Joined Oct 29, 2013
2,015
You're missing steps. If the controller tries to step too fast, the motor will skip steps. First try adding a longer delay between steps. I'm not familiar with the library you're using, but it's likely the SetSpeed() parameter when you setup the controller.

edit --> Google shows me your setSpeed() call sets the max speed in RPM, 75 is pretty low and I would think should be OK.

Second try boosting the voltage to the stepper motor. It's OK to go a little above the rated voltage for the motor. Heat is what kills electric motors. Heat comes from current. In this case it's the average current you're worried about, and since the steps are just a little blip of current, your average current will be very low.

Third do you have anything attached to the stepper that has mass? Try just a piece of tape so you can see it spin.
 

drc_567

Joined Dec 29, 2008
1,135
One way to insure a precise step waveform is to insert a forward biased schottky diode in each of the stepper motor driver wires. ... Maybe this will improve performance.
 
Last edited:

MaxHeadRoom

Joined Jul 18, 2013
23,369
Quality stepper controller manufacturers such as Gecko for example, use the continuous rated current operation in all their drives throughout the rpm range of the motor.
Max.
 

skdubey

Joined Mar 24, 2021
2

Papabravo

Joined Feb 24, 2006
16,498
What speed are you trying to run at? They cannot go from 0 velocity to a high rate without ramping up the mechanical velocity of the rotor. It sounds like all the pulses were sent but the mechanics could not keep up.
 
Top