*Article* **Event-Driven Online Machine State Decision for Energy-E**ffi**cient Manufacturing System Based on Digital Twin Using Max-Plus Algebra**

#### **Junfeng Wang 1,\*, Yaqin Huang 1, Qing Chang <sup>2</sup> and Shiqi Li <sup>1</sup>**


Received: 17 August 2019; Accepted: 12 September 2019; Published: 14 September 2019

**Abstract:** Energy-efficient manufacturing is an important aspect of sustainable development in current society. The rapid development of sensing technologies can collect real-time production data from shop floors, which provides more opportunities for making energy saving decisions about manufacturing systems. In this paper, a digital twin-based bidirectional operation framework is proposed to realize energy-efficient manufacturing systems. The data view, model view, and service view of a digital twin manufacturing system are formulated to describe the physical systems in virtual space, to perform simulation analysis, to make decisions, and to control the physical systems for various energy-saving purposes. For online energy-saving decisions about machines in serial manufacturing systems, an event-driven estimation method of an energy-saving window based on Max-plus Algebra is presented to put the target machine to sleep, considering real-time production data of a system segment. A practical, simplified automotive production line is used to illustrate the effectiveness of the proposed method by simulation experiments. Our method has no restriction on machine failure mode and predefined parameters for energy-saving decision of machines. The proposed approach has potential use in synchronous and asynchronous manufacturing systems.

**Keywords:** energy efficient operation; manufacturing system; stochastic event; digital twin; Max-plus Algebra; MATLAB-Simulink

#### **1. Introduction**

Industrial activities are the most important factor that leads to carbon dioxide (CO2) emissions in the world. The manufacturing industry in China accounts for 58.27% of the total CO2 emissions, which increased by approximately 220.77% in the past twenty years [1]. With the increased sustainable consensus, many emission reduction policies were issued to undertake environmental responsibility and duty in China. More and more manufacturers take effort to reduce energy costs. Energy-efficient manufacturing has been paid more attention considering productivity, flexibility, efficiency and environmental effect in production management [2].

A discrete manufacturing system is a kind of complex, stochastic, and dynamic system with interactions among machines and buffers. It is very common that many machines stay in an idle state, resulting from starvation or blockage during a working day. Statistically, the machine at an idle state consumes about 70% energy of their processing state [3]. Many modern Computerized Numerical Control (CNC) machines and robots have multiple idle states with different energy consumptions. An important strategy for energy-saving operations is to put the idle machine to sleep and to wake it up again at an appropriate time point without sacrificing the system productivity. The machine control

requires real-time production data. New, emerging Internet of Things (IoT) technology, e.g., smart sensors and meters, provide multilevel monitoring of manufacturing system (almost) in real time [4]. The collected data provide more opportunities for energy-saving decisions at the machine, process, and system levels.

Usually, discrete event simulation can be used to evaluate system performances including energy cost [5]. However, discrete event simulation is computationally expensive and time consuming, which is not suitable for online decision-making. As a new, emerging technology for modeling, simulation, and optimization, digital twin can reflect real-time states of physical systems [6]. Based on various models, digital twin not only can carry out simulations in virtual space before production but also can deliver decisions from virtual space to physical space during production, which realizes closed-loop feedback and interactions between physical systems and virtual systems. In this paper, a framework of digital-twin-based energy-efficient operation of manufacturing systems is proposed to support bidirectional interactions between virtual and physical systems. An event-driven Max-plus Algebra method is presented and validated online to predict the dynamic sleep duration of a machine for energy-saving operations at the system level.

The rest of this paper is organized as follows. The literature review is given in Section 2. Section 3 describes an operation framework for energy-efficient manufacturing systems based on digital twin technology. An event-driven energy-saving window approach for online machine state decision is proposed using Max-plus Algebra in Section 4. In Section 5, a practical serial manufacturing system is used to demonstrate the effectiveness of our method and discussions are given. Conclusions and future works are drawn in Section 6.

#### **2. Literature Review**

#### *2.1. Modeling and Simulation of Energy-E*ffi*cient Manufacturing*

Modeling and simulation are important methods for performance evaluation and optimization of energy-efficient manufacturing [7]. The simulation models of machine tools, processes, systems, or products can be used to carry out various what-if analyses. The production manager can understand the impacts of different manufacturing parameters on energy consumption and, thus, make decisions to optimize the parameters for energy-efficient manufacturing.

