How to use force control on a Doosan robot from DRL

Based on contributions by dimitar.prisadnikov, A.Vonk.

Doosan’s force control lets you measure and react to the force the robot arm is applying along a chosen axis — for example, lowering the arm until it meets resistance, then closing the gripper. This is useful whenever a task needs gentle or force-limited contact instead of moving to a fixed, pre-measured position.

:warning: Safety

The example below moves the robot along Cartesian coordinates from its home position. Depending on your robot’s mounting and surroundings, this could cause damage or injury. Set the speed (v) low and keep a hand near the emergency stop whenever you run a new movement for the first time.

What you need

  • A Doosan robot, run from DRL Studio.
  • Familiarity with joint coordinates (posj) and Cartesian coordinates (posx) — if these are new to you, read up on motion concepts first.
  • Basic Python knowledge.

Steps

1. Move the robot to its home position

The example below assumes the robot starts from its home position before the code runs.

2. Start an asynchronous move

Use amovel (asynchronous linear move) so your script can keep checking the force sensor while the robot is still moving — a blocking movel would prevent you from checking anything until the move finished.

3. Poll the force condition while the robot moves

Use check_force_condition to test whether the force on a chosen axis has exceeded a threshold. Because the move is asynchronous, you must also check whether the robot is still moving (check_motion) — otherwise, if the robot reaches its target without ever triggering the force condition, the polling loop never exits.

def wait_force_feedback():
    ff = True
    while ff and check_motion() != 0:
        # wait for the force condition on the Z-axis to be met,
        # or for the robot to stop moving on its own
        ff = check_force_condition(axis=DR_AXIS_Z, max=25, ref=DR_BASE)
    if not ff:
        tp_log("Stopped due to Force Control feedback")
        stop(DR_QSTOP)


# get the current pose in Cartesian coordinates
current_posx, _ = get_current_posx()

# transform the current pose: move 500 mm down along Z
target_posx = trans(current_posx, posx(0, 0, -500, 0, 0, 0))

# start the move asynchronously
amovel(target_posx, v=20, a=100)

# wait for either the force condition or the robot stopping
wait_force_feedback()

Troubleshooting

The script hangs and never continues. This happens if wait_force_feedback only checks check_force_condition in its while loop. Since the move is asynchronous, the robot might reach target_posx without ever triggering the force threshold — and the loop keeps waiting forever. Add check_motion() != 0 to the loop condition (as in the example above) so the loop also exits once the robot has stopped moving on its own.

Related


Rewritten and consolidated (Sept 2026) from the original student how-to’s: Using Doosan’s Force Control.