From 3181d071692f17170b0e336398878ebf8ab66f8e Mon Sep 17 00:00:00 2001 From: Joshua Davidson Date: Sat, 11 Nov 2017 21:36:40 -0500 Subject: [PATCH] A32X: Fix elevator trim behavior on touchdown, fix autoland rollout elevator --- Nasal/FMGC.nas | 12 ++++------ Nasal/brakes.nas | 6 ++--- Systems/it-fbw.xml | 57 +++++++++++++++++++++++++++++----------------- revision.txt | 2 +- 4 files changed, 45 insertions(+), 32 deletions(-) diff --git a/Nasal/FMGC.nas b/Nasal/FMGC.nas index edbe105c..41384af6 100644 --- a/Nasal/FMGC.nas +++ b/Nasal/FMGC.nas @@ -32,8 +32,7 @@ setlistener("/sim/signals/fdm-initialized", func { var database2 = getprop("/FMGC/internal/navdatabase2"); var code1 = getprop("/FMGC/internal/navdatabasecode"); var code2 = getprop("/FMGC/internal/navdatabasecode2"); - var gear1 = getprop("/gear/gear[1]/wow"); - var gear2 = getprop("/gear/gear[2]/wow"); + var gear0 = getprop("/gear/gear[0]/wow"); var state1 = getprop("/systems/thrust/state1"); var state2 = getprop("/systems/thrust/state2"); var flaps = getprop("/controls/flight/flap-pos"); @@ -149,19 +148,18 @@ setlistener("/gear/gear[2]/wow", func { }); var flarecheck = func { - gear1 = getprop("/gear/gear[1]/wow"); - gear2 = getprop("/gear/gear[2]/wow"); + gear0 = getprop("/gear/gear[0]/wow"); state1 = getprop("/systems/thrust/state1"); state2 = getprop("/systems/thrust/state2"); flaps = getprop("/controls/flight/flap-pos"); - if (gear1 == 1 and gear2 == 1 and (state1 == "MCT" or state1 == "MAN THR" or state1 == "TOGA") and (state2 == "MCT" or state2 == "MAN THR" or state2 == "TOGA") and flaps < 4) { + if (gear0 == 1 and (state1 == "MCT" or state1 == "MAN THR" or state1 == "TOGA") and (state2 == "MCT" or state2 == "MAN THR" or state2 == "TOGA") and flaps < 5) { setprop("/FMGC/status/to-state", 1); } if (getprop("/position/gear-agl-ft") >= 55) { setprop("/FMGC/status/to-state", 0); } - if (gear1 == 1 and gear2 == 1 and getprop("/FMGC/status/to-state") == 0 and flaps >= 4) { - setprop("/controls/flight/elevator-trim", 0.0); + if (gear0 == 1 and getprop("/FMGC/status/to-state") == 0 and (flaps >= 5 or (flaps >= 4 and getprop("/instrumentation/mk-viii/inputs/discretes/momentary-flap3-override") == 1))) { + interpolate("/controls/flight/elevator-trim", 0.0, 1.5); } } diff --git a/Nasal/brakes.nas b/Nasal/brakes.nas index 3fc2e47c..6a875570 100644 --- a/Nasal/brakes.nas +++ b/Nasal/brakes.nas @@ -13,6 +13,7 @@ setlistener("/sim/signals/fdm-initialized", func { var rev2 = 0; var thr1 = 0; var thr2 = 0; + var wow0 = getprop("/gear/gear[0]/wow"); var wow1 = getprop("/gear/gear[1]/wow"); var wow2 = getprop("/gear/gear[2]/wow"); var gnd_speed = getprop("/velocities/groundspeed-kt"); @@ -70,11 +71,10 @@ var absChk = maketimer(0.2, func { rev2 = getprop("/engines/engine[1]/reverser-pos-norm"); thr1 = getprop("/controls/engines/engine[0]/throttle"); thr2 = getprop("/controls/engines/engine[1]/throttle"); - wow1 = getprop("/gear/gear[1]/wow"); - wow2 = getprop("/gear/gear[2]/wow"); + wow0 = getprop("/gear/gear[0]/wow"); gnd_speed = getprop("/velocities/groundspeed-kt"); if (gnd_speed > 60 and rev1 < 0.01 and rev2 < 0.01) { - if (getprop("/controls/autobrake/mode") != 0 and thr1 < 0.15 and thr2 < 0.15 and wow1 and wow2) { + if (getprop("/controls/autobrake/mode") != 0 and thr1 < 0.15 and thr2 < 0.15 and wow0) { setprop("/controls/autobrake/active", 1); if (getprop("/controls/autobrake/mode") == 1) { # LO interpolate("/controls/gear/brake-left", 0.4, 0.5); diff --git a/Systems/it-fbw.xml b/Systems/it-fbw.xml index d8367f4e..346ac472 100644 --- a/Systems/it-fbw.xml +++ b/Systems/it-fbw.xml @@ -299,7 +299,7 @@ - 0.05 + 0.0 @@ -1087,26 +1087,14 @@ - - - /it-autoflight/output/ap1 - 1 - - - /it-autoflight/output/ap2 - 1 - - - - /gear/gear[1]/wow - 0 - - - /gear/gear[2]/wow - 0 - - - + + /gear/gear[1]/wow + 0 + + + /gear/gear[2]/wow + 0 + /it-fbw/law @@ -1150,6 +1138,33 @@ /controls/flight/elevator-input-fast + + + + + + /it-autoflight/output/ap1 + 1 + + + /it-autoflight/output/ap2 + 1 + + + + + /gear/gear[1]/wow + 1 + + + /gear/gear[2]/wow + 1 + + + + + 0.1 + diff --git a/revision.txt b/revision.txt index 30f56d0f..35365ccc 100644 --- a/revision.txt +++ b/revision.txt @@ -1 +1 @@ -3057 \ No newline at end of file +3058 \ No newline at end of file