# Peak Energy Reduction in Flow Shop including Switch-Off Policies and Battery Storage
## 3 Reference Context and Proposed Approach  
The manufacturing system considered is a production line composed of a series of \(m\) machines connected in series and separated by buffers. The raw materials are always available, and the buffer of each machine has no capacity limit. The raw items enter following an exponential distribution and each machine has a stochastic power to perform the operation \(i\) (\(Pi\)). The states of the machine considered are the following [33]: working state, when the machine performs the manufacturing operation; idle state, when the machine is on and can work, but no item is available; off state, the machine is turned off and it is not able to work. The production system has a constraint due to the energy consumption contract; when the power used is exceeded, the restriction is considered a penalty. To reduce the cost of the penalty, an energy storage system supported by a battery is introduced. The battery is characterized by the following parameters: the capacity \(Cb\) and the charge factor of the speed \(Sb\). The degradation of the battery and the decrease in capacity has not been considered. When the power of the manufacturing system is under the peak constraint, the battery is charged until the capacity is available; otherwise, one machine at once can use the power of the battery to reduce or to bring to zero the power needed over the peak power constraint. The power to keep the machines idle and off states are always provided by the electricity grid; this is to avoid the problem of not supplying the basic systems of the machines and to ensure the readiness of the machines. Therefore, the battery is used only to support the working state power of the machines. Each machine has a controller to use the battery energy storage system in particular conditions; when a part should be loaded into the machine, the activities shown in Figure 1 are performed. When a part enters the machine, the total power of the production system (\(Plot\)) is calculated, adding the necessary power of the task (\(Pi\)). Each task is characterized by a processing time (\(PTi\)) in minutes. If the _Ptot_ is lower than the power constraint (_Pmax_), it is possible to charge the battery. The charge rate is computed as shown in Expression 1:  
\[Sb=\left[1.1-\frac{Pmax-Ptot}{Pmax}\right]*K \tag{1}\]  
Expression 1 means that the charging speed depends on the difference between the _Pmax_ of the electricity grid and the _Ptot_ used by the manufacturing system that is the power available to charge the battery. The value 1.1 leads to a minimum value of 0.1 (when the power of the manufacturing system is theoretically null) of the factor \(K\) that denotes the performance of the battery in terms of potential charging speed. The factor \(K\) is related to the processing time _PTi_, every _Sb_ unit time (minute) a _KV*PTi_ is charged. If the _Ptot_ is greater than the power constraint (_Pmax_), the controller verifies that the battery is free or that any machine is using the battery. If the battery is used by another machine, the controller switches the entire power _Pi_ on the electricity grid; otherwise, the controller verifies if the _Pi_ is completely over the _Pmax_, then if the battery has enough capacity, the entire _Pi_ is allocated on the battery. If the battery does not have enough capacity, it uses the entire capacity of the battery, and the residual power is allocated on the electricity grid. Finally, if the _Pi_ is not all completely over the _Pmax_ constraint, the controller verifies that the only power over the constraint can be supported by the battery, while the power under the constraint is supplied by the electricity grid. If the battery is not sufficiently charged to supply the power over the constraint, all the battery capacity is used and the  
Figure 1: Machine controller activities on enter item. residual power is allocated on the electricity grid.