Programming Pally for Doosan
This article is written for Pally for Doosan cobot
To make a palletizer program, you’ll need to open the Task Editor.
From the Pally you have two different nodes:
Init Pally (optional)
Get access to the Pally context (variables) and set up your callbacks
Run Pally (required)
Configure the maximum speed and acceleration for Pally
Init Pally program node
This node is optional. You can configure callbacks and get access to the Pally context via this node.
Define Pally context global variable
This is required in order to access the Pally variables.
Define a global variable for Pally and initialize it to 0. The examples here use Global_pally_context
.
Set up callbacks
Create your own subroutines that will be called at specific events during palletizing. Enter the name of each subroutine in the corresponding edit-box, or leave the edit box empty.
Currently the following events are available:
beforePallet: Before starting a new empty pallet.
beforeZone: Before entering a new zone.
onNextTask: Before starting all calculations for the next box(es)
beforeGrab: Before lifting up a box from the pickup position.
afterGrab: After lifting up a box from the pickup position.
beforeRelease: Before releasing a box on the target position.
afterRelease: After releasing a box on the target position.
afterZone: After leaving a completed zone.
onSheet: When a shim paper needs to be inserted.
afterPallet: After the pallet is complete.
Access the Pally context
The Init Pally program node will return a variable called Global_pally_context
which points to an object with configuration data inside the Pally module.
You can use Global_pally_context anywhere in the callback subroutines or below the Init Pally program node in the main program to change any Pally settings in runtime.
In Pally you can get access to the following variables via Global_pally_context:
# tuning parameters
max_speed
max_acceleration
precise_speed
precise_acceleration
min_grip_quality
release_strategy
grip_delay
grip_release_delay
blend
product_selection_strategy
product_selection_predefined
force_palletizing_mode
trace_program_callbacks
gui_ip
set_workpiece_weight
set_weight_workaround
gripper_weight
gripper_tcp
gripper_cog
start_pos
start_jpos
# callback context
Instance
MovePerformed
TaskCompleted
ZoneNr
LayerNr
ProductCount
ProductName
LayerAlt
LayerHeight
PalletNr
PalletCenter
MoveTarget
MountPosition
# IO
# conveyor IO
l1_sensors
l2_sensors
# gripper IO
pick_signals
drop_signals
vacuum_lost_sensor
# pallet confirmation IO
p1_button
p2_button
p1_led
p2_led
# LED tower undefined
green_led
yellow_led
red_led
Example:
Global_pally_context.grip_release_delay=0.5
Example II:
movel(Global_pally_context.MoveTarget)
Global_pally_context.MovePerformed=True
Currently there are some (experimental) settings in the Pally context that can be changed. Parameters and their default values are shown below:
max_speed = 1300
max_acceleration = 1300
precise_speed = 200
precise_acceleration = 200
grip_delay = 0.2
grip_release_delay = 0.2
blend = 0.3
force_palletizing_mode = False
trace_program_callbacks = False
gui_ip = "127.0.0.1"
set_workpiece_weight = False
gripper_weight = 2.6
gripper_cog = [0.0, -100.0, 50.0]
l1_sensors = [ [0, 1], [0, 2] ]
l2_sensors = []
pick_signals = [ [1, 1] ]
drop_signals = [ [1, 2] ]
vacuum_sensor = [1, 1]
Here is an expample on how to add callbacks