Jump to content

[WIN/MAC/LINUX] KSP Trajectory Optimization Tool v1.6.9 [New MATLAB Version!]


Recommended Posts

Hi

I've just started using KSP TOT and tried to find a multi-flyby sequence for Kerbin-Eve-Jool but the solution generated I'm warned by a message below the solution that it "may not be feasible - try again"

How do I find a feasible solution?

Settings I used:-

Central Body: Sun

Launch Window Open: 0 (Yr 1 Day 1)

Launch Window Close: 157680000 (Yr 6 Day1)

Initial SMA 800km

and I kept the default flight time bounds

Link to comment
Share on other sites

Hey guys, I'm looking for calls for feature suggestions for the next version of Mission Architect. I've been thinking of the following and would like to get feedback on them plus other ideas you might have:

1) Kethane/ Karbonite sensor modelling,

2) Low thrust maneuver modelling

What other ideas do you guys have? I'd love to hear them!

Not sure what exacly you mean with sensor modelling, but if you mean a calculator for optimal scanning sattelite altitude then thats a cool idea.

Beside big new features, please consider to improve overall usability. Here are a few things that came to my mind in the past while using the TOT:

  • better integration between the different tools (less ctrl-c)
  • posibility to disable constraints temporarily, without the need to delete them.
  • downloading maneuver nodes from KSP (in fact I already have a Connect module ready for this one :D )
  • networking interface needs some work. TOT could save the last used remote host (or even the last, lets say...five :D) so that one don't have to put it in each time you use it. It would also be great if there were some kind of global "current vessel" variable so that you don't have to select a vessel each time you download an orbit from KSP

Link to comment
Share on other sites

Thanks for getting back to me @Arrowstar !

Can you show me a screenshot of the setting?

Here ya go:

sdeNEh9.png

What do all these do?

  • RTS Process Frequency looks like the plot redraw speed
  • TM Transmission Rate looks like the number of data frames coming from the KSPTOT plugin per second. What is the point of turning this up above 1 if you can't turn up the refresh rate? Is there some averaging going on?
  • And I have NO idea what RTS Process Exec Mode does. Any insight?

Hey guys, I'm looking for calls for feature suggestions for the next version of Mission Architect.

I would love to see some (wow what a surprise) improvements to the realtime system. Here are some suggestions:

  • Turn up the refresh rate (wow what a surprise,) maybe with a warning if you turn it above 1Hz.
  • Add option to plot the target orbit on the Orb Ops panel.
  • Add option to plot maneuver node on orbit on the Orb Ops panel.
  • Add option to show a graphical rotation vector on the S/C dynamics panel.
  • Add option to show maneuver node vector on the S/C dynamics panel.
  • Highlight table entries on the Thermal panel that are critical in red/yellow.
  • Show overall spacecraft temp on Thermal panel.
  • Show total engine and RCS thrust on Propulsion panel.
  • Show total resource draw on Propulsion panel.
  • Replace total [RESOURCE] X/Y display on Propulsion panel with a bar graph.
  • Maybe be able to show only the resources on current stage on Propulsion panel.
  • Fix the weird breakup of the orbit path when rendered in front of the orbiting body in the Orb Ops panel.
  • Add a "Heartbeat" utility to MCC. This would show the stats of the connection in a more user-friendly form than the TM monitor. Maybe show UT, flash something on update and render, and show a graph of average time between updates/renders.

Thanks for this great piece of software!

Edited by Coffeeman
Link to comment
Share on other sites

Couldn't find the bug. But I think it's on the matlab side. Always cuts the last two letters of the bodies names.

Is there anything I could do to successfully load the bodies from KSP....actually I'm going to try this on my desktop, might be a win 8 bug

Link to comment
Share on other sites

Didn't work any better locally on Win 7. It still cuts off the names, and then wont start or calculate. Starting provides the error message

 Reference to non-existent field ". Error in => projectMain.m at line 25

Link to comment
Share on other sites

Is there anything I could do to successfully load the bodies from KSP....actually I'm going to try this on my desktop, might be a win 8 bug

