-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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(RA): RA model based on a probe mesh implementation #7807
base: master
Are you sure you want to change the base?
Conversation
Note: Added Solve TCAS issue where probes are detected as aircraft on the top (highest priority) of the TODO list |
Will put this issue at the end of the TODO list until a viable solution is found. Opened an issue in Asobo's Dev Support: |
Introducing new features to the radio altimeter code to make it ready for ground attenuation effects and noisy environments. Instead of directly reading the altitude from the minimum slant probe on ground, I will be calculating the corresponding SNR (dBm) at each probe and read the RA from the highest returned value. This is a summary of how the new implementation works:
|
First item in the TODO list "New algorithm to improve performance" done and ready for testing. PR description updated and new info included. |
Co-authored-by: 2hwk <[email protected]>
Co-authored-by: 2hwk <[email protected]>
Co-authored-by: 2hwk <[email protected]>
Co-authored-by: 2hwk <[email protected]>
Co-authored-by: 2hwk <[email protected]>
Co-authored-by: 2hwk <[email protected]>
@Taz5150 this probably needs more detailed test instructions for testers |
Well for one this needs to be hooked up the the RA simulation before it has any effect. That's probably one me. |
Alright, noted. I will add a not ready for testing tag, remove it whenever ready |
@@ -7,6 +7,8 @@ | |||
|
|||
## 0.12.0 | |||
|
|||
1. [RA] Realistic RA model based on a probe mesh implementation - @Taz5150 (TazX [Z+2]#0405) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please rebase/merge and move to 0.13.0.
Fixes #[issue_no]
Summary of Changes
This PR features a new Radio-Altimeter model based on the implementation of a pseudo-random probe mesh mimicking its radio beam, given the specs of the Honeywell ALA-52B:
Description
The algorithm will set a mesh of 15 artificial probes with an aperture of +/- 40º horizontally and +/- 20º vertically. When the aircraft is closer to ground, the mesh will be compacted; while when the aircraft gains altitude, the mesh spreads out.
At every Sim frame, the code will read the distance from the aircraft to the ground probe. The probe with minimum estimated received power will be taken as the RA reading (considering to be the first beam signal to be received).
Two new LVars A32NX_RA_1_RAW and A32NX_RA_2_RAWOne new LVar A32NX_RA_RAW has been created to obtain the best RA reading from all the probes in the mess.Each of themRA will be activated/ deactivated as a function of AC bus status.The source code has a debug variable which is set to false by default. If set to true, the console will show received data from the winning probe, as well as other debug messages. For easiness in reading this data, use radalt as a filter within the console. The console will output:
If the spec limits are surpassed (altitude, roll or pitch), or the the AC Bus is not powered, the corresponding RA will read 99999.
Performance wise, this new model has no perceivable impact on FPS.
TODO List
1. New algorithm to improve performance
A new algorithm has been coded and tested. Instead of using a fixed mesh of 100 probes, an adaptive sampling technique has been used to bring down the probe count to just 15 probes.
The algorithm runs in two frames: during the first frame, a coarse mesh of 3 x 5 probes with a rectangular shape is placed on ground. The probe with the highest return power is pre-selected. During the second frame, a new 3 x 5 mesh is created compacted around the selected probe. The probe with the highest received power is the one giving the RA reading.
Blue: Frame 1 Orange: Frame 2
Performance wise, this new algorithm does not seem to have a measurable degradation in FPS as shown below:
2. Integrate RA system electrically
RA1 and RA2 become active/ inactive as a function of A32NX_ELEC_AC_1_BUS_IS_POWERED and A32NX_ELEC_AC_2_BUS_IS_POWERED respectively.
3. Implementation of signal attenuation
As of today, there is no way to obtain surface type to calculate ground attenuation and backscattering. The SURFACE TYPE SimVar only applies to the User, and not to other SimObjects; and nevertheless, it defines "surface type" as a function of the ground texture color, which is not precise at all.
The signal attenuation does take into account distance from the probe to the aircraft, as well as atmospheric attenuation. Also, the specs for the Radio Altimeter specify maximum errors of MAX(1.5ft, 2%). The error has been statistically implemented as a function of probe distance.4. TCAS issue where probes are detected as aircraft
Probes are filtered out and will not appear anymore on TCAS as traffic. A new LVar has been created (A32NX_RA_PROBE_ZERO): if RA is on, the uID of the first probe will be set. If RA is off, the LVar will be set to zero. Since the mesh is created on the same frame sequentially, every probe's uID after the first one will be increase by 1 for a total of 15. The TcasComputer.ts has been updated to filter out every probe within the traffic.
Screenshots (if necessary)
Sample probe mesh representation and console output. Please check the Testing Instructions to understand the different options on probe models.
References
Additional context
Discord username (if different from GitHub): TazX [Z+2]
Testing instructions
For testing purposes within this draft, I have implemented the option of a visual model based on the marshaller stick. You can use the Developer State LVar to control which model to use:- A32NX_DEVELOPER_STATE = 3, will give you the visual (marshaller stick) model.- A32NX_DEVELOPER_STATE != 3, will give you a one point triangular model (invisible)For testing purposes, you can use the Developer State LVar (A32NX_DEVELOPER_STATE) set to '3' to manually activate/ deactivate the RA ('z' to activate the probe mess and 'c' to deactivate it).
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.