Team:UGent Belgium/Software

Bootstrap 101 Template



Fork me on GitHub

Software


The software part of the dewpal is subdivided into two parts, the development of the controlled environment (humidistat) to evaluate the water collection capabilities of the water collectors and the computer-aided design (CAD) of the shape.

Humidistat

For the humidistat, several software modules were and are being developed in Python by our team. The modules are licensed under the MIT license and are published on Github. We strongly encourage the redistribution and reuse of our software.

Sensor logging and data streaming

software architecture

To communicate with the DHT humidity/temperature sensor our team makes use of the Adafruit libraries. For both the DHT11 and DHT22 sensor, a Python script was developed to measure and broadcast the humidity during a predefined timeframe. The measurements are stored in a Pandas dataframe and are streamed to the web using plotly.

Closed-loop control

The actions of a humidifier are controlled by means of a closed-loop control system implemented on a Raspberry Pi microprocessor. Our team developed a multithreading Python framework for the simultaneous control and monitoring of the dewpal experiments. The generic nature of these scripts facilitates the application to other single-input single-output systems and opens the door for the development of other low-cost control systems.

This framework uses the above-mentioned sensor logging and streaming module to gather the environmental data. These actions are incorporated in a sensor class which works well with Adafruit sensor software interfaces but the inclusion of other sensors is straightforward. This class measures the humidity and temperature with a predetermined frequency and writes these measurements to a .csv file, this information is also passed to the controller class. The controller class implements the actual on-off controller, regulating the humidifier; the humidifier is activated when the humidity drops below the setpoint. Due to short dead time and fast dynamics of the system, such a simple controller gives rise to good results.

To facilitate the simultaneous control and data-acquisition on a single-core microprocessor such as the Raspberry Pi, a multithreading layout is used so that the sensor and controller class can run concurrently. Although the sampling rate is different for the sensor and controller, this multithreading framework allows for an elegant implementation of this controller. A schematic overview of the software architecture is given in the figure on the right.

System identification: building a virtual humidistat

Lastly, in order to test the controller software or to perform the tuning of the controller in-silico without the need to constantly perform physical experiments with the humidistat, a Python script was developed for system identification. This script reads a sequence of humidifier values ('on'/'off') and imposes them on the system. Hence, various excitation signals such as pseudo-random binary signals can be used to develop a mathematical model of the humidistat. This "virtual humidistat" can be used to speed up the development of the hardware and software of this system. Due to time constraints, an elaborate system identification of our humidistat has not yet been achieved. Nevertheless, the Python scripts are developed, tested and available on the Github repository.

Computer-aided design (WIP)

Autodesk Fusion 360 is used for the 3D design of the dewpal water collectors. Autodesk Fusion is easy-to-learn, but powerful software to perform parametrised computer-aided design of 3D objects. Its cloud-based and collaborative interface allowed multiple persons to jointly work on a project. Using the software, we could easily discuss and modify different versions of the dewpal and allowed for rapid prototyping.

The CAD files of the various dewpal designs are available on the wiki. These files are parameterized and facilitate the creation of new dewpals in all sizes and shapes. The most important landmark CAD files can be downloaded from the respective Github repository.