1
0
Fork 0

ADIRS: begin reimplementing, stall warning and overspeed in progress

This commit is contained in:
legoboyvdlp R 2019-11-02 14:52:06 +00:00
parent 2ecfd0e8e2
commit 200bcfb9f7
15 changed files with 1207 additions and 22 deletions

View file

@ -136,6 +136,7 @@ xsi:noNamespaceSchemaLocation="http://jsbsim.sourceforge.net/JSBSim.xsd">
<system file="fuel"/>
<system file="glass-effect1"/>
<system file="a320-fcs"/>
<system file="a320-adr"/>
<system file="a320-fwc"/>
<system file="a320-spoiler"/>
<system file="a320-electrical"/>

View file

@ -139,6 +139,7 @@
<autopilot n="12">
<path>Aircraft/A320-family/Systems/a320-lights-proprules.xml</path>
</autopilot>
<path>Aircraft/A320-family/Systems/pitot-static.xml</path>
</systems>
<sound>
@ -922,6 +923,22 @@
<green-psi>0</green-psi>
<yellow-psi>0</yellow-psi>
</hydraulic>
<pitot n="1">
<serviceable>1</serviceable>
</pitot>
<pitot n="2">
<serviceable>1</serviceable>
</pitot>
<static n="1">
<serviceable>1</serviceable>
</static>
<static n="2">
<serviceable>1</serviceable>
</static>
</systems>
<options n="0">
@ -936,6 +953,26 @@
</options>
<instrumentation n="0">
<altimeter n="1">
<serviceable type="bool">true</serviceable>
</altimeter>
<altimeter n="2">
<serviceable type="bool">true</serviceable>
</altimeter>
<altimeter n="3">
<serviceable type="bool">true</serviceable>
</altimeter>
<altimeter n="4">
<serviceable type="bool">true</serviceable>
</altimeter>
<altimeter n="5">
<serviceable type="bool">true</serviceable>
</altimeter>
<chrono n="0">
<started type="bool">0</started>
<paused type="bool">0</paused>
@ -1605,6 +1642,7 @@
<file>Aircraft/A320-family/Nasal/fuel.nas</file>
<file>Aircraft/A320-family/Nasal/engines-common.nas</file>
<file>Aircraft/A320-family/Nasal/ADIRS.nas</file>
<file>Aircraft/A320-family/Nasal/ADIRS/ADR.nas</file>
<file>Aircraft/A320-family/Nasal/fire.nas</file>
<file>Aircraft/A320-family/Nasal/brakes.nas</file>
<file>Aircraft/A320-family/Nasal/ground_services.nas</file>

140
Nasal/ADIRS/ADR.nas Normal file
View file

