GPP2_User_Manua-GPP2-手册l

更新时间:2023-04-05 00:30:01 阅读量: 实用文档 文档下载

说明:文章内容仅供预览,部分内容可能不全。下载后的文档,内容与下面显示的完全一致。下载之前请确认下面内容是否您想要的,是否完整无缺。

CimatronE

GPP2 User Manual Version 3.20

December 2006

Table of Contents

Chapter 1: Theory of Operation (1)

Introduction to GPP2 (1)

GPP2 Input Files (2)

GPP2 Coordinate Systems (3)

Reference UCS (3)

Toolpath UCS (3)

Current Procedure ORIGIN UCS (4)

Output UCS (5)

Legacy Coordinate Systems (5)

MACSYS UCS (5)

MODEL UCS (6)

GPP2 Toolpath Points (6)

Blocks and Qualifiers (7)

List of Blocks and Qualifiers (8)

Non-Supported Old Blocks (8)

Procedure “Header” Blocks (10)

Multi-tool Procedures (11)

GPP2 Connections (11)

The Connection Process (12)

Starting the Connection (12)

Choosing the Default Connection Scenario (13)

Procedure Connection Point (14)

Connection Scenarios (15)

The Default Scenarios (15)

Short Connection (Scenario “short”) (15)

i

Long Connection (Scenario “long”) (16)

Connection after Tool Change (Scenario “tool-change”) (16)

Safe Connection (Scenario “through-safe”) (17)

Breaking Sideways Moves to Multiple Motions (18)

Subroutines (19)

Dealing with Machine Capability (19)

Subroutine Numbers (19)

Subroutine Blocks (20)

Post-time vs. Run-time (20)

Location of Subroutine Body G-Code (21)

Linear Motion (22)

Qualifiers (22)

Process Rapid as Feed (23)

Circular Motion (24)

Dealing with Machine Capability (24)

Planes, Axes and Angles (25)

CimatronE Arc Planes (28)

Limiting Arcs to Quadrants (28)

Limiting Arc angles (29)

Breaking Arcs to Linear Motions (29)

Drill Cycles (31)

Cycle Qualifiers (31)

Dealing with Machine Capability (32)

Inter-Cycle Connections (33)

Tool Position after Cycle (34)

Default Tool Height after the Cycle (34)

Information on the “Next” Cycle (36)

Running a Post-Script from GPP2 (36)

ii

Licensing Post-Processors with GPP2 (37)

Protection of the GPP2 Development Environment (38)

Chapter 2: Language Reference Manual (39)

Introduction and Conventions (39)

Structure of this Document (39)

GPP Users (39)

GPP Conventions (40)

GPP Variables (40)

System Variables (40)

User-defined Variables (41)

User-defined Interaction Variables (41)

User-defined GPP-Procedure Variables (42)

Array variables – Not Recommended (42)

Variable Formats and Types (42)

Formatting Variables for Output (44)

Variable Modality and “Set” Status (46)

Identical Variables – Not Recommended (48)

Variable Initialization (49)

Tool/cycle user-defined variables – Not Supported (50)

GPP Expressions (50)

Expression Types (50)

Constants (51)

Variable References (53)

Standard Mathematical Operators (53)

Trigonometric Functions (54)

Other Numeric Functions (55)

The FORMATTED_NUM Function (55)

The FRAC_DIGITS Function (56)

iii

The INT_ and FRAC_ Functions (57)

String Functions (58)

String Concatenation (58)

String Length (58)

String to Number (59)

Numeric Variable to String (59)

Sub-Strings (60)

Other String Functions (61)

Splitting Strings to Sub-strings (61)

Tool Parameter Functions (62)

Boolean Expressions (63)

Comparisons (64)

Comparing Numeric Expressions (64)

Comparing String Expressions (65)

Comparing Mixed Expressions – Not Recommended (66)

Testing Variable “Set” Status (66)

Complex Boolean Expressions (67)

Program Structure (68)

Declaration Part (68)

New-Line-Is Section (68)

Regular Execution Blocks (69)

System-Defined Blocks and Qualifiers (69)

Declaration Statements (70)

Post Processor Title (70)

Post Processor Protection (70)

FORMAT (71)

INTERACTION (71)

System Interaction Variables (73)

Multi-Choice Interaction Variables (73)

iv

Boolean Interaction Variables (74)

IDENTICAL – not Recommended (74)

MODAL (75)

SET_TABS (76)

ALWAYS_FORMATTED (76)

CONNECTION_SCENARIO (77)

Scenario Actions (78)

Move (78)

Move Up (79)

Move Down (79)

Move to Safe Position (80)

Machine Control (80)

Set UCS (81)

Forcing a Scenario Action (82)

Scenario Examples (82)

Execution Statements (83)

Assignment (83)

IF (84)

IF_SET (86)

IF_EXISTS (86)

