Noiredd / PEGAS

Powered Explicit Guidance Ascent System - a KSP & RO autopilot using the Space Shuttle guidance algorithm, UPFG
http://forum.kerbalspaceprogram.com/index.php?/topic/142213-pegas-powered-explicit-guidance-ascent-system-devlog
MIT License
114 stars 31 forks source link

Support for hotstaging #42

Closed VoreckLukas closed 2 years ago

VoreckLukas commented 2 years ago

So for ullage, you can choose none, srb and rcs. But a hotstaging option where it presses spacebar a bit before the staging event to ignite the engine and then again at the staging event to jettison the previous stage would be nice

Noiredd commented 2 years ago

Thanks for the suggestion.

Just to clearly understand what you'd like to achieve. While stage N is still burning, you'd want to hit spacebar a few seconds before it burns out, and then activate stage N+1 using a jettison-only sequence, since its engine is still running - correct?
If so, this might be a little tricky to implement, because staging events are tied to burn-out times of each stage. I'm currently reworking the event handler routine however, so I'll give this some consideration (another reason to decouple event handling from the staging sequence).

Noiredd commented 2 years ago

I've got an experimental solution working: check out d085c66.

This adds a new ullage mode, "hot", which simply causes jettison and ignition to swap places. I've tested it with one vehicle and it seems to be working, but would be cool if someone confirmed it in their use case - @Voreck do you think you could?

I can see one place where this could go wrong: if the preceding stage burns out faster than it should, and there's no thrust anymore when the staging sequence starts. It would be relatively straightforward to correct on the vehicle side: simply reduce massFuel by a bit to convince PEGAS that the stage should burn out a little earlier. To fix this "properly" on PEGAS side, I'd have to implement some sort of negative delay on a hot-ignited stage, and a look-ahead to deal with such stages. Arguably more hassle than making just a little tweak in vehicle.

EDIT: I'll close this for now. If there are any problems with this, please reopen/comment and we'll have a look.

VoreckLukas commented 2 years ago

Thanks for the suggestion.

Just to clearly understand what you'd like to achieve. While stage N is still burning, you'd want to hit spacebar a few seconds before it burns out, and then activate stage N+1 using a jettison-only sequence, since its engine is still running - correct? If so, this might be a little tricky to implement, because staging events are tied to burn-out times of each stage. I'm currently reworking the event handler routine however, so I'll give this some consideration (another reason to decouple event handling from the staging sequence).

Sorry, havent looked in here for a while

I've got an experimental solution working: check out d085c66.

This adds a new ullage mode, "hot", which simply causes jettison and ignition to swap places. I've tested it with one vehicle and it seems to be working, but would be cool if someone confirmed it in their use case - @Voreck do you think you could?

I can see one place where this could go wrong: if the preceding stage burns out faster than it should, and there's no thrust anymore when the staging sequence starts. It would be relatively straightforward to correct on the vehicle side: simply reduce massFuel by a bit to convince PEGAS that the stage should burn out a little earlier. To fix this "properly" on PEGAS side, I'd have to implement some sort of negative delay on a hot-ignited stage, and a look-ahead to deal with such stages. Arguably more hassle than making just a little tweak in vehicle.

EDIT: I'll close this for now. If there are any problems with this, please reopen/comment and we'll have a look.

Thank you for doing this, I actually didn't expect this project to be alive. I'll try it out once I can

Noiredd commented 2 years ago

Yeah, sorry about the long delay but that's how it is with this project... half a year passes as I have zero free time to even touch it, and then suddenly find myself on a week long coding spree sorting out issues backlogged years ago. This time I want to get them all done, put a "v1.3" tag on it, release and call it finished.