Modeling and development of a low-cost didactic plant for teaching in multivariable systems

This paper aims the planning, construction and modeling of a low-cost multivariable level plant for didactic purposes. The developed model has two pumps that feed four tanks coupled to each other. Between the tanks and the pumps, there are inlet and outlet valves that can change the system dynamics according to its opening configuration. To automate the pumps and read the instrumentation used, the Arduino microcontroller was chosen because it is a model of great use in the academic environment and of easy parameterization. For sensing, the HC-SR04 ultrasonic sensor was chosen, which already has native compatibility with the microcontroller. In order to validate the constructed plant, it was necessary to identify its model, using the empirical step response method for this purpose. In this way, this work has both qualitative and quantitative characteristics, since the planning and construction of the didactic plant involved an exploratory research of the problem, and then the modeling and simulation method was applied to obtain the mathematical model of the plant. Finally, an experimental research was conducted, comparing the data obtained in the real plant with the model data for validation. Having completed all research stages, the work result is a didactic plant with good linearity, able to provide implementation of level control strategies of coupled tanks and to assist in teaching and learning subjects that involve concepts of dynamic systems, besides multivariable systems identification and control.


Introduction
In Brazil, the curriculum of undergraduate engineering courses experiences constant changes that lead universities to search innovative solutions with the aim of improving the formation of engineering students. These changes are a consequence of the application of Brazilian laws, in which curricular guidelines are created to achieve a strong link between theory and practice. In this context, the aim is to reduce the distance between theory and practice, since a large part of the development of the engineer occurs through laboratory disciplines, but due to the lack of coherent learning objectives, there is a limitation of the effectiveness of the objectives as well as difficulties in the development of significant research in the engineering area (Feisel & Rosa, 2005).
One of the most applied methods is project-based learning (PBL) in which the instructional model is student-centered, and the student engages in real-world challenges or projects to achieve shared goals (Kokotsaki et al., 2016). Throughout the development of a project, students are presented with real problems that encourage them to observe, think critically, share experiences, and cooperate to solve the proposed project. Knowledge is gained through experimentation and PBL implementation in engineering courses can bridge the gap between theory and practice (Efstratia, 2014;Vásquez et al., 2015;Özerdem, 2016;Alves et al., 2019).
The growing demand for engineers versed in the practical and theoretical domains has challenged institutions and educators in proposing simple and efficient methodologies of the formation and teaching. This demand stems from the fact that the systems and equipment worked on, whether in design or maintenance, contain a vast amount of information (Simington & Lesiecki, 2004;Sanchez & Bragos, 2007). In general, the practical application consolidates the ideas, directing the student as to the tasks performed by the engineer. In this way, teaching in engineering goes through a gradual evolution in which students are no longer restricted to basic learning through reading and writing only (Srivastava, 2012).
Engineers working in automation and control industrial process may encounter a variety of equipment such as sensors and actuators, requiring indisputable knowledge for the appropriate use or even maintenance of such equipment, which are inserted in various industrial processes. These professionals need to be prepared to deal with real situations present in the daily life of the Control and Automation Engineer. Thus, practical knowledge is a significant requirement for this type of professional, and to improve practical skills, universities apply teaching methods based on experimentation in addition to only providing theoretical classes (Stankovski et al., 2009;Guzman-Ramirez et al., 2015).
The development of educational platforms is crucial to allow students to have contact with engineering practice and experience with real industrial applications (de Paiva et al., 2020;Pinho et al., 2021;Beccaro et al., 2022). One of the difficulties in intensifying the use of didactic control plants in the disciplines of this area is the high commercial price for educational institutions of didactic plants. Other limitations that may arise are the costs of installation, operation and maintenance, the number of students who use the equipment, physical space in laboratories and the amount of equipment available (Pereira et al., 2012).
Knowing the importance of applying practical knowledge and the difficulties in obtaining commercial didactic plants, this paper proposes the construction and modeling of a didactic plant that represents a multivariate level system using low-cost equipment. It should be noted that the purpose of the plant is to assist practical activities in teaching the disciplines of modeling, systems identification, control theory and multivariable control present in the curriculum of the Control and Automation Engineering course at the Federal University of Itajubá, Itabira campus. The proposed didactic plant aims to meet criteria such as low cost, easy construction, assimilation of physical concepts, instrumentation and communication providing a complementation of content covered in other theoretical disciplines of the course curriculum.
The work is structured in six sessions, the first being this introduction. The second section addresses the construction of the proposed didactic plant. The third about identifying system parameters. The fourth on the experimental procedures and the fifth on the validation of the model obtained. In the last section, the conclusion about the work is presented.

