and are the radius at apoapsis and periapsis respectively. Is the length of the velocity vector, is the flight path angle, is the semi-major axis of the ellipse and is the eccentricity of the ellipse. The following calculations allow us to calculate orbit parameters just from, and : From the simulator, we only have the state vector which does not contain orbit parameters. Perform a circularization burn at apoapsis.įor step 1, we need to know the apoapsis of the orbit in order to stop burning in time.Apply 90% throttle at 10 degrees pitch, until the apoapsis reaches 10 km above the surface.Now that we have a ‘reversed’ simulator, the task is to find a set of control inputs that results in a circular orbit at 10 km above the surface. The differential equations are converted to python and are solved by the solve_ivp function of scipy, with time steps of 0.1s. and are the gravitational constant and mass of Mun. is the vehicle mass, which is the sum of the vehicle fuel mass and dry mass. is the pitch angle relative to the horizontal direction. is throttle, is the thrust delivered at 100% throttle and is the mass flow at 100% throttle. Is positive! Mass is increasing in this ‘reversed’ simulator. is the angle relative to the landing location at the landing time and is the angular velocity. Where is the radius from the center of Mun and is vertical speed. 90% throttle is chosen to leave some margin for control, as we want to do a precision landing of course. The angle can be lowered further, depending on obstacles on the surface of Mun.
Kerbal space program getting to the mun simulator#
The simulator starts with a constant pitch angle of 10 degrees and 90% throttle. The fuel mass is increasing in this ‘reversed’ simulator, but everything else is the same. Instead of starting the simulator in orbit and simulating our way towards the surface, the simulation is started on the landing spot. We built a simulator that implements the orbital mechanics.
![kerbal space program getting to the mun kerbal space program getting to the mun](http://dmitry.burkow.ru/ksp/MunReturn.jpg)
Our method is to first generate a reference approach profile. The varying mass also prevents us from making a simple calculation. However, Mun is not a perfectly spherical body and this approach would risk us to fly into a mountain.
![kerbal space program getting to the mun kerbal space program getting to the mun](https://images.ctfassets.net/2lpsze4g694w/PgJCAM7nZtFtgF4ZWnxaU/dddae00b35b587d09763fd5a53de3218/kerbal_space_program_2__13_.png)
An almost horizontal suicide burn then kills of all horizontal velocity. Methodologyįor a perfectly spherical body, the ideal trajectory would be to place the periapsis just centimeters above the surface. Using kRPC, we have written an autopilot that executes the landing automatically. This is an over-engineered attempt to perform a very efficient Mun landing, which I worked on together with my friend Joost Meulenbeld.