Go Down

Topic: Nema 14 with planetary gear 5:1 and power supply not getting along? (Read 128 times) previous topic - next topic


Jan 12, 2018, 11:16 am Last Edit: Jan 12, 2018, 12:30 pm by ivino Reason: I could find out how to correctly insert the image link

I am working with a high torque stepper motor(this one together with the A4988. I have connected the Arduino, the power supply and the motor to the driver according to https://www.google.dk/search?q=A4988+arduino&client=firefox-b-ab&dcr=0&source=lnms&tbm=isch&sa=X&ved=0ahUKEwjI6uyYqdLYAhXNZVAKHbUSCusQ_AUICigB&biw=1830&bih=753#imgrc=yQy5vDBDGCVZ1M: . I am using the folowing simple code :
Code: [Select]
// defines pins numbers
const int stepPin = 4;
const int dirPin = 5;
void setup() {
  // Sets the two pins as Outputs
void loop() {
  digitalWrite(dirPin,HIGH); // Enables the motor to move in a particular direction
  // Makes 200 pulses for making one full cycle rotation
  for(int x = 0; x < 400; x++) {
  delay(1000); // One second delay


But I find so many issues!

-The power supply gets shortcuted every second
-The motor, at  microcontoller restart, shortly turns many times in both directions, before starting with the full cycle turns every second.
-Sometimes it juts gets locked, and won't turn every second
-The turning direction changes every time I restart the microcontroller

What am I not grasping here?


Did you adjust the motor coil current (pot on the A4988 driver)?  Here is a guide on adjusting the coil current on A4988 drivers. 

What is the voltage and current rating of the power supply?

I don't see anything in the code that would cause your problems, so I must assume hardware.

How about a picture of your setup that, clearly, shows components and wiring?


Your code seems to be trying to make the motor move 1000 steps per second. Start with a very much slower movement - say 5 steps per second.

Stepper Motor Basics
Simple Stepper Code
Two or three hours spent thinking and reading documentation solves most programming problems.


trying to make the motor move 1000 steps per second
Sorry, I don't know why I missed that.  It is the same thing the test tube guy was doing.


Start off with a simple test using the AccelStepper library with modest acceleration and speed settings first,
you certainly cannot expect a motor to go from stationary to 1000 steps/sec immediately, it will simply stall/miss-step as motors obey the laws of physics, not impossible demands.

You should add a physical pull-down resistor (1k to 10k range) to pin 4 so that the stepper behaves
during power-up and reset.
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

Go Up