Avertissement

Vous lisez une ancienne version de cette documentation. Si vous souhaitez obtenir des informations actualisées, veuillez consulter 5.0 .

Sample program

Here we introduce an example of a program to perform a basic pick and place.

../../../_images/get_part.png

Fig. 212 Scénario de production avec get_part

It is necessary at this stage to have already performed the camera configuration, as well as the creation of a recipe with its hand-eye calibration.

Basic scenario - get_part

Initialization

  • 1. Prepare the robot:

    • Initialize robot frame and tool.

    • Initialize the robot gripper.

    • Move the robot out of the field of view.

  • 2. Initialize the communication: Call the command EYE_CONFIGURE with the correct client number.

  • 3. Start EYE+ in production: Stop the current state of the EYE+ if needed and start the production with the desired recipe.

Cyclic part of robot program

  • 4. Get the part coordinates: Call the command EYE_GET_PART to get the coordinates of the part to be picked. These coordinates will be stored in the chosen position register.

  • 5. Check if no error occurs while requesting the part coordinates: Call the command EYE_CHECK_LAST_ERROR and check if it returns 0. If it does not, an error has occurred (e.g., a timeout)

  • 6. Calculate position: Create an intermediate position EYEPosDZ from the EYEPos to make sure to not hit anything when picking the part, whether it is the Asycube or another part.

../../../_images/pick_part_path.png

Fig. 213 Path to pick the part

  • 7. Pick: Follow the path from out_of_view to EYEPosDZ to EYEPos and pick the part with your gripper.

  • 8. Place: Follow the path from EYEPos to EYEPosDZ to out_of_view to EYEPlace and place the part with your gripper.

Out of cyclic part

  • 9. Stop EYE+ state: Stop the EYE+ production state by calling the command EYE_STOP. This command will also stop the communication.

Example of FANUC program

Here is an example of a simple pick and place using the registers listed in Tableau 38.

Tableau 38 Reserved registers for private use

Register number

Register type

Description

R[18]

Registers

Reserved register for internal use

R[19]

Registers

Reserved register for internal use

R[20]

Registers

Reserved register for internal use

R[21]

Registers

Last plugin error raised by EYE_CHECK_LAST_ERROR

PR[19]

Position Reg

Robot position to place the part

PR[20]

Position Reg

Last part position found (EYEPos)

PR[21]

Position Reg

Last part position with z-offset (EYEPosDz)

PR[22]

Position Reg

Robot position out of field of view (out_of_view)

../../../_images/sample_program.png

Fig. 214 Sample program - get_part scenario