Difference between revisions of "CPRog Examples"

From Wiki
Line 6: Line 6:
 
== Matrix Motion ==
 
== Matrix Motion ==
  
E.g. to grip work pieces form an rectangular tray it is not necessary to program all singele positions. CPRog can handle two loops that increment the x and y parts of the target position. The gripping motion is inside a sub program.
+
In order to grip work pieces form a rectangular tray it one has to control the robot so that it moves a new position and then operates the gripper. The motions have to be carried out multiple times for multiple items on the matrix. To simplify setting up such a motion, CPRog can handle ''loops and subprograms''. In this case once would program two loops: one that increment the x and y of the target position and a second loop that controls the gripping motion. Here some example code that accomplishes this task:
  
 
'''Program Files:'''
 
'''Program Files:'''
 +
Download the following xml files (right click, save as):
 
* The main program [http://www.cpr-robots.com/download/CPRogExamples/Matrix/testMatrix.xml testMatrix.xml]
 
* The main program [http://www.cpr-robots.com/download/CPRogExamples/Matrix/testMatrix.xml testMatrix.xml]
 
* The gripping sub program [http://www.cpr-robots.com/download/CPRogExamples/Matrix/sub_matrixGrip.xml sub_matrixGrip.xml]
 
* The gripping sub program [http://www.cpr-robots.com/download/CPRogExamples/Matrix/sub_matrixGrip.xml sub_matrixGrip.xml]
  
Please save both files in the c:\CPRog\Data\Programs folder.
+
Please save both files in the <code>C:\CPRog\Data\Programs</code> folder.
  
Please test this program in simulations, not with the real robot. E.g. starting positions etc have to be adapted to your specific set up!
+
''Always first test any program in a simulation, i.e. with the robot disconnected in software. The starting positions of the example code may have to be adapted to your specific set up!''
  
Please refer to the commands specification for further information on the variable commands: [http://www.cpr-robots.com/download/CPRog/CPR_CommandReference.pdf Command Reference]
+
Please refer to the command reference for further information on the commands and variables: [http://www.cpr-robots.com/download/CPRog/CPR_CommandReference.pdf Command Reference]
  
 
'''Troubleshooting:'''
 
'''Troubleshooting:'''
* If the robot does not perform the complete pattern, please check if the motion might exceed the motion limits. This is shown in the log messages tab on the bottom of CPRog
+
* If the robot does not perform the complete pattern, please check if the motion might exceed the '''motion limits'''. This is shown in the log messages tab on the bottom of CPRog.
* Take a look at the variables in the variables tab on the bottom of CPRog. This often helps to find problems.
+
* Take a look at the variables in the "variables" tab on the bottom of CPRog. This often helps to find problems.
* Precision: If the real robot approaches the positions with offsets it might be necessary to perfom a fine calibration. Please have a look at the according page [[Define the zero position offsets]] or get in contact!
+
* Precision: If the real robot approaches the positions with offsets it might be necessary to perform a fine calibration. Please have a look at the according page [[Define the zero position offsets]] or get in contact!
  
  

Revision as of 07:17, 15 May 2018

This page shows some example programs for the CPRog software. Please get in contact if you application is not covered...


The matrix motion in CPRog

Matrix Motion

In order to grip work pieces form a rectangular tray it one has to control the robot so that it moves a new position and then operates the gripper. The motions have to be carried out multiple times for multiple items on the matrix. To simplify setting up such a motion, CPRog can handle loops and subprograms. In this case once would program two loops: one that increment the x and y of the target position and a second loop that controls the gripping motion. Here some example code that accomplishes this task:

Program Files: Download the following xml files (right click, save as):

Please save both files in the C:\CPRog\Data\Programs folder.

Always first test any program in a simulation, i.e. with the robot disconnected in software. The starting positions of the example code may have to be adapted to your specific set up!

Please refer to the command reference for further information on the commands and variables: Command Reference

Troubleshooting:

  • If the robot does not perform the complete pattern, please check if the motion might exceed the motion limits. This is shown in the log messages tab on the bottom of CPRog.
  • Take a look at the variables in the "variables" tab on the bottom of CPRog. This often helps to find problems.
  • Precision: If the real robot approaches the positions with offsets it might be necessary to perform a fine calibration. Please have a look at the according page Define the zero position offsets or get in contact!


For questions please get in contact