Skip to content

Commit

Permalink
fix(a380x/fms): Fix VLS computation for CONF 1 (#9643)
Browse files Browse the repository at this point in the history
* fix(a380x/fms): Fix VLS computation for CONF 1

* changelog

* fix S/F speeds
  • Loading branch information
flogross89 authored Dec 10, 2024
1 parent b73ca73 commit 33c4a62
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 15 deletions.
1 change: 1 addition & 0 deletions .github/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@
1. [A380X/FWS] Fix "NO ZFW OR ZFWCG DATA" ECAM alert after landing - @flogross89 (floridude)
1. [A380X/SD] Add brake temperature color change to amber when brakes are hot - @heclak (Heclak)
1. [A380X/FCU] Fix display of values on FCU during light test - @heclak (Heclak)
1. [A380X/FMS] Fix VLS computation error for CONF 1, might have lead to FMS crashes during climb out - @flogross89 (floridude)

## 0.12.0

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1116,7 +1116,7 @@ export class FmcAircraftInterface {
const altActive = false;
const landingWeight =
this.fmgc.data.zeroFuelWeight.get() ??
NaN + (altActive ? this.fmgc.getAltEFOB(true) : this.fmgc.getDestEFOB(true));
NaN + (altActive ? this.fmgc.getAltEFOB(true) : this.fmgc.getDestEFOB(true)) * 1_000;

return Number.isFinite(landingWeight) ? landingWeight : NaN;
}
Expand All @@ -1128,7 +1128,7 @@ export class FmcAircraftInterface {
/** in kg */
const estLdgWeight = this.tryEstimateLandingWeight();
let ldgWeight = estLdgWeight;
const grossWeight = this.fmc.fmgc.getGrossWeightKg() ?? maxZfw + this.fmc.fmgc.getFOB();
const grossWeight = this.fmc.fmgc.getGrossWeightKg() ?? maxZfw + this.fmc.fmgc.getFOB() * 1_000;
const vnavPrediction = this.fmc.guidanceController?.vnavDriver?.getDestinationPrediction();
// Actual weight is used during approach phase (FCOM bulletin 46/2), and we also assume during go-around
if (this.flightPhase.get() >= FmgcFlightPhase.Approach || !Number.isFinite(estLdgWeight)) {
Expand Down Expand Up @@ -1178,14 +1178,10 @@ export class FmcAircraftInterface {
// Only update speeds if ADR data valid

const flapLever = SimVar.GetSimVarValue('L:A32NX_FLAPS_HANDLE_INDEX', 'Enum');
let flaps = flapLever;
if (flapLever === 1 && SimVar.GetSimVarValue('L:A32NX_FLAPS_CONF_INDEX', 'Enum') === 1) {
flaps = 5; // CONF 1
}
const speeds = new A380OperatingSpeeds(
grossWeight,
cas,
flaps,
flapLever,
this.flightPhase.get(),
this.fmgc.getV2Speed(),
alt,
Expand All @@ -1199,10 +1195,10 @@ export class FmcAircraftInterface {
const f = Math.max(speeds.f2, Vmcl + 5);
this.fmgc.data.flapRetractionSpeed.set(Math.ceil(f));
} else {
if (flaps === 2) {
if (flapLever === 2) {
const f = Math.max(speeds.f2, Vmcl + 15);
this.fmgc.data.flapRetractionSpeed.set(Math.ceil(f));
} else if (flaps === 3) {
} else if (flapLever === 3) {
const f = Math.max(speeds.f3, Vmcl + 10);
this.fmgc.data.flapRetractionSpeed.set(Math.ceil(f));
}
Expand Down
4 changes: 2 additions & 2 deletions fbw-a380x/src/systems/instruments/src/MFD/FMC/fmgc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,7 @@ export class FmgcDataService implements Fmgc {
return this.data.approachTemperature.get() ?? 0;
}

/** in kilograms */
/** in tons */
getDestEFOB(useFob: boolean): number {
// Metric tons
const efob = this.guidanceController?.vnavDriver?.getDestinationPrediction()?.estimatedFuelOnBoard; // in Pounds
Expand All @@ -574,7 +574,7 @@ export class FmgcDataService implements Fmgc {
return 0;
}

/** in kilograms */
/** in tons */
getAltEFOB(useFOB = false): number {
// TODO estimate alternate fuel
if (this.getDestEFOB(useFOB) === 0) {
Expand Down
10 changes: 6 additions & 4 deletions fbw-a380x/src/systems/shared/src/OperatingSpeeds.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,9 @@ export class SpeedsLookupTables {
if (conf === 0) {
return SpeedsLookupTables.VLS_CONF_0.get(0, weight);
} else {
if (conf > 5) {
throw new Error('Invalid flap config for approach VLS computation');
}
return SpeedsLookupTables.VLS_APPR_CONF[conf].get(cg, weight);
}
}
Expand Down Expand Up @@ -512,13 +515,12 @@ export class A380OperatingSpeeds {
this.f2 =
fmgcFlightPhase <= FmgcFlightPhase.Takeoff
? Math.max(1.18 * vs1gConf1F, Vmcl + 5)
: SpeedsLookupTables.F2_SPEED.get(altitude, m);
: SpeedsLookupTables.F2_SPEED.get(cg, m);
this.f3 =
fmgcFlightPhase <= FmgcFlightPhase.Takeoff
? Math.max(1.18 * vs1gConf1F, Vmcl + 5)
: SpeedsLookupTables.F3_SPEED.get(altitude, m);
this.s =
fmgcFlightPhase <= FmgcFlightPhase.Takeoff ? 1.21 * vs1gConf0 : SpeedsLookupTables.S_SPEED.get(altitude, m);
: SpeedsLookupTables.F3_SPEED.get(cg, m);
this.s = fmgcFlightPhase <= FmgcFlightPhase.Takeoff ? 1.21 * vs1gConf0 : SpeedsLookupTables.S_SPEED.get(m);
}
}

Expand Down

0 comments on commit 33c4a62

Please sign in to comment.