AWS Builder Center
Building an Autonomous Satellite Collision-Avoidance System with SGP4, PPO and OpenSearch in Docker

Building an Autonomous Satellite Collision-Avoidance System with SGP4, PPO and OpenSearch in Docker

How I built Orbit Sentinel, a full-stack space traffic system that predicts satellite collisions, scores risk with Chan/Foster physics and three ML models, and plans avoidance burns with a PPO agent. Validated against the 2009 Iridium-Cosmos collision and containerized with Docker and OpenSearch.

The problem: a crowded sky

Over 1,500 tracked objects share low Earth orbit in our catalog, and that is a tiny slice of the real population. When two of them collide at hypervelocity, the debris can trigger further collisions. This chain reaction is called the Kessler cascade, and it can make entire orbital bands unusable.
Most operators still review conjunction alerts manually. I wanted to see how far a single developer could get toward automating the whole loop: predict the collision, score the risk, and plan the avoidance burn. That became Orbit Sentinel.

What Orbit Sentinel does

Orbit Sentinel is a full-stack Space Situational Awareness platform. In one pipeline, it:
  1. Ingests live TLE data from CelesTrak, with SatNOGS as a fallback
  1. Propagates every object with SGP4
  1. Screens all pairs for close approaches
  1. Scores collision probability
  1. Plans a fuel-optimal avoidance maneuver
  1. Shows everything on a live 3D dashboard

Architecture

TLE feed (CelesTrak / SatNOGS) → SGP4 propagation → KDTree broad-phase and parabolic TCA refinement → Chan/Foster 2-D collision probability → ANN classifier and LSTM deviation → PPO maneuver agent and MARL coordinator → FastAPI and WebSocket → React and Three.js dashboard.
Backend: FastAPI (async REST and WebSocket), APScheduler for the 60-second threshold-check loop and TLE refresh, TinyDB by default with optional MongoDB.
Frontend: React 18, TypeScript, Vite, Three.js, Zustand, Recharts, Tailwind.

The interesting engineering

Fast conjunction screening

Checking every pair of 1,500 objects directly is O(n²). I used a  scipy  KDTree as a broad-phase filter (O(n log n)), then refined the time of closest approach with a parabolic fit down to millisecond precision.

Physics-correct collision probability

Collision probability uses the Chan/Foster 2-D formulation, with covariance inflation and the NASA/ESA alert threshold of 1e-4. One detail that matters: the CCSDS CDM standard needs relative position in the RTN frame (Radial, Transverse, Normal). Using raw ECI axis differences gives a geometrically inconsistent Pc integral, so the export projects into RTN properly.

Three ML models, each with a specific job

  • ANN classifier (scikit-learn MLP, 12 features): trained on 50,000 physics-derived synthetic conjunctions and evaluated on a balanced split, giving an honest F1 of roughly 87-91%. It corrects Pc at low miss distances.
  • LSTM (PyTorch): predicts SGP4 residuals at t+72h, which inflate the covariance used in the Pc computation.
  • PPO agent (Stable-Baselines3): trained for 200k steps in a Clohessy-Wiltshire 6-DOF environment, it outputs fuel-optimal delta-v vectors in milliseconds.

Multi-agent coordination

Two satellites dodging the same threat can burn into each other. A MARL coordinator using the CTDE pattern (Centralized Training, Decentralized Execution) shares a global state of planned burns, altitude congestion, and cascade risk, and blocks conflicting maneuvers.

Validation against real history

A model is only believable if it reproduces reality. I tested Orbit Sentinel on the Iridium 33 / Cosmos 2251 collision of February 10, 2009, using pre-collision TLEs from Space-Track:
Orbit Sentinel was validated against the 2009 Iridium 33 / Cosmos 2251 collision using pre-collision TLEs from Space-Track. The pipeline combines raw TLE data with an ANN classifier that corrects the Chan/Foster collision probability (Pc) and an LSTM that predicts 72-hour trajectory deviation to inflate the covariance used in the Pc calculation. Standard operational screening looks 72 hours ahead, but uncertainty at that range is high, so early estimates carry little certainty. In this test, Orbit Sentinel's Pc crossed the 1×10⁻⁴ alert threshold about 18 hours before the time of closest approach, predicted the TCA within 2 minutes of the documented 16:56 UTC, and estimated ~1,500 trackable fragments against ~2,000 catalogued.
Alongside this, a 10-case physics test suite checks RTN axis orthogonality, monotonic Pc behavior, fragment mass conservation, and more.

Shipping it with Docker and OpenSearch

The whole stack runs from one  docker-compose.yml  with three services: the FastAPI backend, the React frontend, and OpenSearch.
OpenSearch is the open-source search and analytics engine created by AWS. I ran it as a single-node container ( opensearchproject/opensearch:2.13.0 ) with a 512 MB Java heap, persistent data in a named volume, and the backend connecting through an  OPENSEARCH_URL  environment variable.
opensearch:
image: opensearchproject/opensearch:2.13.0
environment:
- discovery.type=single-node
- DISABLE_SECURITY_PLUGIN=true
- OPENSEARCH_JAVA_OPTS=-Xms512m -Xmx512m
volumes:
- opensearch_data:/usr/share/opensearch/data
Because everything is containerized, the stack can be brought up anywhere Docker runs, including an Amazon EC2 instance, with  docker compose up --build .

What I learned

  • Physics correctness beats model complexity. The RTN-frame fix and honest, balanced evaluation mattered more than any architecture tweak.
  • Fallbacks keep systems alive. CelesTrak can be blocked or slow, so the SatNOGS fallback and TinyDB auto-fallback kept the app running when infrastructure failed.
  • Validate on real events. The Iridium-Cosmos test is far more convincing than synthetic data alone.
  • OpenSearch is resource-hungry. Even single-node, it needs a machine with enough RAM, so size your host accordingly.

What's next

Deploying the stack on AWS, moving to Amazon OpenSearch Service for managed search, and connecting live Space-Track data for real-time operational use.

Try it

Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article