KSP F9 Flight GNC


Kerbal Space Program (KSP) is a game where you can build your own rockets and fly them around a smaller scale solar system. The base game provides a lot of potential and entertainment launching many different payloads to different planets and orbits. I noticed that I liked trying to run realistic missions, for example trying to land a small lander on Mars (Duna) with a reasonable low delta v single stick two stage rocket. Since I am a huge fan of SpaceX and their Falcon 9, I decided to see if I could replicate their missions. To do this I installed several mods for KSP including the SpaceX Launchers Pack (to provide the Falcon 9), the Realism Overhaul and Real Solar System mods (to allow me to fly from real launch sites in a real scale solar system), and kOS (which provides a language which rockets can be programmed in). Thus began my very ambitious journey to write a program which can autonomously fly a complete mission replica of a Falcon 9 launch. My stretch goal (of my already way to ambitious goal) is to write the software such that I (or anyone) can give it the mission parameters (i.e. target orbit) and it could do it live, in time with an actual launch.

Current Status

Early Development: A very rough script has been put together, and it can (not very elegantly or accurately) launch a satellite to orbit and perform a RTLS landing. A demonstration of this can be seen below. There is still a large amount of work to be done to increase the accuracy, reliability, and performance of the script. Since I am doing this in my limited free time, it will likely take a long time, but I will also be documenting (hopefully in great detail) all the steps I take, both to keep an organized archive of of the progress for my own use, and to help aid anyone else who is looking to do a similar thing, or is just interested in how this works.

GitHub: The project is hosted on GitHub at this link.


Below are links to each step of the development process, in the most intuitive order (theoretically chronologically, but I may make some changes).