Power and Energy Management System of a Lunar Microgrid—Part II: Optimal Sizing and Operation of ISRU

Energy management systems (EMSs) and autonomous power control (APC) for space microgrids (MGs) on the Moon need properly designed operating points and references to ensure the mission's safety. The oxygen and water requirements of the lunar base are supplied by the in situ resource utilization (ISRU) from the lunar regolith. ISRU is one of the most power-demanding subsystems in the lunar base. This article proposes an optimization methodology for sizing and optimal operation management of a photovoltaic (PV)-battery-based space MG. By solving the optimization problem, the optimal size of the PV array and battery, and the PV power generation and battery charging/discharging profiles are determined. First, the ISRU power demand profile is presented considering the oxygen and water management systems of the lunar base. Then, the optimization algorithm is employed to minimize the PV and battery mass and the total unused PV power generation while maintaining the desired level of energy in the battery considering system constraints. It is observed that curtailing the excess PV power generation plays a crucial role in minimizing the battery size and mass, thereby reducing the cost of the space mission.


I. INTRODUCTION
With the advent of Artemis missions, NASA has reignited the long-awaiting desire to make humans interplanetary species [1].The initial phase of returning humans to the Moon has begun by NASA with the successful test flight of Orion spacecraft under Artemis-I in December 2022 [2].With Artemis-III mission by 2025, humans are going to land for the first time on the Moon after the last Apollo mission in December 1972 [3].The Chinese Lunar Exploration Program also plans to establish a lunar base by 2028 [4].In addition, the Japan Aerospace Exploration Agency plans to establish a lunar base [5] and is investigating ways to establish artificial gravity on the Moon [6].
In a lunar base, several systems interact to maintain the artificial atmosphere (air) and temperature, manage water and waste treatment, and produce food.All these systems rely on electricity for functioning; thereby, the space microgrid (MG) is an absolute necessity.The space MG on the Moon consists of several power generation and storage systems and power-consuming units, which are coordinated using advanced control and energy management systems (EMSs) [7], [8].
Nowadays, fast computing systems enable the deployment of autonomous control systems for space applications; for instance, Dragon and Starship spacecraft developed by SpaceX and NASA's Orion spacecraft are completely autonomous in transporting crew members or cargo to space [9], [10], [11].Autonomous systems allow automatically performing certain tasks and have the built-in capability of adapting to the unknown rapidly changing space environment.Incorporation of automatic systems is especially important under adverse operating conditions that require fast reactions within a few milliseconds or in the case of some catastrophic events, including crew incapacitation.As space missions move farther away from earth, communications from ground stations are considerably delayed or impossible due to obstruction.Therefore, an autonomous power controller (APC) is an indispensable part of space MGs on the Moon to ensure the safe, reliable, and resilient operation of the MG and the lunar base.The APC is responsible for scheduling the operating mode of the power-consuming units and coordinating the available power and the power demand to maintain the power balance in the base [12].
Having the information on the power consumption profile of the base is required for maintaining the balance in power of the space MG.Colozza [7] assumes either a fixed value or two states for the power demand depending on daytime and nighttime at the considered location.Saha et al. [13] also propose generating the power demand profile of the base, taking into account the time of use of several power-consuming units having two states of power consumption.However, the power demand of a lunar base is largely dependent on the interaction of its subsystems and the number of crew members.For instance, the oxygen and water consumption rates of the crew members and higher plant compartment in the habitat determine the rates at which oxygen and water must be generated to maintain the desired oxygen and water levels in the respective storage tanks [7], [14], [15].A more detailed study of deriving the power demand profile of the base considering the interaction of various subsystems of the base can be found in Part I of this study.The power demand profile of the base is derived from models that represent the operating conditions of different subsystems and the interaction among them.For operation management of an MG, information on the available power from photovoltaic (PV) systems and storage devices must be available to ensure the adequacy of the power supply.Colozza [7] considers a constant power generation for PV systems near the equatorial region at a latitude of 30 • .However, according to the existing reports, the highly illuminated areas can be found near the lunar polar regions [16], [17], [18].In [19], a candidate location at the lunar south pole is considered for the base, but a constant PV power generation is considered during the lunar daytime.According to the data collected by the Lunar Orbiter Laser Altimeter of NASA's Lunar Reconnaissance Orbiter, many high terrains exist near the lunar polar regions [20], [21].Also, the Sun's elevation angle near the lunar polar regions is less than 10 • [22].The high elevations of the surrounding topography and the low Sun elevation angle create long shadows [23], [24] and obstruct the solar energy near the polar regions.Therefore, the illumination time-series profile provides more accurate information on the availability of solar power at the candidate location.
Furthermore, according to [13], a highly illuminated location might necessitate oversizing the battery to store the extra energy that can be generated by the PV system.An oversized battery increases the cost of the space mission and might render the mission impossible as the mission cost is directly proportional to the payload mass.Therefore, the extra power generation from the PV system can be shed or utilized for other purposes, for instance, charging alternative kinds of energy storage systems (ESSs) such as regenerative fuel cells (RFCs), charging rovers, scheduling the operation of other necessary power-consuming devices, and so on, which were not considered in [13].Therefore, an efficient power management strategy is needed to optimally plan the power generation profile of the PV system considering the available solar radiation and the power demand of different power-consuming units.To the best of our knowledge, such an EMS for space MGs on the Moon to maintain the power balance during the availability and unavailability periods of the PV power and considering the power demand profile of the interacting subsystems of the base has not been reported in the literature.
In this article, the power demand profile of in situ resource utilization (ISRU) obtained from Part I is used to develop an efficient power management strategy for the base, taking into account the interaction between ISRU, crew habitat, and wastewater subsystems to maintain the desired oxygen and water levels in the respective tanks.The goal is to incorporate the power consumption profile of the ISRU to obtain the optimal size of the PV array and ESSs and the optimal power generation profile of the PV system.Considering a hierarchical control structure for the APC, the system-level controller is responsible for scheduling and energy management of the MG to satisfy the power balance and long-term goals of the space mission.In the proposed optimization framework, the optimal mass of the PV system and the battery, the stored energy level and charging/discharging profile of the battery, and the total excess PV power are determined using the Sun illumination time-series profile [25] at the candidate location.Several technical constraints related to the battery system and the power balance in the MG are also taken into account.The main contribution of the study is to obtain an optimal power generation profile and operation management of a PV-battery-based MG, maintain the battery energy at the desired level, and identify the duration when excess PV power generation is available and the amount of the excess power.The profile of the excess PV power provides important insights into the capacity and flexibility of the system for implementing demand-side management strategies and deploying other types of storage systems, such as RFCs.The rest of this article is organized as follows.The interacting subsystems to provide the required oxygen and water of the base are introduced in Section II.Furthermore, the methodology to estimate the available PV power using the illumination time-series profile at the candidate location is presented.Also, the aggregated ISRU power demand profile considering all the power-consuming units is estimated in this section.The battery and power balance constraints and the proposed optimization methodology are presented in Section III.The optimization results are discussed in Section IV, where comparison studies are performed with different conditions.Finally, Section V concludes this article.

II. ISRU POWER DEMAND PROFILE
In this study, the interconnected subsystems, namely, the ISRU, the crew habitat, and the wastewater, are considered to model the power consumption profile of the base.The ISRU utilizes the lunar regolith to produce oxygen and water for the crew habitat.The wastewater produced in the crew habitat can also be filtered in the wastewater subsystem, and the produced fresh water can be reused by the crew members.Several oxygen and water tanks are introduced to interface the ISRU, crew habitat, and wastewater subsystems.Depending on the oxygen and water consumption rates of the crew habitat, the oxygen is supplied from the ISRU oxygen tank, while water is supplied from water tanks of both ISRU and wastewater subsystems.
The illumination time-series profile at the selected location with longitude 222.6627 • and latitude −89.4511 • near the Shackleton crater is shown in Fig. 1(a).It can be observed that the illumination is unavailable over a Fig. 2. Flow diagram to determine the PV power generation profile [7], [13].
significant time duration, in which the lunar regolith intake is ceased, as can be seen in Fig.If the oxygen and water tank levels in ISRU drop below the desired references or a significant darkness period is approaching, the ISRU produces more oxygen and water, which results in increasing its power demand, as can be observed in Fig. 1(c), (e), and (g).In the following subsections, the methodology to estimate the power generation profile of the PV system using the illumination time-series profile and the total power demand profile of the ISRU is discussed.
The power demand profile of the ISRU generated in Part I of this article for maintaining the desired oxygen and water levels in the ISRU tanks is used in this article for optimal sizing and operation management of the ISRU MG.

A. Estimating PV Power Generation
In this article, the available power of PV arrays made up of multijunction GaInP/GaAs/Ge PV cells based on III-V semiconductor technology is estimated using the methodology first proposed in [7] and later updated by Saha et al. [13], as shown in Fig. 2. In the flow diagram shown in Fig. 2, the intensity of radiation from the Sun (I s ) is assumed to be 1359 W/m 2 following [7].In addition, the value of χ d is set to zero, assuming that the PV arrays are installed near the base, and the lunar dust on the arrays can be removed at regular intervals.The optimal area of the PV array (A a ) is found from the solution of the optimization problem that is presented in the following parts.It is worth noticing that the degradation of PV cells due to the particle radiations and low lunar temperatures is not considered in this study.A detailed description of determining the PV power generation profile from the illumination time-series profile is discussed in [13].

B. ISRU Total Power Demand Profile
The power demand profile of ISRU, as shown in Fig. 1(c), is mainly related to the power required to maintain the storage levels of oxygen and water tanks in the ISRU at the desired levels.However, there are several other devices, as listed in Table I [7], [22], [26], that require power for the operation of ISRU.It is assumed that all these devices are running throughout the mission and have two operating modes: active and survival states.When the PV energy is available, all the critical and important devices are in the active state and consume their full required power, which is referred to as the active-state power.Conversely, during the dark periods when the PV energy is not available, the important devices operate at a low-power-consuming state called survival state, while critical loads are in active state and low-priority devices are switched OFF to reduce the energy demand.From Table I, it is observed that the total power consumption of these devices in the active and survival states is approximately 11 and 8 kW, respectively.Therefore, the active-state and survival-state power consumption of these devices is added to the power demand profile of ISRU in Fig. 1(c) as follows: The resulted profile for P t ISRU considering the additional power-consuming devices is used in the following sections for optimal operation of a PV-battery-based MG for the ISRU and to determine the size of the PV arrays and batteries of the MG.

III. OPTIMAL SIZING AND OPERATION OF PV-BATTERY-BASED MG
In this section, the optimization methodology to find the optimal PV array area and the battery capacity for the lunar MG at the candidate location is proposed.The goal is to minimize the mass of the PV system and the battery as well as the total unused PV power.Besides, the desired stored energy level in the battery should be maintained, while satisfying the battery constraints.By solving this optimization problem, the optimal PV power generation and battery charging/discharging profiles are also obtained.

A. Battery Constraints
There are several ESS technologies for terrestrial and space applications.The detailed study of desired characteristics of ESS for space surface missions can be found in [8].Among different available energy storage technologies for space applications (see [8] and [27]), rechargeable batteries and fuel cells meet the required characteristics and are capable of sustaining power demand for extended periods.A detailed comparison of RFCs and rechargeable batteries can be found in [8] and [13].Lithium-ion batteries are selected in this article due to their benefits and widespread utilization in spacecraft and space missions.
In case there is any discrepancy between the power generated by the PV arrays and the power consumption of the base, the batteries are utilized to supply/store the required/excess power to ensure power balance in the MG.A flexible restriction is imposed on the final amount of the stored energy of the battery that can be adjusted by varying δ from 0 to 1 (see Fig. 3).It is worth noticing that due to the short optimization horizon of 708 h (= 29.5 days = 1 lunar month) considered in this article, the battery capacity degradation is not taken into account.

B. Power Balance Constraint
The hourly real power balance is considered as where P t B = P t c for charging, while P t B = −P t d for discharging.

C. Proposed Optimization Strategy
The system-level controller of the APC is responsible for coordinating the operation of different subsystems to ensure optimal resource utilization and maintaining power balance.As the cost of a space mission is directly proportional to the payload mass, the proposed optimization strategy for optimal sizing and operation of the space MG at the candidate locations aims to minimize the mass of the PV array and the battery while minimizing the total unused PV power and maintaining a desired stored energy level in the battery.To this end, the following objective function is considered in the proposed optimization problem: The battery mass (M B ) is calculated as [7], [13]: and M PV is determined by the following equation [7]: The battery mass (M B ) is directly proportional to E cap , as shown in (4).As the power demand is supplied from the batteries during the dark periods, optimal sizing of the battery to minimize the battery mass while ensuring service continuity is required.Therefore, E cap is one of the decision variables of the optimization problem.The initial stored energy of the battery can take an arbitrary value, but the final stored energy level (E (T )) must be within a specified limit of E (0), as shown in Fig. 3.The PV array mass is directly proportional to the array area (A a ).
Optimizing the PV array area ensures having the minimum PV mass while ensuring adequate power generation to satisfy the base load and maintaining the stored energy of the battery at the desired level.Optimizing the PV array area also results in minimizing the total unused PV power  [7], [13] and thereby optimal resource utilization as the PV power is not unnecessarily shed due to the oversized array area.The upper and lower bounds of all decision variables are listed in Table II.The lower bound of A a is set to a value that ensures that the PV system can cover the maximum power demand of the ISRU.This ensures that most of the power demand is supplied by the PV system, while the battery is not used when the Sun illumination is available.Only if there exists a short daytime in between substantially long dark periods, the optimal PV array area might increase as the battery should be charged rapidly by the PV array.The proposed optimization algorithm to size the PV array and the battery, as well as the optimal PV generation profile, is described in Fig. 3.

