A3XX: FADEC Fixed: FLX Limit correct, improve thrust CMD handling, improve EPR calculation

This commit is contained in:
Joshua Davidson 2017-06-16 22:45:19 -04:00
parent 6745986efd
commit 7dc4363a55
3 changed files with 132 additions and 44 deletions

View file

@ -14,7 +14,7 @@ setprop("/engines/flx-thr", 0.0);
setlistener("/sim/signals/fdm-initialized", func { setlistener("/sim/signals/fdm-initialized", func {
setprop("/controls/engines/thrust-limit", "TOGA"); setprop("/controls/engines/thrust-limit", "TOGA");
setprop("/controls/engines/epr-limit", 1.308); setprop("/controls/engines/epr-limit", 1.308);
setprop("/controls/engines/n1-limit", 101.8); setprop("/controls/engines/n1-limit", 95.9);
setprop("/systems/thrust/state1", "IDLE"); setprop("/systems/thrust/state1", "IDLE");
setprop("/systems/thrust/state2", "IDLE"); setprop("/systems/thrust/state2", "IDLE");
setprop("/systems/thrust/lvrclb", "0"); setprop("/systems/thrust/lvrclb", "0");
@ -47,9 +47,9 @@ setlistener("/controls/engines/engine[0]/throttle-pos", func {
setprop("/it-autoflight/input/athr", 1); setprop("/it-autoflight/input/athr", 1);
if (getprop("/controls/engines/thrust-limit") == "FLX") { if (getprop("/controls/engines/thrust-limit") == "FLX") {
var derate = getprop("/engines/flex-derate"); var derate = getprop("/engines/flex-derate");
setprop("/controls/engines/engine[0]/throttle-fdm", 0.95 - derate); setprop("/controls/engines/engine[0]/throttle-fdm", 0.88 - derate);
} else { } else {
setprop("/controls/engines/engine[0]/throttle-fdm", 0.90); setprop("/controls/engines/engine[0]/throttle-fdm", 0.84);
} }
setprop("/systems/thrust/state1", "MCT"); setprop("/systems/thrust/state1", "MCT");
} else if (thrr >= 0.83 and thrr < 0.95) { } else if (thrr >= 0.83 and thrr < 0.95) {
@ -58,7 +58,7 @@ setlistener("/controls/engines/engine[0]/throttle-pos", func {
unflex(); unflex();
} else if (thrr >= 0.95) { } else if (thrr >= 0.95) {
setprop("/it-autoflight/input/athr", 1); setprop("/it-autoflight/input/athr", 1);
setprop("/controls/engines/engine[0]/throttle-fdm", 0.95); setprop("/controls/engines/engine[0]/throttle-fdm", 0.88);
setprop("/systems/thrust/state1", "TOGA"); setprop("/systems/thrust/state1", "TOGA");
unflex(); unflex();
} }
@ -78,7 +78,7 @@ setlistener("/controls/engines/engine[0]/throttle-pos", func {
} else if (thrr >= 0.95) { } else if (thrr >= 0.95) {
setprop("/systems/thrust/state1", "TOGA"); setprop("/systems/thrust/state1", "TOGA");
} }
setprop("/controls/engines/engine[0]/throttle-fdm", 0.95); setprop("/controls/engines/engine[0]/throttle-fdm", 0.88);
} }
}); });
@ -102,9 +102,9 @@ setlistener("/controls/engines/engine[1]/throttle-pos", func {
setprop("/it-autoflight/input/athr", 1); setprop("/it-autoflight/input/athr", 1);
if (getprop("/controls/engines/thrust-limit") == "FLX") { if (getprop("/controls/engines/thrust-limit") == "FLX") {
var derate = getprop("/engines/flex-derate"); var derate = getprop("/engines/flex-derate");
setprop("/controls/engines/engine[1]/throttle-fdm", 0.95 - derate); setprop("/controls/engines/engine[1]/throttle-fdm", 0.88 - derate);
} else { } else {
setprop("/controls/engines/engine[1]/throttle-fdm", 0.90); setprop("/controls/engines/engine[1]/throttle-fdm", 0.84);
} }
setprop("/systems/thrust/state2", "MCT"); setprop("/systems/thrust/state2", "MCT");
} else if (thrr >= 0.83 and thrr < 0.95) { } else if (thrr >= 0.83 and thrr < 0.95) {
@ -113,7 +113,7 @@ setlistener("/controls/engines/engine[1]/throttle-pos", func {
unflex(); unflex();
} else if (thrr >= 0.95) { } else if (thrr >= 0.95) {
setprop("/it-autoflight/input/athr", 1); setprop("/it-autoflight/input/athr", 1);
setprop("/controls/engines/engine[1]/throttle-fdm", 0.95); setprop("/controls/engines/engine[1]/throttle-fdm", 0.88);
setprop("/systems/thrust/state2", "TOGA"); setprop("/systems/thrust/state2", "TOGA");
unflex(); unflex();
} }
@ -133,7 +133,7 @@ setlistener("/controls/engines/engine[1]/throttle-pos", func {
} else if (thrr >= 0.95) { } else if (thrr >= 0.95) {
setprop("/systems/thrust/state2", "TOGA"); setprop("/systems/thrust/state2", "TOGA");
} }
setprop("/controls/engines/engine[1]/throttle-fdm", 0.95); setprop("/controls/engines/engine[1]/throttle-fdm", 0.88);
} }
}); });
@ -177,19 +177,19 @@ var thrust_lim = func {
if ((state1 == "TOGA" or state2 == "TOGA" or (state1 == "MAN THR" and thr1 >= 0.83) or (state2 == "MAN THR" and thr2 >= 0.83)) or getprop("/systems/thrust/alpha-floor") == 1 or getprop("/systems/thrust/toga-lk") == 1) { if ((state1 == "TOGA" or state2 == "TOGA" or (state1 == "MAN THR" and thr1 >= 0.83) or (state2 == "MAN THR" and thr2 >= 0.83)) or getprop("/systems/thrust/alpha-floor") == 1 or getprop("/systems/thrust/toga-lk") == 1) {
setprop("/controls/engines/thrust-limit", "TOGA"); setprop("/controls/engines/thrust-limit", "TOGA");
setprop("/controls/engines/epr-limit", eprtoga); setprop("/controls/engines/epr-limit", eprtoga);
setprop("/controls/engines/n1-limit", 101.8); setprop("/controls/engines/n1-limit", 95.9);
} else if ((state1 == "MCT" or state2 == "MCT" or (state1 == "MAN THR" and thr1 < 0.83) or (state2 == "MAN THR" and thr2 < 0.83)) and getprop("/systems/thrust/lim-flex") == 0) { } else if ((state1 == "MCT" or state2 == "MCT" or (state1 == "MAN THR" and thr1 < 0.83) or (state2 == "MAN THR" and thr2 < 0.83)) and getprop("/systems/thrust/lim-flex") == 0) {
setprop("/controls/engines/thrust-limit", "MCT"); setprop("/controls/engines/thrust-limit", "MCT");
setprop("/controls/engines/epr-limit", eprmct); setprop("/controls/engines/epr-limit", eprmct);
setprop("/controls/engines/n1-limit", 97.7); setprop("/controls/engines/n1-limit", 92.6);
} else if ((state1 == "MCT" or state2 == "MCT" or (state1 == "MAN THR" and thr1 < 0.83) or (state2 == "MAN THR" and thr2 < 0.83)) and getprop("/systems/thrust/lim-flex") == 1) { } else if ((state1 == "MCT" or state2 == "MCT" or (state1 == "MAN THR" and thr1 < 0.83) or (state2 == "MAN THR" and thr2 < 0.83)) and getprop("/systems/thrust/lim-flex") == 1) {
setprop("/controls/engines/thrust-limit", "FLX"); setprop("/controls/engines/thrust-limit", "FLX");
setprop("/controls/engines/epr-limit", eprmct); setprop("/controls/engines/epr-limit", eprflx);
setprop("/controls/engines/n1-limit", 97.7); setprop("/controls/engines/n1-limit", n1flx);
} else if (state1 == "CL" or state2 == "CL" or state1 == "MAN" or state2 == "MAN" or state1 == "IDLE" or state2 == "IDLE") { } else if (state1 == "CL" or state2 == "CL" or state1 == "MAN" or state2 == "MAN" or state1 == "IDLE" or state2 == "IDLE") {
setprop("/controls/engines/thrust-limit", "CLB"); setprop("/controls/engines/thrust-limit", "CLB");
setprop("/controls/engines/epr-limit", eprclb); setprop("/controls/engines/epr-limit", eprclb);
setprop("/controls/engines/n1-limit", 91.9); setprop("/controls/engines/n1-limit", 89.2);
} }
} else if (getprop("/FMGC/internal/flex-set") == 1) { } else if (getprop("/FMGC/internal/flex-set") == 1) {
setprop("/systems/thrust/lim-flex", 1); setprop("/systems/thrust/lim-flex", 1);
@ -199,7 +199,7 @@ var thrust_lim = func {
} else { } else {
setprop("/controls/engines/thrust-limit", "TOGA"); setprop("/controls/engines/thrust-limit", "TOGA");
setprop("/controls/engines/epr-limit", eprtoga); setprop("/controls/engines/epr-limit", eprtoga);
setprop("/controls/engines/n1-limit", 101.8); setprop("/controls/engines/n1-limit", 95.9);
} }
} }
@ -213,7 +213,7 @@ var unflex = func {
var thrust_loop = func { var thrust_loop = func {
var derate = getprop("/engines/flex-derate"); var derate = getprop("/engines/flex-derate");
setprop("/engines/flx-thr", 0.95 - derate); setprop("/engines/flx-thr", 0.88 - derate);
var state1 = getprop("/systems/thrust/state1"); var state1 = getprop("/systems/thrust/state1");
var state2 = getprop("/systems/thrust/state2"); var state2 = getprop("/systems/thrust/state2");
if ((state1 == "CL") and (state2 == "CL")) { if ((state1 == "CL") and (state2 == "CL")) {

View file

@ -16,11 +16,11 @@
<property>/controls/engines/engine[0]/throttle-pos</property> <property>/controls/engines/engine[0]/throttle-pos</property>
<entry><ind>0.00</ind><dep>0.00</dep></entry> <entry><ind>0.00</ind><dep>0.00</dep></entry>
<entry><ind>0.01</ind><dep>0.00</dep></entry> <entry><ind>0.01</ind><dep>0.00</dep></entry>
<entry><ind>0.60</ind><dep>0.83</dep></entry> <entry><ind>0.60</ind><dep>0.80</dep></entry>
<entry><ind>0.65</ind><dep>0.83</dep></entry> <entry><ind>0.65</ind><dep>0.80</dep></entry>
<entry><ind>0.78</ind><dep>0.90</dep></entry> <entry><ind>0.78</ind><dep>0.84</dep></entry>
<entry><ind>0.83</ind><dep>0.90</dep></entry> <entry><ind>0.83</ind><dep>0.84</dep></entry>
<entry><ind>0.95</ind><dep>0.95</dep></entry> <entry><ind>0.95</ind><dep>0.88</dep></entry>
</table> </table>
</expression> </expression>
</input> </input>
@ -38,11 +38,11 @@
<property>/controls/engines/engine[1]/throttle-pos</property> <property>/controls/engines/engine[1]/throttle-pos</property>
<entry><ind>0.00</ind><dep>0.00</dep></entry> <entry><ind>0.00</ind><dep>0.00</dep></entry>
<entry><ind>0.01</ind><dep>0.00</dep></entry> <entry><ind>0.01</ind><dep>0.00</dep></entry>
<entry><ind>0.60</ind><dep>0.83</dep></entry> <entry><ind>0.60</ind><dep>0.80</dep></entry>
<entry><ind>0.65</ind><dep>0.83</dep></entry> <entry><ind>0.65</ind><dep>0.80</dep></entry>
<entry><ind>0.78</ind><dep>0.90</dep></entry> <entry><ind>0.78</ind><dep>0.84</dep></entry>
<entry><ind>0.83</ind><dep>0.90</dep></entry> <entry><ind>0.83</ind><dep>0.84</dep></entry>
<entry><ind>0.95</ind><dep>0.95</dep></entry> <entry><ind>0.95</ind><dep>0.88</dep></entry>
</table> </table>
</expression> </expression>
</input> </input>
@ -54,12 +54,33 @@
<type>gain</type> <type>gain</type>
<gain>1</gain> <gain>1</gain>
<update-interval-secs type="double">0.05</update-interval-secs> <update-interval-secs type="double">0.05</update-interval-secs>
<input>
<condition>
<and>
<equals>
<property>/controls/engines/thrust-limit</property>
<value>FLX</value>
</equals>
<equals>
<property>/systems/thrust/state1</property>
<value>MCT</value>
</equals>
</and>
</condition>
<expression>
<table>
<property>/engines/flx-thr</property>
<entry><ind>0.00</ind><dep> 22.4</dep></entry>
<entry><ind>1.00</ind><dep>105.8</dep></entry>
</table>
</expression>
</input>
<input> <input>
<expression> <expression>
<table> <table>
<property>/controls/engines/engine[0]/throttle-man</property> <property>/controls/engines/engine[0]/throttle-man</property>
<entry><ind>0.00</ind><dep> 22.4</dep></entry> <entry><ind>0.00</ind><dep> 22.4</dep></entry>
<entry><ind>0.95</ind><dep>101.7</dep></entry> <entry><ind>1.00</ind><dep>105.8</dep></entry>
</table> </table>
</expression> </expression>
</input> </input>
@ -71,12 +92,33 @@
<type>gain</type> <type>gain</type>
<gain>1</gain> <gain>1</gain>
<update-interval-secs type="double">0.05</update-interval-secs> <update-interval-secs type="double">0.05</update-interval-secs>
<input>
<condition>
<and>
<equals>
<property>/controls/engines/thrust-limit</property>
<value>FLX</value>
</equals>
<equals>
<property>/systems/thrust/state2</property>
<value>MCT</value>
</equals>
</and>
</condition>
<expression>
<table>
<property>/engines/flx-thr</property>
<entry><ind>0.00</ind><dep> 22.4</dep></entry>
<entry><ind>1.00</ind><dep>105.8</dep></entry>
</table>
</expression>
</input>
<input> <input>
<expression> <expression>
<table> <table>
<property>/controls/engines/engine[1]/throttle-man</property> <property>/controls/engines/engine[1]/throttle-man</property>
<entry><ind>0.00</ind><dep> 22.4</dep></entry> <entry><ind>0.00</ind><dep> 22.4</dep></entry>
<entry><ind>0.95</ind><dep>101.7</dep></entry> <entry><ind>1.00</ind><dep>105.8</dep></entry>
</table> </table>
</expression> </expression>
</input> </input>

View file

@ -16,11 +16,11 @@
<property>/controls/engines/engine[0]/throttle-pos</property> <property>/controls/engines/engine[0]/throttle-pos</property>
<entry><ind>0.00</ind><dep>0.00</dep></entry> <entry><ind>0.00</ind><dep>0.00</dep></entry>
<entry><ind>0.01</ind><dep>0.00</dep></entry> <entry><ind>0.01</ind><dep>0.00</dep></entry>
<entry><ind>0.60</ind><dep>0.83</dep></entry> <entry><ind>0.60</ind><dep>0.80</dep></entry>
<entry><ind>0.65</ind><dep>0.83</dep></entry> <entry><ind>0.65</ind><dep>0.80</dep></entry>
<entry><ind>0.78</ind><dep>0.90</dep></entry> <entry><ind>0.78</ind><dep>0.84</dep></entry>
<entry><ind>0.83</ind><dep>0.90</dep></entry> <entry><ind>0.83</ind><dep>0.84</dep></entry>
<entry><ind>0.95</ind><dep>0.95</dep></entry> <entry><ind>0.95</ind><dep>0.88</dep></entry>
</table> </table>
</expression> </expression>
</input> </input>
@ -38,11 +38,11 @@
<property>/controls/engines/engine[1]/throttle-pos</property> <property>/controls/engines/engine[1]/throttle-pos</property>
<entry><ind>0.00</ind><dep>0.00</dep></entry> <entry><ind>0.00</ind><dep>0.00</dep></entry>
<entry><ind>0.01</ind><dep>0.00</dep></entry> <entry><ind>0.01</ind><dep>0.00</dep></entry>
<entry><ind>0.60</ind><dep>0.83</dep></entry> <entry><ind>0.60</ind><dep>0.80</dep></entry>
<entry><ind>0.65</ind><dep>0.83</dep></entry> <entry><ind>0.65</ind><dep>0.80</dep></entry>
<entry><ind>0.78</ind><dep>0.90</dep></entry> <entry><ind>0.78</ind><dep>0.84</dep></entry>
<entry><ind>0.83</ind><dep>0.90</dep></entry> <entry><ind>0.83</ind><dep>0.84</dep></entry>
<entry><ind>0.95</ind><dep>0.95</dep></entry> <entry><ind>0.95</ind><dep>0.88</dep></entry>
</table> </table>
</expression> </expression>
</input> </input>
@ -58,8 +58,8 @@
<expression> <expression>
<table> <table>
<property>/position/altitude-ft</property> <property>/position/altitude-ft</property>
<entry><ind> 0</ind><dep>0.441</dep></entry> <entry><ind> 0</ind><dep>0.444</dep></entry>
<entry><ind>42000</ind><dep>0.671</dep></entry> <entry><ind>42000</ind><dep>0.684</dep></entry>
</table> </table>
</expression> </expression>
</input> </input>
@ -76,7 +76,7 @@
<table> <table>
<property>/position/altitude-ft</property> <property>/position/altitude-ft</property>
<entry><ind> 0</ind><dep>0.992</dep></entry> <entry><ind> 0</ind><dep>0.992</dep></entry>
<entry><ind>13000</ind><dep>0.979</dep></entry> <entry><ind>13000</ind><dep>0.977</dep></entry>
<entry><ind>42000</ind><dep>0.969</dep></entry> <entry><ind>42000</ind><dep>0.969</dep></entry>
</table> </table>
</expression> </expression>
@ -125,6 +125,29 @@
<type>gain</type> <type>gain</type>
<gain>1</gain> <gain>1</gain>
<update-interval-secs type="double">0.05</update-interval-secs> <update-interval-secs type="double">0.05</update-interval-secs>
<input>
<condition>
<and>
<equals>
<property>/controls/engines/thrust-limit</property>
<value>FLX</value>
</equals>
<equals>
<property>/systems/thrust/state1</property>
<value>MCT</value>
</equals>
</and>
</condition>
<expression>
<table>
<property>/engines/flx-thr</property>
<entry><ind>0.000</ind><dep>0.03</dep></entry>
<entry><ind>0.141</ind><dep>0.20</dep></entry>
<entry><ind>1.000</ind><dep>1.00</dep></entry>
</table>
</expression>
<scale>/engines/epr-scale</scale>
</input>
<input> <input>
<expression> <expression>
<table> <table>
@ -196,6 +219,29 @@
<type>gain</type> <type>gain</type>
<gain>1</gain> <gain>1</gain>
<update-interval-secs type="double">0.05</update-interval-secs> <update-interval-secs type="double">0.05</update-interval-secs>
<input>
<condition>
<and>
<equals>
<property>/controls/engines/thrust-limit</property>
<value>FLX</value>
</equals>
<equals>
<property>/systems/thrust/state2</property>
<value>MCT</value>
</equals>
</and>
</condition>
<expression>
<table>
<property>/engines/flx-thr</property>
<entry><ind>0.000</ind><dep>0.03</dep></entry>
<entry><ind>0.141</ind><dep>0.20</dep></entry>
<entry><ind>1.000</ind><dep>1.00</dep></entry>
</table>
</expression>
<scale>/engines/epr-scale</scale>
</input>
<input> <input>
<expression> <expression>
<table> <table>
@ -560,7 +606,7 @@
<input> <input>
<expression> <expression>
<table> <table>
<value>0.95</value> <value>0.88</value>
<entry><ind>0.000</ind><dep>0.03</dep></entry> <entry><ind>0.000</ind><dep>0.03</dep></entry>
<entry><ind>0.141</ind><dep>0.20</dep></entry> <entry><ind>0.141</ind><dep>0.20</dep></entry>
<entry><ind>1.000</ind><dep>1.00</dep></entry> <entry><ind>1.000</ind><dep>1.00</dep></entry>
@ -595,7 +641,7 @@
<input> <input>
<expression> <expression>
<table> <table>
<value>0.90</value> <value>0.84</value>
<entry><ind>0.000</ind><dep>0.03</dep></entry> <entry><ind>0.000</ind><dep>0.03</dep></entry>
<entry><ind>0.141</ind><dep>0.20</dep></entry> <entry><ind>0.141</ind><dep>0.20</dep></entry>
<entry><ind>1.000</ind><dep>1.00</dep></entry> <entry><ind>1.000</ind><dep>1.00</dep></entry>
@ -665,7 +711,7 @@
<input> <input>
<expression> <expression>
<table> <table>
<value>0.83</value> <value>0.80</value>
<entry><ind>0.000</ind><dep>0.03</dep></entry> <entry><ind>0.000</ind><dep>0.03</dep></entry>
<entry><ind>0.141</ind><dep>0.20</dep></entry> <entry><ind>0.141</ind><dep>0.20</dep></entry>
<entry><ind>1.000</ind><dep>1.00</dep></entry> <entry><ind>1.000</ind><dep>1.00</dep></entry>