<<

sensors

Article Sensors Data Analysis in Supervisory Control and Data Acquisition (SCADA) Systems to Foresee Failures with an Undetermined Origin

F. Javier Maseda 1,*, Iker López 2 , Itziar Martija 1 , Patxi Alkorta 3 , Aitor J. Garrido 1 and Izaskun Garrido 1

1 Automatic Control Group (ACG), Institute of Research and Development of Processes, Faculty of Engineering, University of the Basque Country (UPV/EHU), 48013 Bilbao, Spain; [email protected] (I.M.); [email protected] (A.J.G.); [email protected] (I.G.) 2 Intenance, RDT Company, 48100 Munguia, Spain; [email protected] 3 Engineering School of Gipuzkoa, University of the Basque Country (UPV/EHU), 20600 Eibar, Spain; [email protected] * Correspondence: [email protected]; Tel.: +34-94-6014354

Abstract: This paper presents the design and implementation of a supervisory control and data acquisition (SCADA) system for automatic fault detection. The proposed system offers advantages in three areas: the prognostic capacity for preventive and predictive maintenance, improvement in the quality of the machined product and a reduction in breakdown times. The complementary technologies, the Industrial of Things (IIoT) and various machine learning (ML) techniques,   are employed with SCADA systems to obtain the objectives. The analysis of different data sources and the replacement of specific digital sensors with analog sensors improve the prognostic capacity Citation: Maseda, F.J.; López, I.; for the detection of faults with an undetermined origin. Also presented is an anomaly detection Martija, I.; Alkorta, P.; Garrido, A.J.; Garrido, I. Sensors Data Analysis in algorithm to foresee failures and to recognize their occurrence even when they do not register as Supervisory Control and Data alarms or events. The improvement in machine availability after the implementation of the novel Acquisition (SCADA) Systems to system guarantees the accomplishment of the proposed objectives. Foresee Failures with an Undetermined Origin. Sensors 2021, Keywords: industry 4.0; industrial internet of things; supervisory control and data acquisition 21, 2762. https://doi.org/10.3390/ system; machine learning s21082762

Academic Editors: Pal Varga and Salvatore Cavalieri 1. Introduction Industry 4.0 is used as a synonym for cyber-physical production systems (CPPSs) or Received: 4 March 2021 cyber-physical systems when applied in the domain of the industry [1]. Accepted: 12 April 2021 Published: 14 April 2021 Industry 4.0 is based on the complete digitalization of value chains through data processing technologies, intelligent software and a new view of sensor facilities [2]. The goals of

