Jump to content

[WEB] Kerbal Transfer Illustrator, a mission planning tool


Recommended Posts

Kerbal Transfer Illustrator

i5LNjgH.png

QdsGqUh.gif            FZJWb9M.gif

 

Link:

https://kerbal-transfer-illustrator.netlify.app

 

Description:

The Kerbal Transfer Illustrator is a set of mission planning tools inspired by alexmoon's Launch Window Planner, Arrowstar's KSPTOT, and krafpy's MGA Planner, among other things. It consists of 4 interconnected pages, which each make use of pretty, interactive 3D displays of the solar system:

Transfer Illustrator:

  • Generate porkchop plots and calculate trajectories for any starting and ending orbits in a solar system
  • Optimize trajectories for accurate in-game use
  • Optionally use Oberth maneuvers for arrival and departure from celestial bodies

Flyby Illustrator:

  • Search for efficient multi-gravity-assist missions with powered flybys
  • Optionally make use of deep space maneuvers between flybys (work in progress)
  • Optimize trajectories for accurate in-game use (usually reasonably accurate, work in progress)

Flight Planner:

  • Visualize trajectories for multiple crafts
  • Plan relay constellations by looking using the CommNet display
  • Manually edit individual maneuver nodes and see real-time changes to the resulting trajectory
  • Copy and paste flight plans from the Transfer and Flyby Illustrators

System Editor:

  • Tweak settings for individual planets, or make entirely new solar systems
  • Load modded systems from Kopernicus configuration files
  • Use custom systems in the other pages of the app

 

Also note that orbits and crafts can be loaded from your KSP save files, and links can be generated from each page to save/share your flight plans!

 

Modded systems that are already built in to the app include:

 

Any comments, contributions, or ideas for new features are appreciated!

 

The Kerbal Transfer Illustrator is licensed under the Creative Commons Zero v1.0 Universal license.

Edited by theAstrogoth
Link to comment
Share on other sites

Loading orbits from a KSP save file has been implemented! :cool:

For those of you on PC without a modded solar system, you can now upload a .sfs file and select orbits from your in-game vessels, asteroids, and comets.

If anyone tries it out, let me know how it works! I don't have many different save files using a wide variety of mods, and it's possible that there are mods out there that could cause issues with my savefile parser. If it doesn't seem to be working for you, I'd really appreciate it if you would share your save file with me for debugging purposes. 

 

Link to comment
Share on other sites

Posted (edited)

I've added "refining" of the multi-flyby trajectories to try to ensure good in-game accuracy. Below example of what it looks like for a Kerbin-Eve-Jool-Eeloo flyby.

Since Jool has a large sphere of influence, assuming that its SoI is negligible during interplanetary transfer calculations introduces some error.  Without "refining" the trajectory,  it looks like this:

Fi5ebYX.png

The above image shows the drawbacks of using the zero SoI assumption for calculating the interplanetary transfers. The transfer legs of the trajectory don't change at Jool's SoI, and the craft is assumed to essentially hit Jool dead-center. The flyby is also assumed to be instantaneous. I attempt to overcome these limitations by optimizing the "patch" positions at every SoI change to minimize the difference between the craft's position on either side of the SoI boundary.

 Here is the same trajectory after pressing the "Refine Trajectory" button a few times: 

KHEcMLS.gif

 

Now the craft encounters and escapes from Jool at the appropriate directions! Also note that the flyby duration is taken into account.

Altogether, this means that if you try to use the maneuvers generated by the app, they will need less fine-tuning in game. For a trajectory with well-optimized SoI patches, the only simplification that might still cause you problems is the assumption that maneuvers are performed instantaneously (which is also assumed by maneuver nodes in KSP). For this reason, the trajectories calculated by the Transfer or Flyby Illustrators might not be suitable for low-thrust crafts. 

 

 

Edited by theAstrogoth
Link to comment
Share on other sites

Posted (edited)

I've added a new option to use two-impulse (aka Oberth) maneuvers for ejection/capture. They involve slowing the craft down to decrease the periapsis height as low as possible, and then burning at periapsis, where the speed of the orbit is large. They're useful when the parking orbit altitude and ejection/insertion speed are large. One downside is that they increase the total flight time somewhat. 

