Retroﬁtting a Process Plant in an Industry 4.0 Perspective for Improving Safety and Maintenance Performance

: The transformation from traditional industry to Industry 4.0 can bring many beneﬁts in various spheres, from efﬁciency to safety. However, this transition involves adopting technologically advanced machinery with a high level of digitization and communication. The costs and time to replace obsolete machines could be unsustainable for many companies while retroﬁtting the old machinery. To make them ready to the Industry 4.0 context, they may represent an alternative to the replacement. Even if there are many studies related to retroﬁtting applied to machinery, there are very few studies related to the literature process industry sector. In this work, we propose a case study of a two-phase mixing plant that needed to be enhanced in the safety and maintainability conditions with reasonable times and costs. In this regard, the Digital Twin techniques and Deep Learning algorithms will be tested to predict and detect future faults, not only already visible and existing malfunctions. This approach strength is that, with limited investments and reasonable times, it allows the transformation of an old plant into a smart plant capable of communicating quickly with operators to increase its safety and maintainability.


Introduction
Industry 4.0, also called the fourth industrial revolution, is the natural consequence of the third revolution [1], and it is mostly based on two main factors: Internet of Things and Services (IoT) and Cyber-Physical Systems (CPS) [2]. The implementation of Industry 4.0 aims to guarantee businesses a competitive strategical advantage, organization agility, organizational efficiency and effectiveness, profitability, manufacturing innovation, maintenance costs [3], improved product safety and quality, improved operations, delightful customer experience and environmental and social benefits [4,5]. As a result of its implementation, businesses could achieve a better result in the three dimensions of the Triple Bottom Line (TBL)-economic, social and ecological. Businesses that operate with the aim of achieving these three principles can be defined as sustainable [6,7]. The implementation of Industry 4.0 technologies is not simple and often presents potential problems, particularly for Small and Medium-Sized Enterprises (SME). Such problems can include limited availability of financial resources, limited knowledge and scarce technological competencies [8]. Moreover, even if the use of technologies such as IoT and CPS improve the quality and the safety of the product and the process, another new risk, such as problems connected to cybersecurity, could emerge [9]. SMEs, which make up 90% of European industries [10], are those which encounter greater difficulty in the implementation of Industry 4.0. Nonetheless, they must find a way to adapt to remain competitive against multinational industries [11]. Whereas that the process plants often have a useful life that exceeds 20 years, in many cases, it may be very economically inconvenient to replace the old plant with a new-generation plant designed for Industry 4.0 [12]. Moreover, when a plant is replaced, it must be considered that the replacement includes an

