Using an arduino to control 6 stepper motors

Hey guys!!

I am new to this forum so if I am writing in the wrong section, please forgive me and kindly redirect me to the right section.

I am a student and I am part of a group of guys who's design project is to build a double sided multifunctional cnc machine. We are thinking of using an arduino uno to control the 6 stepper motors and 2 spindles.

I wanted to know the best way of controlling 6 stepper motors?? I know that I/O expanders can be used to expand the capacity.

I want to avoid using two different motion controllers as we need synchronisation between the motors.
There will be two motors in the z axes, top and bottom. Then, two motors in the x axis, top and bottom and then finally two motors in the y axis, top and bottom.

We need to keep the cost down which is the challenge and is the reason why we are trying to keep the costs down as much as possible.

I guess the question is how to use an arduino uno with I/O expanders to control 6 stepper motors/stepper drivers?? Is it possible?

And then also whether the same arduino uno can be used to control the spindle as well as I know that some spindles come with controllers that can be connected to the arduino itself.

Stepper motors we are conisdering as mostly nema 23 and 34 due to the high torque application with 2-3 KW spindles

6 steppers at 4 signals each is 24 total. You'll be ok without a port expander if you use a Mega2560 (or similar ). a 2560 costs little more than an Uno if you buy on ebay.

Manufguy:
There will be two motors in the z axes, top and bottom. Then, two motors in the x axis, top and bottom and then finally two motors in the y axis, top and bottom.

Does that mean that the exact same step and direction signals can be used by a pair of motors? That could mean that the Arduino only "sees" 3 motors.

If the Arduino really does need to control 6 motors and two spindle motors you will need to figure out if it is fast enough to provide all the necessary steps and (perhaps) to read encoders to check the spindle speed. Reading an encoder without missing pulses can use a lot of CPU cycles.

Stepper motors we are conisdering as mostly nema 23 and 34 due to the high torque application with 2-3 KW spindles

That sounds like it has the potential to be very dangerous. Is it wise for an inexperienced person to be taking on this task? Maybe "cheap" is not correct for this project?

Those motors will need expensive stepper drivers in any case.

...R

The Arduino UNO has 20 digital pins it can use. 0-13 and A0-A5. Of those, some have dedicated purposes. For example 0 and 1 are used for serial I/O. That leaves you with 18 pins. A stepper driver typically has three input pins: Step, Direction, and Enable. You can probably get away with wiring the Enable pins to ON. So now you use 12 of your 18 pins for the six Step and six Direction pins. The remaining 6 pins can be used for PWM to two spindles with four pins left over for everything else, like limit/home switches. All programming input and output will go through Serial.

If you want to add any other peripherals you can dedicate two of those remaining four pins (A4 and A5) to an I2C/TWI/Wire bus. With that you can write on an LCD, get the time from an RTC, or add more pins with a Port Expander.

We need to use the limit pins though because we need limit switches on each axis. Also, the x,y motors are all synchronised and then the z motors are different.

So the issue we have is that we are thinking of choosing either an arduino uno with cnc 3 axis shields or an arduino mega uno which should be able to get all the 6 axes I think am not too sure. We are also planning on using Mach3.

What do you reckon is the best option in terms of micro controller and what is the best way of synchronising the x, y motors differently from the z motors?

Manufguy:
We need to use the limit pins though because we need limit switches on each axis. Also, the x,y motors are all synchronised and then the z motors are different.

This is a complex project and you are not providing nearly enough information. Also leaving nearly 2 months before replying does not help because I have definitely forgotten all about it. Don't leave more than 24 hours between a response and your Reply.

So the issue we have is that we are thinking of choosing either an arduino uno with cnc 3 axis shields or an arduino mega uno which should be able to get all the 6 axes I think am not too sure.

I can't imagine what CNC shields have to do with 2-3kW motors. You need to identify stepper drivers suitable for your motors and then post links to the datasheets for the motors and for the motor drivers.

We are also planning on using Mach3

Does that work with an Arduino?

What do you reckon is the best option in terms of micro controller and what is the best way of synchronising the x, y motors differently from the z motors?

See my first comment in this Reply.

...R

Sorry Robin2 just been so busy so it is difficult for me to respond within 24 hours.

Yes, the arduino is capable with mach3, many people have done it before.
Ok I will try to give more information:
The specification is:

 Table range: X/Y= ±120 ~±140 mm (240~280 mm), Z=120 mm;
 Force capability: Fx/Fy= 10 kN at 2000 mm/min; Fz= 25 kN;
 Spindle power: Tmax = 30 Nm at n= 1000 rpm.

It is a double sided cnc system with a dual spindle and our budget is in negotiation but lets not worry about that for now.

It has to perform friction stir welding which requires a very high torque and then it has to be able to perform incremental sheet forming which requires low torque so we need a spindle that can generate high and low rotational speeds.

In terms of control, we require 6 axes of motion. X, Y and Z and then we require three more axes on the bottom so that's three axes on top and three axes on the bottom as it is a dual spindle system. We are trying to figure out the best way to try and control these axes. We plan on making it in a way so that x axes top mirrors x axes bottom and then y axes top mirrors y axes bottom. This is what I am trying to explain.

We plan on having beefy nema 34 motors as the force capability needed for our machine is very high. We plan on obviously having drivers for each motor and then power supplies on selected motors. We calculated that the motors need roughly 12.5 Nm of torque to raise the load.

It is the spindle that we plan on having 3KW for. This is just talking about the spindle, nothing else.
We planned on using arduino shields in order to achieve the extra axes needed. The machine has a stepper motor on each x, y axes then a geared stepper motor on the z axes.

We want the stepper motors of the same axes top and bottom is move together and in sync. `
Don't worry about the motors and rivers. I am using omc as a supplier for those mainly.

There is a current argument within the group whether to use an arduino mega or arduino uno? What do you reckon is best?

The data sheets and links to all parts are shown below:

Above is the z axis geared motor

Above is the x, y axis motor
https://www.amazon.co.uk/d/DIY-Tools/Cooled-Spindle-Motor-Matching-Variable-Frequency-Inverter/B019GQ9Y2I/ref=sr_1_16?ie=UTF8&qid=1486753552&sr=8-16-spons&keywords=4KW+spindle&psc=1
Above is the spindle, we struggled to find a wide range of spindles, if anyone knows of any better suppliers let me know

I reckon this is even more complex than I envisaged and truthfully it is beyond my knowledge and experience.

The only useful comment I can think to make is to use a Mega if your budget allows as it has more memory, more I/O ports and more Hardware Serial ports. But it runs at the same speed as the Arduino.

The information you have provided so far does not throw any light on the issues I mentioned in Reply #2 relating to whether a 16MHz Arduino is fast enough.

...R