Analysis of the effects of recycling on process control

.


INTRODUCTION
In general, a control system can be defi ned as a union of distinct components to obtain a specifi c response for a given process.The objective is to keep a certain variable at a desired value or as close as possible 1 .
The development of a control system is based on the use of a given type of controller.The use of controllers in industrial processes began in the years that preceded the 1940s.Names such as John G. Zeigler and Nathaniel Nichols stood out as pioneers in studies on the behavior of controllers.They were also responsible for developing and adjusting control parameters.These methods are still widely used 2 .
Control systems have become increasingly complex and achieving satisfactory performance has become a necessity.Commonly, to control a process, the feedback technique is used.A relationship is established between the input and output values of the process, a difference between these values that tends to be reduced by the controller 3 .
Among the different controllers available, the Proportional (P); Proportional and Derivative (PD); Proportional and Integral (PI); and, Proportional, Integral and Derivative (PID) are the most used in several branches of engineering, especially in the industrial branch with regard to the control of liquid level 4 .They correspond to 80% of the controllers used in processes.Much is due to the ease and simplicity of their implementation.In addition, there is a large amount of scientifi c work available regarding the application of methods for the adjustment and tuning of its parameters 5 .
In his study for the identifi cation, control and tuning of non-interactive serial tanks, Fernandes 6 proposed tuning parameters of PID controllers, especially the PI controller, using the error over time method (ITAE), avoiding traditional tuning methods.Other methods based, for example, on the integration of absolute error (Integral of Absolute Errors (IAE) or quadratic (Integral of Squared Errors -ISE) have stood out in the control area, providing a more robust recovery action 7-8.By specifying the processes of accumulation and fl ow of liquids in tanks, control systems are becoming more and more complex.Achieving satisfactory performance for controllers in terms of level control has become a major challenge, even more so when it comes to multivariable systems.Liquid level control requires a linearization of the system dynamics and knowledge of its parameters to design controllers with satisfactory performance 9 .In this sense, it is preferable that the output fl ows have sufficiently smooth variations, as the level does not deviate abruptly from the value of reference 9 .
Thus, more and more we are looking for effi cient control strategies that suit the control of multivariate systems, something challenging due to the high cost and large amount of time required to identify the model since it is essential to have a phenomenological model of the process 10 .
Accurate dynamic models that enhance a controller's, project-based performance, are challenging and, if not properly found, can inhibit controller performance 11 .
In terms of software that assists in process control, we highlight products such as Matlab ® , LabView™, Maple ® , Excel ® , widely known and used for presenting large computational capacities, but with a very costly Polish Journal of Chemical Technology, 25, 2, 43-55, 10.2478/pjct-2023-0016With the diagram created, the process control system could be modeled mathematically.The modeling for liquid fl ow and accumulation systems in tanks begins with the principle of mass conservation, and thus by a mass balance applied to each of the reservoirs.In this way, for the fi rst tank: (1)   where A 1 is the area of the cross-section of the tank.The same equation was rewritten as follows: (2) since q 2 is proportional to the valve resistance R and to measure the level of liquid h 2 .The term "x" is a factor that correlated the fl ow rate with the resistance and height of liquid 17 .use license acquisition 12 .On the other hand, there is the Scilab software, based on the concept of "free code", has no acquisition cost and is provided with an integrated tool for modeling and simulation, which assists in the development of phenomenological models of systems to be controlled 13 .Such a tool called Xcos, effectively enables modeling tank systems for level control in interaction mode, as occurs in industrial processes with a liquid cycle between tanks 14 .For data acquisition, many researchers employ the use of electronic platforms based on micro controllers to promote a union between software and hardware in the development of control systems 13 .The Arduino platform, in particular, has been standing out in this medium, mainly because it has its structure based on prototyping architecture, presenting an interface accessible to beginners 15 who seek to collect and process data, as well as trigger actuators external to the system 16 .In addition, it allows real-time control and monitoring via serial or even wireless communication, single input and output systems (SISO), or multivariable (MIMO) 17 .
Within this context, the manufacture of an automatic level control structure in tanks based on free code technologies promotes a lower-cost system than currently available in the market.This action will allow small and medium-sized industries to acquire effective, quality and easy-to-maintain and programming liquid level control systems from a more affordable investment.
Furthermore, as a demonstration of the relevance and importance of developing studies that address this theme, relating the mixture between Scilab and Arduino, the objective of this study is to present the development of an automatic control structure of liquid level in tanks, in a cascade confi guration and with the presence of a cycle between the reservoirs.A process arrangement widely implemented in the process industries, however, still incipient in research carried out in the area.

PHENOMENOLOGICAL DIAGRAM
For the system with liquid fl ow and accumulation in the proposed confi guration, the presence of an entry in the process corresponding to the feed fl ow (represented by Q i or q i ), a quantity related to the level of liquid (H 1 or h 1 ), an output fl ow of the fi rst tank , corresponding also to the inlet fl ow in the second tank, which also has an output fl ow (Q 2 or q 2 ).Part of this fl ow Q 2 , returns as an additional inlet fl ow to tank 1.As the aim of the study was to control the level of liquid, the level of H 1 as the variable to be controlled.To this end, control elements were added to the system: Measurement Element (ME) -responsible for promoting instant an instant reading of the liquid level, Reference (REF) -desirable value for the level, Controller (CT) -which will process the signal received by the ME, compare it with ref and promote the necessary actions through the Manipulated Variable (MV) -triggered by the control system to regulate and reestablish the level to the desired value, role played by valve 1.It was also determined that valve 2 will remain in a constant opening position, in such a way as to maintain the output fl ow of tank 2 with as few variations as possible Fig. 1 presents this diagram where the control elements (in red) are incorporated into the.
To obtain the desired transfer function, it was taken into account that water, as working fl uid, considered an incompressible liquid and, therefore, the density ρ can be eliminated from the equation.In addition, it was necessary to linearize the term Rh 2 x and use variance variables to create a relationship of the transient state with the desirable steady state [17][18] .The deviation variables were established as: , , , where the terms with the over script "-" correspond to the quantities in the steady state.Such manipulations and algebraic developments led to the achievement of equation 3: (3)   in that corresponding to the linearized term.
The transfer function referring to the fi rst tank was then obtained by applying the Laplace Transform over equation 3: (4) Thus, we have Table 1 below.With the knowledge of the T and L values, the tabulated information is used to tune the parameters in the P, PI or PID confi gurations.
For the second tank -featuring the same dimensions as the fi rst tank -it was also mathematically modeled as follows: (5)   in that A 2 = A 1 is the base area of the second tank and h 2 is the height of liquid for the same tank.This equation could be rewritten as: (6)   Therefore, in a manner analogous to the fi rst tank, the transfer function was obtained to the second tank: (7)   in that .

CONTROL SYSTEM AND YOUR PARAMETERS
The controller chosen for the development of this work was the PID, which allows proportional, integral and/ or derivative actions to be applied to the manipulated variable with the clear objective of reducing the error.The PID controller allows a stable and accurate control of the process through a looped feedback algorithm 18 .The controller composed of the three parameters has equations that model its operation based on standardizations defi ned by The Instrumentation, Systems and Automation Society (ISA).Thus, the PID controller can be represented by equation 8 below, defi ned by the sum of proportional control actions (k p ), Integral (k i ) and Derivative (k d ) applied in the same period of time (t) in the process 18 . (8) From the moment the transfer function is used to characterize the process in a closed loop control configuration, different techniques can be applied that will imply the adjustment of the Proportional, Integral and Derivative parameters of the PID controller -or in its P, PI or PD variations.Consequently, it is necessary to impose specifi cations regarding the permanent and transitory regime of the process, in order to promote the stabilization of the system 19 .This adjustment is called "Controller Tuning", commonly applied in processes with unknown mathematical systems 20 .
There are different methods for tuning controller parameters, among which those developed by Ziegler and Nichols stand out 21 .There are two methods proposed by these authors.In the fi rst method, if the process does not present complex polynomials or integrators, the response curve of the process c(t) submitted to a unit step input u(t) will be of the "sigmoid" type, as shown in Fig. 2.
When observing Fig. 2 we can see the existence of two constants: time (T) and delay (L).Both are obtained from a tangent line drawn at the infl ection point of the curve.The authors Ziegler and Nichols 22 used a transfer function (equation 9) of fi rst order with a transport delay to characterize the curve and establish the parameter values based on this method.
(9)  In the second method, a value of k i = ∞ is preliminarily defi ned; k d = 0 and for the proportional gain k p values from 0 are applied to a critical value k cr that will provide a harmonic oscillation Fig. 3.
From the same principles, based on Equation 9, Ziegler and Nichols 22 established the parameter values according to Table 2. Therefore, the critical gain k cr will promote a corresponding critical period P cr .Therefore, if the output value of the system does not present a periodic oscillation, the method becomes inappropriate for the system.
However, Ziegler and Nichols's methods are inapplicable to systems that present a non-oscillating output, since the methods primarily aim to obtain a proportional gain that implies a periodic response oscillation 23 .This occurs for example, in the unbound tank level control system in cascade confi guration.In these cases, it is necessary for the tuning the parameters (k p , k i e k d , ), the use of other methods 24 .
In his study, Neto 25 presented tuning methods that aim to complete the error in relation to its absolute instantaneous value (Integral of Absolute Errors -IAE) or quadratic (Integral of Squared Errors -ISE), resulting in an accumulated global error dependent on the parameters of the PID controller.

DEFINITION OF THE TANK SYSTEM NOT COUPLED WITH RECYCLING
The level system of constant cross-sectional tanks not coupled in cascade confi guration, as presented in Fig. 4, was proposed because it is one of the most commonly found in the industry.The choice of the fl uid to be used, in this case, water, was the fact that it is the most common liquid in reservoirs and industrial tanks, as well as because it has known properties (a temperature of 27 o C and a density of 996.5 kg/m 3 under an atmospheric pressure of 1atm was considered 26 ).
The study was oriented based on a logical sequence of established steps: mathematical modeling of the process presented by means of a phenomenological diagram, development and simulation of the level control structure, preparation of the experimental module and empirical verifi cation of the process control.will feed the controller, which in turn will try to reduce it, implying the subsequent control action 27 .

DEVELOPMENT OF CONTROL STRUCTURE
With the transfer functions of both tanks of the process obtained, it was possible to make the control mesh.Due to a mixture of transfer functions that allowed the so-called block diagram to be generated, a graphical representation of the closed-type control mesh was created, as shown in Fig. 5.A direct relationship is then established between the variable to be controlled and the reference (desired value for the level), generating an error signal (E), which In the next step, the theoretical model of the control structure for the process was developed with the aid of the Xcos tool (modeling and simulation) available in the internal package of Scilab software in version 5.5.2.Such a model is similar to the respective block diagram, but allows to manipulate of the inputs (perturbations) and the response of the output values, besides, of course, providing, through simulations, results related to the application of the control.The theoretical control system is stored in an extension fi le *.zcos and can be represented by Fig. 6.
In the creation of the theoretical control structure, developed in Xcos, it was defi ned that the input variations and REF would be the "step" type that according to 28 , represent well the disturbances that occur in processes based on the accumulation and fl ow of liquids in tanks.The block named "Continuous fi x delay" was inserted and a possible need for a time interval is expected to obtain precise means of measurements referring to the controlled variable -it is important to note that the measurement element does not present dynamic delay, requiring no need for the creation of a block of its own in the control diagram.
And as observed in Fig. 6, the blocks "To workspace A [29991]", "T" and "G" were used to store data on the variation of the liquid level during a predetermined period (T = time) and present these values in graphic form, in order to facilitate the interpretation and analysis of the developed control.Thus, a time of 300 s was determined with periods of 0.01 s -which implies 29991 process simulation points established by the softwaresuffi cient to generate a graph response to the imposed disturbances.The time value was established based on preliminary experimental observations.The step is set to 0.01s, maintaining the same magnitude and magnitude scale of the error to be read by the programming code for tuning the controller to be presented later in this study.
In the control structure created, the graphic generator was confi gured to show signals responses to both the disturbances and the controlled variable, thus allowing a comparative presentation and therefore the variations in the difference between the value of the level and the desired value for this -REF, that is, in the error.
For this work, the ISE method was chosen to tune the parameters of the controller.The calculation of the error applied in this method is mathematically represented by the expression 29 : (10) The upper limit of the integral is defi ned as a considerably large value to cover not only the transitional period but also the stationary period relating to the system response.The adjustment rules of the method aim to minimize the area of the response chart that develops over time as a function of the Error (both for a disturbance in the reference and infl ow fl ow) and consequently reduce the error to a given acceptable value 30 .The method is applied to the control structure (block diagram) created in Xcos, promoting a simulation of the graphical response of the system.Commonly, values are assigned to the parameters and the error is calculated, repeating the task iteratively in order to obtain the lowest ISE value.However, in order to be susceptible to new methodological proposals in this context, and consequently avoid "trial and error" maneuvers, a programming code was developed in the Scilab environment, using the "ISE" function available in the software library itself.
To better clarify the logic of tuning developed by the code, we have the fl owchart of actions programmed according to Fig. 7.
According to the fl owchart, initially the code -in fi le format *.sci, because it was programmed in Scilab -is located and loaded.Therefore, the code in its fi rst iteration assigns initial values to k p , k i and k d using pre-established values such as all equal to one.Then the *.zcos (control structure) fi les are located and executed in order to verify the value of the error obtained with the initial values assigned to the controller.As long as the ISE error is greater than a suffi cient and acceptable defi ned value (represented by "A" in Fig. 7), the code returns to the beginning assigns new values to the parameters and performs one more iteration.This cycle repeats until the best values are found that reduce the error to the desired value, that is, the program terminates when the optimization tuning is obtained.The code allows you to establish the desired ISE value, the number of iterations to be performed and the type of confi guration chosen for the controller (P, PI, PD, or PID).Such conditions are defi ned in advance before the tuning code is run.
To perform the ISE method, a step disturbance in the input fl ow was applied enough in order to obtain parameter values capable of promoting system control with real security.Four types of controller confi gurations depending on their parameters were chosen to be implemented.Thus, the ISE Method sought to obtain the best parameter values for the P controller (only with proportional gain), PD (with proportional and derivative gains), PI (with proportional and full gains), and PID (with proportional, integral and derivative gains).For each of the controller confi gurations, cycle percentages equal to 25%, 50%, and 75% were established.
With the completion of the parameters, the theoretical and simulation part of the process response was fi nalized, and submitted to the proposed control structure.From this point on, the real and practical application of the control system was necessary to ratify the proposed objectives.For this, an experimental module was made according to the confi gurations previously established.

EXPERIMENTAL MODULE AND CONTROL TEST
The system (Fig. 8) with two tanks not coupled in cascade confi guration and with liquid cycle from the second to the fi rst tank, was manufactured as a way to test the control structure.For this process, materials were used in a recyclable way, selected and prioritized according to the best cost-benefi t for the development of the experimental module.
For the tanks, brass gallons (metal alloy composed of zinc and copper) were chosen previously used for the storage of diesel oil in gas stations.The tanks had identical diameters with a volumetric capacity of 20 L (internal diameter of 29 cm and height of 31 cm).
For the support base of the tanks, iron bars with a diameter of 1/2" were used.These were made available by the mechanical manufacturing laboratory of the Department of Mechanical Engineering (DME) of the State University of Maringa (SUM).The other materials used are indicated and described in Fig. 8.As for the control components, the Arduino plate model UNO was chosen to establish the control of the manipulated variable (MV), through programming developed in its own software, IDE.The programmed PID controller was compiled directly on the Arduino board.The MV was developed by attaching a stepper motor (model NEMA17PM-K342B) to the globe fl ow control valve located at the outlet of the fi rst tank(upper).For the motor drive -named in the control area as "actuator" -it was necessary to use a drive type "H bridge", model L298N.In addition, a programming logic was created so that the value of the controlled variable (level) was converted into the number of steps required so that the step motor could control the opening of the manipulated variable.Consequently, measurements regarding valve fl ow (in a "fully open" confi guration) for different liquid level heights were performed to delimit the action of the controller based on the minimum and maximum fl ow rate converted into the number of engine steps.
For this case, a trend curve was obtained whose equation characterizes the fl ow behavior in the valve.This equation allowed the maximum fl ow value of tank 1, which occurs at a maximum height of the level, in addition to providing the resistance R value of the valve.
One of the fundamental components for control structuring was the measurement element.ME are commonly sensors.In this case, the ultrasonic sensor model HC--SR04.This sensor uses ultrasonic signals to determine its distance from other objects or surfaces, within a range of 2 cm to 400 cm, with accuracy of 0.3 cm and detection angle of approximately 15 o (fi fteen degrees).
The fact that there is a recycle of part of the output fl ow of the second tank (lower), required the use again, of a programmed Arduino UNO plate, the L298N drive and the HC-SR04 sensor for the activation of a selected mini hydraulic pump (model RS385), in order to make the fl uid fl ow towards the upper tank through a 5/16" polyethylene hose.In the program compiled on the Arduino plate, the liquid level measured by the ultrasonic sensor is used to calculate the respective output fl ow of the tank in question and thus, it was possible to correctly establish the percentage of cycle desired through the control of the mini-pump.
With the experimental module defi ned (Fig. 9. a), it was manufactured, always focusing on maintaining the proposed conditions and confi gurations (Fig. 9. b).From this point, for the experimental tests, it was established that changes in the reference would be made instead of working with the variation of the input fl ow.This occurred due to the ease of manipulating and controlling the variation of the reference and continuing the analysis more quickly and accurately.With the tank level initially at the 20 cm position, the reference was established at a different level value and the system response was analyzed in a time period of fi ve minutes (300 seconds, time required for system stability to be observed).Soon after, the reference value was changed again and the same response time period was used (fi ve minutes).As a comparative principle, simulations in the theoretical control structure (fi le *.zcos) were performed under the same criteria of variations in the reference value established for the actual tests.

RESULTS AND DISCUSSIONS
Before the specifi c results related to the control structure developed, the values obtained for the maximum and minimum fl ows allowed by the globe valve (shown in Fig. 10).The inlet fl ow rate in the process was kept constant at 69.85 ml/s.
It is also presented the characteristic curve that relates the outfl ow of the tank with the height of the level and the resistance of the valve to the fl ow.Therefore, with the measurements taken, the response curve for the fl ow behavior can be presented by the following equation: (11)   Therefore, from the above, a resistance of R = 40.201and the potentiation factor x = 0.2076 were obtained.These values were fundamental for the tuning of the controller parameters, as well as for the simulations and tests of the developed control structure.
In the case of the tuning of the PID controller parameters, through the ISE Method, the values for the Proportional, Integral and Derivative parameters were found in all possible confi gurations of controller structuring.Such data are indicated in Table 3, together with the value of the ISE error obtained.
It was evidenced that all arrangements of the PID controller allowed the obtaining of the values of its parameters.However, the control structure consisting only of proportional action (P) or proportional and derivative actions (PD) presented much higher ISE values when compared to the other two types of PI control and the PID itself.
This high ISE error value made it impossible for the value of the controlled variable to approach the desired reference value.Therefore, for the simulation and experimentation stages of the control structure, results were obtained only for the PI and PID arrangements, which were satisfactorily able to reduce the error.When observing preliminary results of simulation of the control structure, the presence of an initial oscillation was evidenced, which was reduced when the control (error reduction) was obtained.This fact occurred due to the fact that the structure developed in Xcos through phenomenological diagrams, had not initially taken into account the saturation of the manipulated variable, characterized by the physical limitation of opening the globe valve.The problem was that the total error (integral action) continued to be calculated and the full gain began to increase too much, a factor defi ned by some authors as Windup 31 .As a consequence, the response curve to the process becomes oscillatory -an unsatisfactory factor for industrial systems.There are several methods used to avoid windup in the control system, with logic based on preventing the integrator from increasing when sa-turation occurs.One of the commonly used methods is back-calculation.Through this method, when the actuator enters the saturation region, the integral term is recalculated so that its value remains within the linear limit of the manipulated variable 32 .The theoretical control structure modifi ed with the presence of back-calculation was created and is presented in Fig. 11.
The fi rst analysis of results was performed for the system under the action of the PI controller for a corresponding liquid cycle 25% of the lower tank output fl ow (Fig. 12).
Through a relationship of variation of the reference value and the impacts caused by it in the theoretical and experimental responses of the developed control structure, it was observed that the behavior of the process on control proved to be adequate.For the fi rst change in the liquid level in the upper tank the stability of the system coincided with the simulated response -achieved after 140 seconds.For the second variation of the reference, it took a slightly longer time for stability to be achieved compared to the simulated value with the presence of oscillations, which did not occur for the simulated control with the presence of saturation, presenting a satisfactory correlation with empirical data.The next results obtained (Fig. 13) refer to the system under the action of the PI controller for a liquid cycle corresponding now to 50%.This was the confi guration of the control system that best presented results regarding the reduction of error and level stability.The theoretical and experimental values were coherent and the experimental response curve specifi cally presented a faster response referring to the desired level, and control was achieved in about 150 seconds after the changes caused in the reference.
Concluding the results obtained for the PI control system, the answers to the process that presented a 75% cycle are presented, according to Fig. 14.Due to the fact that there is an inlet of more liquid -and with a signifi cant fl ow rate corresponding to 75% of the lower tank output fl ow -a rapid response to the fi rst disturbance was observed.Control was reached after about 145 seconds.However, clearly the level remained relatively at a value higher than that of the reference (period from 120 s to 240 s).According to the systems of accumulation and fl ow of liquid when submitted to high rates of cycle, tend to present variations in fl ows for changes considered small, causing problems in the control mesh.The signifi cant sensitivity of fl ows in systems with cycle is commonly called the "Snowball Effect", as could be observed in this specifi c case 33 .As mentioned before, results for the process under the PID control system were obtained.These are presented below, starting with the simulated and experimental results for the 25% cycle system (Fig. 15), similar to what has already been presented.
Although the system was counting on an additional fl ow rate due to the cycle -25% considered signifi cantly low depending on the output fl ow of the lower tank -the control system behavior presented a relative "delay" for the fi rst variation of the reference, requiring a time of 220 seconds, which did not occur for the second varia- tion of the reference value, where stability was reached in 135 seconds, consistent with the simulated results.
For the system with 50% cycle (Fig. 16), similar to the behavior presented by the PI control system on the same cycle conditions, the experimental and simulated data corroborate each other in the case of the PID control system.
A better correlation between the data occurred between the experimental and the simulated results with the system considering the saturation of the manipulated variable.
Finally, the results for the PID control system with a 75% cycle are presented for analysis in Fig. 17.Again, due to a signifi cant cycle fl ow rate, the control system remained relatively above the desired level for the fi rst variation of the reference.However, compared to the PI  control over the same conditions, the PID control provided a more adequate control, close to the acceptable margin of error for the control and for the measurement element.This control was reached after 150 seconds, with a small initial oscillation.For the second variation of the reference, as expected, there was a small increase in the time for stabilization to be achieved -255 seconds after the variation in the desired level value.The results can be better observed in Table 4 below.The proximity of control performance presented by the PI and PID controllers is emphasized with the above.Although the PI control system presents a small "delay" in relation to the PID control (a fact justifi ed by the absence of the derivative action that provides a rapid response), this type of control is the most recommended for liquid level control processes, presenting one less parameter to process and be tuned, leaving the development and maintenance of the control structure simpler.This is observed in cases where there was a cycle of 25% and 50% where the proportional and integral controller obtained better response, while the PID stood out when a cycle of 75% was applied to the process.
However, if the objective of the control system is to reach the reference value as quickly as possible, the PID becomes the most indicated, due to the small difference in the characteristics of the stabilization time becoming signifi cant for these cases.It is also worth noting that the proposed study process was chosen for its simplicity.For more complex processes such as those involving chemical reactions, the same control system can be applied, but with changes in mathematical modeling.New transfer functions would have to be obtained and thus a new procedure for tuning the controller parameters.Therefore, there is no guarantee which control confi guration will be effi cient: P, PI or PID.
A factor observed in this study, in addition to the question that involves the physical limitations of the manipulated variable (saturation), was the infl uence of the dimensions of the experimental module.The manipulated variable, for example, presents a fl ow diameter of 1/2" which directly infl uences the response of the control system similar to that described by Samaad 34 , where the increase of this for example, would provide relatively faster responses.However, even operating under these conditions, the PI and PID controllers maintained satisfactory effi ciency and behavior.

CONCLUSION
The level control in tanks was performed based on the PI and PID controllers through the mixture between Scilab software and the Arduino platform.
The ISE method due to the response characteristics of the process in question -level control -proved to be simple by obtaining parameter values that, when tested in the experimental module, presented an adequate response when considering the saturation of the manipulated variable.The implementation of back-calculation in the control mesh did not infl uence the tuned control parameters at all, since, with or without saturation considered, the values reached were the same.
The PI and PID control systems were satisfactory, with relatively close results in the simulation.However, when the experimental part was approached with the cycle, it was possible to observe that the best control for a high cycle (75%) was the PID.On the other hand, for lower cycle percentages, it is coherent to promote level control in tanks with the use of the PI controller, since it would be a control parameter (derivative action) of less to be tuned and computed by the control system, provided that it does not present chemical reactions or specifi c processes where the control response time is signifi cant and a rapid response must be obtained.
It is apparent that the 75% cycle signifi cantly infl uenced the control system, presenting characteristics of the Snowball effect.There is a need for an experimental investigation for cycles of 60% to 90%, so that the infl uence of the cycle on the control system is thus clarifi ed.
Therefore, a level control performed through the union between Scilab and Arduino combined with an appropriate block diagram representation of the process and with an effi cient method of tuning, has become fully achievable.

Figure 1 .
Figure 1.Diagram for the level control system in tanks.ME = Measure Element; CT = Controller; MV = Manipulated Variable; REF = Reference; Q i Or q i = Outfl ow of the fi rst tank; Q 1 Or q 1 = Outfl ow of the fi rst tank; Q 2 Or q 2 = Outfl ow of the second tank; ∞ end 1 -∞ = percentages of tank output fl ow 2

Figure 2 .Table 1 .Figure 3 .
Figure 2. Sigmoid response of the process subjected to the unit step perturbation

Figure 4 .Figure 5 .Figure 6 .
Figure 4. System of uncoupled tanks in shell confi guration and with cycle

Figure 7 .
Figure 7. Flowchart of the ISE method execution code

Figure 9 .Figure 8 .
Figure 9. Experimental module -a) corresponds to the control structure defi ned in a schematic form (the control elements are described: RS385 mini pump; "H bridge" L298N; Arduino UNO plate; HC-SR04 ultrasonic sensor; e, Step motor NE-MA17PM-K342B).b) corresponds to the actual structure built (detail for stepper motor coupled directly to the globe valve of the tap type and ruler positioned near the level indicator and the installation of coolers near the engine and the H bridge for heat dissipation)

Table 3 .Figure 10 .
Figure 10.Measurement of fl ow rates for the upper tank outlet valve

Figure 11 .Figure 12 .
Figure 11.Control system restructured with the addition of the Back-Calculation system (identifi ed with the red dashed line) as a way to fi x the Windup problem.A saturation block was also added, with the aim of simulating the physical limitations of the process.Other characteristics of the structure remained unchanged

Figure 14 .Figure 13 .
Figure 14.Results for the control structure based on the PI controller, applied to the process with 75% fl ow cycle from the second tank to the fi rst tank.In red, the reference value variation is displayed.In black, red and yellow, the simulated, experimental and simulated control responses are presented taking into account valve saturation, respectively

Figure 16 .Figure 15 .
Figure 16.Results for the control structure based on the PID controller, applied to the process with 50% fl ow cycle from the second tank to the fi rst tank

Figure 17 .
Figure 17.Results for the control structure based on the PID controller, applied to the process with 75% fl ow cycle from the second tank to the fi rst tank.Highlight the presence of the Snowball eff ect

Table 2 .
Ziegler and Nichols tuning rule based on the second method

Table 4 .
Results of process responses under different controllers