From c5aac7038d3b0c02a699da823f8130ce4d5c0aba Mon Sep 17 00:00:00 2001 From: legoboyvdlp R Date: Fri, 16 Oct 2020 22:42:09 +0100 Subject: [PATCH] Begin implementation of later FWC standard, including THR LVR ABV IDLE warning, for situation where one engine is in high power and the other is idle or reverse --- Nasal/ECAM/ECAM-controller.nas | 8 +- Nasal/ECAM/ECAM-logic.nas | 45 +++-- Nasal/ECAM/ECAM-messages.nas | 18 +- Nasal/Libraries/property-tree-setup.nas | 1 + Nasal/Systems/pneumatics.nas | 4 +- Sounds/A320-common-sound.xml | 15 ++ Systems/a320-fwc.xml | 217 ++++++++++++++++++++++++ Systems/ecam-proprules.xml | 82 +++++++++ 8 files changed, 370 insertions(+), 20 deletions(-) diff --git a/Nasal/ECAM/ECAM-controller.nas b/Nasal/ECAM/ECAM-controller.nas index e39d7afb..a9d37646 100644 --- a/Nasal/ECAM/ECAM-controller.nas +++ b/Nasal/ECAM/ECAM-controller.nas @@ -15,7 +15,7 @@ var overflow = props.globals.initNode("/ECAM/warnings/overflow", 0, "BOOL"); var dc_ess = props.globals.getNode("/systems/electrical/bus/dc-ess", 1); var lights = [props.globals.initNode("/ECAM/warnings/master-warning-light", 0, "BOOL"), props.globals.initNode("/ECAM/warnings/master-caution-light", 0, "BOOL")]; -var aural = [props.globals.initNode("/sim/sound/warnings/crc", 0, "BOOL"), props.globals.initNode("/sim/sound/warnings/chime", 0, "BOOL"), props.globals.initNode("/sim/sound/warnings/cricket", 0, "BOOL")]; +var aural = [props.globals.initNode("/sim/sound/warnings/crc", 0, "BOOL"), props.globals.initNode("/sim/sound/warnings/chime", 0, "BOOL"), props.globals.initNode("/sim/sound/warnings/cricket", 0, "BOOL"), props.globals.initNode("/sim/sound/warnings/retard", 0, "BOOL")]; var warningFlash = props.globals.initNode("/ECAM/warnings/master-warning-flash", 0, "BOOL"); var lineIndex = 0; @@ -100,6 +100,8 @@ var warningNodes = { gen2FaultOnOff: props.globals.initNode("/ECAM/warnings/flipflop/gen-2-fault-on-off"), pack1Ovht: props.globals.initNode("/ECAM/warnings/flipflop/pack-1-ovht"), pack2Ovht: props.globals.initNode("/ECAM/warnings/flipflop/pack-2-ovht"), + eng1ThrLvrAbvIdle: props.globals.initNode("/ECAM/warnings/logic/eng/eng-1-thr-lvr-abv-idle"), + eng2ThrLvrAbvIdle: props.globals.initNode("/ECAM/warnings/logic/eng/eng-2-thr-lvr-abv-idle"), }, }; @@ -158,7 +160,7 @@ var warning = { me.noRepeat = 1; }, sound: func() { - if (me.aural > 2) { return; } + if (me.aural > 3) { return; } if (me.active == 0 and me.wasActive == 1) { aural[me.aural].setBoolValue(0); me.wasActive = 0; @@ -172,7 +174,7 @@ var warning = { aural[me.aural].setBoolValue(1); }, 0.15); } else { - aural[me.aural].setBoolValue(1); + aural[me.aural].setBoolValue(1); } me.noRepeat2 = 1; }, diff --git a/Nasal/ECAM/ECAM-logic.nas b/Nasal/ECAM/ECAM-logic.nas index fe11ceee..25685dea 100644 --- a/Nasal/ECAM/ECAM-logic.nas +++ b/Nasal/ECAM/ECAM-logic.nas @@ -60,6 +60,13 @@ var messages_priority_3 = func { stallVoice.setValue(0); } + # FCTL FLAPS NOT ZERO + if (flap_not_zero.clearFlag == 0 and phaseVar3 == 6 and pts.Controls.Flight.flapsInput.getValue() != 0 and pts.Instrumentation.Altimeter.indicatedFt.getValue() > 22000) { + flap_not_zero.active = 1; + } else { + ECAM_controller.warningReset(flap_not_zero); + } + if ((phaseVar3 == 1 or (phaseVar3 >= 5 and phaseVar3 <= 7)) and getprop("/systems/navigation/adr/output/overspeed")) { overspeed.active = 1; if (getprop("/systems/navigation/adr/computation/overspeed-vmo") or getprop("/systems/navigation/adr/computation/overspeed-mmo")) { @@ -89,13 +96,6 @@ var messages_priority_3 = func { overspeedFlap.msg = "-VFE................XXX"; } - # FCTL FLAPS NOT ZERO - if ((flap_not_zero.clearFlag == 0) and phaseVar3 == 6 and getprop("/controls/flight/flaps-input") != 0 and getprop("instrumentation/altimeter/indicated-altitude-ft") > 22000) { - flap_not_zero.active = 1; - } else { - ECAM_controller.warningReset(flap_not_zero); - } - # ENG DUAL FAIL if (phaseVar3 >= 5 and phaseVar3 <= 7 and dualFailNode.getBoolValue() and dualFail.clearFlag == 0) { @@ -277,6 +277,31 @@ var messages_priority_3 = func { ECAM_controller.warningReset(dualFailtouch); } + # ENG ABV IDLE + if (eng1ThrLvrAbvIdle.clearFlag == 0 and ((phaseVar3 >= 1 and phaseVar3 <= 4) or (phaseVar3 >= 6 and phaseVar3 <= 9)) and warningNodes.Flipflops.eng1ThrLvrAbvIdle.getValue()) { # AND NOT RUNWAY TOO SHORT + eng1ThrLvrAbvIdle.active = 1; + if (eng1ThrLvrAbvIdle2.clearFlag == 0) { + eng1ThrLvrAbvIdle2.active = 1; + } else { + ECAM_controller.warningReset(eng1ThrLvrAbvIdle2); + } + } else { + ECAM_controller.warningReset(eng1ThrLvrAbvIdle); + ECAM_controller.warningReset(eng1ThrLvrAbvIdle2); + } + + if (eng2ThrLvrAbvIdle.clearFlag == 0 and ((phaseVar3 >= 1 and phaseVar3 <= 4) or (phaseVar3 >= 6 and phaseVar3 <= 9)) and warningNodes.Flipflops.eng2ThrLvrAbvIdle.getValue()) { # AND NOT RUNWAY TOO SHORT + eng2ThrLvrAbvIdle.active = 1; + if (eng2ThrLvrAbvIdle2.clearFlag == 0) { + eng2ThrLvrAbvIdle2.active = 1; + } else { + ECAM_controller.warningReset(eng2ThrLvrAbvIdle2); + } + } else { + ECAM_controller.warningReset(eng2ThrLvrAbvIdle); + ECAM_controller.warningReset(eng2ThrLvrAbvIdle2); + } + # ENG FIRE if ((eng1FireFlAgent2.clearFlag == 0 and getprop("/systems/fire/engine1/warning-active") == 1 and phaseVar3 >= 5 and phaseVar3 <= 7) or (eng1FireGnevacBat.clearFlag == 0 and getprop("/systems/fire/engine1/warning-active") == 1 and (phaseVar3 < 5 or phaseVar3 > 7))) { eng1Fire.active = 1; @@ -699,7 +724,7 @@ var messages_priority_3 = func { } # CONFIG - if ((slats_config.clearFlag == 0) and (getprop("/controls/flight/flaps-input") == 0 or getprop("/controls/flight/flaps-input")) == 4 and phaseVar3 >= 3 and phaseVar3 <= 4) { + if ((slats_config.clearFlag == 0) and (pts.Controls.Flight.flapsInput.getValue() == 0 or pts.Controls.Flight.flapsInput.getValue()) == 4 and phaseVar3 >= 3 and phaseVar3 <= 4) { slats_config.active = 1; slats_config_1.active = 1; } else { @@ -707,7 +732,7 @@ var messages_priority_3 = func { ECAM_controller.warningReset(slats_config_1); } - if ((flaps_config.clearFlag == 0) and (getprop("/controls/flight/flaps-input") == 0 or getprop("/controls/flight/flaps-input") == 4) and phaseVar3 >= 3 and phaseVar3 <= 4) { + if ((flaps_config.clearFlag == 0) and (pts.Controls.Flight.flapsInput.getValue() == 0 or pts.Controls.Flight.flapsInput.getValue() == 4) and phaseVar3 >= 3 and phaseVar3 <= 4) { flaps_config.active = 1; flaps_config_1.active = 1; } else { @@ -2094,7 +2119,7 @@ var messages_priority_0 = func { var messages_config_memo = func { phaseVarMemo = phaseNode.getValue(); - if (getprop("/controls/flight/flaps-input") == 0 or getprop("/controls/flight/flaps-input") == 4 or pts.Controls.Flight.speedbrake.getValue() != 0 or getprop("/fdm/jsbsim/hydraulics/elevator-trim/final-deg") > 1.75 or getprop("/fdm/jsbsim/hydraulics/elevator-trim/final-deg") < -3.65 or getprop("/fdm/jsbsim/hydraulics/rudder/trim-cmd-deg") < -3.55 or getprop("/fdm/jsbsim/hydraulics/rudder/trim-cmd-deg") > 3.55) { + if (pts.Controls.Flight.flapsInput.getValue() == 0 or pts.Controls.Flight.flapsInput.getValue() == 4 or pts.Controls.Flight.speedbrake.getValue() != 0 or getprop("/fdm/jsbsim/hydraulics/elevator-trim/final-deg") > 1.75 or getprop("/fdm/jsbsim/hydraulics/elevator-trim/final-deg") < -3.65 or getprop("/fdm/jsbsim/hydraulics/rudder/trim-cmd-deg") < -3.55 or getprop("/fdm/jsbsim/hydraulics/rudder/trim-cmd-deg") > 3.55) { setprop("/ECAM/to-config-normal", 0); } else { setprop("/ECAM/to-config-normal", 1); diff --git a/Nasal/ECAM/ECAM-messages.nas b/Nasal/ECAM/ECAM-messages.nas index 7d6e0462..77ae303f 100644 --- a/Nasal/ECAM/ECAM-messages.nas +++ b/Nasal/ECAM/ECAM-messages.nas @@ -11,12 +11,12 @@ var warnings = std.Vector.new([ var stall = warning.new(msg: "", aural: 2), - var flap_not_zero = warning.new(msg: "F/CTL FLAP LVR NOT ZERO", colour: "r", aural: 0, light: 0), + var flap_not_zero = warning.new(msg: "F/CTL FLAP LVR NOT ZERO", colour: "r", aural: 0, light: 0, isMainMsg: 1), - var overspeed = warning.new(msg: "OVER SPEED", colour: "r", aural: 0, light: 0, isMainMsg: 1), - var overspeedVMO = warning.new(msg: "-VMO/MMO.......350 /.82", colour: "r"), - var overspeedGear = warning.new(msg: "-VLE...........280 /.67", colour: "r"), - var overspeedFlap = warning.new(msg: "-VFE................XXX", colour: "r"), + var overspeed = warning.new(msg: "OVER SPEED", colour: "r", aural: 0, light: 0, isMainMsg: 1), + var overspeedVMO = warning.new(msg: "-VMO/MMO.......350 /.82", colour: "r"), + var overspeedGear = warning.new(msg: "-VLE...........280 /.67", colour: "r"), + var overspeedFlap = warning.new(msg: "-VFE................XXX", colour: "r"), # DUAL ENG FAIL var dualFail = warning.new(msg: "ENG DUAL FAILURE", colour: "r", aural: 0, light: 0, isMainMsg: 1), @@ -48,6 +48,14 @@ var warnings = std.Vector.new([ var dualFailevac = warning.new(msg: " -EVAC..........INITIATE", colour: "c"), var dualFailbatt = warning.new(msg: " -BAT 1+2............OFF", colour: "c"), + # ENG 1 THR LEVER ABV IDLE + var eng1ThrLvrAbvIdle = warning.new(msg: "ENG 1 THR LEVER ABV IDLE", colour: "r", aural: 3, light: 0, isMainMsg: 1), + var eng1ThrLvrAbvIdle2 = warning.new(msg: " -THR LEVER 1.......IDLE", colour: "c"), + + # ENG 2 THR LEVER ABV IDLE + var eng2ThrLvrAbvIdle = warning.new(msg: "ENG 2 THR LEVER ABV IDLE", colour: "r", aural: 3, light: 0, isMainMsg: 1), + var eng2ThrLvrAbvIdle2 = warning.new(msg: " -THR LEVER 2.......IDLE", colour: "c"), + # ENG 1 FIRE (flight) var eng1Fire = warning.new(msg: "ENG 1 FIRE", colour: "r", aural: 0, light: 0, isMainMsg: 1), var eng1FireFllever = warning.new(msg: " -THR LEVER 1.......IDLE", colour: "c"), diff --git a/Nasal/Libraries/property-tree-setup.nas b/Nasal/Libraries/property-tree-setup.nas index f399a305..62ed5c97 100644 --- a/Nasal/Libraries/property-tree-setup.nas +++ b/Nasal/Libraries/property-tree-setup.nas @@ -39,6 +39,7 @@ var Controls = { elevatorTrim: props.globals.getNode("/controls/flight/elevator-trim"), flaps: props.globals.getNode("/controls/flight/flaps"), flapsTemp: 0, + flapsInput: props.globals.getNode("/controls/flight/flaps-input"), flapsPos: props.globals.getNode("/controls/flight/flaps-pos"), speedbrake: props.globals.getNode("/controls/flight/speedbrake"), speedbrakeArm: props.globals.getNode("/controls/flight/speedbrake-arm"), diff --git a/Nasal/Systems/pneumatics.nas b/Nasal/Systems/pneumatics.nas index d6f23d57..9587c486 100644 --- a/Nasal/Systems/pneumatics.nas +++ b/Nasal/Systems/pneumatics.nas @@ -115,8 +115,8 @@ var PNEU = { setprop("/systems/pressurization/outflowpos-man", "0.5"); setprop("/systems/pressurization/outflowpos-man-sw", "0"); setprop("/systems/pressurization/outflowpos-norm-cmd", "0"); - setprop("/systems/pressurization/cabinalt", getprop("instrumentation/altimeter/indicated-altitude-ft")); - setprop("/systems/pressurization/targetalt", getprop("instrumentation/altimeter/indicated-altitude-ft")); + setprop("/systems/pressurization/cabinalt", pts.Instrumentation.Altimeter.indicatedFt.getValue()); + setprop("/systems/pressurization/targetalt", pts.Instrumentation.Altimeter.indicatedFt.getValue()); setprop("/systems/pressurization/diff-to-target", "0"); setprop("/systems/pressurization/ditchingpb", 0); setprop("/systems/pressurization/targetvs", "0"); diff --git a/Sounds/A320-common-sound.xml b/Sounds/A320-common-sound.xml index e93408c2..e98ce503 100644 --- a/Sounds/A320-common-sound.xml +++ b/Sounds/A320-common-sound.xml @@ -935,6 +935,21 @@ 100.0 + + retard2 + Aircraft/A320-family/Sounds/GPWS/retard.wav + looped + + /sim/sound/warnings/retard + + + /sim/current-view/internal + 8.0 + + 20.0 + 100.0 + + apoff-looped looped diff --git a/Systems/a320-fwc.xml b/Systems/a320-fwc.xml index 6820de11..8a066c00 100644 --- a/Systems/a320-fwc.xml +++ b/Systems/a320-fwc.xml @@ -1661,4 +1661,221 @@ + + + + + + /fdm/jsbsim/spoilers/max-spoiler eq 1 + /fdm/jsbsim/spoilers/main-cmd gt 0 + + + + + /ECAM/warnings/logic/eng/ground-spoilers + 100 + 2 + + + + + + /ECAM/timer/ground-calc eq 0 + /ECAM/warning-phase eq 6 + /ECAM/warning-phase eq 7 + /ECAM/warnings/logic/eng/ground-spoilers-output eq 1 + /ECAM/phases/monostable/phase-8-output eq 1 + + + + + + + /controls/engines/engine[0]/throttle-lever ge 0.13333333333 + + + + + /ECAM/warnings/logic/eng/eng-1-tla-abv-6 + 100 + 1 + + + + + + /controls/engines/engine[0]/throttle-lever lt 0.055 + + + + + /ECAM/warnings/logic/eng/eng-1-tla-idle + 100 + 1 + + + + + + /engines/engine[0]/reverser-pos-norm gt 0 + + + + + /ECAM/warnings/logic/eng/eng-1-reverse + 100 + 1 + + + + + + /controls/engines/engine[1]/throttle-lever ge 0.13333333333 + + + + + /ECAM/warnings/logic/eng/eng-2-tla-abv-6 + 100 + 1 + + + + + + /controls/engines/engine[1]/throttle-lever lt 0.055 + + + + + /ECAM/warnings/logic/eng/eng-2-tla-idle + 100 + 1 + + + + + + /engines/engine[1]/reverser-pos-norm gt 0 + + + + + /ECAM/warnings/logic/eng/eng-2-reverse + 100 + 1 + + + + + + /ECAM/warnings/logic/eng/eng-1-tla-abv-6-output eq 1 + /engines/engine[0]/state eq 3 + /engines/engine[1]/state eq 3 + + /ECAM/warnings/logic/eng/eng-2-reverse-output eq 1 + + /ECAM/warnings/logic/eng/eng-2-reverse eq 1 + /ECAM/warnings/logic/eng/eng-1-retard-case-2-fall-output eq 0 + + + + + + + + + /ECAM/warnings/logic/eng/eng-1-tla-abv-6-output eq 1 + /engines/engine[0]/state eq 3 + /engines/engine[1]/state eq 3 + + /ECAM/warnings/logic/eng/eng-2-tla-idle-output eq 1 + + /ECAM/warnings/logic/eng/eng-2-reverse-fall eq 0 + /ECAM/warnings/logic/eng/eng-2-tla-idle eq 1 + + + + + + + + + /ECAM/warnings/logic/eng/eng-2-tla-abv-6-output eq 1 + /engines/engine[0]/state eq 3 + /engines/engine[1]/state eq 3 + + /ECAM/warnings/logic/eng/eng-1-reverse-output eq 1 + + /ECAM/warnings/logic/eng/eng-1-reverse eq 1 + /ECAM/warnings/logic/eng/eng-2-retard-case-2-fall-output eq 0 + + + + + + + + + /ECAM/warnings/logic/eng/eng-2-tla-abv-6-output eq 1 + /engines/engine[0]/state eq 3 + /engines/engine[1]/state eq 3 + + /ECAM/warnings/logic/eng/eng-1-tla-idle-output eq 1 + + /ECAM/warnings/logic/eng/eng-1-reverse-fall eq 0 + /ECAM/warnings/logic/eng/eng-1-tla-idle eq 1 + + + + + + + + + /ECAM/warnings/logic/eng/ground-retard eq 1 + /velocities/groundspeed-kt gt 40 + + /ECAM/warnings/logic/eng/eng-1-retard-case-1 eq 1 + /ECAM/warnings/logic/eng/eng-1-retard-case-2 eq 1 + + + + + + + + /ECAM/warnings/logic/eng/ground-retard eq 0 + + /ECAM/warnings/logic/eng/eng-1-retard-case-1 eq 0 + /ECAM/warnings/logic/eng/eng-1-retard-case-2 eq 0 + + + + + + + + /ECAM/warnings/logic/eng/ground-retard eq 1 + /velocities/groundspeed-kt gt 40 + + /ECAM/warnings/logic/eng/eng-2-retard-case-1 eq 1 + /ECAM/warnings/logic/eng/eng-2-retard-case-2 eq 1 + + + + + + + + /ECAM/warnings/logic/eng/ground-retard eq 0 + + /ECAM/warnings/logic/eng/eng-2-retard-case-1 eq 0 + /ECAM/warnings/logic/eng/eng-2-retard-case-2 eq 0 + + + + + + diff --git a/Systems/ecam-proprules.xml b/Systems/ecam-proprules.xml index 80d56c3b..c4ff1367 100644 --- a/Systems/ecam-proprules.xml +++ b/Systems/ecam-proprules.xml @@ -399,6 +399,66 @@ + + monostable + true + + + ECAM/phases/monostable/phase-8 + + ECAM/phases/monostable/phase-8-output + + + + monostable + true + + + /ECAM/warnings/logic/eng/eng-1-retard-case-2 + + /ECAM/warnings/logic/eng/eng-1-retard-case-2-fall-output + + + + monostable + true + + + /ECAM/warnings/logic/eng/eng-2-retard-case-2 + + /ECAM/warnings/logic/eng/eng-2-retard-case-2-fall-output + + + + monostable + true + + + /ECAM/warnings/logic/eng/eng-1-reverse + + /ECAM/warnings/logic/eng/eng-1-reverse-fall + + + + monostable + true + + + /ECAM/warnings/logic/eng/eng-2-reverse + + /ECAM/warnings/logic/eng/eng-2-reverse-fall + + monostable true @@ -895,4 +955,26 @@ /ECAM/warnings/flipflop/apu-gen-fault-on-off + + + SR + + /ECAM/warnings/logic/eng/eng-1-thr-lvr-abv-idle-set + + + /ECAM/warnings/logic/eng/eng-1-thr-lvr-abv-idle-reset + + /ECAM/warnings/logic/eng/eng-1-thr-lvr-abv-idle + + + + SR + + /ECAM/warnings/logic/eng/eng-2-thr-lvr-abv-idle-set + + + /ECAM/warnings/logic/eng/eng-2-thr-lvr-abv-idle-reset + + /ECAM/warnings/logic/eng/eng-2-thr-lvr-abv-idle +