Nema 17 twitching

Hi! I recently made a robot that uses 3 NEMA 17 motors (17HS8401S) with a plusivo mega, a cnc shield v3, drv8825 drivers and a psu 12V 5A and when I try and turn more than one motor, they twitch and barely spin, when I use a psu that shows the amps, it shows 1.3A, when I turn 2 motors and 1.2A when just one is used, how can I prevent that twitching?

Have you properly adjusted the coil current limits on all the drivers?
See this page >>>>> Pololu - DRV8825 Stepper Motor Driver Carrier, High Current

Please format your test code using the IDE autoformat tool and post the test code as suggested in the how to get tge best from the forum. post.

When asking questions about hardware, schematics or wiring diagrams and photos are often helpful.

1 Like

Can you post an annotated schematic showing how you wired this. It sounds like the power source to the motors is collapsing. NEMA 17 is just a mechanical frame size. If my memory is close those motors should draw about 1.8A so round to two. Then x2 at least for starting current so you are at 4A Three motors times 4A is 12 Amps. That tells me your power supply is to small.

1 Like

We are talking about a stepper with a current controlling driver. Things are completely different there. And there is no rush in current when starting.
You must consider the needed power to select the PSU. With this motor it's ~5W per coil. 10W per Motor, so 30W for 2 motors. A head room of 100% for losses and mechanical work leads to 60W over all. His PSU is 12V/5A = 60W. So the PSU is sufficent.

1 Like

My mistake, I looked up the wrong part number.

Note that two coils only can draw 42% more with a DRV8825, not 200%.
See the step/current table on page 14 of the DRV8825 datasheet.
Leo..

Ok, do you guys still need a schematic? Because the circuit is pretty simple, just a cnc shield v3 connected to a mega, and 3 drivers on top. What would be the solution to my problem?


What are you referring to? The table only shows the current in relation to the set current in the various step modes. 100% means equal to the set current.

You didn't answer the question of @groundFungus . And did you check the coil connections ( which 2 wires belong to each coil)? I would not blindly trust the colors.

Yes, I checked the wires, every motor rotates perfectly, the problem occurs when I want to rotate mor than one. And the drivers are properly calibrated.

Stepper motors always draw current, even if they don't rotate. So, if you turn only one motor, are both connected? And please show your sketch(es) - with one motor turning and with two.

Yeah, all 3 motors are connected at all times.

can you rotate each motor separately? And what about the sketch?

#include <Stepper.h>
#include <Servo.h>
#define STEPS 200

int pos = 0;
Servo servo1;
Stepper stepper1(STEPS, 5, 2);
Stepper stepper2(STEPS, 6, 3);
Stepper stepper3(STEPS, 7, 4);

void setup() {
//servo1.attach(51);
stepper1.setSpeed(1000);
stepper2.setSpeed(1000);
stepper3.setSpeed(1000);

}

void loop() {
//servo1.write(180);
stepper1.step(10);
stepper2.step(10);
//stepper3.step(10);
}

Here is the code and I can rotate each motor separately, this is just a test code, not the actual code.

The problem here is the Stepper.h library. Du you use it in the actual code too?
The Stepper.h library isn't able to move 2 or more steppers in parallel. So your stepper1 makes 10 steps, then stepper2 makes 10 steps, while stepper1 is waiting. Then in loop() stepper1 does 10 steps while stepper2 is waiting and so on.
That way you will never get a smooth movement of both steppers. You need another stepper library.
You can try AccelStepper or my MobaTools library. With MobaTools it's more easy to move several stepper at the same time, because you need not create the steps in loop() like with AccelStepper.

BTW. It would have been much more easy and faster if you had already followed the advice of @groundFungus in #1 to post your testsketch.

I prefer the MobaTools library over AccelStepper. MobaTools is easier to learn and use.

Thank you sooo much, I'll try that and give you some feedback

That was the problem all along, stepper.h doesn't support moving more than 1 motor, thank you so much!

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