Mach4 Advanced Configuration¶
These are advanced procedures that can be used to further customize Mach4 and your Avid CNC machine for specific use cases.
Swap X and Y Axes¶
By default all Avid CNC machines are configured with the Gantry (short) axis as X and the Table (long) axis as Y. These axes follow a standard "Right Hand Rule" sign convention. The Avid CNC Mach4 profile does include an option to swap these two axes, but it is important to follow these steps to be successful.
This feature only works properly in Avid CNC Mach4 Profile version 2.0.6 (released 11/2019) or newer. You can check your status on the About tabAbout tab (/support/instructions/software/mach4Configuration/#6-about). To upgrade if needed, see our software Mach4 DownloadsMach4 Downloads (/support/instructions/software/downloads/mach4) page.
1. Initial Setup¶
Before using this feature, follow all the normal setup instructions for your machine to completion so that the machine homes and moves correctly in the default configuration. This should result in the axis motion and sensor configuration below.
2. Software Changes¶
In Mach4 go to the Configure -> Avid CNC Machine Configuration -> Advanced Options menu to choose the “Swap X and Y axes” option. This change will switch axis assignments in Mach4 and will cause the Table axis to home to the back of the machine.
3. Machine Changes¶
To accommodate the software changes, you need to physically move the Y1- home sensor and sensor flag to the back end of the gantry riser plate and table. The new axis sign convention and necessary sensor change is shown below:
Configure Dual Z Machine for Routing and Drilling¶
The Avid CNC Mach4 profile includes support for Dual Purpose machines that use a spindle or router on one Z axis and a plasma torch on the second. For applications that require a spindle on one Z axis and a router or drill on the other, there are extra setup and operation steps required.
This guide specifically covers the setup of a Dual Z machine with an Avid CNC Plug and Play Spindle/VFD System and a typical AC powered router/drill motor. Some of the steps may apply for other tooling mounted to the second axis.
1. Physical Setup of the Cutting Tools¶
Install your spindle according to our standard instructions, and install your router/drill in place of the plasma torch.
|Cutting Tool||Axis Name||Mach4 Motor Number|
- Connect the VFD enclosure to the CRP800-00E controller with the 14-pin cable (see Plug & Play Spindle CRP800 SetupPlug & Play Spindle CRP800 Setup (/support/instructions/accessories/spindles/setup/CRP800setup/) for details).
- Plug the router/drill into Relay 1 Out and the necessary power (110V-250V AC) into Relay 1 In on the CRP800 controller.
2. Mach4 Configuration¶
2.1 Mach4 Version¶
These instructions require that you have Avid CNC Mach4 Profile Version 2.1.0 or higher installed. The latest available version is recommended.
- To check your version within Mach4 go to the Configure -> Avid CNC Mach4 Configuration -> About tab.
- If an update is needed, go to Mach4 for Avid CNC MachinesMach4 for Avid CNC Machines (/support/software/downloads/mach4/) and download/run the latest installer.
2.2 Avid CNC Mach4 Configuration Menu¶
In the Avid CNC Mach4 Configuration menu:
- Set the cutting tool to Spindle/Plasma on the General tab. This will enable and map the second vertical axis as the U axis motor.
- Choose the correct side (left/right) for the spindle.
Save the configuration settings at this point to lock the machine configuration.
Navigate back to the Avid CNC Mach4 Configuration menu. On the Custom tab check the Use Custom Homing Settings and Disable Avid CNC Mach4 Configuration options.
2.3 Cutting Method Configuration¶
- On the Cutting Methods tab of the main Mach4 screen, choose Spindle as the cutting tool.
- In the Custom Homing Settings menu set the homing order (X=3, Y=3, Z=1, U=2) as shown below.
2.4 ESS Configuration Changes¶
Because the Relay 1 output doesn't normally get turned off by the on-screen "Stop" button, that behavior needs to be set.
- Navigate to Configure -> Plugins -> ESS. On the Pins Config tab scroll down to find Port2-Pin17. Set the Stop State to Force OFF. Restart Mach4 for the change to take effect.
2.5 Auto Z Touch Plate Configuration¶
- Open the Auto Z Touch Plate window and navigate to Advanced Settings.
- On the Probe Axes tab check the Allow selection of vertical probe axis and U Axis options. This will allow the second vertical axis to use the touchplate for setting work offsets.
3. G-Code Modifications¶
We recommend using separate G-Code files for each cutting tool. This makes it easier to ensure that the correct axis and cutting tool will operate.
If you choose to combine the spindle and router/drill toolpaths in a single G-Code file, be careful to only edit the correct toolpath in the G-Code.
In order to control the second cutting tool (router/drill) correctly you will need to either make the manual changes to the G-Code outlined below, or modify a post processor to make these changes automatically.
These changes can be made by post processing the toolpath using the standard Avid Mach4 post processors in your chosen CAD/CAM program, then opening the G-Code in a text editor like Notepad++Notepad++ (https://notepad-plus-plus.org/) to make the edits using "Find/Replace".
Make the Find/Replace changes below for the router/drill G-Code or toolpath only:
Find M03 (or M3) and Replace with M08G04P5.0
This replaces the standard Spindle On command with a command to turn on Relay 1 and pause for 5 seconds before continuing the program to allow for the RPM to stabilize.
Find M05 (or M5) and Replace with M09G04P5.0
This replaces the standard Spindle Off command with a command to turn off Relays 1 and 2 and pause for 5 seconds before continuing the program to allow for the RPM to drop to zero.
- Find Z and Replace with U
3.2 Spindle Work Offset¶
Find the Safe Start line(s) at the beginning of the spindle G-Code. This line is a series of modal codes that set the proper state of the controller.
Add G54 to this line.
This sets the active work offset for this G-Code to G54, which will get set using the Auto Z Touch Plate and the Z axis.
3.3 Router/Drill Work Offset¶
Find the Safe Start line(s) at the beginning of the router/drill G-Code. This line is a series of modal codes that set the proper state of the controller.
Add G55 to this line.
This sets the active work offset for this G-Code to G55, which will get set using the Auto Z Touch Plate and the U axis.
If you post processed the spindle and router/drill toolpaths in a single file you will need to add G54 at the start of each spindle toolpath and G55 at the start of each router/drill toolpath.
4. Running the Programs¶
4.1 Probe the Spindle Tool (Z axis)¶
- On the Offsets tab in Mach4, select G54 as the active work offset.
- Open the Auto-Z Touch Plate window. Choose the Z as the axis to probe.
- Jog the spindle tool over the touch plate use it as normal. Probe one of the corners to set the G54 XYZ offsets.
4.2 Probe the Router/Drill Tool (U Axis)¶
- On the Offsets tab in Mach4, select G55 as the active work offset.
- Open the Auto-Z Touch Plate window. Choose the U as the axis to probe.
- Jog the router/drill tool over the touch plate and use it as normal. Probe one of the corners to set the G55 XYU offsets.
The U axis can be jogged using the bracket keys, [ (up) and ] (down).
4.3 Program Run¶
The spindle and router/drill G-Code programs can now be run properly. The G-Code changes made in these instructions will make sure that the correct work offsets and axes are used.