1
0
Fork 0

Engine: New reverser system

This commit is contained in:
Josh Davidson 2022-10-09 12:03:30 -04:00
parent 75ba0e1191
commit dc7addc787
8 changed files with 390 additions and 248 deletions

View file

@ -968,7 +968,7 @@
<starter type="bool">0</starter>
<start-switch type="bool">0</start-switch>
<reverse-cmd type="bool">0</reverse-cmd>
<reverse-lever type="double">0</reverse-lever>
<reverse-engage type="double">0</reverse-engage>
<igniter-a type="bool">0</igniter-a>
<igniter-b type="bool">0</igniter-b>
</engine>
@ -981,7 +981,7 @@
<starter type="bool">0</starter>
<start-switch type="bool">0</start-switch>
<reverse-cmd type="bool">0</reverse-cmd>
<reverse-lever type="double">0</reverse-lever>
<reverse-engage type="double">0</reverse-engage>
<igniter-a type="bool">0</igniter-a>
<igniter-b type="bool">0</igniter-b>
</engine>
@ -4598,10 +4598,10 @@
</key>
<key n="127">
<name>DEL</name>
<desc>Simple Engage/Disengage reversers</desc>
<desc>Toggle reversers</desc>
<binding>
<command>nasal</command>
<script>systems.toggleFastRevThrust();</script>
<script>systems.toggleRevThrust();</script>
</binding>
</key>
<key n="257">

View file

@ -11898,9 +11898,9 @@
<object-name>rev_l</object-name>
<property>fdm/jsbsim/fadec/reverse-lever[0]</property>
<interpolation>
<entry><ind>0.00</ind><dep> 0.0</dep></entry>
<entry><ind>0.25</ind><dep> -3.5</dep></entry>
<entry><ind>1.00</ind><dep>-23.5</dep></entry>
<entry><ind>0.10</ind><dep> 0</dep></entry>
<entry><ind>0.25</ind><dep> -6</dep></entry>
<entry><ind>1.00</ind><dep>-23</dep></entry>
</interpolation>
<axis>
<object-name>trim.axis</object-name>
@ -11914,9 +11914,9 @@
<object-name>rev_r</object-name>
<property>fdm/jsbsim/fadec/reverse-lever[1]</property>
<interpolation>
<entry><ind>0.00</ind><dep> 0.0</dep></entry>
<entry><ind>0.25</ind><dep> -3.5</dep></entry>
<entry><ind>1.00</ind><dep>-23.5</dep></entry>
<entry><ind>0.10</ind><dep> 0</dep></entry>
<entry><ind>0.25</ind><dep> -6</dep></entry>
<entry><ind>1.00</ind><dep>-23</dep></entry>
</interpolation>
<axis>
<object-name>trim.axis</object-name>
@ -11927,8 +11927,11 @@
<animation>
<type>rotate</type>
<object-name>rev_l</object-name>
<property>controls/engines/engine[0]/reverse-cmd-pos</property>
<factor>60</factor>
<property>fdm/jsbsim/fadec/reverse-lever[0]</property>
<interpolation>
<entry><ind>0.0</ind><dep> 0</dep></entry>
<entry><ind>0.1</ind><dep>60</dep></entry>
</interpolation>
<axis>
<object-name>rev_l.axis</object-name>
</axis>
@ -11937,8 +11940,11 @@
<animation>
<type>rotate</type>
<object-name>rev_r</object-name>
<property>controls/engines/engine[1]/reverse-cmd-pos</property>
<factor>60</factor>
<property>fdm/jsbsim/fadec/reverse-lever[1]</property>
<interpolation>
<entry><ind>0.0</ind><dep> 0</dep></entry>
<entry><ind>0.1</ind><dep>60</dep></entry>
</interpolation>
<axis>
<object-name>rev_r.axis</object-name>
</axis>

View file

@ -36,7 +36,6 @@ var Controls = {
cutoffSw: [props.globals.getNode("/controls/engines/engine[0]/cutoff-switch"), props.globals.getNode("/controls/engines/engine[1]/cutoff-switch")],
firePb: [props.globals.getNode("/controls/engines/engine[0]/fire-btn"), props.globals.getNode("/controls/engines/engine[1]/fire-btn")],
reverseCmd: [props.globals.getNode("/controls/engines/engine[0]/reverse-cmd"), props.globals.getNode("/controls/engines/engine[1]/reverse-cmd")],
reverseLever: [props.globals.getNode("/controls/engines/engine[0]/reverse-lever"), props.globals.getNode("/controls/engines/engine[1]/reverse-lever")],
starter: [props.globals.getNode("/controls/engines/engine[0]/starter"), props.globals.getNode("/controls/engines/engine[1]/starter")],
throttle: [props.globals.getNode("/controls/engines/engine[0]/throttle"), props.globals.getNode("/controls/engines/engine[1]/throttle")],
},

View file

