1
0
Fork 0

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

This commit is contained in:
legoboyvdlp R 2020-10-16 22:42:09 +01:00
parent c95912fa8b
commit c5aac7038d
8 changed files with 370 additions and 20 deletions

View file

@ -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;

View file

@ -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);

View file

@ -11,7 +11,7 @@
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"),
@ -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"),

View file

@ -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"),

View file

@ -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");

View file

@ -935,6 +935,21 @@
<max-dist>100.0</max-dist>
</retard>
<retard>
<name>retard2</name>
<path>Aircraft/A320-family/Sounds/GPWS/retard.wav</path>
<mode>looped</mode>
<condition>
<property>/sim/sound/warnings/retard</property> <!-- must be EMER CANCEL -->
</condition>
<volume>
<property>/sim/current-view/internal</property>
<factor>8.0</factor>
</volume>
<reference-dist>20.0</reference-dist>
<max-dist>100.0</max-dist>
</retard>
<apoff>
<name>apoff-looped</name>
<mode>looped</mode>

View file

@ -1661,4 +1661,221 @@
</channel>
<channel name="ENG" execrate="8">
<switch name="/ECAM/warnings/logic/eng/ground-spoilers">
<default value="0"/>
<test logic="AND" value="1">
/fdm/jsbsim/spoilers/max-spoiler eq 1
/fdm/jsbsim/spoilers/main-cmd gt 0
</test>
</switch>
<actuator name="/ECAM/warnings/logic/eng/ground-spoilers-output">
<input>/ECAM/warnings/logic/eng/ground-spoilers</input>
<rate_limit sense="decr">100</rate_limit> <!-- Instant -->
<rate_limit sense="incr">2</rate_limit> <!-- 0.5 seconds -->
</actuator>
<switch name="/ECAM/warnings/logic/eng/ground-retard">
<default value="0"/>
<test logic="OR" value="1">
/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
</test>
</switch>
<switch name="/ECAM/warnings/logic/eng/eng-1-tla-abv-6">
<default value="0"/>
<test logic="OR" value="1">
/controls/engines/engine[0]/throttle-lever ge 0.13333333333
</test>
</switch>
<actuator name="/ECAM/warnings/logic/eng/eng-1-tla-abv-6-output">
<input>/ECAM/warnings/logic/eng/eng-1-tla-abv-6</input>
<rate_limit sense="decr">100</rate_limit> <!-- Instant -->
<rate_limit sense="incr">1</rate_limit> <!-- 1 seconds -->
</actuator>
<switch name="/ECAM/warnings/logic/eng/eng-1-tla-idle">
<default value="0"/>
<test logic="OR" value="1">
/controls/engines/engine[0]/throttle-lever lt 0.055
</test>
</switch>
<actuator name="/ECAM/warnings/logic/eng/eng-1-tla-idle-output">
<input>/ECAM/warnings/logic/eng/eng-1-tla-idle</input>
<rate_limit sense="decr">100</rate_limit> <!-- Instant -->
<rate_limit sense="incr">1</rate_limit> <!-- 1 seconds -->
</actuator>
<switch name="/ECAM/warnings/logic/eng/eng-1-reverse">
<default value="0"/>
<test logic="OR" value="1">
/engines/engine[0]/reverser-pos-norm gt 0
</test>
</switch>
<actuator name="/ECAM/warnings/logic/eng/eng-1-reverse-output">
<input>/ECAM/warnings/logic/eng/eng-1-reverse</input>
<rate_limit sense="decr">100</rate_limit> <!-- Instant -->
<rate_limit sense="incr">1</rate_limit> <!-- 1 seconds -->
</actuator>
<switch name="/ECAM/warnings/logic/eng/eng-2-tla-abv-6">
<default value="0"/>
<test logic="OR" value="1">
/controls/engines/engine[1]/throttle-lever ge 0.13333333333
</test>
</switch>
<actuator name="/ECAM/warnings/logic/eng/eng-2-tla-abv-6-output">
<input>/ECAM/warnings/logic/eng/eng-2-tla-abv-6</input>
<rate_limit sense="decr">100</rate_limit> <!-- Instant -->
<rate_limit sense="incr">1</rate_limit> <!-- 1 seconds -->
</actuator>
<switch name="/ECAM/warnings/logic/eng/eng-2-tla-idle">
<default value="0"/>
<test logic="OR" value="1">
/controls/engines/engine[1]/throttle-lever lt 0.055
</test>
</switch>
<actuator name="/ECAM/warnings/logic/eng/eng-2-tla-idle-output">
<input>/ECAM/warnings/logic/eng/eng-2-tla-idle</input>
<rate_limit sense="decr">100</rate_limit> <!-- Instant -->
<rate_limit sense="incr">1</rate_limit> <!-- 1 seconds -->
</actuator>
<switch name="/ECAM/warnings/logic/eng/eng-2-reverse">
<default value="0"/>
<test logic="OR" value="1">
/engines/engine[1]/reverser-pos-norm gt 0
</test>
</switch>
<actuator name="/ECAM/warnings/logic/eng/eng-2-reverse-output">
<input>/ECAM/warnings/logic/eng/eng-2-reverse</input>
<rate_limit sense="decr">100</rate_limit> <!-- Instant -->
<rate_limit sense="incr">1</rate_limit> <!-- 1 seconds -->
</actuator>
<switch name="/ECAM/warnings/logic/eng/eng-1-retard-case-1">
<default value="0"/>
<test logic="AND" value="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
<test logic="OR">
/ECAM/warnings/logic/eng/eng-2-reverse-output eq 1
<test logic="AND">
/ECAM/warnings/logic/eng/eng-2-reverse eq 1
/ECAM/warnings/logic/eng/eng-1-retard-case-2-fall-output eq 0
</test>
</test>
</test>
</switch>
<switch name="/ECAM/warnings/logic/eng/eng-1-retard-case-2">
<default value="0"/>
<test logic="AND" value="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
<test logic="OR">
/ECAM/warnings/logic/eng/eng-2-tla-idle-output eq 1
<test logic="AND">
/ECAM/warnings/logic/eng/eng-2-reverse-fall eq 0
/ECAM/warnings/logic/eng/eng-2-tla-idle eq 1
</test>
</test>
</test>
</switch>
<switch name="/ECAM/warnings/logic/eng/eng-2-retard-case-1">
<default value="0"/>
<test logic="AND" value="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
<test logic="OR">
/ECAM/warnings/logic/eng/eng-1-reverse-output eq 1
<test logic="AND">
/ECAM/warnings/logic/eng/eng-1-reverse eq 1
/ECAM/warnings/logic/eng/eng-2-retard-case-2-fall-output eq 0
</test>
</test>
</test>
</switch>
<switch name="/ECAM/warnings/logic/eng/eng-2-retard-case-2">
<default value="0"/>
<test logic="AND" value="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
<test logic="OR">
/ECAM/warnings/logic/eng/eng-1-tla-idle-output eq 1
<test logic="AND">
/ECAM/warnings/logic/eng/eng-1-reverse-fall eq 0
/ECAM/warnings/logic/eng/eng-1-tla-idle eq 1
</test>
</test>
</test>
</switch>
<switch name="/ECAM/warnings/logic/eng/eng-1-thr-lvr-abv-idle-set">
<default value="0"/>
<test logic="AND" value="1">
/ECAM/warnings/logic/eng/ground-retard eq 1
/velocities/groundspeed-kt gt 40
<test logic="OR">
/ECAM/warnings/logic/eng/eng-1-retard-case-1 eq 1
/ECAM/warnings/logic/eng/eng-1-retard-case-2 eq 1
</test>
</test>
</switch>
<switch name="/ECAM/warnings/logic/eng/eng-1-thr-lvr-abv-idle-reset">
<default value="0"/>
<test logic="OR" value="1">
/ECAM/warnings/logic/eng/ground-retard eq 0
<test logic="AND">
/ECAM/warnings/logic/eng/eng-1-retard-case-1 eq 0
/ECAM/warnings/logic/eng/eng-1-retard-case-2 eq 0
</test>
</test>
</switch>
<switch name="/ECAM/warnings/logic/eng/eng-2-thr-lvr-abv-idle-set">
<default value="0"/>
<test logic="AND" value="1">
/ECAM/warnings/logic/eng/ground-retard eq 1
/velocities/groundspeed-kt gt 40
<test logic="OR">
/ECAM/warnings/logic/eng/eng-2-retard-case-1 eq 1
/ECAM/warnings/logic/eng/eng-2-retard-case-2 eq 1
</test>
</test>
</switch>
<switch name="/ECAM/warnings/logic/eng/eng-2-thr-lvr-abv-idle-reset">
<default value="0"/>
<test logic="OR" value="1">
/ECAM/warnings/logic/eng/ground-retard eq 0
<test logic="AND">
/ECAM/warnings/logic/eng/eng-2-retard-case-1 eq 0
/ECAM/warnings/logic/eng/eng-2-retard-case-2 eq 0
</test>
</test>
</switch>
</channel>
</system>

