schlosrat / FlightPlan

Plan your (space) Flight! Fly your Plan! Set up maneuver nodes to get you where you want to be
Other
12 stars 6 forks source link

Inaccurate maneuver nodes for Moon Return, Interplanetary Transfer, and Course Correction maneuvers #49

Open schlosrat opened 9 months ago

schlosrat commented 9 months ago

In some cases, particularly where the node needed is a relatively long time away, the maneuver node Flight Plan produces results in an orbit that will not encounter the target and may be so poorly timed that it's not even readily adjustable to give an encounter. This is frequently encountered in Moon Returns from Minmus and interplanetary transfers where the next window is more than a short time away, and a similar effect can be seen where a Course Correction maneuver node does not result in an improved encounter.

This is a known issue first observed and reported in Issue 10 (Hohmann Transfers less than ideal) on May 8, 2023, and in Issue 31 (Moon return) on Oct 30th, 2023. I believe these issues are related so I'm approaching the solution in that way and have combined them into this issue so that the problem may be better understood and workarounds captured in the meantime.

Flight Plan leverages a lot of code from MechJeb that has been adapted to work in KSP2, and as a result, tends to give very good results in most cases, however, the KSP2 adaptation is not currently ideal. I believe that is where the problem lies as the rest of it is a proven implementation of orbital mechanics equations coupled with well-established numerical solvers. The adapted MechJeb code is found in both Flight Plan and Node Manager, and so the solution may involve fixes in both, but as the problems are visible to players using Flight Plan I will document them here.

schlosrat commented 9 months ago

Workaround: Moon Return

When constructing a moon return maneuver node from a low inclination, low eccentricity starting orbit at a moon, if you do not get a resulting orbit that approaches the planet then look at the node timing. Generally, you want the Moon Return node to be located on the side of the starting orbit facing the planet so that as you depart the moon your escape from the moon's SOI is in a direction opposite to that of the moon's motion.

If the node created by Flight Plan isn't on that part of the starting orbit, then use Maneuver Node Controller to adjust the starting time of the node until it is. You can also do this manually by selecting the node gizmo in the map view and dragging it to the approximate location until you get a trajectory that will put you close to the planet at Pe. For fine-tuning, MNC can be very helpful to get the Pe you want, but be advised that you may need to make very small adjustments as you get close to the desired return.

schlosrat commented 9 months ago

Workaround: Interplanetary Transfer

As a general workaround for the problem of poor interplanetary transfer nodes, I’ve found this approach to be helpful (I’ve done this successfully with Duna, and presume Jool will be similar).

  1. Launch your craft and get to a high circular orbit
  2. Use FP (or other tools as you may like) to find the time for the next transfer window
  3. Timewarp to a time a day or so before the start of the window - can be closer, but try not to overshoot it.
  4. Use FP to make the node - (IMPORTANT: Select the "as soon as possible" burn option). You should get a not-terrible solution that’s close to giving an encounter.
  5. Use MNC to tweak the node as needed to get an encounter
  6. Use K2D2 to fly the node
  7. Warp to outside of the departing planet SOI

Check to see if you still have an encounter. If not then you’re most likely very close to having one at one of your closest approaches so make a new empty node not far in the future and use MNC to tweak that, then fly it with K2D2. That should be all you need to do to get a reasonable transfer - and, yes, it’s not nearly working as well as I would like. The good news, if there is any, is that this problem is probably related to the course correction and other problems. Hopefully, when I solve one it will pay off for the others as well.

NOTE: The Interplanetary Transfer maneuver offers two burn time options: "at the next transfer window" and "as soon as possible". Be sure to pick "as soon as possible" after you've warped to within a day or so of the transfer window.

schlosrat commented 9 months ago

EXAMPLE: Transfer to Jool

In this example, I needed to warp ahead about 30 days to be only 1 day away from the transfer window, but when I attempted to make a node using the "at the next transfer window" burn option it gave me a node 13 days in the future - not ideal given that I'd already warped to be within a day of the transfer window. Here's the result when using "at the next transfer window".

wpMACHe

but even worse the encounter was pretty much unsalvagable.

B3vE7HG

Seeing that I gave the "as soon as possible" option a try and got this, which is not horrible as we will see

p92xdCI

With our 1A and 1B encounter markers so well aligned, it's worth pulling up Maneuver Node Controller to see how much trouble it might be to save this. Here's what you get with just a single click of the "Prograde >>" button in MNC.

zSQv4GV

Well, there's our encounter! And it was only one click away - of course, Jool's SOI is freaking huge so that's a big part of what makes this easy. Orienting the Map View to give a better perspective on what the encounter will be like helps a lot here, and as you can see what we've got here is just barely in the SOI at closest approach.

7lmLVhH

With not a lot of MNC fiddling (primarily to the Normal >> and Time < buttons, we're able to get this encounter

YdFVqEI

So, there you have it. FP (with a little help from MNC) can give a transfer to Jool. The extra clicking is unfortunate and certainly not ideal, but it is a lot easier than making the node manually I think.

One very important lesson here is to only use the "as soon as possible" burn option, even if you do warp ahead to the window.

schlosrat commented 9 months ago

Workaround: Course Correction

For better course correction results you can do one of two things currently. First, you can use Flight Plan to plot a Course Correction and see what you get, then use Maneuver Node Controller to fine-tune that to get a better result. Secondly, you could skip Flight Plan for this altogether, create an empty node about where you think you'd like to have your course correction, and then use MNC to adjust that. Neither of these are great options, but they're the best I'm aware of at this time, so I offer them here.