You can use this plugin to create a bodies.ini file. Put the dll somewhere in the GameData folder. After starting KSP and entering the Space Center scene, it should create a subfolder "PluginData/totini" with a fresh bodies.ini in it.

Please let me know if it works.

Edited by RadarManFromTheMoon
Link to comment
Share on other sites

Hi all, sorry for the absence lately. Last week and this have been crazy thus far. I appreciate all the replies regarding my call for suggestions. I'll respond to those below in a moment.

dlrk: Can you describe how I would go about reproducing the problem? I've not seen anything like this on my end.

Link to comment
Share on other sites

Did you miss Starstrider42's question about FAR compatibility for aerobraking? I'm actually wondering that too since you only had me test stock...

If you'd like to go ahead and test FAR, please do! :) Let me know if changes are necessary. If so, I might need to be pointed towards the FAR aerodynamics model, because I don't use FAR myself. Actually implementing the model shouldn't be too hard once I know what the math involved looks like.

Link to comment
Share on other sites

better integration between the different tools (less ctrl-c)

I would love this. Do you have any particular examples of how integration might be improved? There's already an orbit clipboard for pasting orbit data around. :)

posibility to disable constraints temporarily, without the need to delete them.

Yeah, I've wanted to do this for a while. Maybe tonight! :)

downloading maneuver nodes from KSP (in fact I already have a Connect module ready for this one :D )

What would the application for this be? I guess I don't see the utility, to be honest. :)

networking interface needs some work. TOT could save the last used remote host (or even the last, lets say...five :D) so that one don't have to put it in each time you use it. It would also be great if there were some kind of global "current vessel" variable so that you don't have to select a vessel each time you download an orbit from KSP


Yep, also something to work on! :)

Link to comment
Share on other sites

What do all these do?

  • RTS Process Frequency looks like the plot redraw speed
  • TM Transmission Rate looks like the number of data frames coming from the KSPTOT plugin per second. What is the point of turning this up above 1 if you can't turn up the refresh rate? Is there some averaging going on?
  • And I have NO idea what RTS Process Exec Mode does. Any insight?

1) Process Frequency is the rate at which the KSPTOT processes check for new data and redraw it on the screen, yes.

2) TM Transmission Rate is the rate at which data is piped down. It can be useful to set this higher than 1 Hz so that the data being redrawn is always fresh and new. Also I was hoping to get redrawing working above 1 Hz and just couldn't do it on MATLAB's one thread.

3) Process Execution mode basically describes how the timers that run everything execute and compute how much time has elapsed since the last draw. (It's a hook into the MATLAB Timer object's ExecutionMode setting, really.) I wouldn't worry too much about this one, just leave it as is. :)

I would love to see some (wow what a surprise) improvements to the realtime system. Here are some suggestions:

  • Turn up the refresh rate (wow what a surprise,) maybe with a warning if you turn it above 1Hz.
  • Add option to plot the target orbit on the Orb Ops panel.
  • Add option to plot maneuver node on orbit on the Orb Ops panel.
  • Add option to show a graphical rotation vector on the S/C dynamics panel.
  • Add option to show maneuver node vector on the S/C dynamics panel.
  • Highlight table entries on the Thermal panel that are critical in red/yellow.
  • Show overall spacecraft temp on Thermal panel.
  • Show total engine and RCS thrust on Propulsion panel.
  • Show total resource draw on Propulsion panel.
  • Replace total [RESOURCE] X/Y display on Propulsion panel with a bar graph.
  • Maybe be able to show only the resources on current stage on Propulsion panel.
  • Fix the weird breakup of the orbit path when rendered in front of the orbiting body in the Orb Ops panel.
  • Add a "Heartbeat" utility to MCC. This would show the stats of the connection in a more user-friendly form than the TM monitor. Maybe show UT, flash something on update and render, and show a graph of average time between updates/renders.

These are good suggestions. Some, such as the refresh rate and the thermal panel table entries aren't possible either because MATLAB doesn't support it or I can't get the performance to where it would need to be to be viable. Others, though, such as plotting new things on the OrbOps and Dynamics panels, are quite do-able. I'll look into implementing those!

