Jump to content

Flight Plan [0.10.7 for KSP2 v0.2.2+]


schlosrat

Recommended Posts

On 5/1/2023 at 5:58 PM, EvelynThe Dragon said:

It's working much better now. And it's starting to get closer to MechJeb functionality for some stuff, and that is nice. Thanks for taking this project on.

Suggestions...

For Hohmann transfer, can you add the ability to set a desired Periapsis? Sometimes it gives a solution that completely misses, or it gives an impact trajectory.
Same for course correction.
Adjusting Periapsis and Apoapsis, you can't adjust Periapsis at Periapsis... Same for Apoapsis at Apoapsis, so those choices should not be available.
New LAN doesn't seem to be working for me.
Set semimajor axis would be nice.
 

Thanks for the feedback!

You're right that Hohmann Transfers need a bit of work. I've been wresting with that for weeks now and still have not gotten it sorted out. Most of that code is straight out of MJ, which is known to work really well. It may be a findamental difference between KSP1 and KSP 2 in how they handle patched conics and orbit predictions as that part of the code is using some built-in KSP2 capabilities to predict the effect of various burns, and sending those results through numeric optimizers (BrentRoot primarily, but also the Gooding solver). The optimization part is pure math, and so if the KSP2 prediction for what you'll get it good, then the solver should be able to find the optimal solution. It's really weird.

The Set LAN is definitely experimental and not producing reliably good results. It's a new addition to the set and so has seen very little testing. The Moon Return option does let you set a desired Pe (I believe it's using the Set Pe value), but it often misses and gives an impact or other poor results. Usually it's just a handful of m/s off from what it needs, and the desired value does go in, it just doesn't have the desired effect.

I plan to add a Set SMA as well, and I just finished work on doing Resonant Orbits (though that shows up in the Resonant Orbit Calculator mod - while can now call FP and K2-D2)

 

Link to comment
Share on other sites

2 hours ago, schlosrat said:

Thanks for the feedback!

Oh, for sure. I am happy to provide it. I am also willing to be a guinea pig for testing new versions if you need one. I'm not one to actually do the mod code myself, I am an OLD C and FORTRAN programmer. This new stuff I haven't really bothered with since I no longer do code for a living. I'm more at the hardware architecture and systems engineering (requirements definition) level in the real world now.

Link to comment
Share on other sites

3 hours ago, EvelynThe Dragon said:

Oh, for sure. I am happy to provide it. I am also willing to be a guinea pig for testing new versions if you need one. I'm not one to actually do the mod code myself, I am an OLD C and FORTRAN programmer. This new stuff I haven't really bothered with since I no longer do code for a living. I'm more at the hardware architecture and systems engineering (requirements definition) level in the real world now.

LOL! I started coding in BASIC in the late '70's and picked up FORTRAN and C in the '80's! Sounds like we're both old programmers turned systems engineers now. Funny!

 

Update to Flight Plan 0.8.1

  • Added SetNewSMA (not experimental).
  • Added internal support for SetNodeLongitude (not working yet - not displayed on GUI)
  • Fixed bug where SetNewLAN did not work at all. This is still an experimental feature, but should at least generate a node.
  • Fixed Circularization, SetNewPe, SetNewAp, Ellipticize, SetInclination, and SetNewLAN to all include the selected burn time option in the status.
  • Fixed status reporting to not wrap on the label.
  • Fixed SetNewLAN to include the target LAN in the debugging log.

https://github.com/schlosrat/FlightPlan/releases/download/0.8.1/flight_plan_v0.8.1.zip

Link to comment
Share on other sites

Update to Flight Plan 0.8.2

  • Overhauled GUI for a tab-based layout to facilitate growth in capabilities. Tabs available include the following.
  • Ownship Maneuvers Tab: Always available. Includes maneuvers that are relative to the orbit you're in
  • Target Relative Maneuvers Tab: Available when your selected target is in orbit about the same body you are
  • Moon Relative Maneuvers Tab: Available when you're in orbit about a moon
  • Planetary Transfer Tab: Available when you're in orbit about a planet and you have another planet as the selected target
  • Resonant Orbit Maneuvers Tab: Always available. Includes maneuvers and information useful for planning and getting into a resonant orbit suitable for deploying a constellation of satellites.

