-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor initializeVehicleForUPFG to fix bugs related to virtual stages #50
base: master
Are you sure you want to change the base?
Conversation
Perfect, I'll run some tests with my oddball launchers, hopefully tomorrow ;) |
Btw, about the throttle blip you mentioned - I've noticed this too, and it's still present here. I'll look into it, hopefully fix it in another commit under this PR. For now let's make sure the core change works well :) |
So, sadly it took a week, but I have some results! But here is the next oddity: |
Just so I understand correctly: you have a |
Correct, yes.
For Seeotter-I 2145:
Booster separation ( At first I thought it might be connected to the procedural fairing being a deprecated part after a mod update but both rockets use it and changing to a non deprecated fairing did nothing. |
Sadly, I am unable to reproduce this issue. I took the same vehicle I used to reproduce the gLim issue, attached a pair of GEM-60s to it (via Booster Mounting Kits, no idea if that's a vanilla part or from some mod) and changed the config to exactly what you posted above. It flew perfectly well. If this happens consistently, here's what I'd recommend you do.
Run a bug-afflicted mission and send all the debug files here; best would be to attach them to the post rather than pasting the content directly (they might get large). |
I'm sorry it took a while, sadly life got in the way again. But I finally managed to do the logging: At first glance I'm not getting much out of it. At t+145 there are two events, the first is the attempted jettison and the second I presume is UPFG accounting for the mass lost during staging. Hence No idea if this actually means anything, the
At t+170.07 the logs end with what PEGAS thinks is staging in the upper stage but in reality is fairing jettison. Supposed starting of the engine is the actual staging event and then obviously thrustWatchdog terminates the launch, as it looks like an engine failure. |
Thanks for following up on this with detailed logs. I have to admit I'm baffled. Looking at the I'd like you to confirm one other thing for me. If you fly this vehicle manually, does one hit of the spacebar stage the fairing? One way to make sure would be to launch it as normal, but then try to stage manually around T+130 (after const-acc mode trigger). Crucial question is: will it drop in one go, or will you have to hit again? One common reason for What happens afterwards (the subsequent |
Ok, so this is getting weirder... Simply sitting on the launch pad, having the fairings as the only thing in the first stage (the Staging Stack that is) and no PEGAS running, they simply detach in both variants (0145 and 2145) when pressing the space bar. As they should. And the logs of course: I'm still going to test the "removed boosters" variant with the proper 0145 boot script, as the 2145 simply pitches too early and aggressively for no boosters, almost immediately plunging into the Atlantic. |
Sorry for getting back to it so late, real life interfered. Your issue does seem to be caused by your vehicle config and/or mods. PEGAS does everything right - it's your vehicle that responds erroneously to a correct command. I'd love to help you with troubleshooting that, but sadly I've got enough debugging on my own plate right now. Thank you very much for stress-testing this PR so hard though. Following your problem really helped ensure this is "production" ready. I'll merge as soon as I finish updating my install to 1.12.5 and kOS v1.14 and giving it a few extra test runs on my standard vehicles. |
Hey, I'm sorry I also took so long to answer, same issue here... Yes, I agree, this problem has nothing to do with PEGAS. Somehow the boosters mess up the staging. Maybe the integrated stack separators and parachutes have something to do with it, although it worked before and now doesn't... well, anyway this seems to be a problem of another mod. No worries with helping me on this, I sadly rarely get to play KSP right now. Hopefully I'll have more time in the coming months/year. And I'm glad I could help in my limited capacity. I can't imagine launching any somewhat realistic rocket without PEGAS anymore and the more robust the code, the better ;) |
The vehicle definition (
vehicle
) is a static, user-input data structure unrelated tosequence
, in which the user defines launch sequence events. In order to provide UPFG with complete information on the vehicle, changes that sequence events might introduce to the vehicle definition (such as an engine shutdown) must be accounted for. The old approach to updatingvehicle
was to iterate oversequence
, check which stage will be running when an event is encountered, and split that stage into its version prior to the event, and a new "virtual" stage describing the vehicle status after it. Finally, acceleration limits would be accounted for after all thesequence
-related changes.This was a problem for several reasons that are discussed in detail in #47.
This PR replaces the old algorithm with a proper vehicle-centric approach. The new approach is to:
Additionally, in order to definitively catch all sequence bugs (like an event that just happens to end up between two stages, and thus escape the initialization routine), a small routine was added that goes over the sequence once more after the entire process, and checks whether some events were missed. All vehicle-altering events that
initializeVehicleForUPFG
takes into account are marked as "processed"; if some event did not receive that mark, it is a sign of trouble and the user will be messaged about it, and relevant data will be dumped to a file to allow analysis.I've taken the new code for a few spins and it seems solid. @theLXMB if you want to try this yourself and tell me if it works for you or breaks under some scenarios, I'd greatly appreciate it.
Closes #47