I also like the idea of the heartbeat monitor and the resource bar graph, so I'll especially see about what I can do with those ideas. Thanks!

Thanks for this great piece of software!

You're welcome! I'm glad you enjoy using it, I enjoy putting it together for you guys. :)

Link to comment
Share on other sites

Hi all, sorry for the absence lately. Last week and this have been crazy thus far. I appreciate all the replies regarding my call for suggestions. I'll respond to those below in a moment.

dlrk: Can you describe how I would go about reproducing the problem? I've not seen anything like this on my end.

AFAIK the problem should occur anytime KSPTOT tries to load bodies from KSP with 6.4x Kerbin RSS

Link to comment
Share on other sites

If you'd like to go ahead and test FAR, please do! :) Let me know if changes are necessary. If so, I might need to be pointed towards the FAR aerodynamics model, because I don't use FAR myself. Actually implementing the model shouldn't be too hard once I know what the math involved looks like.

I will let you know as soon as I get some time for a test. I'm busy getting caught up on all my flights that need a flight tracker set up for them (example|details) - MA is extremely useful for me to look up the orbital parameters of course, and keep track of the UT from event to event...

Link to comment
Share on other sites

AFAIK the problem should occur anytime KSPTOT tries to load bodies from KSP with 6.4x Kerbin RSS

Thanks, I'll look tomorrow. If I find the problem and fix it, want to be the tester?

I will let you know as soon as I get some time for a test. I'm busy getting caught up on all my flights that need a flight tracker set up for them (example|details) - MA is extremely useful for me to look up the orbital parameters of course, and keep track of the UT from event to event...

Okay, sounds good! :)

Link to comment
Share on other sites

I would love this. Do you have any particular examples of how integration might be improved? There's already an orbit clipboard for pasting orbit data around. :)

For example the multi flyby sequencer. Would it be possible that it generates a mission out of the calculated parameters? Maybe I overlooked something but last time I used it, I copy n pasted a lot of values into the MA. This was particularly tedious because some windows just can't be opened simultaneously.

What would the application for this be? I guess I don't see the utility, to be honest. :)

While KSPTOT is very good at optimizing trajectories, it is often hard to even hit the desired SOI in the first place. Running the optimizer is time consuming and often ends up with bad results if optimization values are choosen poorly.

The way KSP is handling Maneuver node creation however, is very straightforward and visual, but not particularly precise. The idea is to get the best out of both worlds. Imagine a mission to another planet. After performing the transfer burn you realize that you screwed up the burn, totally miss the SOI, and will need a massive course correction burn. So, in theory, you import the current orbit into MA, setup a burn and optimize it until it delivers the desired result. If you are good in this and choose the right values, this will work on the first run. But often it is a game of multiple optimizer runs with optimization value tweaking in between. Now imagine you could just setup a maneuver node in map view that more or less achieve the thing you want. You load it up to MA and optimize it to meet the given constraints.

So the improvement I would hope to get from a feature like this, is that I could tell MA in what direction I want to go and reduce the need of time consuming optimizer runs.

Hi all, sorry for the absence lately. Last week and this have been crazy thus far. I appreciate all the replies regarding my call for suggestions. I'll respond to those below in a moment.

dlrk: Can you describe how I would go about reproducing the problem? I've not seen anything like this on my end.

Really? Everythings alright when you try it? I'm getting the same strange behaviour on a stock install no matter if I try it over the network or the loopback interface. All celestial body names are missing the last two letters and most values are messed up entirely. The code in KSPConnect seems to be alright. I even did a rewrite of most of it to use the new network system for sending, but it didn't changed anything. Couldn't inspect the network packages though. KSPTOTConnect converts plain text to doubles before sending them. Network sniffer tools don't like that. Is there any particular reason for such an approach? Does matrix laboratory like doubles more than other data types? :D

Edited by RadarManFromTheMoon
Link to comment
Share on other sites

If you'd like to go ahead and test FAR, please do! :) Let me know if changes are necessary. If so, I might need to be pointed towards the FAR aerodynamics model, because I don't use FAR myself. Actually implementing the model shouldn't be too hard once I know what the math involved looks like.

If you haven't specifically added FAR support, then it won't work. It's a pretty severe override of the stock system.

