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

Implement serial control of velocity and throttle #39

Merged
merged 3 commits into from
May 30, 2024

Conversation

samderanova
Copy link
Contributor

@samderanova samderanova commented May 30, 2024

As part of #37, allow continually outputting the PDM waveform with the last known parameters rather than just a single period. Using multicore functionality, a separate core monitors the serial input and updates the LIM control message through a mutex lock. We still need to implement expiration time for safety reasons.

Changes

  • Create a global variable to store the velocity and throttle
    • Add a mutex to prevent concurrent access to it
  • Utilize Raspberry Pi Pico's second core to run a function to read input and update the global variable

@samderanova samderanova requested a review from taesungh May 30, 2024 05:55
@samderanova samderanova linked an issue May 30, 2024 that may be closed by this pull request
Copy link
Member

@taesungh taesungh left a comment

Choose a reason for hiding this comment

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

Good checkpoint for now, nice to see we can sustain the parameters for continual output and update them on the fly. Will still need to implement the expiration time.

Copy link
Member

@taesungh taesungh 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, maybe in the future we could also consider implementing our own coupled Mutex to avoid having the data and the lock separate.

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