key: cord-0058809-dn7w3tw5 authors: Buele, Jorge; Ríos-Cando, Paulina; Brito, Geovanni; Moreno-P., Rodrigo; Salazar, Franklin W. title: Temperature Controller Using the Takagi-Sugeno-Kang Fuzzy Inference System for an Industrial Heat Treatment Furnace date: 2020-08-24 journal: Computational Science and Its Applications - ICCSA 2020 DOI: 10.1007/978-3-030-58817-5_27 sha: ff646c38c08f3228581e0b8524aabf54621314d1 doc_id: 58809 cord_uid: dn7w3tw5 The industrial welding industry has a high energy consumption due to the heating processes carried out. The heat treatment furnaces used for reheating equipment made of steel require a good regulator to control the temperature at each stage of the process, thereby optimizing resources. Considering dynamic and variable temperature behavior inside the oven, this paper proposes the design of a temperature controller based on a Takagi-Sugeno-Kang (TSK) fuzzy inference system of zero order. Considering the reaction curve of the temperature process, the plant model has been identified with the Miller method and a subsequent optimization based on the descending gradient algorithm. Using the conventional plant model, a TSK fuzzy model optimized by the recursive least square’s algorithm is obtained. The TSK fuzzy controller is initialized from the conventional controller and is optimized by descending gradient and a cost function. Applying this controller to a real heat treatment system achieves an approximate minimization of 15 min with respect to the time spent with a conventional controller. Improving the process and integrated systems of quality management of the service provided. The metalworking industry has considerable participation and growth in the world economy [1] . The most important sectors are oil, energy, industrial, mining, infrastructure, among others, being a strategic axis for its contribution in local and regional production chains [2, 3] . In traditional industries it can still be found that processes are controlled manually by an operator, which depending on their experience and competence may not show optimal results. Within the quality policies, the improvement of the production processes is proposed and thus reach higher levels of competitiveness and productivity required by nowadays market [4, 5] . That is why the need arises to implement technological solutions that minimize operation times in each process. Among the most popular automatic controllers in the industrial sector, the proportional, integral and derivative (PID) and their respective modifications stand out, which have taken a dominant position due to the simplicity of their structure and design [6] . However, this type of conventional control has deficiencies when used in processes that exhibit strongly non-linear and unexpected behaviors [7] . As a case study, there is a post-welding heat treatment furnace for stress relief in steel. Although it is a first-order system, when tuning the current controller, actuators fail to perform the necessary control actions to increase the response speed of the system and therefore it is necessary to look for more advanced control proposals, such as the fuzzy controller. This is based on the decision of a set of rules that determine the desired behavior of the system, through its three stages fuzzification, inference and defuzzification [8, 9] . Fuzzy set operations called membership functions are values assigned to system inputs and outputs and the controller design considers the error and the error change (derived value) [10] . The setup of the rules and gains in this controller is usually based on the experience of the designer, so determining the values of the mathematical model of the system allows predicting its behavior in a more exact way [11] . That is why intelligent evolutionary algorithms have now been developed, which establish these values by considering the system's behavior, reducing the complex mathematical calculations that controllers cannot perform [12] . Using artificial intelligence, optimization methods can be implemented, such as the descending gradient algorithm (AGD), an iterative optimization algorithm that allows to find minimum values of convex and differentiable functions throughout its domain [13] . The development of better controllers and their implementation in the industrial sector is a research topic that remains latent in the search to improve processes. In the work of [14] IAE tuning equations are used to optimize a PID controller, since controlling the temperature deviation is critical for the final product quality in the paper industry. The results show that the controlled variable deviation from the setpoint can be minimized, so that the value of IAE decreases. Similarly, in the manuscript of [15] the design of a fuzzy PD + I controller applied to control the temperature of a nonlinear chemical process. To adjust and obtain the best parameters of the controller, optimization is performed using the evolutionary algorithm PSO (Particles Swarm Optimization), and its comparison with other controllers is carried out by simulation of a mixing tank with variable dead time. In [16] the behavioral model of a vehicle driver is presented using Takagi-Sugeno Fuzzy Control Systems (FCSs) based on gradient descent (GD) and having great results. For its part in [17] , the GD and the Extended Kalman Filter (EKF) estimation is compared to improve the control performance of Fuzzy PID (FPID) controllers, it allows to enhance the reference tracking and disturbance rejection performance. The need to control the temperature level at each stage of the proposed process and reduce the time spent have motivated the present investigation. In this document it is proposed to describe the design of a zero-order Takagi-Sugeno-Kang fuzzy controller identifying the plant model previously. The TSK fuzzy controller is made from a conventional controller and is optimized by descending gradient and a cost function. It is intended to demonstrate the advantages of controllers designed under the artificial intelligence technique compared to classical controllers in an industrial environment. In addition, reduce the operation time of the process, decrease in costs, man hours. Based on the described bibliography, GD optimization is used, focused clearly on the manufacturing sector, demonstrating its variability of applications and good industrial performance. This paper is organized as follows: the introduction in Sect. 1 and the case study in Sect. 2, which describes the characteristics and identification of the furnace for the heat treatment process, temperatures and operating times. In Sect. 3 the design of the conventional controller is presented. In Sect. 4 the design of the TSK fuzzy controller is presented. The analysis of the tests performed and conclusions are described in Sect. 4 and Sect. 5 respectively. The Heat Treatment process for the relief of welding stresses is part of the production chain of the metalworking sector. Equipment made of carbon steel, such as: boilers, external boiler piping, pressure vessels and part of them are placed in a furnace where it is necessary to handle the temperature and the application of controlled heat on the steel to change or alter its properties. The furnace used works with gas and it has dimensions: 14000(L) Â 4000(H) Â 6000(W) mm. It has a thermal insulation of glass wool, two burners and Liquified Petroleum Gas (LPG) is used as fuel. The heat treatment starts when the equipment or steel pieces enter the furnace; thermocouples are welded into the welding joints and burners are ignited. This process is divided into 5 stages and in each of them a temperature monitoring is required at a defined speed and time, as shown in Table 1 . The heat treatment is carried out in an intermittent oven. Most ovens are noncommercial construction and manual operation. Temperature measurement is acquired by thermocouples which are welded directly to the welding joints of the equipment or part to be subjected to the treatment. The control of the process depends on a human operator who visualizes both temperature of the welding joints and required time of the process. Based on these variables, the intensity of the burner flame is regulated by adjusting the LPG air control valve. Temperature variations are recorded and a report is issued at the end of the process. Said process demands a high consumption of resources and man hours as a result of the lack of automation causing high operating times in the process. The level of automation and instrumentation in the heat treatment furnace is minimal, so the implementation of a system that allows automatic control of this industrial process is proposed. To identify the plant, a dynamic model has been made. Said model is tested by the response to a step input. The reaction curve corresponds to the transfer function presented in (1), for a first order system and represents the conventional plant model. Consequently, throughout a linear transformation, the conventional model of the plant becomes a fuzzy model of TSK type. When designing the conventional controller, the characteristic closed loop polynomial and the plant was used in order to find its equivalent to the denominator of the transfer function of a second order system. Temporary characteristics were established such as settling time t s ¼ 4s, overshoot M p ¼ 1%, in order to find the damping factor n and the undamped natural frequency Wn. Using the calculated parameters, the transfer function of a second order system is acquired, the same as defined in (2) . In addition, the structure of the PI + D controller is shown in Fig. 1 . To apply the pole assignment tuning method, the non-interacting conventional PID structure is used. By reducing the diagram blocks, the transfer function of the controller in closed loop with the plant is obtained, shown in (3) . The denominator of the closed loop transfer function of the system is the characteristic polynomial P(s) presented in (4). RðsÞ In (4) it is equal to zero to find the term-to-term equivalences with respect to the denominator of a second order system (2) . Equivalences are defined and the three parameters of the controller are cleared: proportional gain K p in (5); integral time T i in (6) and derivative time T d in (7). The designed controller objective is to follow a temperature curve that varies over time. Once the tuning gains have been found, considering that the Kp gain is zero, the PI + D is modified, remaining as an ID type controller. Its block diagram representation is shown in Fig. 2 and is presented in (8) the transfer function of the control signal U(s) with respect to the error E(s). EðsÞ As a design part, the controller simulation is carried out in the MATLAB software, but for its real implementation the respective programming is carried out in a PLC, therefore, its discretization has been made through the Euler method and after executing an algebraic operation it is obtained the difference equation. It should be mentioned that sampling time selection T for a first order system is T ¼ s=10, where s is the plant time constant. The u k variable defined as the control signal at the instant of time is cleared and the result is described in (9) . To simplify this equation, the assignments shown in (10), (11), (12) and (13) are made. The k values found depend on the parameters of the first order model K, s, the tuning gains of the controller KI, KD and the sampling time T = 210. By previous assignments, the equation is reduced and therefore (14) is obtained. The structure of the discrete conventional controller and the fuzzy plant is shown in Fig. 3 . Subsequently, the respective simulation is carried out, which allows to evaluate the operation of the controller. The output of the u k controller depends directly of these 4 inputs: e k = Error in the instant of time; e kÀ1 = Error in previous time; u kÀ1 = Control signal in the previous time and u kÀ2 = Control signal in the previous time -1. Once the conventional setpoint tracking controller is tuned, the fuzzy controller is tuned and optimized to evaluate their performance and compare them. Similar to obtaining the fuzzy plant model, the discrete transfer function and its respective difference equation is required, it is described in (15) . The structure, inputs and outputs of the fuzzy controller are defined in here for its design and simulation; where the inference system used is a zero order Takagi-Sugeno-Kang type. In a fuzzy model, the number of inputs have a serious role, since at the merger time the more inputs there are, the algorithms become more complex; this is why in (15) errors and control signals were grouped for get only two variables. Final difference equation, which defines the structure of the controller is presented mathematically in (16) and in a block diagram in Fig. 4 . Where: u k = Controller signal at the instant of time; DE k = Error signal variation; DU k = Variation of the control signal and k 2 ; k 4 = Constant values. The inputs of the fuzzy controller are defined by the error variation and the control signal variation. The output is the control signal at a defined time instant. The 5 membership functions of the entries are triangular, which will facilitate the calculations in the optimization process, since they comply with the overlapping law, resulting in 25 system rules. The consequent of the controller is singleton or solitary type and represent a constant value, they are defined in (17) . Where: E p is the value of the speech universe of the error variation when l C ðE p Þ ¼ 1 and U q is the value of the speech universe of the controller variation when the l D ðU q Þ ¼ 1, of the p; q À ths rules and C and D are the fuzzy sets. The controller output is shown in (18). Where w ij depends on the error variation signals and the burner variation, expressed in (19). In this design, the singletons of each system rule were obtained and the optimization of them was carried out by the algorithm of the decreasing gradient. This algorithm evaluates a cost function that indicates how learning evolves in the tuning process. The cost function J to evaluate the performance of the TSK fuzzy controller is the mean square error described in (20). Where: y r = Values of the Heat Treatment Curve (Set Point) and y d = Temperature value when the fuzzy controller and fuzzy plant react. Controller output shown in (18) is replaced in (20). Additionally, J is derived with respect to h pq and the optimization values, therefore the function gradient is obtained in order to iterate the learning algorithm shown in (21). To decrease the number of iterations, the conjugate descending gradient must be used, obtaining the second derivative of the cost function called the gradient address defined in (22). Once the cost function is defined to use the optimization algorithm, the learning periods are evaluated by (23), to determine the modification of the controller singletons. Where: h pq þ 1 = Optimized controller singletons; h pq = Singletons from the previous driver; a = Learning Value; rh pq = Cost function Gradient and r 2 h pq = Gradient Address of the Cost Function. By (5), (6), (7) equivalences of the characteristic polynomial and the second order denominator of the transfer equation described in (2), it is obtained that parameters of the conventional controller found are the following: The obtained control is an ID type since the proportional gain has a value that tends to zero, without this affecting the control algorithm. The integral gain K I allows to reach the required setpoint and increase the response speed, while the derivative gain K D takes care of the system stability. Controller transfer function and closed loop plant are presented in (24). Figure 5 shows the response of the ID controller when establishing an 800°F setpoint, complying with the established M P . Conventional setpoint tracking controller is programmed based on (14) in a MATLAB script, so that it reacts with fuzzy plant. The lambda values are determined by (10), (11) , (12) and (13), depending on the first order model parameters K, s, tuning gains of the controller K I , K D and sampling time T ¼ 210s and are presented below: Replacing lambda values found in Eq. (14), the control signal for simulation shown in (25) is obtained. According to the response of the controller, gains K I , K D are modified manually to improve the monitoring of the Heat Treatment Curve and at the same time verifying that the output of the controller is not saturated. The new values found are: It is observed that in the setpoint tracking controller, the integral effect was increased so that it reaches the desired temperature values and also the derivative effect to eliminate the response overshooting, generated by integral gain. These values are the maximum allowed for this controller avoiding its saturation and possible damage to the actuators. With the recalculated values, the response of the ID controller with the conventional plant follows the heat treatment curve defined in each of its stages, complying with the established speeds and times, as observed in Fig. 6 (a) . The reaction of the designed conventional controller is shown in Fig. 6 (b) . In the heating and sustaining stage, the regulation of the control valve increases over time to a maximum value of 99.64% of opening. For the subsequent stages, a proportional closure of the valve is shown at the output of the controller. Both actions are signals achievable by the actuator. The speech universes for the fuzzy controller inputs are: Error variation ¼ À1:5e 4 1:5e 4 Â Ã Control signal variation ¼ À250 100 ½ For each of the discourse universes, the sample space is divided with five membership functions (MF). The initial or subsequent singletons of the rules were found by (17) and are observed in Table 2 . The clear output of the controller is calculated by (21). One of the problems of fuzzy controllers is to set the tuning parameters based on manual test and error methods. For this case the design of the fuzzy controller starts from the differential equations of the conventional controller described in (15) . The response of the TSK controller is identical and linear to the conventional one and its surface is flat. For the fuzzy control response to be superior to that of the conventional one, optimization of the consequent rules is required (singletons). Once the descending gradient algorithm was programmed in MATLAB, for the optimization of consequent rules, new values of the singletons were obtained as shown in Table 3 . The algorithm starts with the twenty-five singletons obtained with (17) and the evolution of the optimization algorithm is shown in Fig. 7 . The initial value of the defined cost function is: While the learning algorithm is running, in the first 166 iterations the cost function begins to increase until the correct optimization direction is found. The new singletons found with the descending gradient algorithm show a notable increase in four specific rules. In the most notable case, said variation reaches approximately twenty-seven times its initial value as seen in Fig. 8 . With the variation of the singletons, the rules of the controller were also modified, resulting in a control surface that presents nonlinearities which is evidenced in Fig. 9 . With the optimized fuzzy controller, temperature curve monitoring is superior to the conventional one in each of the stages of the heat treatment process, achieving all required times and speeds. Figure 10 (a) shows that TSK fuzzy controller has a higher temperature tracking speed compared to the conventional controller. The ID controller got lower temperature values than those required in the holding stage, but they are accepted since the procedure allows a tolerance of ± 50°F. Figure 10 (b) shows that controller reaction is achievable in both types of controllers and although the optimized controller output is irregular compared to the conventional controller, it provides better results when tracking the setpoint. It is notable that the regulation of the TSK fuzzy controller is more responsive in the heating and sustaining stages of the heat treatment process. Finally, in Fig. 11 it is observed that, by learning, the fuzzy TSK controller is able to follow any temperature curve at different times unlike the conventional controller, which does not reach the desired temperature. The structure of the PI + D controller designed for this first-order plant is equivalent to an ID type controller, where the integral constant (Ki) allows to reach the required setpoint and increase the response speed and the derivative constant (Kd) contributes in system stability. On the other hand, the TSK Fuzzy controller is initialized from the correctly tuned conventional controller, so both have the same dynamics, but by optimizing the fuzzy controller singletons with the descending gradient technique and a defined cost function, a better performance in response time and an output that can be achieved by the final actuator is obtained. Manual process control takes 45% longer than the set time, depending on the steel thickness. Applying the conventional controller, this time decreases to 9% and with the optimized TSK fuzzy controller, it achieves a 4% minimization. The reduction of the time obtained in the welding process carried out by the heat treatment furnace implies a reduction in the consumption of LPG and other resources associated with the process letting the owner minimizes costs for the company. In addition, CO2 emissions into the atmosphere are reduced, which makes this proposal an ecological solution for industrial processes. As part of the process of continuous improvement, this proposal has been developed to motivate the development of a culture of quality management and environmental management. Obtaining positive results motivates the authors of this research to emulate the dynamics of an advance-delay compensator, to analyze its performance and to compare it with the controller designed in this proposal as a future work. In addition, it is proposed to focus this optimization process on other industrial processes, since its economic and ecological advantages for the productive sector have been evidenced. Creating value with less impact: lean, green and eco-efficiency in a metalworking industry towards a cleaner production Hand gesture recognition using adaptive network based fuzzy inference system and K-nearest neighbor Online tuning of fuzzy logic controller using Kalman algorithm for conical tank system Optimization of friction stud welding process parameters by integrated Grey-Fuzzy logic approach MPC under IEC-61499 using low-cost devices for oil pipeline system Modelling and experimental analysis two-wheeled self balance robot using PID controller Nonlinear robust H-infinity PID controller for the multivariable system quadrotor Interactive system for monitoring and control of a flow station using LabVIEW Fuzzy control implementation in low cost CPPS devices Comparison between fuzzy control and MPC algorithms implemented in low-cost embedded devices A linear assignment method for multiple criteria decision analysis with hesitant fuzzy sets based on fuzzy measure Evolving a TORCS modular fuzzy driver using genetic algorithms Gradient descent approach to secure localization for underwater wireless sensor networks Optimización de sintonización de controladores PID bajo el criterio IAE aplicados a procesos térmicos PD + i Fuzzy Controller optimized by PSO applied to a variable dead time process Fuzzy controller inference via gradient descent to model the longitudinal behavior on real drivers Gradient descent and extended kalman filter based selftuning interval type-2 fuzzy PID controllers