I'm using CNC shield v3 with Arduino Uno, I have a code which takes an integer as serial input and runs either of the 4 motors in either direction. Each motor and motor driver is working perfectly when only one is connected at their respective positions on the shield. But when all 4 are connected together, I observe:
They move 1-2 steps instead of 200 steps or
They buzz but no movement
I've tried powering the shield with 12V 2A adapter and a 18V 1.7A adapter.
Here are the details of stepper motors I've attached:
JK42HS48-1684-08AF (5.6kgcm), DRV8825
JK42HS48-1684-08AF (5.6kgcm), DRV8825
JK42HS40-1704 (4kgfm), A4988
SL42STH40-1684A (~3.5kgcm), DRV8825
What have I tried?
Running each motor in isolation, on the same shield.
Changing motor drivers, it didn't help (makes sense as motors are running separately, so drivers are fine).
Adding a cooling fan. Same observations.
Currently trying
I think this might be power supply issue. I've already tried with 2 power supplies, but I'd still try with a 24V SMPS I have just to be sure.
But I might be wrong, and want to hear from people more experienced than me on what the issue exactly is, and what's a good way to go about solving this instead of randomly trying with various power supplies.
What's the issue and how can I solve this?
Edit: The issue was solved by using an appropriate power supply.
You have 3 ea. 1.7A an 1 ea. 1.8A motors (6.9A total) and a 2A or 1.7A power supply. I suspect a power supply problem, too. I would source a 10A supply.
What is the coil current limit set to on the drivers?
Your 1.8A steppers are probably OK with DRV8825 drivers but should at least have heat sinks. The A4988 driver is really only good for about 1A without heat sink and active cooling. You will extend the lives of the drivers if you use heat sinks and a fan. And extend the lives of the motors if you set the coil current of their drivers as low as possible and still do their jobs, reliably, without missing steps.
Monitor, with your DMM, the motor supply voltage. If the voltage drops below 8V the drivers can no longer work.
If this does not help, post your test code. Read the forum guidelines to see how to properly post code and some information on how to get the most from this forum. Use the IDE autoformat tool (ctrl-t or Tools, Auto format) before posting code in code tags.
According to the motor data each of you motor coils needs about 4.7W power (if opereated with the rated current). Two coils per motor and 4 motors means a sum of about 38W. And you must take into accout the efficiency of the drivers and dynamical power when the motors rotate.
That means your PSU is much too weak.
In any case - as already suggested - it's a good idea to set the current to less than the rated current if you don't need the full torque. With the rated current the motors will ge really hot.
NB. With these current drivers the sum of the needed power is important to select an aproriate PSU, not the sum of the current. But you need some headroom if the power supply actively limits the maximum current even during short peaks - or a larger buffer capacitor at the drivers to better absorb these peaks.
Thank you for the answers @groundFungus and @MicroBahner. After posting this question, I tried with my 3D printer's 24V SMPS, and it worked perfectly. So it was a power supply issue.
I now want to learn why exactly this happened and how can I design proper power supply the next time, so please help me.
My doubt is, How to calculate stepper motor's power consumption?
For JK42HS48-1684-08AF, I got nominal voltage as 3.1V and max coil current as 1.2A, so I believe max power would be 3.7W. Since this is the largest stepper motor (5.6kgcm), let's assume I have 4 of these, so the total max power would be 14.88W. And since I connected a 12V 2A supply (24W), it should work without any issues, right?
I am especially confused about this because I believe the above replies both offer a different way approach (sum of current vs sum of power).
Thats a little bit confusing, because I found other data for this motor: 2.8V and 1.68A. But in any case you must be aware that this is only for one coil - and there are two coils in each motor. And the driver itself is also not lossless too. Even if this powerloss is much less then power in the coils.
A stepper driver works similar to a short circuited buck converter. The higher the input voltage, the lower the input current while the output current ( = coil current ) remains the same.
It would be impossible if the input current remained the same when you increase the voltage. The power supply would then deliver more power, and where would this power go? You would burn something.
So if I understand correctly, power per motor would be 2x coil current x nominal voltage.
Which would be 9.4V for JK42HS48-1684-08AF (you were right, the seller's website had wrong info).
This would bring 4 stepper's power to 37.6W. Accounting all losses, let's consider 50% efficiency, so we'd need ~80W power supply. Is that right?
Secondly, can this 80W PSU be any combination of V and I? Can it be 24V,3.3A or 12V, 6.6A, or 5V, 16A?
That's correct.
But of course you can set the current at the driver lower than the rated current, which reduces the required power - but at the expense of the torque.
With 50% efficency you are definitely on the safe side.
Not 'any' combination. The voltage must be significantly higher than the nominal voltage of the stepper for the driver to work correctly. Therefore a 5V/16A would not be appropriate. Also the driver datasheet usually defines a minimum voltage for it to work correctly. E.g. this is 8.2V for the DRV8825.
The higher the voltage ( within the range of the max driver input voltage of course ) the more torque you get with higher steprates.