A32X: Improve lift table, and add Alpha Floor function

This commit is contained in:
Joshua Davidson 2017-12-27 14:34:50 -05:00
parent a48b22d025
commit 876d7caa83
4 changed files with 65 additions and 41 deletions

View file

@ -209,7 +209,8 @@ var canvas_PFD_base = {
wow2 = getprop("/gear/gear[2]/wow"); wow2 = getprop("/gear/gear[2]/wow");
# FMA MAN TOGA MCT FLX THR # FMA MAN TOGA MCT FLX THR
if (athr == 1 and (state1 == "TOGA" or state1 == "MCT" or state1 == "MAN THR" or state2 == "TOGA" or state2 == "MCT" or state2 == "MAN THR") and getprop("/systems/thrust/eng-out") != 1) { if (athr == 1 and (state1 == "TOGA" or state1 == "MCT" or state1 == "MAN THR" or state2 == "TOGA" or state2 == "MCT" or state2 == "MAN THR") and getprop("/systems/thrust/eng-out") != 1 and getprop("/systems/thrust/alpha-floor") != 1 and
getprop("/systems/thrust/toga-lk") != 1) {
me["FMA_man"].show(); me["FMA_man"].show();
me["FMA_manmode"].show(); me["FMA_manmode"].show();
if (state1 == "TOGA" or state2 == "TOGA") { if (state1 == "TOGA" or state2 == "TOGA") {
@ -245,7 +246,7 @@ var canvas_PFD_base = {
me["FMA_man_box"].setColor(0.7333,0.3803,0); me["FMA_man_box"].setColor(0.7333,0.3803,0);
} }
} else if (athr == 1 and (state1 == "TOGA" or (state1 == "MCT" and getprop("/controls/engines/thrust-limit") == "FLX") or (state1 == "MAN THR" and thr1 >= 0.83) or state2 == "TOGA" or (state2 == "MCT" and } else if (athr == 1 and (state1 == "TOGA" or (state1 == "MCT" and getprop("/controls/engines/thrust-limit") == "FLX") or (state1 == "MAN THR" and thr1 >= 0.83) or state2 == "TOGA" or (state2 == "MCT" and
getprop("/controls/engines/thrust-limit") == "FLX") or (state2 == "MAN THR" and thr2 >= 0.83)) and getprop("/systems/thrust/eng-out") == 1) { getprop("/controls/engines/thrust-limit") == "FLX") or (state2 == "MAN THR" and thr2 >= 0.83)) and getprop("/systems/thrust/eng-out") == 1 and getprop("/systems/thrust/alpha-floor") != 1 and getprop("/systems/thrust/toga-lk") != 1) {
me["FMA_man"].show(); me["FMA_man"].show();
me["FMA_manmode"].show(); me["FMA_manmode"].show();
if (state1 == "TOGA" or state2 == "TOGA") { if (state1 == "TOGA" or state2 == "TOGA") {
@ -293,27 +294,41 @@ var canvas_PFD_base = {
} }
# FMA A/THR # FMA A/THR
if (athr == 1 and getprop("/systems/thrust/eng-out") != 1 and (state1 == "MAN" or state1 == "CL") and (state2 == "MAN" or state2 == "CL")) { if (getprop("/systems/thrust/alpha-floor") != 1 and getprop("/systems/thrust/toga-lk") != 1) {
me["FMA_thrust"].show(); if (athr == 1 and getprop("/systems/thrust/eng-out") != 1 and (state1 == "MAN" or state1 == "CL") and (state2 == "MAN" or state2 == "CL")) {
if (getprop("/modes/pfd/fma/throttle-mode-box") == 1 and throttle_mode != " ") { me["FMA_thrust"].show();
me["FMA_thrust_box"].show(); if (getprop("/modes/pfd/fma/throttle-mode-box") == 1 and throttle_mode != " ") {
} else { me["FMA_thrust_box"].show();
me["FMA_thrust_box"].hide(); } else {
} me["FMA_thrust_box"].hide();
} else if (athr == 1 and getprop("/systems/thrust/eng-out") == 1 and (state1 == "MAN" or state1 == "CL" or (state1 == "MAN THR" and thr1 < 0.83) or (state1 == "MCT" and getprop("/controls/engines/thrust-limit") != "FLX")) and }
(state2 == "MAN" or state2 == "CL" or (state2 == "MAN THR" and thr2 < 0.83) or (state2 == "MCT" and getprop("/controls/engines/thrust-limit") != "FLX"))) { } else if (athr == 1 and getprop("/systems/thrust/eng-out") == 1 and (state1 == "MAN" or state1 == "CL" or (state1 == "MAN THR" and thr1 < 0.83) or (state1 == "MCT" and getprop("/controls/engines/thrust-limit") != "FLX")) and
me["FMA_thrust"].show(); (state2 == "MAN" or state2 == "CL" or (state2 == "MAN THR" and thr2 < 0.83) or (state2 == "MCT" and getprop("/controls/engines/thrust-limit") != "FLX"))) {
if (getprop("/modes/pfd/fma/throttle-mode-box") == 1 and throttle_mode != " ") { me["FMA_thrust"].show();
me["FMA_thrust_box"].show(); if (getprop("/modes/pfd/fma/throttle-mode-box") == 1 and throttle_mode != " ") {
me["FMA_thrust_box"].show();
} else {
me["FMA_thrust_box"].hide();
}
} else { } else {
me["FMA_thrust"].hide();
me["FMA_thrust_box"].hide(); me["FMA_thrust_box"].hide();
} }
} else { } else {
me["FMA_thrust"].hide(); me["FMA_thrust"].show();
me["FMA_thrust_box"].hide(); me["FMA_thrust_box"].show();
} }
me["FMA_thrust"].setText(sprintf("%s", throttle_mode)); if (getprop("/systems/thrust/alpha-floor") == 1) {
me["FMA_thrust"].setText("A.FLOOR");
me["FMA_thrust_box"].setColor(0.7333,0.3803,0);
} else if (getprop("/systems/thrust/toga-lk") == 1) {
me["FMA_thrust"].setText("TOGA LK");
me["FMA_thrust_box"].setColor(0.7333,0.3803,0);
} else {
me["FMA_thrust"].setText(sprintf("%s", throttle_mode));
me["FMA_thrust_box"].setColor(0.8078,0.8039,0.8078);
}
# FMA Pitch Roll Common # FMA Pitch Roll Common
me["FMA_combined"].setText(sprintf("%s", pitch_mode)); me["FMA_combined"].setText(sprintf("%s", pitch_mode));

View file

@ -11,7 +11,6 @@
setprop("/FMGC/internal/maxspeed", 0); setprop("/FMGC/internal/maxspeed", 0);
setprop("/FMGC/internal/minspeed", 0); setprop("/FMGC/internal/minspeed", 0);
setprop("/FMGC/internal/alpha-prot-speed", 0);
setprop("/position/gear-agl-ft", 0); setprop("/position/gear-agl-ft", 0);
setprop("/FMGC/internal/mng-spd", 157); setprop("/FMGC/internal/mng-spd", 157);
setprop("/FMGC/internal/mng-spd-cmd", 157); setprop("/FMGC/internal/mng-spd-cmd", 157);

View file

@ -45,9 +45,10 @@ setlistener("/sim/signals/fdm-initialized", func {
var n1mct = getprop("/systems/thrust/n1/mct-lim"); var n1mct = getprop("/systems/thrust/n1/mct-lim");
var n1flx = getprop("/systems/thrust/n1/flx-lim"); var n1flx = getprop("/systems/thrust/n1/flx-lim");
var n1clb = getprop("/systems/thrust/n1/clb-lim"); var n1clb = getprop("/systems/thrust/n1/clb-lim");
var ias = getprop("/velocities/airspeed-kt"); var alpha = getprop("/fdm/jsbsim/aero/alpha-deg");
var flaps = getprop("/controls/flight/flap-pos"); var flaps = getprop("/controls/flight/flap-pos");
var alphaProtSpd = getprop("/FMGC/internal/alpha-prot-speed"); var alphaProt = 0;
var togaLock = 0;
var gs = getprop("/velocities/groundspeed-kt"); var gs = getprop("/velocities/groundspeed-kt");
thrust_lim.start(); thrust_lim.start();
thrustt.start(); thrustt.start();
@ -296,24 +297,33 @@ var thrust_loop = func {
} }
} }
# ias = getprop("/instrumentation/airspeed-indicator/indicated-speed-kt"); alpha = getprop("/fdm/jsbsim/aero/alpha-deg");
# flaps = getprop("/controls/flight/flap-pos"); flaps = getprop("/controls/flight/flap-pos");
# alphaProtSpd = getprop("/FMGC/internal/alpha-prot-speed"); if (flaps == 0) {
# togaLockSpd = alphaProtSpd + 3; alphaProt = 9.5;
# if (getprop("/gear/gear[1]/wow") == 0 and getprop("/gear/gear[2]/wow") == 0 and getprop("/it-fbw/law") == 0) { } else if (flaps == 1 or flaps == 2 or flaps == 3) {
# if (ias < alphaProtSpd) { alphaProt = 15.0;
# setprop("/systems/thrust/alpha-floor", 1); } else if (flaps == 4) {
# setprop("/systems/thrust/toga-lk", 0); alphaProt = 14.0;
# setprop("/it-autoflight/input/athr", 1); } else if (flaps == 5) {
# } else if (getprop("/systems/thrust/alpha-floor") == 1 and ias > togaLockSpd) { alphaProt = 13.0;
# setprop("/systems/thrust/alpha-floor", 0); }
# setprop("/it-autoflight/input/athr", 1); togaLock = alphaProt - 1;
# setprop("/systems/thrust/toga-lk", 1); if (getprop("/gear/gear[1]/wow") == 0 and getprop("/gear/gear[2]/wow") == 0 and getprop("/it-fbw/law") == 0 and (getprop("/systems/thrust/eng-out") == 0 or (getprop("/systems/thrust/eng-out") == 1 and flaps == 0)) and getprop("/systems/fadec/n1mode1") == 0
# } and getprop("/systems/fadec/n1mode2") == 0) {
# } else { if (alpha > alphaProt and getprop("/position/gear-agl-ft") >= 100) {
# setprop("/systems/thrust/alpha-floor", 0); setprop("/systems/thrust/alpha-floor", 1);
# setprop("/systems/thrust/toga-lk", 0); setprop("/systems/thrust/toga-lk", 0);
# } setprop("/it-autoflight/input/athr", 1);
} else if (getprop("/systems/thrust/alpha-floor") == 1 and alpha < togaLock) {
setprop("/systems/thrust/alpha-floor", 0);
setprop("/it-autoflight/input/athr", 1);
setprop("/systems/thrust/toga-lk", 1);
}
} else {
setprop("/systems/thrust/alpha-floor", 0);
setprop("/systems/thrust/toga-lk", 0);
}
} }
# Timers # Timers

View file

@ -28,9 +28,9 @@
-0.64 -1.0312 -0.64 -1.0312
-0.25 -0.9379 -0.25 -0.9379
0.00 0.1494 0.00 0.1494
0.20 1.6072 0.25 1.6072
0.60 1.4305 0.60 1.0305
0.88 0.8415 0.88 0.6415
1.05 0.2294 1.05 0.2294
1.22 0.0544 1.22 0.0544
1.57 0.0000 1.57 0.0000