skip to Main Content

motionPro CNC controller hookup guide

This guide explains in detail how to use the motionPro controller with your CNC systems. This controller can be used for a host of motion systems such as laser engravers/cutters, milling machines, CNC machines etc. This will not work for 3D printers as there are no drivers for feeders etc. It can however, move the axes motors.

This is a 3-axis + 1 clone axis motor controller for all your CNCs, laser cutters and engravers. Its powered by the Atmega328P, is Arduino compatible and runs the grbl motion control firmware.

Here is a list of features that this board supports:

  • 3 + 1 clone axis for systems with two motors for a single axis (X or Y axis can be duplicated)
  • Capable of driving upto 4 NEMA 23 motors at 2.2A per motor (with a heatsink, 1.5A without any heatsink)
  • Full step to 32 micro-steps configurable via on board microswitches
  • Current limiting can be set independently for every axis including the clone axis
  • Options for user configured inputs and feedback such as E-Stop, Reset, Feed Hold, Cycle Start, Homing Location, and Probe
  • Accommodates upto 6 NO limit switches and almost unlimited NC switches. Limit switches are configurable as active high (normally closed switches) or active low (normally open switches)
  • USB port eliminates ancient parallel ports and freedom from older expensive machines that are hard to obtain
  • Bluetooth control (with an optional HC-05 bluetooth module) to wirelessly connect and operate the machine
  • Comes with heatsinks for the motor driver chips
  • Uses standard 12-24V DC supply and with 12V at 1A and 5V at 2A outputs on the board
  • Reverse power connect protection protects against errors while connecting the power source
  • Plenty of visual indicators for debugging
  • Comes pre-installed with grbl v1.1e

Tools that are needed

  • A screwdriver
  • Wire-strippers/cutters for preparing the wires to be connected to the motors
  • A small screwdriver that can turn presets. This is used for turning the preset that sets the current limit
  • A multimeter
  • A soldering iron (optional) for tinning stripped wire ends

The motionPro CNC controller ships with these default settings

  • The current limit for each stepper motor is set at 1A. See this section for more information on how to set current limits.
  • Limit switch mode is set to active low
  • When the USB cable is not plugged in, the board can communicate with the PC through a Bluetooth connection. This essentially makes the Bluetooth the default communication medium.
  • Stepper resolution is set at full step mode for all drivers
  • Clone axis is set to clone the Y-axis
  • Steps/mm are kept at their default values set by grbl. Depending on the type of machine you have, you can set the values using this calculator.

Default grbl settings

The default grbl settings are shown below and assume that your system is belt-driven with a pulley tooth count of 20, 2mm belt pitch and a 200 step/revolution stepper motor that is set to operate in full step mode.

$0=10 (step pulse, usec)
$1=25 (step idle delay, msec)
$2=0 (step port invert mask:00000000)
$3=0 (dir port invert mask:00000000)
$4=0 (step enable invert, bool)
$5=0 (limit pins invert, bool)
$6=0 (probe pin invert, bool)
$10=3 (status report mask:00000011)
$11=0.010 (junction deviation, mm)
$12=0.002 (arc tolerance, mm)
$13=0 (report inches, bool)
$20=0 (soft limits, bool)
$21=0 (hard limits, bool)
$22=0 (homing cycle, bool)
$23=0 (homing dir invert mask:00000000)
$24=25.000 (homing feed, mm/min)
$25=500.000 (homing seek, mm/min)
$26=250 (homing debounce, msec)
$27=1.000 (homing pull-off, mm)
$30=1000 (Max spindle speed, RPM)
$31=0 (Min spindle speed, RPM)
$32=0 (Laser mode, boolean)
$100=5.000 (x, step/mm)
$101=5.000 (y, step/mm)
$102=5.000 (z, step/mm)
$110=6000.000 (x max rate, mm/min)
$111=6000.000 (y max rate, mm/min)
$112=6000.000 (z max rate, mm/min)
$120=100.000 (x accel, mm/sec^2)
$121=100.000 (y accel, mm/sec^2)
$122=10.000 (z accel, mm/sec^2)
$130=200.000 (x max travel, mm)
$131=200.000 (y max travel, mm)
$132=127.000 (z max travel, mm)

The motionPro CNC controller uses a USB to UART bridge from Silicon Labs to connect to your computer. Before you connect the controller to your PC you will need to download the virtual com port (VCP) drivers. Once the drivers are installed your PC should auto-detect the hardware and create a numbered virtual serial port. This port can be used to connect the frontend GUI to your machine.

