Packaging Process Optimization in Multihead Weighers with Double-Layered Upright and Diagonal Systems

: In multihead weighers, packaging processes seek to ﬁnd the best combination of passage hoppers whose product content provides a total package weight as close as possible to its (nominal) label weight. The weighing hoppers arranged in these machines dispense the product quantity that each package contains through computer algorithms designed and executed for this purpose. For its part, in the packaging process for double-layered multihead weighers, all hoppers are arranged in two levels. The ﬁrst layer comprises a group of weighing hoppers, and the second comprises a set of booster hoppers placed uprightly or diagonally to each weighing hopper based on design of the machine. In both processes, the initial machine conﬁguration is the same; however, the hopper selection algorithm works differently. This paper proposes a new packaging process optimization algorithm for double-layer upright and diagonal machines, wherein the hopper subset combined has previously been deﬁned, and the packaging weight is expressed as actual values. As part of its validation, product ﬁlling strategies were implemented for weighing hoppers to assess the algorithm in different scenarios. Results from the process performance metrics prove that the new algorithm improves processes by reducing variability. In addition, results reveal that some machine conﬁgurations were also able to improve their operation.


Introduction
Multihead weighers were first used in the 1970s and, since then, they have been used to improve industrial process performance. Currently, they are used in different packaging processes for several products, regardless of their shape or size, and have become particularly essential in the food industry [1,2]. Multihead weighers play a fundamental role in the industrial process given the accuracy and speed they provide to the packaging process. Once programmed, they can automatically package several food industry products, including products with heterogeneous characteristics. This ensures compliance with current regulatory standards while reducing production costs by maintaining an efficient, high-volume product flow and preserving process quality. Still, one of the most prominent process requirements is that package contents must match the weight printed on its label. This becomes one of the main issues that must be addressed to guarantee high-quality standards in the final product, with variability being directly related to the quality of the process [3]. In this sense, authors such as Taguchi [4] claim that product quality depends on how close its quality features are to their nominal value, in such a way that everything that deviates from said nominal value is considered as a loss to society. Hence, quality in the packaging process may be achieved by reducing variability around the target weight (T) [5]. For these purposes, processes must be streamlined trying to guarantee that package content weights are as close as possible to the weight specified on the label. Optimization techniques, new algorithms, and experiments' design can be used as quality engineering tools for the improvement and optimization of industrial processes [6].
Multihead weighing systems are mainly composed of a vibrating feeder system, n feeding hoppers (H F ), n weighing hoppers (H W ), and a discharge conduit to a packaging machine. In a traditional single-layer machine (without booster hoppers), the internal algorithm combines all the n weighing hoppers in the machine to form a subgroup H of k hoppers and then selects a subset H ∈ H W whose sum of weights is the closest to the target weight T of the package. In this sense, package content weights are obtained by combining a subgroup of k hoppers from the n weighing hoppers that the machine contains, with k ≤ n. However, double-layered (upright and diagonal) weighers contain an additional layer of hoppers and use a larger combination of hoppers to reach the target weight. In these double-layered machines, each of the n weighing hoppers (H W ) has a booster hopper (H B ) underneath, in which a single product ration can be stored, while the weighing hoppers receive a new product ration from the feeding hoppers (H F ), as illustrated in Figure 1. For each package, all the hoppers must contain a certain product quantity, and the machine must combine k hoppers of the 2n so that the system must form a subset H of k hoppers. For double-layered upright systems, this subset H can be formed with booster hoppers or weighing hoppers as long as its corresponding booster hopper is part of the k hoppers, while, for the double-layered diagonal systems, a weighing and booster hopper cannot be selected simultaneously for the same k-nuple.
Mathematics 2021, 9, x FOR PEER REVIEW 2 of 21 variability around the target weight ( ) [5]. For these purposes, processes must be streamlined trying to guarantee that package content weights are as close as possible to the weight specified on the label. Optimization techniques, new algorithms, and experiments' design can be used as quality engineering tools for the improvement and optimization of industrial processes [6]. Multihead weighing systems are mainly composed of a vibrating feeder system, feeding hoppers ( ), weighing hoppers ( ), and a discharge conduit to a packaging machine. In a traditional single-layer machine (without booster hoppers), the internal algorithm combines all the weighing hoppers in the machine to form a subgroup of hoppers and then selects a subset ′ ∈ H whose sum of weights is the closest to the target weight of the package. In this sense, package content weights are obtained by combining a subgroup of hoppers from the weighing hoppers that the machine contains, with ≤ . However, double-layered (upright and diagonal) weighers contain an additional layer of hoppers and use a larger combination of hoppers to reach the target weight. In these double-layered machines, each of the weighing hoppers ( ) has a booster hopper ( ) underneath, in which a single product ration can be stored, while the weighing hoppers receive a new product ration from the feeding hoppers ( ), as illustrated in Figure 1. For each package, all the hoppers must contain a certain product quantity, and the machine must combine hoppers of the 2 so that the system must form a subset of hoppers. For double-layered upright systems, this subset can be formed with booster hoppers or weighing hoppers as long as its corresponding booster hopper is part of the hoppers, while, for the double-layered diagonal systems, a weighing and booster hopper cannot be selected simultaneously for the same k-nuple. This research study proposes a new optimization algorithm for double-layered upright and diagonal machines that seeks to select a subset of hoppers whose total weights are greater and closer to the target weight . The algorithm was validated through a case study for actual products, wherein the performance characteristics of the process were measured in different scenarios. In numerical experiments, filling strategies designed and validated for three weighing hoppers in previous studies were tested. Likewise, different values from previously established combined hoppers were tested in each filling strategy.
This article is structured as follows: Section 2 presents the state of the art within the multihead machine packaging process field. In Section 3, the weighing process for doublelayered upright and diagonal multihead weighers is described. Section 4 discusses the This research study proposes a new optimization algorithm for double-layered upright and diagonal machines that seeks to select a subset H of k hoppers whose total weights are greater and closer to the target weight T. The algorithm was validated through a case study for actual products, wherein the performance characteristics of the process were measured in different scenarios. In numerical experiments, filling strategies designed and validated for three weighing hoppers in previous studies were tested. Likewise, different values from previously established k combined hoppers were tested in each filling strategy.
This article is structured as follows: Section 2 presents the state of the art within the multihead machine packaging process field. In Section 3, the weighing process for double-layered upright and diagonal multihead weighers is described. Section 4 discusses the different hopper-filling strategies used in the process. Then, Section 5 explains the optimization model and the packaging algorithm proposed for double-layered weighers. Section 6 lists the results and provides a preliminary assessment of the numerical experiments. Next, Section 7 contains the results from the experimental design for the different process scenarios evaluated. Finally, Section 8 discussion and Section 9 elucidate our conclusions from this research study.

