1. Introduction
Industrial automation is currently dominated by solutions which are implemented only with distributed controllers, such as programmable logic controllers (PLCs). The programming of these devices is mainly based on the standard IEC 61131, which does not comply with the requirements of the object-oriented programming (OOP) approach of large-scale distributed systems. Since industrial control systems are not generic computing systems, OOP must comply with other requirements [
1]: the direct configuration of I/O signals, multiparadigm programming, etc. Additionally, PLCs have limited processing capabilities, which could be a barrier to scaling their applications to more complex tasks.
The majority of technical solutions deployed in the industrial market have been developed by proprietary technology manufacturers, which causes great difficulties in communication between devices. These interoperability problems have generated technology dependency in most cases. As a consequence, until there is a standardization of interfaces, protocols and applications, the interconnection required for the implementation of Industry 4.0 will be potentially expensive, inefficient and possibly an unsafe option [
2]. Therefore, continuous innovation in open hardware and software is important to boost developments in the areas of supervision, industrial control and interoperability of manufacturing plants, keeping affordable prices for small and medium-sized factories.
Several solutions have been proposed to meet the requirements of supervision, control and communications between production processes using low-cost technologies. For instance, in [
3], a liquid flow monitoring system is detailed that uses a LAN network to transmit data from a microcontroller, Arduino, which measures liquid flow and controls a solenoid valve, to a microcomputer, Raspberry Pi, which implements a web server to enable remote control and monitoring. In [
4], the design of supervisory control and data acquisition (SCADA) systems using open hardware and software is proposed. The structure consists of four elements: a master terminal unit (MTU), a communication protocol, a remote terminal unit (RTU) and field devices. The MTU consists of a computer with an HMI, while the RTU is an embedded platform based on Arduino. The communication protocol is Modbus. In [
5], a testbed consisting of six Raspberry Pis is presented to illustrate a method of troubleshooting communication protocols in intelligent industrial systems. In [
6], an architecture is proposed for a multi-agent system based on OPC-UA for the integration of systems at manufacturing sites. In [
7,
8,
9], architectures based on OPC servers with communication and data logging functionalities between multiple protocols are proposed. In [
10], the implementation of industrial communication protocols using FPGAs is presented.
The research works previously reported have a common disadvantage, which is the low level of robustness of the prototypes. The implementation results are oriented to simple systems with constant operating points and controlled operation conditions (laboratory environment). On the other hand, in [
11], the authors propose a distributed service-oriented architecture to make PLC controllers compatible with Industry 4.0. This solution implies the use of PLCs whose firmware is easily upgradable to an IEC 61131 programming environment which integrates basic web technologies, network data processing and communications. Legacy PLCs typically lack these programming features; therefore, PLCs with embedded processors such as Arduino and Raspberry Pi emerge as feasible industrial solutions.
This work presents the design, implementation and evaluation of the instrumentation, communications, control and supervision systems of a multi-tank system by using low-cost PLCs and communication interfaces compatible with the thinger.io local server IoT platform. The purpose of this research is to explore low-cost embedded platforms through PLCs based on Arduino and Raspberry Pi, enabling communication functions, variable preprocessing and advanced control schemes, in the context of the computer integrated manufacturing (CIM) scheme. Experimental results demonstrate the operational capacity of the system under various operating conditions.
This document is organized as follows:
Section 2 describes the multi-tank system.
Section 3 details the implementation of the instrumentation, communications and control systems of the multi-tank system.
Section 4 presents experimental and simulation results.
Section 5 presents the limitations of the proposed system.
Section 6 presents the conclusions.
3. System Implementation
The CIM architecture integrates the processes involved in the automation of industrial production, from the manufacturing of the product to the level of business management. The CIM model consists of five levels: (1) the field level, (2) process level, (3) level of supervision, (4) management level and (5) the company level [
12].
The architecture proposed in this work involves the first three levels of the CIM pyramid model.
Figure 2 shows the proposed automation system architecture for the multi-tank system. The field level consists of ultrasonic sensors, flow sensors, a hydraulic pump and three solenoid valves. The process level consists of two low-cost embedded PLCs: (i) PiXtend based on the Raspberry Pi platform, which implements the control and fault detection algorithms in the system, and (ii) M-Duino based on the Arduino platform, which preprocesses the signals from the sensors. This configuration allows the demonstration of the integration of different platforms (heterogeneity) within the same system. The supervisory level is made up of an Internet of Things (IoT) local server installed in a Raspberry Pi connected to the local Wi-Fi router via an Ethernet cable, such that only the devices connected to the network—either wired or wireless—can access the data hosted on the thinger.io local server. It is important to mention that both PLCs,
M-Duino and PiXtend, are CE certified and have compliance with the IEC61131 standard. These features offer robustness in industrial applications.
Details regarding the implementation of each level are given below.
3.1. Field Level
The series HC-SR04 ultrasonic sensors (LT-104 and LT-105) are used to measure tank levels. The DIGITEN FL-408 flow sensors (FT-102 and FT-107) are used to monitor the input and output flow of the process, respectively. The level of the tanks is controlled by varying the inflows and outflows of each tank. The variation of the flows is carried out through the regulation of solenoid valves. The solenoid valves used are the following models: ball type Winner WVA4-3 solenoid valve (FCV-101), BACOENG 2W-15 (FCV-103) solenoid type , and the solenoid valve US SOLID USSMSV00002 ball type (FCV-106). The entire system is powered by the Favson F3012 pump.
3.2. Process Level
This level comprises the DCs, whose operation involves the control and fault detection systems. These systems are implemented in the PiXtend PLC (FC-201). The control systems implemented are based on the PID and FGS-PID control algorithms. The fault detection system uses an EKF. The proposed control system is of the decentralized type, as shown in
Figure 3. Each tank has a reference of the desired level (
and
). The error signals are processed to obtain the control signals
,
, and
, which command the valves. Finally, the EKF receives the tank levels and the control signals as input signals to estimate the tank levels (
and
).
In this work, two control schemes are proposed and compared: classic PID and fuzzy + PID. The classic PID scheme uses three PID controllers, one for each valve of the multi-tank system. The fuzzy + PID scheme implements the fuzzy gain scheduling (FGS)-PID algorithm for valve 2, while the controllers for valves 1 and 3 correspond to classic PIDs. This configuration shows significantly better performance than other combinations of FGS-PID applied to valves 1 and 2.
Control schemes, including the fault detection and diagnosis module (FDD) system based on the EKF, are designed from the process model, determined by
where
: | Liquid level at tanks 1, 2 |
: | % of opening of valves (0 1) |
: | Cross-section area of tanks 1, 2 |
: | Cross-section area of valves 2, 3 |
: | Nominal valve flow ( = 4 lt/min) |
g: | Gravity constant (g = 9.81 m/s). |
Faults to be detected correspond to leaks in tanks 1 and 2. A leak is modeled as an outflow caused by a hole located at the bottom of the tank, as follows:
where
: | Flow due to leaks in the tanks 1, 2 |
: | Leak hole area in tanks 1, 2 |
: | Fault indicator for tank 1, 2. |
Table 1 presents the physical values considered for the calculation and deployment of the system.
3.2.1. PID Controller
Equation (
3) presents the discrete control algorithm of the PID controller. Tuning parameters
,
and
of the controllers are obtained from the Ziegler–Nichols final gain method. Additionally, through recursive MATLAB simulations, the overshoot vs. settling time ratio
was minimized.
3.2.2. FGS-PID Controller
The FGS-PID controller design uses the methodology presented in [
13]. The inputs to the control system correspond to the error variables (
) and the first derivative of the error (
), while the outputs are the variables
,
and
, which determine the parameters of the PID controller by
For the linguistic variables (
) and (
), the following membership functions are implemented: big negative values (NB), medium negative (NM), negative small (NS), zero (ZO), small positive (PS), medium positive (PM) and big positive (PB) values.
Figure 4 shows the error membership functions.
Figure 5 shows the membership functions of the error derivative.
The output variables
and
have two membership functions, small (S) and big (B), which are of the Gaussian type with standard deviation
and center at 0 and 1, respectively. These membership functions are shown in
Figure 6. The output variable
has four membership functions, described as 2, 3, 4 and 5, which are implemented as triangular functions. These membership functions are shown in
Figure 7.
The calculation rules of
,
and
are synthesized in
Table 2,
Table 3 and
Table 4, respectively.
3.2.3. Extended Kalman Filter
The EKF is a variation of the Kalman filter, applied to nonlinear systems. The EKF linearizes the system over an average value, applying the Jacobian to obtain the state matrices
,
,
and
, where
and
are the Jacobians calculated with respect to the random variables
and
, respectively [
14]. With these considerations, the equations that define the EKF are
To design the EKF, it is necessary to describe the process as a linear system, as follows:
where
represents the derivative of
,
represents the control vector
,
and
.
For the Jacobian linearization of the model, the equilibrium point of the system is established at an operating point. The balance points
are obtained considering the control signals
. The relationships to obtain the equilibrium points are
The result of the linearization is presented below:
The parameters
,
and
of the EKF are adjusted through recursive simulations in MATLAB, where
and
. The
matrix setting considers two scenarios. The first scenario considers the transition during step-type reference changes, in which the correction component of the EKF is prioritized to track the measured signal. The value selected for this case is
. The second scenario is presented when the tank levels enter a range of
error with respect to their references (steady state); in this case, the EKF estimation component is prioritized, selecting
. The EKF delivers the
and
estimations of tank levels as outputs. Equations (
9) and (
10) present the residues obtained from the comparison of the estimated and measured values.
Leak detection is performed by using thresholds. Experimentally, a threshold is determined as
. When the residue is smaller than this limit, the existence of a leakage is concluded. The data set that pertains to a leakage is
3.3. Supervision Level
The automation architecture proposed in this work involves the first three levels of the CIM model (see
Figure 2). The PiXTend PLC works as a Modbus slave node and receives the information from every device in the network in order to upload selected data to an IoT platform (thinger.io) by using the open source Linux client library provided in [
15]. As seen in
Figure 2, the supervision level uses an IoT local server installed in a Raspberry Pi 3, which is connected to a local Wi-Fi router through an ethernet cable, meaning that only the devices connected to the network can access the data on the thinger.io local server by using the fixed IP address of the Raspberry Pi. This configuration warranties security by creating a virtual industrial network, where PLCs are connected in a different subnet from the SCADA platform, performing communication tasks among them via Modbus TCP, while the SCADA platform, running in a separate subnet, isolates the process controllers from external access to the network.
5. System Limitations
Table 8 presents a comparison of the characteristics of the solution proposed in this work with a generic commercial solution. In this case, enhanced flexibility of the proposed system is highlighted in terms of the use of programming languages and the control algorithms implemented. Additionally, it should be noted that the commercial solution typically uses controllers from a single manufacturer, and the inclusion of equipment from other manufacturers increases the cost of the system due to the acquisition of programming licenses and communication drivers, meaning that the heterogeneity in this system is not guaranteed. On the other hand, the robustness of the system proposed in this work should still be studied in long-term operations and in more aggressive industrial conditions (dust, noise, etc.).
In addition to the advantages/disadvantages analyzed in
Table 8, it is important to remark that the current development of this project still has a low technology readiness level (TRL). Current evaluation of the technology proposed throughout this paper corresponds to a TRL 4, which means the stage of verification in a representative laboratory [
18]. Reaching a higher TRL implies further research and development (R&D) in order to achieve technological transfer in an effective way to industries with requirements to be fulfilled by the solutions proposed in this paper. In [
18], a thorough methodology is offered for achieving technological transfer through a process which implies a technological maturity level (TRL 7).