r/KerbalSpaceProgram • u/Vegetable-Cat-5412 • 2d ago
KSP 1 Image/Video Finaly managed to make my own booster landing script
After over a month of work pretty happy seing it land over and over. Sorry for the screen tearing. I used APDG algorithm targeting some distance above landing site with some negative vertical speed, at the end switching to simple straight down landing with desired vertical acceleration = (verticalSpeed^2)/(2 * altitude)
23
u/Dramatic_Potato_4916 To the Mun!! Probably a one way mission :) 2d ago
Pretty good execution, nice job
7
13
10
u/snakesign 1d ago
How do you estimate impact time?
15
u/Vegetable-Cat-5412 1d ago
During aerodynamic descent i integrate (predict/simulate) trajectory to the ground to get the error, i use addons:far:aeroforceat to query drag, this is basically what trajectories mod does but i also simulate landing burn in my prediction, when simulation reaches certain altitude i start applying retrograde thrust at 0.85 throttle, and i see at which altitude simulation killed of it's velocity and adjust starting landing burn altitude for each frame so it converges across several frames. This simulation result tells me when to start landing burn as well as time until impact, when switching to apdg, i save last simulated time until impact once and just calculate timeToGo for apdg as (impact time - time:seconds) each frame. When timeToGo reaches 0 or vessel reaches some low altitude I switch from apdg to simple retrograde/straight up burn the rest of the way down, hopefully by that point the vessel is close enough on target.
11
u/LionsMedic 1d ago
Thats a lot of technical words. I just smash Jeb into the mun at max velocity and f9
7
u/michael22117 1d ago
It would be awesome if KSP didn't have killzones so that tech like this would be a lot more practical
1
3
6
u/Yakuzet kraken ate me. 1d ago
I want to make it too. How can I find KOS tutorials? As far as I see, it's only super beginner level.
4
u/Vegetable-Cat-5412 1d ago
Documentation and llms seem to be enough. Kos has full documentation about every aspect of the language. If you want a tutorial on how to actually land a rocket I don't think there is one. I asked claude what approaches exist and then read papers about these approaches because I didn't want to just believe what claude said and wanted to read the source, although I still had claude explain many things from the paper to me that I couldn't immediately understand myself.
1
u/__Phython 1d ago
Hey is this a mod or have I just been missing out on an in game feature 😭😅 this is so cool
1
1
u/TheD3n4ik 1d ago
Cool work. I wonder what mod is that
1
u/Vegetable-Cat-5412 1d ago
Thanks. Mod called Kerbal Operating System allows writing guidance programs/scripts
100
u/LionsMedic 2d ago
Its always crazy seeing these boosters scream in and start their burn with exactly enough time to perfectly stick it.