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

Create inverter board abstraction to send velocity and throttle to Raspberry Pi Pico #83

Merged
merged 2 commits into from
May 29, 2024

Conversation

samderanova
Copy link
Contributor

@samderanova samderanova commented May 27, 2024

Resolves #35.

Changes

  • Add new InverterBoard struct
  • Write send_control method to send a velocity and throttle to a Raspberry Pi Pico via UART serial communication over /dev/ttyACM0 (i.e. a USB Type A port on the Raspberry Pi)
  • Include demo function that sends a velocity of 0 and a throttle of 1 to a Pico every second

Testing

  1. Plug a Pico into a Raspberry Pi
  2. Build hx9-control/pod-operation with cargo build --release, ensuring that it is being compiled to the aarch64 (Raspberry Pi) architecture
  3. Copy the executable located in target/aarch64-unknown-linux-gnu/release/pod-operation to the Raspberry Pi
  4. Run the pod-operation executable and observe the waveform on the oscilloscope or connect an LED to the pin outputting the waveform and observe it blinking

@samderanova samderanova requested a review from taesungh May 27, 2024 22:14
@samderanova samderanova linked an issue May 27, 2024 that may be closed by this pull request
@samderanova samderanova marked this pull request as ready for review May 27, 2024 22:14
@samderanova samderanova force-pushed the feature/inverter-board-abstraction branch from 7c6f831 to 15cf281 Compare May 27, 2024 22:16
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 functionally as verified in lab; minor organizational notes.

pod-operation/src/components/inverter_board.rs Outdated Show resolved Hide resolved
pod-operation/src/components/inverter_board.rs Outdated Show resolved Hide resolved
pod-operation/src/components/inverter_board.rs Outdated Show resolved Hide resolved
- Extract arguments to Uart::with_path to constants
- Simplify send_control to use format! rather than string concatenation
@samderanova samderanova force-pushed the feature/inverter-board-abstraction branch from 32af343 to ebecb6a Compare May 29, 2024 07:12
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.

Still unsure if we're having a single or multiple Picos, but works for now.

@ryescholin ryescholin self-requested a review May 29, 2024 07:46
Copy link
Member

@ryescholin ryescholin left a comment

Choose a reason for hiding this comment

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

Looks great, does this need any functionality in FSM?

@samderanova
Copy link
Contributor Author

Looks great, does this need any functionality in FSM?

Eventually, yes. We'll want to be able to control velocity and throttle from the FSM. In the meantime, though, @taesungh and I will be working on inverter-control#37 to improve the communication between the Pi and Pico(s).

@samderanova samderanova merged commit eadf30a into main May 29, 2024
2 checks passed
@taesungh taesungh deleted the feature/inverter-board-abstraction branch June 1, 2024 12:28
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.

[Pod] Create abstraction for driving inverter board
3 participants