Difference between revisions of "Moving Robots via CRI"
(Created page with "Category:CPRogCategory:TinyCtrl While many use cases can be solved solely by a robot program some require the robot to move to coordinates from external sources. For t...") |
(Added approach 'definition of robot program via CRI') |
||
(4 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
[[Category:CPRog]][[Category:TinyCtrl]] | [[Category:CPRog]][[Category:TinyCtrl]] | ||
− | 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: | + | 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) | * 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. | This article gives an overview on how to use these interfaces to command the robot to move to specific positions. | ||
− | = | + | = Jog via CRI = |
− | The | + | 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 Ethernet Interface|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 = | = 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 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: | ||
+ | # 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. | ||
+ | # Run this program on the robot or in CPRog/iRC | ||
+ | # 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. | ||
+ | |||
+ | [[File: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]] |
Latest revision as of 13:14, 23 August 2021
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:
- 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.
- Run this program on the robot or in CPRog/iRC
- 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.
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