A comprehensive kOS autopilot system for Kerbal Space Program featuring automated gravity turn launches and SpaceX-style booster recovery.
- 🚀 Automated Gravity Turn - Smooth, efficient ascent to orbit
- 🎯 Asparagus Staging - Automatic fuel monitoring and staging
- 🛬 RTLS Booster Recovery - SpaceX-style return-to-launch-site landing
- 🎮 Full Autonomy - Set it and forget it
- 📊 Multi-Booster Support - Handles multiple boosters with automatic spacing
- Load your rocket on the launchpad
- Open kOS terminal
- Stage once to activate engines
- Run:
RUN 0:/launch.
launch.ks- Main launch autopilot (runs on main vessel)autoland_staging.ks- Booster landing autopilot (runs on each booster)
lib/util.ks- Utilities, math, LATLNG functionslib/guidance.ks- Trajectory prediction & impact calculationlib/ascent.ks- Gravity turn & staging logiclib/circularize.ks- Orbital circularizationlib/boostback.ks- RTLS boostback guidancelib/entry.ks- Entry burn & descent controllib/landing.ks- Suicide burn & touchdown
test_system_logged.ks- Comprehensive system test with file loggingtest_debug.ks- Debug script for troubleshooting
- kOS processor (10000+ bytes recommended)
- Proper staging configuration
Each booster must have:
- ✅ Probe core or command pod
- ✅ kOS processor (5000+ bytes)
- ✅ At least one throttleable engine
- ✅ Landing legs
- ✅ Power source (battery/RTG)
- ✅ Reaction wheel or RCS
- Airbrakes for descent control
- RCS thrusters for precise steering
- Grid fins
Edit parameters at the top of launch.ks:
SET TARGET_APOAPSIS TO 100000. // Target orbit (meters)
SET TURN_START_ALTITUDE TO 100. // Start gravity turn
SET TURN_END_ALTITUDE TO 45000. // Complete turn
SET TURN_SHAPE TO 0.5. // Turn profile (0.4-0.6)
SET STAGE_FUEL_THRESHOLD TO 5. // Stage at 5% fuelEdit booster landing parameters in autoland_staging.ks:
SET SUICIDE_MARGIN TO 1.20. // 20% safety margin
SET BOOSTBACK_MAX_BURN_TIME TO 60. // Max RTLS burn time
SET LANDING_OFFSET_SPACING TO 10. // Booster separation (meters)- Vertical Ascent (0-100m) - Full throttle climb
- Gravity Turn (100m-45km) - Gradual pitch over
- Asparagus Staging - Automatic when fuel <5%
- Coast to Apoapsis - Engines cut at target altitude
- Circularization - Burn at apoapsis for circular orbit
Each booster independently executes:
- Post-Separation Coast (2-3s) - Clear main rocket
- Flip Maneuver (5-10s) - Rotate to retrograde
- Boostback Burn (0-60s) - Return to KSC trajectory
- Coast to Entry - Ballistic arc with airbrakes
- Entry Burn (optional) - If speed >800 m/s at 15km
- Descent - Retrograde orientation, calculate suicide burn
- Suicide Burn - Adaptive throttle for soft touchdown
- Touchdown - Land at <2 m/s vertical speed
Boosters automatically space themselves:
- Booster 1: -10m west of target
- Booster 2: Center (0m)
- Booster 3: +10m east of target
- Booster 4+: Pattern continues
Run the system test before first launch:
RUN 0:/test_system_logged.Check test_results.txt for detailed output.
- Increase
BOOSTBACK_MAX_BURN_TIME(try 90) - Decrease
BOOSTBACK_TARGET_ERROR(try 300)
- Decrease
BOOSTBACK_MAX_BURN_TIME(try 45) - Increase
BOOSTBACK_TARGET_ERROR(try 700)
- Increase
SUICIDE_MARGIN(try 1.25-1.30) - Check TWR >1.5 required for safe landing
- Decrease
SUICIDE_MARGIN(try 1.15)
- Increase
TURN_END_ALTITUDE(try 50000-55000) - Increase
TURN_SHAPE(try 0.6)
KERBOSCRIPT_REFERENCE.md- Complete kOS language referenceREADME_LAUNCH_SYSTEM.md- Detailed system documentation
Based on research from:
- chippydip's suicide burn algorithm
- Patrykz94's kOS-RTLS-Landing
- kOS community documentation
KSP Version: 1.12.5 kOS Version: 1.4.0+ Last Updated: 2025-03-22
Free to use and modify. Attribution appreciated.
Happy launching! 🚀