I know (Atmospheric) Trajectories supports calculation of drag for both stock and FAR, and it's trying to solve the same problem as you, so that might be a good place to look at what's involved.

Link to comment
Share on other sites

For example the multi flyby sequencer. Would it be possible that it generates a mission out of the calculated parameters? Maybe I overlooked something but last time I used it, I copy n pasted a lot of values into the MA. This was particularly tedious because some windows just can't be opened simultaneously.

Sadly, it's not possible. The whole of KSP TOT (besides MA) uses a zero-radius sphere of influence to simplify the calculations (also because this is what you learn in your first orbital mechanics course at university lol). However, as you know, Mission Architect does model the sphere of influence correctly. This results in some minor differences between what should otherwise be two identical mission plans. It's also why I can't just import maneuvers from the flyby sequencer into MA: they wouldn't work anyways.

So as much as I'd love to be able to do what you're requesting (trust me, it bugs me too), it's really not possible to achieve with any decent results. Sorry!

While KSPTOT is very good at optimizing trajectories, it is often hard to even hit the desired SOI in the first place. Running the optimizer is time consuming and often ends up with bad results if optimization values are choosen poorly.

The way KSP is handling Maneuver node creation however, is very straightforward and visual, but not particularly precise. The idea is to get the best out of both worlds. Imagine a mission to another planet. After performing the transfer burn you realize that you screwed up the burn, totally miss the SOI, and will need a massive course correction burn. So, in theory, you import the current orbit into MA, setup a burn and optimize it until it delivers the desired result. If you are good in this and choose the right values, this will work on the first run. But often it is a game of multiple optimizer runs with optimization value tweaking in between. Now imagine you could just setup a maneuver node in map view that more or less achieve the thing you want. You load it up to MA and optimize it to meet the given constraints.

So the improvement I would hope to get from a feature like this, is that I could tell MA in what direction I want to go and reduce the need of time consuming optimizer runs.

Okay, I'll buy all that. I'll tell you what, you mentioned you had some KSPTOTConnect code that could send maneuver information already? Send it to me, tell me how it works, and I'll code it up and put into into the Mission Architect of the next KSP TOT release (v1.1.9). :)

Really? Everythings alright when you try it? I'm getting the same strange behaviour on a stock install no matter if I try it over the network or the loopback interface. All celestial body names are missing the last two letters and most values are messed up entirely. The code in KSPConnect seems to be alright. I even did a rewrite of most of it to use the new network system for sending, but it didn't changed anything. Couldn't inspect the network packages though. KSPTOTConnect converts plain text to doubles before sending them. Network sniffer tools don't like that. Is there any particular reason for such an approach? Does matrix laboratory like doubles more than other data types? :D

So... I guess I need to apologize to the community. :P I think I forgot to update the KSPTOTConnect DLL file in the last release. Can you try downloading KSP TOT again from the first post in this thread and see if updating the plugin DLL helps? It should have a modified date of 9/29/2014.

If you haven't specifically added FAR support, then it won't work. It's a pretty severe override of the stock system.

I know (Atmospheric) Trajectories supports calculation of drag for both stock and FAR, and it's trying to solve the same problem as you, so that might be a good place to look at what's involved.

Okay, that's fine. Where can I find details on the FAR/NEAR drag model?

Link to comment
Share on other sites

Sadly, it's not possible. The whole of KSP TOT (besides MA) uses a zero-radius sphere of influence to simplify the calculations (also because this is what you learn in your first orbital mechanics course at university lol). However, as you know, Mission Architect does model the sphere of influence correctly. This results in some minor differences between what should otherwise be two identical mission plans. It's also why I can't just import maneuvers from the flyby sequencer into MA: they wouldn't work anyways.

hmmm...thats not exactly what I mean. I know the numbers are not entirely correct. They more or less just point into the right direction. So what you do is copying them into MA and optimize like crazy, until you get what you want, right? So, when I can do copy n' paste, I'm sure the TOT could also just do it for me. For example generating a MA plan for me thats ready to get optimized. Or, probably easier to implement, at least an easier way to copy those burns. One click to flightplan won't happen, I'm awared of that. I just say: Make it more convenient. :)

