aircraft
aircraft copied to clipboard
feat(fms): flight planning version 2
Fixes #1835 Fixes #2068 Fixes #2792 Fixes #5687 Fixes #6379 Fixes #6495 Fixes #6558 Fixes #7524
Summary of Changes
This PR is a complete rewrite of the entire flight planning system of the A32NX (and by extension A380X).
It entirely replaces the old system, a derivative of the CJ4 mod flight plan system, with a completely custom one, purpose-built for simulating Honeywell Airbus FMS software found on the A320/A330/A340/A350/A380.
Motivation
- The current flight planning system possesses a segmenting system prone to breaking, causing potential bugs in may places.
- The current flight planning system does not correctly manage origin and destination legs. Those are often added ad-hoc, without real proper representation at appropriate times in the flight plan. This also results in problem correctly handling approach missed approach points and therefore, makes missed approach segments impossible.
- The current system operates on a flight plan data structure that does not suit the reality of an airliner flight planning system. Legs are represented as waypoints, with irrelevant data strewn around like predictions, and important data present in untyped free-for-all dictionaries. Discontinuities exist solely as a property of the leg they come after, not as an actual flight plan element.
- The current system is not made in a way that can accommodate accurate stringing algorithms.
- The current system does not support efficient flight plan synchronization across clients.
Major design differences
- Flight plan data structure
- The main type of a flight plan is a
FlightPlanElement
, which resolves to typeFlightPlanLeg | Discontinuity
. Only the leg type actually contains information. This API is typed in a way that mandates proper verification of the type by the consumer and allows for semantic narrowing by TypeScript. - Flight plans are divided into segments, which are finite in number and match the only possibilities in a Honeywell Airbus FMS. There is no support for out-of-order segments and operations on flight plans are limited to this layout, reducing the API surface.
-
FlightPlanManager
is split into two classes:-
FlightPlanService
(for now a singleton - will likely change) - this exposes allowed and common operations on flight plans, accepting parameters to target a specific plan or sub-plan (alternate). It also encapsulates TMPY logic. -
FlightPlanManager
- this exposes operations on managing the storage of flight plans (create, delete, copy, swap, etc.)
-
- The main type of a flight plan is a
Functionality introduced
- [x] Database selection (external vs. MSFS)
- [x] Waypoint collapsing (duplicate removal)
- [x] Missed approach support
- [x] Loading of legs, stringing
- [x] Sequencing logic
- [ ] Secondary flight plan support
- [x] Creation, copy, swapping (thru
FlightPlanManager
core logic) - [ ] Editing
- [x] Origin/Dest airport revisions (DEPARTURE, ARRIVAL)
- [x] Element insertion/deletion on FPLN page
- [ ] TBD - some missing
- [ ] Predictions / sync with active logic
- [x] Creation, copy, swapping (thru
- [x] Alternate flight plan support
- [x] Editing
- [x] Origin/Dest airport revisions (DEPARTURE, ARRIVAL)
- [x] Element insertion/deletion on FPLN page
- [x] Hold revisions
- [x] Airway insertion
- [x] TBD - some missing
- [x] ENABLE ALTN (started, not done)
- [x] Editing
Issues fixed
- Approaches are no longer forced to end at the runway threshold
- Various lateral revisions now no longer wrongly remove discontinuities
- Using the same airport as origin/destination is less problematic
- STARs with multiple IAFs now string correctly
Work remaining
Refer to https://github.com/flybywiresim/aircraft/pull/7692#issuecomment-1792383171 for a more detailed list.
- [x] BUG element insertion via LSK on FPLN page adds elements after leg, instead of before
- [ ] BUG automatic airway matching does not work on MSFS backend
- [x] BUG MCDU needs reloading to work
- [x] TODO release msfs-navdata with Coherent airway loading
- [x] TODO correct NEXT WPT logic
- [x] TODO Finish ALTN logic
- [x] TODO Finish missed approach logic
- [ ] TODO Finish plan sync (for split FMGC in the future, A380X)
- [x] TODO port vnav ~~(blocked by VNAV being on dev)~~
- [x] TODO some things to fix, waiting for
msfs-navdata
to supportfixTypeInfo
- [x] TODO some things to fix, waiting for
- [x] TODO delete old flight plan system source code
- [ ] TODO port MSFS planner sync
- [x] TODO finish SimBrief uplink
- [x] TODO add CoRoute uplink
- [x] TODO port hold revisions
- [x] TODO port vertical revisions
Screenshots (if necessary)
References
Additional context
Discord username (if different from GitHub):
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.
- Make sure you are signed in to GitHub
- Click on the Checks tab on the PR
- On the left side, click on the bottom PR tab
- Click on the A32NX download link at the bottom of the page
QA Tester Discord name: Alex R Last tested build: bcc1ffd Date of last test: 22.02.2024
We have 4 categories of issues:
- Logical issues that need fixing
- Procedural issues - Issues that have not yet been verified as a result of logical issues and may be bound to one specific procedure and not a general issue
- Issues that can be fixed at a later time
- Secondary fplan (incomplete as of yet)
1. Logical issues: That should be fixed before merging:
-
[x] 1.1 Fix page/Prog page/pbd not taking 4 letter ICAO ID as references
-
[x] 1.2 No airports are shown on ND with ARPT filter activated (note that dep/arr/altn are always shown regardless of filter setting (see 3.9)
-
[x] 1.3 Entered trans level in MCDU not considered
-
[x] 1.4 Missing autotuning for VOR's, ILS does work sometimes but not always (applies to manual VOR tuning/insertion in fplan as well, not every station can be used
-
[x] 1.5 Greying out secondary flight plan options for initial release (marked as fixed as SEC is planned)
-
[x] 1.6 Alternate VNAV: Going around and then activating the alternate flight plan will cancel out VNAV. That means that for the (now acitve) alternative flight plan VNAV is not available. Changing the cruise altitude on INIT A has no effect. I only got VNAV to calculate a profil after having activated approach phase. Expected behaviour: After going around and activating alternate, VNAV should calculate a descent profil as usual. I dont know whether it will take the cruise altitude from INIT A as reference or the FCU selected level. Please contact me on Discord if further information/testing is required
-
[x] 1.7 After go around TRK/FPA does not work anymore (Procedure to replicate: Load on runway of edds25, initiate weights, fplan EDDF/EDDS, load rwy 25c as departure of eddf, depart in edds, load any approach (I loaded ILS25 GEBNO1W), do direct to a fix near FAF, commit to approach, go around, (I think I now waited until I reduced thrust back to SPEED) and went into heading selected mode, now pressed hdg/trk button on fcu, now TRK/FPA shouldnt be working anymore
-
[x] 1.8 Inserting a waypoint on first flight plan position (the same way you do a direct on Boeing aircraft) will result in the fplan messing up sequencing, especially when going around, the missed approach procedure for example wont be activated
-
[x] 1.9 Coroute - Inserting by coroute name doesnt work and insert by to/from will not import the routing to the fplan. Respective .xml was sent im discord chat related to this PR at 16:43Z November 12th 2023
-
[x] 1.10 PBD not working: PBD fix is not referenced at the position, for example entered EDDS/270/10 but PBD01 ended up somewhere around EDDM (inserted fplan was EDDM-LOWS)
-
[x] 1.11 Can't dct to a waypoint that's not on your flight plan - Original route: YBBN/01R N0437F380 SANEG1 SANEG H91 IGDAM/N0434F390 H12 BOREE BORE3A YSSY/34L Somewhere a bit after SANEG, HDG MODE. After trying to direct YAKKA, while on HDG MODE, it did nothing. Then directed to BOREE, that worked. When on track to BOREE, tried directing to YAKKA again, still didn't work. Added YAKKA to the flight plan in the MCDU flight plan page, plane now flew correctly towards YAKKA. When on track to YAKKA, tried to direct to TOOKI and direct to VONNI, neither worked
-
[x] 1.12 PBX not working, when entering PBX in fplan it simply disappears and doesnt create the PBX waypoint
-
[x] 1.13 Entering waypoint in fplan kills FIX INFO entries
-
[x] 1.14 VERT REF page crashing on waypoints with window constraint
-
[x] 1.15 Fuel pred doesnt work (who needs that anyway, just send it)
-
[x] 1.16 ALTERNATE Changing dest (new dest) wont reset the "departure" airport of the altn fplan to the new dest
-
[x] 1.17 Connection-Notification page crashes when selecting
-
[x] 1.18 Runway only as approach currently not implemented
-
[x] 1.19 ILS autotune by ID not working / Tuning freq manually will work but the correct ID will not appear on rad nav page (partially fiex - ISTE causes borked page / ISTW works normally)
-
[x] 1.20 No DISCO for MANUAL legs (Proc to replicate: KIAH 15L BLTWY7
-
[x] 1.21 Importing via Simbrief, then changing FROM/TO will give NaN under trans alt on perf page (TO and APPR perf page) - Same will happen if no flight is imported but TO/FROM manually entered - mostly fixed ==> Importing, then changing to/from will empty trans for to perf but appr perf remains trans value from import
-
[x] 1.22 Giving DTO to a waypoint that appears two times will sequence to first appearance of wpt. Example: Fplan LBU DKB DISCO LBU DSXXX - DTO to second LBU Result TP LBU DKB DISCO LBU DSXXX, however it should sequence TP LBU DSXXX
-
[x] 1.23 Suspected stringing issue. Had EDDS ABTAL4B and EDDM ILS08R, coinnected appr wpt (BEGEN) to ABTAL by clearing disco (ABTAL BEGEN). Now inserted ILS26L via ROK26 instead and fplan sequenced (ABTAL DISCO BEGEN DISCO ROKIL - already cleared discos in picture) - Can be manually fixed however
-
[x] 1.24 Port over VD leg
-
[x] (1.25 FMS wont sequence along from off route waypoint - Went direct UNSER as offroute and had EDDS ILS25 no via no star after. Even though in fplan I had UNSER EDDS25 it did not sequence towards EDDS25 after passing UNSER - fixed as it wasnt reproduced)
-
[x] 1.26 ALTN fplan not moving ND in plan mode accordingly
-
[x] 1.27 Passing Waypoint which is followedby DISCO will set TO to PPOS, while it should actually be the wpt after the DISCO
-
[x] 1.28 Issues with stringing of new approach after Go Around. FPLAN EDDM/EDDM DEP: GIVMI6S 26L - ARR: ILS26L via ROK26 departed, DTO DM429, DTO NELBI, flew approach. Initiated go around before runway threshold, NAV engaged, all correct: FPLAN however was: MISSED APPR POC DISCO ROK26 DISCO NELBI DISCO D261B (first wpt of missed approach proc) After passing rwy threshold it now had: MISSED APPR PROC DISCO ROK26 (which ends with DM429 MAUNAL) NELBI (no DISCO between NELBI and MANUAL) NELBI FI26L EDDM26L
-
[x] 1.29 You know whats meant
-
[x] 1.30 Automatic airway insertion (inserting airway names without end fixes)
-
[x] 1.31 Follow preocedure of 1.35, then delete the alt waypoint. Will result in only TO wpt in fplan, but deletion of From (alt waypoint) shouldnt be allowed
-
[x] 1.32 EGCC-EHAM, did NEW DEST to EGGP on one of the SID points, inserted ILS09 with the POL1T arrival- resulted in blank HOLD page
-
[x] 1.33 EDDL VOR23R via BAM - FMS sequences missed approach procedure twice, should be MD2/03 BOT DISCO BAM ....
-
[ ] 1.34 MSFS fplan sync
-
[x] 1.35 Having runway only departure, setting new dest from altitude wpt LAT REV and then let the aircraft pass the alt waypoint will result in DISCO DEST without FROM
-
[x] 1.36 Departed EDDL 23R COL SID for EDDL23R VOR approach via BAM. When editing the approach segement of the fplan no temp fplan was shown on ND
-
[x] 1.37 Same procedure as 1.36 - FMS didnt sequence BAM and BAM/06 took position of BAM. Only after inserting BAM manually all waypoints were at the right location
-
[x] 1.38 Implement ARPT button logic
-
[x] 1.39 Weird FMS state when: You have only ORIGIN DISCO DEST, then insert a waypoint ORIGIN WPT DISCO DEST, then delete the WPT
-
[x] 1.40 FMS inserts waypoint at way too offroute position (Dist 9999 NM) - May break sequencing as well Route: EDDF 25C OBOKA3W OBOKA Z29 TORNU DCT ABNED L980 LOGAN LOGAN2H ILS 27L VIA LAM EGLL Additional info: BNN131 is the radial BNN 131 at 3500ft to then turn towards the ILS
NOTE: The alternate marked items can be disregarded if we decide to leave alternate out for an inital release. However my impression is that alternate does already work at a pretty solid level and it can be seriously considered to include altn for an initial release.
2. Procedural issues: I am using current Navigraph Navdata
- [x] 2.1 The VOR STG (116,85 at around N48/49 W8/9) can't be inserted in fplan/fix info/prog as it cant be found, the plane only finds different STG stations. Reference video: https://drive.google.com/file/d/1aqvSsnYZ-qU1uhYu5RDGc0fC6cYd7Rid/view?usp=sharing
- [x] 2.2 GCXO - LPC6J - had one unknown leg (unkw vd) - working correctly on master
- [x] 2.3 ROKIL1B of EDDM not covered by the A32NX. This procedure is available in the stock G3000 for example, so likely not a navdata issue
- [x] 2.4 STARS for 26L EDDM beginning with NAPS NIRG RAST VATE and VESU are missing, although on eof the "N" beginning STARs is actually present - Misinterpretation by myself - verify all STARS present
3. Issues that can be fixed after release
-
[ ] 3.1 CA legs not taking VNAV prediction (results in CA legs that are way too long)
-
[ ] 3.2 T/D reached on message can't be cleared by deletiong that message on scratchpad
-
[ ] 3.3 EFB chocks/cones of ground service page missing (happened with 0.11.1 as well)
-
[ ] 3.4 Alternate: Activating alternate with an alternate route including a STAR (for example SPESA STAR EDDF) and sequencing past the first waypoint of this STAR (in that case SPESA) by a direct (in that case towards DF622) will result in the waypoint SPESA still being shown on the ND although its not in the flightplan catalogue anymore
-
[ ] 3.5 Rather slow AP pitch up response during GA with AP engaged in comparison to reference videos on YT
-
[x] 3.6 Two discos (Disco WPT Disco ==> Delete WPT betweem discos ==> Disco Disco) wont merge into one Disco
-
[x] 3.7 Alternate: Once having scrolled to altn section, the route and waypoint appears on ND. After scrolling back to normal fplan the altn waypoints disappear but the dashed line remains on ND
-
[ ] 3.8 Misaligned ND symols after DIR
-
[x] 3.9 dep/arr/altn airport shown in magenta with magenta star on ND regardless of EFIS filter setting (see 3.8) - as of e0c2076 it is now partially fixed. It is now in white but the labels and star are still present, just in white
-
[x] 3.10 Remove Return button from fix info page
-
[x] 3.11 Waypoints remain on ND after landing
-
[ ] 3.12 Doing fplan changes (for example clearing a DISCO) after having done a DIR resets the turn predicition and the DIR is drawn as a straight line from T-P to waypoint without turn prediction
-
[ ] 3.13 Slope missing for tuned ILS
-
[ ] 3.14 Tuning predcitions. EDDS25 ABTAL4B, plane followed drawn line although it should turn left straight after DS046
-
[ ] 3.15 -5.0° approach causes VNAV to sweat and not take the correctvert constraints for the fixes
-
[ ] 3.16 ND not targeting alt/pseudowaypoints in plan mode
-
[ ] 3.17 some procedures (for example EDDS ABTAL4B) have completely messed up drawings of the departure route, affects guidance as well (plane turns right instead of left) Reference video: https://drive.google.com/file/d/1i-xALezBAHREAJ8nWs2Z6PWBnvPzZ4B9/view?usp=sharing - likely logical issues as I have seen that on som DIR with tight angles between enbound and outbound leg as well
-
[ ] 3.18 FMS sequences missed approach when loading ILS - Steps to repro FPLAN EDDS/EDDH, OKI4B departure rwy 25 Takeoff, go direct UNSER (Offroute) Insert new destination EDDS Insert ILS25, no via no star in vicinity of airfield FMS will now already sequence missed approach
-
[ ] 3.19 Drawing issue for approaches, doesnt affect guidance
-
[ ] 3.20 When pressing imm exit after having entered the hold the aircraft still completes the entry and doesnt leave the hold as direct as possible
Secondary fplan (referred to as SEC)
- [x] 4.1 SEC always shown shown on ND regardles of wether SEC MCDU page is open or not
- [x] 4.2 If there is no SEC (previously deleted or never initiated/copied) the the SEC fplan page will get borked when pressing on the fplan catalogue
- [ ] 4.3 No init for SEC
- [ ] 4.4 SEC doesnt sequence along with primary fplan
- [x] 4.5 T/D and T/C in green in fplan, they are white with Thales software, verify correct color for Honeywell
- [ ] 4.6 No perf for SEC
- [ ] 4.7 No activation/switching of SEC
QA Tester Discord name: Letreiv Last tested build: https://github.com/flybywiresim/aircraft/pull/7692/commits/a4aa95c4af5717c1b863d2b193d880f6712e4a37 Date of last test: 13.01.2024
Objects of Testing: Flew several approaches including their missed approach procedures
Issues:
-
- WORKS AS INTENDED Missed approach segment not correctly drawn until going into FLARE mode
This issue happened at _EDVK ILS27 via WRB before
after reaching FLARE mode
This issue also happened at EDFH (ILS 21)
This issue also happened at EDDL VOR 23R
This example also shows the next issue,
-
- [ ] End of missed approach drawing connected to the previous approach
EDDL VOR23R Missed approach The flightplan included a discontinuity, aircraft correctly swithed into HDG mode at BOT. The initial approach was from the other IAF (BAM). The flightplan has not been modified. This go around was executed at 300 ft AGL before reaching FLARE mode
The end of missed approach also connected to the previous approach at EDDG ILS25 EDLP ILS24 via PAD2 EDVK ILS27 via WRB In those cases, the flightplan did not inlude a discontinuity and the aircraft few onto the approach, staying in NAV. The missed approach procedure ended at the IAF of the previous approach, unlike in the example at EDDL. Not sure if this is intended or not.
- KNOWN Overshooting the drawn go around path in managed modes
EDDK ILS 14L via WYP
EDDL VOR 23R
- KNOWN Overflying the IAF after a DIR TO which causes overshooting
The chart does not show the IAF as an overfly point. EDVK ILS 27 via WRB
- INTENDED Unable to DIR to IAF of VOR approach
EDDL VOR 23R
The IAF shows as BAM/06 in the F-PLN page which results in it not appearing in the DIR page.
- KNOWN Minor drawing issues with no effect on guidance
EDFH ILS 21 via FH506
After deleting CF21
EDDG ILS25 via HMM
For any questions please ping me on discord
I ran into an issue with the MCDU total distance countdown showing longer than expected. In my case, I was flying to EGLL from EKCH. When this bug occurred I was in the cruise phase of the flight. I did not notice this on the ground. When this issue occurred, the dest EFOB and ETA remained the same as before. This did not affect the T/D calculation either. In addition, the range on the ND still showed the correct distances.
EDIT: I did another flight to see if this would reproduce itself. I could not reproduce this. Please ignore.
Here is the route as flown: EKCH/22R LANG2C LANGO M611 ALASA DCT GOLEN N872 EEL DCT VALKO DCT ABNED L980 LOGAN LOGA2H EGLL/27L
NO SID should be the last option
Empty SEC should have only the COPY ACTIVE line, and in cyan
Lat revisioning the take off runway at the beginning of the altn fpln, then departure, then side arrowing shows SIDs from the main fpln take off airport
selecting a different take off runway from the altn fpln does this message too, but inserts fine into the fpln
✖ ND
[ND] › error TS2307: Cannot find module 'instruments/src/ND/types/GenericFmsEvents' or its corresponding type declarations. ()
[ND] › → at ../../../../../../fbw-common/src/systems/instruments/src/ND/pages/plan/index.tsx:9:33
Build is currently failing
Docs PR: https://github.com/flybywiresim/docs/pull/966
Spotted a bug with DIR-TO on the copilot ND.
Impacted by the potential future merge freeze. https://github.com/flybywiresim/aircraft/pull/8466 will be required to be merged into this PR at some point.