Definition
set_external_force_reset(mode, offset)
Features
This function resets the external force sensor mounted on the robot. This can improve the accuracy of force/compliance control and start force/compliance control even when there is an external force due to contact. Since reset is performed based on the external force sensor mounted on the robot, the offset value is set based on the TCP force/torque for the As series, and the offset value is set based on the joint torque for other models.
Parameters
|
Parameter Name |
Data Type |
Default Value |
Description |
|---|---|---|---|
|
mode |
int |
1 |
Reset mode
|
|
offset |
float[6] |
[0.0, 0.0, 0.0, 0.0, 0.0, 0.0] |
Offset of external force sensor
|
Note
-
You can reset the external force error using the set_external_force_reset() command regardless of whether the force/compliance control is in operation.
-
The effect of the set_external_force_reset() command does not affect the robot's safety functions (collision detection, TCP SLF, etc.).
-
Even if the tool weight setting is incorrect, you can reset the external force by using the set_external_force_reset() command.
-
If force/compliance control cannot be started due to external force caused by contact, you can start force/compliance control by initializing the external force using the set_external_force_reset() command.
-
After using the set_external_force_reset() command, errors may accumulate again when the robot moves, so for precise force control, use the set_external_force_reset command at a location as close as possible before contact.
-
It affects the force status of the check_force_condition() command, and also affects the output values obtained through the get_external_torque() and get_tool_force() commands.
-
This feature is useful for M/H/P/As series equipped with additional sensors such as JTS and FTS. Caution is required when using A/E series that use motor current sensor (CS).
Warning
-
Please keep in mind that when using the set_external_force_reset() command when there is an external force due to contact, the offset includes the contact force, so the actual external force measurement is distorted.
-
Also, if you use the set_external_force_reset() command repeatedly when there is contact, the problem may overlap, so be careful not to use it repeatedly.
-
To avoid the above cases, please use the set_external_force_reset() command in a non-contact state if possible.
Return
|
Value |
Description |
|---|---|
|
offset |
Current offset of external force sensor
|
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
# Example
# 1. Move to starting position: [J1, J2, J3, J4, J5, J6] = [0, 0, 90, 0, 90, 0]
# 2. Start compliance control: Reset external force before starting compliance control(Added wait(2.0) because if vibration remains after motion ends, it can cause errors during external force reset.).
# 3. Approaching the target location of the force control
# 4. Start force control: Reset external force before starting force control to improve force control accuracy.
# 5. Retract after force/compliance control ends: After compliance control ends, restore external force offset to 0.
# 1. Move to starting position
q0 = posj(0.0, 0.0, 90.0, 0.0, 90.0, 0.0)
set_velj(30.0)
set_accj(60.0)
movej(q0)
# 2. Start compliance control
wait(2.0)
set_external_force_reset() # Reset external force
k_d = [3000.0, 3000.0, 3000.0, 200.0, 200.0, 200.0]
task_compliance_ctrl(k_d)
wait(2.0)
# 3. Approaching the target location of the force control
set_velx(75.0)
set_accx(100.0)
delta_approach = [0.0, 0.0, -100.0, 0.0, 0.0, 0.0]
movel(delta_approach, mod=DR_MV_MOD_REL)
# 4. Start force control
wait(2.0)
set_external_force_reset() # Reset external force
force_desired = 20.0
f_d = [0.0, 0.0, -force_desired, 0.0, 0.0, 0.0]
f_dir = [0, 0, 1, 0, 0, 0]
set_desired_force(f_d, f_dir)
wait(10.0)
# 5. Retract after force/compliance control ends
release_force(0.5)
delta_retract = [0.0, 0.0, 150.0, 0.0, 0.0, 0.0]
movel(delta_retract, mod=DR_MV_MOD_REL)
release_compliance_ctrl() # Restore external force offset to 0.
set_external_force_reset(0)
movej(q0)