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

AP_Baro: update MS5837-30BA compensation #29132

Merged

Conversation

ES-Alexander
Copy link
Contributor

Context

While reviewing #29122 I found that the MS5837_30BA sensor's current datasheet has some sections/factors for compensation that seemingly weren't there previously, so aren't yet being considered.

Changes

This PR adds in sections for both "high temperature" and "very low temperature" compensation regions, which were previously unhandled.

@ES-Alexander ES-Alexander changed the title libraries: AP_Baro_MS5611.cpp: update MS5837_BA30 compensation AP_Baro: update MS5837_BA30 compensation Jan 24, 2025
@ES-Alexander ES-Alexander changed the title AP_Baro: update MS5837_BA30 compensation AP_Baro: update MS5837-30BA compensation Jan 24, 2025
@ES-Alexander ES-Alexander force-pushed the bar30-updated-compensation branch from f6bf2eb to 202befd Compare February 3, 2025 13:20
@ES-Alexander
Copy link
Contributor Author

Rebased over master, and updated the commit message to be more descriptive and better match the repo standards.

Copy link
Contributor

@Williangalvani Williangalvani 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 to me. The math matches the datasheet and it worked fine on my vehicle.
I do have mixed feelings regarding the expanded 2^n numbers, but not enough to block merging.

@ES-Alexander
Copy link
Contributor Author

I do have mixed feelings regarding the expanded 2^n numbers

I would definitely prefer bit-shifts (assuming they're ok for the data-types involved), especially since the datasheet provides powers rather than expanded integers, but I think cleaning that up is a problem for a separate PR, since most of the other drivers in this file also use the expanded values...

For what little consolation we get from "it's a maintained evil, not a new one" 😅

@Williangalvani Williangalvani merged commit a1421e7 into ArduPilot:master Feb 3, 2025
100 checks passed
@ES-Alexander ES-Alexander deleted the bar30-updated-compensation branch February 3, 2025 19:14
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