A3XX: Add Rate Based Decel for Autobrake
This commit is contained in:
parent
b9959b3ce1
commit
61d4caf6de
4 changed files with 123 additions and 63 deletions
|
@ -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);
|
||||
|
|
|
@ -17,9 +17,9 @@
|
|||
<filter>
|
||||
<name>Aileron Droop</name>
|
||||
<type>gain</type>
|
||||
<gain>1</gain>
|
||||
<gain>1.0</gain>
|
||||
<update-interval-secs type="double">0.05</update-interval-secs>
|
||||
<input>
|
||||
<input>
|
||||
<expression>
|
||||
<table>
|
||||
<property>/velocities/airspeed-kt</property>
|
||||
|
@ -34,9 +34,9 @@
|
|||
<filter>
|
||||
<name>Elevator Droop</name>
|
||||
<type>gain</type>
|
||||
<gain>1</gain>
|
||||
<gain>1.0</gain>
|
||||
<update-interval-secs type="double">0.05</update-interval-secs>
|
||||
<input>
|
||||
<input>
|
||||
<expression>
|
||||
<table>
|
||||
<property>/velocities/airspeed-kt</property>
|
||||
|
@ -1853,9 +1853,9 @@
|
|||
<filter>
|
||||
<name>Left Press</name>
|
||||
<type>gain</type>
|
||||
<gain>1</gain>
|
||||
<gain>1.0</gain>
|
||||
<update-interval-secs type="double">0.05</update-interval-secs>
|
||||
<input>
|
||||
<input>
|
||||
<expression>
|
||||
<table>
|
||||
<property>/controls/gear/brake-left</property>
|
||||
|
@ -1872,9 +1872,9 @@
|
|||
<filter>
|
||||
<name>Right Press</name>
|
||||
<type>gain</type>
|
||||
<gain>1</gain>
|
||||
<gain>1.0</gain>
|
||||
<update-interval-secs type="double">0.05</update-interval-secs>
|
||||
<input>
|
||||
<input>
|
||||
<expression>
|
||||
<table>
|
||||
<property>/controls/gear/brake-right</property>
|
||||
|
@ -1895,9 +1895,9 @@
|
|||
<filter>
|
||||
<name>Left Door</name>
|
||||
<type>gain</type>
|
||||
<gain>1</gain>
|
||||
<gain>1.0</gain>
|
||||
<update-interval-secs type="double">0.05</update-interval-secs>
|
||||
<input>
|
||||
<input>
|
||||
<expression>
|
||||
<table>
|
||||
<property>/gear/gear[1]/position-norm</property>
|
||||
|
@ -1914,9 +1914,9 @@
|
|||
<filter>
|
||||
<name>Left Door Conversion to Degrees</name>
|
||||
<type>gain</type>
|
||||
<gain>1</gain>
|
||||
<gain>1.0</gain>
|
||||
<update-interval-secs type="double">0.05</update-interval-secs>
|
||||
<input>
|
||||
<input>
|
||||
<expression>
|
||||
<table>
|
||||
<property>/systems/hydraulic/gear/door-left</property>
|
||||
|
@ -1931,9 +1931,9 @@
|
|||
<filter>
|
||||
<name>Right Door</name>
|
||||
<type>gain</type>
|
||||
<gain>1</gain>
|
||||
<gain>1.0</gain>
|
||||
<update-interval-secs type="double">0.05</update-interval-secs>
|
||||
<input>
|
||||
<input>
|
||||
<expression>
|
||||
<table>
|
||||
<property>/gear/gear[2]/position-norm</property>
|
||||
|
@ -1950,9 +1950,9 @@
|
|||
<filter>
|
||||
<name>Right Door Conversion to Degrees</name>
|
||||
<type>gain</type>
|
||||
<gain>1</gain>
|
||||
<gain>1.0</gain>
|
||||
<update-interval-secs type="double">0.05</update-interval-secs>
|
||||
<input>
|
||||
<input>
|
||||
<expression>
|
||||
<table>
|
||||
<property>/systems/hydraulic/gear/door-right</property>
|
||||
|
@ -1967,9 +1967,9 @@
|
|||
<filter>
|
||||
<name>Nose Door</name>
|
||||
<type>gain</type>
|
||||
<gain>1</gain>
|
||||
<gain>1.0</gain>
|
||||
<update-interval-secs type="double">0.05</update-interval-secs>
|
||||
<input>
|
||||
<input>
|
||||
<expression>
|
||||
<table>
|
||||
<property>/gear/gear[0]/position-norm</property>
|
||||
|
@ -1986,9 +1986,9 @@
|
|||
<filter>
|
||||
<name>NLG Left Door Conversion to Degrees</name>
|
||||
<type>gain</type>
|
||||
<gain>1</gain>
|
||||
<gain>1.0</gain>
|
||||
<update-interval-secs type="double">0.05</update-interval-secs>
|
||||
<input>
|
||||
<input>
|
||||
<expression>
|
||||
<table>
|
||||
<property>/systems/hydraulic/gear/door-nose</property>
|
||||
|
@ -2003,9 +2003,9 @@
|
|||
<filter>
|
||||
<name>NLG Right Door Conversion to Degrees</name>
|
||||
<type>gain</type>
|
||||
<gain>1</gain>
|
||||
<gain>1.0</gain>
|
||||
<update-interval-secs type="double">0.05</update-interval-secs>
|
||||
<input>
|
||||
<input>
|
||||
<expression>
|
||||
<table>
|
||||
<property>/systems/hydraulic/gear/door-nose</property>
|
||||
|
@ -2016,5 +2016,53 @@
|
|||
</input>
|
||||
<output>/ECAM/Lower/door-nose-right</output>
|
||||
</filter>
|
||||
|
||||
<!-- =============================================================== -->
|
||||
<!-- Autobrake -->
|
||||
<!-- =============================================================== -->
|
||||
|
||||
<filter>
|
||||
<name>Autobrake Decel Error</name>
|
||||
<type>gain</type>
|
||||
<gain>1.0</gain>
|
||||
<input>
|
||||
<expression>
|
||||
<dif>
|
||||
<property>/velocities/groundspeed-mps</property>
|
||||
<property>/velocities/groundspeed-mps-ahead</property>
|
||||
</dif>
|
||||
</expression>
|
||||
</input>
|
||||
<output>/controls/autobrake/decel-error</output>
|
||||
</filter>
|
||||
|
||||
<pi-simple-controller>
|
||||
<name>IT-CONTROLLER: AUTOBRAKE DECEL</name>
|
||||
<debug>false</debug>
|
||||
<enable>
|
||||
<condition>
|
||||
<equals>
|
||||
<property>/controls/autobrake/active</property>
|
||||
<value>1</value>
|
||||
</equals>
|
||||
</condition>
|
||||
</enable>
|
||||
<input>
|
||||
<property>/controls/autobrake/decel-error</property>
|
||||
</input>
|
||||
<reference>
|
||||
<property>/controls/autobrake/decel-rate</property>
|
||||
</reference>
|
||||
<output>
|
||||
<property>/controls/gear/brake-left</property>
|
||||
<property>/controls/gear/brake-right</property>
|
||||
</output>
|
||||
<config>
|
||||
<Kp>0.45</Kp>
|
||||
<Ki>0.25</Ki>
|
||||
<min>0.0</min>
|
||||
<max>1.0</max>
|
||||
</config>
|
||||
</pi-simple-controller>
|
||||
|
||||
</PropertyList>
|
||||
|
|
|
@ -8,12 +8,30 @@
|
|||
|
||||
<PropertyList>
|
||||
|
||||
<filter>
|
||||
<name>Groundspeed Meters Per Second</name>
|
||||
<type>gain</type>
|
||||
<gain>0.51444444444</gain>
|
||||
<input>/velocities/groundspeed-kt</input>
|
||||
<output>/velocities/groundspeed-mps</output>
|
||||
<min>0</min>
|
||||
<max>1000</max>
|
||||
</filter>
|
||||
|
||||
<predict-simple>
|
||||
<name>Groundspeed Meters Per Second Ahead</name>
|
||||
<debug>false</debug>
|
||||
<input>/velocities/groundspeed-mps</input>
|
||||
<output>/velocities/groundspeed-mps-ahead</output>
|
||||
<seconds>1.5</seconds>
|
||||
<filter-gain>0.0</filter-gain>
|
||||
</predict-simple>
|
||||
|
||||
<filter>
|
||||
<name>Gear AGL Altitude FT</name>
|
||||
<type>gain</type>
|
||||
<gain>1.0</gain>
|
||||
<update-interval-secs type="double">0.05</update-interval-secs>
|
||||
<input>
|
||||
<input>
|
||||
<expression>
|
||||
<dif>
|
||||
<property>/position/altitude-agl-ft</property>
|
||||
|
@ -30,8 +48,7 @@
|
|||
<name>Gear AGL Altitude M</name>
|
||||
<type>gain</type>
|
||||
<gain>1.0</gain>
|
||||
<update-interval-secs type="double">0.05</update-interval-secs>
|
||||
<input>
|
||||
<input>
|
||||
<expression>
|
||||
<product>
|
||||
<property>/position/gear-agl-ft</property>
|
||||
|
@ -58,7 +75,7 @@
|
|||
<type>gain</type>
|
||||
<gain>1.0</gain>
|
||||
<update-interval-secs type="double">0.05</update-interval-secs>
|
||||
<input>
|
||||
<input>
|
||||
<expression>
|
||||
<table>
|
||||
<property>/controls/flight/rudder-trim</property>
|
||||
|
@ -76,7 +93,7 @@
|
|||
<type>gain</type>
|
||||
<gain>1.0</gain>
|
||||
<update-interval-secs type="double">0.05</update-interval-secs>
|
||||
<input>
|
||||
<input>
|
||||
<expression>
|
||||
<table>
|
||||
<property>/engines/engine[0]/fuel-flow_pph</property>
|
||||
|
@ -94,7 +111,7 @@
|
|||
<type>gain</type>
|
||||
<gain>1.0</gain>
|
||||
<update-interval-secs type="double">0.05</update-interval-secs>
|
||||
<input>
|
||||
<input>
|
||||
<expression>
|
||||
<table>
|
||||
<property>/engines/engine[1]/fuel-flow_pph</property>
|
||||
|
@ -112,7 +129,7 @@
|
|||
<type>gain</type>
|
||||
<gain>1.0</gain>
|
||||
<update-interval-secs type="double">0.05</update-interval-secs>
|
||||
<input>
|
||||
<input>
|
||||
<expression>
|
||||
<table>
|
||||
<property>/engines/engine[0]/n2-actual</property>
|
||||
|
@ -129,7 +146,7 @@
|
|||
<type>gain</type>
|
||||
<gain>1.0</gain>
|
||||
<update-interval-secs type="double">0.05</update-interval-secs>
|
||||
<input>
|
||||
<input>
|
||||
<expression>
|
||||
<table>
|
||||
<property>/engines/engine[1]/n2-actual</property>
|
||||
|
@ -146,7 +163,7 @@
|
|||
<type>gain</type>
|
||||
<gain>1.0</gain>
|
||||
<update-interval-secs type="double">0.05</update-interval-secs>
|
||||
<input>
|
||||
<input>
|
||||
<expression>
|
||||
<floor>
|
||||
<div>
|
||||
|
@ -163,7 +180,7 @@
|
|||
<name>V/S PFD</name>
|
||||
<type>noise-spike</type>
|
||||
<update-interval-secs type="double">0.05</update-interval-secs>
|
||||
<input>
|
||||
<input>
|
||||
<expression>
|
||||
<floor>
|
||||
<div>
|
||||
|
@ -242,7 +259,7 @@
|
|||
<type>gain</type>
|
||||
<gain>1.0</gain>
|
||||
<update-interval-secs type="double">0.1</update-interval-secs>
|
||||
<input>
|
||||
<input>
|
||||
<expression>
|
||||
<table>
|
||||
<property>/instrumentation/altimeter/indicated-altitude-ft</property>
|
||||
|
@ -264,7 +281,7 @@
|
|||
<type>gain</type>
|
||||
<gain>1.0</gain>
|
||||
<update-interval-secs type="double">0.1</update-interval-secs>
|
||||
<input>
|
||||
<input>
|
||||
<condition>
|
||||
<or>
|
||||
<equals>
|
||||
|
@ -279,7 +296,7 @@
|
|||
</condition>
|
||||
<property>/systems/pressurization/cabinalt-norm</property>
|
||||
</input>
|
||||
<input>
|
||||
<input>
|
||||
<condition>
|
||||
<not>
|
||||
<property>/gear/gear[1]/wow</property>
|
||||
|
@ -296,7 +313,7 @@
|
|||
<type>gain</type>
|
||||
<gain>1.0</gain>
|
||||
<update-interval-secs type="double">0.1</update-interval-secs>
|
||||
<input>
|
||||
<input>
|
||||
<expression>
|
||||
<table>
|
||||
<property>/systems/pressurization/cabinalt-norm</property>
|
||||
|
@ -322,7 +339,7 @@
|
|||
<type>gain</type>
|
||||
<gain>1.0</gain>
|
||||
<update-interval-secs type="double">0.1</update-interval-secs>
|
||||
<input>
|
||||
<input>
|
||||
<condition>
|
||||
<equals>
|
||||
<property>/gear/gear[1]/wow</property>
|
||||
|
@ -331,7 +348,7 @@
|
|||
</condition>
|
||||
<property>/systems/pressurization/ambientpsi</property>
|
||||
</input>
|
||||
<input>
|
||||
<input>
|
||||
<condition>
|
||||
<not>
|
||||
<property>/gear/gear[1]/wow</property>
|
||||
|
@ -348,7 +365,7 @@
|
|||
<type>gain</type>
|
||||
<gain>1.0</gain>
|
||||
<update-interval-secs type="double">0.1</update-interval-secs>
|
||||
<input>
|
||||
<input>
|
||||
<expression>
|
||||
<table>
|
||||
<property>/instrumentation/altimeter/indicated-altitude-ft</property>
|
||||
|
@ -396,7 +413,7 @@
|
|||
<filter>
|
||||
<name>Outflow Valve</name>
|
||||
<type>noise-spike</type>
|
||||
<input>
|
||||
<input>
|
||||
<property>/systems/pressurization/outflowpos</property>
|
||||
</input>
|
||||
<output>/systems/pressurization/outflowpos-norm</output>
|
||||
|
@ -408,7 +425,7 @@
|
|||
<type>gain</type>
|
||||
<gain>1.0</gain>
|
||||
<update-interval-secs type="double">0.1</update-interval-secs>
|
||||
<input>
|
||||
<input>
|
||||
<condition>
|
||||
<equals>
|
||||
<property>/systems/pressurization/auto</property>
|
||||
|
@ -417,7 +434,7 @@
|
|||
</condition>
|
||||
<property>/systems/pressurization/outflowpos-man</property>
|
||||
</input>
|
||||
<input>
|
||||
<input>
|
||||
<condition>
|
||||
<equals>
|
||||
<property>/systems/pressurization/auto</property>
|
||||
|
@ -432,7 +449,7 @@
|
|||
<filter>
|
||||
<name>Cabin VS</name>
|
||||
<type>noise-spike</type>
|
||||
<input>
|
||||
<input>
|
||||
<property>/systems/pressurization/vs</property>
|
||||
</input>
|
||||
<output>/systems/pressurization/vs-norm</output>
|
||||
|
@ -442,7 +459,7 @@
|
|||
<filter>
|
||||
<name>Cabin Differential</name>
|
||||
<type>noise-spike</type>
|
||||
<input>
|
||||
<input>
|
||||
<property>/systems/pressurization/deltap</property>
|
||||
</input>
|
||||
<output>/systems/pressurization/deltap-norm</output>
|
||||
|
@ -508,7 +525,7 @@
|
|||
<type>gain</type>
|
||||
<gain>1.0</gain>
|
||||
<update-interval-secs type="double">0.1</update-interval-secs>
|
||||
<input>
|
||||
<input>
|
||||
<condition>
|
||||
<equals>
|
||||
<property>/gear/gear[1]/wow</property>
|
||||
|
@ -517,7 +534,7 @@
|
|||
</condition>
|
||||
<value>0</value>
|
||||
</input>
|
||||
<input>
|
||||
<input>
|
||||
<condition>
|
||||
<not>
|
||||
<property>/gear/gear[1]/wow</property>
|
||||
|
@ -534,7 +551,7 @@
|
|||
<type>gain</type>
|
||||
<gain>1.0</gain>
|
||||
<update-interval-secs type="double">0.1</update-interval-secs>
|
||||
<input>
|
||||
<input>
|
||||
<expression>
|
||||
<table>
|
||||
<property>/systems/icing/severity</property>
|
||||
|
@ -554,7 +571,7 @@
|
|||
<name>TAS</name>
|
||||
<type>gain</type>
|
||||
<gain>1.0</gain>
|
||||
<input>
|
||||
<input>
|
||||
<expression>
|
||||
<product>
|
||||
<property>velocities/uBody-fps</property>
|
||||
|
@ -616,7 +633,7 @@
|
|||
<type>gain</type>
|
||||
<gain>1.0</gain>
|
||||
<update-interval-secs type="double">0.1</update-interval-secs>
|
||||
<input>
|
||||
<input>
|
||||
<expression>
|
||||
<table>
|
||||
<property>/instrumentation/altimeter/indicated-altitude-ft</property>
|
||||
|
@ -666,7 +683,7 @@
|
|||
<type>gain</type>
|
||||
<gain>1.0</gain>
|
||||
<update-interval-secs type="double">0.1</update-interval-secs>
|
||||
<input>
|
||||
<input>
|
||||
<difference>
|
||||
<property>/environment/temperature-degc</property>
|
||||
<property>/FMGC/internal/ISAtemp</property>
|
||||
|
@ -680,7 +697,7 @@
|
|||
<type>gain</type>
|
||||
<gain>1.0</gain>
|
||||
<update-interval-secs type="double">0.05</update-interval-secs>
|
||||
<input>
|
||||
<input>
|
||||
<expression>
|
||||
<table>
|
||||
<property>/velocities/airspeed-kt</property>
|
||||
|
|
|
@ -1 +1 @@
|
|||
4058
|
||||
4059
|
Reference in a new issue