From the machine tool and process view, Lee et al. [8] proposed a simulation method based on a virtual machine tool to estimate the machining condition considering the energy consumption function or component model. Based on dynamic and kinematic behaviors of machine tools, Bi et al. [9] explored relations of machining parameters (cutting force, depth, and feed rate) and energy consumption. Kim et al. [10] proposed an additive regression algorithm to formulate the relationships between CNC machine energy consumption and machining parameters. From the product aspect, Seow et al. [11] built a simulation model to evaluate the total embodied product energy based on direct and indirect consumed energy.

At the production or manufacturing system levels, simulation-based prediction of energy consumption can support a manager in making decisions considering dynamic changes of production plans, energy prices, and environmental impact. Process chain simulation was an energy-oriented manufacturing system simulation approach [12]. The EnergyBlocks simulation method integrated energy-efficiency criteria with evaluation and decision processes during production system planning and scheduling [13]. Prabhu et al. [14] presented a simulation model that continuously integrated variable power consumption at the machine level and discrete nature at the production level to characterize energy dynamics in discrete manufacturing systems. By integrating a sustainability-enabled product lifecycle management information model with energy-consumption metrics, Zhao et al. [15] estimated the impact of energy control on actual energy consumption of a heating, ventilation, and air conditioning system; a ventilation system; and a production system.

The current modeling and simulation approaches focused on offline evaluation, prediction, and optimization for energy-efficient manufacturing. In order to incorporate real-time production data of shop floors, a data-driven method was always adopted for alleviating the burden of modeling and simulation [16].

#### *2.2. Energy-Aware Manufacturing System Scheduling and Control*

Taking energy consumption as one objective in scheduling; a multi-objective optimization problem can be formalized, and near-optimal job sequences can be searched by heuristic algorithms or exact methods [17]. Shrouf et al. [18] presented a mathematical model to minimize energy costs for a single machine system, and genetic algorithm technology has been used to obtain optimal solutions. For a two-machine system, Fang et al. [19] proposed a mathematical programming model that considered peak power load, energy consumption, and associated carbon footprint in addition to cycle time. In a flow shop with a reference schedule, Bruzzone et al. [20] built a mixed integer programming model where the reference schedule was modified to account for energy consumption without changing the jobs' assignment and sequencing. An energy-efficient flexible job shop scheduling model considering total production energy consumption and makespan was formulated in Reference [21], and a non-dominated sorting genetic algorithm-II was adopted to solve the model. Luo et al. [22] developed an ant colony optimization meta-heuristic to optimize both makespan and electric power cost with the presence of time-of-use electricity prices in a hybrid flow shop.

Quantitative policies and fuzzy rules can describe the operation knowledge of machine/system for energy-efficient manufacturing. Mouzon et al. [23] described several switch-off dispatching policies to minimize total energy consumption in a one-buffer, one-machine system. For a single machine system with stochastic inter-arrival times, the N-policy, Upstream Policy, and Downstream Policy were defined to switch the machine off when the conditions of the policies were satisfied [24]. By formulating four ON–OFF control rules in serial production lines with Bernoulli machines, Jia et al. [25] analyzed system performance measures in order to achieve high energy efficiency while maintaining high productivity. Wang et al [26] designed a fuzzy controller considering real-time data of buffers/machines in order to switch machine states and realize energy-efficient production.

Some works used an analytical method to study energy-saving opportunities of manufacturing systems. Chang et al. [27] proposed an energy opportunity window of a machine, which was predicted based on an approximated analytical model considering random downtime events. Sun and Li [28] presented an analytical estimation of energy control opportunities considering buffer utilization. Zou et al. [29] developed a stochastic analytical model which could predict shutdown time and recovery time of machines based on discrete-time Markov Chains in a stochastic production system. Li et al. [30] developed an analytical approach to quantitatively predict the system level production loss resulting from an energy-saving control event.

The multi-objective scheduling methods of energy-aware manufacturing are usually used to optimize operation plans before actual production. The complex and stochastic events of real shop floors are simplified or ignored in scheduling algorithms. It is noted that the control policies or rules for real-time energy-saving operation of production systems have many parameters to be determined and adjusted with time-consuming work. The advantage of the analytical models is its mathematical theory. Most of the analytical models did not consider the associated events during energy-saving operation, and only a constant energy opportunity window was predicted.

#### *2.3. Digital Twin of Cyber-Physical Manufacturing and Production System*

Digital twin [31], a near-real-time virtual representation of a physical component, product or system enriched with sensing data, is a digital and dynamic model in the cyber-space that is Digital twin [31], a near-real-time virtual representation of a physical component, product, or system enriched with sensing data, is a digital and dynamic model in cyberspace that is completely consistent with its physical ones in real space. It is considered a key technology in realizing cyber–physical production systems (CPPS) for Industry 4.0 [32]. Digital twin can simulate the characteristics, behavior, and performance of its physical counterpart in a timely fashion, which shows gigantic application potential in manufacturing system analysis and control [33,34].

