Jump to content

[WIN/MAC/LINUX] KSP Trajectory Optimization Tool v1.6.10 [Major LVD Improvements!]


Recommended Posts

Is there a guide for using mission architect for direct launch (launch to destination w/o parking orbit) and missions to satellites(natural and artificial)? I understand the rendezvous maneuveur sequencer, but I'm not sure what to put in for initial orbit(since I don't know exactly what the orbit I launch into will be) or what to put in if I intend to launch directly.

Link to comment
Share on other sites

Is there a guide for using mission architect for direct launch (launch to destination w/o parking orbit)

This currently isn't possible however look up a few posts and you'll see Arrowstar is currently working on a tool that could make this possible - I'm still not sure whether it will eventually be applicable to Kerbin/Laythe/Duna/Eve though.

and missions to satellites(natural and artificial)? I understand the rendezvous maneuveur sequencer, but I'm not sure what to put in for initial orbit(since I don't know exactly what the orbit I launch into will be) or what to put in if I intend to launch directly.

I already helped someone with a similar question a while back so I used my response to put up my first KSPTOT Wiki article covering this topic.

Arrowstar you should see if you can place a wiki link into the About dialog box for KSPTOT, or maybe just a straight-up selection option for the Help menu itself. I agree also that the version number should be in the About dialog too, not just in the startup image

Link to comment
Share on other sites

Definitely should make the wiki more visible, I didn't know it existed

- - - Updated - - -

Any info on returning from a moon?

What longitiude and latitude do the constraints refer to? Can I have the optimizer calculate a coast and burn to put my periapsis over a specific longitude and/or longitude?

Edited by dlrk
Link to comment
Share on other sites

Any info on returning from a moon?

Not sure exactly what advice you're looking for but there is an aerobraking feature that could provide some assistance in determining where your capsule will land. I've only tried it once and I undershot my landing zone by 205km

What longitiude and latitude do the constraints refer to? Can I have the optimizer calculate a coast and burn to put my periapsis over a specific longitude and/or longitude?

They refer to the Lat/Lon of the body you are currently orbiting for whatever event you're optimizing for. Yes, you can use the optimizer to put your Pe over a specific point on Kerbin

Link to comment
Share on other sites

Questions are more than welcome here. Rotperiod is the number of seconds it takes the planet to complete one rotation. I am unsure if this is sidereal (try checking against the ksp wiki). Rotini is the degree at which the planet begins its axial rotation at Epoch 0 (start of a new save)

Link to comment
Share on other sites

Hey guys,

Here's another pre-release for 1.5.0.

Nothing new on the launch planner, but I've added a few new things to Mission Architect:

1) Added a Mission Notes section under the Edit menu, let's you record text or whatever you want and store it for later.

2) Added a Staging event to the Events menu. This is basically a Mass-only Set State: you tell it what your post staging dry mass, fuel/ox mass, etc masses are and it sets them for you. Useful for when you're dropping partially used stages, and very complementary to the existing MASS_DUMP event.

The other issue I want to address soon is the the Mission Architect atmospheric model. The exponential model in use is no longer correct. I need to pull the atmo data from the game and get it into KSP TOT via the bodies file, that'll be my next project. After that, I can go back to doing the launch planner. :)


Regarding questions about the bodies.ini file quantities, here's the comment text that will be in the v1.5.0 version of the "as-shipped" bodies.ini file.

