Jump to content

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


Recommended Posts

2 hours ago, Arrowstar said:

You're probably running into the "zero SOI radius" assumption.  It's a little complicated, but if you want to use MFMS results for actually running your manevuers, here's what you should do.

  1. Generate the Flyby Maneuver Sequence.
  2. Tap the "Save Results to File for LVD" button and save the file to some location.
  3. Open Launch Vehicle Designer (LVD).
  4. In LVD, File -> New Mission Plan From MFMS Output.  Select the file you saved in Step (2).
  5. Optimization -> Optimize Mission.

See if that gets you a delta-v maneuver that intersects Eve.

How long do I wait for this? Do I have to pause it manually or wait for something to pop out

Link to comment
Share on other sites

48 minutes ago, RaceToTheMun said:

How long do I wait for this? Do I have to pause it manually or wait for something to pop out

It should be immediate.  If you don't see anything, check your KSPTOT.log file for an error message.

Link to comment
Share on other sites

34 minutes ago, Arrowstar said:

It should be immediate.  If you don't see anything, check your KSPTOT.log file for an error message.

Ah well, it took a while but it finished. I have to click the stop button but I choose the left green option iirc but the manuever still won't intersect eve

Link to comment
Share on other sites

6 minutes ago, RaceToTheMun said:

Ah well, it took a while but it finished. I have to click the stop button but I choose the left green option iirc but the manuever still won't intersect eve

Can you share a screenshot or the LVD MAT file?

I think I misunderstood at first.  I was thinking you were asking how long it took to generate the MFMS data file for LVD.  The actual optimization of the trajectory in LVD could take some time, yes.

Link to comment
Share on other sites

On 4/4/2023 at 1:50 AM, Arrowstar said:

Can you share a screenshot or the LVD MAT file?

I think I misunderstood at first.  I was thinking you were asking how long it took to generate the MFMS data file for LVD.  The actual optimization of the trajectory in LVD could take some time, yes.

here

Link to comment
Share on other sites

  • 3 weeks later...

Hi everyone,

Tonight I've built KSPTOT v1.6.10 pre-release 5.  There are a few new features I want to discuss in this release before I get to the change log.  These are all Launch Vehicle Designer (LVD) related.

First, body (meaning "spacecraft") angular rates are now available to be used as Graphical Analysis tasks and as constraints as well.

Second, there are a variety of new actions you can apply to events.  These are:

  • Set Plugin Variable Value: Sets the value of a  "plugin variable" to a particular constant number.
    • Example: Value = 5
  • Add Value to Plugin Variable Value: Sets the value of a "plugin variable" to itself plus or minus a given constant number.
    • Example: Value = Value + 5
  • Set Plugin Variable Value to Quantity: Sets the value of a plugin variable to the value of a given graphical analysis task quantity.
    • Example: Value = Altitude [Kerbin Inertial Frame]
  • Set Next Event: Sets the next event to be executed to a given event.
    • I'll get to why this is relevant more in a bit.

Third, there is a new Conditional Action.  A conditional action is an action that lets you set the conditions by which a group of actions may or may not be executed.  The action is structured in the same way that an "if-else if-else" structure written in a programming language.  Let's walk through the UI.

uxveDkY.png

The upper section, the "IF" section, is evaluated first.  If the condition on the left is true, then the actions on the right are evaluated.

The middle section, if "ELSE IF" section, is evaluated next if the IF condition returned true.  You can have as many ELSE IF conditions as you'd like, each with their own conditions and associated actions. 

If none of the previous conditions returns true, then the "ELSE" actions are executed, if any.

Conditions are edited through their own UI.  Most conditions will be based on Graphical Analysis task quantities, but there are also AND and OR booleans that let you chain conditions together in a very flexible way.

BF2YLVL.png

