Jump to content

[1.4][1.7.7] GravityTurn continued - Automated Efficient Launches


AndyMt

Recommended Posts

I am still getting an attempt to roll to default orientation if I have rotated the command pod in the VAB (in 1.7.6), but the attempt is so mild as to not be an issue, it makes it about 5 degrees at most before it returns to the desired roll.  For my rockets, the issue is sufficiently dealt with to not cause issues.

Link to comment
Share on other sites

I am now playing around with the mod, and it looks very impressive. The question i have is how many launches are needed before it will find an optimum trajectory?

RIght now I can see the strange thing: I am trying to shoot 140t rocket to a 90 km circular orbit. First guess is average, of course. it takes something like 73-13 for speed and angle. the result is 3496 total burn.

2nd. Than it takes shallower turn (59-15) and gets MUCH better result of 3370 total burn. 

3 rd attempt is like 95-10 (Okay, we are tying extremities) with 3700 total burn... +300dV... something to consider. 

So I expect it at this point to experiment more with shallower ascends, but indeed GT starts to play around the average values between 2nd and 3rd  steadily decreasing the change and by 10th iteration It almost gives up with average values that are far from best result in terms of total burn (something near 3600).... Thats really strange :( And what really messes my brain is that according to log, total losses are steadily decreasing... How could that possibly be??

I have to write down the attemts and the manually use the one giving the best result (usually the 2nd or the 3rd one). Using button "Best previous result" always revertst to previous launch instead of the one with best total burn. 

What am I doing wrong?

Edited by Lan_Morehell
Link to comment
Share on other sites

I'm finding this mod a bit confusing. At times it seems straightforward and simple, and other times it seems completely opaque. I think it could use some better documentation to help new users get started.

Here are some questions I have, after trying the mod and reading through this thread:

  • There was something in this thread about TWR needing to be above 1.2 in order for the algorithm to work. Could you clarify? Does the first stage need to be >1.2, or all atmospheric stages? (I ask because I often have rockets with 1.1 TWR at liftoff)
  • What does the little save button do, and when do I want to use it? At first I thought I needed to press it after each flight attempt to get the mod to store the latest data, but that's not the case. Is it for setting defaults?
  • Sometimes the "improve" button doesn't seem to do anything. See step 5 below.
  • Does the mod ever change values besides Start m/s and Turn Angle? If not, why have them lockable? That they are lockable implies they could change if left unlocked.


Here is some new user guide-type stuff you are welcome to use for any purposes:

1) Build a rocket. Here's one with enough fuel and thrust to easily get to LKO on the bottom two stages (1887m/s from stage3 and ~2008m/s from stage2). Also note the "Total dV" figure for the craft, which is 5157m/s in vacuum. This is used as a basis for comparing efficiency later on.

https://i.imgur.com/OebPRSe.png

2) Click the toolbar button to open the GravityTurn window. As this is the first launch of this craft, there's a button on the bottom that says "First Guess". Press it and the mod will adjust some of the ascent variables according to some math about your rocket. Usually the "Start m/s" and "Turn Angle" fields are the only ones that change.

Then press "Launch!" and the mod will fly your craft (probably) out of the atmosphere.

NOTE: The green and red lock icons signify which variables the mod is allowed to adjust for itself. In this case, even after several launch attempts and variable adjustments, the destination height will remain 100km because it is locked.

If, for example, you want your rocket to start its gravity turn at a speed of 150m/s, you could enter that into "Start m/s" and click the lock button so it is red/locked. Then, when the mod tries to improve the ascent variables later on, it will leave "Start m/s" unchanged (and probably just mess with "Turn Angle").

https://i.imgur.com/jEBhKOl.png

My first attempt got me into orbit using 3545m/s. The mod's values for Start m/s and Turn Angle were 98.66 and 10.22, respectively:

https://i.imgur.com/WJRkPjZ.png

3) Revert to launch. Press the "Improve Guess" button in the GravityTurn window. You'll see some of the unlocked variables change. Launch.

https://i.imgur.com/IdwNvm5.png

This second attempt got to LKO using 3585m/s. Start m/s and Turn Angle, 78.93 and 12.77.

This was a little less efficient.

4) Revert. Improve. Launch.

https://i.imgur.com/5B6KY3X.png

This third attempt got to LKO using 3655m/s. 118.39 and 7.67.

This was less efficient, again.

5) Revert. Improve. NO CHANGE. This is weird. The mod is sticking with the least efficient of the 3 sets of variables it attempted. "Previous Best Settings" reverts to the values used for the first attempt -- most efficient so far. "Improve" again gives the values from the previous (third) attempt. Maybe it wants to try them again, for some reason?

I will manually enter the "First guess" variables (most efficient thus far) and change the "Hold AP Time Start" and "Finish" to 40s instead of 50s. Also locked those time variables.

https://i.imgur.com/9qKzx5D.png

This fourth attempt got to LKO using 3546m/s. 98.66 and 10.22, with 40s AP time.

Same efficiency as "First Guess" (~1m/s difference).

6) Revert. Improve. The mod gives me values it used in the THIRD attempt, again (118.39/7.67). I'll try them once more, since I've also changed the AP time variables.

https://i.imgur.com/rXbdbNe.png

This fifth attempt got to LKO using 3643m/s. 118.39 and 7.67, with 40s AP time.

Better than the third attempt but not as good as the fourth.

7) Revert. Improve. No change.

Edited by revolioclockbergjr
Link to comment
Share on other sites

1 hour ago, revolioclockbergjr said:

There was something in this thread about TWR needing to be above 1.2 in order for the algorithm to work. Could you clarify? Does the first stage need to be >1.2, or all atmospheric stages? (I ask because I often have rockets with 1.1 TWR at liftoff)

First stage, although of course any stage used low in atmo will want to have a respectable TWR. 1.1 is quite low for efficiency - consider that a rocket with a TWR of 1.0 would literally achieve nothing when first lit.

Link to comment
Share on other sites

On 9.12.2016 at 1:03 PM, Lan_Morehell said:

I am now playing around with the mod, and it looks very impressive. The question i have is how many launches are needed before it will find an optimum trajectory?

[...]

What am I doing wrong?

You are doing everything right... If you are using the latest version 1.7.6, then the mod should iterate a few times (max. 5) and then you should have the (close to) optimum launch values. There was a problem with this algorithm which I thought to have fixed in version 1.7.5. Looks like this is not the case (still). Sorry for that, but at the moment you have to write down the values... Usually the suggested values are not too bad, but a tad too steep (depends on the TWR of the 2nd stage, too). The 2nd guess usually is quite close to the optimum and the 3rd guess sometimes is already too aggressive.

Link to comment
Share on other sites

9 hours ago, revolioclockbergjr said:

I'm finding this mod a bit confusing. At times it seems straightforward and simple, and other times it seems completely opaque. I think it could use some better documentation to help new users get started.

Here are some questions I have, after trying the mod and reading through this thread:

  • There was something in this thread about TWR needing to be above 1.2 in order for the algorithm to work. Could you clarify? Does the first stage need to be >1.2, or all atmospheric stages? (I ask because I often have rockets with 1.1 TWR at liftoff)
  • What does the little save button do, and when do I want to use it? At first I thought I needed to press it after each flight attempt to get the mod to store the latest data, but that's not the case. Is it for setting defaults?
  • Sometimes the "improve" button doesn't seem to do anything. See step 5 below.
  • Does the mod ever change values besides Start m/s and Turn Angle? If not, why have them lockable? That they are lockable implies they could change if left unlocked.


Here is some new user guide-type stuff you are welcome to use for any purposes:

[...]

Thanks a lot for your extensive testing and proper description of it. I might well use some of it for the planned wiki page, if that's ok?. Let's answer your questions:

TWR: below 1.2 the initial suggestion will always be 100/10 (on Kerbin). The "improve" button" will increase angle and decrease turn height as it would for higher TWR.

Save button: yes, it saves the defaults. That's the values used for new vehicles

Improve button: looks like there is still an issue with it. The algorithm takes dV and heat into account. I haven't looked into the code for the heat calculations yet, I suspect that this causes this issue.

Values changed: "improve" will only change speed and angle that's correct. But the other values would be overwritten by the defaults if not locked. I'm thinking about changing this behavior.

I plan to overhaul the UI drastically as mentioned a few posts/pages earlier. One of the thinks is the "locked" feature etc. It is actually a workaround necessary because of the inherited code from the original mod. I'm in the middle of refactoring the source code entirely in order to separate data, calculations, controllers and UI. This will take a few more weeks. Because of the holidays etc. don't expect any new release before January.

After the UI overhaul I also plan to provide a wiki page, but it doesn't make sense to do this for the current version, because it will be quite different and I would have to do the work almost 2 times.

Link to comment
Share on other sites

13 hours ago, fourfa said:

FWIW Saturn V had an initial TWR of 1.15, Space Shuttle 1.1 (according to the figures on wikipedia) so it's not like it's outlandish

I think you may have made an error there. WP lists the orbiter at 110,000kg, the external tank at 756,000kg, each SRB at 571,000kg. The SSME total thrust is 5,255 kN and each SRB gives 12,500 kN. That gives a takeoff TWR of 1.5. Of course, I may have made an error...

Link to comment
Share on other sites

13 hours ago, AndyMt said:

Thanks a lot for your extensive testing and proper description of it. I might well use some of it for the planned wiki page, if that's ok?. Let's answer your questions:

TWR: below 1.2 the initial suggestion will always be 100/10 (on Kerbin). The "improve" button" will increase angle and decrease turn height as it would for higher TWR.

Save button: yes, it saves the defaults. That's the values used for new vehicles

Improve button: looks like there is still an issue with it. The algorithm takes dV and heat into account. I haven't looked into the code for the heat calculations yet, I suspect that this causes this issue.

Values changed: "improve" will only change speed and angle that's correct. But the other values would be overwritten by the defaults if not locked. I'm thinking about changing this behavior.

I plan to overhaul the UI drastically as mentioned a few posts/pages earlier. One of the thinks is the "locked" feature etc. It is actually a workaround necessary because of the inherited code from the original mod. I'm in the middle of refactoring the source code entirely in order to separate data, calculations, controllers and UI. This will take a few more weeks. Because of the holidays etc. don't expect any new release before January.

After the UI overhaul I also plan to provide a wiki page, but it doesn't make sense to do this for the current version, because it will be quite different and I would have to do the work almost 2 times.

That all sounds wonderful.

If there's anything I can do to help (testing, breaking, copy writing, wiki-type stuff) let me know. I'd be happy to contribute.

I'd offer to help with the programming but it sounds like you have that mapped out already. And it'd take me a while to catch up. But let me know! Bored nerd looking for side projects. Email is brad at brad dot zone.

 

Edit: One additional thing that you're probably going to flesh out in the next version -- learning from failures. Right now if GT does a launch that's too shallow and burns up or crashes, I don't know if/when GT has recognized the failure. When I revert it doesn't seem to realize that the previous values caused a catastrophe.

Edited by revolioclockbergjr
Link to comment
Share on other sites

2 hours ago, MarlboroMan said:

Will this mod work with realism overhaul and FAR (when they get updated) with limited to no throttle, ullage etc?

Probably not.. throttle control is most of how GT does what it does.

On the other hand, instead of asking, why not install it and test it out? Then you'll know for sure.

Link to comment
Share on other sites

9 hours ago, revolioclockbergjr said:

That all sounds wonderful.

If there's anything I can do to help (testing, breaking, copy writing, wiki-type stuff) let me know. I'd be happy to contribute.

I'd offer to help with the programming but it sounds like you have that mapped out already. And it'd take me a while to catch up. But let me know! Bored nerd looking for side projects. Email is brad at brad dot zone.

 

