The controller software is written in C++ using the standard Arduino library for all I/O operations. It uses a state machine architecture to control the ventilation cycle and to provide the user interface. One execution of the main program loop takes about 15 ms. This constitutes also the sampling rate for pressure and flow measurements. Similarly the cycle time determines the jitter of time based triggers in the ventilation cycle and imposes an upper limit on the bandwidth of the PID algorithm (for closed loop modes).

Microcontroller Software

Commercial ventilators support a range of different ventilation modes that vary in the applied pressure or flow profiles and in the way inspiration and expiration phases are triggered. To make full use of our device for different ventilation modes, we aimed for a very general implementation of the state machine in the controller software that accepts as inputs:

Subset of trigger methods: Triggering the inspiration and expiration phase.

Feedback variable and setpoint profile: Used to calculate the motor speed, either running the PID algorithm or applying the setpoint curve in open loop control.

Set of control parameters: Matching the selected mode. They are displayed and can be edited via the user interface.

Any set of those variables can constitute a ventilation mode in the controller software. This high level of abstraction allows to easily add ventilation modes via a configuration file without changing the core state machine.

User Interface

The device is operated using controls and an LCD on the slanted front panel of the casing. A rotary encoder is used to scroll through a list of user-editable entries shown on the display.

How to interact with the user interface

Menu items are as follows (in this order)

1. ventilation mode: select from implemented modes PC-CMV, OL-CMV, VC-CMV

2. control parameters: multiple entries, depending on selected ventilation mode, e.g. for the PC-CMV mode the operator can set the inspiration time, the respiratory rate, and the slope and plateau value of the pressure ramp.

3. alarm thresholds: one entry for every diagnostic measurement eligible for alarms, e.g. minute volume or inspiratory pressure. The operator can set lower and upper alarm thresholds for every item.