In the aspects of production management, optimization, and control, Zhuang et al. [35] proposed a framework of digital-twin-based smart production management and control approach for complex product-assembly shop-floors. By using Plant simulation software, Vachálek et al. [36] built a digital twin for the optimization of production plans, which was designed in a way that it triggered physical and virtual productions as well. Coronado et al. [37] described the development and implementation of a new manufacturing execution system that combines MTConnect data with production data collected from operators. The work was integral to realizing a complete digital model of the shop floor for production control and optimization.

Considering digital-twin-based energy consumption evaluation and optimization of a production plan, Karanjkar et al. [38] presented an IoT-driven digital twin for energy optimization in an automated printed circuit-board assembly line. A digital twin of the line was built, and a buffering-based solution for improving energy efficiency was evaluated using simulations. Lu et al. [39] proposed an open system architecture for energy-efficient cyber–physical production network for facilitating distributed manufacturing. A cyber twin of a physical manufacturing asset was built, and the energy consumption of feature-based machining process models were evaluated in connected virtual factories. Zhang et al. [40] proposed a framework of equipment energy consumption management for a digital-twin shop floor. The data and models were discussed for monitoring, analysis, and optimization of equipment energy consumption.

It can be concluded that the most current works on digital twin of manufacturing or production system are used to monitor, evaluate, and visualize the real system based on unidirectional mapping from physical space to digital space. There is little research on models of online real-time production control from digital space to physical space, which is the main contribution in this paper considering energy consumption and productivity.

#### **3. Digital Twin Based Operation Framework of Energy-E**ffi**cient Manufacturing System**

Energy-efficient operation decisions of production systems require data from shop floors, carries out evaluations in virtual space, and makes control actions on the shop floor. Digital twin is the digital representation of a physical object. The main purpose of a production system digital twin is to facilitate decision-making activities based on simulation or computation before, during, and after production. The real-time monitoring, simulation, prediction, and control of production systems are vital to improving productivity, efficiency, and flexibility. At present, the interaction between physical and digital production systems is mainly offline interactions, lacking continuous and online interaction [33]. In this section, an operation framework with a three-view representation (Figure 1), i.e., data view, model view, and service view, is proposed to digitalize a manufacturing system, which enables us to perform simulations, to make decisions, and to control the physical system for different energy-saving purposes.

In the physical space of Figure 1, the real manufacturing/production system is a complex, diverse, and dynamic system with sensible ability in the context of Industry 4.0. The multisource and heterogeneous data (e.g., behavior, event, and state) of physical objects (e.g., machines, materials, and parts) are monitored and transmitted to databases based on IoT sensors (e.g., smart meters, radio frequency identification reader, and tags), which enhance the perception ability for physical manufacturing systems. The energy-efficient decisions made in virtual space based on digital twin are implemented through actuators of machines on the shop floor. A three-view digital twin of manufacturing systems for energy-saving operations is described as follows, which enables two-way direct or indirect mapping and interaction between the physical and the virtual manufacturing systems.

**Figure 1.** Framework of digital-twin based energy efficient operation of manufacture systems. eKPIs = energy-related key performance indicators.

#### *3.1. Data View*

The data of energy-efficient manufacturing collected from different sources has the "4V" characteristics (i.e., volume, velocity, variety, and value) of big data considering the spatial and time dimensions. The big data for energy-efficient operation of manufacturing system includes real-time and non-real-time data. The real-time data, such as electrical power of device, location of parts, buffer level, and machine throughput, is monitored and collected during production, which is the most important data source for online energy-saving decisions. The layout data, process plan, maintenance plan, and job schedule are the non-real-time data of the system collected or generated from the physical and cyber space before production. The energy-related key performance indicators (eKPIs), such as energy demand, energy cost, and energy efficiency, are also non-real-time data mined or acquired based on simulation after production. The energy big data can be structured or semi-structured. For example, the data of a machine, such as rated power, spindle speed, and cutting rate, is structured data. The process plan of a part is semi-structured data which has several flexible aspects (e.g., feature sequence, operation type, and machine selection).

The methods for cleaning, reduction, integration, and storage of energy-efficient manufacturing data can be referenced in Reference [41] and is not the focus of the paper. The high real-time processing ability of the storm real-time computing framework [42] can be adopted to process the time-series energy data. The Hadoop computing framework [43] can be used to process the non-real-time data. In order to efficiently store the big data of energy-efficient manufacturing, the Not only Structured Query Language [44] can be chosen for these large-scale structured and semi-structured datasets.