; This is the file that holds information regarding the 
; solar system KSP TOT works with when performing analysis.
; You may edit this file to add, remove, or modify celestial bodies
; in your KSP solar system. Alternatively, with the KSPTOTConnect plugin
; installed into KSP and KSP running in the flight scene, start KSP TOT and use:
; "File" -> "Create New Bodies File from KSP"
;
; Each bodies.ini file required a body called "Sun" with all
; zero orbital elements.
;
; Here is a breakdown of the various entries required by each body,
; a description of the quantity, and their units:
;
; [NameOfBodyOneWord] = Name of this body, must match name field below
; epoch = Time at which the given mean anomaly applies, [sec]
; sma = Semi-major axis of the body's orbit, [km]
; ecc = Eccentricity of the body's orbit, [dimensionless]
; inc = Inclination of the body's orbit, [deg]
; raan = Right ascension of the ascending node of the body's orbit, [deg]
; arg = Argument of periapsis of the body's orbit, [deg]
; mean = Mean anomaly at the given epoch of the body's orbit, [deg]
; gm = Gravitational parameter of the body, mu, [km^3/s^2]
; radius = Radius of the body's sphere, [km]
; atmoHgt = Maximum height of the atmosphere above the surface, [km]
; atmoPressSL = Sea level (altitude = 0) pressure of the amtmosphere, [kPa]
; atmoScaleHgt = Scale height of the atmospheric model, [km]
; rotperiod = Rotational period of the body, length of sidereal day [sec]
; rotini = Initial rotation about the body spin axis at given epoch [deg]
; bodycolor = string that provides the body's gradiant color scheme when
; rendering, see for valid body colors (Color Map Names):
; https://www.mathworks.com/help/matlab/ref/colormap.html#inputarg_map
; canBeCentral = set to 1 if this body has moons/planets orbiting it or 0 if not
; canBeArriveDepart = set to 1 if this body is orbiting another body and at least
; one other body also orbits the same parent body, or 0 if not
; parent = name of the parent body as shown in that body's "name" field
; parentID = Id of the parent body as shown in that body's "id" field
; name = name of this body as displayed in the software, MUST match what's in the
; brackets [] above
; id = Id number of this body, must be a non-negative integer unique to this
; solar system. Once you use an ID number once in this file, you CAN NOT
; re-use it again or the software will get confused.
;
; For questions, post at the KSP TOT thread on the KSP Forums:
; forum.kerbalspaceprogram.com/threads/36476

Let me know if that helps. :)

Link to comment
Share on other sites

The other issue I want to address soon is the the Mission Architect atmospheric model. The exponential model in use is no longer correct. I need to pull the atmo data from the game and get it into KSP TOT via the bodies file, that'll be my next project. After that, I can go back to doing the launch planner. :)

mmmm I like where this is going :)

Link to comment
Share on other sites

mmmm I like where this is going :)

Yeah, unfortunately it means I need to add 6 new entries to the bodies.ini file (or at least two, I may skip the four correction curves and just import temperature and pressure curves) . It's a bit crazy to be honest, but I'm hoping it'll improve the results some. :)

Link to comment
Share on other sites

Yeah, unfortunately it means I need to add 6 new entries to the bodies.ini file (or at least two, I may skip the four correction curves and just import temperature and pressure curves) . It's a bit crazy to be honest, but I'm hoping it'll improve the results some. :)

Don't know if what follows is part of what you considered in the "four correction curves", but temperature sure isn't described by a single curve with altitude, it also depends on the Sun elevation (from what I learned by who worked to make the atmospheric model in KSP), therefore local time at the meridian of the location of interest, and difference among latitude of the location and Sun declination (of course Sun declination is always = 0 for Kerbin, but not for other bodies). I'm assuming you need to have the air density curve for the atmospheric flight profile, so to compute drag (and possibly lift), and sure air density is tied to both temperature and pressure. I'd guess you may include some calculations to account for temperature variance with the location on the body - and those calcs require further data I assume should be fetched from the KSP planetary info as well.

Link to comment
Share on other sites

Don't know if what follows is part of what you considered in the "four correction curves", but temperature sure isn't described by a single curve with altitude, it also depends on the Sun elevation (from what I learned by who worked to make the atmospheric model in KSP), therefore local time at the meridian of the location of interest, and difference among latitude of the location and Sun declination (of course Sun declination is always = 0 for Kerbin, but not for other bodies). I'm assuming you need to have the air density curve for the atmospheric flight profile, so to compute drag (and possibly lift), and sure air density is tied to both temperature and pressure. I'd guess you may include some calculations to account for temperature variance with the location on the body - and those calcs require further data I assume should be fetched from the KSP planetary info as well.

So... yes. Turns out that the correction curves are necessary and do have a meaningful impact on atmospheric density. I experimented a bit today and concluded that I needed them.

Long story short, this evening I got the KSP atmospheric model into KSP TOT. It's a bit of a pain, and it's not perfect, but I think it's close enough. The only factor I'm not including is temperature variations due to time of day, because that would involve determining where the sun is for density calculations, and that's pretty expensive. But I think I get a reasonable approximation this way.

The bodies.ini file got a huge overhaul too. There's a bunch of new fields for the atmo press/temp/correction curves, as well as atmospheric molar mass. I also got rid of the pressure at sea level entry, as it's no longer needed. The scale height parameter is hopefully on the chopping block for tomorrow.

I'll put up a pre-release tomorrow so that people can play with it.

