3.7.1 3.7.0 3.6.0 3.5.0 3.4.0 3.3.0 3.2.2 3.2.1 3.2.0 Korean English Chinese Czech Dutch French German Hungarian Italian Japanese Polish Portuguese Spanish
3.7.1 3.7.0 3.6.0 3.5.0 3.4.0 3.3.0 3.2.2 3.2.1 3.2.0 Korean English Chinese Czech Dutch French German Hungarian Italian Japanese Polish Portuguese Spanish

alter_motion()

정의

alter_motion(pos)

기능

입력 인자 pos에 해당하는 양만큼 경로 수정을 진행합니다.

주의

  • alter_motion()은 사용자 thread 내에서만 동작합니다.

  • alter_motion()은 posx의 orientation type이 None인 경우, DR_FIX_XYZ로 설정됩니다.

알아두기

  • alter_motion()은 enable_alter_motion()을 통해 경로보정기능이 활성화된 경우에만 유효합니다.

  • enable_alter_motion의 설정 값 limit_dPOS, limit_dPOS_per에 따라 경로 수정량은 조정될 수 있습니다.

  • alter_motion()은 SW 버전 V3.4부터 pos를 posx()로 입력하면 다양한 Orientation type을 지원하며, list(float[6]) 형식으로 입력하는 경우, Fixed XYZ로 동작합니다.

인수

인수명

자료형

기본값

설명

pos

list (float[6])

posx

-

position list

posx (if ori_type is None, then ori_type is DR_FIX_XYZ)

예외

예외

설명

DR_Error (DR_ERROR_TYPE)

인수들의 데이터형 오류 시

DR_Error (DR_ERROR_VALUE)

인수의 값이 유효하지 않을 시

DR_Error (DR_ERROR_RUNTIME)

C Extension 모듈 에러 발생 시

DR_Error (DR_ERROR_STOP)

프로그램 강제 종료 시

예제

Python
def alter_thread():
    global dir_a, wait_time
    alter_motion(dX) #dX : amount of alter motion

    if dX[0] > 9.9:
        dir_a = -10
    elif dX[0] < -9.9:
        dir_a = 10

    dX[0] = dX[0] + dir_a
    dX[3] = dX[3] + dir_a

    wait(wait_time)

dX = [10,0,0,10,0,0]

# V3.4 버전부터는 posx()의 ori_type을 설정함에 따라 다양한 Orientation 타입을 지원합니다:
# dX = posx([10, 0, 0, 0, 0, 10], ori_type=DR_ELR_ZYZ, sol=None, turn=None)

J00 = posj(30,45,45,0,90,0)
movej(J00,vel=100,acc=100)

X1,sol = get_current_posx(DR_BASE)

J01 = posj(-30,45, 45,0,90,0)
movej(J01,vel=100,acc=100)

X2,sol = get_current_posx(DR_BASE)

# Alter motion is executed during the cycle time
cycle_time = 0.6

n_period = int(cycle_time * 1000 / 50)
wait_time = cycle_time

# 경로 수정 기능 활성화
# 생성주기:(n_period * 10)msec, 모드:누적량, 기준좌표계:베이스
# 누적량 제한:50mm, 90deg, 증분량 제한:60mm, 60deg
# alter motion 이동량에 비해 cycle time이 너무 짧은 경우 Limit 알람이 발생할 수 있습니다.
enable_alter_motion(n=n_period,mode=DR_DPOS, ref=DR_BASE, limit_dPOS=[50,90], limit_dPOS_per=[60,60])

th_id = thread_run(alter_thread, loop=True)

movel(pos=X1,vel=10,acc=100)
movel(pos=X2,vel=10,acc=100)

thread_stop(th_id)
disable_alter_motion() # 경로 수정 기능 비활성화

관련 명령어

Keyword

alter / motion / alter_