Literature Review
The literature review will bring attention to the adoption of Industry 4.0 paradigms using retrofitting in the context of industrial and process plants. Some authors have used retrofitting to improve maintenance operations. For Instance, Cattaneo and Macchi [16] have retrofitted an old drilling machine realizing a DT for estimate Remaining Useful Life; Herwan et al. [17] and Hesser et al. [18] used artificial neural networks (ANN) for detecting the tool wear in a CNC machine after retrofitting; the latter show how the ANNs give better results than support vector machine (SVM) and k-nearest neighbors (KNN) models in tools wear prediction. Strauß et al. [19] have retrofitted a heavy lift Electric Monorail System (EMS) at the BMW Group with a low-cost sensor and have used machine learning algorithms for predictive maintenance; this work shows how supervised models, such as the ANNs, are the best choice when labeled fault data are available. Supervised ANNs cannot be used without data, and they also have the disadvantage of overfitting, which tends to make the model adapt to a specific and not general behavior of the system. If no data are available, a semi-supervised approach can be adopted using models such as the Isolation Forest or the One-class SVM.
Cruz et al. [20] have implemented a data visualization system with which it is possible to make real-time analysis and predict machinery problems. Other works aim to improve performance, such as Guerreriro et al. [21] which, through the smart retrofit of a drilling process and using augmented reality, improve the quality and reduce the cycle time of the process. Still using augmented reality, Hassan Al-Maeeni et al. [13] propose the retrofitting of a bending machine through which it helps operators follow the right sequence of work to improve times and costs. Some authors suggest retrofitting case studies with an approach aimed at adaptive manufacturing; for instance, Lass and Gronau [22] apply it on a roller conveyor to speed up the reconfiguration. Contreras Pérez [23] retrofitted a CNC machine inserted in a flexible manufacturing cell, demonstrating that adopting the Industry 4.0 paradigms does not involve a huge investment but can be obtained by retrofitting existing equipment. Retrofitting is also an excellent opportunity for sustainability, as claimed by Stock and Slinger [12]. They propose a case study on a desktop tool machine. As proof of this, Lins and Oliveira [24] present in their work the improvement of the energy efficiency of a mechanical arm through a Cyber-Physical Production System (CPPS) retrofitting process, while Lima et al. [25], through simulation tools and cloud, propose an approach to evaluate the energy consumption in a manufacturing system. Furthermore, Ayani et al. [26] highlighted how DT technology is economically advantageous and beneficial for sustainability. An important aspect related to Industry 4.0 and retrofitting for its implementation is undoubtedly the safety of operators. Burresi et al. [27], in the retrofitting of a steel mill plant through the implementation of a CPS, in addition to efficiency objectives, also have the aim of improving the safety of operators, obtaining benefits not only in terms of increasing productivity but also in training new operators.
Instead of focusing on the benefits that can be obtained from an Industry 4.0 retrofitting, such as those listed above, some works focus on how to transform a machine, a plant, a process ready for Industry 4.0. These works focus on the aspects of the approach adopted, communication, type of IoT sensors and all the other technologies adopted to make the old manufacturing systems smart. For instance, ref. [28][29][30] propose different approaches to make CNC machines and robotic arms ready for Industry 4.0, while Haskamp et al. [31] present a migration process from an old system to an ICPS (Industrial Cyber-Physical System) for a flexible manufacturing system. Gualtieri et al. [32] propose a qualitative and economic evaluation model for the transformation from the manual working area to the human-robot collaborative area. Garcia et al. [33] present a case study that aimed to increase the level of communication and interoperability in a flexible manufacturing system. Some retrofitting works use a Reference Architectural Model Industry 4.0 (RAMI 4.0)-based approach [24,33,34]. RAMI 4.0 is a kind of framework for the implementation and development of Industry 4.0 applications; although it is an effective method to implement Industry 4.0, often, in old plants, this type of approach needs data that are not available or are difficult to collect. Most of the cases discussed in the literature refer to manufacturing processes, while regarding process plants, it is still a relatively unexplored topic. Moreover, regarding the implementation of digital models, the literature reports several examples of DT applications in maintenance; instead, the implementation for safety or risk assessment is limited. The few works identified are carried out by Gabbar et al. [35]. They proposed dynamic process modeling for safety assessment and risk analysis. Although the case study regards a hydro-desulphurization unit and demonstrated to identify some specific high-risk scenarios, the proposed model did not develop a systematic process hazard analysis. Ramzan et al. [36] also proposed a simulation model for the hazard analysis on a distillation column with two products. A further study that made use of dynamic simulation for conducting process hazard analysis was conducted by Wu et al. [37]. These authors integrated qualitative models with dynamic simulation for conducting a process hazard analysis. Recently, Kummer and Varga [38] developed an open software platform that allows generating disturbances to provide input to traditional hazard assessment processes to reduce the hazard process duration and human error. It was tested in a chemical process to evaluate the system's sensitivity to critical variable disturbances.
The literature approaches are intended to provide only a quantitative assessment of the risk without developing a real DT of the plant.
The literature reviewed highlights, first of all, how retrofitting operations are typical for manufacturing plants and not for process plants. Secondly, although all addressed Industry 4.0 technologies, the proposed articles mainly focus on developing a single aspect and not on an integrated system. The Industry 4.0 paradigm strength is referred precisely to the integration of these technologies into a single system capable of connecting all actors involved in the execution of activity (from the individual operator to the manager, from the first to the last machine).
For this reason, the framework presented in this article wants to show how a careful analysis of technologies, about the reality under investigation, can allow to digitalize and manage at best an old plant, above all keeping costs down. From the articles reviewed, we can see the inaccessibility (for the moment) to these technologies by small industrial realities. For this reason, the proposed approach wants to try to overcome this limitation.

