post

2023-6-9

Ucancam Post Processor 



    The Post Processor is a programme which converts the tool path in some standard neutral format into the format requried by a specific machine control system. For example the G code format supported wordwide by many control systems and PLT3D suported by Roland machine.

    Because the wide range of control system on the market, the majority of controls have simple formatting requirments. And therefore UCancam supply a configurable post processor which can be used by customers or agents to create a post proceesor file to support their controls.This configurable post proceesor use an unicode ASCII configration file to specify the output format required. 

    An example of a configuration file is shown on the below:

//////////////////////////// 
FORMAT <X|X%1.3f |1.0> 
FORMAT <Y|Y%1.3f |1.0> 
FORMAT <Z|Z%1.3f |1.0> 
FORMAT <S|S%d |1> 
FORMAT <F|F%d |1> 
UNITS <MM> 
/////// 
FILE_EXTENSION <nc> 
//////////////////////////// 
PROG_HEAD <G90G17G21> 
TOOLCHANGE <M06 T[TN]> 
PROG_TAIL <M30> 

Briefly, the entries in configuration flie fall into four main categories which can be described as below

1. Global Statements


These determine the file extensions, whether the output is in mm or inches.

Line numbering information and formattong for numeric fileds



2. Head of Pogramme


This section deals with line that must be output at the head of every programme.This information usually has the programme name, command for switching on the spindle etc. 

for example:

PROG_HEAD <%:[DATE]:[TIME]>

PROG_HEAD <G90G17G21>

The word suffix “[ ]” is variable.





3. Tail of Pogramm


This section deals with line that must be output at the tailof every programme. This information usually has the programme name, command for switching off the spindle etc, moving the tool back to the home position.

for example :

PROG_TAIL <M30>

PROG_TAIL <%>



4. TOOLCHANGE


If the machine tool is equiped with an automatic toolchanger, or user wants to allow manual tool changes through an output file.this statement can be used to ouput the appropriate commans.

For example:

TOOLCHANGE <M05>

TOOLCHANGE <M06 T[TN]>

(TN: current tool number)



The schema of configuration file is : KEY WORD < description/value>

First word in the line is key word that is defined by Ucancam like as UNITS.

These in the brackets contain the description for command or values. For example : UNITS <MM>. To define the output is in milimeter.



The key word in Ucancam include two type:the one is to deinfe the commands.

The other is variable that is referenced in post processor file with prefix “[ ]”

The following is the key word for commands

KEY WORD
Specification
FORMAT
define the formatting for numeric fields
PROG_HEAD
Head of program
PROG_TAIL
Tail of program
TOOLCHANGE
Tool change command
G00_DEF
Command name for rapid moving
G01_DEF
Command name for line cut
G02_DEF
Command name for CW arc cut
G03_DEF
Command name for CCW arc cut
G04_DEF
Command name for pause
DWELL_DEF
Commands for pause statement.
FIRST_ G00_MOVE_DEF
Commands for the first rapid move
G00_MOVE_DEF
Commands for rapid moves 
FIRST_ G01_MOVE_DEF
Commands for the first feed rate move
G01_MOVE_DEF
Commands for feed rate move
FIRST_ G02_MOVE_DEF
Commands for the first clockwise arc move
G02_MOVE_DEF
Commands for clockwise arc moves
FIRST_ G03_MOVE_DEF
Commands for the first counter-clockwise arc move
G03_MOVE_DEF
Commands for counter-clockwise arc move
G20_DEF
command name for inch unit 
G21_DEF
command name for mm unit
SPN_CW
command name for spindle CW rotation
FILE_EXTENSION
File extension name
UNITS
Unit for length
XYZ_SEQ
Sequence for XYZ
LINE_NUM_START
The start line number
LINE_NUM_INCREMENT
Line number increment
LINE_NUM_MAXIMUM Maximum value for line number
OMIT_SAME_GCODE
Omit the same G code
OMIT_SAME_XYZ Omit the same XYZ value
RAPID_ XY_Z Sequency for rapid moving
ARC_TO_LINES  Convert arc to lines
END_OF_LINE
The string at the end of line
DRILL_CYC Drill cycle
THREAD_CYC
Thread cycle



The following is the key word for variable