Each tab has a unique and distinctive icon making finding the tab you need easier. All tabs include the basic Flight Plan functionality for making a node. If you've got Maneuver Node Controller installed, then you'll have an MNC icon available to make finetuning your nodes easier. If you've got K2-D2 installed, you'll be able to have it perform precision node execution for your flight plan.

https://github.com/schlosrat/FlightPlan/releases/download/0.8.2/flight_plan_v0.8.2.zip

0Y0uS3Y.png

Link to comment
Share on other sites

Updated to Flight Plan 0.8.3

  • Fixed issue where the Planetary Transfer tab was not displayed when a viable planet was selected. Now that tab will always be available if a viable planet is selected and the active vessel is in orbit around another planet. If the Experimental Features are turned off, then the tab displays a warning about that condition with instructions for how to turn those features on, otherwise, it shows the available experimental maneuver.
  • Updated Target Relative Maneuver icons (plural now!) so that they update based on if your selected target is a vessel or a celestial object.
  • Updated Target Relative Maneuver Tab to show celestial target relevant maneuvers when a celestial body is selected, and vessel relative maneuvers when a vessel is selected.
  • Widened the GUI window to properly accommodate up to four tab icons without clipping.

https://github.com/schlosrat/FlightPlan/releases/download/untagged-03dc5e4bafe6d5c467e2/flight_plan_v0.8.3.zip

Link to comment
Share on other sites

I have looked at the documentation but unable to see how to make it all work. I can set Kerbin for Planet. I can set 120KM for PE/AP but have not figured out how to make it launch the mission. If I launch manually, there is not staging and neither does the craft go into a controlled ascent to the AP point. Then burn to achieve the PE point.

Link to comment
Share on other sites

2 hours ago, Jhaxxar said:

I have looked at the documentation but unable to see how to make it all work. I can set Kerbin for Planet. I can set 120KM for PE/AP but have not figured out how to make it launch the mission. If I launch manually, there is not staging and neither does the craft go into a controlled ascent to the AP point. Then burn to achieve the PE point.

Are you looking to use a mod to help with launch of a rocket from Kerbin? If so, then you should know that launch is not a Flight Plan capability. For launch (and landing) I recommend either K2-D2 or KontrolSystem2. Both have capabilities that can aid with launch and landing and both can integrate with Flight Plan for other things.

Where Flight Plan can help you is once you're in orbit and want to get around up there. The UI has tabs that organize the capabilities based on your current situation and whether you've got the Experimental Features turned on. Each tab has an icon, and only the tabs that make sense for your current situation are available at any time. The graphic in my earlier post should give a good idea for what the tabs have to offer.

As to how to use them, the work flow is like this.

Select a maneuver you'd like to do, like New Pe for example. The maneuver buttons are toggle buttons, so when you press them they stay pressed until you either press that one again or press some other one - there can only be one maneuver selected at a time. Some maneuver options like New Pe will also have a text entry field beside them where you can enter the value you want. The Pe and Ap values are all specified as altitude above ground level, just like the game would display them to you. For any entry that wants an angle (e.g. New Inclination) that entry will be in degrees.

With a maneuver selected that will give you a list of Burn Time Options that make sense for that maneuver in your current situation.

With some maneuver types and Burn Time Options there may be an additional input field that will appear below the maneuver buttons and above the line separating those from the icon buttons at the bottom. Those are for Burn Time Options like "after a fixed time" or "at an altitude". Those are only displayed when needed.

Once the maneuver type has been selected, the burn time option is set, and you're satisficed with the values in the other input fields then you're ready to click the Make Node button. This one is not a toggle button, you just press it and you should get a maneuver node.

To the right of the Make Node button there may be a Maneuver Node Controller icon. That will only be there if you also have MNC installed, but if it is there then you can press it to see all the node details and edit your node if you like.

To the far right on the bottom there may be a K2-D2 icon. Like the MNC button, this one is only present if you've got K2-D2 installed, but it also will only be there if you've got a maneuver node. If you press this button, then K2-D2 will take over and fly the node for you.


 

Update to Flight Plan 0.8.4

  • Fixed bug affecting burn timing of Hohmann and planetary transfers. Now transfers for which the ideal burn time is more than one orbit in the future will be timed better. This makes a small difference in transfers to nearby objects but can make a huge difference in the initial quality of planetary transfers. Planetary transfers are still considered an experimental feature in that they will generally require a small amount of fine-tuning after creating the node but will now start much closer to what they ought to be.
  • Folded-in capability in the Orbital Transfer Maneuvers tab to show the following information regardless of the Experimental Features setting
  • Phase Angle to Target
  • Transfer Window Phase Angle (should be approximately equal to the Phase Angle to Target for a good transfer window)
  • Transfer Time (estimated one-way trip time)
  • Synodic Period
  • Time to Next Window
  • Approximate Eject Delta-V

https://github.com/schlosrat/FlightPlan/releases/download/0.8.4/flight_plan_v0.8.4.zip

Here is a sample of the new Orbital Transfer Maneuvers tab with Experimental Features disabled.
z2spAl4.png

And here's what it may look like for you with those features enabled

VRR7uYL.png

Link to comment
Share on other sites

Still having issues where if selecting a specific part on another vessel (such as a docking port for docking) ALL tabs vanish.  Even after docking/undocking, it does not restore the functionality - although selecting another "valid" target does bring them back.  Any way that it can treat individual parts-as-targets as being the same as targeting the vessel itself?

Link to comment
Share on other sites

4 hours ago, RaccoonTOF said:

Still having issues where if selecting a specific part on another vessel (such as a docking port for docking) ALL tabs vanish.  Even after docking/undocking, it does not restore the functionality - although selecting another "valid" target does bring them back.  Any way that it can treat individual parts-as-targets as being the same as targeting the vessel itself?

Interesting case. I've not tested for that previously but I will. When you say all tabs vanish, this includes the Ownship Maneuvers and Resonant Orbit Maneuvers tabs? That's surprising as the logic for both is to always be available regardless of the target or any other condition. They literally have this in their code to control availability
 

 public override bool IsActive => true;

There are no conditions when these tabs should not be present, unlike the others which do consider what the selected target is.

Link to comment
Share on other sites

 

2 hours ago, schlosrat said:
6 hours ago, RaccoonTOF said:

Still having issues where if selecting a specific part on another vessel (such as a docking port for docking) ALL tabs vanish.  Even after docking/undocking, it does not restore the functionality - although selecting another "valid" target does bring them back.  Any way that it can treat individual parts-as-targets as being the same as targeting the vessel itself?

Interesting case. I've not tested for that previously but I will. When you say all tabs vanish, this includes the Ownship Maneuvers and Resonant Orbit Maneuvers tabs? That's surprisin

@RaccoonTOF, I was unable to duplicate this effect in the latest version - though that doesn't mean there isn't an issue here and we don't need an improvement. What I found was that if I selected a docking port on a target I would loose the Target Relative Maneuvers for Ship to Ship, but not the others. Here's what I'm seeing with a docking port selected while the active vessel is in orbit of the Mun.

UU5ZXmD.png

That said, I'll take a look to see about recognizing targeted parts the same as vessels since only vessels have parts.

UPDATE! I have found the issue. Not sure why it didn't trigger when I first tested, but I'm now able to reliably reproduce it and hope to have a fix out for you soon.

Edited by schlosrat
Corrected information
Link to comment
Share on other sites

@schlosrat Love this mod! Thanks very much. The regular (daily in effect :o) updates are very impressive too. 

The optional mods icons don't seem to be appearing as advertised even though I have  both K2-D2 vand Maneuver Node Controller installed and working. I am running  Flight Plan v0.8.4 with experimental mode activated currently. When the weekend comes around I will update Flight Plan and double check the other mods' versions and generally make sure I am not doing something wrong. Hopefully it will resolve. I am running KSP2 via Proton under Linux, maybe there is a need to add support for some native Windows library.

