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

SNS - Levitation Current Sensor #71

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

Aux1r
Copy link
Contributor

@Aux1r Aux1r commented Feb 3, 2025

init commit

@Aux1r Aux1r requested a review from davidbeechey February 3, 2025 14:46
@Aux1r Aux1r self-assigned this Feb 3, 2025
@Aux1r Aux1r requested a review from H-Allen as a code owner February 3, 2025 14:46
Copy link

linear bot commented Feb 3, 2025

@Aux1r Aux1r marked this pull request as draft February 3, 2025 14:46
@davidbeechey davidbeechey changed the title Create branch for levitation current sensor SNS - Levitation Current Sensor Feb 3, 2025
Copy link
Collaborator

@davidbeechey davidbeechey 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, just a few things to tidy up

@davidbeechey davidbeechey added the needs testing Needs testing in the lab before merging label Feb 7, 2025
@Aux1r Aux1r marked this pull request as ready for review February 9, 2025 12:20
@Aux1r
Copy link
Contributor Author

Aux1r commented Feb 9, 2025

Rejigged the structure of the current_levitation.rs file and the current_levitation_test.rs files so that they're more akin to the temperature sensors' structure (do the matching for SensorValueRanges in the test instead of the task file)

/// by the supply voltage divided by 2, so if you change the supply voltage, you'll have to change the offset that we subtract
/// in the read function accordingly.
pub fn read(&mut self) -> SensorValueRange<f32> {
let current = self.adc.read_value() as f32;
Copy link
Collaborator

Choose a reason for hiding this comment

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

you need to convert the value read on ADC into volts first (currently will be 0-4096)

Copy link
Contributor

Choose a reason for hiding this comment

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

is that something that can be done as part of the adc implementation?

Copy link
Collaborator

Choose a reason for hiding this comment

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

getting the resolution of the ADC is being added in #82 if that's what you mean?

I guess we could also add functionality to map it to a given range (e.g. 0-3.3) too

@Aux1r Aux1r requested a review from jpfbastos as a code owner February 21, 2025 12:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs testing Needs testing in the lab before merging
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants