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

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.

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. The CAD files of the various dewpal designs are available on the wiki. These files are parametrised and facilitate the creation of new dewpal's in all sizes and shapes. The most important landmark CAD files can be downloaded from the respective Github repository.