Skip to content

Implement MATLAB ADCS framework for CubeSat attitude determination and control#1

Draft
Copilot wants to merge 4 commits intomasterfrom
copilot/add-cubesat-attitude-control
Draft

Implement MATLAB ADCS framework for CubeSat attitude determination and control#1
Copilot wants to merge 4 commits intomasterfrom
copilot/add-cubesat-attitude-control

Conversation

Copy link

Copilot AI commented Feb 2, 2026

Implements a complete ADCS software package with quaternion-based attitude representation, realistic sensor/actuator models, and multiple control strategies.

Architecture

Attitude Determination

  • TRIAD: Two-vector deterministic solver (sun + mag)
  • EKF: Gyro-integrated optimal estimator with measurement updates

Attitude Control

  • B-dot: Passive magnetic detumbling via field derivative
  • PID: Three-axis pointing with gyroscopic compensation
  • Magnetorquer: Pseudo-inverse torque allocation (2-axis controllable)
  • Reaction wheel: Momentum exchange with saturation handling

Models

  • Sensors: Magnetometer, sun sensor (FOV-limited), gyroscope (bias + noise)
  • Actuators: Magnetorquer (M × B torque), reaction wheel (with friction)
  • Environment: Dipole magnetic field, RK4 orbit propagator

Usage

init_adcs  % Load paths and config

% Configure for your spacecraft
config = adcs_config();
config.spacecraft.inertia = diag([0.02, 0.02, 0.01]);  % kg·m²
config.control.pid.Kp = 0.1;

% Run simulations
run('examples/detumbling_simulation.m')    % B-dot → 90% rate reduction in 1hr
run('examples/pointing_simulation.m')       % PID → <1° error in 3min
run('examples/attitude_estimation.m')       % TRIAD → 0.3° RMS error

Structure

src/
  attitude_determination/  # TRIAD, EKF
  attitude_control/        # B-dot, PID, wheel/mag control
  sensors/                 # 3-axis mag, sun, gyro
  actuators/              # Magnetorquer, reaction wheel
  utils/                  # Quaternion math, DCM, orbit prop
examples/                 # 3 complete simulation scenarios
config/                   # Centralized parameters
simulink/                 # Model setup scripts

All functions include comprehensive documentation. Code generation ready for embedded deployment via MATLAB Coder.

Original prompt

MATLAB and SIMULINK simulations/generated code for a CubeSat Attitude Determination and Control System


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 3 commits February 2, 2026 03:02
Co-authored-by: AbdullaSadoun <128957261+AbdullaSadoun@users.noreply.github.com>
Co-authored-by: AbdullaSadoun <128957261+AbdullaSadoun@users.noreply.github.com>
Co-authored-by: AbdullaSadoun <128957261+AbdullaSadoun@users.noreply.github.com>
Copilot AI changed the title [WIP] Add MATLAB and SIMULINK simulations for CubeSat attitude control Implement MATLAB ADCS framework for CubeSat attitude determination and control Feb 2, 2026
Copilot AI requested a review from AbdullaSadoun February 2, 2026 03:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants