top of page

Using a CNC Shield with grblHAL controllers

  • Writer: Phil Barrett
    Phil Barrett
  • Oct 26
  • 7 min read

Updated: Oct 28


This blog shows how to use a CNC Shield that supports StepStick drivers with boards like the T41U5XBB or RP23CNC.


ree

I often receive questions about driving small stepper motors, typically NEMA 17 motors drawing less than 1.5A, with our boards. Using larger drivers like the DM542 for these motors is overkill. The smaller StepStick drivers are less expensive, but require a carrier for power, wiring, and secure mounting. Many people also want to upgrade their 8-bit Arduino Grbl CNC machines to grblHAL for features like auto-squaring. These machines often use the Protoneer CNC Shield and StepStick drivers like the TMC2209.


Materials needed:

  1. CNC controller like the T41U5XBB or RP23CNC.

  2. CNC Shield V3.0

  3. Screw Terminal Shield (optional but recommended)

  4. 3 or 4 StepStick Drivers, one for each stepper motor.

  5. 4 1x4 Dupont cable assemblies

  6. 2 1x6 Dupont cable assemblies (if not using a Screw Terminal Shield)

  7. 10-14 2.54mm shorting plugs (also called pin header jumpers or shunts)

  8. misc screws to mount the Shields

  9. hot glue to secure the Dupont connectors


The basic steps are

  1. Mount the CNC Shield and Screw Terminal, if using it.

  2. Connect the CNC Shield pins to the grblHAL board.

  3. Insert the StepStick drivers on the CNC Shield.

  4. Connect stepper motors to the CNC Shield.

  5. Apply power to the shield, adjust VRef and test.



Mount the shield


If you have the CNC shield mounted on an Arduino, carefully detach it. Then, mount the CNC shield on some sort of carrier. A Screw Terminal Shield is ideal because it holds the CNC shield in place, gives easy access to the pins you need to connect and is fairly easy to mount securely. If you don't have a screw terminal shield, you can use the CNC shield directly but will need to mount it securely. Your best bet will be to 3D print a mount for it as the two holes in the CNC Shield are poorly positioned and may even not have enough clearance for the screw heads. When selecting a screw terminal shield, look for one with header sockets that allows plugging the CNC shield on top - you will need access to a number of the shield pins. I have a 3D printable carrier for the Screw Terminal Shield that is commonly available on Amazon and AliExpress. It supplies a relatively secure mount for the shield and enough clearance for the pins that protrude below. It is available for download.


Connect the shield pins to the grblHAL board


Using a screw terminal shield


Identify which stepper outputs you need to connect to the shield. Identify Stp (step) and Dir (direction) for X, Y, Z and A (if you need it). Connect them to the screw shield as shown below. Note that Controller can be a T41U5XBB, PicoCNC or an RP23CNC.


ree
ree


To use the A driver from the Screw Terminal Shield, you will need to direct the pins to the A driver header by use 2 shorting plugs in the positions noted in the picture above.


If you have a ganged axis other than Y, substitute that for Y1. For instance, if you ganged X and A, then X becomes X1 and A becomes X2 - connect those to D12/D13.


Use a shorting plug to connect the EN pin to GND. Without this connection, the stepper motors will not operate.



Using the CNC shield directly


This necessitates the use of "DuPont" header cables or comparable alternatives. Connect Stp and Dir for the X, Y/Y1, Z, and A/Y2 axes as illustrated below. For a moving gantry machine, you must identify which axis output corresponds to the second gantry motor (typically referred to as Y2 in a standard moving gantry machine). Connect Stp and Dir to the A/Y2 STEP/DIR pins on the CNC shield as depicted below.


ree

Insert StepStick Drivers


There are several different stepper drivers available in the StepStick format. I suggest using the TMC2209 V1.3 drivers, as they are smoother, quieter, and can handle more current than others. Insert the StepStick drivers into the sockets, ensuring they are oriented correctly—incorrect orientation WILL damage the StepStick. Refer to the above picture for the correct orientation of the TMC2209 V1.3 driver. If you use other drivers, make sure they are properly oriented. Some models do not have the lettering aligned the same way as the CNC Shield.



Connect Stepper Motors


Stepper motors use 2 coils to generate motion. First step is to identify which motor wires connect to the coils. Short a pair of wires together and try to turn the motor. If it becomes harder to turn then those two wires go to one of the coils and the other two connect to the other coil. The top two positions on each motor interface connector on the CNC Shield (see below) go to one coil and the bottom two go to the other.


ree