#### *3.2. Model View*

In digital space, the parameter correlations of the objects/systems are represented in simulation or computation models, which are core components of digital twin and the base of the application services. The models describe the working principle of machines with power supply, the energy consumption resources of the machining process, and the state space evolution of production systems. The models at three different levels are built for energy-efficient decisions in this framework.

At the device level, the physics-based energy model is required to formulate power consumption and dynamic behavior of industrial robot and CNC machine [40,45], and thus the energy-efficient trajectory planning, operating parameters, and power state of machine components can be completed. At the process level, the machining parameters, e.g., spindle speed, feed rate, and depth of cut, have a notable influence of energy consumption for the same job features [9]. The mathematical cutting equations or learning algorithms should be constructed for energy-consumption calculation and prediction of machining process.

The models at the system level depict the interaction among the objects in production systems. Various models such as knowledge-based models, mathematical models, and discrete event simulation models are established for different decisions of energy-efficient manufacturing. The policies/rules [23–25] and fuzzy logic [26] are expert knowledge for the energy-saving operation of production systems. The big data analysis models [46], e.g., neural networks, rough set theory, and deep learning, can mine implicit relationships of production parameters considering energy cost and productivity. The stochastic process [28] and algebra mathematical models [47] usually are used to evaluate the system eKPIs. The heuristic models (e.g., simulated annealing, genetic algorithm, and particle swarm optimization algorithm) for multi-objective optimization [17] are important for production scheduling. The discrete event simulation models are very popular for system evaluation and optimization as stated in the review section. The complex relations among entities, events, and activities of a production system are scheduled based on queuing theory in simulation models.

#### *3.3. Service View*

At the top of Figure 1, many kinds of application services are provided for online and offline scheduling, evaluating, forecasting, visualizing, monitoring, and controlling of energy-efficient manufacturing based on simulation or computation models.

The offline services are usually initiated on-demand by managers to determine the appropriate energy-efficient process parameters or job sequences in advance before production. The simulation services allow managers to perform what-if analyses on various production plans and to optimize schedules for minimizing total energy cost while maintaining higher productivity. After production, the future energy management [48,49], such as energy policy, energy benchmark, energy recycle, and manufacturing process/production schedule, can also be analyzed based on the collected data. The data-mining application services [46] can be formulated to discover hidden valuable information and knowledge from the enormous production datasets with energy indicators.

From the online services view, a near-real-time dynamic visualization application of productionand energy-related information can be generated based on discrete event simulation models with collected data, which provide more direct perceptions of the physical shop floor status. By creating the latest snapshot of the physical manufacturing system status based on the data-driven simulation method [16], the forecasting application is adaptive and flexible to any change in terms of actual production settings and can provide prediction services of system performances and eKPIs using online forward simulation experiments. Feedback control based on decisions in virtual space is the distinct characteristic of digital twin. The energy-saving opportunities during production come from the transient states of manufacturing system [27]. An online, event-driven energy-saving decision service for machine state control is proposed in this paper to execute short-term analysis by mapping the exact state of a physical system into the digital world at run time. The decision results will be sent to physical machines for realizing energy-efficient production.

#### **4. Event-Driven Online Decision Model of Energy Saving Window Using Max-Plus Algebra**

#### *4.1. Physical Manufacturing System and Modeling Assumptions*

In this paper, a typical serial production system (Figure 2) is used to illustrate energy efficient operation at the system level based on the above described digital twin framework. In order to build the mathematical model of the physical system for energy saving decision and control, the following assumptions are made.


**Figure 2.** Typical serial production system.

#### *4.2. Methodology of Event-Driven Online Energy Saving Decision and Control of Machine States*

Usually, time-based scheme is adopted at shop floor to collected production data with predefined sampling intervals and data-driven method is used to make operation decisions [41]. Generally speaking, the idle activities during production bring energy-saving opportunities. The idle activities generate from the events of blockage or starvation. Thus, event-based scheme can be more effective and economical considering the big data processing burden of time-based scheme [50]. Event-driven decision has shown many potential applications in manufacturing, such as manufacturing information system architecture [51], make-to-order production [52], and manufacturing execution system [53]. The most related research of event-based energy efficient production control is conducted by Li et al. [30,54], where a sequence of disruption events was defined to estimate the production loss for energy saving operation. In this paper, four traditional events of a machine, i.e., blockage event (BE), starvation event (SE), failure event (FE) and recover event from failure (RE), are monitored at the physical shop floor, which trigger energy-saving decision in digital space and control machines in physical system.