Regarding the Maneuver Module: Happy you wanna give it a try. :) I'll send you the class as soon as I am on the right computer.

Link to comment
Share on other sites

If you mean actual documentation, I don't know of any. You could try poking around the forum thread or the repository. And, as noted, Trajectories should have some useful examples.

Thanks! That was pretty useful. So useful, in fact, that I came up with a version of aerobraking tonight that incorporates the FAR model.

Anyone want to try it out?

hmmm...thats not exactly what I mean. I know the numbers are not entirely correct. They more or less just point into the right direction. So what you do is copying them into MA and optimize like crazy, until you get what you want, right? So, when I can do copy n' paste, I'm sure the TOT could also just do it for me. For example generating a MA plan for me thats ready to get optimized. Or, probably easier to implement, at least an easier way to copy those burns. One click to flightplan won't happen, I'm awared of that. I just say: Make it more convenient. :)

Alrighty, I'll think about what I can do. I already gave an orbit clipboard, maybe I can implement a maneuver clipboard as well. :)

Regarding the Maneuver Module: Happy you wanna give it a try. :) I'll send you the class as soon as I am on the right computer.

Thanks!

Link to comment
Share on other sites

Sadly, it's not possible. The whole of KSP TOT (besides MA) uses a zero-radius sphere of influence to simplify the calculations (also because this is what you learn in your first orbital mechanics course at university lol). However, as you know, Mission Architect does model the sphere of influence correctly. This results in some minor differences between what should otherwise be two identical mission plans. It's also why I can't just import maneuvers from the flyby sequencer into MA: they wouldn't work anyways.

That is very interesting. Know it makes more sense to me, that I couldn't reproduce the flyby-sequencer in the MA. However, I don't quite get yet, what a zero-radius sphere of influence means. If you are on a flyby around, say, Eve, and you never enter its SOI, you shouldn't get any gravity influence from Eve. Or do you mean that the influence of the Sun is never neglected? Please enlighten me, wise one. ;-).

Link to comment
Share on other sites

That is very interesting. Know it makes more sense to me, that I couldn't reproduce the flyby-sequencer in the MA. However, I don't quite get yet, what a zero-radius sphere of influence means. If you are on a flyby around, say, Eve, and you never enter its SOI, you shouldn't get any gravity influence from Eve. Or do you mean that the influence of the Sun is never neglected? Please enlighten me, wise one. ;-).

Let's say we want to to a Kerbin -> Eve -> Duna mission. We can greatly simplify the calculations by considering each of the planets and their SoIs to be points. This is because we can then analytically solve for the trajectory between each body using what is called a Lambert solver. If we introduce SoIs that are bigger than zero-sized, then we can't use Lambert solvers and the whole thing becomes very tricky and quite the mess (source: the SoI code in Mission Architect is the most annoying and tricky part of the whole Mission Architect code base). This simplification is so important that it's basically how everyone learns to do patched conics in school, and how preliminary interplanetary trajectories are analyzed.

Having a zero-sized SoI doesn't mean you don't consider it, though! For example, in my hypothetical Eve flyby mission, we would just have to compute the Eve SoI portion separately. There are lots of ways to do this, but it gets a bit tricky in some places too. The way KSP TOT works is to figure out the optimal Kerbin -> Eve and Eve -> Duna segments and then, once you've got that nailed down, figure out how the Kerbin departure and Eve flyby trajectories need to be.

Final note: KSP is a bit different than normal because it does use finite-sized SoIs. It does this for game play reasons, however. In the real world, we either ignore SoIs completely (for preliminary trajectory analysis) or we use high fidelity orbit propagators that model the N-body problem directly.

EDIT: has anyone tried the FAR aerobraking modeling build I posted above?

Link to comment
Share on other sites

Been busy, but it's on my ToDo list and I will get you some results as soon as I am able if no one beats me to it

Thanks! Let me know how it goes...

Btw, RadarManFromTheMoon, I added your functionality to get the maneuver nodes from KSP and import them into KSPTOT Mission Architect. It seems to work nicely. :)

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