View file

@ -399,6 +399,66 @@
</flipflop>
<!-- falling edge detector - take inverse of following -->
<flipflop>
<type>monostable</type>
<inverted type="bool">true</inverted>
<time>
<value>4.5</value>
</time>
<S>
<property>ECAM/phases/monostable/phase-8</property>
</S>
<output>ECAM/phases/monostable/phase-8-output</output>
</flipflop>
<flipflop>
<type>monostable</type>
<inverted type="bool">true</inverted>
<time>
<value>1.5</value>
</time>
<S>
<property>/ECAM/warnings/logic/eng/eng-1-retard-case-2</property>
</S>
<output>/ECAM/warnings/logic/eng/eng-1-retard-case-2-fall-output</output>
</flipflop>
<flipflop>
<type>monostable</type>
<inverted type="bool">true</inverted>
<time>
<value>1.5</value>
</time>
<S>
<property>/ECAM/warnings/logic/eng/eng-2-retard-case-2</property>
</S>
<output>/ECAM/warnings/logic/eng/eng-2-retard-case-2-fall-output</output>
</flipflop>
<flipflop>
<type>monostable</type>
<inverted type="bool">true</inverted>
<time>
<value>1.5</value>
</time>
<S>
<property>/ECAM/warnings/logic/eng/eng-1-reverse</property>
</S>
<output>/ECAM/warnings/logic/eng/eng-1-reverse-fall</output>
</flipflop>
<flipflop>
<type>monostable</type>
<inverted type="bool">true</inverted>
<time>
<value>1.5</value>
</time>
<S>
<property>/ECAM/warnings/logic/eng/eng-2-reverse</property>
</S>
<output>/ECAM/warnings/logic/eng/eng-2-reverse-fall</output>
</flipflop>
<flipflop>
<type>monostable</type>
<inverted type="bool">true</inverted>
@ -895,4 +955,26 @@
</R>
<output>/ECAM/warnings/flipflop/apu-gen-fault-on-off</output>
</flipflop>
<flipflop>
<type>SR</type>
<S>
<property>/ECAM/warnings/logic/eng/eng-1-thr-lvr-abv-idle-set</property>
</S>
<R>
<property>/ECAM/warnings/logic/eng/eng-1-thr-lvr-abv-idle-reset</property>
</R>
<output>/ECAM/warnings/logic/eng/eng-1-thr-lvr-abv-idle</output>
</flipflop>
<flipflop>
<type>SR</type>
<S>
<property>/ECAM/warnings/logic/eng/eng-2-thr-lvr-abv-idle-set</property>
</S>
<R>
<property>/ECAM/warnings/logic/eng/eng-2-thr-lvr-abv-idle-reset</property>
</R>
<output>/ECAM/warnings/logic/eng/eng-2-thr-lvr-abv-idle</output>
</flipflop>
</PropertyList>