Jump to content

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


Arrowstar
 Share

Recommended Posts

On 9/3/2021 at 9:20 PM, Arrowstar said:

First, would anyone actually use something like this when they play KSP? 

*jumps up and down waving arms* ME! OOH! OOH! MEMEMEME!

On 9/3/2021 at 9:20 PM, Arrowstar said:

Be realistic, as this could potentially be a lot of effort. 

But it wouldn't be for a while. KSA will resume ops in 2022 but it's still a ways from launching scanning satellites tho that is a priority. I'd use it right away for cameras tho

Still, there's always people asking about good scanning orbits in the DMagic SCANSat thread and no one has really produced a tool dedicated to helping people with this. Best that's ever been done is a table of good orbits per instrument but that's been outdated for a while with more recent changes to how the SCAN instruments work

On 9/3/2021 at 9:20 PM, Arrowstar said:

there any other uses you can come up with that you might want to be able to do with this sort of functionality?

Not yet...

Link to comment
Share on other sites

23 hours ago, Drew Kerman said:

*jumps up and down waving arms* ME! OOH! OOH! MEMEMEME!

Well obviously if you would like it, @Drew Kerman, then I think I have to implement it. ;)

Quote

But it wouldn't be for a while. KSA will resume ops in 2022 but it's still a ways from launching scanning satellites tho that is a priority. I'd use it right away for cameras tho

Still, there's always people asking about good scanning orbits in the DMagic SCANSat thread and no one has really produced a tool dedicated to helping people with this. Best that's ever been done is a table of good orbits per instrument but that's been outdated for a while with more recent changes to how the SCAN instruments work

These are some good ideas.  I'll have to post a demo video in the SCANSat thread once I've got everything to my liking.  Thanks!

Speaking of demo videos, I've got an initial implementation into LVD!  It's actually pretty slick to play around with.  I'm going to have fun with this. ;)  Check it out.

kwrccVl.gif

 

 

Edited by Arrowstar
Link to comment
Share on other sites

13 hours ago, Razgriz1 said:

How do you do things like this so quickly?? Teach me your ways!

In this case, I had most of the math worked out before I asked people if they would be interested.  Acutally getting it into LVD then was just a matter of writing the classes that do what you see based on the original development script.  All the hard work was done before I asked lol. ;)

Link to comment
Share on other sites

Alright, here's a fun image for you all to look at.  As it turns out, the sensor obscuration system works with celestial bodies other than the central body of the current orbit.  In this case, I have a sensor on the surface of Kerbin (at KSC, of course) and I have a grid of sensor target points all over the surface of Minmus.  Here's what the display currently looks like.

vCVKYKn.png

See those big black cones in the middle of the big green sphere?  Those are sensor shadows being created by the Mun (the big one, left) and Minmus (small one, right).

Here's what the grid of points on the surface of Minmus looks like.

GOTrIvG.png

Anyway, I'm working on a tool that will do the analysis of sensor data and provide XLS files out for the user.  It turns out that in this particular scenario, we can actually get out what kind of coverage of Minmus KSC gets.

grz7ikV.png

The first ~4000 seconds of this plot represent time that KSC cannot see Minmus at all.  The blue line you see represents the  approximate instantaneous amount of the surface of Minmus visible from KSC, and the orange line is the total amount of the surface cumulatively seen by the sensor.  Keep in mind that "the surface" here is represented by points that are 0.01 km off the surface of Minmus, and so we're not looking at the surface as a continuous thing, but rather sampling points near it for this analysis.

I'll have more to show next week, but I hope this gets people excited about what's possible here. :) Let me know if you have any questions!

Link to comment
Share on other sites

This afternoon I've built KSPTOT v1.6.9 pre-release 2!  This pre-release introduces the new Sensor system into KSPTOT's Launch Vehicle Designer (LVD) tool.  Here's the change log:

  • LVD: New Sensor system
    • Model sensors attached to vehicles, ground stations, and other points.
    • Detect sensor targets, defined as points or sets of points.
    • Plot sensor data and output to XLS files.
    • New actions to update sensor properties.
  • LVD: The yellow "working" labels are now gone and have been replaced with a more modern looking notification area at the bottom of the UI, complete with spinning "busy" widget. ;)
  • LVD: View Settings UI is now properly resizable.

Let's talk through how the new sensor system works in practice.  In order to use the sensor system, you need to model at least one sensor and at least one sensor target.  Both of these options are found under the new Scenario -> Sensors menu.

When you select Edit Sensors from this menu, you'll see the usual add/remove/edit component dialog box that's used all over LVD.  Go ahead and add a new sensor.  You'll be prompted to select the sensor type (there is only one type at this time).  When you select Conical Sensor, you'll be greeted with this UI.

G8e10s7.png

