Frequently Used TurboPost Examples

Cutter Diameter Compensation
Setting Tool Numbers in the Post
Drilling as a Macro
Cycles in the TurboPost
Rotary Table Configuration

Cutter Diameter Compensation

To turn Cutter Diameter Compensation on in the first move of a cutterpath, and shut it off on the last move, go into the output_format file and add the following lines.

compensation switches: force_full left= 41 right= 42 cancel= 40

canned cycle setup:

RAPID: gcode= 0 rapid     std blk= N*G*X*Z  
LINEAR: gcode= 1 feed std blk= N*G*X*Z*F  
FEED: gcode= 1 feed std blk= N*G*X*Z*F  
CIRCLE_CW: gcode= 2 feed std blk= N*G*X*Z*I*K*F  
CIRCLE_CCW: gcode= 3 feed std blk= N*G*X*Z*I*K*F  
ROTARY_POS: gcode= 0     rapid std blk= N*G*X*Y*Z*A  
ROTARY_FEED:   gcode= 1 feed std blk= N*G*X*Y*Z*A*F  
DCOMP_ON: gcode= 1 feed std blk= N*G*g*X*Z*D*F <<<<< ADD THIS
DCOMP_OFF: gcode= 1 feed std blk= N*G*g*X*Z <<<<< ADD THIS

Also go into cut_contour and add the following variable:

FEED: Z= Rap_level- Finish_depth; Feed= Zfeed;
ASSIGN: Feed= Tfeed;
ASSIGN: Dia_comp_mode= 1;   <<<<< ADD THIS
CUTPATH:
ASSIGN: Pathendpt

The variable that Dia_comp_mode uses for the 40,41 or 42 is Comp_dir.    The variable used for the diameter compensation number is Dia_comp.    These variables need to be set in the post.

This is an example of a contour question file setting the Comp_dir variable to either 41 or 42.

# contour_ques

Dia_comp force prompt= "CUTTER DIAMETER COMP #";
Comp_dir force prompt= "CUTTER COMP DIRECTION ( 41 )Left ( 42 )Right";
Rap_level default    prompt= "RAP LEVEL";
Tool_clearance    default prompt= "TOOL CLEARANCE";
Finish_depth force prompt= "FINISH DEPTH";
Zfeed default prompt= "Z FEED RATE";

ASSIGN: Plot_pen= 5; Depth_of_cut= Finish_depth;

By setting Dia_comp_mode to 0,1,2 or 3 you will get these results:

Dia_comp_mode=0; Dia compensation not used.

Dia_comp_mode=1; Dia compensation turned on in the first move of the path, and canceled on the last move of the path.

Dia_comp_mode=2; Dia compensation turned on in the first move of the path, and not canceled.

Dia_comp_mode=3; Dia compensation is canceled on the last move of the path.


[Back to Top]

Setting Tool Numbers in the Post

To get the post to pre-stage the tools you can set the Tool_num variable and the Next_tool variable.    Here is an example of a post that prestages tools.

# startup_ques


Cus_name force prompt= "ENTER THE CUSTOMER NAME";
Prog_desc force prompt= "ENTER THE PROGRAM DESCRIPTION";
Prog_id force prompt= "ENTER THE PROGRAM NUMBER";
Tool_num force prompt= "ENTER THE TOOL NUMBER";
Next_tool force prompt= "ENTER THE NEXT TOOL NUMBER";
ASSIGN: Time2=0;
ASSIGN: Length_comp= Tool_num; Dia_comp= Length_comp

# s_up macro

NOTEPAD.TOOLS:
NOTEPAD.TIME:    Time Analysis for Program {Prog_desc}.
NOTEPAD.TOOLS:   ENTER THE CUSTOMER NAME {Cus_name}
NOTEPAD.TOOLS:   ENTER THE PROGRAM DESCRIPTION {Prog_desc}
NOTEPAD.TIME:
MACRO: cyc_tool_data
OUTPUT: **O000 {Prog_id}
TOOLSYMBOL:
OUTPUT: **(*** T{Tool_num}*** {Tool_desc} ***)
OUTPUT: T{Tool_num}M06
OUTPUT: S{Speed} {Spindle}T{Next_tool}

