ur10_robot_arm:drawing_with_the_ur10

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
ur10_robot_arm:drawing_with_the_ur10 [2021/02/25 08:08] – [Send program to robot] formlabur10_robot_arm:drawing_with_the_ur10 [2021/03/03 01:15] (current) – [Troubleshooting] formlab
Line 5: Line 5:
   - Select all   - Select all
   - ''Path > Object to Path''   - ''Path > Object to Path''
-  - Save as. Choose ''Plain SVG''. Optional: open saved file in text editor to check that there are only ''<path>'' objects present.+  - Save as. Choose ''Plain SVG'' 
 +    - //Optional: open saved file in text editor to check that there are only ''<path>'' objects present.// 
 +    - //Keep the filename simple and avoid spaces.//
  
 ===== Prepare the canvas ===== ===== Prepare the canvas =====
-  * Make sure to have a mostly flat surface. The orientation doesn't matter, as long as the arm can reach it. +  * **Flat surface**: Make sure to have a mostly flat surface. The orientation doesn't matter, as long as the arm can reach it. 
-  * The surface should be fixed well, so it doesn't accidentally move. +  * **Immovable surface**: The surface should be fixed well, so it doesn't accidentally move. 
-  * Measure the width and height of the image area on the surface. Keep this value for later.+  * **Measure** the width and height of the image area on the surface. Keep this value for later.
  
 ===== Setup the physical robot ===== ===== Setup the physical robot =====
Line 32: Line 34:
  
   - Right click the python script and choose ''Edit Python Script''. The VSCodium text editor starts up and opens the python script.   - Right click the python script and choose ''Edit Python Script''. The VSCodium text editor starts up and opens the python script.
-  - Change the variable ''SIZE_BOARD'' to the size you would like the drawing to be (in millimeters). +  - Change the variable ''SIZE_BOARD'' to the size you would like the drawing to be (in millimeters). <code python> SIZE_BOARD = [460, 310] #Set the size of the canvas (in mm) </code> 
-  - Change the variable ''IMAGE_FILE'' to the name of the SVG image. (for example: test-image.svg)+  - Change the variable ''IMAGE_FILE'' to the filename of the SVG image. <code python> IMAGE_FILE = 'test-image.svg' </code>
   - Press ctrl + s to save the file and go back to RoboDK. //Keep in mind that this file is updated in RoboDK, but not in the file explorer. Save the changes to the file explorer if you want to keep them for the future.//   - Press ctrl + s to save the file and go back to RoboDK. //Keep in mind that this file is updated in RoboDK, but not in the file explorer. Save the changes to the file explorer if you want to keep them for the future.//
  
Line 54: Line 56:
   * P3 should be somewhere on the canvas to the right.   * P3 should be somewhere on the canvas to the right.
  
-//Tip: if you're using a spring-loaded pen holder, add a spacer to the spring, so the pen is retracted a little bit. Then almost-touch the canvast with the pen when probing.+//Tip: if you're using a spring-loaded pen holder, add a spacer to the spring, so the pen is retracted a little bit. Then almost touch the canvast with the pen when probing. Remove the spacer before drawing.
 // //
   - **Move the physical robot** to one of the 3 points   - **Move the physical robot** to one of the 3 points
Line 70: Line 72:
   * **Save the file**. The file is already stored in a temporary location in the finder. Find the location, or save-as to a new one.   * **Save the file**. The file is already stored in a temporary location in the finder. Find the location, or save-as to a new one.
   * **Import in RoboDK**. Load the file back into RoboDK (drag it onto the window, and select ''import program'' from the popup window).   * **Import in RoboDK**. Load the file back into RoboDK (drag it onto the window, and select ''import program'' from the popup window).
 +  * <WRAP center round alert 60%>
 +the generated program starts at a different position than RoboDK shows. 
 +Temporary fix: in the program instructions: ctrl + click on the first ''change frame'' item. Choose ''Set Reference Link''. Select ''UR10 Base''. Then it should work.
 +</WRAP>
   * **Connect to the robot**. Open the connection to the robot in RoboDK. After the first time, it seems to work when the connection status is disconnected.   * **Connect to the robot**. Open the connection to the robot in RoboDK. After the first time, it seems to work when the connection status is disconnected.
-  * **Stand clear of the robot arm**. +  * <wrap hi>**Stand clear of the robot arm** and slow down the motion on the teaching pendant.</wrap> 
-  * **Send program to robot**. Ctrl + click on the robot program (the text file icon with a triangle on the left) and select ''Send program to robot''**The robot start moving immediately**+  * **Send program to robot**. Ctrl + click on the robot program (the text file icon with a triangle on the left) and select ''Send program to robot''. The robot start moving immediately.
  
  
  
  
 +===== Troubleshooting =====
 +  * **After 'Run Python script', nothing happens**. On the left bottom of the RoboDK screen 'Running python script' is indicated. This means something is wrong with the code. Click 'Edit Python Script' and try to break the code into blocks to find the bug. 
 +    * Use the line <code python> RDK.ShowMessage("message", popup = True) </code> to open a popup and pause the execution of the code at that point.
 +    * To display variables, use this method: <code python> msg_str = "message: %s" % variable </code> and use the string in ShowMessage like so: <code python> RDK.ShowMessage(msg_str, popup = True) </code>
 +    * It might help to temporary load an older version of the python script, and loading the new one again after that. It sounds impossible, but it helped here before...
  
  
Line 85: Line 96:
  
  
-==== WRITTEN UNTIL HERE==== 
- 
- 
-<WRAP center round alert 60%> 
-ERROR: the generated program starts at a different position.  
-temp fix: in the program instructions: ctrl + click on the first ''change frame'' item. Choose ''Set Reference Link''. Select ''UR10 Base''. Then it works perfectly. 
-TODO: Find a fix for this in the Python program. 
-</WRAP> 
- 
- 
- 
- 
-get real world position of robot into RoboDK 
-  * move robot arm 
-  * in RoboDK, connect to robot 
-  * Click 'Get Position" 
  
  
-Set the virtual blackboard to the position of a real drawing surface 
-  * [[https://robodk.com/doc/en/General.html#CalibrateTCP|Calibrate the TCP]] 
-  * [[https://robodk.com/doc/en/General.html#CalibrateFrame|Define reference frame]] 
-    * Ctrl + click on the ''Frame draw'' reference. Select ''Redefine Frame Definition''. 
-    * Set ''select method'' to ''3 points (p1 = origin)'' 
-    * Look at the diagram. Repeat the following steps for each point 
-     * Move the physical robot to the next position 1. (Position 1 will become the origin. Note that the connection status changes to disconnected when moving the real robot. 
-     * With the reference Frame window still in front, Click ''connect'' in the connection window in the background. 
-     * When the connection is ready, click ''Get Position'' (you should see the virtual robot in RoboDK move).  
-     * In the Reference frame window, click ''Get p1''. 
-    * when all 3 points are defined, click ''Update'', Click OK in the confirmation dialog. 
-    * Close the Reference Frame window. The selected reference frame has moved to the newly defined position & orientation. 
  • ur10_robot_arm/drawing_with_the_ur10.1614269332.txt.gz
  • Last modified: 2021/02/25 08:08
  • by formlab