Energy-Aware Model Predictive Control of Assembly Lines

: This paper presents a model predictive approach to the energy-aware control of tasks’ execution in an assembly line. The proposed algorithm takes into account both the need for optimizing the assembly line operations (in terms of the minimization of the total cycle time) and that of optimizing the energy consumption deriving from the operations, by exploiting the ﬂexibility added by the presence of a local source of renewable energy (a common scenario of industries that are often equipped, e.g., with photovoltaic plants) and, possibly, also exploiting an energy storage plant. The energy-related objectives we take into account refer to the minimization of the energy bill and the minimization of the peaks in the power injected and absorbed from the grid (which is desirable also from the perspective of the network operator). We propose a mixed-integer linear formulation of the optimization problem, through the use of H-inﬁnite norms, instead of the quadratic ones. Simulation results show the effectiveness of the proposed algorithm in ﬁnding a trade-off that allows keeping at a minimum the cycle time, while saving on the energy bill and reducing peak powers.


Introduction
As outlined in the Industry 4.0 paradigm, Smart Factories shall leverage on data science and new production technologies for boosting industrial processes' efficiency. More specifically, Smart Factories shall adopt innovative production systems [1,2] and smart energy management systems [3,4], aiding human operators to perform optimal context-aware decisions. The integration of such smart systems is expected to be pioneered by industrial assembly lines due to their high output volumes and reproducibility [5]. Motivated by these considerations, in this work, an energy-aware control framework for the optimization of industrial assembly lines' operations is developed.
The optimization of assembly lines' operations (i.e., the definition of an optimal schedule for executing tasks) is a well-known and -studied problem, which, in the literature, is referred to as the Assembly Line Balancing Problem (ALBP). ALBPs are defined in terms of three main elements: the tasks to be executed, the areas or machines where tasks are executed (also referred to as workstations), and the resources needed to execute tasks. ALBPs have been classified based on several characteristics such as: the control objective (e.g., the minimization of the cycle time, i.e., the time required to execute all tasks or the minimization of the number of workstations), the factory layout (i.e., the shape of the graph modeling the interconnection between workstations), the nature (deterministic or stochastic) of the time required to execute tasks in given workstations, and the ability of the assembly line to process single, multiple, or different kinds of products. The ambition of the present work is to develop a general control framework, not tailored to a specific ALBP instance, able to simultaneously minimize assembly lines' cycle time and energy consumption. With respect to the latter aspect, local production of renewable energy and the presence of energy storage systems will be considered. This translates into the need for addressing a secondary control objective with respect to the energy management problem related to the energy profile absorbed or injected in the power grid. Indeed, in this setting, factories are allowed to absorb energy from the grid, absorb energy from the storage element, and inject energy in the grid (due to the local energy production assumption). The former and latter aspects require controlling such energy profiles since it should be as smooth as possible to not unbalance the power grid [6]. The presented control algorithm assumes the industrial plant is equipped with an integrated control system, which makes it possible to retrieve real-time data from the operations of the assembly line, run the proposed optimization-based algorithm, and implement the decisions thanks to human operators and actuators or devices concerned both with the operations side (e.g., workstations) and the energy side of the problem (e.g., electric storage), hence the relevance of the proposed contribution for the control systems and actuators' research community.
The reminder of this section is organized as follows: Sections 1.1 and 1.2 review the literature with respect to ALBPs and energy-aware control frameworks, respectively; Section 1.3 summarizes the paper's contributions, and finally, Section 1.4 describes the paper's structure.