Background
The documented research studies of multihead machines propose diverse solutions for packaging issues. Different algorithms and solution and configuration models have been presented for these processes. For example, some authors propose an optimal scheme for determining ideal operation times for vibrating linear feeders in multihead weighers. In their corresponding studies, they found that the least-squares method can be used to reduce variability against fixed operating times [7]. A bit-operation-based weighing algorithm succeeded in proving that operation times can be reduced and that the output weight from uneven hoppers is closer to the desired target weight [8]. In other research studies, the product residence time in hoppers was introduced as a second objective. Hence, the packaging problem was formulated as a bicriteria approximation issue for discrete weights, and a dynamic programming algorithm was proposed for its solution. This algorithm aimed to reduce the maximum duration of the product in the packaging system [9] while assuring that the total weight of each package was as close as possible to its target weight. Similar work was approached for double-layered upright and diagonal machines for discrete weights in the hoppers, using a bicriteria dynamic programming algorithm for these machines [10]. Subsequently, the bicriteria model proposed by [9] was ultimately improved through algorithms designed to reduce execution times, which makes the packaging process more efficient [11]. Later, these theories were extended to duplex and quasi-duplex machines [12]. In the same sense, heuristic algorithms have been proposed to find better results in the bicriteria packaging process, targeting label weights, and priority orders [13,14]. Likewise, several optimization algorithms have been proposed to determine the optimum product flow rate for radial feeders, seeking to minimize expected production costs per each "compliant" package within a fixed period of time. In this study, the response surface methodology identified conditions of minimal process variability and lower costs, compared to an industrial solution [15]. A heuristic optimization model based on a detailed characterization of what constitutes a near-optimal solution to the multihead weigher configuration problem has also been proposed. This model reduced hopper combination response times according to each package weight, in addition to finding the right hopper feeding points to minimize the mean square error for package weights [16]. Statistical control of the packaging process has also been addressed. For example, several modified control charts have been developed and studied to monitor and control the package production process [17]. Finally, new bio-objective approaches have been developed for the optimization of actual package weights [18,19], incorporating package target weights and the priority associated with the product discharge times reported by hoppers into the model. The innovation proposed by these approaches is that the relative importance of the objectives is managed and dynamically adjusted in each packaging operation, thus determining the best operation conditions for each process [20]. These approaches are extremely useful for packaging fresh or frozen products. As evidenced, hitherto, no scientific content has been disclosed regarding diagonal and upright machines considering actual weights in hoppers with previously established k values. Therefore, this study becomes quite relevant as it proposes a new optimization algorithm for double-layered upright machines that considers actual weights and preestablished k values.