From here, you can adjust the size and range of the sensor, as well as whether or not the sensor is active at the initial state.  You can also adjust the sensor's origin, which is always a Geometric Point.  The scenario must have at least one geometric point to be able to use sensors.  You can also adjust the sensor's pointing model, which describes which direction the sensor points.  At this time you can either fix the sensor in the vehicle's attitude body frame or you can fix it in a Geometric Coordinate System.  You need at least one geometric geometric coordinate system to use this last function.

Next up we need to add a target.  You add targets using the Edit Targets menu item in the same Sensors menu as before.  There are three different kinds of targets available:

  • Point targets
    • These use one Geometric Point, turning that point into a single target the sensor can detect.
  • Rectangular lat/long grid targets
    • These are a rectangular grid of latitude/longitude target points at a certain altitude above a celestial body. 
  • Circular lat/long grid targets
    • These are similar to the rectangular grid targets, but the grid is a circle, centered at a lat/long point with a certain radius, at a certain altitude above a celestial body.

If you select the circular lat/long grid target option, you'll be greeted with the following UI.

X3MmpDs.png

Options are generally self-explanatory here: select the celestial body, select the circle grid parameters, etc.  You can draw a circle on the 2D map if you want to generate your parameters visually.  Note that some points are displayed as if "found" and others as if "not found" so you can get a sense for what they look like.

Finally, once you have a sensor and a sensor target, you can generate a sensor report from the Sensor Reports menu item. 

bc28LvH.png

Select the sensor and the target you just created, select where you want the output files to be written to, and tap "Generate Report".  This process can take some time as the sensor geometry and target locations are computed at every time step in the simulation.  Once done, the Data Viewer tab will be populated and XLS files containing that same data will be generated.  You are free to work with the data as you need to at this point.

And that's all there is to it!  As you're using this new system, please keep me in the loop if you have any features you'd like to see or bugs you find that need fixing.  Thank you!

Link to comment
Share on other sites

Hey everyone, I've found a bit of a flaw with the system that computes the shadowed sensor volumes for the conical sensors.  I have corrected it, but unfortunately it means that conical sensors are limited to 90 degrees max half angle now.  I'll explain more when I have a bit more time, but long story short, please download the PR2 release again to get the fix.  Thanks!

Link to comment
Share on other sites

48 minutes ago, MashAndBangers said:

So I had a chance to play around with KSPTOT last night, and I was able to calculate an Eve flyby in the special flyby module, but how do I go from KSPTOT to maneuver nodes in KSP?

You have a couple options.  The "easy" way is to just use the departure and arrival dates in MFMS and plan the maneuver nodes yourself, knowing that you want to leave and arrive on certain days.  This takes a lot of hand tuning but is procedurally straight forward.  The "medium skill" method is to right click on the DV Maneuver Info text box to upload your departure maneuver node to KSP.  You'll have to do the rest of the maneuver nodes yourself, but it'll work.  The "hard" way is to use the information from MFMS as a seed for Launch Vehicle Designer and, using LVD, put together a high fidelity simulation akin to the "lvdExample_ToEelooViaJool_BackPropExample.mat" example LVD mission that I provide with KSPTOT.

If you're new to the idea of mission planning, try the first way for now and just try to get the departure and arrival times in KSP to be close by hand adjusting your maneuver nodes.  You're also looking to make sure that your post-flyby orbit around the Sun looks generally pretty close to what is shown in MFMS.

Once you've tried that, let me know if you want help with any of the other more challenging methods and I'll answer whatever questions you might have.  Hope that helps! :)

Link to comment
Share on other sites

@Arrowstar  Is it possible to export a KoS .csv from your "lvdExample_L2HaloOrbit"?  In LVD, when I select Simulation --> Create KoS Control CSV file & try exporting various parts (or all) I just get stuck at the "parsing state log data..." with no .csv generated (even with "Edit Event" closed...I just had that open in the screenshot as an example of looking at the details of a specific event).  (I am currently still using the release 1.6.8 since I still have so much to learn...)  (I was thinking I might try to visualize the example in KSP from the 700km sma LKO in a manner similar to your video.) Thanks!

YKZuw1n.png

 

Edited by AloE
Link to comment
Share on other sites

6 hours ago, AloE said:

@Arrowstar  Is it possible to export a KoS .csv from your "lvdExample_L2HaloOrbit"?  In LVD, when I select Simulation --> Create KoS Control CSV file & try exporting various parts (or all) I just get stuck at the "parsing state log data..." with no .csv generated (even with "Edit Event" closed...I just had that open in the screenshot as an example of looking at the details of a specific event).  (I am currently still using the release 1.6.8 since I still have so much to learn...)  (I was thinking I might try to visualize the example in KSP from the 700km sma LKO in a manner similar to your video.) Thanks!

YKZuw1n.png

 

You found a bug!  I've fixed it this morning in the v1.6.9 pre-release 2.  Please download that and give it a try.  It should hopefully do what you want.   Thanks for the report!

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