Methodology
Following the methodological definitions explained by Köche (2016), it is possible to state that this work has both qualitative and quantitative characteristics. The planning and construction of the didactic plant involved explanatory research.
The research problem to be investigated was identified by engineering professors and students: the difficulty of applying concepts related to the discipline of multivariate control. The proposed solution to this problem was then the development of a low-cost module for didactic purposes to illustrate the application of control theory.
For the didactic module construction, the four phases of the action research method were followed: plan, act, describe and evaluate (Tripp, 2005). Action research is a method for conducting applied research, oriented towards making diagnoses, identifying problems, and finding solutions (Thiollent, 1988).
Then, in later stages of work, the modeling and simulation method was applied to obtain the mathematical model of this dynamic system and validate the built plant. According to De Pádua (2019), it is not possible to establish a single procedure for experimental research due to the intrinsic characteristics of the method. The empirical step response method was used and an experimental research was conducted, comparing the data obtained in the built plant with the data from the identified model for validation.

Proposed Didactic Plant
For the development of the work, it was proposed to build a multivariable didactic plant for level control with individual activation of two water pumps, responsible for feeding 4 interconnected tanks and a supply water tank. Figure 1 illustrates the Research, Society andDevelopment, v. 11, n. 7, e33011730249, 2022 (CC BY 4.0) | ISSN 2525-3409 | DOI: http://dx.doi.org/10.33448/rsd-v11i7.30249 4 plant structure. In it, each pump is fed by the main water tank and has two outlets connected to distribute the flow of water between the tanks. Pump 1 feeds water tanks 1 and 4, while pump 2 feeds water tanks 2 and 3. In addition, the outlets of tanks 3 and 4 feed tanks 1 and 2, respectively, and they return the water to the main reservoir. Source: Authors.
The water tanks have a flow control at their entrances made by manual valves that are connected independently after each T connector outlet that feeds the water tanks. The pump's 1 flow can be divided between water tanks 1 and 4, while for pump 2 it is possible to divide between water tanks 2 and 3. In addition to the inlet control, each water tank has an output flow control in its lower part, in which it can also be manually regulated by a valve.

Plant Structure
Among the materials used in the construction of the plan, some were available at Federal University of Itajubá campus Itabira laboratories, while the others were chosen based on the cost-benefit ratio. Therefore, they have low maintenance costs, they are easy to acquire and use. Tables 1 and 2 show the components used and their respective unit prices in Reais (R$).  Source: Authors.

Arduino
Arduino is a micro controller with ATmega 2560 chip and RISC processor that has a 16MHz oscillator. Even though it is a microcontroller with only 256 Kbytes of flash memory, it has a wide range of applications because it has 16 analog inputs and 54 digital ports that can operate as an input or output of which 14 can be used as PWM outputs as shown in Figure 2 and can work with voltages of 3.3, 5, and 9V if powered by a source. This driver is widespread in the academic environment because the board and its accessories have a low acquisition Research, Society and Development, v. 11, n. 7, e33011730249, 2022 (CC BY 4.0) | ISSN 2525-3409 | DOI: http://dx.doi.org/10.33448/rsd-v11i7.30249 6 cost, such as sensors, actuators, displays and modules for communication. Another advantage is having an open source and widespread language because processing is based in C language, besides working with USB type connection that is found on both PCs and notebooks.

