From 312867ac60cb72b38042d0fdf5d564304d3d87dd Mon Sep 17 00:00:00 2001 From: Joshua Davidson Date: Sun, 8 Oct 2017 15:56:15 -0400 Subject: [PATCH] A3XX: Add Rollout mode to FMGC AP --- Nasal/FMGC-b.nas | 15 +- Nasal/PFD_FMA.nas | 12 +- Systems/autopilot-dlg.xml | 50 ++++-- Systems/fmgc-pitch.xml | 18 +- Systems/it-fbw.xml | 351 +++++++++++++++++--------------------- revision.txt | 2 +- 6 files changed, 221 insertions(+), 227 deletions(-) diff --git a/Nasal/FMGC-b.nas b/Nasal/FMGC-b.nas index 3b2e8a5b..28d23453 100644 --- a/Nasal/FMGC-b.nas +++ b/Nasal/FMGC-b.nas @@ -20,6 +20,8 @@ setlistener("/sim/signals/fdm-initialized", func { var VS = getprop("/velocities/vertical-speed-fps"); var TAS = getprop("/velocities/uBody-fps"); var FPangle = 0; + var gear1 = getprop("/gear/gear[1]/wow"); + var gear2 = getprop("/gear/gear[2]/wow"); }); var APinit = func { @@ -461,7 +463,7 @@ var ap_various = func { } if (getprop("/it-autoflight/output/ap1") == 1 or getprop("/it-autoflight/output/ap2") == 1) { - if (getprop("/controls/flight/aileron") > 0.4 or getprop("/controls/flight/aileron") < -0.4 or getprop("/controls/flight/elevator") > 0.4 or getprop("/controls/flight/elevator") < -0.4) { + if (getprop("/controls/flight/aileron") > 0.3 or getprop("/controls/flight/aileron") < -0.3 or getprop("/controls/flight/elevator") > 0.3 or getprop("/controls/flight/elevator") < -0.3) { setprop("/it-autoflight/input/ap1", 0); setprop("/it-autoflight/input/ap2", 0); } @@ -782,18 +784,15 @@ var aland1 = func { setprop("/it-autoflight/output/thr-mode", 1); setprop("/it-autoflight/mode/thr", "RETARD"); } - var gear1 = getprop("/gear/gear[1]/wow"); - var gear2 = getprop("/gear/gear[2]/wow"); + gear1 = getprop("/gear/gear[1]/wow"); + gear2 = getprop("/gear/gear[2]/wow"); if (gear1 == 1 or gear2 == 1) { - setprop("/it-autoflight/input/ap1", 0); - setprop("/it-autoflight/input/ap2", 0); alandt1.stop(); + setprop("/it-autoflight/mode/lat", "RLOU"); + setprop("/it-autoflight/mode/vert", "ROLLOUT"); } } -# Autoland Stage 2 Logic (Rollout) -# Not yet working, planned. - # Managed Climb/Descent var mng_main = func { if (getprop("/autopilot/route-manager/route/num") > 0 and getprop("/autopilot/route-manager/active") == 1) { diff --git a/Nasal/PFD_FMA.nas b/Nasal/PFD_FMA.nas index 9d1490b2..6d2d0e4b 100644 --- a/Nasal/PFD_FMA.nas +++ b/Nasal/PFD_FMA.nas @@ -143,8 +143,12 @@ setlistener("/it-autoflight/mode/lat", func { locupdate.start(); } } else if (lat == "ALGN") { - if (newlat != "LAND") { - setprop("/modes/pfd/fma/roll-mode", "LAND"); + if (newlat != " ") { + setprop("/modes/pfd/fma/roll-mode", " "); + } + } else if (lat == "RLOU") { + if (newlat != " ") { + setprop("/modes/pfd/fma/roll-mode", " "); } } }); @@ -228,6 +232,10 @@ setlistener("/it-autoflight/mode/vert", func { if (newvert != "FLARE") { setprop("/modes/pfd/fma/pitch-mode", "FLARE"); } + } else if (vert == "ROLLOUT") { + if (newvert != "ROLLOUT") { + setprop("/modes/pfd/fma/pitch-mode", "ROLLOUT"); + } } else if (vert == "T/O CLB") { if (newvertarm != "CLB") { setprop("/modes/pfd/fma/pitch-mode2-armed", "CLB"); diff --git a/Systems/autopilot-dlg.xml b/Systems/autopilot-dlg.xml index 189ad480..45edbe2b 100644 --- a/Systems/autopilot-dlg.xml +++ b/Systems/autopilot-dlg.xml @@ -102,24 +102,38 @@ 1 - - - /it-autoflight/output/fd1 - 1 - - - /it-autoflight/output/fd2 - 1 - - - /it-autoflight/output/ap1 - 1 - - - /it-autoflight/output/ap2 - 1 - - + + + + /it-autoflight/output/fd1 + 1 + + + /it-autoflight/output/fd2 + 1 + + + /it-autoflight/output/ap1 + 1 + + + /it-autoflight/output/ap2 + 1 + + + + modes/pfd/fma/pitch-mode + LAND + + + modes/pfd/fma/pitch-mode + FLARE + + + modes/pfd/fma/pitch-mode + ROLLOUT + + center /modes/pfd/fma/roll-mode diff --git a/Systems/fmgc-pitch.xml b/Systems/fmgc-pitch.xml index 9434ad48..c1783c26 100644 --- a/Systems/fmgc-pitch.xml +++ b/Systems/fmgc-pitch.xml @@ -407,10 +407,20 @@ /it-autoflight/output/vert 5 - - /it-autoflight/output/vert - 6 - + + + /it-autoflight/output/vert + 6 + + + /gear/gear[1]/wow + 0 + + + /gear/gear[2]/wow + 0 + + /it-autoflight/output/vert 7 diff --git a/Systems/it-fbw.xml b/Systems/it-fbw.xml index c670cd19..2af2000b 100644 --- a/Systems/it-fbw.xml +++ b/Systems/it-fbw.xml @@ -27,6 +27,21 @@ + + + + + /it-autoflight/output/ap1 + 1 + + + /it-autoflight/output/ap2 + 1 + + + + 0 + /controls/flight/aileron /controls/flight/aileron-input-fast 5 @@ -43,6 +58,21 @@ + + + + + /it-autoflight/output/ap1 + 1 + + + /it-autoflight/output/ap2 + 1 + + + + 0 + /controls/flight/elevator /controls/flight/elevator-input-fast 5 @@ -221,19 +251,56 @@ - + + + + /it-autoflight/output/ap1 + 1 + + + /it-autoflight/output/ap2 + 1 + + - /it-autoflight/output/ap1 - 1 + /gear/gear[1]/wow + 0 - /it-autoflight/output/ap2 - 1 + /gear/gear[2]/wow + 0 - + /it-autoflight/internal/elevator-cmd + + + + + + /it-autoflight/output/ap1 + 1 + + + /it-autoflight/output/ap2 + 1 + + + + + /gear/gear[1]/wow + 1 + + + /gear/gear[2]/wow + 1 + + + + + 0.05 + @@ -441,14 +508,26 @@ - - /gear/gear[1]/wow - 0 - - - /gear/gear[2]/wow - 0 - + + + /it-autoflight/output/ap1 + 1 + + + /it-autoflight/output/ap2 + 1 + + + + /gear/gear[1]/wow + 0 + + + /gear/gear[2]/wow + 0 + + + /it-fbw/law 0 @@ -459,24 +538,34 @@ - + - /gear/gear[1]/wow - 1 + /it-autoflight/output/ap1 + 0 - /gear/gear[2]/wow - 1 + /it-autoflight/output/ap2 + 0 - - /it-fbw/law - 1 - - - /it-fbw/law - 2 - - + + + /gear/gear[1]/wow + 1 + + + /gear/gear[2]/wow + 1 + + + /it-fbw/law + 1 + + + /it-fbw/law + 2 + + + /controls/flight/aileron-input-fast @@ -918,154 +1007,6 @@ - - IT-FBW: SPD PITCH TARGET CMD - noise-spike - - - - - /gear/gear[1]/wow - 0 - - - /gear/gear[2]/wow - 0 - - - /it-fbw/spd-hold - 1 - - - - /it-fbw/law - 0 - - - /it-fbw/law - 1 - - - - - - - -
- /controls/flight/elevator-input - 0129 - -1106 -
-
- - /it-fbw/spd-pitch-target - 10 - - - - IT-FBW: SPD PITCH TARGET - false - - - - - /gear/gear[1]/wow - 0 - - - /gear/gear[2]/wow - 0 - - - /it-fbw/spd-hold - 1 - - - - /it-fbw/law - 0 - - - /it-fbw/law - 1 - - - - - - - /it-autoflight/internal/lookahead-10-sec-airspeed-kt - - - /it-fbw/spd-pitch-target - - - /it-fbw/spd-pitch-deg - - - -0.50 - 1.0 - 0.1 - 0.0 - 5.0 - 0.0001 - -10 - 30 - - - - - IT-FBW: SPD PITCH - false - - - - - /gear/gear[1]/wow - 0 - - - /gear/gear[2]/wow - 0 - - - /it-fbw/spd-hold - 1 - - - - /it-fbw/law - 0 - - - /it-fbw/law - 1 - - - - - - - /orientation/pitch-deg - - - /it-fbw/spd-pitch-deg - - - /controls/flight/elevator-fbw-cmd - - - -0.08 - 1 - 0.1 - 0 - 5 - 0.001 - -1 - 1 - - - IT-FBW: PITCH OPTION false @@ -1076,14 +1017,26 @@ - - /gear/gear[1]/wow - 0 - - - /gear/gear[2]/wow - 0 - + + + /it-autoflight/output/ap1 + 1 + + + /it-autoflight/output/ap2 + 1 + + + + /gear/gear[1]/wow + 0 + + + /gear/gear[2]/wow + 0 + + + /it-fbw/law @@ -1100,20 +1053,30 @@ - + - /gear/gear[1]/wow - 1 + /it-autoflight/output/ap1 + 0 - /gear/gear[2]/wow - 1 + /it-autoflight/output/ap2 + 0 - - /it-fbw/law - 2 - - + + + /gear/gear[1]/wow + 1 + + + /gear/gear[2]/wow + 1 + + + /it-fbw/law + 2 + + + /controls/flight/elevator-input-fast diff --git a/revision.txt b/revision.txt index 678482bc..6adc804a 100644 --- a/revision.txt +++ b/revision.txt @@ -1 +1 @@ -2111 \ No newline at end of file +2112 \ No newline at end of file