NOTE: This is a Mission Architect save file BREAKING release. v1.4.0 Mission Architect files will NOT work with v1.5.0 due to the changes in the bodies.ini file structure. Sorry about that. :(

Link to comment
Share on other sites

But I think I get a reasonable approximation this way.

Personally I'm totally ok with this. Since I'm roleplaying, I have to pretend I don't know a lot of things that KSP can give you with incredible accuracy for unexplored places that real space missions have to "feel out" (like Rosetta and New Horizons). I'm really not into tools that lets me plan and do things perfectly on the first try (I actually like the floating point inaccuracies of 32-bit KSP throwing off my mission plans just slightly)

Also, new wiki entry with some general tips & tricks that wouldn't be obvious to newbies (and maybe some vets). Remember this is a public wiki so if anyone else has some tips & tricks just edit this page don't create a new one! :P

Edited by Gaiiden
Link to comment
Share on other sites

So... yes. Turns out that the correction curves are necessary and do have a meaningful impact on atmospheric density. I experimented a bit today and concluded that I needed them.

Long story short, this evening I got the KSP atmospheric model into KSP TOT. It's a bit of a pain, and it's not perfect, but I think it's close enough. The only factor I'm not including is temperature variations due to time of day, because that would involve determining where the sun is for density calculations, and that's pretty expensive. But I think I get a reasonable approximation this way.

...

NOTE: This is a Mission Architect save file BREAKING release. v1.4.0 Mission Architect files will NOT work with v1.5.0 due to the changes in the bodies.ini file structure. Sorry about that. :(

Fine, thanks for checking and showing how it will be implemented :). Though I'm a bit surprised to learn determining the Sun location would be expensive, I'd have guessed it could be done with just some reuse of the functions required for computing longitude on the rotating body and right ascension of Sun. However, looking at some raw data (not yet able to conduct extensive thermal data collection on all atmospheric bodies in KSP) I have to concur about the reasonable approximation even leaving the diurnal variation factor out. Temperature diurnal excursion seems to be marked (~ 30-40°C) only at very high altitudes, where density is low enough that its change would minimally affect drag.

About the old .mat files format (being not compatible with the new 1.5.0 MA), hope you may soon release newer example mission files also. As it showed even few days ago, I still find your example files very useful.

...

Also, new wiki entry with some general tips & tricks that wouldn't be obvious to newbies (and maybe some vets). Remember this is a public wiki so if anyone else has some tips & tricks just edit this page don't create a new one! :P

Great job you're doing with the wiki :).

Link to comment
Share on other sites

Hey guys,

Here's the latest v1.5.0 pre-release.

Please note that this is save-breaking. You'll basically need to start over as I can't promise that updating to this version will preserve all of the data objects in the MAT files for mission architect. Still, I'd appreciate your opinions and thoughts on the new atmospheric model and the launch trajectory planner. :)

Thanks! :)

Link to comment
Share on other sites

okay adding stages works. Sorry but I still have a lot of questions about the actual use of this tool:

I see there is a drag coefficient field for the stages now. Does the Cd calculator tool still work? As in, I build a rocket, hyper-edit it into orbit then do an aerobrake making sure the pointy-end stays prograde. Then stage it and do another for the new configuration, etc.

I'm assuming the dry/wet mass is of that stage only, not the whole rocket at that stage, but want to make sure

So if I'm hot-staging, the Coast field should be 0 correct?

How does the Max Coast factor in? Is that used for the optimizer? If so, why isn't there a way to lock the Coast fields for individual stages?

Ascent Duration seems to be another constraint, and if so one that I should be able to toggle off/on

a Data Point tool would be nice for the graphs at the bottom, and is it possible to also have the ground track plot show distance in km?

I first interpreted the Thrust field as needed to inform the tool of the maximum possible thrust of the engine - but in fact that field is telling the tool the current thrust output (throttle setting) of the engines at that point correct?

What ISP value am I inputting? Vacuum or Atmospheric? It can calculate one from the other I'm sure but I don't know which it starts with.

(In regard to my last two points - I have not played around yet with rocket launches at all in v1 so I'm still completely unfamiliar with the new more-realistic ISP/Thrust relationship so I may be thinking about these values completely wrong and "old-school" pre-v1)

once I get a better handle on how to set up and use this tool I look forward to putting a very simple rocket together with a kOS script running the launch trajectory results to see what happens.

Link to comment
Share on other sites

I see there is a drag coefficient field for the stages now. Does the Cd calculator tool still work? As in, I build a rocket, hyper-edit it into orbit then do an aerobrake making sure the pointy-end stays prograde. Then stage it and do another for the new configuration, etc.

Yes, it still works! :-) And that process sounds good.

