Skip to content
Simulation 2025 12 / 14

Lunar Landing Simulation

PID control that lands a spacecraft softly — inspired by the Beresheet mission.

Built with

Language

  • Python

Skills & tools

  • NumPy
  • Pandas
  • Matplotlib
  • PID control
  • Physics simulation
Deep star field

A 2D lunar-descent simulation with PID-controlled vertical speed, dynamic angle targeting and braking logic, logging full telemetry to CSV and Excel.

The challenge

Israel’s Beresheet lander crashed on the Moon in 2019. This simulation asks: what control logic would have landed it?

Approach

  • A PID controller holds vertical speed to a target that shrinks with altitude.
  • The spacecraft’s angle is steered from 60° toward 0° as it closes in on the target.
  • Extra horizontal braking kicks in below 3,000 m.
  • Every step is logged — time, altitude, speeds, angle, fuel and throttle — and exported for analysis.
  • Telemetry from a full simulated descent — altitude, horizontal and vertical speed.