Monitoring and Control Interface Based on Virtual Sensors

In this article, a toolbox based on a monitoring and control interface (MCI) is presented and applied in a heat exchanger. The MCI was programed in order to realize sensor fault detection and isolation and fault tolerance using virtual sensors. The virtual sensors were designed from model-based high-gain observers. To develop the control task, different kinds of control laws were included in the monitoring and control interface. These control laws are PID, MPC and a non-linear model-based control law. The MCI helps to maintain the heat exchanger under operation, even if a temperature outlet sensor fault occurs; in the case of outlet temperature sensor failure, the MCI will display an alarm. The monitoring and control interface is used as a practical tool to support electronic engineering students with heat transfer and control concepts to be applied in a double-pipe heat exchanger pilot plant. The method aims to teach the students through the observation and manipulation of the main variables of the process and by the interaction with the monitoring and control interface (MCI) developed in LabVIEW©. The MCI provides the electronic engineering students with the knowledge of heat exchanger behavior, since the interface is provided with a thermodynamic model that approximates the temperatures and the physical properties of the fluid (density and heat capacity). An advantage of the interface is the easy manipulation of the actuator for an automatic or manual operation. Another advantage of the monitoring and control interface is that all algorithms can be manipulated and modified by the users.


Introduction
It has been observed that due to the academic training received by electronic engineering students, it is difficult for them to understand heat transfer concepts and how to deal with cases in which a failure occurs. Therefore, at the National Center for Research and Technological Development (CENIDET (Centro Nacional de Investigación y Desarrollo Tecnológico)), a monitoring and control interface (MCI) for a double-pipe heat exchanger was developed. The MCI is orientated to provide support for the electronic engineering students, and so, the MCI has two main purposes. On the one hand, this system provides the students with the knowledge of heat exchanger behavior. The MCI shows on-line the physical property behavior of the fluid in the double pipe heat exchanger ρ (density) and C p (heat capacity). Additionally, the MCI shows on-line the value of the convective heat transfer coefficients (h o , h i ) and the global heat transfer coefficient (U ), which are calculated by a thermodynamic model. On the other hand, the information obtained through the thermodynamic model is used by a nonlinear model that describes the temperature dynamics in the double pipe heat exchanger. A fault-tolerant system-based model was implemented as a practical example. The MCI allows manipulating the system actuators in order to perform control tasks. The interface can be operated in open loop or in closed loop. The main objective of the monitoring and control interface is to provide the students with educational workstation with practice in the control area. This work represents the effort of the lecturers who developed the educational workstation based on their own research, which is implemented in the heat exchanger pilot plant.
The main objective of the industry is to keep processes operating adequately; nevertheless, nowadays, the industry demands constant monitoring of the systems in order to improve the reliability and safety of the involved processes. Thus, monitoring systems must be efficient and capable of supervising the main variables of the process and to implement control tasks in order to enhance user capabilities. Industrial processes, such as mining, chemical, water treatment, among others, use complex systems that operate in different regimes, which make them difficult to control. Therefore, this work was developed in order to prepare electronic engineering students (EES) for these challenges and to give them multidisciplinary training.
Heat exchangers are widely used in power production, process, chemical and food industries, electronic, environmental engineering, waste heat recovery, manufacturing industries, space heating, refrigeration, air conditioning, chemical plants, petrochemical plants, petroleum refineries and natural gas processing. Therefore, it is extremely important for EES to learn the techniques of process control focused on heat exchangers.
Mathematical algorithms are becoming widely used to estimate unmeasurable variables. The available mathematical algorithms measure data to reconstruct unmeasurable variables or parameters of a system or a process. These kinds of systems are usually known as virtual sensors or soft sensors. Some applications of virtual sensors are: the monitoring of unknown variables or parameters of a mechanical system or a process [1][2][3][4]; the design of fault detection systems [5,6]; for fault detection isolation systems [7,8]; or for fault-tolerant control systems based on analytical redundancy [9]. In [10], a soft sensor is proposed using neural models in order to improve the product quality monitoring and control in a refinery. The advantages of the virtual sensors lie in that their implementation is easy, and in comparison with a hardware sensor, the cost is lower. In [11], the design and implementation of an observer-based soft sensor (virtual sensor) for a heat exchanger is presented.
The authors in [12] consider that the user interface is particularly important for educational software. There are some educational works concerning the heat exchanger [13,14] and thermodynamic systems [15,16], where the software is a teaching tool. The authors in [17] believe that learning can be enhanced by integrating the theoretical abstraction of textbooks with the tactile nature of the lab and plant.
Nowadays, the technological resources at universities and research departments allow one to develop sophisticated software with the aim of simulating the real conditions of the process. Most of the works in educational process are geared towards simulation [17][18][19]. However, developing practice or research in a pilot plant is more significant for the students, since they have the responsibility for the equipment and the process. Therefore, in this work, a monitoring and control interface for a heat exchanger pilot plant is presented.