Retrofitting Research Approach
The proposed approach to retrofit an old process plant can be divided into four main phases, as shown in Figure 1. 1. The starting point is the definition of the objectives. The adoption of Industry 4.0 paradigms makes it possible to achieve targets such as improving working conditions, better quality processes, better communication, collaboration, improved productivity, improved efficiency, flexibility, agility and reduced costs. In our case study, this objective is connected to enhancing the safety and maintainability of a two-phase mixing plant through smart solutions. Achieving all these objectives is very difficult; therefore, before designing the retrofit, it is important to identify which are the most strategic ones. This step is essential because it helps designers to identify the Industry 4.0 application to be defined. 2. The second phase consists of an AS-IS analysis. In this step, a detailed description of the plant and process is developed to analyze the main functions of the plant, the variables (temperature, pressure, flow rate, ...) that come into play in the process, the variables already monitored and those that must be controlled. This is possible thanks to the analysis of historical data and interviews and questionnaires with the operators who used the plant. Indeed, in this phase, a risk assessment of the plan must be developed in order to identify and analyze all possible tricky events, their causes and the internal and external risk factors. Through an iterative process, the preliminary analysis and knowledge of Industry 4.0 paradigms can change or add previously defined objectives. Moreover, considering that the idea is to create a digital mapping of a process, a careful technical evaluation can help to define additional variables to be monitored and controlled to achieve the required targets. 3. The third phase regards the retrofitting processes.The new hardware (IoT tools) will be implemented, a platform will be developed for acquiring data, control the plant and simulate new scenarios. The sensors and actuators acting on the variables must communicate with the acquisition platform. This step is one of the most critical activities in the retrofitting process since the sensors and actuators already present could not communicate with third-party systems, requiring their replacement or adjustment.
The realized system allowed us to implement Deep Learning and Swarm Intelligence (SI) algorithms devoted to anomaly prediction and prevention. The collected data will be stored in databases and used in real time by a specific additional application. Thus, appropriate communication protocols will have to be defined and implemented to guarantee the required performance in terms of speed, efficiency and security. It is preferable to use Cloud Storage rather than classic DBs to ensure that many users can rapidly access data, simultaneously. 4. Finally, a user interface has to be developed in order to make the developed applications easy to use for the operators. Although operators should have experienced at least some training and are known, the interface has to be designed so that it can be operated by very heterogeneous user groups with little to no training, in varying contexts and environments and with only a little knowledge about the users themselves.

The Case Study
The case study regards a laboratory plant (shown in Figure 2a,b) that simulates a situation that occurs in the oil extraction processes; the pressure of an oil field, whose pressure is higher than the transport pressure, is exploited to create a suction on an oil field whose pressure is not high enough for transport on the line. In this case, the motive fluid, i.e., the one with the highest pressure, is a liquid, while the second fluid, i.e., the aspirated one, is a gas. In the real case, the fluids are oil and gas, while in the experimental plant under consideration they are water and air. The plant consists of an ejector pumping system for the transport of two-phase gas-liquid fluids.