They're not too difficult to plan manually, and I'm not aware of another tool for KSP that sets them up for you.

Below shows a direct ejection and Oberth ejection starting from Minmus:

kfZt0e4.gif

 

For some transfers (e.g. Minmus to Jool/Laythe), using Oberth maneuvers can lead to huge ∆v savings. For others (e.g. Minmus to Duna/Ike), they are probably not worth the trouble.

Edited by theAstrogoth
Link to comment
Share on other sites

  • 1 month later...

Along with some improvements to the UI, I've added a new page to the app: the Flight Planner! It's my attempt at a web version of KSP's tracking station or orbital map view: you can place and edit maneuver nodes, and then see how the trajectory is affected in real time!

kjfyq2Y.gif

 

There a new navbar at the top of the app for navigating between the three pages, and you can copy/paste orbits, maneuvers, and flight plans between the three pages. This makes it easier to plan multi-step missions. For example, you could calculate a transfer needed to rendezvous your craft in LKO with a refueling station around Minmus, and then calculate a transfer from there to Laythe. 

 

Most of the work for this wasn't math/astrodynamics, but coming to grips with React in order to get the UI to work correctly. If you try it out, let me know if you notice any bugs or strange behavior!

Link to comment
Share on other sites

Posted (edited)

This is very cool.  Where to you want bugs reported?  Here?  A git repo?

Just a quick description: Oberth enabled, Minmus to Duna; Kerbin Oberth while listed in correct order has a UT prior to Minmus burn

imgur is apparently being DOS'd or something else I'd post a screen shot  link

Another image hoster...

kti-0-0.jpg

Edited by darthgently
Link to comment
Share on other sites

4 hours ago, darthgently said:

This is very cool.  Where to you want bugs reported?  Here?  A git repo?

Here is fine! The git repo would be good as well: https://github.com/theastrogoth/Kerbal-Transfer-Illustrator/issues

Thanks for asking :)

 

4 hours ago, darthgently said:

Just a quick description: Oberth enabled, Minmus to Duna; Kerbin Oberth while listed in correct order has a UT prior to Minmus burn

Good catch! I'll see if I can track down the source of the problem. 

Link to comment
Share on other sites

1 minute ago, theAstrogoth said:

Here is fine! The git repo would be good as well: https://github.com/theastrogoth/Kerbal-Transfer-Illustrator/issues

Thanks for asking :)

 

Good catch! I'll see if I can track down the source of the problem. 

I haven't encountered it again, so it was probably some combination of params.  I have found that having the eventual target altitude in atmosphere and not having "No insertion burn checked" seems to cause a hang when clicking "Search Trajectories".  Not sure, but I could see wanting to do an insertion burn while aerobraking might seem mutually exclusive to many ppl (I do it as a hedge, but can live with having "No insertion burn" set).

I am having way too much fun with this.  Thanks!

Link to comment
Share on other sites

3 minutes ago, darthgently said:

I haven't encountered it again, so it was probably some combination of params.  I have found that having the eventual target altitude in atmosphere and not having "No insertion burn checked" seems to cause a hang when clicking "Search Trajectories".  Not sure, but I could see wanting to do an insertion burn while aerobraking might seem mutually exclusive to many ppl (I do it as a hedge, but can live with having "No insertion burn" set).

Hmmm, not sure what's causing that either, so I'll try to take a look to make sure the app doesn't hang, at least.

I don't simulate atmospheres at all, other than to require that flybys don't pass through them, so leaving off the insertion burn is probably your best bet if you're confident you can bleed off most of your velocity by aerobraking. 

Link to comment
Share on other sites

I, for one, would find it useful to display the periapsis of each patch in the orbit info and when hovering over the patch in the graphic. Maybe display periapsis in RED if in atmosphere

Periapsis = ( -semi_major_axis * (e - 1) ) - body_radius.  I think that works fine with elliptical or hyperbolic eccentricity.   Atmospheric height and other body info (radius, etc) might be nice also when hovering over bodies. 

Link to comment
Share on other sites

50 minutes ago, darthgently said:

I, for one, would find it useful to display the periapsis of each patch in the orbit info and when hovering over the patch in the graphic.

Done! Apoapsis and periapsis are now shown in each orbit's hover text. I can't change font color for only part of the hovertext if the periapsis it too low, but I also added the radius and atmosphere heights to the hover text for bodies, so it's easy to manually check.

