Skip to content

PSG: cut a burn before a coast or a fixed stack on its planned angular momentum, not only on the clock - #2781

Closed
sarbian wants to merge 1 commit into
devfrom
fix/psg-cut-on-energy
Closed

sarbian wants to merge 1 commit into
devfrom
fix/psg-cut-on-energy

Conversation

@sarbian

@sarbian sarbian commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

AscentStateMachine cut the burn before a coast (CoastDue) and a burn dropped before a fixed upper stack (JettisonDue) at their planned end MET. A burn behind its plan was cut with propellant it still needed, and PSGSimulation pauses solving for the last PreStageTime (10 s) of a phase, so no re-solve could move the end. A late fixed booster also let JETTISON stage straight through the cut stage above it.

Both cuts now wait for the angular momentum at the next tick to reach the plan's at that time (within 1e-5, the rule of the closed #2747), and JETTISON cuts only in the burn's own KSP stage. A burn on or ahead of its plan is cut on the clock as before.

Adds the F6 cases of ReviewRegressionTests (they failed on dev ef54081).

Not tested: compiled only (MechJebLibTest Release, or MechJeb2.sln Debug). No unit test or flight was run on this branch.

From the review of #2776 and #2777: #2776 (comment)

…lanned end and its planned angular momentum

AscentStateMachine cut the burn before a coast (CoastDue) and a burn dropped before a fixed upper stack (JettisonDue) at their planned end MET, whatever the vessel had reached. A burn behind its plan (an engine short of thrust, a booster below it that burned late) was cut with propellant it still needed, and PSGSimulation pauses solving for the last PreStageTime of a phase, so no re-solve could move the end. A late fixed booster also let JETTISON stage through the cut stage above it, down to dropping it unlit.

Both cuts now wait for the vessel's angular momentum at the next tick to reach the plan's at that time (within 1e-5, the rule of #2747), and JETTISON only cuts in the burn's own KSP stage. A burn on or ahead of its plan is cut on the clock as before; one behind burns on until it gets there or is spent.

Tests: ReviewRegressionTests (F6 cases), failing on dev ef54081.
@lamont-granquist

Copy link
Copy Markdown
Collaborator

yeah, i don't want to do this one yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants