391 lines
12 KiB
XML
391 lines
12 KiB
XML
|
<?xml version="1.0"?>
|
||
|
|
||
|
<!-- Copyright (c) 2019 Jonathan Redpath (legoboyvdlp) -->
|
||
|
|
||
|
<system name="A320: Electrical">
|
||
|
|
||
|
<channel name="Main Electrical" execrate="8">
|
||
|
|
||
|
<!-- Battery 1 -->
|
||
|
<fcs_function name="/systems/electrical/sources/bat-1/volt">
|
||
|
<function>
|
||
|
<table>
|
||
|
<independentVar lookup="row">/systems/electrical/sources/bat-1/percent</independentVar>
|
||
|
<independentVar lookup="column">/systems/failures/electrical/bat-1</independentVar>
|
||
|
<tableData>
|
||
|
0 1
|
||
|
0 0 0
|
||
|
10 24 4
|
||
|
100 31 7
|
||
|
</tableData>
|
||
|
</table>
|
||
|
</function>
|
||
|
</fcs_function>
|
||
|
|
||
|
<switch name="/systems/electrical/sources/bat-1/amp"> <!-- todo - should relate to load / charging -->
|
||
|
<default value="0"/>
|
||
|
<test logic="AND" value="2">
|
||
|
/controls/electrical/switches/bat-1 eq 1
|
||
|
/systems/electrical/sources/bat-1/volt ge 10
|
||
|
</test>
|
||
|
</switch>
|
||
|
|
||
|
<!-- Battery 2 -->
|
||
|
<fcs_function name="/systems/electrical/sources/bat-2/volt">
|
||
|
<function>
|
||
|
<table>
|
||
|
<independentVar lookup="row">/systems/electrical/sources/bat-2/percent</independentVar>
|
||
|
<independentVar lookup="column">/systems/failures/electrical/bat-2</independentVar>
|
||
|
<tableData>
|
||
|
0 1
|
||
|
0 0 0
|
||
|
10 24 4
|
||
|
100 31 7
|
||
|
</tableData>
|
||
|
</table>
|
||
|
</function>
|
||
|
</fcs_function>
|
||
|
|
||
|
<switch name="/systems/electrical/sources/bat-2/amp"> <!-- todo - should relate to load / charging -->
|
||
|
<default value="0"/>
|
||
|
<test logic="AND" value="2">
|
||
|
/controls/electrical/switches/bat-2 eq 1
|
||
|
/systems/electrical/sources/bat-2/volt ge 10
|
||
|
</test>
|
||
|
</switch>
|
||
|
|
||
|
<!-- IDG 1 -->
|
||
|
<pure_gain name="/systems/electrical/sources/idg-1/drive-rpm-input">
|
||
|
<input>/engines/engine[0]/n2-actual</input>
|
||
|
<gain>90.298</gain> <!-- 1% N2 RPM value * 0.604 -->
|
||
|
</pure_gain>
|
||
|
|
||
|
<pure_gain name="/systems/electrical/sources/idg-1/drive-rpm">
|
||
|
<input>/systems/electrical/sources/idg-1/drive-rpm-input</input>
|
||
|
<gain>/controls/electrical/switches/gen-drive-1</gain>
|
||
|
</pure_gain>
|
||
|
|
||
|
<fcs_function name="/systems/electrical/sources/idg-1/csd-gearbox-ratio-cmd">
|
||
|
<function>
|
||
|
<quotient>
|
||
|
<value>12000</value>
|
||
|
<property>/systems/electrical/sources/idg-1/drive-rpm</property>
|
||
|
</quotient>
|
||
|
</function>
|
||
|
<clipto>
|
||
|
<min>1.3</min>
|
||
|
<max>2.8</max>
|
||
|
</clipto>
|
||
|
</fcs_function>
|
||
|
|
||
|
<lag_filter name="/systems/electrical/sources/idg-1/csd-gearbox-ratio">
|
||
|
<input>/systems/electrical/sources/idg-1/csd-gearbox-ratio-cmd</input>
|
||
|
<c1>40</c1>
|
||
|
</lag_filter>
|
||
|
|
||
|
<pure_gain name="/systems/electrical/sources/idg-1/csd-rpm">
|
||
|
<input>/systems/electrical/sources/idg-1/drive-rpm</input>
|
||
|
<gain>/systems/electrical/sources/idg-1/csd-gearbox-ratio</gain>
|
||
|
</pure_gain>
|
||
|
|
||
|
<fcs_function name="/systems/electrical/sources/idg-1/pmg-volt">
|
||
|
<function>
|
||
|
<product>
|
||
|
<property>/systems/electrical/sources/idg-1/csd-rpm</property>
|
||
|
<quotient>
|
||
|
<value>115</value>
|
||
|
<value>12000</value>
|
||
|
</quotient>
|
||
|
</product>
|
||
|
</function>
|
||
|
</fcs_function>
|
||
|
|
||
|
<fcs_function name="/systems/electrical/sources/idg-1/pmg-hertz">
|
||
|
<function>
|
||
|
<quotient>
|
||
|
<product>
|
||
|
<property>/systems/electrical/sources/idg-1/csd-rpm</property>
|
||
|
<value>4</value> <!-- Number of poles in generator -->
|
||
|
</product>
|
||
|
<value>120</value>
|
||
|
</quotient>
|
||
|
</function>
|
||
|
</fcs_function>
|
||
|
|
||
|
<switch name="/systems/electrical/sources/idg-1/gcr-relay">
|
||
|
<default value="0"/>
|
||
|
<test logic="AND" value="1">
|
||
|
/controls/electrical/switches/gen-1 eq 1
|
||
|
/systems/failures/electrical/gen-1 ne 1
|
||
|
/systems/electrical/sources/idg-1/csd-rpm ge 11500
|
||
|
</test>
|
||
|
</switch>
|
||
|
|
||
|
<pure_gain name="/systems/electrical/sources/idg-1/output-volt">
|
||
|
<input>/systems/electrical/sources/idg-1/pmg-volt</input>
|
||
|
<gain>/systems/electrical/sources/idg-1/gcr-relay</gain>
|
||
|
</pure_gain>
|
||
|
|
||
|
<pure_gain name="/systems/electrical/sources/idg-1/output-hertz">
|
||
|
<input>/systems/electrical/sources/idg-1/pmg-hertz</input>
|
||
|
<gain>/systems/electrical/sources/idg-1/gcr-relay</gain>
|
||
|
</pure_gain>
|
||
|
|
||
|
<!-- IDG 2 -->
|
||
|
<pure_gain name="/systems/electrical/sources/idg-2/drive-rpm-input">
|
||
|
<input>/engines/engine[1]/n2-actual</input>
|
||
|
<gain>90.298</gain> <!-- 1% N2 RPM value * 0.604 -->
|
||
|
</pure_gain>
|
||
|
|
||
|
<pure_gain name="/systems/electrical/sources/idg-2/drive-rpm">
|
||
|
<input>/systems/electrical/sources/idg-2/drive-rpm-input</input>
|
||
|
<gain>/controls/electrical/switches/gen-drive-2</gain>
|
||
|
</pure_gain>
|
||
|
|
||
|
<fcs_function name="/systems/electrical/sources/idg-2/csd-gearbox-ratio-cmd">
|
||
|
<function>
|
||
|
<quotient>
|
||
|
<value>12000</value>
|
||
|
<property>/systems/electrical/sources/idg-2/drive-rpm</property>
|
||
|
</quotient>
|
||
|
</function>
|
||
|
<clipto>
|
||
|
<min>1.3</min>
|
||
|
<max>2.8</max>
|
||
|
</clipto>
|
||
|
</fcs_function>
|
||
|
|
||
|
<lag_filter name="/systems/electrical/sources/idg-2/csd-gearbox-ratio">
|
||
|
<input>/systems/electrical/sources/idg-2/csd-gearbox-ratio-cmd</input>
|
||
|
<c1>40</c1>
|
||
|
</lag_filter>
|
||
|
|
||
|
<pure_gain name="/systems/electrical/sources/idg-2/csd-rpm">
|
||
|
<input>/systems/electrical/sources/idg-2/drive-rpm</input>
|
||
|
<gain>/systems/electrical/sources/idg-2/csd-gearbox-ratio</gain>
|
||
|
</pure_gain>
|
||
|
|
||
|
<fcs_function name="/systems/electrical/sources/idg-2/pmg-volt">
|
||
|
<function>
|
||
|
<product>
|
||
|
<property>/systems/electrical/sources/idg-2/csd-rpm</property>
|
||
|
<quotient>
|
||
|
<value>115</value>
|
||
|
<value>12000</value>
|
||
|
</quotient>
|
||
|
</product>
|
||
|
</function>
|
||
|
</fcs_function>
|
||
|
|
||
|
<fcs_function name="/systems/electrical/sources/idg-2/pmg-hertz">
|
||
|
<function>
|
||
|
<quotient>
|
||
|
<product>
|
||
|
<property>/systems/electrical/sources/idg-2/csd-rpm</property>
|
||
|
<value>4</value> <!-- Number of poles in generator -->
|
||
|
</product>
|
||
|
<value>120</value>
|
||
|
</quotient>
|
||
|
</function>
|
||
|
</fcs_function>
|
||
|
|
||
|
<switch name="/systems/electrical/sources/idg-2/gcr-relay">
|
||
|
<default value="0"/>
|
||
|
<test logic="AND" value="1">
|
||
|
/controls/electrical/switches/gen-2 eq 1
|
||
|
/systems/failures/electrical/gen-2 ne 1
|
||
|
/systems/electrical/sources/idg-2/csd-rpm ge 11500
|
||
|
</test>
|
||
|
</switch>
|
||
|
|
||
|
<pure_gain name="/systems/electrical/sources/idg-2/output-volt">
|
||
|
<input>/systems/electrical/sources/idg-2/pmg-volt</input>
|
||
|
<gain>/systems/electrical/sources/idg-2/gcr-relay</gain>
|
||
|
</pure_gain>
|
||
|
|
||
|
<pure_gain name="/systems/electrical/sources/idg-2/output-hertz">
|
||
|
<input>/systems/electrical/sources/idg-2/pmg-hertz</input>
|
||
|
<gain>/systems/electrical/sources/idg-2/gcr-relay</gain>
|
||
|
</pure_gain>
|
||
|
|
||
|
<!-- APU gen -->
|
||
|
<!-- IDG 1 -->
|
||
|
<pure_gain name="/systems/electrical/sources/apu/drive-rpm-input">
|
||
|
<input>/systems/apu/n2</input>
|
||
|
<gain>240</gain>
|
||
|
</pure_gain>
|
||
|
|
||
|
<pure_gain name="/systems/electrical/sources/apu/drive-rpm">
|
||
|
<input>/systems/electrical/sources/apu/drive-rpm-input</input>
|
||
|
<gain>/controls/electrical/switches/gen-drive-1</gain>
|
||
|
</pure_gain> <!-- fire btn -->
|
||
|
|
||
|
<fcs_function name="/systems/electrical/sources/apu/pmg-volt">
|
||
|
<function>
|
||
|
<product>
|
||
|
<property>/systems/electrical/sources/apu/drive-rpm</property>
|
||
|
<quotient>
|
||
|
<value>115</value>
|
||
|
<value>24000</value>
|
||
|
</quotient>
|
||
|
</product>
|
||
|
</function>
|
||
|
</fcs_function>
|
||
|
|
||
|
<fcs_function name="/systems/electrical/sources/apu/pmg-hertz">
|
||
|
<function>
|
||
|
<quotient>
|
||
|
<product>
|
||
|
<property>/systems/electrical/sources/apu/drive-rpm</property>
|
||
|
<value>2</value> <!-- Number of poles in generator -->
|
||
|
</product>
|
||
|
<value>120</value>
|
||
|
</quotient>
|
||
|
</function>
|
||
|
</fcs_function>
|
||
|
|
||
|
<switch name="/systems/electrical/sources/apu/gcr-relay">
|
||
|
<default value="0"/>
|
||
|
<test logic="AND" value="1">
|
||
|
/controls/electrical/switches/gen-apu eq 1
|
||
|
/systems/failures/electrical/gen-apu ne 1
|
||
|
/systems/electrical/sources/apu/csd-rpm ge 23000
|
||
|
</test>
|
||
|
</switch>
|
||
|
|
||
|
<pure_gain name="/systems/electrical/sources/apu/output-volt">
|
||
|
<input>/systems/electrical/sources/apu/pmg-volt</input>
|
||
|
<gain>/systems/electrical/sources/apu/gcr-relay</gain>
|
||
|
</pure_gain>
|
||
|
|
||
|
<pure_gain name="/systems/electrical/sources/apu/output-hertz">
|
||
|
<input>/systems/electrical/sources/apu/pmg-hertz</input>
|
||
|
<gain>/systems/electrical/sources/apu/gcr-relay</gain>
|
||
|
</pure_gain>
|
||
|
|
||
|
<!-- External Power -->
|
||
|
<fcs_function name="/systems/electrical/sources/ext/input-volt">
|
||
|
<function>
|
||
|
<ifthen>
|
||
|
<eq>
|
||
|
<property>/controls/switches/cart</property>
|
||
|
<value>1</value>
|
||
|
</eq>
|
||
|
<value>115</value>
|
||
|
<value>0</value>
|
||
|
</ifthen>
|
||
|
</function>
|
||
|
</fcs_function>
|
||
|
|
||
|
<switch name="/systems/electrical/sources/ext/epc-relay">
|
||
|
<default value="0"/>
|
||
|
<test logic="AND" value="1">
|
||
|
/systems/electrical/sources/ext/input-volt ge 110
|
||
|
/controls/electrical/switches/ext-pwr eq 1
|
||
|
</test>
|
||
|
</switch>
|
||
|
|
||
|
<pure_gain name="/systems/electrical/sources/ext/output-volt">
|
||
|
<input>/systems/electrical/sources/ext/input-volt</input>
|
||
|
<gain>/systems/electrical/sources/ext/epc-relay</gain>
|
||
|
</pure_gain>
|
||
|
|
||
|
<fcs_function name="/systems/electrical/sources/ext/output-hertz">
|
||
|
<function>
|
||
|
<ifthen>
|
||
|
<ge>
|
||
|
<property>/systems/electrical/sources/ext/output-volt</property>
|
||
|
<value>110</value>
|
||
|
</ge>
|
||
|
<value>400</value>
|
||
|
<value>0</value>
|
||
|
</ifthen>
|
||
|
</function>
|
||
|
</fcs_function>
|
||
|
|
||
|
<!-- Static Inverter -->
|
||
|
<switch name="/systems/electrical/sources/inverter/inverter-active">
|
||
|
<default value="0"/>
|
||
|
<test logic="AND" value="1">
|
||
|
/instrumentation/airspeed-indicator/indicated-speed-kt ge 50
|
||
|
/instrumentation/airspeed-indicator/indicated-speed-kt lt 100
|
||
|
</test>
|
||
|
<test logic="AND" value="1">
|
||
|
/instrumentation/airspeed-indicator/indicated-speed-kt lt 50
|
||
|
/controls/electrical/switches/bat-1 eq 1
|
||
|
/controls/electrical/switches/bat-2 eq 1
|
||
|
</test>
|
||
|
</switch>
|
||
|
|
||
|
<!-- Emergency Generator -->
|
||
|
<switch name="/systems/electrical/some-electric-thingie/emer-gen-operate">
|
||
|
<default value="0"/>
|
||
|
<test value="1">
|
||
|
/controls/electrical/switches/emer-gen-test eq 1
|
||
|
</test>
|
||
|
<test logic="AND" value="1">
|
||
|
/instrumentation/airspeed-indicator/indicated-speed-kt gt 100
|
||
|
/systems/electrical/bus/ac1 eq 0
|
||
|
/systems/electrical/bus/ac1 eq 2
|
||
|
</test>
|
||
|
<test value="1">
|
||
|
/controls/electrical/switches/emer-elec-man-on eq 1
|
||
|
</test>
|
||
|
</switch>
|
||
|
|
||
|
<switch name="/systems/electrical/sources/emer-gen/output-volt">
|
||
|
<default value="0"/>
|
||
|
<test logic="AND" value="115"> <!-- regulated to 115V, no point doing fancy, hyd controls it -->
|
||
|
/systems/electrical/some-electric-thingie/emer-gen-operate eq 1
|
||
|
/systems/hydraulic/blue-psi gt 2500
|
||
|
</test>
|
||
|
</switch>
|
||
|
|
||
|
<switch name="/systems/electrical/sources/emer-gen/output-hertz">
|
||
|
<default value="0"/>
|
||
|
<test logic="AND" value="400">
|
||
|
/systems/electrical/sources/emer-gen/output-volt eq 115
|
||
|
</test>
|
||
|
</switch>
|
||
|
|
||
|
<!-- BTC close only if no eng gen are online when ext connected -->
|
||
|
<!-- ground service bus connected directly to input-volt -->
|
||
|
<!-- TR 2 fail leads to loss of gnd FLT bus -->
|
||
|
|
||
|
</channel>
|
||
|
|
||
|
<!-- notes -->
|
||
|
<!-- do the ext, apu gen properly -->
|
||
|
<!-- then bus tie and feed to ac1 / 2 -->
|
||
|
<!-- priority: eng, ext, apu -- but EXT ON lt stays on even when not feeding a/c -->
|
||
|
<channel name="Overhead Lights" execrate="8">
|
||
|
|
||
|
<switch name="/systems/electrical/light/gen1-fault">
|
||
|
<default value="0"/>
|
||
|
<test value="1">
|
||
|
/controls/electrical/switches/gen-1 eq 1
|
||
|
/systems/electrical/sources/idg-1/gcr-relay eq 0
|
||
|
</test>
|
||
|
</switch>
|
||
|
|
||
|
<switch name="/systems/electrical/light/gen2-fault">
|
||
|
<default value="0"/>
|
||
|
<test value="1">
|
||
|
/controls/electrical/switches/gen-2 eq 1
|
||
|
/systems/electrical/sources/idg-2/gcr-relay eq 0
|
||
|
</test>
|
||
|
</switch>
|
||
|
|
||
|
<switch name="/systems/electrical/light/rat-emer-gen-fault">
|
||
|
<default value="0"/>
|
||
|
<test value="1">
|
||
|
/systems/electrical/sources/ess-tr/output-volt eq 0
|
||
|
/systems/electrical/bus/ac1 eq 0
|
||
|
/systems/electrical/bus/ac2 eq 0
|
||
|
position/wow eq 0
|
||
|
</test>
|
||
|
</switch>
|
||
|
|
||
|
</channel>
|
||
|
|
||
|
</system>
|