From 85b9d3959337baf3d5d06c50043ccd46f6439421 Mon Sep 17 00:00:00 2001 From: legoboyvdlp R Date: Sat, 20 Jun 2020 20:52:04 +0100 Subject: [PATCH] Trim air / cabin fans failures --- Nasal/ECAM/ECAM-controller.nas | 2 ++ Nasal/ECAM/ECAM-logic.nas | 44 ++++++++++++++++++++++++++++++---- Nasal/ECAM/ECAM-messages.nas | 24 ++++++++++--------- Systems/a320-aircond.xml | 16 +++++++++---- Systems/a320-fwc.xml | 43 +++++++++++++++++++++++++++++++++ 5 files changed, 110 insertions(+), 19 deletions(-) diff --git a/Nasal/ECAM/ECAM-controller.nas b/Nasal/ECAM/ECAM-controller.nas index ea0bf79f..f137a0d4 100644 --- a/Nasal/ECAM/ECAM-controller.nas +++ b/Nasal/ECAM/ECAM-controller.nas @@ -51,6 +51,7 @@ var warningNodes = { pack12Fault: props.globals.initNode("/ECAM/warnings/logic/pack-1-2-fault"), pack1ResetPb: props.globals.initNode("/ECAM/warnings/logic/reset-pack-1-switch-cmd"), pack2ResetPb: props.globals.initNode("/ECAM/warnings/logic/reset-pack-2-switch-cmd"), + cabinFans: props.globals.initNode("/ECAM/warnings/logic/cabin-fans-fault"), }, Timers: { apuFaultOutput: props.globals.initNode("/ECAM/warnings/timer/apu-fault-output"), @@ -76,6 +77,7 @@ var warningNodes = { pack2Fault: props.globals.initNode("/ECAM/warnings/timer/pack-2-fault-2"), pack1Off: props.globals.initNode("/ECAM/warnings/timer/pack-1-off"), pack2Off: props.globals.initNode("/ECAM/warnings/timer/pack-2-off"), + trimAirFault: props.globals.initNode("/ECAM/warnings/timer/trim-air-fault"), }, Flipflops: { bleed1LowTemp: props.globals.initNode("/ECAM/warnings/logic/bleed-1-low-temp-flipflop-output"), diff --git a/Nasal/ECAM/ECAM-logic.nas b/Nasal/ECAM/ECAM-logic.nas index 19f75313..78a8c42d 100644 --- a/Nasal/ECAM/ECAM-logic.nas +++ b/Nasal/ECAM/ECAM-logic.nas @@ -1716,8 +1716,44 @@ var messages_priority_2 = func { ECAM_controller.warningReset(pack2Off); } + # COND + if (cabFanFault.clearFlag == 0 and (phaseVar <= 2 or phaseVar >= 9 or phaseVar == 6) and warningNodes.Logic.cabinFans.getBoolValue()) { + cabFanFault.active = 1; + cabFanFaultFlow.active = 1; + } else { + ECAM_controller.warningReset(cabFanFault); + ECAM_controller.warningReset(cabFanFaultFlow); + } + + if (trimAirFault.clearFlag == 0 and (phaseVar <= 2 or phaseVar >= 9 or phaseVar == 6) and warningNodes.Timers.trimAirFault.getValue() == 1) { + trimAirFault.active = 1; + + if (systems.PNEU.Fail.trimValveAft.getBoolValue()) { + trimAirFaultAft.active = 1; + } else { + ECAM_controller.warningReset(trimAirFaultAft); + } + + if (systems.PNEU.Fail.trimValveFwd.getBoolValue()) { + trimAirFaultFwd.active = 1; + } else { + ECAM_controller.warningReset(trimAirFaultFwd); + } + + if (systems.PNEU.Fail.trimValveCockpit.getBoolValue()) { + trimAirFaultCkpt.active = 1; + } else { + ECAM_controller.warningReset(trimAirFaultCkpt); + } + } else { + ECAM_controller.warningReset(trimAirFault); + ECAM_controller.warningReset(trimAirFaultAft); + ECAM_controller.warningReset(trimAirFaultFwd); + ECAM_controller.warningReset(trimAirFaultCkpt); + } + # ENG AICE - if (eng1IceClosed.clearFlag == 0 and (phaseVar <= 2 or phaseVar >= 9 or phaseVar == 6) and warningNodes.Timers.eng1AiceNotOpen.getValue() == 1) { + if (eng1IceClosed.clearFlag == 0 and (phaseVar <= 2 or phaseVar >= 9 or phaseVar == 6) and warningNodes.Timers.eng1AiceNotOpen.getValue() == 1) { eng1IceClosed.active = 1; eng1IceClosedIcing.active = 1; } else { @@ -1725,7 +1761,7 @@ var messages_priority_2 = func { ECAM_controller.warningReset(eng1IceClosedIcing); } - if (eng2IceClosed.clearFlag == 0 and (phaseVar <= 2 or phaseVar >= 9 or phaseVar == 6) and warningNodes.Timers.eng2AiceNotOpen.getValue() == 1) { + if (eng2IceClosed.clearFlag == 0 and (phaseVar <= 2 or phaseVar >= 9 or phaseVar == 6) and warningNodes.Timers.eng2AiceNotOpen.getValue() == 1) { eng2IceClosed.active = 1; eng2IceClosedIcing.active = 1; } else { @@ -1733,7 +1769,7 @@ var messages_priority_2 = func { ECAM_controller.warningReset(eng2IceClosedIcing); } - if (eng1IceOpen.clearFlag == 0 and (phaseVar <= 2 or phaseVar >= 9 or phaseVar == 6) and warningNodes.Timers.eng1AiceNotClsd.getValue() == 1) { + if (eng1IceOpen.clearFlag == 0 and (phaseVar <= 2 or phaseVar >= 9 or phaseVar == 6) and warningNodes.Timers.eng1AiceNotClsd.getValue() == 1) { eng1IceOpen.active = 1; eng1IceOpenThrust.active = 1; } else { @@ -1741,7 +1777,7 @@ var messages_priority_2 = func { ECAM_controller.warningReset(eng1IceOpenThrust); } - if (eng2IceOpen.clearFlag == 0 and (phaseVar <= 2 or phaseVar >= 9 or phaseVar == 6) and warningNodes.Timers.eng2AiceNotClsd.getValue() == 1) { + if (eng2IceOpen.clearFlag == 0 and (phaseVar <= 2 or phaseVar >= 9 or phaseVar == 6) and warningNodes.Timers.eng2AiceNotClsd.getValue() == 1) { eng2IceOpen.active = 1; eng2IceOpenThrust.active = 1; } else { diff --git a/Nasal/ECAM/ECAM-messages.nas b/Nasal/ECAM/ECAM-messages.nas index 35bee6bf..b6b13171 100644 --- a/Nasal/ECAM/ECAM-messages.nas +++ b/Nasal/ECAM/ECAM-messages.nas @@ -250,8 +250,8 @@ var warnings = std.Vector.new([ var bleed2FaultPack = warning.new(msg: " -PACK 2.............OFF", colour: "c"), var bleed2FaultXBleed = warning.new(msg: " -X BLEED...........OPEN", colour: "c"), var apuBleedFault = warning.new(msg: "AIR APU BLEED FAULT", colour: "a", aural: 1, light: 1), - var hpValve1Fault = warning.new(msg: "AIR ENG 1 HP VALVE FAULT", colour: "a", aural: 0, light: 0), - var hpValve2Fault = warning.new(msg: "AIR ENG 2 HP VALVE FAULT", colour: "a", aural: 0, light: 0), + var hpValve1Fault = warning.new(msg: "AIR ENG 1 HP VALVE FAULT", colour: "a"), + var hpValve2Fault = warning.new(msg: "AIR ENG 2 HP VALVE FAULT", colour: "a"), var xBleedFault = warning.new(msg: "AIR X BLEED FAULT", colour: "a", aural: 1, light: 1, isMainMsg: 1), var xBleedFaultMan = warning.new(msg: " -X BLEED........MAN CTL", colour: "c"), var xBleedOff = warning.new(msg: " -WING ANTI ICE......OFF", colour: "c"), @@ -292,9 +292,9 @@ var warnings = std.Vector.new([ var eng1BleedNotClsdOff = warning.new(msg: " -ENG 1 BLEED........OFF", colour: "c"), var eng2BleedNotClsd = warning.new(msg: "AIR ENG 2 BLEED NOT CLSD", colour: "a", aural: 1, light: 1, isMainMsg: 1), var eng2BleedNotClsdOff = warning.new(msg: " -ENG 2 BLEED........OFF", colour: "c"), - var bleedMonFault = warning.new(msg: "BLEED MONITORING FAULT", colour: "a", aural: 0, light: 0, isMainMsg: 1), - var bleedMon1Fault = warning.new(msg: "BLEED MONIT SYS 1 FAULT", colour: "a", aural: 0, light: 0, isMainMsg: 1), - var bleedMon2Fault = warning.new(msg: "BLEED MONIT SYS 2 FAULT", colour: "a", aural: 0, light: 0, isMainMsg: 1), + var bleedMonFault = warning.new(msg: "BLEED MONITORING FAULT", colour: "a", isMainMsg: 1), + var bleedMon1Fault = warning.new(msg: "BLEED MONIT SYS 1 FAULT", colour: "a", isMainMsg: 1), + var bleedMon2Fault = warning.new(msg: "BLEED MONIT SYS 2 FAULT", colour: "a", isMainMsg: 1), # PACK var pack12Fault = warning.new(msg: "AIR PACK 1+2 FAULT", colour: "a", aural: 1, light: 1, isMainMsg: 1), @@ -322,10 +322,12 @@ var warnings = std.Vector.new([ var pack2FaultOff = warning.new(msg: " -PACK 2.............OFF", colour: "c"), var pack1Off = warning.new(msg: "AIR PACK 1 OFF", colour: "a", aural: 1, light: 1, isMainMsg: 1), var pack2Off = warning.new(msg: "AIR PACK 2 OFF", colour: "a", aural: 1, light: 1, isMainMsg: 1), - var pack1RegulFlt = warning.new(msg: "AIR PACK 1 REGUL FAULT", colour: "a", aural: 0, light: 0, isMainMsg: 1), - var pack2RegulFlt = warning.new(msg: "AIR PACK 2 REGUL FAULT", colour: "a", aural: 0, light: 0, isMainMsg: 1), - var aftCrgVentFlt = warning.new(msg: "AIR AFT CRG VENT FAULT", colour: "a", aural: 0, light: 0, isMainMsg: 1), - var fwdCrgVentFlt = warning.new(msg: "AIR FWD CRG VENT FAULT", colour: "a", aural: 0, light: 0, isMainMsg: 1), + var cabFanFault = warning.new(msg: "COND L+R CAB FAN FAULT", colour: "a", aural: 1, light: 1, isMainMsg: 1), + var cabFanFaultFlow = warning.new(msg: " -PACK FLOW...........HI", colour: "c"), + var trimAirFault = warning.new(msg: "COND TRIM AIR SYS FAULT", colour: "a", isMainMsg: 1), + var trimAirFaultAft = warning.new(msg: " -AFT CAB TRIM VALVE", colour: "c"), + var trimAirFaultFwd = warning.new(msg: " -FWD CAB TRIM VALVE", colour: "c"), + var trimAirFaultCkpt = warning.new(msg: " -CKPT TRIM VALVE", colour: "c"), # Eng AICE var eng1IceClosed = warning.new(msg: "ANTI ICE ENG1 VALVE CLSD", colour: "a", aural: 1, light: 1, isMainMsg: 1), @@ -364,9 +366,9 @@ var warnings = std.Vector.new([ var wingIceROpenThrust = warning.new(msg: " THRUST LIM PENALTY", colour: "c"), var wingIceOpenGnd = warning.new(msg: "WING A.ICE OPEN ON GND", colour: "a", aural: 1, light: 1, isMainMsg: 1), var wingIceOpenGndShut = warning.new(msg: " -WING ANTI ICE......OFF", colour: "c"), - var wingIceLHiPr = warning.new(msg: "WING A.ICE L HI PR", colour: "a", aural: 0, light: 0, isMainMsg: 1), + var wingIceLHiPr = warning.new(msg: "WING A.ICE L HI PR", colour: "a", isMainMsg: 1), var wingIceLHiPrThrust = warning.new(msg: " THRUST LIM PENTALTY", colour: "c"), - var wingIceRHiPr = warning.new(msg: "WING A.ICE R HI PR", colour: "a", aural: 0, light: 0, isMainMsg: 1), + var wingIceRHiPr = warning.new(msg: "WING A.ICE R HI PR", colour: "a", isMainMsg: 1), var wingIceRHiPrThrust = warning.new(msg: " THRUST LIM PENTALTY", colour: "c"), # FIRE det fault diff --git a/Systems/a320-aircond.xml b/Systems/a320-aircond.xml index cd533936..2e501b70 100644 --- a/Systems/a320-aircond.xml +++ b/Systems/a320-aircond.xml @@ -313,7 +313,7 @@ - /controls/pneumatics/switches/hot-air + /systems/air-conditioning/valves/hot-air 0 @@ -373,7 +373,7 @@ - /controls/pneumatics/switches/hot-air + /systems/air-conditioning/valves/hot-air 0 @@ -413,7 +413,7 @@ - /controls/pneumatics/switches/hot-air + /systems/air-conditioning/valves/hot-air 0 @@ -766,12 +766,20 @@ + + + + /controls/switches/pneumatics/cabin-fans eq 1 + /systems/failures/pneumatics/cabin-fans eq 0 + + + /systems/air-conditioning/recirc/recirc-factor - /controls/switches/pneumatics/cabin-fans + /systems/air-conditioning/recirc/cabin-fans /systems/air-conditioning/mass-flow-fresh-kg_s /systems/air-conditioning/mass-flow-fresh-kg_s diff --git a/Systems/a320-fwc.xml b/Systems/a320-fwc.xml index d66bff07..537e15e8 100644 --- a/Systems/a320-fwc.xml +++ b/Systems/a320-fwc.xml @@ -314,6 +314,13 @@ 0.0166666 + + Timer for the ECAM system + /ECAM/warnings/logic/trim-air-fault-input + 100 + 0.2 + + @@ -1160,6 +1167,42 @@ + + + + /systems/electrical/bus/ac-ess lt 110 + + + /ECAM/warning-phase eq 1 + /ECAM/warning-phase eq 10 + + /systems/air-conditioning/valves/hot-air eq 0 + + + + + + + + + /systems/failures/pneumatics/trim-valve-cabin-aft eq 1 + /systems/failures/pneumatics/trim-valve-cabin-fwd eq 1 + /systems/failures/pneumatics/trim-valve-cockpit eq 1 + + /ECAM/warnings/logic/trim-air-fault-inhibit eq 0 + + + + + + + /systems/failures/pneumatics/cabin-fans eq 1 + /systems/electrical/bus/dc-1 ge 25 + /systems/electrical/bus/dc-2 ge 25 + /systems/electrical/bus/ac-1 ge 110 + /systems/electrical/bus/ac-2 ge 110 + +