This mod is not known to work with the latest version of Kitten Space Agency. Proceed with caution.
Guidance for Kitten Space Agency (KSA): guidance for powered ascent and powered descent, allowing accurate orbit targeting and pinpoint landing.
The UPFG program is the program that was used to guide the space shuttle to it's desired orbit, as well as providing capability for other orbital manoeuvres. The implementation of mode 1 (standard ascent) is explained extremely well by the PEGAS mod for KSP https://github.com/Noiredd/PEGAS-MATLAB/blob/master/docs/upfg.md
This mod iterates by including mode 2 from the UPFG paper "Ascent to Reference trajectory", which allows us to drive the cutoff position to a desired point by modulating throttle. This can not only be used to target a reference trajectory on launch, but also to fly the vehicle to a precise landing point.
For the terminal landing, we can use JPL's G-FOLD Algorithm developed by Blackmore et al. http://larsblackmore.com/iee_tcst13.pdf
This provides fuel optimal landing at a designated point, subject to constraints on min and max thrust, thrust pointing, glideslope and maximum speed. This is achieved by formulating a second-order cone problem, and solving it multiple times a second to provide a constantly updating solution which is able to cope with disturbances and modelling uncertainties.
The thrust direction and magnitude are fed to KSA's autopilot as a euler angle command and a throttle. Therefore, the solver can fail when rapid changes of direction are required, as the 6dof dynamics are not accounted for. For this reason, it will likely provide better results with an agile lander using rcs for pointing, rather than the large default rocket with a large coupling between thrust and control rate due to thrust gimballing.
G-FOLD is a very clever algorithm, but it has it's limitations. It is fundamentally linear, and is therefore unable to handle nonlinearities such as vehicle rotation or air resistance. For precise control of vehicles with high rotational inertia and/or flying in an atmosphere, G-FOLD is insufficient.
To solve this problem, this mod uses a method called sequential convex programming. The CAT-S (Convex Approximation for Trajectories - Sequential) algorithm is a custom written algorithm for this problem, and does not correspond exactly to any published research paper. The guidance loop gets state data from KSA, then guesses a reference trajectory (doesn't have to be a good guess) between our current conditions and our final (terminal) position. We then linearise the system dynamics around this trajectory, and send this convex sub-problem to an external solver (SCS.dll) to be solved. We then repeat this process, linearising around the new slightly improved trajectory, to converge to an optimal trajectory.
Documents\My Games\Kitten Space Agency\mods\PoweredGuidance\.Documents\My Games\Kitten Space Agency\manifest.toml:[[mods]]
id = "PoweredGuidance"
enabled = true
| Package | Purpose | Tested version |
|---|---|---|
| StarMap | Mod loader, required at runtime (see Installation) | 0.4.6 |
Required only to build the mod from source. Targets .NET 10.
| Package | Source | Tested Version |
|---|---|---|
| StarMap.API | NuGet | 0.3.6 |
| Lib.Harmony | NuGet | 2.4.2 |
GPLv3 — see LICENSE. This is required because the mod links the vendored
ECOS solver, which is GPLv3; the whole work is therefore distributed under GPLv3.
Raw stats are from the beginning of time until now. Each follower and download entry represents one hour of data. Uneventful hours are omitted.