IV. SIMULATION RESULTS
The illumination time-series profile of the candidate location at longitude 222.6627 • and latitude −89.4511 • near the Shackleton crater at the south pole is considered to generate the ISRU power demand and the power generation profile of the ISRU.The proposed optimization problem is modeled in MATLAB and solved using fmincon toolbox and the interior point algorithm considering an optimization horizon of 708 h (= 29.5 days = 1 lunar month).The values assumed for PV and battery parameters for the simulation purpose are listed in Table III.To find the illumination time-series profile, it is assumed that the PV arrays are placed on top of towers with 10-m height.The simulation is performed by considering only the power demand of the ISRU and all its supporting devices, as listed in Table I, in the space MG.For the simulation study, four scenarios are investigated.In the first scenario, it is assumed that the total unused PV power is minimized, the lower bound of the PV array area is set to a value that ensures covering the maximum power demand of the ISRU, and three cases with different reference values for the stored energy of the battery equal to 50%, 25%, and 85% of E cap are simulated and analyzed.
The obtained results from solving the proposed optimization problem are presented in Fig. 4. It can be seen that the optimal PV area in all three cases is similar and equal to 257.7 m 2 .It can be observed in Fig. 4(a) that the output power of the PV system with an area of 257.7 m 2 is almost equal to the maximum power demand of the ISRU.The maximum power demand of ISRU and the maximum PV power generation with an area of 257.7 m 2 are 8.7267 × 10 4 and 8.7273 × 10 4 W, respectively.
To maintain the power balance in the MG, the optimization algorithm decides the time periods to charge or discharge the batteries depending on the available power from the PV system and the power demand.From Fig. 4(a), it can be observed that there are several intervals in which the generated PV power is more than the ISRU power demand.During this time, the optimization algorithm decides to charge the battery or shed the excess power generated.If the stored energy of the battery is less than the desired level or a dark interval without PV power generation is approaching, excess power is used to charge the batteries.For the case in which E ref is set to 50%, it can be seen in Fig. 4(c) that at approximately 150 h, the stored energy of the battery reaches the desired level.The charging profile of the battery is shown in Fig. 4(d).Afterward, the excess power generation from the PV system is shed [see Fig. 4(b)].The same behavior can be observed for the other two cases with desired values of 85% and 25% for the stored energy level of the battery.By comparing Fig. 4(f), (g), and (e) for the case with a battery reference of 25%, it can be observed that the battery is charging approximately from 150 h, and as soon as the stored energy of the battery reaches the desired level at approximately 160 h, the battery charging ceases and the excess PV power is shed.The same phenomenon is observed in Fig. 4(i), (j), and (h) for the case with a battery reference of 85%.
In Fig. 4(a), it can be seen that the PV power is unavailable from 220 to 280 h and the ISRU survival-state power demand is supplied from the batteries.At approximately 210 h, the batteries start charging in all three cases to be prepared for the approaching dark period without any PV power generation as can be seen in Fig. 4(d), (g), and (j) for the cases with battery reference of 50%, 25%, and 85%, respectively.After approximately 220 h, the power from the PV is unavailable, and the batteries supply the ISRU's power demand.Therefore, a decrease in the stored energy level of the batteries can be observed approximately from 220 to 280 h in all three cases, as observed in Fig. 4(c), (f),  and (i).
According to Fig. 4(a), at approximately 280 h, the PV power is again available.It can also be observed from this figure that the ISRU demands a high power for a few hours when the PV power becomes available to restore the decrease in the stored oxygen and water levels in the respective tanks in the ISRU.However, soon the ISRU power demand reduces.From approximately 280 to 290 h, the optimal operating strategy decides not to shed the generated .(e) ISRU optimal PV power reference and PV power shedding profile for battery reference at 25%.(f) Battery stored energy profile for battery reference at 25%.(g) Battery charging/discharging power profile for battery reference at 25%.(h) ISRU optimal PV power reference and PV power shedding profile for battery reference at 85%. (i) Battery stored energy profile for battery reference at 85%. (j) Battery charging/discharging power profile for battery reference at 85%.
PV power even if the ISRU power demand is reduced for all three cases, as seen in Fig. 4(b), (e), and (h).Instead, during this period, the batteries are charged in all three cases to reach the desired stored energy level, as can be seen in Fig. 4(c), (f), and (i).As soon as the stored energy level of batteries reaches the desired level at approximately 295 h, the excess PV power generation is shed in all three cases, as shown in Fig. 4(b), (e), and (h).The process of getting prepared for a long dark period and charging the batteries is observed in all three cases from Fig. 4(c), (f), and (i).A similar phenomenon of charging and discharging the batteries depending on the PV power availability, ISRU power  demand, and the stored energy level of batteries is observed during the rest of the optimization horizon.Therefore, it can be concluded that the proposed optimization strategy can maintain the power balance in the space MG by optimally generating the PV power generation profile.The optimal PV power generation profiles for the ISRU in all three cases are represented in Fig. 4(b), (e), and (h), which are obtained by subtracting the respective PV power shedding profile, as seen in Fig. 4(b), (e), and (h), respectively, from the PV power generation profile shown in Fig. 4(a).The optimal size and mass of the PV array and the battery are listed as Scenario 1 in Table IV.According to the results, all cases have the same size for the PV array area and the battery capacity.
The PV array and battery capacity were further compared with three more scenarios.It is observed that the optimal PV array area and the battery capacity in Scenario 2 are close to the obtained results in the base scenario, Scenario 1 that has been studied so far.Also, the excess PV power profile is similar to Fig. 4(b).The optimal PV array area in Scenario 2 is 249.3449m 2 that can generate a maximum power of 8.4444 × 10 4 W, which is less than the maximum ISRU power demand of 8.7267 × 10 4 W. Therefore, the battery is used to supply the maximum power demand even when Sun illumination is available, slightly affecting the stored energy level and charging/discharging power profile of the battery during the initial few hours of operation.It is also observed that compared to Scenario 1, although there is a reduction of 17.8799 kg in the PV array mass, the battery mass increases by 396.5848 kg.
Comparing Scenario 3 with Scenario 1, it is observed that, although the PV array mass reduces by 201.5406 kg, the battery mass rises by 31086.0057kg in Scenario 3. The increase in the battery size is because there is no possibility of PV power shedding when the PV power generation is more than the ISRU power demand.The PV power generation and the battery stored energy profiles for Scenario 3 are shown in Fig. 5.A similar result is observed in Scenario 4. As the excess PV power generation is stored in the battery, the battery mass increases by 1.372 × 10 6 kg compared to Scenario 1.Therefore, it can be concluded that having an efficient strategy to optimally charge the battery before nighttime using the excess PV power generation and shed the unused power allows maintaining the battery energy at the desired level and can considerably reduce the size and mass of the battery.
Although curtailing the available PV power reduces the required battery capacity and mass, disregarding resources in a resource-scarce environment like space is not wise.Instead, the excess energy can be used to recharge other types of ESSs such as RFCs.Employing a variety of ESSs allows more flexible operation management, especially during critical events such as equipment malfunction or failure.In addition, an effective load management and scheduling scheme can be developed to utilize the excess PV power.For instance, the charging of electric vehicles or spacesuits/extravehicular mobility units can be scheduled during the availability of excess power.Developing such a scheme to better utilize the available resources is under investigation by the authors.