REPEAT UNTIL (87)

OUTPUT (87)

Using Expressions in Output (89)

PRINT, PRINT0, PRINT1 to PRINT10 (90)

OUTPUT Redirection (91)

LOAD_FILE (93)

SET_ON and SET_OFF (94)

Sequencing (94)

System Calls (96)

v

GPP_STOP (97)

Advanced Statements for 5X Machines (97)

KEEP (97)

GPP Procedures (98)

Procedure Definition (98)

Parameter and variable Name “Scope” (99)

Procedure Calls (99)

GPP Debugging and Tracing (100)

Trace Execution (100)

Single-Step Execution (102)

Trace G-Code Output (102)

Chapter 3: Blocks, Constants and System Variables .. 103 GPP2 Blocks (103)

GPP2 Constants (107)

General Purpose Constants (107)

Constants for GPP2 Connections (107)

Other Numeric Constants (108)

Constants for 5 Axes Machines (108)

Constants for 5 Axes Post Processing (109)

GPP2 Variable Formats (110)

DF2-Related Variables (111)

Machine Codes (112)

Sequencing (113)

Circular Motions (114)

GPP2 Connections (115)

5 Axes Connections (116)

Inter-Cycle Connections (117)

5 Axes Motions (118)

vi

Miscellaneous (119)

System Flags (119)

Global System variables (122)

Advanced System Variables (123)

Machine Definition Variables (124)

5X Machine Definition (124)

5X Machine – Primary (A) Axis (125)

5X Machine – Secondary (B) Axis (126)

Machine Simulation (128)

Miscellaneous (129)

XML and Report Variables (130)

Toolpath Variables (132)

Block: BEGINNING OF CONNECT (132)

Block: BEGINNING OF PROC (133)

Block: BEGINNING OF SUB (137)

Block: BEGINNING OF TAPE (137)

Block: BEGINNING OF TLPATH (138)

Block: CIRCULAR MOTION (139)

Block: CUTTER COMPENSATION (140)

Block: CYCLE (140)

Block: END OF CONNECT (143)

Block: END OF FILE (143)

Block: END OF PROC (143)

Block: END OF SUB (143)

Block: END OF TAPE (144)

Block: END OF TOOLPATH (144)

Block: INSERT WITH (SEQUENCING) (144)

Block: INSERT WITHOUT (SEQUENCING) (144)

vii

Block: LINEAR MOTION (145)

Block: MACHINE CONTROL (145)

Block: MESSAGE (146)

Block: MOVE TO SAFE (146)

Block: ORIGIN CHANGE (146)

Block: POST SCRIPT (146)

Block: PROC FIRST POINT (147)

Block: RESET AXIS (147)

Block: SET UCS (147)

Block: START PROC (147)

Block: STARTUP (147)

Block: SUBROUTINE CALL (147)

Block: TOOL CHANGE (148)

Chapter 4: 4/5 Axes Post-Processors (151)

Introduction to 5 Axes Post-Processing (151)

Machine Definition (151)

Machine Types (151)

5 Axes Table-Table (TT) (152)

5 Axes Table-Head (TH) (153)

5 Axes Head-Head (HH) (155)

4 Axes Table (156)

4 Axes Head (157)

Defining Machine Axes (157)

Manually-Defined Axes (159)

Machine Definition Command (160)

Machine Geometry (161)

A and B Vectors (161)

Tool Direction Vector (165)

viii

Tool Length Correction (166)

RTCP Settings (166)

Head RTCP (167)

Table RTCP (167)

Full RTCP (M128) (168)

Axis Rotation Types (171)

Continuous Cyclic Axes (171)

Continuous Resettable Axes (172)

Limited Range Axes (173)

Axis Angle Limits (173)

Miscellaneous Settings (173)

Axis Preference (173)

Axis Angle Reversal (174)

Axis Letter (174)

Machine Reconfiguration (174)

Placing the Part on the Machine (176)

5X Toolpath Optimization (177)

Toolpath Segments (177)

Axis Angle Optimization (177)

Any-Angles (178)

5X Linear Motions (178)

5X Connections (180)

The 5X Connection Shape (181)

5X Drill (182)

Managing Advanced 5X Machines (183)

Set Output UCS (183)

Calculating the Work Plane UCS (187)

Virtual Axes Rotation Angles (189)

ix

Incremental Rotations (192)

Setting the Axes Zero Points (192)

Machine Simulation (193)

Machine Simulation Output (193)

The “Safe” Position (193)

Part Position on the Table (194)

Simulation Data Order (194)

Tool Compensation (194)

Toolpath Representation (195)

Chapter 5: Report Customization (197)

GPP2 Reports (197)

Using GPP2 and XML Variables (197)

Selecting the Report Template (198)

Creating Report Templates (198)

Report Header (198)

Report Body (199)

