Jump to content

spaceplane ascent -- what do you do once the rockets are on?


Recommended Posts

Writing a kOS script for spaceplane ascent, I don't quite know what to do once I switched to rockets.

Initial ascent is quite straightforward: stick to a certain percentage or terminal velocity, adjust climb so you stay near that percentage while going full throttle. 60% seems to be a good starting point for vessels of all sizes.

Gaining speed is simple, too: just stick to a certain climb rate during the last few minutes before you have to switch.

But then? Climb again, of course; about 25° at first seems to be best (might that be the maximum angle of attack for wings, perhaps?). One should slowly turn towards the horizon at about 40km and reach level flight by something like 45-50km. Both figures may vary by quite a bit, depending on -- what? I don't know. I'm currently using Time To Apoapsis as a proxy (or rather, it's rate of change), but while it gives better results than anything else I tried so far, it's not exactly good.

What do you do? How do you tell that it's time to get out of the climb, and how quickly?

Link to comment
Share on other sites

I couldn't describe how to do this is kOS but, there's basically four variables I'm using to manually optimise my ascent profile with SSTOs:

  • Vertical acceleration delta
  • Horizontal acceleration delta
  • Intake air to turbo throttle ratio
  • Thrust to drag ratio

Up to the critical air intake to engine ratio I'm looking to maximise my vertical delta. Then, I'm basically looking to maximise my horizontal delta. Thrust to weight ratio will decide what my delta thresholds are prior to switching to rockets.

Some simple rules:

  • Vertical delta should not go above 5m/s/s after 15km
  • Vertical delta should never be negative if vertical is not positive
  • Vertical delta should not go less than negative 5m/s/s at any time
  • Thrust to drag must not drop below certain value*

*This last one is subjective and I don't have any research invested in what those numbers are. It's more like a guess from experience than something I've quantified. Basically, I'm looking for a value which can best be described as the thrust to drag ratio.

There would be another layer of rules where you would need to power down at your air intake threshold and then engage rockets once thrust to drag drops below a certain level. You would also need to moderate AoA to keep your vertical acceleration constant by measuring the vertical delta to intake ratio. Also, the moment you turn off your turbos and go for full rocket would be when vertical delta and horizontal delta go negative.

It might be interesting to get into kOS at some point to see if I can get SSTOs up more efficiently than by hand. I'm confident you could get an efficient ascent profile using these four base variables.

Link to comment
Share on other sites

I couldn't describe how to do this is kOS but, there's basically four variables I'm using to manually optimise my ascent profile with SSTOs:

  • Vertical acceleration delta
  • Horizontal acceleration delta
  • Intake air to turbo throttle ratio
  • Thrust to drag ratio

Basically, it goes like this:

  1. if fast enough: pitch +1
  2. if too slow: pitch -1
  3. if climb rate too low: pitch +1
  4. wait a moment
  5. repeat until air gets too thin.

The desired airspeed is defined as a percentage of terminal velocity (isn't that another name for thrust-to-drag?). So I'm climbing at 60% termvelocity at first, later the script switches the desired speed to some unachievable figure, effectively bringing the plane down to the pre-set climb rate. Actual code is a little more elaborate, of course, but that's the gist of it. It really is that simple. Btw, you should try climbing a little faster than 5m/s -- each and every of my vessels can maintain at least 15m/s, often more, without sacrificing airspeed.

As I said, this is the easy part. But I don't know what to do next. I hope that there might be a set of rules for rocket-powered ascent that are as simple as the ones above.

Link to comment
Share on other sites

The angle of thrust isn't that important when you get up to about 35km. If you got that high using a 10% glide slope with jet engines then switch to rockets and use the same glide slope until apoapsis reaches 100km or however high it needs to be. As long as you can get that high to begin with it is not complicated.

Link to comment
Share on other sites

The desired airspeed is defined as a percentage of terminal velocity (isn't that another name for thrust-to-drag?).

That might make a good proxy. At high altitudes thrust to weight ratio is not as important as the amount of drag you have to overcome, which is related in KSP to weight. I don't know if you can get this information with kOS. I'd imagine there are some good estimate proxies for it though.

Actual code is a little more elaborate, of course

Yep. I'd imagine code to get an SSTO into orbit would be quite complex given the range of ascents you can take given different engine configurations.

Btw, you should try climbing a little faster than 5m/s -- each and every of my vessels can maintain at least 15m/s, often more, without sacrificing airspeed.

I'm talking about acceleration(m/s/s). While velocity is important, I think you will ultimately need to be tracking your ascent profile using deltas rather than basic velocity numbers. Velocity is important but, you will need to assess AoA against what deltas you achieve from those angles at given altitudes. That's going to give you a better understanding of how the plane is performing.

Link to comment
Share on other sites

Yep. I'd imagine code to get an SSTO into orbit would be quite complex given the range of ascents you can take given different engine configurations.

That part is actually rather easy, a block of "when altitude > x then {set climbrate to foo}" statements. Or "when intakeair > 0.02" -- you get the drift. But getting to a new climbrate quickly but without overshooting by a mile? That's what makes the code complex & convoluted.

I'm talking about acceleration(m/s/s). While velocity is important, I think you will ultimately need to be tracking your ascent profile using deltas rather than basic velocity numbers. Velocity is important but, you will need to assess AoA against what deltas you achieve from those angles at given altitudes. That's going to give you a better understanding of how the plane is performing.

Imo, there's no point in making it so complicated. Find out a) what climbrate still works and B) when you need to turn from speed-constrained to climb-constrained flight; that will get you to within 1% of the ideal. Deltas are quite important when you want to dampen the oscillation after a turn, though.

Link to comment
Share on other sites

I am used to reaching orbital speeds in atmosphere with jet engine (35 km altitude is optimal for that), then just coasting to apoapsis and only using rocket engine when safely in orbit. It takes longer but it also saves fuel.

I think I should also point out that with a correctly built plane you want to spend a lot of jet burning time with intake air at zero. Even when starved on air, jets have much better thrust at full throttle than at reduced throttle with the same air.

xsoSSdJ.png
Edited by Kasuha
Link to comment
Share on other sites

Spaceplanes vary so much in ascent profile. Some will punch an AP well over 70Km so you only need rockets to circularise. At the other end of the spectrum, the ascent profile may look more like a jet assisted rocket profile (like they all did pre v18). So making a general purpose kOS program may be quite a challenge.

Anyhows... I have done a full K-prize run with landing back on the runway fully under kOS control. But the program was written for a particular spaceplane. I will PM you some material. Including a very detailed document that describes the solutions in the program.

Link to comment
Share on other sites

As to my original question: "climb until the air gets thinner, then resume gravity turn" is obviously drag related. Should have been obvious before I even asked. I based the end condition terminal velocity and immediately saved 10% oxidizer compared to my previous best run.

But thruth be told, I have no idea whether I'm actually doing the right thing. The figure I plugged in was pulled from the top of my head.

Spaceplanes vary so much in ascent profile. Some will punch an AP well over 70Km so you only need rockets to circularise. At the other end of the spectrum, the ascent profile may look more like a jet assisted rocket profile (like they all did pre v18). So making a general purpose kOS program may be quite a challenge.

Depends on what you mean by general purpose. You certainly need to configure the action groups, there's no way around that. Though in most cases, that amounts to "when intakeair < 0.02 then toggle agX". Other than that, my script needs to be told when to turn from climbing to speed-building; given that data, it will make a decent ascent with any craft. However, getting from "decent" to "really good" requires so many breakpoints that one could as well write a targeted script.

Link to comment
Share on other sites

Though in most cases, that amounts to "when intakeair < 0.02 then toggle agX".

Intake air level is "surplus", if you have some it means your engines don't consume as much as your intakes collect. But your engines are able to run and produce thrust long after your intakes no longer collect that much air and your intake air level is zero. If you start reducing jet engine power with intake air still positive, you're wasting power you still have available.

Other than that, my script needs to be told when to turn from climbing to speed-building; given that data, it will make a decent ascent with any craft. However, getting from "decent" to "really good" requires so many breakpoints that one could as well write a targeted script.

For each ratio of intakes to jets, for each throttle setting and for each altitude there's certain minimum speed below which you will flameout. You can't simply switch from ascent to speed building, you need to build up your speed as you ascend. Preferably at the highest throttle possible while staying at maximum altitude your speed allows.

Link to comment
Share on other sites

Intake air level is "surplus", if you have some it means your engines don't consume as much as your intakes collect. But your engines are able to run and produce thrust long after your intakes no longer collect that much air and your intake air level is zero. If you start reducing jet engine power with intake air still positive, you're wasting power you still have available.

I already wanted to ask you after you said that the first time: how do you do it? I can starve my engines by a little, but not much, before I get flameouts. Intake air remains well above zero almost all the time. It only plummets briefly when an engine gives up; the 0.02 threshold is high enough to catch that when it happens, but before and after the event, intake air reads much higher.

(The mechjeb counters of intake air needed/available are much more precise, but in kOS you're stuck with the figures from the resource tab.)

For each ratio of intakes to jets, for each throttle setting and for each altitude there's certain minimum speed below which you will flameout. You can't simply switch from ascent to speed building, you need to build up your speed as you ascend. Preferably at the highest throttle possible while staying at maximum altitude your speed allows.

Yeah, but "maintain certain airspeed(1) when possible, otherwise climb at least at a given rate" approximates this surprisingly well.

(1) "Airspeed" as a fraction of terminal velocity, in case I didn't say this often enough already.

Link to comment
Share on other sites

I already wanted to ask you after you said that the first time: how do you do it? I can starve my engines by a little, but not much, before I get flameouts. Intake air remains well above zero almost all the time. It only plummets briefly when an engine gives up; the 0.02 threshold is high enough to catch that when it happens, but before and after the event, intake air reads much higher.

The devil is in how game distributes intake air. Some clues can be found in the Intake Air "chapter" in this thread.

In general, you need to mount your intakes and engines evenly. Use only one jet engine type and have exactly the same amount/types of intakes for each engine and mount them one by one.

For example you decide to use turbojets and to have two RAM intakes and one radial intake per engine. Go to SPH and strip the plane off all its engines and intakes. Then place two RAMs and one radial intake, then first engine. Another two RAMs and one radial and second engine. And so on till you place all intakes and all engines one by one in exactly the same order (it is irrelevant where on the plane you put them, just the order is important).

Note also that all intakes need to be oriented the same way, each group placed before each engine must always produce the same amount of air.

This way, when you run out of intake air, then still each of your engines will get air from two RAM intakes and one radial intake. Only when they fail to provide enough air to keep the engine running at all, the engine will flameout and the next engine will get double the amount of air. If you have four engines and mount them in order outer left-inner right-outer right-inner left, then one engine on the left and one engine on the right will flameout at once in such situation, suggesting that you need to throttle down. With just two engines you will get asymmetric flameout but after running on zero air for a while and at already reduced thrust.

While looking for the thread linked above I also found this thread. I guess you might find it useful as well.

Link to comment
Share on other sites

[...] Then place two RAMs and one radial intake, then first engine. Another two RAMs and one radial and second engine. And so on [...]

If I get this right, symmetry will be punished.

But then again, if I really want to play the game like this I have noone to blame but myself.

Edited by Laie
ftfm.
Link to comment
Share on other sites

Writing a kOS script for spaceplane ascent, I don't quite know what to do once I switched to rockets.

Initial ascent is quite straightforward: stick to a certain percentage or terminal velocity, adjust climb so you stay near that percentage while going full throttle. 60% seems to be a good starting point for vessels of all sizes.

Gaining speed is simple, too: just stick to a certain climb rate during the last few minutes before you have to switch.

But then? Climb again, of course; about 25° at first seems to be best (might that be the maximum angle of attack for wings, perhaps?). One should slowly turn towards the horizon at about 40km and reach level flight by something like 45-50km. Both figures may vary by quite a bit, depending on -- what? I don't know. I'm currently using Time To Apoapsis as a proxy (or rather, it's rate of change), but while it gives better results than anything else I tried so far, it's not exactly good.

What do you do? How do you tell that it's time to get out of the climb, and how quickly?

Just a quick question: Are you using FAR?

I'm not sure if the answers given here assume you're using FAR or not, but I didn't see it mentioned.

Anyway, it seems that the flight characteristics of the particular SSTO you're writing the program for should be determine the program's parameters and decision rules, in addition to using mods.

Every vessel is going to fly differently. Most rockets can be roughly generalized, but in my limited experience with SSTOs (I've made exactly one that I thought was worth flying more than once), they are way more individual.

The point being: With the SSTO you're building, what are the general guidelines you use for flying it without kOS?

Link to comment
Share on other sites

I found that with SSTO with maximum possible payload its absolutely essential to get as much ISP of jet engines as possible. 0.24.5 makes it much easier, because jet engine will automatically throttle down if intake air goes low - it only creates problems when several jet engines throttle down asymmetrically due to subtle intake differences. It solved quite easy, either by having enough vectored control authority, or by leaving just one center-placed jet engine running and gradually switching rest off (in pairs), this allows to get this extra high-ISP jet thrust up to 40+km before full flameout (or thrust becoming too low to be useful).

Shallowest ascent angle found quite easy, by monitoring TtA, and making sure that it stays approx. constant, say, in 1-2 min range.

Edited by RidingTheFlow
Link to comment
Share on other sites

The devil is in how game distributes intake air. Some clues can be found in the Intake Air "chapter" in this thread.

In general, you need to mount your intakes and engines evenly. Use only one jet engine type and have exactly the same amount/types of intakes for each engine and mount them one by one.

Building planes like that is a PITA, but following these rules I find that 2 intakes/engine will invariably last me well beyond 30km. *Every* such plane was able to reach orbital speeds in the atmosphere. The first flameout happens when airflow (according to mechjeb) drops below 10% of your needs.

Until now, that is. For my heavyweight of 24 jets, I first created a 4-to-2 nacelle (using 2-1 placement), then cloned this all over the plane. Within each nacelle, one engine was starving while the other was going strong, with flameouts at 50% -- that pattern was still symmetric, so I suspect that I may just switch off every other engine (and may well end up with exactly the same thrust). Won't get to try that until tomorrow, though.

BTW: kOS reports intakeair in the same figures as you see in the resource tab, but with many more significant digits. Whatever that figure actually means, it isn't "surplus". It only ever reaches zero when you leave the atmosphere. With a single ramjet at high altitudes, setting the throttle to (intake_air * 130) works quite well, except when it doesn't. It drives me mad.

Shallowest ascent angle found quite easy, by monitoring TtA, and making sure that it stays approx. constant, say, in 1-2 min range.

Tell that to a computer and you will get a shallow ascent indeed, making several orbits inside the atmosphere while spiralling outward ever so slowly. Running on the last jet, it didn't run out of fuel and actually made it to space... after like 40 minutes or so. I now supplement TtA by enforcing a minimum climb rate (required climb rate tapers off the higher you get, basically a 1/x function).

Say, is it possible that there is a best ascent path? In real life, you've got drag here and gravity there and need to consider a tradeoff. But with the current mass-based drag model, I wonder if the mass on both sides of the equation might be struck out, leaving you with a single solution.

Link to comment
Share on other sites

Imo, there's no point in making it so complicated. Find out a) what climbrate still works and B) when you need to turn from speed-constrained to climb-constrained flight; that will get you to within 1% of the ideal. Deltas are quite important when you want to dampen the oscillation after a turn, though.

The problem with using raw velocity numbers is that you cannot "read" your aerodynamic performance. You will always be reacting to your current situation rather than anticipating and controlling the ascent. So, unless you want to assign paramaters for each craft(see points a and B) you are going to have to figure out the performance characteristics on the fly. Here's a good example of a common issue:

If you are in a high lift to control surface plane and use a shallow AoA at the beginning of your ascent then, as you get faster in the dense atmosphere your aerodynamics will push your craft flat to the horizon. Whereas, if you aggressively keep you AoA high from the outset your climb rate may be a bit lower at first but, you will soon get higher climb rate and much, much more efficient ascent with full control over your AoA by keeping horizontal velocity low enough for your control surfaces to keep your vertical acceleration high.

This situation exists on most of my craft and players have reported not being able to get above 20km.

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