SpaceX Autopilot
Project · Software & hardware · 2025A program that docks the Dragon capsule to the ISS on its own.
Scroll ↓My diploma thesis at HTL Vöcklabruck, together with ABATEC GmbH: an autopilot for SpaceX’s official docking simulator and a control panel built from real hardware that hands over to the autopilot at the push of a button. My part was the software – from reading the website and the control algorithm to an attempt to learn docking with reinforcement learning.
- Client
- ABATEC GmbH
- Year
- 2025
- Role
- Autopilot, web scraping, AI experiments
- Team
- Team of two · diploma thesis at HTL Vöcklabruck
- Duration
- 15 months
- Tools
- Python · Selenium · TensorFlow · Raspberry Pi 5 · PyCharm

Docking without an interface.
The simulator at iss-sim.spacex.com shows what NASA astronauts see too: eleven telemetry values and twelve control buttons. Only when position and attitude are at zero and every rate is below 0.2 does the capsule dock.
There is no programming interface. The autopilot has to read and operate the website like a person. ABATEC wanted an eye-catcher for trade fairs: a panel where visitors fly themselves and, at the push of a button, watch the autopilot take over.

Read, calculate, press.
Selenium reads the values straight from the page. Each axis is an object with two buttons, a rate and an error. From these the algorithm calculates a target speed: five percent of the remaining error – the closer to the target, the slower.
If the rate is too high or too low, the program presses the matching button – in a loop over all six axes until “Success” appears. On the Raspberry Pi 5 inside the control panel, one button switches between manual control and autopilot at any time.

The simulator
At iss-sim.spacex.com SpaceX offers a simulator in which the Dragon capsule docks to the International Space Station – with the same kind of displays astronauts use.
Eleven telemetry values describe the situation: the distance on three axes, the attitude in roll, pitch and yaw with one rate each, plus the straight-line range and an overall rate. Twelve buttons move or rotate the capsule. The zero point sits at the ISS docking port.

Web scraping with Selenium
Without an interface, only the surface remains. Selenium opens the page, clicks “Begin” and finds every display and every button by its CSS identifier.
Each axis is an object of the HudItem class: two buttons, the identifier of the rate and of the error. That way one loop handles all six axes the same way.
For the three position axes the simulator shows no individual rate, only a combined one. So I calculate it myself: the change of the error since the last reading, divided by the time that has passed.

The control algorithm
The core is one line: expectedRate = error × 0.05. The desired speed is always five percent of the remaining error. Far away the capsule moves fast, close to the target only slowly – it brakes by itself.
If the measured rate is below the target, the program presses one button of the axis, otherwise the other. One special case applies to the last five metres: there the capsule approaches the station at a fixed rate of −0.3 m/s.
The result was an autopilot that docks reliably. The biggest hurdle was not the calculation but Selenium itself: it reacted at different speeds depending on the machine, and the code had to be adapted once more for the Raspberry Pi.
The AI attempt
In addition, an autopilot was meant to learn docking by itself. I evaluated three approaches – the PILCO algorithm, reinforcement learning with TensorFlow and OpenAI Gymnasium – and chose TensorFlow.
The neural network receives the eleven telemetry values and picks one of twelve buttons. A reward system scores every step: getting closer earns points, too large distances and spin rates cost a lot. Several browsers trained in parallel without a window, and their models were merged afterwards.
After seven days of training the capsule no longer spun out of control – but it never got close to the ISS. Possible reasons: wrong priorities in the reward system or an undiscovered bug. One small model per axis would probably have been simpler. For the Raspberry Pi the training was too heavy anyway.

Hardware and switching
My project partner built the control panel: a Raspberry Pi 5 with 8 GB, twelve illuminated buttons for steering, a start and an autopilot button, and a 5-inch display showing time and mode. The housing made of film-faced plywood was designed in Creo; its shape is inspired by the Cybertruck.
To make switching work, manual control lives in the same code as the autopilot. One press of the autopilot button is enough, and the program takes over mid-flight – or hands control back.

Scraping, algorithm, first docking.
Raspberry Pi, prototype, code on the Pi.
PILCO, reinforcement learning, training.
Final panel, thesis, presentation.