Jump to content

Matrix Palletizing and Error Recovery: Difference between revisions

From Wiki
Created page with "In palletizing applications error recovery should be considered: An item not being picked correctly or dropping before placing may result in an empty spot on the pallet. The motion program failing may require restarting the program from the first step. This guide gives hints and examples on how to handle these issues when using the matrix command for palletizing, but it can be useful for any looping application. = Matrix Loop vs Matrix Query = The following advice expec..."
 
(No difference)

Latest revision as of 11:36, 1 October 2025

In palletizing applications error recovery should be considered: An item not being picked correctly or dropping before placing may result in an empty spot on the pallet. The motion program failing may require restarting the program from the first step. This guide gives hints and examples on how to handle these issues when using the matrix command for palletizing, but it can be useful for any looping application.

Matrix Loop vs Matrix Query

The following advice expect that you understand the Matrix Query command. While the Matrix Loop command is easy to use and sufficient for basic palletizing tasks it can not easily be entered at a specific index or position, making error recovery difficult. Therefore we recommend using the Matrix Query command: Here you can "ask" the matrix for the position for a specific index (counting from 0 to the number of items on a pallete layer - 1). This allows you to start at any index, repeat indices and handle indices out of order.

The basic idea for using the Matrix Query:

  1. Define the A, B and C corner positions of the pallet as position variables
  2. Call the Matrix Definition command with corner positions A, B and C
  3. Define a number variable for specifying the current pallet position index
  4. Use the Loop command: In V14-005 or newer: use the counting loop and set your index variable as the counting variable OR (supported in all versions) use a conditional loop which checks whether the index is smaller than the number of items on the pallete layer (e.g. "myIndex < 8")
    1. Call the Matrix Query command to get the target position for the current index
    2. Add motion and logic commands to pick the item and place it at the target position
    3. If you use the conditional loop use the Math command to increase the index by 1

In comparison the Matrix Loop command handles the index variable and the loop.

Starting the program with a partially-filled pallet

Sometimes you need to start the process with a non-empty pallet. In this case the index variable must be set to the next-to-be-placed position on the palette before re-starting the palletizing. This can be done in several ways.

Persistent variables

Persistent variables keep their value even if the robot control is shut off. This allows easy restarting the process at the last position.

Since version V14-004-3 you can define persistent variables either via the iRC PC software (click the add button in the variables section below the 3D view) or using the Store command in the robot program, which does this automatically and is the recommended approach. Note that the store command is ignored for persistent variables once they exist so they do not get overwritten on program restart. To set a persistent variable in the robot program you need to use the Math command with "set" operation.

In earlier versions you can use the pre-defined system variables "#parts-good" and "#parts-bad" despite the names. Here the Store command will overwrite the values but since these variables are always present you do not need to define them using the Store command.

Since version V14-004-3 you can set the variable's value (i.e. the pallet's starting index) in the iRC PC software, in earlier versions you need to set the starting position in the robot program using the Store command.

Alternatively you can set the variable using PLC or other controls. Hint: If your robot program needs to wait for the PLC to set the starting index, use a global signal and a conditional wait command: Set the global signal to false when the program starts, then wait till it is set to true by the PLC.

Repeating pallet positions on error

For a more automatic error recovery you may want to repeat a pallet position on error. The following example aborts and repeats the current step if the motion program is paused or stopped, e.g. on error or by the operator.

For this approach you need both the motion program and a logic program, which runs in parallel to the motion program and does not stop on error. The logic program observes the motion program's run state and commands it to abort and repeat if necessary.

You can get the example program here: File:ExampleRecoverableMatrix.zip, run it in a simulation of a DLE-RG-0001 room gantry and observe the behavior when you pause and continue the program.

Logic Program

Motion program for a recoverable matrix

The logic program uses an IF command to repeatedly check the system variable "#programrunning". If it is 0 the motion program is stopped or paused, otherwise it is 1. If the motion program is not running a global signal is set to true using the Digital Output command to request repeating the step.

Motion Program

Motion program for a recoverable matrix

The motion program does not change much from the usual Matrix Query program. You need to use the conditional loop approach explained in the "Matrix Loop" section above, this will not work with the counting loop.

  • Reset the global signal to false on startup (before entering the loop)
  • To abort any motion commands inside the loop set their abort condition to the global signal, e.g. "GSig1".
  • Add an IF command that checks whether the global signal is set. In the example the condition is "!GSig1", meaning the first IF-branch is called when the global signal is not set, the normal case. Move the Math command that increases the index variable here, we do not want to go to the next position when aborted.
  • In the ELSE-branch add a Digital Output command to reset the global signal to false

Configuration

Once the motion and logic programs are created you need to load them. You can load the logic program in the Program configuration section ("File" -> "Configure Project" -> "Program"). In the same section set the error state of the motion program to "Pause", so the motion program continues inside the loop on error.