The Heat Exchanger and Its Instrumentation
A double pipe heat exchanger is a device where two fluids exchange heat. The double pipe heat exchanger is formed by two circular concentric pipes. The heat exchanger can be operated in parallel (the fluids flow in the same direction through the tube side and the shell side) or in counter-current flow (the fluids flow in opposite directions). In this work, the counter-current flow was used, as is shown in Figure 1.
The main variables involved in this process are: • The inlet temperature of the fluid in the hot stream, T hi .
• The inlet temperature of the fluid in the cold stream, T ci .
• The outlet temperature of the fluid in the hot stream, T ho .
• The outlet temperature of the fluid in the cold stream, T co .
• The hot water flow, W vh .
• The cold water flow, W vc .
The double-pipe heat exchanger pilot plant produced by Didatec Technologies is located at the Process Control Laboratory of CENIDET (see Figure 2). The plant operates as a water-cooling process. In this heat exchanger, there is no change in the phase of any interacting fluid.
The pilot plant is provided with the following instrumentation: • T ci and T ho are measured by two RTDPt-100 with four wires.
• T co and T hi are measured by two RTD Pt-100 with three wires.
• W vc and W vh are measured in two Platon variable section flow meters, and there is no digital signal from the flow meters.    The basic values of the Engelhard Pyro-Control Pt-100 temperature transmitter are given in Table 1. The instrumentation of the plant is sufficient to perform full variable monitoring, but not enough for automatic control tasks, since the flow rate cannot be recorded by the acquisition system. In the Didatec Technologies pilot-plant, the cold and hot water streams W vc , W vh are not measured by a digital transmitter (W vc is the manipulated variable, and W vh is taken as a constant). Furthermore, the system is not equipped with a human interface to allow the students to visualize, adequately, the data provided by the mentioned instruments and/or to control the plant actuators. Therefore, the students must be near the plant to visualize the measurements of the desired variables, which limits the user functions.
The goal of this work is to design a monitoring and control interface for the pilot plant in order to teach automatic control and heat transfer concepts. To develop the monitoring and control interface, an adequate acquisition system is required to transfer the plant's data to a computer, so it is necessary to integrate mathematic algorithms to estimate variables, such as temperature and flow rate.

Heat Exchanger Modeling
In order to show the behavior of the main process variables in the heat transfer process and to develop a control system, a dynamic model was implemented. Furthermore, the algorithm model has implemented a thermodynamic model, which evaluates the density, heat capacity, convective heat transfer coefficients (h i , h o ) and the global heat transfer coefficient; these values are displayed in a separate graphic.
The model was developed considering the follows conditions: • A1. The flow is constant in the shell side.
• A2. The water physical properties are evaluated as functions of the temperature by empiric correlations. • A3. The convective coefficient is dependent on the flow and temperature, and it varies with it.
• A4. There is no heat transfer between the outer pipe and the environment. • A5. There is no energy accumulation in the pipe walls. • A6. The system inputs are measurable.
The heat exchanger model is presented in Equation (1).
where A o and A i are the shell area and the tube side area, respectively. The thermodynamic model of the double-pipe heat exchanger was presented in [20].

