Development of a data collection system for a CNC system using cloud FRED technology and OPC UA specification

. Collecting data from process equipment is currently an interesting task. The use of complex SCADA systems is not always possible and is usually an expensive solution. For some tasks, in-depth analysis of the received technological information is not needed, but visualization of the necessary data is sufficient. In control systems, it is usually not possible to create custom HMI screens. The use of new approaches based on web technologies and cloud solutions allows collecting and visualizing data on web pages and screens of mobile devices. The article shows a solution for collecting data from a CNC system using the OPC UA protocol and subsequent data visualization based on the FRED cloud platform in the required format with the ability to configure HMI screens.


Introduction
Backup data is of paramount importance nowadays. The CNC and PLC systems are stored very dissimilar. At the moment, any event of the CNC system is written to the log file. The loss of any piece of data can damage production. It is often too late for many manufacturers to discover that no system backups are available [1,2].
One approach to solve this problem could be digital shadow of production or digital shadow of a separate CNC machine. The CNC digital shadow helps solve this problem for CNC machines by offering remote access to the backed up information of these machines. This shadow includes creating and maintaining a complete set of backups of CNC machine data stored in a secure, remote location that can be accessed 24/7.
If, for example, backup data has disappeared or is not available, it is very difficult to understand why the machine is currently not working -is it planned or unplanned downtime [3]. Without backing up the data, the service engineer has to be near the machine and figure out what data should have been on the CNC machine, what happened, why the machine is not working [4].
Backing up CNC data remotely using a digital shadow approach can eliminate this time-consuming process. Using the digital shadow of the CNC system, the remote monitoring system connects CNC machines distributed in various industrial sites (or workshops) with a cloud platform for collecting and analyzing the working state of the machines, as well as for storing, monitoring, filtering and protecting data [5,6]. Fig. 1 an example of workshop monitoring using a digital shadow of the CNC system is given. In this example, CNC machines are connected to a local network using some kind of communication protocol (OPC UA, MT Connect, Modbus, etc.). Wireless and wired device servers, used to connect a local network to an office router, allow data from CNC machines to be transferred directly to the office network, and then using the Internet in the digital shadow of the CNC system [7].  An important big advantage of digital shadow is that it provides mobility as it is device and location independent. Users can access data remotely through any web browser, regardless of their location or the device used (e.g. PC, tablet, smartphone, etc.).

Development of CNC digital cloud shadow using FRED cloud tool and OPC UA protocol
A test version of the digital shadow of the "AxiOMA Control" CNC system operates in the cloud (FRED), it is used to collect and store production data of the technological process in the cloud [8].
FRED (Front End for Node-RED) is an open cloud Node-RED platform that is used to provide a solution for monitoring and processing data monitoring from any OPC UA server or other communication protocols [9,10].
The digital cloud shadow is used to send data from the OPC UA server of the CNC system to the FRED cloud using a remote Node-RED user terminal based on the OPC UA web client and using the STS-MQTT (Message Queuing Telemetry Transport) platform. STS-MQTT (Sense Tecnic MQTT) is a cloud-hosted MQTT (popular protocol for IoT communication) brokerage service that provides reliable MQTT connectivity and empowers the user with a realistic and efficient user interface to manage themes and connections between process equipment and Node-RED on the FRED cloud. The general scheme for the development of a digital cloud shadow of a CNC system using a cloud FRED tool and OPC UA protocol is shown in the Fig.2. To configure Node-RED to send data to the FRED cloud via the STS-MQTT platform, two STS-MQTT clients were developed, one for the OPC UA CNC server, and one for the FRED cloud [11].
Also STS-MQTT topics were developed (Fig.3), each of which corresponds to one data source from the OPC UA server of the CNC system. STS-MQTT subscription is a string that is used to filter messages from each connected STS-MQTT client [12].

Fig. 3. Topics developed by STS-MQTT.
To ensure the exchange of messages between the OPC UA server of the CNC system and the FRED cloud, the data topic from each node (msg.topic) in the remote Node-RED terminal of the user must be installed in the corresponding STS-MQTT topic, as in the FRED cloud [13]. For example, for the Program "Percentage programm" node, its topic was set to accounts / ahed144 / Program percent, just like in the FRED cloud (Fig.4). In the FRED cloud, you need to configure the "MQTT in" node, which is used to receive data in the FRED cloud from the STS-MQTT platform. To configure this node, it is necessary to connect its broker to the corresponding STS-MQTT client "Client FRED Cloud" using its client ID. After configuring the "MQTT in" node and the switching node, all received data from the STS-MQTT platform can be used separately in the FRED cloud.

Testing the developed system
Several tests have been carried out to demonstrate the performance of the system. The Fig.5 shows two diagrams that are used to illustrate real-time data received from the STS-MQTT platform in the FRED cloud [14,15]. On the left is the oscillogram for the current values of positions along the X, Y, Z, C and S axes, and on the second for the current values of speed [16,17]. Also in the figure, you can see various text nodes to illustrate other received data from the CNC system in real time (File name, Feed, Program work time, etc.). The OPC UA server saves the historical data of the "AxiOMA Control" CNC system until it is turned off, and the next time it is turned on, new historical data will be saved [18]. In some cases, all old and new historical data must be retained for a long time so that it can be used for remote access and analysis. CNC digital cloud shadow can save CNC data for a long time (SQL DB) and can work with any web browser running on any device (computer, mobile phone, Raspberry, etc.).
To store the data of the CNC system in the cloud, the main Node-RED server must be running on a CNC machine or on any computer that is connected to the OPC UA server of the CNC system [19].
The Node-RED server uses an MQTT broker to collect data from the connected OPC UA server of the CNC system and send it to the cloud (STS-MQTT platform).
After receiving the data from the STS-MQTT CNC system, the platform saves them in its database [20]. The developed cloud FRED client has access to the stored data of the STS-MQTT platform.
The fig.6 shows the remote monitoring and digital cloud shadow access of the CNC system in different states of the OPC UA server and CNC system (off or on) and for different control programs [21].

Conclusion
A feature of the proposed approach for creating a digital shadow of the CNC system is that it can be used in any operating system without the need to install any additional application for remote monitoring of the parameters of the CNC system kernel, and that it can be used at any time without taking into account the operating state of OPC UA server or CNC system (off or on). At the moment, we are analyzing the use of this approach for application at the workshop level, when there may be more machines with CNC systems.