Both the first and second stages have kOS guidance built in. After stage separation, stage 1 performs a boostback (without physics range extender). Stage 2 performs a burn to 100km apoapsis. At 70km, i switch back to stage 1 and let it fly itself back to LZ-1 while stage 2 coasts to apoapsis. Then i switch back to stage 2 to complete the circularization burn. No manual input outside of switching crafts is required.
The real F9-S1 landing guidance uses convex optimization as terminal guidance back to the launchpad. However in kOS the processors are limited to 200 ops/frame. With the help of the trajectories mod, i perform a simple gradient descent and a PID loop to guide the booster to the correct geolocation. Burn start-times are determined by a hardcoded drag coefficient and 0.95x max trust for safety margins.…