## 2 Materials and Methods--Implementation, Integration, and Testing of the IDEASSat Flight Model
### Spacecraft Flight Software (FSW)  
The spacecraft autonomous flight software (FSW) was developed in-house using C, Verilog, and assembly language. FSW could continuously check the status of all subsystems running in the background of the program, and transition between the corresponding operation mode according to the state of the subsystem telemetry. When the spacecraft passed within the line of sight of ground stations used for command and control, it could perform related actions in response to the commands from the ground station and also adjust the spacecraft attitude to orient the S-band patch antenna at the ground station when needed. IDEASSat's flight software had two major modes: emergency and nominal. There were 2 sub-modes in emergency and 3 sub-modes in nominal, as shown in Table 6. Mode transitions were based on the state of charge (SOC) and whether the spacecraft was located in sunlight or eclipse. FSW variables were normally stored in the OBC SRAM and are protected by the built-in single error correction and double error detection (SECDED) feature of the SmartFusion2 [14; 18; 19]. To reduce the recovery time needed following spacecraft hard resets, FSW setting variables normally stored in volatile SRAM were written to the OBC SD cards every six hours or at mode transitions. Since SD Cards are a nonvolatile storage medium, the logged FSW settings could be read and re-implemented by FSW upon reboot, removing the need for manual reset by flight controllers. \begin{table}
\begin{tabular}{c c} \hline \hline
**Major Mode** & **Sub-Modes** \\ \hline Emergency & Phoenix mode, Safe mode \\ Nominal & Charging mode, Transition mode, Science mode \\ \hline \hline \end{tabular}
\end{table} 
Table 6: IDEASSat operating modes. Figure 2: CIP mechanical structure, comprised of the apertures and meshes module (AMM), analog preprocessing unit (APU), digital control unit (DCU), and power management unit (PMU). The emergency mode was a low power consumption mode intended to facilitate rapid recovery from low SOC, while also minimizing actions not related to survival. The corresponding sub-modes are phoenix and safe. Phoenix mode was an extremely low power consumption mode to deal with emergencies caused by extremely low SOC or rapid decline in satellite SOC. FSW would enter phoenix mode following boot-up, with a 30 min passive wait time upon the first boot-up. This satisfied launch provider requirements for the spacecraft to remain in a passive state for 30 min following launch vehicle separation. Most sub-systems would not be powered on in phoenix mode, with the only subsystems powered on (EPS, CDH, UHF) related to the bare survival of the spacecraft. Safe mode was responsible for handling the protection settings of low SOC or anomalous subsystem telemetry under nominal mode. This mode would keep the spacecraft in a safe condition of basic operation and timely charging. Different from phoenix mode, this mode would enable the ADCS into a sun pointing mode using the coarse sun sensor (CSS) to rapidly charge the spacecraft batteries. The use of the CSS reduced the number of sensors required to find the sun. Nominal operations consisted of a charging mode using fine reference sun pointing in sunlight, as well as autonomous ground station pointing for S-band data downlink. Charging mode was a configuration for fast charging of satellites and scientific data transmission in the day side sector. Compared with safe mode, ADCS would perform fine sun pointing using more ADCS sensor inputs to charge the satellite more efficiently [11]  
Science mode meant that the satellite could collect scientific data when in the night side sector and the total power was sufficient. Scientific observations were to be performed when the spacecraft was in eclipse, which is consistent with scintillation causing equatorial plasma bubbles being a nighttime phenomenon [20]. Transition mode was responsible for handling the situation in which the spacecraft was in eclipse but the total power was insufficient for complete scientific data collection.