KEY WORD
Specification
DATE
Date of create file
TIME
Time of create file
FILENAME
File name
TOOLPATHNAME
Toolpath type name
XSIZE
Toolpath size for x axis
YSIZE
Toolpath size for y axis
ZSIZE
Toolpath size for z axis
XMIN
Toolpath minimum value for x axis
YMIN
Toolpath minimum value for y axis
ZMIN
Toolpath minimum value for z axis
XMAX
Toolpath maximum value for x axis
YMAX
Toolpath maximum value for y axis
ZMAX
Toolpath maximum value for z axis
WK_XSIZE
Length of material in X.
WK_YSIZE
Length of material in Y.
WK_XMIN
Minimum value of material in X.
WK_YMIN
Minimum value of material in Y.
WK_XMAX
Maximum value of material in X.
WK_YMAX
Maximum value of material in Y.
X
Current x position
Y Current y position
Z Current Z position
I
Arc center in X Axis (relative to start X,Y position). 
J Arc center in Y Axis (relative to start X,Y position). 
K Arc center in Z Axis (relative to start X,Y position). 
IA
Arc center in X Axis (absolute coordinates)
JA
Arc center in Y Axis (absolute coordinates)
KA
Arc center in Z Axis (absolute coordinates)
IE
Arc centre in X Axis (relative to end X,Y position). 
JE
Arc centre in Y Axis (relative to end X,Y position). 
KE
Arc centre in Z Axis (relative to end X,Y position). 
LN
Line number
TN
Tool number
TOOL_DESC
Tool description 
FC
Feedrate for cut
FP
Feedrate for plunge
FR
Feedrate for rapid moving 
SPN_SPEED
Spindle rotation speed
SAFE_ZPOS
Safe height
DRILL_DZ
Driill maximum depth
DRILL_RZ
Driill retract depth
DRILL_QZ
Drill depth per cycle



FORMAT 

Output firmat for Variable in UCancam include :

FORMAT <N|N%d >

FORMAT <X|X%1.3f |1.0>

FORMAT <Y|Y%1.3f |1.0>

FORMAT <Z|Z%1.3f |1.0>

FORMAT <S|S%d |1>

FORMAT <F|F%d |1>

FORMAT <I|I%1.3f |1.0>

FORMAT <J|J%1.3f |1.0>

FORMAT <K|K%1.3f |1.0>

FORMAT <R|R%1.3f |1.0>

FORMAT <A|A%1.3f |1.0>



The field in brackets are separated as three parts by character “|” .eg: 

FORMAT <X|X%1.3f |1.0>, the first part is Key character of Ucancam , “X” mean the current format is for x coordinate. Ucancam key characters of format include : N X Y Z S F I J K R A. 

N: line number.

X: x cordinate

Y: y cordinate

Z: z cordinate

S: spindle rotation speed

F: spindle feedrate

I: arc x increment value

J: arc y increment value

K: arc z increment value

R: arc radius

A; angle for rotation axis 



The second part is the string to print before value when output。 %1.3f is format string to control the number of decimal places leading zero etc. “1” is number that specifies minimum number of characters output. “3” is the precision specification value that specifies maximum number of characters printed for all or part of the output field


5.G00_DEF、G01_DEF、G02_DEF、G03_DEF、G04_DEF、G20_DEF、G21_DEF


Define the command string name that repace for ISO G Code G00 ,G01, G02, G03, G04, G20, G21. 

Eg: G00_DEF <G172>



6. Arc command


1)ARC_TO_LINES <1>

Possible value: 1 or 0 

Convert the arc to lines. 

Default: 0



2)The format of arc output, Expressed as R.

FORMAT <R|R%1.3f |1.0>



3)The format of arc output, Expressed as I、J、K(Arc centre in X Axis, relative to start X,Y position).

FORMAT <I|I%1.3f |1.0>

FORMAT <J|J%1.3f |1.0>

FORMAT <K|K%1.3f |1.0>



4)The format of arc output, Expressed as IA、JA、KA(absolute coordinates)





5)The format of arc output, Expressed as IE、JE、KE(Arc centre in X Axis, relative to end X,Y position).





Default: R format 



7. FIRST_ G00_MOVE_DEF 


Commands output for first rapid move.

Commands that are output when the very first rapid move is made. A Section not used for most posts, but useful if the very first rapid move, needs to output different information to subsequent rapid moves. 

This section is sometimes required for HPGL variants



G00_MOVE_DEF 

Commands output for rapid moves.

Commands that are output when rapid moves are required.



8.FIRST_G01_MOVE_DEF 


Commands output for first feed rate moves. 

This section is commonly used where controllers require that the Feed Rate is set at the first feed move, this rate would then be used for subsequent cut moves. 



G01_MOVE_DEF 

Commands output for feed rate moves 

Used to output information required at every move, or all feed moves except for the First Feed Move, if a FIRST_FEED_MOVE section is present within the post processor



9.FIRST_G02_MOVE_DEF 


Commands output for the first clockwise arc move 

Similar to the FIRST_G01_MOVE_DEF section, but for clockwise arc segments. This section is commonly used where controllers require that the Feed Rate is set for the first arc segment, this rate would then be used for subsequent arc moves in the same direction. 



G02_MOVE_DEF

Commands output for clockwise arc moves.

Similar to the G01_MOVE_DEF section, but for clockwise arc segments. 



10.FIRST_G03_MOVE_DEF 


Commands output for the first counter-clockwise arc move.

Similar to the FIRST_G01_MOVE_DEF section, but for counter-clockwise arc segments. This section is commonly used where controllers require that the Feed Rate is set for the first arc segment, this rate would then be used for subsequent arc moves in the same direction. 



G03_MOVE_DEF 

