From 4d7197aefd66dfddca210de93016338c6682edda Mon Sep 17 00:00:00 2001 From: Joshua Davidson Date: Tue, 2 May 2017 22:16:53 -0400 Subject: [PATCH] improve hydraulics, make elevator/ailerons connected to hydraulics, fix animations exterior, elevator/aileron/rudder new props over MP --- A319-100-IAE.xml | 4 +- A320-200-IAE.xml | 4 +- A320-main.xml | 15 +- A321-200-IAE.xml | 4 +- ACJ-IAE.xml | 4 +- Models/Fuselages/A319/hstab.xml | 12 +- Models/Fuselages/A320/hstab.xml | 12 +- Models/Fuselages/A321/hstab.xml | 12 +- Models/Fuselages/ACJ/hstab.xml | 12 +- Models/Fuselages/ACJ/vstab.xml | 2 +- Models/Wings/a320.wings.iae.xml | 8 +- Nasal/hydraulics.nas | 12 +- Nasal/it-fbw.nas | 53 +++---- Systems/hydraulics.xml | 260 ++++++++++++++++++++++++++++++++ 14 files changed, 340 insertions(+), 74 deletions(-) diff --git a/A319-100-IAE.xml b/A319-100-IAE.xml index 6e088171..c62e450a 100644 --- a/A319-100-IAE.xml +++ b/A319-100-IAE.xml @@ -566,7 +566,7 @@ YAW MOI_________3950000______23089847_______24848934 - /controls/flight/elevator-fbw + /controls/flight/elevator-sum /controls/flight/elevator-trim -1 @@ -594,7 +594,7 @@ YAW MOI_________3950000______23089847_______24848934 - /controls/flight/aileron-fbw + /controls/flight/aileron-sum /controls/flight/aileron-trim -1 diff --git a/A320-200-IAE.xml b/A320-200-IAE.xml index 99b7c85b..5aca0e1b 100644 --- a/A320-200-IAE.xml +++ b/A320-200-IAE.xml @@ -566,7 +566,7 @@ YAW MOI_________3950000______23089847_______24848934 - /controls/flight/elevator-fbw + /controls/flight/elevator-sum /controls/flight/elevator-trim -1 @@ -594,7 +594,7 @@ YAW MOI_________3950000______23089847_______24848934 - /controls/flight/aileron-fbw + /controls/flight/aileron-sum /controls/flight/aileron-trim -1 diff --git a/A320-main.xml b/A320-main.xml index 74e20d62..0e53ffdd 100644 --- a/A320-main.xml +++ b/A320-main.xml @@ -34,9 +34,9 @@ - + Aircraft/A320Family/Systems/it-fbw-b.xml @@ -152,6 +152,11 @@ + + + + + @@ -389,7 +394,13 @@ 0 + 0.5 + -0.5 + 0.0 0 + 0.1 + 0.1 + 0.2 0 0 0 diff --git a/A321-200-IAE.xml b/A321-200-IAE.xml index b0e0983b..dda19e40 100644 --- a/A321-200-IAE.xml +++ b/A321-200-IAE.xml @@ -566,7 +566,7 @@ YAW MOI_________3950000______23089847_______24848934 - /controls/flight/elevator-fbw + /controls/flight/elevator-sum /controls/flight/elevator-trim -1 @@ -594,7 +594,7 @@ YAW MOI_________3950000______23089847_______24848934 - /controls/flight/aileron-fbw + /controls/flight/aileron-sum /controls/flight/aileron-trim -1 diff --git a/ACJ-IAE.xml b/ACJ-IAE.xml index f07e357b..cf00b429 100644 --- a/ACJ-IAE.xml +++ b/ACJ-IAE.xml @@ -566,7 +566,7 @@ YAW MOI_________3950000______23089847_______24848934 - /controls/flight/elevator-fbw + /controls/flight/elevator-sum /controls/flight/elevator-trim -1 @@ -594,7 +594,7 @@ YAW MOI_________3950000______23089847_______24848934 - /controls/flight/aileron-fbw + /controls/flight/aileron-sum /controls/flight/aileron-trim -1 diff --git a/Models/Fuselages/A319/hstab.xml b/Models/Fuselages/A319/hstab.xml index ec7eb5d6..6081b6b1 100644 --- a/Models/Fuselages/A319/hstab.xml +++ b/Models/Fuselages/A319/hstab.xml @@ -9,11 +9,11 @@ Left elevator rotate ElevatorL - /controls/flight/elevator-fbw + /sim/multiplay/generic/float[4] - -1.0-15.0 + -0.5-20.0 0.00.0 - 1.015.0 + 0.520.0 4.8217428 @@ -28,11 +28,11 @@ Right elevator rotate ElevatorR - /controls/flight/elevator-fbw + /sim/multiplay/generic/float[5] - -1.0-15.0 + -0.5-20.0 0.00.0 - 1.015.0 + 0.520.0 2.9796817 diff --git a/Models/Fuselages/A320/hstab.xml b/Models/Fuselages/A320/hstab.xml index ec7eb5d6..6081b6b1 100644 --- a/Models/Fuselages/A320/hstab.xml +++ b/Models/Fuselages/A320/hstab.xml @@ -9,11 +9,11 @@ Left elevator rotate ElevatorL - /controls/flight/elevator-fbw + /sim/multiplay/generic/float[4] - -1.0-15.0 + -0.5-20.0 0.00.0 - 1.015.0 + 0.520.0 4.8217428 @@ -28,11 +28,11 @@ Right elevator rotate ElevatorR - /controls/flight/elevator-fbw + /sim/multiplay/generic/float[5] - -1.0-15.0 + -0.5-20.0 0.00.0 - 1.015.0 + 0.520.0 2.9796817 diff --git a/Models/Fuselages/A321/hstab.xml b/Models/Fuselages/A321/hstab.xml index ec7eb5d6..6081b6b1 100644 --- a/Models/Fuselages/A321/hstab.xml +++ b/Models/Fuselages/A321/hstab.xml @@ -9,11 +9,11 @@ Left elevator rotate ElevatorL - /controls/flight/elevator-fbw + /sim/multiplay/generic/float[4] - -1.0-15.0 + -0.5-20.0 0.00.0 - 1.015.0 + 0.520.0 4.8217428 @@ -28,11 +28,11 @@ Right elevator rotate ElevatorR - /controls/flight/elevator-fbw + /sim/multiplay/generic/float[5] - -1.0-15.0 + -0.5-20.0 0.00.0 - 1.015.0 + 0.520.0 2.9796817 diff --git a/Models/Fuselages/ACJ/hstab.xml b/Models/Fuselages/ACJ/hstab.xml index ec7eb5d6..6081b6b1 100644 --- a/Models/Fuselages/ACJ/hstab.xml +++ b/Models/Fuselages/ACJ/hstab.xml @@ -9,11 +9,11 @@ Left elevator rotate ElevatorL - /controls/flight/elevator-fbw + /sim/multiplay/generic/float[4] - -1.0-15.0 + -0.5-20.0 0.00.0 - 1.015.0 + 0.520.0 4.8217428 @@ -28,11 +28,11 @@ Right elevator rotate ElevatorR - /controls/flight/elevator-fbw + /sim/multiplay/generic/float[5] - -1.0-15.0 + -0.5-20.0 0.00.0 - 1.015.0 + 0.520.0 2.9796817 diff --git a/Models/Fuselages/ACJ/vstab.xml b/Models/Fuselages/ACJ/vstab.xml index e8ee9ee4..cb45bb62 100644 --- a/Models/Fuselages/ACJ/vstab.xml +++ b/Models/Fuselages/ACJ/vstab.xml @@ -15,7 +15,7 @@ Rudder rotate Rudder - surface-positions/rudder-pos-norm + /sim/multiplay/generic/float[8] 25 4.013 diff --git a/Models/Wings/a320.wings.iae.xml b/Models/Wings/a320.wings.iae.xml index ce7434f5..cc65b23d 100644 --- a/Models/Wings/a320.wings.iae.xml +++ b/Models/Wings/a320.wings.iae.xml @@ -29,8 +29,8 @@ Left aileron rotate AileronL - surface-positions/left-aileron-pos-norm - 25 + /sim/multiplay/generic/float[6] + 40 8.7295 -16.3231163 @@ -44,8 +44,8 @@ Right aileron rotate AileronR - surface-positions/right-aileron-pos-norm - 25 + /sim/multiplay/generic/float[7] + 40 7.6792 13.3967144 diff --git a/Nasal/hydraulics.nas b/Nasal/hydraulics.nas index c289db28..04d9dd76 100644 --- a/Nasal/hydraulics.nas +++ b/Nasal/hydraulics.nas @@ -53,9 +53,15 @@ var master_hyd = func { } else { setprop("/systems/hydraulic/blue-psi", 3000); } + } else if (getprop("/instrumentation/airspeed-indicator/indicated-speed-kt") >= 120 and rat_man_sw == 1) { + if (blue_psi < 2400) { + setprop("/systems/hydraulic/blue-psi", blue_psi + 100); + } else { + setprop("/systems/hydraulic/blue-psi", 2500); + } } else { if (blue_psi > 1) { - setprop("/systems/hydraulic/blue-psi", blue_psi - 0.1); + setprop("/systems/hydraulic/blue-psi", blue_psi - 5); } else { setprop("/systems/hydraulic/blue-psi", 0); } @@ -75,7 +81,7 @@ var master_hyd = func { } } else { if (green_psi > 1) { - setprop("/systems/hydraulic/green-psi", green_psi - 0.1); + setprop("/systems/hydraulic/green-psi", green_psi - 5); } else { setprop("/systems/hydraulic/green-psi", 0); } @@ -101,7 +107,7 @@ var master_hyd = func { } } else { if (yellow_psi > 1) { - setprop("/systems/hydraulic/yellow-psi", yellow_psi - 0.1); + setprop("/systems/hydraulic/yellow-psi", yellow_psi - 5); } else { setprop("/systems/hydraulic/yellow-psi", 0); } diff --git a/Nasal/it-fbw.nas b/Nasal/it-fbw.nas index c177392c..f1b9edd1 100644 --- a/Nasal/it-fbw.nas +++ b/Nasal/it-fbw.nas @@ -1,11 +1,11 @@ # Airbus A3XX FBW System by Joshua Davidson (it0uchpods) -# V0.9.6 +# V0.9.7 -######################## -# Roll Update Function # -######################## +################### +# Update Function # +################### -var roll_input = func { +var update_loop = func { var ail = getprop("/controls/flight/aileron"); @@ -29,13 +29,6 @@ var roll_input = func { setprop("/it-fbw/roll-lim-max", "33"); setprop("/it-fbw/roll-lim-min", "-33"); } -} - -######################### -# Pitch Update Function # -######################### - -var pitch_input = func { var elev = getprop("/controls/flight/elevator"); @@ -54,29 +47,16 @@ var pitch_input = func { setprop("/it-fbw/pitch-lim-max", "15"); setprop("/it-fbw/pitch-lim-min", "-15"); } -} -########################### -# Various Other Functions # -########################### - -setlistener("/sim/signals/fdm-initialized", func { - setprop("/it-fbw/override", 0); - setprop("/it-fbw/law", 3); - update_roll.start(); - update_pitch.start(); -}); - -setlistener("/systems/electrical/bus/ac-ess", func { - fbw_law(); -}); - -var fbw_law = func { if (getprop("/it-fbw/override") == 0) { - if (getprop("/systems/electrical/bus/ac-ess") >= 110) { + if ((getprop("/systems/electrical/bus/ac-ess") >= 110) and (getprop("/systems/hydraulic/green-psi") >= 1500) and (getprop("/systems/hydraulic/yellow-psi") >= 1500)) { if (getprop("/it-fbw/law") != 0) { setprop("/it-fbw/law", 0); } + } else if ((getprop("/systems/electrical/bus/ac-ess") >= 110) and (getprop("/systems/hydraulic/blue-psi") >= 1500)) { + if (getprop("/it-fbw/law") != 2) { + setprop("/it-fbw/law", 2); + } } else { if (getprop("/it-fbw/law") != 3) { setprop("/it-fbw/law", 3); @@ -85,8 +65,17 @@ var fbw_law = func { } } +########################### +# Various Other Functions # +########################### + +setlistener("/sim/signals/fdm-initialized", func { + setprop("/it-fbw/override", 0); + setprop("/it-fbw/law", 3); + updatet.start(); +}); + ########## # Timers # ########## -var update_roll = maketimer(0.01, roll_input); -var update_pitch = maketimer(0.01, pitch_input); +var updatet = maketimer(0.01, update_loop); diff --git a/Systems/hydraulics.xml b/Systems/hydraulics.xml index 58adf1ae..2ed2dba6 100644 --- a/Systems/hydraulics.xml +++ b/Systems/hydraulics.xml @@ -4,6 +4,266 @@ + + + + false + gain + 1.0 + + + + + /systems/hydraulic/green-psi + 1500 + + + /systems/hydraulic/blue-psi + 1500 + + + + 0.5 + + + + + + /systems/hydraulic/green-psi + 1500 + + + /systems/hydraulic/blue-psi + 1500 + + + + + + /controls/flight/aileron-fbw + -1-0.5 + 0 0.0 + 1 0.5 +
+
+ + /controls/flight/aileron-left +
+ + + false + gain + 1.0 + + + + + /systems/hydraulic/green-psi + 1500 + + + /systems/hydraulic/blue-psi + 1500 + + + + 0.5 + + + + + + /systems/hydraulic/green-psi + 1500 + + + /systems/hydraulic/blue-psi + 1500 + + + + + + /controls/flight/aileron-fbw + -1 0.5 + 0 0.0 + 1-0.5 +
+
+ + /controls/flight/aileron-right +
+ + + false + gain + 1.0 + + + + /controls/flight/aileron-left + /controls/flight/aileron-right + + + + /controls/flight/aileron-sum + + + + false + gain + 1.0 + + + + + /systems/hydraulic/green-psi + 1500 + + + /systems/hydraulic/blue-psi + 1500 + + + + 0.1 + + + + + + /systems/hydraulic/green-psi + 1500 + + + /systems/hydraulic/blue-psi + 1500 + + + + + + /controls/flight/elevator-fbw + -1-0.5 + 0 0.0 + 1 0.5 +
+
+ + /controls/flight/elevator-left +
+ + + false + gain + 1.0 + + + + + /systems/hydraulic/yellow-psi + 1500 + + + /systems/hydraulic/blue-psi + 1500 + + + + 0.1 + + + + + + /systems/hydraulic/yellow-psi + 1500 + + + /systems/hydraulic/blue-psi + 1500 + + + + + + /controls/flight/elevator-fbw + -1-0.5 + 0 0.0 + 1 0.5 +
+
+ + /controls/flight/elevator-right +
+ + + false + gain + 1.0 + + + + /controls/flight/elevator-left + /controls/flight/elevator-right + + + + /controls/flight/elevator-sum + + + + + false + gain + 1.0 + + + + + /systems/hydraulic/green-psi + 1500 + + + /systems/hydraulic/blue-psi + 1500 + + + /systems/hydraulic/yellow-psi + 1500 + + + + 0.0 + + + + + + /systems/hydraulic/green-psi + 1500 + + + /systems/hydraulic/blue-psi + 1500 + + + /systems/hydraulic/yellow-psi + 1500 + + + + + + /controls/flight/rudder + /controls/flight/rudder-trim + + + + /controls/flight/rudder-fdm + -1.0 + 1.0 +