Skip to content

feat(A380X/mfd): improved compute lrc#10470

Open
Lucas-IQ21 wants to merge 3 commits intoflybywiresim:masterfrom
Lucas-IQ21:feat_add_compute_lrc
Open

feat(A380X/mfd): improved compute lrc#10470
Lucas-IQ21 wants to merge 3 commits intoflybywiresim:masterfrom
Lucas-IQ21:feat_add_compute_lrc

Conversation

@Lucas-IQ21
Copy link
Copy Markdown
Contributor

Fixes #[issue_no]

Summary of Changes

Improved LRC compute FMS perf cuize page.

Screenshots (if necessary)

image

References

https://www.fzt.haw-hamburg.de/pers/Scholz/arbeiten/HAW-TextCaers.pdf -> 2.1.4 Long-Range Cruise Speed
https://ansperformance.eu/library/airbus-fuel-economy.pdf

FCOM :
image

image

Additional context

Previously, the LCR speed was simply specified as a fixed value, but now it is calculated based on ISA temp, the weight, and the altitude of the aircraft.

Discord username (if different from GitHub): Lucas-IQ

Testing instructions

  1. Fill FMS as usual.
  2. Before the cruise phase, the LRC speed in Mach does not appear.
  3. Reach cruise phase.
  4. The LCR speed is displayed and varies depending on the cruising altitude, the weight of the aircraft, and the ISA temperature.
  5. The LRC cannot be less than 0.75 or greater than 0.88.

How to download the PR for QA

Every new commit to this PR will cause new A32NX and A380X artifacts 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, find and click on the PR Build tab
  4. Click on either flybywire-aircraft-a320-neo, flybywire-aircraft-a380-842 (4K) or flybywire-aircraft-a380-842 (8K) download link at the bottom of the page

@github-project-automation github-project-automation Bot moved this to 🟡 Code Review: Ready for Review in Quality Assurance Jan 6, 2026
const crzFL = pd?.cruiseFlightLevel?.get();
const grossWeightKg = SimVar.GetSimVarValue('TOTAL WEIGHT', 'pounds') * 0.453592;
const isaDev =
SimVar.GetSimVarValue('AMBIENT TEMPERATURE', 'celsius') -
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Values from the ADIRS should be used, not magic sim values.

// Compute LRC
const pd = this.loadedFlightPlan?.performanceData;
const crzFL = pd?.cruiseFlightLevel?.get();
const grossWeightKg = SimVar.GetSimVarValue('TOTAL WEIGHT', 'pounds') * 0.453592;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think we may have a system that computes gross weight. Also, avoid conversions using magic numbers. @tracernz what's the conversion utilities we should use here?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The FMS indeed calculates GW itself already and that should be used.

For future: when reading a simvar you can specify the units you want and the sim will do the conversion for you. If you need to do manual conversions in instruments with msfs-sdk you can use UnitType to do the conversion.

@github-project-automation github-project-automation Bot moved this from 🟡 Code Review: Ready for Review to 🔴 Code Review: In progress in Quality Assurance Jan 7, 2026
SimVar.GetSimVarValue('AMBIENT TEMPERATURE', 'celsius') -
SimVar.GetSimVarValue('STANDARD ATM TEMPERATURE', 'celsius');
if (this.activeFlightPhase.get() >= FmgcFlightPhase.Cruise && crzFL > 0) {
const lrc = new Lrc({
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We shouldn’t need to allocate new objects all the time for things like this. We want to avoid allocations as much as reasonably possible.

@BravoMike99
Copy link
Copy Markdown
Contributor

Could you perhaps also set the calculated value as the managed speed target, when the active cost index mode is LRC?
getManagedCruiseSpeed & getManagedCruiseSpeedMach in fmgc.ts

@donstim
Copy link
Copy Markdown
Contributor

donstim commented Mar 28, 2026

More information is needed on exactly what you are using for lift, drag, and fuel flow parameters as a function of weight, altitude, temperature, and speed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 🔴 Code Review: In progress

Development

Successfully merging this pull request may close these issues.

5 participants