This repository contains a comprehensive simulation environment for the ADCS (Attitude Determination and Control System) of a 6U nadir-pointing CubeSat in Low Earth Orbit (LEO), developed for the MSc in Space Engineering at Politecnico di Milano.
The framework is organized into two primary technical domains:
Focused on high-fidelity sensor modeling and vector-based attitude determination.
- Multi-Sensor Architecture: Integration of Infrared Horizon Sensors (MAI-SES 400) and Sun Sensors to provide redundant attitude references.
- Vector Observation (SVD): Implementation of Singular Value Decomposition (SVD) algorithms to reconstruct the spacecraft's attitude matrix from non-collinear vector measurements.
- High-Fidelity Noise Modeling: Realistic simulation of sensor performance including Gaussian noise, bias drift (STIM300 Gyro), and resolution limits.
-
Signal Processing: Implementation of low-pass filtering for magnetic field (
$B$ ) and angular velocity ($\omega$ ) measurements to mitigate high-frequency noise.
Focused on a three-phase control strategy for mission-critical maneuvers.
-
Detumbling (
$B$ -dot): Magnetic-based rate damping to reduce initial tip-off rates using Earth's magnetic field interaction. - Slew Maneuvers (LQR): Application of Linear Quadratic Regulation for optimal large-angle reorientation.
- Precision Tracking: Quaternion-based feedback control for nadir-pointing requirements.
- Hybrid Actuation: Integrated management of Magnetorquers (MTQ400) and a Reaction Wheel, including momentum desaturation logic.
main.m: Entry point of the project. This script initializes the workspace, defines spacecraft physical properties (mass, inertia), sets orbital parameters (SSO), configures sensor noise characteristics, and calculates controller gains.simulink_ADCS.slx: The core simulation engine. It implements the non-linear dynamics, environmental disturbance models, and the hybrid control logic (B-dot, LQR, and Pointing). Must be run after executingmain.m.ADCS_Report.pdf: Comprehensive technical documentation covering the mathematical background and simulation results.
MATLAB functions/: A collection of specialized aerospace utilities
The methodology, mathematical derivations (IGRF-2020 7th-order harmonics), and performance analyses are documented in the detailed technical report:
- Environment: MATLAB (R2023b or later recommended) & Simulink.
- Toolboxes: Control System Toolbox, Aerospace Toolbox.
- Setup: 1. Clone the repository.
2. Add the
MATLAB functionsfolder and its subfolders to your MATLAB Path. 3. Runmain.mto initialize the workspace constants. 4. Open and runsimulink_ADCS.slx.
- Pointing Accuracy: Achieved 0.1° – 1% error range under perturbed environments.
- Environmental Modeling: Includes Gravity Gradient, Solar Radiation Pressure (SRP), and 7th-order IGRF Geomagnetic model.
Author: Pietro Cavalletti