Skip to main content

Simulation

The Moonlander simulation is a modular spacecraft dynamics environment implemented in C++, designed for propulsion, guidance, and control experimentation.

The current system supports three-dimensional translational dynamics with vectorized thrust representation and a multi-engine propulsion architecture. The simulation is structured to evolve toward full 6-DOF spacecraft dynamics while maintaining clear subsystem boundaries.

Simulation Demonstration

The following example shows a representative simulation run including spacecraft motion, propulsion response, and real-time telemetry visualization in the cockpit interface.

Architecture & Data Flow

The simulation is built around a modular C++ backend with a clear separation between physics, propulsion, control, and visualization.

  • Simulation Core: C++ backend for dynamics, propulsion, and control
  • Propulsion System: Central Thrust Orchestrator managing multiple engines and fuel tanks
  • Command Flow: Separation of commanded input, actuator state, and physical thrust output
  • Telemetry Interface: Thread-safe communication between backend and Qt frontend
  • Frontend: Qt-based cockpit for real-time visualization and operator interaction
Explore Architecture

Propulsion Modeling

The propulsion subsystem is based on a multi-engine architecture with a centralized Thrust Orchestrator. Each engine is modeled independently and contributes to the overall thrust vector.

  • Main Engine: Scalar thrust model with dynamic response (ME_ThrustState)
  • RCS: Vector-based thrust commands for translational control (RCS_ThrustState)
  • Engine Selection: EngineType interface for querying subsystem or total thrust
  • Fuel System: Multi-tank support with engine-specific consumption

This separation allows physically consistent modeling while supporting flexible control strategies and future actuator extensions.

Model Scope & Assumptions

  • Three-dimensional translational spacecraft dynamics
  • Central lunar gravity model
  • Discrete-time numerical integration
  • Vectorized thrust representation
  • Multi-engine propulsion architecture

The current model intentionally excludes rotational dynamics and full 6-DOF rigid-body simulation. The architecture is designed to support these extensions in future development stages.

A detailed mathematical formulation is provided in the Mathematics section.