Jump to content

[1.9,1.8] ascent/descent addon for interplanetory transfer (before launch planning and PLAD's flyby finder interface)


okder

Recommended Posts

download:

source: https://drive.google.com/file/d/0B0rgcOJPK_8XTE5QRVdxZWtWYjg/view?usp=sharing&resourcekey=0-DAyd0ddkfsgDXUR3qDpDNA

binary:  https://drive.google.com/file/d/0B0rgcOJPK_8XeWdVRmNlRVhqeUk/view?usp=sharing&resourcekey=0-lWyGnBnQ3ckkp1AN1jCppw

binary beta (April 2020) : https://drive.google.com/file/d/1WzovyRVp_aYhe9p_UOdWcoMtDL_h2RH2/view?usp=sharing

for ksp 1.9, 1.8, MJ 2.9.2

installation: just put the plugin dll near MechJeb2.dll (inside GameData/MechJeb2/Plugins folder, and 2 new window ("My Landing Guidance", "Ascent StartTime") will be in mechjeb list)

 

Ascent StartTime (MechJebModuleAscentTime.cs) provides interface between mechjeb and plad's flyby finder, or allows you to plan your interplanetary transfer before you leave the ground.

and auto start to correct intermediate orbit, helps you advance that orbit, and do ejection burn to some other celestial body around sun (or in case you fly from one moon to other - around parent celestial body)

To do so you need to:

1. select destination body (other planet) (or type it's name if you clear ByTgt checkbox)

2. fill Orbit altitude (will be forwarded to Ascent autopilot) in Ascent StarTime window (it's in list of other mechjeb windowses, if addon was installed correctly)

3. generate with initial guess and tune buttons or fill (from PLAD's flyby finder, or other sources such as alexmoon's Launch Window Planner) following values:

Departure

Arrival

(they are set in days from start of game (first day is 1, but can be changed by offset field (which is in hours)) )

which path to use short one or long one, usually preferable one with lower Boost deltaV, but in some cases to get to  next gravity assist  you would need to be more specific, so there is no auto here by default, but any previously mentioned tune button will auto that.

3. after that you could just Press Best button to fill most optimal parameter that defines inclination (previously mentioned auto tune will do it for you),

it will find parameter that correspond to lowest possible inclination of initial orbit, which HOWEVER do allow both: launch from your launch site (your current position on planet surface)  and chosen interplanetary transfer.

or if you need more specific orbit you could fill Orb[ital] Par[ameter] of incl[ination] by yourself (or just select it by clicking some point on planet, after clicking on "Select").

4. after that you could use DrawIntermedOrbit button ( Choose or tune buttons will do that also )  to show orbit in orbits screen (M), more important that Boost from Circular [orbit] field will now show calculated transfer deltaV, which should up to 0.1m/s correspond those from PLAD's flyby finder, or just (in case other sources of transfer time) be good enough for you.

other fields which can be useful:

BoostPrepareDays - how much time (in days) you want spend on orbit of current planet. (you could build boost with several passes, but you would need time)

BoostPrepareOrbits - same(additional to days) but in orbital periods of shown orbit (it's not circular!)

LaunchOffset - will start early by that number of seconds, allowing vessel get to upper layers of atmosphere, or you will miss selected orbital plane because of planetary atmosphere rotation (with planet itself), best values 90 sec for kerbin and 150 for earth, write here if you find better, spaceplanes could require more.

HoursPerDay - just to choose between kerbal/earth day

OffsetHours(firstday) - i probably should replace this field with something like offset day, currently should be same as HoursPerDay, and for PLAD's fly by finder both fields should be 24.

(at least old for version)

Launch countdown - same as in mechjeb's ascent guidance (i.e. how many last seconds will pass with warp 1x)

PartialBoostGuidance - parameter for displayed orbit, which allow you to see how orbit will looks like after acceleration by this speed in proper time (beginning of interplanetary transfer), for technical reason can't be 0(i.e. displayed orbit is never circular), but value can be 0.0001 * (Boost from Circular)

again Boost from Circular is accounted from exactly circular orbit with selected Orbit altitude

5. press button Launch to circlular orbit (it will update and calc orbit again anyway, so may be needed to check it, if some bugs got there)

6. (optionally) tune values in Ascent Guidance window.

7. press engage autopilot (do the same in both windows, but better do it in "Ascent StartTime", as caller is tracked in MJ)

8. after reaching orbit CreateTranferNode button will be available to create transfer maneuver node

(this done mostly with slightly modified mechjeb code, when i did tests precision was 1m/s or better)

but you could just do prograde burn manually - you have marked point on orbits map, where you need to do burn (in case marker orbit and your orbit matched closely)

(p.s. there was bug that orbit marker is drifting over time, so DrawIntermedOrbit  may have to fix that, better to press it before burn, CreateTranferNode also call same code to prevent any error appears, if you could reproduce or know why it's happens i will fix it)

9. and CreateCorrectionNode button would place correction node as soon as possible (after all nodes)

this button use 100% mechjeb code (only with fixed arrival time filled from Arrival field) and it's buggy(2 authors of mechjeb why?) while you fly in source planet soi, if you want correction early (than leaving source planet soi) you need to do it manually.

 

I did find cases when launch to inclination choose completely wrong times (on minmus orbit), so i did add same feature to that addon, with completely different code (which is used for primary purpose of addon anyway) i.e. "Launch into plane of target" just doing the same job as button in ascent guidance but without bugs :).

take into consideration that current MJ version did not account for initial (start) orbital velocity (due to rotation of planet) when it goes for inclined orbits (so it will end with incorrect inclination), so you need to make correction by yourself in upper layers of atmosphere, you need keep 10 degrees on correct side for 10-20 sec, you don't need even turn of autopilot for that (MJ devs said that bug is fixed in dev build), mine last 5 attempts(while i did test that) result into orbit with relative inclination less than 0.05 degrees from calculated.

 

with life realistic plugins for ksp i would recommend to use fake vessel and warp time (using this addon to step 7) until 1 min before launch(Launch countdown = 60), then abort and recover fake vessel and select proper one, and do proper launch (you would need to select target/planet again, other values should be saved so you could press launch in circlular and engage autopilot).

 

"Launch to circular orbit" button uses latest allowed(by limitation) time for launch (to keep vessel in parking orbit minimum time, because life realistic plugins will spend your resources while you in orbit).

"Launch into plane of target" button uses earliest allowed time.

Auto tuning DepartureDay and ArrivalDay supported, i.e. you don't need external window planner anymore, unless you want  several flyby.

InitialGuess: makes them for almost circular orbits (all celestial bodies in original ksp looks good enough) and not much inclined.

Tune makes it almost perfect (there are separate buttons for DepartureDay  and ArrivalDay and also combined one near InitialGuess:

toggle able Tune2 near Dst.Inb.Spd: allows previously mentioned tuning not only for minimum boost speed (transfer dv), but also for minimum entering orbit burn (stopping) at destination.

Spoiler

although Tune2  is inverse of " No insertion burn (e.g. aerocapture or fly-by) " option in alexmoon's launch window planner, but it don't take into account oberth effect of both celestial bodies, i.e. it would probably need another option to include it for each celestial body (at user provided periapsis altitude)

most of feature still working when you in orbit of moon of starting celestial body, i.e. you could tune intermediate orbit for transfer and left moon in proper time with minimal delta-v (including transfer burn)

My landing guidance - highly experimental fork of mechjeb version with a lot more tunable parameters done to allow landing with RO engines, now could only be used after deorbit burn done and in way (i think that you have limited ignitions):

Spoiler

My landing guidance - highly experimental fork of mechjeb version with a lot more tunable parameters done to allow landing with RO engines, now could only be used after deorbit burn done and in way (i think that you have limited ignitions):

1. Do manual deorbit burn (with large overshoot)

2. Show predictions, Show predictions with DescendPolicy

3. Set target

4. disable engines and auto-warp

5. press Land At Target

6. if correction needed (error limit is now editable) abort autopilot

and use button to insert correction node, tune correction node, and manually do the burn, goto 5

7. if it shows Coasting toward deceleration burn enable warp, if you could spend rcs fuel on better landing precision enable rcs.

mintrust - works after deceleration burn started, it (in theory) will never put lower thrust on engines until touchdown (i.e. no ignition spend) very buggy in last landing stage.

safityThrustLimit... - it will do predictions assuming that max-thrust is multiplied on that number, for safer landing put that number less than 1.0, for less fuel consumption - more than 1.0 (very dangerous for poor kerbals)

8. when deceleration burn begins do enable engines manually (make sure no vapor in fuel lines!, i prefer use rcs acceleration for that)

 

take into account that interface do change in new MJ version so if you want to use faster you need to download sources and rebuild by yourself (you could just compile with any .NET c# compiler (even without VS installing, just add reference for assemblies dlls { mechjeb2 UnityEngine Assembly-CSharp } from ksp forder) ).

 

M1fPh9V.jpg

 

outdated:

temporary merged with GravityTurn 

source

https://drive.google.com/open?id=0B0rgcOJPK_8XeWc3TWNBWmtKOTQ

binary

https://drive.google.com/open?id=0B0rgcOJPK_8XTGZhQndoWDJsS1E

 

(As accessible as submenu from GravityTurn main menu, but actually it controls Gravity Turn :) )

small fixes in GravityTurn for inclination and max thrust while too low.

P.S. it's old GravityTurn recompiled for 1.2, new GravityTurn without AscentStartTime is there

 

Edited by okder
updates
Link to comment
Share on other sites

https://drive.google.com/file/d/0B0rgcOJPK_8XWndqMUp4ZXJDUEE/view?usp=sharing

https://drive.google.com/file/d/0B0rgcOJPK_8XNzNZRk5xQkpLUU0/view?usp=sharing

https://drive.google.com/file/d/0B0rgcOJPK_8XYVB3SkxLdE1uLTA/view?usp=sharing

https://drive.google.com/file/d/0B0rgcOJPK_8XOTBqUTg2Y1loemc/view?usp=sharing

as you can see error by DV value -0.2 m/s by direction ~17m/s (but orbit is not exactly the same + mechjeb node insertion takes into account precise in soi position, PLAD FlyBy operates mostly out of soi of planes (i.e. distance between planet and position where soi escape velocity appears considered 0) ) burn position exactly the point where it's expected.

landing is slightly too alpha:

https://drive.google.com/file/d/0B0rgcOJPK_8XSWtkMUZEMWdRVzQ/view?usp=sharing

i.e. i can't force prediction do same way in node placement as it works in landing autopilot enabled, so may be some problems.

i just don't know what's reason for behavior change (as i do force proper DescentPolicy, it still calcs differently)

EBDOYss.jpg

x7Szvf5.jpg

8eNmru4.jpg

KTjTr9k.jpg

 

 

 

Edited by okder
Link to comment
Share on other sites

it looks like mechjeb auto create transfer node need more work, because now it's work worse than inserting prograde in periapsis

but i proved that 3800 dV budget (leo,150km) is enough to go to Venus upper atmosphere and back to Earth, but no science there, you need at least 1000 m/s or even 1500 more (i did spend 2000) if you want science because atmosphere science can't be acquired while orbit escapes soi .

Edited by okder
Link to comment
Share on other sites

Very nice addon here. I tried it out setting up a couple of flyby paths and it did the job correctly. This is a really handy way to get into the right orbit and especially to set up the departure node from the start planet to the first planet. The fact that it corrects for errors in getting to the start orbit is superb. In Flyby Finder I define the departure orbit using an equatorial orbit for reference, but that is usually not the most efficient orbit to get into from the surface. This addon finds the most efficient orbit to use, and it finds ones where FF gets the 'inclination 90 degrees' error. I made up a little primer to explain what I mean since I can't explain it without pictures. (I can see that okder already knows this, so this is for everyone else.)

 

Something I forgot to say- the diameter of the departure circle varies from about 60 degrees for a minimal trip to Eve to about 120 degrees for a trip straight to Eeloo. My drawings show it too small.

 

Here are my experiences from using the addon:

I'm tempted to suggest that you eliminate the 'short path' choice by checking the boost from circular value from both the short and long way and eliminating the one that is much bigger, but I kind of liked being able to see both Lambert solutions. Great Job!

Link to comment
Share on other sites

@PLAD , Create node is slightly modified(elliptic escape orbits allowed instead of infinity hyperbolic (place where escape Vinf  is accounted) ) mechjeb function with fixed arrival time,

but as i showed it still tends going wrong(worse than periapsis prograde if your orbit is close to optimal) , so i thinking about switch (periapsis node, close to optimal node, automechjeb node) for that button.

Quote

Note that the program gave a -179.8 degree launch inclination- into the right orbit but retrograde.

you probably forgot to press Choose button or enter desired parameter of inclination yourself, this parameter is not the inclination, but rather just way to calculate inclination (free parameter in formulas), i.e. in this case it needs to be 180, for close to zero inclination (Choose would find better one), if you did press Choose  and it got that one please report it.

 

 

P.S. i did the check Choose looks like works correctly for that example:

2w1va4k.jpg

i could also suggest we both adds field for year offset (in my case instead of OffsetHours), it's almost no point to add it without adding into FlyBy finder.

Edited by okder
Link to comment
Share on other sites

OK, got it, I didn't understand what the "Choose" button did. I've also since figured out the "PartialBoostGuidance" field and that it is why the blue orbit was elliptical. I should have studied more before commenting!

I realized that OffsetHours(firstday) compensates for the fact that I call the start time of the game (0 seconds UT) day "1" instead of "0". What would the year offset do?  I have to be careful that I understand it correctly, all the 6/426 and 24/365  and indicated time details take me some effort to keep straight. (When I first wrote FF, KSP only had the 24/365 time system so I didn't make it easy to change.)

  I'm going to try this with the RSS/RO mod now. 

Link to comment
Share on other sites

On 13.02.2016 at 2:45 AM, PLAD said:

 What would the year offset do?

just making days number lower (and so easier to convert in mind in ksp dates) , for your program - modifying 1 field instead of 3-5 fields, when you move fly window, i.e. 1 year would mean same as 24 or 6 hours in OffsetHours, 2 year would mean 366 or 427 days, etc.

but i am think just about time offset field (i.e. ability to enter 1y or 6h there), and so unification OffsetHours and OffsetYears

 

 

Edited by okder
Link to comment
Share on other sites

This is extremely useful for the RSS mod too. I will never launch to a planetary departure orbit in RSS without the 'launch to circular orbit' and 'create transfer node' features again. If you reach a point where you do not plan any big changes to that part of the interface I will add this to my FF tutorials.

I am not sure what you meant about modifying fields, I have the 'Increment all search dates by' field in FF that allows you to change all the 'Earliest search date' fields at once, is it something like that? I want to keep that in days rather than years so I don't have to write decimal points when entering data. Sorry if I am misunderstanding.

Link to comment
Share on other sites

When I tried to use this, I got a massive spam of this exception when I launched a ship:

MissingMethodException: Method not found: 'MuMech.GLUtils.DrawPath'.
  at RenderingManager.OnGUI () [0x00000] in <filename unknown>:0

Also, all of the blizzys toolbar icons were greyed out and the esc key wouldn't work, had to force exit KSP. Using dev build #567.

Output log

Edited by smjjames
Link to comment
Share on other sites

  • 3 weeks later...
On 20.02.2016 at 6:21 AM, davidy12 said:

How do I install it?!?!

to install just put binary dll nearby mecheb2.dll (i did write that in initial post), also i did update binary for mechjeb 2.5.6

On 20.02.2016 at 5:20 AM, smjjames said:

When I tried to use this, I got a massive spam of this exception when I launched a ship:

MissingMethodException: Method not found: 'MuMech.GLUtils.DrawPath'.
  at RenderingManager.OnGUI () [0x00000] in <filename unknown>:0

fixed now(for mecheb 2.5.6 release), sorry for delay

 

Edited by okder
Link to comment
Share on other sites

20 hours ago, smjjames said:

Did you check against build 571?

no just for 2.5.6.0 release, post direct link to mechjeb2.dll or archive which has that dll, i would check it.

(as i write it's better to rebuild yourself if you using dev build, you need only c# compiler for that, usually interface changes are small - just more params field and it's easy to fix,

or ask mechjeb dev's include stuff you need into regular mecheb version, license do allow that)

Link to comment
Share on other sites

  • 2 months later...
  • 4 weeks later...

updated to 2.5.7.0 and for ksp 1.1, used new way of rendering support orbit, may be some bugs there (with garbage), needs some precise and simple way to reproduce.

it appears ksp 1.1 do crash if you fall precisely in center of planet (after transfer) so i did workaround for it (it do modifies transfer node, to make it less precise).

p.s. actually binary was ready 10 days ago, but i still did not tested it well, sorry for delay, please ask me more (with @ reference for example like @romanasul ) for faster update, i don't know how many people needs this project.

 

 

 

Edited by okder
Link to comment
Share on other sites

I certainly use your addon every time I execute an FF or Alexmun generated transfer. It is terrific. I never want to bother you or anyone to update stuff because you are doing it for free, and it is a lot of work to figure out what needs to be changed after every update and then write and test it (and I am glad for those who take them time to test it well), but I will say thank you for keeping this up.

That is an odd new crash scenario. I'd agree that while it makes sense to have the initial path go through the center of the planet, it isn't necessary to be that exact because you can never execute the actual burn in LKO that accurately. Anything within a couple thousand km or so of center is plenty good enough.

Link to comment
Share on other sites

there is  also new experimental mode for planning transfer while you in soi of moon of source planet, (i.e. it will draw support orbit around source planet, and do proper calculation, which in turn allows you to leave moon in good moment (to reach support orbit) )

and also new mode for adding tranfser node (i.e. just prograde burn at periapsis, and MJ optimisation of interplanetory transfer is now optional too, for both modes)

 

 

Edited by okder
Link to comment
Share on other sites

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

temporary merged with GravityTurn and build it for 1.2 PRE. (not sure that new bugs did not introduced)

no mechjeb support so lost features for complex additional transfer nodes,

but still able to put transfer node in periapsis, when both relative inclination: and angle between Periapsises: very close to zero,

in other words, when you in correct orbital plane (which is marked for you in planetarium) and your orbit's periapsis node in correct position (also marked in planetarium).

actually it's doable when launching (right after automatic phase MJ or GravityTurn ) and first low orbit time.

 

new features:

auto tuning DepartureDay and ArrivalDay

InitialGuess: makes them for almost circular orbits (all celestial bodies in original ksp looks good enough) and not much inclined.

Tune makes it almost perfect (there are separate buttons for DepartureDay  and ArrivalDay and also combined one near InitialGuess:

i.e. you don't need alexmoon's ksp launch window anymore, but still need Plad's fly by finder (in case you need several gravity assists along the way.)

 

Edited by okder
Link to comment
Share on other sites

another small update - toggle Tune2 near Dst.Inb.Spd: allows tuning not only for minimum boost speed (transfer dv), but also for minimum entering orbit burn (stopping) at destination.

value speed itself is magnitude of out of soi speed when entering soi of destination (or just relative speed for object without soi (asteroid, or vessel)).

i.e. Tune2  is inverse of " No insertion burn (e.g. aerocapture or fly-by) " option in alexmoon's launch window planner

(download links updated)

Edited by okder
Link to comment
Share on other sites

  • 2 months later...

updated for  MJ 2.5.9.0-662 ksp 1.2.1

https://drive.google.com/file/d/0B0rgcOJPK_8XeWdVRmNlRVhqeUk/view

all features from both previous branches, need more testing so waiting for bug reports :).

update: fixed in space buttons to function properly.

update2: fixed error spam in log.

update3: fixed launch in plane of target.

 

Edited by okder
Link to comment
Share on other sites

  • 2 weeks later...
  • 4 weeks later...
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...