Skip to content

Adding new FSM config value for apogee timer (Issue #223) - #227

Merged
mpark108 merged 7 commits into
mainfrom
bugfix/adding-fsm-config-apog-timer
Oct 24, 2026
Merged

mpark108 merged 7 commits into
mainfrom
bugfix/adding-fsm-config-apog-timer

Conversation

@MelodyParker

Copy link
Copy Markdown
Contributor

I've resolved the issue that came to @mpkarpov-ui in a dream, and added an additional user config FSM value for a timer that must pass before the FSM can transition from COAST to DROGUE, to eliminate the possibility for an early transition, even if not accompanied with a pyro at that same time (because that is a separately configurable setting).

@github-actions

github-actions Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

FSM SILSIM: 6/6 passed ✓ — plots

@EDED2314 EDED2314 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is any other component affected by this? CRC?

thoughts on another name for apog_detect_time_passed?

@MelodyParker

Copy link
Copy Markdown
Contributor Author

The CRC stuff is calculated based on the full sizeof the struct (because Michael is intelligent), so this shouldn't cause an issue. I agree on the naming thing; any thoughts, @mpkarpov-ui?

mpkarpov-ui
mpkarpov-ui previously approved these changes Oct 23, 2026

@mpkarpov-ui mpkarpov-ui left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would be really nice to somehow exercise this in fsm silsim at one point but I can't come up with off the top of my head how.

otherwise lgtm, I'll sleep better with this in :)

* Peter Giannetos
* Aaditya Voruganti
* Micheal Karpov
* Michael Karpov

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LMAO

Comment thread MIDAS/src/finite-state-machines/fsm.cpp Outdated
// Note: This evaluates to TRUE (no lockout) if the lockout is disabled, OR if the condition is met

if (apog_detect_low_speed && apog_detect_cruise_lockout) {
// Condition 3: Enough time has passed since launched

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

super nit: maybe "time passed since launch"? instead of "launched"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch

Comment thread MIDAS/src/finite-state-machines/fsm.cpp Outdated

if (apog_detect_low_speed && apog_detect_cruise_lockout) {
// Condition 3: Enough time has passed since launched
bool apog_detect_time_passed = ((current_time - launch_time) >= config.thresholds.apog_launch_t_gt);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

re the naming comments: the telemega calls this "mach lockout", if we want to be more accurate/verbose could call it "apog_minimum_flight_time_met", or to follow telemega could do "apog_mach_lockout_expired"

Don't have a super strong opinion on it

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good ideas

@mpkarpov-ui

Copy link
Copy Markdown
Contributor

also rebase to pick up the cam ci changes <3

tjmcmanamen38
tjmcmanamen38 previously approved these changes Oct 23, 2026

@tjmcmanamen38 tjmcmanamen38 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall, agreed with michaels comments on the naming though I think something different could be good.

Also whats the rationale behind the values in the test cases? really the only one I would personally see the need to set it is aether offnom boo. generally shouldn't be needed for single stages / sustainers

@tjmcmanamen38

tjmcmanamen38 commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

would like to see a hitl run testing this feature or some other verification but okay to merge prior to that

(i.e. set the lockout greater than the expected time to apogee and see that it changes the behavior, etc.)

@mpark108
mpark108 force-pushed the bugfix/adding-fsm-config-apog-timer branch from bb258d0 to c97f49f Compare October 23, 2026 16:32
@mpark108

Copy link
Copy Markdown
Contributor

would be really nice to somehow exercise this in fsm silsim at one point but I can't come up with off the top of my head how.

I did try setting a timer past where drogue should happen for a couple of the tests, and it waited until that timer had passed to actually transition, so it seems to work as it should.

@mpark108

Copy link
Copy Markdown
Contributor

Also whats the rationale behind the values in the test cases? really the only one I would personally see the need to set it is aether offnom boo. generally shouldn't be needed for single stages / sustainers

You're not wrong; I've changed it to just be that one

@tjmcmanamen38 tjmcmanamen38 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@mpkarpov-ui

mpkarpov-ui commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

I did try setting a timer past where drogue should happen for a couple of the tests, and it waited until that timer had passed to actually transition, so it seems to work as it should.

good enough for initial verification IMO.

@mpark108
mpark108 merged commit bb55566 into main Oct 24, 2026
8 checks passed
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.

5 participants