Identification and control of an oxygen provider system for a biological capsule

Abstract: Providing oxygen is a necessary process in manned missions to space. The aim of this paper is to identify the dynamics of an open loop control system in preparation for feature missions. A linear time invariant model is identified with data gathered from pre-flight tests of Kavoshgar, the Iranian bio-capsule. Numerical evaluation of the resulting model and its validation are given. The resulting time discrete model is used to drive the optimal setting that minimizes power consumption of the system.


PUBLIC INTEREST STATEMENT
This research is the first attempt to find a mathematical model for an oxygen provider system in a biological capsule. Using experimental data and methods of system identification, the relations between different environmental parameters of the capsule were formulated as a valid discrete linear dynamical system. Optimal control for minimizing the electrical power consumption was also studied. The results and methods may be used to increase the level of automation of the next generation of the biological capsules.
mission, and during special situations. This will result in a reduction of power consumption, weight, cost of materials, and provide better living conditions. In order to design such a controller, the dynamics of the system are required as the first step. The impact of the on/off switching on the current and feature levels of gases has to be known. This motivates our system identification approach to be able to estimate the system behavior via experimental data gathered during integration and final tests.
For some of the recent application of system identification, for example, Zhang, Wei, and Qi (2016) may be addressed, where, a recursive least-squares algorithm was used for online parameter identification and estimation of the amount of charge in lithium iron phosphate batteries. In Delpoux and Floquet (2015), an algebraic online parameter estimation method was proposed and applied to a permanent magnet stepper motor. A new class of non-linear fractional models based on the Volterra series was proposed by Maachoua et al. (2014) for modeling non-linear diffusive phenomena in order to estimate thermal parameters in cases where the temperature variations are large. In Wang (2015), a fast affine projection technique was applied for system identification of a DC-DC convertor in order to drive a novel adaptive control technique for the output voltage regulation of the convertor, and to improve its dynamic response.
In the present work, a linear time variant model is determined to simulate the system response.
The resulting system is marginally stable, and simulations show reasonable accuracy of the model. The model is also evaluated and validated with data-sets.
Finally, the optimal control of the resulting time discrete system is studied. The problem of optimal control leads to solving a linear programming problem with binary variables. Examining the optimal solution in test cases confirms the desired reduction in power consumption.

System description
One of the most important aspects of space missions for Kavoshgar is to investigate biological treatments and to develop life support systems for future projects. For this purpose, a biological capsule was designed to accommodate a rhesus monkey (Figure 1). This module contained life support equipments such as monitoring vital signals, isolation, seat, and an OPS. Obviously, any living being onboard the spacecraft consumes oxygen and produces CO 2 . For a 4 kg rhesus monkey, according to Bourne (1975), the rate of oxygen consumption is 51.7 ± 10.3 ml/min. In our test case, the CO 2 concentration when the monkey is in the biological capsule with closed doors grows from 400 to 6,000 ppm in 15 min when the oxygen provider system is off. This means that, the CO 2 production rate in an 80 L volume of the pressurized capsule is 29.86 ml/min. According to Rising and Lin (2013), the respiratory quotient of the rhesus monkey in an unstressed situation is 0.75. Then, the oxygen consumption rate for the monkey in the experimental test is 39.81 ml/min, which is in the theoretical range.
The aforementioned calculations show that a monkey consumes oxygen in its closed area at a rate of about 40 ml/min. Remembering the 5 h total mission time, 72 L of oxygen is needed, which is impossible to include from the mission onset: the capacity of the bio-capsule is 80 L, where the maximum fraction of initial oxygen can only be 25% of the total volume. This shows the existence of a system for CO 2 reduction and oxygen production is an essential requirement. To meet this requirement, a chemical reactor was developed for Kavoshgar project. It works based on the following chemical reaction, where sodium peroxide reacts with CO 2 to produce oxygen: With this reaction, the CO 2 produced by respiration reacts with Na 2 O 2 to make oxygen. As depicted in Figure 2, the system consists of three hollow cylinders. A fan in the bottom pulls air into the central cylinder. Then, air enters into the second part which is a porous medium filled with Na 2 O 2 granules. The chemical reaction (1) occurs in this section, and the clean air is withdrawn by the upper fan and enters back into the bio-capsule. (1)

