From 31423c830c8b670c0435546dd995267a5f0fe390 Mon Sep 17 00:00:00 2001 From: Joshua Davidson Date: Fri, 17 Nov 2017 23:17:34 -0500 Subject: [PATCH] A3XX: Add better NAV system and very basic predictive turning --- Nasal/FMGC-b.nas | 5 ++- Systems/fmgc-drivers.xml | 79 ++++++++++++++++++++++++++++++---------- revision.txt | 2 +- 3 files changed, 64 insertions(+), 22 deletions(-) diff --git a/Nasal/FMGC-b.nas b/Nasal/FMGC-b.nas index 762dfc26..68e49782 100644 --- a/Nasal/FMGC-b.nas +++ b/Nasal/FMGC-b.nas @@ -14,6 +14,7 @@ setprop("/it-autoflight/internal/track-deg", 0); setprop("/it-autoflight/internal/vert-speed-fpm", 0); setprop("/it-autoflight/internal/heading-5-sec-ahead", 0); setprop("/it-autoflight/internal/altitude-5-sec-ahead", 0); +setprop("/it-autoflight/internal/lnav-advance-nm", 1); setlistener("/sim/signals/fdm-initialized", func { var trueSpeedKts = getprop("/instrumentation/airspeed-indicator/true-speed-kt"); @@ -535,7 +536,7 @@ var ap_various = func { } if (getprop("/autopilot/route-manager/route/num") > 0 and getprop("/autopilot/route-manager/active") == 1) { - if (getprop("/autopilot/route-manager/wp/dist") <= 1.0) { + if (getprop("/autopilot/route-manager/wp/dist") <= getprop("/it-autoflight/internal/lnav-advance-nm")) { if ((getprop("/autopilot/route-manager/current-wp") + 1) < getprop("/autopilot/route-manager/route/num")) { setprop("/autopilot/route-manager/current-wp", getprop("/autopilot/route-manager/current-wp") + 1); } @@ -543,7 +544,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.3 or getprop("/controls/flight/aileron") < -0.3 or getprop("/controls/flight/elevator") > 0.3 or getprop("/controls/flight/elevator") < -0.3) { + if (getprop("/controls/flight/aileron") > 0.3 or getprop("/controls/flight/aileron") < -0.2 or getprop("/controls/flight/elevator") > 0.3 or getprop("/controls/flight/elevator") < -0.2) { setprop("/it-autoflight/input/ap1", 0); setprop("/it-autoflight/input/ap2", 0); } diff --git a/Systems/fmgc-drivers.xml b/Systems/fmgc-drivers.xml index d0caa9eb..65c1f0af 100644 --- a/Systems/fmgc-drivers.xml +++ b/Systems/fmgc-drivers.xml @@ -110,7 +110,7 @@ AUTOLAND FD FPM gain - 1 + 1.0 0.05 @@ -128,7 +128,7 @@ AUTOLAND FPM gain - 1 + 1.0 0.05 @@ -150,7 +150,7 @@ FMGC MNG SPD gain - 1 + 1.0 0.05 @@ -170,7 +170,7 @@ FMGC MNG MACH gain - 1 + 1.0 0.05 @@ -194,7 +194,7 @@ FMGC Target IAS PFD gain - 1 + 1.0 0.1 @@ -355,7 +355,7 @@ IAS SYNC gain - 1 + 1.0 @@ -372,7 +372,7 @@ MACH SYNC gain - 1 + 1.0 @@ -437,11 +437,42 @@ /it-autoflight/internal/track-deg /instrumentation/pfd/track-deg - + + + LNAV ADVANCE + gain + 1.0 + + + + + /velocities/groundspeed-kt + 1201.0 + 4001.2 +
+ + + + /autopilot/route-manager/wp[1]/true-bearing-deg + /autopilot/route-manager/wp[0]/true-bearing-deg + + + 300.0 + 701.5 +
+
+
+ + /it-autoflight/internal/lnav-advance-nm + 1.0 + 10.0 +
+ HEADING ERROR DEG false gain + 1.0 @@ -487,11 +518,22 @@ 1
- /autopilot/settings/true-heading-deg - - /orientation/heading-deg - -1.0 - + + + + /autopilot/route-manager/wp[0]/true-bearing-deg + + /autopilot/internal/drift-angle-deg + -1 + + + /orientation/heading-deg + -1 + + + 1.5 + + @@ -513,7 +555,6 @@ -180 180 - 1.0
@@ -585,6 +626,7 @@ NAV ERROR DEG false gain + 1.0 /instrumentation/nav[0]/radials/target-auto-hdg-deg @@ -597,22 +639,22 @@ -180 180 - 1.0 INTERNAL VERTICAL SPEED COMPUTER false gain + 55.5 /velocities/vertical-speed-fps /it-autoflight/internal/vert-speed-fpm - 55.5 INTERNAL VERTICAL SPEED COMPUTER SYNC 4 false gain + 55.5 @@ -629,13 +671,13 @@ /velocities/vertical-speed-fps /it-autoflight/internal/target-fpm-b - 55.5 INTERNAL VERTICAL SPEED COMPUTER SYNC 5 false gain + 55.5 @@ -646,16 +688,15 @@ /velocities/vertical-speed-fps /it-autoflight/internal/target-fpm-d - 55.5 NAV1 G/S FPM Calc false gain + 1.0 /instrumentation/nav[0]/gs-rate-of-climb-fpm /it-autoflight/internal/nav1-rate-of-climb-fpm - 1.0 diff --git a/revision.txt b/revision.txt index eb888846..f9e0edcb 100644 --- a/revision.txt +++ b/revision.txt @@ -1 +1 @@ -4009 \ No newline at end of file +4010 \ No newline at end of file