Weighing Process on Double-Layered Upright and Diagonal Weighers
The packaging process in double-layered multihead weighers consists of selecting a subset H from the set H of the 2n machine hoppers to produce each package. Initially, the product is distributed through the vibrating channels to the feeding hoppers, Then, it is discharged to the H Wi weighing hoppers (i = 1, 2, 3, . . . n), where the product is weighed. In double-layered upright and double-layered diagonal weighers, each of the weighing hoppers has a booster hopper, in which the content of the weighed product can be stored.
For this reason, once the product is weighed, it is discharged into the corresponding H Bj booster hoppers (j = n + 1, n + 2, . . . 2n), and the weighing hopper receives a new portion of the product, as denoted in Figure 2. Once all the hoppers are full (weighing and booster), the machine calculates the combinations of all the weights, selecting a subset H of k hoppers whose sum of the weights is greater and closer to the target weight T. Then, the unloaded hoppers are filled with a new product to repeat the procedure until completing the Q number of packages required.

Weighing Process on Double-Layered Upright and Diagonal Weighers
The packaging process in double-layered multihead weighers consists of selecting a subset from the set of the 2 machine hoppers to produce each package. Initially, the product is distributed through the vibrating channels to the feeding hoppers, Then, it is discharged to the weighing hoppers ( = 1,2,3, … ), where the product is weighed. In double-layered upright and double-layered diagonal weighers, each of the weighing hoppers has a booster hopper, in which the content of the weighed product can be stored. For this reason, once the product is weighed, it is discharged into the corresponding booster hoppers ( = + 1, + 2, … 2 ), and the weighing hopper receives a new portion of the product, as denoted in Figure 2. Once all the hoppers are full (weighing and booster), the machine calculates the combinations of all the weights, selecting a subset of hoppers whose sum of the weights is greater and closer to the target weight . Then, the unloaded hoppers are filled with a new product to repeat the procedure until completing the number of packages required. The weights in the hoppers are arranged in a normal distribution ~( , ) [14][15][16], where is the average weight of the product to be provided in each weighing hopper , and is the standard deviation. Previous studies have found that has a direct correlation with the mean quantity and linearly depends on it, due to vibrating feeding systems, according to = ; where is a proportionality coefficient and varies according to the characteristics of the packaging product [14][15][16][17]19].
For each discharge, the single-layer machine performs a number of combinations (NC) determined by Equation (1), where is the total number of hoppers in the system and is the hoppers to be combined. By adding the booster layers, the NCs for the double-layered upright and diagonal machines increase, being greater in the latter.