Retrofitting Objectives
The main retrofitting objective is to enhance the safety and maintainability conditions of the plant. The major criticalities of the system are linked to the compromise of the final part of the ejector and the possibility of occlusions in the pipes. Creating a DT of the entire system is a relatively expensive process in terms of time. Therefore, given that the most dangerous component in the event of a malfunction is the ejector, it is more useful to create the DT of this component in the first phase. In this way, it will be possible not only to simulate the various operating conditions but also to evaluate the real behavior of the system with respect to the simulated one. To improve maintainability conditions, especially about the formation of occlusions in the pipes, it may be useful to implement an anomaly detection system that allows to quickly identify the area where the intervention is to be performed. to the open tank (CO4), takes a flow rate Q liq of water and sends it, at a certain pressure P liq , to the ejector (CO2). The ejector is the main component of the system; it has the task of exchanging energy between the high-pressure fluid and the low-pressure one. Inside the ejector, transformation from pressure energy into kinetic energy occurs through a converging cone. The depression created by this transformation generates a suction on the air duct, which is at atmospheric pressure. A mixture of the two fluids comes out of the ejector at a pressure compressed between the pressure of the two. This biphasic mixture flows into a tank that acts as a vertical separator. The liquid component goes downwards by gravity while the gaseous one goes upwards. Finally, the gaseous component is dispersed into the atmosphere from the tank while the liquid one is re-flowing back into the open tank. The plant is also equipped with two solenoid valves that control the flow rate at the outlet of the liquid component (VC2) and the flow rate at the outlet of the gaseous component (VC1) from the tank. Through an analog PID (Proportional-Integral-Derivative) control, these valves maintain a prefixed liquid level (sensor L20) and a pressure (sensor L19) inside the tank.

AS-IS Analysis
The most critical component is the diverging cone at the ejector outlet, used for pressure recovery. This component in the event of overpressure in the affected area could be compromised. Furthermore, when working with water and air in this system, incrustations or occlusions are rarely formed in the pipes. Considering a real case where the fluids are oil and gas extracted from an oil field, these problems are much more frequent. According to the risk assessment analysis, the main risks connected to this plant are The retrofitting process discussed in the next sections aims at predicting and preventing the highlighted risk events through smart solutions.

New Variables and Hardware
It is possible to divide the variables of a process into monitored variables, usually represented by sensor readings, and controlled variables, which typically require the presence of an actuator. In this case, in the original configuration, the pressure and the liquid level inside the tank were the monitored variables necessary for the normal operation of the process. The controlled variables were the gas and liquid outlet section from the tank, controlled by two solenoid valves (VC1 and VC2). Although these variables were sufficient for the normal operation of the process, the plant was equipped with other monitored variables useful for better checks on operations. These variables were the pressure before, after and on the ejector case and the flow before the ejector. To make the system ready for Industry 4.0, in addition to the variables introduced above, it is necessary to control new variables. Specifically, after analyzing the process from the fluid dynamic point of view, the variables necessary to ensure sufficient monitoring of the risks are those shown in Table 1.
All mechanical sensors, such as the pressure gauges placed near the ejector, have been replaced with analog instruments. The acquisition and control board used in this case is an Arduino Mega 2560, which accepts an input voltage for analog signals from 0 to 5 volts. Most of the sensors installed are equipped with a 0-5 volts output; the sensors with a different output range have been equipped with a converter that has equalized the output voltage to the voltage accepted by the acquisition card. Figure 4 shows the layout of the system with the new equipment installed.

