Knowledgebase



HOW TO: Automatically calculate the Armset values for a camera that is mounted onto arm linkage #2 of a SCARA robot using the camera’s calibration data

 
Article ID: T4888
Date: 2/14/12
Product: EPSON RC+ All Versions

For certain applications, it is convenient to create an “Arm” for a Joint #2 mobile mounted camera. An “Arm” is any auxiliary equipment that is mounted onto the SCARA robot’s second arm linkage.   A typical application for when an Arm would be used for a mobile mounted camera would be to locate loosely positioned parts in the pockets of a tray.  To position the camera over each pocket, the code would select the “Arm” (which defines the location of the camera on the robot) and then command the robot to move to the “Pallet” index.  This would position the center of the camera’s field of view directly over the center the pocket in the tray.

The following procedure automatically calculates the proper “ArmSet” values for a Joint #2 mobile mounted camera ->

The Joint #2 mobile mounted camera must be calibrated before using this procedure.

a) Using Vision Guide, create a vision sequence called "SetArm".  Place a "Point" vision object anywhere on the vision screen (i.e., screen relative).  Use the default point name "Point01".
b) Apply the Calibration file (previously created) to the "Calibration" property for the vision sequence "SetArm".
c) Move the mobile mounted camera to roughly the same location where the camera calibration was performed.
d) Run the following code.

Important Notes:

  1. This program uses points P1, P2, and P3...use different point numbers if these points are already being used. 
  2. This code automatically sets arm #1.  Change the Armset instruction if you want to define a different Arm.
  3. The code uses a Pulnix CV-A1 camera.  If you are using a different resolution camera then the X and Y properties of Point01 will need be changed in order to position Point01 in the center the camera’s field of view.

Function myArmSet
       Double pulses1, j1res, theta1, mytheta1
       Double J1LENGTH
       Real x1, y1, x2, y2, u2, x3, y3
       Real parameter1, parameter2, parameter4
       Integer found 

       Tool 0
       Arm 0

       J1LENGTH = armset(0,4)    
       'Pulnix CV-A1 resolution is 1376 x 1035 pixels
       VSet SetArm.Point01.X,688
       VSet SetArm.Point01.Y,518
       VRun SetArm
       VGet SetArm.Point01.robotx,x2
       VGet SetArm.Point01.roboty,y2
       P2 = XY(x2, y2, 0, 0)

       theta1 = DegToRad(Agl(1))
       x3 = Cos(theta1) * J1LENGTH
       y3 = Sin(theta1) * J1LENGTH
       P3 = XY(x3, y3, 0, 0)

       P1 = Here
       x1 = CX(P1)
       y1 = CY(P1)

       parameter1 = Dist(P2, P3)
       parameter4 = J1LENGTH
       parameter2 = RadToDeg(Atan2(x2 - x3, y2 - y3)) - RadToDeg(Atan2(x1 - x3, y1 - y3))

       ArmSet 1, parameter1, parameter2, 0, parameter4, 0
       Print "ArmSet 1,", parameter1, ",", parameter2, ", 0,", parameter4, ", 0" 

Fend

The Arm has now been set.  When you want the robot to move the camera over the top of a taught point (for example P10), simply do something like the following (Command Window commands are shown below) -

> tool 0
> arm 1
> jump P10:z(0)

Please do not forget to return to Arm 0 and the appropriate tool before moving the gripper to a point.  For example -

> tool 1
> arm 0
> jump P20

This will cause the robot to jump to point P20 with tool 1.

Author of the Article: John Yett



Related Articles

No related articles were found.

Attachments

No attachments were found.

Visitor Comments

Article Details

Last Updated
21st of February, 2012

Would you like to...

Print this page  Print this page

Email this page  Email this page

Post a comment  Post a comment

 Subscribe me

Subscribe me  Add to favorites

Remove Highlighting Remove Highlighting

Edit this Article

Quick Edit

Export to PDF


User Opinions

75% thumbs up 25% thumbs down (4 votes)

How would you rate this answer?




Thank you for rating this answer.

Continue