Jump to content

Porkchop plot + showing your flight path and where it will take you next (gravity assists)


Ens Gijs

Recommended Posts

The proof of concept is now live at http://ens-gijs.github.io/ksp/

 

I've been working on  adding flyby calculation to alexmoon's launch window planner for a couple of weeks in the evenings. It's coming along nicely but there is so much more I want to do with it :D

The idea is that you will be able to click on the porkchop plot and see the flight path of not only the selected orbit but also of where that flight path can take you next. I'm working on showing secondary interactions without making an absolute mess of things. She's a little rough but working well. Try this flight path out to get a flyby of the Mun from Minmus which results in a return to Kerbin.

w3F686j.png

The left image shows a transfer from Minmus to the Mun that results in a Kerbin deorbit flight path. Uninteresting parts of the flight path were Photoshoped lighter - I haven't coded that up yet. The Mun is shown twice, once with a label and once without - the one with the label is where the Mun is when you leave Minmus, the one without a label is where the Mun will be when you encounter it.

The right image is the flyby condition at the Mun. Kerbin is directly "up" in that image and the Mun is traveling from left to right. The Pe at Mun is 7548m, which is minimum safe distance +500m.

 

 

Anyway, this post is just a hello world post for the project. I'll be working on it through the holiday and hopefully have it up and running somewhere you can play with it in a couple of days.

 

Edited by Ens Gijs
Link to comment
Share on other sites

That looks really nice. Just that demo shows two things Flyby Finder can't do- show a graph of the path, and flybys of moons. I like that touch of showing the SOI's of the bodies in the overview rather than little dots for the bodies themselves. I look forward to seeing what you come up with!

Link to comment
Share on other sites

The proof of concept is now live at http://ens-gijs.github.io/ksp/

Mouse wheel will zoom you in and out. Click and drag to pan. If you are calculating transfers between moons the main solar view will track your primary (the planet the moons are orbiting) which may be a little annoying but it's better than the planet always shifting fully out of view.

The "Final orbit" field is used to specify the flyby Pe at the destination body.

For now there is no control over side of passing - you cannot yet specify if you want to pass in front of or behind the target body for a higher or lower flyby orbit than the original - this is on my list of things to do.

Just like Alex's original tool the results you are shown will not be exactly how things will happen in game. Especially around bodies with large SOI's relative to the length of your flight path (e.g. transferring between moons and flying by Jool). The patch conics approximation completely ignores SOI's - it considers the flight path turn and velocity changes to be instantaneous. I might improve on this in the future but there is a long list of things i need to get to before this.

One last note: the view on the right showing the flyby trajectory is always normalized - that is, it is rotated so the destination body is traveling left to right and its primary (e.g. the sun) is, nearly, directly up and the view is rotated such that the views XY plane is aligned with the plane of the flyby orbit... translation until i get 3d rotation support in that view know that it is aligned with your flyby's orbit and is not a strait "down" view onto the body. To see this in action set a transfer from Kerbin to Eeloo and note the dots and "rod" on the body - these represent the north and south poles and the line between them to help you get a sense of orientation. If you didn't follow this last bit dont worry about it :D

 

If you want to look at the code... don't ;) this is a very rough thrown together proof of concept - it'll get a complete overhaul in a while but I wanted to get it out there for the community to start messing with.

Edited by Ens Gijs
Link to comment
Share on other sites

  • 4 weeks later...

Just a quick update. I'm back to work on this project and I've planned and executed my first complex trip using it! Don't get too excited though. The UI hasn't caught up to the theory just yet, but I'm confidant now that the tool really can be valuable.

This is the trip I planned, and flew in KSP. The trip was a flyby of Duna with a "free return" to Kerbin - all told it cost me just over 1200 dV to eject from LKO and return to Kerbins surface.

 

rMQYgoN.png

Kerbin Departure
Initial Orbit: 100km
Flyby Altitude: 100km
Departure: Year 1, day 222 at 3:07
Time of Flight: 366 days 2:33
Ejection dV: 1114
  Prograde dV: 1112.4
  Normal dV: -51.2

Spent 50dV at midpoint to Duna to correct injection error


Return Conditions
Correction burn dV: 27 estimated, 32 actual - performed at time of Duna flyby (at Duna Pe)
Encounter occurs at +2 orbits

Spent additional couple of dV to tune Kerbin encounter in interplanetary space. I'm happy to report that from the Duna burn alone I achieved a Kerbin encounter, this adjustment burn was to actually hit the planet, not just the SOI :D

Link to comment
Share on other sites

You may now get EXCITED! I know I am :D

I've added support for using the WSAD keys to move your orbit selection around (holding a key down works too - lots of fun to see the planets spin and your orbits change).

Most importantly I've added a listing of what bodies your flyby will open up to you. In the screenshot below you will see Kerbin (+2) 3.02 This means that the selected flyby will give you an encounter with Kerbin in 2 orbits of your craft for 3 m/s of deltaV (I bet you could do it for free ;)).

Tip: you can hover over the encounter (e.g. Kerbin (+2) 3.02) to see the "Time of flight" - this gets rather comical when using Jool to reach Eeloo.

p1ZTRbE.png

Edited by Ens Gijs
Added note about hovering over encounter listings for Time of flight information.
Link to comment
Share on other sites

So if I wanted to go to Moho utilizing an assist from Eve would I set eve as my target with a 100km "final" orbit and then WASD to adjust the plan to find one that gives me a good slingshot towards Moho?

Link to comment
Share on other sites

1 hour ago, tomf said:

So if I wanted to go to Moho utilizing an assist from Eve would I set eve as my target with a 100km "final" orbit and then WASD to adjust the plan to find one that gives me a good slingshot towards Moho?

Correct

Using various "final" orbital altitudes may yield better slingshots as well. For example I found a nice free return from Eeloo  (round trip from kerbin) with an optimal flyby Pe of about 440k (savings were trivial, but Eeloo is a low gravity body anyway - 80dV at 100K flyby vs 30dV at 440K flyby). I was actually able to achieve the free return for 8dV in game by burning just after I exited Kerbin SOI instead of within / near Eeloo SOI as planned by the tool.

 

Sorry for the pains of early access ;)

Edited by Ens Gijs
Link to comment
Share on other sites

  • 5 years later...
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...