MachPro Compatible Motion Controller Configuration Settings
This manual will guide you through integrating your compatible motion controller with MachPro
MachLabs recommends using the E-Stop, Hardware Enable, Drive Enable, and Alarm features of your motion controller. If you are not going to use these features, you may need to contact support to disable some features in the Machine and Safety Relay sections of the MachPro settings.
MachPro Startup
On the desktop of your control, there is a MachPro shortcut
for your machine type.
After double clicking on your MachPro shortcut, a window will come up asking to Press Cycle Start to Enable Mach and Home All Axes . By default on a new installation, MachPro will home in place. While you are configuring your control, click Cancel to prevent the system from enabling.

This prompt can be turned off in the MachPro settings if desired.
Firmware Update
On your first start of the MachPro software, it will check to ensure that you have the latest firmware for the M31 motion controller. If not, you will see an update screen.
Follow the prompts to update the M31 firmware. When it has completed the process, it needs to reboot the M31, and it will prompt for your approval to do that. Once the M31 is running again, and both the Firmware and FPGA are current, close the M31 Upgrade window.
Restart the MachPro software to ensure smooth operation.
If you have problems with the automated upgrades, you should use the manual upgrade process. MachPro Manual Upgrade of M31 Firmware and FPGA
The configuration menus are locked if the system is enabled, and all the menu options will be grayed out. You need to disable the system in order to make configuration changes.
Emergency Stop Input Mapping
- Map the E-Stop signal to [motion controller] 1DI.ESTP - the actual input wired on your motion controller.
- When configured correctly, opening the E-Stop terminals will disable the system.
- The system will only operate when the E-Stop circuit is closed and healthy.
- Accessing the E-Stop input mapping
- Pull down Configure > Control.
- Select the Input Signals tab.
- Scroll down to the E-Stop signal. It is a little over halfway down the list of input signals.
Hardware and drive enable settings
- Open Configure > Control.
- Select the Settings tab
- Scroll down to the Machine section
In the Settings tab, you can:
- Set the outputs for the hardware and drive enable signals.
- Set the delay between hardware enable and drive enable.
- Choose which outputs turn off when the system disables.

Axis Setup
After the drives are connected to the motion controller, open up MachPro, and enable the axes as follows:
Note: This may already be setup depending on your system.
- Enable all the motors that are to be controlled by setting the respective boxes in the right pane to checks. In the example below, motors 0, 1, and 2 are enabled.
- If a motor moves the wrong direction, it can be reversed in the MachPro. Check the Reverse? box if the motor direction needs to be reversed. The motor will now move the opposite direction than it did before. If the homing direction was already set, it may need to be reversed as well. (see the homing section ). NOTE: Axes with master and slave motors typically need to have one motor reversed, and the other left to run normally.
- Press [ Apply ] to save any changes.

- Next, select the Axis Mapping tab as pictured below. Associate the enabled motors to the applicable axis. In this example, Motor0 is the X master, Motor1 is the Y master, and Motor2 is not mapped to an axis. No slave axes are configured on this system.

- If you have an axis with two motors - such as a gantry - one motor will be the master and the second will be the slave. In the slave column, select the motor that will be running in slave mode. In this example X axis has Motor0 as the master and Motor2 as the slave.

