Jump to content

Resonant Orbit Calculator [0.6.2]


schlosrat

Recommended Posts

Resonant Orbit Calculator

uojtZfN.png
Making resonant orbit planning easier for Kerbal Space Program 2 one mission at a time.

NOTICE!

This mod receives sporadic updates as I've incorporated all of its functionality into Flight Plan.

I'll keep testing it to make sure it works with future releases of the game, and you're welcome to keep using it as a stand-alone tool if that's what suits you best, but I recommend transitioning to Flight Plan as that's where new features and capabilities will appear.


Compatibility

  • Tested with Kerbal Space Program 2 v0.1.4 & SpaceWarp 1.4.2
  • Requires SpaceWarp 1.4.2+
  • Optional, but highly recommended: Flight Plan v0.8.12+. See capabilities below
  • Optional, but highly recommended: Maneuver Node Controller v1.0.3+. See the capabilities described below.
  • Optional, but highly recommended: K2-D2 v0.9.4+. See the capabilities described below.
  • Note: Both Flight Plan and Maneuver Node Controller require Node Manager 0.6.1+

Source Code

Latest Releasehttps://github.com/schlosrat/ResonantOrbitCalculator/releases/tag/0.6.2

Features

  • Display Carrier Vessel and Current Orbit Info
  • Assist In planning deployment missions for constellations of 2 or more satellites
  • Model Resonant Deployment Orbit Options (Diving vs. Non-Diving)
  • Display effects of the next planned Maneuver
  • OPTIONAL: If Flight Plan is installed, then Resonant Orbit Calculator will help you make the nodes needed to get into your selected Deploy Orbit!
  • OPTIONALIf Maneuver Node Controller is installed, then Resonant Orbit Calculator will present a button to launch MNC if you'd like to finetune the node it created
  • OPTIONALIf K2-D2 is installed, then Resonant Orbit Calculator will present a K2-D2 button that will cause K2-D2 to perform a precision node execution for you!

Video 

Installation

  1. Download and extract BepInEx mod loader with SpaceWarp 1.0.1 or later (see link above) into your game folder and run the game, then close it. If you've done this before, you can skip this step. If you've installed the game via Steam, then this is probably here: C:\Program Files (x86)\Steam\steamapps\common\Kerbal Space Program 2. If you complete this step correctly you'll have a BepInEx subfolder in that directory along with the following files (in addition to what was there before): changelog.txt, doorstop_config.ini, winhttp.dll
  2. Download and extract this mod into the game folder. From the resonant_orbit_calculator_vx.x.x.zip file copy the BepInEx folder on top of your game's install folder. If done correctly, you should have the following folder structure within your KSP2 game folder: ...\Kerbal Space Program 2\BepInEx\plugins\resonant_orbit_calculator.
  3. Optional: Download and install Flight Plan to assist with maneuver node creation! (see link above). From the flight_plan_vx.x.x.zip file copy the BepInEx folder on top of your game's install folder. If done correctly, you should have the following folder structure within your KSP2 game folder: ...\Kerbal Space Program 2\BepInEx\plugins\flight_plan.
  4. Optional: Download and install Maneuver Node Controller to assist you with finetuning your maneuver nodes! (see link above). From the maneuver_node_controller_vx.x.x.zip file copy the BepInEx folder on top of your game's install folder. If done correctly, you should have the following folder structure within your KSP2 game folder: ...\Kerbal Space Program 2\BepInEx\plugins\maneuver_node_controller
  5. NOTE! If installing Flight Plan of Maneuver Node Controller, then you must also install Node Manager 0.5.3 or later (see link above). From the NodeManager-x.x.x.zip file copy the BepInEx folder on top of your game's install folder. If done correctly, you should have the following folder structure within your KSP2 game folder: ...\Kerbal Space Program 2\BepInEx\plugins\node_manager.
  6. Optional: Download and install K2-D2, your friendly KSP Astromech ready to perform precision node execution for you! (see link above). From the K2D2_vx.x.x.zip file copy the BepInEx folder on top of your game's install folder. If done correctly, you should have the following folder structure within your KSP2 game folder: ...\Kerbal Space Program 2\BepInEx\plugins\K2D2.

License: MIT

Example Craft (shown below)

 

Would you like to know just what orbit to get your craft into so it's ready to deploy a constellation of satellites? Are you in a hurry and don't want to spend time performing tedious computations involving obscure and arcane orbital mechanics equations? Well, now you can! Look no further - Resonant Orbit Calculator is at hand and ready to help you sort out your next Comm Sat deployment mission in a snap!

With the Resonant Orbit Calculator (ROC) by your side, you'll quickly be able to see all the important details for the Current Orbit your Carrier Vessel is in, as well as able to plan your Deployment Orbit.

No matter if you're deploying 2 Payloads or 52, the ROC will get you all set up with everything you need to know. Just click the (-) and (+) buttons next to the number of satellites you're carrying and you'll be off to the races!

Would you like to only deploy a satellite once every 2nd or 3rd or 27th pass? We've got you covered there, too! Just click away with the (-) and (+) buttons to quickly set your Deploy Orbits from 1 each pass on up to whatever you need! The ROC will even tell you exactly what Orbital Resonance factor will be needed to execute your plan!

Have you got a specific Target Altitude you need your satellites in? There's a handy spot right there ready for you to enter any value you like, and you'll instantly be able to see the orbital period your deployed sats will have (assuming circular orbits).

What if you want to set your satellites up so they're in Synchronous or Semi-Synchronous orbits? That info is displayed for you (assuming such orbits are possible for the body you're in orbit about). You don't even need to transcribe this back into the Target Altitude field! Just click on the handy Set Target Altitude button right next to the displayed Synchronous or Semi Synchronous Alt field. Note: These buttons are only present if such orbits are possible...

If you're seeing the dreaded Outside SOI warning for either of these, then don't fret! The SOI Altitude is also displayed so you'll know what the max is!

But what if you don't care about the max and are more interested in the Minimum LOS Orbit Alt? We've got you covered there, too! (For constellation with 3 or more satellites only...). You'll find a handy Set Target Altitude button here too! You can even account for occlusion due to a planet's atmosphere (if it's got one). Toggle Occlusion on will allow you to set the Atm and Vac factors to apply, and will automatically apply the appropriate one for the body you're orbiting to set the Min LOS Orbit altitude accordingly.

What if you'd just like to target your Current Orbit's Apoapsis or Periapsis for deployment operations? There are handy Set Target Altitude buttons right beside your Apoapsis (used for diving resonant orbits) and Periapsis (for climbing resonant orbits).

When it comes time to set up your Deployment Orbit, you've got an option to either Dive under your target orbit or climb higher for your resonant deployment orbit. Either way works in general, but watch out for Lithobraking Periapsis when diving. Similarly, watch out for SOI escaping Apoapsis when climbing.

Your choice for Diving or Climbing doesn't just impact opportunities for lithobraking and SOI escape, you'll also be able to quickly see the required Injection ∆v your satellites will need to supply in order to circularize their orbits when you release them! This is not to be confused with whatever ∆v you may need to get your Carrier Vessel into the deployment orbit, but this does need to be accounted for so that you'll know your satellites are prepared to complete their own circularization when you deploy them.

What about getting your craft into the Deployment Orbit? Just add a maneuver node to your current orbit and you'll be able to see where it's taking you in the Maneuver section! You can quickly get set up with a new Apoapsis or Periapsis that works for your plan to either perform a diving or climbing resonance respectively. Once that's set, you'll be able to use the Maneuver section once again to help you plan the next maneuver node to complete things and put you in the resonant orbit of your dreams!


zdYNNVt.png

The development of this mod (by this author!) was greatly assisted by the kind help and excellent examples and templates set out by @munix (SpaceWarp Mode Template), Micrologist (MicroEngineer), @XYZ3211 (Maneuver Node Controller), and of course @meyerweb(Resonant Orbit Calculator Web version). I certainly didn't invent the math that goes into this, so I'll also credit my ancient copy of Fundamentals of Astrodynamics - a book I discovered back in my undergraduate life and which I will forever treasure! There's a second edition of that out now, but I prefer my dog-eared and heavily note-taken-in first edition...

Planned Improvements
To see what improvements and new features are planned for this mod, you can visit the Issues page on the project's GitHub.

Edited by schlosrat
Updated for v 0.6.2
Link to comment
Share on other sites

Updated to v 0.1.1

New features: Set Target Altitude buttons "" attached to the Synchronous Alt and Semi Synchronous Alt fields when those values are within the SOI Alt and thus possible options. This works just like the Set Target Altitude buttons already present for the Current Orbit's Apoapsis and Periapsis fields. If you click any of these the Target Altitude for your deployed satellites will be set to that value.

In the example images shown above in the main post the craft is in orbit around Moho, and so synchronous and even semi synchronous orbits are impossible, however for most bodies at the least a semi synchronous orbit (period = 1/2 the rotation of the body) are possible. Shown below is a CommSat deployer craft in LKO getting ready to move to a deployment orbit. For Kerbin, both synchronous and semi synchronous orbits are possible, so both values are displayed and the new 0.1.1 Set Target Altitude buttons for each are visible.

OZrJy5J.png

 

 

 

Edited by schlosrat
Link to comment
Share on other sites

Update to v 0.1.2

hY8y7kW.png

New Features:

  • Updated Min Orbit LOS Alt field name to include "Alt" in the name so that it's clearer that it's a suitable value for Target Altitude. 
  • Added Set Target Altitude button to the Minimum LOS Orbit Alt
Link to comment
Share on other sites

15 minutes ago, kennyc222 said:

link is dead..i can't reach your mod!

@schlosrat I see the same broken link to the github repository for the source code, referenced in the OP above. 

@kennyc222 if you looking to just download the mod to install, the SpaceDock page is still active here - https://spacedock.info/mod/3332/Resonant Orbit Calculator

Link to comment
Share on other sites

@schlosrat For some reason I can not get this mod to load. I've download v0.1.2, extracted and place the folder into the KSP2 game's /BepInEx/plugins folder. Started the game, it does not show up in the Main Menu Mod manager list. I am on KSP2 0.1.1.0.21572 - Windows 11. Am I missing a step during the install? I do the same install process for other mods, and I have no issues. Thanks for the help in advance.

PA9gPg5.jpg

Mjq6kXB.jpg

Link to comment
Share on other sites

I see what the problem is. You're running SpaceWarp 0.4.0, but the mod is telling SpaceWarp it's only compatible with 1.0.1 - which I believe it the latest release. Chances are it will run fine with 0.4.0, and you're welcome to try.

If you look inside the mod folder you'll find just a few files. The swinfo.json file is the one that tells SpaceWarp about the mod, including all the info that it would display in your second pic.

Try editing the swinfo.json dependencies section to set the min to 0.4.0 and see what happens. Alternatively update your SpaceWarp to this: https://spacedock.info/mod/3277/Space Warp + BepInEx

{
  "mod_id": "resonant_orbit_calculator",
  "author": "schlosrat",
  "name": "Resonant Orbit Calculator",
  "description": "Calculate resonant orbits for the selected vessel and assit with setting up maneuver nodes to enter the resonant orbit",
  "source": "https://github.com/schlosrat/ResonantOrbitCalculator",
  "version": "0.1.2",
  "version_check": "",
  // "version_check": "https://raw.githubusercontent.com/schlosrat/ResonantOrbitCalculator/master/resonant_orbit_calculator/swinfo.json",
  "dependencies": [
    {
      "id": "SpaceWarp",
      "version": {
        "min": "1.0.1",
        "max": "*"
      }
    }
  ],
  "ksp2_version": {
    "min": "0.1.1",
    "max": "*"
  }
}

Looks like I either need to update the SpaceDock page to correctly inform folks of this dependency up front or roll back to SpaceWarp 0.4.0 and test with that... I'm thinking it will be easier for me to update the SpaceDock page. ;-)

UPDATE: SpaceDock page revised to indicate the mod is tested with SpaceWarp 1.0.1, and compatibility with 0.4.0 is not assured. I've also updated the swinfo.json file in the github repo to set the min to 0.4.0 (which likely will work - though I've not definitively tested that configuration). This will roll out in the next release, probably this weekend. I'm looking to add a capability to assist with creating maneuver nodes to get you from your current orbit to the planned transfer.

If you do opt to modify the swinfo.json file and give it a go with SW 0.4.0, please let me know. I'll be listening for a LEEEROYYY JENKINS! to know when you've tested it. ;-)

Edited by schlosrat
Link to comment
Share on other sites

3 hours ago, schlosrat said:

give it a go with SW 0.4.0, please let me know

@schlosrat - LEEEEROYYY JEennnkins!. I edited the swinfo.json to "0.4.0" and restarted KSP2. The Mod still did not show up in the Mod Manager. So it does not look like its compatible with 0.4.0. I updated SpaceWarp to 1.0.1 and now working fine.

Thanks

Edited by LeroyJenkins
Link to comment
Share on other sites

  • 3 weeks later...
  • 3 weeks later...

Update for Version 0.6.0

New GUI Skin to match Flight Plan, Maneuver Node Controller, and K2-D2

Now compatible with all three of the above mods, which are optional for this one. If you don't have them, this mod still works, but if you do have them that will unlock additional new capabilities for you!

  • OPTIONAL: If Flight Plan is installed, then Resonant Orbit Calculator will help you make the nodes needed to get into your selected Deploy Orbit!
  • OPTIONAL: If Maneuver Node Controller is installed, then Resonant Orbit Calculator will present a button to launch MNC if you'd like to finetune the node its created! This isn't typically necessary, but it's kinda nice to have around all the same.
  • OPTIONAL: If K2-D2 is installed, then Resonant Orbit Calculator will present a K2-D2 button that will cause K2-D2 to perform a precision node execution for you!

Latest Version: https://github.com/schlosrat/ResonantOrbitCalculator/releases/download/0.6.0/resonant_orbit_calculator_v0.6.0.zip

Link to comment
Share on other sites

  • 2 weeks later...

I've rolled this capability into Flight Plan, so probably will not be updating this mod much going forward. If you find a bug or issue, and prefer to use this over the Flight Plan Resonant orbit Maneuvers capability, I'll be happy to post and update to fix it, but otherwise I recommend you transition to using Flight Plan.

Link to comment
Share on other sites

  • 1 month later...

Tested ROC with KSP2 0.1.3, SpaceWarp 1.3.0. Appears to still work fine. Let me know if you run into any issues, but I still recommend transitioning to using Flight Plan. FYI, I'm working on an update to Flight Plan which will switch it over to using a UITK-based GUII (instead of IMGUI) as this is more performant and all around the way to go. If there's further demand for updates to ROC as a stand-alone mod I'll most likely transition it to UITK as well for the same reasons.

Link to comment
Share on other sites

  • 2 months later...

Updated for v 0.6.2

  • Updated for compatibility with KSP2 0.1.4
  • Honestly, why are you still using this mod?
  • You do realize that Flight Plan has fully absorbed all the Resonant Orbit Calculator functionality?
  • Please! I'm begging you! Don't download this, just use Flight Plan instead! It's much better and does so much more!
Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

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