Auto-mixer : equipment for the reduction of risks associated with inadequate oxygen supply Auto-mixer : equipo para disminuir los riesgos por el inadecuado suministro de oxígeno

In this paper, the AUTO-MIXER, a medical support equipment for the reduction of risks associated with the inadequate supply of oxygen, is presented. The equipment automatically regulates the Inspired Oxygen Fraction (FIO2 concentration), which is supplied to the patient according to user parameters, measures of oxygen saturation and patient’s status. The AUTO-MIXER is based on a fuzzy control system, which was implemented in a microcontroller using a Look-Up Table. The operation of the device was validated using simulated data and actual patients. The results show that the AUTO-MIXER is an important tool for decreasing the incidence of pathologies related to unsuitable handling (excess or lack) of oxygen.


Introduction 123
The specialists at the neonatal intensive care unit of the Centro Médico Imbanaco (CMI) in Cali, point out that 25% of the premature newborns are diagnosed with some type of complex respiratory pathology (Donoghue et al., 2006) and they often require mechanical ventilation or supplementary oxygen, approximately 25% of the patients that survive will stay dependent on oxygen.For a patient under stable conditions, oxygen saturation (SPO2) must stay within 88% and 95%, while in the case of newborns, a lower range of 85 and 93% (Zin, De la Fuente, Gilbert, Quinn and Sola, 2007), is acceptable, as shown in Table 1.
For this reason, the monitoring of oxygen saturation and a permanent control of the Inspired Oxygen Fraction (FiO2) administered to the patients that require oxygen treatment, are critical factors that must be controlled given that it can cause irreversible effects (Azad, 2006), such as permanent damage to the blood vessels in the retina; this is one of the major causes of child blindness in children at health institutions.
Today, the technology used in monitoring oxygen saturation presents a high variability and the oxygen supply control procedure is done manually by opening and closing a valve (Mechanic blender: mixers of air and oxygen).
Currently, there is only one ventilation system that has been designed to automatically regulate and modify the oxygen supply in critical and intubated patients (Strickland and James, 2004); other oxygen administration systems (cannula, mask and cephalic chamber) do not have automatic mechanisms.
In this work, equipment for the automatic of supply oxygen, called AUTO-MIXER is presented.The AUTO-MIXER is a piece of equipment based on a fuzzy logic control system.This system is implemented in a microcontroller through a matrix or data structure.
The AUTO-MIXER controls the oxygen income in a precise way leading, in the majority of instances, to the lowering of the oxygen dependency time of hospitalized patients.This is a substantial difference to the current system.
This paper is organized as follows: first, the approximate model of the patient that is used in the project is explained; next, the description of the fuzzy controller is presented as well as the description of the AUTO-Mixer and the tests carried out to verify the performance of the proposed device and lastly, the conclusions are outlined.

Approximate model of a patient
The patient model, in this case, becomes necessary to facilitate the design of the controller given that otherwise, in order to tune it, it would have been necessary to carry out tests directly on the process, in this case a patient.Having an approximate model of the patient assists in the final implementation because there are simulated results that back up such design (Matiz, Araque and Zapata, 2007).
According to specialized literature on the topic, a human being reacts to an oxygen stimulus in 8 seconds (Smith, 2000).For this study, it is assumed that it presents an exponential behavior.
Hence, a suitable model to use is a first order dynamic (Ogata, 1993), as shown in Equation 1: where K is the gain and T is the time constant.
For the practical case of the project, the most important variable is the stabilization time (ts).To obtain this, the time was researched among medical staff and it was concluded that it is dificult to establish a specific time for all patients due to the fact that it depends on the pathology of each individual.For this reason, a model of a patient under stable conditions was used.This means that the patient requires an oxygen supply, but is not in a critical state.
For the 4% criteria (Ogata, 1993), the relationship between T and ts is given by: (2) In this case, ts = 8s and therefore  = 2 according to Equation 2.
To calculate the gain K, it would be necessary to obtain a relationship between how much the oxygen saturation increases or decreases, when a specific percentage of the oxygen concentration is raised.
However, this relationship is difficult to calculate since the variables that govern the behavior of the human respiratory system have to be related and a statistic study of patients with different pathologies must be performed (West, 2001).Therefore, in a sta-ble patient, this relationship shows that the gain K, is approximately 1.
Based on the simulation carried out, it can be observed that when the gain of the plant or patient is reduced, the stabilization time of the system and the control effort increases (Matiz et al., 2007).
With these observations, it can be concluded that when there is more control effort, the patient has more respiratory problems and thus, is less effectively stabilized.