@ -4,14 +4,14 @@
var ENGINE = {
cutoffSwitch: [props.globals.getNode("/controls/engines/engine[0]/cutoff-switch"), props.globals.getNode("/controls/engines/engine[1]/cutoff-switch")],
manStart: [props.globals.getNode("/controls/engines/engine[0]/start-switch"), props.globals.getNode("/controls/engines/engine[1]/start-switch")],
reverseLever: [props.globals.getNode("/controls/engines/engine[0]/reverse-lever"), props.globals.getNode("/controls/engines/engine[1]/reverse-lever")],
reverseLeverTemp: [0, 0],
reverseEngage: [props.globals.getNode("/controls/engines/engine[0]/reverse-engage"), props.globals.getNode("/controls/engines/engine[1]/reverse-engage")],
throttle: [props.globals.getNode("/controls/engines/engine[0]/throttle"), props.globals.getNode("/controls/engines/engine[1]/throttle")],
throttleTemp: [0, 0],
init: func() {
me.manStart[0].setBoolValue(0);
me.manStart[1].setBoolValue(0);
me.reverseLever[0].setBoolValue(0);
me.reverseLever[1].setBoolValue(0);
me.reverseEngage[0].setBoolValue(0);
me.reverseEngage[1].setBoolValue(0);
},
};
@ -87,69 +87,76 @@ var doTogaThrust = func {
}
}
# Intentionally not using + or -, floating point error would be BAD
# We just based it off Engine 1
# Base off Engine 1
var doRevThrust = func() {
ENGINE.reverseLeverTemp[0] = ENGINE.reverseLever[0].getValue();
if ((pts.Gear.wow[1].getBoolValue() or pts.Gear.wow[2].getBoolValue()) and systems.FADEC.maxDetent.getValue() == 0) {
if (ENGINE.reverseLeverTemp[0] < 0.25) {
ENGINE.reverseLever[0].setValue(0.25);
ENGINE.reverseLever[1].setValue(0.25);
} else if (ENGINE.reverseLeverTemp[0] < 0.5) {
ENGINE.reverseLever[0].setValue(0.5);
ENGINE.reverseLever[1].setValue(0.5);
} else if (ENGINE.reverseLeverTemp[0] < 0.75) {
ENGINE.reverseLever[0].setValue(0.75);
ENGINE.reverseLever[1].setValue(0.75);
} else if (ENGINE.reverseLeverTemp[0] < 1.0) {
ENGINE.reverseLever[0].setValue(1);
ENGINE.reverseLever[1].setValue(1);
ENGINE.throttleTemp[0] = ENGINE.throttle[0].getValue();
if (!ENGINE.reverseEngage[0].getBoolValue() or !ENGINE.reverseEngage[1].getBoolValue()) {
ENGINE.reverseEngage[0].setBoolValue(1);
ENGINE.reverseEngage[1].setBoolValue(1);
ENGINE.throttle[0].setValue(0);
ENGINE.throttle[1].setValue(0);
} else if (ENGINE.throttleTemp[0] < 0.4) {
ENGINE.throttle[0].setValue(0.4);
ENGINE.throttle[1].setValue(0.4);
} else if (ENGINE.throttleTemp[0] < 0.7) {
ENGINE.throttle[0].setValue(0.7);
ENGINE.throttle[1].setValue(0.7);
} else if (ENGINE.throttleTemp[0] < 1) {
ENGINE.throttle[0].setValue(1);
ENGINE.throttle[1].setValue(1);
}
} else {
ENGINE.throttle[0].setValue(0);
ENGINE.throttle[1].setValue(0);
} else {
ENGINE.reverseLever[0].setValue(0);
ENGINE.reverseLever[1].setValue(0);
ENGINE.reverseEngage[0].setBoolValue(0);
ENGINE.reverseEngage[1].setBoolValue(0);
}
}
var unRevThrust = func() {
ENGINE.reverseLeverTemp[0] = ENGINE.reverseLever[0].getValue();
if ((pts.Gear.wow[1].getBoolValue() or pts.Gear.wow[2].getBoolValue()) and systems.FADEC.maxDetent.getValue() == 0) {
if (ENGINE.reverseLeverTemp[0] > 0.75) {
ENGINE.reverseLever[0].setValue(0.75);
ENGINE.reverseLever[1].setValue(0.75);
} else if (ENGINE.reverseLeverTemp[0] > 0.5) {
ENGINE.reverseLever[0].setValue(0.5);
ENGINE.reverseLever[1].setValue(0.5);
} else if (ENGINE.reverseLeverTemp[0] > 0.25) {
ENGINE.reverseLever[0].setValue(0.25);
ENGINE.reverseLever[1].setValue(0.25);
} else if (ENGINE.reverseLeverTemp[0] > 0) {
ENGINE.reverseLever[0].setValue(0);
ENGINE.reverseLever[1].setValue(0);
if (ENGINE.reverseEngage[0].getBoolValue() or ENGINE.reverseEngage[1].getBoolValue()) {
ENGINE.throttleTemp[0] = ENGINE.throttle[0].getValue();
if (ENGINE.throttleTemp[0] > 0.7) {
ENGINE.throttle[0].setValue(0.7);
ENGINE.throttle[1].setValue(0.7);
} else if (ENGINE.throttleTemp[0] > 0.4) {
ENGINE.throttle[0].setValue(0.4);
ENGINE.throttle[1].setValue(0.4);
} else if (ENGINE.throttleTemp[0] > 0.05) {
ENGINE.throttle[0].setValue(0);
ENGINE.throttle[1].setValue(0);
} else {
ENGINE.throttle[0].setValue(0);
ENGINE.throttle[1].setValue(0);
ENGINE.reverseEngage[0].setBoolValue(0);
ENGINE.reverseEngage[1].setBoolValue(0);
}
}
} else {
ENGINE.throttle[0].setValue(0);
ENGINE.throttle[1].setValue(0);
} else {
ENGINE.reverseLever[0].setValue(0);
ENGINE.reverseLever[1].setValue(0);
ENGINE.reverseEngage[0].setBoolValue(0);
ENGINE.reverseEngage[1].setBoolValue(0);
}
}
var toggleFastRevThrust = func() {
var toggleRevThrust = func() {
if ((pts.Gear.wow[1].getBoolValue() or pts.Gear.wow[2].getBoolValue()) and systems.FADEC.maxDetent.getValue() == 0) {
if (ENGINE.reverseLever[0].getValue() != 0) { # NOT a bool, this way it always closes even if partially open
ENGINE.reverseLever[0].setValue(0);
ENGINE.reverseLever[1].setValue(0);
if (ENGINE.reverseEngage[0].getBoolValue() or ENGINE.reverseEngage[1].getBoolValue()) {
ENGINE.throttle[0].setValue(0);
ENGINE.throttle[1].setValue(0);
ENGINE.reverseEngage[0].setBoolValue(0);
ENGINE.reverseEngage[1].setBoolValue(0);
} else {
ENGINE.reverseLever[0].setValue(1);
ENGINE.reverseLever[1].setValue(1);
ENGINE.reverseEngage[0].setBoolValue(1);
ENGINE.reverseEngage[1].setBoolValue(1);
}
} else {
ENGINE.throttle[0].setValue(0);
ENGINE.throttle[1].setValue(0);
} else {
ENGINE.reverseLever[0].setValue(0);
ENGINE.reverseLever[1].setValue(0);
ENGINE.reverseEngage[0].setBoolValue(0);
ENGINE.reverseEngage[1].setBoolValue(0);
}
}

View file

@ -406,7 +406,7 @@
<switch name="fadec/reverse-1/position-cmd">
<default value="0"/>
<test value="1">
/controls/engines/engine[0]/reverse-lever ge 0.25
/controls/engines/engine[0]/reverse-engage eq 1
</test>
<output>/controls/engines/engine[0]/reverse-cmd</output>
</switch>
@ -430,36 +430,71 @@
<gain>3.14</gain>
</pure_gain>
<fcs_function name="fadec/reverse-1/throttle-rev-cmd">
<function>
<ifthen>
<eq>
<property>fadec/reverse-1/position-norm</property>
<value>1</value>
</eq>
<table>
<independentVar lookup="row">/controls/engines/engine[0]/throttle</independentVar>
<tableData>
0.05 0
1.00 1
</tableData>
</table>
<value>0</value>
</ifthen>
</function>
</fcs_function>
<fcs_function name="fadec/reverse-1/throttle-rev">
<function>
<sum>
<value>0.08</value>
<product>
<difference>
<property>/controls/engines/engine[0]/reverse-lever</property>
<value>0.25</value>
</difference>
<quotient>
<ifthen>
<eq>
<property>/controls/engines/engine[0]/reverse-engage</property>
<value>1</value>
</eq>
<sum>
<value>0.05</value>
<product>
<property>fadec/reverse-1/throttle-rev-cmd</property>
<difference>
<property>fadec/limit/mrev-norm</property>
<value>0.08</value>
<value>0.05</value>
</difference>
<value>0.75</value> <!-- 1.0 - 0.25 -->
</quotient>
</product>
</sum>
</product>
</sum>
<value>0</value>
</ifthen>
</function>
<clipto>
<min>0.08</min>
<min>0.05</min>
<max>fadec/limit/mrev-norm</max>
</clipto>
</fcs_function>
<fcs_function name="/controls/engines/engine[0]/reverse-lever">
<function>
<product>
<property>/controls/engines/engine[0]/reverse-engage</property>
<table>
<independentVar lookup="row">/controls/engines/engine[0]/throttle</independentVar>
<tableData>
0.05 0.25
1.00 1.00
</tableData>
</table>
</product>
</function>
</fcs_function>
<!-- Engine 2 -->
<switch name="fadec/reverse-2/position-cmd">
<default value="0"/>
<test value="1">
/controls/engines/engine[1]/reverse-lever ge 0.25
/controls/engines/engine[1]/reverse-engage eq 1
</test>
<output>/controls/engines/engine[1]/reverse-cmd</output>
</switch>
@ -483,55 +518,90 @@
<gain>3.14</gain>
</pure_gain>
<fcs_function name="fadec/reverse-2/throttle-rev-cmd">
<function>
<ifthen>
<eq>
<property>fadec/reverse-2/position-norm</property>
<value>1</value>
</eq>
<table>
<independentVar lookup="row">/controls/engines/engine[1]/throttle</independentVar>
<tableData>
0.05 0
1.00 1
</tableData>
</table>
<value>0</value>
</ifthen>
</function>
</fcs_function>
<fcs_function name="fadec/reverse-2/throttle-rev">
<function>
<sum>
<value>0.08</value>
<product>
<difference>
<property>/controls/engines/engine[1]/reverse-lever</property>
<value>0.25</value>
</difference>
<quotient>
<ifthen>
<eq>
<property>/controls/engines/engine[1]/reverse-engage</property>
<value>1</value>
</eq>
<sum>
<value>0.05</value>
<product>
<property>fadec/reverse-2/throttle-rev-cmd</property>
<difference>
<property>fadec/limit/mrev-norm</property>
<value>0.08</value>
<value>0.05</value>
</difference>
<value>0.75</value> <!-- 1.0 - 0.25 -->
</quotient>
</product>
</sum>
</product>
</sum>
<value>0</value>
</ifthen>
</function>
<clipto>
<min>0.08</min>
<min>0.05</min>
<max>fadec/limit/mrev-norm</max>
</clipto>
</fcs_function>
<fcs_function name="/controls/engines/engine[1]/reverse-lever">
<function>
<product>
<property>/controls/engines/engine[1]/reverse-engage</property>
<table>
<independentVar lookup="row">/controls/engines/engine[1]/throttle</independentVar>
<tableData>
0.05 0.25
1.00 1.00
</tableData>
</table>
</product>
</function>
</fcs_function>
</channel>
<channel name="Engine Control"> <!-- Very complicated, please don't touch if you don't understand it -->
<!-- Engine 1 -->
<lag_filter name="fadec/control-1/throttle-lag">
<input>/controls/engines/engine[0]/throttle</input>
<c1>20</c1>
</lag_filter>
<switch name="fadec/control-1/throttle-pos">
<default value="fadec/control-1/throttle-lag"/>
<default value="/controls/engines/engine[0]/throttle"/>
<test value="0">
fadec/reverse-1/position-norm ne 0
</test>
</switch>
<lag_filter name="fadec/control-1/throttle-lag">
<input>fadec/control-1/throttle-pos</input>
<c1>20</c1>
</lag_filter>
<fcs_function name="fadec/control-1/idle-climb-n1">
<function>
<sum>
<property>fadec/limit/min-n1</property>
<product>
<difference>
<property>fadec/control-1/throttle-pos</property>
<property>fadec/control-1/throttle-lag</property>
<property>/systems/acconfig/options/fadec/idle-t</property>
</difference>
<quotient>
@ -559,7 +629,7 @@
<property>fadec/limit/climb</property>
<product>
<difference>
<property>fadec/control-1/throttle-pos</property>
<property>fadec/control-1/throttle-lag</property>
<property>/systems/acconfig/options/fadec/climb-t</property>
</difference>
<quotient>
@ -587,7 +657,7 @@
<property>fadec/limit/mct</property>
<product>
<difference>
<property>fadec/control-1/throttle-pos</property>
<property>fadec/control-1/throttle-lag</property>
<property>/systems/acconfig/options/fadec/mct-t</property>
</difference>
<quotient>
@ -612,10 +682,10 @@
<switch name="fadec/control-1/lever-n1">
<default value="fadec/control-1/idle-climb-n1"/>
<test value="fadec/control-1/mct-toga-n1">
fadec/control-1/throttle-pos gt /systems/acconfig/options/fadec/mct-t
fadec/control-1/throttle-lag gt /systems/acconfig/options/fadec/mct-t
</test>
<test value="fadec/control-1/climb-mct-n1">
fadec/control-1/throttle-pos gt /systems/acconfig/options/fadec/climb-t
fadec/control-1/throttle-lag gt /systems/acconfig/options/fadec/climb-t
</test>
</switch>
@ -634,22 +704,22 @@
<switch name="fadec/control-1/detent">
<default value="0"/> <!-- IDLE -->
<test value="6"> <!-- TOGA -->
fadec/control-1/throttle-pos ge /systems/acconfig/options/fadec/toga-b
fadec/control-1/throttle-lag ge /systems/acconfig/options/fadec/toga-b
</test>
<test value="5"> <!-- MAN THR -->
fadec/control-1/throttle-pos gt /systems/acconfig/options/fadec/mct-t
fadec/control-1/throttle-lag gt /systems/acconfig/options/fadec/mct-t
</test>
<test value="4"> <!-- MCT/FLX -->
fadec/control-1/throttle-pos ge /systems/acconfig/options/fadec/mct-b
fadec/control-1/throttle-lag ge /systems/acconfig/options/fadec/mct-b
</test>
<test value="3"> <!-- MAN THR -->
fadec/control-1/throttle-pos gt /systems/acconfig/options/fadec/climb-t
fadec/control-1/throttle-lag gt /systems/acconfig/options/fadec/climb-t
</test>
<test value="2"> <!-- CL -->
fadec/control-1/throttle-pos ge /systems/acconfig/options/fadec/climb-b
fadec/control-1/throttle-lag ge /systems/acconfig/options/fadec/climb-b
</test>
<test value="1"> <!-- MAN -->
fadec/control-1/throttle-pos gt /systems/acconfig/options/fadec/idle-t
fadec/control-1/throttle-lag gt /systems/acconfig/options/fadec/idle-t
</test>
<output>fbw/detent-1-feedback</output>
</switch>
@ -660,7 +730,7 @@
<value>2</value>
<product>
<difference>
<property>fadec/control-1/throttle-pos</property>
<property>fadec/control-1/throttle-lag</property>
<property>/systems/acconfig/options/fadec/idle-t</property>
</difference>
<quotient>
@ -688,7 +758,7 @@
<value>27</value>
<product>
<difference>
<property>fadec/control-1/throttle-pos</property>
<property>fadec/control-1/throttle-lag</property>
<property>/systems/acconfig/options/fadec/climb-t</property>
</difference>
<quotient>
@ -716,7 +786,7 @@
<value>37</value>
<product>
<difference>
<property>fadec/control-1/throttle-pos</property>
<property>fadec/control-1/throttle-lag</property>
<property>/systems/acconfig/options/fadec/mct-t</property>
</difference>
<quotient>
@ -741,45 +811,45 @@
<switch name="fadec/control-1/lever/angle">
<default value="0"/> <!-- IDLE -->
<test value="45"> <!-- TOGA -->
fadec/control-1/throttle-pos ge /systems/acconfig/options/fadec/toga-b
fadec/control-1/throttle-lag ge /systems/acconfig/options/fadec/toga-b
</test>
<test value="fadec/control-1/lever/mct-toga"> <!-- MAN THR -->
fadec/control-1/throttle-pos gt /systems/acconfig/options/fadec/mct-t
fadec/control-1/throttle-lag gt /systems/acconfig/options/fadec/mct-t
</test>
<test value="35"> <!-- MCT/FLX -->
fadec/control-1/throttle-pos ge /systems/acconfig/options/fadec/mct-b
fadec/control-1/throttle-lag ge /systems/acconfig/options/fadec/mct-b
</test>
<test value="fadec/control-1/lever/climb-mct"> <!-- MAN THR -->
fadec/control-1/throttle-pos gt /systems/acconfig/options/fadec/climb-t
fadec/control-1/throttle-lag gt /systems/acconfig/options/fadec/climb-t
</test>
<test value="25"> <!-- CL -->
fadec/control-1/throttle-pos ge /systems/acconfig/options/fadec/climb-b
fadec/control-1/throttle-lag ge /systems/acconfig/options/fadec/climb-b
</test>
<test value="fadec/control-1/lever/idle-climb"> <!-- MAN -->
fadec/control-1/throttle-pos gt /systems/acconfig/options/fadec/idle-t
fadec/control-1/throttle-lag gt /systems/acconfig/options/fadec/idle-t
</test>
</switch>
<!-- Engine 2 -->
<lag_filter name="fadec/control-2/throttle-lag">
<input>/controls/engines/engine[1]/throttle</input>
<c1>20</c1>
</lag_filter>
<switch name="fadec/control-2/throttle-pos">
<default value="fadec/control-2/throttle-lag"/>
<default value="/controls/engines/engine[1]/throttle"/>
<test value="0">
fadec/reverse-2/position-norm ne 0
</test>
</switch>
<lag_filter name="fadec/control-2/throttle-lag">
<input>fadec/control-2/throttle-pos</input>
<c1>20</c1>
</lag_filter>
<fcs_function name="fadec/control-2/idle-climb-n1">
<function>
<sum>
<property>fadec/limit/min-n1</property>
<product>
<difference>
<property>fadec/control-2/throttle-pos</property>
<property>fadec/control-2/throttle-lag</property>
<property>/systems/acconfig/options/fadec/idle-t</property>
</difference>
<quotient>
@ -807,7 +877,7 @@
<property>fadec/limit/climb</property>
<product>
<difference>
<property>fadec/control-2/throttle-pos</property>
<property>fadec/control-2/throttle-lag</property>
<property>/systems/acconfig/options/fadec/climb-t</property>
</difference>
<quotient>
@ -835,7 +905,7 @@
<property>fadec/limit/mct</property>
<product>
<difference>
<property>fadec/control-2/throttle-pos</property>
<property>fadec/control-2/throttle-lag</property>
<property>/systems/acconfig/options/fadec/mct-t</property>
</difference>
<quotient>
@ -860,10 +930,10 @@
<switch name="fadec/control-2/lever-n1">
<default value="fadec/control-2/idle-climb-n1"/>
<test value="fadec/control-2/mct-toga-n1">
fadec/control-2/throttle-pos gt /systems/acconfig/options/fadec/mct-t
fadec/control-2/throttle-lag gt /systems/acconfig/options/fadec/mct-t
</test>
<test value="fadec/control-2/climb-mct-n1">
fadec/control-2/throttle-pos gt /systems/acconfig/options/fadec/climb-t
fadec/control-2/throttle-lag gt /systems/acconfig/options/fadec/climb-t
</test>
</switch>
@ -882,22 +952,22 @@
<switch name="fadec/control-2/detent">
<default value="0"/> <!-- IDLE -->
<test value="6"> <!-- TOGA -->
fadec/control-2/throttle-pos ge /systems/acconfig/options/fadec/toga-b
fadec/control-2/throttle-lag ge /systems/acconfig/options/fadec/toga-b
</test>
<test value="5"> <!-- MAN THR -->
fadec/control-2/throttle-pos gt /systems/acconfig/options/fadec/mct-t
fadec/control-2/throttle-lag gt /systems/acconfig/options/fadec/mct-t
</test>
<test value="4"> <!-- MCT/FLX -->
fadec/control-2/throttle-pos ge /systems/acconfig/options/fadec/mct-b
fadec/control-2/throttle-lag ge /systems/acconfig/options/fadec/mct-b
</test>
<test value="3"> <!-- MAN THR -->
fadec/control-2/throttle-pos gt /systems/acconfig/options/fadec/climb-t
fadec/control-2/throttle-lag gt /systems/acconfig/options/fadec/climb-t
</test>
<test value="2"> <!-- CL -->
fadec/control-2/throttle-pos ge /systems/acconfig/options/fadec/climb-b
fadec/control-2/throttle-lag ge /systems/acconfig/options/fadec/climb-b
</test>
<test value="1"> <!-- MAN -->
fadec/control-2/throttle-pos gt /systems/acconfig/options/fadec/idle-t
fadec/control-2/throttle-lag gt /systems/acconfig/options/fadec/idle-t
</test>
<output>fbw/detent-2-feedback</output>
</switch>
@ -908,7 +978,7 @@
<value>2</value>
<product>
<difference>
<property>fadec/control-2/throttle-pos</property>
<property>fadec/control-2/throttle-lag</property>
<property>/systems/acconfig/options/fadec/idle-t</property>
</difference>
<quotient>
@ -936,7 +1006,7 @@
<value>27</value>
<product>
<difference>
<property>fadec/control-2/throttle-pos</property>
<property>fadec/control-2/throttle-lag</property>
<property>/systems/acconfig/options/fadec/climb-t</property>
</difference>
<quotient>
@ -964,7 +1034,7 @@
<value>37</value>
<product>
<difference>
<property>fadec/control-2/throttle-pos</property>
<property>fadec/control-2/throttle-lag</property>
<property>/systems/acconfig/options/fadec/mct-t</property>
</difference>
<quotient>
@ -989,22 +1059,22 @@
<switch name="fadec/control-2/lever/angle">
<default value="0"/> <!-- IDLE -->
<test value="45"> <!-- TOGA -->
fadec/control-2/throttle-pos ge /systems/acconfig/options/fadec/toga-b
fadec/control-2/throttle-lag ge /systems/acconfig/options/fadec/toga-b
</test>
<test value="fadec/control-2/lever/mct-toga"> <!-- MAN THR -->
fadec/control-2/throttle-pos gt /systems/acconfig/options/fadec/mct-t
fadec/control-2/throttle-lag gt /systems/acconfig/options/fadec/mct-t
</test>
<test value="35"> <!-- MCT/FLX -->
fadec/control-2/throttle-pos ge /systems/acconfig/options/fadec/mct-b
fadec/control-2/throttle-lag ge /systems/acconfig/options/fadec/mct-b
</test>
<test value="fadec/control-2/lever/climb-mct"> <!-- MAN THR -->
fadec/control-2/throttle-pos gt /systems/acconfig/options/fadec/climb-t
fadec/control-2/throttle-lag gt /systems/acconfig/options/fadec/climb-t
</test>
<test value="25"> <!-- CL -->
fadec/control-2/throttle-pos ge /systems/acconfig/options/fadec/climb-b
fadec/control-2/throttle-lag ge /systems/acconfig/options/fadec/climb-b
</test>
<test value="fadec/control-2/lever/idle-climb"> <!-- MAN -->
fadec/control-2/throttle-pos gt /systems/acconfig/options/fadec/idle-t
fadec/control-2/throttle-lag gt /systems/acconfig/options/fadec/idle-t
</test>
</switch>
@ -1167,7 +1237,7 @@
</test>
<clipto>
<min>fadec/limit/idle-norm</min> <!-- Never force it below the idle limit -->
<max>1</max>
<max>1.0</max>
</clipto>
</switch>
@ -1248,7 +1318,7 @@
<gain>1.0</gain>
<clipto>
<min>fadec/limit/idle-norm</min>
<max>1</max>
<max>1.0</max>
</clipto>
</pure_gain>
@ -1282,7 +1352,7 @@
<gain>1.0</gain>
<clipto>
<min>fadec/limit/idle-norm</min>
<max>1</max>
<max>1.0</max>
</clipto>
</pure_gain>

View file

@ -87,12 +87,12 @@
<lag_filter name="fadec/reverse-lever[0]">
<input>/controls/engines/engine[0]/reverse-lever</input>
<c1>16</c1>
<c1>20</c1>
</lag_filter>
<lag_filter name="fadec/reverse-lever[1]">
<input>/controls/engines/engine[1]/reverse-lever</input>
<c1>16</c1>
<c1>20</c1>
</lag_filter>
<lag_filter name="fcs/engine-cutoff[0]">
@ -410,16 +410,6 @@
<c1>20</c1>
</lag_filter>
<lag_filter name="/controls/engines/engine[0]/reverse-cmd-pos">
<input>/controls/engines/engine[0]/reverse-cmd</input>
<c1>20</c1>
</lag_filter>
<lag_filter name="/controls/engines/engine[1]/reverse-cmd-pos">
<input>/controls/engines/engine[1]/reverse-cmd</input>
<c1>20</c1>
</lag_filter>
<lag_filter name="/controls/OH/protectors/aftdisch-pos">
<input>/controls/OH/protectors/aftdisch</input>
<c1>20</c1>

View file

@ -2948,8 +2948,8 @@
/ECAM/warning-phase ne 7
</test>
<test logic="OR">
/controls/engines/engine[0]/reverse-lever gt 0.0
/controls/engines/engine[1]/reverse-lever gt 0.0
/controls/engines/engine[0]/reverse-engage eq 1
/controls/engines/engine[1]/reverse-engage eq 1
</test>
</test>
</switch>

View file

@ -40,8 +40,8 @@
<table>
<independentVar lookup="row">velocities/mach</independentVar>
<tableData>
0.06 0.973269699530
0.10 1.000000000000
0.06 0.97326969953
0.10 1.00000000000
</tableData>
</table>
</function>
@ -809,7 +809,7 @@
<switch name="fadec/reverse-1/position-cmd">
<default value="0"/>
<test value="1">
/controls/engines/engine[0]/reverse-lever ge 0.25
/controls/engines/engine[0]/reverse-engage eq 1
</test>
<output>/controls/engines/engine[0]/reverse-cmd</output>
</switch>
@ -833,36 +833,71 @@
<gain>3.14</gain>
</pure_gain>
<fcs_function name="fadec/reverse-1/throttle-rev-cmd">
<function>
<ifthen>
<eq>
<property>fadec/reverse-1/position-norm</property>
<value>1</value>
</eq>
<table>
<independentVar lookup="row">/controls/engines/engine[0]/throttle</independentVar>
<tableData>
0.05 0
1.00 1
</tableData>
</table>
<value>0</value>
</ifthen>
</function>
</fcs_function>
<fcs_function name="fadec/reverse-1/throttle-rev">
<function>
<sum>
<value>0.08</value>
<product>
<difference>
<property>/controls/engines/engine[0]/reverse-lever</property>
<value>0.25</value>
</difference>
<quotient>
<ifthen>
<eq>
<property>/controls/engines/engine[0]/reverse-engage</property>
<value>1</value>
</eq>
<sum>
<value>0.05</value>
<product>
<property>fadec/reverse-1/throttle-rev-cmd</property>
<difference>
<property>fadec/limit/mrev-norm</property>
<value>0.08</value>
<value>0.05</value>
</difference>
<value>0.75</value> <!-- 1.0 - 0.25 -->
</quotient>
</product>
</sum>
</product>
</sum>
<value>0</value>
</ifthen>
</function>
<clipto>
<min>0.08</min>
<min>0.05</min>
<max>fadec/limit/mrev-norm</max>
</clipto>
</fcs_function>
<fcs_function name="/controls/engines/engine[0]/reverse-lever">
<function>
<product>
<property>/controls/engines/engine[0]/reverse-engage</property>
<table>
<independentVar lookup="row">/controls/engines/engine[0]/throttle</independentVar>
<tableData>
0.05 0.25
1.00 1.00
</tableData>
</table>
</product>
</function>
</fcs_function>
<!-- Engine 2 -->
<switch name="fadec/reverse-2/position-cmd">
<default value="0"/>
<test value="1">
/controls/engines/engine[1]/reverse-lever ge 0.25
/controls/engines/engine[1]/reverse-engage eq 1
</test>
<output>/controls/engines/engine[1]/reverse-cmd</output>
</switch>
@ -886,55 +921,90 @@
<gain>3.14</gain>
</pure_gain>
<fcs_function name="fadec/reverse-2/throttle-rev-cmd">
<function>
<ifthen>
<eq>
<property>fadec/reverse-2/position-norm</property>
<value>1</value>
</eq>
<table>
<independentVar lookup="row">/controls/engines/engine[1]/throttle</independentVar>
<tableData>
0.05 0
1.00 1
</tableData>
</table>
<value>0</value>
</ifthen>
</function>
</fcs_function>
<fcs_function name="fadec/reverse-2/throttle-rev">
<function>
<sum>
<value>0.08</value>
<product>
<difference>
<property>/controls/engines/engine[1]/reverse-lever</property>
<value>0.25</value>
</difference>
<quotient>
<ifthen>
<eq>
<property>/controls/engines/engine[1]/reverse-engage</property>
<value>1</value>
</eq>
<sum>
<value>0.05</value>
<product>
<property>fadec/reverse-2/throttle-rev-cmd</property>
<difference>
<property>fadec/limit/mrev-norm</property>
<value>0.08</value>
<value>0.05</value>
</difference>
<value>0.75</value> <!-- 1.0 - 0.25 -->
</quotient>
</product>
</sum>
</product>
</sum>
<value>0</value>
</ifthen>
</function>
<clipto>
<min>0.08</min>
<min>0.05</min>
<max>fadec/limit/mrev-norm</max>
</clipto>
</fcs_function>
<fcs_function name="/controls/engines/engine[1]/reverse-lever">
<function>
<product>
<property>/controls/engines/engine[1]/reverse-engage</property>
<table>
<independentVar lookup="row">/controls/engines/engine[1]/throttle</independentVar>
<tableData>
0.05 0.25
1.00 1.00
</tableData>
</table>
</product>
</function>
</fcs_function>
</channel>
<channel name="Engine Control"> <!-- Very complicated, please don't touch if you don't understand it -->
<!-- Engine 1 -->
<lag_filter name="fadec/control-1/throttle-lag">
<input>/controls/engines/engine[0]/throttle</input>
<c1>20</c1>
</lag_filter>
<switch name="fadec/control-1/throttle-pos">
<default value="fadec/control-1/throttle-lag"/>
<default value="/controls/engines/engine[0]/throttle"/>
<test value="0">
fadec/reverse-1/position-norm ne 0
</test>
</switch>
<lag_filter name="fadec/control-1/throttle-lag">
<input>fadec/control-1/throttle-pos</input>
<c1>20</c1>
</lag_filter>
<fcs_function name="fadec/control-1/idle-climb-n1">
<function>
<sum>
<property>fadec/limit/min-n1</property>
<product>
<difference>
<property>fadec/control-1/throttle-pos</property>
<property>fadec/control-1/throttle-lag</property>
<property>/systems/acconfig/options/fadec/idle-t</property>
</difference>
<quotient>
@ -962,7 +1032,7 @@
<property>fadec/limit/climb</property>
<product>
<difference>
<property>fadec/control-1/throttle-pos</property>
<property>fadec/control-1/throttle-lag</property>
<property>/systems/acconfig/options/fadec/climb-t</property>
</difference>
<quotient>
@ -990,7 +1060,7 @@
<property>fadec/limit/mct</property>
<product>
<difference>
<property>fadec/control-1/throttle-pos</property>
<property>fadec/control-1/throttle-lag</property>
<property>/systems/acconfig/options/fadec/mct-t</property>
</difference>
<quotient>
@ -1015,10 +1085,10 @@
<switch name="fadec/control-1/lever-n1">
<default value="fadec/control-1/idle-climb-n1"/>
<test value="fadec/control-1/mct-toga-n1">
fadec/control-1/throttle-pos gt /systems/acconfig/options/fadec/mct-t
fadec/control-1/throttle-lag gt /systems/acconfig/options/fadec/mct-t
</test>
<test value="fadec/control-1/climb-mct-n1">
fadec/control-1/throttle-pos gt /systems/acconfig/options/fadec/climb-t
fadec/control-1/throttle-lag gt /systems/acconfig/options/fadec/climb-t
</test>
</switch>
@ -1065,22 +1135,22 @@
<switch name="fadec/control-1/detent">
<default value="0"/> <!-- IDLE -->
<test value="6"> <!-- TOGA -->
fadec/control-1/throttle-pos ge /systems/acconfig/options/fadec/toga-b
fadec/control-1/throttle-lag ge /systems/acconfig/options/fadec/toga-b
</test>
<test value="5"> <!-- MAN THR -->
fadec/control-1/throttle-pos gt /systems/acconfig/options/fadec/mct-t
fadec/control-1/throttle-lag gt /systems/acconfig/options/fadec/mct-t
</test>
<test value="4"> <!-- MCT/FLX -->
fadec/control-1/throttle-pos ge /systems/acconfig/options/fadec/mct-b
fadec/control-1/throttle-lag ge /systems/acconfig/options/fadec/mct-b
</test>
<test value="3"> <!-- MAN THR -->
fadec/control-1/throttle-pos gt /systems/acconfig/options/fadec/climb-t
fadec/control-1/throttle-lag gt /systems/acconfig/options/fadec/climb-t
</test>
<test value="2"> <!-- CL -->
fadec/control-1/throttle-pos ge /systems/acconfig/options/fadec/climb-b
fadec/control-1/throttle-lag ge /systems/acconfig/options/fadec/climb-b
</test>
<test value="1"> <!-- MAN -->
fadec/control-1/throttle-pos gt /systems/acconfig/options/fadec/idle-t
fadec/control-1/throttle-lag gt /systems/acconfig/options/fadec/idle-t
</test>
<output>fbw/detent-1-feedback</output>
</switch>
@ -1091,7 +1161,7 @@
<value>2</value>
<product>
<difference>
<property>fadec/control-1/throttle-pos</property>
<property>fadec/control-1/throttle-lag</property>
<property>/systems/acconfig/options/fadec/idle-t</property>
</difference>
<quotient>
@ -1119,7 +1189,7 @@
<value>27</value>
<product>
<difference>
<property>fadec/control-1/throttle-pos</property>
<property>fadec/control-1/throttle-lag</property>
<property>/systems/acconfig/options/fadec/climb-t</property>
</difference>
<quotient>
@ -1147,7 +1217,7 @@
<value>37</value>
<product>
<difference>
<property>fadec/control-1/throttle-pos</property>
<property>fadec/control-1/throttle-lag</property>
<property>/systems/acconfig/options/fadec/mct-t</property>
</difference>
<quotient>
@ -1172,45 +1242,45 @@
<switch name="fadec/control-1/lever/angle">
<default value="0"/> <!-- IDLE -->
<test value="45"> <!-- TOGA -->
fadec/control-1/throttle-pos ge /systems/acconfig/options/fadec/toga-b
fadec/control-1/throttle-lag ge /systems/acconfig/options/fadec/toga-b
</test>
<test value="fadec/control-1/lever/mct-toga"> <!-- MAN THR -->
fadec/control-1/throttle-pos gt /systems/acconfig/options/fadec/mct-t
fadec/control-1/throttle-lag gt /systems/acconfig/options/fadec/mct-t
</test>
<test value="35"> <!-- MCT/FLX -->
fadec/control-1/throttle-pos ge /systems/acconfig/options/fadec/mct-b
fadec/control-1/throttle-lag ge /systems/acconfig/options/fadec/mct-b
</test>
<test value="fadec/control-1/lever/climb-mct"> <!-- MAN THR -->
fadec/control-1/throttle-pos gt /systems/acconfig/options/fadec/climb-t
fadec/control-1/throttle-lag gt /systems/acconfig/options/fadec/climb-t
</test>
<test value="25"> <!-- CL -->
fadec/control-1/throttle-pos ge /systems/acconfig/options/fadec/climb-b
fadec/control-1/throttle-lag ge /systems/acconfig/options/fadec/climb-b
</test>
<test value="fadec/control-1/lever/idle-climb"> <!-- MAN -->
fadec/control-1/throttle-pos gt /systems/acconfig/options/fadec/idle-t
fadec/control-1/throttle-lag gt /systems/acconfig/options/fadec/idle-t
</test>
</switch>
<!-- Engine 2 -->
<lag_filter name="fadec/control-2/throttle-lag">
<input>/controls/engines/engine[1]/throttle</input>
<c1>20</c1>
</lag_filter>
<switch name="fadec/control-2/throttle-pos">
<default value="fadec/control-2/throttle-lag"/>
<default value="/controls/engines/engine[1]/throttle"/>
<test value="0">
fadec/reverse-2/position-norm ne 0
</test>
</switch>
<lag_filter name="fadec/control-2/throttle-lag">
<input>fadec/control-2/throttle-pos</input>
<c1>20</c1>
</lag_filter>
<fcs_function name="fadec/control-2/idle-climb-n1">
<function>
<sum>
<property>fadec/limit/min-n1</property>
<product>
<difference>
<property>fadec/control-2/throttle-pos</property>
<property>fadec/control-2/throttle-lag</property>
<property>/systems/acconfig/options/fadec/idle-t</property>
</difference>
<quotient>
@ -1238,7 +1308,7 @@
<property>fadec/limit/climb</property>
<product>
<difference>
<property>fadec/control-2/throttle-pos</property>
<property>fadec/control-2/throttle-lag</property>
<property>/systems/acconfig/options/fadec/climb-t</property>
</difference>
<quotient>
@ -1266,7 +1336,7 @@
<property>fadec/limit/mct</property>
<product>
<difference>
<property>fadec/control-2/throttle-pos</property>
<property>fadec/control-2/throttle-lag</property>
<property>/systems/acconfig/options/fadec/mct-t</property>
</difference>
<quotient>
@ -1291,10 +1361,10 @@
<switch name="fadec/control-2/lever-n1">
<default value="fadec/control-2/idle-climb-n1"/>
<test value="fadec/control-2/mct-toga-n1">
fadec/control-2/throttle-pos gt /systems/acconfig/options/fadec/mct-t
fadec/control-2/throttle-lag gt /systems/acconfig/options/fadec/mct-t
</test>
<test value="fadec/control-2/climb-mct-n1">
fadec/control-2/throttle-pos gt /systems/acconfig/options/fadec/climb-t
fadec/control-2/throttle-lag gt /systems/acconfig/options/fadec/climb-t
</test>
</switch>
@ -1341,22 +1411,22 @@
<switch name="fadec/control-2/detent">
<default value="0"/> <!-- IDLE -->
<test value="6"> <!-- TOGA -->
fadec/control-2/throttle-pos ge /systems/acconfig/options/fadec/toga-b
fadec/control-2/throttle-lag ge /systems/acconfig/options/fadec/toga-b
</test>
<test value="5"> <!-- MAN THR -->
fadec/control-2/throttle-pos gt /systems/acconfig/options/fadec/mct-t
fadec/control-2/throttle-lag gt /systems/acconfig/options/fadec/mct-t
</test>
<test value="4"> <!-- MCT/FLX -->
fadec/control-2/throttle-pos ge /systems/acconfig/options/fadec/mct-b
fadec/control-2/throttle-lag ge /systems/acconfig/options/fadec/mct-b
</test>
<test value="3"> <!-- MAN THR -->
fadec/control-2/throttle-pos gt /systems/acconfig/options/fadec/climb-t
fadec/control-2/throttle-lag gt /systems/acconfig/options/fadec/climb-t
</test>
<test value="2"> <!-- CL -->
fadec/control-2/throttle-pos ge /systems/acconfig/options/fadec/climb-b
fadec/control-2/throttle-lag ge /systems/acconfig/options/fadec/climb-b
</test>
<test value="1"> <!-- MAN -->
fadec/control-2/throttle-pos gt /systems/acconfig/options/fadec/idle-t
fadec/control-2/throttle-lag gt /systems/acconfig/options/fadec/idle-t
</test>
<output>fbw/detent-2-feedback</output>
</switch>
@ -1367,7 +1437,7 @@
<value>2</value>
<product>
<difference>
<property>fadec/control-2/throttle-pos</property>
<property>fadec/control-2/throttle-lag</property>
<property>/systems/acconfig/options/fadec/idle-t</property>
</difference>
<quotient>
@ -1395,7 +1465,7 @@
<value>27</value>
<product>
<difference>
<property>fadec/control-2/throttle-pos</property>
<property>fadec/control-2/throttle-lag</property>
<property>/systems/acconfig/options/fadec/climb-t</property>
</difference>
<quotient>
@ -1423,7 +1493,7 @@
<value>37</value>
<product>
<difference>
<property>fadec/control-2/throttle-pos</property>
<property>fadec/control-2/throttle-lag</property>
<property>/systems/acconfig/options/fadec/mct-t</property>
</difference>
<quotient>
@ -1448,22 +1518,22 @@
<switch name="fadec/control-2/lever/angle">
<default value="0"/> <!-- IDLE -->
<test value="45"> <!-- TOGA -->
fadec/control-2/throttle-pos ge /systems/acconfig/options/fadec/toga-b
fadec/control-2/throttle-lag ge /systems/acconfig/options/fadec/toga-b
</test>
<test value="fadec/control-2/lever/mct-toga"> <!-- MAN THR -->
fadec/control-2/throttle-pos gt /systems/acconfig/options/fadec/mct-t
fadec/control-2/throttle-lag gt /systems/acconfig/options/fadec/mct-t
</test>
<test value="35"> <!-- MCT/FLX -->
fadec/control-2/throttle-pos ge /systems/acconfig/options/fadec/mct-b
fadec/control-2/throttle-lag ge /systems/acconfig/options/fadec/mct-b
</test>
<test value="fadec/control-2/lever/climb-mct"> <!-- MAN THR -->
fadec/control-2/throttle-pos gt /systems/acconfig/options/fadec/climb-t
fadec/control-2/throttle-lag gt /systems/acconfig/options/fadec/climb-t
</test>
<test value="25"> <!-- CL -->
fadec/control-2/throttle-pos ge /systems/acconfig/options/fadec/climb-b
fadec/control-2/throttle-lag ge /systems/acconfig/options/fadec/climb-b
</test>
<test value="fadec/control-2/lever/idle-climb"> <!-- MAN -->
fadec/control-2/throttle-pos gt /systems/acconfig/options/fadec/idle-t
fadec/control-2/throttle-lag gt /systems/acconfig/options/fadec/idle-t
</test>
</switch>
@ -1645,7 +1715,7 @@
</test>
<clipto>
<min>fadec/limit/idle-norm</min> <!-- Never force it below the idle limit -->
<max>1</max>
<max>1.0</max>
</clipto>
</switch>
@ -1795,7 +1865,7 @@
<gain>1.0</gain>
<clipto>
<min>fadec/limit/idle-norm</min>
<max>1</max>
<max>1.0</max>
</clipto>
</pure_gain>
@ -1833,7 +1903,7 @@
<gain>1.0</gain>
<clipto>
<min>fadec/limit/idle-norm</min>
<max>1</max>
<max>1.0</max>
</clipto>
</pure_gain>