Link to comment
Share on other sites

@Kaa253 There was a bug in 0.8.4 that prevented K2-D2 from showing up if MNC was not 0.8.3+. That got fixed in 0.8.5, and 0.8.6 is current. I expect to have 0.8.7 out soon with Rendezvous capabilities. I don’t know of a reason that it wouldn’t work in your setup as long as the game itself works, but of course I’ve not tested it in that environment. Please let me know how it goes for you!

Note, the latest MNC you can get on SpaceDock is 0.8.1, but FP needs 0.8.3. We’re waiting of @XYZ3211to roll in some updates to the master and release it. If you would like a pre-release of MNC 0.9.2 you can get that from my GitHub repo.

https://github.com/schlosrat/ManeuverNodeController/releases/download/0.9.2/maneuver_node_controller_v0.9.2.zip

Edited by schlosrat
Link to comment
Share on other sites

Updated to Flight Plan 0.8.7

  • Updated the Target Selection system to now support selecting celestial bodies, vessels, and docking ports with the same easy interface. Now instead of an inactive text label to the left of the selection GUI, there's a toggle button.
  • When not pressed it says "Select Celestial" and the GUI to the right of it will present the same easy-to-use indented celestial body selection GUI.
  • When the toggle button is pressed it now says "Select Vessel" and the GUI to the right of it will present the user with a list of vessels (excluding the active one and all debris) the pick from.
  • If a vessel is selected and you're on the Target Relative Maneuvers tab, and you're within 3km of the selected vessel, then there will be a Select Docking Port toggle on the tab right below the tab title and above the Burn Options selection GUI. Activating the Select Docking Port toggle button will convert the "Select Vessel" option on the Target Selection GUI into a "Select Port", allowing the user to pick from a list of all docking ports on the targeted vessel.
  • Updated Target Relative Maneuvers tab for when the selected target is a vessel. This tab now has many new features and capabilities relating to setting up and executing a rendezvous with another vessel orbiting the same body. Below the Burn Time Option selection GUI the following new information is displayed
  • Target Orbit: (periapsis x apoapsis)
  • Current Orbit: (periapsis x apoapsis)
  • Relative Inclination: (degrees)
  • Synodic Period: (y d HH:mm:ss)
  • Next Window: (y d HH:mm:ss)
  • Next Closest Approach: (y d HH:mm:ss)
  • Separation at CA: (km, or m if close)
  • Relative Velocity (m/s, if within 3 km of the target)
  • In addition to the previous maneuvers that were present on this tap, New Ap has been added to assist with raising orbits for better phasing, and Match Velocity is no longer an experimental feature as it's working quite well now.
  • The maneuver buttons have been reordered for a more logical flow useful in rendezvous operations.
  • The recommended next action necessary for a rendezvous with the target is now displayed below the maneuver buttons. If you follow this guide you should be able to get within a few meters of your target, at which point docking will be possible

https://github.com/schlosrat/FlightPlan/releases/download/0.8.7/flight_plan_v0.8.7.zip

5rw7vMo.png

Link to comment
Share on other sites

20 hours ago, stephensmat said:

That did it. That actually did it.

That update has actually made it possible for me to target another craft for docking purposes. I haven't been able to do that in KSP2, and with this new update, I docked my Duna Lander with a larger ship for the first time. This has fixed the gamebreaker for me.

 

Many, MANY thanks.

Yeah, targeting the docking ports is a pain for sure. I'm glad that feature is helping you get more out of the game!

Link to comment
Share on other sites

Thank you for the reply.  This now makes a lot more sense. I can use Krontrol2 to get into orbit and then use Flight Plan to get me to my Station. So once I am near my station, I can select a docking port and Flight Plan will help me get into position to dock and/or dock my craft. Still a little hazy on this part.

Link to comment
Share on other sites

