speedj (Auto Mode)

It is an asynchronous motion command; the next command is executed as soon as the motion starts. It follows the most recent target joint speed among continuously transmitted commands, within the maximum speed and acceleration set for that command.

This API is valid only in Auto (Run) mode. It is not available in Manual (Teach) mode.

Definition
DRFLEx.h within class CDRFLEx, public section

bool speedj(float fTargetVel[NUM_JOINT],
            float fTargetAcc[NUM_JOINT],
            float fTargetTime)
{
    return _speedj(_rbtCtrl, fTargetVel, fTargetAcc, fTargetTime);
}

Parameter

Parameter Name

Data Type

Default Value

Description

fTargetVel

float[6]

Target joint velocity for six axes [deg/s].

fTargetAcc

float[6]

Joint acceleration [deg/s²].

fTargetTime

float

Command duration [sec]. Automatically adjusted if infeasible. -10000 = not specified; the controller uses its automatic value.

Return

Value

Description

0

Failed

1

Success

Note

Returns false without a message when the robot is in STATE_EMERGENCY_STOP, STATE_SAFE_OFF, STATE_SAFE_OFF2, STATE_SAFE_STOP or STATE_SAFE_STOP2.

A return of true does not confirm that the controller applied the request. Confirm the motion with get_current_posj, get_current_posx or the monitoring data callback.

Example

// Preconditions: Connected, servo ON, Auto mode active

// Define joint velocity and acceleration
float jvel[6] = {10.f, 10.f, 10.f, 10.f, 10.f, 10.f};
float jacc[6] = {20.f, 20.f, 20.f, 20.f, 20.f, 20.f};

// Execute velocity control in joint space
drfl.speedj(jvel, jacc, -10000.f);

Note

  • If fTargetTime is specified but cannot be maintained due to the maximum speed or acceleration condition, it is adjusted automatically and a notification message is displayed.

  • If you want to stop gradually, set fTargetVel = {0,0,0,0,0,0} or call stop().

  • On DRCF v3.0 to v3.3, if no new command arrives within 0.1 s, the motion stops with an alarm. On DRCF v3.4 or later and on v2.12.x, the arm keeps the last target velocity until stop() or a zero-velocity command.

  • speedj is not linked with the operation speed adjustment function change_operation_speed().

  • Recommended for continuous joint velocity control, trajectory following, or real-time motion update loops.