Moving Robots via CRI

From Wiki
Revision as of 14:14, 23 August 2021 by Mab (talk | contribs) (Added approach 'definition of robot program via CRI')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

While many use-cases can be solved solely by a robot program some require the robot to move to coordinates from external sources. For these cases CPRog/iRC and TinyCtrl offer the following interfaces:

  • Move-To commands via CRI (positions, supported with V12 and newer)
  • Robot program definition via CRI (more flexible alternative to Move-To)
  • Program variables via CRI (position or scalar number)
  • Jog via CRI (velocity values)
  • Camera interface (2D coordinate, orientation and object type)

This article gives an overview on how to use these interfaces to command the robot to move to specific positions.

Jog via CRI

The CRI Ethernet Interface includes the ALIVEJOG command, which can be used to move the robot by specifying velocity values (percent) per joint or cartesian axis. This approach can be used for joystick-like motion.

Move-To commands via CRI

Starting with CPRog/iRC and TinyCtrl V12 the robot can be instructed to move to a coordinate or joint angle position via the "CMD Move" command. Once issued the robot will immediately move to the position (if reachable). A still running Move command will be stopped and replaced by the new command. The "CMD Move Stop" command stops the motion. Please refer to the CRI documentation for more information.

Program definition via CRI

The CRI can be used to add basic commands to a robot program. You can use these for moving the robot by defining and executing a temporary program:

  • Clear a loaded program, if present: CMD DeleteProgram
  • Define your target position: e.g. PROG JOINT 10 20 30 40 50 60 EXT 10 20 30 VEL 50
  • You can add more commands if you like (motion, gripper, DOut, wait)
  • Start the program: CMD StartProgram

This approach requires more CRI commands than the Move-To commands but is more flexible.

Program variables via CRI

The recommended approach is to use the CRI Ethernet Interface to transmit position or scalar variables that can be read and changed in robot programs. The necessary CRI commands are described here: Remote Variable Access#CRI Ethernet Interface

The general approach is this:

  1. Create a robot program that initializes a position variable, then uses a motion-by-variable command in an infinite loop to move to this variable position (see the example below). The infinite loop is necessary since the store command re-initializes the variable and therefore overwrites any value received via CRI.
  2. Run this program on the robot or in CPRog/iRC
  3. Connect your CRI client and make it send new positions whenever necessary

You may use a more complex robot program for this, e.g. if you also want to control a gripper or digital outputs.

ExampleTargetPosition.JPG

Camera interface

The camera interface uses a simple text-based TCP/IP protocol that is based on the IFM O2D camera. It transmits 2D coordinates (integer), an orientation value (float) and a object class value (integer). If you do not want to use the CRI protocol this can be used to transmit coordinates or arbitrary values, however some extra calculations might be necessary to shift the integer values to decimal accuracy, if needed. This article describes how to use the camera interface: Remote Variable Access#Camera interface

If you want to integrate an O2D camera follow this guide: 2D Camera Integration