Jump to content

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


Recommended Posts

Two things missing:

First, gravity assists from muns on the way to some other planet. Kerbin has a very convient mun which could provide an assist to just about anywhere, provided you time your ejection correctly.

Second, what about gravity assists from the destination body? The Messenger probe (I believe) to Mercury used not one but two gravity assists from Mercury to slow down enough to be able to enter orbit. This is acutally much easier to model, since you only have to calculate what height to perform the flyby so that the gravity assist slows you down or speeds you up just the right amount to enter into a resonant orbit of some sort, where you can then either insert into orbit the next time you come around, or else use another gravity assist to an even closer resonant orbit.

Link to comment
Share on other sites

Arrowstar, I'm confused - the tutorial...

Before launch it tells me to get the UT from MechJeb and plug that into KSP TOT... But a few paragraphs later it tells me that MechJeb and KSP TOT don't calculate date the same.

If that is true, then the MechJeb date you told me to plug in is 1 year and 1 day older than my actual condition...

Please help, I don't know which of your instructions was correct. But they are contradictory to each other..

Thanks!

Edited by Kurtvw
Link to comment
Share on other sites

Hi everyone! Sorry it's taken me so long to get back to the responses on this thread. I've been working long, very early days (getting up before 4 AM) this past week and that's really limited my motivation to respond to the forum. :) Never fear, though, I've actually gotten a fair bit of work done on KSP TOT and the MCC software.

Best example I'll show is the new Dynamics console. In "real life," the Dynamics engineer in the MCC is responsible for vessel pointing attitude rates. At Boeing, we combine that position with "ACS" (attitude control) to form one "ACS/Dynamics" console position. I've basically done the same here and thus have included information regarding the state of the vessel's reaction wheels, RCS, ASAS, etc. Take a look!

hNbkBi1.png

There are also some new options for setting TM data rate out of KSP and other related things. You'll see when you play with it. I'm going to get a pre-release out as as soon as I can build the code and test it out in Windows. :)

Those console screenshots look pretty in-depth. I take from it that you can basically get any info you need from KSP and possibly send stuff back for remote control? Looks awesome! :D

Thanks for your work on this. The possibilities you opened up with KSPTOT are endless.

PS: I sent you a PM with some code...

Thanks! I'll take a look.

Two things missing:

First, gravity assists from muns on the way to some other planet. Kerbin has a very convient mun which could provide an assist to just about anywhere, provided you time your ejection correctly.

Second, what about gravity assists from the destination body? The Messenger probe (I believe) to Mercury used not one but two gravity assists from Mercury to slow down enough to be able to enter orbit. This is acutally much easier to model, since you only have to calculate what height to perform the flyby so that the gravity assist slows you down or speeds you up just the right amount to enter into a resonant orbit of some sort, where you can then either insert into orbit the next time you come around, or else use another gravity assist to an even closer resonant orbit.

Regarding 1) Performing a gravity assist maneuver with a body within your current sphere of influence isn't a problem I've studied yet. I'll give it a think and see what I come up with.

Regarding 2) The code is only capable of optimizing one gravity assist maneuver by design. A multi-body gravity assist flight plan is very CPU intensive and hard to set up and get right. This isn't something you're just going to be able to whip out in a few minutes using KSP TOT. NASA spends years studying these trajectories on high performance workstations. What I've given everyone in KSP TOT is a simplified version that can be used to do 99.9% of everything the average/advanced user might want. Anything more isn't feasible. (I know, I actually wrote code to do what you're asking for and it was a pain in the neck to get it to provide any good results at all.) I've left this out to improve the user experience.

Thanks for the thoughts, though! I do appreciate the feedback and I'll take (1) under consideration.

Arrowstar, I'm confused - the tutorial...

Before launch it tells me to get the UT from MechJeb and plug that into KSP TOT... But a few paragraphs later it tells me that MechJeb and KSP TOT don't calculate date the same.

If that is true, then the MechJeb date you told me to plug in is 1 year and 1 day older than my actual condition...

Please help, I don't know which of your instructions was correct. But they are contradictory to each other..

Thanks!

Hi Kurtvw. The times are the same but the way Mech Jeb and I represent them is different. Basically MechJeb starts at Year 0, Day 0 and I (and KSP!) start at Year 1, Day 1. So yes, when you read times from MechJeb, just add a year and a day. :)