Review of ALBPs and Solution Methods
The structure of an assembly line greatly depends on the characteristics of the product to be assembled/created and on technological constraints [7,8]. The main phases of the design of an assembly line are product design, factory layout definition (or line configuration), and line balancing [9]. Recent works highlighted the import role of simulations in both phases [10]. The first phase provides information regarding the activities to be performed in the assembly line. The second phase drives the definition of the paths (or links) connecting workstations. These paths define the so-called factory layout: many standard layouts (e.g., straight, U-shaped, or asymmetric lines) have been formalized and analyzed in the literature. The latter phase deals with the optimal assignment of tasks to workstations. This is a complex combinatorial problem driving the performances of the assembly line. ALBPs typically consider the output of the former two phases as given: solution algorithms are developed to address the line balancing problem. Indeed, the re-design of an assembly line deals with hard economic and technological constraints [11]. The optimization of tasks' assignment, on the other hand, allows increasing the line's efficiency without requiring high investments.
ALBPs dealing with the production of a single product are referred to as Simple ALBPs (SALBPs) [7,12]. Several SALBP instances have been defined based on the optimization goal [13,14]: • SALBPs of type 1 (SALBP-1) deal with minimization of the number of workstations required to execute a given set of tasks. • SALBPs of type 2 (SALBP-2) aim at minimizing the cycle time, i.e., at maximizing the production rate. • SALBPs of type E (SALBP-E), where E stands for efficiency, focus on the minimization of the product between the cycle time and the number of workstations, i.e., the objective is to minimize the total idle time. • SALBPs of type F (SALBP-F), where E stands for feasibility, are aimed at understanding if, for a given number of workstations and a desired cycle time c, it is possible to execute all the tasks.
More complex ALBP instances consider the production of different models of the same product (mixed-model ALBPs) or the production of several products (multi-model ALBPs). Another important characteristic used to classify ALBPs is the nature (deterministic or stochastic) of the task processing time. Stochastic ALBPs allow modeling the different know-how of human operators or to directly model the presence of disturbances (delays, failures, etc.).
Solution methods are typically classified into two main categories: exact (e.g., mixedinteger optimization problems) or approximate (e.g., heuristic procedures, genetic algorithms, etc.) methods [15,16]. The former class of methods allow finding the optimal solution to the line balancing problem, but are associated with high computational costs, exponentially increasing with the dimension of the considered ALBP instance (i.e., in terms of number of tasks, workstations, and constraints). On the other hand, approximate methods do not guarantee the optimality of the solution, but are able to achieve good feasible results in an acceptable computation time.

Energy-Aware Control Frameworks for Industrial Assembly Lines
According to the International Energy Agency, in 2014, the industrial sector was responsible for 36 % of the global Total Final Energy Consumption (TFEC) [17]. The industrial sector is the largest energy consumer, with an electricity usage that is expected to grow nearly 40 % by 2050 [18]. The growing attention toward energy-aware manufacturing and production systems has led to an increasing interest in the scientific community for designing decision support systems capable of optimizing energy consumption [14]. One of the major goals of many modern manufacturers is to decrease the cost of production by any possible means while satisfying environmental regulations and ensuring given quality levels of the end products [19]. Electricity production is unfortunately a highly polluting process [13]. Due to the rise in energy prices and in awareness of environmental issues, the exploitation of green energy resources has become a crucial factor in the industrial domain. Indeed, reduced energy usage helps industries to save costs and become more competitive. This is a key factor for promoting green and sustainable practices [20]. This also implies the need for designing and managing energy-efficient manufacturing systems. Given this context, the integration of renewable energy sources in the industrial sector is expected to significantly grow in the next few decades [21].

Paper Contributions
The main contribution of the paper consists of the development of a control framework and a Model Predictive Control (MPC) solution algorithm for the optimization of industrial processes. More specifically, the problem of balancing a generic assembly line is addressed. As described in Section 1.1, this is a very relevant problem in the industrial domain. An important feature of the proposed framework is that we did not focus on a specific ALBP instance: the proposed problem formalization is sufficiently flexible to take into account any factory layout. As highlighted in Section 1.1, scientific articles mostly focus on a single ALBP instance. Furthermore, following the discussion reported in Section 1.2, the control framework directly takes into consideration energy-related considerations, with the aim to minimize the energy consumption bill, reduce the peak power exchanged with the grid, and maximize the usage of locally produced renewable energy. The control of the consumed energy profile represents an important aspect when considering renewable energies since spikes in the energy demand may lead to a disequilibrium in the energy grid. However, this aspect has not been extensively considered in the literature.
These activities have been partially developed in the context of the H2020 SESAME project (coordinated by ArianeGroup) [22], which is aimed at boosting European space access through the exploitation of digitalization and data science. For doing so, the project focuses on improving the rocket manufacturing processes by predicting the production machines maintenance and components' quality levels and increasing the flexibility and availability of spaceports' resources by developing adaptive operations management tools.

Paper Structure
The remainder of this paper is organized as follows: Section 2 describes in detail the considered problem; Section 3 introduces the mathematical model developed to formalize the problem; Section 4 presents simulations carried out to validate the proposed approach, and, finally, Section 5 summarizes the work performed and outlines future research lines.

Problem Description
As already mentioned, the considered problem refers to the control of an industrial assembly line in a scenario in which the factory can rely on a local production of renewable energy and on the presence of energy storage systems (see Figure 1). The developed control framework is thus aimed at increasing the efficiency of the assembly lines from an energetic and operational point of view. With respect to the former aspect, the control objective consists of a smart management of the available energy sources (i.e., the grid and the storage systems). The presence of the energy storage systems introduces a further degree of freedom allowing controlling the consumed energy profile. Indeed, to avoid disequilibria in the energy grid, it is necessary to avoid peaks in the absorbed/injected power at the point of connection of the industry with the grid. On the other hand, an intelligent use of the energy source represented by the storage systems allows lowering the electric bill and optimizing the locally produced renewable energy. With respect to the latter aspect, the aim is to aid assembly line operators with optimized task schedules. This problem is particularly relevant for complex environments in which the effect of a delay or of the execution of a given task cannot be immediately understood. Furthermore, typically assembly line operators have a strong knowledge relative to the technical domain in which they work. Hence, one cannot assume that they are able to make decisions regarding the energy market. In this respect, the authors believe that the energy-aware optimized task schedule, the output of the proposed control framework, could represent a huge help in the industrial domain.

Problem Formulation
The control problem is formulated in discrete time. The formulation proposed in this paper is an extension of [23], where an algorithm is presented to control tasks' execution with the sole goal of minimizing the cycle time, while respecting all the existing constraints. In this paper, instead, we focus on the extension of the problem to enable an energy-aware control of the tasks, including in the optimization process also the goal of minimizing the energy bill, reducing the power peaks at the point of connection with the grid, and maximizing the self-consumption of the locally produced renewable energy.
In the following, the problem formulation is presented. We start by only recalling the main variables introduced in [23] for controlling tasks' execution and resources' assignment to the workstations. The detailed formulation of the associated constraints can be found in [23].
The variables associated with the control of the tasks are: • e t,w,i , which is a Boolean control variable equal to one if and only if the algorithm commands to execute tasks t on workstation w at time i; • a r,t,i , a Boolean control variable equal to one if and only if the algorithm commands to assign resource r to task t at time i; • d t,i , a real variable that represents the expected duration of tasks t at time i (that is, the time left to complete tasks t at time i). After the task is completed, it is clearly d t,i = 0. We define d t as the total time to complete task t (it is obviously d t,i ≤ d t ); • o w,i , a real variable that captures the occupancy level of workstation w at time i. For instance, the occupancy level could be referred to the maximum number of tasks that can simultaneously run on the workstation (as in this paper), or to other metrics as well, depending on the specific case; The following variables are introduced to allow energy-aware control of the assembly line: • P grid i , a real variable that represents the power flowing at the point of connection of the industry with the grid, at time i. It is by convention positive, when the industry absorbs power, and negative instead when the industry injects power into the grid. Thresholds are given for both the maximum allowed power withdrawal (P grid,max > 0) and the maximum power injection (P grid,min ≤ 0): • To allow proper computation of the energy bill, we introduce a non-negative real variable, P grid,in ≥ 0, to capture the power that flows from the grid to the industry, and a second non-negative real variable, P grid,out ≥ 0, to capture the power that flows in the opposite direction, from the industry to the grid. Given these definitions, P grid can then be defined as: Obviously, at any time, only one of the two components of P grid i can be different from zero. To enforce this, we need to introduce two auxiliary Boolean variables, δ in i , which should be equal to one if P grid,in i > 0 (i.e., when the industry is taking power from the grid), and δ out i , which should be equal to one if P grid,out i > 0 (i.e., when the industry is injecting power into the grid). This behavior for the auxiliary variables can be enforced by adding the following constraints: and P grid,out i ≤ −δ out i P grid,min .
Then, the following constraint ensures that at any time, only one between P grid,in i and P grid,out i can be different (i.e., greater) from zero.
• Next, the real variable P ess i is introduced, which represents the charging/discharging power (kW) of the battery at time i, which is limited between a maximum possible charging level and a maximum possible discharging level: P ess,min ≤ P ess i ≤ P ess,max .
• The real variable x ess i represents the energy level (kWh) of energy stored in the battery at time i. At any time, it must be: x ess,min ≤ x ess i ≤ x ess,max , where x ess,min ≥ 0 and x ess,max ≥ 0 are the minimum and maximum allowed energy levels of the battery, respectively. Furthermore, the dynamics of x ess i is: where T is the sampling time of the MPC algorithm, and we consider, for simplicity, a lossless model of the battery; • P T i , the aggregated power consumption of the tasks running at time i. It is defined as the sum of the power consumed by all the tasks currently executing (i.e., for which e t,w,k = 1): where P t,j is the power consumption of task t when it is at time j of execution (we make the realistic assumption that an estimate of the power consumption of the tasks is available). • Finally, P PV i ≥ 0 is the forecast of the power generated by the renewable plant at time i.
Given the above definitions, the overall power balance equation can be defined as:

Objective Function
We define the objective function as the convex combination of different terms, of which some are related to the operations-related goals (i.e., cycle time minimization) and the remaining are related to the energy optimization goals.
The term V 1,k is related to the tasks' control and pushes the minimization of the time left to complete the tasks: 2.
The second term is to the energy cost. It is added in order to minimize, at each instant of time, the cost related to the energy consumption required by the tasks and to maximize the profit when the power is injected into the grid. We consider a scenario with a time-varying time-of-use tariff, where c i is the cost (EUR/kWh) of energy consumption at time i and p i is the remuneration (EUR/kWh) of the energy injected into the grid at time i. The term is: where T is the sampling time.

3.
The third term is also energy related. It pushes the minimization of the peaks in the power exchanged between the industry and the grid. To avoid nonlinear formulations, which make the computation time of the algorithms higher, we minimized the Hinfinity norm of the injected and absorbed power vectors, i.e., P grid,in and P grid,out (we recall that the H-infinity norm of a vector is defined as the largest component of the vector, so that we seek in practice to minimize the greater absorption and injection power peak). To capture the H-infinity norm of P grid,in and P grid,out , we introduced two auxiliary variables, h in and h out . By definition, the H-infinity norm is greater than or equal to any component of the vector, i.e.: and P grid,out i Finally, we minimized h in and h out in the objective function (so that, at the optimum, h in and h out are actually the H-infinity norms of the vectors P grid,in and P grid,out ).
Summarizing, the algorithm works in discrete time, meaning that it computes control decisions every T seconds, T being the sampling time. The decisions made by the algorithm concern the scheduling of tasks and resources to workstations, according to the constraints characterizing the assembly line (precedence constraints, maximum possible occupancy of the workstations, deadlines, etc.). The goal of the algorithm is to minimize the cycle time and, at the same time, to optimize the energy flows in the plant, in order to reduce the peak power consumption and the energy bill. To do this, also the control of a storage device is considered, to balance the peak consumption and store the energy from the local renewable generation plants.

Remarks on Practical Implementation and Possible Disadvantages of the Solution
Implementing the algorithm clearly brings some costs, which are, however, expected to be largely surpassed by the benefits brought. Some indications of the costs are as follows. The main costs concern the hardware needed to run the optimization problem, which consists of a computer able to run smoothly large optimization problems (or, alternatively, an equivalent cloud computing service). Another relevant cost item is given by the software needed to solve the optimization problem, in case a commercial solver is used. Expenses are finally needed to integrate the algorithm with the industry management systems, from which the data can be retrieved by the algorithm. The total costs depend highly on the specific requirements of the industry and the solutions adopted. They are in the order of few to some thousands of EUR. Costs are expected to be largely surpassed by the economic benefits deriving from increased productivity and savings in the energy bill. A detailed cost-benefit analysis is beyond the scope of this work and will be proposed in future works focused on the practical testing and validation of the solution.
The main disadvantage of the proposed solution is in its computational complexity, which does not allow it to scale to very large scenarios. To overcome this issue, several strategies could be adopted. One is to move from exact solvers to ones based on heuristics, which are able to achieve often excellent suboptima in much less time. Another strategy is to develop decentralized/distributed solution strategies, based, for example, on the recent works such as [24].