Edit: One additional thing that you're probably going to flesh out in the next version -- learning from failures. Right now if GT does a launch that's too shallow and burns up or crashes, I don't know if/when GT has recognized the failure. When I revert it doesn't seem to realize that the previous values caused a catastrophe.

I' might very well come back to your offer :). Programming was my daily business until a few years back - and I miss it so much I do side projects of this kind... Now I'm doing requirements and systems engineering without actually producing anything - but earning twice the money... I don't complain...

Regarding learning from failures: actually it should. I have to check the code, but if the maximum achieved altitude is above the current altitude and you revert, then that set of parameters should not count. Same for crash and overheating (=exploding). But I guess they might currently not be looked at properly because of the "improve guess" issue - which starts to annoy me as I thought to have it fixed in 2 versions already...

Link to comment
Share on other sites

6 hours ago, MarlboroMan said:

Will this mod work with realism overhaul and FAR (when they get updated) with limited to no throttle, ullage etc?

I honestly don't know, but I would like to. For sure it will be limited, as it heavily relies on throttling to hold the time to apoapsis. So it would heavily depend on the design of the rocket so that the stages and engines match the needed TWR as close as possible. What it could do is pitching downwards (within limits) to control the time to apoapsis. Right now the algorithm prevents this from happening, it only allows pitching upwards. I've briefly experimented with removing this constraint and setting the sensitivity parameter to 100% (= no throttling down). That didn't work too bad, but it really depends on the engine's TWR on all stages to be close to what is needed. Otherwise the vessel pitches down too much and may break up due to atmospheric forces. Also a problem: engines with limited amount of re-ignitions (or none) especially with the upper stages when coasting towards the end of the atmosphere.

If FAR would be an issue at all I can't tell. Atmospheric forces are not really pre-calculated and taken into account. The initial turning height and angle are calculated with a very simple algorithm - which might not be appropriate for RSS sized systems.

So - as soon as there is a RSS or RO mod available and I've completed the UI/code refactoring, I'll have a look. Because I really, really would like to do a career play through in RO - just not launching manually all the time. I do for new rockets usually.

Link to comment
Share on other sites

55 minutes ago, AndyMt said:

as soon as there is a RSS or RO mod available and I've completed the UI/code refactoring, I'll have a look.

That'd be fantastic.

Yeah i read your op, and understand your mod is mainly using throttle to hit it's target. I frankly didn't expect you to be as welcoming as you are with the RO idea.

 

RO mostly demands you build and launch rockets efficiently, so the margins for TWR and AOA are much lower than what you can normally get away with in stock.

Most of my dialed in RO rockets follow a similar launch profile and never exceed 5 degrees AOA.

I'm happy to help test in RO for you if/when it's needed. I will try your mod in 1.1.3 and report back. My guess is it wont work.

Link to comment
Share on other sites

5 minutes ago, MarlboroMan said:

That'd be fantastic.

Yeah i read your op, and understand your mod is mainly using throttle to hit it's target. I frankly didn't expect you to be as welcoming as you are with the RO idea.

 

RO mostly demands you build and launch rockets efficiently, so the margins for TWR and AOA are much lower than what you can normally get away with in stock.

Most of my dialed in RO rockets follow a similar launch profile and never exceed 5 degrees AOA.

I'm happy to help test in RO for you if/when it's needed. I will try your mod in 1.1.3 and report back. My guess is it wont work.

Yes, it won't work in 1.1.3 because of changes in the KSP API. Is there any real scale planet mod for 1.2.x yet?

Link to comment
Share on other sites

A possible feature request if it is easy to implement (possibly an advanced feature).  if is not, no worries, as it is an edge case for utility.

 

When launching large and draggy rockets, there is still benefit in following the old souposphere launch profile, as it minimizes drag in the lower atmosphere by keeping the speed around terminal velocity until the atmosphere thins out, and you can really open up the throttles.  This also helps for Eve

 

