Skip to main content
Skip table of contents

servoj()

Features

The command is the asynchronous motion command, and the next command is executed at the same time the motion begins. When the mode is set to Override mode, it follows the most recent target joint position in a motion within the maximum speed and acceleration among the continuously delivered commands. When the mode is set to Queue mode, it can store up to 100 previous commands and sequentially follow the path. When 100 waypoints have been stored in Queue mode, the command will not return until reaching the next waypoint. If an Override command is input during Queue mode, it ignores the previously stored waypoints and follows the most recent target joint position.

Parameters

Parameter Name

Data Type

Default Value

Description

pos

posj

-

posj or

joint angle list

list (float[6])

vel (v)

float

None

maximum velocity (same to all axes) or

maximum velocity (to an axis) [deg/s]

list (float[6])

acc (a)

float

None

maximum acceleration (same to all axes) or

maximum acceleration (acceleration to an axis) [deg/s2]

list (float[6])

time (t)

float

None

reach time [sec]

modintDR_SERVO_OVERRIDE

Waypoint mode

  • DR_SERVO_OVERRIDE: Recent command
  • DR_SERVO_QUEUE: Queue mode (Keep waypoints)

 

Note

  • Abbreviated parameter names are supported. (v:vel, a:acc, t:time)
  • _global_velj is applied if vel is None. (The initial value of _global_velj is 0.0 and can be set by set_velj.)
  • _global_accj is applied if acc is None. (The initial value of _global_accj is 0.0 and can be set by set_accj.)
  • After time is set, If reach time can’t be keep because of condition of maximum velocity and acceleration, the reach time is adjusted automatically and notice through information message.

Caution

  • Currently, it is not linked with the speed control function of the speed slide bar.
  • Currently, it is not linked with check_motion(), change_operation_speed() functions.

Return

Value

Description

0

Success

Negative value

Error

Exception

Exception

Description

DR_Error (DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error (DR_ERROR_VALUE)

Parameter value is invalid

DR_Error (DR_ERROR_RUNTIME)

C extension module error occurred

DR_Error (DR_ERROR_STOP)

Program terminated forcefully

Example

PY
set_velj(30)
set_accj(60)

Xt=posj(0, 0, 0, 0, 0, 0)
servoj(Xt)

Xt=posj(0, 0, 0, 0, 0, 0)
target = posx(90, 0, 120, -50, 50, -90)
del_t = [3, 0.1, 3, -3, 3, -3]

while 1:
    for i in range(0,6):
        Xt[i] = Xt[i] + del_t[i]    
    
        if del_t[i] > 0:
            if Xt[i] > target[i]:  
                Xt[i] = target[i]
        else:
            if Xt[i] < target[i]:
                Xt[i] = target[i]
            
    servoj(Xt)

Related commands

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.