Keywords

1 Introduction

In the food processing company on the packaging line of finished products, there is a task of equalizing semi-finished products that are in the opened box. The necessity of the process is due to the fact that if the semi-finished products protrude outside the box, the packaging machine will not work correctly.

At the moment, the balancing is done by people. It is proposed to automate the alignment process. The publications [1, 2] describe the process of development of robot-manipulator DR-1, which has the necessary characteristics for the implementation of equalization. It uses forward and inverse kinematics [3, 4] for positioning the end-effector. Delta robots with the same construction are used to sort waste [5].

The aim is to develop an algorithm that, based on the signal from the sensor of the passage of the box on the conveyor belt, gives control commands to the robot manipulator. The same task was solved in [6, 7].

The tasks defined are:

  1. 1.

    To assemble an installation for the equalization of semi-finished products in laboratory conditions.

  2. 2.

    Create a mathematical description of the equalization process.

  3. 3.

    Develop an algorithm for the equalization process.

  4. 4.

    Calculate the errors in the execution of the algorithm.

  5. 5.

    Conduct tests of the resulting automation system.

2 Hardware Description

The nugget packaging production line consists of a conveyor belt and a robot arm DR-1 located above it. The robot is mounted on a frame. A working body is attached to the robot manipulator, which is a vibrating platform. The conveyor line has a maximum movement speed of 0.55 m/s and adjustable width, which allows moving boxes with nuggets one after another (Fig. 1).

Fig. 1
A photograph of the mixing unit of the nugget. It labels the end-effector, conveyor belt, special frame, box detector, and robot.

General view of the nugget mixing unit. A vibrating platform is used as the end-effector

The nugget box moves in the direction of the blue arrow (Fig. 1) and has the characteristics shown in Table 1.

Table 1 Features of the nugget box

A laser pointer and a photo-sensor were used as a detector, fixed at the beginning of the conveyor line, with a distance of about 0.7 m to the center of the robot. This is the best way because using RGB-D cameras [8] and neural networks to determine the position of the boxes [9, 10] takes too much time and is redundant in this situation. Used a more classic way, like here [11].

The photosensor outputs a discrete signal of 0 V if the box is not present, and 3.3 V if the box interrupts the beam. The sensor was connected to the discrete input of the onboard microcontroller of the DR-1 robot.

3 Mathematical Description of the Equalization Process

For simplification, the installation shown in Fig. 1, considers schematically from the side (Fig. 2) and from above (Fig. 3).

Fig. 2
A diagram depicts the triangular trajectory formed between M subscript 1, M subscript 2, and M subscript 3, and a downward acting arrow Z from M subscript 0 through M subscript 1. On the left, an object with M subscript k moves towards the triangle trajectory.

Diagram of the robot-manipulator working body movement when equalizing the box with nuggets, side view

Fig. 3
A schematic presents the arm movement of the robot. It indicates the distance between the object midpoint and the center of the circle is S subscript 0, M subscript 2, and M subscript 3, among others.

Schematic of the robotic arm movement when equalizing a box of nuggets, top view

The coordinate system, the center of which is located at point \(M_{0}\), the \(Z\) axis is directed downwards, the \(X\) axis makes an angle a with the central line of the conveyor, is presented. The \(Y\) axis complements the right triplet. The point \(M_{0}\) is the geometric center of the robot.

The angle \(a\) appears because the robot is attached to the frame in such a way that it cannot touch it when it moves. Therefore, the central axis of the conveyor is not coaxial with any of the axes of the robot’s coordinate system. The angle \(a\) is constant.

During the experiments on debugging of motion planning system of robot manipulator DR-1 it was found that the highest speed can be obtained by setting the motion path with a minimum number of points. This is due to the fact that the robot manipulator must stop at a given point. Therefore, the trajectory in the form of a triangle is used when performing the nuggets flattening operation (Fig. 2).

In Fig. 2, the blue rectangle is the box with the nuggets, the point \(M_{\kappa }\) is the center of its upper edge. The box appears in the line of sight of the robot manipulator at the moment of passing through the detector (point \(M_{\partial }\)). \(M_{0}\) is the origin of the coordinate system of the robot manipulator. The point \(M_{1}\) is the coordinate of the center of the bottom plate of the working body in the waiting position. The point \(M_{2}\) is the coordinate when the bottom plate of the robot manipulator first contacts the box. At this point, the impact on the nuggets in the box by the robot manipulator itself and the pneumatic vibrator placed on the working organ is carried out. This impact continues up to the point \(M_{3}\), the working body accompanies the box. At the point \(M_{3}\), the tool stops impacting the box and starts moving to the waiting position—point \(M_{1}\).