Report Trailer (200)

Debugging Report Templates (200)

XML File Configuration (201)

Many-to-One Mapping (202)

GPP2 Processing of XML Data (203)

x

xi

Chapter 1: Theory of Operation

Introduction to GPP2

This document describes the theory of operation of GPP2 – the second generation of the General Post Processor.

GPP2 is essentially a programming environment that allows the development of post-processors for CimatronE NC. A GPP2 post processor is composed of the following:

? A program file, also known as the EX2 program file (after its extension). This program tells GPP2 how to process each toolpath block it encounters. EX2 programs are written in a special dedicated programming language, which is described in the “GPP2 Language Reference Manual”. The language is tailored and well suited to the task of writing post processors.

?The EX2 program file is compiled to create a DX2 file, which is executed by GPP2.

? A definitions file, also known as the DF2 file. This file contains many definitions that affect how GPP2 interprets and executes the EX2 program file. It allows fine tuning of the output machine code (generally referred to as “G-Code”), the formatting of numbers, the way GPP2 handles various motions, etc. A full description of the DF2 file and its DF2 Editor is provided in a separate document.

GPP2 is similar but not 100% backward-compatible to the old GPP. This was done in order to fix some of the basic flaws in old GPP, mostly related to the reference coordinate system used for post-processing. Trying to maintain backward compatibility would have caused more confusion than bring benefits. The document highlights these differences where applicable.

1

GPP2 Input Files

GPP2 is a separate stand-alone program from CimatronE. In order to get the CimatronE NC toolpath for processing, it works on an intermediary toolpath file (extension .GPP2), which is essentially a dump of the toolpath.

The GPP2 toolpath file is created using old GPP, with a special post-processor (called GPP2) that creates the file according to the format expected by GPP2. The process is shown in the diagram below.

The process of post-processing with GPP2 involves the following steps:

?Creating the toolpath file from within the CimatronE post dialog (selecting the special GPP2 post-processor).

?Running GPP2.

?Loading the toolpath file (created by old GPP) into the GPP2 application.

?Loading a GPP2 post-processor (DX2 and DF2 files) into the GPP2 application.

?Executing the post-processor on the loaded toolpath file.

2

GPP2 Coordinate Systems

There are several coordinate systems being used in GPP2 and in CimatronE NC. Every tool point is always defined relative to a given UCS. It is important to understand the relationship between the UCSs and how the various points relate to each one.

Reference UCS

The reference UCS (REF) is new to GPP2. It defines the reference point and reference axes direction for the whole posting process. All other UCS?s and tool points are defined relative to REF.

The REF UCS must correspond to the “zero” UCS for the machine. The operation of GPP2 assumes that zeroing all machine axes will result in the tooltip positioned at the REF UCS origin, with the tool aligned with the REF UCS Z axis.

The REF UCS is determined by the user at post-time, in the CimatronE PP interaction. Currently, there are several ways to define the REF UCS:

?NC document setup UCS – this is the simplest way, but is also very rigid, since that UCS cannot be modified in an NC document after it is created.

?The first procedure UCS.

?Any UCS selected by the user. This option is available starting with CimatronE version 7.2 patch 4. It should become the major method of specifying the REF UCS.

Note that inside GPP2, there are no EX2 system variables that specify REF. It is simply not required. The REF zero point is, by definition, (0,0,0), and its orientation axes are similarly known: X is (1,0,0), Y is (0,1,0) and Z is (0,0,1). Everything else is measured in reference to this UCS.

Toolpath UCS

The Toolpath UCS (TP UCS) is actually not used in GPP2. It is mentioned here for completeness only.

The only use of the TP UCS is when defining the HOME point. With GPP2, the HOME point is always specified relative to the TP UCS (that takes place in the CimatronE PP interaction). However, the HOME point is immediately translated to the REF coordinate system. For that reason, the TP UCS is not truly relevant inside GPP2.

Note: the TP UCS was also not fully available in old GPP (orientation was not known).

3

Current Procedure ORIGIN UCS

Each procedure has its own UCS, which is fully specified in GPP2, as the ORIGIN UCS. The ORIGIN UCS is defined relative to REF, both in terms of position, and in terms of orientation.

The following system variables describe the procedure Origin UCS:

The orientation of the Y unit vector can be obtained from a vector multiplication of the Z and X vectors (Z * X).

The following diagram shows the REF UCS and an ORIGIN UCS. It shows the ORIGIN zero point, Z axis and X axis, all expressed in the REF coordinate system.

4

5

Output UCS

The “Output UCS” is the UCS used for outputting all toolpath points to the machine. Typically, da ta is output (or “posted”) to the G -code file relative to the REF UCS, which corresponds to the machine UCS.

In some cases, data needs to be output relative to another UCS. A typical example is when a “work plane” is defined for a 5X machine. From that poi nt on, the machine is expecting data expressed in a new work plane UCS. In other words, GPP2 must use a different Output UCS.