# tool_ques

ASSIGN: Tool_num= Next_tool;

Next_tool force prompt= "ENTER THE NEXT TOOL_NUM";
Initial_z force prompt= "INITIAL Z LEVEL";
Plot_symbol default prompt= "CHOOSE FIXURE SYMBOL";
Symbol_address default prompt= "STORAGE DEVICE FOR SYMBOL";
Tool_symbol default prompt= "CHOOSE REQUIRED TOOL SYMBOL";

ASSIGN: Length_comp= Tool_num;
ASSIGN: Dia_comp= Tool_num;

# tool_change macro

MACRO: calc_cyc_time
MACRO: cycle_time_out
MACRO: cyc_tool_data
OUTPUT: **G0G91G28Z0.M09
OUTPUT: ** (*** T{Tool_num} *** {Tool_desc} ***)
OUTPUT: T{Tool_num}M06
OUTPUT: S{Speed} {Spindle}T{Next_tool}
TOOLSYMBOL:


[Back to Top]

Drilling as a Macro

The standard post processor uses the drill command as a canned cycle. This means that the only block of code you have control over is the G81 block. If your machine requires you to position to the first hole, turn on the Length_comp, and then do the G81 canned block, you will need to change the canned cycles to macros.

The first thing that you need to do is change the cycles in the user_commands file from canned cycles to macros.

# user_commands


DRILL: pick_type= H     macro    file= drill ques_file= drill_ques
PECK(G83): pick_type= H macro file= peck ques_file= peck_ques
PECK(G73): pick_type= H macro file= peck73    ques_file= peck_ques
COUNTERBORE:     pick_type= H macro file= bore ques_file= bore_ques
TAP: pick_type= H macro file= tap ques_file= tap_ques

Next create a file called drill.    It should look like this.

# drill macro
ASSIGN: Rap_level= Zstart; Finish_depth= Hole_depth;
MACRO: pre_drill   Repeats= (Tl_ch> 0);
DRILL: X= Xstart; Y= Ystart;

The macro pre_drill will look like this.

# pre_drill
OUTPUT: G0X{Xstart}Y{Ystart}S{Speed}M3
OUTPUT: G43Z{Tool_clearance}H{Length_comp}M8
ASSIGN: Tl_ch= 0;

You need to assign the Tl_ch variable to 1 in the user_variables file and in the tool_ques file.

#user_variables

Tl_ch= 1;
S_retract= .1;
Angle_b= 0;
Num_holes= 5;
New_angle= 0;
Part_rotate= 1;
Diameter1= 0;

#tool_ques

ASSIGN: Tool_num= Next_tool;

Next_tool force prompt= "ENTER NEXT TOOL NUMBER";
Plot_symbol default prompt= "CHOOSE FIXURE SYMBOL";
Symbol_address default prompt= "STORAGE DEVICE FOR SYMBOL";
Tool_symbol default prompt= "CHOOSE REQUIRED TOOL SYMBOL";
Sym_size default prompt= "ENTER THE TOOL SYMBOL SIZE";
Tool_on default prompt= "TOOL PLOT ( 1 )ON ( 0 )OFF";
Initial_z default prompt= "INITIAL Z LEVEL";

ASSIGN: Length_comp= Tool_num;
ASSIGN: Tl_ch= 1;


[Back to Top]

Cycles in the TurboPost

STARTUP: Choose this in the beginning of the program.    It will output the codes to start the program and includes the first tool change.

END_CODES: This cycle will output the codes that you need to end the program.

TOOLCH: This cycle will output the codes to perform a tool change.    If you have tools loaded in, the Speed, Feed, Tool_desc, Tool_dia, and Tool_symbol will be taken from the tool.    If no tools are loaded, you will be prompted to answer this information.

ANALYZE_COST: This is a macro that sends cost analysis information to a file called NOTEPAD.COST.

CUT_CONTOUR: This is a cycle to cut a single 2D cutterpath to one specified depth.

MCUT_CONTOUR: Same as above but will take more than one depth of cut.