=
(1) For each package produced, the double-layered upright machine can discharge booster hoppers or simultaneously discharge the weighing hopper and its corresponding booster hopper (Figure 3), making the NC greater, thus improving the possibility of finding a subset of hoppers that meet the target weight requirement. Depending on the number of weighing hoppers, we have several types of combinations. For example, the system can combine booster hoppers or ≤ booster hoppers, where is an integer, with their corresponding weighing hoppers and the other − booster hoppers. The w i weights in the hoppers are arranged in a normal distribution w i ∼ N(µ, σ) [14][15][16], where µ is the average weight of the product to be provided in each weighing hopper H Wi , and σ is the standard deviation. Previous studies have found that σ has a direct correlation with the mean quantity µ and linearly depends on it, due to vibrating feeding systems, according to σ = γµ; where γ is a proportionality coefficient and varies according to the characteristics of the packaging product [14][15][16][17]19].
For each discharge, the single-layer machine performs a number of combinations (NC) determined by Equation (1), where n is the total number of hoppers in the system and k is the hoppers to be combined. By adding the booster layers, the NCs for the double-layered upright and diagonal machines increase, being greater in the latter.
For each package produced, the double-layered upright machine can discharge booster hoppers or simultaneously discharge the weighing hopper and its corresponding booster hopper (Figure 3), making the NC greater, thus improving the possibility of finding a subset of hoppers that meet the target weight requirement. Depending on the number of weighing hoppers, we have several types of combinations. For example, the system can combine k booster hoppers or i ≤ k 2 booster hoppers, where i is an integer, with their corresponding weighing hoppers and the other n − i booster hoppers. For = 2, when combining the booster hoppers, combinations are obtained, but the weighing hopper with its corresponding booster can also be combined; therefore, there are additional cases (see Equation (2)). In the same sense, for = 3, first, there are booster hopper combinations. In addition, the weighing hoppers can be combined with booster hoppers, and each pair can be associated with − 1 hoppers, replicated times (see Equation (3)). By mathematical induction of Equations (2)-(8), it is deduced that, in general, the total NC of ≤ hoppers is determined by Equation (9), where 2 represents the integer part of .
Furthermore, for double-layered diagonal machines, only booster hoppers, only weighing hoppers, or a combination of both levels can be discharged to produce each package, as long as a weighing hopper and its booster are not simultaneously unloaded, as denoted in Figure 4.
For example, for = 2, weighing hopper combinations are generated, each of the weighing hoppers can be associated with − 1 booster hoppers replicated times and, finally, booster hopper combinations, the mathematical expression to generate the combinations is shown in Equation (10). For = 3, only three booster hoppers can be combined, i.e., two booster hoppers with one of the − 2 remaining weighing hoppers, For k = 2, when combining the booster hoppers, n 2 combinations are obtained, but the weighing hopper with its corresponding booster can also be combined; therefore, there are n additional cases (see Equation (2)). In the same sense, for k = 3, first, there are n 3 booster hopper combinations. In addition, the weighing hoppers can be combined with booster hoppers, and each pair can be associated with n − 1 hoppers, replicated n times (see Equation (3)). By mathematical induction of Equations (2)-(8), it is deduced that, in general, the total NC of k ≤ n hoppers is determined by Equation (9), where 〚 k /2〛 represents the integer part of k 2 .
Furthermore, for double-layered diagonal machines, only booster hoppers, only weighing hoppers, or a combination of both levels can be discharged to produce each package, as long as a weighing hopper and its booster are not simultaneously unloaded, as denoted in Figure 4.   For example, for k = 2, n 2 weighing hopper combinations are generated, each of the weighing hoppers can be associated with n − 1 booster hoppers replicated n times and, finally, n 2 booster hopper combinations, the mathematical expression to generate the combinations is shown in Equation (10). For k = 3, only three booster hoppers can be combined, i.e., two booster hoppers with one of the n − 2 remaining weighing hoppers, one booster hopper with a combination of two of the n − 1 remaining weighing hoppers, or only three weighing hoppers. Equations (10)-(13) denote the calculation of the combinations for k = 2, 3, 4, and 5. In general, by mathematical induction, the total NC of k hoppers with k ≤ n is determined by Equation (14). Table 1 below presents an example of the NC that can be generated for each machine type for n = 16 with k = 2 up to k = 8. As aforementioned, in its initial configuration, the double-layered upright machine has a restriction in the combination of the k system hoppers (H m ). Specifically, a hopper of H Wi can only be part of a k − nupla of hoppers if and only if the set of the k hoppers contains H Bj , with j = n + i. However, in the double-layered diagonal machine, all H Wi and H Bj that belong to the k − nupla must meet the condition of i = j − n. Figure 3 below illustrates the invalid combinations for each machine. For example, for n = 10 with k = 3, Hopper 3 in a double-layered upright system is a weighing hopper, while Hopper 13 is a booster hopper. Here, Hopper 3 may be selected for combination provided that Hopper 13 is also selected, while, for the diagonal system, they cannot be selected simultaneously. Examples 7 and 8 of Figure 5 denote invalid combinations for the upright machine when trying to combine weighing hoppers without considering their corresponding booster hopper. Furthermore, Example 9 illustrates an incorrect combination in the diagonal machine when trying to simultaneously discharge the weighing hopper with their corresponding booster hopper. As aforementioned, in its initial configuration, the double-layered upright machine has a restriction in the combination of the system hoppers ( ). Specifically, a hopper of can only be part of a − of hoppers if and only if the set of the hoppers contains , with = + . However, in the double-layered diagonal machine, all and that belong to the − must meet the condition of ≠ − . Figure 3 below illustrates the invalid combinations for each machine. For example, for = 10 with = 3, Hopper 3 in a double-layered upright system is a weighing hopper, while Hopper 13 is a booster hopper. Here, Hopper 3 may be selected for combination provided that Hopper 13 is also selected, while, for the diagonal system, they cannot be selected simultaneously. Examples 7 and 8 of Figure 5 denote invalid combinations for the upright machine when trying to combine weighing hoppers without considering their corresponding booster hopper. Furthermore, Example 9 illustrates an incorrect combination in the diagonal machine when trying to simultaneously discharge the weighing hopper with their corresponding booster hopper.

