Skip to main content

MachPro Compatible Motion Controller Configuration Settings

MachLabs - Logo & Text.png

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 image.png 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.

cycle-start-prompt.jpg
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.

image.png

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.

image.png

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.

image.png

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
    1. Pull down Configure > Control.
    2. Select the Input Signals tab.
    3. Scroll down to the E-Stop signal. It is a little over halfway down the list of input signals.

image.png

Hardware and drive enable settings

  1. Open Configure > Control.
  2. Select the Settings tab
  3. 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.
    image.png

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.

  1. On the menu bar, click Configure->Control. Then select the Motors tab (pictured below).

Note, if menu options are greyed out (not active/selectable), disable the system to allow configuration changes

  1. 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.
  2. 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.
  3.  Press [ Apply  ] to save any changes. 
    image.png
  4. 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.  
    image.png
  5. 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. 
    image.png
  6. Press [  Apply ] and [ OK ] to save and close.
  7. 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.
  8. 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. 

image.png

image.png

  1. Select the Drive that most closely matches yours. If there is not an exact match, select based on the number of encoder resolution bits. 
  2. Select the max motor RPM
  3. 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. 
  4. Enter 1 for the drive ratio. 
  5. If this axis uses a pulley, select that box and enter the number of teeth from the load side and the motor side.
  6. If there is a gearbox, select that box and enter the ratio.
  7. This axis will have either a ballscrew or rack and pinion system. Select the type it has and complete the open fields.
  8. Select the axis to calibrate.
  9. Leave Angle at 0 degrees
  10. Press the [Calculate] button.
  11. Evaluate the current steps value against the proposed values. You may change values and re-calculate.
  12. 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. 

image.png


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.

  1. Select the axis to calibrate.
  2. Select either Jog Distance or Commanded Distance. Jogging allows you to directly control the speed and distance the axis moves.

Manual Calibration Using Jogged Distance

Manual Calibration Using Commanded Distance

image.png

image.png

  1. Press [  Enable  ] and then [  Record Jog  ]
  2. Jog the longest distance you can accurately measure
  3. Press [  Record Jog  ] again to stop the recording
  4. Measure the distance jogged and enter it into the actual travel field.
  5. Press [ Submit ] to calculate the steps per unit
  6. Press [ Accept ] to update the axis calibration.
  7. To verify, use the Commanded Distance function
  1. Enter the distance and feedrate you want to use.
  2. Press [  Enable  ] and then [  Move  ]. Be prepared to press the E-Stop button if the axis moves too close to a hard stop. 
  3. Measure the distance moved and enter it into the actual travel field.
  4. Press [ Submit ] to calculate the steps per unit
  5. If the distances commanded and moved are the same, it will not change the steps per unit and you can press [ OK ] to close the window.
  6. If commanded and actual are different, press [ Accept ] to update the axis calibration.
  7. To verify, repeat the Commanded Distance function.

Pressing [ Accept ] at this point will update the steps per unit on this axis

image.png

Pressing [ Accept ] at this point will update the steps per unit on this axisimage.png

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. 

image.png

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.

kR3image.png

To wire 24V limit switches, follow the steps outlined below. 

    1. Select, or install, two limit switches at the end of each axis' hard limits. 
    2. 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

  1. At the top of the screen, open Configure → Control.
  2. Click the Input Signals tab.
  3. Scroll down the list until you see each motor section: Home, ++, and --.
  4. Note the State column. It shows the current state of that signal, providing for immediate confirmation of your I/O configurations. In the first screen below, Z is homed.
  5. For each signal mapping (Home, ++, --) do these steps:
    • Enable mapping: Click the red [ X ] next to the signal. It will turn into a green [ ✓ ]. That turns the mapping on.
    • Device: Choose your motion controller from the Device list.
    • Input Name: Pick the input you wired to the motion controller (for example 1DI.01.08 or 1DI.01.09).
    • Active Low:
      • If your limit switches are normally closed, click the red [ X ] to change it to a green [ ✓ ].
      • This makes the input active when the voltage goes low. (Wiring normally closed is the safest method.)
    • Description: Type the name for this axis limit (the name operators and designers use).
  6. When you finish all limits and home switches for a motor, click Apply, then click OK.

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.

image.png

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.

image.png

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.

  • Unmap the slave motor from the Master column
    • Find the motor listed under the Master column that will function as the slave.
    • Remove or clear that motor so it is no longer mapped in the Master column.
  • Set the slave motor
    • Under Slave 1, pick the motor you want to be the slave (use the drop-down).
  • Save your changes (press Apply)

image.png

Open Configure → Control → Input Signals.

  • Find the Home signal row for the slave motor.
  • Turn on that mapping (click the red [ X ] so it becomes a green [ ✓ ]).
  • Set the Input Name to 1DI.01.09 (the same input the master uses).
  • If your switches are normally closed, set Active Low to a green [ ✓ ] so the input triggers when voltage goes low.
  • In Description write a clear name (for example: (1DI.01.09 X2 HOME uses X1 home sensor ).
  • Save your changes (press Apply)

 

image.png

 

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.

  • Unmap the slave motor from the Master column
    • Find the motor listed under the Master column that will function as the slave.
    • Remove or clear that motor so it is no longer mapped in the Master column.
  • Set the slave motor
    • Under Slave 1, pick the motor you want to be the slave (use the drop-down).
  • Save your changes (press Apply)

image.png

Open Configure → Control → Input Signals.

  • Find the Home signal row for the slave motor.
  • Turn on that mapping (click the red [ X ] so it becomes a green [ ✓ ]).
  • Make sure that each axis is mapped to its own home sensor input 
  • If your switches are normally closed, set Active Low to a green [ ✓ ] so the input triggers when voltage goes low.
  • In Description write a clear name (for example: X2 HOME  (1DI.01.13).
  • Save your changes (press Apply)

 

image.png

 

 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.

  1. Home the machine.
  2. Select to view Machine Coordinates on the Locked screen view so that the DRO’s are orange.

    • image-1605907309826.png
  3. 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.
  4. Record the machine coordinates at the end of the travel for each axis.
  5. Jog the machine to the maximum safe distance beyond the homing switches, and record the machine coordinates for each axis.
  6. Open the menu bar and click Configure->Control and select the Homing/SoftLimits tab as previously shown.
  7. 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. 
  8. 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.

  1. On the menu bar click on Config->Control .
  2. Select the Output Signals
  3. Scroll down to the desired output (There are 64 output signals available).
  4. Note the State column. It shows the current state of that signal, providing for immediate confirmation of your I/O configurations. In the screen below the Brushes Up signal is active.
  5. Enable the output by setting the Mapping Enabled box to a green check.
  6. Set the Device to your motion controller and the Output Name to the motion controller output port you wired. This example maps the Draw Bar Open to port DO.09.2.
  7. Set the Active Low column to a green check for a normally closed signal (Active Low) or red x for normally open (Active High).
  8. Press [ Apply ] and [  OK ] to save changes.

image.png

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

M200

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
  1. On the menu bar click on Config->Control, select the Output Signals tab
  2. Select the motion control device and output port
  3. Add a User Description, which will show on the Service Machine I/O dashboard
  4. Further down in the settings, select the Settings tab
  5. Filter for either Mist or Flood and adjust the settings for your system

Feature

ON M-Code

OFF M-Code

Preconfigured Output

Mist

M7

M9

image.png

Flood

M8

image.png

Spindle Setup

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

MachLabs Terms and Conditions

The MachLabs Team
14518 County Road 7240, Newburg, MO 65550
support@mach-labs.com