Control system (Fuzzy controller)
Fig. 1 shows a diagram of the control system considering the patient as the process to be controlled.

Figure 1. System blocks diagram of the control system
The measurement of the oxygen concentration is sent by the pulse oximeter to the AUTO-MIXER, it activates a stepper motor through an electromagnetic adaptation that allows it to open or close the blender to modify the oxygen supply to the patient.
The fuzzy logic was chosen to develop the control system because it adjusts perfectly to the needs of the project:  It allows the knowledge and ability of the medical staff to be represented semantically.


It is possible to design the fuzzy inference system using an approximate model of the process, (Caicedo, López and Muñoz, 2012), the patient in this case.
A Sugeno Fuzzy Inference System (FIS) was selected.One advantage of Sugeno FIS is that the values that are produced by the consequents of the different activated rules are already numerical values.This implies that an additional stage of defuzzyfication is not necessary (Passino and Yurkovich, 1998) (Caicedo, López and Muñoz, 2012).
The control system has a FIS with two inputs (error and derivative of the saturation), one output (blender movement) and 35 fuzzy rules derived from the interaction with the health staff, the pa-tient´s clinical histories and the research group.Fig. 2 shows the fuzzy inference systems.The first input of the control system is the "error", represented by the equation: The reference is the desired saturation that has to be in the range that was initially programmed.The saturation measured is the value measured by the pulse oximeter.The equation that defines the reference is given by: where, MaximumValue and MinimumValue are the maximum and the minimum values of oxygen saturation that the user can set in the AUTO-MIXER.
In this input five fuzzy sets are defined, which have values between -20 and 20, since the patient does not have a higher difference between the desired value and the measured value (Matiz et al., 2007).The second input of the control system is the derivative of the saturation that refers to the future tendency of such variable.This variable gives the information of how the patient could behave when the oxygen stimulus is applied.The equation that defines the derivative of the saturation is given by: where sat(k) is the oxygen saturation in the sample k, sat(k-1) is the oxygen saturation at the sample k-1 and SP is the sampling period; given that the pulse oximeter sends measurements every 2 seconds, the sampling period (SP) is equal to 2.
For this input there are seven sets which have values between -10 to 10. Fig. 4 shows the membership functions for the second input of the FIS.The output of the control system is given by the control action over the blender; it is opened or closed according to the system conditions.Fig. 5 shows the linguistic labels and the values for the output of the FIS.
The 35 fuzzy rules were obtained with the help of the specialized medical staff.An example of the analysis for a specific rule is the following: if the error is positive, it means that the saturation measurement is less than the desired level and if the derivative of the saturation (future tendency) is negative it means that the patient requires an oxygen stimulus and it would be necessary to open the blender.