Commands output for counter-clockwise arc moves.

Similar to the G01_MOVE_DEF section, but for counter-clockwise arc segments. 



11. DWELL_DEF 


Commamds for pause statement.

If not set this statement, Default:G04 Xtime

Eg: G04 X2.000 the pause time when drilling at the bottom is 2 seconds.





12.line numbering 


FORMAT <N|N%d > 

There are two meanings: 

(1) output the line number.if not set this statement, ucancam do not output line number. 

(2) Set the format of line number



LINE_NUM_START <1> 

Start line number

Default: 1



LINE_NUM_INCREMENT <1> 

Increment line number

Default: 1



13.UNITS 


Possible value: MM or INCH

MM: All position in mm, feed in mm/min

INCH: All position in inches, feed in inches/min



14.FILE_EXTENSION 


Defines the file extension that is used for files created with toolpath output.



15.Rotary_AXIS 


This is used only in post processor which are used to drive a machine using rotary axis.

Possible value: X or Y

Either the X oy Y coordinate is mapped to rotary axis.



If this staement is present , Ucancam will display the dialog which show the 

Diameter of rotary axis, the default value for diameter is assume that complete the length of toolpath along the axis being wrapped is the circumference of the cylinder.



16.OMIT_SAME_GCODE 


Possible value: 1 or 0

Omit the following same G code in output file .

Default: 0.



Eg: G01 x010.000 Y 20.000 Z0.000

G01 x010.000 Y 20.000 Z-5.000



if set the statement : OMIT_SAME_GCODE <1>

the ouput is :

G01 x010.000 Y 20.000 Z0.000

x010.000 Y 20.000 Z-5.000



17.OMIT_SAME_XYZ 


OMIT_SAME_XYZ <1> 

Possible value: 1 or 0.

Omit the folowing same xyz coordinate.

Default: 0.



Eg: G01 x010.000 Y 20.000 Z0.000

G01 x010.000 Y 20.000 Z-5.000



if set the statement : OMIT_SAME_XYZ <1>

the ouput is :

G01 x010.000 Y 20.000 Z0.000

G01 Z-5.000



18.RAPID_XY_Z 


Possible value: 1 or 0

If set the statement : RAPID_XY_Z <1> , the rapid move of tool from

PointA(0,0,10) to point pointB(100,50,0) isseperated I n two part, firstly from pointA(0,0,10) to midpoint(100,50,10), second ly from midpoint(100,50,10) to pointB(100,50,0).



19.XYZ_SEQ


Possible value: XYZ, XZY, YXZ, YZX, ZXY, ZYX.

This statement specifies the sequence of point coordinate is printed out .



20.END_OF_LINE


This statement specifies the character ouput at the end of line.

Default: none.



21.XSIZE、YSIZE、ZSIZE 


The size of The toolpath in x axis, y axis, z axis.



22.XMIN、YMIN、ZMIN、XMAX、YMAX、ZMAX


The minimum and maximun value of the toolpath



23.X、Y、Z


Current tool point coordiant



24.SPN_SPEED


Spindle rotation speed.



25.FC 


Tool feedrate for cutting



26.FR 


Tool feedrate for rapid moving.



27.SAFE_ZPOS

   Safe height.

28.DRILL_CYC

    Drill cycle

28.THREAD_CYC

   Thread cycle:

THREAD_CYC <M29>
THREAD_CYC <G99 G84 Z[DRILL_ZPOS] R[DRILL_RPOS] Q[DRILL_QZ]>
THREAD_CYC <G80>



The following is example of pots processor file: 

Eg1:general CNC

//line number

//FORMAT <N|N%d >

///////////////////

FORMAT <X|X%1.3f >

FORMAT <Y|Y%1.3f |1.0>

FORMAT <Z|Z%1.3f |1.0>

FORMAT <S|S%d |1>

FORMAT <F|F%d |1>

//////////////////////////////

UNITS <MM>

/////////////////////////////////

FILE_EXTENSION <nc>

/////////////////////////////////

LINE_NUM_START <1>

LINE_NUM_INCREMENT <1>

/////////////////////////////////

PROG_HEAD <G90G17G21>



TOOLCHANGE <M05>

TOOLCHANGE <M06 T[TN]>

PROG_TAIL <M30>


Eg2:HP_PLT3D

//precision = 0.025, 1/0.025=40 

FORMAT <X|%1.0f, |40.0>

FORMAT <Y|%1.0f, |40.0>

FORMAT <Z|%1.0f |40.0>

///////////////////////////////////

UNITS <MM>

//convert arc into lines

ARC_TO_LINES <1>

RAPID_XY_Z <0>

END_OF_LINE <;>

///////////////////////////////////

FILE_EXTENSION <plt>

//////////////////////////////////

PROG_HEAD <IN;>

PROG_HEAD <SP1>



G00_DEF <PU>

G01_DEF <PD>



TOOLCHANGE <SP[TN]>



PROG_TAIL <SP0>



Previous:This is the latest article