The CubeSat Avionics and Attitude Control System focuses on developing flight software for a 2U (10x10x20 cm) nanosatellite. We designed algorithms to control the attitude, or orientation, of the satellite using only magnetorquers. A magnetorquer is a coil of wire that generates a localized magnetic field when a current goes through it; this magnetic field produces a torque to turn the satellite. Our software drives the magnetorquer to achieve detumbling, spin stabilization, and inertial pointing of the satellite.
We used an STM32 Nucleo L476RG board as our main microcontroller, a magnetorquer and a dual H-bridge to drive it, and a BNO085 inertial measurement unit (IMU) to measure the external magnetic field, acceleration, and angular velocity. STM's Hardware Abstraction Layer was the primary library we used. We implemented a Python-based Hardware in the Loop simulation to visualize the satellite's motion in 3D and graph the telemetry readings (angular velocity, current, torque).
Our simulation allows us to visualize the satellite's motion in detumbling, spin stabilization, and inertial pointing modes based on our algorithms. In detumbling, the algorithm decreases excess angular velocity in the x, y, and z directions. In spin stabilization, the satellite's spin is adjusted so that it only spins about the y-axis. Finally, in inertial pointing, the satellite starts out in the opposite direction from what is desired. The generated torque aligns the satellite as close to the desired direction as possible.
