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

feat(tcas): TCAS TA/RA logic and annunciations (ReactJS/TS) #5934

Merged
merged 9 commits into from
Feb 14, 2022

Conversation

2hwk
Copy link
Member

@2hwk 2hwk commented Sep 30, 2021

Fixes #130

Summary of Changes

This PR builds upon #2242 and #5162

Additional note:

This PR also includes some improvements to FDR (more fields to be available) and also a new parameter to control minimum simulation rate and maximum simulation rate. The reason is simply that FDR interface version needs to be managed and due to TCAS a new interface version is anyway needed. So to reduce number of interface versions those changes will come with this PR.

Autopilot features: (beside TCAS)

  • fixed issue with V/S speed protection law (turned out during testing for TCAS)
  • fixed issue with A.FLOOR not being able to deactivate by disconnecting the A/THR system (was made as this logic needed revisit anyway for TCAS)

Features:

  • Add TA (traffic advisory) logic and annunciation
  • Add RA (resolution advisory) logic and annunciation for all possible RA callouts/variants
  • Integrate TA and RA annunciations with core sound manager for proper sound sequencing
  • Do not change sensitivity level during an active RA
  • Use more up-to-date TAU calculation
  • Inhibit RA's depending on altitude/other systems
    • Inhibit "increase descent" RA's below 1,550 ft AGL
    • Inhibit all "descend" RA's below 1,200 ft AGL at takeoff, and 1,000 ft AGL during approach
    • Inhibit all RA's below 1,100 ft AGL in climb, 900 ft AGL in descent ("TA ONLY" message on ND)
    • Inhibit all RA's as well as aural TA's below 600 ft. in climb, 400 ft. in descent
    • Inhibit all climb RA's at or above 39,000 ft
    • Inhibit all RA's when in windshear/stall condition or during GPWS "glideslope" warning ("TA ONLY" message on ND)
    • Inhibit all RA's for non-altitude reporting aircraft above 15,500 ft MSL (currently not possible given sim data)
  • Ignore aircraft on ground (below 380 ft. AGL when they are climbing, 400 ft. AGL when they are descending) when own altitude is less than 1650 AGL when descending, and 1750 AGL when climbing
  • Implement TVTHR support
  • Implement HMD (horizontal miss distance) filtering (Probably not in this PR)
  • Add green/red zones to PFD vertical speed display during an active RA which indicate the desired/forbidden vertical speed ranges, respectively
  • "CHANGE MODE" when EFIS mode selector is in PLAN mode
  • Off scale TA/RA in ROSE NAV mode
  • Off scale TA/RA in ARC mode
  • Support simulation rate
  • Add TCAS test

