Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5

Use ABB Teach Pendent Defined TCP tooldata

#1
How do I import the tool center point data (TCP) from the pendant for use in RoboDK made programs?

It is generally easy to define and calibrate tools from the robot pendant. Being able to import this data from the pendant into RoboDK or specify the TCP from the pendant for use in the output program would be very helpful.

I am using an ABB robot. Right now a RoboDK made mod file has the tool definition as:

Code:
! Tool variables:
PERS tooldata toolRDK := [TRUE,[[346.602,7.309,63.820],[0.70710678,0.00000000,0.70710678,0.00000001]],[1,[0,0,20],[1,0,0,0],0,0,0.005]];

The RoboDK code creates a new tool that can be seen on the pendant. The program then references toolRDK for each move. 

Instead of defining the tool with the XYZ, quaternion, mass and other data, I want to simply call out the use of a tool from the pendant, e.g. "use AMTool" where AMTool is defined on the pendant.

Is there a way to reference a tool stored on the pendant in RoboDK so that the generated code uses a tool from the pendant? Or should I modify the output file to somehow define toolRDK to be equal to a tool on the pendant, e.g.
Code:
PERS tooldata toolRDK := AMTool
where AMTool is defined on the pendant (not sure this will work as ABB documentation is convoluted in how to reference a tool)
#2
Yes, this is possible, however, it requires customizing your post processor to filter known tool variable names (TCPs or also known as tooldata for ABB controllers).

To customize the post processor to filter how you set tool variable names you can write a setTool function like this one:
Code:
def setTool(self, pose, tool_id, tool_name):
    if tool_name in ["CustomTool1", "CustomTool2"]:
        # Update the tooldata to be used for upcoming movements, don't do anything else
        self.TOOLDATA = tool_name
        return

    # Trigger the default program call for setting the tool
    super().setTool(self, pose, tool_id, tool_name)
#3
(04-25-2024, 04:12 PM)Albert Wrote: Yes, this is possible, however, it requires customizing your post processor to filter known tool variable names (TCPs or also known as tooldata for ABB controllers).

To customize the post processor to filter how you set tool variable names you can write a setTool function like this one:
Code:
def setTool(self, pose, tool_id, tool_name):
    if tool_name in ["CustomTool1", "CustomTool2"]:
        # Update the tooldata to be used for upcoming movements, don't do anything else
        self.TOOLDATA = tool_name
        return

    # Trigger the default program call for setting the tool
    super().setTool(self, pose, tool_id, tool_name)

Can you clarify further how to use this?

So far I have the following, but it creates no effect on the output:

Code:
class RobotPost(BasePost):

    # ------------------------ Customize your RoboDK post processor using the following variables ------------------------

    # all the stuff in the post

    # Default tool
    # TOOLDATA = "tool0"
    TOOLDATA = "AMTool"

    # Default reference
    WOBJDATA = "wobj0"

    # --------------------------------------------------------------------------------------------------------------------

    pass

def setTool(self, pose, tool_id, tool_name):
    if tool_name in ["AMTool", "CustomTool2"]:
        # Update the tooldata to be used for upcoming movements, don't do anything else
        self.TOOLDATA = tool_name
        return

    # Trigger the default program call for setting the tool
    super().setTool(self, pose, tool_id, tool_name)

Alternatively, if I put the "def setTool" inside the class RobotPost(BasePost), I get the following error:
Traceback (most recent call last):
File "C:\Users\...\PostFILENAME.py", line 34, in
r.setTool(p(346.602,7.309,63.8202,0,90,0),-1,r"""toolRDK""")
File "C:\RoboDK\Posts\ABB_RAPID_IRC5.py", line 114, in setTool
super().setTool(self, pose, tool_id, tool_name)
TypeError: RbotPost.setTool() takes from 2 to 4 positional arguments but 5 were given
  




Users browsing this thread:
1 Guest(s)