Based on previous works [27,55–57], an energy-saving window (ESWi) of a target machine *Mi* is defined as a time length of *Mi* being purposely put to sleep without bringing production loss to the system in this study. A system segment (SGi) of a target machine *Mi* is defined as the partial system including all machines and buffers between the target machine and bottleneck machine. The estimation of ESW in the next section will consider the bottleneck machine of the system, of which the production interruption will most likely result in system production loss [57]. The main flow of event-driven online energy-saving decision and control is shown in Figure 3 and explained as follows.

**Figure 3.** Event-driven online machine energy saving decision and control flow. Note: Abbreviations defined before Figure 2.

As shown in Figure 3, the main decision flow (rectangle 1) will be triggered if there is a BE or SE of a target machine Mi during production. The ESW of this target machine is estimated based on the current states of SGi. Then, the physical machine is switched into sleep mode. During the sleep duration of a target machine, different events of machines will be monitored and machine states will be controlled for energy-saving operation. In the flow of rectangle 2, the FE and then the RE of a machine in SGi are monitored. If an RE occurs on a machine, the main decision flow is retriggered to estimate a new ESW of the target machine. The underlying principle is that the failure of a machine in SGi can provide more energy-saving time for the target machine. In the flow of rectangle 3, different machines of the system are monitored according to the place of SGi, considering the bottleneck Mb. If the target machine Mi is before Mb, a new system segment before SGi is named as BSGi. The BE of machines in BSGi and the SE of machines in SGi are monitored. For each machine, from near to distant, related to the target machine, the machine in BSGi or SGi will be put to sleep if it is blocked or starved. If the target machine Mi is after Mb, a new system segment after SGi is named ASGi and similar decisions are made on each machine before the target machine ends its sleep. All the machines that were put to sleep will be woken when the ESW of the target machine is exhausted and a decision round ends.

Compared with time-based data sampling in the fuzzy logic method [26], our event-driven method greatly eases the burden of data collection and conforms to the stochastic of the system. The dynamic updating of the ESW of the target machine during one round decision is more reasonable compared with the constant opportunity windows [27,29,55–57] and will be illustrated in Section 5.

From the flow in Figure 3, our event-driven energy-saving decision method is also different from the event-based energy-efficient production control in References [30,54], which used predefined energy-saving control events to analyze the system performances.

#### *4.3. Estimation of Energy Saving Window Based on System Segment using Max-Plus Algebra*

Discrete event simulation is usually time consuming and cannot be used as the online tool for real-time decisions. Max-plus Algebra is a mathematical tool that can model discrete event systems in linear equations analogous to traditional state space dynamic equations [58] and has higher computation efficiency. Some works used Max-plus Algebra to model and analyse manufacturing systems, such as parametric analysis of mixed-model assembly lines [59], makespan calculation of a job-shop [60], and flow shop scheduling problems [61]. In this section, Max-plus Algebra is used to estimate the ESW of a target machine for energy saving operation based on previous work [62].

As aforementioned, ESW represents the sleep time of the target machine without affecting the production of Mb. If the target machine Mi is located before the bottleneck Mb (1 ≤ i < b), the sleep of the target machine will result in the starvation of the Mb. We define TEi as the time length that all work-in-processes (WIP) in buffers of SGi are cleared out. In order to recover the production of Mb immediately after waking the target machine, the time length from entering the target machine to arriving at buffer Bb−<sup>1</sup> must be eliminated and donated as TRi. If the target machine Mi is located after the bottleneck Mb (b < i ≤ m), putting the target machine to sleep will cause a blockage of the Mb if all buffers in SGi are full. We define TFi as the time duration that all buffers in SGi are filled from their current levels. The ESW of the target machine Mi is estimated as follows:

$$ESW\_i = \begin{cases} \begin{array}{l} TE\_i - TR\_i \quad (1 \le i < b) \\ TF\_i \end{array} \\ \begin{array}{l} (b < i \le m) \\ \end{array} \tag{1}$$

The time length TEi, TRi, and TFi can be estimated using the Max-plus Algebra method, which can calculate the time instant of a system state. Here, the estimation of TEi is illustrated as an example. The following variables are defined to describe the system states for target machine Mi (1 ≤ i < b).


Apparently, we can get the following formula if the current time clock is zero.

$$TE\_i = \mathfrak{x}\_b(n) \tag{2}$$

where xb (*n*) means the time instant that bottleneck machine Mb starts processing the last part in SGi.