Ultrasonic Sensor
To measure the level of the water tanks, the ultrasonic distance sensor HC-SR04 was chosen. It is shown in Figure 3. This sensor, in addition to having a low cost, it's capable of measuring distances from 4 cm to 4 m with an accuracy of up to 3 mm. The module has a circuit with an emitter and receiver attached and 4 pins (VCC, Trigger, ECHO, GND). When the Trigger pin receives a 5V pulse with a minimum duration of 10µs, the module emits 8 pulses with a frequency of 40kHz and the ECHO pin assumes a high logic level. As soon as these pulses find an object, they are reflected, detected by the receiver and the ECHO pin assumes a low logical level. The time (thigh), in µs, that the ECHO pin remains at a high logical level is proportional to the distance (d) between the sensor and the desired object, which can be calculated by Eq. (1), in centimeters (Morgan, 2014). Source: Manufacturer's instruction manual.

Water Tanks
The plant is formed by 4 water tanks made of acrylic with a thickness of 3 mm and with identical geometries, so that Research, Society and Development, v. 11, n. 7, e33011730249, 2022 (CC BY 4.0) | ISSN 2525-3409 | DOI: http://dx.doi.org/10.33448/rsd-v11i7.30249 7 all have equal volumes. They have a length of 100 mm, a depth of 100 mm and a height of 120 mm as shown in Figure 5, which guarantees a capacity of one liter due to fixing holes in the upper part.  To supply these tanks, another reservoir was installed and positioned at the bottom of the plant. It was designed to store a volume greater than the sum of the 4 upper acrylic tanks, to store and supply water to the system uninterruptedly. The pumps are connected directly to the bottom of this water tank and as the exits from water tanks 1 and 2 flow directly into it, there is no risk of shortage or overflow as it has a higher than the other tanks.

Pumps
Hydraulic pumps are flow machines, whose function is to supply kinetic energy to the water, with the objective of elevating it through mechanical energy conversion of its rotor from a combustion engine or an electric motor. In this way, hydraulic pumps are seen as generating hydraulic machines (Jones, 2013).
These devices are classified as actuators and can significantly influence the response of the system's behavior. Some of the aspects necessary for the design of a pump are the desired flow, the pressure variation, the torque, and the power.
In this work, 2 Rhondamaq CF-2201A centrifugal pumps were used to supply the water tanks, as shown in Figure 7.
These pumps work with a voltage of 12V, have a power of 36W and a pressure of 110 PSI. In addition to being a compact equipment, it has the advantage of providing high water pressure with low energy consumption (Rhondamaq, 2022). To connect the outlet of the pumps to the water tanks, PVC pipes of 8 mm in diameter were used.
To obtain the pump flow behavior curve, it is necessary to vary the supply voltage and measure the time required for the pump to move a known volume of water. Source: Manufacturer's instruction manual.

Valves
All valves used are 3/8-inch ball type with lever type handle, as shown in Figure 8, whose name is because its plug (mobile component responsible for restricting the flow of the valve) consists of a central hollow sphere. When the lever is aligned with the pipe, the valve allows maximum flow, and when it is 90º from the pipe, it is completely closed, preventing the flow of liquid. What distinguish the inlet and outlet valves are the lever models and their connections. The inlet connections have quick coupling and long lever connections, while the outlets from the water tanks have short lever and threaded connections with rubber sealing ring.
Since these are manual opening valves, the liquid flow in the valves is not precise enough so that it can be indicated by a specific value. For this reason, this flow is represented by the range of percentage values of valve opening. Research, Society and Development, v. 11, n. 7, e33011730249, 2022 (CC BY 4.0) | ISSN 2525-3409 | DOI: http://dx.doi.org/10.33448/rsd-v11i7.30249 9

Logical/Power Connection
The speed control of the pumps is done by varying the input voltage, which occurs through PWM modulation. As the voltage and current for these pumps are higher than those supported by the Arduino PWM outputs, two circuit boards were created to drive the pumps. To read the level of the water tanks, an ultrasonic sensor was installed at the top of each water tank, which is connected to the digital inputs of the microcontroller.
To make the communication between the computer and Arduıno, serial communication was used via USB cable to establish the connection, it was configured in Arduino and installed an add-on in Simulink. With this communication it was possible to obtain the data from the sensors and create the activation of the pumps.

