How to setup the Alternate CNCShield 4 Driver electronics board.
Note, stepper driver chips are fragile and may be damaged by applying power without a motor connected — always wire things up completely, and verify all connections each time before applying power.
Note, that stepper motors can be wired up in many different ways and still function, though the motors may turn in the reverse of the desired direction (stepper motors are reversed by swapping pairs of wires).
Most importantly you must have the two pairs correctly identified.
The motors supplied with your mill have pairs:
- Black and Green
- Red and Blue
These pairs must be wired into the drivers correct or the driver may be destroyed. You may have to change a pair of wires around later if need be change the settings in Grbl.
- Arduino with Grbl firmware (contains an AVR processor, USB connector and I/O pins) – yours supplied programmed with GRBL > V9
- CNC Shield – takes the electronic signals Grbl generates and sets the current from the power supply which drives the steppers. Small pots are used to adjust. More information about stepper shields is on the wiki.)
- Stepper motors x 4 pcs
- Power Supply
- Power wire (for connecting the power supply to the gShield)
- Computer with a Grbl Communication/Control program and drivers for the Arduino installed (not included in the kit)
- USB Cable
- Soldering Iron
- Patience (just a little bit)
Regarding shielded cables and shielding:
Please ignore any misinformation you read on the forums about using shielded cables, running some wires away from other wires, adding resistors etc.
These efforts are to help with the limit switches and are all of difficult, messy, expensive, sometimes dangerous and above all completely unnecessary and likely not to work anyway.
There will be more information in the limit switch section as to how and why, for the moment… trust us.
Screw Drivers, Wire strippers / Cutters, Multimeter for testing continuity – not required but you should have one!, soldering iron.
First thing that we do is plug our Arduino into the computer and test it. If you are confident your Arduino works, its been tested at 3DTek so should be fine, skip to Hook Stuff Up below.
Remember, the big end of the cable goes into the Arduino. Loading the driver for the Arduino is documented in Software
Communication / Control Program
Launch your selected Communication/Control program on your computer. Connect to the Arduino and ensure that it works (see the Software page for details). Once you are certain your controller works, disconnect it.
Build CNC Shield – No longer any need to solder up this board, they will be supplied ready to go.
This is very well documented here, so we wont recreate that wheel however there are some handy connecters included that will help you be able to remove the motor wires and clip back on as you organize your wiring or reverse the direction of some motors.
So make sure you leave out some of the pin connections and replace them with the white sockets. See the differences in the images below.
NOTE: You don’t need to use the sockets if you don’t want, the plugs will fit over the header pins as supplied with the board and shown in the official instructions!
The boards do not ship with a fuse, you should use a jumper wire (as thick as can fit) to short the fuse pins as can be seen above right (red wire) an external fuse to between your power supply and the electronics enclosure.
For each axis you will need to install some jumpers
|MO||M1||M2||Micro step Resolution|
We want the X & Y (+A) axis to run 1/8 step so a jumper over the M0 and M1 pins, for Z axis it’s a half step so a jumper of the M0
More information on this found here
You will see in the image below 9 jumpers in total.
On the left two horizontally, this will duplicate the Y steps to the A axis!
Under each capacitor, vertically, these set the stepping, note only one jumper on MO for Z-axis.
The next step is to prepare the limit switches. You can leave this till later if you want to proceed with the rest of the build and worry about the limit switches later – if so skip down to “Connect it all together.”
With the latest version of GRBL, some pins have been changed and the CNC shield product has not yet been updated. New Pinout in the image below.
They are as referenced above however there are some changes to how you wire your switches to the CNC Shield. As Pin 11 is now no longer the Z limit switch pin you cannot connect your Z limit switch to the now incorrectly labelled Z limit on the CNC Shield.
Your Z Limit Switch is now instead connected to SpiDir (spindle direction)
Your Spindle speed output if you choose to use it will be Z Limit.
The techy background to the issue is this:
Pins 9,10&11 on the Arduino are held high (5V) by internal pull-up resistors. (grbl v0.8)
Pins 9,10&12 on the Arduino are held high (5V) by internal pull-up resistors. (grbl v0.9)
When ever your limit switch gets hit it pulls the pin voltage low 0V and the controller understands ‘oh no we’ve hit the edge!”
Connect it all together.
So at this point you can connect the shield board on top of the Arduino, and the CNC shield on top of that. Lastly install 4 stepper drivers onto the CNC shield taking note to ensure the pins marked ‘en’ line up with the ‘en’ printed on the shield.
You will end up with this:
On the Left – A setup with DRV8825 (purple) drivers, on the right A4988 (Green or Red) drivers.
Please take note of the orientations, The purple drivers with the current limiting variable resistors towards the reset button and the green or red drivers with the trim pots away from the reset button. If you turn the drivers over you will notice one pin is marked EN for enable. There is a corresponding EN marking on the CNC shield so if you line these up with each other when inserting your good to go.
At the end of the stepper motor wires, solder on one of these plug and fly leads.
You want to make sure that your motor wire pairs stay together. Counting from either side of the plug, its not important which, connect the wires in order 1) Green 2) Black, 3)Red, 4) Blue. For all motors except one of the Y motors which we will swap the order slightly by swapping the position of Green and Black – so for 1 and one only of the Y motors make the order 1) Black 2) Green, 3)Red, 4) Blue – This will make sure one of your Y motors spins in the opposite of the other, which is vital!
Your Stepper motors will now plug directly into the CNC shield boards white sockets. Note that the X, Y Z and A connections are clearly marked and located next to the driver for that axis. Driver A is for one of the Y motors, any signal sent to Y is duplicated over to A as well. This is instructed to be done by adding two of the included jumpers to the pins marked Y on the cnc shield. See in the first image of this blog post there are two jumpers side by side a little above the green screw down power input terminals.
Examine the connections once you are done for possible shorts and remake any connections, which do not seem safe and secure. If you have a multimeter you may wish to test the connections for continuity.
Set the multimeter to resistance, or continuity (beep mode) if you have it, and test for a beep or a reading of a few ohms between pins B1 & B2, then A1 & A2 of each driver (with motors plugged in of course and no power connected)
If you cant get a reading/beep on each of these then you should NOT continue to applying power to the board as the driver in question will likely fail.
You are ok to apply 5 volts via the USB connection, just don’t connect any power supply to the 12-36V screw down connection on the CNC shield until you can verify there is a stepper motor coil on each of those sets of pins described above for each driver. If you cannot find this continuity as described then you likely have some wiring wrong from the motor to the plug, test each combination of wires at the end of that plug until you find two pairs, if they are not the two left as one pair and the two right as another, something is wrong.
You simply run two wires to each. Connect them to the two furthest pins from the roller on the end of the leaver. This switch is in normally open mode, meaning the circuit is open until the switch is depressed. If you put the wires on the wrong terminals it will be either a closed circuit or in normally closed mode which means the switch will circuit will open when depressed.
At the control board end, one of these wires from each switch is connected to the ground plane, and the other to pin 9 (X) 10(Y) or 11(Z)
NOTE: pin 9 (X) 10(Y) or 12(Z) for versions of GRBL setup with variable spindle speed control!!!
When initially testing a machine, place it in a middle position with space to move up, down and to all four sides, so as to prevent a crash if it should move in the wrong direction or farther than expected.
Load up a Universal G-Code Sender (or some other Communication / Control program) and use its jog functionality to test each Axis. For the Universal G-Code Sender, this would typically involve opening the connection on the correct COM port, selecting baud rate of 57600, then switching to the “Machine Control” tab, and using the buttons to move the X-, Y-, and Z-axes. (There is no need to load a G-Code file at this time.) Please take note of whether one is using relative or absolute mode if typing actual G-Code commands.
If one or more motors don’t move or don’t move smoothly, you may need to adjust the trim pots on the Drivers. (!!!! Clockwise is less power, counter clockwise more!)
Note that once the machine is assembled, the positive direction for X is right, for Y it’s away from you, and for Z it’s up.
Go For a Spin
Z-Axis — (Counter clockwise) Note that when testing, the Z-axis should turn for a longer duration than the other axes since the screw requires more revolutions to move a given distance than the belts used on the X- and Y-axes.
X-Axis — (Counter clockwise) the X- and Y-axis should move for the same duration for a given degree of movement. Positive moves will be to the right, negative towards the left.
And a Final Spin
Y-Axis — (Both Clockwise and Counter clockwise) make certain that the two motors for the Y-axis are rotating in opposite directions — the one which is for the right side of the gantry should turn clockwise, the one for the left should turn counter-clockwise. Positive moves will be away from the front of the machine, negative moves towards the front.