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(flex-stacker): stream motor driver stall guard value during move #468

Open
wants to merge 10 commits into
base: edge
Choose a base branch
from

Conversation

ahiuchingau
Copy link
Contributor

@ahiuchingau ahiuchingau commented Oct 4, 2024

This PR creates a freertos task that handles the streaming of the stall guard value if requested in the move. The stall guard result from the motor driver will be reported via a M900 message every 10 ms while the motor is in motion.

Any concerns regarding how the freertos task is created/executed?

@ahiuchingau ahiuchingau force-pushed the PLAT-489-stream-motor-driver-stall-guard-value branch from b68fc85 to 5b80425 Compare October 7, 2024 20:06
Copy link
Contributor

@vegano1 vegano1 left a comment

Choose a reason for hiding this comment

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

Thank you for setting this up and I'm glad it's working!

A few comments

  1. It could get hard to manage multiple tasks from the same module, usually, we have one task per module. So if we want to go the new task route it would make sense to pull the run_stallguard_task into its own file that follows the motor_task.hpp and motor_driver_task.hpp framework.

  2. Alternatively, instead of creating a new task, we could also use the freertos_timer.hpp to set up a timer from the motor_driver_task that calls read_stallguard and sends the result over USB. We use the timer with the Hepa/UV in the ot3-firmware repo, you can find that here.

@vegano1 vegano1 self-requested a review October 8, 2024 18:10
@ahiuchingau ahiuchingau force-pushed the PLAT-489-stream-motor-driver-stall-guard-value branch from cb3bed8 to 5b80425 Compare October 8, 2024 21:14
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.

10ms feels pretty fast for a text-mode UART but hey the math says it works so we good

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.

3 participants