The point heights \(M_{1} ,\,M_{2} ,\,M_{3}\) are chosen experimentally. The quality of the nuggets and the safety of the packs and half-finished products depend on them. During the tests, it was observed that the best way to level the nuggets is to set the height of points \(M_{2}\) and \(M_{3}\) at the height of the top edge of the box. This height minimizes the impact of the implementation on the carton. The height of the point \(M_{1}\) is a few centimeters less (\(Z\)-axis pointing downwards) than \(M_{2}\) and \(M_{3}\), which is enough to prevent the box and the half-finished products in it from getting caught when the implement is moved.

At the moment the box passes through the detector (point \(M_{\partial }\), time moment \(t_{0}\)), the coordinates of the center of the box \(M_{\kappa }\) (1) and the projection of the distance \(M_{\kappa } M_{0}\) on the \(XY\) plane become known, denote \(S_{0}\). It turns out that \(S_{0}\) is the distance by which the box moves from the moment of its detection until it is directly below the middle of the robot.

$$ \left\{ {\begin{array}{*{20}l} {M_{{\kappa_{x} }} \, = \,M_{{\partial_{x} }} \, + \,\frac{{l\, * \,{\text{cos}}\left( a \right)}}{2}} \hfill \\ {M_{{\kappa_{y} }} \, = \,M_{{\partial_{y} }} \, + \,\frac{{l\, * \,{\text{sin}}\left( a \right)}}{2}} \hfill \\ \end{array} } \right. $$
(1)

where \(l\) is the length of the box, indexes \(x\) and \(y\) denote the projections on the corresponding axes.

The box moves to the projection of the point \(M_{0}\) with constant velocity \({\text{v}}\), equal to the velocity of the conveyor.

Thus, we can write down the equation of motion of the center of the box in projections to the \(X\) and \(Y\) axes, assuming that \(t\) is the current time:

$$ \left\{ {\begin{array}{*{20}l} {s_{x} \left( t \right)\, = \,s_{0} \, * \,{\text{cos}}\left( a \right)\, + \,{\text{v}}\, * \,{\text{cos}}\left( a \right)\, * \,\left( {t\, - \,t_{0} } \right)} \hfill \\ {s_{y} (t)\, = \,s_{0} \, * \,{\text{sin}}\left( a \right)\, + \,{\text{v}}\, * \,{\text{sin}}\left( a \right)\, * \,\left( {t\, - \,t_{0} } \right)} \hfill \\ \end{array} } \right. $$
(2)

It should be explained that the velocity \({\text{v}}\) will have a negative value in the coordinate system of the robot.

Let us define on the plane \(XY\) a circle with a radius \(R\) and center at \(M_{0}\), which will be the effective working area of the robot manipulator. This means that the robot will not perform equilibrium until the box moves inside the circle:

$$ \sqrt {s_{x} \left( t \right)^{2} \, + \,s_{y} \left( t \right)^{2} \, \le \,R} $$
(3)

The radius \(R\) was chosen experimentally. An experiment was conducted, in which \(R\) was decreased from 0.2 to 0.03 m. The criterion was the qualitative alignment of the nuggets (the nugget pack does not protrude beyond the top edge of the box) and the fact that the robot has time to align all the boxes on the conveyor belt. A high \(R\) value is excessive and doesn’t equalize all the boxes. A small value of \(R\), which degenerates into pushing from above on the box without accompanying it, is less effective from the point of view of leveling.

A \({\text{delta}}\) value is introduced for tracking multiple boxes. This is the time it takes for one box to completely travel down the conveyor belt past the box detector. The \({\text{delta}}\) is calculated by formula (4).

$$ {\text{delta}}\, = \,\frac{l}{{\text{v}}} $$
(4)

where \(l\) is the length of the box, \({\text{v}}\)—conveyor velocity. The \({\text{delta}}\) value allows excluding false triggers of the detector when one box moves and at the same time to signal the beginning of a new box, if they go one after another without separation.

Assign each box an ordinal number \(i\left( {i\, = \,1 \ldots } \right),\) and for each \(i\)-th box, we will remember \(t_{{0_{i} }}\)—the time of passage of each box through the detector, from which we can calculate the position of the box at a time \(t\).

4 Algorithm of Half-Finished Products Equalization

Based on the mathematical description of the semi-finished product equalization process, an algorithm has been developed, the description of which is given in natural language.

The algorithm is divided into 2 blocks, working in parallel.

The first block is responsible for processing signals from the box detector and recording time \(t_{{0_{i} }}\) in a ring queue:

In case a signal from the box detector arrives, do the following. If the queue is empty or the difference between the current time t and the last element of the queue is greater than or equal to the delta, then add the current time t to the end of the queue.

An empty queue means that no box has passed through the detector yet. The time difference must be determined in order to separate 2 boxes that follow each other.

The second block is responsible for calculating the position of the box whose time \(t_{0}\) is recorded at the beginning of the queue and sending control commands.

  1. 1.

    Set the signal “Operation allowed” to FALSE.

  2. 2.

    If the signal “Operation is permitted” is set to FALSE, go to step 3, otherwise go to step 5.

  3. 3.

    If the queue size is greater than 0, calculate the current position of the box according to formula (2), go to step 4, otherwise go to step 2.

  4. 4.

    If the current position of the box is within the working area of the robot (formula (3)), set the “Operation allowed” signal to TRUE and remove the first element from the queue, go to step 2.

  5. 5.

    Perform sequential movement from point \(M_{1}\) to \(M_{2}\), then from \(M_{2}\) to \(M_{3}\). Then from \(M_{3}\) to \(M_{1}\). Set the “Operation Allowed” signal to FALSE. Go to step 2.

The presented algorithm was implemented in the C +  + 11 standard programming language and integrated into the existing software solution as a node in the Robot Operating System (ROS) software platform [12,13,14].

This node communicates with forward and inverse kinematics solver nodes via topics and [15] tells it works in real-time. It is suitable to use the Linux real-time kernel patch as done here [16] to increase performance. TCP/IP connection over Ethernet is used in robotics and is quite efficient [17]. The onboard microcontroller uses the operating system FreeRTOS, which is real-time [18].

5 Errors Estimation

It is especially important to estimate the errors when performing work on the equalization of boxes with nuggets because we consider the high-speed section of the production line, where errors can lead to damage to semi-finished products and packaging containers.

The permissible positioning error of the working body is \(e\) = 0.02 m. This is the difference between the length and width of the box and the similar parameters of the lower part of the working body.

At the speed of the conveyor in \({\text{v}}\) = 0.55 m/c error in time can be no more than \(t_{{{\text{err}}}}\) = 36 ms. The calculation was carried out according to the formula (5).

$$ t_{{{\text{err}}}} \, = \,\frac{e}{{\text{v}}} $$
(5)

Table 2 shows the main delays that can affect the positioning error.

Table 2 Basic system delays

Thus, in the worst case, the delay will be no more than 23 ms, which satisfies the conditions.

6 Tests

Three boxes of nuggets with nuggets protruding outside the package were used for the tests. The main condition for quality leveling was to level the nuggets in such a way that they do not protrude outside the package. Also, the integrity of the packaging and the semi-finished products was evaluated, here we should take into account that the equalization must be done exactly once in production conditions, and in the experimental conditions, it was done several times.

Boxes of nuggets were placed on the conveyor belt before the detector in various combinations:

  1. 1.

    One box.

  2. 2.

    Two boxes going across the gap.

  3. 3.

    Two boxes going side by side.

  4. 4.

    Three boxes going side by side.

The case with three boxes going in a row was considered most “thorough” as the most difficult to perform.

Twenty experiments were conducted. The boxes were consecutively fed on the conveyor so that there were no gaps between them (Fig. 4). After that, the boxes were influenced and the result was checked (Fig. 5). All boxes of nuggets were successfully aligned. Damage to the carton and some of the nuggets was observed. No damage to the polyethylene packaging was observed.

Fig. 4
A photograph of the boxes of the nuggets where the nuggets packets stick out on the box edges.

Boxes of nuggets before the test. The nuggets protrude over the edges of the box

Fig. 5
A photograph of the boxes of the nuggets where the nuggets packets are placed properly inside the box.

The result of the algorithm. The nuggets do not protrude over the edges with the box

7 Conclusions

In the course of the study, all of the objectives have been achieved. The goal of the research has been achieved. The developed algorithm showed effectiveness in the equalization of boxes of nuggets, it can be used in industry after longer testing in the complex with the robot manipulator and the working body.

At the same time, the disadvantages of the robot manipulator design were identified:

  1. 1.

    Installation of a more rigid connection to the conveyor belt.

  2. 2.

    Reducing positioning error by transferring the algorithm from the control computer to the onboard microcontroller, which is a real-time system, for example [19].

  3. 3.

    Adding the ability to quickly calibrate the system in-house, for example [20].

Such improvements will allow more efficient and less costly use of the equalization algorithm and the entire automation system.