Issues:

  • RA's are given "clear of conflict" then immediately return to RA state. Need to find a filter/hysteresis to hold the RA status until we're 100% sure we're clear of conflict. (Same with TA's).
  • "Maintain vertical speed" speed ranges are reversed (green range is negative when current VS is positive, and vice-versa
  • "Level off" is interrupted almost immediately by "Clear of Conflict" in some cases
  • Need to restrict annunciations/simvar setting to only one ND
  • "Climb"/"Descend" RA given immediately after weakening "Level Off" RA
  • Bug occurrence: "Climb" followed shortly by "increase descent" followed by "climb now" followed by "increase descent"
  • TA audio not playing for some reason
  • "Monitor vertical speed" RA initiated (red range 0 to 6000+) while in the red zone
  • Traffic icon remaining as TA despite being more than 4 seconds since TA ended and 6+ NM away
  • Fix angle of preventative red zones on PFD. To be improved in future PRs
  • "traffic traffic" call given right after RA resolution, on same aircraft. To be improved in future PRs
  • some callouts not repeating as intended. To be improved in future PRs
  • mask out traffic icons on PLAN mode
  • Nuisance TA/RA due to incomplete TCAS II 7.1 logic - To be iterated and improved upon
  • Nuisance TA/RA due to teleporting AI traffic (default AI Traffic) - Asobo bug can't fix, workaround in place
  • Ground traffic always has XPDR on/no XPDR information - Asobo bug can't fix, workaround in place

Screenshots (if necessary)

image

https://streamable.com/h3n0es (OLD)

https://cdn.discordapp.com/attachments/739225362642501672/892960697871372348/5HjsMJaduh.webm

References

Additional context

Discord username (if different from GitHub):

Testing instructions

  • Ensure that developer mode is OFF
  • Spawn C&D
  • Start up as per normal
  • FAIL ADR1 by pushing the PB under the ADIRS1 alignment knob, AMBER TCAS fault should come up on PFD and ND.
  • Unfail ADR1
  • Observe Traffic
    • Antennae Range: 60 nm Forwards, 30 nm each side, 20 nm behind.
    • 8 intruders can be displayed at once
    • Off-scale intruders should stay at the edge of the screen with the correct bearing - indicating the need to increase range. Currently relative altitude may not always be readable, this will be improved in future PRs.
  • Take-off and attempt to get in close proximity to traffic. Test with live traffic as well as injected traffic (i.e. VATSIM). TAs and RAs should be issued.
    • No Aural TAs below 1000 feet (radio alt)
    • No RAs below 1400 feet (radio alt)
    • No Increase Descend RAs below 1550 feet (radio alt)
    • No Descend RAs below 1100 feet (radio alt)
    • No Climb RAs above 39000 feet (std pressure - barometer alt)
    • No RAs should be issued when (TA ONLY) is displayed on the ND.
    • Only TAs can be forced by turning the TCAS mode switch to TA from TA/RA.
  • When the transponder/TCAS is in standby mode, no traffic should be displayed on the ND
  • Note that nuisance RAs may occur in normal flight, this is a true-to-life "bug" that may occur if your climb or descent rate is too high. Note that there is a currently a bug with MSFS live traffic where traffic will spawn and "slew" into position, which is (correctly) interpreted as a sudden incoming fast moving intruder by TCAS, which may create momentary nuisance RAs. This may slightly improve in future PRs.

Live traffic issue:

https://cdn.discordapp.com/attachments/817470205260726322/894460313443905536/hT8mG2OPgM.webm

  • Multiple RAs/TAs occuring at once is also not considered a bug, this is also true to life and TCAS can realistically handle multiple RAs (though not fully implemented yet), as this can often happen in heavy traffic around airfields.
  • Attempt to trigger off RA at multiple altitudes. Note that this will become more sensitive the higher up in altitude you go, and it is possible for an RA to display Off-scale (at the edge of the screen) which indicates the need to change to a more zoomed out view.
  • Follow RA and CLEAR FROM CONFLICT should trigger once the intruder is out of threshold.
  • Deliberately disobey RAs. (Depending on conditions you may be issued a reversal or a stronger RA, or not.) Check that you are still able to eventually reach a normal vertical separation and be CLEAR OF CONFLICT with the intruder.
  • Repeat spawning on runway and in mid-air
  • Fly a few flights normally and take note of any "nuisance" RAs or TAs. Screenshots or videos would be appreciated.

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

@aguther aguther force-pushed the autopilot-custom-fpm branch 2 times, most recently from 21ff550 to 7a5c6d9 Compare September 30, 2021 04:42
@2hwk 2hwk force-pushed the react-ts-tcas branch 3 times, most recently from 7babfea to 8efa0a3 Compare September 30, 2021 10:00
@2hwk 2hwk force-pushed the react-ts-tcas branch 3 times, most recently from 1d8bfa5 to 5cea41d Compare October 3, 2021 07:50
@2hwk 2hwk force-pushed the react-ts-tcas branch 3 times, most recently from d400073 to 0ba7bb4 Compare October 5, 2021 16:09
@2hwk 2hwk marked this pull request as ready for review October 6, 2021 14:59
@github-actions github-actions bot added this to 🟡 Code Review: Ready for Review in Quality Assurance Oct 6, 2021
src/tcas/src/components/TCasComputer.ts Outdated Show resolved Hide resolved
src/tcas/src/components/TCasComputer.ts Outdated Show resolved Hide resolved
src/tcas/src/components/TCasSoundManager.ts Outdated Show resolved Hide resolved
src/tcas/src/lib/TCasConstants.ts Outdated Show resolved Hide resolved
src/tcas/src/lib/TCasConstants.ts Outdated Show resolved Hide resolved
@2hwk 2hwk force-pushed the react-ts-tcas branch 2 times, most recently from e1cf585 to 3aa5b1b Compare October 7, 2021 10:31
@lolisec
Copy link

lolisec commented Oct 7, 2021

tcas seems to give random calls sometimes even before traffic traffic sometimes I get "clear of conflict" or "monitor vertical speed"
randomly

@ShadowFrost3

This comment has been minimized.

@2hwk
Copy link
Member Author

2hwk commented Oct 8, 2021

tcas seems to give random calls sometimes even before traffic traffic sometimes I get "clear of conflict" or "monitor vertical speed" randomly

Nuisance RAs are entirely possible without a prior TA and happen often with AI Traffic (which again can spawn and position in such a way that RAs will be triggered). In some cases this is a bug, in others this is because we are still missing some finer aspects of RA filtering and in others because of AI Traffic bugs which we can't do much about on our side.

This will be tuned but needs further testing, again the main purpose of this targeted towards VATSIM and injected traffic, rather than the currently bugged live traffic.

@2hwk 2hwk moved this from 🟡 Code Review: Ready for Review to 🟣 QA Team Review: Ready to Test in Quality Assurance Oct 8, 2021
@2hwk

This comment has been minimized.

aguther pushed a commit that referenced this pull request Feb 11, 2022
Co-authored-by: Will Pine <wpine215@gmail.com>
aguther pushed a commit that referenced this pull request Feb 11, 2022
Co-authored-by: Will Pine <wpine215@gmail.com>
aguther pushed a commit that referenced this pull request Feb 12, 2022
Co-authored-by: Will Pine <wpine215@gmail.com>
aguther pushed a commit that referenced this pull request Feb 12, 2022
Co-authored-by: Will Pine <wpine215@gmail.com>
frankkopp pushed a commit to frankkopp/aircraft that referenced this pull request Feb 12, 2022
aguther pushed a commit that referenced this pull request Feb 12, 2022
Co-authored-by: Will Pine <wpine215@gmail.com>
aguther pushed a commit that referenced this pull request Feb 12, 2022
Co-authored-by: Will Pine <wpine215@gmail.com>
aguther pushed a commit that referenced this pull request Feb 13, 2022
Co-authored-by: Will Pine <wpine215@gmail.com>
aguther pushed a commit that referenced this pull request Feb 13, 2022
Co-authored-by: Will Pine <wpine215@gmail.com>
aguther pushed a commit that referenced this pull request Feb 14, 2022
Co-authored-by: Will Pine <wpine215@gmail.com>
@aguther aguther force-pushed the react-ts-tcas branch 2 times, most recently from 9c4fce2 to 25faff3 Compare February 14, 2022 19:17
@aguther aguther dismissed beheh’s stale review February 14, 2022 19:20

Will be done in a later PR when TCAS is anyway moved to C++/Rust

Quality Assurance automation moved this from 🔴 Code Review: In progress to 🟣 QA Team Review: Ready to Test Feb 14, 2022
@aguther aguther merged commit b761799 into master Feb 14, 2022
Quality Assurance automation moved this from 🟣 QA Team Review: Ready to Test to ✔️ Done Feb 14, 2022
@aguther aguther deleted the react-ts-tcas branch February 14, 2022 19:46
@2hwk 2hwk added this to the v0.8.0 milestone Apr 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging this pull request may close these issues.

TCAS