Figure 5. Output values
The rules that define the functioning behavior of the fuzzy inference system are generated by performing this same analysis for each one of the five linguistic labels in which the first input was divided as well as for the seven linguistic labels in which the second input was divided.
Table 2 shows some of the cases of the relationship be-tween the input and output variables: the first column shows the linguistic values for the first input (Error), the first row shows the linguistic values for the second input (DerSat) and the linguistic values of the output (Blender) are in the inner grid.Fig. 6 shows the tridimensional surface of the fuzzy inference system.This graph allows the visualization of the control actions that are generated by the fuzzy system for the possible input values.For the implementation of the fuzzy control in a microcontroller PIC, Look-Up Tables (LUT) are generated; this process is done in Matlab, where all the inputs are related to all the outputs.LUTs are very useful to save processing time because memory values can be obtained faster than when complex computational routines are used.
The outputs are in a floating-point format from -10% to 10%, according to the output of the controller that refers to the percentage of the opening of the blender (Matiz et al., 2007).To carry out such opening, a stepper motor opening angle of 1.8° is used.
The first input (error) is divided into 41 possible values.These values are located in the rows of the LUT.
The second input (derivative of the saturation) is divided into 21 possible values.These values are located in the columns of the LUT.
In the inside of the table, the mapped values that were calculated using Matlab are shown.These are located in sequence at the beginning of the code that is programmed in the microcontroller.These values are accessed using a mathematical formula that redirects the pointer of the program to the code line of the value that must be returned.
Such values are correlated with the direction of the turn of the motor in order to increase or decrease the air-oxygen mixture (Matiz et al., 2007).

AUTO-MIXER description
The system developed consists of a device that regulates the FiO2 administered to the patient through a mechanical valve.The first step is to get the signal from the patient´s pulse oximeter that measures oxygen saturation.The physiological signals obtained through a serial port in the pulse oximeter are interpreted, stored and digitally processed in an electronic circuit ruled by a microcontroller PIC18F452, which later transmits the data, receives the user desired parameters and executes the control actions on the blender (changes in the FiO2 that returns to the patient), (Matiz et al., 2007).
Finally, the user visualizes the set respiratory values and the saturation measured in an LCD display.Fig. 7 shows the diagram of the system.The parameters that the user can set through the keyboard are the maximum (MAX) and the minimum (MIN) values of oxygen saturation, the response time of the AUTO-MIXER (TO2) and the initial position of the blender (SpO2) that will be the starting point of the oxygen-air mixture with which the subject will start.
The oxygen saturation value taken from the pulse oximeter is referenced with the stored range and according to this, it either increases or decreases the FiO2 administered in order to stabilize the newborn (patient).
When the system is initialized it has a 6 second delay before beginning to measure the required data.This is a warranty that the measured value is a stable value in the patient.At this moment, it delays another 8 seconds and then carries out the next control action.
In case the patient is outside the reference range after 5 time cycles (40 seconds), a sound and visual alarm is generated.This is due to the fact that according to the physiological knowledge, when a patient does not recover in that time, other complications that demand an immediate reaction may be generating (Smith, 2000).

System performance tests
Several tests were carried out in order to verify the functionality of the system:

Matlab Simulation
In order to test the control system, a simulation with a Matlab tool called Simulink was carried out.The FIS was developed in Matlab with the fuzzy logic toolbox.
The equation of the process model is equivalent to a stable patient that reacts to an oxygen stimulus in 8 seconds.According to this, the approximate model for the patient is given by Equation 6: An integrator is used to guarantee that error, under stable conditions, is zero and therefore, be able to warranty the final stability of the patient.
The output of the compensator corresponds to a percentage of the oxygen injection that is done by opening the valve at a given percentage.This opening produces a change in the oxygen saturation of the patient, which is then fed back and compared with the reference saturation to produce the signal that is processed by the compensator.
Fig. 8 shows the result of the simulations.The X-axis corresponds to the time and the Y-axis corresponds to the oxygen saturation.The reference for the patient is a range of 80%, as seen in the continuous horizontal line.
From time 0 to 25 seconds, the stabilization of the output of the control system and the fact that both (patient and control system) remain at the reference level, can be observed.
A perturbation at 25 seconds was simulated, increasing the pa-tient´s saturation 10%; in other words, the patient´s saturation went from 80% to 90%.
Between 25 and 30 seconds the fuzzy control system causes the patient´s saturation to return to its reference in approximately 8 seconds as it is expected.

