Article Text

Download PDFPDF

Development and preclinical testing of an adaptive algorithm for automated control of inspired oxygen in the preterm infant
  1. Peter A Dargaville1,2,
  2. Omid Sadeghi Fathabadi3,
  3. Gemma K Plottier2,4,
  4. Kathleen Lim2,
  5. Kevin I Wheeler5,
  6. Rohan Jayakar3,
  7. Timothy J Gale3
  1. 1Neonatal Respiratory Group, Menzies Institute for Medical Research, University of Tasmania, Hobart, Tasmania, Australia
  2. 2Department of Paediatrics, Royal Hobart Hospital, Hobart, Tasmania, Australia
  3. 3School of Engineering and ICT, University of Tasmania, Hobart, Tasmania, Australia
  4. 4School of Medicine, University of Tasmania, Hobart, Tasmania, Australia
  5. 5Neonatal Unit, Royal Children's Hospital, Melbourne, Victoria, Australia
  1. Correspondence to Professor Peter A Dargaville, Department of Paediatrics, Royal Hobart Hospital, 48 Liverpool St, Hobart TAS 7000, Australia; peter.dargaville{at}


Objective To assess the performance of a novel algorithm for automated oxygen control using a simulation of oxygenation founded on in vivo data from preterm infants.

Methods A proportional–integral–derivative (PID) control algorithm was enhanced by (i) compensation for the non-linear SpO2–PaO2 relationship, (ii) adaptation to the severity of lung dysfunction and (iii) error attenuation within the target range. Algorithm function with and without enhancements was evaluated by iterative linking with a computerised simulation of oxygenation. Data for this simulation (FiO2 and SpO2 at 1 Hz) were sourced from extant recordings from preterm infants (n=16), and converted to a datastream of values for ventilation:perfusion ratio and shunt. Combination of this datastream second by second with the FiO2 values from the algorithm under test produced a sequence of novel SpO2 values, allowing time in the SpO2 target range (91%–95%) and in various degrees of hypoxaemia and hyperoxaemia to be determined. A PID algorithm with 30 s lockout after each FiO2 adjustment, and a proportional–derivative (PD) algorithm were also evaluated.

Results Separate addition of each enhancing feature to the PID algorithm showed a benefit, but not with uniformly positive effects. The fully enhanced algorithm was optimal for the combination of targeting the desired SpO2 range and avoiding time in, and episodes of, hypoxaemia and hyperoxaemia. This algorithm performed better than one with a 30 s lockout, and considerably better than PD control.

Conclusions An enhanced PID algorithm was very effective for automated oxygen control in a simulation of oxygenation, and deserves clinical evaluation.

  • Neonatology
  • Respiratory
  • Intensive Care

Statistics from

Request Permissions

If you wish to reuse any or all of this article please use the link below which will take you to the Copyright Clearance Center’s RightsLink service. You will be able to get a quick price and instant permission to reuse the content in many different ways.

What is already known on this topic?

  • Current algorithms for automated oxygen control are largely rule based and in some cases not designed for rapid responses to fluctuations in oxygen saturation (SpO2).

  • These algorithms have shown a modest benefit in SpO2 targeting in preterm infants compared with manual control.

  • An ideal algorithm would be rapidly responsive, and deal with the non-linearity of the SpO2–PaO2 relationship and the variable oxygenation response between infants.

What this study adds?

  • A proportional–integral–derivative algorithm could be enhanced to avoid hyperoxaemia and adapt to the severity of lung dysfunction.

  • In preclinical testing using an oxygenation simulation, the enhanced algorithm was very effective in targeting the desired SpO2 range and avoiding the extremes of oxygenation.

  • This algorithm now requires evaluation in clinical studies.


The conundrum of oxygen therapy in the preterm infant has yet to be resolved. There is, on the one hand, increasing acceptance of the importance of targeting a desired oxygen saturation (SpO2) range1 ,2 and avoiding prolonged hypoxaemic and hyperoxaemic episodes,3 ,4 and on the other, the recognition that such targeting cannot be reliably achieved by bedside caregivers.5–7 Feedback-controlled automatic adjustment of fraction of inspired oxygen (FiO2) clearly has the potential to improve the precision of SpO2 targeting,8–17 and is beginning to find its way into clinical practice. Automated oxygen controllers have been incorporated into several commercially available ventilators, which are being used with the hope that more effective SpO2 targeting can be achieved with less manual intervention.