I'm assuming the dry/wet mass is of that stage only, not the whole rocket at that stage, but want to make sure

Correct.

So if I'm hot-staging, the Coast field should be 0 correct?

Also correct.

How does the Max Coast factor in? Is that used for the optimizer? If so, why isn't there a way to lock the Coast fields for individual stages?

Max coast is the upper bound the optimizer uses for optimizing the coast duration. And yes, there should be a way to set it individually and lock it for no optimization. Good suggestions.

Ascent Duration seems to be another constraint, and if so one that I should be able to toggle off/on

I agree. :-)

a Data Point tool would be nice for the graphs at the bottom, and is it possible to also have the ground track plot show distance in km?

I suppose I could, but linear distance doesn't make sense since the planet is spherical. Maybe a new down range distance plot instead?

I first interpreted the Thrust field as needed to inform the tool of the maximum possible thrust of the engine - but in fact that field is telling the tool the current thrust output (throttle setting) of the engines at that point correct?

That is correct. Turns out you can show mathematically that the optimal thrust level is always full thrust, so no reason to optimism that, too.

What ISP value am I inputting? Vacuum or Atmospheric? It can calculate one from the other I'm sure but I don't know which it starts with.

It's generic isp at the moment, you could think of it as a time averaged isp. I'm not sure how I would compute atmospheric isp from that though. Ideas?

once I get a better handle on how to set up and use this tool I look forward to putting a very simple rocket together with a kOS script running the launch trajectory results to see what happens.

Please do! I look forward to hearing your thoughts. :-)

- - - Updated - - -

Does the launch trajectory tool work with FAR?

You might need a new bodies file for the FAR atmosphere, but otherwise it should, yes.

Allow the pitch profile to set simply to 'surface prograde' at some points.

I could look into that. Why surface though, as opposed to orbit?

Link to comment
Share on other sites

I could look into that. Why surface though, as opposed to orbit?

Orbit prograde would probably be useful as well, but in the atmosphere surface prograde works better, since it keeps it from getting ripped apart by the atmosphere.

Link to comment
Share on other sites

Oooh so much correctness. I'm quite pleased with myself :)

Maybe a new down range distance plot instead?

Well, down range distance would be nice too, but I was indeed referring just to distance traveled. However you're right in that would not correlate well with a ground plot, derp. Both down-range distance and distance traveled would be very useful launch metrics though. In fact I already use both in my launch telemetry streams, but the precision of my distance traveled measurement could use a lot of improvement (Persistent Trails mod gives it to me, but only in whole number km after a few hundred meters)

That is correct. Turns out you can show mathematically that the optimal thrust level is always full thrust, so no reason to optimism that, too.

Oh crap, I just realized I was treating the Stage listing as time-keys like the pitch points. Grrrrrrr late night posting...

Okay so the way I've launched rockets under pre v1 (again, not done any launches in v1 yet) is to have a booster stage set to burn for a minute, which means reduced thrust output for a longer burn - that usually gets me about 0.8-1.1TWR. I then make up the rest with the main engine(s) to have a 1.3TWR at lift off. Then I throttle up my main engines to full once the boosters burn out and stage. Not sure if it's possible to tell the program I'm doing that. Technically my main engines and boosters are in separate stages, even though they light and are used at the same time.

Maybe the stage listing should be time-keys. Or maybe I just need to change the way I launch rockets :)

It's generic isp at the moment, you could think of it as a time averaged isp. I'm not sure how I would compute atmospheric isp from that though. Ideas?

There are two ISP values KSP gives you for each engine - atmospheric ISP and vacuum ISP. Those are the only two 99.99999% of people (including me :P) are going to know to enter, so it should really be one of those. I have no idea what "time averaged ISP" means

Link to comment
Share on other sites

Anyone have any luck running this with WINE on Linux?
I tried the other day, nothing but trouble and pain. The Matlab Complier Runtime installs on wine-1.7.44 and not on wine 1.6, but then KSPTOT just crashes.
Link to comment
Share on other sites

I'm kind of a noob, so maybe I'm looking at something wrong, but while using the Multi-flyby maneuver sequencer, I think I've found a display bug. After computing a maneuver sequence, the display for Hyperbolic Departure & Flyby Orbits windows seem to have the RAAN and Argument of Periapse swapped (for the initial hyperbolic departure at least) from what would actually give an encounter using the mission architect tools.

Edited by glassbeat
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.

×
×
  • Create New...