CUT_PATH_GRP: This cycle will cut the roughing cutter paths to one to one specified depth.    The roughing paths include Follow Pocket, Zig-Zag, and Boundary.

MCUT_PATH_GRP: Same as above but will take more than one depth of cut.

RAMP_CONTOUR: This cycle will cut a roughing cutter path feeding in Z to the start point at a specified maximum ramp angle per inch, or a maximum Z step per inch.

MRAMP_CONTOUR: Same as above but will take more than one depth of cut.

ROUNDCUT: This cycle will mill the outside or the inside of a hole.

ROUND_MCUT: Same as above but will do more than one depth of cut.

SLOT:

CBORE_ROUND:

CUTSURF_UNIDIR: This is a cycle that will cut a 3D cutterpath moving in one direction.

CUTSURF_BIDIR: This is a cycle that will cut a 3D cutterpath bidirectionally.    The variable 3D zig-zag cuts must be set to 1 when creating the cutterpaths.

3D_POCKET: This cycle will cut a 3D pocket.

CLAMP_AVOID: This cycle will rapid to a specified position in Z.

DRILL: Standard G81 canned drilling cycle.

PECK_DRILL: Standard G83 canned peck drilling cycle.

COUNTERBORE: Standard G82 canned boring cycle.

TAP: Standard G84 canned tapping cycle.

BORE(G85): Standard G85 canned boring cycle.

NEW_ZERO: This cycle will shift the origin of a part to a specified location.    Standard G92 origin shift.

RESET_ZERO: This will reset the origin back to the original.

RAPID: This is a command that will rapid to specified locations.

FEED: This is a command that will feed to specified locations.

CUTPATH: This command will cut a 2D cutterpath.

MAN_CODES: Command to output operator information.


[Back to Top]

Rotary Table Configuration

The Synergy horiz_mill is set up for a machine that rotates the B Axis. If you are creating a post processor for a horizontal or a vertical machine need to start from the horiz_mill.

The following sections must be in the output_format file in the post directory.

# ROTARY ANGLE COMPUTATION TYPE

# A   0-360 +CW -CCW
# B 0-360 machine determines shortest distance
# C no range +CW -CCW
# D no range machine determines shortest distance
# E windup +CW -CCW
# F windup machine determines shortest distance
# G incremental        +CW -CCW
# H incremental unsigned

rotary B axis: available on shortest comp_type= A angle_addon= 0.0

A-H are the different ways that the post can rotate the table.    This example is set for type A or 0-360 +CW -CCW.    The comp_type is what needs to be changed for the different methods of rotating the table.    If this is a vertical machine, you need to change the rotary B axis to rotary A axis.

You must also have the ROTARY_POS and ROTARY_FEED commands in the output_format file.


RAPID: gcode= 0     rapid     std blk= N*G*X*Y*Z
RAPID_Z: gcode= 0 rapid std blk= N*G*Z
POSITION_XY: gcode= 0 rapid std blk= N*G*X*Y
LINEAR: gcode= 1 feed std blk= N*G*X*Y*Z*F
FEED: gcode= 1 feed std blk= N*G*X*Y*Z*F
CIRCLE_CW: gcode= 2 feed std blk= N*G*X*Y*Z*I*J*K*F
CIRCLE_CCW: gcode= 3 feed std blk= N*G*X*Y*Z*I*J*K*F
ROTARY_POS: gcode= 0 rapid std blk= N*G*X*Y*Z*A
ROTARY_FEED:           gcode= 1 rapid std blk= N*G*X*Y*Z*A*F

You need to draw the geometry in the correct workplane.    The post will automatically rotate the table to the workplane that you have your geometry drawn in.    Following is an example of the pre_cont_cut macro in the hori_mill post processor:

# macro pre_cont_cut
ASSIGN: Pathstartpt
ROTARY_POS: B= Bstart;
POSITION_XY: X= Xstart; Y= Ystart;
RAPID: Z= Rap_level+ Tool_clearance;

The Pathstartpt command calculates the angle of rotation to the startpoint of the geometry. The Variable that holds this value is called Bstart on a horizontal machine, and Astart for a vertical machine. The ROTARY_POS command will output the angle to the tapecode.


[Back to Top]