Hopper-Filling Strategies
In the industrial field, the filling configuration of the hoppers during the multihead weighing process is made based on the experience and skill of the machine operator. This is since the machine does not have a predetermined configuration strategy for all the types of existing products that can be packaged in it. To address this fact, the present research proposes solving the packaging problem through an algorithm for different k hopper combinations, with an average feed for each hopper according to the three filling strategies proposed by [14,19,20] for single-layered weighers (see Table 2, Equations (15)-(17)). Two of these strategies consider the cases in which each hopper i is filled with a different average quantity of product µ i (instead of a common value µ = T/k). In this sense, and considering the original concept of each filling strategy, this study will explore the cases in which hopper feeds are defined so that hopper subgroups may share the same value of µ i . These strategies have been implemented in single-layered machines using single-target and biotarget algorithms with good results in reducing process variability [14,[18][19][20]. However, they have not yet been tested on double-layered machines. With the implementation of the strategies, it is also intended to evaluate if it is more efficient for the process to supply all hoppers with the same amount of product or uneven amount of product according to the coefficient of proportionality γ related to the product to be packed. Hopper feed variation will depend on a change value represented by the δ parameter, which is commonly used in statistical process control to simulate out-of-control processes. Nevertheless, for the purposes hereof, it will be used to voluntarily simulate an uneven product supply for weighing hoppers. Herein, δ will take values from 0 to 3 with increments of 0.5 (these increments are represented by the δ min parameter, as expressed in Equation (15)). In addition, the average filling value for each hopper will also be influenced by the proportionality coefficient γ (σ = γµ), which will depend on the type of material to be packaged. In this document, proportionality coefficients are used for two different pasta products: Fusilli, with γ = 0.123, and Ravioli, with γ = 0.331, [19,20]. For example, to calculate the standard deviation for a target weight of 500 g when we want to pack a product such as Fusilli by combining three hoppers, we will have a theoretical deviation of σ = 0.123· 500 g 3 = 20.5 g. Table 2. Number of hoppers for each group according to the S 1 , S 2 , and S 3 strategies and distribution of hoppers.
In addition to the S 1 , S 2 , and S 3 filling strategies, in which an average product supply is established for each subgroup, we must define a distribution of hoppers, in particular, the number of hoppers that are assigned to each subgroup (see Table 2). In this sense, three types of distributions are proposed: equal, central, and extreme. In the equal distribution strategy, each group includes approximately the same number of hoppers. For example, for the S 1 filling strategy, the total number of hoppers (n) is divided among the five groups n 5 . Each of the n i (i = 1, . . . 5) is assigned a number of hoppers equal to the largest integer multiplied by 5 that is closest to n (integer part 〚 n 2 〛). If the remainder of the division mod n 5 is 1, the central group (n 3 ) will have one more hopper. If it is 2, a hopper will be assigned to each extreme group. For mod n 5 = 3, they are distributed between n 1 , n 3 , and n 5 . If mod n 5 = 4, the n 3 group will have one less hopper than the rest. The central distribution consists of assigning as many hoppers as possible to the central set of hoppers. For example, in strategy S 2 for n ≤ 8 and n > 8, one and two hoppers will be assigned, respectively, to each end, and the surplus is assigned to the central group. Finally, the extreme distribution assigns the largest number of hoppers to the extreme subgroups n 1 and n 5 , and the least amount to n 3 . Tables 3 and 4 illustrate an example of the number of hoppers for each subgroup according to the S 1 , S 2 , and S 3 strategies with n = 16 weighing hoppers, and the average supply values for central, equal, and extreme subgroup distributions.  Table 4. Average filling weight according to the S 1 , S 2 , and S 3 strategies for equal, central, and extreme distributions with n = 16.

Distribution Strategy Average Filling Weight
Equal

Optimization Model and Packaging Algorithm
This section presents the mathematical model and the packaging algorithm for the process in double-layered upright and diagonal machines. In this work, an adaptation of the well-known backpack problem is used. For each package, a deterministic knapsack problem is solved. Some researchers have optimized this way of determining the final weight of the package [21][22][23].
The symbology, decision variables, target function, and constraints for each process are also presented.

Target Function
The target function for the packaging processes in double-layered machines seeks to minimize the difference between the effective content of the package and its target weight T. The binary vectors are defined for the weighing hoppers (Equation (18)) and Y j for the booster hoppers (Equation (19)), whose components x i or y j take the value of 1 if the hopper weight H m was selected, or else it takes the value of 0 (Equations (20) and (21)).
Y j = (y n+1 , y n+2 , y n+3 , y n+4 . . . y 2n ) (19) x i = 1, if H Wi is the selected hopper 0, otherwise (20) To select the hoppers, whose sum of the weights are the closest and greatest to the package weight, the function will be minimized, The problem restrictions will be directly determined by hopper selection restrictions. For the double-layered upright machine, the operating restriction of the system is that an upper hopper cannot be selected if its corresponding booster hopper has not been selected, which means that Equation (23) must be used. For the double-layered diagonal machine, a weighing hopper and its booster cannot be selected simultaneously, which is guaranteed by Equation (24).
x i − y i ≤ 0 (23) In each iteration, the best combination of k hoppers from the 2n available must be selected. If Equation (22)  (30) Wi is chosen 0, in other case (31) Wm is chosen 0, in other case (32) Wr is selected 0, in other case (33) Bj is selected 0, in other case (34) Bt is chosen 0, in other case (35) Bu is selected 0, in other case (36) x r − y r ≤ 0 (40) x m + y t ≤ 1 (42) x r + y r ≤ 1 (43)

Algorithm
In this subsection, we present the algorithm designed for the packaging process for double-layered upright and diagonal machines. The step-by-step process is generic for any of the k combinations of the 2n hoppers of the system, with initial constants adjustable to the type of product packaged.

•
Step 1. The initial values and conditions are defined. Q : Total number of packages processed; n : Number of weighing hoppers; k : Number of hoppers to combine 2 ≤ k ≤ n; T : Target weight > 0.

•
Step 2. The empty weighing hoppers H Wi are loaded with randomly assigned weights w i , i ∈ {1, 2, . . . n} according to S1, S2, or S3 and according to the number of hoppers in each group.

•
Step 3. The contents of the weighing hoppers H Wi are discharged into their corresponding empty booster hoppers H Bj , with w n+i = w i and w i = 0.

•
Step 4. The weighing hoppers previously discharged are reloaded.

•
Step 5. The hoppers that meet the criteria from Equation (23) or Equation (24) are combined for the upright or diagonal machines, respectively. • Step 6. The difference between the sum of the weights of each combination and the target weight is calculated (Equation (22)).

•
Step 7. The subset H of k hoppers whose difference with T is minimal, from those calculated in the previous point, is selected.

•
Step 8. The product is discharged and packed.

•
Step 9. If the required number of Q packets has been completed, the process ends. Otherwise, it returns to Step 2.

Preliminary Analysis
To validate the algorithm, we used proportionality coefficients of γ = 0.123 for Fusilli and γ = 0.331 for Ravioli [20]. In addition, a number of n = 16 weighing hoppers were assessed, at k = 2, 3, 4, 5, and 7, δ = 2, δ min = 0.5, and a target weight of T = 250 g. The number of hoppers in each subgroup is shown in Table 3. Combinations generated for the different values of k assessed are presented in Table 1. The performance measures calculated were the average weight of the packages produced (µ paq ), the standard deviation of the packages produced (σ paq ), and the coefficient of variation of the packages produced CV paq = µ paq σ paq , all above for Q = 10,000 packages. Results for the double-layered upright and diagonal machine are presented in Tables 5 and 6. Here, we observe that at γ = 0.123, for the double-layered upright machine, the S 3 strategy produces a weight closer to T and lower values of σ paq and CV paq , when k = 7. However, this strategy offers the highest values for µ paq and σ paq , thus becoming the least favorable for the process. In S 1 and S 2 , the average weight closest to T and lower values of σ paq and CV paq were obtained at k = 7. However, their values were similar to k = 6. These last strategies seem to be the most convenient in terms of reducing process variability. This behavior of the strategies is maintained for the double-layered diagonal machine, which also denotes lower values when compared to those obtained in the double-layered upright machine. Table 5. Results of S 1 , S 2 , and S 3 strategies, for k = 2, 3, 4, 5, 6, and 7, and γ = 0.123.  Table 6. Results of the S 1 , S 2 , and S 3 strategies, for k = 3, 4, 5, 6, and 7, and γ = 0.331. However, the results of the tests for γ = 0.331 show that the average weight of the packages closest to the target weight and the lowest values of σ paq and CV paq are presented for k = 6 and 7 in both machines, being lower in S 1 and S 2 . In general terms, we observe that when the value of the proportionality coefficient is increased to γ = 0.331, the µ paq , σ paq , and CV paq values also increase. However, the behavior (operation) of the process is similar for both products. Based on these results, the design of experiments presented in Section 7 was proposed to determine which conditions decrease process variability and provide higher values and as close as possible to the target weight.

Experiment Design
To follow up on our preliminary analysis, an experiment design (DOE) of fixed effects factors [24] was conducted to determine the best combination of treatments that provides the least process variability. For the design, the factor levels that evidenced the best performance in their coefficient of variation are considered, discarding those that yielded the lowest levels of process variability reduction. The multifactorial design consists of eight factors, as shown in Table 7, for a total of 1512 treatments in each machine, each of them with three replicates, finally obtaining 12,096 runs. The response variable studied is the coefficient of variation obtained in each run of 10,000 packages since it is a measure that may be used to compare different target weights T. In addition to analyzing the best factor combination, the upright and diagonal machines are compared against each other to determine which offers less process variability. Here, the first factor encompasses two levels, which refer to the double-layered upright or diagonal machine. A second factor is associated with the number of weighing hoppers. In this case, machines with 10, 14, and 16 weighing hoppers were assessed. The third factor is the number of hoppers to combine with values from k = 5 to k = 7. Another factor to consider is the target label weight, which is set at two levels: 250 g and 500 g. In addition, two packaging products, Fusilli and Ravioli, constitute the two levels of the sixth factor. The S 1 and S 2 strategies determine hopper subgroups, grouped by equal, central, and extreme levels. The filling position constitutes the eighth factor with seven levels δ min = 0, 0.5, 1, 1.5, 2, 2.5, and 3, which simulate an out-of-control process when δ min > 0. Given that the data of the response variation coefficient variable (CVpaq) are asymmetric, with a lower target weight, adjusted box plots are used to compare the levels within the same factor, as shown in Figure 6. To assess the experiment design, a transformation of the variable CV paq by Johnson's method [25] is used to standardize the data, thus obtaining the transformed coefficient of variation (CV paqT) as the response variable.
Results from the experiment design were analyzed using analysis of variance (ANOVA). Table 8 denotes the results of the ANOVA. As it may be observed, no significant differences were found in the product type and number of subgroups factors for the hopper distribution. Figure 7 denotes the significant factors. When analyzing the interactions, significant p-values were found for Machine Type Target Weight, Machine Type· k, Target Weight·n, n·k, n k, n·Delta, n·Gamma, n·Hopper Distribution, k·Delta, k·Number of Subgroups, k·Hopper Distribution, Delta·Gamma, Delta·Number of Subgroups, and Number of Subgroups·Hopper Distribution.
Based on the results of the significant interactions between the design factors (Figures 8 and 9), we can infer that when comparing machine performances according to the number of weighing hoppers, n = 16 provides greater accuracy, and it is even better when the target weight is 500 g. For the number of hoppers combined, significant differences were found between the mean values of the coefficient of variation. Figures 6 and 7 denote that for almost all interactions, k = 7 is the ideal number of hoppers to reach the target weight, except at δ = 1.5, which suggests the use of six hopper combinations. Significant differences were also found for CV paqT, according to the target weight, exhibiting better behaviors if T = 500 g. Regarding the S 1 and S 2 filling strategies, five subgroups provided better results at δ = 2.5. In addition, significant differences were found regarding the product type. In this aspect, better results were found when the proportionality coefficient is the lowest because lower values of γ introduce less variability in the weights supplied to the weighing hoppers. Here, Fusilli (γ = 0.123) reported less process variability with an optimum point at δ = 2.5. Regarding the hopper distribution for each group, the central strategy denotes better behavior for both machines. Hence, we can conclude that the optimal process uses the diagonal machine at k = 7, n = 16 T = 500, S 1 = 5, central distribution, δ = 2.5 (δ = 1.0 for Ravioli), and γ = 0.123.
Mathematics 2021, 9, x FOR PEER REVIEW 15 of 21 Given that the data of the response variation coefficient variable (CVpaq) are asymmetric, with a lower target weight, adjusted box plots are used to compare the levels within the same factor, as shown in Figure 6. To assess the experiment design, a transformation of the variable by Johnson's method [25] is used to standardize the data, thus obtaining the transformed coefficient of variation ( ) as the response variable. Results from the experiment design were analyzed using analysis of variance (ANOVA). Table 8 denotes the results of the ANOVA. As it may be observed, no significant differences were found in the product type and number of subgroups factors for the hopper distribution. Figure 7 denotes  Based on the results of the significant interactions between the design factors ( Figures  8 and 9), we can infer that when comparing machine performances according to the number of weighing hoppers, = 16 provides greater accuracy, and it is even better when the target weight is 500 g. For the number of hoppers combined, significant differences were found between the mean values of the coefficient of variation. Figures 6  and 7 denote that for almost all interactions, = 7 is the ideal number of hoppers to reach the target weight, except at = 1.5, which suggests the use of six hopper combinations. Significant differences were also found for , according to the target weight, exhibiting better behaviors if = 500 g . Regarding the and filling strategies, five subgroups provided better results at = 2.5. In addition, significant differences were found regarding the product type. In this aspect, better results were found when the proportionality coefficient is the lowest because lower values of introduce less variability in the weights supplied to the weighing hoppers. Here, Fusilli

Discussion
Multihead machines for their proper operation require two processes: packaging and machine configuration. The packaging process is linked to the problem of the backpack, that is, how to select the hoppers whose sum of the weights is greater and closest possible to the target weight. The new software, implemented for upright and diagonal double-layer machines with real weights according to the preliminary results (Tables 5 and 6), shows that it is capable of responding to the problem by finding the optimal value in each package, complying with the requirements. On the other hand, the configuration of the machine is related to the amount of product that each weighing hopper receives, and in this sense, the filling strategies focus on evaluating the performance of the machine according to the amount of product supplied to each hopper. The S3 strategy provides each hopper with the same amount of product, while the S2 divides the hoppers into three groups and in the same way, S1 into five groups, which guarantees an unequal supply of product to each subset of hoppers. The preliminary results of Tables 5 and 6 show that the configuration of the machines with the lowest performance in terms of the target weight and the variation of the process is the S3 strategy, which supplies the same quantity of product to all the hoppers; therefore, it is not taken into account for the design of the experiment (Table 7). Likewise, in the configuration process, distribution strategies (central, equal, and extreme) were tested with the number of hoppers for each subset determined in each strategy S1 and S2, according to the group to which the largest number of hoppers is assigned. In the results of the design of experiments (Table 8), it is observed that there is no difference between the strategies S1 and S2 (p-value = 0.27); however, when contrasting them in the presence of other factors, for example, the number of hoppers to combine (k) and the delta value (δ), we find that in the presence of these factors, there is a significant difference between them. In the same sense, for the type of product, significant p-values are found in the presence of a second factor such as the case of delta and the number of hoppers in the system. In accordance with the above, the type of product is an important factor to take into account when configuring the machine. When analyzing the interactions of the other factors with the delta value (δ) ( Table 8, Figures 8 and 9), we find that the process presents less variability in values of δ = 1.5, which suggests a group of hoppers receive content that is far away plus 1.5 standard deviations of the average content according to the target weight and the type of product to be packed. Finally, the results suggest that for k = 7, hopper combinations the packaging process achieves its optimal value.

Conclusions
The multihead weighing process is characterized by high product packaging performance and accuracy. The optimization of this process guarantees material savings and high levels of productivity in terms of the number of packages produced. In this document, a new packaging algorithm and its corresponding optimization model for double-layered upright and diagonal multihead weighers have been presented, considering actual weights in the weighing hoppers and a predefined number of hoppers to be combined. The algorithm was validated using three product feeding strategies (S 1 , S 2 , and S 3 ) and different numbers k of hopper combinations. To assess the performance of the process, two products (Ravioli and Fusilli) were tested at different coefficients of proportionality (γ), and then an experiment design was approached to establish a comparison between different factor levels. The performance metrics used were the average weight of the packages produced, the standard deviation of the packages produced, and the coefficient of variation of the packages produced. Results revealed that the best filling configuration to reduce the process variability is the S 1 strategy, particularly with the five subgroups of hoppers, assigning the largest number of hoppers to the group. In addition, the number of hoppers to be combined at k = 7 offered the least variability in the total weight of the packages produced in both processes. The study also concluded that process behavior or operation is better at minimum values of γ (γ = 0.123). Finally, the diagonal machine offers a greater NC for the weighing hoppers when selecting the package weight, which is reflected in lower process variability.