Skip to content

DinithMadushan/CubeSat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 

Repository files navigation

CubeSat Attitude and Orbital Control Simulator

Python Pygame License: MIT

🚀 Overview

A realistic CubeSat attitude and orbital control simulator built with Pygame, NumPy, and PID controllers. Features interactive 3D visualization, orbital mechanics simulation around multiple planets (Earth, Mars, Jupiter, etc.), live telemetry, attitude graphs, and PID-based stabilization.

Key Physics:

  • Gravitational orbital dynamics (Newtonian gravity)
  • PID attitude control (roll, pitch, yaw)
  • Orbital thrust correction for stable circular orbits

Demo Screenshot (Add your screenshot/video here)

✨ Features

  • Multi-Planet Support: Simulate around Earth, Mars, Jupiter, Venus, Saturn
  • Real-time 3D CubeSat Visualization: Projected cube with rotation, orbital trail
  • PID Controllers: Independent roll/pitch/yaw stabilization with configurable gains
  • Orbital Mechanics: Gravity, thrust correction, orbit decay/escape detection
  • Interactive GUI:
    • Login screen (Demo: Username Dinith, Password 2002)
    • Live attitude graphs (Roll/Pitch/Yaw)
    • Scrollable telemetry panels (position, velocity, attitude history)
    • Off-attitude warning log
    • Controls: Play/Pause/Stop/Reset, speed adjustment, keyboard disturbances
  • Auto-Stabilize: One-click recovery from unstable attitudes/orbits
  • Responsive UI: Resizable window, planet details popups

📦 Quick Start

Prerequisites

Installation

pip install pygame numpy simple-pid

Run

python system.py

🎮 Usage

  1. Login: Use Dinith / 2002
  2. Select Planet: "Change Planet" → Pick Earth/Mars/etc.
  3. Start Simulation: Click "Start/Resume"
  4. Controls:
    Action Key/Button
    Disturb Attitude Arrow Keys
    Speed ± Slow/Fast buttons
    Stabilize "Auto-Stabilize" (when unstable)
    Toggle Panels History/Sat/Warnings
  5. Monitor: Watch telemetry, graphs, warnings

🐛 Troubleshooting

  • Pygame Install Fail (Windows): Install C++ Build Tools → Restart terminal → Retry pip install pygame
  • Import Errors: See TODO.md for status
  • Verify deps: python -c "import pygame, numpy, simple_pid; print('OK')"

🔧 Development

  • Main file: system.py
  • Edit PID gains in AttitudeController / OrbitalController
  • Add planets to PLANET_MODELS

📋 TODO

See TODO.md for dependency fixes and enhancements.

🤝 Contributing

Fork → PR with blackboxai/ branch prefix.

📄 License

MIT License - see LICENSE (create if needed)

Author: Dinith (CubeSat Team)
Repo: DM-GITHUB/CubeSat

About

CubeSat attitude control

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages