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

Recommended Posts

On 18/01/2018 at 12:16 AM, DStaal said:

I think for a kOS script, you'd probably want the simple version of what this mod does: A certain time/height/speed after launch, turn a set amount.  Keep engines on full until apoptosis is ~50 seconds away.  (Or 20, or whatever you set.)  Then reduce throttle and adjust it to keep it at that time away.  Have a minimum throttle you can reduce to.  Cut engines entirely when apoptosis reaches your desired orbital height.  (Though you may want to keep the script running to account for drag.)

Thanks, but as far as I can tell that is not the most efficient possible way. What I'm trying to do is something a bit more clever, which adjusts throttle to account for dynamic pressure (and indirectly TWR), and finds the most efficient curve to minimize  the sum of drag, steering and gravity losses... But I have no idea where to get started, and I have no idea which parameters I can compute and which/how many ones I have to arbitrarily pluck in there and try out...

I was wondering what you meant by apoptosis but I guess you meant Apoapsis

anyway I googled it, so, fyi from wikipedia : Apoptosis (from Ancient Greek ἀπόπτωσις "falling off") is a process of programmed cell death that occurs in multicellular organisms. I just learned something today

Edited by lBoBl
Share on other sites

14 hours ago, lBoBl said:

I was wondering what you meant by apoptosis but I guess you meant Apoapsis

Yes...  I can't spell, and occasionally my spell checker doesn't help me.

14 hours ago, lBoBl said:

Thanks, but as far as I can tell that is not the most efficient possible way. What I'm trying to do is something a bit more clever, which adjusts throttle to account for dynamic pressure (and indirectly TWR), and finds the most efficient curve to minimize  the sum of drag, steering and gravity losses... But I have no idea where to get started, and I have no idea which parameters I can compute and which/how many ones I have to arbitrarily pluck in there and try out...

It may not be the most efficient, but I believe it's the way this mod does it...

Share on other sites

Got an Exception in GravityTurn, where it throws an exception about not beeing able to load a Skin.

Share on other sites

On 1/17/2018 at 5:06 AM, AndyMt said:

Great! Thanks for looking into this so the 2 mods work together.

I still don't have the time to continue the refactoring and UI improvement...

So I have the countdown clock calling the Launch() method, but apparently GT doesn't like to do anything if the engines have already been started.

So if the countdown clock has started the engines early, and then calls GT, it launches, but then GT seems to be disabled.

Any idea why, and how I can work around this?

Share on other sites

9 hours ago, linuxgurugamer said:

So I have the countdown clock calling the Launch() method, but apparently GT doesn't like to do anything if the engines have already been started.

So if the countdown clock has started the engines early, and then calls GT, it launches, but then GT seems to be disabled.

Any idea why, and how I can work around this?

Hm... By Launch() do you mean GT's internal GravityTurner:Launch() method?

What you can do: if you show the stats window in GT and have the alt-key pressed while klicking the checkbox, GT will show some more information there. Including some status information about which phase of a launch it is in. Also the log file might help a little about what happens (or doesn't) compared to a manual launch.

Share on other sites

Prologue: Disregard if mod conflicts aren't a concern--if they are, I'll research the crash.  Otherwise please disregard.

Title:  Gravity Turn Crashes KSP When Staging Occurs in Map View.

KSP: v 1.3.1

x64
-force-d3d11

GravityTurn: v 1.7.6

Steps To Reproduce:

1. Get game to a launch situation with a reasonable rocket with more than one stage that works without Gravity Turn.
2. Open Gravity Turn window.
3. Open 'Map' window.  ('m' key)
4. With default parameters in Gravity Turn Window, select 'launch.'

Observed Result:  Always, and with any ship, the game will crash shortly after launch/staging.

Expected Result: Game should not crash.

Notes:
*
This is in a real-world play-through install with many many mods alongside it.  I'm posting this just to let you know there's something 'bad' going on--either with the map or with some other mod.  I'll test it again with just this mod installed to see if the same thing occurs.

*Please let me know what logs you'd like to see so I don't bombard you with useless information.

*Interestingly, a game with only this mod installed does not allow staging from the Map view.  The question now becomes: What mod permits it?

*Installed on its own, it doesn't exhibit the above behavior, so it's some mod conflicting with it.

Edited by slaintemaith
Share on other sites

16 minutes ago, slaintemaith said:

Prologue: Disregard if mod conflicts aren't a concern--if they are, I'll research the crash.  Otherwise please disregard.

Title:  Gravity Turn Crashes KSP When Staging Occurs in Map View.

KSP: v 1.3.1

x64
-force-d3d11

GravityTurn: v 1.7.6

Steps To Reproduce:

1. Get game to a launch situation with a reasonable rocket with more than one stage that works without Gravity Turn.
2. Open Gravity Turn window.
3. Open 'Map' window.  ('m' key)
4. With default parameters in Gravity Turn Window, select 'launch.'

Observed Result:  Always, and with any ship, the game will crash shortly after launch/staging.

Expected Result: Game should not crash.

Notes:
*
This is in a real-world play-through install with many many mods alongside it.  I'm posting this just to let you know there's something 'bad' going on--either with the map or with some other mod.  I'll test it again with just this mod installed to see if the same thing occurs.

*Please let me know what logs you'd like to see so I don't bombard you with useless information.

*Interestingly, a game with only this mod installed does not allow staging from the Map view.  The question now becomes: What mod permits it?

*Installed on its own, it doesn't exhibit the above behavior, so it's some mod conflicting with it.

Oh nice, got the same problem, but thought it might be one of my many other mods that would interfere with something.

Share on other sites

Do we care enough to track down which mod(s) though?    (=

Share on other sites

1 minute ago, slaintemaith said:

Do we care enough to track down which mod(s) though?    (=

By >100 active mods, not really because it could be any of them
But tracking it down to map view yeah can confirm that, even launching just in map view will cause it, happened to me once.

Share on other sites

came back to play ksp after like 1 year away, and im so glad i found this mod!

really works, way better than the updated mechjeb

thank you a lot!

Edited by nfpinto
Share on other sites

Not meaning to sound obtuse, but is there someplace that explains the parameters entered for this like I'm six years old?  Maybe a nice pop=up book?  Some of the descriptions by mousing over them seem a bit...obscure.  (And yes, I've read them, I just still don't understand them--sort of like an ape reading Nietzsche.)

Not a complaint, I'm just wondering why I'm entering some of the numbers I'm entering and some things work--at times exceptionally well--and having no understanding of why--especially when the numbers I'm entering make no sense.

Case in point:  Using the Cormorant Aeronology Shuttle stack in a 2.5x sized RSS world, these settings lob me in to orbit perfectly--even allowing the ET to be jettisoned and circularization completed by the OMS engines.  This is no small feat, as shuttles of any sort and autopilots tend NOT to get along in Kerbal.  At all.  Ever.  Unless they're VERY well written, or very specifically written:

Start m/s: 200

Turn Angle: 20

Hold AP Time Start: 59.79 (This number was put there not by me)

Hold AP Time Finish: 25.00

Sensitivity: 30

Apoapsis: 120

Roll: 180

Inc: 28.60

Press. Cutoff: 1200

Now some of these don't make sense at all.  Like how can the AP stop before it starts?  And shouldn't the press. cutoff be different due to the different atmo size?  I'd like to understand this a little better in the hopes of pinpointing certain phases of flight.

Edited by slaintemaith
Share on other sites

9 minutes ago, slaintemaith said:

Now some of these don't make sense at all.  Like how can the AP stop before it starts?  And shouldn't the press. cutoff be different due to the different atmo size?  I'd like to understand this a little better in the hopes of pinpointing certain phases of flight.

The AP start/stop are the time to AP at the start and stop of the gravity turn.  The gravity turn starts when you launch, and ends when you get to your orbital altitude, so you're basically saying to gradually shallow out your turn during the ascent.

Pressure cutoff and size of the atmosphere don't really interact - the pressure cutoff is the pressure of the atmosphere against the ship, not the pressure of the atmosphere at a height.  So it takes into account the speed you're flying at as well as the thickness of the atmosphere.  (At, least, that's my understanding.)  When the pressure drops below a certain amount, the fairings will jettison.  What depth you are in the atmosphere that happens at will be complex.

Share on other sites

3 minutes ago, DStaal said:

The AP start/stop are the time to AP at the start and stop of the gravity turn.  The gravity turn starts when you launch, and ends when you get to your orbital altitude, so you're basically saying to gradually shallow out your turn during the ascent.

I find this conflicting report very conflicting.  If you're saying GTurn starts at liftoff and stops at specified alt, what are these numbers for at all?  Or perhaps the better question is: how to these numbers shape the gravity turn?

Share on other sites

17 minutes ago, slaintemaith said:

I find this conflicting report very conflicting.  If you're saying GTurn starts at liftoff and stops at specified alt, what are these numbers for at all?  Or perhaps the better question is: how to these numbers shape the gravity turn?

They are the time to AP that the mod will try to maintain at those points in the turn.  At the beginning it will try to accelerate until AP is ~60 seconds away, and then it will let the speed/angle fall until it's just 25 seconds away.  (Subject to the sensitivity, which is the lowest throttle setting it will allow until AP is at the orbital altitude.)

I'm guessing the shuttle stack has some solid-rocket engines that can't be throttled, based on those numbers.  The mod will adjust the start time to AP in that case to whatever it was when the solid boosters cut out.

Share on other sites

That would make sense, yep.

Share on other sites

• 2 weeks later...

I'm a fan of recreating the historical space race, so I downloaded @Alcentar's R7/Vostok/Sputnik mod and launched an R7 with Sputnik 1 from one of the Kosmodrome launch pads.  I used Gravity Turn to control the ascent and noticed the rocket started to spiral along it's center axis off kilter(i.e. the head  and tail of the rocket weren't lined up with the spin). I relaunched the rocket and flew it manually with SAS enabled and didn't have the same issue. I'm not sure if this is an issue with Gravity Turn or the R7 in question. I haven't had similar issues using Gravity Turn to launch a Juno Rocket with Explorer 1(BDB) from the regular launch pad. I'm going to do more experiments to try and recreate the issue on different launchpads or with different rockets.

Share on other sites

Guys, is there a "full throttle" version of this mod? I'm playing on Realism Overhaul, an throttling down isn't an option. I tried writing a script in kOS, but believe me, the math part is VERY hard. I used an equation similar to y = sqrt(x), but this is very dependent of the rocket's TWR and staging timings.

Launch on default KSP isn't an issue, you get there quite quickly, but on Realism Overhaul, doing it over and over and over again gets tiring. I need to automate that!

Any ideas?

Share on other sites

On 2/11/2018 at 11:57 AM, Spike88 said:

I'm a fan of recreating the historical space race, so I downloaded......

in question. I haven't had similar issues using Gravity Turn to launch a Juno Rocket with Explorer 1(BDB) from the regular launch pad. I'm going to do more experiments to try and recreate the issue on different launchpads or with different rockets.

I had the same thing happen with a tantares R7.

Share on other sites

On 11.2.2018 at 5:57 PM, Spike88 said:

I'm a fan of recreating the historical space race, so I downloaded @Alcentar's R7/Vostok/Sputnik mod and launched an R7 with Sputnik 1 from one of the Kosmodrome launch pads.  I used Gravity Turn to control the ascent and noticed the rocket started to spiral along it's center axis off kilter(i.e. the head  and tail of the rocket weren't lined up with the spin). I relaunched the rocket and flew it manually with SAS enabled and didn't have the same issue. I'm not sure if this is an issue with Gravity Turn or the R7 in question. I haven't had similar issues using Gravity Turn to launch a Juno Rocket with Explorer 1(BDB) from the regular launch pad. I'm going to do more experiments to try and recreate the issue on different launchpads or with different rockets.

Usually this is due to "interference" of gimbals. So what you could try is: disable roll in the actuation toggles for all or most of the engines.

10 hours ago, JaviLL said:

Guys, is there a "full throttle" version of this mod? I'm playing on Realism Overhaul, an throttling down isn't an option. I tried writing a script in kOS, but believe me, the math part is VERY hard. I used an equation similar to y = sqrt(x), but this is very dependent of the rocket's TWR and staging timings.

Launch on default KSP isn't an issue, you get there quite quickly, but on Realism Overhaul, doing it over and over and over again gets tiring. I need to automate that!

Any ideas?

It's actually built in :): set the "sensitivity" to 1.0. Then it will never throttle down. But it won't pitch down if the time to AP get's too high. So you need to design your rockets accordingly.

Share on other sites

Is it possible to do two roll programs a-la the shuttle? Rolls onto its back once it's cleared its own height, and then rolls back from inverted not long after SRB sep?

e: Ahh, I see that I can just change the roll from 180 to 0 and it does it itself.

Wow. It actually launched my shuttle cleanly. This is really well made. KUDOS!

Edited by falken
Share on other sites

21 hours ago, JaviLL said:

Guys, is there a "full throttle" version of this mod? I'm playing on Realism Overhaul, an throttling down isn't an option. I tried writing a script in kOS, but believe me, the math part is VERY hard. I used an equation similar to y = sqrt(x), but this is very dependent of the rocket's TWR and staging timings.

Launch on default KSP isn't an issue, you get there quite quickly, but on Realism Overhaul, doing it over and over and over again gets tiring. I need to automate that!

Any ideas?

The new release of Mechjeb has PoweredExplicitGuidance for RO/RP0 in Ascent Guidance mode, with that you dont have to write your own script nor change GravityTurn. Its good and easy to use.

Share on other sites

On 2/16/2018 at 3:10 AM, AndyMt said:

Usually this is due to "interference" of gimbals. So what you could try is: disable roll in the actuation toggles for all or most of the engines.

Thanks:  I disabled the roll in the boosters and left it in the core stage.  This resulted in no more "waggle" but the rocket did want to keep rolling.  After the boosters were dumped the rocket went back to a waggle until the core stage was dumped and only the second stage was left.  Any ideas?
BTW:  thanks so much for the considerations!!!!

Share on other sites

5 hours ago, debaker02 said:

Thanks:  I disabled the roll in the boosters and left it in the core stage.  This resulted in no more "waggle" but the rocket did want to keep rolling.  After the boosters were dumped the rocket went back to a waggle until the core stage was dumped and only the second stage was left.  Any ideas?
BTW:  thanks so much for the considerations!!!!

Hm... maybe the other way around: disable roll on the core stage? Or: try to adjust the amount of gimbal you allow. As I see it the reaction time of the gimbals is too low for the amount GT wants to apply. Until the engines moved enough and back again, the impulse is already too high, so it overshoots.

I see this issue when using the "Vector" engine in stock. It's gimbals range  is extremely high, but it moves quite slow. So - I usually have to reduce gimbals range to about 30% for most launches. But all this is just good guessing...

Share on other sites

Cool, I will try a bunch of stuff like that

If I figure it out, I will post so others can learn.

Also, this almost happened on the real life LEM throttle.

Share on other sites

So i've been messing around with FMRS and reusable stages. In combination with this mod, you can get some pretty accurate and consistent missions. My only problem arrives with my heavy version of my lifter. (FH inspired) and the issue is the auto staging. To trick the program, you can lock the fuel flow so that it thinks its empty and stages when you really save some fuel for landing. This works when you have the rocket inline (Like FH core) and have no fuel lines, but when you do it with the side boosters it will not autostage. Boosters with locked fuel next to a burning core = no staging. Boosters with no locked fuel next to core = staging. Having fuel pumps feeding into the center does not affect the auto staging. But to repeat, the core, with locked fuel or no locked fuel = staging.
I could just press space manually like i have been doing so far but i decided to point this out as it may affect certain crafts for other players.

Oh and also this mod really doesn't like vector engines much. Lots and lots of overcorrection, even if the gimbal is turned down or off.

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.

×   Pasted as rich text.   Paste as plain text instead

Only 75 emoji are allowed.