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(hyd): Simple hydraulic temperature simulation #7573

Merged
Merged
Show file tree
Hide file tree
Changes from 52 commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
2bb6230
first proto
crocket63 Oct 28, 2022
7435fc0
feat(sd): add OVHT indication to HYD page
lukecologne Oct 28, 2022
c334bf9
added faults lvars
crocket63 Oct 28, 2022
7e3f3c4
Update CHANGELOG.md
crocket63 Oct 28, 2022
d5957f3
ecam faults
crocket63 Oct 28, 2022
421da2f
added pump failures
crocket63 Oct 29, 2022
7570d59
pumps heats circuit fluid
crocket63 Oct 29, 2022
39502db
fault logic reworked
crocket63 Oct 29, 2022
2bdf2bc
EWD formatting
crocket63 Oct 29, 2022
792bec3
Update a320-simvars.md
crocket63 Oct 29, 2022
240ee89
feat(sd): add ELEC PUMP OVHT indication
lukecologne Oct 29, 2022
b6abd92
Update electrical_pump_physics.rs
crocket63 Oct 29, 2022
0747ba9
Merge branch 'feat_hyd_temperature_simulation' of https://github.com/…
crocket63 Oct 29, 2022
bf6db36
pump damaged do not consume current
crocket63 Oct 29, 2022
0148d8b
fix tests
crocket63 Oct 29, 2022
3082560
Merge branch 'master' into feat_hyd_temperature_simulation
crocket63 Oct 30, 2022
cb4695c
Update mod.rs
crocket63 Oct 30, 2022
231e7e3
fix elec pump staying active when not spinning
crocket63 Oct 30, 2022
2d9bffa
fix edp spinning when damaged
crocket63 Oct 30, 2022
3de52f6
some tests
crocket63 Oct 30, 2022
664328f
Update PseudoFWC.tsx
crocket63 Oct 30, 2022
a5f9f1d
clean up
crocket63 Oct 31, 2022
3b4c05e
removed failing test
crocket63 Oct 31, 2022
5233938
fix ptu heating only in one direction
crocket63 Nov 3, 2022
e4adcbd
Merge branch 'master' into feat_hyd_temperature_simulation
crocket63 Nov 3, 2022
05a1e40
generic pump identifiers
crocket63 Nov 14, 2022
0e081a4
Merge branch 'master' of https://github.com/flybywiresim/a32nx into f…
crocket63 Nov 14, 2022
d2d9ea7
fix merge
crocket63 Nov 14, 2022
ed39962
test update
crocket63 Nov 18, 2022
f17c7f6
Merge branch 'master' into feat_hyd_temperature_simulation
crocket63 Nov 18, 2022
e39005a
merged with latest rust changes
crocket63 Nov 18, 2022
b427bc9
update test profile fixing stack overflow
crocket63 Nov 18, 2022
1c9e260
fix OVHT SD ecam that disapeared
crocket63 Nov 18, 2022
0867664
clippy
crocket63 Nov 18, 2022
80735b5
Merge branch 'master' into feat_hyd_temperature_simulation
crocket63 Nov 21, 2022
a7d6d79
Merge branch 'master' into feat_hyd_temperature_simulation
beheh Dec 2, 2022
7bbdc60
Merge branch 'master' into feat_hyd_temperature_simulation
crocket63 Dec 14, 2022
cf33b34
Merge branch 'master' into feat_hyd_temperature_simulation
crocket63 Dec 14, 2022
27fb284
Update CHANGELOG.md
crocket63 Dec 19, 2022
9283b94
Update src/systems/a320_systems_wasm/src/lib.rs
crocket63 Dec 19, 2022
36bfa16
Merge branch 'feat_hyd_temperature_simulation' of https://github.com/…
crocket63 Dec 19, 2022
78d8d47
Update src/systems/systems/src/hydraulic/mod.rs
crocket63 Dec 19, 2022
e9acedf
removed vectors
crocket63 Dec 19, 2022
7b2a617
Merge branch 'feat_hyd_temperature_simulation' of https://github.com/…
crocket63 Dec 19, 2022
296b57f
Update src/systems/systems/src/hydraulic/mod.rs
crocket63 Dec 19, 2022
a19388b
Update src/systems/systems/src/hydraulic/mod.rs
crocket63 Dec 19, 2022
c8d4100
Update src/systems/systems/src/hydraulic/mod.rs
crocket63 Dec 19, 2022
ae0c3d0
Update mod.rs
crocket63 Dec 19, 2022
e7483f7
Merge branch 'feat_hyd_temperature_simulation' of https://github.com/…
crocket63 Dec 19, 2022
11cf1f6
Merge branch 'master' into feat_hyd_temperature_simulation
lukecologne Dec 19, 2022
9d41604
fix(hyd): fix use imports after merge
lukecologne Dec 19, 2022
9d29120
Merge branch 'master' into feat_hyd_temperature_simulation
crocket63 Dec 20, 2022
e0e63ed
Merge branch 'master' into feat_hyd_temperature_simulation
crocket63 Dec 21, 2022
1bd5fa9
Merge branch 'master' into feat_hyd_temperature_simulation
crocket63 Dec 22, 2022
439b748
fix ptu overheating when theres fluid
crocket63 Dec 22, 2022
0600b41
Merge branch 'master' into feat_hyd_temperature_simulation
crocket63 Dec 27, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
1. [ATSU] Fix LSK6L not returning to ATSU DATALINK page in ATC MENU - @BravoMike99 (Bruno_pt99#5802)
1. [HYD] Trimmable physical assemblies - @Crocket63 (crocket)
1. [HYD] Simulation of the rudder mechanical assembly and yaw dampers - @Crocket63 (crocket)
1. [HYD] Simple temperature simulation - @Crocket63 (crocket)
1. [FLIGHTMODEL] Reduced flap induced drag - @donstim (donbikes#4084)

## 0.9.0
Expand Down
15 changes: 15 additions & 0 deletions docs/a320-simvars.md
Original file line number Diff line number Diff line change
Expand Up @@ -808,6 +808,14 @@
- BLUE
- YELLOW

- A32NX_HYD_{loop_name}_RESERVOIR_OVHT
- Boolean
- Reservoir of {loop_name} hydraulic circuit is overheating
- {loop_name}
- GREEN
- BLUE
- YELLOW

- A32NX_HYD_{loop_name}_EDPUMP_ACTIVE
- Bool
- Engine driven pump of {loop_name} hydraulic circuit is active
Expand Down Expand Up @@ -887,6 +895,13 @@
- BLUE
- YELLOW

- A32NX_HYD_{loop_name}_EPUMP_OVHT
- Bool
- Electric pump of {loop_name} hydraulic circuit is overheating
- {loop_name}
- BLUE
- YELLOW

- A32NX_HYD_{loop_name}_PUMP_1_FIRE_VALVE_OPENED
- Bool
- Engine driven pump of {loop_name} hydraulic circuit can receive hydraulic fluid
Expand Down
6 changes: 6 additions & 0 deletions src/failures/src/a320.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export const A320Failure = Object.freeze({
Sec3Failure: 27004,
Fcdc1Failure: 27005,
Fcdc2Failure: 27006,

GreenReservoirLeak: 29000,
BlueReservoirLeak: 29001,
YellowReservoirLeak: 29002,
Expand All @@ -22,6 +23,11 @@ export const A320Failure = Object.freeze({
GreenReservoirReturnLeak: 29006,
BlueReservoirReturnLeak: 29007,
YellowReservoirReturnLeak: 29008,
GreenEdpOverheat: 29009,
BlueEpumpOverheat: 29010,
YellowEdpOverheat: 29011,
YellowEpumpOverheat: 29012,

LeftPfdDisplay: 31000,
RightPfdDisplay: 31001,

Expand Down
9 changes: 9 additions & 0 deletions src/instruments/src/Common/EWDMessages.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,15 @@ const EWDMessages = {
'270055701': '\x1b<4m\x1b4mF/CTL\x1bm FCDC 2 FAULT',
'290031001': '\x1b<4m*HYD',
'290031201': '\x1b<4m*HYD',
'290012601': '\x1b<4m\x1b4mHYD\x1bm B RSVR OVHT',
'290012602': '\x1b<5m -BLUE ELEC PUMP.....OFF',
'290012701': '\x1b<4m\x1b4mHYD\x1bm Y RSVR OVHT',
'290012702': '\x1b<5m -PTU................OFF',
'290012703': '\x1b<5m -YELLOW ENG 2 PUMP..OFF',
'290012704': '\x1b<5m -YELLOW ELEC PUMP...OFF',
'290012801': '\x1b<4m\x1b4mHYD\x1bm G RSVR OVHT',
'290012802': '\x1b<5m -PTU................OFF',
'290012803': '\x1b<5m -GREEN ENG 1 PUMP...OFF',
crocket63 marked this conversation as resolved.
Show resolved Hide resolved
'308118601': '\x1b<4m\x1b4mSEVERE ICE\x1bm DETECTED',
'308118602': '\x1b5m -WING ANTI ICE.......ON',
'308118603': '\x1b5m -ENG MOD SEL........IGN',
Expand Down
4 changes: 4 additions & 0 deletions src/instruments/src/EFB/failures-orchestrator-provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ const createOrchestrator = () => new FailuresOrchestrator('A32NX', [
[29, A320Failure.GreenReservoirReturnLeak, 'Green reservoir return leak'],
[29, A320Failure.BlueReservoirReturnLeak, 'Blue reservoir return leak'],
[29, A320Failure.YellowReservoirReturnLeak, 'Yellow reservoir return leak'],
[29, A320Failure.GreenEdpOverheat, 'Green engine pump overheat'],
[29, A320Failure.BlueEpumpOverheat, 'Blue electric pump overheat'],
[29, A320Failure.YellowEdpOverheat, 'Yellow engine pump overheat'],
[29, A320Failure.YellowEpumpOverheat, 'Yellow electric pump overheat'],

[31, A320Failure.LeftPfdDisplay, 'Captain PFD display'],
[31, A320Failure.RightPfdDisplay, 'F/O PFD display'],
Expand Down
58 changes: 58 additions & 0 deletions src/instruments/src/EWD/elements/PseudoFWC.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -193,11 +193,17 @@ const PseudoFWC: React.FC = () => {
const [blueLP] = useSimVar('L:A32NX_HYD_BLUE_EDPUMP_LOW_PRESS', 'bool', 500);
const [blueSysPressurised] = useSimVar('L:A32NX_HYD_BLUE_SYSTEM_1_SECTION_PRESSURE_SWITCH', 'bool', 500);
const [blueRvrLow] = useSimVar('L:A32NX_HYD_BLUE_RESERVOIR_LEVEL_IS_LOW', 'bool', 500);

const [yellowRvrOvht] = useSimVar('L:A32NX_HYD_YELLOW_RESERVOIR_OVHT', 'bool', 500);
const [greenRvrOvht] = useSimVar('L:A32NX_HYD_GREEN_RESERVOIR_OVHT', 'bool', 500);
const [blueRvrOvht] = useSimVar('L:A32NX_HYD_BLUE_RESERVOIR_OVHT', 'bool', 500);
const [blueElecPumpPBAuto] = useSimVar('L:A32NX_OVHD_HYD_EPUMPB_PB_IS_AUTO', 'bool', 500);
const [yellowLP] = useSimVar('L:A32NX_HYD_YELLOW_EDPUMP_LOW_PRESS', 'bool', 500);
const [yellowSysPressurised] = useSimVar('L:A32NX_HYD_YELLOW_SYSTEM_1_SECTION_PRESSURE_SWITCH', 'bool', 500);
const [eng1pumpPBisAuto] = useSimVar('L:A32NX_OVHD_HYD_ENG_1_PUMP_PB_IS_AUTO', 'bool', 500);
const [eng2pumpPBisAuto] = useSimVar('L:A32NX_OVHD_HYD_ENG_2_PUMP_PB_IS_AUTO', 'bool', 500);
const [yepumpPBisAuto] = useSimVar('L:A32NX_OVHD_HYD_EPUMPY_PB_IS_AUTO', 'bool', 500);
const [ptuIsAuto] = useSimVar('L:A32NX_OVHD_HYD_PTU_PB_IS_AUTO', 'bool', 500);
const [hydPTU] = useSimVar('L:A32NX_HYD_PTU_ON_ECAM_MEMO', 'bool', 500);
const [ratDeployed] = useSimVar('L:A32NX_HYD_RAT_STOW_POSITION', 'percent over 100', 500);

Expand Down Expand Up @@ -1181,6 +1187,51 @@ const PseudoFWC: React.FC = () => {
sysPage: -1,
side: 'LEFT',
},
2900126: // *HYD - Blue reservoir overheat
{
flightPhaseInhib: [3, 4, 5, 7, 8],
simVarIsActive: blueRvrOvht,
whichCodeToReturn: [
0,
blueElecPumpPBAuto ? 1 : null,
],
codesToReturn: ['290012601', '290012602'],
memoInhibit: false,
failure: 2,
sysPage: 4,
side: 'LEFT',
},
2900127: // *HYD - Yellow reservoir overheat
{
flightPhaseInhib: [3, 4, 5, 7, 8],
simVarIsActive: yellowRvrOvht,
whichCodeToReturn: [
0,
ptuIsAuto ? 1 : null,
eng2pumpPBisAuto ? 2 : null,
!yepumpPBisAuto ? 3 : null,
],
codesToReturn: ['290012701', '290012702', '290012703', '290012704'],
memoInhibit: false,
failure: 2,
sysPage: 4,
side: 'LEFT',
},
2900128: // *HYD - Green reservoir overheat
{
flightPhaseInhib: [3, 4, 5, 7, 8],
simVarIsActive: greenRvrOvht,
whichCodeToReturn: [
0,
ptuIsAuto ? 1 : null,
eng1pumpPBisAuto ? 2 : null,
],
codesToReturn: ['290012801', '290012802', '290012803'],
memoInhibit: false,
failure: 2,
sysPage: 4,
side: 'LEFT',
},
2900310: // *HYD - Blue
{
flightPhaseInhib: [4, 5],
Expand Down Expand Up @@ -1897,6 +1948,7 @@ const PseudoFWC: React.FC = () => {
autoThrustStatus,
blueElecPumpPBAuto,
blueRvrLow,
blueRvrOvht,
brakeFan,
cabAltSetResetState1,
cabAltSetResetState2,
Expand Down Expand Up @@ -1933,10 +1985,12 @@ const PseudoFWC: React.FC = () => {
eng1AntiIce,
eng1FireTest,
engine1State,
eng1pumpPBisAuto,
eng2Agent1PB,
eng2Agent2PB,
eng2AntiIce,
eng2FireTest,
eng2pumpPBisAuto,
engine2State,
engDualFault,
engSelectorPosition,
Expand All @@ -1958,6 +2012,7 @@ const PseudoFWC: React.FC = () => {
gpwsFlaps3,
gpwsTerrOff,
greenHydEng1PBAuto,
greenRvrOvht,
height1Failed,
height2Failed,
hydPTU,
Expand All @@ -1984,6 +2039,7 @@ const PseudoFWC: React.FC = () => {
packOffNotFailure2,
parkBrake,
predWSOn,
ptuIsAuto,
ratDeployed,
recallReset,
rightOuterInnerValve,
Expand All @@ -2008,6 +2064,8 @@ const PseudoFWC: React.FC = () => {
usrStartRefueling,
wingAntiIce,
voiceVHF3,
yellowRvrOvht,
yepumpPBisAuto,
]);

useEffect(() => {
Expand Down
26 changes: 26 additions & 0 deletions src/instruments/src/SD/Pages/Hyd/Hyd.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ export const HydPage = () => {

const [ACBus1IsPowered] = useSimVar('L:A32NX_ELEC_AC_1_BUS_IS_POWERED', 'bool', 1000);

const [blueElecPumpOvht] = useSimVar('L:A32NX_HYD_BLUE_EPUMP_OVHT', 'bool', 1000);

const [engine1Running, setEngine1Running] = useState(false);
const [engine2Running, setEngine2Running] = useState(false);

Expand Down Expand Up @@ -111,6 +113,13 @@ export const HydPage = () => {
>
ELEC
</text>
<text
className={blueElecPumpOvht ? 'Large Amber' : 'Hide'}
x={420}
y={414}
>
OVHT
</text>

<YellowElecPump pumpPushbuttonOn={yellowElectricPumpStatus} pressure={yellowPressure} enginePumpPressureLowSwitch={!yellowPumpPressurisedSwitch} />

Expand Down Expand Up @@ -255,6 +264,10 @@ const HydReservoir = ({ system, x, y, lowLevel } : HydReservoirProps) => {

const [lowAirPress] = useSimVar(`L:A32NX_HYD_${system}_RESERVOIR_AIR_PRESSURE_IS_LOW`, 'boolean', 1000);

// The overheat indication should be computed by the EIS itself from the numerical temperature value,
// by applying a hysteresis logic. For now, we just use a boolean from the hydraulics directly.
const [overheat] = useSimVar(`L:A32NX_HYD_${system}_RESERVOIR_OVHT`, 'boolean', 1000);

const fluidLevelInLitres = fluidLevel * litersPerGallon;

const values = levels[system];
Expand Down Expand Up @@ -282,6 +295,10 @@ const HydReservoir = ({ system, x, y, lowLevel } : HydReservoirProps) => {

<text className={lowAirPress ? 'Large Amber' : 'Hide'} x={12} y={-72}>LO AIR</text>
<text className={lowAirPress ? 'Large Amber' : 'Hide'} x={12} y={-45}>PRESS</text>

{ /* Not sure about the exact placement, have to wait for an IRL ref */ }
<text className={overheat ? 'Large Amber' : 'Hide'} x={20} y={-5}>OVHT</text>

</SvgGroup>
);
};
Expand All @@ -295,6 +312,8 @@ type YellowElecPumpProps = {
const YellowElecPump = ({ pumpPushbuttonOn, pressure, enginePumpPressureLowSwitch }: YellowElecPumpProps) => {
const [ACBus2IsPowered] = useSimVar('L:A32NX_ELEC_AC_2_BUS_IS_POWERED', 'bool', 1000);

const [yellowElecPumpOvht] = useSimVar('L:A32NX_HYD_YELLOW_EPUMP_OVHT', 'bool', 1000);

let elecHorizontalLineFormat: string;
let verticalLineFormat: string;
let elecTriangleFill: number;
Expand Down Expand Up @@ -326,6 +345,13 @@ const YellowElecPump = ({ pumpPushbuttonOn, pressure, enginePumpPressureLowSwitc
>
ELEC
</text>
<text
className={yellowElecPumpOvht ? 'Large Amber' : 'Hide'}
x={676}
y={322}
>
OVHT
</text>
<Triangle x={642} y={283} scale={4 / 3} colour={elecTriangleColour} fill={elecTriangleFill} orientation={-90} />
<line className={elecHorizontalLineFormat} x1={631} y1={283} x2={642} y2={283} />
<line className={verticalLineFormat} x1={630} y1={217} x2={630} y2={283} />
Expand Down
12 changes: 8 additions & 4 deletions src/systems/a320_hydraulic_simulation_graphs/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ use systems::hydraulic::*;
use systems::{
electrical::{test::TestElectricitySource, ElectricalBus, Electricity},
shared::{
update_iterator::FixedStepLoop, ElectricalBusType, HydraulicColor, PotentialOrigin,
ReservoirAirPressure,
update_iterator::FixedStepLoop, AirbusElectricPumpId, AirbusEngineDrivenPumpId,
ElectricalBusType, HydraulicColor, PotentialOrigin, ReservoirAirPressure,
},
simulation::{
test::{SimulationTestBed, TestBed},
Expand Down Expand Up @@ -358,15 +358,19 @@ fn hydraulic_loop(context: &mut InitContext, loop_color: HydraulicColor) -> Hydr
fn electric_pump(context: &mut InitContext) -> ElectricPump {
ElectricPump::new(
context,
"DEFAULT",
AirbusElectricPumpId::Green,
ElectricalBusType::AlternatingCurrentGndFltService,
ElectricCurrent::new::<ampere>(45.),
PumpCharacteristics::a320_electric_pump(),
)
}

fn _engine_driven_pump(context: &mut InitContext) -> EngineDrivenPump {
EngineDrivenPump::new(context, "DEFAULT", PumpCharacteristics::a320_edp())
EngineDrivenPump::new(
context,
AirbusEngineDrivenPumpId::Green,
PumpCharacteristics::a320_edp(),
)
}

struct A320TestPneumatics {
Expand Down
Loading