Помощь - Поиск - Пользователи - Календарь
Полная версия этой страницы: Позиционная Обработка В Solidcam
Все о станках с ЧПУ > Станки с ЧПУ, Hobby CNC > Программное обеспечение
Kemp
Уважаемые форумчане! Уже долгое время пытаюсь написать свой пост на haas vf5 с наклонно поворотным столом, но желаемого результата так и не добился! Деталь- кубик с косыми отверстиями и циковками по всем сторонам!Написал всю обработку-при визуализации на станке оьрабатывает как хотелось бы а в проге полная ерунда!Выдает координаты относительно вспомогательных СК(pos2.pos3...) спозиционировать оси А и В не проблема,а вот координаты x.y.z через shift_ось выразить не получается!!!Создал процедуру пересчета координат-а когда её вызывать и какие углы использовать пока не разобрался!!!Помогите у кого опыт есть!!!
GPP файл поста:
; ; FANUC
; -----
;
@init_post
global string tool_diameter_f
global numeric flag1 flag2 m_feed_flag

; Non GPPL variables
num_user_procs = 1
line_labels = FALSE ; Jump to N...

; GPPL variables
pre_processor = 'HAAS-5A'
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'
apos_f = '5.3'
feed_f = '4.3'
tool_diameter_f = '5.3/1'
blknum_f = '5.0(p)'
blknum_gen = false
blknum_exist = true
blknum = 1
blknum_delta = 1
blknum_max = 100000
trace 'all':5
endp

;-------------------
@tmatrix
endp
;-------------------

@start_of_file
; before tools definition
{'%'}
{nl, 'O0'program_number, ' (', part_name, ')'}
{nl, '( MCV-OP )', ' (',DATE ')'}
blknum_gen = true
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, ')'}
flag2 = 0
endp

;-------------------

@start_program
; after tools definition
{nb, 'G80 G49 G40'}
; call @home_number
endp

;-------------------

@end_program
blknum_gen = FALSE
; {nb, 'M98 P9010'}
{nb, 'M9'}
{nb, 'M5'}
{nb, 'G28 G91 Z0'}
{nb, 'G28 G91 Y0'}
{nb, 'M30'}
endp

;-------------------

@end_of_file
{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
if dely eq 1
{' G64 '}
endif
{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 'G'home_number}
{nb 'END ', loop_level}
endp

;----------------

@def_tool
;;; {nb, '(G10 L12 P', (tool_number), ' R'tool_offset, ')'}
endp

;-------------------

@rapid_move
{nb}
gcode = 0
if change(gcode) then
{'G'gcode}
else
{' '}
endif
{[' X'xpos], [' Y'ypos],[' Z'zpos]}
; if flag1 eq 1
; {' S'spin:'5.0(p)',' M03'}
; {nb, 'M08'}
; endif
; flag1 = 0
endp

;-------------------

@line
call @calc_rotate_x_y
{nb}
gcode = 1
if change(gcode) then
{'G'gcode}
else
{' '}
endif
{[' X'xpos], [' Y'ypos], [' Z'zpos]}
if m_feed_flag eq 1
m_feed_flag = 0
{ ' F'feed}
else
{ [' F'feed]}
endif
endp

;-------------------

@arc
{nb}

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
if arc_plane eq XY then
{' I'xcenter_rel, ' J'ycenter_rel}
endif
if arc_plane eq YZ then
{' J'xcenter_rel, ' K'ycenter_rel}
endif
if arc_plane eq ZX then
{' K'xcenter_rel, ' I'ycenter_rel}
endif
else
if arc_size >= 180 then
radius = -radius
endif
{' R'radius}
endif
if m_feed_flag eq 1
m_feed_flag = 0
{ ' F'feed}
else
{ [' F'feed]}
endif

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 = 10
{nb, 'G'gcode, 'G91 L2 P'home_number ' X'xhome, ' Y'yhome, ' Z'zhome}
{nb,'G90'}
endp

;-------------------

@home_number
gcode = 53 + home_number
{nb, 'G'gcode}
flag2 = 1
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, ' B'angle}

endp

;-------------------
@offset_change
endp
;-------------------
@job_plane
endp
;-------------------

;-------------------
@tool_path_info
endp
;-------------------

;-------------------
@change_tool
if flag2 eq 0
call @home_number
endif
flag2 = 1
local logical save_blknum_gen

; {nb, 'M98 P9011'}
{nb, 'M9'}
{nb, 'M5'}
{nb, 'G91 G28 Z0'}
{nb, 'G90'}

; if tool_number gt 20 and tool_number lt 40
; tool_number = (tool_number - 20)
; endif
; if tool_number gt 40 and tool_number lt 60
; tool_number = (tool_number - 40)
; endif
; if tool_number gt 60 and tool_number lt 80
; tool_number = (tool_number - 60)
; endif