GPP2 supports dynamic definition of the Output UCS (from the EX2 program). By default, the Output UCS is simply identical to the REF UCS.

Legacy Coordinate Systems

MACSYS UCS

The MACSYS coordinate system is not used in GPP2, except for the fact that it is the default reference UCS (REF). Therefore, GPP2 does not include any system variables that define MACSYS in any way.

? If MACSYS is used as REF, then it?s data if implicitly known (0,0,0,…)

? If another UCS is used as REF, then MACSYS is simply not used in any way. REF UCS X

Y

Z X Z Y Zero point vector

X_ORIGIN

Y_ORIGIN

Z_ORIGIN ORIGIN UCS

X axis orientation IX_ORIGIN JX_ORIGIN KX_ORIGIN

Z axis orientation

I_ORIGIN

J_ORIGIN

K_ORIGIN An ORIGIN UCS,

expressed in REF

UCS coordinates

6

MODEL UCS

The model UCS is not used in GPP2. It was partly used in old GPP, since its zero point was the true reference position for all tool points.

Since this is not the case in GPP2, and all tool points are fully referred to the REF UCS (orientation and position), the Model UCS is not used.

GPP2 Toolpath Points

Inside CimatronE, the toolpath points are defined relative to each procedure UCS (also known as the procedure origin). GPP2 converts every tool point to the REF coordinate system.

ROT_MAT and TRANS_MAT are not used in GPP2. All conversions between the original procedure UCS and the REF UCS are being taken care of by GPP2.

The following diagram shows a tool point in the REF UCS (showing both position and orientation), as well as the original position vector in the procedure UCS.

REF UCS

vector

(I,J,K) vector inside

Blocks and Qualifiers

GPP2 is a programming environment based on toolpath blocks and execution of specific code in response to each block. The code is defined in the post-processor EX2 file, and is executed when each block is invoked.

Some blocks have optional qualifiers, which may affect the required output. For instance, the “TOOL CHANGE” block has a qualifier called “first”, which is used on the first time the block is called (first tool change).

When GPP2 executes a block with a qualifier, it follows the following algorithm:

?It first looks for a block definition in the EX2 program that includes the specific qualifier (for instance, TOOL CHANGE: first:). If that block is found, the

commands listed in it are executed.

?If such a block does not exist in the EX2 program, GPP2 looks for the same block but without the qualifier (the generic block, for instance, TOOL CHANGE:). If such a block is found, it is executed.

?If no generic block is found, nothing is executed, and GPP2 simply moves on to the next toolpath block.

Therefore, it is important to make the distinction between how a block is invoked (with or without a qualifier) and how it is eventually executed (that depends on the actual structure of the EX2 program). Note: the order of blocks in the program file has no effect on the logic of execution.

There are some important exceptions in the block execution logic described above.

One of them relates to the LINEAR MOTION block. The LINEAR MOTION block has many qualifiers, 2 of them are used for rapid motions –fast: and fastlencomp:. For these qualifiers, GPP2 defines a “two-level hierarchy” for selecting the block to be executed.

?In case the block is invoked with the fastlencomp: and the exact block cannot be found in the program, GPP2 will attempt to execute the block with the fast:

qualifier.

?If a block with the fast: qualifier cannot be found either, GPP2 will attempt to execute the block with no qualifier.

?The two-level hierarchy allows the GPP developer to write a single block LINEAR MOTION: fast:that handles all the “fast” qualifiers. Without that logic, these

blocks (fastlencomp:) would “fall through” to the standard (feed) LINEAR

MOTION block (with no qualifier).

7

A two-level hierarchy is also used with the CYCLE block. If the toinit: qualifier is invoked, and no such block exists, GPP2 will attempt to execute the on: qualifier block before defaulting to the “no qualifier” case.

toinint: → on: → none

With that logic, the GPP developer can write one CYCLE: on: block that handles both qualifiers, toinit and on.

Finally, the CYCLE: off: block does not default to the CYCLE: block, since they really represent different things. In order for a CYCLE “off” block to be executed, the EX2 program must have a CYCLE: off: block defined.

List of Blocks and Qualifiers

The following table lists all GPP2 blocks. A more complete list, with all the qualifiers and their use, is provided in the GPP2 Blocks, Constants and Variables manual.

Non-Supported Old Blocks

Several blocks that were supported in old GPP are no longer supported in GPP2:

?AXIS CHANGE (the number of axes is available at the Beginning of Proc block)

?CONSTANT SPEED (lathe only)

?COOLANT (the coolant data is available at the Beginning of Proc block)

?DWELL

?FEED (the feed data is available at the relevant motion blocks)

?GROOVE CYCLE (lathe only)

8

本文来源:https://www.bwwdw.com/article/xyhl.html

Top