The Data Acquisition System
The programming software selected to develop the monitoring interface is LabVIEW © , due to it being provided with algorithms to perform easily the remote monitoring tasks and to monitor the control systems, as well as having a user-friendly graphical interface, which is why a National Instruments (NI © ) acquisition card was selected to communicate the heat-exchanger pilot plant information to the computer.
The acquisition card used in this work is the NI USB-6008. It was selected because it is USB-compatible and has eight (12 bits) analog inputs, sufficient for acquiring all of the variables involved in the heat exchanger process; and it has two (12 bits) analog outputs used to send the data required to control the system actuators, as well as 12 digital I/O lines and a counter. The acquisition card is shown in Figure 3.
An advantages of this card is that it can be easily connected to the pilot plant, using a simple signal converter made by the students. The signal converter is used to convert the current signal (sensors signal) to the voltage signal (received by the DAQand then sending it to the computer), which is the input signal of the data acquisition. The connections of the signal converter are shown in Figure 4.

Design of the Monitoring and Interface
The designed interface is capable of performing three different tasks: • Monitoring the inlet and outlet temperatures.
• Estimating the outlet temperatures, by using a heat exchanger model or by state observers to reconstruct a state variable from only one measure (T co or T ho ) in order to implement a fault diagnosis scheme. • Detecting and isolating sensor failures in the process with the aim of controlling the temperature, even if a failure occurs.
These tasks are executed simultaneously, as can be seen in Figure 5.
The main program of the MCI system has a hierarchic design, which is shown in Figure 5. It provides features to select the subprogram to perform. Figure 5 shows the hierarchic design of the MCI. Level 1: Initialization of the main program. LabVIEW © has a running button to start the main program. Level 2: Initialization of the data acquisition. In the MCI, there is an acquisition button. Level 3: Signal reading and temperature estimation. The four temperature signals are read by the program, and these temperatures can be stored by a data store button, which is in the MCI. At the same level, there is the estimation of the temperatures, and at this level, a model and a bank of observers (virtual sensors) are programmed. The MCI has two buttons to request the model estimation and the virtual sensors estimation. Level 4: The fault detection system, where the failure sensor could be replaced in case of failures. Level 5: A quit button, which can be pushed to end the MCI.
An intuitive interface is required in order to perform the monitoring and control tasks in the heat exchanger pilot plant. Due this, the interface requires an adequate communication with the pilot plant. An acquisition card developed by NI © is used to communicate data from/to the personal computer, which is why the LabVIEW © software was selected.
As can be seen in Figure 5, a routine is necessary in order to initialize the settings required to acquire and send data to/from the pilot plant and from/to the personal computer. This routine is configured by the NI © acquisition card, so it can be accessed by the computer using the indicated LabVIEW © program. The main flow diagrams for the listed tasks are explained below.
• Monitoring the temperatures plant: This algorithm reads a four-dimension data array, where the temperatures data are measured T ci , T hi , T co , T ho from the related sensors.
The monitoring program (represented by the flow diagram; Figure 6) developed in LabVIEW © allows the user to visualize the acquired data, through an on-line graphical interface. Different graphics are displayed for each temperature. The monitoring tasks are executed after the initializing routine automatically. Figure 6. Variable monitoring.
• Estimating the outlet temperatures (T co andT ho ): This task executes an observer algorithm used to estimate both variables (T co andT ho ) by using state observers to reconstruct a state variable from only one measure (T co or T ho ) in order to implement a fault diagnosis scheme. The observer algorithm uses the input variables and the available output measure. It performs the required control algorithm, which, based on a model of the pilot plant, estimates the value of the two output variables (T co andT ho ). The error is obtained by the comparison between the measured temperatures T co and T ho and the estimated temperaturesT co andT ho . The flow diagram is shown in Figure 7.
In the MCI, the temperature estimation (represented by the flow diagram shown in Figure 7) is executed by a button, which starts the estimation algorithms. The observer gain Equation (5) can be indicated in the interface or can be selected as a constant inside the program. Figure 7. Estimating task.
• Detecting sensor failures: An observer-based algorithm is used to detect and isolate failures in the sensors. Two observers are required, one for each physical sensor. Observer 1 uses T ci , T hi , T co as inputs, and Observer 2 uses T ci , T hi , T ho as inputs. The observers estimate the temperatures in the cold and hot stream (T co ,T ho ). A comparison is done between each temperature estimation and its corresponding physical sensor measure in order to evaluate the error (so, there are four error evaluations Equations (6)- (9)). The error is compared with an error tolerance, which is set by the user. If the error is bigger than the error tolerance, then an alarm is displayed in the MCI, indicating that a failure exists. Figure 8 shows the flow diagram that represents the fault detection realized by the virtual sensor or observer, and there is no interaction between the user and the interface when this task is running.
In the case of a sensor failure, the MCI will display a green indicator. Figure 8. Failure detection function.