In Windows, this should be visible under Device Manager and in OSX you should be able to see this by typing ‘lsusb’ in the Terminal window.

Download the drivers available here

Remember at any given point in time, either the USB or the Bluetooth connections are active but NOT both. When the USB cable is not plugged in, Bluetooth is the default communication option. When the USB cable is plugged in, the Bluetooth module automatically shuts off.

All stepper drivers need to have current limiting set to prevent excessive current draw that can damage the motors and the controller board. By default the current limit is set to 1A. Current limit is set using the following formula:

Current Limit (ILIMx) = Vref x 2

To set a maximum current draw of 2A per motor you would set the Vref using the onboard preset to 1V. The board has separate 1-pin headers next to presets on the board marked as ILIMx.

At the time of shipping, the default limits are set at 1A. To change this limit, connect a multimeter between this point and any of the GND terminals. To set a larger current limit value, turn the preset anti-clockwise and to lower the limit turn it clockwise. Follow the equation above to set the required Vref value which in turn sets the current limit.

When the motor tries to draw more current than is set, the driver shuts down and a FAULT status is triggered. This can be identified on the FLTx pins on the expansion header. A low on these pins indicates a fault status.

The motionPro CNC controller can source upto 2.2A per motor with adequate heat sinks. DO NOT set the current limit higher than the motor’s rated limit. Its always a good idea to set the current limit to approximately 20% lower than the rated motor current.

Before connecting the motors you’ll need to identify which wires represent the coils. This guide explains identifying wires for a 4 and 6-wire stepper motor.

To identify the motor wires, simply choose two random wires and measure the resistance across them using a multimeter. If the meter shows an open connection then these wires belong to different coils. Once you’ve found the two pairs with similar resistances (usually in the range of a few ohms), you’ve identified the two coils.

This controller comes with four 4-pin terminals and 4-pin headers for connecting the motors. The headers make it easy to connect the motors if yours have connectors attached to them. If your motor does not have connectors simply use the terminals. The terminals are marked as 2B, 2A, 1A, 1B. Insert one pair in the 2B and 2A and other in 1A and 1B.

Always test motors and their direction of movement when they are not in the system hooked up with the rails. This helps in identifying how a specific wire pair combination affects the direction of the motor.

Remember that connecting motors in ways other than in pairs identified earlier will have unexpected results including the motors not moving at all or damaging them in some way.

Clone axis operation

Most motion systems have two motors for either the X or Y axis. Two motors help balance the motion load leading to very precise motion. This controller comes with a separate clone axis that can be used to mirror either the X or Y axis.

This switch simply mirrors the STEP and DIR inputs. You will still need to set the current limits for these as with any other axis.

A host of limit switch options are available.

Limit switches are either normally open (NO) or normally closed (NC). When normally open switches are used, set the limit switch mode to ACTIVE LOW. With NC switches set the limit switch mode to ACTIVE HIGH.

On the board, there is a 2×4 header with numbers around the pins. Pins 1 and 3 and 2 and 4 are shorted. Also, pins 2 and 4 are common pins. Connect your limit switch common terminals here.

Series vs parallel connections

In a typical motion system there are 6 limit switches (2 for each axis on either ends).

Series connections. Typically normally closed limit switches are connected in series with each other as shown here. In this case, when either switches gets tripped it breaks the connection stopping the motor’s motion. If you are using this mode, set the limit switch mode to active high, connect the common terminal either on pins 2 or 4 and the other terminal on 1 or 3. In the series connection mode, you’ll need to use only one pair of the 2×4 headers.

Parallel connection. Limit switches that are normally open are wired in parallel with each other. When either of them is tripped stop motion is triggered. If you are using this configuration, connect the common terminals of both switches on pins 2 and 4 and the other terminals on pins 1 and 3.

Make sure you match the axis limit switches with the ones marked on the board.

Limit switches must be enabled through homing by setting $21=1 in the settings. Note that once homing is complete, the entire machine is set in the negative coordinate space. If you’d like it otherwise, you need to enable HOMING_FORCE_SET_ORIGIN in the config.h file to set 0,0,0 to the homed location and re-upload the firmware. You’ll then need to play with the homing direction and main direction port masks (explained below).