When launching these type of rockets, I tend to set up GT with a high initial turn velocity, a low initial turn angle, and set the initial time to ap really low (25-30).  The problem with this is that it tends to way overcook the gravity turn once the real pitchover starts as it take a while for the time to ap to step from the low initial start to the final value.

 

would it be possible to code an intermediate time to ap setting, possible something like a time to ap at a defined or user specified altitude, so we can set up a 2 slope time to ap curve on occasions where it is beneficial.  

Link to comment
Share on other sites

13 hours ago, MarlboroMan said:

Will this mod work with realism overhaul and FAR (when they get updated) with limited to no throttle, ullage etc?

I tried it with RO-RP0.  I tuned the start and turn figures manually, and it did a reasonable job, with the rockets I tried.  Obviously, tuning those initial turn figure took a little trial and error for each design.

 

Link to comment
Share on other sites

You could try allowing a wide band for hysteresis in time-to-APO?  Like while aiming for 50 seconds to APO, go full-throttle until 60s to APO, shut off and coast until 40s to APO, etc.  Obviously there's no point if ignitions are very limited (I haven't played RO).

 

Link to comment
Share on other sites

Excellent mod - thank you!

I do need a bit more info on some of the settings though...

Start m/s...OK, I got this one. The speed at which the gravity turn starts. Why should it change though, more/less draggy/massive craft?

Turn angle...How far off-vertical the craft first turns after the above? So, if I don't want to cause too much drag at this point I should make this less but the flight might then be a bit less than optimal?

Hold SAP Time Start...Means nothing to me. I get that it makes the climb steeper or shallower but have no idea why. The title of this setting seems to have four unrelated words. What are "good" values and why?

Hold SAP Time Finish...As above. 

Sensitivity...Minimum throttle? If so, why is it called sensitivity? What are "good" values and why?

Destination Height...On safer ground with this one. 

Roll...Something with ham in it? Kidding. Handy to get a craft in the right orientation so that pairs of boosters fly away OK on decoupling. 

Inclination...OK with this one too. 

Pressure Cutoff...Umm, nope, got nothing for this one. Why would I change this? What are "good" values and why?

Edited by Foxster
Link to comment
Share on other sites

13 minutes ago, Foxster said:

Hold SP Time Start...Means nothing to me. I get that it makes the climb steeper or shallower but have no idea why. The title of this setting seems to have four unrelated words. What are "good" values and why?

Hold AP Time Start - if you had a mod like Kerbal Engineer installed, you'd notice a readout called "Time to AP".  This is how long until you get to the AP, and when Gravity turn in in command, you'd notice that it reduces the throttle to keep that time at whatever this setting is.  Reduces wasted Dv.

13 minutes ago, Foxster said:

Hold SP Time Finish...As above. 

Using this value, GT "scales" the Time to AP between the two values (Hold AP Time Start and Hold AP Time Finish) during the launch.  It gradually lets the AP move further ahead of the craft during ascent. 

13 minutes ago, Foxster said:

Sensitivity...Minimum throttle? If so, why is it called sensitivity? What are "good" values and why?

Yes, minimum throttle.

 

Have you clicked the "?" buttons?  They do describe the variables, although there are errors "Hold AP Time Start" says it varies "Time to Prograde" which if it is actually a accurate term (I've never heard it) does fly in the face of how this is typically expressed everywhere else in Kerbal discussions.

Edited by tg626
Link to comment
Share on other sites

Thanks for that. 

I have used the ? buttons and they just didn't help me much. I'm afraid that your explanations, though no doubt excellent, only help a little. I really do need an idiot's guide with phrases like "Make this number bigger to get there quicker but waste more fuel". 

For someone who has played KSP for quite a while and done some pretty special things in the game, I never fail to be amazed at my near complete ignorance of anything related to orbital mechanics, atmospherics, numbers, words, etc. 

Thinking about it, is a better answer to me that I should go away and learn some stuff?

Edited by Foxster
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...