Publisher’s Note: MDPI stays neutral Industry 4.0 are to promote decentralization, interoperability, modularity and real-time with regard to jurisdictional claims in capability. Industry 4.0 promises increased flexibility in production facilities and, in this published maps and institutional affil- way, promotes mass customization, better quality and improved productivity [3]. In iations. summary, Industry 4.0 will become one of the broadest areas of research in the next decade [4,5]. However, it is well-known that industry has traditionally demonstrated inertia toward technological change. This current stage of technological development for the industrial transformation to the smart factory is becoming faster, and it is expected to achieve un- Copyright: © 2021 by the authors. Licensee MDPI, Basel, Switzerland. precedented levels in operational efficiencies [6]. One solution for overcoming an outdated This article is an open access article industry may be the development and implementation of retrofitting techniques with the distributed under the terms and addition of new technologies for an efficient re-use of existing equipment [7]. conditions of the Creative Commons Using the Internet and CPPSs, manufacturing plants can be modernized, transforming Attribution (CC BY) license (https:// them into intelligent factories, characterized by a continuous and instantaneous inter- creativecommons.org/licenses/by/ communication between different workstations that make up the production chains [8]. 4.0/). The Industrial Internet of Things (IIoT) and its related domains—industrial networks, big

Sensors 2021, 21, 2762. https://doi.org/10.3390/s21082762 https://www.mdpi.com/journal/sensors Sensors 2021, 21, 2762 2 of 18

data and cloud computing—will bring great opportunities for promoting these industrial upgrades [9]. Supervisory control and data acquisition (SCADA) systems are the underlying moni- toring and control strategy components of CPPSs [10]. The SCADA system supervises a plant or process through a master terminal unit (MTU) with one or more remote terminal units (RTUs). Through the human–machine interface (HMI), users obtain information in real time that allows them to improve decision-making procedures. The SCADA systems’ increasingly efficient connection with the Internet, as well as with corporate networks, allows for the management of a great amount of data [10]. The collection of data generated by the sensors contributes to the improvement of the control and self-diagnostic capacity in different technological areas [11–13]. The virtual replication of a manufacturing chain and the improvement of operative procedures and test simulations are the new possibilities for sensors in Industry 4.0 [12–14]. The data ingestion of heterogeneous sensors and devices is a challenge which plays a significant role in SCADA systems. Different solutions have been proposed, from the use of device templates to strategies for data synchronization, data slicing, data splitting and data indexing [15,16]. The combination of data mining and analytics with machine learning (ML) algorithms can be used for information extraction, data pattern recognition and fault prediction [17,18]. The evolution of technology and equipment in modern industry has made main- tenance tasks more complex and functional. Two tasks can be highlighted in the new generation of SCADA systems: managing a huge amount of different data and fault di- agnosis and prognosis [19]. The manufacturing industry generates more data than any other sector of the economy; however, on many occasions, these data do not result in knowledge [20]. One of the main objectives of maintenance is to integrate in SCADA systems diagnosis modules for detecting abnormal situations from sensor data [21]. The alarms and event logs are the base knowledge for analyzing the root cause of most of the failures, something usually undervalued in industry. The ML applications in maintenance tasks can cover these gaps and take advantage of all these data logs, resulting in smarter and more robust manufacturing [22–24]. In this study we analyzed the roles that sensor data analysis and treatment play in a SCADA system for fault diagnosis, specifically for faults that have a difficult prognosis due to root causes of unknown origin. Applications of different maintenance procedures for identifying error patterns and estimating the useful life of the machinery components were developed. The fulfillment of the main objective proposed and its application rely on the improvement of the availability of machine tools in chip removal machining processes and its adaptability to other machine processes. Chip removal machinery are widely used industrial equipment for which the IIoT and ML techniques can notably help to improve the resolution of different maintenance failures in relation to their undetermined root causes. The methodological approach is based on the challenge of foreseeing faults with an undetermined origin. The first step is the development of a preventive and predictive maintenance procedure integrated in the SCADA system. This procedure analyzes the sensor and actuator from three data sources: retrofitting, digital twin and event SCADA screens. The IIoT physical support, which facilitates data collection from different sources within a diverse operational environment, is an Open Platform Communications (OPC) system [25,26]. The developed environment is a response to the majority of failures, as their origin becomes known [27,28]. However, some faults and their root causes remain unknown [29]. The analysis of these abnormal situations leads to the decision to change from digital to analog sensors in specific machine variables. The novel features added to the anomaly detection procedure improve fault prognosis. Finally, for resolving hidden faults, fundamentally those related to the malfunctioning of the machine without generating an alarm or event, an unsupervised anomaly detection algorithm is used. The remainder of this work is organized as follows. Section2 surveys the related work. Section3 details the SCADA system’s main functions for failure detection, and provides a Sensors 2021, 21, 2762 3 of 18

global vision of applicable procedures for their resolution. Section4 presents the proposed IIoT architecture and the protocols implemented. Section5 sets out the data sources for fault detection. Section6 describes the use of analog sensors as a solution for the detection of faults with unknown origins. In Section7, the data management and machine learning techniques and, in particular, an anomaly detection algorithm, are developed. Finally, Section8 presents the results and conclusions.

2. Related Work This section describes and contrasts related work from the fields of fault and anomaly detection in Industry 4.0. The authors of [3] have provided a review of intelligent manufacturing techniques in the context of Industry 4.0. In recent years, the explosive growth of sensor data in SCADA systems through IIoT platforms has resulted in an increased use of data mining and analytics in , improving the role of machine learning [10,18]. In turn, the authors of [19] surveyed the different artificial intelligent techniques for the fault diagnosis of rotating machinery. A data-driven approach based on alarms, events and exploratory data analysis was proposed in [20]. In order to illustrate the efficiency and usefulness of machine learning in smart manu- facturing, with regard to fault diagnosis, different algorithms have been proposed in [21,22]. In [23], the authors outlined machine learning in the fault diagnosis of air handling units, based on the comparison between the observed behavior and a set of behavioral patterns generated through various fault conditions. Furthermore, the authors of [24] undertook a survey on decision-making procedures based on system reliability for improving predictive maintenance in Industry 4.0. This study analyzed the impact that local failures can impose on an entire company. Also, anomaly detection algorithms in different industry fields have been widely used. In [30], the authors describe a new methodology for the detection of anomalies in industrial components based on the creation of behavior patterns using unsupervised machine learning algorithms such as K-means for clustering. An algorithm based on probability density distribution was used to enhance the cluster patterns. Likewise, an interesting application of an anomaly detection algorithm for early stage-bearing fault diagnosis was presented in [31]. Similarly, machine learning methods for anomaly detection, improving maintenance activities and security in industrial processes techniques were developed in [32]. Finally, in [33], the author used as a case study the detection of known and unknown faults in the automotive industry by acquiring data during production and testing of vehicles. In this work, two-class and one-class classifiers were evaluated. Most of the described works in fault and anomaly detection compare different machine learning algorithms applied to a specific case study so that the proposals have enough machine data to use these supervised and unsupervised machine learning algorithms. In addition, the different classifiers have been successfully used to detect the anomalies. The proposal presented in this paper is quite different since the main idea relies on using the most effective procedure and a feasible anomaly detection algorithm for industrial applications in a diverse range of chip removal machinery. A second difference is related to the unknown causes of the failures that make the selection of features for the algorithms difficult and can determine the changes in the machine structure, as it is a case of replacing digital sensors with analog sensors. Another difference is the absence of clear data patterns to assist with the fault identification tasks, as these faults either do not generate events or are related to wear and fatigue in components. Finally, the results of the progressive implementation and adaptation of the proposed system provides a knowledge base for continuous improvement. Sensors 2021, 21, x FOR PEER REVIEW 4 of 18

Designs and implementations of supervisory control and data acquisition systems for improving the use of industrial machinery have been increasing in recent years, with an evolution towards novel objectives, such as standardization, complex data analysis and robustness against failure [2,21]. Figure 1 shows a SCADA system for controlling and Sensors 2021, 21, 2762 monitoring an industrial system. 4 of 18 Four basic functions performed by SCADA systems for creating autonomous envi- ronments with the final objective of the improvement of a fault prognostic for faults with no clear root causes are described below. 3. FailureAutomation: Detection the Backgroundcontrol and data are linked, in a continuous and reliable way, with the field equipment.Designs and Supervision: implementations based on of the supervisory data movement, control the and state data of actuators acquisition and systems sensors arefor improvingmonitored from the use an ofHMI industrial and stored machinery in the Cloud. have been Alarm increasing management: in recent the years,events with and alarmsan evolution caused towards by an abnormal novel objectives, state of suchthe process as standardization, are gathered. complexReport generation: data analysis the SCADAand robustness functions against generate failure a large [2,21 amount]. Figure of 1he showsterogeneous a SCADA data, system the analysis for controlling of which leads and tomonitoring different maintenance an industrial procedures, system. some of them based on artificial intelligent technologies.

Figure 1. ((aa)) Supervisory Supervisory control control and and data data acquisition acquisition (SCADA) (SCADA) system; system; (b) ( bretrofitting) retrofitting scheme scheme as asSCADA SCADA screen screen for forlo- locatingcating a aspecific specific system system fault. fault.

FigureFour basic 1 shows functions a typical performed example by of SCADA a standard systems maintenance for creating procedure. autonomous In Figure environ- 1a, aments fault withpops theup in final a SCADA objective screen of the (the improvement red color indicates of a fault a fault); prognostic in this for case, faults it describes with no aclear clogged root causespump areor strainer described filter. below. A sensor detects the fault in a carriage’s hydrostatic lubricationAutomation: system, the a controlsituation and difficult data are to linked,find during in a continuous a routine inspection. and reliable If way, the withuser clicksthe field on equipment.the SCADA screen Supervision: fault, the based related on theretrofitting data movement, scheme in the Figure state 1b of shows actuators the detectionand sensors of an are anomaly monitored in the from starting an HMI level and of storedthe return in the pump Cloud. to the Alarm drill management:tank of a ma- chine’sthe events right and chip alarms collector. caused This by level an abnormal stays at state“1”, causing of the process the pump are gathered.to start and Report stop constantly,generation: which the SCADA is not an functions optimum generate function aing large state amount for the motor-pump of heterogeneous group data, (35M2). the analysisThe ofproposed which leadsSCADA to differentsystem implements maintenance different procedures, improvemen some ofts them based based on the on analysisartificial intelligentof data generated technologies. in this situation. For example, the number of motor-pump groupFigure operations1 shows carried a typical out exampleopens new of apredictive standard maintenance procedure.procedures Infor Figure monitor-1a, inga fault and pops foreseeing up in a SCADAfuture wear screen failures (the red in color this indicates equipment. a fault); Howeve in thisr, case,the question it describes is whethera clogged it pumpis feasible or strainerto develop filter. a general A sensor procedure detects for the the fault early in detection a carriage’s of failures hydrostatic that, lubrication system, a situation difficult to find during a routine inspection. If the user clicks on many occasions, may have uncertain origins. Figure 2 shows a flowchart that provides on the SCADA screen fault, the related retrofitting scheme in Figure1b shows the detection an answer to this question. of an anomaly in the starting level of the return pump to the drill tank of a machine’s right The flowchart illustrates the process of analysis of maintenance resource optimiza- chip collector. This level stays at “1”, causing the pump to start and stop constantly, which tion, determining if a breakdown is caused by a persistent or intermittent fault. If the fault is not an optimum functioning state for the motor-pump group (35M2). is persistent, the machine can be repaired. However, if the fault is intermittent, occurring The proposed SCADA system implements different improvements based on the in erratic sequences with variable durations, it is necessary to define whether the origin of analysis of data generated in this situation. For example, the number of motor-pump group the fault is known or not. When an intermittent problem occurs due to a known fault, the operations carried out opens new predictive maintenance procedures for monitoring and previous procedure is followed: the fault is corrected and the machine re-started, fixing it foreseeing future wear failures in this equipment. However, the question is whether it is so it does not occur again. feasible to develop a general procedure for the early detection of failures that, on many In cases where the origin of the fault is uncertain, the proposed solution is to be applied. occasions, may have uncertain origins. Figure2 shows a flowchart that provides an answer Theto this first question. thing needed is to know the state of the machine. The next step is to obtain a collection The flowchart illustrates the process of analysis of maintenance resource optimization, determining if a breakdown is caused by a persistent or intermittent fault. If the fault is persistent, the machine can be repaired. However, if the fault is intermittent, occurring in erratic sequences with variable durations, it is necessary to define whether the origin of the fault is known or not. When an intermittent problem occurs due to a known fault, the previous procedure is followed: the fault is corrected and the machine re-started, fixing it so it does not occur again. Sensors 2021, 21, x FOR PEER REVIEW 5 of 18

of variables and capture all the signals that intervene in the process for their analysis. Subse- quently, all the information collected is processed for visualization in the SCADA graphical interface, created through retrofitting, digital twin and event log screens. The monitoring pro- cess does not start when the fault is generated. The application is always in operation in order to collect in real time all the events that occur in the machines. The continuous processing of these data through different machine learning algorithms can offer sufficient information to solve a failure of which the origin was previously uncertain. The scalability in the use of these algorithms guarantees an optimal management of the fault prognosis [23]. Finally, if the fault diagnosis system still does not have enough information to solve the problem, it will continue collecting data, repeating the process described above. The last situation relates to the lack of information about the root cause of the prob- lem. These uncertainties are mainly due to the majority of sensors in use being digital. The Sensors 2021, 21, 2762 change from digital to analog sensors in strategic machinery components, which present5 of 18 most of the intermittent failures, can help in identifying the root causes and lead to the development of a solution for them.

FigureFigure 2. Flowchart 2. Flowchart for forfault fault diagnosis diagnosis and and resolution. resolution.

4. IIoT andIn cases SCADA where Systems the origin of the fault is uncertain, the proposed solution is to be applied. The first thing needed is to know the state of the machine. The next step is to obtain a The Industrial Internet of Things and its related domains, big data and cloud computing, collection of variables and capture all the signals that intervene in the process for their bring great opportunities for promoting industrial advancements in Industry 4.0. The massive analysis. Subsequently, all the information collected is processed for visualization in the data-exchange boosted by SCADA systems and IIoT demands more incisive approaches to SCADA graphical interface, created through retrofitting, digital twin and event log screens. the analysis of industrial data. Data mining, analytics support and decision-making play an The monitoring process does not start when the fault is generated. The application is important new role in the process industry [24]. Analysis of sensor data to predict intermittent always in operation in order to collect in real time all the events that occur in the machines. failures due to an undetermined root cause belongs within this framework. The continuous processing of these data through different machine learning algo- Figure 3 shows the communication platform proposed for linking the SCADA system rithms can offer sufficient information to solve a failure of which the origin was previously and the database in the Cloud. However, there are two concepts that should be analyzed: uncertain. The scalability in the use of these algorithms guarantees an optimal management of the fault prognosis [23]. Finally, if the fault diagnosis system still does not have enough information to solve the problem, it will continue collecting data, repeating the process described above. The last situation relates to the lack of information about the root cause of the problem. These uncertainties are mainly due to the majority of sensors in use being digital. The change from digital to analog sensors in strategic machinery components, which present most of the intermittent failures, can help in identifying the root causes and lead to the development of a solution for them.

4. IIoT and SCADA Systems The Industrial Internet of Things and its related domains, big data and cloud com- puting, bring great opportunities for promoting industrial advancements in Industry 4.0. The massive data-exchange boosted by SCADA systems and IIoT demands more inci- sive approaches to the analysis of industrial data. Data mining, analytics support and decision-making play an important new role in the process industry [24]. Analysis of Sensors 2021, 21, x FOR PEER REVIEW 6 of 18

the real-time and the open communication structures. They allow precision and free de- sign for adaptation to different industrial applications [9,10]. The schematic shown in Figure

Sensors 2021, 21, 2762 3 represents a general operation environment, where the procedure for fault diagnosis6 is of inte- 18 grated and the ML algorithms use the database for prognosis tasks. These IIoT and SCADA systems make data management and the anomaly detection algorithms portable systems with a high degree of independency from the operating environment used for its implementation. sensorA data measuring to predict device intermittent that works failures in real time due is to able an undeterminedto show the value root of causea variable belongs at the withinprecise this instant framework. when this variable changes its state. When , controllers or any device thatFigure works3 basedshows on the a communicationcomputer program platform to process proposed field forinformation linking the are SCADA used, a system time lag andappears, the database a delay, inwhich the Cloud. can affect However, the instantane there areous twoaccuracy concepts of the that displayed should value. be analyzed: This lack theof real-timeaccuracy andcan thego unnoticed, open communication particularly structures. in the measurement They allow of precision “slow” variables, and free designor it can forbe adaptation considerable to differentin the case industrial of “fast” applicationsvariables. Figure [9,10 ].3 Theshows schematic an instantaneous shown in peakFigure of3 an representsanalog variable a general that must operation be accurately environment, recorded where and thecollected procedure in the fordatabase. fault diagnosis is integratedThis anddelay the or MLtime algorithms lag can also use appear the database in the devices for prognosis that make tasks. up a These telecommunica- IIoT and SCADAtion network, systems such make as data switches management and routers. and theConsequently, anomaly detection the term algorithms “real time” portable should systemsalso take with into a consideration high degree of these independency delays in transmission, from the operating which environmentcould be understood used for as itserrors implementation. or noise [21].

FigureFigure 3. 3.Implemented Implemented Open Open Platform Platform Communications Communications (OPC) (OPC) scheme scheme and and database. database.

AOn measuring the other devicehand, “real that workstime” is in a real term time that is should able to be show properly the value valued of in a variablean industrial at theenvironment. precise instant It is whenpossible this to variabledefine the changes delay that its can state. be Whentolerated computers, by the process controllers and in orthis anycontext device “strictly that works in real based time” on means a that a system program reacts to process to external field events information within arethat used, speci- afied time time lag appears,in 100% of a cases. delay, If which the specific can affect reaction the times instantaneous are overcome accuracy without of causing the displayed relevant value.problems, This lackas in ofnon-critical accuracy systems, can go unnoticed, it is called particularly“soft real time”. in the measurement of “slow” variables,The ormain it canadvantage be considerable of a PC-based in the system, case of its “fast” open structure, variables. can Figure become3 shows a relevant an instantaneousdrawback. The peak open of anstructure analog allows variable the that company must be and accurately developer recorded more freedom and collected in choos- in theing database. the right tool for the design, programming and implementation of the SCADA system. However,This delay having or time to centralize lag can also the appear data insent the by devices communication that make up protocols a telecommunication from different network, such as switches and routers. Consequently, the term “real time” should also take manufacturers can generate errors when sending the data and poor analysis from the pre- into consideration these delays in transmission, which could be understood as errors or dictive algorithms. The treatment of corrupted data can be a major inconvenience in ob- noise [21]. taining favorable results. The use of Open Platform Communications (OPC) is a solution On the other hand, “real time” is a term that should be properly valued in an industrial for this issue. environment. It is possible to define the delay that can be tolerated by the process and in this context “strictly in real time” means that a system reacts to external events within that 4.1. Open Platform Communications specified time in 100% of cases. If the specific reaction times are overcome without causing relevantOpen problems, Platform as inCommunications non-critical systems, is a communication it is called “soft standard real time”. for the secure and re- liableThe exchange main advantage of data in of the a PC-based industrial system, its open environment. structure, It can allows become the aflow rele- of vantinformation drawback. among The open devices structure from different allows the manufacturers. company and The developer OPC standard more freedom defines inthe choosinginterface the between right tool clients for theand design, servers, programming including real-time and implementation data, monitoring of the alarms SCADA and system.events and However, accessing having historical to centralize data. the data sent by communication protocols from different manufacturers can generate errors when sending the data and poor analysis from the predictive algorithms. The treatment of corrupted data can be a major inconvenience in obtaining favorable results. The use of Open Platform Communications (OPC) is a solution for this issue. Sensors 2021, 21, 2762 7 of 18

4.1. Open Platform Communications Open Platform Communications is a communication standard for the secure and reliable exchange of data in the industrial automation environment. It allows the flow of information among devices from different manufacturers. The OPC standard defines the Sensors 2021, 21, x FOR PEER REVIEWinterface between clients and servers, including real-time data, monitoring alarms7 of and 18

events and accessing historical data. The purpose of this standard is to abstract PLC-specific protocols (such as Profibus, ,The purpose Profinet, of etc.) this into standard a standardized is to abstract interface PLC-specific allowing protocol HMI/SCADAs (such as systems , to convertModbus, generic Profinet, OPC etc.) read/write into a standardized requests into interface device-specific allowing requests HMI/SCADA and vice-versa. systems to convertWith generic the introduction OPC read/write of service-oriented requests intoarchitectures device-specific in manufacturingrequests and vice-versa. systems, new challengesWith the in security introduction and data of service-oriented modeling arise. Thearchitectures OPC Foundation in manufacturing developed thesystems, OPC UAnew specificationschallenges in security to address and these data needsmodeling and arise. at the The same OPC time Foundation provided developed a feature-rich, the open-platformOPC UA specifications architecture to address technology these that needs is future-proof, and at the same scalable time andprovided extensible. a feature- This multi-layered approach accomplishes the original design specification goals of functional rich, open-platform architecture technology that is future-proof, scalable and extensible. equivalence, platform independence and security [25]. This multi-layered approach accomplishes the original design specification goals of func- 4.2.tional Software equivalence, for Interactive platform Work independence and security [25]. Cyber-physical production systems need to include different technologies and have 4.2. Software for Interactive Work to be able to fulfill the requirements imposed, such as optimization of the manufacturing process,Cyber-physical data integration, production secure syst communicationems need to andinclude flexible different adaptation technologies to changes, and have among to othersbe able [to1]. fulfill the requirements imposed, such as optimization of the manufacturing process, data integration,SIMATIC WinCC secure wascommunication the software and tool flexible used inadaptation this project. to changes, It is a well-adapted among others envi- [1]. ronmentSIMATIC for working WinCC with was SCADA the software applications. tool used It isin a this scalable project. visualization It is a well-adapted environment en- endowedvironment with for working powerful with functions SCADA for applications the supervision. It is ofa scalable automated visualization processes. environ- WinCC providesment endowed full SCADA with functionalitypowerful functions in Windows, for the from supervision single-user of systemsautomated to distributed processes. multi-userWinCC provides systems full with SCADA redundant functionality servers [in26 Windows,]. from single-user systems to dis- tributedWinCC multi-user integrates systems Visual with Basic redundant for Applications servers (VBA) [26]. in WinCC Graphics Designer, a standardWinCC environment integrates forVisual application-specific Basic for Applications extensions. (VBA) VBA in WinCC provides Graphics access toDesigner, all con- figurationa standard data environment (variables, for warnings, application-speci images andfic graphic extensions. objects, VBA with provides animation access included). to all Figureconfiguration4 shows data an implementation (variables, warnings, example. images and graphic objects, with animation in- cluded). Figure 4 shows an implementation example.

Figure 4. Extract of the VBScript encoded to control anan internalinternal securitysecurity barrierbarrier ofof aa machine.machine.

The result of thisthis softwaresoftware combination,combination, inin thethe HMIs,HMIs, allowsallows managingmanaging usersusers andand passwords, comparing different variables, programmingprogramming several conditions at thethe samesame time, sending reports ofof errorserrors andand storagestorage inin ,databases, effectivelyeffectively extendingextending thethe failurefailure prognosis for most of situations. In the following section, three examples are developed for a better comprehension of the proposal.

5. Data Sources for Fault Detection As previously mentioned, one of the biggest problems faced by developers in the area of industrial maintenance is the lack of knowledge about the exact origin of the failure that causes a breakdown. This results in an indeterminable waste of time—unfortunately more often spent on the search for the failure than its resolution—and therefore in in- creased production over-costs.

Sensors 2021, 21, x FOR PEER REVIEW 8 of 18

Information is the solution for fixing the faults and this information is located in the SCADA data. Figure 5 shows three dataset sources for fault detection. The first source is the data obtained by retrofitting techniques. Figure 5 shows a hydrau- lics and lubrication screen that has been created and animated from the original static draw- ing. The retrofitting techniques transform the old documentation into new SCADA screens, which is thus a low-cost solution with optimum results [4]. Drawings of pipes, motors, sole- noid valves and so on that change color at the same time that the variables change state im- mediately indicate if a hose has pressure, if a pump is running or if the machine is projecting coolant while machining. Changes of states in cylinders and electro-valves are also visualized, generating a clearer understanding of the operation of the circuits and helping to instantly Sensors 2021, 21, 2762 8 of 18 identify the causes of a possible fault. In addition, these component signals supply the data- base for actuators and sensors. Their analysis allows the overcoming of potential failures in components, from intermittent faults to predictions on wear fatigue. prognosisThe second for most data of situations.source is obtained In the following from digital section, twin three production examples systems. are developed Figure for 5 showsa better a comprehensionvirtual twin of a of set the of proposal.automatic tool loaders and its GRAFCET (Graphe Fonction- nel de Commande Etape Transition). The digital environment reproduces a real system, its control5. Data variables Sources for and Fault the functioning Detection conditions: a robot that loads tools from the ware- house,As a previouslychanging arm mentioned, that exchanges one of the tools biggest between problems the machining faced by developers head and inthe the ware- area houseof industrial robot, maintenancethe laser detectors is the lack for ofchecking knowledge and aboutmeasuring the exact the origintools and of the the failure different that doorscauses that a breakdown. open or close This depending results in anon indeterminablethe needs of the waste machine. of time—unfortunately more oftenIn spent cases on of thea failure search in for a change the failure sequence, than itsthe resolution—and stage tag that has therefore not been in completed increased remainsproduction red, over-costs. alerting the operator where the problem has occurred. The fault is recorded in theInformation database in is order the solution to be analyzed, for fixing theincluding faults andinformation this information on whether is located the fault in the is persistentSCADA data. or intermittent Figure5 shows and threewhether dataset its root sources cause for is faultknown. detection.

Figure 5. Standard data sources for fault detection.

The first source is the data obtained by retrofitting techniques. Figure5 shows a hydraulics and lubrication screen that has been created and animated from the original static drawing. The retrofitting techniques transform the old documentation into new SCADA screens, which is thus a low-cost solution with optimum results [4]. Drawings of pipes, motors, solenoid valves and so on that change color at the same time that the variables change state immediately indicate if a hose has pressure, if a pump is running or if the machine is projecting coolant while machining. Changes of states in cylinders and electro-valves are also visualized, generating a clearer understanding of the operation of the circuits and helping to instantly identify the causes of a possible fault. In addition, these component signals supply the database for actuators and sensors. Their analysis allows the overcoming of potential failures in components, from intermittent faults to predictions on wear fatigue. Sensors 2021, 21, 2762 9 of 18

The second data source is obtained from digital twin production systems. Figure5 shows a virtual twin of a set of automatic tool loaders and its GRAFCET (Graphe Fonctionnel de Commande Etape Transition). The digital environment reproduces a real system, its control variables and the functioning conditions: a robot that loads tools from the warehouse, a changing arm that exchanges tools between the machining head and the warehouse robot, the laser detectors for checking and measuring the tools and the different doors that open or close depending on the needs of the machine. In cases of a failure in a change sequence, the stage tag that has not been completed remains red, alerting the operator where the problem has occurred. The fault is recorded in the database in order to be analyzed, including information on whether the fault is persistent or intermittent and whether its root cause is known. The third source is the event log. Figure5 shows a type of screen, perhaps somewhat unusual, for fault detection. The figure shows one specific signal from the total set of events and alarms that appear during the production time. When an anomaly during the machining process happens, the machine activates a series of variables stored in a folder exclusively for events and alarms. By detecting that change of state in these variables, it is possible to visualize what situation is occurring and what part of the system it comes from. Figure5 also shows an abnormally delayed operation time in a hydraulic cylinder, which could mean a reduction of pressure for its operation, possibly caused by excessive friction or a synchronization fault. The analysis should lead to the root cause prognosis and avoid the foreseeable blockage.

6. Analog Sensors as a Solution for Faults with Unknown Origin Analog sensors provide an opportunity to improve the SCADA system characteristics by increasing their efficiency in predicting failures—in particular, failures that are more difficult to resolve because their origin remains unknown from among many possible root causes. The replacement of a digital sensor with an analog sensor in an industrial context is not an easy decision. Doing so means a modification of the machine structure. In addition, this decision implies that the new feature needs to be included in the fault detection algorithms. Figure6 shows a yearly report of the fault incidence for a specific machine based on the number of notices and downtime hours. The left y-axis shows the number of maintenance notices and downtime hours, in blue and brown bars respectively, for each part of the machine. The Automatic Tool Changer alone accounted for 40% of the machine notices on the right y-axis. Figure6 illustrates the most critical components in the machine and answers the question as to where to implement the change. In the case of this particular yearly report, this information led to the decision to change specific digital sensors for analog sensors in these critical components of the machine. This option should be carefully analyzed because it involves physical changes and hardware and software development. The real case described in this paper allowed for the analysis of the strategic role of an analog sensor (SA5000 from IFM) installed in the cooling system of a milling machine (Figure7). The cooling system was the second most common cause of downtime in the machine. The digital flowmeter switch that was previously installed could only indicate if the flow rate of the coolant pump was correct based on a set point programmed in the controller. After installing the analog flowmeter, the monitoring interface was able to control in real-time the real flow through the coolant pipe. Figure7a shows the sensor installed in the pipeline and Figure7b shows a graphic with the pressure flow measurement. The main goal was to link the information of the cooling system flowmeter with the type of machining operation and tool type used at all times. Then, using all the data extracted from the machine, wear failure of the coolant pumps could be avoided, preventing the machine from being damaged and ensuring the optimal functioning of the cooling systems and the highest quality of the produced pieces. Sensors 2021, 21, x FOR PEER REVIEW 9 of 18

The third source is the event log. Figure 5 shows a type of screen, perhaps somewhat unusual, for fault detection. The figure shows one specific signal from the total set of events and alarms that appear during the production time. When an anomaly during the machining process happens, the machine activates a series of variables stored in a folder exclusively for events and alarms. By detecting that change of state in these variables, it is possible to visualize what situation is occurring and what part of the system it comes from. Figure 5 also shows an abnormally delayed operation time in a hydraulic cylinder, which could mean a reduction of pressure for its operation, possibly caused by excessive friction or a synchronization fault. The analysis should lead to the root cause prognosis and avoid the foreseeable blockage.

6. Analog Sensors as a Solution for Faults with Unknown Origin Analog sensors provide an opportunity to improve the SCADA system characteris- tics by increasing their efficiency in predicting failures—in particular, failures that are more difficult to resolve because their origin remains unknown from among many possi- ble root causes. The replacement of a digital sensor with an analog sensor in an industrial context is not an easy decision. Doing so means a modification of the machine structure. In addition, this decision implies that the new feature needs to be included in the fault detection algorithms. Figure 6 shows a yearly report of the fault incidence for a specific machine based on the number of notices and downtime hours. The left y-axis shows the number of mainte- nance notices and downtime hours, in blue and brown bars respectively, for each part of Sensors 2021, 21, 2762 the machine. The Automatic Tool Changer alone accounted for 40% of the machine notices10 of 18 on the right y-axis. Figure 6 illustrates the most critical components in the machine and answers the question as to where to implement the change.

Sensors 2021, 21, x FOR PEER REVIEW 10 of 18

(Figure 7). The cooling system was the second most common cause of downtime in the machine. The digital flowmeter switch that was previously installed could only indicate if the flow rate of the coolant pump was correct based on a set point programmed in the controller. After installing the analog flowmeter, the monitoring interface was able to control in real-time the real flow through the coolant pipe. Figure 7a shows the sensor installed in the pipeline and Figure 7b shows a graphic with the pressure flow measurement. The main goal was to link the information of the cooling system flowmeter with the type of machining operation and tool type used at all times. Then, using all the data ex- tracted from the machine, wear failure of the coolant pumps could be avoided, preventing the machine from being damaged and ensuring the optimal functioning of the cooling systems and the highest quality of the produced pieces. Figure 6. Accumulated number of notices and hours of machinery stoppages.

In the case of this particular yearly report, this information led to the decision to change specific digital sensors for analog sensors in these critical components of the ma- chine. This option should be carefully analyzed because it involves physical changes and hardware and software development. The real case described in this paper allowed for the analysis of the strategic role of an analog sensor (SA5000 from IFM) installed in the cooling system of a milling machine

(a) (b)

Figure 7. (a) Analog flowmeter installed in the machine. (b) Coolant flow monitoring. Figure 7. (a) Analog flowmeter installed in the machine. (b) Coolant flow monitoring. 7. Data Management for Improving Prognosis Capabilities and Machine Learning 7. Data Management for Improving Prognosis Capabilities and Machine Learning The Automatic Tool Changer in chip removal machining processes is usually engaged The Automatic Tool Changer in chip removal machining processes is usually en- in exchanging milling and drilling tools. It is very important to maintain a stable hydraulic gaged in exchanging milling and drilling tools. It is very important to maintain a stable service pressure in this component; a reduction in pressure, for example, causes the tool hydraulic service pressure in this component; a reduction in pressure, for example, causes to vibrate when working and results in roughly machined pieces. This is the problem the tool to vibrate when working and results in roughly machined pieces. This is the prob- examined in this section, as it was the most frequent source of notices and downtime hours lem examined in this section, as it was the most frequent source of notices and downtime for the machine described in Figure6, nearly 40%. For some unknown reason, a drop hours for the machine described in Figure 6, nearly 40%. For some unknown reason, a in pressure can be noticed after certain tool changes. This should not happen due to the drop in pressure can be noticed after certain tool changes. This should not happen due to existing nitrogen hydraulic accumulator in the pressure circuit. The system must ensure the rotaryexisting shaft nitrogen remains hydraulic free of blockagesaccumulator in eachin the of pressure the special circuit. heads. The system must en- sure Figurethe rotary8 shows shaft the remains hydraulic free of circuit blockages and measured in each of data the inspecial the pressure heads. sensor of the analyzedFigure system. 8 shows The the sensor hydraulic used wascircuit the and same meas analogured sensor data in as the previously pressure (SA5000 sensor of from the analyzedIFM), which system. can be The programed sensor used as was an analog the same flowmeter analog sensor or an analog as previously pressure (SA5000 meter. from IFM), which can be programed as an analog flowmeter or an analog pressure meter.

Sensors 2021, 21, 2762 11 of 18 Sensors 2021, 21, x FOR PEER REVIEW 11 of 18

FigureFigure 8. 8.Hydraulic Hydraulic circuit circuit and and unstable unstable and and stable stable recorded recorded pressure pressure data. data.

InIn this this kind kind of of maintenance maintenance problem, problem, the the difficulty difficulty of of determining determining the the useful useful life life of of eacheach element element of of the the hydraulic hydraulic circuit circuit and and the the discharge discharge of of the the nitrogen nitrogen accumulator accumulator is is assumed.assumed. InIn addition, addition, the the problem problem involves involves not not only only an an unexpected unexpected machine machine stop, stop, but but alsoalso the the quality quality of of the the machining. machining. This This last last problem problem was was detected detected with with a a product product quality quality inspectioninspection but but the the machine machine did did not not give give any any warning warning of of the the event. event. What What is is proposed proposed is is the the applicationapplication of of different different techniques techniques to to determine determine whether whether intervention intervention in in the the equipment equipment is is necessarynecessary based based on on the the value value of of certain certain indicators. indicators. The The techniques techniques that that can can be be employed employed toto acquire acquire or or determine determine these these indicators indicators can can be be non-invasive non-invasive measurements, measurements, performance performance data,data, scheduled scheduled tests tests and and behaviors behaviors detected detected from from the the monitoring monitoring system. system. 7.1. Condition-Based Maintenance 7.1. Condition-Based Maintenance Condition-based maintenance (CBM) combines three elements: data acquisition, data Condition-based maintenance (CBM) combines three elements: data acquisition, data processing and maintenance decision-making [27,28]. A simple procedure for maintenance processing and maintenance decision-making [27,28]. A simple procedure for mainte- decision-making is to perform the statistics calculation of SCADA data in intervals in differ- nance decision-making is to perform the statistics calculation of SCADA data in intervals ent time horizons and, in this way, check whether the possible anomalous trends detected arein different the result time of some horizons specific and, requirement in this way, check or are whether maintained the possible over time. anomalous The statistics trends calculationsdetected are chosen the result for this of some purpose specific were requ theirement arithmetic or meanare maintained and the standard over time. deviation. The sta- tisticsThe calculations arithmetic meanchosen of for a finite this purpose set of values were aims the toarithmetic offer the mean expected and valuethe standard or the mathematicaldeviation. expectation of the sample used. To do this, all the sample values are added (x(i)) andThe divided arithmetic by themean number of a finite of addends set of values (m). aims to offer the expected value or the mathematical expectation of the sample used. To do this, all the sample values are added (x(i)) and divided by the number of addends1 (m).n µ = · x(i) (1) m ∑n 1 i=1 µ= · x (1) m The standard deviation is a statistic used toi=1 quantify the variation or dispersion of a set of data, indicating its tendency to be grouped close to its mean value. The standard deviation is a statistic used to quantify the variation or dispersion of a set of data, indicating its tendency tos be groupedm close to its mean value. 1 ( ) 2 σ = · (x i −µ) (2) m ∑ m 1 i=1 2 σ= · (x-μ) (2) m In Figure9, pressure data captured overi=1 a certain period of time, the calculated arithmeticIn Figure mean 9, value pressure (165.30 data bar) captured and the over standard a certain deviation period of (2.2821) time, the are calculated shown. These arith- datametic are mean considered value within(165.30 thebar) standard and the workstandard conditions deviation window. (2.2821) If the are pressure shown. evolutionThese data generatesare considered a notice within or error the in standard the CDM work system, conditions a warning window. is sent toIf thethe maintenancepressure evolution staff. generates a notice or error in the CDM system, a warning is sent to the maintenance staff.

Sensors 2021, 21, 2762 12 of 18 Sensors 2021, 21, x FOR PEER REVIEW 12 of 18

FigureFigure 9.9. Captured datadata andand thethe arithmeticarithmetic meanmean valuevalue underunder standardstandard conditions.conditions.

Under standard conditions, the working pressurepressure of thethe systemsystem isis betweenbetween 150150 andand 170170 bar.bar. TheThe fluctuationsfluctuations areare duedue toto thethe demanddemand pumpspumps andand pressurepressure accumulator.accumulator. TheThe ideaidea isis toto recordrecord thethe pressurepressure valuesvalues everyevery 500 ms, whenever the machine is in operation, and to include these data in the statistics method, which would establish the conditions for and to include these data in the statistics method, which would establish the conditions preventive and predictive maintenance actions. for preventive and predictive maintenance actions. The value of the arithmetic mean and its evolution can be used as an indicator of The value of the arithmetic mean and its evolution can be used as an indicator of the the wear of the pump and the accumulator. In our case study, for the detection of a wear of the pump and the accumulator. In our case study, for the detection of a continued continued decrease over time, a daily average lower than 162 bar was set as a standard, decrease over time, a daily average lower than 162 bar was set as a standard, and if main- and if maintained over five days it would lead to a request for a time window to intervene tained over five days it would lead to a request for a time window to intervene in the in the machine and check the status of the hydraulic system. On the other hand, a standard machine and check the status of the hydraulic system. On the other hand, a standard de- deviation greater than 3.25 was set to trigger a review notice and activate preventive viation greater than 3.25 was set to trigger a review notice and activate preventive mainte- maintenance; a deviation greater than 3.75 bar was set to trigger a notice for high priority nance; a deviation greater than 3.75 bar was set to trigger a notice for high priority mainte- maintenance action. nance action. 7.2. Machine Learning 7.2. Machine Learning Machine learning is a subset of artificial intelligence methods actively used in indus- trial settingsMachine [ 22learning]. The applicationsis a subset of involve artificial supervised intelligence and methods unsupervised actively algorithmsused in indus- for supportingtrial settings the [22]. optimization The applications of maintenance involve supervised decisions about and unsupervised locating faults algorithms and machine for malfunctioningsupporting the optimization with an unclear of maintenance origin [23,24]. decisions about locating faults and machine malfunctioningA significant with issue an unclear in the caseorigin study [23,24]. under examination is that faults very rarely occurA and significant when they issue do in occur, the case they study depend under on examination multiple factors. is that The faults creation very rarely of different occur behaviorand when patterns they do occur, based they on the depend progressive on multiple degradation factors. The of industrial creation of components different behav- can provideior patterns advance based failure on the warning progressive and degradat precise faultion of detection industrial [29 components–31]. Most ofcan pertinent provide studiesadvance in failure the literature warning compare and precise different fault classifiers detection when [29–31]. dealing Most with of pertinent a specific studies problem in inthe a literature machine component,compare different for which classifiers the probability when dealing of failure with isa studiedspecific problem or predicted. in a ma- On manychine occasions,component, there for arewhich data the available probability that allowof failure the identificationis studied or ofpredicted. a behavior On pattern many modeloccasions, that there can beare considered data available “normal” that allow or there the identification are anomaly of data a behavior for training pattern and model cross- referencethat can be dataset considered creation “normal” [30–33]. or In ourthere case are study, anomaly the failuredata for or training malfunction and cross-refer- is detected, butence its dataset origin creation is undetermined [30–33]. In and ourso case is thestudy, component, the failure or or components, malfunction ofis detected, the machine but thatits origin cause is it. undetermined In addition, there and areso is no the initial component, data for theor components, anomaly to adjust of the themachine metric that for predictingcause it. In theaddition, fault. Thesethere are two no facts initial make data it difficultfor the anomaly to predict to andadjust search the metric for the for origin pre- ofdicting the failure. the fault. In thisThese case two study, facts unsupervised make it difficult machine to predict learning and algorithmssearch for forthe anomalyorigin of detectionthe failure. can In bethis employed case study, to unsupervised investigate possible machine solutions learning for algorithms these situations. for anomaly de- tection can be employed to investigate possible solutions for these situations.

Sensors 2021, 21, 2762 13 of 18

The data features considered are the pressure (x1) and the tool’s three axis positions (x2, x3, x4) for robotic arm movement. Table1 shows a set of real data for analysis.

Table 1. Input data: sensor pressure (x1) and the tool’s three axis positions (x2, x3 and x4).

Pressure (bar) X-axis (mm) Y-axis (mm) Z-axis (mm) 166.7101 1450.00 −3000.8 0 166.577 1450.00 −3000.8 0 166.6435 1612.44 −3000.8 −82.5457 149.4734 2901.50 −3000.8 −737.6 163.0498 2901.50 −3000.8 −737.6 166.4439 2901.50 −3000.8 −737.6 162.9167 2363.06 −3000.8 −463.9846 165.8449 1450.00 −3000.8 0

The number of the sample m for the anomaly detection algorithm can be defined in a flexible mode. As previously mentioned, the sample time for security in the OPC UA is 500 ms; all the features are captured at the same time and, as a result, in sixty seconds the system can have 120 samples for each feature. In the following analysis, m = 468.

 1 1 1 1   x1 x2 x3 x4   . .. .  Data set = . .. . (3)  m m m m  x1 x2 x2 x4 The anomaly detection is based on a Gaussian distribution:

(x−µ)2  2 1 (− ) p x; µ, σ = √ exp 2σ2 (4) 2πσ

where µ is the arithmetic mean and σ2 is the variance. The Gaussian density for all features can be determined as follows:

n  2  2  2  2   2 p(x)= p x1; µ1, σ1 p x2; µ2, σ2 p x3; µ3, σ3 . . . .p xn; µn, σn = ∏ p xj; µj, σj (5) j=1

(x −µ )2 n n (− j j )   2σ2 2 1 j p(x) = ∏ p xj; µj, σj = ∏ √ exp (6) j=1 j=1 2πσj The anomaly detection is activated when the Gaussian density has a lower probability than a constant value “epsilon”: p(x)< ε (7)

This value ε is selected based on the F1 score metric. After observing the distribution data, we implemented a multivariate Gaussian distribution:

1 1 T −1 (− 2 (x−µ) Σ (x−µ)) p(x; µ, Σ) = n 1 exp (8) (2π) 2 |Σ| 2

where µ ∈ Rn is the arithmetic mean vector and Σ ∈ Rnxn is the covariance matrix. The results can be observed in Figure 10a,b. Figure 10a shows the data distribution, with the pressure in bars on the x-axis and the three-dimensional robot arm position (XYZ) on the y-axis. Figure 10b shows probability results, analyzed as a multivariate Gaussian distribution. Sensors 2021, 21, x FOR PEER REVIEW 14 of 18

Sensors 2021, 21, 2762 14 of 18 p-amplitude Robot Arm Axis (mm): X-blue, Y-green, Z-red Y-green, X-blue, (mm): Axis Arm Robot

(a) (b) Figure 10.Figure (a) The 10. (positiona) The position arm axis arm axisrelated related to tohydr hydraulicaulic circuit circuit pressurepressure with with about about m = m468 = samples 468 samples for each for feature. each (feature.b) (b) MultivariateMultivariate Gaussian Gaussian distribution distribution px; p μ,(x; Σµ,.Σ ).

As previously mentioned, the constant ε for accomplishing p(x) < ε is adjusted As previously mentioned, the constant ε for accomplishing px <ε is adjusted through the F1 score metric. A point of difference in this case is that, compared with other throughapplications the F1 score of anomaly metric. detection A point algorithms, of difference there in is th nois pattern case is for that, the recognitioncompared ofwith other applicationspositive faults.of anomaly This fact detection makes it difficult algorithms, to use athere cross-reference is no pattern dataset for to the adjust recognition the of positivemetric. faults. Once theThis epsilon fact valuemakes has it been difficult selected, to theuse applied a cross-reference solution consists dataset in analyzing to adjust the the possible outliers, which in this case results in 17 situations of possible anomalies that metric. Once the epsilon value has been selected, the applied solution consists in analyz- could result in a malfunction in the machining process and consequent quality faults ing thein thepossible machined outliers, pieces. which These in outliers this case result re insultstp (true in 17 positives situations situations), of possiblefp (false anomalies that couldpositive result situations), in a malfunctionfn (false negative in situations)the machining and tn process(true negative and situations)consequent and quality this faults in theinformation machined allows pieces. for These the improvement outliers result of the precisionin tp (true of positives the F1 score situations), metric for future fp (false posi- prognosis. The precision (P) and recall (R) parameters are applied for computing the metric: tive situations), fn (false negative situations) and tn (true negative situations) and this in- formation allows for the improvement of the precisionPR of the F1 score metric for future F −score = 2 (9) prognosis. The precision (P) and recall1 (R) parametersP + R are applied for computing the met- ric: P and R can be obtained as follows:

tp PR PF=-score=2 (10) (9) tp + fp P+R

P and R can be obtained as follows: tp R = (11) + tp fn P= (10) where tp represents the true positive situations where+ the prediction and the actual situation are coincident and the fault exists; fp represents the false positive situations where a fault is predicted but there is no fault in the machine; f represents the false negative situations R= n (11) where the prediction is that there is no fault, but the+ fault exists in the machine; and, finally, tn represents the true negative situations where the prediction and the actual situation are wherecoincident tp represents and the the fault true does positive not exist. situations where the prediction and the actual situa- tion are coincident and the fault exists; fp represents the false positive situations where a 8. Results and Conclusions fault is predicted but there is no fault in the machine; fn represents the false negative situ- ations whereThe novel the supervisoryprediction controlis that andthere data is acquisition no fault, (SCADA)but the fault system exists proposed in the can machine; contribute to advances relevant to the analysis of faults with undetermined origins. This and, knowledgefinally, tn helpsrepresents in foreseeing the true these negative faults and situations improving where the functionality the prediction of machinery. and the actual situationThe are maincoincident contributions and the of thisfault work does can not be summarizedexist. in the following six points: firstly, the implementation of a maintenance procedure for fault prognosis integrated in a 8. ResultsSCADA and system; Conclusions secondly, the design of a communication platform that linked the SCADA system and a Cloud server for data concentration in a secure and normalized database; The novel supervisory control and data acquisition (SCADA) system proposed can contribute to advances relevant to the analysis of faults with undetermined origins. This knowledge helps in foreseeing these faults and improving the functionality of machinery. The main contributions of this work can be summarized in the following six points: firstly, the implementation of a maintenance procedure for fault prognosis integrated in a SCADA system; secondly, the design of a communication platform that linked the SCADA system and a Cloud server for data concentration in a secure and normalized database; thirdly, the development of different data sources for fault detection that were

Sensors 2021, 21, x FOR PEER REVIEW 15 of 18

Sensors 2021, 21, 2762 15 of 18

connected to the database; fourthly, fault prognosis was improved when changing from digital to analog sensors; fifthly, the foreseeing of failures with an undetermined origin; thirdly,finally, the the development development of of different an unsupervised data sources anomaly for fault detection detection algorithm that were for connected the detec- totion the of database; malfunctioning fourthly, machinery. fault prognosis was improved when changing from digital to analogThe sensors; results fifthly,offer advantages the foreseeing in three of failuresareas: an with increase an undetermined in prognosis capacity origin; finally,for pre- theventive development and predictive of an unsupervisedmaintenance, anomalyan improvement detection in algorithmmachined forproduct the detection quality and of malfunctioningconsiderable reductions machinery. in breakdown times. TheTable results 2 and offer Figure advantages 11 show the in threeavailability areas: improvement an increase in of prognosisthree different capacity machine for preventivetools in machining and predictive processes maintenance, of chip removal an improvement over fifteen in machinedmonths in product 2019 and quality 2020, andafter considerablethe implementation reductions the inproposed breakdown system. times. Table2 and Figure 11 show the availability improvement of three different machine Table 2. Scheduledtools in machining hours and loss processes of availability of chip in removal three machines over fifteen over fifteen months months. in 2019 and 2020, after the implementation the proposed system. Mth1 Mth2 Mth3 Mth4 Mth5 Mth6 Mth7 Mth8 Mth9 Mth10 Mth11 Mth12 Mth13 Mth14 Mth15 Scheduled Table 2. Scheduled hours and loss of availability in three machines over fifteen months. 545.99 571.78 550.83 614.76 612.86 547.47 583.15 536.26 586.94 569.5 546.38 528.15 531.06 515.17 264.29 Hours Mth1 Mth2 Mth3 Mth4 Mth5 Mth6 Mth7 Mth8 Mth9 Mth10 Mth11 Mth12 Mth13 Mth14 Mth15 Loss of Scheduled 545.99 571.78 550.83 614.76 612.86 547.47 583.15 536.26 586.94 569.5 546.38 528.15 531.06 515.17 264.29 AvailabilityHours 12.2 15.17 8.08 11.62 13.09 9.8 13.04 10.05 9.66 13.03 7.79 6.19 6.88 4.12 1.03 (Hours)Loss of

MACHINE 1 MACHINE AvailabilityAvailability 12.2 15.17 8.08 11.62 13.09 9.8 13.04 10.05 9.66 13.03 7.79 6.19 6.88 4.12 1.03 97.77 97.35 98.53 98.11 97.86 98.21 97.76 98.13 98.35 97.71 98.57 98.83 98.7 99.2 99.61 (Hours)(%) MACHINE 1 Availability Scheduled 97.77 97.35 98.53 98.11 97.86 98.21 97.76 98.13 98.35 97.71 98.57 98.83 98.7 99.2 99.61 (%) 552.77 548.7 586.22 649.74 656.2 579.59 602.76 552.53 596.28 587.88 593.31 546.66 561.34 568.02 279.87 (Hours) Scheduled 552.77 548.7 586.22 649.74 656.2 579.59 602.76 552.53 596.28 587.88 593.31 546.66 561.34 568.02 279.87 Loss(Hours) of AvailabilityLoss of 9.16 8.26 9.54 11.01 9.95 8.18 9.34 8.75 9.07 10.52 9.46 5.27 6.51 5.16 1.35 (Hours)Availability 9.16 8.26 9.54 11.01 9.95 8.18 9.34 8.75 9.07 10.52 9.46 5.27 6.51 5.16 1.35 (Hours) MACHINE 2 MACHINE Availability MACHINE 2 Availability 98.34 98.59 98.37 98.31 98.48 98.59 98.45 98.42 98.48 98.21 98.41 99.04 98.84 99.09 99.52 98.34 98.59 98.37 98.31 98.48 98.59 98.45 98.42 98.48 98.21 98.41 99.04 98.84 99.09 99.52 (%)(%) ScheduledScheduled 548.73548.73 549.43 549.43 550.97 550.97 618.85 618.85 580.66 580.66 524.3 524.3 592.2 548.46 548.46 601.08 601.08 559.86 559.86 558.7 487.97 487.97 536.94 560.01 262.54 (Hours)(Hours) LossLoss of of AvailabilityAvailability 11.6411.64 9.029.02 9.08 9.08 14.7514.75 7.79 7.38 11.97 10.27 11.74 8.978.97 6.576.57 6.396.39 6.896.89 1.881.88 1.511.51 (Hours)

MACHINE 3 (Hours) Availability MACHINE 3 MACHINE Availability 97.88 98.36 98.35 97.62 98.66 98.59 97.98 98.13 98.05 98.4 98.82 98.69 98.72 99.66 99.44 (%) 97.88 98.36 98.35 97.62 98.66 98.59 97.98 98.13 98.05 98.4 98.82 98.69 98.72 99.66 99.44 (%) 33 32.45 26.7 37.38 30.83 25.36 34.35 29.07 30.47 32.52 23.82 17.85 20.28 11.16 3.89 33 32.45 26.7 37.38 30.83 25.36 34.35 29.07 30.47 32.52 23.82 17.85 20.28 11.16 3.89

FigureFigure 11. 11.Machine Machine availability availability evolution. evolution.

The three machines analyzed were in the same production line and each of them had different architectures and tasks. Table 1 represents the data used for training the anomaly

Sensors 2021, 21, 2762 16 of 18

The three machines analyzed were in the same production line and each of them had different architectures and tasks. Table1 represents the data used for training the anomaly detection algorithm for machine 1. Machines 2 and 3 (as seen in Table2 and Figure 11 together with machine 1) were twin machines that did not have a y-axis. The implementation of the proposed technical solution in these different machines shows a continuing improvement in the availability of the three machines. This demonstrates that this algorithm has potential for widespread implementation in different types of machines. The progressive improvements in the fifteen-month period can be summarized as follows: in the first five months, retrofitting, digital twin and event screens were created and tested; in the following three months, the OPC UA server and client communication was developed; and from the eighth month onward, machine learning algorithms and data management became operative. It is possible to observe how the improvement was progressive and increased notably over the last five months. The SCADA systems and the machine learning algorithms integrated in them improved their accuracy and efficiency for early fault detection due to the amount of data that they acquired. One of the most noteworthy points of the proposal presented in this paper was that, for many of the solved problems, their causes could not be analyzed before applying the proposed methodology. The failures occurred but their root causes were not known. As a result of the real examples described throughout the paper, it was possible to show that not only can the origins of problems that cause machine downtime be analyzed, but that the root causes of problems that result in the production of low-quality machined parts can be analyzed as well. In summary, this study described a SCADA system that combines complexity and agility in the relationship between operator and machine to improve fault prognosis for undetermined root causes. It is recommended that industries continue to research and innovate to obtain the best possible performance outcomes from the potential of the smart factory. The development of more sophisticated SCADA systems to optimize sensor data management and the improvement of industrial predictive maintenance with the implementation of robust diagnosis tools are means to meet this challenge. The results obtained in this industrial research project, through the investigation of a multi-featured production process affected by intermittent faults and malfunctions of undetermined origins, were applied within the context of Industry 4.0 and the Industrial Internet of Things. The progressive evolution of this work will be centered on the latest research developments concerning the recognition and prognosis of failures that do not generate events when they are occurring. Systematic data analysis of different machines with the same problem and the application of machine learning techniques will result in the development of common procedures for the prediction of these failures that are difficult to detect with standard maintenance operations.

Author Contributions: F.J.M. and I.L. developed the SCADA systems and the machine learning algorithms. I.M. contributed significant mechanical and manufacturing advice. P.A. contributed the main concepts about sensors. A.J.G. and I.G. provided important advice and guidance about control systems. All authors have read and agreed to the published version of the manuscript. Funding: This work was supported partially by the Basque Government through project IT1207-19, and by the MCIU/MINECO through RTI2018-094902-B-C21/RTI2018-094902-B-C22 (MCIU/AEI/ FEDER, UE). The authors would like to thank Intenance Company for its collaboration and help. Institutional Review Board Statement: Not applicable. Informed Consent Statement: Not applicable Data Availability Statement: The data presented in this study are available on request from the corresponding author. The data are not publicly available due to confidentiality reasons. Conflicts of Interest: The authors declare no conflict of interest. Sensors 2021, 21, 2762 17 of 18

Abbreviations The following abbreviations are used in this manuscript: SCADA Supervisory control and data acquisition IIoT Industrial Internet of Things CPPS Cyber-physical production systems HMI Human–machine interface OPC Open Platform Communications CBL Condition-based maintenance ML Machine learning

References 1. Vogel-Heuser, B.; Hess, D. Guest Editorial: Industry 4.0—Prerequisites and visions. IEEE Trans. Autom. Sci. Eng. 2016, 13, 411–413. [CrossRef] 2. Lu, Y. Industry 4.0: A survey on technologies, applications and open research issues. J. Ind. Inf. Integr. 2017, 6, 1–10. [CrossRef] 3. Zhong, R.Y.; Xu, X.; Klotz, E.; Newman, S.T. Intelligent manufacturing in the context of Industry 4.0: A review. Engineering 2017, 3, 616–630. [CrossRef] 4. Thoben, K.D.; Wiesner, S.; Wuest, T. “Industrie 4.0” and smart manufacturing—A review of research issues and application examples. Int. J. Autom. Technol. 2017, 11, 4–16. [CrossRef] 5. Oztemel, E.; Gursev, S. Literature review of Industry 4.0 and related technologies. J. Intell. Manuf. 2020, 31, 127–182. [CrossRef] 6. Vaidya, S.; Ambad, P.; Bhosle, S. Industry 4.0—A glimpse. In Proceedings of the 2nd International Conference on Materials Manufacturing and Design Engineering (iCMMD2017), MIT Aurangabad, Maharashtra, India, 11–12 December 2017; pp. 233–238. 7. Lins, T.; Rabelo-Oliveira, R.A. Cyber-physical production systems retrofitting in context of industry 4.0. Comput. Ind. Eng. 2020, 139, 11. [CrossRef] 8. Wollschlaeger, M.; Sauter, T.; Jasperneite, J. The future of industrial communication. IEEE Ind. Electron. Mag. 2017, 11, 17–27. [CrossRef] 9. Wan, J.; Tang, S.; Shu, Z.; Li, D.; Wang, S.; Inran, M.; Vasilakos, A.V. Software-defined industrial Internet of Things in the context of Industry 4.0. IEEE Sens. J. 2016, 16, 7373–7380. [CrossRef] 10. Pliatsios, D.; Sarigiannidis, P.; Lagkas, T.; Sarigiannidis, A.G. A Survey on SCADA systems: Secure protocols, incidents, threats and tactics. IEEE Commun. Surv. Tutor. 2020, 22, 1942–1976. [CrossRef] 11. Lekube, J.; Garrido, A.J.; Garrido, I.; Otaola, E.; Maseda, J. Flow control in wells turbines for harnessing maximun wave power. Sensors 2018, 18, 535. [CrossRef] 12. Schütze, A.; Helwig, N.; Schneider, T. Sensors 4.0—Smart sensors and measurement technology enable Industry 4.0. J. Sens. Sens. Syst. 2018, 7, 359–371. [CrossRef] 13. Kaya, A.; Keceli, A.S.; Catal, .; Tekinerdogan, B. Sensor failure tolerable machine learning-based food quality prediction model. Sensors 2020, 20, 3173. [CrossRef] 14. Mishra, D.; Roy, R.B.; Dutta, S.; Pal, S.K.; Chakravarty, D. A review on sensor-based monitoring and control of friction stir welding process and a roadmap to Industry 4.0. J. Manuf. Process. 2018, 36, 333–397. [CrossRef] 15. Ji, C.; Shao, Q.; Sin, J.; Liu, S.; Pan, L.; Wu, L.; Yang, C. Device data ingestion for industrial big data platforms with a case study. Sensors 2016, 279, 279. [CrossRef][PubMed] 16. Raposo, D.; Rodrigues, A.; Sinche, S.; Sá Silva, J.; Boavida, F. Industrial IoT monitoring: Technologies and architecture proposal. Sensors 2018, 18, 3568. [CrossRef] 17. Pimenov, D.Y.; Bustillo, A.; Mikolajczyk, T. Artificial intelligence for automatic prediction of required surface roughness by monitoring wear on face mill teeth. J. Intell. Manuf. 2020, 29, 1045–1061. [CrossRef] 18. Ge, Z.; Song, Z.; Ding, S.X.; Huang, B. Data mining and analytics in the process industry: The role of Machine Learning. IEEE Access 2017, 5, 20590–20616. [CrossRef] 19. Liu, R.; Yang, B.; Zio, E.; Chen, X. Artificial intelligence for fault diagnosis of rotating machinery: A review. Mech. Syst. Signal Process. 2018, 108, 33–47. [CrossRef] 20. Bezerra, A.; Silva, I.; Guedes, L.A.; Silva, D.; Leitao, G.; Saito, K. Extracting value from industrial alarms and events: A data-driven approach based on exploratory data analysis. Sensors 2019, 19, 2772. [CrossRef] 21. Lo, N.; Flaus, J.M.; Adrot, O. Review of machine learning approaches in fault diagnosis applied to IoT systems. In Proceedings of the International Conference on Control, Automation and Diagnosis (ICCAD), Grenoble, France, 2–4 July 2019. 22. Sharp, M.; Ak, R.; Hedberg, T.J. A survey of the advancing use and development of machine learning in smart manufacturing. J. Manuf. Syst. 2018, 48, 170–179. [CrossRef] 23. Najafi, M.; Auslander, D.M.; Bartlett, P.L.; Haves, P.; Sohn, M.D. Application of machine learning in the fault diagnostics of air handling units. Appl. Energy 2012, 96, 347–358. [CrossRef] 24. Hoffmann-Souza, M.L.; André-da Costa, C.; Oliveira-Ramos, G.; da Rosa-Righi, R. A survey on decision-making based on system reliability in the context of Industry 4.0. J. Manuf. Syst. 2020, 56, 133–156. [CrossRef] 25. OPC Foundation. Available online: https://opcfoundation.org/ (accessed on 5 February 2021). Sensors 2021, 21, 2762 18 of 18

26. SIMATIC WinCC in the TIA Portal. Available online: https://new.siemens.com/in/en/products/automation/industry-software/ automation-software/tia-portal/software/simatic-wincc-tia-portal.html (accessed on 10 February 2021). 27. Jardine, A.K.S.; Lin, D.; Banjevic, D. A review on machinery diagnostics and prognostics implementing condition-based maintenance. Mech. Syst. Signal Process. 2006, 20, 1483–1510. [CrossRef] 28. Baker, W.; Nixon, S.; Banks, J.; Reichard, K.; Castelle, K. Degrader analysis for diagnostic and the predictive capabilities: A demonstration of progress in DoD CBM+ initiatives. Procedia Comput. Sci. Complex Adapt. Syst. Conf. 2020, 168, 257–264. [CrossRef] 29. Romeo, L.; Loncarski, J.; Paolanti, M.; Bocchini, G.; Mancini, A.; Frontoni, E. Machine learning-based design support system for the prediction of heterogeneous machine parameters in industry 4.0. Expert Syst. Appl. 2020, 140, 1–14. [CrossRef] 30. Calvo-Bascones, P.; Sanz-Bobi, M.A.; Welte, T.M. Anomaly detection method based on the deep knowledge behavior patterns in industrial components, as applied to a hydropower plant. Comput. Ind. 2021, 125, 1–17. [CrossRef] 31. Purarjomandlangrudi, A.; Ghapanchi, A.H.; Esmalifalak, M. A data mining approach for faults diagnosis: An application of anomaly detection algorithm. Measurements 2014, 55, 343–352. [CrossRef] 32. Quatrini, E.; Constantino, F.; Di Gravio, G.; Patriarca, R. Machine learning for anomaly detection and process phase classification to improve safety and maintenance activities. J. Manuf. Syst. 2020, 56, 117–132. [CrossRef] 33. Theissler, A. Detecting known and unknown faults in automotive systems using ensemble-based anomaly detection. Knowl. Based Syst. 2017, 123, 163–173. [CrossRef]