Automated oxygen control devices have at their heart an algorithm which measures deviation of SpO2 from a setpoint, and computes an updated value of FiO2 which is then actuated mechanically.18 ,19 The design of the algorithm is fundamental to the function of the device. Contemporary algorithms each have an element of rule-based control,8 ,9 ,13 ,20 whereby FiO2 adjustments to SpO2 fluctuations are made based on a decision table developed by clinical experts. This approach offers the reassurance of clinical input to the decision-making, but the rules for FiO2 alteration are arbitrary and in some cases limited in scope,9 ,13 ,20 meaning that the algorithm may not serve the needs of all individuals.

In developing an ideal algorithm for automated oxygen delivery in preterm infants, several significant challenges need to be overcome.19 The first of these is that the system under control is prone to rapid and pronounced fluctuations in SpO2.7 ,21 ,22 An ideal control algorithm would be capable of a timely response to these SpO2 alterations without inducing instability. Algorithms with a lockout period after each FiO2 adjustment9 ,20 may thus fail to respond to a critical SpO2 deviation. The algorithm must also be capable of dealing with a protracted SpO2 deviation (usually hypoxaemia) that has been refractory to the initial FiO2 alterations called for by the algorithm, and also with ‘steady-state’ error that arises when the characteristics of the system under control alter gradually (eg, basal oxygen requirement changes).

Another challenge for automated control is that SpO2 as the indicator of oxygenation is limited by the non-linear PaO2–SpO2 relationship, with PaO2 changing by only 1–2 mm Hg for each 1% step change in SpO2 on the linear portion of the sigmoid curve, but by >20 mm Hg further towards the asymptote.23 A control algorithm should take account of this discrepancy, and thus avoid lingering hyperoxaemia because of an insufficient FiO2 reduction in response to positive SpO2 errors of relatively low magnitude.

A further challenge for automated control of oxygen delivery is that the magnitude of the SpO2 response to FiO2 adjustments (system gain) varies over time, related in large part to the evolution of lung dysfunction.24 ,25 This calls for a control algorithm that can adapt to the current severity of lung dysfunction, a feature incorporated into only one of the contemporary automated control algorithms.8

Herein, we report the development and preclinical testing of a rapidly responsive and adaptive algorithm for automated control of inspired oxygen in preterm infants. Beginning with proportional–integral–derivative (PID) control logic, we developed an algorithm with optimised coefficients, and investigated enhancements including compensation for the non-linear SpO2–PaO2 relationship, and adaptation to the severity of lung dysfunction. In preclinical testing using a simulation of oxygenation disturbances in the preterm infant, we aimed to assess the performance of the algorithm and its enhancements in (a) keeping SpO2 within a target range, (b) avoidance of time in hypoxaemia (SpO2 <85%) and hyperoxaemia (SpO2 >96% in oxygen) and (c) avoiding hypoxaemic and hyperoxaemic episodes.


The oxygen control algorithm was developed so as to allow incorporation in a stand-alone device or integration with pre-existing hardware for respiratory support in neonates. For the purpose of preclinical and ultimately initial clinical testing26 the algorithm was housed in a stand-alone device consisting of a processing platform (laptop computer), device inputs and outputs, a servo-controlled air–oxygen blender and a user interface displayed on the computer screen. The algorithm code was written in a graphical programming language (LabVIEW 2010, National Instruments, Austin, Texas, USA) and uploaded in the laptop computer.

The core PID algorithm

At the core of the algorithm was a PID controller, a popular and versatile form of process control widely used in industry.27 For PID control, an error is defined as the deviation of the process signal from the setpoint, and the value of the manipulated signal output at each moment is proportional to the error, its integral and its derivative, with a different multiplying coefficient in each case (Kp, Ki, Kd). In this case the error (e) was the numerical difference between the incoming value for SpO2 (assuming a valid signal) and the midpoint of the selected target range (eg, target range 91%–95%, midpoint 93%). The integrand (Embedded Imageedτ) was the sum of all errors (subject to constraints outlined below); the integral term in PID control lends the advantage of overcoming steady-state error.27 The derivative (de/dt) was the SpO2 slope by linear regression over the previous 5 s, and in PID control gives a prediction of future error.27 The output of the algorithm at each iteration was ΔFiO2, being the sum of each of the PID terms (equation 1). The FiO2 to be delivered (set FiO2) was the sum of ΔFiO2 and a reference FiO2 value (rFiO2), a representation of the current baseline oxygen requirement (equation 2). Set FiO2 was rounded to ±0.5% and coerced to a value between 21% and 100%.Embedded Image 1Embedded Image 2

The PID algorithm code was within a loop iterating each second, allowing FiO2 alterations to be made at 1 s intervals if necessary. Value ranges for Kp, Ki and Kd, each of which was negative, were derived from extensive simulation studies. The value of Kp could be adapted to the severity of lung dysfunction (see below).