Link to comment
Share on other sites

I've added the option to select OPM and RSS systems. Eventually,  I plan to add an additional page to the app that allows users to input custom modded systems, but I haven't gotten there yet. 

Here's an Earth-Venus-Venus-Jupiter-Saturn multi-flyby:

MdzMSay.gif

 

Link to comment
Share on other sites

16 hours ago, theAstrogoth said:

I've added the option to select OPM and RSS systems. Eventually,  I plan to add an additional page to the app that allows users to input custom modded systems, but I haven't gotten there yet. 

Here's an Earth-Venus-Venus-Jupiter-Saturn multi-flyby:

MdzMSay.gif

Thanks for the additions and fixes, there is a lot of good stuff here.  Work got busy or I'd have gotten back to you sooner.  Who honestly thought javascript would be doing stuff like this a few decades back?  Not me

 

Link to comment
Share on other sites

Posted (edited)
3 hours ago, OrbitalManeuvers said:

Do you have any interest in adding a KSRSS @ 2.5x scale to your app? It's a pretty common setup these days and I'd love to give your stuff a try.

Rather than manually adding separate options for rescaled systems (1x, 1.5x,  2x, 2.5x ...), I plan to add a "System Editor" page to the app, which lets you modify existing system options (add/remove planets, edit orbits, rescale the entire system, etc). This will hopefully be enough to allow people with less commonly used solar systems to use the app as well.

It seems like the format used for the Kopernicus configs is the same one used for save files, so I should be able to use the savefile parser that I have now to let users upload configs rather than have to type in everything manually.

Once I have Kopernicus config parsing squared away, it will be really easy for me to add (popular) planet packs to the app, so that no upload is needed. I'll make sure KSRSS gets added!

 

3 hours ago, OrbitalManeuvers said:

If you need any data from a working install, I have several, and would be happy to help out.

I appreciate the offer! Usually, the relevant info that's needed is in the Github repo for the planet pack (the Kopernicus configs), so there's no need to look at actual installs. 

 

EDIT: Kopernicus configs may not contain the reference ID, or "flightGlobalsIndex", for each body. I'm not sure how these get determined if a value isn't provided, so it might be necessary to install a planet pack to check. 

Edited by theAstrogoth
Link to comment
Share on other sites

  • 2 weeks later...

I got a little sidetracked from getting the system editor up and running, but I stumbled across a potentially great way of saving/sharing trajectories and custom systems: storing the info in the URL hash!

I'm still making sure that it works with a variety of inputs, but when using the Flight Planner, the URL will automatically update with every change to your flight plans. If you copy the URL and reload it or share it, your flight plans should once again be visible. Here's an example Kerbin-Eve-Laythe trajectory I put together as an example:

https://kerbal-transfer-illustrator.netlify.app/FlightPlan#vesselPlans=[{"name"%3A"Copied+Multi-Flyby"%2C"orbit"%3A{"semiMajorAxis"%3A699999.9999999988%2C"apoapsis"%3A699999.9999999988%2C"periapsis"%3A699999.9999999988%2C"eccentricity"%3A0%2C"inclination"%3A0%2C"argOfPeriapsis"%3A0%2C"ascNodeLongitude"%3A0%2C"meanAnomalyEpoch"%3A0.9350468499583543%2C"epoch"%3A57510913.62193195%2C"semiLatusRectum"%3A699999.9999999988%2C"siderealPeriod"%3A1958.1284360312395%2C"orbiting"%3A1%2C"attractorSoi"%3A84159286%2C"attractorStdGravParam"%3A3531600000000}%2C"maneuvers"%3A[{"prograde"%3A1162.0658346989326%2C"normal"%3A-291.62622614152446%2C"radial"%3A-1.0231815394945443e-12%2C"date"%3A57510913.642115}%2C{"prograde"%3A630.329%2C"normal"%3A0%2C"radial"%3A0%2C"date"%3A62010402.6}%2C{"prograde"%3A0%2C"normal"%3A-12%2C"radial"%3A0%2C"date"%3A85082400}]}]

 

And here's a different trajectory, a transfer from Earth to Mars:

