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

fix: Pounds - kilograms units conversion #5896

Merged
merged 2 commits into from
Sep 23, 2021
Merged

fix: Pounds - kilograms units conversion #5896

merged 2 commits into from
Sep 23, 2021

Conversation

donstim
Copy link
Contributor

@donstim donstim commented Sep 23, 2021

Fixes #[issue_no]

Summary of Changes

Changes kilograms per pound units conversion in our utilities coding to better match what MSFS uses internally. This PR is intended to complement PR #5895 (although that PR is not necessary for this one to be merged).

Screenshots (if necessary)

The current conversion in the NX Utilities package is 2.20462 kg/lb. This PR changes it to 2.204625 lb/kg. Although that is not the exact conversion you will find in any online converters ( 2.2046226218 kg/lb), it is what is necessary to match MSFS weights. See the following screenshots with weights in pounds and then with kilograms:

Screenshot (1215)
Screenshot (1214)

I filled each loading station and fuel tank with the max allowed by the slider in order to maximize the weights and therefore the accuracy of this check.

Here is a screenshot of a spreadsheet I used to find a conversion, starting with the weight in pounds (which is what MSFS uses as its base) and converting it to kilograms. First, I tried different conversions to match the 198856 lbs fully loaded weight in kg. Starting with the current utils conversion factor of 2.20462, you can see that this would round off to 90200 kg, whereas the MSFS weight is 90199 kg. I then tried several conversions until finding the one that matched.

After that, I checked each loading station using that conversion (2.204625) and comparing it to the MSFS weight in kg to the same precision level as the MSFS weights are shown.) Lastly, as a final check on the original 2.20462 conversion, I compared it to the MSFS kg weight for the center and inner fuel tanks. With that conversion, the kg weights were not converted to the exact MSFS weights. (They are off by a whopping 0.01 kg! xD)

Screenshot (1219)

Anyway, in the interest of exact matching of MSFS weight conversions, I propose this PR.

References

Additional context

Discord username (if different from GitHub): donbikes#4084

Testing instructions

How to download the PR for QA

Every new commit to this PR will cause a new A32NX artifact to be created, built, and uploaded.

  1. Make sure you are signed in to GitHub
  2. Click on the Checks tab on the PR
  3. On the left side, click on the bottom PR tab
  4. Click on the A32NX download link at the bottom of the page

@github-actions github-actions bot added this to 🟡 Code Review: Ready for Review in Quality Assurance Sep 23, 2021
Quality Assurance automation moved this from 🟡 Code Review: Ready for Review to 🟣 QA Team Review: Ready to Test Sep 23, 2021
@sidnov sidnov merged commit f4d3795 into flybywiresim:master Sep 23, 2021
Quality Assurance automation moved this from 🟣 QA Team Review: Ready to Test to ✔️ Done Sep 23, 2021
@donstim donstim deleted the fix-Lbs-to-kgs-units-conversion branch September 25, 2021 00:26
@derl30n derl30n added this to the v0.8.0 milestone Sep 25, 2021
aguther pushed a commit that referenced this pull request Oct 18, 2021
* Update NXUnits.js

* Update CHANGELOG.md
aguther pushed a commit that referenced this pull request Oct 26, 2021
* Update NXUnits.js

* Update CHANGELOG.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

None yet

3 participants