Adjustment/Redesign Acquisition and Control Platform
As it is possible to see in Figure 4, with respect to the initial configuration of Figure 3, all the sensors converge in the acquisition card. In addition, the control of the solenoid valves, which was previously carried out with an analog PID control (see Figure 3), is now completely managed by the acquisition card itself. As previously said, the acquisition card chosen is Arduino Mega 2560. It was chosen because it is very versatile, reliable, easily programmable and cheap. Arduino Mega 2560 is equipped with an 8-bit microprocessor, 54 digital and 16 analog pins. Normally Arduino can communicate only through the serial port; for this reason, it has been equipped with an additional shield that allows it to communicate through the Ethernet port. The board sends the data to a server that will process them and make them available. The board will also control the solenoid valves according to the precise indications of the server.
The Arduino MEGA 2560 has a clock of 16 MHz. The execution speed is very high and suitable for the management of real-time systems, such as the case study presented, considering the delays due to memory management and that the operating code is not an operating system but a single program. The libraries allow Arduino to access the internet via a SocketIO connection to send data to the Cloud. The SocketIOs will enable us to receive the plant data, in real-time, from any connected device. A web page interprets and analyzes the data and allows users to save and download the data while the plant is running. Arduino has been preferred to other types of acquirers, such as ADAM, because it can adapt its outputs autonomously, being a programmable microcontroller. On the contrary, other acquirers need at least a PC always turned on and connected to the network to read and send commands. What has been said would lead not only to a drastic increase in sensor reading times but, above all, to risks when the PID systems that control the actuators are activated because there is no direct control over them. Figure 5 represents the flow of information. The sensors send an analog signal to the Arduino, which converts this signal into a digital signal. Arduino sends, through the web socket communication protocol, the sensor readings detected to a web platform, which will have the task of analyzing, displaying and storing these data. Communication is not mono-directional; from the web platform, it is possible, always using the web socket communication protocol, to send commands to the Arduino, which can control the actuators present on the system. WebSocket, in particular, socketIo is a web technology that offers the possibility of establishing a bi-directional Full-Duplex communication on a TCP/IP port between a client and a server. The peculiarity of a Full-Duplex communication is to transmit and receive data simultaneously between the "interlocutors". In the context of the development of web applications, which must have real-time functionality, web sockets are the reference HTML5 technology that web applications should aim for in the future. The system was equipped with an analog PID control of the solenoid valves to maintain constant pressure and liquid level in the tank at certain values. In the new configuration, this control is guaranteed by Arduino, which, thanks to a special library, allows to perform a digital PID control. The PID parameters and the desired pressure and level values are communicated through the web platform.
Regarding data storage, it must be considered that the volume of data stored will be very large over time. Moreover, to use Industry 4.0 typical algorithms, such as machine learning ones, very fast access to data is required. For this reason, it is not recommended to use a traditional data storage approach, such as a classic relational DB. A solution could be using one of the many cloud service vendors such as Microsoft Azure, Amazon, etc. At this point, the plant can be considered Industry 4.0 ready.
What is described only means that the system is designed to be included in a 4.0 context. This does not mean that the plant is already taken advantage of the benefits of Industry 4.0. To take advantage of the benefits of Industry 4.0 it is necessary to develop applications dedicated to performing certain functions, as can be seen in the next section.

Development of Industry 4.0 Applications
The strategic objectives defined above are to improve safety and maintainability conditions; therefore, the applications that have been defined are as follows: • create a DT model of the process that occurs in the ejector; • create an anomaly detection platform to promptly identify the cause of an anomaly.
The former allows both to simulate the behavior of the ejector in different scenarios and compare the real-time status of the system with the simulated one to evaluate any malfunctions. The latter focuses attention on the problem of the occlusion of the pipes, allowing technicians, in case of occlusion of some pipes, to quickly identify which is the area on which to intervene.

Ejector Digital Twin
For developing the Ejector DT we used a supervised approach because it is too complex to model the behavior of this component through mathematical equations or Computational Fluid Dynamics (CFD) Simulation software like Ansys. Initially, a series of test campaigns were carried out that allowed the collection of data under different working conditions; subsequently, among the supervised approach, we evaluated Deep Learning and SI algorithms.
The best results for the ejector simulation model were obtained using SI algorithms such as Fish Colony, Water Cycle and Grey Wolf. Moreover, many mathematical functions have been implemented, such as linear, exponential, quadratic, etc., to identify the model that best represents the behavior of the ejector. Table 2 shows how the available variables have been used for output estimation. To test the various algorithms, a set of simulations were carried out varying the algorithm, the function, the number of iterations (between 30 and 90) and the swarm size (between 30 and 90 agents). Table 3 shows an extract of the analyzed scenarios (experiment number, intercept present or not, function type, population size and maximum iteration number).
By comparing the variance inflation factor (VIF) and the computational time, the best estimation algorithm for ejector DT was the Gray Wolf with swarm size equal to 60 and 60 iterations. Equation (1) reports the mathematical model, and Figure 6 shows the comparison of real and simulated behaviors.
The estimation error committed ranges from a minimum of 0.03% to a maximum of 7.75% on all the tests considered.
The DT tool can work both online and off-line. Working off-line, the tool allows us to analyze what-if scenarios, identifying the tricky situations for operators without activating the plant and simulating maintenance procedures.
When the tool works on-line, it receives information from sensors and modifies its parameters allowing users to compare the data provided by sensors and the simulated ones.

