## Article  
Model-Based Design and Testbed for CubeSat Attitude Determination and Control System with Magnetic Actuation  
[PERSON]  
1 School of Astronautics, Beihang University, Beijing 100191, China; [EMAIL_ADDRESS] (FJ.T.C. ); arntuoyes2010@gThe reduction in cost associated with CubeSats can be attributed to the standardization of their component subsystems and the availability of low-cost, commercial off-the-shelf (COTS) components. Nevertheless, CubeSats are more prone to failures when subjected to extreme environmental conditions. To mitigate these hazards, international standards such as ISO 19683:2017 [7] and ECSS-E-ST-10-03C [8] have been established. These regulations emphasize rigorous ground testing of CubeSat subsystems to reduce the probability of mission failures [9]. In response to the challenges associated with CubeSat missions, low-cost techniques such as Software-in-the-Loop (SIL), Processor-in-the-Loop (PIL), and Model-in-the-Loop (MIL) have been developed. These methodologies are instrumental in validating the Attitude Determination and Control System (ADCS) algorithms. As emphasized by [10], the reliability of the results obtained from these tests heavily depends on the accuracy of the models used in the simulations. Consequently, many designers [10; 11; 12] have adopted another advanced technique known as Hardware-in-the-Loop (HIL), which provides more accurate ADCS results by incorporating actual hardware interactions with the simulated environment. For instance, HIL has been employed in real-time configurations to emulate the Earth's magnetic field using a Helmholtz cage for high-precision calibration [13], as well as for magnetic sensing and actuation tests [14]. Moreover, at various stages of development, models are extensively used for early testing not only in the aerospace industry but also across other industries engaged in R&D. These models serve to eliminate ambiguities and facilitate low-cost test configurations by representing entire systems. Typically, these models are developed in layers, progressing from high-level requirements to detailed technical interactions between components [15]. Especially for low-level configurations, tools such as MIL, SIL, PIL, and HIL significantly reduce development time by enabling extensive testing. In this context, model-based configurations are particularly advantageous for early-stage testing in the development process. When it comes to subsystems like the ADCS, specific aspects of its performance, physical resources, and operational maneuvers can be meticulously analyzed for all operational modes of a CubeSat. This research aims to establish a robust conceptual design that sets the baseline for CubeSat missions, particularly focusing on Earth observation and on-board image classification, as illustrated in Figure 1. Through the use of mathematical models, it is possible to thoroughly analyze the interaction between a simulated environment and the system via sensors and actuators, such as solar sensors [16] and magnetorquers [17; 18]. This approach not only enhances the accuracy and reliability of the ADCS but also contributes to the overall success of CubeSat missions. Matlab/Simulink is an ideal platform for developing simulated environments due to its extensive range of modules that facilitate the simulation of complex systems. One notable feature is the Simulink Code Generation block, which enables the conversion of simulation models into C code, allowing implementation on embedded devices to replicate the simulated performance [19; 20]. However, it is important to note that the ideal simulated performance often differs from the actual performance due to unmodeled disturbances and the non-ideal output of sensors. This discrepancy underscores the need for rigorous validation and calibration to ensure that the simulated environment accurately reflects real-world conditions. Among other failure factors that may be considered in ground testing are the physical and electronic limitations of the sensors [21].