For information on the latest version, please have a look at GL013301.
task_compliance_ctrl (Auto Mode)
This section explains how to use task_compliance_ctrl during Auto (Run) operations to activate Cartesian compliance control for force-assisted or compliance-based tasks. This function allows the robot to adjust its stiffness dynamically for specific tasks, enabling safe interaction with objects, materials, or the environment.
In Auto Mode, this function is useful for tasks that require force control or compliant motion, such as automated assembly, insertion, or material handling.
Typical usage
Enable compliance mode to allow force-assisted movement during automated tasks.
Perform surface following, insertion, or contact-based alignment in automated operations.
Adjust stiffness dynamically for safe interaction with parts or tools.
Combine with set_desired_force to control both force and compliance for automated tasks.
Use release_compliance_ctrl to revert to standard position control after the task is complete.
Note
Typical stiffness range:
- Translational: 0~20000 N/m
- Rotational: 0~400 N·m/radUse
COORDINATE_SYSTEM_TOOLfor tool-aligned compliance orBASEfor global compliance control.
Example: Enable Cartesian Compliance for Automated Insertion
#include "DRFLEx.h"
#include <cstdio>
using namespace DRAFramework;
int main() {
CDRFLEx drfl;
// Preconditions:
// - Connection established, servo ON
// - Auto mode active
// 1) Move to a safe position for insertion
float q0[6] = {0.0f, 0.0f, 90.0f, 0.0f, 90.0f, 0.0f};
drfl.movej(q0, 60, 30);
drfl.mwait();
// 2) Enable compliance control with base stiffness
float baseStiff[6] = {3000.f, 3000.f, 3000.f, 200.f, 200.f, 200.f};
drfl.task_compliance_ctrl(baseStiff, COORDINATE_SYSTEM_TOOL, 0.0f);
// 3) Adjust stiffness dynamically for insertion task
float newStiff[6] = {1000.f, 1500.f, 2000.f, 150.f, 150.f, 150.f};
drfl.set_stiffnessx(newStiff, COORDINATE_SYSTEM_TOOL, 0.5f);
// 4) Finalize insertion task and return to position control
drfl.release_compliance_ctrl();
printf("Compliance mode enabled for automated insertion.\n");
return 0;
}
In this example, the robot transitions to a compliant state, adjusts stiffness for optimal insertion, and then releases compliance to return to standard position control after the task.
Tips
Use moderate stiffness (e.g., 1000–3000 N/m) for safe and controlled insertion or assembly tasks.
Apply short transition times (0.3–0.5 s) for smooth and responsive stiffness changes.
COORDINATE_SYSTEM_TOOL is recommended for force applications related to tool movement or part insertion.
Ensure compliance control is activated before performing tasks that involve force or contact-based control.
Combine with set_desired_force to manage force control in conjunction with compliance.