Някои знае ли как да дефинирам постпроцесор на Fanuc за 3 axis machine
Преглед за печат
Някои знае ли как да дефинирам постпроцесор на Fanuc за 3 axis machine
Погледни и ТоваКод:; FANUC
@pre_processor
;
;Internal parms
;
machine_type = MILLING
post_processor = fanuc
doc_processor = fanuc
gpp_file_ext = TAP
mac_holder = holder
tool_table_name = table
max_g_name_length = 0
max_tool_numbers = 1000
default_lang = DEFAULT
;
;Machine Initialize
;
machine_plane = XY
z_with_xy = Y
mac_axes = XYZ
num_axes = 4
num_simult_axes = 4
abs_coord = N
rotate = Y
mirror = Y
variables = Y
loops = Y
_4th_axes_around = X
first_rotation_angle = Z
_5th_axes_around =
;
;Program numbers
;
prog_num_min = 5000
prog_num_max = 8999
prog_num_dflt = 5000
get_prog_num = Y
proc_num_min = 1
proc_num_max = 8999
proc_num_dflt = 1
get_proc_num = Y
;
;Procedures control
;
full_gcode = N
gen_procs = N
drill_proc = N
turn_proc = Y
thread_proc = Y
gen_internal_proc = N
turn_common_proc = Y
gen_1_line_proc = Y
optimize_jobs_loop = Y
G_in_2_cols = Y
seq_sub_number = N
loop_exist = Y
same_sub_numbers = N
init_var_after_split = Y
;
;Home
;
num_homes = 6
dflt_home = 1
get_job_home = N
abs_zero_chng = Y
home_data_at_start = N
;
;Positioning
;
dflt_start = 0.0000 200.0000 100.0000, 0.0000 7.8740 3.9370
dflt_end = 0.0000 200.0000 0.0000, 0.0000 7.8740 0.0000
set_xy_chng = N N
set_z_chng = Y N
dflt_tool_chng = 0.0000 0.0000 0.0000, 0.0000 0.0000 0.0000
;
;Compensation
;
comp_exist = Y
comp_arc_arc = Y
comp_arc_line = Y
comp_line_line = Y
next_angle = N
comp_x_start = N
comp_by_arcs = N
chng_tool_table = N
look_forward = 2
delta_for_TOOL_H = 50
comp_by_zero_tool = N
;
;Arc definitions
;
arc_exist = Y
arc_3d = Y
arc_quadrants = N
arc_gt_180 = Y
arc_max_chord = 30.0000, 1.1811
arc_max_angle = 10.0000
arc_max_radius = 2000.0000, 78.7402
arc_min_length = 0.0000, 0.0000
arc_zx_yz = N
;
;Epsilon values
;
eps_angle = 0.0020, 0.0001
eps_line = 0.0010, 0.0000
zero_value = 0.0010, 0.0000
movement_precision = 0.0010, 0.0000
min_delt_arc_rad = 0.0100, 0.0004
safety_dist = 2.0000, 0.0787
;
;Feed-Spin
;
rapid_feed = 5000.0000, 196.8503
max_spin = 6000.0000
max_feed = 6000.0000, 236.2205
spin_direction = CW
;
;Timing
;
time_factor = 1.0000
block_time = 0.2000
change_tool_time = 15.0000
;
;Part options
;
options = COLENT INTEGER
;
;Job options
;
job_opt_type = OPT1 Y DELY FEAD
;
;Drill cycles
;
drill_type = Drilling Drilling Y
drill_type = F_Drill F_Drill Y Delay
drill_type = Peck Peck Y Delay
drill_type = Tapping Tapping Y
drill_type = Boring Boring Y Delay
drill_type = R_Boring R_Boring Y Delay
drill_type = F_Boring F_Boring Y Delay
;
;Fourth axis
;
indexial_4th_axis = N
indexial_increment = 0.0000, 0.0000
init_cpos = Y
polar_4x = N
cartez_4x = N
set_dir = N
fourth_axis_letter = C
;
;Sim Five axis
;
kinematic_type = HEAD_HEAD
spindle_direction = 0.0000 0.0000 1.0000
rotate_axis_dir1 = 0.0000 0.0000 -1.0000
rotate_axis_dir2 = 0.0000 -1.0000 0.0000
rot_axis_base_pnt1 = 0.0000 0.0000 0.0000, 0.0000 0.0000 0.0000
rot_axis_base_pnt2 = 0.0000 0.0000 0.0000, 0.0000 0.0000 0.0000
abs_machine_coord = N
pivot_length = 0.0000, 0.0000
first_rot_axis_name = C
second_rot_axis_name = B
machine_simulation = HeadHead
rot_axis_min_limit0 = -100000.0000
rot_axis_min_limit1 = -100000.0000
rot_axis_max_limit0 = 100000.0000
rot_axis_max_limit1 = 100000.0000
auto_angle_pair = Y
other_angle_pair = Y
angle_change_limit = 30.0000
interplat_angle_step = 3.0000
interplat_for_dist = N
interplat_distance = 5.0000, 0.1969
retract_distance = 100.0000, 3.9370
center_rot_mac_num = 20
min_inverse_feed = 100.0000, 3.9370
enable_mx_edit = N
;
endp
Post-Processor file: [fanuc.gpp]
; FANUC
@init_post
global string tool_diameter_f
num_user_procs = 1
numeric_def_f = '5.3'
integer_def_f = '5.0(p)'
gcode_f = '2.0(p)'
mcode_f = '2.0(p)'
xpos_f = '5.3'
ypos_f = '5.3'
zpos_f = '5.3'
feed_f = '4.3(p)'
tool_diameter_f = '5.3/1'
blknum_f = '5.0(p)'
blknum_gen = FALSE
blknum_exist = TRUE
blknum = 5
blknum_delta = 5
blknum_max = 32000
endp
;-------------------
@start_of_file
; before tools definition
{'%'}
{nl, 'O'program_number, ' (', g_file_name, ')'}
if rotate_used then
gcode = 69
{nb, 'G'gcode}
endif
if mirror_used then
{nb, 'G50.1 X0 Y0'}
endif
{nb, '(SUBROUTINES: O'first_proc_number, ' .. O'last_proc_number, ')'}
endp
;-------------------
@start_program
; after tools definition
{nb, 'G80 G49 G40'}
call @home_number
endp
;-------------------
@end_program
{nb, 'M9'}
call @rapid_move
{nb, 'M30'}
endp
;-------------------
@end_of_file
label = first_user_proc
call @proc
{nb, '(--------------------)'}
{nb, '(- CHANGE TOOL -)'}
{nb, '(--------------------)'}
{nb, 'G80 G49 G40 M9'}
{nb, 'G91 G28 Z0.'}
call @stop_tool
{nb, 'G90 M1'}
{nb, 'M6'}
call @end_proc
{nl, '%'}
endp
;-------------------
@relative_mode
gcode = 91
{nb, 'G'gcode, ' '}
skipline = FALSE
endp
;-------------------
@absolute_mode
gcode = 90
{nb, 'G'gcode, ' '}
skipline = FALSE
endp
;-------------------
@machine_plane
if machine_plane eq XY
gcode = 17
endif
if machine_plane eq YZ
gcode = 18
endif
if machine_plane eq ZX
gcode = 19
endif
{nb, 'G'gcode}
endp
;-------------------
@call_proc
if active(parm1) then
gcode = 65
{nb, 'G'gcode, ' P'label}
{' A'parm1, [' B'parm2], [' C'parm3]}
else
{nb, 'M98 P'label}
endif
if proc_count gt 1 then
{' L'proc_count}
endif
{[' ('message, ')']}
endp
;-------------------
@proc
{nl, 'O'label}
endp
;-------------------
@end_proc
{nb, 'M99'}
endp
;----------------
@loop
local integer var_num
var_num = loop_level + 20
{nb, '#', var_num, ' = 0'}
{nb, 'WHILE [#', var_num, ' LT ', loop_count, '] DO ', loop_level}
endp
;----------------
@end_loop
local integer var_num
var_num = loop_level + 20
{nb '#', var_num, ' = #', var_num, ' + 1'}
{nb 'END ', loop_level}
endp
;----------------
@def_tool
{nb, '(G10 L12 P', (tool_number+50), ' R'tool_offset, ')'}
endp
;-------------------
@rapid_move
{nb}
gcode = 0
if change(gcode) then
{'G'gcode}
else
{' '}
endif
{[' X'xpos], [' Y'ypos], [' Z'zpos]}
endp
;-------------------
@line
{nb}
gcode = 1
if change(gcode) then
{'G'gcode}
else
{' '}
endif
{[' X'xpos], [' Y'ypos], [' Z'zpos], [' F'feed]}
endp
;-------------------
@arc
if arc_direction eq CCW then
gcode = 3
else ; CW
gcode = 2
endif
if change(gcode) then
{'G'gcode}
else
{' '}
endif
{[' X'xpos] [' Y'ypos] [' Z'zpos]}
if arc_size eq 360 then
else
if arc_size >= 180 then
radius = -radius
endif
{' R'radius}
endif
{[' F'feed]}
endp
;-------------------
@compensation
if side eq COMP_LEFT then
gcode = 41
endif
if side eq COMP_RIGHT then
gcode = 42
endif
if side eq COMP_OFF then
gcode = 40
endif
{nb, 'G'gcode, ' '}
skipline = FALSE
endp
;-------------------
@delay
gcode = 4
{nb 'G'gcode, ' P'delay_period:integer_def_f}
endp
;-------------------
@change_ref_point
; Given in absolute mode
gcode = 92
{nb, 'G'gcode, ' X'xhome, ' Y'yhome, ' Z'zhome}
endp
;-------------------
@home_number
gcode = 53 + home_number
{nb, 'G'gcode}
endp
;-------------------
@rotate
; Not exist in FANUC 6M
if rotate_cancel then
gcode = 69
{nb, 'G'gcode}
else
gcode = 68
{nb, 'G'gcode, ' X0 Y0 G91 R'angle}
{nb, 'G90'}
endif
endp
;-------------------
@fourth_axis
gcode = 0
{nb, 'G'gcode, ' A'angle}
endp
;-------------------
@change_tool
local logical save_blknum_gen
{nb, '(*TOOL 'tool_number, ' - DIA 'tool_diameter, '*)'}
{nb, 'T'tool_number}
label = first_user_proc
call @call_simple_proc
save_blknum_gen = blknum_gen
blknum_gen = true ; gen block number for next block
gcode = 43
{nb, 'G'gcode, ' H'tool_number, ' D'(tool_number+50), ' '}
blknum_gen = save_blknum_gen
xpos = xnext
ypos = ynext
zpos = znext
skipline = FALSE
call @rapid_move
tool_direction = CCW
call @start_tool
{nb, 'M8'}
endp
;-------------------
@message
{nb, '(', message, ')'}
endp
;-------------------
@drill
call @rapid_move
gcode = 98
{nb, 'G'gcode, ' '}
if drill_type eq drilling then
gcode = 81
endif
if drill_type eq f_drill then
gcode = 82
endif
if drill_type eq peck then
gcode = 83
endif
if drill_type eq tapping then
gcode = 84
endif
if drill_type eq boring then
gcode = 85
endif
if drill_type eq r_boring then
gcode = 86
endif
if drill_type eq f_boring then
gcode = 89
endif
{'G'gcode, ' Z'drill_lower_z, ' R'drill_upper_z}
if drill_type eq peck then
{' Q'down_step}
endif
if drill_type eq f_drill or drill_type eq tapping then
{' P'delay:integer_def_f}
endif
{' F'feed}
endp
;-------------------
@drill_point
if not first_drill then
{nb, ' ', [' X'xpos], [' Y'ypos], [' Z'zpos]}
endif
endp
;-------------------
@mirror
if mirror_type eq MIRROR_OFF then
{nb, 'G50.1 X0 Y0'}
else
{nb, 'G51.1 '}
if mirror_type eq MIRROR_X then
{'X1 Y0'}
endif
if mirror_type eq MIRROR_Y then
{'X0 Y1'}
endif
if mirror_type eq MIRROR_XY then
{'X1 Y1'}
endif
endif
endp
;-------------------
@end_drill
gcode = 80
{nb, 'G'gcode}
endp
;-------------------
@halt_program
{' M0'}
endp
;--------------------
@start_of_job
; NOP
endp
;--------------------
@end_of_job
; NOP
endp
; =======================
; USER DEFINED PROCEDURES
; =======================
@call_simple_proc
active(message) = FALSE
active(parm1) = FALSE
active(parm2) = FALSE
active(parm3) = FALSE
proc_count = 1
call @call_proc
endp
;-------------------
@start_tool
if tool_direction eq CW then
mcode = 4
else ; CCW
mcode = 3
endif
{' S'spin:integer_def_f, ' M'mcode}
endp
;-------------------
@stop_tool
{' M5'}
endp