Getting homing right is never easy. Just be patient and if you’ve wired everything correctly, its bound to work right. I usually run a homing cycle and see which direction the axes move. I then play with the direction homing direction mask ($23) and get it to home in my preferred corner. Right after this you’d typically see that one or more axes are reversed. This is easily remedied by tweaking the direction port invert mask ($3). Once this is done, re-home the machine and then re-set the homing direction mask (it should be reversed again since we changed the main direction port invert mask). This should properly set the machine with limit switches and in your preferred coordinate space.

Before you plug in a BT module you will need to configure it with the appropriate settings. If you’ve bought the module from me, its pre-configured and you can skip straight to the connecting part. However if you are using your own module, you will need to configure it using this guide.

Once you’ve configured the module, Simply plug it in on the board such that the ‘KEY’ pin points to the motor controllers on the right.

If you’ve connected the USB cable, the BT module will remain switched OFF. To turn ON the module, detach the cable from the computer. If you are on a Windows machine, open Devices and Printers and click on ‘Add new device’. With the module turned ON, your computer should be able to discover the device and install its appropriate drivers.

When the computer installs the module it also creates a numbered serial port. You can find this port number under ‘Ports (COM & LPT)’ in the Device Manager (Control Panel > Device Manager). You’ll need this port number when you connect your CNC GUI with the board.

Once everything is installed, all you need to do is power up one of the supported controller GUIs, select the bluetooth module port and click connect. If all goes well, you should see the grbl welcome message with its currently installed version.

Changing the module's baud rate in Windows

This is not absolutely necessary. However, when everything else doesn’t work this just might do the trick. The default baud rate is set to 9600. When you configure the module (and if you intend to use this module with the controller) you will need to set this to 115200. On a Windows machine get to Control Panel > Device Manager. Right click on the COM port installed when the module was installed and change the baud to 115200 from the default 9600.

There are plenty of software that are compatible with grbl. Shapeoko’s Wiki also has a comprehensive list of GUIs for grbl. Of these I quite like Candle and bCNC.

To change the default grbl settings connect to your controller board using either the USB cable or the BT module and open the serial monitor. Once connected you should see a message such as this:

Grbl v0.Xx [‘$’ for help]

This confirms that you are able to access all control settings for grbl. A full list of settings and their description is available here. To view the settings type $$ and grbl should respond with the settings that are pre-configured. To change any of the settings type $ followed by the associated number and the setting value. The grbl wiki here describes in detail the settings, its values and how to change them.

Typical values that you would need to change are the steps/mm, max travel distance, the acceleration rates and homing.

Please proceed with caution and know what you are doing. Updating the firmware will erase all custom settings and options. This will reset grbl back to its default settings.

This controller comes pre-installed with grbl 1.1e. Whenever a new release comes in you can update the firmware yourself using the Arduino IDE. Download the grbl zip or clone the git repository into a new folder. You should find a new folder called grbl inside this main folder (usually named grbl-master). Copy the grbl folder to the Arduino libraries folder. This is usually under your ‘Documents/Arduino’ folder.

Restart the IDE and you should now see the grbl item under File > Examples menu. Please make a note of your existing settings, mask values etc. This is important!

Clear the EEPROM and upload the new firmware

Before you update the firmware, you’ll need to clear all existing settings and values. From the Arduino IDE menu, open the eeprom_clear program (File > Examples > EEPROM). Now upload this program to the controller as you would any other program.

eeprom clear

Now click and open the grblUpload sketch and simply upload the sketch to get the updated firmware.

The other way is to upload a pre-compiled HEX file (also available on the grbl page) using a HEX uploader and an AVR programmer (there are plenty of cheaper clones of these programmers).

Updating firmware using the ISP header

If the above method does not work, use the 10-pin ISP header next to the AVR processor to program the board. You will need one an AVR programmer such as this or this. Please install any 3rd party drivers that would be needed by your programmer before attempting this. Make sure you line up the red wire from the programmer with pin 1 of the header (marked on the board).

If your programmer has a 6-pin header, you’ll need a converter or you need to connect individual wires between the programmer and the header as shown below.

After you’ve correctly wired the programmer, start the Arduino IDE and open the requisite sketch. Select the programmer as “USBTinyISP” from the Tools > Programmer menu. Now upload the sketch and update the firmware using “Upload using Programmer” option instead of simply “Upload”.

Note that when using Sparkfun’s AVR Pocket Programmer you do not need to specify a com port. Also this programmer works only on machines that run the Windows operating system. Follow their excellent hookup guide to setup the drivers first.

This Post Has 6 Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

Back To Top