V. CONCLUSION
In this study, an optimization strategy was proposed for optimal sizing and operation management of PV-battery-based space MGs.The MG is considered to be located at a candidate location near the Shackleton crater and serves the power demand of the ISRU.The output power of the PV array was calculated using the actual Sun illumination time-series profile at the candidate location during one lunar month with the assumption that PV arrays are installed on top of towers with 10-m height.The power demand of the ISRU to maintain the desired oxygen and water levels in the respective oxygen and water tanks of the lunar habitat was considered.From solving the proposed optimization problem, the optimal power generation profile of the PV system and the optimal charging/discharging strategy for the battery were obtained.PV power shedding was also considered to avoid an unnecessary increase in the capacity of the battery.The optimization algorithm charges the battery from the excess available PV power before any long nighttime at the candidate location to ensure service continuity.This optimized PV power generation profile can be used as a reference in the EMS of the lunar base to optimally distribute the available power among several subsystems while satisfying their operating goals.Different scenarios with and without the possibility for PV power shedding were simulated and analyzed.It was observed that the PV power shedding helps to significantly reduce the battery size and mass as the excess PV power is shed.Investigating the integration of load scheduling and other flexible power generation technologies such as RFCs to a space MG to enhance power flexibility and efficiency and better resource utilization is the scope of the future research of the authors.Furthermore, uncertainties in the power demand can also arise due to the deviation of oxygen and water consumption and wastewater generation in the habitat from the standard rate (discussed in Part I of the study), which are considered as future study by the authors.It is worth mentioning that in the space environment, critical emergency situations might arise due to equipment malfunction or failure, damage caused by a meteorite strike, or communication failure, among others.Therefore, for optimal sizing and operation management of PV-battery-based MGs, different contingency scenarios should be taken into account, which is among the important research directions in this field to ensure reliable and resilient operation of space MGs.

Fig. 1 .
Fig. 1.(a) Illumination time-series profile at the candidate lunar site with longitude 222.6627 • and latitude −89.4511 • near the Shackleton crater from July 6, 2023 to August 5, 2023.Illumination "1" shows that solar illumination is available at the location, and "0" indicates that the site is in shadow due to the low Sun elevation and high lunar terrain.(b) Lunar regolith intake rate.(c) ISRU power demand to maintain the ISRU's oxygen and water tank at desired level.(d) ISRU oxygen tank level.(e) ISRU oxygen tank level zoomed.(f) ISRU water tank level.(g) ISRU water tank level zoomed.
1(b), to reduce the power demand of the ISRU.Fig. 1(c) shows the power demand profile of the ISRU to maintain the desired stored levels of oxygen and water in the respective tanks of the ISRU.

Fig. 4 .
Fig.4.(a) ISRU PV array power generation and power demand profiles.(b) ISRU optimal PV power reference and PV power shedding profile for battery reference at 50%.(c) Battery stored energy profile for battery reference at 50%.(d) Battery charging/discharging power profile for battery reference at 50%.(e) ISRU optimal PV power reference and PV power shedding profile for battery reference at 25%.(f) Battery stored energy profile for battery reference at 25%.(g) Battery charging/discharging power profile for battery reference at 25%.(h) ISRU optimal PV power reference and PV power shedding profile for battery reference at 85%. (i) Battery stored energy profile for battery reference at 85%. (j) Battery charging/discharging power profile for battery reference at 85%.

Fig. 5 .
Fig. 5. (a) ISRU PV array power generation and power demand profile.(b) Battery stored energy level profile for Scenario 3.

TABLE I Power
Consumption of Several Devices in ISRU

TABLE IV PV
Array Area and Battery Capacity and Their Mass Considering Different Optimization Conditions

1 )
Scenario 2: With PV power shedding, maintain E ref at 50% of E cap and the lower bound of A a equal to zero.2) 3: Without PV power shedding, maintain E ref at 50% of E cap ; the lower bound of A a is equal to zero, and δ = 10%.3) Scenario 4: Without PV power shedding, maintain E ref at 50% of E cap ; the lower bound of A a is set to a value that ensures covering the maximum power demand of the ISRU, and δ = 10%.