Jump to content

Best Suicide Burn/Gravity Turn


arthur106

Recommended Posts

I'll just leave this here...

 I'd like to write a Matlab script to accurately determine the altitude to start the burn so that you end up with a perfect burn every time.  The biggest problem is that the surface elevation changes, and as far as I know, there's no way of setting a target on the surface and knowing it's elevation beforehand, right?

Link to comment
Share on other sites

That's got to feel pretty awesome!

I think kerbal engineer is able to pull height data at arbitrary points. If memory serves, it would need to do that for bodies with atmospheres where it does a projected impact location that differs from the raw trajectory. Or I could be wrong and it may just be making a guess using the altitude at the games projected point of impact as a proxy value.

 

There is also the kerbNet system, which has altitude data. I'm not sure about accessing that data for a script, but that might have potential.

 

The real trick to me is not just pulling off the suicide burn (which is plenty hard enough), but doing so and landing in a specific place. To that end, perhaps a script that uses a target vessel on the surface for the calculations, at least to start with. It would provide precise location and altitude information you need, and I think plenty of us would find even that more limited application super useful (you tend to waste a lot of fuel trying to land ships together - at least I do).

 

 

 

Link to comment
Share on other sites

Seems to me that if you have a known target on the surface, and a known orbit that will cross above that target, that you could work backwards from the ground, integrating backwards until you find yourself in orbit at the desired height.  Whatever location that is, is where you should start your suicide burn :)

(I know, easy to say, but I'm not so great at calculus to simply whip it up...)

Link to comment
Share on other sites

Actually for every celestial body there is a function to get the surface altitude for any latitude and longitude, so the question is only how do you get it into Matlab ?

MechJeb Landing function lets you pick a target on the map and then outputs the altitude as well, while KER has output for a perfect suicide burn.

Link to comment
Share on other sites

  • 1 month later...
On 3/7/2020 at 9:02 AM, CBase said:

Actually for every celestial body there is a function to get the surface altitude for any latitude and longitude, so the question is only how do you get it into Matlab ?

MechJeb Landing function lets you pick a target on the map and then outputs the altitude as well, while KER has output for a perfect suicide burn.

Ooooh, I like this idea.  So you mean there's an actual equation that the developers used?  Or an equation approximation, like using spherical harmonics or something similar?  Either way, this seems like the way to go.

Link to comment
Share on other sites

On 3/6/2020 at 9:11 AM, Shadowmage said:

Seems to me that if you have a known target on the surface, and a known orbit that will cross above that target, that you could work backwards from the ground, integrating backwards until you find yourself in orbit at the desired height.  Whatever location that is, is where you should start your suicide burn :)

(I know, easy to say, but I'm not so great at calculus to simply whip it up...)

I like that idea and I was thinking of using some sort of initial condition to work backwards from (i.e. Height above ground, pitch, heading, surface velocity, mass, etc...)  This won't suffice entirely, as the mass at this point will be unknown.  I could definitely approximate it, however, and run an iterative process to get everything working quite well.
I'm thinking the most efficient way would be to integrate backwards from this initial condition, varying the initial pitch until a full throttle gravity turn results in a circularized orbit at some altitude, and then Hohmann Transfer up to whatever the original parking orbit is?

This method obviously wouldn't be great for vehicles with a high TWR landing in areas surrounded by mountainous terrain, but this could be overcome by tweaking some parameters specific to the landing location..

Edited by arthur106
added content, last paragraph
Link to comment
Share on other sites

8 hours ago, arthur106 said:

So you mean there's an actual equation that the developers used?

For getting the terrain height of course there are documented API functions:

https://kerbalspaceprogram.com/api/class_celestial_body.html#a3a7c07a805f442124a523a149923f8a6

The calculation of perfect suicide burn is something different. I only displayed the readout from Kerbal Engineer Redux (KER) Addon in KSP, but never thought how it is calculated. For non atmospheric bodies you can rely on KSP Orbit Class calculations, which does a great job on all spherical 2-body gravitation equations:

https://kerbalspaceprogram.com/api/class_orbit.html

The current orbit can be retrieved from the vessel Object.

Since KER has a suicide calculations, you might want to look how they did it (actually it seems they didn't like calculus and physics that much as well):

https://github.com/jrbudda/KerbalEngineer/blob/master/KerbalEngineer/Flight/Readouts/Surface/ImpactProcessor.cs

Basically they follow the orbit until it hits the ground and then do interval search for a breakpoint.

Fun fact: KER developers never used the TerrainAltitude property, but some more complex based on rotation matrices, although it might not been there at the time when it was coded.

 

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...