https://kerbal-transfer-illustrator.netlify.app/FlightPlan#vesselPlans=[{"name"%3A"Copied+Transfer"%2C"orbit"%3A{"semiMajorAxis"%3A7371000%2C"apoapsis"%3A7371000%2C"periapsis"%3A7371000%2C"eccentricity"%3A0%2C"inclination"%3A0%2C"argOfPeriapsis"%3A0%2C"ascNodeLongitude"%3A0%2C"meanAnomalyEpoch"%3A0%2C"epoch"%3A0%2C"semiLatusRectum"%3A7371000%2C"siderealPeriod"%3A6297.970191292341%2C"orbiting"%3A1%2C"attractorSoi"%3A924649202.461023%2C"attractorStdGravParam"%3A398600435436096}%2C"maneuvers"%3A[{"prograde"%3A3766.375123262773%2C"normal"%3A769.5263141771914%2C"radial"%3A-3.410605131648481e-12%2C"date"%3A59983204.17753832}%2C{"prograde"%3A-2606.6521705082287%2C"normal"%3A703.3126569013859%2C"radial"%3A8.918517897896256e-13%2C"date"%3A86416920}]}]&systemName="Sol+System+(RSS)" 

Link to comment
Share on other sites

The system editor is now up and running: you can manually add/remove, tweak, and rescale bodies, or you can upload all of your Kopernicus configs at once! I've tested it with the OPM, JNSQ, RSS, and KSRSS config files, but there may be some planet packs out there that the app doesn't read properly.

@OrbitalManeuvers since you were interested, it is now fairly easy use the KSRSS x2.5 system with the app. Navigate to the System Editor page, select the KSRSS (1x) system from the dropdown, and enter "2.5" in the system scale field. Then, when you navigate to the other pages in the app, you can select the rescaled KSRSS system as the "Custom System."

Link to comment
Share on other sites

Posted (edited)

I've add savable/sharable links for each page of the app. Here are a few examples:

Multi-Flyby Planner: 

Transfer Planner: 

Flight Planner: 

System Editor:

 

I've also made various UI improvements and have attempted to make the app mobile-friendly. There are some quality-of-life improvements for PC browser users as well (try holding  ctrl, shift, or alt  while clicking the +/- buttons for number inputs).  

Edited by theAstrogoth
Link to comment
Share on other sites

  • 2 weeks later...

Wooooow ! Just discovered it and it's amazing ! Really cool work, I'm glad my work inspired you :cool:. The UIs are also very neat and clean.

I tried a Kerbin-Eeloo trajectory and the total delta-V your tool finds is way better than mine : about 1840m/s, instead of about 3000m/s on my side.

You managed to solve several problems I'm still facing. I'd be really interested in knowing some of the maths and implementation details :D. Like, how are you generating flyby sequences ? What trajectory parameterization are you using ? How did you implement your "refining" of trajectory feature ?

Looking forward to talk in messages :D.

Link to comment
Share on other sites

3 hours ago, Krafpy said:

Really cool work, I'm glad my work inspired you :cool:.

Thanks! I got started by adapting some of your code :).  

 

3 hours ago, Krafpy said:

Looking forward to talk in messages :D.

Ditto! 

Link to comment
Share on other sites

  • 2 weeks later...
Posted (edited)

I've overhauled the way planets and orbits are displayed (switched from using PlotlyJS to THREEjs). They should now not only be more responsive and load more quickly, but also look a lot prettier! There are also a bunch of new things that can be displayed (crafts, maneuver nodes, apo/peri apses, ascending/descending nodes, a skybox).

NSl8dtl.png

 

I've also improved the "Refine Transfer" and "Refine Trajectory" buttons, which should converge more quickly (usually with a single button press). 

 

Edited by theAstrogoth
Link to comment
Share on other sites

  • 4 months later...

I've recently worked on adding CommNet visualization to the app. Connections are calculated between any flying or landed crafts based on their signal ranges, and they are blocked when celestial bodies get in the way. I've also added options to show the KSC and ground stations on Kerbin, as well as options to set the Tracking Station's level.

This will hopefully be useful for planning out satellite constellations or for making sure that unmanned craft maintain a CommNet connection throughout a mission.

 

nqAVxrg.gif    FZJWb9M.gif

Link to comment
Share on other sites

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.

 Share

×
×
  • Create New...