Anomaly Detection Platform
Before proceeding with the development of the anomaly detection platform, the process parameters, shown in Table 4, were defined. Subsequently, a test campaign was carried out in normal and anomalous operating conditions. The manual valves, arranged along with the plant, were used to simulate the anomalies. Specifically, the valves VM3, VM4, VM5 and VM6 were used to simulate occlusion, and the valve VM7 simulated a tank leak (see Table 5). Table 4. Process parameters contain the parameters characteristic of the normal steady state. These parameters were used to perform the tests for training the anomaly detection model.  Table 5. Fault types-the categories into which a fault, related to occlusions or leaks, can be classified.

A1
Fault 1 consists of an obstruction in the air intake duct Simulated by closing the VM3 shut-off valve A2 Fault 2 consists of an obstruction of the ejector outlet duct Simulated by closing the VM4 shut-off valve A3 Fault 3 consists of an obstruction of the water outlet pipe from the tank Simulated by closing the VM5 shut-off valve A4 Fault 4 consists of an obstruction of the air outlet duct from the tank Simulated by closing the VM6 shut-off valve A5 Fault 5 consists of a tank leak Simulated by opening the VM7 shut-off valve The problem of identifying anomalies has been separated into two sub-problems: • evaluate whether the system is in a fault condition or not; • if the system is in a fault condition, classify the type of fault.
The first problem was addressed using a traditional approach. A multivariate statistic was used to verify whether the system was in a control condition or not; specifically, Hoteling's T 2 Control Chart was used [39]. Once the data were standardized, and the control limit was calculated using the steady-state data, it was possible to discriminate the out-of-control points in the tests that presented anomalies and assign them the specific anomaly. Figure 7 shows an example of data collected where is clearly defined the working condition and the out-of-control condition. Once the anomaly is generated, the system switches from a control condition (T < UCL) to an out-of-control condition (T > UCL).
The dataset obtained is similar to that in Table 6. On the one hand, there are standardized sensor readings, while, on the other, there is a vector of five binaries, which identifies the type of anomaly.
Several studies [40][41][42][43] have shown that when you have available data related to anomalies, or you are able to simulate anomalies (as in this case), anomaly detection algorithms, based on neural networks, have obtained good results. For that, the second problem was dealing with an MLP neural network (see Figure 8). The dataset described above was divided into a training dataset and a test dataset; subsequently, systematic experimentation was carried out to evaluate the best configuration for the neural network. Table 7 shows the parameters and ranges used for systematic experimentation. Figure 7. The trend of the multivariate statistic (Hotelling T2) during an A1 anomaly; sensor readings are condensed into a single variable, so it is easy to determine when the system is out of control. Table 6. Extract of dataset used for the training of the neural network. Column X contains the anomaly data, which were standardized with mean and variance calculated in the steady-state conditions. Column Y contains binary vectors necessary to classify the type of anomaly. Readings at time t and (t-1) were used as input for the neural network. Thus, the network was equipped with a kind of memory. Finally, the best configurations were evaluated through a k-fold evaluation test. In terms of accuracy (about 98%), the best configuration was the one with 36 neurons in the first hidden level and 8 in the second level, with a learning rate of 0.05 and 300 training epochs.  Figure 8. Structure of the neural network used. In input to the network, in addition to the readings at time t, the readings at time t-1 are used; in this way the network has a kind of memory.

User Interface
The platform interface is essential. A web interface was created for the case study examined. Through this interface, it is possible to see the sensor readings in real-time, evaluate the deviation between the ejector's real behavior and the simulated one and, finally, identify the anomalies. The interface has been equipped with the system 3D model in which anomalies will be reported directly to facilitate anomalies identification. Figure 9 shows the main page of the developed interface.

