KUKA calibration program

This example program requires that Pickit is installed and set up with your robot. For installation instructions, please refer to the KUKA installation and setup article.

Before following these KUKA specific instructions in this article, make sure you first understand the process of executing a robot-camera calibration as explained on Calibration.

Note

If you want to perform perform robot-camera calibration infrequently, you don’t need to write a calibration robot program. You can teach the calibration poses manually using the robot pendant and the Collect current pose button of the calibration wizard.

If, on the other hand, you expect to run calibration multiple times, an automated calibration program makes sense. You can run it whenever the camera has moved with respect to its fixture. This is the case when you’re setting up your application and the camera location is not yet fully decided. It can also be the result of calibration validation detecting an unexpected change.

Example program: PickitMultiPoseCal

Attention

The examples contained in the Pickit application files contain hard-coded robot poses that should be adapted to every new robot. For PickitMultiPoseCal, you must reteach all the XP1, XP2, … poses. Also make sure the parameters in Pickit_configure_calib() are correct for your setup. When executing such programs for the first time, please do so in manual mode and at low speed to check for potential collisions.

This example program can be found in R1 > Program > Pickit > PickitMultiPoseCal. It runs a complete multi-pose calibration: it configures the calibration, detects the calibration plate at ten taught poses, and computes the result.

DEF PickitMultiPoseCal( )

    ;FOLD INI;%{PE}

    IF NOT Pickit_is_running() THEN
        IF Pickit_comm_is_ok() THEN
            PickitMessages(#info, 1) ;Pickit not in ROBOT mode
        ENDIF
        HALT
    ENDIF

    ; Start calibration procedure - Pickit_configure_calib()
    ; Change PICKIT_CAM_FIXED (0) to PICKIT_CAM_ON_ROBOT (1) if the camera is mounted on the robot
    Pickit_configure_calib(PICKIT_CALIB_MULTI_POSE, PICKIT_CAM_FIXED, ZERO_TF)

    PTP Xhome

    PTP XP1
    WAIT SEC 0.5
    Pickit_do_calibration()

    PTP XP2
    WAIT SEC 0.5
    Pickit_do_calibration()

    ...

    PTP XP10
    WAIT SEC 0.5
    Pickit_do_calibration()

    ; Calculate calibration
    Pickit_compute_calib()

    IF Pickit_comm_is_ok() AND (CON_PI_P2R_DATA.Status==PICKIT_COMP_CALIB_OK) THEN
        MsgNotify("Calibration done. Read the results from the web interface.")
    ELSE
        MsgNotify("Calibration failed - result discarded")
    ENDIF

    PTP Xhome

END

Note

The listing above is a simplified rendition of the shipped program: the KUKA inline form folds around the motion instructions are collapsed into a single PTP line each, and poses XP3 to XP9 are omitted. Always start from the program shipped with your Pickit installation files and adapt it to your application.

Below, each step of the program is explained.

Configure the calibration

Pickit_configure_calib tells Pickit which calibration to run. It has to be called before the first Pickit_do_calibration:

  • The calibration method is the first argument. PICKIT_CALIB_MULTI_POSE or 1 selects the multi-pose method used by this program.

  • The camera mount is the second argument. Change PICKIT_CAM_FIXED (0) to PICKIT_CAM_ON_ROBOT (1) if the camera is mounted on the robot.

  • The transformation is the third argument, and is unused by the multi-pose method. This program passes ZERO_TF, a zero frame declared in PickitMultiPoseCal.dat. You can also leave out this third argument.

See Pickit_configure_calib() for the full description of these arguments.

Note

Alternatively, pass PICKIT_CALIB_DEFAULT as the method to use the calibration method and camera mount configured in the Pickit web interface, in which case the other two arguments are ignored.

Teach calibration points

The calibration program requires ten poses to be defined (P1 - P10). For more information on how to define these poses, see the article on Multi poses calibration.

At each pose, Pickit_do_calibration triggers a detection of the calibration plate. This only locates the plate, it does not compute the calibration. The WAIT SEC 0.5 before each call lets the robot come to a complete standstill, so that the plate is detected while the robot is not moving.

See Pickit_do_calibration() for more information.

Compute the calibration

After the last pose, Pickit_compute_calib computes the calibration from the ten collected plate detections. Until this call succeeds, nothing has been calibrated.

The program then checks the outcome and reports it on the smartPAD. On success, the calibration result can be read from the Pickit web interface, or from the robot program with the Calibration results functions.

See Pickit_compute_calib() for more information.