Skip to content

Commit

Permalink
feat(brakes): better brakes simulation (#8793)
Browse files Browse the repository at this point in the history
* current state dump

* move brake simulation to aircraft specific module

* adjust wheel SD page to new brake temperature signals

* remove old brake temperature simulation code

* fix tests

* adjust A380 brake properties to more realistic numbers

* add wheel rpm variables to A380X systems

* feat: added quantization of temperature values sent over arinc

* fix: add cutoff for slow rotating wheels

* feat: add simvars for the reported brake temperatures

* refactor: fix linting

* move assignment out of loop

* some fixes

* remove reference to old brake simulation

* add changelog entry

* remove obsolete code

* some fixes in the cooling physics

* fix changelog

* added some small tests

* fix linting

* move changelog entry to end

* fix calculation of brake probe temperature gradient

* couple sound to brake fan instead of brake fan button

* put changelog entry at the end

* remove duplicated entries

* fix compilation error

* fix lint
  • Loading branch information
Gurgel100 authored Nov 17, 2024
1 parent d2f0f52 commit 2f939d3
Show file tree
Hide file tree
Showing 18 changed files with 1,007 additions and 404 deletions.
1 change: 1 addition & 0 deletions .github/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
1. [A380X/FMS] Added SURV Status & Switching page with TCAS fault indication - @Frenkii (Moritz)
1. [FMS] Fix T/D not showing in selected speed - @BlueberryKing (BlueberryKing)
1. [FMS] Fix Pause at T/D not working in selected speed - @BlueberryKing (BlueberryKing)
1. [MISC] Replaced brake temperature simulation with physics based model of brakes - @Gurgel100 (Pascal)

## 0.12.0

Expand Down
16 changes: 12 additions & 4 deletions fbw-a32nx/docs/a320-simvars.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,16 +71,24 @@
- represents the brake temperature of the rear wheels

- A32NX_REPORTED_BRAKE_TEMPERATURE_{1,2,3,4}
- celsius
- represents the reported brake temperature of the rear wheels by the sensor.
- `Arinc429Word<Celsius>`
- represents the reported brake temperature of the main wheels reported by the BSCU.
- It can be different from the brake temperature when the brake fan has been used, because the brake fan will cool
the sensor more than the brakes
- (which have much more energy to dissipate) therefore giving potentially erroneous readings that the pilots must
take into account

- A32NX_BRAKE_FAN
- A32NX_BRAKE_FAN_RUNNING
- boolean
- whether or not the brake fan is running
(brake fan button pressed AND left main landing gear down and locked, reported by BSCU)

- A32NX_BRAKE_FAN_{side}_RUNNING
- boolean
- whether or not the brake fan is running (brake fan button pressed AND left main landing gear down and locked)
- wether or not a brake fan on the corresponding side is running
- {side}
- LEFT
- RIGHT

- A32NX_BRAKE_FAN_BTN_PRESSED
- boolean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1032,7 +1032,7 @@
<TOGGLE_SIMVAR>L:A32NX_BRAKE_FAN_BTN_PRESSED</TOGGLE_SIMVAR>
<SEQ2_EMISSIVE_DRIVES_VISIBILITY>False</SEQ2_EMISSIVE_DRIVES_VISIBILITY>
<SEQ1_CODE>(L:A32NX_BRAKES_HOT, Bool)</SEQ1_CODE>
<SEQ2_CODE>(L:A32NX_BRAKE_FAN, Bool)</SEQ2_CODE>
<SEQ2_CODE>(L:A32NX_BRAKE_FAN_BTN_PRESSED, Bool)</SEQ2_CODE>
<SEQ_POWERED>(L:A32NX_ELEC_AC_2_BUS_IS_POWERED, Bool)</SEQ_POWERED>
<TOOLTIPID>%((L:A32NX_BRAKE_FAN_BTN_PRESSED, Bool))%{if}Turn OFF brake fan%{else}Turn ON brake fan%{end}</TOOLTIPID>
</UseTemplate>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -490,45 +490,46 @@
</Sound>


<Sound WwiseData="true" WwiseEvent="brakefan" NodeName="BASE_LEFT" FadeOutType="2" FadeOutTime="0.5" LocalVar="A32NX_BRAKE_FAN" Units="BOOL" Index="0">
<Sound WwiseData="true" WwiseEvent="brakefan" NodeName="BASE_LEFT" FadeOutType="2" FadeOutTime="0.5" LocalVar="A32NX_BRAKE_FAN_LEFT_RUNNING" Units="BOOL" Index="0">
<Range LowerBound="1.0" />
<WwiseRTPC SimVar="TURB ENG N1" Units="percent" Index="1" RTPCName="SIMVAR_TURB_ENG_N1" />
<Requires LocalVar="A32NX_ELEC_AC_1_BUS_IS_POWERED" Units="Bool" Index="1">
<Range LowerBound="1" />
</Requires>
<WwiseRTPC LocalVar="A32NX_SOUND_EXTERIOR_MASTER" Units="number" Index="0" RTPCName="LOCALVAR_A32NX_EXTERIOR_VOLUME" />
</Sound>

<Sound WwiseData="true" WwiseEvent="brakefan2" NodeName="BASE_RIGHT" FadeOutType="2" FadeOutTime="0.5" LocalVar="A32NX_BRAKE_FAN" Units="BOOL" Index="0">
<Sound WwiseData="true" WwiseEvent="brakefan2" NodeName="BASE_RIGHT" FadeOutType="2" FadeOutTime="0.5" LocalVar="A32NX_BRAKE_FAN_RIGHT_RUNNING" Units="BOOL" Index="0">
<Range LowerBound="1.0" />
<WwiseRTPC SimVar="TURB ENG N1" Units="percent" Index="1" RTPCName="SIMVAR_TURB_ENG_N1" />
<Requires LocalVar="A32NX_ELEC_AC_1_BUS_IS_POWERED" Units="Bool" Index="1">
<Range LowerBound="1" />
</Requires>
<WwiseRTPC LocalVar="A32NX_SOUND_EXTERIOR_MASTER" Units="number" Index="0" RTPCName="LOCALVAR_A32NX_EXTERIOR_VOLUME" />
</Sound>

<Sound WwiseData="true" WwiseEvent="brakefanshut" NodeName="BASE_LEFT" Continuous="false" LocalVar="A32NX_BRAKE_FAN" Units="BOOL" Index="0">
<Sound WwiseData="true" WwiseEvent="brakefanshut" NodeName="BASE_LEFT" Continuous="false" LocalVar="A32NX_BRAKE_FAN_LEFT_RUNNING" Units="BOOL" Index="0">
<Range UpperBound="0" />
<WwiseRTPC SimVar="TURB ENG N1" Units="percent" Index="1" RTPCName="SIMVAR_TURB_ENG_N1" />
<WwiseRTPC LocalVar="A32NX_SOUND_EXTERIOR_MASTER" Units="number" Index="0" RTPCName="LOCALVAR_A32NX_EXTERIOR_VOLUME" />
</Sound>

<Sound WwiseData="true" WwiseEvent="brakefanshut" NodeName="BASE_RIGHT" Continuous="false" LocalVar="A32NX_BRAKE_FAN" Units="BOOL" Index="0">
<Sound WwiseData="true" WwiseEvent="brakefanshut" NodeName="BASE_RIGHT" Continuous="false" LocalVar="A32NX_BRAKE_FAN_RIGHT_RUNNING" Units="BOOL" Index="0">
<Range UpperBound="0" />
<WwiseRTPC SimVar="TURB ENG N1" Units="percent" Index="1" RTPCName="SIMVAR_TURB_ENG_N1" />
<WwiseRTPC LocalVar="A32NX_SOUND_EXTERIOR_MASTER" Units="number" Index="0" RTPCName="LOCALVAR_A32NX_EXTERIOR_VOLUME" />
</Sound>

<Sound WwiseData="true" WwiseEvent="intbrakefan" NodeName="BASE_LEFT" FadeOutType="2" FadeOutTime="0.5" LocalVar="A32NX_BRAKE_FAN" Units="BOOL" Index="0">
<Sound WwiseData="true" WwiseEvent="intbrakefan" NodeName="BASE_LEFT" FadeOutType="2" FadeOutTime="0.5" LocalVar="A32NX_BRAKE_FAN_LEFT_RUNNING" Units="BOOL" Index="0">
<Range LowerBound="1.0" />
<WwiseRTPC SimVar="TURB ENG N1" Units="percent" Index="1" RTPCName="SIMVAR_TURB_ENG_N1" />
</Sound>

<Sound WwiseData="true" WwiseEvent="intbrakefanshut" NodeName="BASE_LEFT" Continuous="false" LocalVar="A32NX_BRAKE_FAN_LEFT_RUNNING" Units="BOOL" Index="0">
<Range UpperBound="0" />
<WwiseRTPC SimVar="TURB ENG N1" Units="percent" Index="1" RTPCName="SIMVAR_TURB_ENG_N1" />
</Sound>

<Sound WwiseData="true" WwiseEvent="intbrakefan" NodeName="BASE_RIGHT" FadeOutType="2" FadeOutTime="0.5" LocalVar="A32NX_BRAKE_FAN_RIGHT_RUNNING" Units="BOOL" Index="0">
<Range LowerBound="1.0" />
<WwiseRTPC SimVar="TURB ENG N1" Units="percent" Index="1" RTPCName="SIMVAR_TURB_ENG_N1" />
<Requires LocalVar="A32NX_ELEC_AC_1_BUS_IS_POWERED" Units="Bool" Index="1">
<Range LowerBound="1" />
</Requires>
</Sound>

<Sound WwiseData="true" WwiseEvent="intbrakefanshut" NodeName="BASE_LEFT" Continuous="false" LocalVar="A32NX_BRAKE_FAN" Units="BOOL" Index="0">
<Sound WwiseData="true" WwiseEvent="intbrakefanshut" NodeName="BASE_RIGHT" Continuous="false" LocalVar="A32NX_BRAKE_FAN_RIGHT_RUNNING" Units="BOOL" Index="0">
<Range UpperBound="0" />
<WwiseRTPC SimVar="TURB ENG N1" Units="percent" Index="1" RTPCName="SIMVAR_TURB_ENG_N1" />
</Sound>
Expand Down
Loading

0 comments on commit 2f939d3

Please sign in to comment.