Controlling End-effector from G-code when using Toolpath Nodes in Remote TCP & Toolpath URCap (Polyscope Version ≥ 5.11.5)
Remote TCP & Toolpath URCap is embedded in Polyscope for e-Series Robots. This article describes how to control end-effectors when executing G-code files using the toolpath nodes enabled by this URCap in Polyscope 5.11.5 and above.
Example is valid for: e-Series Software version: 5.11.5
Note that older or newer software versions may behave differently. Please refer to this article if your robot runs an older version of Polyscope (between 5.6.0 and 5.11.3).
This example can be used for e-Series only. Sample files are available for download at the bottom of the page.
The Remote TCP & Toolpath URCap makes it easier to program Universal Robots for process applications, such as dispensing, deburring, polishing, sewing, welding, additive manufacturing, etc. It can automatically generate robot motion based on imported G-code toolpath files. When the end-effector is mounted onto the robot’s tool flange, a G-code file can be executed using a Toolpath_MoveP node (tutorial). When the end-effector is mounted off the robot at a fixed location relative to the robot base, Remote TCP is the right option. Under a RTCP_MoveP node, a RTCPToolpath node can be used to execute a G-code file (tutorial).
It may be desired to turn the robot’s end-effector on and off while it executes a G-code file. Let’s use this dispensing demo as an example. The robot dispenses gel on two different segments, and the dispenser is turned off while the robot moves from the end of the first segment to the beginning of the second segment. How to control the end-effector in this example?
If your robot is running Polyscope 5.11.5 or above, the recommended way to control the end-effector is using M-code commands inside a G-code toolpath file. M-code commands can directly control ports, which are mapped to digital outputs on the robot. If the robot’s end-effector is connected to one of those digital outputs, the G-code file will be able to control it using M-code commands.
In the dispensing example above, if there is one G-code file that covers both segments, the following M-code commands can be inserted at the beginning and end of each segment.
- M62 P0 -> turning on Port 0
- M63 P0 -> turning off Port 0
- G4 P0.5 -> pausing motion for 0.5 seconds
The complete G-code toolpath file is available at the bottom of the page (UR_Logo.nc).
Note: The N number at the beginning of each line is the line number, which does not affect robot motion. Line numbers are optional in G-code files.
To map a port in a G-code file to a digital output on your robot, please navigate to the following page in the URCap. An output port can be mapped to a digital, configurable, or tool output on the robot. Likewise, an input port can be mapped to a digital, configurable, or tool input on the robot. Using an output port should suffice if no feedback is expected from the end-effector.
In this case, the robot program is concise since the end-effector control commands are embedded in the G-code toolpath file. The program and installation files are available at the bottom of the page (Dispensing_Demo_1.3.urp, Dispensing_Demo_1.3.installation).
If you are going to try these programs on your robot, please make sure to adjust the TCP, Part Coordinate System (PCS) and waypoints based on your hardware setup. The program structure and G-code files should not require any modification.
Should you have any questions, please feel free to post them on our user forum or contact Technical Support using the Request Information from UR+ Partner button on the UR+ product page.