From d5959f03297b92dc92e3e8557961ee555c557f5e Mon Sep 17 00:00:00 2001 From: Jonathan Redpath Date: Wed, 24 Nov 2021 18:54:29 +0000 Subject: [PATCH 1/3] Add improved dual failure --- Nasal/ECAM/ECAM-logic.nas | 18 +------------ Systems/a320-fwc.xml | 55 ++++++++++++++++++++++++++++++++++----- 2 files changed, 50 insertions(+), 23 deletions(-) diff --git a/Nasal/ECAM/ECAM-logic.nas b/Nasal/ECAM/ECAM-logic.nas index 7b6211a3..df2a5eec 100644 --- a/Nasal/ECAM/ECAM-logic.nas +++ b/Nasal/ECAM/ECAM-logic.nas @@ -3,7 +3,7 @@ # props.nas: -var dualFailNode = props.globals.initNode("/ECAM/dual-failure-enabled", 0, "BOOL"); +var dualFailNode = props.globals.initNode("/ECAM/warnings/logic/eng/dual-failure", 0, "BOOL"); var apWarn = props.globals.getNode("/it-autoflight/output/ap-warning", 1); var athrWarn = props.globals.getNode("/it-autoflight/output/athr-warning", 1); @@ -3642,19 +3642,3 @@ var messages_right_memo = func { adirs_switch.active = 0; } } - -setlistener("/engines/engine[0]/state", func() { - if ((state1Node.getValue() != 3 and state2Node.getValue() != 3) and !pts.Fdm.JSBsim.Position.wow.getBoolValue()) { - dualFailNode.setBoolValue(1); - } else { - dualFailNode.setBoolValue(0); - } -}, 0, 0); - -setlistener("/engines/engine[1]/state", func() { - if ((state1Node.getValue() != 3 and state2Node.getValue() != 3) and !pts.Fdm.JSBsim.Position.wow.getBoolValue()) { - dualFailNode.setBoolValue(1); - } else { - dualFailNode.setBoolValue(0); - } -}, 0, 0); diff --git a/Systems/a320-fwc.xml b/Systems/a320-fwc.xml index abc66dd1..e177faab 100644 --- a/Systems/a320-fwc.xml +++ b/Systems/a320-fwc.xml @@ -1823,7 +1823,7 @@ /ECAM/timer/ground-calc eq 0 - /ECAM/dual-failure-enabled eq 0 + /ECAM/warnings/logic/eng/dual-failure eq 0 @@ -1870,7 +1870,7 @@ /ECAM/timer/ground-calc eq 0 - /ECAM/dual-failure-enabled eq 0 + /ECAM/warnings/logic/eng/dual-failure eq 0 @@ -2752,6 +2752,49 @@ + + + + /engines/engine[0]/n2-actual lt 59.4 + /engines/engine[1]/n2-actual lt 59.4 + + + + + /ECAM/warnings/logic/eng/dual-failure-5-sec-input + 0.5 + 100 + + + + + /controls/engines/engine[1]/fire-btn + 0.1 + 1.0 + + + + + + /ECAM/timer/ground-calc eq 0 + + /ECAM/warnings/logic/eng/eng-1-fire-btn-timer eq 1 + /controls/engines/engine[1]/fire-btn eq 0 + + + + /controls/engines/engine[0]/fire-btn eq 1 + /controls/engines/engine[1]/fire-btn eq 1 + + + /controls/engines/engine[0]/cutoff-switch eq 1 + /controls/engines/engine[1]/cutoff-switch eq 1 + + /ECAM/warnings/logic/eng/dual-failure-5-sec eq 1 + + + + @@ -2818,7 +2861,7 @@ /engines/engine[0]/n2-actual ge 59.4 - /ECAM/dual-failure-enabled eq 1 + /ECAM/warnings/logic/eng/dual-failure eq 1 @@ -2826,7 +2869,7 @@ /engines/engine[1]/n2-actual ge 59.4 - /ECAM/dual-failure-enabled eq 1 + /ECAM/warnings/logic/eng/dual-failure eq 1 @@ -2891,7 +2934,7 @@ /ECAM/phases/timer/acconfig-running eq 0 - /ECAM/dual-failure-enabled eq 0 + /ECAM/warnings/logic/eng/dual-failure eq 0 @@ -2912,7 +2955,7 @@ /ECAM/phases/timer/acconfig-running eq 0 - /ECAM/dual-failure-enabled eq 0 + /ECAM/warnings/logic/eng/dual-failure eq 0 From 8599c12b2ac029f9f27e1af493e119fd8527c128 Mon Sep 17 00:00:00 2001 From: Jonathan Redpath Date: Wed, 24 Nov 2021 18:56:45 +0000 Subject: [PATCH 2/3] Typo --- Systems/a320-fwc.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Systems/a320-fwc.xml b/Systems/a320-fwc.xml index e177faab..568bf8e2 100644 --- a/Systems/a320-fwc.xml +++ b/Systems/a320-fwc.xml @@ -2767,7 +2767,7 @@ - + /controls/engines/engine[1]/fire-btn 0.1 1.0 @@ -2778,7 +2778,7 @@ /ECAM/timer/ground-calc eq 0 - /ECAM/warnings/logic/eng/eng-1-fire-btn-timer eq 1 + /ECAM/warnings/logic/eng/eng-2-fire-btn-timer eq 1 /controls/engines/engine[1]/fire-btn eq 0 From bbedfd3656f8a5a68c56803b855f871e6966077d Mon Sep 17 00:00:00 2001 From: Jonathan Redpath Date: Thu, 25 Nov 2021 20:39:19 +0000 Subject: [PATCH 3/3] Revise GEN fault engine logic --- Nasal/ECAM/ECAM-logic.nas | 4 +- Systems/a320-fwc-phases.xml | 32 +--------------- Systems/a320-fwc.xml | 75 +++++++++++++++++++++++++++++++++++-- 3 files changed, 76 insertions(+), 35 deletions(-) diff --git a/Nasal/ECAM/ECAM-logic.nas b/Nasal/ECAM/ECAM-logic.nas index df2a5eec..987914b4 100644 --- a/Nasal/ECAM/ECAM-logic.nas +++ b/Nasal/ECAM/ECAM-logic.nas @@ -1920,7 +1920,7 @@ var messages_priority_2 = func { } # GEN 1 FAULT - if (gen1fault.clearFlag == 0 and warningNodes.Flipflops.gen1Fault.getValue() and (phaseVar2 == 2 or phaseVar2 == 3 or phaseVar2 == 6 or phaseVar2 == 9)) { + if (gen1fault.clearFlag == 0 and warningNodes.Flipflops.gen1Fault.getValue() == 1 and (phaseVar2 == 2 or phaseVar2 == 3 or phaseVar2 == 6 or phaseVar2 == 9)) { gen1fault.active = 1; if (!warningNodes.Flipflops.gen1FaultOnOff.getValue()) { gen1faultGen.active = 1; @@ -1950,7 +1950,7 @@ var messages_priority_2 = func { } # GEN 2 FAULT - if (gen2fault.clearFlag == 0 and warningNodes.Flipflops.gen2Fault.getValue() and (phaseVar2 == 2 or phaseVar2 == 3 or phaseVar2 == 6 or phaseVar2 == 9)) { + if (gen2fault.clearFlag == 0 and warningNodes.Flipflops.gen2Fault.getValue() == 1 and (phaseVar2 == 2 or phaseVar2 == 3 or phaseVar2 == 6 or phaseVar2 == 9)) { gen2fault.active = 1; if (!warningNodes.Flipflops.gen2FaultOnOff.getValue()) { gen2faultGen.active = 1; diff --git a/Systems/a320-fwc-phases.xml b/Systems/a320-fwc-phases.xml index 5dbd7e02..3431cabf 100644 --- a/Systems/a320-fwc-phases.xml +++ b/Systems/a320-fwc-phases.xml @@ -141,39 +141,11 @@ - - - - - /ECAM/phases/timer/eng1idle-output eq 0 - /controls/engines/engine[0]/cutoff-switch eq 1 - - - /ECAM/timer/ground-calc eq 1 - /ECAM/phases/timer/eng1idle eq 0 - - - - - - - - - /ECAM/phases/timer/eng2idle-output eq 0 - /controls/engines/engine[1]/cutoff-switch eq 1 - - - /ECAM/timer/ground-calc eq 1 - /ECAM/phases/timer/eng2idle eq 0 - - - - - /ECAM/phases/phase-calculation/engine-1-off eq 1 - /ECAM/phases/phase-calculation/engine-2-off eq 1 + /ECAM/warnings/logic/eng/JE1NORUN eq 1 + /ECAM/warnings/logic/eng/JE2NORUN eq 1 diff --git a/Systems/a320-fwc.xml b/Systems/a320-fwc.xml index 568bf8e2..a88998b0 100644 --- a/Systems/a320-fwc.xml +++ b/Systems/a320-fwc.xml @@ -1499,10 +1499,80 @@ + + + + /engines/engine[0]/n2-actual ge 59.4 + + + + + /ECAM/warnings/logic/eng/engine-1-core-speed-abv-idle-input + 0.03333333333 + 1.0 + + + + /controls/engines/engine[0]/fire-btn + 0.03225806451 + 1.0 + + + + + + /controls/engines/engine[0]/cutoff-switch eq 1 + + /ECAM/warnings/logic/eng/engine-1-core-speed-abv-idle ne 1 + + /engines/engine[0]/n2-actual lt 59.4 + /ECAM/timer/ground-calc eq 1 + /controls/engines/engine[0]/fire-btn eq 0 + /ECAM/warnings/logic/eng/eng-1-fire-btn-timer-31 ne 1 + + + + + + + + + /engines/engine[0]/n2-actual ge 59.4 + + + + + /ECAM/warnings/logic/eng/engine-2-core-speed-abv-idle-input + 0.03333333333 + 1.0 + + + + /controls/engines/engine[1]/fire-btn + 0.03225806451 + 1.0 + + + + + + /controls/engines/engine[1]/cutoff-switch eq 1 + + /ECAM/warnings/logic/eng/engine-2-core-speed-abv-idle ne 1 + + /engines/engine[1]/n2-actual lt 59.4 + /ECAM/timer/ground-calc eq 1 + /controls/engines/engine[1]/fire-btn eq 0 + /ECAM/warnings/logic/eng/eng-2-fire-btn-timer-31 ne 1 + + + + + - /engines/engine[0]/state eq 3 + /ECAM/warnings/logic/eng/JE1NORUN eq 0 /systems/electrical/relay/gen-1-glc/contact-pos eq 0 @@ -1570,7 +1640,7 @@ - /engines/engine[1]/state eq 3 + /ECAM/warnings/logic/eng/JE2NORUN eq 0 /systems/electrical/relay/gen-2-glc/contact-pos eq 0 @@ -2766,7 +2836,6 @@ 100 - /controls/engines/engine[1]/fire-btn 0.1