From 0f4dd9a4b962f8c93df4b3b08c5269cae657cc6d Mon Sep 17 00:00:00 2001 From: Josh Davidson Date: Fri, 23 Apr 2021 16:30:35 -0400 Subject: [PATCH] FMGC: Install new speed on pitch system, hook up FADEC properly to engage SRS/RWY, bugfixes --- A320-main.xml | 7 ++ Models/Instruments/PFD/PFD.nas | 4 +- Nasal/FMGC/FMGC-c.nas | 6 +- Nasal/Libraries/libraries.nas | 2 +- Systems/a320-cfm56-5b4-engine-fadec.xml | 6 +- Systems/fmgc-drivers.xml | 151 ++++++++++++++++++++++-- Systems/fmgc-pitch.xml | 117 +++++++++--------- Systems/fmgc-roll-yaw.xml | 4 +- 8 files changed, 217 insertions(+), 80 deletions(-) diff --git a/A320-main.xml b/A320-main.xml index 175f20ef..5d289853 100644 --- a/A320-main.xml +++ b/A320-main.xml @@ -898,6 +898,9 @@ 0 0 0.94 + + 0 + 0 0 0 0 @@ -917,6 +920,10 @@ 0 0 0.94 + 0.94 + + 0 + 0 0 0 0 diff --git a/Models/Instruments/PFD/PFD.nas b/Models/Instruments/PFD/PFD.nas index 2e93f345..d62aac14 100644 --- a/Models/Instruments/PFD/PFD.nas +++ b/Models/Instruments/PFD/PFD.nas @@ -361,10 +361,10 @@ var canvas_PFD_base = { fd_roll_cur = fd_roll.getValue(); fd_pitch_cur = fd_pitch.getValue(); if (fd_roll_cur != nil) { - me["FD_roll"].setTranslation((fd_roll_cur) * 2.2, 0); + me["FD_roll"].setTranslation(fd_roll_cur * 2.2, 0); } if (fd_pitch_cur != nil) { - me["FD_pitch"].setTranslation(0, -(fd_pitch_cur) * 3.8); + me["FD_pitch"].setTranslation(0, fd_pitch_cur * -11.825); } gear_agl_cur = gear_agl.getValue(); diff --git a/Nasal/FMGC/FMGC-c.nas b/Nasal/FMGC/FMGC-c.nas index 5cb7354c..5f95aaca 100644 --- a/Nasal/FMGC/FMGC-c.nas +++ b/Nasal/FMGC/FMGC-c.nas @@ -192,13 +192,13 @@ var loopFMA = maketimer(0.05, func { engstate2 = pts.Engines.Engine.state[1].getValue(); if (((state1 == "TOGA" or state2 == "TOGA") or (flx == 1 and (state1 == "MCT" or state2 == "MCT")) or (flx == 1 and ((state1 == "MAN THR" and systems.FADEC.manThrAboveMct[0]) or (state2 == "MAN THR" and systems.FADEC.manThrAboveMct[1])))) and (engstate1 == 3 or engstate2 == 3)) { # RWY Engagement would go here, but automatic ILS selection is not simulated yet. - gear1 = pts.Gear.wow[0].getValue(); + gear1 = pts.Gear.wow[1].getValue(); if (gear1 and FMGCInternal.v2set and Output.vert.getValue() != 7) { ITAF.setVertMode(7); - Text.vert.setValue("T/O CLB"); + ITAF.updateVertText("T/O CLB"); } } else { - gear1 = pts.Gear.wow[0].getValue(); + gear1 = pts.Gear.wow[1].getValue(); gear2 = pts.Gear.wow[2].getValue(); if (Input.lat.getValue() == 5 and (gear1 or gear2)) { ITAF.setLatMode(9); diff --git a/Nasal/Libraries/libraries.nas b/Nasal/Libraries/libraries.nas index 79f3ff86..967b11dc 100644 --- a/Nasal/Libraries/libraries.nas +++ b/Nasal/Libraries/libraries.nas @@ -4,7 +4,7 @@ # Copyright (c) 2021 Josh Davidson (Octal450) print("------------------------------------------------"); -print("Copyright (c) 2016-2020 Josh Davidson (Octal450)"); +print("Copyright (c) 2016-2021 Josh Davidson (Octal450)"); print("------------------------------------------------"); # Disable specific menubar items diff --git a/Systems/a320-cfm56-5b4-engine-fadec.xml b/Systems/a320-cfm56-5b4-engine-fadec.xml index ca2d58b7..be6243bc 100644 --- a/Systems/a320-cfm56-5b4-engine-fadec.xml +++ b/Systems/a320-cfm56-5b4-engine-fadec.xml @@ -12,11 +12,7 @@ fadec/limit/max-n1 fadec/limit/active-epr - - /controls/engines/engine[0]/throttle-lever - /controls/engines/engine[0]/throttle-pos - /controls/engines/engine[1]/throttle-lever - /controls/engines/engine[1]/throttle-pos + fadec/limit/idle diff --git a/Systems/fmgc-drivers.xml b/Systems/fmgc-drivers.xml index f36c3a0e..820616a7 100644 --- a/Systems/fmgc-drivers.xml +++ b/Systems/fmgc-drivers.xml @@ -304,6 +304,143 @@ /it-autoflight/input/mach + + Knots Rate + derivative + /velocities/airspeed-kt + /it-autoflight/internal/kts-rate-raw + 1.0 + + + + Knots Rate Lag + false + exponential + + + + /velocities/airspeed-kt + 80 + + + 0 + + /it-autoflight/internal/kts-rate-raw + /it-autoflight/internal/kts-rate + 0.08 + + + + Flch Knots Rate Command + false + gain + 1.0 + + + + /it-autoflight/mode/vert + T/O CLB + + + + + + + /it-autoflight/settings/togaspd + 10 + + /instrumentation/airspeed-indicator/indicated-speed-kt + + 0.08 + + + + + + + /it-autoflight/input/kts-mach + 1 + + + + + + /it-autoflight/input/mach + /instrumentation/airspeed-indicator/indicated-mach + + 80 + + + + + + + + /it-autoflight/input/kts + /instrumentation/airspeed-indicator/indicated-speed-kt + + 0.08 + + + + /it-autoflight/internal/flch-kts-error-cmd + -1.5 + 1.5 + + + + Flch Knots Rate Filter + noise-spike + true + output + /it-autoflight/internal/flch-kts-error-cmd + /it-autoflight/internal/flch-kts-error + + + + + + /it-autoflight/output/vert + 4 + + + /it-autoflight/output/vert + 7 + + + + + /it-autoflight/output/ap1 + 1 + + + /it-autoflight/output/ap2 + 1 + + + /it-autoflight/output/fd1 + 1 + + + /it-autoflight/output/fd2 + 1 + + + + /gear/gear[1]/wow + 0 + + + /gear/gear[2]/wow + 0 + + + + 2.5 + + 100 + + Heading Deg gain @@ -518,7 +655,7 @@ VS Abs gain 1.0 - 0.02 + 0.02 @@ -533,7 +670,7 @@ FPA Abs gain 1.0 - 0.02 + 0.02 @@ -617,7 +754,7 @@
/orientation/roll-deg - /fdm/jsbsim/velocities/vc-kts + /velocities/airspeed-kt1401.83602.8
@@ -638,7 +775,7 @@
/orientation/roll-deg - /fdm/jsbsim/velocities/vc-kts + /velocities/airspeed-kt1401.83602.8
@@ -777,9 +914,9 @@ /it-autoflight/internal/vert-speed-fpm - /instrumentation/airspeed-indicator/indicated-mach - 0.200.004 - 0.950.002 + /velocities/airspeed-kt + 1400.001848350 + 3600.000924175
diff --git a/Systems/fmgc-pitch.xml b/Systems/fmgc-pitch.xml index 193f4260..312191dd 100644 --- a/Systems/fmgc-pitch.xml +++ b/Systems/fmgc-pitch.xml @@ -69,49 +69,36 @@ /it-autoflight/internal/flch-active - - - - /it-autoflight/input/kts-mach - 0 - - - /it-autoflight/internal/kts-predicted-15 - - - - - /it-autoflight/input/kts-mach - 1 - - - /it-autoflight/internal/mach-predicted-15 - 750 - - - - - /it-autoflight/input/kts-mach - 0 - - - /it-autoflight/internal/flch-kts - - - - - /it-autoflight/input/kts-mach - 1 - - - /it-autoflight/internal/flch-mach - 750 - + /it-autoflight/internal/kts-rate + /it-autoflight/internal/flch-kts-error /it-autoflight/internal/target-fpm-flch - -55 - 2.5 - 0.001 + + + + /velocities/airspeed-kt + 140-390 + 360-430 +
+
+
+ 1.3 + 0.0 + + + + + /gear/gear[1]/wow + 1 + + + /gear/gear[2]/wow + 1 + + + + 0 + @@ -119,34 +106,36 @@ 2 - 120 + + + 120 + + /it-autoflight/internal/vert-speed-fpm + 2000 + + + /it-autoflight/internal/vert-speed-fpm - 2500 + 2000 - + - /it-autoflight/output/thr-mode - 2 + /gear/gear[1]/wow + 1 - - - /gear/gear[1]/wow - 1 - - - /gear/gear[2]/wow - 1 - - - + + /gear/gear[2]/wow + 1 + + 1000 @@ -157,13 +146,21 @@ 1 - -120 + + + -120 + + /it-autoflight/internal/vert-speed-fpm + 2000 + + + /it-autoflight/internal/vert-speed-fpm - 2500 + 2000 @@ -489,7 +486,7 @@ - /fdm/jsbsim/velocities/vc-kts + /velocities/airspeed-kt1400.00293600.0009
diff --git a/Systems/fmgc-roll-yaw.xml b/Systems/fmgc-roll-yaw.xml index 3c82e56c..f0fec8f0 100644 --- a/Systems/fmgc-roll-yaw.xml +++ b/Systems/fmgc-roll-yaw.xml @@ -13,7 +13,7 @@ - /fdm/jsbsim/velocities/vc-kts + /velocities/airspeed-kt1401.83602.8
@@ -70,7 +70,7 @@ - /fdm/jsbsim/velocities/vc-kts + /velocities/airspeed-kt1401.83602.8