4. Motion Parameters
API List
API Function | Description | Save Required? |
---|---|---|
set_tcp_jerk() | Set the jerk for linear motion | Yes |
set_joint_jerk() | Set the jerk for joint motion | Yes |
set_collision_sensitivity() | Set the sensitivity for collision detection | Yes |
set_tcp_load() | Set the TCP load (weight and center of gravity) | Yes |
set_tcp_offset() | Set the TCP offset | Yes |
set_world_offset() | Set a user-defined world coordinate system | Yes |
save_config() | Save the above configurations to make them permanent | - |
Speed and Acceleration
Speed and acceleration are primarily set as parameters within motion commands.
Parameter | Parameter Name in Motion Command | Unit (Linear/Joint) |
---|---|---|
Speed | speed | mm/s or rad/s |
Acceleration | mvacc | mm/s² or rad/s² |
Example:
# Specify speed as 100 mm/s and acceleration as 2000 mm/s² in linear motion
arm.set_position(x=300, y=0, z=200, speed=100, mvacc=2000, wait=True)
# Specify joint speed as 50 °/s and joint acceleration as 500 °/s² in joint motion
arm.set_servo_angle(angle=[10, 0, 0, 0, 0, 0], speed=50, mvacc=500, wait=True, is_radian=False)
Jerk
Jerk affects the rate of acceleration and the smoothness of the motion. It is generally not recommended to modify it.
Motion Type | Interface | Unit |
---|---|---|
Linear Motion | set_tcp_jerk(jerk) | mm/s³ |
Joint Motion | set_joint_jerk(jerk, is_radian) | °/s³ or rad/s³ |
Note: After setting the jerk using the interface, you need to call arm.save_config()
to save the configuration if you want it to remain effective after a reboot.
Example:
# Set TCP jerk to 10000 mm/s³
arm.set_tcp_jerk(10000)
# Set joint jerk to 7000 °/s³
arm.set_joint_jerk(7000, is_radian=False)
# Save the configuration to make it permanent
arm.save_config()
Collision Sensitivity
The robot arm has a built-in collision detection function based on current, and its sensitivity can be set.
Use set_collision_sensitivity(sensitivity)
to set it.
sensitivity
: The sensitivity value, range 0-5. The higher the value, the more easily the collision protection is triggered. 0 means it is turned off. The factory default is 3.
Note: After setting the collision sensitivity, you need to call arm.save_config()
to save the configuration if you want it to remain effective after a reboot.
Example: Set the collision detection sensitivity to 3.
arm.set_collision_sensitivity(3)
TCP Load and Offset
When a tool (like a gripper or a welding gun) is mounted on the end of the robot arm, you need to set the tool's TCP load (weight and center of gravity) and TCP offset (the offset of the tool coordinate system relative to the end flange center) to ensure motion accuracy and stability.
Set TCP Load
Use set_tcp_load(weight, center_of_gravity)
to set it.
weight
: The load weight in kg.center_of_gravity
: The coordinates of the load's center of gravity relative to the Tool Center Point (TCP), a list of[x, y, z]
in mm.
Example: Set the load to 0.8kg, with the center of gravity at [0, 0, 50].
arm.set_tcp_load(0.8, [0, 0, 50])
Note: After setting the TCP load, you need to call arm.save_config()
to save the configuration if you want it to remain effective after a reboot.
Set TCP Offset
Use set_tcp_offset(offset)
to set it.
offset
: A list containing[x, y, z, roll, pitch, yaw]
.
Example: Set a TCP located 100mm along the Z-axis from the end flange center.
arm.set_tcp_offset([0, 0, 100, 0, 0, 0])
Note:
- After setting the TCP offset, the robot arm will enter the state 5(
state=5
) and can not accept and execute new commands. You need to callset_state(0)
to resume. - If you want the setting to remain effective after a reboot, you need to call
arm.save_config()
.
Coordinate System
You can set a user-defined coordinate system (world coordinate system) using set_world_offset(offset, is_radian=None)
. After setting it, motion will be based on this new world coordinate system.
offset
: A list[x, y, z, roll, pitch, yaw]
that defines the offset of the base coordinate system within the world coordinate system.is_radian
: Specifies whetherroll, pitch, yaw
are in degrees or radians.
Example:
# Set a new world coordinate system, placing the robot's base coordinate system at [200, 0, 0, 0, 0, 0] in the world coordinate system
arm.set_world_offset([200, 0, 0, 0, 0, 0])
Note:
- After setting the coordinate system, the robot arm will enter the state 5(
state=5
) and can not accept and execute new commands. You need to callset_state(0)
to resume. - If you want the setting to remain effective after a reboot, you need to call
arm.save_config()
.