Link to comment
Share on other sites

Alright, and here we are! The v0.11 pre-release is here!

THIS IS PRE-RELEASE SOFTWARE. STABILITY IS NOT GUARANTEED AND SOURCE CODE IS NOT INCLUDED.

(Source will be included in the proper release. This pre-release is subject to the same license as the main release.)

KSP TOT v0.11 PRE-RELEASE

Major changes include:

  • KSP TOT Connect, a KSP plugin that allows KSP TOT to "talk to" KSP and retrieve and send information!
    • Grab the orbit and game UT from straight from KSP!
    • Upload maneuver nodes straight from the applications and execute them! (Note, you still have to fly them, KSP TOT is not an autopilot. :P) Right click on any Maneuver Information text box to see the option to upload.

    [*]A preliminary version of KSP TOT Real Time System (RTS) - a mission control center suite for KSP!

    • Using KSP TOT Connect, monitor a vessel's orbit, attitude, maneuver nodes, and more!
    • Used in conjunction with KSP TOT, can make for a cool "Mission Control Center" experience. :)

    [*]A handful of very minor fixes on the KSP TOT side.

Some current limitations with the MCC software:

  • You can only use it to connect to KSP on your own computer at the moment. Basically, KSP TOT only looks for connections on (and KSP TOT Connect only accepts connections from) localhost. This will change hopefully by Sunday evening. I'm going to put together a whitelist system for IP addresses that KSP TOT Connect will accept connections from.
  • Connection status is currently determined by the last time the game UT is sent over to KSP TOT via telemetry. Don't set the TM data rate below 3 frames/second of TM of you may get "disconnected".
  • Occasionally the tables in the TM monitor page flicker. Not much I can do about it, it's a MATLAB bug.
  • KSP has to be in the FLIGHT SCENE (you need to be looking at a ship in orbit or on the ground) for KSP TOT to connect. The tracking center, VAB, SPH, Space Center, etc do not count. You must be in the Flight Scene. (If you go back to the Space Center from the flight scene, KSP TOT should disconnect gracefully, though it make take a few moments, so be patient.) This is because the KSP TOT Connect plugin doesn't run outside of the flight scene by design.
  • The Enhanced Maneuver Nodes plugin doesn't seem to work when KSP TOT Connect is installed. Not sure why.
  • Only the OrbOps, Dynamics, and TM Monitor console pages are available at the moment. The others are in work.

To use the new KSP TOT RTS, do the following:

  • Unzip the pre-release package to some folder somewhere. Place the contents of the GameData directory in your KSP install's GameData directory, as you would do when installing any plugin/mod.
  • Run the KSP TOT executable. Give it a few moments to start up, it has to unpack two new toolboxes I needed to include to make the connection between KSP and KSP TOT work. Could be up to 10-15 seconds.
  • In the menu bar of KSP TOT, you'll see something about the Real Time System. Select the MCC option. Make sure you're in the flight scene before you do this step.
  • Select a vessel to connect to in the dialog that pops up. Tap 'Connect.'
  • Viola, happy MCCing. :)

Please let me know if you find any serious bugs or something's not working. I've tested everything on my end quite a bit, but I can't test everything.

Thanks, everyone! :)

Link to comment
Share on other sites

Ok, I downloaded the latest Mat stuff from your other thread, downloaded this version and installed. I restarted ksp and went to one of my flights in progress. then started KSP_TOT and then selected real time system. next i told it mcc real time system, but..... it does not show any of my vessels as being there and it says on the bottom in red, "could not connect - check if ksp is running in flight scene". H'mmmm

Are there any hard-wired dir names for the ksp or else that you are looking for?????

Link to comment
Share on other sites