Modifications of the standard PID approach were applied to accommodate some idiosyncrasies of the system under control. The effect of reducing the error related to SpO2 values within the target range with a fractional multiplier proportional to distance from the midpoint was investigated (target range attenuation). Further, given the relative imprecision of SpO2 monitoring at values <80%,28 negative error was capped at 13%. These error adjustments were applied to calculation of the proportional term only.

Some modifications to handling of the integral term were also implemented. In recognition that the integral term progressively increments FiO2 in the event of unremitting hypoxaemia, its magnitude was capped so as to limit the maximum ΔFiO2 to 40% above rFiO2. In hyperoxaemia (SpO2 above target range when in supplemental oxygen), which can follow a hypoxaemic event as an ‘overshoot’,29 the error at high SpO2 values is not proportional to the likely deviation of PaO2 from an acceptable value (figure 1). An approach to overcome this was investigated (Severinghaus compensation), whereby during hyperoxaemia, for as long as the integral term remained positive (ie, tending to increase ΔFiO2), an error multiplier was applied to incoming positive errors (table 1).23 This had the effect of rapidly reducing the integral term towards zero, leading to FiO2 reduction and thus mitigation of overshoot. When in room air, sequential values of SpO2 above the target range were no longer considered to represent unremitting hyperoxaemia, and the integral term was not altered.

Table 1

Error multiplier for positive SpO2 errors

Figure 1

PaO2 error relative to unitary SpO2 error. Plot of the step alteration in PaO2 (ΔPaO2) for each 1% advance in SpO2 beginning with SpO2=80%. The ΔPaO2/ΔSpO2 relationship is relatively linear below SpO2=90%, and becomes exponential thereafter. Data derived from the Severinghaus equation.23

The derivative term calculation was also modified in hyperoxaemia, such that negative SpO2 slope was nullified (ie, rendered=0) if all of the latest five SpO2 values were above the setpoint. Upward pressure on ΔFiO2 by the derivative term was thus avoided in hyperoxaemia.

Adaptive features of the algorithm

Adaptive control is an approach in which the behaviour of an algorithm is adjusted based on varying characteristics of the process and its signals.30 An adaptive approach was investigated in which Kp was modified according to the severity of lung dysfunction by applying a scaling factor proportional to current rFiO2. The Kp modification was by multiplication of the standing value of Kp by a factor in the range 0.5–1.5 for rFiO2 21%–60%. Adaptation of Kp in this way acknowledges the inverse proportional relationship between gain and severity of lung disease that has been observed in this population.24 ,25

Algorithm input and output

The primary input to the algorithm, SpO2, can be sourced from any oximeter having an analogue or digital data output. For algorithm development and preclinical testing, SpO2 was derived from a simulation of oxygenation in the preterm infant. The output from the algorithm can be transmitted to any device that can receive and execute a desired value of FiO2, including air–oxygen blenders and mechanical ventilators. For preclinical testing, the output FiO2 was linked to the oxygenation simulator.

Algorithm evaluation

The contribution to algorithm function of three enhancing features was investigated. The performance of all permutations of the PID algorithm with (a) Severinghaus compensation, (b) Kp adaptation and (c) target range attenuation was evaluated using a simulation of oxygenation (fully described in the online supplementary text and depicted in online supplementary figure S1). A 1 Hz recording of FiO2 and SpO2 (∼24 hours duration) from each of 16 preterm infants on continuous positive airway pressure (CPAP)7 was converted to a series of values for ventilation:perfusion (Embedded Image) ratio and shunt. The assumptions made in abstracting oxygenation data were subject to a validation outlined in the online supplement. SpO2 averaging time of the original recordings was 2–4 s, and was not averaged further during the data abstraction and simulation. The Embedded Image and shunt series was then linked to the algorithm under test within the automated oxygen controller, allowing a sequence of unique values for SpO2 to be generated. The SpO2 target range was set at 91%–95%. Function of the algorithm without an integral term (ie, proportional–derivative, PD), and of the fully enhanced algorithm with a 30 s lockout after an FiO2 adjustment, were also examined. For these latter analyses, multiple permutations of PID coefficients were trialled in an attempt to optimise performance.

Data analysis

