.app_weld_adj_motion_offset(offset=[0.0, 0.0])
기능
용접 seem traking 기능 동작시 일정한 X좌표로 움직인다고 할 때, 실시간으로 각각 Y좌표, Z좌표의 offset (float) 값을 전달 받아 moving 제어
인수
인수명 | 자료형 | 기본값 | 설명 |
---|---|---|---|
offset | float[2] | 0.0, 0.0 | offset[0]: Y좌표 offset offset[1]: Z좌표 offset |
리턴
값 | 설명 |
---|---|
0 | 설정 성공 |
음수값 | 설정 실패 |
예외
예외 | 설명 |
---|---|
DR_Error (DR_ERROR_TYPE) | 인수들의 데이터형 오류 시 |
DR_Error (DR_ERROR_VALUE) | 인수의 값이 유효하지 않을 시 |
DR_Error (DR_ERROR_RUNTIME) | C Extension 모듈 에러 발생 시 |
DR_Error (DR_ERROR_STOP) | 프로그램 강제 종료 시 |
예제
def arc_sensing_model(left, right, time):
## Edit your own seam tracking algorithm in this function
# This example is assumed as below
# 1. Seam tracking algorithm is in welding machine
# 2. Use digital IO communication between robot controller and welding machine
if left == 1:
set_digital_output(15, ON)
elif left == 0:
set_digital_output(15, OFF)
if right == 1:
set_digital_output(16, ON)
elif right == 0:
set_digital_output(16, OFF)
y_offset = 0
z_offset = 0
if get_digital_input(9) == OFF:
y_offset = 10
z_offset = 0
if get_digital_input(10) == ON:
y_offset = -10
z_offset = 0
if get_digital_input(11) == ON:
y_offset = 0
z_offset = 10
if get_digital_input(12) == ON:
y_offset = 0
z_offset = -10
offset=[y_offset, z_offset]
return offset
def seam_tracking():
Vt, Ct, Ft, velt, Vm, Cm, Off, Dout, status = app_weld_get_welding_cond_analog()
if status == 99:
left, right = app_weld_get_extreme_point(time=90)
offset=arc_sensing_model(left, right, time)
app_weld_adj_motion_offset(offset)
set_velj(30)
set_accj(60)
set_velx(30)
set_accx(30)
movej(posj(0,0,90,0,90,0))
app_weld_enable_analog(ch_v_out=[0,0], spec_v_out=[0,0,0,0], ch_f_out =[0,0],
spec_f_out =[0,0,0,0], ch_v_in =[0,0], spec_v_in =[0,0,0,0], ch_c_in =[0,0],
spec_c_in=[0,0,0,0], ch_arc_on=0, ch_gas_on=0, ch_inching_fwd=0, ch_inching_bwd=0, ch_blow_out=0)
th_id = thread_run(seam_tracking, loop=True) #Activate Saem Tracking Function
app_weld_set_weld_cond_analog(flag_dry_run=1, v_target=0, f_target=0, vel_target=10, vel_min=0,
vel_max=100, weld_proc_param=[0,0,0,0,0,0,0,0,0])
app_weld_weave_cond_zigzag(wv_offset=[-10,0], wv_ang=0, wv_param=[10,1])
# zigzag weaving pattern, offset=0,0 tilt angle=0, weaving width=10(mm), weaving period=0.5(sec)
app_weld_adj_welding_cond_analog(flag_reset=1)
movel(posx(619.50, -50, 982.80, 0, -180, 0), app_type=DR_MV_APP_WELD)
thread_stop(th_id) #Deactivate Seam Tracking Function
app_weld_disable_analog()