From 61d4caf6de5d3294953f548cde7a1be27facd933 Mon Sep 17 00:00:00 2001 From: Joshua Davidson Date: Sun, 3 Dec 2017 09:38:57 -0500 Subject: [PATCH] A3XX: Add Rate Based Decel for Autobrake --- Nasal/brakes.nas | 15 +++---- Systems/hydraulics.xml | 92 ++++++++++++++++++++++++++++++++---------- Systems/libraries.xml | 77 +++++++++++++++++++++-------------- revision.txt | 2 +- 4 files changed, 123 insertions(+), 63 deletions(-) diff --git a/Nasal/brakes.nas b/Nasal/brakes.nas index d6e01775..8079a6df 100644 --- a/Nasal/brakes.nas +++ b/Nasal/brakes.nas @@ -7,6 +7,7 @@ setprop("/controls/autobrake/active", 0); setprop("/controls/autobrake/mode", 0); +setprop("/controls/autobrake/decel-rate", 0); setlistener("/sim/signals/fdm-initialized", func { var thr1 = 0; @@ -46,14 +47,18 @@ var arm_autobrake = func(mode) { setprop("/controls/gear/brake-left", 0); setprop("/controls/gear/brake-right", 0); } + setprop("/controls/autobrake/decel-rate", 0); setprop("/controls/autobrake/mode", 0); } else if (mode == 1 and wow0 != 1) { # LO + setprop("/controls/autobrake/decel-rate", 1.7); setprop("/controls/autobrake/mode", 1); absChk.start(); } else if (mode == 2 and wow0 != 1) { # MED + setprop("/controls/autobrake/decel-rate", 3); setprop("/controls/autobrake/mode", 2); absChk.start(); } else if (mode == 3 and wow0 == 1) { # MAX + setprop("/controls/autobrake/decel-rate", 6); setprop("/controls/autobrake/mode", 3); absChk.start(); } @@ -68,16 +73,6 @@ var absChk = maketimer(0.2, func { if (gnd_speed > 72) { if (getprop("/controls/autobrake/mode") != 0 and thr1 < 0.15 and thr2 < 0.15 and wow0 == 1) { setprop("/controls/autobrake/active", 1); - if (getprop("/controls/autobrake/mode") == 1) { # LO - interpolate("/controls/gear/brake-left", 0.4, 0.5); - interpolate("/controls/gear/brake-right", 0.4, 0.5); - } else if (getprop("/controls/autobrake/mode") == 2) { # MED - interpolate("/controls/gear/brake-left", 0.65, 0.5); - interpolate("/controls/gear/brake-right", 0.65, 0.5); - } else if (getprop("/controls/autobrake/mode") == 3) { # MAX - interpolate("/controls/gear/brake-left", 0.9, 0.5); - interpolate("/controls/gear/brake-right", 0.9, 0.5); - } } else { setprop("/controls/autobrake/active", 0); setprop("/controls/gear/brake-left", 0); diff --git a/Systems/hydraulics.xml b/Systems/hydraulics.xml index 13d5555a..6a765580 100644 --- a/Systems/hydraulics.xml +++ b/Systems/hydraulics.xml @@ -17,9 +17,9 @@ Aileron Droop gain - 1 + 1.0 0.05 - + /velocities/airspeed-kt @@ -34,9 +34,9 @@ Elevator Droop gain - 1 + 1.0 0.05 - +
/velocities/airspeed-kt @@ -1853,9 +1853,9 @@ Left Press gain - 1 + 1.0 0.05 - +
/controls/gear/brake-left @@ -1872,9 +1872,9 @@ Right Press gain - 1 + 1.0 0.05 - +
/controls/gear/brake-right @@ -1895,9 +1895,9 @@ Left Door gain - 1 + 1.0 0.05 - +
/gear/gear[1]/position-norm @@ -1914,9 +1914,9 @@ Left Door Conversion to Degrees gain - 1 + 1.0 0.05 - +
/systems/hydraulic/gear/door-left @@ -1931,9 +1931,9 @@ Right Door gain - 1 + 1.0 0.05 - +
/gear/gear[2]/position-norm @@ -1950,9 +1950,9 @@ Right Door Conversion to Degrees gain - 1 + 1.0 0.05 - +
/systems/hydraulic/gear/door-right @@ -1967,9 +1967,9 @@ Nose Door gain - 1 + 1.0 0.05 - +
/gear/gear[0]/position-norm @@ -1986,9 +1986,9 @@ NLG Left Door Conversion to Degrees gain - 1 + 1.0 0.05 - +
/systems/hydraulic/gear/door-nose @@ -2003,9 +2003,9 @@ NLG Right Door Conversion to Degrees gain - 1 + 1.0 0.05 - +
/systems/hydraulic/gear/door-nose @@ -2016,5 +2016,53 @@ /ECAM/Lower/door-nose-right + + + + + + + Autobrake Decel Error + gain + 1.0 + + + + /velocities/groundspeed-mps + /velocities/groundspeed-mps-ahead + + + + /controls/autobrake/decel-error + + + + IT-CONTROLLER: AUTOBRAKE DECEL + false + + + + /controls/autobrake/active + 1 + + + + + /controls/autobrake/decel-error + + + /controls/autobrake/decel-rate + + + /controls/gear/brake-left + /controls/gear/brake-right + + + 0.45 + 0.25 + 0.0 + 1.0 + + diff --git a/Systems/libraries.xml b/Systems/libraries.xml index 6e817033..199a7977 100644 --- a/Systems/libraries.xml +++ b/Systems/libraries.xml @@ -8,12 +8,30 @@ + + Groundspeed Meters Per Second + gain + 0.51444444444 + /velocities/groundspeed-kt + /velocities/groundspeed-mps + 0 + 1000 + + + + Groundspeed Meters Per Second Ahead + false + /velocities/groundspeed-mps + /velocities/groundspeed-mps-ahead + 1.5 + 0.0 + + Gear AGL Altitude FT gain 1.0 - 0.05 - + /position/altitude-agl-ft @@ -30,8 +48,7 @@ Gear AGL Altitude M gain 1.0 - 0.05 - + /position/gear-agl-ft @@ -58,7 +75,7 @@ gain 1.0 0.05 - +
/controls/flight/rudder-trim @@ -76,7 +93,7 @@ gain1.00.05 - +
/engines/engine[0]/fuel-flow_pph @@ -94,7 +111,7 @@ gain1.00.05 - +
/engines/engine[1]/fuel-flow_pph @@ -112,7 +129,7 @@ gain1.00.05 - +
/engines/engine[0]/n2-actual @@ -129,7 +146,7 @@ gain1.00.05 - +
/engines/engine[1]/n2-actual @@ -146,7 +163,7 @@ gain1.00.05 - +
@@ -163,7 +180,7 @@ V/S PFD noise-spike 0.05 - +
@@ -242,7 +259,7 @@ gain 1.0 0.1 - +
/instrumentation/altimeter/indicated-altitude-ft @@ -264,7 +281,7 @@ gain1.00.1 - + @@ -279,7 +296,7 @@ /systems/pressurization/cabinalt-norm - + /gear/gear[1]/wow @@ -296,7 +313,7 @@ gain 1.0 0.1 - +
/systems/pressurization/cabinalt-norm @@ -322,7 +339,7 @@ gain1.00.1 - + /gear/gear[1]/wow @@ -331,7 +348,7 @@ /systems/pressurization/ambientpsi - + /gear/gear[1]/wow @@ -348,7 +365,7 @@ gain 1.0 0.1 - +
/instrumentation/altimeter/indicated-altitude-ft @@ -396,7 +413,7 @@ Outflow Valve noise-spike - + /systems/pressurization/outflowpos /systems/pressurization/outflowpos-norm @@ -408,7 +425,7 @@ gain 1.0 0.1 - + /systems/pressurization/auto @@ -417,7 +434,7 @@ /systems/pressurization/outflowpos-man - + /systems/pressurization/auto @@ -432,7 +449,7 @@ Cabin VS noise-spike - + /systems/pressurization/vs /systems/pressurization/vs-norm @@ -442,7 +459,7 @@ Cabin Differential noise-spike - + /systems/pressurization/deltap /systems/pressurization/deltap-norm @@ -508,7 +525,7 @@ gain 1.0 0.1 - + /gear/gear[1]/wow @@ -517,7 +534,7 @@ 0 - + /gear/gear[1]/wow @@ -534,7 +551,7 @@ gain 1.0 0.1 - +
/systems/icing/severity @@ -554,7 +571,7 @@ TASgain1.0 - + velocities/uBody-fps @@ -616,7 +633,7 @@ gain 1.0 0.1 - +
/instrumentation/altimeter/indicated-altitude-ft @@ -666,7 +683,7 @@ gain1.00.1 - + /environment/temperature-degc /FMGC/internal/ISAtemp @@ -680,7 +697,7 @@ gain 1.0 0.05 - +
/velocities/airspeed-kt diff --git a/revision.txt b/revision.txt index 467ba129..f42f6466 100644 --- a/revision.txt +++ b/revision.txt @@ -1 +1 @@ -4058 \ No newline at end of file +4059 \ No newline at end of file