Weight-Based Box Validation for Palletizing

In some palletizing applications, it can be useful to weigh a box to ensure that the correct number of products is inside. This helps prevent missing items and ensures quality control.

The force sensor embedded in UR robots allows measuring the applied force, making it possible to weigh objects. However, it is not a precision tool for determining the exact weight of a box. While the sensor offers good repeatability, its accuracy is limited, meaning an object weighing X kg may be detected with a slightly different value. To simplify calculations and programming, we will work directly with force in Newtons rather than weight in kilograms.

Determining the Force Values for a Typical Box

First, we need to determine the force values for a typical box. The Weight Box.urp program template allows you to measure and record the HighLimit and LowLimit detected for a standard box. In this program, you will need to:

  1. Define the AbovePickPose position 50 mm above the box to be picked.
  2. Insert a Gripper/Vacuum grip instruction to pick up the box.
  3. Insert a Gripper/Vacuum release instruction to release the box between measurements.

 

Once you have completed these steps, run the program. It will repeat 25 cycles before stopping Go to the variable tab and note the HighLimit and LowLimit values.

 

To validate detection accuracy, repeat the process with one product removed from the box. The difference between a full box and a box with a missing product must be significant for accurate detection.

If the HighLimit of a box with a missing product is very close to or overlaps with the LowLimit of a full box, the system may not detect the variation correctly. A sufficient difference also allows for a slightly wider range to account for minor variations during operation.

In the example above, we could set the HighLimit to 45N and the LowLimit to 40N, as long as the gap between a full box and a box with a missing product is large enough.

Integrating the Weight-Based Box Validation into Your Palletizing Program

For the next step, we assume you already have a functional program in which you want to integrate the Weight-Based Box Validation. To do this,

  1. Open the Weight-Based Box Validation for Palletizing.urp program template
  2. Click on the Initialize Variables folder
  3. Then click Copy in the bottom menu.

  1. Open your palletizer program
  2. Click on the Before Start section
  3. Paste the folder
  4. Then save your program

Repeat the process for the WeightBox Folder:

  1. Open the Weight-Based Box Validation for Palletizing.urp program
  2. Click on the WeightBox folder then click Copy

  3. Open your palletizer program
  4. Click inside the Grip section of the program
  5. Paste the folder
  6. Move your Grip/Vacuum instruction to the appropriate section in the program.

  7. For this program to work properly, the pick position defined in the URCap must be 50 mm above the box to be picked. Move the robot to your current pick position and set the new grip position 50 mm (2") higher.
  8. In the Before Start section, enter the HighLimit and LowLimit values obtained earlier when running the Weight Box.urp program. You may need to enter slightly larger values to account for potential variations.
  9. If a box is outside the defined range, the code in the following section will be executed. This is where you need to insert instructions for the robot’s response, such as moving the box to a specific location, triggering a popup, or activating an alarm.

     

    Note that the robot will automatically attempt to pick a new box once it exits this section. It will return to the pick position, so ensure the path is clear to avoid collisions. Alternatively, insert movements to reposition the robot above the pick position after discarding the box.

    You should now be able to run and test your program!

     

    Optimizing Cycle Time

    Note that this type of programming will impact cycle time. However, there are ways to minimize the delay.

    In this example, we defined the pick position above the box and performed a sensor zeroing before adding manual movements to grip the box. An alternative approach would be to define the pick position directly on the box, eliminating the need to stop for sensor zeroing and allowing the robot to grip the box immediately. In this case, the sensor zeroing could be performed at the box release, avoiding additional movements.

    For the zeroing process to work correctly, it must be done while the tool is not in contact with a box. One way to achieve this is by slightly increasing the programmed pallet height, forcing the robot to release the box from a higher position so the gripper is no longer touching it after release. However, this may cause slight movement of the boxes after placement. Performing the zero sensor at release may also affect the accuracy of the weight reading at the pick position. Therefore, ensure that the HighLimit and LowLimit values have enough buffer to account for detection variations.

    Another optimization is to remove the wait is_steady function after the relative move up before measuring the box weight.

This step is also included in the zero sensor function.



Removing these steps will improve cycle time but may reduce measurement precision. Again, make sure the HighLimit and LowLimit values have sufficient buffer to compensate for this variation. Generally, if the weight difference between a full box and a box with a missing product is significant enough, this should not be an issue.

If you need assistance, feel free to contact support@robotiq.com.