Cold Water Flow Rate Solution
To monitor the heat exchanger control temperature using the cold water flow as the control input, it was necessary to characterize the control valve. In Figure 9, the valve characterization is shown, which presents hysteresis. Therefore, to send the control signal to the valve, it was convenient to use a Lagrange approximation (Equation (2)). The algorithm calculated the voltage necessary to control the valve according to the requested cold water flow (control input signal). It can be in open loop or in closed loop.
f (x k ) = P n (x k ) k = 0, 1, 2, . . . , n P n (x) = f (x 0 )L n,0 (x) + f (x 1 )L n,1 (x) + · · · + f (x n )L n,n (x) where x k is the independent variable, f (x k ) is the approximation of the independent variable, L n,k (x) is a polynomial base and P n (x) is the polynomial Lagrange interpolation.

Fault Detection and Isolation-Based Model
To accomplish the sensor fault detection and isolation (FDI), analytical redundancy was employed. To develop this system, a bank of nonlinear high gain observers was implemented. The bank implementation was done, because the fault detection system was designed to detect two possible failures, in the cold temperature sensor (T co ) and in the hot temperature sensor (T ho ), so it is necessary to have two virtual sensors (or a bank of virtual sensors) in order to replace any of the two physical sensors. In the next section, a general explanation of the FDI system is given.

Fault Detection and Isolation Nonlinear Approach
To implement the FDI system, a bank of observers was implemented. The design of the FDI based on a bank of nonlinear observers was studied in [20]. Therefore, in the present work, the equations are presented in a general form.

Control-Affine Nonlinear System
A control-affine nonlinear system can be formulated as Equation (3).
where x(t) ∈ R n , u i (t) ∈ R, i = 1, ..., m, where m is the number of inputs, y(t) ∈ R, f (x(t)) ∈ R n and g i (x(t)) ∈ R n , the last two are smooth vectors fields [20]. In these terms, if the model given in Equation (1) can be formulated as Equation (3), then it could be possible to design a nonlinear observer Equation (4).

Nonlinear Observer
The high gain nonlinear observer is defined by Equation (4).
Considering a second order system, the matrix S θ is: For the design of the FDI system, a bank of two observers is required.

Error Generation
The error evaluation between the physical sensors and the virtual sensors is obtained by Equations (6)- (9). An error evaluation is the difference between the measured temperature and the estimated temperature. Error evaluation from Observer 1: Error evaluation from Observer 2: where T ho is the hot water outlet temperature in the pipe and T co is the cooling water outlet temperature in the shell side. Therefore, theT co andT ho are estimated values, and the subscript number (1 or 2) refers to the observer number.
According to the authors in [20], the switching between the measure and by Observer 1 or 2 depends on the failure (output sensor of the hot water or output sensor of the cooling water, respectively). Thus, the following conditions are given in order to perform the switching. (11) ζ is error tolerance, which is a constant value and represents the maximum value of the error between the estimated variable by the virtual sensor and the real sensor signal value. Once this value is reached by any residual (r 12 , r 21 ), the real sensor signal is switched, and it is replaced by the virtual sensor. This error tolerance value is set by the user.