Ok, I downloaded the latest Mat stuff from your other thread, downloaded this version and installed. I restarted ksp and went to one of my flights in progress. then started KSP_TOT and then selected real time system. next i told it mcc real time system, but..... it does not show any of my vessels as being there and it says on the bottom in red, "could not connect - check if ksp is running in flight scene". H'mmmm

Are there any hard-wired dir names for the ksp or else that you are looking for?????

Did you install the KSP TOT plug in into the GameData folder of your KSP install?

Link to comment
Share on other sites

I have the same issue. I am in flight mode with the probe in orbit, but it doesn't connect (Check if ksp is running in flight scene)

EDIT1: Turning the Firewall of does not help i will try to run everything as administrator now.

EDIT2: Doesn't work either. I guess the plugin somehow is not loaded in KSP.

Edited by Mefi282
Link to comment
Share on other sites

Alright hang tight. I'm going to upload a build which has some extra debugging in it on the KSP TOT side. It also has my update to allow connections to remote computers, but I'd like you all to keep trying to connect to localhost for the time being. You'll see what I mean.

In the mean time, can you do the following:

A) Start a flight in KSP,

B) Open the debug log with Alt-F2,

C) Tell me if you see a line like this: [KSPTOT Connect] Server Started.

Do this at least the new debug version I'm uploading soon. If you see this before that gets up, do it on the current install you have. This will let me know if KSP TOT Connect is actually running in KSP. If you could take a screenshot of KSP with the debug log open so I can see that line, that would be great (post it here.)

Link to comment
Share on other sites

And here's the pre-release, version 2 with debugging:

KSPTOT V0.11 PRE-RELEASE 2

Please give this a try and tell me what happens. Note: you need to FULLY remove the KSPTOTConnect folder from your GameData folder and replace it with the one in the ZIP file.

Usage is similar but slightly different from the first release:

1) Start the KSP TOT application as normal.

2) KSP Real Time System -> MCC Real Time System

3) Leave the remote host field as "localhost" (no quotes).

4) Tap "Test Connect to Remote Host."

5) If it works, the drop down menu will populate. If it doesn't, you'll get an error. I need to know what that error is.

When you run this, take a screenshot of the error message that pops up when you try to connect. Remember, when you test it I also need a screenshot of your debug log from within KSP.

Thanks! :)

Link to comment
Share on other sites

Regarding 2) The code is only capable of optimizing one gravity assist maneuver by design. A multi-body gravity assist flight plan is very CPU intensive and hard to set up and get right. This isn't something you're just going to be able to whip out in a few minutes using KSP TOT. NASA spends years studying these trajectories on high performance workstations. What I've given everyone in KSP TOT is a simplified version that can be used to do 99.9% of everything the average/advanced user might want. Anything more isn't feasible. (I know, I actually wrote code to do what you're asking for and it was a pain in the neck to get it to provide any good results at all.) I've left this out to improve the user experience.

I wasn't really talking about muti-body assists - I was talking about the case where you get a gravity assist from the destination body - something like Kerbin-Moho-Moho, where the first Moho encounter slows the craft down so that the second time it comes around it can insert into orbit more easily. The trick is to figure out the proper altitude to fly by at in order to get into a resonant orbit relative to the Sun, so that you encounter the destination again. The limitation to this technique is that the closer your orbit is to the target body, the longer you have to wait for the second encounter. I really wouldn't want to try this with Eeloo:D.

Edited by Keldor
Link to comment
Share on other sites

And here's the pre-release, version 2 with debugging:

KSPTOT V0.11 PRE-RELEASE 2

Please give this a try and tell me what happens. Note: you need to FULLY remove the KSPTOTConnect folder from your GameData folder and replace it with the one in the ZIP file.

Usage is similar but slightly different from the first release:

1) Start the KSP TOT application as normal.

2) KSP Real Time System -> MCC Real Time System

3) Leave the remote host field as "localhost" (no quotes).

4) Tap "Test Connect to Remote Host."

5) If it works, the drop down menu will populate. If it doesn't, you'll get an error. I need to know what that error is.

When you run this, take a screenshot of the error message that pops up when you try to connect. Remember, when you test it I also need a screenshot of your debug log from within KSP.

