Skip to content

Commit

Permalink
fix(a380x/eng): Engine performance improvement trial 1 (flybywiresim#…
Browse files Browse the repository at this point in the history
…9041)

* n2_to_n1_table: Set N1 entries for mach 0 to 88.1% of previous values (lowering idle N1 to ~17%)
n1_and_mach_on_thrust_table: Increase thrust to 120% of previous values
Adapt FF controller PID parameters to keep responsiveness

* packs 3&4... don't know what I was smoking
  • Loading branch information
flogross89 authored Oct 10, 2024
1 parent 29c52a9 commit e813a14
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ AfterBurnThrustSpecificFuelConsumption = 0.0
mach_0_corrected_commanded_ne_table = 0:1.000000:1.201723:1.453784:2.175007:3.364756:4.472461:5.415178,0.000000:60.000000:61.058056:62.174137:64.603148:67.341070:69.189046:69.189046,0.100000:66.862170:68.041236:69.284962:71.991777:75.042834:77.102162:77.102162,0.200000:73.020528:74.308192:75.666471:78.622599:81.954674:84.203677:84.203677,0.400000:81.642229:83.081930:84.600585:87.905749:91.631250:94.145798:94.145798,0.600000:86.217009:87.737383:89.341135:92.831502:96.765760:99.421209:99.421209,0.750000:89.296188:90.870861:92.531889:96.146913:100.221680:102.971967:102.971967,0.900000:95.014663:96.690177:106.000000:102.304105:106.639817:109.566230:109.566230,1.000000:100.000000:101.763427:103.623561:107.671913:112.235116:115.315076:115.315076
mach_hi_corrected_commanded_ne_table = 0.9:1.000000:1.201723:1.453784:2.175007:3.364756:4.472461:5.415178,0.000000:55.660639:56.642174:57.677536:59.930874:62.470783:64.185108:64.185108,0.100000:62.026518:63.120311:64.274087:66.785139:69.615535:71.525927:71.525927,0.200000:67.739487:68.934024:70.194069:72.936401:76.027492:78.113841:78.113841,0.400000:75.737643:77.073222:78.482043:81.548169:85.004232:87.336921:87.336921,0.600000:79.981563:81.391980:82.879744:86.117679:89.767400:92.230800:92.230800,0.750000:82.838047:84.298836:85.839735:89.193310:92.973379:95.524757:95.524757,0.900000:88.142947:89.697284:98.333795:94.905197:98.927339:101.642106:101.642106,1.000000:92.767731:94.403623:96.129227:99.884791:104.117971:106.975180:106.975180
corrected_n2_from_ff_table = 0.000184:20.234723,0.017030:60.000352,0.018464:65.542906,0.108271:69.501874,0.141371:73.460841,0.168471:76.540038,0.190658:79.179350,0.208824:81.818662,0.213632:87.977056,0.269273:100.000000
n1_and_mach_on_thrust_table=0.000000:0.000000:0.100000:0.200000:0.300000:0.400000:0.500000:0.600000:0.700000:0.800000:0.900000,0.000000:0.000000:0.000000:0.000000:0.000000:0.000000:0.000000:0.000000:0.000000:0.000000:0.000000,20.000000:0.025:0.015:0.015:0.028096:-0.017284:-0.037284:-0.057077:-0.205841:-0.315399:-0.488717,25.000000:0.035:0.02:0.015:0.030404:-0.009593:-0.026571:-0.041999:-0.151328:-0.266204:-0.439028,30.000000:0.05:0.022:0.015:0.032748:0.017389:0.003990:-0.026921:-0.051814:-0.081946:-0.369391,35.000000:0.262207:0.126047:0.077206:0.045921:0.024719:0.006062:-0.002812:-0.022800:-0.044248:-0.293631,40.000000:0.330230:0.162757:0.124088:0.069579:0.057905:0.049621:0.029790:-0.002139:-0.025811:-0.220630,45.000000:0.393293:0.250096:0.156707:0.112419:0.091418:0.076757:0.056090:0.018509:-0.007375:-0.155120,50.000000:0.452337:0.311066:0.211353:0.158174:0.127429:0.104915:0.081171:0.047419:0.011062:-0.098474,55.000000:0.509468:0.373568:0.269961:0.209106:0.168650:0.137223:0.108383:0.075660:0.028704:-0.049469,60.000000:0.594614:0.439955:0.334629:0.267477:0.217773:0.176899:0.141404:0.107148:0.064556:-0.005036,65.000000:0.660035:0.512604:0.407151:0.335055:0.276928:0.226669:0.183627:0.145850:0.104441:0.039012,70.000000:0.733601:0.593506:0.488571:0.412623:0.347163:0.288210:0.237559:0.195142:0.152485:0.087269,75.000000:0.818693:0.683880:0.578756:0.499514:0.427939:0.361604:0.304241:0.257197:0.212005:0.144042,80.000000:0.910344:0.783795:0.675982:0.593166:0.516644:0.444822:0.382689:0.332384:0.284867:0.212679,85.000000:1.025165:0.891823:0.776548:0.688692:0.608128:0.533210:0.469351:0.418690:0.370870:0.294907,90.000000:1.157049:1.004695:0.874400:0.778466:0.694251:0.619011:0.557581:0.511153:0.467149:0.390203,95.000000:1.281333:1.116993:0.960774:0.851733:0.763455:0.690890:0.637136:0.601322:0.567588:0.495167,100.000000:1.357935:1.220844:1.023864:0.894234:0.800352:0.733488:0.693684:0.654691:0.617963:0.539115,105.000000:1.378826:1.239626:1.048498:0.915750:0.819609:0.751137:0.710375:0.670444:0.632832:0.552086,110.000000:1.392754:1.252148:1.069322:0.933937:0.835886:0.766054:0.724483:0.683759:0.645400:0.563051
n2_to_n1_table = 0.000000:0.000000:0.200000:0.900000,16.011730:0.000000:0.000000:17.000000,19.354839:1.844660:1.844660:17.344660,22.873900:2.427184:2.427184:18.127184,50.146628:12.427184:12.427184:26.627184,60.000000:18.500000:18.500000:33.727774,67.741935:25.242718:25.242718:40.082270,73.020528:30.505087:30.505087:43.853613,78.299120:39.778681:39.778681:48.898780,81.642229:49.514563:49.514563:53.556563,85.337243:63.106796:63.106796:63.106796,87.976540:74.757282:74.757282:74.757282,97.800000:97.200000:97.200000:97.200000,118.000000:115.346535:115.346535:115.346535
n1_and_mach_on_thrust_table=0:0:0.1:0.2:0.3:0.4:0.5:0.6:0.7:0.8:0.9,0:0:0:0:0:0:0:0:0:0:0,20:0.03:0.018:0.018:0.0337152:-0.0207408:-0.0447408:-0.0684924:-0.2470092:-0.3784788:-0.5864604,25:0.042:0.024:0.018:0.0364848:-0.0115116:-0.0318852:-0.0503988:-0.1815936:-0.3194448:-0.5268336,30:0.06:0.0264:0.018:0.0392976:0.0208668:0.004788:-0.0323052:-0.0621768:-0.0983352:-0.4432692,35:0.3146484:0.1512564:0.0926472:0.0551052:0.0296628:0.0072744:-0.0033744:-0.02736:-0.0530976:-0.3523572,40:0.396276:0.1953084:0.1489056:0.0834948:0.069486:0.0595452:0.035748:-0.0025668:-0.0309732:-0.264756,45:0.4719516:0.3001152:0.1880484:0.1349028:0.1097016:0.0921084:0.067308:0.0222108:-0.00885:-0.186144,50:0.5428044:0.3732792:0.2536236:0.1898088:0.1529148:0.125898:0.0974052:0.0569028:0.0132744:-0.1181688,55:0.6113616:0.4482816:0.3239532:0.2509272:0.20238:0.1646676:0.1300596:0.090792:0.0344448:-0.0593628,60:0.7135368:0.527946:0.4015548:0.3209724:0.2613276:0.2122788:0.1696848:0.1285776:0.0774672:-0.0060432,65:0.792042:0.6151248:0.4885812:0.402066:0.3323136:0.2720028:0.2203524:0.17502:0.1253292:0.0468144,70:0.8803212:0.7122072:0.5862852:0.4951476:0.4165956:0.345852:0.2850708:0.2341704:0.182982:0.1047228,75:0.9824316:0.820656:0.6945072:0.5994168:0.5135268:0.4339248:0.3650892:0.3086364:0.254406:0.1728504,80:1.0924128:0.940554:0.8111784:0.7117992:0.6199728:0.5337864:0.4592268:0.3988608:0.3418404:0.2552148,85:1.230198:1.0701876:0.9318576:0.8264304:0.7297536:0.639852:0.5632212:0.502428:0.445044:0.3538884,90:1.3884588:1.205634:1.04928:0.9341592:0.8331012:0.7428132:0.6690972:0.6133836:0.5605788:0.4682436,95:1.5375996:1.3403916:1.1529288:1.0220796:0.916146:0.829068:0.7645632:0.7215864:0.6811056:0.5942004,100:1.629522:1.4650128:1.2286368:1.0730808:0.9604224:0.8801856:0.8324208:0.7856292:0.7415556:0.646938,105:1.6545912:1.4875512:1.2581976:1.0989:0.9835308:0.9013644:0.85245:0.8045328:0.7593984:0.6625032,110:1.6713048:1.5025776:1.2831864:1.1207244:1.0030632:0.9192648:0.8693796:0.8205108:0.77448:0.6756612
n2_to_n1_table = 0:0:0.2:0.9,16.01173:0:0:17,19.354839:1.62525110132159:1.62525110132159:17.34466,22.8739:2.13848810572687:2.13848810572687:18.127184,50.146628:10.9490607929515:10.9490607929515:26.627184,60:16.2995594713656:16.2995594713656:33.727774,67.741935:22.2402801762115:22.2402801762115:40.08227,73.020528:26.8767286343612:26.8767286343612:43.853613,78.29912:35.0472960352423:35.0472960352423:48.89878,81.642229:43.6251656387665:43.6251656387665:53.556563,85.337243:63.106796:63.106796:63.106796,87.97654:74.757282:74.757282:74.757282,97.8:97.2:97.2:97.2,118:115.346535:115.346535:115.346535
corrected_airflow_table = 0.000000:0.000000:0.100000:0.200000:0.300000:0.400000:0.500000:0.600000:0.700000:0.800000:0.900000,0.000000:0.000000:0.000000:0.000000:0.000000:0.000000:0.000000:0.000000:0.000000:0.000000:0.000000,20.000000:0.000000:0.000000:0.000000:0.000000:0.000000:0.000000:0.000000:0.000000:0.000000:0.000000,25.000000:0.000000:0.000000:0.000000:0.000000:0.000000:0.000000:0.000000:0.000000:0.000000:0.000000,30.000000:0.000000:0.000000:0.000000:0.000000:0.000000:0.000000:0.000000:0.000000:0.000000:0.000000,35.000000:0.000000:0.000000:0.000000:0.000000:0.000000:0.000000:0.000000:0.000000:0.000000:0.000000,40.000000:0.000000:0.000000:0.000000:0.000000:0.000000:0.000000:0.000000:0.000000:0.000000:0.000000,45.000000:0.000000:0.000000:0.000000:0.000000:0.000000:0.000000:0.000000:0.000000:0.000000:0.000000,50.000000:0.000000:0.000000:0.000000:0.000000:0.000000:0.000000:0.000000:0.000000:0.000000:0.000000,55.000000:0.000000:0.000000:0.000000:0.000000:0.000000:0.000000:0.000000:0.000000:0.000000:0.000000,60.000000:0.000000:0.000000:0.000000:0.000000:0.000000:0.000000:0.000000:0.000000:0.000000:0.000000,65.000000:0.000000:0.000000:0.000000:0.000000:0.000000:0.000000:0.000000:0.000000:0.000000:0.000000,70.000000:0.000000:0.000000:0.000000:0.000000:0.000000:0.000000:0.000000:0.000000:0.000000:0.000000,75.000000:0.000000:0.000000:0.000000:0.000000:0.000000:0.000000:0.000000:0.000000:0.000000:0.000000,80.000000:0.000000:0.000000:0.000000:0.000000:0.000000:0.000000:0.000000:0.000000:0.000000:0.000000,85.000000:0.000000:0.000000:0.000000:0.000000:0.000000:0.000000:0.000000:0.000000:0.000000:0.000000,90.000000:0.000000:0.000000:0.000000:0.000000:0.000000:0.000000:0.000000:0.000000:0.000000:0.000000,95.000000:0.000000:0.000000:0.000000:0.000000:0.000000:0.000000:0.000000:0.000000:0.000000:0.000000,100.000000:0.000000:0.000000:0.000000:0.000000:0.000000:0.000000:0.000000:0.000000:0.000000:0.000000,105.000000:0.000000:0.000000:0.000000:0.000000:0.000000:0.000000:0.000000:0.000000:0.000000:0.000000,110.000000:0.000000:0.000000:0.000000:0.000000:0.000000:0.000000:0.000000:0.000000:0.000000:0.000000
epr_max = 1.4
epr_tc = 14
Expand Down Expand Up @@ -91,16 +91,16 @@ n1_normal_tc = 0.5 ; Float factor changing N1 acceleration during normal use of
n1_start_max_rate = 1.0 ; Float limiting N1 acceleration during starter use
n1_start_combustion_max_rate = 2.0 ; Float limiting N1 acceleration during startup when cumbustion has started
idle_fuel_flow = 1366 ; pound per hour
low_idle_n1 = 18.5
low_idle_n1 = 15.0
low_idle_n2 = 60.0
high_n1 = 100
high_n2 = 100
high_fuel_flow = 50000
min_n2_for_fuel_flow = 22
mach_influence_on_n1 = 10
fuel_flow_max = 50000
fuel_flow_controller_p = 2.5
fuel_flow_controller_i = 0.0075
fuel_flow_controller_p = 3.7
fuel_flow_controller_i = 0.01
fuel_flow_controller_d = 0
fuel_flow_controller_iboundary = 1
fuel_flow_controller_dboundary = 100
Expand Down
24 changes: 12 additions & 12 deletions fbw-a380x/src/wasm/fadec_a380x/src/Fadec/FadecSimData_A380X.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class FadecSimData_A380X {
char atcID[32];
};
DataDefinitionVector atcIdDataDef = {
// MSFS docs say this is max 10 chars - we use 32 for safety
// MSFS docs say this is max 10 chars - we use 32 for safety
{"ATC ID", 0, UNITS.None, SIMCONNECT_DATATYPE_STRING32} //
};
/**
Expand Down Expand Up @@ -136,17 +136,17 @@ class FadecSimData_A380X {

// SimVars Data in one Data Definition as they are read together and never updated
struct SimVarsData {
FLOAT64 animationDeltaTime; // in Seconds
FLOAT64 airSpeedMach; // in Mach
FLOAT64 ambientPressure; // in Millibars
FLOAT64 ambientTemperature; // in Celsius
FLOAT64 pressureAltitude; // in Feet
FLOAT64 fuelWeightLbsPerGallon; // in Pounds
FLOAT64 engineAntiIce[4]; // 0 or 1
FLOAT64 engineIgniter[4]; // 0 or 1
FLOAT64 engineStarter[4]; // 0 or 1
FLOAT64 simEngineN1[4]; // in Percent
FLOAT64 simEngineN2[4]; // in Percent
FLOAT64 animationDeltaTime; // in Seconds
FLOAT64 airSpeedMach; // in Mach
FLOAT64 ambientPressure; // in Millibars
FLOAT64 ambientTemperature; // in Celsius
FLOAT64 pressureAltitude; // in Feet
FLOAT64 fuelWeightLbsPerGallon; // in Pounds
FLOAT64 engineAntiIce[4]; // 0 or 1
FLOAT64 engineIgniter[4]; // 0 or 1
FLOAT64 engineStarter[4]; // 0 or 1
FLOAT64 simEngineN1[4]; // in Percent
FLOAT64 simEngineN2[4]; // in Percent
};
DataDefinitionVector simVarsDataDef = {
{"ANIMATION DELTA TIME", 0, UNITS.Seconds }, //
Expand Down
28 changes: 14 additions & 14 deletions fbw-a380x/src/wasm/fadec_a380x/src/Fadec/Table1502_A380X.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,19 @@ class Table1502_A380X {
* @return A 2D array representing the CN2 - correctedN1 pairs.
*/
static constexpr double table1502[13][4] = {
{16.012, 0.000, 0.000, 17.000 }, // CN3 = 18.20, correctedN1 = [0.00, 0.00] at Mach 0.2, correctedN1 = 17.00 at Mach 0.9
{19.355, 1.845, 1.845, 17.345 }, // CN3 = 22.00, correctedN1 = [1.90, 1.90] at Mach 0.2, correctedN1 = 17.40 at Mach 0.9
{22.874, 2.427, 2.427, 18.127 }, // CN3 = 26.00, correctedN1 = [2.50, 2.50] at Mach 0.2, correctedN1 = 18.20 at Mach 0.9
{50.147, 12.427, 12.427, 26.627 }, // CN3 = 57.00, correctedN1 = [12.80, 12.80] at Mach 0.2, correctedN1 = 27.00 at Mach 0.9
{60.000, 18.500, 18.500, 33.728 }, // CN3 = 68.20, correctedN1 = [19.60, 19.60] at Mach 0.2, correctedN1 = 34.83 at Mach 0.9
{67.742, 25.243, 25.243, 40.082 }, // CN3 = 77.00, correctedN1 = [26.00, 26.00] at Mach 0.2, correctedN1 = 40.84 at Mach 0.9
{73.021, 30.505, 30.505, 43.854 }, // CN3 = 83.00, correctedN1 = [31.42, 31.42] at Mach 0.2, correctedN1 = 44.77 at Mach 0.9
{78.299, 39.779, 39.779, 48.899 }, // CN3 = 89.00, correctedN1 = [40.97, 40.97] at Mach 0.2, correctedN1 = 50.09 at Mach 0.9
{81.642, 49.515, 49.515, 53.557 }, // CN3 = 92.80, correctedN1 = [51.00, 51.00] at Mach 0.2, correctedN1 = 55.04 at Mach 0.9
{85.337, 63.107, 63.107, 63.107 }, // CN3 = 97.00, correctedN1 = [65.00, 65.00] at Mach 0.2, correctedN1 = 65.00 at Mach 0.9
{87.977, 74.757, 74.757, 74.757 }, // CN3 = 100.00, correctedN1 = [77.00, 77.00] at Mach 0.2, correctedN1 = 77.00 at Mach 0.9
{97.800, 97.200, 97.200, 97.200 }, // CN3 = 104.00, correctedN1 = [85.00, 85.00] at Mach 0.2, correctedN1 = 85.50 at Mach 0.9
{118.000, 115.347, 115.347, 115.347} // CN3 = 116.50, correctedN1 = [101.00, 101.00] at Mach 0.2, correctedN1 = 101.00 at Mach 0.9
{16.012, 0.000, 0.000, 17.000 }, // CN3 = 16.012, correctedN1 = [0.00, 0.00] at Mach 0.2, correctedN1 = 17.00 at Mach 0.9
{19.355, 1.6253, 1.6253, 17.345 },
{22.874, 2.1385, 2.1385, 18.127 },
{50.147, 10.949, 10.949, 26.627 },
{60.000, 16.299, 16.299, 33.728 },
{67.742, 22.240, 22.240, 40.082 },
{73.021, 26.877, 26.877, 43.854 },
{78.299, 35.047, 35.047, 48.899 },
{81.642, 43.625, 43.625, 53.557 },
{85.337, 63.107, 63.107, 63.107 },
{87.977, 74.757, 74.757, 74.757 },
{97.800, 97.200, 97.200, 97.200 },
{118.000, 115.347, 115.347, 115.347}
};

public:
Expand All @@ -56,7 +56,7 @@ class Table1502_A380X {
static double iCN3(double pressureAltitude, double mach) {
// The specific values are likely derived from empirical data or a mathematical model of the engine's behavior.
// The original source code does not provide any information on the origin of these values.
return 68.2 / ((std::sqrt)((288.15 - (1.98 * pressureAltitude / 1000)) / 288.15) * (std::sqrt)(1 + (0.2 * (std::pow)(mach, 2))));
return 63 / ((std::sqrt)((288.15 - (1.98 * pressureAltitude / 1000)) / 288.15) * (std::sqrt)(1 + (0.2 * (std::pow)(mach, 2))));
}

/**
Expand Down

0 comments on commit e813a14

Please sign in to comment.