Selection of a Control Law
For academic purposes, the MCI has implemented different control laws, which are Proportional (P) (Equation (12)), Proportional-Integral (PI) (Equation (13)), Proportional-Integral-Derivative (PID) (Equation (14)), MPC (Equation (18)) and a nonlinear control law-based model (Equation (23)). With the implementation of these control laws, the students can practice different tuning methods. Furthermore, the MCI allows the interaction between the FDI system and the control law to ensure a fault-tolerant system.
To develop the prediction algorithm for the MPC, the state-space model given in Equation (15) was considered. The development of MPC is presented in detail in [21].
where x is the state vector, y is the output vector and u is the input vector.
In Equation (16), x denotes that the systems is linearized at one point. For linear systems of the form given in Equation (16), the development of the prediction model is simple: To develop the control algorithm in the absence of input or output constraints, a generalized predictive control law is reduced to a linear feedback control strategy. State-space systems based on the predictive control law take the form: A model-based nonlinear control law proposed in [22] was also implemented. The nonlinear control law Equation (23) is based on the nonlinear model of the heat exchanger Equation (1).
The graphical user interface displays the parameters of the selected control law.

The Monitoring and Control Interface Implementation
The MCI was programed in order to realize sensors fault detection and isolation and fault tolerance using virtual sensors. The virtual sensors were designed from model-based high-gain observers. To develop the control task, different kinds of control laws were included in the monitoring and control interface. These control laws are PID, MPC and a nonlinear model-based control law. The MCI helps to maintain the heat exchanger under operation, even if a temperature outlet sensor fault occurs; in the case of outlet temperature sensor failure, the MCI displays an alarm. The monitoring and control interface is used as a practical tool to support electronic engineering students with heat transfer and control concepts to be applied in a double-pipe heat exchanger pilot plant. The method aims to teach the students through the observation and manipulation of the main variables of the process and by the interaction with the monitoring and control interface (MCI) developed in LabVIEW © . In this section, the monitoring and control interface is presented (Figure 10), which was developed in LabVIEW © , and some control algorithms of the MCI are shown.
The MCI allows the students to develop and implement approximation algorithms. The MCI is a tool that facilitates the interaction between the students and the process (heat exchanger). This tool allows students to understand the control algorithms that were programmed in the MCI. Furthermore, students can interact with the MCI in different ways, such as monitoring the states of the process, tuning the PID control law and developing control algorithms using the MATLAB programming language. At CENIDET, there are courses on MATLAB to train the students in programming skills. A common practice is to ask the students to develop a program for the heat exchanger's model using the MATLAB programming language, in order to realize a comparison with the real temperature signals acquired. In Figure 10, the density and heat capacity of the fluid in both streams of the heat exchanger are shown (left-most section; tube side and shell side). In the upper center section of Figure 10, the cooling water temperature is shown (the red line shows the measured temperatures, and the blue line shows the estimated temperatures). In the right side of Figure 10, the hot water temperature is shown (the green line shows the measured temperatures, and the red line shows the estimated temperatures). The interface is intuitive for the users. Each section is adequately signposted, and it is continuously enhanced by the students according to their needs.
In Figure 11 (left side), the hot water temperature is shown (the green line shows measured temperature, and the red line shows the estimated temperatures). In the middle of the figure, the fault detection and control section are shown. As can be seen, the green light is lit, because of a fault in a hot water temperature sensor (total failure in the sensor). However, the system continues its operation, because the measured temperature is replaced by the estimated temperature (by observer 1 ), which does not depends on the T ho measure for temperature. Other graphics are shown in this figure, such as the observer estimation (on the top), the control variable (cooling water flow) and the global heat transfer coefficient. Figure 12 shows the program of the monitoring and control interface. In Figure 12, the data acquisition algorithm using LabVIEW © is presented. For this work, three temperatures were measured and acquired for the instrument T hi , T co and T ho .
At the top of the Figure 13, the error evaluation and the alarms section are shown. In the bottom of the figure (Figure 13), the nonlinear control law is shown, which was implemented for the closed loop; also, it has the Lagrange approximation to perform the closed loop control.
In Figure 14, the open loop control algorithm is shown for manual operation. The user can change the cold water flow manually through a slide manipulation, which is on the front panel of the MCI.    The figure shows the Lagrange approximation, which is used to calculate the required voltage for the control flow. Figure 15 shows the PID controller; also, it has the Lagrange approximation to perform the closed loop control.

