PF400 Interface Improvements: TCS Kinematics, Force Compliance, Height Detection, and Motion Enhancements#31
Merged
Merged
Conversation
…into update_action_locations
…odule into interface_updates
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PF400 Interface Improvements: TCS Kinematics, Force Compliance, Height Detection, and Motion Enhancements
Overview
This PR covers a series of improvements to the PF400 robot interface spanning the TCS server custom command layer, the Python driver, and motion handling logic. The changes replace the old local kinematics implementation with accurate robot-side calculations, add new hardware features, and improve the reliability and flexibility of pick and place operations.
TCS Server: Custom GPL Commands (
Custom.gpl)A custom GPL module (
RPL Custom Module 2.1) has been added to the robot's TCS server project (Tcp_cmd_server_pa). This module exposes five new TCP commands callable over port 10100.Kinematics Commands
The existing local Python kinematics implementation (
pf400_kinematics.py) had known inaccuracies and has been fully replaced by calls to the robot's internalKineSolmethod via these commands:JointToCart j1 j2 j3 j4 j5 railForward kinematics (FK): converts joint angles to Cartesian coordinates. Rail offset is added to X internally so the result matches
wherecworld coordinates.CartToJoint X Y Z yaw pitch roll railInverse kinematics (IK): converts Cartesian coordinates to joint angles. Rail is passed explicitly, subtracted from X before IK, and returned unchanged as j6.
RotateLoc j1 j2 j3 j4 j5 rail rotation_degRotates the end effector yaw by
rotation_degdegrees at a given joint location. Internally runs FK, applies the rotation, then IK. Used to switch between narrow and wide microplate orientations without saving duplicate locations.Force Compliance Commands
Requires XY Compliance license on the controller.
EnableCompliance bias_torque_pctEnables horizontal force compliance via
AC_HorizCompliance2. Thebias_torque_pctparameter (0-100) sets a bias torque as a percentage of the last used position control torque to prevent axis drift.0= fully free, typical values 0-20.DisableComplianceDisables horizontal force compliance and returns to normal position control. Always call after
EnableCompliance.Python interface (
pf400.py)Kinematics Module Removed
pf400_kinematics.pyand theKINEMATICSparent class have been removed entirely.PF400is now a standalone class. All kinematics calls now go through the TCS server.New Kinematics Methods
New Force Compliance Methods
default_bias_torque_pct = 95is set as a class attribute and can be overridden per call or at the class level.New Height Detection Method
Requires Z Height Detection license on the controller.
Returns the detected Z height in mm. The gripper must be positioned at least 20mm above the surface before calling.
Updated Motion Methods
set_plate_rotationnow callsrotate_yawinstead of the old local kinematics.check_incorrect_plate_orientationnow usesjoint_to_cartto check yaw androtate_yawto correct orientation.Previous Motion Improvements
The following changes were made in earlier work and are included here for completeness:
Height and Grab Offsets
Pick, place, transfer, remove lid, and replace lid operations now support:
grab_offset: adds a custom height offset to the default plate grab height, sourced from plate resource attributesapproach_height_offset: adds an additional height offset to the approach waypoint, specified per location in theLocationArgumentdictionarySource and target locations can have independent approach height offsets in transfer operations.
Height Limit Validation
An optional
height_limitparameter can be set per location inLocationArgument. If provided,pick_plateandplace_platevalidate the calculated above position against this limit before moving. If the approach height would exceed the limit anActionFailedis returned without moving the robot.Straight Motion Profile
A third motion profile (
straight_motion_profile = 3) has been added for straight-line joint moves. The approach sequence now uses this profile for the critical segments:Fast motion profile is used for all other approach waypoints.
Multiple Approach Locations
source_approachandtarget_approachnow support both single and multiple approach waypoints. When a list of locations is provided the robot sequences through them in order on approach and in reverse on return, using straight motion for the waypoint closest to the target and fast motion for the rest.Resource Validation
Pick and place operations now validate resource state before moving:
Validation failures return
ActionFailedwithout moving the robot, keeping the node alive for subsequent commands.Files Changed
src/pf400_interface/pf400_driver.py— main driver, kinematics removed, new methods addedsrc/pf400_interface/pf400_kinematics.py— deletedrobot/Tcp_cmd_server_pa/Custom.gpl— new TCS custom commandsdocs/DEPLOY_CUSTOM_GPL.md— deployment instructions for Custom.gpl