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

Full Resolution Wheel Encoder #72

Merged
merged 28 commits into from
May 31, 2024

Conversation

SM-dot
Copy link
Contributor

@SM-dot SM-dot commented May 25, 2024

A discussed in #58, this utilizes a more accurate approach to calculate distance and velocity. In case of under sampling, indicates an error to transition in the Faulted State for the FSM.

Changes

  • Upgrade to RPPAL v0.18.0 for using InputPin with Raspberry Pi 5
  • Create enums for EncoderState and EncoderDiff with numeric traits derived from num_enum
  • Encode two pins of wheel encoder as 2-bit gray code to track full 16-count resolution
  • Calculate velocity on all increments rather than on interval
  • Handle undersampling by returning an Err

@SM-dot SM-dot linked an issue May 25, 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.

Rather than having a separate copy, we'll want to modify the existing implementation in wheel_encoder.rs

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.

Some notes about implementation, I've already looked into addressing most of them. Noticed in testing we'll also need to update the version of RPPAL.

pod-operation/src/components/wheel_encoder.rs Outdated Show resolved Hide resolved
pod-operation/src/components/wheel_encoder.rs Outdated Show resolved Hide resolved
pod-operation/src/components/wheel_encoder.rs Outdated Show resolved Hide resolved
pod-operation/src/components/wheel_encoder.rs Outdated Show resolved Hide resolved
pod-operation/src/components/wheel_encoder.rs Outdated Show resolved Hide resolved
@ryescholin ryescholin self-requested a review May 31, 2024 01:15
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.

Tested in lab -- works! tysm

Copy link
Contributor

@samderanova samderanova left a comment

Choose a reason for hiding this comment

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

Approving since wheel encoder works as stated above and to unblock integration testing with other peripherals. We'll want to use meters instead of feet but we can do this in another issue.

@ryescholin ryescholin merged commit c0e5283 into main May 31, 2024
2 checks passed
@taesungh taesungh deleted the 58-pod-improve-wheel-encoder-measurements branch May 31, 2024 16:42
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] Improve wheel encoder measurements
4 participants