Skip to content
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

feat(stacker): Add statusbar animation patterns + enable and handle stallguard #500

Merged
merged 16 commits into from
Jan 29, 2025

Conversation

vegano1
Copy link
Contributor

@vegano1 vegano1 commented Jan 27, 2025

Overview

Now that the Flex Stacker is in ABR and Science, let's enable stallguard and add UI led to some states to inform the user what's happening with the device. This pull request goes in conjunction with this monorepo pull request Opentrons/opentrons#17349

Changelog

  • Enable stallguard motor error (diag0_stall = 1) and set the stallguard threshold to 2 for all motor axis
  • Add debounce when handling GPIO interrupt messages
  • check estop and diag0 pin in the motor interrupt so we can react while moving an axis
  • change heartbeat led to blink after 500ms without setting the timer directly
  • add animation patterns (Static, Pulse, Flash, Confirm) and expose duration, reps to the SetStatusBarState gcodes
  • add the color yellow to the list of LED colors

Testing

  • Make sure we can set the led status bar pattern, duration, and reps via repl
  • Make sure the flex stacker motors stop moving when there is a stall
  • Make sure the flex stacker motors stop moving when the estop is pressed
  • Make sure we only send an error message when triggering estop or stall

Review requests

Copy link
Member

@sfoster1 sfoster1 left a comment

Choose a reason for hiding this comment

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

Looks good to me, though that's a pretty fast timer

default:
return white_channels;
}
}

// The timer driving LED update frequency should run at this period
static constexpr uint32_t UPDATE_PERIOD_MS = 1000;
static constexpr uint32_t UPDATE_PERIOD_MS = 1;
Copy link
Member

Choose a reason for hiding this comment

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

that seems like quite a lot, it's the same frequency as the systick. can we make it 10 or something?

auto visit_message(const messages::UpdateUIMessage& m, Policy& policy)
-> void {
static constexpr double TWO = 2.0F;
for (auto bar_id : {StatusBarID::Internal, StatusBarID::External}) {
Copy link
Member

Choose a reason for hiding this comment

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

ooh fancy i love it

@vegano1 vegano1 merged commit 3f5f0b6 into edge Jan 29, 2025
12 of 13 checks passed
@vegano1 vegano1 deleted the flex-stacker-expand-set-statusbar branch January 29, 2025 15:46
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