For each of the 16 SpO2 sequences generated during simulation, proportions of time in the following oxygenation states were calculated: SpO2 in target range, eupoxia (SpO2 in target range, or above target range when in room air), SpO2 <80%, <85%, below and above target range, >96% in oxygen and >98% in oxygen. Frequency of prolonged episodes of hypoxaemia (SpO2 <85%) and hyperoxaemia (SpO2 >96% in oxygen) were identified, as was frequency of SpO2 overshoot, defined as SpO2 readings above the target range for at least 60 s over the 2 min following a hypoxaemic event with SpO2 <85%.8 ,15 SpO2 instability was evaluated using SpO2 coefficient of variation (CV), and frequency and mean duration of episodes outside the target range. These data were summarised as median and IQR, other than for SpO2 overshoot, where data were pooled and expressed as a single value for each algorithm. Algorithm performance was evaluated by comparison of medians using Friedman non-parametric repeated measures analysis of variance with Dunn's post hoc test. For simplicity the comparisons were limited to the following groupings: (a) core PID with or without one enhancing factor (Severinghaus compensation/Kp adaptation/target range attenuation); (b) enhanced PID with or without subtraction of one enhancing factor and (c) comparison of core PID/enhanced PID/PID with 30 s lockout/PD. Summary data regarding SpO2 targeting by manual control from the original recordings were also generated, but statistical comparisons not made given the different SpO2 target range (88%–92%).


The recordings using in the simulation came from 16 preterm infants of median gestation at birth 30.5 weeks (IQR 27.5–31 weeks), birth weight 1320 (910–1860) grams and postnatal age 2.0 (0–5.3) days. The infants had a considerable degree of SpO2 instability, with hypoxaemic episodes (SpO2 <80) occurring with a frequency of 3.1 (1.6–9.9) episodes per 4 hours. At the time of the recording, CPAP pressure level was 7.0 (6.5–8.0) cm H2O and baseline FiO2 0.28 (0.25–0.31), with a baseline FiO2 range of 0.21–0.61. After removal of missing SpO2 data, the recordings were of duration 22 (20–26) hours.

In simulation testing, the complementary function of the different components of the PID controller was evident. Separate addition of Kp adaptation and target range attenuation to the core PID controller improved eupoxia time, whereas addition of Severinghaus compensation decreased episodes of hyperoxaemia, but not without some deleterious effects (tables 2 and 3). Overall, the performance of the PID algorithm with all three enhancements was superior to other combinations, but not for all oxygenation parameters. Without target range attenuation, eupoxia time trended higher than for fully enhanced PID, but conversely time at the extremes of oxygenation was also somewhat higher (table 2). Hypoxaemic and hyperoxaemic episodes were most effectively eliminated without Kp adaptation (table 3), but on occasions at the cost of more oscillation around the target range (see online supplementary figure S2C) and thus less effective SpO2 targeting overall (table 2). Removal of Severinghaus compensation from the enhanced algorithm minimised hypoxaemia, but predictably led to more time in, and episodes of, hyperoxaemia (tables 2 and 3) (see also online supplementary figure S2D). The enhanced algorithm performed better in all respects than an algorithm with a 30 s lockout period after each FiO2 alteration (see online supplementary figure S2E), and considerably better than a PD algorithm (tables 2 and 3).

Table 2

SpO2 targeting

Table 3

Hypoxaemic and hyperoxaemic episodes and overshoot

Stability of the SpO2 recording also varied considerably with different permutations of enhancing features (table 4). The SpO2 CV values in the recordings overall reflected the instability seen in individual examples (eg, with Kp adaptation removed from the enhanced algorithm, see online supplementary figure S2C). SpO2 CV was minimised with the enhanced algorithm (and several other combinations) suggesting relative stability under these circumstances. Both PID control with a 30 s lockout and PD control resulted in less SpO2 stability, with longer-lasting episodes above and below the target range (table 4).

Table 4

SpO2 instability


Effective automated oxygen control for the preterm infant requires an algorithm capable of responses that are emphatic and tempered in equal measure, and take account of the physiological complexities of the oxygenation system and its variability between individuals. We found that a core PID algorithm could be enhanced for automated oxygen control by rapid reaction to iatrogenic hyperoxaemia, adaptation to the severity of lung dysfunction and error attenuation within the SpO2 target range. In a simulation of oxygenation derived from in vivo data, the enhanced algorithm had better all-round performance than PID algorithms with fewer enhancements, with an optimal combination of time in the desired SpO2 range and avoidance of hypoxaemia and hyperoxaemia.

The enhanced PID algorithm was able to respond rapidly to SpO2 deviations, adjusting FiO2 up to once per second if necessary. The initial response to a hypoxaemic or hyperoxaemic event was largely the domain of the proportional and derivative terms, with further and more tempered FiO2 adjustments dictated by the integral term until normoxia was restored.

At least in simulation, the enhanced PID algorithm was very effective in mitigation of episodes of prolonged hypoxaemia and hyperoxaemia. The addition of Severinghaus compensation to the core PID algorithm was instrumental in overcoming hyperoxaemic events (including overshoot), and removing it from the enhanced algorithm resulted in their reappearance. The core PID algorithm alone was effective at reducing prolonged hypoxaemia, and remained so with enhancing features added.

PID is widely used in industry and known to provide control to systems with a high degree of variability and with a timelag.27 A PID control algorithm has been used previously for automated oxygen control, either alone31 or in combination with feedback control of mechanical ventilation.32 The PID algorithm used in our study differed from that of Tehrani et al31 ,32 in two important ways. First, we determined error based on the difference of SpO2 values from an accepted setpoint (midpoint of the target range) rather than by conversion to a proximate PaO2 value and comparison with an ‘ideal’ PaO2.31 ,32 Second, our PID algorithm was designed to respond to rapid SpO2 fluctuations, unlike that previously reported in which a rule-based algorithm was invoked during hypoxaemic events.31 ,32 These differences, along with the additional features in our enhanced algorithm, may have improved its function, and avoided the oscillation in SpO2 noted previously before a new steady state was achieved.31

Even with optimised coefficients, the enhanced PID algorithm was less effective at SpO2 targeting when each FiO2 adjustment was followed by a 30 s lockout. PID algorithms are known to retain function when signal output is further manipulated during the time lag until full system response.27 Based on our own observations we estimate the total delay of the oxygenation system in preterm infants to be at least 30 s.33 Avoiding further FiO2 adjustments for such a period seems a suboptimal approach if there is further deviation of SpO2 from the target range, and additional manual FiO2 adjustments are more likely to be needed. In a recent multicentre study of a rule-based algorithm with a 180 s lockout period, a relatively large number of manual adjustments (2.2/hours) were made by bedside staff during automated control.12

Even with enhanced PID including Kp adaptation, the performance of the algorithm was variable in the data recordings sourced from different individuals, with eupoxia time ranging from 86% to 98%. Interindividual variation in the gain of the oxygenation response, which we have recently reported in preterm infants,24 is likely an important contributor to this heterogeneity of performance. Along these lines, there may well be potential to optimise the effectiveness of automated control in a given individual by real-time analysis of algorithm function and tuning of coefficients, in particular adjustment of Kp from its adapted value. No form of performance analysis and autotuning is found in any of the algorithms currently incorporated in commercially available ventilators, and its lack may at times results in automated control that is inferior to that achievable manually. Performance analysis software will be evaluated in clinical studies of a future version of our enhanced PID algorithm.

The simulation of oxygenation used for algorithm comparison was an extension of a validated physiological model in the preterm infant.34 ,35 The simulation allowed the oxygenation disturbance to be expressed independent of FiO2, and thus the impact of FiO2 values different to the original could be examined. Whether such a simulation can reliably predict the function of an algorithm when directly applied to preterm infants will need further investigation. However, using data from our initial clinical study,26 the assumptions regarding the blend of Embedded Image ratio and shunt were found to produce an SpO2 targeting profile in simulation that closely matched actual data during automated oxygen control (see online supplement). Refinement of physiological modelling, possibly including multiple Embedded Image compartments with variable blood flow,36 may further improve the authenticity of the simulation.


An enhanced PID algorithm was very effective for automated oxygen control in a simulation of oxygenation, and deserves evaluation in clinical studies.



  • Contributors PAD: conceived the algorithm (with TJG) and its enhancements (with OSF, KIW and TJG), conceived and developed the simulation (with TJG and RJ), compiled and analysed the simulation data, wrote the first draft of the manuscript and approved the final version. OSF, GKP and KIW: identified enhancements to the function of the algorithm, reviewed and edited the manuscript and approved the final version. KL: collected the original data recordings used for simulation, reviewed and edited the manuscript and approved the final version. RJ: developed the simulation (with PAD), reviewed and edited the manuscript and approved the final version. TJG: conceived the algorithm (with PAD) and its enhancements (with PAD, OSF and KIW), conceived and developed the simulation (with PAD and RJ), reviewed and edited the manuscript and approved the final version.

  • Funding Supported by a starter grant (12-019) from the Royal Hobart Hospital Research Foundation.

  • Competing interests The University of Tasmania and Royal Hobart Hospital have jointly lodged a provisional patent application concerning automated control of inspired oxygen concentration in the newborn infant.

  • Ethics approval University of Tasmania Human Research Ethics Committee.

  • Provenance and peer review Not commissioned; externally peer reviewed.

  • Data sharing statement Original data available for sharing on request.

Linked Articles