Experimental setup
In order to gather data and identify the influencing factors of the capsule's environment, a series of test was performed. In these preflight tests, the monkey was in a sealed capsule similar to real flight conditions. All instruments and sensors were attached to the monkey and the capsule. Then, the onboard data-gathering system was powered up and recorded the environmental parameters and vital signals at a rate of one sample per minute. Data were also recorded by operators from portable metering devices in order to check the acquisition system. Table 1 shows the equipment which were used in this test.
In the first part of the sampling process, the OPS was off for the first 15 min and turned on for the remaining 65 min of the test. Data were gathered as is shown and studied in Section 4. Figure 3 shows a flowchart of the test process.

Environmental factors
In past missions, the system is powered on 30 min before launch up to the end of the mission (5 h). Test results show that the system is not necessarily working, and hence turned on, over the entire duration of the mission; indeed, it may be powered on and off in special circumstances. In order to find such time points, knowledge of the dynamics and characteristics of the system is required. The important environmental parameters are listed subsequently.

Oxygen
A correctly operating OPS increases the percentage of oxygen in the bio-capsule. In a functional system test with a monkey in its seat and with closed doors, the OPS is first turned off for 15 min, whereby it is turned on to measure the amount oxygen and CO 2 changes. During this test, data from onboard sensors was recorded every minute as shown in Figure 4. In the first part, i.e. without oxygen production, the oxygen levels decreased from 22 to 21% because of the monkey's breathing. After turning on the OPS, oxygen was produced and its percentage increased up to 25% at the end of the first hour of OPS operation. As oxygen levels over 25% are harmful for the creature, is it necessary to power off the OPS at some time based on knowledge of the system's dynamics, which will be determined via system identification.

Carbon dioxide
In the aforementioned experimental test, the amount of CO 2 was also measured, see Figure 5. As can be seen, up to the 15th minute of the test, i.e. when the OPS was turned off, the density of CO 2 increased due to the animal's breathing. When oxygen production started, the amount of CO 2 decreased based on reaction (1). In a 1 h test, the CO 2 amount decreased from 4,500 to 380 ppm.

Temperature
The reaction (1) is exothermic and adds heat to the bio-capsule. As is shown in Figure 6, during a 80 min mission, the temperature increased from 29 to 35.5 • C. Therefore, based on the linear behavior of temperature, for a full mission, an increase of about 24 • C is expected, which may be harmful for the monkey when the oxygen provider is working all the time and when finding the payload takes a long time.
It should be noted that there are other heat sources, such as the monkey itself, electrical equipment in the capsule, and lighting. However, the quota of the oxygen provider is considerable, and designers are interested in identifying the relationship between the temperature changes caused by the OPS and other parameters via the experimental data used in this paper.

Pressure
Internal pressure of the bio-capsule is another key parameter affected by the operating OPS. As shown in Figure 7, the process of converting CO 2 to oxygen increases the internal pressure. In our test case, the pressure grew from 920 to 936 millibar in 16 min. This shows that the pressure increases 1 millibar per minute when the OPS is working continuously.

Humidity
The exothermic behavior of reaction (1) causes a reduction of humidity in the bio-capsule, while the respiration of the monkey increases it. However, the drying attributed to the oxygen provider overcomes the effect of respiration to the overall humidity. Figure 8 shows the percentage of humidity in an experimental test. In this test, the OPS was powered off from begin up to 15 min, then it was powered on for 1 h. Results show that the humidity increased from 21 to 34% when the OPS was

Pressure(mbar)
switched off. This increase was due to the respiration of the animal. When the OPS was powered on, the humidity decreased as expected, from 33 to 8%. During this phase, the dominancy of the OSP to the monkey respiration toward air-drying is proved. It is clear that when the mission takes a long time, the humidity in the bio-capsule drops. It should be noted that humidity is also influenced by temperature, the amount of CO 2 and oxygen in the air, and the internal pressure.

Correlations
A quick view of the aforementioned graphs (Figures 4-8) indicates that there are some relationships and dependencies between the related parameters. The internal temperature and pressure, for example, seem to increase at the same rate. Humidity and CO 2 both decrease, and it seems that they are correlated with each other. To illustrate the quantitative measure of such dependencies, one may use the cross-correlation coefficient between each pairs of experimental data, which is defined as: where x stands for the average of x. The cross-correlation coefficient ranges from −1.0 to +1.0.

