Jump to content

[WIP] Improved Non-Atmospheric Landings v0.2 (2016/02/25)


timchap

Recommended Posts

Hi there!

Have you ever injected from solar orbit into a highly horizontal suborbital trajectory towards a huge lumpy rock, and wondered...

1cAMrNj.png?2

...What is the most delta-V efficient way to bring my vessel to a safe landing?

Well, wonder no more!

Download

Source

As you may be aware, the delta-V-optimal way to come to a stop over a non-atmospheric body is using 100% retrograde thrust (relative to surface). However, begin thrusting too early and you will come to a stop with a long way yet to fall - on the other hand, begin thrusting too late and you will find that the surface forcibly assists your deceleration. Finding the perfect balance is a mathematically non-trivial problem. To this end, I have developed a successive approximation numerical landing solver: the Improved Non-Atmospheric Landings (INAL) mod, which allows you to pull of scary-ass landings like this:

 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

How to use it:

Spoiler
  1. Be on a suborbital trajectory towards a non-atmospheric body (ideally within a few minutes of impact for best results). If you're starting in a stable orbit, just fire retrograde at your apoapsis until your trajectory kisses the surface.
  2. Open the INAL window from the top-right toolbar.
  3. Hit "Calculate Descent".
  4. The game will pause! This is one of the key limitations of this mod, and I understand that it's pretty annoying. However, due to the grindiness of the algorithm, it is currently the most viable implementation.
  5. If the calculation is taking too long, you can "accept" the best-trajectory-so-far offered by the dialogue box - basically, this is a sub-optimal landing trajectory that result in you stopping at a higher altitude. If you wait for the calculation to finish, you can expect a final stop height of under 50m.
  6. Once the calculation is complete (or you have accepted a trajectory), the game will resume.
  7. Hit "Activate Autopilot".
  8. The autopilot will auto-warp and execute the calculated descent.
  9. Once the vessel has slowed sufficiently, the vessel will cut thrust and recalculate the descent "live" (a la most conventional landing calculators).
  10. Touchdown! (Hopefully - this is a WIP, after all)

Other recommendations for use:

Spoiler
  1. This is not the most consistent or user-friendly tool and usually only achieves marginal delta-V benefits over a conventional circularization-and-suicide-burn descent, so I expect that is used mostly to assist in desperate situations or challenge-type missions.
  2. It is highly recommended that you quicksave before activating the autopilot, since crashes (of the vessel, not the game) are known to occur (see issues below).
  3. You will get the best results (quickest solutions and most efficient landings) if you delay the calculation closer to impact (e.g. 2 minutes before impact instead of 2 days).
  4. For obvious reasons, the vessel must be in essentially the same state when the calculation is performed and the descent is carried out. This means:
    • Staging is not currently supported
    • Don't activate thrust between calculating the trajectory and executing it
    • If it is possible to maintain control without it, consider disabling RCS. This is because the use of RCS throughout descent will change the vessel's mass in an unpredictable manner, and the vessel may come to a stop at a higher-than-expected altitude.
  5. The calculation will only be correct for vessels whose thrust vectors are symmetrical and aligned. This is an accepted limitation on the grounds that this mod is a tool for delta-V efficiency, and a vessel whose thrust vectors are unaligned is anything but efficient.
  6. By the same token, consider disabling or limiting all gimbals (since gimbal oscillation results in lateral thrust). If you don't, your retrograde thrust component may be reduced to the point that you crash.
  7. If the autopilot has trouble orienting your craft correctly, you can try tweaking the PID parameters in the settings menu. Similarly, whether your vessel is a fragile little butterfly or a rock-solid lander you can tweak the maximum landing speed in settings to suit.
  8. If the autopilot really has trouble orienting your craft, you may wish to disable it and carry out the descent yourself according to the timer provided. Let me know if you find this necessary and I'll investigate.

Current issues:

