Mach4 CNC Operation Manual-Hobby
Mach4 CNC Operation Manual-Hobby
1
Copyright © 2014 Newfangled Solutions, Artsoft USA, All Rights Reserved
The following are registered trademarks of Microsoft Corporation: Microsoft, Windows. Any other
trademarks used in this manual are the property of the respective trademark holder.
Table of Contents
1Introducton............................................................................................................................................... 3
1.1Before You Begin................................................................................................................................. 4
1.2What is Mach4?.................................................................................................................................. 4
1.3How Do I Get My Drawing Into Mach4?.............................................................................................. 4
1.4Typical CNC Cutng grocess................................................................................................................ 5
2Screen Layout and Controls....................................................................................................................... 5
2.1Menu Bar............................................................................................................................................ 6
2.1.1File Menu..................................................................................................................................... 6
2.1.2View Menu................................................................................................................................... 7
2.1.3Confgure Menu........................................................................................................................... 8
2.1.4Diagnostc Menu.......................................................................................................................... 9
2.1.5Wizard Menu............................................................................................................................... 9
2.1.6Operator Menu.......................................................................................................................... 10
2.1.7Help Menu................................................................................................................................. 11
2.1.8Operaton Mode Tabs................................................................................................................ 12
2.1.9grogram Run Tab........................................................................................................................ 12
2.1.10MDI Tab.................................................................................................................................... 14
2.1.11Tool gath Tab............................................................................................................................ 16
2.1.12Diagnostc Tab.......................................................................................................................... 16
2.2Operator Control Tabs....................................................................................................................... 17
2.2.1File Ops Tab................................................................................................................................ 17
2.2.2Run Ops Tab............................................................................................................................... 17
2.2.3Tool gath Ops Tab....................................................................................................................... 18
2.2.4Jogging Tab................................................................................................................................. 18
3Getng Started........................................................................................................................................ 19
3.1Enabling the System.......................................................................................................................... 20
3.2Home the Machine........................................................................................................................... 21
3.3Jogging.............................................................................................................................................. 22
3.4Changing Tools.................................................................................................................................. 23
3.5Fixture Ofsets................................................................................................................................... 23
3.5.1Edge Finding............................................................................................................................... 24
2
3.5.2Inputng Fixture Ofset Values................................................................................................... 25
3.6Tool Length Ofsets........................................................................................................................... 27
3.6.1Master Tool................................................................................................................................ 28
3.6.2Tool Length from Gage Line....................................................................................................... 28
3.7Tool Diameter Ofsets....................................................................................................................... 29
3.8Tool Wear Ofsets.............................................................................................................................. 29
3.9Tool Informaton............................................................................................................................... 30
3.10 Creatng grograms.......................................................................................................................... 30
3.10.1Mill Wizard............................................................................................................................... 31
4Running the Machine............................................................................................................................... 35
4.1Manual Data Input (MDI).................................................................................................................. 35
4.2Loading a G Code grogram................................................................................................................ 36
4.3Viewing the Tool gath....................................................................................................................... 37
4.4Editng a G Code grogram................................................................................................................. 37
4.5Closing a G Code grogram................................................................................................................. 37
4.6Executng a G Code grogram............................................................................................................. 37
4.6.1Cycle Start.................................................................................................................................. 37
4.6.2Feed Hold................................................................................................................................... 37
4.6.3Stop............................................................................................................................................ 38
4.6.4Reset.......................................................................................................................................... 38
4.6.5Startng from the Middle of a grogram...................................................................................... 38
5Help, I’ve Crashed…................................................................................................................................. 39
5.1Limit Switches................................................................................................................................... 39
5.2Sof Limits......................................................................................................................................... 40
5.3Crash!!!............................................................................................................................................. 41
5.4greventng the Inevitable.................................................................................................................. 41
Introducton
The purpose of this manual is to teach the basic operaton and functonality of the Mach4 CNC control
sofware. This manual is based on the core Mach4 product using the standard screen set. The
appearance of the interface may vary depending on the machine builder. Mach4 includes a screen
designer that allows manufactures and operators to create custom screen layouts for their specifc need.
3
More informaton on the screen designer can be found in the customizaton manual. grogramming and
confguraton also have their own respectve manuals which must be read before setng up and running
a Mach4 controlled machine.
Note: Operators should be familiar with general CNC and machining practces before operatng
any CNC machine. Some great resources for additonal learning at the machsupport.com
forums, other user groups/forums, and books such as CNC Programming Handbook and CNC
Control Setup for Milling and Turning, both by Peter Smid and Programming of CNC Machines by
Ken Evans
What is Mach4?
Mach4 is sofware that operates on a personal computer to create a powerful and cost efcient CNC
controller. It makes up one small piece of a computer numerical control (CNC) machine. Machines can
range from basic mills and lathes to wood routers, plasma cuters, mult axis machining centers, uuiltng
machines, anything reuuiring moton control. The system is capable of interpretng multple
programming languages, the default and most common being G code, to provide instructons for
machine movement and other functons. These instructons are passed to an external moton device,
which in turn controls all the inputs and output signals and moton.
Mach4 is designed to be fexible and adaptable to a wide variety of machines. gart of this fexibility is
the ability for hardware and sofware developers to create addons or plugins for Mach4 to expand its
capabilites. Addons are small programs installed into the Mach4 directory that give Mach the ability to
talk to hardware devices such as moton controllers and pendants, communicate with other sofware,
add additonal wizards or conversatonal machining functons, or anything a developer can dream up.
Addons to Mach4 are so diverse it would be impossible to cover them in this manual. The developer
should provide detailed informaton on the installaton, confguraton and use of their addon or plugin.
What is an external moton device? Originally, Mach-series sofware only worked with the parallel
port (via the parallel port driver), which was a standard port on every PC. Technologies have
advanced over tme, and not only is the parallel port becoming obsolete, but the Windows codebase
has changed to the point where it is technical impossible for the parallel port driver to work. An
external moton device is a piece of hardware that is an improvement over the parallel port. It
enables a PC running Mach3/Mach4 to control outputs and read inputs. They typically
communicate with the PC via an Ethernet or USB connecton (but are not limited to those two means
of communicaton). In order to control a machine using an external moton device, the developer of
the hardware must write a plugin (driver) for that specifc device, so no standard USB-to-parallel
4
port adapters will work. There are many devices listed on our Plugins page in the sofware and
download secton of our website (www.machsupport.com).
5
Typical CNC Cutng g Process
6
Figure 2-1: Mach4 screen layout.
Menu Bar: Contains drop down menus similar to many programs. Optons here range from
loading programs, confguraton of Mach4 and its plug-ins and exitng the program.
Operaton Mode Tabs: These tabs select the operaton mode of Mach4 and change the layout of
the upper half of the screen based on the selecton made.
Program Executon Controls: Cycle Start, Feed Hold and Stop butons to control the executon of
loaded G Code programs or MDI programming.
Reset: The Reset buton returns the control to its default state and rewinds the program.
Enable/Disable: The enable buton does just that, it enables Mach4. The control must be
disabled before any confguraton changes can be made.
Status Bar: Shows the current state of the modal G Code groups.
Message History: Displays a window that shows the history of messages displayed in the
message bar and recent buton pushes.
Message Bar: Displays Mach4 errors and comments from a program or script.
Operator Control Tabs: Display a variety of butons for control of loading and editng programs,
running of programs, tool path display and jogging.
Current Tool Data: Displays current tool number and ofset data.
Actve Profile: Displays the name of the current profle.
Override Controls: grovide control over the feed rate, rapid and spindle speed overrides.
Spindle Control: Spindle on/of buton.
7
Menu Bar
The menu bar in Mach 4 consists of drop downs that provide access to, among other things,
confguraton setngs, diagnostcs, and ofset informaton.
File Menu
The fle menu contains commands for opening and closing G code fles and exitng the program (see
fgure 2-2).
New Gcode File: Selectng this opton opens the G code editor with a new blank fle. A program
can then be manually typed in by the user and saved for later executon.
Recent Files: Display a list of the most recently opened G code fles. Select one from the list to
load it into Mach4 for executon.
Open Gcode File: Opens the “Select File” dialog, fgure 2-3. The user can then navigate to the
desired G code fle to select and open it in Mach4.
View Menu
The view menu, fgure 2-4, contains controls for changing the current display.
8
Figure 2-4: View menu
Load Screen: Opens a dialog that allows the user to choose a new screen, or display.
Full Screen: guts Mach4 into full screen mode. Mach4’s display will be enlarged to cover the
entre display.
Fixture Ofsets: Displays the fxture ofset table, more informaton is available in the fxture
ofset secton of this manual.
Tool Table: Displays the tool ofset table, more informaton is available in the tool ofset secton
of this manual.
Windows: grovides optons for what toolbars are displayed when in the screen editor mode.
The screen editor and its associated functons are explained in the customizaton manual.
Configure Menu
The confgure menu, fgure 2-5, provides access to Mach and glugins confguratons. Confguraton
setngs are disabled when Mach4 is enabled. To allow access to these setngs, frst disable the
controller. More detailed informaton on these setngs can be found in the Mach4 CNC Controller
Confguraton Manual.
Select Moton Dev: Use this menu opton to select the external moton device that is to be used.
Control: Opens a window that displays all of Mach4’s confguraton setngs. This is where all
motor and input and output setngs are entered.
Plugins: Opens a window that lists all installed plugins and provides access to each plugin’s
confguraton setngs.
9
PMC: grogrammable Machine Control Is a later logic style control for Mach4 interface
Diagnostc Menu
The diagnostc menu, fgure 2-6, provides functons for logging and viewing the status of inputs and
outputs. Any installed plugins may have their own diagnostc, varying the contents of this menu based
on the machine confguraton. Some of the optons shown may not be discussed in this manual as they
are 3rd party plugin diagnostcs. The menu items should be covered in detail in the manual provided by
the developer of the plugin.
Logging: Opens the logging facility. This is handy error checking tool that logs events in Mach4 in
real tme. The machine builder can choose what gets logged, so each machine may log events
diferently.
Modbus: Opens a window that shows the current state of Modbus communicatons.
Regfile: Opens a window that displays the current value of a variety of registers and variables in
Mach4. The contents and range of what is displayed here will vary with each machine build.
Wizard Menu
The wizard menu, fgure 2-7, provides access to the pick wizard window (fgure 2-8). Any installed
wizards can be found here. A wizard is a small program that allows a user to easily generate G code for
common or moderately complex machining processes. Wizards are their capabilites can be as varied as
the programmers that write them.
10
Figure 2-8: Load wizard window
Operator Menu
The operator menu, fgure 2-9, provides the operator with optons for editng the Mach4 interface and
Lua scriptng. The screen editor and an overview of Lua can be found in the customizaton manual.
Lock: Locks the screen from being edited, a password is reuuired to unlock.
DRO Auto Calc: A calculator for a DRO by double clicking in the box to perform any
mathematcally calculaton for values of the DRO
Edit Screen: switches Mach4 to the screen editng mode, see fgure 2-10.
Edit/Debug Scripts: Opens the Lua editor for editng scripts saved as macros, such as custom M
codes.
11
Figure 2-10: Edit Screen
Help Menu
The help menu, fgure 2-11, is where the operator will fnd the “About” page, fgure 2-12.
About: Opens a window that displays informaton about Mach4 and the computer it is installed
on. The about screen indicates what version of Mach4 is installed, Lite, Hobby, Industrial, etc.
Next is the version number, followed by the build number. The gCID is reuuired for licensing.
The gCID is based on the confguraton of the computer Mach4 is installed and the license will be
locked to that gCID / computer system. Copy the gCID number by clicking on the “Copy ID to
Clipboard” buton. Use the “Load License File” buton to load a license fle received from
Artsof.
12
Figure 2-12: About Window
13
Figure 2-13: Program run tab
Operaton Mode Selecton: These are the tab markers, select the desired tab by clicking on its
name.
G Code Window: Displays the current G code fle.
Go to Zero: Moves machine to X0, Y0 in the actve fxture ofset.
Positon Display Mode Selecton: Changes the contents of the positon display. The “To Go”
buton changes the display to show the distance to go to the programmed point. The “Machine
Coordinates” buton changes the display to show the machine coordinate system. The LED
above each buton will light up when the buton is actvated. If neither LED is on the display
shows the current positon in the actve fxture ofset.
Reference All: References/Homes all axes in the order set on the Homing/Sof limits tab in the
Mach confguraton. The axes will move to the home switches and machine zero set.
Zero Axis: The zero axis butons will set the current positon to zero in the actve fxture ofset.
This sets the actve fxture ofset and will over write any data that was entered previously.
Reference Status LEDs: When an axis is referenced or homed its status LED will change from red
to green.
Positon Display: The digital readouts (DROs) display positon data as selected by the display
mode butons.
14
Tool Path Window: The tool path window displays the programmed path for the currently
loaded G code fle. Below it are some basic controls for the display.
Display Mode: This buton toggles the display of the sof limits in the tool path window.
Showing the extents of the sof limits can provide visual reference of where the program is in the
machine travel and if it fts.
MDI Tab
Manual Data Input, or MDI, is a mode that allows the user to manually type in blocks of G code to be
executed. A block is a single line of G code containing multple words, each started with a leter or
symbol. The code is executed by pressing the cycle start buton.
Operaton Mode Selecton: These are the tab markers. Select the desired tab by clicking on its
name.
Reference All: References/Homes all axes in the order set on the Homing/Sof Limits tab in the
Mach confguraton. The axes will move to the home switches and machine zero set.
Zero Axis: The zero axis butons will set the current positon to zero in the actve fxture ofset.
This sets the actve fxture ofset and will over write any data that was entered previously.
Reference Status LEDs: When an axis is referenced or homed its status LED will change from red
to green.
De-Ref All Axes: This buton sets all axes to an un-referenced state.
Manual Data Input Window: Manually input G code to be executed in this window. Multple
lines can be entered. The up and down arrows to the lef scroll through the history of executed
code.
Positon Display Mode Selecton: Changes the contents of the positon display. The “To Go”
buton changes the display to show the distance to go to the programmed point. The “Machine
Coordinates” buton changes the display to show the machine coordinate system. The LED
15
above each buton will light up when the buton is actvated. If neither LED is on the display
shows the current positon in the actve fxture ofset.
Positon Display: The digital readouts (DROs) display positon data as selected by the display
mode butons.
Operaton Mode Selecton: These are the tab markers. Select the desired tab by clicking on its
name.
Positon Display: The digital readouts (DROs) display positon data as selected by the display
mode butons. There are not positon display mode butons on this tab, the display will be
changed based on the state of the butons on the grogram Run or MDI pages.
Tool Path Window: The tool path window displays the programmed path for the currently
loaded G code fle.
Diagnostc Tab
In the diagnostc tab, fgure 2-16, the operator can view the status of inputs and outputs as well as
individual axis homing.
16
Operaton Mode Selecton: These are the tab markers. Select the desired tab by clicking on its
name.
Input Status LEDs: LEDs show the status of a variety of inputs to Mach4.
Output Status LEDs: LEDs show the status of a variety of outputs from Mach4.
Axis Homing: Butons to home individual axes and status LEDs to show the reference status.
DRO's:
Spindle Movements:
Current G Code File: Displays the fle path and name of the current G code fle.
Wizard Controls: The “Load Wizards” buton opens a window that displays all the installed
wizards available to the user, select one and press “OK” to run the wizard. “Load Last Wizard”
loads the last wizard that was run.
Regenerate Tool Path: This buton regenerates or refreshes the display. When pushed the tool
path will be recalculated with any changes.
Operator Control Selecton: These are the tab markers. Select the desired tab by clicking on its
name.
Edit G Code: The edit buton opens the current G code fle in the G code editor. The operator
can then make changes to the program. When the editor is closed the G code fle is reloaded
into Mach4.
17
Load Recent G Code: Opens a window that displays a list of the most recently loaded G code
fles. A fle can be selected to be loaded into Mach4.
Close G Code: Closes the current G code fle.
Load G Code: Opens a window to search for a G code fle to be loaded into Mach4.
Run From Here: Opens a wizard to aid in startng program executon from anywhere in the
program. This functon is described in greater detail later in this manual.
Line: Displays the current line in the G code fle. This is the line being currently executed by the
controller.
Set Next Line: Sets the line to start program executon from.
Operator Control Selecton: These are the tab markers, select the desired tab by clicking on its
name.
Single Block: Actvates single block mode, the LED will light when actve. In single block mode
Mach4 will execute only one line, or block, of code for every press of the cycle start buton.
Optonal Stop: When actvated program executon will pause at M01 in the program.
Block Skip: It is possible to skip lines, or blocks, or a program using the block butons. When
actvated any block startng with a slash, “/”, will be ignored by Mach4.
18
Figure 2-19: Tool path ops tab
Jog Follow: This buton toggles how moton is displayed in the tool path window. With jog
follow of the tool path stays statonary and the red lines showing the tool positon moves
around. When on, the tool positon stays centered on the window and the tool path moves
around. For large parts this mode can be used to view the tool path in more detail.
Operator Control Selecton: These are the tab markers. Select the desired tab by clicking on its
name.
Regenerate Toolpath: Reloads the program and recalculates the tool path.
Jog Follow: When actve the center of the tool is locked to the center of the tool path display.
The display will follow tool movement.
Perspectves: Several butons allow for diferent perspectves of the toolpath including the
default Top view.
Jogging Tab
The jogging tab, fgure 2-20, displays controls for jogging the machine’s axes and changing the jog mode.
19
Axes Limit Override: If a limit switched is tripped moton is disabled. This can cause a problem
trying to move the machine of the limit. The limit override essentally ignores the limit switches
untl they are deactvated. Extreme cauton should be used when actvatng the limit override, it
is possible to overrun the switch and cause damage to the machine.
Soft Limits: Actvates or deactvates the sof limits. Sof limits are exactly as the same implies,
sofware limits to contain machine motons. These are usually set just inside of the actual limit
switches. Sof limits are set up in the Homing/Sof limits tab in the Mach confguraton.
Operator Control Selecton: These are the tab markers. Select the desired tab by clicking on its
name.
Jog Butons: Butons to jog X, Y, , and A axes.
Cycle Incremental Jog Distance: In incremental jog mode each press of an axis jog buton will
move the machine on a specifed distance, this buton cycles through the distances defned in
the general confguraton. The current step distance in shown in the adjacent DRO.
Toggle Jog Mode: Toggles between contnuous and incremental jog modes.
Jog Rate: Sets the velocity for contnuous jog as a percentage of the machine’s max velocity.
Toggle Keyboard Jog: Turns on/of the ability to jog using the keyboard.
20
Trace tab gives users the opportunity to create a G Code fle using an existng template, with or without
preexistng dimensions set. By jogging axes to the desired shape using the on screen butons.
Start Trace: To begin jogging enable start trace. When End Trace is selected a prompt will appear
to close profle with a line, to enclose the shape just made
Rapid End Point: Rapid end point allows for movement to a diferent area of the screen without
cutng the material
Line End Point: Straight movements from the current point to the selected point, in a direct cut
Arc Mid Point: Afer selectng the Arc Mid goint the buton will change to Arc End goint to allow
for a complete arc to be traced and fnished
2 Point Circle: Selectng the center of the circle and one additonal point along the outside of the
circle
3 Point Circle: Creatng a circle by selectng three points along the radius of the existng circle
Plate Alignment: Adjustng for an uneven material in the workspace to allow for the proper
alignment of the trace tool, regardless of the materials positon on the machine
For more informaton and descripton of how to use the trace tab, go to our ofcial YouTube
page Mach Support. Direct link: htps://www.youtube.com/watch?v=t-4huKA68jItt=333s
Getng Started
How to start Mach4 will vary depending on the installaton. In all cases there will be a Mach4GUI.exe
located in the Mach4 folder usually located on the C drive. Some machines may have a shortcut to this
executable on the desktop. When Mach4 is started the user will be presented with an opton to choose
a profle, fgure 3-1.
21
In the select profle window, the user can choose a profle to open, create a new profle from scratch,
copy an existng profle, restore a profle or delete a profle. Once a machine is set up, using a shortcut to
run a specifc profle is ofen convenient. Create a shortcut to Mach4GUI.exe on the desktop. Right click
on the shortcut and select propertes. In the propertes dialog, fgure 3-2, the Target is the fle that will
be run. This should read the locaton of Mach4GUI.exe. Add “/p proflename” to the end of this line,
replacing “proflename” with the name of the desired profle. The shortcut will open Mach4 into the
named profle.
22
Figure 3-3: Mach4 main screen in disabled state
Notce that when Mach4 is disabled butons that control moton or program executon are unavailable to
the user, they are greyed out. On this main screen these controls are “Ref All Home”, “Goto ,ero”, “Cycle
Start”, and “Reset”. Once enabled these controls are made available to the user.
Jogging is enabled whenever the controller is enabled and a program is not being executed. However,
keyboard jog defaults to of for safety. The default screen provides controls for jogging 4 axes; X, Y, ,,
and A. These controls work just like a physical buton, in contnuous jog mode the machine will move as
long as the buton is held down. Keyboard jogging is deactvated by default, this feature can be actvated
by pressing the “Keyboard Jog” buton. The default jog butons are lef arrow for X-, right arrow for X+,
up arrow for Y+, down arrow for Y-, page up for ,+ and page down for ,-.
There are 2 basic jog modes which are selectable by pressing the “Jog Mode” buton. The current
selecton will be indicated by an LED. Figure 3-5 shows the contnuous mode selected. In contnuous
mode the machine will move at the specifed jog rate as long as a jog buton is held down. The jog rate
can be changed by moving the slider at the botom of the jogging tab or by directly typing the desired
rate into the DRO in the botom right corner. The number shown in the DRO is a percentage of the max
velocity, or rapid rate, of the machine. Contnuous mode is useful for moving the machine relatvely
large distances and rough positoning. When fnding the edge of a work piece, locatng a hole, or other
precision positon is reuuired, step jog is much more accurate. In step jog, the machine moves only by
the specifed increment amount, regardless of how long the jog buton is held down. The jog increment
can be changed by pressing the “Cycle Jog Inc” buton. This buton will change the DRO to the right of it
to show the current increment amount. The increment values can be changed on the General tab in the
Mach confguraton.
24
Figure 3-6: Control panel and pendant examples
Changing Tools
Tool changes will vary depending on machine confguraton. Some machines have automatc tool
changers, while others reuuire the operator to physically change the tool. Each type of tool changer
must be confgured properly in Mach4, this is covered in the confguraton manual. For automatc tool
changers, a Lua script will likely be reuuired to command it or communicate between an external
controller and Mach4. Scriptng is covered in a separate scriptng manual.
Fixture ofsets are used to tell the machine where a work piece is located. The values are stored in the
fxture ofset table, fgure 3-8. These values ofset the machine coordinate system to create a user
coordinate system at the desired point. Ofsets are actvated by calling the corresponding G code in the
program. See the programming manual for details on calling fxture ofsets. G54-G59 are the standard
fxture ofsets with G54.1 g1 through G54.1 g248. There are also two additonal ofsets in the table
Work Shif and Head Shif. Values in work shif will shif the entre table, this can be useful when test
25
running programs (the , axis can be lifed slightly more than the max depth of the program to run above
the part) or making adjustments without changing ofset values. The work shif is always actve, so when
changed, it is important to remember a change has been made. Changing fxture ofsets in the program
will not deactvate work shifs. Head shif is used for mult head/mult spindle machines and not covered
in this manual.
There are a variety of ways to fnd a work piece in the machine; edge fnding is probably the most
commonly used method and will be covered in this manual. grobing is a great method when available,
sometmes all that is reuuired is to visually jog the machine to positon and zero it. The accuracy
reuuired is determined by the reuuired part accuracy.
g Probing Tab
26
Figure 3-9: Probing Tab
Edge Finding
Edge fnders, fgure 3-10, come in many shapes and styles, each specialized for specifc applicatons. The
type used for examples in this manual are highlighted in fgure 3-10. The shaf diameters can vary, but
the tp diameter is 0.200 inch, making the math for calculatng the ofsets very easy.
An edge fnder is used by spinning it at a low RgM, usually 1000 is perfect. The tp of an edge fnder is
held in place under spring tension and is moveable. In fgure 3-11 all the edge fnders are shown with the
tp ofset. When spinning in free space, away from a part edge, the tp will move away from the center
line and wobble. Choose an axis to touch of frst. For this example, we will use the X axis and make the
27
lef edge of our part the fxture zero. Jog the machine to a positon that will allow the edge fnder to
come down below the surface of the part just to the lef of the work piece, see fgure 3-11 positon A.
When clear of the work piece, the edge fnder can be moved down in the , axis untl the tp is just below
the surface of the part, about .100 inch. The tp will be wobbling and appear bigger than it actually is.
Jog the machine, slowly and carefully, towards the part. When the edge fnder just starts to touch the
part stop and switch to incremental jog. A larger step amount of about 0.010 inch is appropriate here,
move one increment at a tme untl the edge fnder starts to look like fgure 3-11, positon B. As the
machine moves closer to the edge, the edge fnder will start spinning more truly. As the machine gets
closer, the edge fnder will get more sensitve to movement. Turn the step increment down to 0.001 inch
and move in one increment at a tme. When the correct positon is reached, the edge fnder will break,
as shown in fgure 3-11 positon C.
28
Ofsets Tab
29
Figure 3-13: Fixture ofset table
Let’s frst input the ofset using the “Input” and “Input +” butons. The value we’re looking to enter into
the ofset is the machine positon of the X axis at the desired zero locaton on the work piece. The
positon we are looking for is the locaton of the edge of the part. The edge fnder was used to fnd the
edge, but the radius of the edge fnder has to be accounted for, see fgure 3-14.
Figure 3-14: Touch of locaton for 0.200 inch diameter edge fnder
Select the desired ofset. In fgure 3-13 the X ofset of G54 is selected. In the input box type in the
positon displayed in the X axis machine positon DRO and press the input buton. The data will be
writen to the ofset. Now turn of the machine positon to see the fxture ofset positon in the DRO. If
everything was entered correctly, the X DRO should now read 0.0000. If not, make sure the desired
fxture ofset is actve by commanding it in the MDI mode. Now, although the data was input correctly to
30
obtain zero, the edge fnder radius has not been accounted for. The positon we are actually looking for is
-0.1000 as shown in fgure 3-14. To make this adjustment type 0.1000 into the input box and press the
“Input +” buton. The X DRO will update to show -0.1000, this is the correct positon. Double check your
ofset data by commanding the fxture ofset in MDI to actvate it, jog the machine so the edge fnder is
just above the surface of the part and move to X0.0000; the edge of the part should be at the center of
the edge fnder.
The next method, and more reliable as human error is reduced, is to use the measure buton. With the
edge found with the edge fnder, type in the desired positon, in this case it is -0.1000 and press the
“Measure” buton; the ofset value is calculated and input into the ofset. The X axis DRO will now read -
0.1000. The math is completed by Mach4, just input the value that the DRO should read at the current
positon.
Repeat the same process to fnd the Y axis positon. The , axis will be a litle diferent. A good way to
fnd the , axis positon is to use a fxed tool. The edge fnder is a good one, and a gage block. Move the
machine above the part and jog down slowly. When near the gage block height, use incremental mode
to avoid crushing anything. Slide the gage block under the edge fnder, if it slides freely pull it out and
step the , axis down. Keep stepping down untl the gage block just hits and won’t slide under. Go back
up one increment, usually around 0.001 but that will vary with desired accuracy. This is the touch of
positon. Entering the ofset data is the same as described above, only this tme instead of taking the
edge fnder radius into account the gage block thickness must be used. Select the , axis ofset in the
fxture ofset window, enter the gage block thickness in the input box and press the “Measure” buton.
Actvate the ofset and check the positon DRO. The , axis should show the gage block thickness.
31
Figure 3-15: Tool ofset table
There are a couple of methods for touching of the tool. A gage block can be used as described for
setng the , fxture ofset in the previous chapter. A piece of paper can be used in place of a gage block,
using the same procedure. Electronic blocks and touch of devices are available, as are blocks with
indicators, and even automatc tool seters (see fgure 3-16). Another great method for high producton
environments is an ofine tool pre-seter outside the machine.
Master Tool
Setng up a master tool is a great way to do tool ofsets, especially on a knee mill type machine. This
method involves having a tool at a fxed length and a tool ofset value of zero. An edge fnder is great for
this. Select a holder and lock the edge fnder at a fxed length. Use the edge fnder to set a work ofset at
32
the top surface of a work piece or any fat surface to touch all the tools of. This allows the operator to
set up a library of tools with set ofsets. When a new part is set up, just touch of the , fxture ofset and
start machining. All the tools will follow the master tool. Make sure to disable tool length ofsets (G49)
or actvate the tool length ofset for the master tool (G43 Hhh, where hh is the ofset number of the
master tool) before setng the fxture ofset for touch of surface.
Once a surface is found using the master tool and the fxture ofset entered, bring each tool down to the
surface using the same method, some type of gage block or tool seter of known height. The positon
shown in the , axis DRO will show the diference in length between the master tool and the tool being
touched of. There are a few optons for inputng the value into the tool ofset table, just like when
setng fxture ofsets. The value can be entered directly into the ofset. A value can be typed into the
input box at the botom and then the “Input” buton will over write the existng data with the value in
the box, the “Input +” buton will add the value from the input box to the existng value, and the
“Measure” buton will calculate the ofset value using the data in the input box as the desired positon.
For this example, type in the gage block thickness then press the “Measure” buton. The value will be
set. Double check the data by actvatng the current tool ofset, MDI G43 Hhh where hh is the ofset
number of the tool being touched of. The , axis DRO should read the gage block thickness if done
correctly.
To use this type of tool ofset system, a fxed point in the machine should be chosen to measure tools. A
great positon is the table of a bed mill. The distance from the spindle gage line to this point must be
found. One way to do this, is remove any tool from the spindle then jog the , axis down. Generally, the
spindle cannot reach the table, but a 4” block usually provides enough height to obtain a measurement.
Use the same procedure as was used when touching of tools, step the spindle down in small increments
untl the block just slides under. The machine positon , axis DRO will read the distance the spindle
traveled down to reach this point. Record this number. For our example machine, let’s say it is -10.0000.
If the gage block used is the same one that will be used to touch of tools, then this is the number that
33
will be used for tool touch ofs. If not, subtract the gage block thickness (-10.0000-4.0000=-14.0000) to
get down to the table and then add back the height of whatever gage will be used.
Now, we will explain how to touch of tools. A fxture ofset can be set at this positon or a macro can be
created. If a fxture ofset is used, it must be actve and tool height ofsets inactve when touching tools
to get the correct data. With this set up, the user positon , axis DRO will read the length of the tool.
This number should be directly input into the tool height ofset. With a macro (see customizaton
manual for more detailed informaton) a buton like the “Auto Tool ,ero” buton can be used to do the
math. The macro would take the absolute value of the diference between -10.0000 and the machine
positon when the buton is pressed. The resultng number will be the length of the tool. For instance, if
a tool is touched of and the , axis machine positon is -8.5000 the tool length, tool height ofset, is -
8.5000+10.0000=1.5000. So, the tool in the spindle is 1.5000 long, which is the tool ofset. This method
is a litle more complicated to set up, but once set can be a tme saver. Fixture , ofsets can be set with
any tool as long as the correct height ofset is actvated.
Tool Informaton
During operaton the current tool informaton is displayed on the main screen, fgure 3-18. This secton
of the screen shows the current tool number and its diameter and height ofset informaton. It is a uuick
way to check that the correct data has been input into the tool ofset. During a tool change the “Tool
Chng” LED will blink, indicatng that the machine is either changing the tool automatcally or waitng for
the user to manual change tools and press the cycle start buton.
34
Figure 3-18: Tool informaton
The “Tool” DRO shows the currently selected tool, this DRO will be updated at every tool change. It can
also be changed by the user by clicking on the DRO, typing in the desired tool number, and pressing
enter or return on the keyboard. The “Diameter” and “Height” ofset DROs will update to show
informaton for the selected tool number. These DROs are read only and not user editable.
Creatng g Programs
grograms are reuuired for automatc operaton of the machine. The most common format is G code.
This type of programming uses a system of G codes (G01, G10, G81, etc.) to specify the desired functon.
gositon codes (X, Y, ,, etc.) are used to tell the machine where to go, or where an operaton is to take
place. Other codes startng with M, T, S, F and a few others enable control of just about every aspect of
the controller and machine. The Mach4 grogramming Guide is a complete descripton of the reuuired G
code format.
grograms can be created by using the wizards, a CAM (computer aided manufacturing) system, or by
manually typing it. There are a variety of CAM systems that can be used for generatng programs from
2D or 3D drawings. When CAD models are available using a CAM package is usually the best and
uuickest way to generate a G code program for machining. However, some of these sofware packages
can be very expensive. For this reason, Mach4 includes the ability to run wizards, a form of
conversatonal programming. Wizards can be created by anyone with some computer programming skill
for just about any task needed.
Mill Wizard
Mill Wizard provides the user with a set of tools to generate G code fles for common milling jobs. The
close link with Mach4 allows created G code to be loaded into Mach4 with the push of a single buton.
Mill Wizard can create programs with multple tools and features. Features and shapes include
rectangles, circles, links, slots, hole paterns, engraving, gears, splines and more. Figure 3-19 shows the
main screen and all the available operatons.
Jobs can be created using the stock materials or the user can add special materials to the table. Tools
can be added to a table for later use. Operatons can be modifed and re-ordered as desired. Complete
documentaton is provided in the help menu of the sofware. The follow fgures give a basic idea of what
the sofware looks like.
35
Figure 3-19: Mill Wizard main screen
36
Figure 3-21: New tool window, select tool and set feed and speed
37
Figure 3-23: Hole circle wizard
38
Figure 3-25: Rectangle cutng wizard, cut inside, outside or groove
39
Figure 4-1: MDI screen
To enter code into the MDI window, select the window and type in the desired code. gress the “Cycle
Start” buton to execute the code in the window. Once executed, the code will be stored in the history
where it will remain untl Mach4 is shut down. gress the up arrow on the lef of the MDI window to
scroll through the history. The most recent code is shown frst. The tool path window on this page shows
the tool path of the currently loaded G code fle and not the MDI program.
Some examples:
Feed Hold
The feed hold buton will immediately pause the program, press cycle start to contnue. Feed hold will
only pause axis moton. If the spindle is running it will stay on and any actve outputs will remain actve
(coolant, air blow, etc).
Stop
The stop buton will immediately end program executon. All moton will stop as well as the spindle and
other outputs. This is similar to commanding a program stop in the G code program. Although program
executon is halted by pressing the stop buton, the program is not rewound.
Reset
To rewind a program back to the beginning press the reset buton. This will also return the controller to
its default state.
grograms can also be started from any positon in the program, including in the middle of a cut. To do
this, select the point to start by scrolling through the G code program in the G code window and select
41
the desired line. Manually jog the machine close to the start point. Next, press the “Run From Here”
buton in the File Ops tab. A window will open, fgure 4-2, to start the process of restartng the program.
In the run from here window, there is a positon read out showing distance to go. These distances are
how far the machine needs to travel to reach the start point. Before startng executon, the machine
must be moved to the start point. The axes can be moved using the controls in the “Move Axis to Start
gositon” secton of the window. Enabled axes will be available for selecton. Select one or multple axes
to move and press the “Move Selected” buton. The selected axes will move to their start positons.
Another buton, “Move Unselected” will move the unselected axes. Use this buton to move any
remaining axes to their start positons. Once the machine is in the start positon, press the “OK” buton.
Mach4 will scan the preceding part of the program to get the machine into the proper state:
coolant/spindle on or of and setng up cuter comp if actve. gress cycle start to start machine moton
and run the rest of the program.
Limit Switches
Limit switches are physical switches that mark the end of a machine’s range of moton. Sometmes one
or more of these will double as a home switch. The hard limit switches are basically the last line of
defense before major damage occurs. Without these switches the machine could slam into a hard stop
at the end of travel or even send the table right of the end of the rails, depending on the confguraton.
Running a machine without limit switches is risking damage to ball screws and nuts, bearings, castngs,
people, foors and walls.
42
Figure 5-1: Limit override on program run screen
When Mach senses that a limit switch is actvated it immediately disables all moton. In this state
jogging is disabled. At frst it can seem impossible to recover from this situaton. On small machines one
soluton could be to turn the ball screw or slide the axis by hand, on bigger machines this is not possible.
In this case jogging the machine of the limit is the only opton.
When a machine is on a limit switch it can be jogged by temporarily overriding the limit switches. gress
the “Limit Override” buton on the program run screen, fgure 5-1. This will re-enable axis moton and
jogging so the machine can be moved away from the limit switch. As soon as the switch is deactvated
the limit override is automatcally turned of.
When the limit override buton is pushed the machine can be moved in any directon
and regardless of the state of the limit switches. Exercise EXTREME cauton to avoid
serious damage to human operator or machine. Check and double check which axis
should be moved and in which directon. Start movement with a very small move, just
bump the axis, to verify your choice of directon is correct. Then move the machine the
rest of the way of the switch.
Sof Limits
Running into machine hard limits can be prevented by using sof limits. Sof limits are sofware end of
travel switches. They are generally set up by the machine builder to be about ¼ to 1 inch from the
physical switch depending on machine size, velocity and acceleraton. When an axis is moved into the
sof limit it is decelerated to a stop. Generally there is a deceleraton window of about a inch. Inside
this window axis velocity is reduced. When a machine runs into a sof limit it can simply be jogged the
other way, no risky limit override buton.
43
Figure 5-2: Sof Limits On/Of in Jogging tab
Sof limits can be displayed in the tool path display by pressing the “Display Mode” buton. The sof
limits show up as dashed yellow lines, fgure 5-2. When the cycle start buton is pressed to run a
program, Mach automatcally checks if the tool path extends beyond the sof limits, if it does a warning
is issued.
Crash!!!
It happens to everyone who has ever run a CNC machine. The machine is running great, the part is being
cut exactly as we expected. Then, CRASH. A tool breaks, the work piece comes out of the vise or chuck,
the machine hits a clamp, or any number of seemingly impossible feats for a machine to perform.
Sometmes it’s very minor, sometmes it’s very serious. These moments are extremely frustratng for
operators and programmers, it is usually best to take a minute to survey the situaton before taking
acton. Before atemptng to move a machine that has been crashed take a good look at everything
involved. Make sure there is no major damage to the machine, if there is don’t try to jog it which could
cause even more damage. If something happened while cutng a part, check the tool and where in cut
it stopped. Sometmes it is best to loosen a tool in its holder so the , axis can be jogged up to remove
the tool. End mills can be easily damaged when jogged along a part edge or ripped out of a pocket when
they’re not spinning. Also, if the tool is currently welded to the part (which does happen) trying to pull it
out with the machine can potentally cause damage to the machine or it could break, sending small very
sharp bits of carbide or tool steel fying in every directon, could cause harm to humans and other things
nearby. If a tool is stuck in a part try to loosen or remove it from the spindle or unclamp the part before
atemptng recovery.
44
New programs are always a huge source of crashes involving the tool and work piece or work holding
devices. Usually these crashes are minor, at worst resultng in a broken tool. However, the worst crashes
can result in broken spindles, damaged bearings, cracked or bent castngs and machine frames, bent tool
changer arms, or even fre. However, these types of collisions can almost always be avoided by dry
running the program, either without a part or above the part. grocedures for checking programs can be
found in text books or talking to experienced operators.
Jogging is another source of crashes. We’ve all done it, jogging tool towards a part to check or set the
height and bang, we jogged too far and crushed the tool into about 1,000 pieces. These crashes are
usually very minor as the velocites tend to be low and the buton pushes are short, but they do happen.
Biggest thing to avoiding these is pay atenton and take your tme. This usually happens when you’re
rushing that last job and you don’t want to switch to incremental jog just yet, one more bump of the jog
buton will get it that much closer. Now a new tool needs to be put in and touched of. Take the extra
tme and use the incremental jog when nearing a part. This prevents crashes caused by holding the jog
buton down a millisecond too long.
Computers. They make this technology possible, they can also bring it crumbling down and make us
want to leap out of tall buildings. Computers can crash and fail, when set up properly this will simply
cause the machine to stop, hopefully avoiding any damage. When a computer locks up the charge pump
signal from Mach to the hardware moton control stops as well, this tells the moton controller that
Mach is no longer in control of the system. In this situaton the moton controller will essentally hit the
emergency stop buton ending all moton and shutng down all outputs. Using a good, reliable
computer can almost completely avoid these situatons. Keep the computer running the machine
cleaned up (inside and out) and don’t use it for any unnecessary tasks. It is best if this computer is 100%
dedicated to running the machine and nothing else. Keep the control sofware and any plugins up to
date with the most current stable releases. Don’t move too fast for the computer. Many tmes a
computer crash is caused when the computer is “thinking” and the user is frustrated and clicks on
something 1,000,000,000 tmes. Don’t do it, let the computer react to your input before moving on. Be
deliberate and precise in your actons.
Sometmes, it’s just out of our control. CNC machines are a complex web of mechanical and electrical
systems. These systems can fail. No machine is ever failure proof. Motor drivers can fail, causing the
motor to stop or go max RgM untl something stops it. Wires can corrode and break, welds can crack, or
lightening can strike. Whatever the failure, use the same processes described above. Step back and take
it all in before taking acton.
45