Humidity(%)
This shows that, for the above example, the CO 2 density and humidity percentage are highly correlated with each other, while the humidity and temperature are negatively correlated with each other. This shows the dependency of these quantities within the closed environment of the biocapsule. A mathematical model that describes hidden relations in this system via mathematical expressions is presented in Section 5.

System identification
As mentioned previously, a system identification method was used to describe the dynamics of the OPS as mathematical relations. First, the input and output signals are defined. Let us assume that u(t) is the on-off situation of the OPS at time t, which is considered as the input of the system. It is a Bang-Bang control with 0-1 values as: There are five components of the output vector: With a degree of 5, there are 60 unknown coefficients in matrices A, B, C, and D which have to be determined in such a way that the resulting system estimate matches the experimental data. Data were gathered when the OPS was off for 15 min, and then turned on for 60 min. As such, the response of the system to a step input, as in Figure 9, is available for identification. The parameter estimation method (Ljung, 1999) was used to find the model parameters. It is assumed that vector Z shows all experimental data, and shows all unknown parameters. The related error of an individual parameter is defined as: where y(t) is the experimental value, and ŷ(t) is its related estimation. In the case of this research, a set of data gathered during an experimental preflight test for N = 80 min was used. The sampling rate was one sample per minute. In addition to recording the sensor data with the data acquisition system, samples were checked with an analog thermometer, barometer, and CO 2 indicator. Therefore, with 80 samples in each of the five channels in (4), the vector Z = [y(t 0 ), y(t 1 ), … , y(t 79 )] is ready. Then, the vector of parameters * has to be determined in such a way that (t i , ) in (7) is zero for all samples. However, with 60 unknown parameters and 80 equations, this is an over-determined linear system. An efficient method for solving such a system is to use the least-squares method in which the following average norm of errors has to be minimized: (4) y(t) = (y 1 (t), y 2 (t), y 3 (t), y 4 (t), y 5 (t)) T (5) The total error function of (8) was minimized using the least-squares method proposed in Farahi, Fahimian, and Nazemi (2008). The matrix coefficients were found as:

Stability
To study the stability properties of the resulting linear time invariant system, the magnitude of the eigenvalues of matrix A were calculated, and found to be 1.0001, 0.9241, 0.8231, 0.8231, 0.5120. Since these eigenvalues are in the unit circle or on its boundary, the system is marginally stable (Boom, 2006). This means that if an impulse of finite magnitude is given as input, then the system will not give an unbounded output, but neither will the output return to zero.

Validation
To check the validity of our results, the estimation was calculated using the input signal of the experiment and comparing the estimated and actual data. To start the simulation, initial parameter values are needed. From the experimental data, y(0) = (22, 1000, 21, 29, 920) T . Therefore, the related initial value for the state vector was calculated as:

Control Input
In Figure 10, the simulated oxygen percentage is shown. It is clear that the simulated output of the resulting system tracks the data well.
A similar graph of the CO 2 density is also depicted in Figure 11. The simulation coincides with the experimental data for the first 20 min, and after that an acceptable trend is observed. Figure 12 shows the experimental and estimated humidity in the capsule. As can be seen, the founded model estimates this quantity well.

Experimet Simulation
The model also estimated the temperature and pressure, as can be seen in Figures 13 and 14. For the final course of pressure, the model over-estimates the pressure by 15%, but still maintains the general trend, which has an acceptable accuracy.

