Computers and Chemical Engineering 157 (2022) 107625 Contents lists available at ScienceDirect Computers and Chemical Engineering journal homepage: www.elsevier.com/locate/compchemeng Hierarchically controlled ecological life support systems Carles Ciurans a,b,∗, Najmeh Bazmohammadi c, Laurent Poughon b, Juan C. Vasquez c, Claude G. Dussap b, Francesc Gòdia a, Josep M. Guerrero c a MELiSSA Pilot Plant-Claude Chipaux Laboratory, Escola de d’Enginyeria, Universitat Autònoma de Barcelona, Carrer de les Sitges, Cerdanyola del Vallès, Spain b Institut Pascal, Campus Universitaire des Cézeaux, 4 Avenue Blaise Pascal, 63178 Aubière, France c Centre for Research on Microgrids (CROM), Aalborg University, AAU Energy, Denmark a r t i c l e i n f o a b s t r a c t Article history: Life support systems (LSSs) are autonomous systems integrating various generation, recycling, and con- Received 4 June 2021 sumption subsystems with storage capability to maintain the balance of key system compounds. A novel Revised 11 November 2021 hierarchical control is proposed in this paper to operate an exemplary controlled ecological LSS. The study Accepted 2 December 2021 focuses on the control of O2 concentration in the crew compartment, as the main consumer of a LSS, Available online 5 December 2021 while coordinating a network of biological compartments with a variety of generation, consumption, and Keywords: storage capabilities. A concentrated gas buffer tank is included in the system to demonstrate its capability Hierarchical control structure to support the system operation flexibility and efficiency. Simulation analyses for changing O2 demand Controlled ecological life support systems scenarios are carried to assess the proposed control architecture performance. Model Predictive Control © 2021 The Authors. Published by Elsevier Ltd. Optimization Problem This is an open access article under the CC BY license (http://creativecommons.org/licenses/by/4.0/) MELiSSA Pilot Plant 1. Introduction vide advanced solutions for the severe challenges faced on Earth such as climate change and CO2 accumulation, depletion of nat- Life support systems (LSSs) are designed to provide the re- ural resources, clean water scarcity, or food crisis (Nelson et al., quired environment for human beings to survive in outer space 2003). Controlled ecological LSSs (CELSSs) are LSSs driven by the or isolated environments (Jones, 2003). The main objectives of use of artificial ecosystems based on advanced control strategies LSSs are to regenerate the atmosphere, recycle water, supply the to guarantee its long-term operation and including the provision required amount of edible material to sustain human life, and of food, which is not possible with purely physicochemical LSSs process the waste generated in the system to provide maximum (Schwartzkopf, 1992). The most advanced human-made CELSS in- self-sustainability. LSSs were initially developed by space agencies clude ALSSTB (Texas, US), Biosphere-2 (Arizona, US), CEEF com- to enable life in space due to their capability to self-regenerate plex (Rokkasho, Japan), and MELiSSA (Micro-Ecological Life Support residues using physicochemical technologies. Current LSSs are par- System Alternative (Gòdia et al., 2004)) with a pilot plant facil- tially Earth-dependent as it happens in the International Space ity (MELiSSA Pilot Plant) implemented at Universitat Autonoma de Station (ISS), with a scheduled re-supply of food and fresh wa- Barcelona, Spain. ter from Earth based on the crew needs. On average, an astro- To have an operative CELSS, several complex subsystems need naut consumes 0.835, 3.909, and 0.617 kg per day of O2 , water, to be designed and integrated to achieve an operational loop satis- and food, respectively (Ehlmann et al., 2005). The journey to Mars, fying many strict requirements. In this sense, a significant concern which is calculated to last up to 1100 days, makes it impossi- in integrating different biological subsystems is related to design- ble to embark all crew needs due to the associated cargo load ing an efficient, reliable, and dynamic control system that can ful- (Barta, 2017). Therefore, the future of space crewed missions, in- fill system requirements and guarantee its performance and long- cluding the sustainable and long-term presence on Moon and Mars term operation. Among the difficulties presented by this control surfaces, will require the capability to sustain life autonomously problem, the different time constants of each compartment, the (Gitelson and Lisovsky, 2002; Gòdia et al., 2004; Nelson et al., non-linearities found in the models, and especially the high degree 2010; Schwartzkopf, 1992; Sulzman, 1994). LSSs can also pro- of coupling between the variables to control are remarkable. In 1991, Biosphere-2 experiments proved the importance and challenges of the controllability of CELSSs as microorganisms in ∗ Corresponding author. the soil grew and released CO2 into the atmosphere in an un- E-mail address: Carles.Ciurans@uab.cat (C. Ciurans). controlled way, exceeding the capacity of plants to revitalize the https://doi.org/10.1016/j.compchemeng.2021.107625 0098-1354/© 2021 The Authors. Published by Elsevier Ltd. This is an open access article under the CC BY license (http://creativecommons.org/licenses/by/4.0/) C. Ciurans, N. Bazmohammadi, L. Poughon et al. Computers and Chemical Engineering 157 (2022) 107625 Nomenclature of y to refer to biomass. Superindex I {A, Bn, C, in, out, r} provides information about the local- Indexes ization within C3 reactor [g L − 1 ] d Phase: gas (g) or liquid (l) μzx Specific growth rate of strain x [h − 1 ] in com- x Strain (i.e. L. indica, N. winogradskyi, N. europaea) partment z y Compound index (i.e. O2 , CO2 ) μz,x max Maximum value of μzx [h − 1 ] y z Compartment index (C3, C4a, C5, membrane sepa- Kx,g/m Saturation constant of compound y for strain x. ration, concentrated gas tank, diluted gas tank) Subindex g/m refers to growth/maintenance [g n C3 vol section n {1..5} L − 1] i, j, m Current sampling point at different control levels dx Death rate of strain x [h − 1 ] (3,2,1) mx Maintenance rate of strain x [h − 1 ] nom Nominal point ϕyz Gas-Liquid transfer rate of compound y in com- re f Reference partment z [g L − 1 h − 1 ] Sensor measurement. Ex. Cyz |d represents the mea- p p KL az Gas-liquid transfer coefficient (reactor design pa- sured value of Cy |d z rameter) in compartment z [h − 1 ] qy Partition coefficient of compound y Concentrated Gas Tank Parameters ∗ Cyz |d Saturation concentration of compound y in z (l SCT, re f Normalized reference level of the concen- indicates liquid phase) [g L − 1 ] trated gas tank Yy , Yield of compound y over x. A subindex g/m can SCT,max / SCT,min Normalized max/min level of the concen- x g/m trated gas tank be included referring to growth/maintenance SCT Normalized level of the concentrated gas yz Limiting factor associated to substrate y at com- tank partment z PCT, max Total maximum pressure of concentrated gas Compartment C3 Parameters tank [Pa] ε Bead void volume PCT Total pressure of concentrated gas tank [Pa] εL Liquid fraction of bed GCT /DT Concentrated/Diluted gas tank εG Gas fraction of bed discharging(+)/charging(-) rate [L h − 1 ] VA/Bn/C Volume of fraction A/ B, section n/C [L] GCT,max / GCT,min Maximum concentrated gas tank discharg- f Liquid fraction of flow F back-mixed ing/charging rate [L h − 1 ] f Gas fraction of flow F back-mixed V CT Volume of the concentrated gas tank N Rate of moles [mole h − 1 ] Compartment C4a Parameters T Temperature [K] R Radius of the bioreactor [m] R Gas constant [J K − 1 mol−1 ] W Light intensity [W m − 2 ] nom Wday/night Day/night nominal light intensity [W m − 2] Internal Model Parameters − 2] Kj Saturation constant for light [W m fy Dilution factor in the membrane separation for O2 , α, δ Radiative properties accounting for the absorption CO2 , and N2 compounds and scattering cross section of the cells and the All Compartments fraction of radiant backscattered energy φyz |I Rate of reaction of compound y in compartment Compartment C5 parameters z (subsection I {Bn } for C3) [g L − 1 h − 1 ] respC5 Respiration rate of compound y in C5 [mole h − 1] y φx z Growth rate of strain x in compartment z [g L − 1 h − 1] Controller parameters z Fin/out,I Input/output liquid volumetric flow in compart- QOC42a Span of the C4a production rate [g h − 1 ] ment z. Subindex I {A, Bn, C, in, out, r} provides CO2 |zg Span of O2 concentration in gas phase in com- information about the flow localization within C3 partment z [%] reactor [L h − 1 ] GCT Span of the gas flow from CT [L min−1 ] z Gin/out, I Input/output gas volumetric flow in compartment ρ Dispatch factor GC4 in a /GC5 out z. Subindex I {A, Bn, C, in, out, r} provides infor- ρ /ρ max min Max/min dispatch factor mation about the flow localization within C3 re- λi The ith weighting factor actor [L h − 1 ] DzO O2 consumption rate of compartment z [g h − 1 ] 2 My |d z in/out Input/Output mass flow of compoun(4d y in NPi /NCi Prediction/Control horizon at the ith control level phase d in compartment z [g L − 1 h − 1 ]. Ex- Tm,PF Ci First order process time constant, ith control level tra superindex in can be included if referring to PFC [h − 1 ] input mass flow. Km,PF Ci First order process gain, ith control level PFC Qyz Production rate of compound y in compartment z Ts,i Sampling time at the ith control level [h] [g h − 1 ] CLRTPF Ci Closed loop response time at the ith control level Qyz, max/min Max/min production rate of compound y in com- PFC MV Manipulating Variable partment z [g h − 1 ] Cyz |d Concentration of compound y in phase d in com- Acronyms partment z [g L − 1 ] CELSSs Controlled ecological LSSs Cyz |Ig Concentration of compound y in phase d in in- HCS Hierarchical control structure flow/outflow of compartment z. x is used instead ISS International Space Station 2 C. Ciurans, N. Bazmohammadi, L. Poughon et al. Computers and Chemical Engineering 157 (2022) 107625 centration in the crew compartment ensuring the survivability of LSS Life support systems the crew through coordinating the operation of different available MELiSSA Micro-Ecological Life Support System Alternative resources. A concentrated gas tank is included in the system to MG Microgrid demonstrate its capability to support the system’s operation flexi- MPC Model Predictive Control bility and efficiency. MS Membrane separation It should be noted that power and thermal subsystems also play PFC Predictive functional controller important roles in a CELSS to provide the required energy to sup- VR-MPC Varying-resolution MPC port different equipment operations and to maintain the temper- PQ Photosynthetic quotient ature and humidity of different compartments within the desired boundaries. However, this paper only focuses on the mass balance and O2 control of the CELSS, and integrating energy and thermal air while making the atmosphere unbreathable for the inhabitants subsystems will be a future study of the authors. (Nelson et al., 2003). In one of the longest runs of a CELSS test pro- The rest of this paper is organized as follows: Section 2 is de- moted by NASA in 1998, which included air revitalization coupled voted to the introduction of the selected case study and mathe- to food supply from crop culture and waste processing, the need matical representation of its different subsystems. The outline of for an integrated control system appeared to be essential to reduce the proposed HCS is presented in Section 3 while discussing dif- crew and ground personnel intervention time (Nelson et al., 1993). ferent control levels and associated methodologies, objective func- A recent integration attempt in the MELiSSA Pilot Plant succeeded tions, and constraints. Simulation results are presented and dis- to provide revitalized air to the crew compartment solely from a cussed in Section 4. Finally, concluding remarks are given in Sec- photosynthetic compartment under the control of a Master-slave tion 5. predictive functional controller (PFC) in operation during 50 days (Alemany et al., 2019). This represents an inspiring basis to de- 2. Mathematical representation of the Melissa loop sign an advanced control system to integrate other compartments in the loop while supporting its performance. MELiSSA is a CELSS made of a network of five biological com- Current LSS strategies in ISS does not include the production partments with limited matter exchange with the outside environ- of edible material, but only the environmental control based on ment (Fig. 1) including an anaerobic reactor that converts resid- the O2 generation and CO2 removal. However, to improve the recy- ual wastes into CO2 and volatile fatty acids called C1; a photo- cling capacity extending it to all metabolic wastes generated by the heterotrophic compartment that converts the volatile fatty acids crew, it is mandatory to produce edible material that makes the into CO2 (C2); a nitrification reactor that consumes O2 to convert use of photosynthetic compartments essential. This is the strategy ammonium and urea into nitrate (C3); a photobioreactor that uses followed by CELSS, which integrates photosynthetic compartments cyanobacteria to convert CO2 and inorganic nitrogen into edible providing high levels of recycling and autonomy. In CELSS, sunlight material and O2 (C4a); and a higher plant chamber that is used represents the only fully available external resource, but in terms to grow crops converting inorganic nitrogen and CO2 into edible of mass exchange, a full closeness is expected. material and O2 (C4b). All these compartments need to be coor- In a CELSS, the limited degree of freedom, reduced size of the dinated to guarantee a safe environment for the crew compart- physical system, presence of multiple producers and consumers, ment (C5) through the supply of O2 , water, and nutrients, air re- tight technical and operational restrictions, and different dynam- vitalization, and waste processing. MELiSSA loop should also ex- ics interacting within and between compartments result in a com- ploit the sunlight through the biosynthetic reactions, maximize re- plex control problem. However, there are other existing complex action yields, minimize the overall hardware mass and the energy systems such as microgrids (MGs) that share similarities with LSSs expenditure, and guarantee the crew safety among other life sup- and can inspire their control design and resource allocation. port requirements provided in the ALISSE criteria (Brunet et al., MGs are known as local aggregations of distributed energy re- 2010). The part of the process that is studied in this paper is rep- sources, energy storage systems, and loads with the capability of resented in Fig. 2, which reproduces the current integration phase operating in both grid-connected and standalone modes. MGs are of the MELiSSA Pilot Plant, comprising C3, C4a, and C5 along with responsible to locally solve energy balance problems by controlling two gas buffer tanks. C3 and C4a are connected through the liquid a variety of distributed energy resources and storage systems char- phase while C3, C4a, C5, and the gas storing tanks are connected acterizing different dynamical behavior. The main goal is to sup- through the gas phase. ply MGs consumers with sustainable, reliable, and cost-effective As can be seen in Fig. 2, starting from C5, the gas outflow of energy and ensure optimal resource utilization through solving this compartment (GC5 out ), containing gas compounds with specific multi-time scale multi-objective control tasks while considering a concentrations is split into two flows going to C4a (GC4 in a ) and the number of operational and technical constraints and uncertainty at MS membrane separation unit (Gin ) whose output is a concentrated both demand and supply sides. (GC ) and a diluted (GD ) O2 flow. A specific fraction of the concen- The similarities between MGs and specially islanded MGs and trated gas flow is the input of C3 (GC3 ) that is determined based in CELSS are considerable, including the existence of multiple sup- on the amount of ammonia to be oxidized in the liquid inflow be- pliers and consumers, the uncertainties in the consumption and ing fed to C3 (FinC3 ). The other fraction (GC − GC3 ) is sent back to C5 in production patterns, the need to control optimally the elements and can be used to fill the concentrated gas tank. The gas outflow involved in the loop, the importance of storage management as of C3 (GC3 C4a out ) and C4a (Gout ) are sent back to C5 together with the well as the key role of sun-derived energy, among others. The ac- gas flows coming from the membrane separation closing the gas cumulated experience and success of MGs management offers the loop as shown in the following equations. possibility to apply their advanced control approaches in CELSSs operation as already explored in Ciurans et al. (2021). A compari- GC5 C4a C3 D in = Gout + Gout + Grich + G + G DT (1) son between the two systems is presented in Fig. 1. In this sense, this paper extends the hierarchical control (Vasquez et al., 2010)   Grich = GC − GC3 in + G CT (2) and energy management of MGs to CELSS using the MELiSSA Pilot Plant, as a case study (Gòdia et al., 2004). The study focuses on de- The gas buffer tanks are appropriately sized to satisfy the O2 veloping a hierarchical control structure (HCS) to control O2 con- demand of one human for 24 h with a maximum pressure of 3 C. Ciurans, N. Bazmohammadi, L. Poughon et al. Computers and Chemical Engineering 157 (2022) 107625 Fig. 1. An exemplary life support system (left) and a Microgrid (right). Fig. 2. The layout of the system under study. 50 bar and 10 L of volume. Considering that the MELiSSA Pilot dence times (5 – 80 h) (Pérez et al., 2005a), while C4a and C5 Plant has not yet integrated the higher plant chamber (C4b), which models were evaluated in two 50 and 30-day integration tests by represents the main producer of O2 , only 3 rats (out of the max- applying step changes to O2 setpoints (19–22%) of the crew com- imum capacity of C5 of 40 rats, approximately equivalent to one partment (Alemany et al., 2019). Interested readers are referred to human in terms of physiological needs) are inhabiting C5, which (Cornet et al., 1995; Cruvellier et al., 2017; Dauchet et al., 2016; have an O2 consumption rate that can be supplied solely by C4a. Poughon et al., 1999) for more information. Currently, the liquid phase loop is still not closed, but its closure is The process described in Fig. 2 operates in a continuous mode expected in the upcoming MELiSSA Pilot Plant activities. for both the liquid and gas phases. Thus, the law of conservation Non-linear mechanistic models are available for each of these of mass needs to be satisfied in each of the biological compart- compartments validated with massive experimental data obtained ments C3, C4a, and C5. Each compartment includes several com- in the MELiSSA Pilot Plant testing campaigns. C3 model was val- pounds from a list of 23 compounds including H2 O, NH3 , H2 SO4 , idated and calibrated in a 120-day standalone experiment using H3 PO4 , HNO3 , HNO2 , Urea, O2 , CO2 , Acetic, Propionic, Butyric, Va- step changes of ammonium loads (0.3–0.6 g N–NH4/L) and resi- leric and Caproic Acid, N2 , H2 , CH4 , Inert gases, Organic Matter, Ni- 4 C. Ciurans, N. Bazmohammadi, L. Poughon et al. Computers and Chemical Engineering 157 (2022) 107625 trosomonas, Nitrobacter, Rhodobacter, and Limnospira Biomass. Ac- cordingly, instead of introducing the dynamical equations of in- dividual compounds of each compartment, the general governing equations of each compartment will be introduced. A bioreactor working in continuous mode with a biochemical transformation of compound y can be defined with the following generic form: C˙ yz |d = Myz |in d − M y | d + φy + ϕ y z out z z (3) φxz = μzx · Cxz |l (4) μzx = μz,x max · yz − dx (5) Cyz |l yz = (6) Cyz |l + Kx,g y φyz = φxz · Y yx (7) Notice in (4)-(7), rate of reaction (φyz ) only affects the liquid phase, being the rate of reaction zero in the gas phase. According to (3), the changes in the concentration of the yth compound (C˙ yz |d ) in compartment z in phase d (gas/liquid) is specified by the mass Fig. 3. Illustration of the design of Compartment 3. inflow (Myz |in d ) and outflow (Myz |out d ), the rate of reaction (φyz ) and the phase exchange rate (ϕy ) in the associated compartment. In z case of multiple substrates, (6) is modified to include the product The dynamical evolutions of parts A, B, and C of the compart- of all participating substrates and  z is defined for Ny compounds ment in both liquid and gas phases are derived by the following as follows: general equations where Fint C3 /GC3 is the sum of liquid/gas inflow to int C3 (FinC3 /GC3 ) and recirculation liquid/gas flux (FrC3 /GC3 r ) (Pérez et al., Cyz |l Ny  in z = (8) 2005b; Poughon et al., 1999): Cz y=1 y l | + Kx,g y Part A To obtain the production and consumption rates including VA · (1 − εG ) · C˙ yC3 |Al = FinC3 · CyC3 |in l + FrC3 · CyC3 |rl maintenance costs, expression (7) becomes: − Fint · ( f + 1 ) · Cy |l − f · Cy |l C3 C3 A C3 B1 (12)   + VA · (1 − εG ) · ϕyC3 μ z,max x · Cyz l | | mx · Cyz l φyz = · Y y ,g + · Y y ,m · Cxz |l (9) | y Cyz l + Kx,g x | y Cyz l + Kx,m x VA · (1 − εL ) · C˙ yC3 |Ag = GC3 in · Cy |g + Gr · Cy |g C3 in C3 C3 r The gas-liquid transfer rate defined by ϕyz takes the following    form: −GC3 int · f  + 1 · CyC3 |Ag − f  · CyC3 |Bg 1   ϕyz = KL az · Cyz |l ∗ − Cyz |l (10) −VA · (1 − εL ) · ϕyC3 (13) Cyz |l Part B ∗ Cyz |l = (11)  qy VBn · ε · (1 − εG ) · C˙ yC3 |Bn l = Fint · ( f + 1 ) · Cy |l C3 C3 Bn−1   Notice that considering the continuous mode of operation of + f · CyC3 |Bn l +1 − ( f + 1 ) · CyC3 |Bn l + f · Cy |l C3 Bn the compartments and assuming that the biochemical transforma-   tion that takes place does not imply density changes in either of + VBn · ε · (1 − εG ) · φyC3 |Bn + ϕyC3 (14) the liquid or gas phases, the volumetric input and output flow is maintained, i.e. Gzin = Gzout and Finz = Fout z .   VBn · ε · (1 − εL ) · C˙ yC3 |Bn C3 g = Gint · f  + 1 · CyC3 |Bn g −1 + f  · CyC3 |Bn g +1    2.1. C3 Compartment model − f  + 1 · CyC3 |Bn  g + f · Cy |g C3 Bn − VBn · ε · (1 − εL ) · ϕyC3 (15) The design of C3 is based on a packed-bed reactor with im- mobilized cells that carry the oxidation of ammonia to nitrate by Part C   ammonia-oxidizing Nitrosomonas europaea and nitrite-oxidizing Ni- VC · (1 − εG ) · C˙ yC3 |Cl = Fint C3 · ( f + 1 ) · CyC3 |Bl 5 − f · CyC3 |Cl trobacter winogradskyi. To capture properly the C3 dynamics, the total module is discretized in seven volumes as shown in Fig. 3. − FrC3 · CyC3 |Cl − Fout C3 · CyC3 |Cl In this figure, VA and VC are the volumes at the top and bottom of + VC · (1 − εG ) · ϕyC3 (16) the reactor, which are used for probe location, gas, and liquid inlet, recirculation and outlet flows, but where no reaction takes place.    VB includes the packed-bed part of the bioreactor where cells are VC · (1 − εL ) · C˙ yC3 |Cg = GC3 int · f  + 1 · CyC3 |Bg 5 − f  · CyC3 |Cg immobilized and the reaction takes place. VB is discretized in five − FrC3 · CyC3 |Cg − GC3 out · Cy |g C3 C parts to cope with the hydrodynamics and to account for non-ideal liquid mixing for implementing the reaction kinetics. − VC · (1 − εL ) · ϕyC3 (17) 5 C. Ciurans, N. Bazmohammadi, L. Poughon et al. Computers and Chemical Engineering 157 (2022) 107625 2.2. C4a Compartment model 2.5. Storage Gas tanks The hydrodynamic pattern of C4a is approximated to a perfectly The concentrated gas tank can be charged or discharged accord- mixed photobioreactor, which is responsible for the conversion of ing to the O2 needs of the overall system. The mission of the con- CO2 from C5 and nitrate from C3 into O2 and biomass for human centrated gas tank is to store concentrated O2 to support C4a for consumption while the reaction is controlled by light when no supplying O2 to the system. The ideal gas law is supposed to apply substrate is limiting. The reaction is carried by the cyanobacteria for the gas in the tank to calculate the rate of moles (N) introduced Limnospira indica. The general mass balance equation for this biore- or removed during charging and discharging periods as shown be- actor is given in (3). The growth rate term in C4a is slightly differ- low: ent from (4) as light energy transfer is considered a rate-limiting PCT · GCT process (Cornet et al., 1992). The following equation is used to cal- N= (26) R·T culate the growth rate of L. indica and consumption or production The normalized state of storage of the gas tank is calculated as rates of compound y: follows: 1 R 4π Jr PCT φxC4a = μC4 a, max ·  C4a · ∫ 2π r dr (18) SCT = (27) x π · R2 Ril K j + 4π Jr PCT,max To maintain the mass flow in the loop, a diluted gas tank is φyC4a = φxC4a · Y yx , g (19) included in the model as can be seen in Fig. 2, whose function is to release gas when the concentrated gas tank is filled and to be In (18), Ril is the illuminated radius defined as the photobiore- filled when the concentrated gas tank is emptied. actor radius where light reaches the compensation point. In addi- tion, Jr represents the profile of the light radiant energy and it is 3. Method: HCS of the Melissa pilot plant expressed as a quotient of the modified Bessel functions of the first kind as follows: In this Section, the hierarchical control and energy management W · I0 (δ · r ) strategies of MGs are extended to CELSS. In general, MGs control is Jr = (20) I0 (δ · L ) + α · I1 (δ · L ) organized in a hierarchical structure including three control levels, namely primary, secondary, and tertiary. The primary control level In (20), α and δ characterize the radiative properties of L. in- is responsible for voltage/frequency regulation and power sharing dica. The term  C4a introduced in (8) considers the use of H2 NO3 , among distributed resources and features the fastest control re- H3 PO4 , and CO2 as substrates (Alemany et al., 2019). sponse. The secondary controller is responsible for restoring volt- age/frequency to their nominal values while maintaining them in 2.3. C5 Compartment model the permissible boundaries. Finally, the tertiary control level at the top of the hierarchy and with the largest time scale is responsible The dynamical model of compartment C5 takes into account for optimal system operation and guaranteeing long-term efficient, the respiration dynamics of the crew (respC5 y ), which, as mentioned economic, and resilient operation of the system. above, is simulated by a group of three rats. It should be men- Similarly, in a CELSS, to accommodate different time scales of tioned that no liquid phase in C5 is considered in the simulation the various processes in the loop and considering the complexity presented in this study. The general equation for the respiration of the integrated control problem, different control tasks includ- dynamics in C5 is represented below. ing mass flow regulation, flow dispatch, and optimal resource uti- lization can be distributed in different control levels. Accordingly, C˙ yC5 |g = GC5 in · Cy |g − Gout · Cy |g + respy C5 in C5 C5 C5 (21) the proposed control structure is organized into three levels. Since each level of control follows different operating goals and responds In (21), respC5 y is assumed to take two values for day and night to different dynamics, different frequencies (clock signals in Fig. 4) shifts for O2 and CO2 . In addition, GC5 in is the inflow of C5 coming are used for updating the control commands. While Level 3 aims from other compartments as represented in (1), while GC5 out is the at deriving long-term control commands for O2 supply from C4a compartment outflow that is split between C4a and the membrane and the concentrated gas tank, the lower-level controllers are re- separator as shown in Fig. 2 (Alemany et al., 2019). sponsible for determining short-term detailed control signals en- suring gas balance, and satisfying the system safety requirements. 2.4. Membrane Separation In Fig. 4, a general overview of the proposed control architecture is presented. A detailed description of each control level will be given In the membrane module, compounds are distributed in a con- in the following parts. centrated (GC ) and a diluted (GD ) flow, being the latter higher than The main challenge is to design a control architecture that can the first, with a concentration of CyC |g and CyD |g respectively: manage the integrated operation of multiple producers and con- sumers of O2 . The most important priority of the process under fy · GMS · CyMS |g study is to maintain the O2 level in the crew compartment at a CyD |g = (22) GD target level of around 21% at one bar of total pressure without vi- olating the critical boundaries for CO2 . The definition of the up-  per boundary for carbon dioxide concentration in the crew com- GD = fy · GMS · CyMS |g (23) partment has been based on the maximum CO2 concentration of y∈{O2 ,C O2 ,N2 } 3% achieved in the MELiSSA Pilot Plant. This is acceptable for a   test-bed hosting rats, as mock-up crew, whose environment con- GMS · CyMS |g − fy · GMS · CyMS |g | = CyC g (24) trol is ruled by the directive 2010/63/EU which suggests minimiz- GC ing toxic pollutants (European Comission, 2010). For future human- based habitats, the environment control will be subject to the con-    GC = GMS · CyMS |g − fy · GMS · CyMS |g (25) centration range of 0.3–0.7% CO2 defined by the NASA standard y∈{O2 ,C O2 ,N2 } [V2–6004], which has become more restricted through the years 6 C. Ciurans, N. Bazmohammadi, L. Poughon et al. Computers and Chemical Engineering 157 (2022) 107625 Fig. 4. The proposed hierarchical control structure. according to the evidence from operational and research data. This paper, PFC is applied to a simplified first-order approximation of can be easily achieved through the inclusion of a higher plants subsystems assuming one coincidence point. compartment, which have a notably lower photosynthetic quotient Considering a first-order difference equation for a given com- (PQ) for most of the crops under consideration for Life Support pound Cyz |d and a manipulated variable (MV): Systems compared to the PQ of L. indica used in C4a, driving the Cyz |d (k + 1 ) = αm,PF C · Cyz |d (k ) + Km,PF C · βm,PF C · MV (k ) (28) reduction of the overall carbon concentration in the system. This is included in the next MELiSSA Pilot Plant integration steps, but not in this study. Regarding oxygen control, NASA standard [V2– αm,PF C = e−Ts/Tm,PFC (29) 6003] requires a mild hypoxia limit of 16% (NASA, 2019) with the reference established at 21%. βm,PF C = 1 − αm,PF C (30) To achieve these requirements, besides tuning and properly The reference trajectory (Cyz |d ) is considered to be of the first- re f scaling the process design, appropriate control methods are neces- sary at each control level considering the control performance such order type whose starting point is equal to the value of the mea- sured process output (Cyz |d ) at the current time step. Assuming the p as control functionality or controller response time, among others. In this regard, model predictive control (MPC) is adopted at Levels coincidence point equal to one, the predicted value of the process 2 and 3 of the proposed structure taking into account its capa- output one step later than the present can be calculated as follows: bility to consider for the future predicted behavior of the system,  −3·Ts system constraints, its capacity to deal with non-linear multiple- Cˆyz |d (k + 1 ) = Cyz |re d f (k ) − Cyz |dp (k ) · 1 − e CLRTPFC (31) input multiple-output processes (Michael A.Henson, 1998) and to express the desired performance specifications through adjusting The parameter CLRT can be used to adjust the speed of re- control objectives (Ocampo-Martinez et al., 2012). Predictive func- sponse. After some algebraic operations using (28)-(31), it is tional control (PFC) is also used at Levels 1 and 2 because of its straightforward to obtain the following control law: simplicity, low computational time requirement, and ease of im-  plementation (Richalet, 1993). Cyz |re f (k ) − Cyz |dp (k ) · l hPF C + βm,PF C · Cˆyz |d (k ) MV (k ) = d (32) PFC is a simplified variant of MPC that is characterized by re- Km,PF C · βm,PF C placing the control and prediction horizon of MPC with a coin-   cidence point. When only one coincidence point is used, instead lh = 1 − e−3·Ts/CLRTPFC (33) of minimizing the difference between the predicted output of the In the proposed control structure, PFC is used at Level 2 to ad- system and the desired trajectory over the desired horizon, the just the input gas flow of C3 (GC3 ) according to the amount of am- in goal is to match the model output and the target trajectory at the monium introduced in C3 that needs to be oxidized to nitrate. PFC coincidence point by solving a simple algebraic equation. In this is also used at Level 1 to adjust the light energy input in C4a. 7 C. Ciurans, N. Bazmohammadi, L. Poughon et al. Computers and Chemical Engineering 157 (2022) 107625 Other primary and device-level controllers are also mostly satisfied with the production from C4a and the concentrated gas based on PFC controllers. In the following, the control strategies at tank. The outputs of the tertiary controller stored in U3 are con- different control levels along with the associated control objectives sidered as the reference for the secondary controller (see Fig. 4). and constraints are presented. In (35), SCT,re f represents the reference value for the state of the storage in the tank, which in this study is assumed to be fixed 3.1. Level 3: Tertiary controller and time-invariant. In our future work, the operating criteria are expected to be dynamically adapted by the supervisory controller This is the system-level controller responsible for designing op- using a techno-economical and reliability analysis following the timal long-term operating setpoints for the local controllers while LSSs requirements such as the ALISSE criteria. Range parameters optimizing the use of resources and satisfying different technical are included in the objective functions for normalization purposes and operational constraints. To do so, a prediction is made based due to the different magnitude of process variables. on the optimal operating criteria prescribed by the supervisory controller. These operating criteria include keeping the level of the 3.2. Level 2: Secondary controller concentrated gas tank around a reference level (SCT, re f ) of 50% over the total volume of 10 L and a maximum pressure of 50 bar The main functionality of the secondary controller is to keep and to operate C4a around two nominal light levels for day and nom the gas concentration of the crew compartment within a safe night shifts (Wday/night ). To draw the prediction, measurements are boundary by manipulating the gas flows and the O2 concentration obtained from the monitoring system and used to initialize the in- in C4a. The output of this level of control is provided to local con- ternal model described in Section 2. On the one hand, the upper trollers as the reference trajectory for the following time intervals. bound of the O2 production rate of C4a (QOC42a, max ) is set by run- The secondary controller needs to follow the outcome of the ter- ning the internal model using the maximum light intensity tech- tiary controller as it accounts for the optimal resource distribution C4a,re f nically allowed while its reference production rate (QO2 ) is de- and is based on the long-term prediction of the process. The sam- termined using the nominal light intensity. On the other hand, O2 ple time of this level is shorter than that of Level 3, in line with consumption rates by C3 and C5 (Dˆ C3 O and Dˆ C5 O respectively) are its scope to correct O2 concentration deviations in C5. Two inter- 2 2 predicted over the Level 3 prediction horizon. Hence, references related controllers work at the secondary level: (1) a PFC-based regarding the predicted O2 consumption and production rates are controller (PFC 2) that determines the flow of gas (GC3 ) required in generated and used to solve the following optimization problem: to oxidize the nitrogen demands according to the ammonia con- JT = min λ1 J1 + λ2 J2 (34) centration fed to C3 in the liquid phase (FinC3 , see Fig.2), and (2) a U non-linear varying-resolution MPC (VR-MPC) controller that gener- ates the reference values for gas flows and the O2 concentration in  N p1  2 C4a to be followed by the local controllers (see Fig. 4). To do so, J1 = SˆCT (i + k|i ) − SCT,re f (35) the VR-MPC requires the information from PFC-2. k=1 c1 −1  2 QOC42a (i + k|i) − QˆOC42a,re f (i + k|i ) N 3.2.1. Predictive functional control J2 = (36) At the secondary level, a PFC-based control strategy is used k=0 Qˆ C4a (k ) O2 to adjust the flow of enriched O2 gas to convert ammonium into ⎡ ⎤ nitrate. The internal model used is based on a first-order ap- QOC42a (i ) ⎢ GCT (i ) ⎥ proximation of O2 concentration of C3 in the liquid phase (CyC3 |l ) ⎢ ⎥ with the input gas flow (GC3 ) as the manipulated variable. The U =⎢⎢ . .. ⎥ (37) in ⎥ first order process gain and time constant have been identified ⎣Q C4a (i + N p − 1)⎦ in Alemany et al. (2019) based on several experimental tests con- O2 1 GCT (i + N p1 − 1 ) ducted in the pilot plant. Further details regarding the identifica-  tion and validation of the first-order models for C3 and C4a con- U3 = QOC42a (i ) GCT (i ) (38) trollers can be found in Alemany et al. (2019). It is worth mention- ing that these parameters are assumed to be fixed in this paper. Subject to: However, as the system operating condition and the plant envi- (26)-(27)  ronment are exposed to changes over time, these parameters need Dˆ zO2 (i + k|i ) = QO42a (i + k|i) + QˆOCT2 (i + k|i) (39) to be re-tuned. Two different strategies can be followed for re- z∈{C 3,C 5} tuning of the model parameters, a regular time-based re-tuning strategy or an event-based technique continuously monitoring a GCT,min ≤ GCT (i + k|i ) ≤ GCT,max (40) performance index to trigger the re-tuning process. In the for- mer strategy, a fixed frequency is determined based on the his- torical data and experts’ knowledge to re-tune the model param- QOC42a, min (i + k|i ) ≤ QO42a (i + k|i ) ≤ QˆOC42a, max ( i + k|i ) (41) eters while in the latter, a performance index is defined for the model. Monitoring the performance index and comparing it with SCT,min ≤ SˆCT (i + k|i ) ≤ SCT,max (42) the desired threshold reflecting the permissible level of perfor- mance degradation, the time for triggering the re-tuning process In (39)-(42), k ∈ {0,…,Np1 –1}. SˆCT (i + k|i ), Dˆ O2 (i + is determined. Using the first-order model parameters given in k|i ), QˆOC42a,max (i + k|i ) and QˆOCT (i + k|i ) denote the predicted con- Alemany et al. (2019) and (28)-(33), the following control law can 2 centrated gas tank storage level, the total O2 demand (Dˆ C3 O + Dˆ C5 O ), be obtained: the C4a maximum production rate and the concentrated gas tank 2 2  COC32 |re f ( j ) − COC32 |lp ( j ) · l hPF C2 + βm,PF C2 · CˆOC32 |l ( j ) production or consumption rate respectively at time step i + k GC3 ( j) = l (43) using the internal model with the information available at time in Km,PF C2 · βm,PF C2 step i. The constraint represented in (39) indicates that the con- sumption rate expected for the compartments C3 and C5 must be in ( j ) ≥ 0 GC3 (44) 8 C. Ciurans, N. Bazmohammadi, L. Poughon et al. Computers and Chemical Engineering 157 (2022) 107625 In (43), COC3 |l is the reference of the O2 concentration of C3 in re f 2 the liquid phase, which is obtained from the O2 demand predicted GCT,min ≤ GCT ( j + k| j ) ≤ GCT,max (58) by the prediction system at the tertiary level. Hence, at the current time step of the tertiary and the secondary controllers: SCT,min ≤ SˆCT ( j + k| j ) ≤ SCT,max (59) Dˆ C3 COC32 |re f O2 ( j) = (45) COC52 |min ≤ CˆOC52 |g ( j + k| j ) ≤ COC52 |max (60) l VC3 · KL aC3 g g 3.2.2. Varying-Resolution MPC CCC5O2 |min g ≤ CˆCC5O2 |g ( j + k| j ) ≤ CCC5O2 |max g (61) The output of this controller includes the gas flows to C4a (GC4 in a ) and to the membrane separation unit (GMS ), the gas flow to in add or retrieve from the concentrated gas tank (GCT ) and the di- COC42 a |min g ≤ COC42 a |g ( j + k| j ) ≤ COC42 a |max g (62) luted gas tank (GDT ) and the O2 concentration in the outflow of C4a (COC4a |g ). The prediction and control horizons are set to one ρ min ≤ ρ ( j + k| j ) ≤ ρ max (63) 2 hour and the sample time is set to 6 min. However, using a 6- min time resolution over the entire horizon of 1-hour results in a The cost function (46) is the weighted sum of the normalized 10-step problem, which cannot be efficiently solved in a reason- cost functions associated with the deviation of O2 concentration able time. Hence, a homogeneous time resolution is not appro- in C5 from the reference as represented in (47), the deviation of priate over the 1-hour time span. While in the first next steps, a the O2 provided by the concentrated gas tank and C4a from the higher resolution is preferred due to more accurate information, in references scheduled at the tertiary level represented in (48) and the later steps, with fewer certain scenarios, the resolution can be (49) and the rate of change of manipulated variables represented decreased (Olivares et al., 2014). Accordingly, five time steps with in (50)-(51). different time resolutions are considered: 2 × 6-min, 2 × 12-min, It is worth mentioning that due to the restricted computation and 1 × 24-min time-steps. The multi-objective control problem time of the secondary controller, the dynamic equations corre- at the secondary level is summarized below where λi represent sponding to the evolution of O2 and CO2 in C3 and C5 have been weighting coefficients: reduced to fixed consumption rates. In addition, an empirical ap- proximation has been used to estimate CO2 concentration in C4a JS = min(λ3 J3 + λ4 J4 + λ5 J5 + λ6 J6 + λ7 J7 ) (46) given the decision variable COC4a |g . Hence, all the models are dis- Y 2 cretized to be used in the above-mentioned MPC framework. The  2 outputs of the secondary controller stored in U2 , together with the  N p2 CˆOC52 |g ( j + k| j ) − COC52 |re g f J3 = (47) output of PFC2, become the references for the controllers at Level COC52 |g 1. k=1 c2 −1 N  2 GCT ( j + k| j ) − GCT,re f ( j + k| j ) 3.3. Level 1: Local controllers J4 = (48) GCT k=0 At this level, primary controllers, which receive the setpoints N c2 −1  2 from the secondary controllers and send control actions to the  QˆOC42a ( j + k| j ) − QOC42a,re f ( j + k| j ) process actuators are defined. Considering the need for a high- J5 = (49) k=0 Qˆ C4a ( j + k| j ) O2 speed actuation and low computation time, a PFC-based (PFC1) control strategy has been chosen to control the O2 concentra- c2 −1 N tion in C4a by adjusting the light intensity. The control law is J6 = (ρ ( j + k| j ) − ρ ( j + k − 1| j ))2 (50) derived based on the first-order model parameters identified in k=0 Alemany et al. (2019) and using (28)-(33) as follows:  2  c2 −1 N CˆOC42 a |g ( j + k| j ) − CˆOC42 a |g ( j + k − 1| j ) COC42 a |re g (m ) − CO2 |g (m ) · l hPF C1 + βm,PF C1 · CO2 |g (m ) f C4a p ˆC4a J7 = (51) W (m ) = COC42 a |g Km,PF C1 · βm,PF C1 k=0 (64) ⎡ ⎤ y1 Level 1 is triggered every 36 s (fast clock in Fig. 4) to respond to Y = ⎣ .. ⎦ (52) O2 fluctuations in the gas outflow of the C4a compartment (COC4a |g ). . 2 yN p2 −1 The constraints are related to the lower W min and upper W max     bounds of the light intensity. A summary of the proposed HCS is ρ ( j) ρ ( j + N p2 − 1 ) represented in Fig. 4. y1 = G ( j ) ; yN p2 −1 = CT G ( j + N p2 − 1 ) CT (53) COC42 a |g ( j ) COC42 a |g ( j + N p2 − 1 ) 4. Simulation results  U2 = ρ ( j ) GCT ( j ) COC42 a |g ( j ) (54) 4.1. Simulation Plan Subject to: In this section, the performance of the proposed control method System dynamics (21 ) − (27 ) (55) is evaluated using the MELiSSA Pilot Plant as a test case under dif- ferent operating scenarios. The time interval used for simulation is 120 days. Simulations are conducted in MATLAB environment out ( j + k − 1| j ) = Gin ( j + k| j ) + Gin ( j + k| j ) GC5 C4a MS (56) and Parallel computing Toolbox and Aalborg University cloud ser- vice (CLAAUDIA) are employed for parallel computations. Different in ( GC4 a j + k| j ) controller specifications that are considered for the simulations are ρ ( j + k| j ) = (57) out ( j + k| j ) GC5 given in Table 1. 9 C. Ciurans, N. Bazmohammadi, L. Poughon et al. Computers and Chemical Engineering 157 (2022) 107625 Fig. 5. Evolution of (a) O2 and (b) CO2 in the gas phase of C5. Table 1 O2 reference-tracking requirement in C5 defined in (47) is intro- Controller’s specifications. duced in the optimization problem as a soft constraint. Therefore, Par Value Par Value deviations from the reference are allowed under a penalization de- SCT,ref 0.5 Wnom /Wnom 225/84 Wm−2 fined by the weight factor λ3 , without violating the limits as de- day night SCT,min/max 0/1 Np3 =Nc3 6 fined in (60). From a process point of view, when O2 demand is Wmin /Wmax 10/364 Np2 =Nc2 5 high (for example when nitrogen load is at its highest point af- Wm−2 ter 50 days), the concentration of O2 in C5 decreases. The reason GCT,min/max −10/10 Lh−1 λ1 5 for this behavior is that the optimization problem in Level 3 and PCT,max 50×105 Pa λ 2 = λ3 1 VCT 10L λ4 , . . . , λ 7 0.1 Level 2 controllers provide a compromise between the precision O2 |g CC5 ref 21% TS,3 1h of the reference tracking in C5 and the deviation of the operating min/max CC4a O2 g| 18/24% TS,2 0.1TS,3 conditions from the desired nominal operating points defined by C5 min/max CO2 |g 0/3% TS,1 0.1TS,2 parameters SCT,re f and Wdaynom /W nom in Table 1. In opposite, when night ρ min/max 0.1/0.9 the process operates at its nominal condition, the concentration of O2 in C5 can track the reference with high precision. In this study, CO2 is not controlled, but with the operating conditions used, it As mentioned in Section 3, the parameter identification of the can be kept below a critical level of 3% as can be seen in Fig. 5b. PFC first-order models has been inferred based on the MELiSSA Pi- The already mentioned high degree of coupling between variables lot Plant experimental data, which has also represented a test-bed makes it necessary to design a CO2 trap or buffer tank, which in- for the control implementation and large-scale validation. The con- troduces a degree of freedom in the system to be able to control troller parameters regarding PFC2 and PFC1 are listed in Table 2. CO2 . The data required for modeling the MELiSSA Pilot Level 3- In Fig. 6, the optimal resource allocation scheduled by Plant can be accessed in Pérez et al. (2005a) for C3 and solving (34)-(42) is represented. Essentially, Level 3 is constrained Alemany et al. (2019) for C4a and C5. A simulation with changing by the mass balance in (39) considering a list of technical restric- nitrogen load (ammonium load is also used indistinctively) in tions and operating criteria. If the process is operating in nomi- the input of C3 has been performed. By changing the nitrogen nal conditions (Load 1 in Table 3), O2 is supplied mainly by C4a load, the overall demand of O2 changes, and the response per- through adjusting light intensities close to the nominal values. It formance of the proposed HCS can be assessed. The details of is important to notice that the oscillations of the system are due the simulation schedule are given in Table 3 . As the nitrogen to the day-night dynamics of the mock-up crew respiration. Dur- inflow increases/decreases, the required O2 by C3 (Dˆ C3 O ) to oxidize ing the nighttime, rats consume O2 and produce CO2 at a reduced 2 it, also increases/decreases. The control system is responsible to rate in relation to the day shift causing the repeated oscillation ob- coordinate all O2 producer and consumer compartments as well served in most of the variables represented in this section. This is as the concentrated gas tank to satisfy the main requirements of also the reason why two nominal points of light intensity are used the loop. in C4a, so that the resource utilization can be optimized. In Fig. 6, it can be observed how the concentrated gas tank is coordinated 4.2. Results with C4a to handle the excess and deficit of O2 in the system. Thus, when the consumption rate of C3 and C5 exceeds C4a production Main Outcome- As the main outcome of the study, Fig. 5a capacity (from 25 to 30 days in Fig. 6b), the concentrated gas tank demonstrates that O2 in the crew compartment is appropriately is mainly discharged (red area in Fig. 6b). On the contrary, if C4a maintained within the required limits while following the desired has enough production capacity (from 30 to 38 hr in Fig. 6b), the reference of 21%. concentrated gas tank is mainly charged (purple area in Fig. 6b). The reason for this fluctuation, which evolves according to the Level 2- Once Level 3 has determined the resource allocation in nitrogen load, lies in the fact that in the secondary controller, the terms of O2 production rates from C4a and the concentrated gas 10 C. Ciurans, N. Bazmohammadi, L. Poughon et al. Computers and Chemical Engineering 157 (2022) 107625 Table 2 Predictive functional controllers’ parameter. Name Control command Time constant (h) Gain Coincidence point (h) Closed loop response time (h) Reference HCS level PFC 2 GC3 in 0.01 0.0459 0.1 0.03 COC32 |re l f 2 PFC 1 Light intensity (W) 0.15 0.007% O2 /W/m2 0.01 0.45 COC42 a |re g f 1 Table 3 Simulation Schedule. Step Inlet Flow (mL/min) [NH4 ] (mg/L) N Load (mg N l-1 day-1 ) Time Interval (day) ∗ Load1 20.8 128.6 435 0–10 Load2 16.4 128.6 343 10–30 Load3 27.8 128.6 580 30–50 Load4 33.5 128.6 700 50–70 Load1 20.8 128.6 435 70–120 ∗ Nominal operating condition. Fig. 6. a) Overall demand of O2 from C3 and C5 and the optimal resource allocation of C4a; b) Concentrated gas tank charging(-)/discharging(+) rates according to tertiary level decisions; c) and d) are zoomed plots of a) and b) respectively from day 25 to 38. tank, references are sent to the secondary controller, which gen- sented for CO2 and HNO3 , demonstrating that when nitrogen load erates reference signals to be tracked by local controllers through is decreased in Load 2 scenario, C4a receives less nitrate and its solving the control problem presented in (46)-(63). In Fig. 7, where O2 productivity is threatened. It is also important to highlight that the output of the secondary controller is represented, a high per- according to Table 3 the concentration of NH4 in the input of C3 is formance can be observed in terms of precision in the tracking of not changed, but the flow of input liquid (FinC3 ) is changed. Hence, the references received from Level 3. PFC2 performance will be as- the concentration of nitrate in the input of C4a is time-invariant, sessed in the next section. considering that C3 operates at full nitrification. The cause of the limitation is that reducing the flow involves increasing the resi- 4.2.1. Local controllers and process performance dence time in the photobioreactor C4a, increasing its biomass con- According to Table 3, Load 2 corresponds to the lowest Nitro- centration (increasing the population) until the consumption rate gen load in C3 which carries the lowest O2 demand. Nevertheless, of nitrate crosses a boundary that implies nitrogen (resource) lim- it is also observed in Fig. 6b that with this low amount of nitrogen itation (see Fig.8b). This is a paradigmatic example of the degree load, the concentrated gas tank needs to be discharged to satisfy of interdependency between variables involved in biochemical re- the overall O2 demand. The reason for this apparent contradictory actions. phenomenon about low O2 demand and discharging of the con- The control system proposed in this study can overcome this centrated gas tank can be explained by the resource limitation in type of limitation by deploying efficient predictions. The tertiary C4a. According to (4)-(8), when the substrate y concentration de- controller uses the measurements obtained from the plant, which creases, the associated limiting factor decreases yz < 1, hence, cell in combination with the internal model presented in Section 2, can growth and productivity of O2 also decrease. In Fig. 8a, yz is repre- anticipate some of the negative phenomena that the process can 11 C. Ciurans, N. Bazmohammadi, L. Poughon et al. Computers and Chemical Engineering 157 (2022) 107625 Fig. 7. a) Concentrated gas tank charging (-)/discharging(+) rate; b) Oxygen production rate of C4a; c) and d) are zoomed plots of a) and b) respectively from day 25 to 38. Fig. 8. a) Substrate limitation in C4a associated to Carbon and Nitrogen sources b) Concentration of compounds in the liquid phase in the output of C4a. face as long as they are properly considered in the internal model. whenever nitrogen load is increased, so does the reference dis- When the nitrogen load is at its highest level (Load 4), it can be solved O2 in C3 following (45). To track these reference changes, observed in Fig. 6b that the concentrated gas tank needs to be dis- the input gas flow (Fig. 9b) is modified to inject more concen- charged, not because of a nitrogen limitation in C4a, but because of trated O2 from the membrane separation unit when more nitrogen the high O2 demand in the system. At this point, C4a approaches is loaded in C3. As it can be seen in Fig. 9c, PFC is proven to be its maximum production capacity, which is penalized by the ob- very efficient in guaranteeing that no NH4 is sent to C4a. jective function. As can be observed, the HCS defines an optimal Regarding the output of the secondary controller, the concen- strategy for charging and discharging the concentrated gas tank for trated gas tank flow (Fig. 7a) can be directly sent to the local con- compensating, either the default of nitrogen availability or the ex- troller, but the O2 production rate assigned to C4a (Fig. 7b) de- cess in O2 demand of the system. pends on the C4a gas flow and the O2 concentration in the output According to the diagram in Fig. 4, the secondary controller re- of C4a. Thus, secondary controller determines optimal flows and quires information about the gas inflow in C3 to be able to gen- concentration setpoints to be tracked by the local controllers Given erate the rest of the control references. By applying the PFC in the flow rate generated by Level 2, the control of O2 concentra- (43), the gas flow is determined based on the expected O2 demand, tion in C4a is performed by adjusting the light intensity in the pri- which is predicted at the tertiary level. Fig. 9a demonstrates that mary controller. As mentioned, the operating criteria for C4a is to 12 C. Ciurans, N. Bazmohammadi, L. Poughon et al. Computers and Chemical Engineering 157 (2022) 107625 Fig. 9. Summary of oxygen controller in C3. a) Dissolved oxygen tracking to guarantee ammonia oxidization to nitrate b) C3 Gas inflow representation as a control command in response to varying nitrogen load c) Distribution of nitrogen compounds of C3 in the liquid phase. Fig. 10. Performance of the controllers in Level 1: a) Oxygen reference tracking in C4a, b) C4a light adjustment, c) Concentrated gas tank level. work with two nominal levels of light intensity. In Fig. 10a, it can as soon as the production capacity of C4a can satisfy the overall be observed that the O2 concentration in C4a follows with good O2 demand, the tank is charged to restore its desired level. This precision the reference received from Level 2. The performance of is observed in Fig. 10c when the nominal operating conditions are the PFC controller has been already validated in the MELiSSA Pi- restored from day 70 until the end of the simulation. Hence, the lot Plant. In Fig. 10b it is shown that when the process operates light intensity profile in C4a is never saturated as it stays around at the nominal operating condition (Load 1) the light intensity is the nominal point and similarly, the concentrated gas tank level close to the day and night nominal points (225 and 84 W/m2 re- fluctuates around 50%. spectively), while in scenarios when different nitrogen loads are Satisfactory results have been achieved regarding both the oper- applied, light intensity tends to deviate from the nominal levels ation of the system following the desired references guaranteeing following the priority given to different objective functions of the a safe environment for the crew and the achievement of a high de- secondary controller. Fig. 10c shows the evolution of the concen- gree of resilience to changes. The computational time required at trated gas tank storage level over the simulation time, tracking the different levels in the proposed HCS is also satisfactory, given the desired reference imposed by the supervisory controller at a value complexity of the MPC used for Levels 3 and 2. Details about the of 50%. As the reference for concentrated gas tank is set to 50%, computational cost of different controllers can be found in Table 4. 13 C. Ciurans, N. Bazmohammadi, L. Poughon et al. Computers and Chemical Engineering 157 (2022) 107625 Table 4 Supervision, Project administration, Funding acquisition. Josep M. Controllers Computational Cost. Guerrero: Conceptualization, Methodology, Supervision, Funding Level in HCS Maximum (sec) Minimum (sec) Mean (sec) acquisition. Prediction 122.15 65.74 70.06 Level 3 2.72 0.55 0.62 Acknowledgements Level 2 9.38 1.07 2.065 Level 1 <0.1 <0.1 <0.1 This work was supported by VILLUM FONDEN under the VIL- LUM Investigator Grant (no. 25920): Center for Research on Micro- grids (CROM). The MELiSSA Pilot Plant is funded from ESA contri- 5. Future works butions from Spain (main contributor), Belgium, France, Italy and Norway, under Frame Contract C40 0 0109802/13/NL/CP. Co-funding In Section 4, the proposed HCS has been applied to an exem- from Ministerio de Ciencia, Innovación y Universidades, General- plary LSS, MELiSSA Pilot Plant, in MATLAB environment using its itat de Catalunya and Universitat Autònoma de Barcelona is also well-tested and validated models. According to the results, the pro- acknowledged (https://www.melissafoundation.org) posed controller has a satisfactory performance to achieve the op- erating goals of the system while satisfying the main requirements References determined in LSS standards. It is worth mentioning that, as the main focus of this paper is to demonstrate the potential of a hier- Alemany, L., Peiro, E., Arnau, C., Garcia, D., Poughon, L., Cornet, J.F., Dussap, C.G., archical control strategy for operation management of a LSS with a Gerbi, O., Lamaze, B., Lasseur, C., Godia, F., 2019. Continuous controlled long- term operation and modeling of a closed loop connecting an air-lift photobiore- variety of constraints and operating goals, analyzing the effects of actor and an animal compartment for the development of a life support system. uncertainty on the controller performance is proposed as an im- Biochem. Eng. J. 151. doi:10.1016/j.bej.2019.107323. portant future research direction. Mitigating model uncertainties Barta, D., 2017. Getting out of orbit: water recycling requirements and technology need for long duration missions away from Earth. In: 20th Annual Nanotech and sensor noise caused by the uncertain behavior of the crew 2017 Conference and Expo, pp. 1–9. are among the main issues that necessitate the deployment of ad- Brunet, J., Gerbi, O., André, P., Davin, E., Avezuela Rodriguez, R., Carbonero, F.O., vanced robust and stochastic control strategies. Besides, this paper Soumalainen, E., Lasseur, C., 2010. Alisse : advanced life support system eval- focuses on the mass balance and oxygen control of the CELSS and uator. In: 38th COSPAR Scientific Assembly, p. 2. Ciurans, C., Bazmohammadi, N., Vasquez, J.C., Dussap, G., Guerrero, J.M., Godia, F., only the gas phase loop is considered for a mock-up crew of three 2021. Hierarchical control of space closed ecosystems – expanding microgrid rats. Integrating energy and thermal subsystems as well as the liq- concepts to bioastronautics. IEEE Ind. Electron. Mag. 2–13. doi:10.1109/MIE. uid phase loop are also of vital importance to have a coordinated 2020.3026828. Cornet, J.F.; Dussap, C.G.; Dubertret, G., 1992. A structured model for simulation of framework to control a human-rated regenerative life support sys- cultures of cyanobacterium Spyrulina platensis in Photobioreactors coupling be- tems that will be followed by the authors in their future research. tween light transfer and growth kinetics. Cornet, J.F., Dussap, C.G., Gros, J.B., Binois, C., Lasseur, C., 1995. A simplified monodi- mensional approach for modeling coupling between radiant light transfer and 6. Conclusions growth kinetics in photobioreactors. Chem. Eng. Sci. 50, 1489–1500. doi:10.1016/ 0 0 09-2509(95)0 0 022-W. In this paper, HCS and energy management strategies of MGs Cruvellier, N., Poughon, L., Creuly, C., Dussap, C.G., Lasseur, C., 2017. High ammonium loading and nitrification modelling in a fixed-bed bioreactor. J. Water Process are extended to control ecological LSSs, which have a very com- Eng. 20, 90–96. doi:10.1016/j.jwpe.2017.10.006. plex nature reflected in the mathematical modeling and present Dauchet, J., Cornet, J.F., Gros, F., Roudet, M., Dussap, C.G., 2016. Photobioreactor mod- many challenges including non-linearities, interrelated system dy- eling and radiative transfer analysis for engineering purposes. Adv. Chem. Eng. 48, 1–106. doi:10.1016/bs.ache.2015.11.003. namics, hard constraints, scarce resources, and degrees of freedom, Ehlmann, B.L., Chowdhury, J., Marzullo, T.C., Eric Collins, R., Litzenberger, J., Ib- and especially a high degree of variable and functions coupling. sen, S., Krauser, W.R., Dekock, B., Hannon, M., Kinnevan, J., Shepard, R., Douglas All this requires a HCS with different levels to supervise (Supervi- Grant, F., 2005. Humans to Mars: a feasibility and cost-benefit analysis. Acta sory Level), manage (Level 3), adjust (Level 2), and execute (Level Astronaut 56, 851–858. doi:10.1016/j.actaastro.2005.01.010. European Comission, 2010. Directive 2010/63/EU of the european parliament and 1) control commands. The platform presented will be used in the the council of 22 September 2010 on the protection of animals used for scien- future to adapt the proposed HCS to further integration steps pur- tific purposes. Off. J. Eur. Union 1–162. sued in the MELiSSA Pilot Plant. Increasing the number of com- Gitelson, J., Lisovsky, G., 2002. Man-Made Closed Ecological Systems. Gòdia, F., Albiol, J., Pérez, J., Creus, N., Cabello, F., Montràs, A., Masot, A., Lasseur, C., partments will naturally increase the control complexity. Among 2004. The MELISSA pilot plant facility as an integration test-bed for advanced others, it will force to include water and edible material produc- life support systems. Adv. Sp. Res. 34, 1483–1493. doi:10.1016/j.asr.2003.08.038. tion for the crew, to assess the use of buffer elements to ensure Jones, H., 2003. Design rules for space life support systems. SAE Tech. Pap. doi:10. 4271/2003- 01- 2356. optimal control of the plant, as well as to appraise the control ar- A.Henson, Michael, 1998. Nonlinear model predictive control current states and fu- chitecture resilience and robustness. ture directions.pdf. Comput. Chem. Eng.. NASA, 2019. Nasa Spaceflight Human-System Standard. Volume2: Human Factors, Habitability, and Environmental Health. Declaration of Competing Interest Nelson, M., Allen, J., Alling, A., Dempster, W.F., Silverstone, S., 2003. Earth appli- cations of closed ecological systems: relevance to the development of sus- The authors declare that they have no known competing finan- tainability in our global biosphere. Adv. Sp. Res. 31, 1649–1655. doi:10.1016/ S0273-1177(03)80011-X. cial interests or personal relationships that could have appeared to Nelson, M., Burgess, T.L., Alling, A., Alvarez-Romo, N., Dempster, W.F., Walford, R.L., influence the work reported in this paper. Allen, J.P., 1993. Using a closed ecological system to study Earth’s biosphere: initial results from Biosphere 2. Bioscience 43, 225–236. doi:10.2307/1312123. Nelson, M., Pechurkin, N.S., Allen, J.P., Somova, L.A., Gitelson, J.I., 2010. Closed eco- CRediT authorship contribution statement logical systems, space life support and Biospherics. Environ. Biotechnol doi:10. 1007/978- 1- 60327- 140- 0_11. Carles Ciurans: Writing – original draft, Writing – review Ocampo-Martinez, C., Barcelli, D., Puig, V., Bemporad, A., 2012. Hierarchical and de- centralised model predictive control of drinking water networks: application & editing, Conceptualization, Software, Formal analysis. Najmeh to Barcelona case study. IET Control Theory Appl 6, 62–71. doi:10.1049/iet-cta. Bazmohammadi: Writing – original draft, Writing – review 2010.0737. & editing, Conceptualization, Software, Methodology. Laurent Olivares, D.E., Canizares, C.A., Kazerani, M., 2014. A centralized energy manage- Poughon: Investigation, Resources. Juan C. Vasquez: Conceptual- ment system for isolated microgrids. IEEE Trans. Smart Grid 5, 1864–1875. doi:10.1109/TSG.2013.2294187. ization, Methodology, Supervision. Claude G. Dussap: Investiga- Pérez, J., Poughon, L., Dussap, C.G., Montesinos, J.L., Gòdia, F., 2005a. Dynamics and tion, Resources, Supervision, Funding acquisition. Francesc Gòdia: steady state operation of a nitrifying fixed bed biofilm reactor: mathematical 14 C. Ciurans, N. Bazmohammadi, L. Poughon et al. Computers and Chemical Engineering 157 (2022) 107625 model based description. Process Biochem 40, 2359–2369. doi:10.1016/j.procbio. Richalet, J., 1993. Practique De La Commande Predictive. Hermes Sciences Publicat. 2004.09.022. Schwartzkopf, S.H., 1992. Design of a controlled ecological life support system: re- Pérez, J., Poughon, L., Dussap, C.G., Montesinos, J.L., Gòdia, F., 2005b. Dynamics and generative technologies are necessary for implementation in a lunar base CELSS. steady state operation of a nitrifying fixed bed biofilm reactor: mathematical Bioscience 42, 526–535. doi:10.2307/1311883. model based description. Process Biochem 40, 2359–2369. doi:10.1016/j.procbio. Sulzman, F.M., 1994. Life Support and Habitability. Vol II. Space Biology and 2004.09.022. Medicine. Poughon, L., Dussap, C.G., Gros, J.B., 1999. Dynamic model of a nitrifying fixed bed Vasquez, J., Guerrero, J., Miret, J., Castilla, M., De Vicuña, L., 2010. Hierarchical con- column: simulation of the biomass distribution of Nitrosomonas and Nitrobac- trol of intelligent Microgrids. IEEE Ind. Electron. Mag. 23–29. ter and of transient behaviour of the column. Bioprocess Eng 20, 209–221. doi:10.10 07/s0 04490 050583. 15