@ -0,0 +1,140 @@
# A3XX ADIRS System
# Jonathan Redpath (legoboyvdlp)
# Copyright (c) 2019 Jonathan Redpath (legoboyvdlp)
var _NUMADIRU = 3;
var ADR = {
outputDisc: 0, # 0 = disc, 1 = normal
mode: 0, # 0 = off, 1 = nav, 2 = att
energised: 0, # 0 = off, 1 = on
input: [],
new: func() {
var adr = { parents:[ADR] };
return adr;
},
updateEnergized: func(mode) {
me.energized = mode != 0 ? 1 : 0;
},
};
var IR = {
outputDisc: 0, # 0 = disc, 1 = normal
mode: 0, # 0 = off, 1 = nav, 2 = att
energised: 0, # 0 = off, 1 = on
input: [],
new: func() {
var ir = { parents:[IR] };
return ir;
},
updateEnergized: func(mode) {
me.energized = mode != 0 ? 1 : 0;
},
};
var ADIRSControlPanel = {
# local vars
_adrSwitchState: 0,
_irSwitchState: 0,
_irModeSwitchState: 0,
# ADIRS Units
ADRunits: [nil, nil, nil],
IRunits: [nil, nil, nil],
# PTS
Switches: {
adrSw: [props.globals.getNode("/controls/navigation/adirscp/switches/adr-1"), props.globals.getNode("/controls/navigation/adirscp/switches/adr-2"), props.globals.getNode("/controls/navigation/adirscp/switches/adr-3")],
irModeSw: [props.globals.getNode("/controls/navigation/adirscp/switches/ir-1-mode"), props.globals.getNode("/controls/navigation/adirscp/switches/ir-2-mode"), props.globals.getNode("/controls/navigation/adirscp/switches/ir-3-mode")],
irSw: [props.globals.getNode("/controls/navigation/adirscp/switches/ir-1"), props.globals.getNode("/controls/navigation/adirscp/switches/ir-2"), props.globals.getNode("/controls/navigation/adirscp/switches/ir-3")],
},
Lights: {
adrFault: [props.globals.getNode("/controls/navigation/adirscp/lights/adr-1-fault"), props.globals.getNode("/controls/navigation/adirscp/lights/adr-2-fault"), props.globals.getNode("/controls/navigation/adirscp/lights/adr-3-fault")],
adrOff: [props.globals.getNode("/controls/navigation/adirscp/lights/adr-1-off"), props.globals.getNode("/controls/navigation/adirscp/lights/adr-2-off"), props.globals.getNode("/controls/navigation/adirscp/lights/adr-3-off")],
irFault: [props.globals.getNode("/controls/navigation/adirscp/lights/ir-1-fault"), props.globals.getNode("/controls/navigation/adirscp/lights/ir-2-fault"), props.globals.getNode("/controls/navigation/adirscp/lights/ir-3-fault")],
irOff: [props.globals.getNode("/controls/navigation/adirscp/lights/ir-1-off"), props.globals.getNode("/controls/navigation/adirscp/lights/ir-2-off"), props.globals.getNode("/controls/navigation/adirscp/lights/ir-3-off")],
onBat: props.globals.getNode("/controls/navigation/adirscp/lights/on-bat"),
},
# Methods
adrSw: func(n) {
if (n < 0 or n > _NUMADIRU) { return; }
me._adrSwitchState = me.Switches.adrSw[n].getValue();
print("Switching adr unit " ~ n ~ " to " ~ !me._adrSwitchState);
me.Switches.adrSw[n].setValue(!me._adrSwitchState);
if (me.ADRunits[n] != nil) {
me.ADRunits[n].outputDisc = !me._adrSwitchState;
}
},
adrSw: func(n) {
if (n < 0 or n > _NUMADIRU) { return; }
me._irSwitchState = me.Switches.irSw[n].getValue();
print("Switching ir unit " ~ n ~ " to " ~ !me._irSwitchState);
me.Switches.irSw[n].setValue(!me._irSwitchState);
if (me.IRunits[n] != nil) {
me.IRunits[n].outputDisc = !me._irSwitchState;
}
},
irModeSw: func(n, mode) {
if (mode < 0 or mode > 2) { return; }
me._irModeSwitchState = me.Switches.irModeSw[n].getValue();
print("Switching adirs " ~ n ~ " to mode " ~ mode);
if (me.ADRunits[n] != nil) {
me.ADRunits[n].mode = mode;
me.ADRunits[n].updateEnergized(mode);
}
if (me.IRunits[n] != nil) {
me.IRunits[n].mode = mode;
me.IRunits[n].updateEnergized(mode);
}
}
};
var SwitchingPanel = {
Switches: {
attHdg: props.globals.getNode("/controls/navigation/switching/att-hdg"),
airData: props.globals.getNode("/controls/navigation/switching/air-data"),
},
};
var ADIRSnew = {
_flapPos: nil,
_slatPos: nil,
overspeedVFE: props.globals.initNode("/systems/navigation/adr/computation/overspeed-vfe-spd", 0, "INT"),
init: func() {
for (i = 0; i < _NUMADIRU; i = i + 1) {
print("Creating new ADR unit " ~ i);
ADIRSControlPanel.ADRunits[i] = ADR.new();
}
},
update_items: [
props.UpdateManager.FromPropertyHashList(["/fdm/jsbsim/fcs/flap-pos-deg","/fdm/jsbsim/fcs/slat-pos-deg"], 0.1, func(notification)
{
me._flapPos = pts.JSBSIM.FCS.flapDeg.getValue();
me._slatPos = pts.JSBSIM.FCS.slatDeg.getValue();
if (me._flapPos >= 23 and me._slatPos >= 25) {
ADIRSnew.overspeedVFE.setValue(181);
} elsif (me._flapPos >= 18) {
ADIRSnew.overspeedVFE.setValue(189);
} elsif (me._flapPos >= 13 or me._slatPos > 20) {
ADIRSnew.overspeedVFE.setValue(204);
} elsif (me._slatPos <= 20 and me._flapPos > 2) {
ADIRSnew.overspeedVFE.setValue(219);
} elsif (me._slatPos >= 2 and me._slatPos <= 20) {
ADIRSnew.overspeedVFE.setValue(234);
} else {
ADIRSnew.overspeedVFE.setValue(1024);
}
}
),
],
loop: func() {
notification = nil;
foreach (var update_item; me.update_items) {
update_item.update(notification);
}
},
};

View file