{nb, 'M6 T'tool_number}

{nb, 'M01'}
if tool_type eq 0 then
{nb, '( TOOL -'tool_number, '- DRILL DIA 'tool_diameter, ' MM )'}
endif
if tool_type eq 1 then
{nb, '( TOOL -'tool_number, '- ROUGH DIA 'tool_diameter, ' MM )'}
endif
if tool_type eq 2 then
{nb, '(TOOL -'tool_number, '- MILL DIA 'tool_diameter, ' R'corner_radius,' MM )'}
endif
{nb, 'G90 G00 G40 G'(53 + home_number)}
label = first_user_proc
save_blknum_gen = blknum_gen
gcode = 43
{nb, 'G'gcode, ' H'tool_number, ' D'(tool_number), ' '}
blknum_gen = save_blknum_gen
xpos = xnext
ypos = ynext
zpos = znext
skipline = FALSE
call @rapid_move
tool_direction = CCW
call @start_tool
if colent eq 0
{nb, 'M8'}
endif
if colent eq 17
{nb, 'M17'}
endif
if colent eq 18
{nb, 'M18'}
endif


endp

;-------------------

@message
{nb, '(', message, ')'}
endp

;-------------------

@drill
call @rapid_move

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
if drill_type eq tapping then
{nb,'M3 S'spin:integer_def_f}

endif
{nb,'G98 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
;-------------------
@calc_rotate_x_y
local numeric x y z s_x s_y s_z x1 y1 y2 z1
local logical save_ch_x save_ch_y
; for @line @rapid_move @arc
; Saving the xops and ypos value to local parameters
;s_x = xpos
;s_y = ypos
;s_z = zpos
;rotating the poit X Y Z to the new position.

;x = shift_x_after_rot*cos(dev_angle_z) - shift_y_after_rot*sin(dev_angle_z)
;y = shift_x_after_rot*sin(dev_angle_z) + shift_y_after_rot*cos(dev_angle_z)
;y = y*cos(dev_angle_x) - z*sin(dev_angle_x)
;z = y*sin(dev_angle_x) + z*cos(dev_angle_x)

x=shift_x_after_rot
y=shift_y_after_rot
z=shift_z_after_rot


x1 = x*cos(dev_angle_z) - y*sin(dev_angle_z)
y1 = x*sin(dev_angle_z) + y*cos(dev_angle_z)
y2 = y1*cos(dev_angle_x) - z*sin(dev_angle_x)
z1 = y1*sin(dev_angle_x) + z*cos(dev_angle_x)

;x = xpos*cos(dev_angle_z) - ypos*sin(dev_angle_z)
;y = xpos*sin(dev_angle_z) + ypos*cos(dev_angle_z)
;y = y*cos(dev_angle_x) - z*sin(dev_angle_x)
;z = y*sin(dev_angle_x) + z*cos(dev_angle_x)

shift_x_after_rot=x1
shift_y_after_rot=y2
shift_z_after_rot=z1
{' x'x1}
{' y'y2}
{' z'z1}

xpos=xpos-shift_x_after_rot
ypos=ypos-shift_y_after_rot
zpos=zpos-shift_z_after_rot
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

;--------------------
@home_data
endp
;--------------------
@round_comp
; NOP
endp

;--------------------

@start_of_job

if dely eq 1
{nb, 'G61'}
endif
; flag1 = 1
endp

;--------------------

@end_of_job
; NOP
endp

;--------------------

@assign_axis
; TBD
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


;-------------------

@m_feed_spin
; if tool_direction eq CW then
; mcode = 4
; else ; CCW
; mcode = 3
; endif
; if change(spin)
; {nb,'S'spin:integer_def_f, ' M'mcode}
; endif
m_feed_flag = 1
endp

;-------------------

@stop_tool
; {' M5'}
endp
Kemp
Какова цена вопроса?
Bobr
Цитата(Kemp @ 9.11.2010, 7:28) *
Какова цена вопроса?

Для SolidCAM ваша задача - реальный геморрой!

Возьмите SURFCAM и не мучайтесь, если понадобится помощь с SURFCAM помогу за спасибо ))))
noncompos
Цитата(Bobr @ 10.11.2010, 17:00) *
Для SolidCAM ваша задача - реальный геморрой!

Возьмите SURFCAM и не мучайтесь, если понадобится помощь с SURFCAM помогу за спасибо ))))

К сведению, модуль многоосевой обработки для SolidCAM и SurfCAM поставляет одна и та же контора
http://www.moduleworks.com/company/news-press.asp#13

Следовательно Ваш пост должен звучать так:

"Для меня решить эту задачу в SolidCAM - реальный геморрой. Я могу сделать это в SurfCAM."
Для просмотра полной версии этой страницы, пожалуйста, пройдите по ссылке.
Форум IP.Board © 2001-2024 IPS, Inc.