7 min read
CubeSat Engineering Simulation Suite: Interactive 3D ADCS & Space Material Degradation
A dual-module space engineering simulation toolkit combining an interactive 3D Attitude Determination & Control System in base MATLAB with a long-duration orbital flight and space material degradation simulator in Python.
- 3D ADCS
- MATLAB
- Python
- Space Systems
- Material Degradation
- Robotics & Control
- Orbital Mechanics
1. Overview: Bridging Control & Space Environments
Designing a nanosatellite (CubeSat) requires solving two critical engineering challenges that are rarely simulated together:
- Short-Term Dynamics: How does the satellite stabilize, rotate, and point its instruments using reaction wheels?
- Long-Term Survival: How does the harsh Low Earth Orbit (LEO) environment—radiation, atomic oxygen, thermal cycling, and UV—erode satellite materials and degrade mission performance over months in orbit?
This simulation suite bridges the gap through two dedicated tools:
- Module 1: Interactive ADCS Simulator (Base MATLAB)
Focuses on real-time 3D quaternion attitude control, interactive orientation sliders, reaction wheel torque limits, and tumble recovery. - Module 2: Flight & Material Degradation Suite (Python 3)
Focuses on RK4 numerical orbit propagation with J2 Earth oblateness, 5-hazard space material aging, and coupled power degradation models.
| Module | Primary Focus | Platform | Key Capabilities |
|---|---|---|---|
| Interactive ADCS Simulator | Real-time 3D attitude control & slewing | Base MATLAB (Zero toolboxes) | Live slider steering, dual 3D triad rendering, reaction wheel saturation, tumble perturbation injection |
| Flight & Material Simulator | Long-duration mission aging & orbital mechanics | Python 3 (Tkinter, NumPy, Matplotlib) | RK4 + J2 orbit propagation, 5 space environmental hazards, coupled SRP disturbance, solar cell voltage demotion |
2. Module 1: Interactive MATLAB ADCS Simulator
The MATLAB module (ADCS_simulator.m) is built for hands-on exploration of spacecraft attitude dynamics without needing expensive toolboxes (Simulink or Aerospace Blockset).
How the ADCS Pipeline Works
- Interactive Sliders: The user adjusts desired Yaw, Pitch, and Roll angles live during execution.
- Target Quaternion: Angles are converted into a singularity-free unit quaternion (
q_target). - Attitude Error Engine: Calculates the rotational error quaternion between target and current spacecraft attitude.
- PD Controller: Computes required corrective torque using a proportional rotational spring and derivative damping term.
- Torque Limiter: Enforces physical brushless motor saturation (clamped to 4 mN·m).
- Rigid-Body Dynamics: Euler rotational equations compute angular accelerations based on 3U chassis inertia.
- Kinematics Integration: Integrates quaternion state forward in time (dt = 0.03 s).
- Real-Time Display: Renders dual 3D coordinate triads (target vs. actual satellite) and updates rolling telemetry plots.
Core Highlights
- Live Target Steering: Adjust Yaw (-180° to +180°), Pitch (-90° to +90°), or Roll (-180° to +180°) mid-simulation. The dashed target triad updates instantly, and the satellite's virtual reaction wheels spin up to align the spacecraft.
- Dual 3D Visualization: Displays the real spacecraft's body frame (solid RGB axes) chasing the commanded target frame (dashed RGB axes) in real time.
- Realistic Actuator Saturation: Enforces real-world brushless DC motor limits (maximum torque = 4 mN·m), preventing unrealistic instant turns.
- Disturbance Recovery: With one click, inject a ±35°/s tumble spike to observe how the closed-loop controller autonomously detumbles and locks back on target.
The Physics Behind the Controller
-
Quaternion Kinematics: Uses 4-element unit quaternions
q = [w, x, y, z]to eliminate gimbal lock singularities:dq/dt = 0.5 * q * [0, omega] -
Euler Rigid-Body Dynamics: Models the 3U CubeSat (4.0 kg) rotational inertia
I = diag(Ixx, Iyy, Izz):I * (d(omega)/dt) + omega x (I * omega) = Torque_cmd d(omega)/dt = I^(-1) * [ Torque_cmd - omega x (I * omega) ] -
Saturated PD Control Law:
Torque_raw = -Kp * q_err_vector - Kd * omega Torque_cmd = clamp(Torque_raw, -Tau_max, +Tau_max)- Kp = 0.015: Proportional spring action pulling toward the target.
- Kd = 0.050: Derivative damping against oscillations and overshoot.
- Tau_max = 0.004 N·m (4 mN·m): Maximum physical motor torque.
3. Module 2: Python Flight & Space Material Degradation Suite
While MATLAB handles fast, real-time control, the Python simulator (flight_and_material_simulator.py) zooms out to full mission lifespans. It models how space hazards degrade materials over hundreds of orbits.
High-Fidelity Orbital Mechanics
- 4th-Order Runge-Kutta (RK4) Integrator: Propagates satellite position and velocity vectors through orbital time steps.
- J2 Earth Oblateness: Simulates real orbital precession and nodal drift caused by Earth's equatorial bulge.
- Environmental Disturbance Torques: Accounts for aerodynamic drag in upper atmosphere, gravity gradient, geomagnetic dipole coupling, and solar radiation pressure.
The 5 Environmental Hazards
- Solar UV Radiation: Causes photolysis, darkening polymer coatings and increasing thermal absorptivity.
- Atomic Oxygen (AO): High-velocity collisions (relative velocity ~7.8 km/s) chemically erode polymer chains and exposed resins in LEO.
- Ionizing Radiation: Energetic particles create lattice displacement defects and color centers in optical glass.
- Day/Night Thermal Cycling: Deep temperature swings (-150°C in Earth's shadow to +120°C in direct sunlight) create thermo-mechanical stress fatigue.
- Micrometeorite Impacts & Outgassing: Random hypervelocity particle impacts and vacuum mass loss.
Direct Coupling: Materials to Flight Physics
In most engineering tools, material wear and flight dynamics are modeled independently. Here, they directly influence one another:
-
Surface Degradation to Solar Radiation Pressure (SRP) Shift:
As UV and atomic oxygen erode outer coatings, surface reflectivity decreases and absorptivity rises. This alters the solar pressure force:Force_SRP = Solar_Constant * Area * (1 + Reflectivity) / Speed_of_LightThe resulting torque shifts the satellite's equilibrium over time, forcing reaction wheels to store more momentum to maintain pointing.
-
Cover Glass Darkening to Power Loss & Safe Mode:
Ionizing radiation browns the solar cell cover glass, reducing power generation over mission life:Power_gen(t) = Base_Power * Cover_Glass_Integrity(t) Bus_Voltage(t) = 28.0V * [ 0.60 + 0.40 * (Power_gen(t) / Base_Power) ]If bus voltage drops below 22.0V, the flight software automatically demotes itself to LOW VOLTAGE SAFE MODE, shedding non-essential payloads to protect batteries.
4. Space Materials Reference Catalog
| Material | Primary Role | Advantages | Key Space Vulnerability |
|---|---|---|---|
| Aluminum 6061-T6 | Chassis, structural rails | High strength-to-weight, easy machining, good thermal conductivity | Thermal expansion stress, minor surface pitting |
| Carbon Fiber / Epoxy | Solar panel substrates, shear panels | High stiffness, 40% lighter than aluminum, low thermal expansion | Atomic oxygen erodes epoxy resin in LEO |
| Titanium Ti-6Al-4V | Thruster brackets, hinge pins | High tensile strength, thermal barrier | Higher density and machining cost |
| Kapton Polyimide | Thermal MLI blankets | Flexible, stable from -269°C to +400°C | Severe erosion from atomic oxygen, UV darkening |
| Fused Silica (Quartz) | Solar cell cover glass | High optical clarity, radiation resistant | Radiation browning (color centers) under high doses |
5. Architectural Comparison
| Dimension | MATLAB ADCS Simulator | Python Flight & Material Suite |
|---|---|---|
| Primary Domain | Real-time 3D attitude control | Long-duration mission aging & orbital flight |
| Platform | Base MATLAB (R2018b+, zero toolboxes) | Python 3 (NumPy, Matplotlib, Tkinter) |
| User Interaction | Live orientation sliders | Configuration dialog to live telemetry dashboard |
| Kinematics | Unit Quaternions (q = [w, x, y, z]) | Unit Quaternions (q = [w, x, y, z]) |
| Control Law | Saturated PD (4 mN·m clamp) | Saturated PD with momentum dumping |
| Orbit Model | Pure attitude dynamics | RK4 + J2 Earth oblateness propagation |
| Disturbances | User tumble kicks (±35°/s) | Coupled SRP, gravity gradient, aero drag, magnetic |
| Material Physics | N/A | UV, Atomic Oxygen, Radiation, Thermal, Micrometeorites |
| Telemetry Output | Live in-memory rolling scopes | CSV time-series log + formatted TXT mission report |
6. Access the Code & Case Study
- Project Case Study: For step-by-step instructions on running the simulator, reviewing the control scripts, and testing the 3D GUI in MATLAB, visit the CubeSat 3D ADCS Simulator Project Case Study.
- Source Code: Complete open-source repositories and scripts are available on GitHub.