1 hour ago, Jhaxxar said:

Thank you for the reply.  This now makes a lot more sense. I can use Krontrol2 to get into orbit and then use Flight Plan to get me to my Station. So once I am near my station, I can select a docking port and Flight Plan will help me get into position to dock and/or dock my craft. Still a little hazy on this part.

You can use either KontrolSystem2 or K2-D2 to get into orbit. I've used both and last I checked they both work for that. Sounds like you're already comfortable with a solution for that.

You can definitely use Flight Plan to get you to within a few meters of your station. You can either generate the nodes you need in FP and execute them yourself, or you can have K2-D2 execute them for you. The key here is to select your rendezvous target (your station or anything else you want to get to), then go to the Target Relative Maneuvers tab for Ship to Ship maneuvers. It's the one with the icon showing two capsules. Once you're on that tab FP will give you tips on what maneuver you should set up next. These show up as text near the bottom of the GUI.

Once you're within 3 km of your target, FP will give you an option of picking a docking port to target instead of targeting the whole vessel. So, you can definitely use Flight Plan to select a docking port on a target vessel. If your station has docking ports then that should work fine. I generally don't switch to targeting a docking port until I'm ready to dock, but that's up to you.

There isn't a docking capability per se in Flight Plan at this time, but I've found that docking is pretty easy in most cases if you're able to do what I call cooperative docking. In this example Vessel A is the one doing most of the maneuvering. It's the one you want to dock with Vessel B (in your case your station)

  1. Vessel A: Use the tools available on the Target Relative Maneuvers tab to get close to Vessel B. The closer you get, the easier it will be. Vessel A's target is Vessel B.
  2. Vessel A: Match velocity so that Vessel A isn't drifting closer or further away from Vessel B
  3. Vessel A: Target the docking port you want to dock with.
  4. Vessel A: Use  SAS to point at your target (Vessel B's docking port). DO NOT USE RCS to point to the target, that will move you around and mess things up.
  5. Switch to Vessel B (the one who's docking port you previously targeted in step 3)
  6. Vessel B: Using the parts manager pick the docking port targeted in step 3 and select "Control from here"
  7. Vessel B: Select Vessel A as the target
  8. Vessel B: Select Vessel A's docking port as the target
  9. Vessel B: Use SAS to point at the target (Vessel A's docking port). Wait until both vessels docking ports are pointing at each other and things seem stable.
  10. Switch  back to Vessel A
  11. Switch SAS to Hold mode (the padlock icon). This keeps you pointed reasonably well and will prevent RCS from going nuts and moving you out of alignment in step 12.
  12. Turn RCS on
  13. Use RCS thrusters (H key) to move in and dock. Keep an eye on the relative velocity and try to keep it under 1 m/s as you get close.

I call this "Cooperative Docking" as both ships are trying to point their docking port at the other docking port, so all you need to do is maneuver along one axis. This method works 

I plan to work with @cfloutierto get some automated rendezvous and docking capabilities implemented, but those are autopilot things so they'll happen when they do in K2-D2. When those get developed I'll add buttons to FP to let you call them from there if you like.

Link to comment
Share on other sites

I have Flight Plan V0.87,  K2-D2V0.90,  Node Manager V0.5.3, Maneuver Node Controller V0.8.1 installed.  when i fire up Flight Plan, I do not see the same screen that I see here.  There is only one button at the bottom of the screen, "Make Node".  The other two buttons do not show.  Make Node just blinks when pressed. If I click on "Match Velocities" it switches to a blank screen which I can not recover from except to kill KSP2 and start over.  I have a screen print but don't know how to load it here.

Link to comment
Share on other sites

11 hours ago, Jhaxxar said:

I have Flight Plan V0.87,  K2-D2V0.90,  Node Manager V0.5.3, Maneuver Node Controller V0.8.1 installed.  when i fire up Flight Plan, I do not see the same screen that I see here.  There is only one button at the bottom of the screen, "Make Node".  The other two buttons do not show.  Make Node just blinks when pressed. If I click on "Match Velocities" it switches to a blank screen which I can not recover from except to kill KSP2 and start over.  I have a screen print but don't know how to load it here.

You have to upload images to an external website like https://imgur.com and then link them here 

Link to comment
Share on other sites

22 hours ago, Jhaxxar said:

I have Flight Plan V0.87,  K2-D2V0.90,  Node Manager V0.5.3, Maneuver Node Controller V0.8.1 installed.  when i fire up Flight Plan, I do not see the same screen that I see here.  There is only one button at the bottom of the screen, "Make Node".  The other two buttons do not show.  Make Node just blinks when pressed. If I click on "Match Velocities" it switches to a blank screen which I can not recover from except to kill KSP2 and start over.  I have a screen print but don't know how to load it here.

The reason you only see the Make Node button is that you've got MNC 0.8.1 and you need MNC 0.8.3+

If you scroll up, you'll see that I posted a reply to another user answering this question. Flight Plan needs MNC 0.8.3 or later. I've been working with @XYZ3211to get the official MNC release updated but I believe he's swamped with other things and hasn't had the time to update it yet. No matter, you can get the latest version from my GitHub repo linked in numerous places, including in the quote from my post below.

On 5/10/2023 at 11:44 PM, schlosrat said:

@Kaa253 There was a bug in 0.8.4 that prevented K2-D2 from showing up if MNC was not 0.8.3+. That got fixed in 0.8.5, and 0.8.6 is current. I expect to have 0.8.7 out soon with Rendezvous capabilities. I don’t know of a reason that it wouldn’t work in your setup as long as the game itself works, but of course I’ve not tested it in that environment. Please let me know how it goes for you!

Note, the latest MNC you can get on SpaceDock is 0.8.1, but FP needs 0.8.3. We’re waiting of @XYZ3211to roll in some updates to the master and release it. If you would like a pre-release of MNC 0.9.2 you can get that from my GitHub repo.

https://github.com/schlosrat/ManeuverNodeController/releases/download/0.9.2/maneuver_node_controller_v0.9.2.zip

In order to get the K2-D2 icon you need to have a maneuver node, which you should be able to get by pressing the Make Node button. If something goes wrong with that process and you don't get a node, then K2-D2 will not show up. This is most likely why you're not seeing the K2-D2 button since you've got the latest version of K2-D2 installed.

I would like to help you sort out why you're not getting the node you want when you press that, but I'll need some more info to work with. Let's start with this.

Make Node will try to make the node you've got FP configured to make, but there are situations where you're asking it to make an impossible node and so you don't get a node. For example, if you want to raise your Pe above your Ap, you can't do that as Pe is by definition less than or equal to Ap. Similarly you can make a node to make your Ap be less than your Pe.

Q1: What is the orbit you're starting from? What's the Pe and Ap specifically?

Q2: What kind of node are you asking FP to make? By this, I mean which tab are you on and what is the Maneuver Type toggle button you've got pressed? For example "Match Velocities" is a node type Flight Plan can help you make when you've got a target selected.

Q3: What is your selected target? If it's a vessel, then is it also orbiting the same body your active vessel is, and what's it's orbit? (Ap, Pe, Inclination)

Q4: If you've selected a maneuver type that has an input like New Pe, or New Ap, etc., then what is the value you've got in the text input field to the right of the Maneuver Type toggle button?

Q5: What is the burn time option you've selected? In most cases you can safely go with the default, but it will help me to diagnose this issue if you can give me these details so I'll be able to know what kind of maneuver node you're asking Flight Plan to make for you.

Edited by schlosrat
Link to comment
Share on other sites

1 hour ago, Jhaxxar said:

All I can find is MNC V0.8.1.  This from the GitHub Website. Where do I find the latest version?  Thank you for the suggestions on docking. I will give that a try.

It's literally in the post you're replying to, but here it is again. I updated it to 0.9.3 yesterday to fix a minor bug.
https://github.com/schlosrat/ManeuverNodeController/releases/download/0.9.3/maneuver_node_controller_v0.9.3.zip

 

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