27 Jul 2018
How to run two CNC shields (other one as clone) with one Arduino UNO
I learned a nice thing about Arduino CNC shield today. I have a project coming up where I need 3 axes. On each axis, there will be 2 motors (cloned, running in sync). That means I need a total of 6 motors and drives, but CNC shield only supports 4 drives (axes). So I needed two boards somehow to work together with one Arduino. The second one needs to run as a clone/slave. So it would be possible to run a cloned motor for each axis.
I was afraid that I must create some hackish middle layer to route connections to both shields. But actually, there was no soldering or hacking needed. The solution was already there like it’s meant for that.
Arduino CNC shield has very convenient pin-outs on its board. Not only for cloning 4th axis but also to clone the whole board. Not sure is it especially for this but it worked for my application. You only need to connect (highlighted) pins from the primary board to the second one and it’s cloned.
How does this work?
What happens is that we send the same step and direction commands to other board like on the original one. The pins on top of a shield are just passing through signals. The shield does not care that it’s not sitting top of Arduino directly. So it should be possible stack even more shields in such way.
Since other board is not attached to an Arduino we need 3 extra connections. Connect the same pins from primary shield to the same pins on the secondary shield and it’s done. Minimum connections are:
- Enable pin (so drives can be activated by software)
That’s it. Now you can clone needed axes on other board by connecting corresponding pins from one board to other. And of course, don’t forget to power the cloned board too. Look photo of the example used in this article. Here I have cloned only Z-axis to the second board.
Go check out the quick video on Youtube with this example running.
Great post. Thanks for that.
Do you know if you can use the extra end stopsensors on the slave board, so you can use an endstop switch for each of the 2 motors on an axis? Autosquaring my cnc-mill would be much easier then.
Otherwise I think you don’t need the slave board because you can just put 2 motors in series together.