Results
With the monitoring control interface (MCI), the instructors for the control process, nonlinear control and classic control subjects have the support to develop their laboratory practices. Furthermore, most of the students can easily interact with the heat exchanger, even if they have little experience in heat exchange devices. The results obtained with the design of the MCI are: 100% of the EES that belong to the automatic control area have had the opportunity to practice at least once with the heat exchange devices during their stay at CENIDET. One student is developing his research on fault-tolerant control with an application in a heat exchanger. Another student is developing his research project on the design of state observers applied in a heat exchange process. Figure 16 shows the opinion of the students about the MCI. In Figure 16, Sections A and B are the contents for the students that have made use of the MCI. In Figure 16, Sections C and D are the contents for students which have no made use of the MCI. We formulate two questions for the students that have made use of the MCI. These questions have four different concepts included. Question 1: How much has the use of the monitoring and control interface allowed you to assimilate clearly the following criteria? Question 2: How much has the use of the monitoring and control interface awakened your interest with respect to the following criteria? The criteria for both cases were: Process, control design, control law application and graphical interface interaction. In Sections C and D of Figure 16, the questions applied were as follows. Question 1: How much has the use of the interface enabled you to assimilate the following criteria? Question 2: How much has the use of monitoring and control interface sparked your interest in the following criteria? Figure 16. Statistics on the use of the monitoring and control interface (MCI).
Since the MCI has been in use, the interest of the students in heat exchanger control has increased, because, during the course period, the EES have acquired experience and practice in the operation of these devices. Furthermore, they have acquired knowledge in the control area and for how they can develop their control algorithms to design soft sensors or other control techniques.
CENIDET is the National Center for Research and Technological Development, which provides educational training support to technological universities. Students from 15 or 20 (approximately) technological universities of Mexico carry out professional practice in CENIDET, and in most of the cases, these students select CENIDET to develop their master studies. Some of the students that have had professional practice using the MCI and who are now working on their Master's thesis project are: Diego Alessis Carbot Rojas, "Actuator fault-tolerant control: Application in a heat transfer process"; Juan Pablo Castillo González, "Control design for a biodiesel reactor"; and Moisés Bulmaro Ramos Martínez, "Control design for an azeotropic process". Other success cases in the implementation of the MCI are students that decide to continue their Doctoral studies, students such as: Betty Yolanda López Zapa "Fault diagnosis applied in a biodiesel reactor"; Jarniel García Morales "Multiple-fuel control design for an internal combustion engine"; and Omar Hernández González "Observation and control of nonlinear process systems for energy recovery from waste heat". In addition, students have published articles in the control area using the heat exchanger device and the knowledge that the MCI provides: the most recent work done by a student is under review, however, in the Revista Mexicana de Ingeniería Química, this work is entitled Multiple Sensor Fault Diagnosis in a Heat Exchanger Using Sliding-Mode Observers Based on Super-Twisting Algorithm. Another example of the contribution made by the students is given in the work presented in [23], where the student, Betty Yolanda López-Zapata, was a collaborator. Furthermore, the MCI has provided support to develop some published works regarding heat exchanger devices and their control [24,25].

Conclusions
The monitoring control interface (MCI) is an excellent alternative to implement in a real heat exchange process in order to make the system fault tolerant. The MCI is capable of detecting and isolating failures using virtual sensors. These virtual sensors are accurate in outlet temperatures estimation. Furthermore, the MCI is an excellent option to strengthen the knowledge taught in the classroom. Subjects, such as classic control, nonlinear control and fault detection and isolation (via two different approaches, linear and nonlinear observers), are supported by this interactive educational workstation. The participation and the interest of the students in laboratory practices employing the heat exchanger pilot plant increased by more than 20% since the MCI was implemented, according to a survey. In a similar way, the lecturers were very interested in developing other algorithms to enrich the control area. For future work, subjects, such as fuzzy control, neural networks and system identification, could be added to the interactive educational workstation.