This repository presents a comprehensive treatment of spacecraft dynamics and control, implementing the Embedded Model Control (EMC) approach as developed by Canuto et al. The work provides rigorous mathematical foundations, detailed derivations, and practical implementations for attitude determination and control systems (ADCS), orbital mechanics, and guidance, navigation, and control (GNC) subsystems.
Keywords: Spacecraft Dynamics, Attitude Control, Embedded Model Control, Quaternion Kinematics, Orbital Mechanics, ADCS, GNC Systems
Emanuel Quintana Silva
Universidad Pedagógica y Tecnológica de Colombia (UPTC)
School of Engineering
Sogamoso, Boyacá, Colombia
Contact: emanuel.quintana@uptc.edu.co
ORCID: 0000-0000-0000-0000
ResearchGate: Profile
- Introduction
- Mathematical Framework
- Repository Structure
- Installation and Requirements
- Usage and Compilation
- Content Overview
- Theoretical Background
- Computational Tools
- Citation
- References
- License
- Acknowledgments
The design and analysis of spacecraft guidance, navigation, and control systems require a deep understanding of:
- Attitude Representation Theory: Rotation matrices, Euler angles, quaternions, and Modified Rodrigues Parameters (MRPs)
- Orbital Mechanics: Two-body problem, perturbed dynamics, and relative motion
- Control Theory: State-space methods, optimal control, and robust design
- Sensor and Actuator Models: High-fidelity models for gyroscopes, star trackers, reaction wheels, and thrusters
This repository provides a systematic treatment of these topics, emphasizing mathematical rigor and practical implementation.
The primary objectives are:
- Theoretical Development: Rigorous derivations of fundamental equations
- Computational Implementation: MATLAB/Python code for algorithms
- Practical Applications: Case studies from real missions
- Educational Resource: Comprehensive learning material for graduate students
| Symbol | Description | Example |
|---|---|---|
| n-dimensional Euclidean space | ||
| Special Orthogonal Group | ||
| Unit quaternion space | ||
| Inertial reference frame | ECI frame | |
| Body-fixed reference frame | Spacecraft frame | |
| Angular velocity vector | rad/s | |
| Moment of inertia tensor | kg·m² |
Attitude Kinematics (Quaternion Form):
Euler's Rotational Equation:
Orbital Dynamics (Two-Body):
spacecraft-dynamics-control/
│
├── manuscript/
│ ├── index.qmd # Main manuscript
│ ├── _quarto.yml # Configuration
│ └── references.bib # Bibliography
│
├── chapters/
│ ├── 01-mathematical-preliminaries/
│ │ ├── index.qmd
│ │ ├── vectors-matrices.qmd
│ │ └── exercises.qmd
│ ├── 02-attitude-representation/
│ │ ├── index.qmd
│ │ ├── rotation-matrices.qmd
│ │ ├── quaternions.qmd
│ │ └── mrp.qmd
│ ├── 03-orbital-dynamics/
│ ├── 04-perturbations/
│ ├── 05-attitude-kinematics/
│ ├── 06-attitude-dynamics/
│ ├── 07-sensors/
│ ├── 08-actuators/
│ ├── 09-attitude-determination/
│ ├── 10-control-design/
│ └── 11-case-studies/
│
├── code/
│ ├── matlab/
│ │ ├── attitude/
│ │ │ ├── quat2dcm.m
│ │ │ ├── dcm2quat.m
│ │ │ └── quatmult.m
│ │ ├── dynamics/
│ │ ├── orbit/
│ │ └── control/
│ ├── python/
│ │ ├── spacecraft_dynamics/
│ │ │ ├── __init__.py
│ │ │ ├── attitude.py
│ │ │ ├── orbit.py
│ │ │ └── control.py
│ │ └── tests/
│ └── simulations/
│
├── data/
│ ├── missions/ # Real mission data
│ ├── ephemeris/ # Planetary ephemeris
│ └── measurements/ # Sensor data
│
├── figures/
│ ├── diagrams/
│ ├── plots/
│ └── schematics/
│
├── appendices/
│ ├── A-mathematical-proofs.qmd
│ ├── B-derivations.qmd
│ └── C-algorithms.qmd
│
├── docs/
│ ├── api/ # Code documentation
│ └── tutorials/ # Step-by-step guides
│
├── tests/
│ ├── unit/
│ └── integration/
│
├── .github/
│ └── workflows/
│ ├── quarto-publish.yml
│ └── code-tests.yml
│
├── README.md
├── LICENSE
├── CITATION.cff
├── .gitignore
└── environment.yml # Conda environment
- Operating System: Linux, macOS, or Windows 10+
- RAM: 8 GB minimum, 16 GB recommended
- Disk Space: 2 GB for repository and dependencies
# Quarto (v1.4+)
# Download from: https://quarto.org/docs/get-started/
# Git
sudo apt-get install git # Linux
brew install git # macOS
# LaTeX distribution (for PDF output)
sudo apt-get install texlive-full # Linux
brew install --cask mactex # macOS# Create conda environment
conda env create -f environment.yml
conda activate spacecraft-dynamics
# Or use pip
pip install -r requirements.txtrequirements.txt:
numpy>=1.24.0
scipy>=1.10.0
matplotlib>=3.7.0
pandas>=2.0.0
sympy>=1.12
jupyter>=1.0.0
plotly>=5.14.0
pytest>=7.3.0
black>=23.0.0
- Aerospace Toolbox
- Control System Toolbox
- Optimization Toolbox
- Symbolic Math Toolbox
# Clone repository
git clone https://github.com/equintana-uptc/spacecraft-dynamics-control.git
cd spacecraft-dynamics-control
# Preview during development
quarto preview manuscript/
# Render all formats
quarto render manuscript/
# Render specific format
quarto render manuscript/ --to pdf
quarto render manuscript/ --to html
quarto render manuscript/ --to docx# Python simulations
cd code/python
python simulations/attitude_propagation.py
# MATLAB simulations
cd code/matlab
matlab -batch "run('simulations/orbital_propagation.m')"# Python tests
pytest tests/
# MATLAB tests
matlab -batch "runtests('tests/')"- Vector spaces and linear algebra
- Matrix theory and properties
- Tensor calculus
- Differential geometry fundamentals
- Direction cosine matrices (DCM)
- Euler angles (multiple conventions)
- Axis-angle representation (Rodrigues parameters)
- Unit quaternions
- Modified Rodrigues Parameters (MRP)
- Comparison and singularity analysis
- Two-body problem and Kepler's laws
- Classical orbital elements (COE)
- Orbital maneuvers and transfers
- Orbit propagation methods
- Lagrange planetary equations
- Gravitational perturbations (J2, J3, third-body)
- Atmospheric drag modeling
- Solar radiation pressure
- Magnetic field interactions
- Comprehensive disturbance models
- Gauss variational equations
- Lagrange planetary equations
- Hill-Clohessy-Wiltshire (HCW) equations
- Restricted three-body problem
- Formation flying dynamics
- Kinematic differential equations
- Euler angle kinematics
- Quaternion kinematics and properties
- Error kinematics for control
- Kinematic singularities
- Euler's equations of motion
- Torque-free motion and stability
- Gravity gradient torque effects
- Dual-spin spacecraft
- Momentum exchange devices
- Inertial measurement units (IMU)
- MEMS gyroscopes and accelerometers
- Star trackers and star catalogs
- Sun sensors and Earth horizon sensors
- Magnetometers
- GPS/GNSS receivers
- Sensor error models and calibration
- Chemical and electric propulsion
- Reaction wheels and momentum wheels
- Control moment gyroscopes (CMG)
- Magnetic torquers
- Thruster configurations
- Actuator dynamics and saturation
- TRIAD algorithm
- Wahba's problem formulation
- QUEST and ESOQ algorithms
- Davenport's q-method
- SVD-based methods
- Extended Kalman Filter (EKF)
- Unscented Kalman Filter (UKF)
- Drag-free control systems
- Station-keeping maneuvers
- Orbit transfer optimization
- Orbital quaternion prediction
- Relative navigation and control
- PD and PID control laws
- Linear Quadratic Regulator (LQR)
- Sliding mode control
- Embedded Model Control (EMC)
- Momentum management
- Detumbling strategies
- Mission requirements and constraints
- ADCS architecture design
- Mode definitions and transitions
- Simulation results and validation
- Failure modes and recovery
- Optimal control theory
- Robust control design
- Adaptive control methods
- Machine learning applications
- Multi-spacecraft coordination
The EMC approach, developed by Canuto et al., represents a paradigm shift in spacecraft control design. Key principles include:
- Embedded Disturbance Model: Explicit modeling of disturbances in the control law
- Command and Disturbance Governors: Separation of tracking and rejection
- State Prediction: High-bandwidth state estimation
- Model Uncertainty: Systematic treatment of modeling errors
Control Architecture:
Reference → Command → State → Control → Plant
Commands Governor Predictor Law
↑ ↑
│ │
Disturbance ← Measurements
Governor
Quaternions provide singularity-free attitude representation:
where
Quaternion Multiplication:
Comprehensive Python library for spacecraft analysis:
from spacecraft_dynamics import attitude, orbit, control
# Quaternion operations
q1 = attitude.Quaternion([1, 0, 0, 0])
q2 = attitude.Quaternion.from_euler([0, 0, np.pi/4])
q_result = q1 * q2
# Orbital propagation
state0 = orbit.ClassicalElements(a=7000e3, e=0.001, i=np.deg2rad(51.6))
trajectory = orbit.propagate(state0, t_span=[0, 86400])
# Control design
controller = control.LQR(Q=np.eye(6), R=np.eye(3))
torque = controller.compute(state, reference)Professional-grade functions following aerospace standards:
% Attitude conversion
dcm = quat2dcm(q);
q = euler2quat(phi, theta, psi, 'ZYX');
% Dynamics simulation
[t, state] = ode45(@(t,x) spacecraft_eom(t, x, params), tspan, x0);
% Control
K = lqr(A, B, Q, R);
u = -K * (x - x_ref);If you use this work in your research, please cite:
@misc{quintana2024spacecraft,
author = {Quintana Silva, Emanuel},
title = {Spacecraft Dynamics and Control: Mathematical Foundations and Applications},
year = {2024},
publisher = {GitHub},
journal = {GitHub repository},
howpublished = {\url{https://github.com/equintana-uptc/spacecraft-dynamics-control}},
institution = {Universidad Pedagógica y Tecnológica de Colombia}
}Quintana Silva, E. (2024). Spacecraft dynamics and control: Mathematical foundations and applications. Universidad Pedagógica y Tecnológica de Colombia. https://github.com/equintana-uptc/spacecraft-dynamics-control
Canuto, E., Novara, C., Massotti, L., Carlucci, D., & Perez Montenegro, C. (2018). Spacecraft dynamics and control: The embedded model control approach. Butterworth-Heinemann. https://doi.org/10.1016/C2015-0-04007-5
- Wertz, J. R. (Ed.). (2012). Spacecraft attitude determination and control. Springer Science & Business Media.
- Wie, B. (2008). Space vehicle dynamics and control (2nd ed.). American Institute of Aeronautics and Astronautics.
- Markley, F. L., & Crassidis, J. L. (2014). Fundamentals of spacecraft attitude determination and control. Springer.
- Vallado, D. A. (2013). Fundamentals of astrodynamics and applications (4th ed.). Microcosm Press.
- Shuster, M. D., & Oh, S. D. (1981). Three-axis attitude determination from vector observations. Journal of Guidance and Control, 4(1), 70-77.
- Markley, F. L. (1988). Attitude determination using vector observations and the singular value decomposition. The Journal of the Astronautical Sciences, 36(3), 245-258.
This work is licensed under CC BY-NC-SA 4.0. You are free to:
- Share: Copy and redistribute the material
- Adapt: Remix, transform, and build upon the material
Under the following terms:
- Attribution: Appropriate credit must be given
- NonCommercial: Not for commercial purposes
- ShareAlike: Distributed under the same license
Full license: https://creativecommons.org/licenses/by-nc-sa/4.0/
Software components are licensed under the MIT License.
- Universidad Pedagógica y Tecnológica de Colombia (UPTC) - Academic support and resources
- School of Engineering - Research facilities
This work builds upon the foundational research of:
- European Space Agency (ESA) - GOCE mission data and documentation
- NASA - Public datasets and technical reports
- Politecnico di Torino - EMC methodology development
Special thanks to the developers of:
- Quarto - Scientific publishing system
- Python Scientific Stack - NumPy, SciPy, Matplotlib
- MATLAB - Numerical computing environment
Contributions are welcome! Please follow these guidelines:
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit changes (
git commit -m 'Add AmazingFeature') - Push to branch (
git push origin feature/AmazingFeature) - Open a Pull Request
- Python: Follow PEP 8, use Black formatter
- MATLAB: Follow MATLAB Style Guidelines
- Documentation: Use NumPy docstring format
- Testing: Maintain >90% code coverage
Please use GitHub Issues with appropriate labels:
bug: Something isn't workingenhancement: New feature requestdocumentation: Documentation improvementsquestion: Further information requested
Emanuel Quintana Silva
emanuel.quintana@uptc.edu.co
Universidad Pedagógica y Tecnológica de Colombia
Sogamoso, Boyacá, Colombia
- Repository: https://github.com/equintana-uptc/spacecraft-dynamics-control
- Documentation: https://equintana-uptc.github.io/spacecraft-dynamics-control
- Issues: https://github.com/equintana-uptc/spacecraft-dynamics-control/issues