The best part about this is that you can use this, combined with the new "Set Next Event" action, to create conditional, branching trajectories.  I've done this is the example UIs that I've been showing here.  Note that the "quantity comparison" conditional can compare one quantity against a fixed, constant number like I'm doing here or against the value of a different quantity at that same point in time.  This is particularly useful for comparing the values of Plugin Variables, which are really now great places to store numeric data that you might want to compare against as you propagate your trajectory.

Anyway, that's the main gist of things!  Here's the full change log. 

  • LVD: Added new polling and search methods for patternsearch().
  • LVD: Warn/alert area is now a UI table.
  • The KSPTOT main GUI has been replaced with something that is much more visually indicative of what functionality KSPTOT has to offer.
  • KSPTOT UI now supports theming of the colors of all UIs.  Access from the new main GUI: View -> Edit Themes and View -> Set Theme.
  • New icons for KSPTOT and various KSPTOT tools and applications.  There is also a new splash screen shown when loading KSPTOT.
  • LVD: GUI areas for initial/final state is now a text area so it can scroll.
  • LVD: Added body angular velocity Graphical Analysis tasks.
  • LVD: Added body angular rate constraints.
  • LVD: Added conditional action.
  • LVD: Added Longitude termination condition
  • LVD: Added Add value to plugin var value action and other similar actions.
  • LVD: Added Set Next Event action.
  • LVD: Actions are now sorted alphabetically.
  • Fixed bug with Select Departure/Arrival Date button in Compute Departure stuff.

That should be it!  Let me know if you have any questions or find any bugs!  Happy orbiting!

Link to comment
Share on other sites

On 4/26/2023 at 7:16 AM, Sauge said:

Hey I'm trying to follow one of the included tutorials for Mission Architect but the Architects is not working for me, when I setup my initial state I get this warning....which I can't read since I can't resize the window for some reason
https://imgur.com/a/JdhRPSP

Hey there, that warning just means that the mission needs to be run first.  It's not really an error and it doesn't imply that anything is wrong.  That said, I'd encourage you to use Launch Vehicle Designer (LVD) instead, since it's a far more fully featured and robust mission planning tool that works for both launch vehicles and spacecraft.  I haven't really maintained MA in a number of years now aside from a bug fix here and there.

Link to comment
Share on other sites

Hello, what's wrong with this, I didn't get the same result as the second tutorial. The UT of Final Spacecraft State was very different from the tutorial and Optimization didn't work.

3cd1950dab08e187c3d6e99915f1ae16.png

Here are configs of each event

5129986091c39164fb802cdfaa8b8c37.png

0798578e472f50b58ed01105151479fd.png

8babc9cdb8b09e016fa3131234bb99d1.png

8babc9cdb8b09e016fa3131234bb99d1.png

ae6574126e8aac38d924e82401412581.png

I noticed that in the tutorial KSPTOT v1.5.4 was used. Is there any difference in the algorithm?

Link to comment
Share on other sites

  • 1 month later...

Hey arrowstar, new KSP TOT user here. may I ask you two questions?

1) suppose I want to fire the engines in a prograde direction, but I don't want to use the "instant dv" action but rather set the throttle to 100% and wait for x seconds before shutting it off. What kind of steering action am I supposed to use to just say "point prograde"?

2) I have somehow managed to put my ship from the KSC all the way into orbit by following your pdf tutorial for the lvd. I needed that specific orbital parameters and that 's why I need to freeze all the variables before proceeding to optimize the next section of the mission. However, if I disable the optimization in one or more events (eg: they all have two ** in the name) and I optimize the rest of the mission, my entire launch profile screws up  (yeah from stage one) because my  variables gets modified anyway. Am I forgetting something?

Thank you very much in advance!

Link to comment
Share on other sites

  • 4 months later...
On 10/23/2023 at 12:57 PM, akyyy said:

Maybe someone could make a Twitch or youtube  full lenght video of a gravity assist? :D 

I don't have the skills for that, but if anyone would like to give it a go, they are welcome to let me know and I'll help with info as I can. :)

Link to comment
Share on other sites

  • 4 weeks later...
  • 1 month later...

Hello! I've recently started messing with KSP TOT and specifically the LVD.

I think I am at a point where I mostly understand how to plan basic missions and gravity assists. But I am not quite sure on how to actually execute the missions.

1: I plan an eve gravity assist from Kerbin Orbit with 800km SMA at say 150000s UT.
2: Now I launch a probe to that orbit but obviously the orbit isn't going to be perfect so I import the orbit from the active vessel and re-optimize. So far so good although quite a lot of toggling as I mostly want to change the time first I assume?
3: I execute my departure burn, but it's not going to be perfect, and this is where I am starting to be lost. Now on my way on the first coast event, how do I add a correction burn and re optimize my mission from where I currently am? Is there any way I can again import my spacecraft state tell it where in the mission i am, add a correction burn to fix my course,  continue to my eve departure burn and repeat that until mission end?

Am I thinking about this totally wrong or am I missing something?

Link to comment
Share on other sites

  • 2 weeks later...
On 12/25/2023 at 12:16 PM, 7e21 said:

Hello! I've recently started messing with KSP TOT and specifically the LVD.

I think I am at a point where I mostly understand how to plan basic missions and gravity assists. But I am not quite sure on how to actually execute the missions.

1: I plan an eve gravity assist from Kerbin Orbit with 800km SMA at say 150000s UT.
2: Now I launch a probe to that orbit but obviously the orbit isn't going to be perfect so I import the orbit from the active vessel and re-optimize. So far so good although quite a lot of toggling as I mostly want to change the time first I assume?
3: I execute my departure burn, but it's not going to be perfect, and this is where I am starting to be lost. Now on my way on the first coast event, how do I add a correction burn and re optimize my mission from where I currently am? Is there any way I can again import my spacecraft state tell it where in the mission i am, add a correction burn to fix my course,  continue to my eve departure burn and repeat that until mission end?

Am I thinking about this totally wrong or am I missing something?

Hey, sorry about taking forever to get back to you.  Between Christmas and New Year's Day I've been pretty busy recently.

You've basically got the idea on point 3 about updating the state.  Once you're in between major bits of the mission and you're just coasting along, you can remove the previous segments and update the initial state to match your current state in the game via importing it (right click in the Initial State dialog box).  At that point you can add maneuvers for corrections and stuff like that.

I think there's  an "advance to segment" option in the right click menu of the script listbox that helps make some of this easier!

Does this help any? 

Link to comment
Share on other sites

On 1/6/2024 at 7:06 PM, Arrowstar said:

Hey, sorry about taking forever to get back to you.  Between Christmas and New Year's Day I've been pretty busy recently.

You've basically got the idea on point 3 about updating the state.  Once you're in between major bits of the mission and you're just coasting along, you can remove the previous segments and update the initial state to match your current state in the game via importing it (right click in the Initial State dialog box).  At that point you can add maneuvers for corrections and stuff like that.

I think there's  an "advance to segment" option in the right click menu of the script listbox that helps make some of this easier!

Does this help any? 

It certainly helps and the advance to segment is a usefulthing I missed, but I'm still a little confused on how to deal with time disrepancies with how much things rely on the duration since the last state in LVD. Where there is a couple more things like coast to UT, revs before coasting to true anomaly etc in Mission Architect.

As a side note, when I try to use nbody coast to UT in mission architect I can not open the edit window for that event again at all (like for the lunar transfer tutorial on the wiki). Here is what the log says:
 

Error using matlab.ui.control.UIControl/set
The UIContextMenu's parent figure is not the same as the parent figure of this object.

Error in ma_InsertNBodyCoastGUI>coastTypeCombo_Callback (line 688)

Error in ma_InsertNBodyCoastGUI>ma_InsertNBodyCoastGUI_OpeningFcn (line 79)

Error in gui_mainfcn (line 220)

Error in ma_InsertNBodyCoastGUI (line 40)

Error in ma_MainGUI>scriptListbox_Callback (line 294)