@ -18,7 +18,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")];
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 warningFlash = props.globals.initNode("/ECAM/warnings/master-warning-flash", 0, "BOOL");
var lineIndex = 0;
@ -46,6 +46,7 @@ var warning = {
t.sdPage = sdPage;
t.isMemo = isMemo;
t.hasCalled = 0;
t.wasActive = 0;
return t
},
@ -68,19 +69,29 @@ var warning = {
}
},
warnlight: func() {
if (me.light > 1 or me.noRepeat == 1 or me.active == 0) {return;}
lights[me.light].setBoolValue(1);
me.noRepeat = 1;
if (me.light > 1 or me.noRepeat == 1 or (me.active == 0 and me.wasActive == 0)) {return;}
if (me.active == 1) {
lights[me.light].setBoolValue(1);
me.noRepeat = 1;
} elsif (me.wasActive) {
lights[me.light].setBoolValue(0);
me.wasActive = 0;
}
},
sound: func() {
if (me.aural > 1 or me.noRepeat2 == 1 or me.active == 0) {return;}
if (me.aural != 0) {
if (me.aural > 2 or me.noRepeat2 == 1 or (me.active == 0 and me.wasActive == 0)) {return;}
if (me.active == 1) {
if (me.aural != 0) {
aural[me.aural].setBoolValue(0);
}
me.noRepeat2 = 1;
settimer(func() {
aural[me.aural].setBoolValue(1);
}, 0.15);
} elsif (me.wasActive) {
aural[me.aural].setBoolValue(0);
me.wasActive = 0;
}
me.noRepeat2 = 1;
settimer(func() {
aural[me.aural].setBoolValue(1);
}, 0.15);
},
callPage: func() {
if (me.sdPage == "nil" or me.hasCalled == 1) { return; }
@ -320,6 +331,9 @@ var ECAM_controller = {
warning.active = 0;
warning.noRepeat = 0;
warning.noRepeat2 = 0;
if (warning.aural == 2) {
aural[2].setValue(0);
}
},
};

View file

@ -22,6 +22,7 @@ var apu_bleedSw = props.globals.getNode("/controls/pneumatic/switches/bleedapu
var gear = props.globals.getNode("/gear/gear-pos-norm", 1);
var cutoff1 = props.globals.getNode("/controls/engines/engine[0]/cutoff-switch", 1);
var cutoff2 = props.globals.getNode("/controls/engines/engine[1]/cutoff-switch", 1);
var stallVoice = props.globals.initNode("/sim/sound/warnings/stall-voice", 0, "BOOL");
var engOpt = props.globals.getNode("/options/eng", 1);
# local variables
@ -29,11 +30,53 @@ var phaseVar = nil;
var dualFailFACActive = 1;
var emerConfigFACActive = 1;
var gear_agl_cur = nil;
var messages_priority_3 = func {
phaseVar = phaseNode.getValue();
# FCTL
# Stall
# todo - altn law and emer cancel flipflops page 2440
if (phaseVar >= 5 and phaseVar <= 7 and (getprop("/fdm/jsbsim/fcs/slat-pos-deg") <= 15 and (getprop("/systems/navigation/adr/output/aoa-1") > 15 or getprop("/systems/navigation/adr/output/aoa-2") > 15 or getprop("/systems/navigation/adr/output/aoa-3") > 15)) or (getprop("/fdm/jsbsim/fcs/slat-pos-deg") > 15 and (getprop("/systems/navigation/adr/output/aoa-1") > 23 or getprop("/systems/navigation/adr/output/aoa-2") > 23 or getprop("/systems/navigation/adr/output/aoa-3") > 23))) {
stall.active = 1;
} else {
ECAM_controller.warningReset(stall);
}
if (stall.active) {
stallVoice.setValue(1);
} else {
stallVoice.setValue(0);
}
if ((phaseVar == 1 or (phaseVar >= 5 and phaseVar <= 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")) {
overspeedVMO.active = 1;
} else {
ECAM_controller.warningReset(overspeedVMO);
}
if (getprop("/systems/navigation/adr/computation/overspeed-vle")) {
overspeedGear.active = 1;
} else {
ECAM_controller.warningReset(overspeedGear);
}
if (getprop("/systems/navigation/adr/computation/overspeed-vfe")) {
overspeedFlap.active = 1;
overspeedFlap.msg = "-VFE................" ~ (systems.ADIRSnew.overspeedVFE.getValue() - 4);
} else {
ECAM_controller.warningReset(overspeedGear);
overspeedFlap.msg = "-VFE................XXX";
}
} else {
ECAM_controller.warningReset(overspeed);
ECAM_controller.warningReset(overspeedVMO);
ECAM_controller.warningReset(overspeedGear);
ECAM_controller.warningReset(overspeedFlap);
overspeedFlap.msg = "-VFE................XXX";
}
# FCTL FLAPS NOT ZERO
if ((flap_not_zero.clearFlag == 0) and phaseVar == 6 and getprop("/controls/flight/flap-lever") != 0 and getprop("/instrumentation/altimeter/indicated-altitude-ft") > 22000) {
flap_not_zero.active = 1;
} else {

View file

@ -10,8 +10,14 @@
# Left E/WD
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 overspeed = warning.new(msg: "OVER SPEED", colour: "r", aural: 0, light: 0, hasSubmsg: 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, hasSubmsg: 1),
var dualFailModeSel = warning.new(msg: " -ENG MODE SEL.......IGN", colour: "c"),

View file

@ -264,24 +264,24 @@ var masterFMGC = maketimer(0.2, func {
reset_FMGC();
}
if (getprop("/systems/navigation/adr/computation/overspeed-vfe-spd") != 1024) {
setprop("/FMGC/internal/maxspeed", getprop("/systems/navigation/adr/computation/overspeed-vfe-spd") - 4);
} else {
setprop("/FMGC/internal/maxspeed", getprop("/it-fbw/speeds/vmo-mmo"));
}
flap = getprop("/controls/flight/flap-pos");
if (flap == 0) { # 0
setprop("/FMGC/internal/maxspeed", getprop("/it-fbw/speeds/vmo-mmo"));
setprop("/FMGC/internal/minspeed", 202);
} else if (flap == 1) { # 1
setprop("/FMGC/internal/maxspeed", 230);
setprop("/FMGC/internal/minspeed", 184);
} else if (flap == 2) { # 1+F
setprop("/FMGC/internal/maxspeed", 215);
setprop("/FMGC/internal/minspeed", 171);
} else if (flap == 3) { # 2
setprop("/FMGC/internal/maxspeed", 200);
setprop("/FMGC/internal/minspeed", 156);
} else if (flap == 4) { # 3
setprop("/FMGC/internal/maxspeed", 185);
setprop("/FMGC/internal/minspeed", 147);
} else if (flap == 5) { # FULL
setprop("/FMGC/internal/maxspeed", 177);
setprop("/FMGC/internal/minspeed", 131);
}

View file

@ -200,6 +200,7 @@ var systemsInit = func {
systems.HYD.init();
systems.FUEL.init();
systems.ADIRS.init();
systems.ADIRSnew.init();
systems.eng_init();
systems.fire_init();
systems.autobrake_init();
@ -231,6 +232,7 @@ var systemsLoop = maketimer(0.1, func {
systems.HYD.loop();
systems.FUEL.loop();
systems.ADIRS.loop();
systems.ADIRSnew.loop();
libraries.ECAM.loop();
libraries.BUTTONS.update();
fadec.FADEC.loop();

View file

@ -47,6 +47,13 @@ var Instrumentation = {
},
};
var JSBSIM = {
FCS: {
flapDeg: props.globals.getNode("/fdm/jsbsim/fcs/flap-pos-deg"),
slatDeg: props.globals.getNode("/fdm/jsbsim/fcs/slat-pos-deg"),
},
};
var Options = {
eng: props.globals.getNode("/options/eng"),
};

View file

@ -1581,14 +1581,32 @@
<max-dist>100</max-dist>
</crc>
<cricket>
<name>Cricket</name>
<path>Aircraft/A320-family/Sounds/Cockpit/cricket.wav</path>
<mode>looped</mode>
<type>avionics</type>
<condition>
<property>/sim/sound/warnings/cricket</property>
</condition>
<volume>
<factor>0.2</factor>
</volume>
<reference-dist>10</reference-dist>
<max-dist>100</max-dist>
</cricket>
<stall-voice>
<name>stall-voice</name>
<mode>looped</mode>
<path>Aircraft/A320-family/Sounds/Cockpit/stall_voice.wav</path>
<type>avionics</type>
<condition>
<property>warnings/stall/active</property>
<property>/sim/sound/warnings/stall-voice</property>
</condition>
<volume>
<factor>2.0</factor>
</volume>
<reference-dist>10</reference-dist>
<max-dist>100.0</max-dist>
</stall-voice>

Binary file not shown.

Binary file not shown.

809
Systems/a320-adr.xml Normal file
View file

@ -0,0 +1,809 @@
<!-- Airbus A320 ADR -->
<!-- Copyright (c) 2019 Jonathan Redpath -->
<system name="A320: ADR">
<channel name="ADR Inputs">
<sensor name="/systems/navigation/probes/pitot-1">
<input>/systems/pitot[0]/measured-total-pressure-inhg</input>
</sensor>
<sensor name="/systems/navigation/probes/pitot-2">
<input>/systems/pitot[1]/measured-total-pressure-inhg</input>
</sensor>
<sensor name="/systems/navigation/probes/pitot-3">
<input>/systems/pitot[2]/measured-total-pressure-inhg</input>
</sensor>
<sensor name="/systems/navigation/probes/static-1">
<input>/systems/static[0]/pressure-inhg</input>
</sensor>
<sensor name="/systems/navigation/probes/static-2">
<input>/systems/static[1]/pressure-inhg</input>
</sensor>
<sensor name="/systems/navigation/probes/static-3">
<input>/systems/static[2]/pressure-inhg</input>
</sensor>
<fcs_function name="/systems/navigation/probes/tat-1/compute-tat">
<function>
<difference>
<product>
<sum>
<property>/environment/temperature-degc</property> <!-- SAT -->
<value>273.15</value>
</sum>
<sum>
<value>1</value>
<product>
<value>0.2</value> <!-- ratio of specific heats - 1 / 2 -->
<value>0.995</value> <!-- empirical recovery factor -->
<pow>
<property>velocities/mach</property> <!-- going to use the pure value of mach here and then calculate another value -->
<value>2</value>
</pow>
</product>
</sum>
</product>
<value>273.15</value>
</difference>
</function>
</fcs_function>
<fcs_function name="/systems/navigation/probes/tat-2/compute-tat">
<function>
<difference>
<product>
<sum>
<property>/environment/temperature-degc</property> <!-- SAT -->
<value>273.15</value>
</sum>
<sum>
<value>1</value>
<product>
<value>0.2</value> <!-- ratio of specific heats - 1 / 2 -->
<value>0.996</value> <!-- empirical recovery factor -->
<pow>
<property>velocities/mach</property> <!-- going to use the pure value of mach here and then calculate another value -->
<value>2</value>
</pow>
</product>
</sum>
</product>
<value>273.15</value>
</difference>
</function>
</fcs_function>
<sensor name="/systems/navigation/probes/tat-1/tat">
<input>/systems/navigation/probes/tat-1/compute-tat</input>
<quantization name="/systems/navigation/adr/output/tat-1">
<bits>11</bits>
<min>-256</min>
<max>256</max>
</quantization>
</sensor>
<sensor name="/systems/navigation/probes/tat-2/tat">
<input>/systems/navigation/probes/tat-2/compute-tat</input>
<quantization name="/systems/navigation/adr/output/tat-2">
<bits>11</bits>
<min>-256</min>
<max>256</max>
</quantization>
</sensor>
<sensor name="/systems/navigation/probes/aoa-1">
<input>aero/alpha-deg</input>
<quantization name="/systems/navigation/adr/output/aoa-1">
<bits>12</bits>
<min>-180</min>
<max>180</max>
</quantization>
</sensor>
<sensor name="/systems/navigation/probes/aoa-2">
<input>aero/alpha-deg</input>
<quantization name="/systems/navigation/adr/output/aoa-2">
<bits>12</bits>
<min>-180</min>
<max>180</max>
</quantization>
</sensor>
<sensor name="/systems/navigation/probes/aoa-3">
<input>aero/alpha-deg</input>
<quantization name="/systems/navigation/adr/output/aoa-3">
<bits>12</bits>
<min>-180</min>
<max>180</max>
</quantization>
</sensor>
</channel>
<channel name="ADR Computation">
<sensor name="/systems/navigation/adr/computation/baro-alt-1-capt">
<input>/instrumentation/altimeter[0]/pressure-alt-ft</input>
<quantization name="/systems/navigation/adr/output/baro-alt-1-capt">
<bits>17</bits>
<min>-65536</min>
<max>65536</max>
</quantization>
</sensor>
<sensor name="/systems/navigation/adr/computation/baro-alt-2-capt">
<input>/instrumentation/altimeter[1]/pressure-alt-ft</input>
<quantization name="/systems/navigation/adr/output/baro-alt-2-capt">
<bits>17</bits>
<min>-65536</min>
<max>65536</max>
</quantization>
</sensor>
<sensor name="/systems/navigation/adr/computation/baro-alt-3-capt">
<input>/instrumentation/altimeter[2]/pressure-alt-ft</input>
<quantization name="/systems/navigation/adr/output/baro-alt-3-capt">
<bits>17</bits>
<min>-65536</min>
<max>65536</max>
</quantization>
</sensor>
<sensor name="/systems/navigation/adr/computation/baro-alt-1-fo">
<input>/instrumentation/altimeter[3]/pressure-alt-ft</input>
<quantization name="/systems/navigation/adr/output/baro-alt-1-fo">
<bits>17</bits>
<min>-65536</min>
<max>65536</max>
</quantization>
</sensor>
<sensor name="/systems/navigation/adr/computation/baro-alt-2-fo">
<input>/instrumentation/altimeter[4]/pressure-alt-ft</input>
<quantization name="/systems/navigation/adr/output/baro-alt-2-fo">
<bits>17</bits>
<min>-65536</min>
<max>65536</max>
</quantization>
</sensor>
<sensor name="/systems/navigation/adr/computation/baro-alt-3-fo">
<input>/instrumentation/altimeter[5]/pressure-alt-ft</input>
<quantization name="/systems/navigation/adr/output/baro-alt-3-fo">
<bits>17</bits>
<min>-65536</min>
<max>65536</max>
</quantization>
</sensor>
<sensor name="/systems/navigation/adr/computation/baro-alt-corrected-1-capt">
<input>/instrumentation/altimeter[0]/indicated-altitude-ft</input>
<quantization name="/systems/navigation/adr/output/baro-alt-corrected-1-capt">
<bits>17</bits>
<min>-65536</min>
<max>65536</max>
</quantization>
</sensor>
<sensor name="/systems/navigation/adr/computation/baro-alt-corrected-2-capt">
<input>/instrumentation/altimeter[1]/indicated-altitude-ft</input>
<quantization name="/systems/navigation/adr/output/baro-alt-corrected-2-capt">
<bits>17</bits>
<min>-65536</min>
<max>65536</max>
</quantization>
</sensor>
<sensor name="/systems/navigation/adr/computation/baro-alt-corrected-3-capt">
<input>/instrumentation/altimeter[2]/indicated-altitude-ft</input>
<quantization name="/systems/navigation/adr/output/baro-alt-corrected-3-capt">
<bits>17</bits>
<min>-65536</min>
<max>65536</max>
</quantization>
</sensor>
<sensor name="/systems/navigation/adr/computation/baro-alt-corrected-1-fo">
<input>/instrumentation/altimeter[3]/indicated-altitude-ft</input>
<quantization name="/systems/navigation/adr/output/baro-alt-corrected-1-fo">
<bits>17</bits>
<min>-65536</min>
<max>65536</max>
</quantization>
</sensor>
<sensor name="/systems/navigation/adr/computation/baro-alt-corrected-2-fo">
<input>/instrumentation/altimeter[4]/indicated-altitude-ft</input>
<quantization name="/systems/navigation/adr/output/baro-alt-corrected-2-fo">
<bits>17</bits>
<min>-65536</min>
<max>65536</max>
</quantization>
</sensor>
<sensor name="/systems/navigation/adr/computation/baro-alt-corrected-3-fo">
<input>/instrumentation/altimeter[5]/indicated-altitude-ft</input>
<quantization name="/systems/navigation/adr/output/baro-alt-corrected-3-fo">
<bits>17</bits>
<min>-65536</min>
<max>65536</max>
</quantization>
</sensor>
<fcs_function name="/systems/navigation/adr/computation/cas-1-compute"> <!-- same as mach but with sea level pressure and multiplied by speed of sound at sea level -->
<function>
<product>
<value>661.47</value>
<pow>
<product>
<value>5</value>
<difference>
<pow>
<sum>
<quotient>
<difference>
<property>/systems/navigation/probes/pitot-1</property> <!-- impact pressure -->
<property>/systems/navigation/probes/static-1</property>
</difference>
<value>29.9212553</value> <!-- use standard outside pressure -->
</quotient>
<value>1</value>
</sum>
<quotient>
<value>2</value>
<value>7</value>
</quotient>
</pow>
<value>1</value>
</difference>
</product>
<value>0.5</value>
</pow>
</product>
</function>
</fcs_function>
<fcs_function name="/systems/navigation/adr/computation/cas-2-compute">
<function>
<product>
<value>661.47</value>
<pow>
<product>
<value>5</value>
<difference>
<pow>
<sum>
<quotient>
<difference>
<property>/systems/navigation/probes/pitot-2</property>
<property>/systems/navigation/probes/static-2</property>
</difference>
<value>29.9212553</value>
</quotient>
<value>1</value>
</sum>
<quotient>
<value>2</value>
<value>7</value>
</quotient>
</pow>
<value>1</value>
</difference>
</product>
<value>0.5</value>
</pow>
</product>
</function>
</fcs_function>
<fcs_function name="/systems/navigation/adr/computation/cas-3-compute">
<function>
<product>
<value>661.47</value>
<pow>
<product>
<value>5</value>
<difference>
<pow>
<sum>
<quotient>
<difference>
<property>/systems/navigation/probes/pitot-3</property> <!-- impact pressure -->
<property>/systems/navigation/probes/static-3</property>
</difference>
<value>29.9212553</value> <!-- use standard outside pressure -->
</quotient>
<value>1</value>
</sum>
<quotient>
<value>2</value>
<value>7</value>
</quotient>
</pow>
<value>1</value>
</difference>
</product>
<value>0.5</value>
</pow>
</product>
</function>
</fcs_function>
<sensor name="/systems/navigation/adr/computation/cas-1">
<input>/systems/navigation/adr/computation/cas-1-compute</input>
<quantization name="/systems/navigation/adr/computation/cas-1">
<bits>14</bits>
<min>0</min>
<max>1024</max>
</quantization>
</sensor>
<sensor name="/systems/navigation/adr/computation/cas-2">
<input>/systems/navigation/adr/computation/cas-2-compute</input>
<quantization name="/systems/navigation/adr/computation/cas-2">
<bits>14</bits>
<min>0</min>
<max>1024</max>
</quantization>
</sensor>
<sensor name="/systems/navigation/adr/computation/cas-3">
<input>/systems/navigation/adr/computation/cas-3-compute</input>
<quantization name="/systems/navigation/adr/computation/cas-3">
<bits>14</bits>
<min>0</min>
<max>1024</max>
</quantization>
</sensor>
<fcs_function name="/systems/navigation/adr/computation/mach-1-compute">
<function>
<pow>
<product>
<value>5</value> <!-- 2 / specific heat ratio - 1 -->
<difference>
<pow>
<sum>
<quotient>
<difference>
<property>/systems/navigation/probes/pitot-1</property> <!-- dynamic pressure -->
<property>/systems/navigation/probes/static-1</property>
</difference>
<property>/systems/navigation/probes/static-1</property> <!-- static pressure -->
</quotient>
<value>1</value>
</sum>
<quotient>
<value>2</value>
<value>7</value>
</quotient>
</pow>
<value>1</value>
</difference>
</product>
<value>0.5</value>
</pow>
</function>
</fcs_function>
<fcs_function name="/systems/navigation/adr/computation/mach-2-compute">
<function>
<pow>
<product>
<value>5</value>
<difference>
<pow>
<sum>
<quotient>
<difference>
<property>/systems/navigation/probes/pitot-2</property>
<property>/systems/navigation/probes/static-2</property>
</difference>
<property>/systems/navigation/probes/static-2</property>
</quotient>
<value>1</value>
</sum>
<quotient>
<value>2</value>
<value>7</value>
</quotient>
</pow>
<value>1</value>
</difference>
</product>
<value>0.5</value>
</pow>
</function>
</fcs_function>
<fcs_function name="/systems/navigation/adr/computation/mach-3-compute">
<function>
<pow>
<product>
<value>5</value>
<difference>
<pow>
<sum>
<quotient>
<difference>
<property>/systems/navigation/probes/pitot-3</property>
<property>/systems/navigation/probes/static-3</property>
</difference>
<property>/systems/navigation/probes/static-3</property>
</quotient>
<value>1</value>
</sum>
<quotient>
<value>2</value>
<value>7</value>
</quotient>
</pow>
<value>1</value>
</difference>
</product>
<value>0.5</value>
</pow>
</function>
</fcs_function>
<sensor name="/systems/navigation/adr/computation/mach-1">
<input>/systems/navigation/adr/computation/mach-1-compute</input>
<quantization name="/systems/navigation/adr/computation/mach-1">
<bits>16</bits>
<min>0</min>
<max>4.096</max> <!-- O_o -->
</quantization>
</sensor>
<sensor name="/systems/navigation/adr/computation/mach-2">
<input>/systems/navigation/adr/computation/mach-2-compute</input>
<quantization name="/systems/navigation/adr/computation/mach-2">
<bits>16</bits>
<min>0</min>
<max>4.096</max>
</quantization>
</sensor>
<sensor name="/systems/navigation/adr/computation/mach-3">
<input>/systems/navigation/adr/computation/mach-3-compute</input>
<quantization name="/systems/navigation/adr/computation/mach-3">
<bits>16</bits>
<min>0</min>
<max>4.096</max>
</quantization>
</sensor>
<fcs_function name="/systems/navigation/adr/computation/sat-1-compute">
<function>
<difference>
<property>/systems/navigation/probes/tat-1/tat</property>
<quotient>
<pow>
<property>/velocities/TAS</property>
<value>2</value>
</pow>
<value>7569</value>
</quotient>
</difference>
</function>
</fcs_function>
<sensor name="/systems/navigation/adr/computation/sat-1">
<input>/environment/temperature-degc</input>
<quantization name="/systems/navigation/adr/computation/sat-1">
<bits>11</bits>
<min>-256</min>
<max>256</max>
</quantization>
</sensor>
<sensor name="/systems/navigation/adr/computation/sat-2">
<input>/environment/temperature-degc</input>
<quantization name="/systems/navigation/adr/computation/sat-2">
<bits>11</bits>
<min>-256</min>
<max>256</max>
</quantization>
</sensor>
<fcs_function name="/systems/navigation/adr/computation/tas-1-compute">
<function>
<product>
<value>661.47</value> <!-- speed of sound at SL -->
<property>/systems/navigation/adr/computation/mach-1</property>
<pow>
<quotient>
<sum>
<property>/systems/navigation/adr/computation/sat-1</property>
<value>273.15</value>
</sum>
<value>288.15</value> <!-- temperature at SL -->
</quotient>
<value>0.5</value>
</pow>
</product>
</function>
</fcs_function>
<fcs_function name="/systems/navigation/adr/computation/tas-2-compute">
<function>
<product>
<value>661.47</value> <!-- speed of sound at SL -->
<property>/systems/navigation/adr/computation/mach-2</property>
<pow>
<quotient>
<sum>
<property>/systems/navigation/adr/computation/sat-2</property>
<value>273.15</value>
</sum>
<value>288.15</value> <!-- temperature at SL -->
</quotient>
<value>0.5</value>
</pow>
</product>
</function>
</fcs_function>
<fcs_function name="/systems/navigation/adr/computation/tas-3-compute">
<function>
<product>
<value>661.47</value> <!-- speed of sound at SL -->
<property>/systems/navigation/adr/computation/mach-3</property>
<pow>
<quotient>
<sum>
<property>/systems/navigation/adr/computation/sat-1</property> <!-- use captain's probe -->
<value>273.15</value>
</sum>
<value>288.15</value> <!-- temperature at SL -->
</quotient>
<value>0.5</value>
</pow>
</product>
</function>
</fcs_function>
<sensor name="/systems/navigation/adr/computation/tas-1">
<input>/systems/navigation/adr/computation/tas-1-compute</input>
<quantization name="/systems/navigation/adr/computation/tas-1">
<bits>15</bits>
<min>0</min>
<max>2048</max>
</quantization>
</sensor>
<sensor name="/systems/navigation/adr/computation/tas-2">
<input>/systems/navigation/adr/computation/tas-2-compute</input>
<quantization name="/systems/navigation/adr/computation/tas-2">
<bits>15</bits>
<min>0</min>
<max>2048</max>
</quantization>
</sensor>
<sensor name="/systems/navigation/adr/computation/tas-3">
<input>/systems/navigation/adr/computation/tas-3-compute</input>
<quantization name="/systems/navigation/adr/computation/tas-3">
<bits>15</bits>
<min>0</min>
<max>2048</max>
</quantization>
</sensor>
<fcs_function name="/systems/navigation/adr/computation/overspeed-vmo">
<function>
<ifthen>
<gt>
<max>
<property>/systems/navigation/adr/output/cas-1</property>
<property>/systems/navigation/adr/output/cas-2</property>
<property>/systems/navigation/adr/output/cas-3</property>
</max>
<value>354</value>
</gt>
<value>1</value>
<value>0</value>
</ifthen>
</function>
</fcs_function>
<fcs_function name="/systems/navigation/adr/computation/overspeed-mmo">
<function>
<ifthen>
<gt>
<max>
<property>/systems/navigation/adr/output/mach-1</property>
<property>/systems/navigation/adr/output/mach-2</property>
<property>/systems/navigation/adr/output/mach-3</property>
</max>
<value>0.826</value>
</gt>
<value>1</value>
<value>0</value>
</ifthen>
</function>
</fcs_function>
<switch name="/systems/navigation/adr/computation/overspeed-vle">
<default value="0"/>
<test logic="AND" value="1">
/systems/navigation/adr/computation/overspeed-vle-speed eq 1
<test logic="OR">
/ECAM/Lower/door-left ne 0
/ECAM/Lower/door-right ne 0
/ECAM/Lower/door-nose-left ne 0
/ECAM/Lower/door-nose-right ne 0
/gear/gear[0]/position-norm ne 0
/gear/gear[1]/position-norm ne 0
/gear/gear[2]/position-norm ne 0
</test>
</test>
</switch>
<fcs_function name="/systems/navigation/adr/computation/overspeed-vle-speed">
<function>
<ifthen>
<gt>
<max>
<property>/systems/navigation/adr/output/cas-1</property>
<property>/systems/navigation/adr/output/cas-2</property>
<property>/systems/navigation/adr/output/cas-3</property>
</max>
<value>284</value>
</gt>
<value>1</value>
<value>0</value>
</ifthen>
</function>
</fcs_function>
<fcs_function name="/systems/navigation/adr/computation/overspeed-vfe">
<function>
<ifthen>
<gt>
<max>
<property>/systems/navigation/adr/output/cas-1</property>
<property>/systems/navigation/adr/output/cas-2</property>
<property>/systems/navigation/adr/output/cas-3</property>
</max>
<property>/systems/navigation/adr/computation/overspeed-vfe-spd</property>
</gt>
<value>1</value>
<value>0</value>
</ifthen>
</function>
</fcs_function>
</channel>
<channel name="ADR Output"> <!-- todo - need lowpass? -->
<pure_gain name="/systems/navigation/adr/output/aoa-1">
<input>/systems/navigation/probes/aoa-1</input>
<gain>1</gain>
</pure_gain>
<pure_gain name="/systems/navigation/adr/output/aoa-2">
<input>/systems/navigation/probes/aoa-2</input>
<gain>1</gain>
</pure_gain>
<pure_gain name="/systems/navigation/adr/output/aoa-3">
<input>/systems/navigation/probes/aoa-3</input>
<gain>1</gain>
</pure_gain>
<pure_gain name="/systems/navigation/adr/output/baro-alt-1-capt">
<input>/systems/navigation/adr/computation/baro-alt-1-capt</input>
<gain>1</gain>
</pure_gain>
<pure_gain name="/systems/navigation/adr/output/baro-alt-2-capt">
<input>/systems/navigation/adr/computation/baro-alt-2-capt</input>
<gain>1</gain>
</pure_gain>
<pure_gain name="/systems/navigation/adr/output/baro-alt-3-capt">
<input>/systems/navigation/adr/computation/baro-alt-3-capt</input>
<gain>1</gain>
</pure_gain>
<pure_gain name="/systems/navigation/adr/output/baro-alt-1-fo">
<input>/systems/navigation/adr/computation/baro-alt-1-fo</input>
<gain>1</gain>
</pure_gain>
<pure_gain name="/systems/navigation/adr/output/baro-alt-2-capt">
<input>/systems/navigation/adr/computation/baro-alt-2-fo</input>
<gain>1</gain>
</pure_gain>
<pure_gain name="/systems/navigation/adr/output/baro-alt-3-fo">
<input>/systems/navigation/adr/computation/baro-alt-3-fo</input>
<gain>1</gain>
</pure_gain>
<pure_gain name="/systems/navigation/adr/output/cas-1">
<input>/systems/navigation/adr/computation/cas-1</input>
<gain>1</gain>
</pure_gain>
<pure_gain name="/systems/navigation/adr/output/cas-2">
<input>/systems/navigation/adr/computation/cas-2</input>
<gain>1</gain>
</pure_gain>
<pure_gain name="/systems/navigation/adr/output/cas-3">
<input>/systems/navigation/adr/computation/cas-3</input>
<gain>1</gain>
</pure_gain>
<pure_gain name="/systems/navigation/adr/output/mach-1">
<input>/systems/navigation/adr/computation/mach-1</input>
<gain>1</gain>
</pure_gain>
<pure_gain name="/systems/navigation/adr/output/mach-2">
<input>/systems/navigation/adr/computation/mach-2</input>
<gain>1</gain>
</pure_gain>
<pure_gain name="/systems/navigation/adr/output/mach-3">
<input>/systems/navigation/adr/computation/mach-3</input>
<gain>1</gain>
</pure_gain>
<pure_gain name="/systems/navigation/adr/output/sat-1">
<input>/systems/navigation/adr/computation/sat-1</input>
<gain>1</gain>
</pure_gain>
<pure_gain name="/systems/navigation/adr/output/sat-2">
<input>/systems/navigation/adr/computation/sat-2</input>
<gain>1</gain>
</pure_gain>
<pure_gain name="/systems/navigation/adr/output/tas-1">
<input>/systems/navigation/adr/computation/tas-1</input>
<gain>1</gain>
</pure_gain>
<pure_gain name="/systems/navigation/adr/output/tas-2">
<input>/systems/navigation/adr/computation/tas-2</input>
<gain>1</gain>
</pure_gain>
<pure_gain name="/systems/navigation/adr/output/tas-3">
<input>/systems/navigation/adr/computation/tas-3</input>
<gain>1</gain>
</pure_gain>
<pure_gain name="/systems/navigation/adr/output/tat-1">
<input>/systems/navigation/probes/tat-1/tat</input>
<gain>1</gain>
</pure_gain>
<pure_gain name="/systems/navigation/adr/output/tat-2">
<input>/systems/navigation/probes/tat-2/tat</input>
<gain>1</gain>
</pure_gain>
<fcs_function name="/systems/navigation/adr/output/overspeed">
<function>
<max>
<property>/systems/navigation/adr/computation/overspeed-vmo</property>
<property>/systems/navigation/adr/computation/overspeed-mmo</property>
<property>/systems/navigation/adr/computation/overspeed-vle</property>
<property>/systems/navigation/adr/computation/overspeed-vfe</property>
</max>
</function>
</fcs_function>
</channel>
</system>

View file

@ -26,9 +26,59 @@
<altimeter>
<name>altimeter</name>
<number>0</number>
<static-pressure>/systems/static/pressure-inhg</static-pressure>
<quantum>0</quantum>
<tau>0</tau>
<static-pressure>/systems/static[0]/pressure-inhg</static-pressure>
<quantum>1</quantum>
<tau>0.1</tau>
<encode-mode-c>1</encode-mode-c>
<encode-mode-s>1</encode-mode-s>
</altimeter>
<altimeter>
<name>altimeter</name>
<number>1</number>
<static-pressure>/systems/static[1]/pressure-inhg</static-pressure>
<quantum>1</quantum>
<tau>0.1</tau>
<encode-mode-c>1</encode-mode-c>
<encode-mode-s>1</encode-mode-s>
</altimeter>
<altimeter>
<name>altimeter</name>
<number>2</number>
<static-pressure>/systems/static[2]/pressure-inhg</static-pressure>
<quantum>1</quantum>
<tau>0.1</tau>
<encode-mode-c>1</encode-mode-c>
<encode-mode-s>1</encode-mode-s>
</altimeter>
<altimeter>
<name>altimeter</name>
<number>3</number>
<static-pressure>/systems/static[0]/pressure-inhg</static-pressure>
<quantum>1</quantum>
<tau>0.1</tau>
<encode-mode-c>1</encode-mode-c>
<encode-mode-s>1</encode-mode-s>
</altimeter>
<altimeter>
<name>altimeter</name>
<number>4</number>
<static-pressure>/systems/static[1]/pressure-inhg</static-pressure>
<quantum>1</quantum>
<tau>0.1</tau>
<encode-mode-c>1</encode-mode-c>
<encode-mode-s>1</encode-mode-s>
</altimeter>
<altimeter>
<name>altimeter</name>
<number>5</number>
<static-pressure>/systems/static[2]/pressure-inhg</static-pressure>
<quantum>1</quantum>
<tau>0.1</tau>
<encode-mode-c>1</encode-mode-c>
<encode-mode-s>1</encode-mode-s>
</altimeter>

57
Systems/pitot-static.xml Normal file
View file

@ -0,0 +1,57 @@
<?xml version="1.0"?>
<PropertyList>
<pitot>
<name>pitot</name>
<number>0</number>
</pitot>
<pitot>
<name>pitot</name>
<number>1</number>
</pitot>
<pitot>
<name>pitot</name>
<number>2</number>
</pitot>
<static>
<name>static</name>
<number>0</number>
<tau>0.7</tau>
<type>1</type>
<error-factor>0.43</error-factor>
</static>
<static>
<name>static</name>
<number>1</number>
<tau>0.7</tau>
<type>1</type>
<error-factor>0.42</error-factor>
</static>
<static>
<name>static</name>
<number>2</number>
<tau>0.7</tau>
<type>1</type>
<error-factor>0.45</error-factor>
</static>
<vacuum> <!-- todo get property based on elec -->
<name>vacuum</name>
<number>0</number>
<rpm>/engines/engine[0]/rpm</rpm>
<scale>1.0</scale>
</vacuum>
<vacuum>
<name>vacuum</name>
<number>1</number>
<rpm>/engines/engine[1]/rpm</rpm>
<scale>1.0</scale>
</vacuum>
</PropertyList>