Spoiler
  1. The highest priority issue at this stage is the occasional apparent-failure of the descent calculation. My personal tests demonstrate intermittent cases in which the vessel will either stop several kilometres above the surface or plough into the ground at 100m/s. The cause of this is not currently known, however I suspect it may be an issue with the games PQS controller given that is sometime coincides with Kerbal Engineer reporting incorrect or non-physical "Time to Impact". Usually going back to a quicksave and re-attempting the calculation will work. However, I would appreciate feedback from the community if you can provide detail about when/where this seems to be most prevalent.
  2. Minor GUI layout bugs
  3. Sometimes the calculation window will appear to not-converge. Usually aborting and re-calculating solves this.
  4. Autopilot doesn't kill axial rotation (i.e. rotation about the up-down axis), and will lose control if the vessel begins to spin too much.

Changelog:

Spoiler
  • v0.1:
    • Initial release
  • v0.2:
    • Added delta V to post-calculation display
    • Added predicted landing latitude/longitude to post-calculation display
    • Added option to change gimbal percentage in settings menu
    • Fixed a bug where the GUI would hang if autopilot was aborted at the wrong time

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Other than that, please experiment with this mod and test its limits! Bug reports, suggestions, support, and feature requests are welcome in this thread, however this is my first-ever software release of any kind so I'll do my best but no guarantees. Oh, and I'm also accepting better names for the mod.

 

Enjoy!

Edited by timchap
New version
Link to comment
Share on other sites

Nice! downloaded.

I haven't had time to play with this yet but a few suggestions for future features.

1) Display the Dv required - A) so you can make sure you have the Dv required and B) so you can see how good/bad you're manual landings are compared to this.

2) A button to disable gimbals and RCS ports - combination laziness and not wanting to miss a gimbal/rcs port on large craft.

3) A predicted landing spot.

And thanks for sharing this.

Link to comment
Share on other sites

12 hours ago, wasml said:

1) Display the Dv required - A) so you can make sure you have the Dv required and B) so you can see how good/bad you're manual landings are compared to this.

2) A button to disable gimbals and RCS ports - combination laziness and not wanting to miss a gimbal/rcs port on large craft.

3) A predicted landing spot.

And thanks for sharing this.

Thanks for the recommendations! I'll have a release with (1) implemented for you shortly. Don't know why I didn't do this already. I agree (2) would be handy, not so much for RCS (is there any reason you can't just use the action group?) but gimbals can definitely be annoying. (3) would also be very nice, I can get the coordinates pretty easily but I'll have to look into marking the landing spot in map view or something.

Link to comment
Share on other sites

Liking it a lot so far, had some issues at first but that was solely error on my part. Activated the autopilot then timewarped closer to the ground, only after testing did I realize it timewarps automatically. Would definitely like a function to disable gimbals automatically, as I often forget to bind that to an action group. Even if displaying the landing point in the map proved to difficult, displaying coordinates would be great, especially when you're trying to set vehicles down in a super precise location.

Link to comment
Share on other sites

Great - I'll be watching for the update.

Youen made a mod Trajectories that places a X at your predicted landing spot (license MIT) - you may be able to find an example in that code if you do decide to add this.

One more suggestion :) could you include the version and date of last change in the title - makes it much easier for users of the mod to spot when an update has been posted.

 

Link to comment
Share on other sites

Alright, sorry about the delay. New version available at the link in the OP. Changes include:

  1. Added required dV to the post-calculation window
  2. Added predicted landing coords to post-calculation window. I will continue to look into marking the landing spot in map view
  3. Added option to change all gimbals to a given percentage in settings menu (a bit clunky but hopefully self-explanatory)
  4. Minor bug fixes

Haven't tested these additions extensively so let me know how you go.

Link to comment
Share on other sites

3 hours ago, MatterBeam said:

Would this work in a rescaled (x6.4/RSS) system?

It should do.

3 hours ago, MatterBeam said:

Wouldthe benefits there be similarly marginal, considering that circularization burns are greater?

