Callbacks

With Callbacks you can extend the functionality of Pally to your needs.

Your Waypoints or custom code in the Callback will automatically be executed when that specific events occur.

 

 

Some typical use examples for Callbacks are:

  • Turning the conveyor on/off

  • Control a light tower to notify operators

  • Add a shim paper routine

  • Perform custom moves on the robot

    • Sort out bad boxes

    • Scan barcode on a box

  • Signal external machines

And many more..

 

Callbacks

Initial MoveJ node

Executed once on startup, after all configuration variables have been initialized. This allows runtime configuration changes and special tuning.

beforePallet

Before starting a new and empty pallet.

  • Start conveyor

  • Start other machine

  • Initialize variable that should be use trough the program

beforeZone

Before entering a new zone (typically a new layer on the pallet)

  • Lifting column control

  • Action before new layer or zone

onNextTask

Before starting all calculations for the next pick and place.

  • Modify path planning parameters dynamically

  • Prepare for custom motion towards the pick point

beforeGrab

Before lifting up a box from the pickup position. (gripper is placed onto the box)

afterGrab

After lifting up a box from the pickup position. (gripper is placed onto the box)

beforeRelease

Before releasing a box on the pallet (target position).

afterRelease

After releasing a box on the pallet (target position).

afterZone

After leaving a completed layer or zone.

onSheet

When a shim paper needs to be inserted. Add your own manual waypoints to shim/slip paper tray, pick the paper and move to a position over the pallet to where paper should be placed. See shim paper article for more information.

afterPallet

After the pallet is completed.

Variables

The user-defined commands can utilize the values of the following global variables:

  • LayerAlt: The altitude, measured from the top of the empty pallet (accumulated height of all layers up to the current layer - mainly used in shim paper routines).

  • LayerHeight: Height of the layer currently being processed. For normal layers this is identical to the product height. For shim paper layers this contains the thickness of the current shim paper.

  • LayerNr: Indicates which layer is being palletized, starting from 0.

  • MountPosition: variable to use with custom path as dynamic position is activated

  • MovePerformed: this is a user writable variable to indicate that the robot has been moved to the MoveTarget position and the program should skip the movement. With this variable it is possible to implement custom movement from the pickup to the target position, or back from the target position to the waiting position. Set this variable to True in either afterGrab or afterRelease, depending on the direction of the movement that has been performed by user code.

  • MoveTarget: target position. In the beforeGrab callback, this value contains the pose of the pick position for the next box(es) including gripper rotation and offset corrections. In the afterGrab callback, it contains the target pose of the box on the pallet where the robot should move. In the afterRelease callback it contains the pose of the default waiting position, transformed by the lifting column position.

  • PalletCenter: A pose that defines the position and orientation of the pallet top center.

    • e.g used with slim/shim paper

  • PalletNr: 1=right pallet, 2=left pallet.

  • ProductCount: The number of boxes on the pallet, starting from 0. Please note the value is updated between beforeRelease and afterRelease.

  • ProductHeight: Height of the box that is being palletized.

  • ProductName: Name of the product that is being palletized.

  • TaskCompleted: this is a read-write boolean variable to indicate that the box(es) are successfully palletized and the box counter can be incremented. The default value is normally True, but can be False when a vacuum sensor is installed and vacuum is not detected at the target position before releasing the boxes. Set this variable to False to repeat the same box position, e.g. when a project-specific quality check is implemented and some boxes are moved from the pickup position to a waste bin instead of being palletized.

  • WorldPosition: A pose that defines an extra transformation for elevated lifting columns.

  • ZoneNr: Indicates which part of the pallet is being palletized (when using zones of lifting columns).

List of global variables in Pally

List of global variables in Pally

 

Examples

 

1. Full pallet timer

Timer for counting how long a full pallet would take. The value is presented in the RUN screen

 

2. Shim paper routine

The entry point of a user defined shim paper routine is the onSheet callback. Put your code here to define a robot trajectory suitable for inserting shim papers between layers.

URP’s is added outside the program and called on from the onSheet Callback

For better readability, we have extracted the shim paper logic into two separated subprograms:

  • get the shim paper from the tray, and

  • put the shim paper on the pallet.

 

Picking shim paper from a tray is common for both left and right pallets

Moving the shim paper to each pallet may be impemented separately

 

3. Change optimizer parameters for the next box

The entry point for changing optimizer parameters is typically the onNextTask callback, which is executed before all calculations begin.



4. Custom path

Control the robot motion directly when specfic events occur.