Pulse Width Modulation -PWM
The control of the pump flow is done by varying the speed of your motor. The pump uses a DC motor and the turning speed in RPM can be controlled by varying its supply voltage (Petru & Mazen, 2015). In addition, the rotation is directly proportional to the applied voltage. Therefore, varying the average supply voltage of the motor, its rotation is varied. This control can be done by linear voltage control or by PWM.
There are disadvantages to applying linear control, because when the voltage varies, so does the torque, so at low speeds the motor would start in an irregular way. With the use of PWM it is possible to obtain the same torque regardless of the applied speed.
The PWM consists of a modulation of the digital output signal creating an alternation of the signal that is switched between Off and On. When it is Off, no-load current is supplied and when it is On, maximum current is delivered.
The PWM, electrically, allows the average voltage in each period to be controlled, so that, the greater the proportion of time that the system is ON, the greater the average voltage of the signal in the same period (Petru & Mazen, 2015). The time the signal is on during this period is called Duty Cycle and can be calculated by Eq. (2) and Figure 9 represents the average voltage in terms Duty Cycle. Source: Manufacturer's instruction manual.

Drive Board
Due to the power limitations of Arduino, which its PWM output provides a voltage of up to 5V with a maximum current of 200 mA, and the fact that the pump chosen for the project works with a voltage of up to 12V with a current of up to 3A, it was necessary to build a power drive to the pump as shown in Figure 10. Source: Manufacturer's instruction manual.
As shown in Figure 11, the circuit is based on Transistor TIP3055 which is of the NPN type. This integrated circuit can withstand currents of up to 15A and voltages of 60V, for this reason it was chosen as the power drive for Arduino PWM output signal (Innovations, 2022). Source: Authors.
After the development of the board, the diagram of the circuit was printed as shown in Figure 12. The stages of design, simulation, and creation of the layout of the drive board were produced using Proteus software.

System Parameters Identification
Sophisticated control techniques, in general, have as a requirement for good results, a good process modeling. Thus, the identification of systems is a crucial step for control and is directly related to areas of signal processing engineering, optimization and statistics (Åström & Hägglund, 1995).
Based on mathematical modeling, the representation can be performed through parametric and nonparametric methods, with the transfer function being the most accepted and used parametric model used (Wang & Zhang, 2001). To obtain the transfer function of a system, several types of tests can be performed, such as step response, pulse, pseudo-random binary sequence, sinusoidal (Yuwana & Seborg, 1982). Among these methods, the step response is considered the simplest one, since the step function is usually standard on controllers and microcontrollers and can even be done manually.
This method, also known as Step Response, consists of applying a step in the manipulated variable and when the controlled variable is in a stationary regime, observe the behavior of the system. For a correct analysis of the step response, it is necessary a minimum of prior knowledge about the process to be identified, making possible that the observed behavior can be translated into already defined parameters of the model. The model order, the presence or not of dead time and poles in the right semi-plane (unstable open loop processes) are mentioned as desirable knowledge parameters (Ljung, 1999).
Modeling a plant behavior with several interconnected tanks can be an ongoing task, since the supply configuration of the water tanks can cause a high coupling between the variables, making it difficult to obtain the system's behavior when using the Step Response technique (Yuwana & Seborg, 1982). In view of this difficulty, a viable alternative is to model each water tank individually and build a final model using these equations together (Gosmann, 2002).
The approximation of the behavior of water tanks for first-order models is something that is already widespread in the literature, since the dynamics in these processes are equivalent to electric capacitor models, in which the stored liquid volume can be compared to the electrical energy stored in the component (Ogata, 2010).
In this type of model, there may or may not be a transport delay, being a feature inherent to the process to be parameterized. The insertion of this nonlinear parameter in the modeling can make it difficult or even impossible, according to its intensity, to apply the usual control techniques (PID or Lead-Lag). However, this type of problem does not reach the didactic plant, as it is a device with small distances to be covered by the fluid, so we will not take this type of behavior into consideration.
In this way, a first order system without transport delay can be represented mathematically as Eq. (3).
where K and τ, which represent the gain and the constant time, respectively, indicate the parameters of the model to be determined. The time constant τ is defined as the time that the output takes to achieve approximately 63.2% of the response in a stationary and the gain K can be calculated by Eq. (4) where Δy is the variation in the amplitude of the output of the system and Δu is a variation in the applied step.