At a decision time point, there are Ij−<sup>1</sup> parts in buffer Bj−<sup>1</sup> that are available to machine Mj. After the processing activity of Mj, a new part will be sent to Bj and will be available to machine Mj+1. The vector uj is formulated as follows:

$$\mu\_{i+1} = \underbrace{[0,0,\ldots,0]}\_{I\_i}^T \tag{3}$$

$$\mathfrak{u}\_{l+2} = \underbrace{[0, 0, \dots, 0, \mathbf{x}\_{l+1}(1) + \mathbf{P}\_{l+1}, \mathbf{x}\_{l+1}(2) + \mathbf{P}\_{l+1}, \dots, \mathbf{x}\_{l+1}(I\_l) + \mathbf{P}\_{l+1}]^T}\_{I\_{l+1}} \tag{4}$$

$$\mathbf{u\_{b}} = \underbrace{\left[0, 0, \dots, 0, \mathbf{x\_{b-1}}(1) + \mathbf{P\_{b-1}}, \mathbf{x\_{b-1}}(2) + \mathbf{P\_{b-1}}, \dots, \mathbf{x\_{b-1}}(I\_{l} + I\_{l+1} + \dots + I\_{b-2}) + \mathbf{P\_{b-1}}\right]^T \tag{5}$$

For each part in buffers of SGi, the time instant that Mj starts processing the part is as follows:

$$\mathbf{x}\_{i+1}(\mathbf{k}) = \max(\mu\_{i+1}(\mathbf{k}), \mathbf{x}\_{i+1}(\mathbf{k} - 1) + P\_{i+1}, \mathbf{x}\_{i+2}(\mathbf{k} - 1 + I\_{i+1} - \mathcal{C}\_{i+1})) \tag{6}$$

$$\max\_{i+2}(\mathbf{k}) = \max(\mu\_{i+2}(\mathbf{k}), \mathbf{x}\_{i+2}(\mathbf{k}-1) + \mathbf{P}\_{i+2}, \mathbf{x}\_{i+3}(\mathbf{k}-1 + I\_{i+2} - \mathbf{C}\_{i+2})) \tag{7}$$

$$\mathbf{x}\_{b-1}(k) = \max(\boldsymbol{u}\_{b-1}(k), \mathbf{x}\_{b-1}(k-1) + P\_{b-1}, \mathbf{x}\_b(k-1 + I\_{b-1} - \mathbf{C}\_{b-1})) \tag{8}$$

$$\mathbf{x}\_{\mathbf{b}}(k) = \max(\boldsymbol{u}\_{\mathbf{b}}(k), \mathbf{x}\_{\mathbf{b}}(k-1) + \boldsymbol{P}\_{\mathbf{b}}) \tag{9}$$

In state space form, it can be described as follows:

$$\begin{array}{l} \mathbf{x}(k) = & \mathbf{A} \otimes \mathbf{u}(k) \oplus \mathbf{D} \otimes \mathbf{x}(k-1) \oplus \mathbf{F}^1 \otimes \mathbf{x}\_{l+2}(k-1 + I\_{l+1} - \mathbf{C}\_{l+1}) \\ & \oplus \mathbf{F}^2 \otimes \mathbf{x}\_{l+3}(k-1 + I\_{l+2} - \mathbf{C}\_{l+2}) \oplus \dots \oplus \mathbf{F}^{b-1} \otimes \mathbf{x}\_b(k-1 + I\_{b-1} - \mathbf{C}\_{b-1}) \end{array} \tag{10}$$

The coefficient matrices A, D and F are formulated as follows:

$$\mathbf{A} \in \mathbf{R}\_{\varepsilon}^{(b-i+1)\times(b-i+1)}, \; D \in \mathbf{R}\_{\varepsilon}^{(b-i+1)\times n}, \; \mathbf{F}^{l} \in \mathbf{R}\_{\varepsilon}^{(b-i+1)\times(b-i+1)}$$

$$\mathbf{A} = (a\_{lj}) = \begin{cases} \begin{array}{l} \mathbf{e} & \mathbf{i} = j; \\ \varepsilon & \text{otherwise} \end{array} \end{cases} \tag{11}$$

$$D = (d\_{i\dot{\jmath}}) = \begin{cases} \ P\_i & \text{ $i = j$ ;} \\ \varepsilon & \text{otherwise} \end{cases} \tag{12}$$

$$\mathbf{F}^l = (f\_{ij}) = \begin{cases} \mathbf{e} & \mathbf{i} = l, j = l+1 \ (l = 1, 2, \dots, b-\mathbf{i})\\ \boldsymbol{\varepsilon} & \text{otherwise} \end{cases} \tag{13}$$

where *e* is the null element and ε is the identity element in Max-plus Algebra.

Based on the above method, the state equations of the system segment will be quickly initialized using real time production data collected from shop floor and the ESW of a machine can be estimated for online energy saving decision and control.

#### **5. Simulation Experiments and Discussion**

#### *5.1. Simulation Case of a Serial Manufacturing System*

The event-driven energy saving decision model in our digital twin of an energy efficient manufacturing system can be used to control the physical system online under Industry 4.0 environment in the future, which realizes the communication from virtual space to physical space. In order to imitate the operation procedure of the physical production system, the model of the real production line is built in MATLAB-Simulink [63]. The running process of the modeled system generates real-time production data and events, which are monitored, collected and sent to digital twin. The energy-saving decision based on Max-plus Algebra is built in digital space as a service. The decision is driven based on defined events and the decision results are sent to the mimetic physical production system in MATLAB-Simulink, where the machines are controlled for energy-saving operation. The whole process simulates the bidirectional communication between physical space and virtual space.

A typical serial manufacturing system including six machines and five buffers (6M5B) in References [26,29] is taken to illustrate the effectiveness of our method. This system is a simplified version of a real automotive production line. The parameters are presented in Tables 1 and 2, where mean time between failure (MTBF) and mean time to repair (MTTR) are assumed as exponential distribution for this case. The simulation duration is three weeks, i.e., 30,240 min. The electricity rate is assumed to be \$0.2/kWh. It is assumed that no power is consumed in machine sleep mode for comparing performances with the methods in References [26,29].

**Table 1.** Machine parameters of the 6M5B serial automotive production line.


**Table 2.** Buffer parameters of the 6M5B serial automotive production line.


Three scenarios are simulated as follows: baseline scenario with no energy saving decision and control (S1), only one machine being controlled for energy saving (S2), and multi-machine except the bottleneck machine being controlled for energy saving (S3). These three scenarios are simulated for 20 trials-each. After simulation of baseline scenario S1, machine M4 is recognized as the system bottleneck.

#### *5.2. Experiment Results and Analysis*

The simulation results of system performances, i.e., System throughput (STP), System throughput Loss (STPL), Total system energy cost (TSEE), Energy cost per part (ECPP), and Energy cost saving per part (ECSPP), are shown in Table 3 with 95% confidential interval (CI). It can be seen that the energy cost saving per part is remarkable based on an event-driven digital twin model of the machine control method. When multiple-machines are controlled in S3, there is almost 57.24% energy-cost saving and only 2.20% system throughput is lost compared with baseline scenario S1.


**Table 3.** Simulation results of the three scenarios.

Figure 4 shows the machine states time in three scenarios, where the machine states include processing (PR), blockage (BL), starvation (ST), failure (FL), and sleep (SL). For machine M1, M2, and M3 before the BN (M4), the blockage time gradually decreases and the sleep time (energy-saving time) gradually increases in S2 and S3 compared with S1. The processing time of the machines almost remain unchanged, which means the energy-saving control does not affect processing work and converts the blockage time to sleep time. For machines M5 and M6 after the BN (M4), the energy-saving decision and control method can effectively change the starvation time into sleep time. For example, the total starvation time of M5 in S1 is 86.37% of simulation time. In S3, the starvation time of M5 is entirely converted to sleep time. The total processing time of M5 in S1 (3438.2 min) and S3 (3376.6 min) almost remain the same, while the sleep time of M5 is 86.57% of simulation time in S3. The control of machine states results in the energy-cost reduction as shown in Table 3.

We recorded the data of an event-driven energy-saving decision process during simulation experiments. Table 4 shows some data from S3, and the meanings are explained as follows.

An SE of M3 is monitored at 19,772.1 min, and M3 is taken as the target machine. An energy-saving decision is triggered based on the system segment SG3 (i.e., M3-B3-M4), and the ESW of M3 is estimated as 110.1 min. At the same time, the M3 is put to sleep. No energy-saving event is monitored following 110.1 min, and then M3 is woken at 19,882.2 min. For M5, an SE is monitored at 20,679.6 min and the target machine is set as M5. The ESW5 is calculated as 470.0 min, considering system segment SG5 (i.e., M4-B4-M5) in record No.4. Before the end of sleep time, there is a failure event of M4 at time 20,757.8 (No.5) and then a recover event of M4 at time 20,813.3 (No.6). Therefore, the energy-saving decision process of M5 is retriggered at time 20,813.3 and a new ESW5 is estimated as 385.4 min. The ESW5 is updated dynamically based on the event-driven method. Later, M6 in ASG5 (i.e., B5-M6) has an SE and is put to sleep at time 20,944.8. The sleep states of M5 and M6 are ended at time 21,198.7 (No.9). M5 and M6 have another decision round shown in record No.10, 12, and 14. For M3, a BL is monitored at 21,065.4 min and taken as the target machine. The ESW3 is calculated as 1501.3 min (No.8). At the later procedure, M2 and M1 are put to sleep in succession because of the BE in BSG3 (i.e., M1-B1-M2-B2). At

the end of the sleep time of M3 (i.e., 22,566.7 min), M1, M2, and M3 are woken up together. It can be seen that multiple machines can be controlled for energy-saving operation based on the event-driven method considering online production data.

**Figure 4.** The state time distribution of machines in three scenarios.


**Table 4.** Event-driven energy-saving decision process in scenario S3.

Figure 5 shows the changing process of machine states (M5) in S1 and S3, which is randomly selected from the experiments between 20,000 to 24,000 min. In baseline S1 with no energy-saving decision and control, there are many interval starvations and processing times of M5 due to the empty state of buffer B4. For example, there is one part in B4 at time 20,158.6 (S1) and in M5 that begins to process the part for 1.1 min. After time 20,159.7, the frequent starvation and processing state occurs alternately. Therefore, many normal starvation states of M5 with short duration consume a lot of non-value-added energy. In controlled scenario S3, the M5 is put to sleep until time 20,619.2. At time 20,619.2, M5 is woken up and processes parts continuously for 61.6 min until time 20,680.7. Then, M5 is put to sleep again in a new event-driven decision round. Comparing the states of M5 in S1 and S3, it can be concluded that control of machine energy-saving states brings energy-cost reduction of manufacturing systems.

**Figure 5.** The machine state changing process of M5: (a) S1 and (b) S3.

The eKPIs of the system under multi-machine control scenario in this paper are compared with fuzzy logic method [26] and mathematical model [29] in Table 5. The three methods of energy-saving control all result in reduction of system throughput less than 3%, which is acceptable in practical manufacturing systems. Our method achieves the most energy-cost reduction per part (57.23%) compared with the other two methods, and the effectiveness of this paper is proved.


**Table 5.** Comparision of the system eKPIs in different methods.

Except for the better performances, our method has some advantages for practical use in shop floors. The first advantage is that there is no restriction on the failure mode of machines in our method. The mathematical models [24,25,29] for energy-saving decision are all based on specific failure modes of machines. When the machine recovers from failure, the event-driven method will re-estimate the ESW of the machine. Non-predefined control parameter is the second advantage of our method. In fuzzy logic method [26], the threshold values and decision intervals of the machines should be defined in advance for energy-saving control. The method in Reference [29] should assume the subjective value of discount ratio and collaboration ratio. The third advantage is that our method can be used in synchronous manufacturing systems and asynchronous manufacturing systems. The method in Reference [29] can only be used in an asynchronous line.

#### **6. Conclusions**

With the development of IoTs, energy-efficient manufacturing is provided more opportunities in an Industry 4.0 environment, where the digital twin plays an important role for real-time production monitoring, simulation analysis, and feedback control of physical systems. Considering most current works focus on the uniderection mapping from physical space to virtual space, a digital-twin-based bidirectional operation framework of energy-efficient manufacturing system is proposed to digitalize the physical manufacturing systems, to perform simulations and decisions for different energy-saving purposes in virtual space, and to control the power states of physical machines. The three views, i.e., data view, model view, and service view, are described to map the physical system to digital system. An online event-driven energy-saving decision method based on Max-plus Algebra is presented to switch machines to sleep mode with consideration of maximum energy saving and minimum effect on system throughput. The Max-plus Algebra model is used to snapshot the states of system segment and to estimate the ESW of the machines. A simplified real automotive production line is taken as an example to carry out simulation experiments, and the results illustrate the effectiveness of the proposed method compared with other methods in literatures. Not relying on machine failure mode and non-predefined parameters in our method makes it simple to be used in synchronous and asynchronous systems. The potential application of our method in more complex line, e.g., parallel line, assembly line, or disassembly line, will be experimented in the future.

**Author Contributions:** The authors contribute equally to this study.

**Funding:** This research was funded by National Natural Science Foundation of China grant number No. 71571075. **Acknowledgments:** Authors thank the anonymous reviewers for their valuable comments. **Conflicts of Interest:** The authors declare no conflict of interest.

#### **Abbreviations**


#### **References**


© 2019 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).