Discussion
The retrofitting process led to an improvement in the performance of the system, but, at the same time, it presented some difficulties in the application and the emergence of new problems. The application of the proposed approach to the case study allowed, in a reasonable time and machine downtime, an improvement in the performance. As shown in Table 8, the retrofitted system allows better maintenance and operator safety management thanks to the specific applications for anomaly detection and simulation. Furthermore, the newly developed platform allows remote monitoring and controlling via a web application. Thus, both operators and managers can have a broader view of the process. Managers and analysts can also quickly access the database cloud with historical data to make statistics and forecasts.

Security
High risk for operators who are near the plant in the event of a malfunction.
With the simulation tool, it is possible to anticipate tricky situations by intervening preventively or by stopping the process. Maintainability Specialized operators are required to identify the area on which to intervene in the event of an anomaly.
Thanks to the anomaly detection tool, time for identifying the intervention area is drastically reduced, and highly specialized operators are not required to determine the area of interest.

Plant control
Process control is only possible in the vicinity of the plant, and making an overall assessment of the process is very complicated.
Through the developed platform, it is possible to monitor the process in real-time using a web application. Furthermore, it is possible to combine the various sensor readings to obtain aggregate data that gives a rough idea of the process status. Access to data There is no data acquisition system.
Thanks to the data acquisition and storage system in the cloud, data can be quickly accessed both locally and remotely. Consequently, it requires the adoption of data protection systems from any cyber-attacks.
Regarding the criticality in reference to the model implementation, it is possible to highlight the need for deterministic transactions. Real-time implies determinism. This means that processing must be based on suitable (operating) systems designed for real-time. The design of embedded systems, by definition, is aimed at applications with specific performance and guaranteed stability. Moreover, for embedded systems, the usual concept that computing devices will soon be more powerful and less expensive is no longer valid. Programming paradigms must take into account a new dimension where resources are limited "by design".

Conclusions
The process of transitioning old process plants to Industry 4.0 is still a great challenge for many companies, especially SMEs. This article proposes a general framework to guide the transition process. The proposed framework was applied to a real case study relating to a two-phase process plant. The application to the real case showed the strengths and weaknesses of the proposed method. The strength of this approach is that, with limited investments and reasonable times, it allows the transformation of an old plant into a smart plant capable of communicating easily with the outside world-all this without completely changing the system configuration. In the case study presented, the improvement of communication allowed the improvement of the aspects related to safety and maintainability. The application of this approach presented some challenges, mainly related to the multidisciplinarity of the topics dealt with, ranging from knowledge of the process to electronics to information technology and data analysis. Furthermore, the definition of the new variables is a recursive operation linked to the performance evaluation. This can lead to a delay compared to the time foreseen in the planning phase. The work carried out on the plant is a preliminary work. Indeed, development is foreseen in the future. Surely the DT, which was created in this phase only for the ejector, will have to be implemented in the entire system and even in the entire work environment through cameras and RFID systems. Concerning the anomaly detection system, new systems will have to be developed that do not require preliminary data to function; for example, unsupervised machine learning algorithms could be used. Moreover, it could be useful to develop a dedicated interface for mobile devices such as smartphones or smartglasses. Funding: This research was funded by INAIL (Istituto Nazionale per l'Assicurazione Contro gli Infortuni sul Lavoro), the Italian National Institute for Insurance against Accidents at Work grant number BRIC 2018 project titled "Sviluppo di soluzioni smart attraverso metodologie Digital Twin per aumentare la sicurezza degli operatori durante i processi di manutenzione degli impianti produttivi"-BRIC ID12.
Institutional Review Board Statement: Not applicable.

Informed Consent Statement: Not applicable.
Data Availability Statement: Data available on request due to restrictions e.g. privacy or ethical. The data presented in this study are available on request from the corresponding author. The data are not publicly available due to privacy requested by the INAIL, the funding agency of the project.

Conflicts of Interest:
The authors declare no conflict of interest.