Thanks! :)

BINGO!... That did it.. Working fine now....

Just for your info, my system has two NIC's, one of which is dedicated to iSCSI Raid. It might be possible that for some reason the first version was getting 'hung' on that particular device entry as it is listed first. Just a thought...

This is really, REALLY cool...

Great work.

Link to comment
Share on other sites

<snip>

I've got this i hope you can find a solutuion for this :D

BINGO!... That did it.. Working fine now....

Just for your info, my system has two NIC's, one of which is dedicated to iSCSI Raid. It might be possible that for some reason the first version was getting 'hung' on that particular device entry as it is listed first. Just a thought...

This is really, REALLY cool...

Great work.

Thanks, guys. Drtedastro, I'm glad you were able to find a solution and it all works for you now. Mefi, was the screenshot you posted from the first or second version of the pre-release? Honestly, I can't think of any reason why it doesn't work. Are you behind a router?

Link to comment
Share on other sites

I wasn't really talking about muti-body assists - I was talking about the case where you get a gravity assist from the destination body - something like Kerbin-Moho-Moho, where the first Moho encounter slows the craft down so that the second time it comes around it can insert into orbit more easily. The trick is to figure out the proper altitude to fly by at in order to get into a resonant orbit relative to the Sun, so that you encounter the destination again. The limitation to this technique is that the closer your orbit is to the target body, the longer you have to wait for the second encounter. I really wouldn't want to try this with Eeloo:D.

You should check out PyKEP, which is available for free. I played around with it a bit, and did some slingshots with it, so I can verify that it works!

Link to comment
Share on other sites

I'm running the prerelease-2 and it's on the same computer. And yes i am behind a router but who isn't ;) I'd really like to test the new features.

Hmm, okay. Is the set up of the computer or its network odd in some way? Maybe instead of 'localhost' on the connection menu, you can try your network IP address (192.168.0.x) or internet IP (Google "My IP Address" to quickly find out what it is). If you do this, you will need to add whatever IP you're connecting from to the IPAddressWhitelist file located here:

GameData\KSPTOTConnect\Plugins\PluginData\KSPTOTConnect\IPAddressWhitelist.txt

Just use one IP address per row. Give that a shot and let me know how it works. :)

EDIT: Example whitelist file would look like this:

74.125.224.72

192.168.0.1

Edited by Arrowstar
Link to comment
Share on other sites

Hey guys, another heads up:

As far as I can tell, pre-release 2 of KSP TOT Connect (see link above) works with 0.23. Feel free to test it out and let me know if you find issues, though.

In addition, a notice regarding my availability: I'm heading out on vacation for about two weeks starting tomorrow. I'll still have some time to work on code here and there, but releases will be slowed until right after the new year. I'm hoping to get 0.11 out in January with a fully featured KSP MCC suite. :)

Link to comment
Share on other sites

Hey guys, another heads up:

As far as I can tell, pre-release 2 of KSP TOT Connect (see link above) works with 0.23. Feel free to test it out and let me know if you find issues, though.

In addition, a notice regarding my availability: I'm heading out on vacation for about two weeks starting tomorrow. I'll still have some time to work on code here and there, but releases will be slowed until right after the new year. I'm hoping to get 0.11 out in January with a fully featured KSP MCC suite. :)

Take your time. Enjoy!

Link to comment
Share on other sites

Can this be used to plot a transfer orbit for any time instead of having to wait for the optimal transfer window? I went to Duna and overdid it plenty on the fuel capacity. It has one orange tank and four FL-T800 tanks of fuel it won't need to tap at all for the return. The four orange tanks and four engines on them will be enough for the optimum return. Tested that in an experimenting save.

So I'd love to hurry up the return instead of having the crew twiddle their thumbs for almost 150 more days. Once the return boost stage is tapped out, the ship has a Skipper and four LV-T30 engines to slow down to get into an orbit around Kerbin. Doesn't need to be a particularly good orbit as I have many ways to refuel or just dock a tank to the top of the lander like I did to get back from my very first non-crashing or completely missing the moon Mun trip. ;)

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