Setting payload and center of gravity when using multiple TCPs
When working with multiple TCPs and/or different work items, a few script functions can come in handy.
Examples are valid for:
CB3 Software version: 3.3
e-Series Software version: 5.1
Note that newer software versions may behave differently.
These examples can be used on CB3/CB3.1 from software 3.3 and on e-Series.
When working with multiple TCPs and/or different work items, a few script functions can come in handy. Using PolyScope, it is possible to define TCPs, however it is only possible to define one “global” payload and center of gravity (COG) for a given installation.
When switching TCP or picking up a work item while running a program, it can be necessary to change both the payload weight and the COG.
A 'Set' program node should be used when only changing the payload. In a 'Set' program node, the "set payload" option would previously also set the COG to the value of the current TCP. Now, the COG is only set to the active TCP, when a new check box "Use active TCP as center of gravity" is checked.
When the check box is not checked, only the value of the payload mass is updated and the current active COG will not be modified.
Setting a custom COG must be done using a script command.
To use a script command directly in a program, a 'Script Code' node must be inserted. In the text field in the node input the following:
set_payload_cog([x, y, z]) where x,y,z denotes the displacement in meters from the tool output flange to the COG. Observe the orientation of coordinate axes in the illustration in the TCP Configuration screen in the Installation tab.
If a tool is holding a work item, remember to take both tool and work item into account when calculating the COG as well as the payload.
Other script commands useful in scenarios like this are:
set_payload_mass(m) where m is the mass in kg. This corresponds to doing it through the 'Set' node with the 'Use active TCP as center of gravity' unchecked.
set_payload(m) where m is the mass in kg. This will set the payload and use the active TCP as COG. Subsequent changes of TCP also changes COG accordingly. This corresponds to doing it through the 'Set' node and checking the 'Use active TCP as center of gravity' checkbox.
set_payload(m, [x, y, z]) where m is the mass in kg and x,y,z denotes the displacement in meters from the tool output flange to the COG. Convenience function which combines the first two functions described.
Attached is a zip file containing two sample programs.
One is a simple program that sets a TCP and payload using the 'Set' node followed by a 'Script Code' node calling the set_payload_cog(). The two nodes are surrounded by two waypoints in order to have a running program. See screenshot below for an overview.
The other is a more advanced program consisting of a flow looking like this (for an overview see screenshot below):
1. Move to tool pick up location, pick up tool and adjust payload.
2. Move to work item location and pick up work item. Adjust payload and COG.
3. Move to drop item location and drop item. Adjust payload and COG.
4. Move to tool drop location and drop tool. Adjust payload.
Please note that the functions set_payload_mass(), set_payload() and set_payload() are deprecated and replaced by set_target_payload() refer to the URScript manual for more details on these functions.