Machine Sim
Machine Sim
GibbsCAM 2009
February 2009, rev 1.4
Proprietary Notice
This document contains propriety information of Gibbs and Associates and is to be used only pursuant to and
in conjunction with the license granted to the licensee with respect to the accompanying Gibbs and Associates
licensed software. Except as expressly permitted in the license, no part of this document may be reproduced,
transmitted, transcribed, stored in a retrieval system, or translated into any language or computer language, in
any form or by any means, electronic, magnetic, optical, chemical, manual or otherwise, without the prior
expressed written permission from Gibbs and Associates or a duly authorized representative thereof.
It is strongly advised that users carefully review the license in order to understand the rights and obligations
related to this licensed software and the accompanying documentation.
Use of the computer software and the user documentation has been provided pursuant to a Gibbs and
Associates licensing agreement.
©2004-2009 Gibbs and Associates, a Cimatron company. All rights reserved. The Gibbs logo, GibbsCAM,
GibbsCAM logo, CAM von Gibbs, Virtual Gibbs, Gibbs SFP, SolidSurfacer, MTM and "Powerfully Simple.
Simply Powerful." are either trademark(s) or registered trademark(s) of Gibbs and Associates in the United
States and/or other countries. Microsoft, Windows, and the Windows logo are trademarks, or registered
trademarks of Microsoft Corporation in the United States and/or other countries. All other brand or product
names are trademarks or registered trademarks of their respective owners. Contains Autodesk® RealDWG by
Autodesk, Inc., Copyright © 1998-2006 Autodesk, Inc. All rights reserved.
Table of Contents
INTRODUCTION 1
About Machine Simulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3
Overview. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
Comparison of rendering modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
SET UP 7
Overview. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Build Machine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Machine Simulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Clearance Planes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
MDDs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
About the MDDs and the MDD Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Home Position - Mills. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Home Position - Lathes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Machine Sim Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Cutting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Collisions/Limits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
Slider. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Feature . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
Statistics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
i
Table of Contents
SCRIPTING 57
Machine Sim Scripts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
Types of Scripts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
Machine Sim Scripts Utility Op Script Names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
Conditional Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
Debugging Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
About Commands and Redraws. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
PostScript Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
MDD Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
MDDs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
VMMs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
INDEX 93
iii
Table of Contents
iv
INTRODUCTION
Introduction
CHAPTER 1 : Introduction
ABOUT MACHINE SIMULATION
The Machine Simulation option is a 3D representation of a Machine Tool, the parts and cutting tools which
supplements the standard rendering component of GibbsCAM. Machine Simulation provides a machine-
centric view of what is happening as opposed to the standard rendering which is part-centric. Also included
with this option is Machine Builder, a tool to create the models that represent the machine tool. Machine
Simulation supports lathe, mill, Mill/Turn, Advanced CS, rotary mill, Tombstone Machining System and most
Multi-Task Machining parts. As of version 9.0, all users have access to all modes of CPR and simulation.
However, if you do not have Machine Sim as a part of your license, you cannot load a machine sim model. If
this is the case, machine sim will create a temporary machine kinematic model (no visible components) based
on the MDD and do the simulation with that.
Figure 1: Example of a machine assembly file and a part being rendered with Machine Simulation.
3
Introduction
OVERVIEW
Machine Simulation is accessed from the Cut Part Render button on the
main palette or the Plug-Ins menu. Build Machine opens the interface
for def ining and creating a machine tool while the Machine Sim option
activates the Simulation rendering mode. Typically a machine tool
needs to be created before using Simulation but it may be used without
a machine tool model in Part Mode. At f irst glance Part Mode may seem
to just be Flash CPR. In fact it is not. Using Simulation in Part Mode will
display all inter-operation tool moves that Flash CPR (and the standard
rendering) does not display.
Traditional CPR Flash CPR “Part Mode” Machine Sim “Machine Mode” Machine Sim
While Flash CPR and Simulation may appear similar, their uses are different. A key difference is the Simulation
capability to display the inter-operation moves of a tool. Flash CPR may be faster than Simulation as it does
not have to render an entire machine model and the moving axes. You may f ind that when checking your part
f ile you use several or all of the rendering types (standard CPR, Flash CPR and Machine Simulation),
depending on your needs.
Simulation, in any mode, will show all of the part instances in a TMS multi-part setup where standard CPR and
Flash CPR only show the single part as programmed in the VNC f ile.
4
Introduction
TMS rendering with Flash CPR TMS rendering with Machine Sim
5
Introduction
6
SET UP
Set Up
CHAPTER 2 : Set Up
OVERVIEW
Machine Simulation does not really affect part set-up, except that each machine assembly requires a custom
MDD, which can streamline some of the choices you make when setting up a part including the rotary set-up
and the post processor selection.
BUILD MACHINE
With Build Machine we will be creating a machine assembly f ile that represents a machine tool. The
representation of the machine can be as simple as just a base, each axis and primary components, such as the
table, or it may be very complex, down to modeling the control’s buttons and dials. The level of complexity is
up to you. When creating the model you should be sure to create a workspace big enough to contain the entire
machine.
Figure 2: Examples of machine models. Some are very complex, others are very basic.
All machines must be def ined in millimeters but the part can be inch or metric. The machine assembly will be
scaled to work with inch parts.
9
Set Up
MACHINE SIMULATION
Clearance Planes
The MDD associated with a machine should reflect the machine’s and the post’s retract behavior so that
Machine Sim shows what will really happen on the machine. For most posts the tool will go home, in some
cases the render will only show ZCP1.
Figure 3: Example of a machine whose Tool Change Position and Tool Holder Class are defined in
the MDD and are not user-definable. The Master Clearance plane is still definable.
10
Set Up
MDDS
Each machine assembly that is created must have an custom MDD that def ines that machine including the
tool change position, the range of motion of the axes and other data. In the case of many fairly simple
machines you can start with an existing, standard MDD and modify the data to f it the machine. Whenever the
MDD is selected in the Document Control dialog, the accompanying machine assembly f ile will be the default
machine for Machine Sim. The MDD should be reviewed after you have created the machine assembly f ile. It is
important that the MDD and machine assembly f ile be consistent in terms of axes def inition. This includes
number and type of axes, the axes position, orientation and order. See the MDD Editor documentation for
information on creating an MDD.
In addition to the default machine, the MDD for a Machine Simulation model can set other information. For
example, the rotary information for a 4 or 5-axis machine will be pre-determined, meaning that it does not
need to be set each time a part is created. The tool change position may be pre-set, depending on your
machine and preference. Also, the default post processor is set by the Machine Sim MDD.
If there are two rotary axes that are connected to each other (i.e. both are on the table, or both are on the too),
then the mounting order in the MDD must match the parent/child relationship def ined in the machine
assembly. For example, if the A axis is mounted on the B axis in the MDD, then the corresponding A axis must
be a child of the B axis in the machine assembly.
Other areas to review for MDD/machine assembly consistency include: pivot distances (i.e. rotary axes
locations), axes directions including positive/negative for both linear and rotary axes, and axes names.
The MDD also def ines behavior and positions for tool changes and other moves between operations. Many of
these moves are not displayed in Cut Part Rendering, but all moves are displayed in Machine Simulation, so it
is important that this information be correct in the MDD if any part using a particular MDD is going to be
used in Machine Simulation. This includes tool change settings like axis priority, axis retract position type (e.g.
full retract, preset position, user def ined), and axis retract position. It also includes same tool rotation settings
like axis move order and position.
11
Set Up
the distance from the pivot point to the spindle origin. In the Build Machine this is the distance between the
part origin to the pivot point.
1. Pivot Point
2. Spindle Origin
3. Part Origin
4. Pivot Point
12
Set Up
CUTTING
The cutting options section allow you to control the quality
and responsiveness of Machine Sim. Please note that the
Machine Sim preferences are stored with the part. This means
that if you change the preferences but open a part that has an
older set of preferences, it will override the changes you have
made.
Steps Per Update: Steps per Update specif ies the maximum
number of CPR features to render before updating the display.
Large numbers will increase the rendering speed but will result
in a rougher rendering animation. With large numbers the tool
may appear to jump ahead of rendering, which will suddenly
snap to the tool. This may be jerky, but can be rather fast. A
low number provides a smooth animation, but may be slow.
Cut Part Chord Height: This setting is the resolution for the cut part displayed in Flash
CPR. The smaller the value, the higher quality of the display and the more resources
needed by the system, resulting in a slower rendering. There are separate settings for Chord Height
inch and metric parts. The separate values can only be set from within a part of that
unit type.
Body Chord Height: This option determines the resolution of bodies (part, stock
and f ixtures) in Machine Sim. There are two ways this can be set, either by the
Chord Height option (which is setting a specif ic value), or by the % of Body’s Chord Height option. This
second option uses the value set from the Properties dialog, (accessed by right-clicking on a body.) A
setting of 100% will use the body’s Chord Height while a setting of 10% is 1/10th of the body’s Chord Height
while 1,000% is 10 times the body chord height. Any percentage between 1 and 100,000 is acceptable. As
the percentage is set higher the body will appear rougher but the display will be faster and lower
13
Set Up
percentages mean higher quality but slower response. Note that this setting only affects on-screen display,
not the actual machining.
COLLISIONS/LIMITS
The items found in the Collisions/Limits section of the dialog provide control over how the system reports
collision errors while rendering. Any combination of the alert methods may be used to inform the user when a
collision occurs.
Please note that the Collision Checking option (found in the Render Control palette’s
! menu) must be activated for the system to check for collisions.
A collision in Machine Simulation occurs whenever any two objects contact each other during the simulation
that are not supposed to touch. Objects in Machine Simulation include machine components and non-
machine components. Machine components are objects in the machine assembly that are def ined by Build
Machine. Non-machine components are not in the machine assembly, but are created by Machine Simulation
based on information in the GibbsCAM part f ile. These objects include tools, holders, f ixtures, parts, and
stocks. The active cutting tool and its holder always participate in collision detection when collision detection
is activated. Other objects participate in collision detection based on their inclusion in collision component
groups. Collision component groups are component groups with their collision setting turned on. See
“Component Groups” on page 28 for more information.
Non-machine objects are automatically included in component groups based on their logical attachment to an
object in a component group. For example, a tool and tool holder are logically attached to a turret by virtue of
their assignment to a particular toolgroup and tool position in the tool def inition dialog in GibbsCAM. A part/
stock is assigned to a spindle or chuck in the machine assembly because of the part body (P-body) that is
def ined in the machine model. When determining group membership, f ixtures inherit goup attributes from
the part body associated with the f ixture’s spindle.
Machine simulation collisions are detected when collision detection is set on, and any of the following
conditions occur:
• The cutting portion of a tool contacts the part/stock while in rapid mode
• The non-cutting portion of a tool or holder contacts the part/stock while cutting
• Any object that is part of a collision component group contacts any object that is part of a different
collision component group
• Any axis position exceeds the axis limit as def ined in the machine assembly for any of the machine
components with axis limits (min/max).
14
Set Up
Alert Types: You may choose any or all of the various feedback methods that alert you to a collision. The Beep
option provides an audible alert, Log To Display will output an error in the Clash Console log window and
Stock Flash provides a visual alert to the error by flashing the rendered stock. Stop Animation will cause the
rendering to stop when a collision is detected.
Tolerance: The Tolerance setting allows a different value for metric and inch parts. Any collision within the
specif ied tolerance will generate a collision alert.
Figure 5: The Clash Console output showing a tool clashing with the stock and a fixture.
SLIDER
The items in this section affects the responsiveness and quality of the rendering by controlling the maximum
step distance between features in rendering. These values are used with the speed slider on the rendering
palette. The fastest speed jumps the tool from feature to feature using these settings. Lowering the speed will
scale the distances between features. Please note that this does not affect toolpath, only the rendered part.
These settings can have a very large impact on the rendering speed versus quality.
Length: The Length value sets the maximum distance between rendered linear moves. Let us imagine a linear
cut where the tool will traverse 400mm in a straight line. Using the default settings of 200mm, the display will
show this move in two steps when the slider is set to its maximum (fastest) value. If the linear cut was less then
200mm long the rendering shows the cut in one step, at the start and end of the cut.
Angle: The Angle values can have an especially big impact on rotary operations. Like the Length setting, this
value controls the rendering steps between features, in this case for angular moves. A low number will create
very small angles in rotations, resulting in a smooth image while a high number can create a rendered part that
is not smooth but is very fast.
Auto Range: This option will disable the Length values and will instead use the size of the stock (length, width
and height separately) to set the maximum feed and rapid lengths. The maximum value for feeds will be set to
1/10th of the largest stock dimension and rapids are double that value. The smallest step that the system will
take when rendering is 1/100th of the smallest dimension of the stock.
15
Set Up
FEATURE
Circular Threads: This option renders “circular” threads rather than proper spiraled threads. Enabling this
option will render threads much more quickly.
STATISTICS
When the Statistics option is enabled a window opens when
you activate Machine Sim. The window logs the current
framerate for your machine as well as any logged errors for
the CPR session.
16
USING BUILD MACHINE
Using Build Machine
19
Using Build Machine
1. Base
2. X Axis
3. Y Axis
4. Z Axis
5. Rotary Body
6. A Axis
7. Table
8. Head
9. Spindle
For convenience, it is recommended that each body is given a descriptive name such as “Y_axis”, “Spindle” and
“Table”. If a body will represent an axis, giving the body the name of the axis will make things easier when
building the assembly of components.
The origin for the machine model is very important as it is a reference for several values. A coordinate system
must be created that represents the spindle or table face. The origin of the CS should be at the spindle face
origin or the top-center of the table. The CS should be aligned as the machine is, i.e. if the machine is off
vertical by 30 degrees, so should the Machine CS. This CS will be referred to as the “machine origin CS”
20
Using Build Machine
throughout this document. All of the bodies in the assembly must be assigned to this “machine origin”
coordinate system.
Figure 7: Example of a machine’s XY plane (A) and Machine CS plane (B) where the horizontal and vertical axes
are shaded for emphasis. The Machine CS plane is used for alignment of bodies and for all reference
values.
21
Using Build Machine
Make sure to def ine the part origin at a location that is easy to identify on the machine tool, for example the
center of the table or the spindle face for lathe-type machines.
• For mill parts it is easiest to def ine the center of the table at the origin and then create the non-
moving bodies.
• For lathe, mill/turn and MTM setups it is easiest to def ine the spindle face at the origin and then
create the non-moving bodies.
• All bodies should lie in the same coordinate system, CS1 or ideally a CS that is aligned to the
spindle face or table top.
• Create Points and Lines to identify the center location and direction of the rotary axes.
• Create a point identifying the tool attachment position. For a mill this is the spindle face, for a
lathe this is the place on the turret where the tool holder attaches.
• When the MDD Editor setting Use Tool Holder Length is active the Z axis position will be
corrected automatically during simulation to take in account tool/holder length & tool attachment
position.
The P-body is a machine component made from any solid body (usually a cylinder or a rectangular solid) and
is given an label of P or Px, where x is any integer number. This special P naming tells machine simulation that
the P-body is not to be displayed directly in the simulation, but the P-body is to be replaced by the actual
machined part/stock during the simulation.
Mill machines: For a mill it is typical that the P-body is a child of the machine component representing the
machine's table, meaning that it is attached to the table.
Lathe machines: For a lathe, it is typical that the P-body is a child of the machine component representing the
machine's part spindle (or collet, bushing, or chuck).
MTM setups: For MTM machines, it is possible that there will be more than one P-body, corresponding to the
number of parts that can be machined simultaneously in the machine.
22
Using Build Machine
TOOLGROUPS
Understanding how to properly set up tools and positions is vital to getting Machine Sim to render correctly.
The method for displaying tools in machine simulation is different depending on whether the machine is a
mill or a lathe. For this discussion, “lathe” includes all lathe machines, Mill/Turn machines, and MTM
machines, as def ined by the MDD.
Mill machines: Mills will only show the currently active tool, which is the tool that is loaded in the tool spindle
at any given time. See the section “Mill Toolgroups” on page 51 for more information.
Lathe machines: Lathes will typically show all tools that are loaded into the lathe's toolgroup(s) at the start of
the NC program. One exception to this is that a lathe can have a toolgroup def ined as a mill-style toolgroup,
commonly known as an Automatic Tool Changing head or ATC. An ATC toolgroup in a lathe will display tools
in the same way that a mill will display tools, namely, to show only the currently active tool at any given time.
Def ining a toolgroup as an ATC in a lathe involves turning off the “Has Turret” setting in the machine setup
dialog in Build Machine. See the section “Lathe Toolgroups” on page 53 for more information.
23
Using Build Machine
Remove: The Remove button will delete a selected component from the assembly tree.
Test: The Test button opens a window that lets you view the assembly and test the machine’s moving parts to
ensure the proper motion.
24
Using Build Machine
Save: The Save button can be clicked once you have def ined your machine tool assembly. This opens a dialog
prompting you to select a directory for saving the f ile.Build Machine Interface
The Build Machine option allows you to create a model of a machine tool. Each component (the base of the
machine, the table, etc.) is def ined as a solid model and added to the Build Machine dialog. As the components
are def ined the Build Machine dialog will create a tree that def ines the machine tool and its parts. When ready
to be saved, the model’s moving parts can be tested. Once complete, the model will be available for Machine
Simulation.
Figure 9: The Build Machine window in its initial state and with components added.
In addition to the Build Machine window, there are several other windows and dialog boxes that are used to
def ine a machine. These are all accessed from the Build Machine window and are described in the following
sections. These include the Setup dialog box, the Add Component dialog box, and the Test Machine dialog
box.
25
Using Build Machine
Machine Parameter
MTM: This item is selected if the machine being created will be used for lathe, mill/turn or MTM. It activates
the toolgroup count and interprets the spindle/toolgroup as a toolgroup tool attach position. If this option is
not checked the setup is for a mill.
ToolGroup Count: This is the number of toolgroups on the machine. The origin of each toolgroup needs to
be def ined separately.
ToolGroup: This item lets you index between the toolgroups so that they can be fully def ined.
Workpiece Count: This is the number of workpieces on the machine. The origin is a milling spindle. The model
should contain a part body, either with the label “P” for a mill or simple lathe setup or with the label “Px”
where “x” is an integer between 1 and 100.
Spindle/ToolGroup Origin: This item is used to def ine where the tool or holder attaches to the spindle. This
item must be def ined and the easiest way to do so is to create a point in the part f ile that lies at the spindle
origin using the From Selection button.
From Selection button: Clicking this button loads the coordinates of a selected point that represents the
origin. The CS used by the points in these parameters should be the same one that the bodies used by the
machine components are assigned to.
26
Using Build Machine
Has Turret: This item is used if the machine has a turret or in MTM if the
ToolGroup being def ined is a turret. This item activates the Positions button
which lets you def ine the position of tools in a turret on the machine.
Positions button: This button opens the Turret Positions dialog box which lets
you def ine, among other things, the type of turret and how many tool
positions it has.
Turret Positions
This item lets you def ine a turret by setting how
many tool positions are on the turret, what
position they are in and the axis of motion the
turret moves in.
Axis Type: Choose the way the turret indexes from one tool to the next. The options include Rotary/Shortest
(the machine indexes in the shortest possible direction), Rotary + (the machine indexes only in an incremental
angle), Rotary – (the machine indexes only in a decremental angle) and Linear.
Axis Increment: This is the angle or linear distance between tools that the turret must take to index from one
tool to the next.
Advanced Setup
Selecting this option allows you to set a custom
Primary Value for each turret position, as def ined
by the “Count” setting. This is required if the tool
positions are note evenly spaced in the turret or
spindle. Activating the Secondary Axis option
allows you to def ine an additional axis that the
toolgroup uses to move tools into position.
Primary Value: This is the primary axis position for the tool position being def ined.
27
Using Build Machine
Secondary Axis: This item is used for any toolgroup where one axis is
not enough to def ine the motion needed to position the toolgroup
from one tool to another, such as a mini-gang on a slide.
Axis Type: Choose the way the turret indexes from one tool to the
next. The options include Rotary/Shortest (the machine indexes
in the shortest possible direction), Rotary + (the machine indexes
only in an incremental angle), Rotary – (the machine indexes only
in a decremental angle) and Linear.
Axis Increment: This is the angle or linear distance between tools that the turret must take to index from
one tool to the next.
Secondary Value: This is the secondary position for the tool being def ined, e.g. tool position 2 in a mini-
gang.
Component Groups
The Component Groups function allows you to group machine components together. The grouping has two
uses. The f irst use is for collision checking, the second use is for controlling component visibility. By default
there are two groups. Right clicking on the group list allows you to Add, Edit or Delete a group.
Collision Checking
The Used for Collision Checking option states that items in the group will be used when Collision Checking is
active. This means that components that may not otherwise be checked for collisions, such as sheet metal, will
be checked. Items within a component group will not be checked against each other (beyond the normal tool-
part interference) but the group as a whole can be tested against tool and part interference as well as other
groups consisting of things that are not ordinarily tested like steady rests, the machine’s sheet metal, the table
or chucks.
It is recommended that all items within a flow that are connected together, such as a chuck, spindle, x-axis and
z-axis on a common 3-axis mill, be put in the same Component Group. As previously stated, items within a
component group are not checked against each other. This can be very convenient on models with faces that
meet or overlap.
Controlling Visibility
Components can be grouped so you can easily show or hide them while rendering. As with the Collision
Checking option, a component is assigned to a group from the Add Component dialog box. Machine
Component Visibility is one of the options available in the right mouse menu when you are in Machine
28
Using Build Machine
Simulation. The dialog that is accessed from this selection lets you show or hide individual components or the
pre-def ined Component Groups.
Axis Mapping
This item is not currently used.
Parent: Use this f ield to select the Parent Component, which is the component on
which this item will be mounted. The list will contain the names of each body in the
part. Please note that all bodes that will be a parent must have a unique name for the
system to work properly.
29
Using Build Machine
Groups button: The Groups button opens a dialog that allows you to assign a
component to any group you have already def ined. This lets a component be collision
checked and/or easily shown or hidden as a part of the group. Select one or more
groups and close the dialog. The group assignment is automatically saved.
Name: This is the name of the component as it will show up in the Parent list. By
default it is the name of the body. If this is changed, (e.g. “Z” to “Z_Axis”) the new
name will only show up in this dialog. The name of the body will not change. Please note that names should
not include a space.
Axis Label: This item is very important for moving axes and several other components. The f ield corresponds to
the programmed axis, for example “X” is entered for the for the X axis of the Machine while “A” is entered for a
machine’s A axis. Additionally, the model that represents the part must be given a label of “P” or “Px” where x
is a number from 1-100. All entries are case sensitive. Valid entries for this f ield are any letter with or without a
number. MTM machine labels are described in the section “MTM Axis Labels” on page 35.
The part must be given a label because the system needs to know where the part is in the
machine assembly. A mill tool holder is assumed to attach to the spindle origin.
Comment: This section may be used to annotate the component. This is the only place the comment is used.
Color: You may simply enter the RGB (Red Green Blue) values (which are 0-255 with 0 being no color and 255
being pure red, green or blue) or you may use the Color button to select a color for the component. Simply
select one of the Basic Colors and click the OK button.
The Define Custom Colors button provides access to a much more complete spectrum of colors. You may
def ine the RGB (Red Green Blue) values or use your mouse to select a color from the spectrum and adjust the
darkness using the slider. When you click the OK button, the RGB values in the Add Component dialog will be
updated.
Visible: This sets the default visibility of the component. Component visibility can be toggled at runtime from
the Component Visibility dialog.
Component Type
Those buttons determine the component type. Use “Fixed” if the component is f ixed relative to its parent
component, e.g. a chuck is f ixed relative to a spindle. Use “Translation” for linear axes (X, Y, Z) Use “Rotation”
for rotary axes (A, B, C). Each component will be represented with an icon corresponding to the component
type, as shown to the right.
Type Icon
Fixed
Translation
Rotation
If the component is not “Fixed”, use the corresponding f ields to indicate the Axis direction and the center of
rotation for rotary axes. You can use the “From Selection” button to update the corresponding f ields from
selected geometry.
30
Using Build Machine
Translation: These f ields are used to specify an axis a component moves along and the direction in which it
travels. For orthogonal axes systems, a value of “-1” or “1” is entered for the appropriate axis, all other f ields
are to be given a value of “0”. A value of “-1” states that the initial movement of the axis will be in a negative
direction while a value of “1” states the initial movement is in a positive direction. Please note that all vectors
must be normalized.
Rotation: The rotation section has two parameters, one for the
actual axis of rotation, the other for specifying where the axis of rotation is relative to the machine origin.
Axis: The Axis value is a 3D vector def inition. The axis value for the A
axis should be X1Y0Z0, the B axis should be X0Y1Z0 while the C axis
should be X0Y0Z1. Please note that the value should be negative if the
axis moves clockwise or positive if the axis moves counter clockwise.
An easy guideline for most machines is that values for any axis the tool
is attached to should be positive while values for any axis the part is attached to should be negative.
Center: The Center value is the center of rotation relative to the machine origin. The easiest way to get this
data is to select the point that represents the center of rotation and click the From Selection button. This
will set the X, Y and Z values automatically.
31
Using Build Machine
For each axis, the zero position is assumed to be the position where the component is placed in the machine
model when the model is saved and the machine assembly is created. From this zero position the component
will move in a positive or negative direction based on the axis def inition. This is true for both linear and rotary
axes.
For axes that are not limited (for example a C axis on a typical lathe spindle), the Has Limits setting should be
unchecked (off ).
For axes that have either a minimum or maximum limit value, the Has Limits setting should be checked (on).
This enables both the Min and Max values which should be set to the appropriate value for the machine. It is
not possible to enable only a Min or a Max. If the Has Limits item is checked, both Min and Max must be set. If
limits are set for an axis, anytime the position of that axis exceeds either of the limit values during machine
simulation, a collision event is generated. If collision detection is set on, then the collision alert will be
triggered. A component does not need to be included in a collision component group for an axis limit exceed
collision event to be generated.
32
Using Build Machine
Figure 11: An example of a built machine ready for its axes to be tested.
Each axis can be tested by clicking on an arrow key associated with an axis. The Less Than button will move
an axis in the negative direction. The Greater Than button will move an axis in the positive direction.
Clicking these buttons function as if the machine was fed incremental g-code, or jogging the machine. If the
model moves in a direction that is not expected, e.g. a rotary axis moves in a clockwise direction when the
Greater Than button (a positive rotation) is clicked, then the values set in the Add Component dialog will need
to be changed.
Be especially careful if the part model is mounted directly on an axis. The Z Translation value may
need to be a “-1” instead of “1” due to a difference between the tool moving and the part moving
33
Using Build Machine
SAVE
The Save button is used to create the simulation model. Select a directory for saving the complete assembly
f ile and enter the f ile name for the model and click OK. The f iles will be generated and the Test Machine
window will display the model you just created.
The save function creates a group of f iles including an ASY f ile, an INI f ile and a FB f ile for each component in
the assembly. Together, these f iles create the machine assembly model. The VNC f ile stores data about these
f iles. If the ASY, INI or FB f iles are changed, the VNC will not know about the changes. The next time the VNC
f ile is opened and modif ications are made, the system will overwrite any changes made to the f iles. Therefore
it is highly recommended that all the f iles associated with the machine be stored in the same folder. This
includes the VNC, saved assembly data and MDD. Each revision of a model should include a new VNC.
Store all the f iles associated with a machine in one folder, including the machine’s VNC f ile, the
assembly f iles and MDD. This will let you revise a machine f ile, keep track of different machines and
MDDs, and ensure data is not overwritten.
34
Using Build Machine
NAMING CONVENTIONS
AXIS LABELS
When def ining a moving component you must specify the axis in which the component moves. Axis labels are
case sensitive and must be a letter with or without a number, e.g. “X”, “Z”, “A”, “B”, “x2” and “X2”. If the
component is to be a parent it must have a unique name.
ToolGroups: Each ToolGroup has its own set of axis labels, X through C and 1 to 99. If a machine has two
ToolGroups the f irst uses the labels X1, Y1, Z1, A1, B1, C1 and the second ToolGroup uses the labels X2, Y2, Z2,
A2, B2, C2. This allows a theoretical limit of 99 individual ToolGroups.
X1, Y1, Z1, A1, B1, C1 Toolgroup 1 axes (note: rarely is an A axis def ined on an MTM machine)
...
X99, Y99, Z99, A99, B99, C99 Toolgroup 99 axes
Spindles: Each spindle has its own set of axis labels, X through C and 101 to 199. If a machine has two spindles the
first uses the labels X101, Y101, Z101, A101, B101, C101 and the second spindle uses the labels X102, Y102, Z102,
A102, B102, C102. This allows a theoretical limit of 99 individual spindles.
...
Please note that most spindles only have a C axis and sometimes a Z as well, but other axes are possible.
!
Auxiliary Axes: Auxiliary functions are typically set through Utility operations. Each auxiliary function, such as
a bar feeder or part catcher, has its own set of axis labels, X through C. The number that follows def ines the
type of auxiliary function.
X301, Y301, Z301, A301, B301, C301 Auto Bar Feeder axes
35
Using Build Machine
Please note that auxiliary component assemblies generally only have one
! or two axes but all 6 are available.
36
USING MACHINE SIMULATION
Using Machine Simulation
The Machine Sim Models dialog opens, displaying known machine assembly f iles. Select a machine tool from
the list or click on the User Folder button to select a specif ic machine tool folder. The simulation window will
open with the selected machine loaded.
The User Folder location is stored in each user’s system preferences. The machine model name is stored with
the associated part f ile.
39
Using Machine Simulation
40
Using Machine Simulation
1. Tool Display
2. Run Mode
3. Render Control menu
Tool Display: The Tool Display option is similar to the traditional rendering option of showing an invisible tool,
a transparent tool or a solid tool. As with standard rendering, the hidden tool produces the fastest rendering
while the solid tool is the slowest of the options.
Run Mode: The Run Mode option shows whether Simulation will display the full machine model and part
(Machine Sim), show only the part (Part Sim) or show the toolpath on the stock (Tool Sim).
To use Machine Mode a machine f ile will need to be selected using the Load Machine option in the Render
Control menu. If your MDD correctly def ines the ToolGroup and Workpiece home positions Simulation can be
run in Machine mode without loading a machine f ile. In Machine mode to aid in the visualization of lathe
41
Using Machine Simulation
spindles, the spindle will rotate while cutting during any lathe turning operation. This rotation is only to assist
in showing the direction of rotation.
In Tool Sim mode, the Render Control has two additional sliders. As with other render modes, the f irst slider
(from top to bottom) controls rendering speed. The second slider moves the tool back and forth through the
render process with a fairly course granularity. The third slider provides a much f iner granularity of control.
The “Show Toolpath” options control the display of the toolpath.
Figure 12: An example of ToolSim. The green lines are the traced toolpath and
the orange lines are the rapid moves.
Render Control Menu: This menu provides control over the appearance and content of the Simulation
rendering. The Render Control menu is largely the same as the standard and Flash CPR rendering modes. The
options in this menu are fully detailed in the section “Simulation Rendering Options”.
42
Using Machine Simulation
Show Time: This will set the Current Display to show the elapsed cut time.
Show Op #: This will set the Current Display to show the current operation number.
Transparent Stock: This option will produce a translucent stock, providing visualization of areas hidden by a
wall. This option will slow down rendering speed.
Transparent Fixture: This option will produce a translucent f ixture bodies, providing visualization of areas
hidden by walls. This option will slow down rendering speed.
Skip Pecks: This option increases render speed by not showing small retracts in a drilling operation that uses
pecks.
Skip Unselected Ops: This option will only render the currently selected operations. The operations are still
generated. This option simply reduces the rendering time.
43
Using Machine Simulation
Tool Motion on Target Body: This option provides a non-cutting simulation of the tool motion. Selecting this
option will increase the speed of the simulation where the display of material removal is not as important as
what the tool is doing.
Op Color Mode: This option lets you utilize color to enhance the
functionality of CPR and Simulation. The corresponding options
sub-dialog has 3 color modes, Cut Color (which is the default behavior
and the same as earlier versions of the software), Tool Number and Op
Number. The color of the remaining material changes with each operation
or tool. This way you can see what areas of the part were machined by
each operation, tool or selected op. The color palette is generated
automatically to create a set of colors that are readily distinguishable from
one another. Double clicking a color allows you to change it.
Figure 13: Example of Cut Color, Tool Number and Op Number use.
Show Toolpath: This option is available in Tool Sim. The rendering options can
be accessed either by clicking on the options arrow next to the speed control
or by right mouse clicking on the Render Control title bar. These options let
you can choose how much of the toolpath will remain on the screen as the tool
follows the toolpath (0, 1, 5 or 100%). Trace Operation will draw one operation
at a time. Trace From Run will clear the previous toolpath and begin redrawing
if the user stops the render midway through and restarts.
44
Using Machine Simulation
Holder was involved while the Prim 2 section reports whether the collision was with Stock or a Fixture. Using
this option will slow down rendering speed.
Show Rapid Tool: The tool is rendered in a different color to show when it is Rapiding when this option is
enabled.
Check Machine Travel Limits: This setting enables Machine Sim to check for any axis motion that is beyond the
limits set in any machine component. If an axis limit is exceeded, a collision event is generated in the same way
that it is generated when two components collide. The result of an axis limit exceeded event is controlled by
the Collisions/Limits settings in the Machine Sim Settings dialog.
Load Machine: This option allows you to select which machine assembly f ile will be used for the current part.
Once selected, the same machine will automatically be used for the part until a different machine is selected.
Clicking User Folder allows you to select a directory that contains machine assembly f iles. Select the machine
you wish to use and click OK.
45
Using Machine Simulation
Setup… This option is used if the part f ile does not lie properly
within the machine space. This will occur if the part’s origin is not at
the center and bottom of the workspace def inition. To reposition the
part to the machine space def ine the distance from the machine
origin to the part origin. These are absolute values in part units from
the machine origin to the part origin.
Machine Component Visibility: This option opens a dialog box that lets you control the visibility of components
in the machine assembly f ile. You may control the components individually and/or by the groups set in Build
Machine. As with workgroups and coordinate systems, the eye icon lets you show or hide a component.
Additionally you may set it to a specif ic transparency level from 0 (invisible) to 255 (solid).
Show Machine: This item turns on (or off) the display of all of the selected machine’s bodies.
POV Lock: The choices here all control how the part (or part/machine) move during the simulation sequence.
This gives the user control over how the virtual camera moves around the scene, def ining the point of view
during animation.
The choices available for Point of View Lock will be different depending on the rendering mode. For CPR, Part
Sim and Tool Sim, the options are Fixed Part, Tool Rotary Axes, Tool Linear Axes and Tool Rotary & Linear
46
Using Machine Simulation
Axes. For Machine Sim, the choices are Operator, Part, Machine Component, Tool Rotary Axes, Tool Linear
Axes and Tool Rotary and Linear Axes.
Don’t Preload Subspindles: The initial stock on the subspindle is pre-calculated, by default, anytime Simulation
is activated or rewound. By selecting this option the calculation of the subspindle stock is deferred until after
the main spindle cutting has been simulated. This can reduce Simulation’s use of system resources and aid
rendering, especially on slower machines.
Settings: This option opens the Machine Sim Settings dialog. While this dialog is essentially the same as the
Flash CPR Rendering Preferences, they save separate data f iles. These preferences are detailed in “Machine Sim
Settings” section beginging on page 13.
47
Using Machine Simulation
Create Facet Body: This function turns the current cut rendered condition into a facet
body. The facet body will appear in the workspace as a transparent body. One of the
few uses of facet bodies is that they can be set as stock for “display only” purposes, i.e.
they cannot be used as a stock condition for creating toolpath but they can be shown
in rendering for Flash CPR sessions. Looking at the properties dialog you can see that
essentially nothing can be done but setting the body as a part, f ixture or stock. Setting
a facet body as stock can be quite useful for saving a rendered condition so you can
instantly get to later operations.
48
Using Machine Simulation
TOOLS
SETUP
Understanding how to properly set up tools and positions is vital to getting Machine Sim to render correctly.
This section discusses def ining tools for Machine Sim. Information on setting up toolgroups within the
machine assembly is discussed in the “ToolGroups” section beginging on page 23.
In this section we will go over how one machine’s toolgroup was set up. The machine is a relatively standard
two turret two spindle MTM-type machine. The MDD for this machine will handle the tool holder length so
the user will not have to calculate the tool tip’s distance from the mount point. The Use Tool/Holder Length
value in the MDD can be set to X0, Y0, Z0 because the mount point is known and specif ied in the Build
Machine Setup (see below). The machine assembly f ile has been def ined with all of the components
referenced from the machine CS, #1 in the images below. The turret is def ined in the Add Component dialog
box as a rotary axis and the rotation point (#2 below and Figure 16) is referenced from the machine CS. The
turret’s datum point or mounting point for tools (#3 below and Figure 17) is set in the Setup dialog box. The
point can be set and seen by clicking on the From Selection and Show buttons.
49
Using Machine Simulation
50
Using Machine Simulation
tools will need to be offset in Xr to be in place while the OD oriented tools will need to be offset in Z.
Additionally, other offsets or turret shifts may need to be applied.
1. Tool Offset in Xr
2. Tool Offset in Z
3. Turret Shift in Z
4. Turret Shift in Xr
Figure 18: The Turret Shift dialog. It is important to be aware of the difference between the
tool offset values and the Turret Shift values.
Mill Toolgroups
Tools are attached to a mill toolgroup during machining when the tool becomes the active cutting tool. The
tool is positioned at the location def ined by setting the Spindle/ToolGroup Origin in the Setup dialog box of
Build Machine.
For mill toolgroups, the tool should be offset in Z only. There are two methods to def ine the Z offset of a mill
tool. One method is to use the tool Z offset value from the tool dialog, meaning the length out of holder plus
the distance the tool holder sticks out of the toolgroup. The other method is to let machine simulation
calculate the Z offset by using the tool holder length and the “Length Out of Holder”.
To enable machine simulation to calculate the Z offset for tools in a mill toolgroup, there is a setting in the
MDD that must be turned on. This setting is called “Use Tool / Holder Length” and is one of the toolgroup
settings in the MDD. When this option is checked the tool and holder (if available) are positioned so that the
tool and holder stick out from the spindle at the spindle face. The tool shift offsets are applied from that
default position. If the option is not checked then the tool tip center is shown at the spindle face, offset by the
tool shift offsets.
51
Using Machine Simulation
If we were not using the MDD’s capability of calculating the tool & holder length we would also need to add a
Z offset. The tool length out of the holder is 1.2 inches and t has a tool holder of some length. We would need
to know the gauge length of the holder to calculate the Z offset properly. In the Turret Shift dialog we would
enter an Xr offset value of -1.181 and a Z offset of 1.2+(gaugle length) inches.
Mill Tools - OD
Here we are using the tool in position #3 as an example. In order to get the tooltip in the correct location we
need to apply a tool offset value. In this case, as the hole for the holders is OD aligned, we will need to offset
52
Using Machine Simulation
the tool in Z. The distance from the datum point to the center of the mount hole is 50mm or 1.9685 inches. In
the Turret Shift dialog we enter an tool offset value of -1.9685 in Z.
Lathe Toolgroups
Tools are attached to a lathe toolgroup during machine simulation as a result of the information in the tool
dialog. The tool dialog holds the toolgroup number and the tool position within the toolgroup. In the setup
dialog, enabling the “Has Turret” option activates the tool position def inition. This allows the machine
assembly to store information about the tool positions in a toolgroup. Each position is numbered, and the
position number is matched to the tool dialog position numbers to display each tool in the proper position.
The tool is attached to the toolgroup so that when the tool's position is moved into place for cutting, the tool is
at the tool attachment position of the toolgroup. This attachment position is def ined by using the Spindle/
ToolGroup Origin setting in the Setup dialog box of Build Machine.
The tool offset values from the tool dialog is used to adjust the tool position in the toolgroup from the tool
attachment position. This means that if the tool offset values for a given tool are set to zero, the tool control
point (typically the tool insert tip) is displayed at the tool attachment position. A common place on the
toolgroup for the tool attachment position is the corner of the turret closest to the spindle that the toolgroup
will address during machining. The tool offset values are used to position the tool tip at the correct offset from
the tool attachment position, considering the length and width of the tool holder and any tool adapter block
or live tool assembly that is required.
Lathe Tools - OD
Here we are using tool #13 as an example. In order to get the tooltip in the correct location we need to apply a
tool offset value. The system automatically aligns the tooltip to the front of the spindle and sets an offset so
the touch off point is correct based on the tool thickness. This tool setup is fairly easy, we simply need to enter
53
Using Machine Simulation
the tool holder length, which in this case is 4 inches. In the Turret Shift dialog we simply enter an Xr offset
value of 4.
54
Using Machine Simulation
55
Using Machine Simulation
56
SCRIPTING
Scripting
CHAPTER 5 : Scripting
MACHINE SIM SCRIPTS
A simple but powerful scripting/macro capability is available in Machine Sim. This functionality allows you to
create customized Machine Sim motion that simulate the motion of the real machine. These scripted macro
programs (called “Scripts”) provide a source for motion that is not known or managed by GibbsCAM at the
detail level required to show a realistic simulation of utility operations for a given machine. In this way you can
spend as much time as is necessary creating a very detailed and specif ic type of simulation for the utility
operations of a given machine, e.g. to show the movement of tailstock and steady rests and to show the precise
motion of the jaws on a chuck.
The Machine Sim Scripts are executed by Machine Sim whenever a utility operation is encountered during the
replay of the operations in the VNC f ile. Machine Sim scripts can also be called directly via a command in the
At Start Op or At End Op comments of the Utility Data of any operation (e.g. postscript). The script f iles
should be placed in the machine model folder, in a sub folder called “scripts”.
The Machine Sim Scripts are interpreted, meaning that the text f ile containing the script commands will be
read and parsed sequentially (except for conditional commands) at the time of execution. Each script
command will cause a Machine Sim action. The Machine Sim Script language supports local and global
variables, simple math operations, and conditional logic commands. The scripting language is not case
sensitive.
59
Scripting
TYPES OF SCRIPTS
There are f ive different types of scripts:
Utility Op Start Script: This type of script is executed when a utility op of the same name as the script is
encountered at the start of the f irst path feature of the utility op. This type of script is a “one-shot” script,
where all other Machine Simulation motion is suspended, and the script is run serially. Start Scripts are stored
in the sub-folder /scripts/startscript. A list of these scripts can be found in the section “Machine Sim
Scripts Utility Op Script Names” on page 60
Utility Op End Script: This type of script is executed when a utility op of the same name as the script is
encountered at the end of the last path feature of the utility op. This type of script is a “one-shot” script, where
all other Machine Simulation motion is suspended, and the script is run serially. End Scripts are stored in the
sub-folder /scripts/endscript. A list of these scripts can be found in the section “Machine Sim Scripts
Utility Op Script Names” on page 60
Time-based Script: This type of script is executed when a utility op of the same name as the script is
encountered at the start of the f irst path feature of the utility op. This type of script is a synchronous script,
meaning the motion of the script is time-synched to all other Machine Simulation motion, and the script is
run in parallel. Time-based Scripts are stored in the sub-folder /scripts/timebased.
Explicit Script: This type of script is executed when an explicit call to the script is made from postscript
commands in any GibbsCAM operation, i.e. the At Op Start or At Op End utility data. These scripts are run as
one-shot scripts at the feature containing the runscript command. These scripts are stored in the sub-folder /
scripts.
Implicit Script: This type of script is executed by default at particular key points in the machine simulation.
Currently this includes a Start Machine Sim script, Change Tool script and an End Machine Sim script. These
scripts are run as one-shot scripts at the feature containing the runscript command. These scripts are stored in
the sub-folder /scripts.
LoadSpindle_script † UnLoadSpindle_script †
LoadSpindleManual_script UnLoadSpindleManual_script
LoadSpindleAutoBarFeed_script UnLoadSpindleAutoChuck_script
LoadSpindleAutoChuck_script UnLoadSpindlePartCatcher_script
LoadSpindleBarFeed_script UnLoadSpindleGripper_script
LoadSpindleBarPull_script UnLoadSpindleRobot_script
LoadSpindleSubSpinPull_script UnLoadSpindlePartDrop_script
LoadSpindleRobot_script UnLoadSpindlePushOut_script
TailstockIn_script † SubSpindleOnPart_script †
TailstockOut_script † SubSpindleReturn_script †
PosTailstock_script †
60
Scripting
PartShift_script † SteadyRestIn_script †
PartShiftManual_script SteadyRestOut_script †
PartShiftAutoChuck_script PosSteadyRest_script †
PartShiftBarFeed_script CatcherIn_script †
PartShiftAutoBarFeed_script CatcherOut_script †
PartShiftBarPull_script PartIndex_script †
PartShiftSubSpinPull_script MoveTool_script †
PartShiftRobot_script AllStop_script †
MachMode_script †
COMMANDS
The scripting language includes the following script commands:
MoveTo: This command moves (animates) bodies along their axes to a position with a specif ied number of
animation steps. This command can accept multiple bodes at the same time. The specif ied axes will move
simultaneously.
GoTo: This command statically repositions (“pops”) bodies to a new axes position.This command can accept
multiple bodes at the same time. The specif ied axes will move simultaneously.
SetPos: This command functions the same as GoTo but does not have redraw at the end.
Delay 500
This will delay the system for half a second.
Load: Loads a part for the specif ied P body. Can do it invisibly if optional “Vis 0” is specif ied.
Load P1 Vis 0
Part 1 is loaded invisibly
Unload: Unloads the part that’s standing in for the specif ied P body
SetVis: This command sets the visibility of one or more bodies. Use 0 for invisible, 1 for translucent and 2 for
opaque.
61
Scripting
SetVar: This command def ines a variable and sets its value.
ChangeTool: This command changes a tool. It is typically used for machines with an ATC to more correctly
render the tool change. Normally a tool change occurs just before an operation. If you are scripting an ATC’s
motion to the tool port and back to the part the system will, by default, only change to the new tool just before
the new op starts. This command lets you force the new tool to be drawn at a more appropriate time.
Reparent: This command assigns the owner of a part to a P body so that it can be moved. It effectively
“attaches” the part to a body (the parent body to the P body specif ied) so that if that body moves, the part
moves with it, as in the case when a subspindle pulls the part out of the spindle.
Reparent P1 P2
This assigns the ownership of the part in P1 to the P2 body and its parent.
Conditional Commands
The scripting language includes the following conditional logic commands.
IF
ELSE
ENDIF
Conditional expressions (the test in an IF statement) only support relational operators (<,<=,>,>=,=,<>), but
the left and right sides may be complex arithmetic expressions.
62
Scripting
Debugging Commands
Print <stuff>: This command writes the contents of <stuff> to the Machine Sim Statistics console (Machine Sim
Settings -> Statistics... checkbox). Either a string literal or a script expression can be used as <stuff>.
PrintLn <stuff>: This command writes the contents of <stuff> to the Machine Sim Statistics console (Machine
Sim Settings -> Statistics... checkbox). Either a string literal or a script expression can be used as <stuff>.
PrintLn adds a line break after <stuff> where Print does not.
• GoTo and MoveTo do a redraw at the end of the command. MoveTo may do several redraws, one after each
scene it automatically creates have been composed.
• SetPos, SetVis, Load, Unload, Reparent, ChangeTool, SetPartVis may change the graphic state of
simulation, but a redraw is not automatically done at their completion. This allows a user to do multiple-
command scene composition, and then show the results using Redraw when the scene is ready.
• GoTo, MoveTo and Delay may do an automatic redraw at the beginning of the command if the graphic state
has been changed since the last redraw. This would be triggered by SetPos, SetVis, Load, Unload, Reparent,
ChangeTool or SetPartVis.
63
Scripting
OPERATORS
The scripting language includes the following math operators:
+ (plus sign): This performs an addition of the variables on both sides of the +.
- (minus sign): This performs a subtraction of the variable on the right of the – from the variable on the left of
the –.
* (multiply sign): This performs a multiplication of the variables on both sides of the *.
/ (division sign): This performs a division of the variable on the left of the / by the variable on the right of the /.
VARIABLES
The scripting language allows for local, global, and operation def ined variables. Local variables are def ined by,
used, and scoped internally to an MS Script. Global variables are def ined either in a Script, or as part of a
globally available environment that is created and managed dynamically by Machine Simulation. Operation
def ined variables represent utility operation data that is supplied by the user when a utility op is created (e.g.
ZPosition)
#variablename
Variable Data
&PartUnit 0=metric, 1=english
&OpType 0=mill, 1=lathe, any other value=none
&OpSubType Mill: 0=drill, 1=Contour, 2=Pocket, 3=Thread Mill, 4=Surface, Any other value=none
• Global variables can also be user-def ined. These are formatted as:
64
Scripting
%variablename (e.g. %X102, which will return the current position of the spindle2 X axis.) To set an axis
value, use the SetPos command.
@variablename (e.g.@ZPosition)
65
Scripting
66
Scripting
POSTSCRIPT COMMANDS
Machine Sim Scripts allows for commands that are manually typed into the postscript (the At Start Op or At
End Op utility data) or that are included in an Add Gcode Utility operation. These commands include:
SetVar(<variablename>=<value>)
RunScript(<scriptname>)
Please note that SetVar can only be used for global variables and the global variable pref ix ‘$’ must not be
used.
Example: A script named MoveWAxis_script.txt was created and you want to call it after Operation 3. This
script requires a variable named $h to be set to 100. Operation 3’s At Op End f ield is edited to include the
following.
SetVar(h=100)
RunScript(MoveWAxis)
67
Scripting
MDD EDITOR
MDDS
• The length of the mill tool is affected by the MDD setting called “Use Tool / Holder Length”. When this
option is checked the tool and holder (if available) are positioned so that the tool and holder stick out
from the spindle at the spindle face. The tool shift offsets are applied from that default position. If the
option is not checked then the tool tip center is shown at the spindle face, offset by the tool shift offsets.
• The axis limits def ined in the MDD are used by Machine Builder and Machine Sim.
VMMS
VMM defined auxiliary axes: With customization, VMM's are now able to support the def inition and
positioning of axes, such as a subspindle, in the program based on standard behavior of utility operations. This
allows for motion that does not result from machining operations to be handled by Machine Sim without the
need for scripts for axes. The VMM def ines axis motion for utility ops that relies on the presence of axes
def ined in the machine model. If the axes are present in the machine model, machine sim will move these axes
whenever a utility operation that controls these axes is encountered. These newly def ined axes will be tracked
internally by GibbsCAM and controlled by Machine Sim. In this way, standard motion for utility ops can be
programmed either generically or specif ically by a VMM, and a resulting motion will occur in Machine
Simulation, with or without the use of an accompanying Machine Sim Script. Additionally, the VMM can
specify that a part is to be reparented in a utility operation. This allows for a smooth, synchronous transition of
a part from one spindle to another without the use of special scripts.
Please note that VMM upgrades are required for Machine Sim to function correctly on multi-spindle machines
as scripts cannot handle subspindle moves.
68
MACHINE SIMULATION
TUTORIALS
Machine Simulation
1. Base
2. Table
3. A Axis
4. Rotary_Body
5. X_Axis
6. Y_Axis
7. Z_Axis
8. Spindle
You will likely be prompted about the system creating an MDD for this f ile. That is to be expected, as a
custom MDD was created to represent this machine assembly. Without the custom MDD the linear
and rotary motions may not be properly def ined.
• In the YZ plane extrude the Base geometry by X+:300, X-:–300. Name this body
“Base”.
• In the YZ plane extrude the Table geometry by X+:+350, X-:–350. Name this body “Table”.
• In the YZ plane create a 360mm diameter cylinder that is 50mm deep, extending from
X+350 to X+400. Name this body “A Axis”.
71
Machine Simulation
It is extremely important to properly align bodies that represent rotary axes about
their center of rotation. If possible, it is recommended that you model the rotary
! axes with a cylindrical rather than a cube shape to more easily conf irm the rotation
is correct when using Build Machine.
• In the YZ plane extrude the Rotary Body geometry by X+:+600, X-:+400. Name this body
“Rotary_Body”.
• In the XZ plane extrude the X Axis geometry by D+:+0, D-:-500. Name this body
“X_Axis”.
• Create a cube that is smaller than the table to represent the part and name this body “Part”.
72
Machine Simulation
It is vital to state what each body attaches to. As all other components in the machine model eventually
attach to the base, the base shall be used as the basis, the root, of the assembly.
This states the this model is stationary, based on what it is attached to. Since it is attached to the root,
the Base is the foundation upon which all other components will move.
73
Machine Simulation
The values Red 100 Green 100 Blue 100 will make the base gray. The color of the model may seem
relatively unimportant, but being able to clearly distinguish between components can be very
important. A good color selection can help this.
The component has been added, we will now add more components.
The Z Axis
• Select the Z_Axis body and click the Add button.
Creating the Machine Assembly
If a body represents a linear or rotary axis it must be given an Axis Label, legitimate entries are X, Y, Z,
A, B or C and capitalization is critical.
This tells the system that the model represents a linear axis. We now need to def ine the Axis.
74
Machine Simulation
A value is entered in the box that represents the component’s axis. The Direction tells the system
whether the axis moves in a positive or negative direction from its 0 position. Typically only a single
axis is selected using an entry of “1” for a positive move and “-1” for a negative move. All f ields that are
not used by an axis get a value of “0”.
The component has been added, we will now add more components.
The Spindle
• Select the Spindle body and click
the Add button.
75
Machine Simulation
The Tool
• Select the Tool body and click the
Add button.
76
Machine Simulation
The Y Axis
• Select the Y_Axis body and click the Add button.
Negative 1 is entered because the Y axis part must move in a negative direction along its axis so that the
tool is in a “higher” relative position to the part along the Y axis.
77
Machine Simulation
The X Axis
• Select the X_Axis body and click
the Add button.
left (a negative move) to get the part into a “higher” relative position to the tool.
78
Machine Simulation
The A Axis
• Select the A Axis body and click
the Add button.
The Part
• Select the Part model and click
the Add button.
79
Machine Simulation
The Arrow
• Select the Arrow model and click
the Add button.
The Numbers
• Select the 90+0+-90 model (the
numbers) and click the Add
button.
Creating the Machine Assembly
80
Machine Simulation
81
Machine Simulation
Axis Testing
• Click Save to save the assembly and test the
components.
This should cause the A axis body rotate in a positive direction. The axis is actually rotating in a
negative direction. We need to change the Rotation value.
• Close the Test Machine window, right click the A_Axis component and select Edit.
• Click the Save button to save the assembly file and open
the Test Machine window.
82
Machine Simulation
There is a point in this workgroup that has been created at the spindle origin. This point will be used to
load the position.
• Select the point and click the Spindle Origin From Selection button.
83
Machine Simulation
• Close the Build Machine dialog and save the part file as it is complete.
Please note that the assembly f ile does not represent the limits of the machine’s axes. This and other
information including the tool change position is handled by the MDD (Machine Def inition
Document) associated with the machine. Each machine built with Build Machine must have a custom-
built MDD. for more information on this, see the MDD Editor documentation. In that manual we will
make an MDD associated with this machine.
Finalizing the Assembly
84
Machine Simulation
If you render the part, you can see that we do a pre-mill hole, followed by
drilling to the bottom of the hole, roughing the pocket and completing the
operations by f inishing the pocket.
Enabling the Show Tool Holder option in the toolbar will include the
Loading Processes
We will now load the processes to f inish the machining of this part.
85
Machine Simulation
Machining XZ Plane
• Load the MachineSim1 process.
• Switch to CS2, the XZ plane and select the point that lies in that CS (at Y0,
centered above the hole).
Machining XZ Backside
• Delete the existing process tiles and deselect the operations we just created.
• Switch to CS3, select the two points that lie above the holes.
86
Machine Simulation
• Delete the existing process tiles and deselect the existing operations.
Be sure to use the Single Feature Cut function. Offsetting the markers by
5mm will start the tool off of the part.
If you enabled the Show Tool Holder option you probably noticed that the
tools have holders even though we did not set any. The saved processes
include tool holder data. While the holders are not essential for Flash CPR,
they are useful. The display of the holders can be considered crucial when
Preferences
Let’s look at our rendering options before we use Machine Sim.
When Machine Sim f irst opens you will see the stock body and
f ixtures. Unless you have changed the Preferences, the
workspace is a gradient rather than black.
87
Machine Simulation
This should only require you to select the Transparent Stock and
Transparent Fixture options.
88
Machine Simulation
Part Sim
Machine Sim can be used without a machine assembly f ile. This mode is referred to as “Part Sim” or “Part
Mode”. If a machine is not loaded, Machine Sim automatically uses this mode. Part Sim can also be selected
if a machine is loaded. Let’s look at Part Sim before we load a machine. We will render the part using Part
Sim f irst for familiarization.
• From the isometric view, zoom out a little and move the part so that the fixture is at
the bottom of your window.
Zooming out will allow you to see the tools and holders better. The transparent
stock and f ixtures allows us to see what the tools and holders are doing without
rotating the part.
• Turn the rendering Speed Control down to the first mark on the speed control (this is the 1/4
speed mark, which is 1/4 of the way from the left).
At top speed we will not see many of the subtleties of the tool movement, (unless you have a very slow
computer).
If the rendering is too slow, move the Speed Control to a faster speed.
Note how you can see all of the cut stock.
89
Machine Simulation
Loading A Machine
Before Machine Sim can be used, a machine assembly f ile
must be selected. If you are going to create your own machine
assembly f ile and have not done the “Build Machine Tutorial”
on page 71 it is recommended that you complete that tutorial
before continuing this tutorial. For information on creating a
machine assembly f ile see the chapter “Using Build Machine”
starting on page 17. If you will not be creating your own
machine assembly (i.e. someone else in your company is
tasked with that responsibility), we have included a
completed version of the machine assembly that you can use.
90
Machine Simulation
A dialog will open allowing you to navigate to the location of the machine assembly f ile you created. If
you did not create an assembly f ile you can choose the folder 4 Axis Vertical Mill Machine File that is in
the same folder as the MachineSim.vnc f ile.
The Gibbs window will include the machine model but we have something to take care of f irst.
• Switch to isometric view and zoom out until you see the entire
machine.
The part should be centered on the table. It is very important that the system
knows where the part origin is relative to the machine’s origin. Not def ining
this properly could lead to interference between the tool and the machine or
part. If you do not properly def ine where the part is upon f irst activating
Machine Sim, you can always select the Setup… option from the Machine Sim
menu on the Render Control palette.
91
Machine Simulation
• Set the render speed to about the 1/4 speed mark and click the Play button.
Both the tool and the holder are now displayed by the system. Note
that selecting the transparent tool option applies to both the tool and
holder.
When the operations on the front face need to be rendered the table
moves down in Y and the A Axis rotates into position. Throughout the
rendering process the X and Y axis move as needed. Note that even the
threads are rendered.
When the operations on the back need to be rendered the table moves up in Y
and the A Axis rotates into position. When complete the rendering process
stops at the end of the operations. Sending the tool home and unloading the
tool is not rendered as that is not a part of the operations we def ine.
Using Machine Sim
• If you want to inspect the rendered part, you can zoom, pan and rotate the part as
needed without restarting the rendering.
92
INDEX
Index
95
Index
Home position: 22
O
Op Color Mode: 44
I OpenGL: 41
Implicit Script: 60 Origin: 20, 22
Inter-Operation Moves: 4
P
L Parent: 29
Lathe parts: 22 Part Body: 22
Length Out of Holder: 51 Labels: 26
Less Than button: 33 Part Mode: 4
Load command: 61, 63 Part Origin: 46
Load Machine: 39, 41, 45 Part Sim: 41
Part units: 22
P-body: 22
M Pivot distances: 11
Machine assembly: 14 Plug-Ins menu: 4, 24, 39
Machine Component Objects: 14 Position, tool in turret: 27
Machine Component Visibility: 46 Postscript: 59, 67
Machine CS: 20 POV Lock: 46
Machine Mode: 4, 41 Preferences: 47
Machine Parameters dialog: 24 Prim 1: 44
Machine Sim: 4, 41 Prim 2: 45
Machine Space: 46 Primary Value, axis position: 27
Machine Tool: 4, 20 Primary Value, turret position: 27
MachSim Axis: 27 Print command: 63
MDD: 11, 68 PrintLn command: 63
Mill parts: 22
Model Tree: 19, 24–25, 29
Moves, intra-operation: 11 R
MoveTo: 63 Redraw command: 61
MoveTo command: 61, 63 Reload Simulation: 47
MTM parts: 22, 26 Remove button: 24
MTM, Machine Parameter checkbox: 26 Render Control: 39, 41
Menu: 42
Rendrering colors: 44
N Reparent: 63
Names, of components: 20, 30 Reparent command: 62
Non-Cutting simulation: 44 Reposition the part: 46
Non-machine components: 14 RGB: 30
96
Index
97
Index
Use Op Stop: 43
Use Tool / Holder Length: 68
from MDD: 51
Use Tool/Holder Length: 49
Used for Collision Checking: 28
Utility Data: 59
Utility Op End Script: 60
Utility Op Start Script: 60
Utility Operations: 68
V
Variables
Global: 64
Global, user defined: 64–65
Local: 64
Operation: 65
Visible, compenent setting: 30
VMM: 68
W
Workpiece: 11, 22
Count: 26
Z
Zero position: 32
98