Simulation Results
Simulations were performed in Julia 1.7.2 (https://julialang.org/, accessed on 1 June 2022). The Model Predictive Control (MPC) problem was written using the Julia JuMP modeling package [25] and solved using the Gurobi optimizer [26], on an Intel I7, 8GB RAM machine, running Windows 10.

Simulation Scenario
The simulation focused on the optimization of the integration process of the Vega launcher in the Vega mobile gantry [27]. In this process, the different stages of the launcher arrive at the mobile gantry and are vertically assembled; the payload is integrated on top of the launcher; the final checks are performed prior to the final countdown. An artificial, but realistic simulation scenario was built based on [27][28][29][30][31], which provide a high-level description of the integration operations.
The process was broken down into 44 macro-tasks, which span about 20 days. The list of tasks, with the related temporal parameters, deadlines, list of needed resources, and temporal relations, is reported in Table 1. For the ease of visualization, we focused on the first 15 tasks, corresponding to about 2 days of operations.
The overall task dependency graph is in Figure 2. The sampling time was set to 15 min. Two main scenarios are discussed in the following: • Minimization of cycle time. In this first simulation, we only sought to optimize the cycle time, while leaving out of the optimization all the energy-related considerations (i.e., we set to α 2 and α 3 zero in the objective function). This simulation serves as a baseline for the next one; • Energy-aware task control. In this scenario, the proposed algorithm is tested, with all the terms, including also the energy-related ones. The goal is to show that the energy-related performance can be improved (i.e., energy bill savings and reduction of power peaks).
The energy tariff considered in the simulations is displayed in Figure 3. We assumed a fixed remuneration of 0.12 EUR/kWh in case of injecting power into the grid. In the simulations, we considered the following parameters: x max = 500 kWh, P grid,max = 100 kW, P grid,min = −100 kW, P ess,max = 50 kW, P ess,min = −50 kW. We considered the presence of a photovoltaic power plant, whose output is displayed in Figure 4.

Minimization of Cycle Time
This scenario serves as a baseline for the next simulation. Here, the algorithm focuses only on the minimization of the total cycle time, while no energy considerations are present (the ESS is disabled, and α 2 , α 3 = 0). Figure 5 shows the resulting Gantt plot, showing the scheduling of the tasks resulting in a minimization of the cycle time.  The average value of P grid is 28 kW; the standard deviation is 30.5. The total cost for the energy consumption is EUR 572.9.

Energy-Aware Task Scheduling Optimization
In this scenario, the complete algorithm is tested, including also the terms related with the energy optimization. The coefficients of the target function were empirically tuned.
The resulting Gantt chart is shown in Figure 7. The cycle time increases. In fact, in the previous simulation, all tasks are executed before the end of the second day of working. In this simulation, the cycle time ends during the third day. From the Gantt, we notice that the tasks have several interruptions, and the cycle time increased compared to the first simulation. This is due to the fact that the algorithm tries to use task preemption/shifting to improve the energy metrics (in fact, the most expensive period of the tariff is avoided). If needed, however, constraints can be put on the maximum number of tasks interruptions and the maximum value of the cycle time allowed.   The ESS contributes to optimizing the energy consumption, via balancing of the renewable power and the tasks' power. The resulting total cost of energy is EUR 550.1, bringing a savings.
Finally, regarding the computational complexity, the average solving times was 34 s.

Conclusions
This paper presented a model predictive control approach for the energy-aware control of tasks' execution in an assembly line. While most of the works present in the literature of assembly line balancing focus on operations-related aspects, such as cycle time minimization, workload balancing, and optimization of resources, in this paper, we went a step further by also optimizing energy-related aspects (energy bill and power peak minimization), which is more and more relevant in view of the ongoing energy crisis and climate change. We considered a scenario of an industry equipped with an electric storage and a renewable plant for energy generation. Simulation results showed that the proposed algorithm is able to seek the minimization of the cycle time, while also minimizing the energy bill and the peaks in the power exchange with the grid. These energy-related aspects are relevant, in view of integrating more and more the industrial plant into the smart grid.
One drawback inherent to the proposed solution is its scalability to scenarios with a very large number of tasks to be controlled. To tackle this, we are exploring heuristics to solve the MPC iteration, distributed versions of the algorithm, and algorithms based on deep learning. Funding: This work was carried out in the framework of the SESAME project, which has received funding from the European Union's Horizon 2020 Research and Innovation Programme under Grant Agreement No 821875. The content of this paper reflects only the authors' view; the EU Commission/Agency is not responsible for any use that may be made of the information it contains.
Institutional Review Board Statement: Not applicable.

Informed Consent Statement: Not applicable.
Data Availability Statement: Not applicable.