To connect a motor to the CNC shield, you'll require a cable set with a DuPont connector or similar. The 4-pin cable should have a "DuPont" plug on one end, with the appropriate connectors for your motors on the other. Some motors include this type of cable. The wire colors displayed here are for illustration purposes only, as there is no standard color coding for stepper motors.



ree

Connect Stepper Motor Power Supply Unit


The shield is labeled for 12 to 36VDC but not all step stick drivers are rated for 36V. The TMC2209 is rated for a maximum of 29V. A voltage of 24V, a common and widely available PSU voltage, is recommended. 12V will work but will not provide a lot of power and can cause missed steps. You do not need to connect the PSU's ground to the controller, just the CNC shield.



Adjust stepper motor current limit


The StepStick format uses a small trimmer potentiometer (RP1 though not all drivers label it) to set the current limit. Find the RMS current limit for your stepper motors. Using a Voltmeter (DMM, Multimeter, ...) measure the voltage between the VRef pin and ground. With a screwdriver, adjust RP1 to change the stepper motor RMS current based on a formula that is specific to the StepStick model you are using. Each Stepstick Driver format has different locations of the VRef pin. Note: while you adjust RP1, you are measuring the voltage of the current sensing circuit. This procedure works for the TMC2209 drivers, other stepstick types are different.



ree

For the TMC2209 drivers, the formula is:

VRef = RMS_Current * 1.41

For instance, if you have a stepper motor specified for 0.8 A RMS current, you should set the VRef voltage to 1.128 V (0.8*1.41). Adjust this for each driver you have installed. If you're using a different driver, search for "VRef adjust <your driver model number>" to find the correct formula and procedure. It is better to use a non-metallic screwdriver - a metal one might cause a short circuit if misaligned.


Warning: Do not skip this step. Bad things can happen if you do.


Configuring the driver's microsteps


The 2x3 pin headers between the StepStick driver sockets are for configuring the microsteps that the driver will output. Each model of driver uses a different scheme so refer to the your driver's documentation. The TMC2209 is configured as described below. Using this scheme for different drivers will result in incorrect behavior.

ree

Testing


Make sure all wiring and StepStick orientations are correct. Next, power on the Stepper Motor PSU and the grblHAL board. Check the rotation direction by jogging each axis. If the direction is not correct, adjust it in the grblHAL settings using $3. Each bit corresponds to a motor's direction: bit 0 for X, bit 1 for Y, bit 2 for Z, and bit 3 for A. In a moving gantry CNC machine, Y1 and Y2 typically need to rotate in opposite directions. If both motors rotate in the same direction, you can use $8 to reverse the direction of the second ganged motor (Y2). If the gantry moves in the wrong direction, use $3 to reverse it. The $8 setting will properly adjust to this change to ensure the motors rotate correctly.



Environmental Concerns


Your drivers may need forced air cooling. Even with heat sinks mounted on them, they will benefit from forced air cooling. An 80mm fan mounted to blow directly on the CNC Shield will help them to run cooler. Get a fan that uses the same voltage as the stepper motors so you can share the PSU. Since the CNC Shield mounting holes do not align with the Screw Terminal Shield holes, there is no easy way to mechanically bind them together. However, the CNC Shield has 28 pins and will do a decent job of holding itself in the sockets of the Screw Terminal Shield. For extra protection, a bead of hot glue can be used on the 16 pin side of the shield to keep it from moving. This is especially useful in a high vibration environment. The 12 pin side may be hard to glue without affecting the screw terminals. The Screw Terminal Shield has 3 mounting holes that allow it to you secured to your base plate. Note that at least 9 mm standoffs should be used to prevent the shield's pins from touching the base plate.


Ensure that the stepper motor cables and connectors are securely connected to the CNC Shield. Apply hot glue to prevent the connectors from shifting. With only 4 pins each, they lack sufficient friction to stay in place. However, you can slightly bend the pins to increase friction and thus better hold the connector in place.



Using the shield for limit, mist and Grbl control pins


This is not recommended. Your grblHAL controller has isolation and drivers that will work better than the CNC Shield. It is better to connect those signal wires directly to the grblHAL controller. Keep your wiring as simple as possible - extra wiring will be increase susceptibility to EMI.



About Me.

ree

I'm Phil Barrett, a long time CNC enthusiast. I run a small company, Brookwood Design, that makes several breakout boards for grblHAL and love to help people get the most out of their CNC machines.





 
 
 

Comments


Featured Posts
Recent Posts
Search By Tags
Follow Us
  • Facebook Classic
  • Twitter Classic
  • Google Classic
  • Wix Facebook page
  • Twitter Classic
  • Google Classic
bottom of page