scieee AI-readable full text Open interactive document viewer

PressureShield: An Open-Source Air Pressure Pocket Lab for Control Engineering Education

Vargová, Anna; Boldocký, Ján; Gulan, Martin; Staroň, Martin; Mikuláš, Erik; Takács, Gergely

Abstract

This paper presents a miniaturized didactic device for experimenting with the feedback control of air pressure in a vessel, called the PressureShield. The apparatus is built on a custom extension shield for Arduino R3 compatible microprocessor boards, utilizing widely available off-the-shelf components and 3D-printed parts, resulting in an exceptionally low-cost hardware that can be manufactured under 20 e. The device was created within a larger initiative AutomationShield, which aims to create open-source low-cost educational tools intended to aid control systems and mechatronics education via hands-on experiments or even aid conducting research on a budget. The hardware and software specifications briefly introduced in this paper are freely accessible on the project's GitHub wiki page, making it possible for anyone to reproduce, use, or even improve the PressureShield. In addition to hardware design with downloadable project files, we also present available application programming interfaces and outputs of some demonstration examples.

Full text

PressureShield: an open-source air pressure pocket lab for control engineering education Anna Vargová1,2, Ján Boldocký1,2, Martin Gulan1,2, Martin Staroˇ n1, Erik Mikuláš2, Gergely Takács2 1Faculty of Mechanical Engineering, Slovak University of Technology in Bratislava 2AutomationShield.com Open-Source Initiative {anna.vargova, jan.boldocky, martin.gulan}@stuba.sk, [email protected] Abstract—This paper presents a miniaturized didactic device for experimenting with the feedback control of air pressure in a vessel, called the PressureShield. The apparatus is built on a custom extension shield for Arduino R3 compatible microprocessor boards, utilizing widely available off-the-shelf components and 3D-printed parts, resulting in an exceptionally low-cost hardware that can be manufactured under 20 e. The device was created within a larger initiative AutomationShield, which aims to create open-source low-cost educational tools intended to aid control systems and mechatronics education via hands-on experiments or even aid conducting research on a budget. The hardware and software specifications briefly introduced in this paper are freely accessible on the project’s GitHub wiki page, making it possible for anyone to reproduce, use, or even improve the PressureShield. In addition to hardware design with downloadable project files, we also present available application programming interfaces and outputs of some demonstration examples. Index Terms—pressure control, control education, microcontroller, Arduino, mechatronics I. INTRODUCTION Control engineering education, besides the theoretical fundamentals, ideally requires hands-on experience and practical illustrations to facilitate understanding of basic concepts. For this purpose, universities and educational institutions use various laboratory devices representing systems with various levels of complexity. Commonly used academic benchmarks include inverted pendulums, motor speed control systems, temperature control experiments, etc. Pressure control experiments—using any fluids—certainly belong to such tools as well. Thanks to the relatively simple process dynamics, they are often used in control systems courses for elementary system identification tasks and implementation of basic feedback control algorithms. One may find numerous publications dealing with pressure control. For example, in [1] the author designed an experimental laboratory platform for controlling air pressure in a small tank. The authors in [2] also introduced an entire experimental air tank system for process control education. Others focused more on the solution to a more particular problem of choosing particular hardware elements. For example, the authors in [3] described methods of controlling the air pressure in a chamber by using an electromagnetic microvalve for pneumatic control. In [4] the authors compared the pressure control effectiveness using a commercially available proportional pressure regulator with using a significantly cheaper and lighter solenoid valve. The authors in [5] introduced the design of a high-precision dynamic air pressure controller. An adaptive pressure control system was designed and tested in [6], while the authors in [7] have recently proposed and experimentally tested a pneumatic pressure control based on nonlinear model predictive control. The aforementioned reference examples illustrate not only various approaches to using a pressure control system in research and education, but also a large variety of used hardware, while most of them make use of custom-made devices utilizing components commonly found in laboratories. Although this is a typical approach when it comes to laboratory equipment, we must mention the wide range of accessible commercial laboratory kits intended for control engineering education in the first place. One may opt for more complex equipment, where the pressure control is only a part of the whole experiment (see e.g. [8], [9]), and which can be usually operated as a stand-alone system based on a programmable logic controller (PLC) or a built-in microcontroller unit (MCU). Other devices possessing this feature, with only the pressure control functionality, utilize either water [10] or air [11] as working medium. An interesting group of process control trainers represent devices that need an external computer to be operated [12], thus allowing a more compact design and higher adaptability. Although the above list is by no means exhaustive, it demonstrates the key aspects of these devices. The greatest advantage of commercial laboratory equipment is the extensive software support, a certain level of modularity, and in some cases also a series of training materials and learning handouts equipped with instructor’s guide. Another key feature is the usual size of this equipment. While larger dimensions frequently aid in precision and comprehension of system dynamics, taking into the account the inherently higher price their individual use by students is generally not an option and take-home experiments are virtually impossible. In this paper we present an alternative pressure control experiment developed within the AutomationShield open-source hardware and software initiative [13], [14]. Aim of the project is to design low-cost and compact didactic devices that can fit on the standard R3 pinout compatible boards and can be easily replicated. With the help of provided application programming interfaces and worked examples, the students, educators, and researchers are able to easily implement and perform various control engineering tasks. With these objectives in mind we introduce a new device—the PressureShield. Its hardware was designed to be as simple as possible while still preserving the main features of pressure control systems important for control a b c d e f g h i j Fig. 1: Photograph of the PressureShield device mounted on an Arduino Uno microcontroller board. education, resulting in a device consisting of: •a small vessel with an adjustable orifice, that serves as a pneumatic consumer, •a pump as an actuator, •and a pressure sensor placed in the vessel, •all built on a standard Arduino extension shield layout. The goal of the experiment is naturally to achieve and maintain the desired value of air pressure in the vessel despite a leakage through the orifice. II. HARDWARE In this section we provide a detailed hardware description of the PressureShield, so that the device can be replicated or even improved upon by others. Components, both mechanical and electronic, are labelled alphabetically and can be easily referenced through Figs. 1–3 and Tab. I. It is important to note that the initial PressureShield prototype was created as the part of a team project for the Microcomputers and Microprocessor Technology course, while some major revisions of the electrical circuit and the application programming interfaces were done within a master's thesis. The currently introduced version is built on this version, improving it mainly with new mechanical design and software refinements. A. Mechanical design First, let us introduce the mechanical components of PressureShield. The entire device is built on a printed circuit board (PCB) (b) copying the outline of the Arduino Uno development board (a), however may be connected and mechanically fixed to any R3 compatible pin layout microcontroller prototyping board. A small diaphragm pump (h) is connected to the PCB via two cables and mounted in a 3D-printed housing (c) attached to the base. Note that this pump may also serve as a vacuum pump, therefore it contains both, inlet and outlet g f c 12 k e Fig. 2: 3D printed components of the PressureShield. hose barbs, but the inlet one were cut short to keep the device compact. A flexible pressure hose (d) leading from the pump's outlet connects the pump with the printed vessel. The vessel itself consists of three parts: a small chamber (e) with arched ceiling and a 1.0 mm exhaust hole at the top, a lid (f), and an adjusting screw with a handle (g). An I2C pressure sensor module is installed in the pressurized chamber, connected to the PCB. The lid with the screw serves as a valve mechanism, enabling the user to regulate the pressure loss from the system. The device also contains a potentiometer (i) and a switch (j). These simple peripherals can be programmed for various purposes, such as for setting the reference pressure, or switching between operating modes, respectively. In case of the vessel, the importance of a proper sealing in the pressure chamber cannot be underestimated. The walls of the chamber were printed on a Creality CR-5 Pro 3D-printer, with a 3 mm perimeter, 0.16 mm layer height and 25% gyriod infill. This shall prevent any significant leakage of air through the walls. Other possible leakage may occur at the base, where the chamber is attached to the PCB, and around the hose connections. For the base of the chamber we opted for the usage of polyethylene sheet foam as a sealant, which is placed underneath the vessel. For a better force distribution, the vessel is mounted to a counterpart (k) placed at the bottom of the PCB. We remark that the chamber itself was tested to withstand the expected maximal pressure the pump can produce. B. Electrical design To maintain the ease of use and low cost of the device, the electronic design of the PressureShield was kept as simple as possible. Therefore the resulting electrical schematic shown in Fig. 3 contains only a few parts. The pump is powered through a h i Fig. 3: Electrical schematic of the PressureShield. the Arduino board (a), while the supplied power is controlled by the low-side MOSFET transistor Q1 receiving PWM signal from the Arduino pin D11 through the 150 Ω current limiting resistor. Floating states are handled by the 10 kΩ pull-down resistor. The diode D1 protects the microcontroller from reverse current, while transient effects on the pump power supply are filtered by a capacitor. As for the measurements, an I2C pressure sensor breakout with the sensor BMP280 is used. The sensor is represented in the schematic only by its connector, which is routed to the I2C communication pins of the Arduino, 3.3 V power source and ground. Finally, the POT1 potentiometer's wiper is attached to the A0 ADC capable pin and the MS switch is connected to D3 digital pin. The LED with a suitable resistor only signals the presence of power supply. The resulting two-layer PCB design is shown in Fig. 4. Note that the ground plane copper pour of the PCB is not displayed for better readability. The electrical schematic and the PCB were designed in the free version of DIP Trace, making further changes possible to anyone. We provide the editable schematic files and the PCB layout, along with the manufacturing-ready Gerber format PCB on the wiki page of the device [15]. III. SOFTWARE This section introduces the application programming interfaces (APIs) for the PressureShield device. The goal of every API presented next is to abstract the hardware functionality to input-output functions, thus enabling the students to focus on more complex tasks, such as system identification and control design assignments. A. Arduino IDE API The basic API for PressureShield is written in C/C++ using the standard Arduino Programming Language which can be easily compiled from the Arduino IDE. This API is integrated into the open-source AutomationShield Arduino library which contains hardware drivers and sample exercises for control engineering education. All functionalities associated with PressureShield are included in the PressureShield.h header containing the PressureClass class, that is constructed by default as PressureShield object. As per Arduino custom, the initialization functionality is contained in the begin() method, called within the setup() loop of Arduino IDE as: PressureShield.begin(); This method contains initial settings of the board. First, for each of the used pins it defines whether they are input or output pins. Next, it sets the pump input to 0 to avoid accidentally starting the pump during the initialization. Since the board is designed for 3.3 V logic, the method also defines an external analog reference as analogReference(EXTERNAL). Next, I2C communication between the sensor and the Arduino board is initialized and the functions that measure the pressure on the sensor are loaded. As the pressure of air in the vessel may be slightly different from the atmospheric pressure—due to various reasons, such as a residual pressure from the previous experiment, different air temperature in the vessel after placing it into another room, etc.—it is necessary to calibrate the device for the minimal and maximal pressure measured in the vessel. For this purpose the PressureShield.calibration(); method was created. First, it measures the stabilized pressure. This value is assigned to the variable _minPressure, which is later taken as the relative 0 in the system. Afterwards, the maximal pressure is determined with the pump turned on for 500 ms. These measurements can be retrieved using methods: PressureShield.getMin(); PressureShield.getMax(); In line with the Arduino naming conventions, the I/O functionalities are handled by read and write methods. Calling y=PressureShield.readPressure(); will output the absolute barometric pressure, and the method y=PressureShield.sensorRead(); translates this pressure into a percentage value within the range given by the measured minimal and maximal pressure values for easier presentation. By supplying the input power uin the range of 0–100% to the PressureShield.actuatorWrite(u); method, the user can set the power sent to the pump through the power circuitry. This method maps the input to 8-bit PWM integers, and then sends it to the D11 pin of the Arduino. Manual reference from the potentiometer is read by the PressureShield.referenceRead(); method, returning the reference as a floating-point number. The manual switch connected to the D3 pin of the Arduino has an assigned global boolean variable PRESSURE_MSPIN for checking its position, therefore it can be retrieved later on in any custom script. Besides, the AutomationShield library for A sdf A5 A4 A3 A2 A1 A0 SDA SCL Vin GND 5V 3.3V RESET IOREF TX 1 RX 0 2 7 3 4 5 6 8 9 10 11 12 13 GND AREF A a w1 w2 Fig. 4: Printed circuit board in true size showing traces and pads (black), drilled holes, and the silkscreen layers (green, blue). TABLE I: Component list of the PressureShield, without an Arduino board. Symbol Part Description Qty. UP Price (e) (h), M1 Pump Miniature diaphragm pump, 3.3 V,160 mA, 30 kPa (e.g. SC3101PW) 1 3.77 3.77 (b) PCB FR4, 2 layers, 1.6 mm thick 1 2.39 2.39 BMP280 Pressure sensor I2C pressure sensor module, BMP280 1 2 2.00 (j), MS Manual switch SPDT, SMD, ON–OFF slide switches 1 1.46 1.46 (c),(e),(f),(g),(k) 3D printed parts 3D printed, 39 g of PETG filament 5 – 4.52 IRF 3710 MOSFET 100V, 57A, N-channel trench MOSFET, TO-220, (e.g. IRF3710) 1 1.09 1.09 D1 Diode SMD, 300 V, 1 A, 150 ns 1 0.33 0.33 C1 Capacitor 10 µF, 16 V, SMD, 20% 1 0.32 0.32 – Sealant Polyethylene sheet foam, 0.8 mm thick 1 0.2 0.20 R3 Resistor 1 kΩ, 0805, 0.1%, 0.125 W 1 0.19 0.19 D2 LED 0805, red 1 0.18 0.18 (i), POT1 Potentiometer 10 kΩ ca14 1 0.17 0.17 R2 Resistor 150 Ω, 0805, 0.5%, 0.125 W 1 0.14 0.14 – Turning knob 5 mm×18.7 mm 1 0.12 0.12 R1 Resistor 10 kΩ, 0805, 0.1%, 0.125 W 1 0.12 0.12 – Bolts M3×16 4 0.1 0.40 – Screws M3×8 4 0.09 0.36 (d) Pneumatic hose 4×11 mm 1 0.09 0.09 – Nuts M3 4 0.07 0.28 – Jumper cable 0.5×70 mm 2 0.02 0.04 †For low quantity orders, excluding labor and postage. Total: e18.10† the Arduino IDE provides numerous universal functions common to feedback control, such as a comprehensive interruptbased sampling framework, a PID controller implementation, routines for signal processing, Kalman filtering, etc. B. MATLAB API To avoid unnecessary confusion, structure of the MATLAB API is kept very similar to the Arduino IDE (C/C++) API. In this case, the PressureShield class is contained within the file PressureShield.m. The user has to first create a PressureShield object by calling PressureShield =PressureShield; The initialization method PressureShield.begin can be then used to take care of attaching the I2C device with the assigned I2C address to the PressureShieldObject .arduino member of the object. The remaining methods •PressureShield.sensorRead(); •PressureShield.actuatorWrite(); •PressureShield.referenceRead(); work analogously to the Arduino IDE API. C. Simulink API As all of the devices from the AutomationShield initiative, the PressureShield also has an API library for the Simulink environment: PressureLibrary.slx. This library contains basic algorithmic blocks and functions shown in Fig. 5. The structure of this API follows the introduced framework with three fundamental blocks handling the I/O functionalities: •SensorRead, •ActuatorWrite, •ReferenceRead, Fig. 5: Algorithmic blocks for the AeroShield in Simulink. as well as a comprehensive block representing the entire device (PressureShield) which incorporates the above functions for further use as a plant in feedback control experiments. The input to this function block is the value of the control input u, which is fed to its embedded ActuatorWrite block, while the output from the function block is the pressure value obtained from its embedded SensorRead block. IV. EXAMPLES To demonstrate the functionality of the PressureShield hardware and library, a set of scholar examples of feedback control has been created and integrated in the PressureShield library. All these examples are available on the GitHub wiki page [15]. A. PID control By inspecting the system response it is clear, that the system is open-loop stable and that the dynamics is of the first order. Such systems are often used in teaching control theory mainly in undergraduate courses. In particular, air pressure control experiments are often used to comprehensively illustrate simple control algorithms such as the on-off controller, proportional, proportional-integral or proportional–integral–derivative (PID) control. Therefore the first example that we present is a simple implementation of discrete PID controller. It was tuned using the Good Gain method and manually refined to the parameters Kp= 15.4, Ti= 0.0013, Td= 0.00007, and sampled at 10 ms with input saturation and integral windup handling by clamping. The results of the PID controlled presssure in the vessel are shown in Fig. 6. The controller was implemented in Arduino IDE API, and the data collected through serial logging and plotted in MATLAB. The reference tracking is fairly accurate given the rather complex dynamics of the controlled process. Even with a well-tuned PID controller, students can observe a noticeable oscillation of the measured output for lower setpoints. This can spark a discussion about possible causes, such as the noisy behaviour of the actuator, and potential solutions, such as filtering, which shall lead to further examination of the hardware limitations of the device. Note that for didactic reasons in this example no filter was used. A reasonable next step can be the design of a series of experiments and measurements. An example of the output of such an investigation is the static characteristics of the device shown in Fig. 7, which illustrates the dependence of the measured steady-state pressure on the PWM input signal applied to the pump. In Fig. 7 one can easily observe the nonlinear behaviour of the system, both manifesting itself as hysteresis and deadzone of the pump. As the pump is designed for the 3.3 V to 3.8 V range, at low values of the PWM signal (and thus for a lower corresponding voltage level) it does not even turn on, or simply does not have enough power to overcome the current pressure in the vessel. Naturally, this effect is more present at the lower pressure setpoints, causing the aforementioned oscillation. A brainstorming about possible solutions may lead to ideas such as replacement of the pump, voltage level shifting, assuming the PWM signal with a higher resolution, implementation of an adaptive or gain-scheduling control algorithm, etc. B. LQ control Although PID is an effective method to control single-input single-output systems, the presented hardware can also be used for the demonstration of model based control approaches such as the linear-quadratic (LQ) control. The controller design is then preceded by system identification. This gives the opportunity to introduce various methods to identify the system model. As the dynamics of the process is of the first order, it can be modelled with a first-order differential equation, but based on our experience, second-order models cope with the phenomena caused by hardware limitations better. Another question arising while identifying the system is whether to assume a black-box or a gray-box model. Although constructing the model based on airflow dynamics or an adequate RLC circuit analogy can be tempting, it is easy to encounter equations that exceed the scope of entry-level courses. Consequently, for the presented LQ control example a simple black-box state-space model of a second-order system was implemented. After identifying the system dynamics, students can proceed to the design of the LQ controller itself. The requirement of reference tracking consequently leads to introduction of an integrator state, giving the students an opportunity to get handson experience with tuning of such a controller. Figure 6 shows the profiles of input and output signals after a more aggressive manually tuned LQ controller with integral action was implemented to track the same pressure value reference as the PID controller, assuming the same sampling rate. It can be observed that the LQ controller has a similarly good performance with a less aggressive profile of the manipulated variable. Note that for a fair comparison of the controllers on different MCUs or under different conditions (atmospheric pressure and temperature), we recommend setting the difference between the minimal and maximal steady-state pressure to a value from 5 kPa to 7 kPa using the adjustment screw. V. CONCLUSION In this paper we presented a miniature air pressure control experiment, which can be conveniently used in undergraduate control systems courses, with possible learning outcomes depending on how the lab work is set up, such as data collection and signal processing, feedback control design and tuning, or basics of system identification. The entire device can be easily assembled from off-the-shelf components for less than 20e. Although, as illustrated by the examples in Sec. IV, it is fully functional and suitable for use in education, there is still a potential for improvements. These may include possible hardware augmentations to eliminate the Fig. 6: Example of closed-loop responses obtained with PID and LQ control implemented using the Arduino IDE API. 0 20 40 60 80 100 PWM (%) 0 20 40 60 80 Overpressure (hPa) Increasing input PWM signal Decreasing input PWM signal Fig. 7: Measured static characteristic of the system. mentioned hardware limitations, or adding other components such as valves, different sensors, etc., as well as new software additions. Since the PressureShield is a part of an open-source project, anyone can and is encouraged to contribute. There is an ongoing initiative to integrate the PressureShield into control engineering courses at the faculty. Simultaneously, we are collecting feedback from students regarding their experience with the device, which will be analyzed to identify areas for potential improvement and to enhance the overall learning experience for future students. ACKNOWLEDGEMENT The authors gratefully acknowledge the contribution of the Slovak Research and Development Agency under the grant APVV-18-0023, the Cultural and Educational Grant Agency of the Ministry of Education of Slovak Republic under the grant 012STU-4/2021, and the European Union under Horizon Europe Grant Agreement number 101079342 (Fostering Opportunities Towards Slovak Excellence in Advanced Control for Smart Industries). REFERENCES [1] D. Mihai, “Designing an experimental platform for the air pressure in a small tank by digital control,” in International Conference on Applied and Theoretical Electricity, Craiova, Romania, October 2016. [2] C. Long, J. Miles, C. Holland, and E. Gatzke, “A flexible multivariable experimental air tank system for process control education,” in American Control Conference, 2003, pp. 688–693. [3] X. Liu and S. Li, “Control method experimental research of micro chamber air pressure via a novel electromagnetic microvalve,” in 4th Int. Conference on Information Science and Control Engineering, 2017. [4] M. Shiee, K. A. Sharifi, M. Fathi, and F. Najafi, “Air pressure control via sliding mode approach using an on/off solenoid valve,” in 20th Iranian Conference on Electrical Engineering, Tehran, Iran, 2012, pp. 857–861. [5] J. Du, L. Tan, and C. Wu, “An introduction of dynamic air pressure controller with high precision,” in International Conference on Fluid Power and Mechatronics, 2015, pp. 440–443. [6] T. K. S. Flores, J. M. M. Villanueva, H. P. Gomes, and S. Y. C. Catunda, “Adaptive pressure control system based on the maximum correntropy criterion,” Sensors, vol. 21, 2021. [7] X. Zhang, Z. Lin, J. Li, and T. Zhang, “Pneumatic pressure control based on improved nmpc and its application to aeroengine surge simulation,” Chinese Journal of Aeronautics, 2023. [8] Tecquipment, “Process trainer,” Online, 2022, https://www.tecquipmen t.com/de/process-trainer. [9] TTT, “Analog process control system,”Online,2022, https://tii-tech.com/ learning-systems/integrated-automation/analog-process-control-system. [10] Tecquipment, “Pressure process training system,” Online, 2022, https: //www.tecquipment.com/pressure-process-training-system. [11] Solteq, “Air pressure control trainer,” Online, 2022, http://www.solution .com.my/Product/ProductPage. [12] GUNT Hamburg, “RT 030 training system pressure control,” Online, 2022, https://gunt.de/en/products/training-system-pressure-control-hsi/0 80.03000/rt030/glct-1:pa-148:pr-1044. [13] AutomationShield, “AutomationShield,” Online, 2023, GitHub Wiki page. www.AutomationShield.com. [14] G. Takács, E. Mikuláš, M. Gulan, A. Vargová, and J. Boldocký, “Automationshield: an open-source hardware and software initiative for control engineering education,” in 22nd IFAC World Congress, 2023, to appear. [15] AutomationShield, “PressureShield,”Online,2023, GitHub wiki page. ht tps://github.com/gergelytakacs/AutomationShield/wiki/PressureShield.