• ⚠️ Mod Release Rules now apply to this board.

    All mods must include a license, source code (for executable mods), and proper attribution.

    Read the full rules here before posting.

Tools Powered Guidance

cairn5

New Member

Powered Guidance​

Guidance for Kitten Space Agency (KSA): guidance for powered ascent and powered descent, allowing accurate orbit targeting and pinpoint landing.

Unified Powered Flight Guidance​


The UPFG program is the program that was used to guide the Space Shuttle to its desired orbit, as well as providing capability for other orbital manoeuvres. The implementation of Mode 1 (standard ascent) is explained extremely well by the wonderful 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.

G-FOLD and Lossless Convexification


For the terminal landing, we 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 minimum and maximum thrust, thrust pointing, glide slope 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 an Euler angle command and a throttle setting. Therefore, the solver can fail when rapid changes of direction are required, as the 6-DOF 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.

Installation​

  1. Install StarMap.
  2. Download the latest release from the Releases tab.
  3. Extract into Documents\My Games\Kitten Space Agency\mods\PoweredGuidance\.
  4. The game auto-discovers new mods and prompts you to enable them. Alternatively, add to Documents\My Games\Kitten Space Agency\manifest.toml:
Code
[[mods]]
id = "PoweredGuidance"
enabled = true

Dependencies​

PackagePurposeTested version
StarMapMod loader, required at runtime (see Installation)0.4.5

Build dependencies​

Required only to build the mod from source. Targets .NET 10.
PackageSourceTested Version
StarMap.APINuGet0.3.6
Lib.HarmonyNuGet2.4.2

License​

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.

Credits​

  • ECOS (embotech) — the conic solver, GPLv3.
  • PEGAS by Noiredd — reference and foundation for the UPFG implementation.
  • G-FOLD — Açıkmeşe & Blackmore, lossless convexification of powered-descent guidance.

Source​

GitHub Repository: https://github.com/cairn5/PoweredGuidance

Latest Release: https://github.com/cairn5/PoweredGuidance/releases/latest
 
Powered Guidance 0.2.0

Updated compatability with new staging menu, added ascent overlay, tweaked landing parameters

- Ascent params moved into the main Ascent tab (no more separate popup), expanded
by default alongside the target orbit.
- Added a map/world overlay for ascent: target orbit in cyan, flown trajectory in
magenta. Toggleable, and hidden while the Landing tab is open.
- Stage table now shows delta-v per stage, and is visible before you hit EXECUTE
so you can check your staging on the pad.
- Moved the G-FOLD-to-hover handoff setting into the Deorbit tab, next to the rest
of the approach settings.
- Touchdown is now detected by actual ground contact instead of an altitude
guess, for both G-FOLD descent and terminal hover — engines cut the instant any
part of the vehicle touches down.
- Fixed: solid rocket boosters were treated as having no propellant, so their
fuel and thrust were missing from the ascent stage list.
- Auto-staging now also drops burned-out boosters that are still attached to a
live core, not just at total engine flameout — and won't ever separate the part
of the vehicle you're actually flying.
- Fixed: disengaging the autopilot could leave the vehicle spinning uncontrollably,
and could make the Strict/Balanced/Relaxed attitude presets stop responding.
 

Attachments

  • Screenshot 2026-08-03 120553.png
    Screenshot 2026-08-03 120553.png
    1.3 MB · Views: 0
  • Screenshot 2026-08-03 120457.png
    Screenshot 2026-08-03 120457.png
    763.4 KB · Views: 0
PoweredGuidance v0.3.0 is out now! - KSA v2026.8.19.5261

Hey guys, excited to share the new version of PoweredGuidance! I'm hoping it's actually in a state now where people will be able to have a play around with it. New features are the new **CAT-S** solver for advanced realtime landing problems, as well as UI updates to make the experience more consistent with KSA.

### See a demo!

### Check out the repo

[0.3.0] Changelog

Added sequential convex programming and UI updates.

- Implemented Convex Approximation for Trajectories - Sequential Algorithm (CAT-S), allowing accurate control of vehicles with high rotational interia, and paving the way for aerodynamic entries.

- Added new UI designed for the end-user. New UI elements such as UPFG visualiser, landing visualiser and descent pass planner.

- Added multi-vehicle control with independent PoweredGuidance instances.

- Tweaked orbit overlay.

- New logo.
 
There's something so fun about watching the rockets just hover in place before touchdown.
 
For some reason it disables itself all the time for me after some seconds, not sure what's going on. Tested guided ascent to LEO.
 
## [0.4.0]
Boosters fly themselves home. Returnable stages with their own landing sites, and a move to MIT.
- Added **boostback guidance**. EXECUTE on the new Boostback tab flies a separated booster back toward its landing site — settling burn, flip, boostback burn, then entry attitude — and it keeps flying whether or not you are watching it. RETARGET works there, so the site can be moved mid-flight.
- Boosters hand themselves over at separation: the stage that drops away starts its own boostback with its own landing site while you stay with the upper stage.
- Added **returnable stages** to the Ascent tab. Any stage that separates carrying a command pod is listed with its own **Set target** button and a live return cost that falls as you climb, so you can see when bringing it back becomes affordable.
- Added **Booster reserve dV**, per vehicle. Ascent leaves that much propellant in the booster and stages on it, rather than burning the stage dry and leaving nothing to come home on.
- The Boostback tab draws where the vehicle will actually hit the ground — through the atmosphere rather than in vacuum — with time to impact, impact speed, and the miss against your landing site.
- **The project is now MIT licensed.** ECOS was the only copyleft dependency and forced the whole work to be GPLv3. It has been replaced by [Clarabel](https://github.com/oxfordcontrol/Clarabel.rs), which reproduces its landing solutions exactly. Attributions are in THIRD-PARTY-NOTICES.md; releases up to and including v0.3.1 remain GPLv3.
- KSA 2026.9.7.5402 compatibility.
 
For some reason it disables itself all the time for me after some seconds, not sure what's going on. Tested guided ascent to LEO.

That's strange, if you get the time please could you try with the new version and let me know if this continues to happen?
 
Ascent works now. Landing I have no clue how to make it work, but I'm sure that's a me issue.
Thanks for letting me know! The landing is quite fiddly, perhaps i should put together a user's guide.

The main thing is that the "Landing" modes won't activate unless the vehicle is in a sensible position and can physically make the landing. This usually means already heading in the vague direction of the target with a sensible velocity, and within a few km altitude.

The "Descent" mode is designed to get you to this position on bodies without atmosphere.

The "Boostback" mode is designed to get you there on bodies with atmosphere. (Waiting for proper aero to make in-atmosphere corrections)
 
Landing I got working now, nice (although landing legs break on touch down, but that's an issue with the latest build...). But descend, no idea how it is supposed to work. I use the RETARGET to select a landing location, hit EXECUTE and it just time warps until I'm right over the (or closest to) the destination and then burns all my fuel - of course, without getting even close to the target destination. Pretty sure it's again my fault. But I don't understand how it is supposed to be used 🙈
 
1788626064201.png

I think I found a bit of a rendering bug. The desired orbit is free roaming around my monitor!
 
Back
Top