Experimental Procedures
This section addresses the necessary experiments to the modeling of the proposed didactic plant, as well as make the necessary data available for replication of the present work. Following the configurations proposed in Section 2, the didactic plant was built as shown in Figure 13.  The Figure 14 presents the results obtained and the percentage linearity of each pump. Source: Authors.
From Figure 14, the response behavior of the pumps approaches the linear, thus enabling the experiments of didactic plant modeling. After the linearization test, the modeling of the dynamic system was done, according to the theoretical framework for this, it was applied a voltage step on each pump separately until the system reached the steady state. This procedure was repeated 5 times with the objective of obtaining a more reliable value for modeling and without operational deviations. Table 4 show the average height values obtained from a voltage step on the pump 1 (P1) and pump 2 (P2). Both steps on the pumps began to emerge from the dead zone tension of each pump and water tanks were initially empty. Figure 15 shows the dynamic behavior of the levels of the four water tanks (h1, h2, h3 and h4) when the step is applied to the pumps.  Source: Authors.

Modeling Validation
From Figure 15 and Table 4 it is possible to observe the Δy, Δu and τ parameters refer to equations (3) and (4). Thus, such parameters are presented as shown in Table 5. An important information when calculating Δu is to consider the dead zone of the pump, which is the minimum voltage for its operation. From Table 4, the dead zone of pump 1 is 2.3V while the dead zone of pump 2 is 2V. The τ value was found for each water tank measuring the time for the system to reach 63.2% of the value in steady state and can be seen in Table 5.
With the parameters shown in Table 5 and with equations (3) and (4) reproduce the two tests shown in Figure 15. From the same step of entry into the simulation environment.
As a result of the dynamic response of the system was obtained, as shown in Figure 16. Source: Authors.
As expected, pump 1 does not have any influence on water tank 3, as well as pump 2 has no influence on water tank 2.
It is also observed a greater influence of the pump 1 flow in water tanks 1 and 4, as well as greater influence of pump 2 on water tanks 2 and 3. In addition, it was made a comparison of the results obtained in the simulation with the actual test data obtained from the open loop steps applied to pumps 1 and 2. The result of the comparison can be seen in Figure 17. Source: Authors. Figure 17 shows the confrontation between the real test and the computer simulation based on the mathematical models obtained. It is noted that the mathematical model obtained for the didactic plant is like the real system, satisfactorily representing the system dynamics for the imposed configuration.

Conclusion
Due to the difficulty, for several educational institutions, of obtaining didactic plants for the teaching of disciplines in automation and control, this work presents the necessary concepts for the construction and modeling of a didactic plant for teaching multivariable systems. The development of specific skills and abilities was put into practice during the development of the project as well as the interdisciplinarities that are directly related to the disciplines of modeling, systems identification, electronics, and technical design.
It stands out for the fact that it was possible to create an engineering project for the development of a didactic system using low-cost resources that are accessible to any student. In addition, the system built, proved to be reliable and with a linear behavior satisfactory enough that its identification was obtained through a simple empirical method. The evaluation of this can be done by comparing the step response of the model obtained with the real data of the system, validating the model obtained for the system.
For future work, other techniques for identifying systems and applying multivariable process control strategies can be analyzed. In addition, it is intended to use the didactic plant in a PBL-based course to assess students learning of concepts related to the identification of systems as well as the application of different strategies for multivariate controlling systems.