spectrachrome / kOS_FlightControllerScripts

A home for my kOS scripts and their documentation, so that I can spacefare programmatically in Kerbal Space Program.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Kerion Launch Scripts

This repository is a personal collection of mine, which contains scripts that can be executed on the kOS virtual machine to control virtual spacecraft in Kerbal Space Program.

For now, we'll use the following formula to calculate how much we need to pitch sideways during the ascent, roughly simulating a gravity turn and thus making sure the vehicle follows a fuel-efficient path and does not not experience large aerodynamic stresses during flight.

This calculates the ascent angle from the planned apoapsis height and the current altitude. Retrieving the exact starting angle for a real gravity turn is a bit more difficult, so this will do for now.

The equation shown here is the cycloid curve equation for the y parameter, which has been transformed to yield the tilt angle θ (referred to as t in the article) which represents how many degrees our spacecraft will pitch eastwards during the ascent. The graph traced by this equation looks like this, where the vertical parameter θ represents eastward heading angle in degrees and the horizontal paramater x represents altitude in kilometers:

The engine will shut off once the apoapsis is at the target distance, so only during a part of the curve thrust will be actually applied. The exact time for shut-off depends on the configuration of the rocket.

About

A home for my kOS scripts and their documentation, so that I can spacefare programmatically in Kerbal Space Program.