Pulse oximetry simulation in Turbo C
This test is done using a program that sends data every 2 seconds by the serial port simulating a pulse oximeter.
The test was developed using a maximum value of oxygen saturation equal to 95% and a minimum value of oxygen saturation equal to 85%.According to these values, the average that the user wants for the patient is 90%.The program that simulates a pulse oximeter sends a value under the desired range (SpO2=82%, hypoxemic patient), thus the output of the control system is to move the blender 5% to the right in order to increase the FiO2 administered from 80% to 85%; this opening of the blender will produce an increase of the SpO2 saturation in order to reach a value within the desired range.

Real Test
The study was designed in the following way: Forty children (gestational age, 25 +/-2 weeks and weight at birth, of 780 +/-130g), with frequent hypoxemic episodes.They were randomly divided into 2 groups.One group was the control group and the other was the experimental group.They were divided in 12 hour periods for the FiO2 adjustment by the medical staff (manual Blender) and the system was automatically set up (AUTO-MIXER), respectively with the full time supervision of a respiratory therapeutic technician.The test was carried out in one hospital.This test showed that, compared with the traditional method, the percentage of time was within the expected SpO2 range (85% -93%) increased during the use of the AUTO-MIXER (58% compared to 33.7%), while the percentage of time with the SpO2 above the expected range (>94%), was reduced (26.5% compared to 54.8%).The percentage of time with SpO2 < 84% was increased during the automatically set period (15.5% compared to 11.5%).
The medium FiO2 was lower during the automatically set period (37% compared to 44.13%, p<0.05).
All statistical analysis was performed with SPSS software, as shown in Fig. 9:

Conclusions
After of collecting more than 55000 SpO2 (24466 with actual blender, 32618 with AUTO-MIXER) measures, it has been preliminarily demonstrated that the AUTO-MIXER is an important tool to aid in the reduction of different pathologies.Additionally, it decreases the variability in oxygen saturation, as shown the standard deviation (5778 in AUTO-MIXER patients and less than 6374 in blender patients) in Fig. 10, and according to medical staff this is a critical parameter in oxygen-dependent patients.Fig. 10 shows a higher concentration of data around the mean (89.76%) and in a range of values clinically accepted by medical staff, most of them between 84% and 94%.This proved the theory stated by Doctors Eduardo Bancalari and Nelson Claure concluding that when the regulation of oxygen is applied in an automatic way, the patient stays within the desired ranges longer than outside (Claure, D'Ugard and Bancalari, 2010).
The control system developed by fuzzy logic has the advantage of allowing the medical staff to define the behavior of AUTO-MIXER, thanks to their way of representing knowledge implementing "natural human laws" (Kosko, 1991 ).The AUTO-MIXER becomes an important support tool for reducing the incidence of different diseases and reduces the variability in oxygen saturation and the FiO2 delivered, which results in reducing the high social and economic impact generated by these pathologies in society as evidenced by the results.

Figure 2 .
Figure 2. Block diagram of the fuzzy inference system.

Fig. 3
Fig.3shows membership functions for the first input of the FIS.

Figure 3 .
Figure 3. Membership functions for the first input (error)

Figure 4 .
Figure 4. Membership functions for the second input (DerSat)

Figure 6 .
Figure 6.Surface of the control system in 3DWith the advice of the medical staff at the Centro Médico Imbanaco and the medical staff at Hospital Universitario del Valle, 11 possible values were defined for the system output that range from -5% to 5%.Taking a coordinate of the inputs is possible to see the action of the resulting control and then, verify if this is in agreement with what is expected from the controller.The X-axis represents the

Figure 7 .
Figure 7. Diagram of the general operation of the system.

Figure
Figure 8. System simulation

Figure 9 .
Figure 9. Comparative percentages of using Auto Mixer and traditional method (Blender) for FiO2 adjustment

Figure 10 .
Figure 10.Comparison of the variability of mean oxygen saturation in an experimental group patient (AUTO-MIXER)