- Press [ Apply ] and [ OK ] to save and close.
- Carefully test jogging. If you have a gantry with two motors, you may need to reverse one motor for correct motion. See step 2 above.
-
You are not seeing motion on one, or all axes
- Slow down your speed to see if it moves at slow speed.
- Reduce your steps per unit and jog slowly.
The system should now be able to jog, however,....
WARNING
The machine can be crashed very easily at this point. The axes need to be calibrated and the limits set up now.
Axis Calibration
Before calibrating the axes remove all backlash settings from each axis. There is an explanation of backlash at the end of this document.
Go to Configure-> Plugins -> Machine Calibration.
Select the type of configuration you would like to perform from the window:
- Manual - Calculate the axes by comparing distance traveled vs. distance commanded. See Manual Calibration below for instructions.
- Automatic - Calibrate axes using the specifications of your system. Continue for instructions.
Automatic Units Calibration
Automatic calibration requires you to provide all of the details of your motor and axis hardware. If you are unable to find this information, proceed to the Manual Calibration section.
- Select the Drive that most closely matches yours. If there is not an exact match, select based on the number of encoder resolution bits.
- Select the max motor RPM
- Enter 131,072 for the Encoder Resolution. If you have a stepper drive, or the drive is less than 17 bit, then enter the actual resolution per rotation for your motor.
- Enter 1 for the drive ratio.
- If this axis uses a pulley, select that box and enter the number of teeth from the load side and the motor side.
- If there is a gearbox, select that box and enter the ratio.
- This axis will have either a ballscrew or rack and pinion system. Select the type it has and complete the open fields.
- Select the axis to calibrate.
- Leave Angle at 0 degrees
- Press the [Calculate] button.
- Evaluate the current steps value against the proposed values. You may change values and re-calculate.
- When you are ready to Accept the new steps per value, enter in the maximum Acceleration and Velocity values that you want for this axis.
Repeat for each axis.
Press [OK] and restart MachPro to save the calibration settings.
This is an example of a simple X axis that has been calculated and is ready to be accepted. You may need to change the Acceleration and Velocity values to be appropriate for your machine.
Verify that each axis is moving the distance that you command.
Manual Calibration
This tool will enable you to calibrate your axes based on measuring actual distances moved and updating the MachPro parameters. Use the longest distance that you can accurately measure to calibrate each axis.
You will be commanding motion on each axis. Carefully jog each axis to the middle of travel before starting calibration.
- Select the axis to calibrate.
- Select either Jog Distance or Commanded Distance. Jogging allows you to directly control the speed and distance the axis moves.
Axis calibration is a core function of a CNC control. Ensure that it now meets your accuracy requirements before moving on in the configuration. All of the following configuration steps depend on calibration, and if you later change the calibration, you will need to reconfigure many of the items below.
Configure Velocity and Acceleration
If you want to adjust your velocity, select Configure on the top menu bar, then Control . Select the Motors tab as shown below.
In the right pane, click on the motor you want to set up.
Click the word to highlight and select the axis. The checkbox is for enabling/disabling the motor
The selected motor’s parameters will be loaded and the velocity or acceleration settings can be adjusted.
- The max velocity is limited by several factors, including the motor. If you want an axis rapid speed to be limited or lowered, adjust the velocity for that motor to the max speed you want the rapid to be. The rigidity of the machine hardware will limit practical maximum velocity of an axis. The cut quality and accuracy will degrade as it reaches that point.
- For stepper motors, max acceleration is typically 15-20 if in standard units. For servo motors, start with value of 30-40. This parameter also sets the deceleration rate, which interacts with a regeneration resistor - if one is installed on this axis.
Press [ Apply ] before clicking on another motor or closing out the Mach Configuration window. NOTE: If you change the counts per unit, the velocity and acceleration values will adjust accordingly. If you do not want them to change, type in the current values shown. Verify by clicking another motor and then coming back to the adjusted motor.
WARNING
No limits have been set up. DEATH, INJURY or serious PROPERTY DAMAGE can occur if the system is not operated carefully. Limits and homing setup will be completed in the next sections
All of the axes are now calibrated, but MachPro does not know where the limits of travel are on each axis. That will be configured next. Until that setup is completed, be very careful if you are moving axes.
Note: For the highest level of safety, wire the limit switches Normally Closed. If a limit is tripped, or a wire or limit is damaged, the system will stop motion.
To wire 24V limit switches, follow the steps outlined below.
-
- Select, or install, two limit switches at the end of each axis' hard limits.
- Wire the two switches in series, normally closed. If either limit is tripped, the circuit will open and motion will stop. I/O ports are limited, and wiring the limits for a given axis in series conserves those limited ports while maintaining function.
Wire a home switch on each axis to a separate input.
Tip for success: Once you understand how to wire and map inputs and outputs, complete and use the charts in the appendix at the end of this document while you are wiring your inputs and outputs.
Mapping Input Signals
Short example
- Motor 0: Home, ++, and -- are enabled (green check).
- All limits are wired normally closed.
- We used M31 1DI.01.09 for both ++ and --.
- We used M31 1DI.01.08 for the Home switch. Using a separate input for Home is more reliable.
Manually trigger each limit switch and make sure they disable Mach before continuing. This verifies both the wiring and signal mapping. Manually trigger all other inputs to verify the provide the correct software signal.
Homing Setup
-
Danger: If limit switches are wrong or an axis moves the wrong way, the machine can crash.
- Do this first: Keep your hand on the Emergency Stop button the first time you run homing.
- Open the settings: From the menu bar click Configure → Control. Then click the Homing/SoftLimits tab.
Columns
- Home Dir: Pick the direction the axis will move to find home — positive or negative.
- Home Order: Set the order of homing using numbers (1 = first, 2 = second, etc.).
- Tip: Z is often set to 1 so it moves up first and stays out of the way.
- Home Offset: the machine coordinate value MachPro will assign to the axis when homing finishes
- Home Speed%: Set how fast the axis homes by choosing a percent.
- 20% is the usual maximum for best results.
- Slower speeds help stop over-travel.
- You can jog (move) the axis quickly close to the home position before homing to save time.
- Home In Place: Set this based on your hardware in the motion controller config. This is used with absolute encoder systems.
- Soft Enable: Deselect this if you will not be using soft limits on this axis
- Soft Min: The most negative value you want the machine to move on this axis
- Soft Max: The most positive value you want the machine to move on this axis
- Ref On Startup: Used on machines that use G90 and G92 heavily
Save: Press OK to save your changes.
Test: Home each axis one by one to check the settings. Then press Home All to verify everything works.
Homing Slave Axis
There are 2 configuration options:
1. Homing with the home switch only on the Master axis. In this configuration, the slave axis will use the input signal from the master home switch. You will also need to configure the axes in the motion controller.
|
Open Configure → Control → Axis Mapping.
|
|
|
Open Configure → Control → Input Signals.
|
|
2. Homing with both Master and Slave having their own home sensors. In this configuration, the master and slave axes each have their own home switch. This is the preferred configuration.
|
Open Configure → Control → Axis Mapping.
|
|
|
Open Configure → Control → Input Signals.
|
|
Troubleshooting
- What happens: When you touch off switches and home, one side keeps moving and drags the other side. This is a sign the switch assignments are swapped.
- What it means: The home switch used for the master may actually be wired to the slave (they are swapped).
- How to check:
- Touch each home switch by hand (one side at a time).
- Home the machine and watch each side while you touch the switches.
- If one side still travels and pulls the other side, the switch mapping is likely wrong.
- What to check in software: Look at Input Signals and Axis Mapping to make sure each switch is assigned to the correct axis.
- Safety: Keep your hand on E-Stop the first time you test after changes.
Soft Limits Setup
With machine homed correctly and soft limits set, the machine will not hit a physical limit switch. If at any time a command is made for the machine to move outside of the soft limits (while they are enabled), an error will appear in the status line and motion will stop. To set up the soft limits, follow the procedure outlined below.
- Home the machine.
- Select to view Machine Coordinates on the Locked screen view so that the DRO’s are orange.
- Jog the machine to the maximum safe distance from the homing switches.
- Note: Make sure to stay inside the physical limit switches. If the machine is jogged outside of the limit switches, it completely defeats the purpose of soft limits.
- Record the machine coordinates at the end of the travel for each axis.
- Jog the machine to the maximum safe distance beyond the homing switches, and record the machine coordinates for each axis.
- Open the menu bar and click Configure->Control and select the Homing/SoftLimits tab as previously shown.
- Enable soft limits on each desired axis by setting the Soft Enable column to a green check mark, and enter in the recorded values.
- For each axis, enter the largest, most positive value in the Soft Max field, and the smallest, most negative value in the Soft Min field.
- Press [ OK ] to save changes. Test the soft limits by jogging the axes to maximum amounts in all directions.
- Note: When loading a G-code file, the tool path display will show the soft limits as dashed lines. If any part of the tool path renders outside the soft limits, check your file.
Mapping Output Signals
To configure an output, follow the procedure below.
Verify that all of your outputs trigger correctly when you enable them from MachPro.
Using Outputs
Outputs 0-9 can be controlled with M-Codes. One M-Code turns an output on, and the other M-Code turns the output off. Use the table below for a reference.
|
Advanced M-Codes |
Functions |
|
Output #0 on |
|
|
M201 |
Output #0 off |
|
M202 |
Output #1 on |
|
M203 |
Output #1 off |
|
M204 |
Output #2 on |
|
M205 |
Output #2 off |
|
M206 |
Output #3 on |
|
M207 |
Output #3 off |
|
M208 |
Output #4 on |
|
M209 |
Output #4 off |
|
M210 |
Output #5 on |
|
M211 |
Output #5 off |
|
This pattern continues through M219 and M220 for Output #9 |
|
Also see M220 - M222 for extended output control
Mist and Flood Control
|
Feature |
ON M-Code |
OFF M-Code |
Preconfigured Output |
|
Mist |
M7 |
M9 |
|
|
Flood |
M8 |
Spindle Setup
A VFD (Variable Frequency Drive) controls the speed of the spindle motor.
Set the VFD to match the motor’s electrical ratings:
- Rated voltage
- Rated current
- Rated speed (RPM range)
You must use the values from:
- The VFD manual
- The spindle motor manual
- Do not guess these values.
Turning on the Spindle
In addition to the screen controls the spindle can also be controlled using M-codes. Use the table below as a reference.
|
M-Code |
Function |
|
M3 |
Clockwise |
|
M4 |
Counter/Clockwise |
|
M5 |
Stop |
Spindle Calibration
Mills and Lathes benefit from calibrating their spindles. MachPro Spindle Calibration
Next Steps
There are Machine Type Setup and Operation manuals for the different machine types, and there is also an Advanced Configuration Manual for features like modifying the tool table or using the GCAdapter.
Explanation
Backlash Repair and Compensation
Backlash is caused by the gaps between moving parts such as gears and ballscrews. It is the amount of movement one component can make in one direction without causing motion in the next connected part. Mechanical systems have some backlash - even when new. If the mechanics are too tight, binding and excessive wear will result. As the gears and ballscrews wear, the backlash will increase, and accuracy will decrease. Ongoing testing and maintenance of your mechanical system is required to minimize backlash and maintain your production quality.
| http://www.mach-labs.com | MachLabs Documentation | support@mach-labs.com |
The MachLabs Team
14518 County Road 7240, Newburg, MO 65550
support@mach-labs.com