Optimal control
The system response to the two possible step functions u = 0 and u = 1 were obtained as depicted in Figure 15. When the OPS was off, the CO 2 level reached and stayed at 6,000 ppm, which coincides well with the experimental results.
The aim of the optimal control was to keep the gases and environmental levels at a desired level, while minimizing the power usage by switching the OPS on and off.
It is to be noted that open loop control is preferred to closed loop control because the latter needs to measure the level of gases and environmental factors, where, low reliable sensors, will affect the control loop.
With regards the problem of power and energy minimization, the objective usually has a quadratic form. However, in the present case, as the control values are binary u(t) ∈ {0, 1}, the quadratic form is equivalent to the linear one. Therefore, the objective function here is considered as a weighed summation of the control values, as follows, in discrete form, which is to be minimized: Here, r(t), t = 0, 1, 2, … , N are positive weights. There are also possible constraints on the responses: where y min and y max are vectors of the lower and upper limits on the responses of system (5)-(6), respectively. Given an initial value of x(0) = x 0 , using a procedure similar to the one presented in Goodwin and Seron (2005), and including Equation (5), the state vector x t = x(t) which is related to the unknown input u t = t(u) is obtained as: y min ≤ y(t) ≤ y max ,

Experimet Simulation
The aforementioned equation may be written in matrix form as follows: where, = Γ + Ωx 0 , Therefore, from (6) and (12), the vector of the system's responses is calculated as: where diag(D) is a block diagonal matrix with D as its diagonal entries, and multiplication of C to Γ and Ω is performed in a component-wise manner. The constraints may also be written as: Now, merging (13) and (14) results in: where, Therefore, the problem of optimally controlling the power consumption is reduced to the following integer linear programming problem with 10N constraints: where = [r(0), r(1), … , r(N − 1)]. The only decision variable in this linear programming problem is vector with N components. After solving this problem, the optimal control will be found.
≤ y max , − ≤ −y min . The problem was solved with the branch-and-bound algorithm in N = 100 min, r(t) = 1, t = 0, 1, … , N, and a set of parameters as shown in Table 2. In the first simulation, the upper bound for CO 2 is 4,000, the optimal objective function is eight which is 92% lower than the case when the OPS is working continuously during this time period. Figure 16 shows the control function, and the system responses to it including CO 2 and oxygen levels and temperature. As it can be seen, the resulting optimal control has an off-on-off form with 16 switches between the on and off positions.
In the second case, the upper bound for CO 2 is set to 3,000 ppm, therefore, more working periods of OPS was expected to keep the CO 2 level below 3,000 ppm with respect to the first case.
As depicted in Figure 17, the control function has more switches. The optimal objective, as expected, increases to 36 which is 42% lower than full working of OPS. This means that when using the resulting control function, the power consumption reduces by 42%, while the CO 2 level does not grow over 3,000 ppm.
In the third run, the upper bound of CO 2 was set to 2,000 ppm. The results are shown in Figure 18.
The objective reduced to 51 with 100 switches.

Averaging approach
When solving (16), it was seen that the control function has many switches, especially when the CO 2 upper bound decreased. In cases such as a sequence turning on and off what is undesirable, the averaging approach may be applied. In this case, the upper bound on each element of is set to the relating average. For example, for CO 2 , the present constraints in (10) are However, in averaging approach, they read as: where, y min ≤ y 2 (t) ≤ y max , t = 1, 2, ⋯ , N. (18) y min ≤ y 2 ≤ y max , t = 1, 2, ⋯ , N,  Therefore, the linear programming problem (16) is changed to an averaged form as follows: Here the number of constraints was reduced to five, and each of them is related to one of the parameters of Table 2.
The problem (20) was also solved for the same values used in the non-averaged method. The results for a CO 2 upper bound of 2,000 ppm are shown in Figure 19, for example. It is clear that the control function does not have the same fluctuations as seen in Figure 18 and there are only two switches, while the average CO 2 level remained below the upper bound. In order to compare the averaged and non-averaged approaches, in Table 3    (WCT) that measures the running time for solving the related LP problem. As is expected, because of the reduction in the number of constraints in (20), solving the averaged problem is very fast with respect to the non-averaged method. The number of switches is also reduced to two in all three cases. The objective function and power consumption is also better than in the non-average case. The last column shows the improvement in power consumption with respect to the case of a fully operating OPS.
It should be noted that the solution of the averaged approach will violate the upper and lower bound, but remains in the region in an average meaning.

Conclusion
A linear time invariant model was obtained to describe the governing dynamics of an OPS for a space bio-capsule. Our chosen parameter estimation method was based on system identification theory. The resulting model was also validated via experimental data. Finally, the model was used to design an open loop controller. Simulations show that with the obtained optimal control, the desired environmental conditions are preserved and electrical power consumption is reduced.