Home Programming


Left ArrowBack to discussions page
SebastienSebastien Posts: 219 Handy
edited November 2016 in Programming
Hi Pros,
one quick question. We are working on a system that includes a UR and a smart camera. In the application we need to first locate the part, then do a barcode reading and bin the part based on the barcode value. We are thinking of setting up the camera with the robot using ethernetIP. The camera would send barcode value in the first place to the robot. Then when locating the object it would send XY position of the object.  The camera will be a Cognex camera. It has a feature in its interface that allows us to calibrate the position of the camera such that XY positions returned are in the robot's coordinate system. My question is, on the robot side, what do you usually use in a program to update XY positions based on camera's feedback?


  • BeachChEBeachChE Founding Pro Posts: 19 Handy
    Sebastien, one of the things you have to be aware of is the the units between the camera and UR are different. Camera will be in meters for X, Y, and Z and the UR is in mm. Also the rotation angle is in degrees in the camera and Rads in the UR. I run the camera loop in a thread so that it finds the part and holds the coordinates until they are asked for.  I use this thread on 3 Cognex cameras now and will be adding a 4th. Here is my thread.

         'Camera 1  Program Start'
         If Thread_1≟1
           Set Camera_1_Trig=Off
           Socket_Test_1≔ False 
           Wait: 0.3
             Loop Socket_Test_1≟ False 
               Wait: 1.0
             Set Camera_1_Trig=On
             Wait: 0.2
             Set Camera_1_Trig=Off
             Wait: 0.2
             If Socket_Test_1≟ True 
               Wait: 0.2
               Set Pic_Cntr=Pic_Cntr+1
             Wait: 0.2
             If Result_1[0]≟3
               Socket_Test_1≔ False 

    The Pic_Cntr is a variable I use to prevent the camera and robot from sitting there and trying to find a part forever. If it goes above 20 tries, I trigger a popup and lights on an andon stack.

    I hope this helps.
  • SebastienSebastien Posts: 219 Handy
    Yes that helps a lot thanks for the tips! Also for the units difference between the two device! This is something that is usually easy to skip over when we start programming!
Sign In or Register to comment.
Left ArrowBack to discussions page