Error in gui_mainfcn (line 95)

Error in ma_MainGUI (line 42)

Error in matlab.graphics.internal.figfile.FigFile/read>@(hObject,eventdata)ma_MainGUI('scriptListbox_Callback',hObject,eventdata,guidata(hObject))

Error while evaluating UIControl Callback.
Link to comment
Share on other sites

On 1/9/2024 at 2:54 AM, 7e21 said:

As a side note, when I try to use nbody coast to UT in mission architect I can not open the edit window for that event again at all (like for the lunar transfer tutorial on the wiki). Here is what the log says:
 

Error using matlab.ui.control.UIControl/set
The UIContextMenu's parent figure is not the same as the parent figure of this object.

Error in ma_InsertNBodyCoastGUI>coastTypeCombo_Callback (line 688)

Error in ma_InsertNBodyCoastGUI>ma_InsertNBodyCoastGUI_OpeningFcn (line 79)

Error in gui_mainfcn (line 220)

Error in ma_InsertNBodyCoastGUI (line 40)

Error in ma_MainGUI>scriptListbox_Callback (line 294)

Error in gui_mainfcn (line 95)

Error in ma_MainGUI (line 42)

Error in matlab.graphics.internal.figfile.FigFile/read>@(hObject,eventdata)ma_MainGUI('scriptListbox_Callback',hObject,eventdata,guidata(hObject))

Error while evaluating UIControl Callback.

I actually couldn't reproduce this error.  Does it still happen for you?

Quote

t certainly helps and the advance to segment is a usefulthing I missed, but I'm still a little confused on how to deal with time disrepancies with how much things rely on the duration since the last state in LVD. Where there is a couple more things like coast to UT, revs before coasting to true anomaly etc in Mission Architect.

Propagating to certain "events", like true anomaly or whatnot, doesn't work as well in the integrator based system that LVD uses.  This is why everything is time based.  Set up constraints to the target you want at the end of an event and then optimize the propagation time of that event to meet those constraints.  This should work out pretty well most of the time.

Link to comment
Share on other sites

Just a heads up to everyone, the next pre-release will probably update MATLAB to R2023b (the latest version).  It'll also have an updated version of the NOMAD optimizer (v4.4) in LVD, along with some other changes.

Link to comment
Share on other sites

On 1/12/2024 at 4:10 PM, Arrowstar said:

I actually couldn't reproduce this error.  Does it still happen for you?

Yup. I've tried reinstalling too and very consistently get it 100% of the time. This is only with n-body coast + UT but it happens every time for me with that combo, but I'm mostly trying using LVD anyway. :)

Link to comment
Share on other sites

On 1/14/2024 at 4:52 AM, 7e21 said:

Yup. I've tried reinstalling too and very consistently get it 100% of the time. This is only with n-body coast + UT but it happens every time for me with that combo, but I'm mostly trying using LVD anyway. :)

Got it.  I found the issue and resolved it for the next release.

Link to comment
Share on other sites

Hi everyone,

I'm happy to announce that after a fairly lengthy hiatus, I've built KSPTOT v1.6.10 pre-release 6.  This new build moves KSPTOT to a new MATLAB version, MATLAB R2023b.  You will need to download and install the MATLAB Compiler Runtime version for R2023b to run this build.  Please do so before attempting to run KSPTOT v1.6.10 PR6.

Here's the change log:

  • New MATLAB Version: R2023b
  • LVD: Update NOMAD solver to v4.4 and removed v4.3.1.
  • LVD: Enabled DiscoMADS option for NOMAD solver.
  • MA/LVD: Updated the optimization variable plot mouseover label background color to be not transparent.
  • LVD: Run Case Matrix workers now record diary as they run to a "running" log file.
  • LVD: Updated tab order for initial state and set kinematic state UIs.
  • LVD: New example: lvdExample_MunarFreeReturn
  • MA/LVD: Many bug fixes.

Please let me know if you find any issues.  Thank you and happy orbiting!

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