Benefits should roughly scale with overall dV required to land. It's all relative, anyway - it really depends on how good your manual landings are. When I've tested it I've typically saved anything from 100-200m/s on the Mun (where the descent itself is a few hundred m/s) to upwards of 500m/s on some Tylo descents. Basically, this mod allows you to time your retrograde thrust perfectly so that you come to a stop just above the surface. If you manage to luck out and time it perfectly on a manual descent you'll get exactly the same delta V result. If not, you'll either crash or lose a few extra dV in the final descent (when you realise that you're going to stop short and you throttle back). Timing it perfectly is a lot easier when you (a) are moving slower, and (b) have a higher TWR, so this mod will probably be more "useful" in a rescaled (bigger) system.

In fact, the idea for this mod was initially conceived when I was trying to land on Tylo with barely enough dV. I basically quicksaved and then repeatedly attempted the descent, changing my thrust start time each time. If I crashed, I knew to try a bit earlier. If I ran out of fuel before landing, I knew to try a bit later (or I just didn't have enough dV). Unfortunately, I quickly realised that when you're moving at 2000m/s towards the surface, missing your thrust start time by even 1 second means that you will over-or under-shoot the surface by 2km. To that end, I made a mod that would (a) effectively simulate all those successive descents for me, and (b) start thrusting at exactly the right time.

tl;dr Try it in a rescaled system, it should work and  it'll probably give you more dV savings than in the stock system.

Link to comment
Share on other sites

23 minutes ago, timchap said:

It should do.

Benefits should roughly scale with overall dV required to land. It's all relative, anyway - it really depends on how good your manual landings are. When I've tested it I've typically saved anything from 100-200m/s on the Mun (where the descent itself is a few hundred m/s) to upwards of 500m/s on some Tylo descents. Basically, this mod allows you to time your retrograde thrust perfectly so that you come to a stop just above the surface. If you manage to luck out and time it perfectly on a manual descent you'll get exactly the same delta V result. If not, you'll either crash or lose a few extra dV in the final descent (when you realise that you're going to stop short and you throttle back). Timing it perfectly is a lot easier when you (a) are moving slower, and (b) have a higher TWR, so this mod will probably be more "useful" in a rescaled (bigger) system.

In fact, the idea for this mod was initially conceived when I was trying to land on Tylo with barely enough dV. I basically quicksaved and then repeatedly attempted the descent, changing my thrust start time each time. If I crashed, I knew to try a bit earlier. If I ran out of fuel before landing, I knew to try a bit later (or I just didn't have enough dV). Unfortunately, I quickly realised that when you're moving at 2000m/s towards the surface, missing your thrust start time by even 1 second means that you will over-or under-shoot the surface by 2km. To that end, I made a mod that would (a) effectively simulate all those successive descents for me, and (b) start thrusting at exactly the right time.

tl;dr Try it in a rescaled system, it should work and  it'll probably give you more dV savings than in the stock system.

Sounds interesting... but how is it different then from the 'suicide burn' calculator from Kerbal Engineer or MechJeb?

Link to comment
Share on other sites

1 minute ago, MatterBeam said:

Sounds interesting... but how is it different then from the 'suicide burn' calculator from Kerbal Engineer or MechJeb?

Those suicide burn calculators only work if you're descending directly towards the body. Mine works for any suborbital trajectory, which is (though I do say so myself) a much more difficult problem. On top of the standard dynamics of the problem (e.g. changing fuel mass), you have to 2 dimensions to deal with instead of one AND (most importantly) the changing terrain height over the course of the descent.

Link to comment
Share on other sites

Just now, timchap said:

Those suicide burn calculators only work if you're descending directly towards the body. Mine works for any suborbital trajectory, which is (though I do say so myself) a much more difficult problem. On top of the standard dynamics of the problem (e.g. changing fuel mass), you have to 2 dimensions to deal with instead of one AND (most importantly) the changing terrain height over the course of the descent.

I see. I'll try it out.

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...