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,7 +17,7 @@
|
|||
<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>
|
||||
<expression>
|
||||
|
@ -34,7 +34,7 @@
|
|||
<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>
|
||||
<expression>
|
||||
|
@ -1853,7 +1853,7 @@
|
|||
<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>
|
||||
<expression>
|
||||
|
@ -1872,7 +1872,7 @@
|
|||
<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>
|
||||
<expression>
|
||||
|
@ -1895,7 +1895,7 @@
|
|||
<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>
|
||||
<expression>
|
||||
|
@ -1914,7 +1914,7 @@
|
|||
<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>
|
||||
<expression>
|
||||
|
@ -1931,7 +1931,7 @@
|
|||
<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>
|
||||
<expression>
|
||||
|
@ -1950,7 +1950,7 @@
|
|||
<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>
|
||||
<expression>
|
||||
|
@ -1967,7 +1967,7 @@
|
|||
<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>
|
||||
<expression>
|
||||
|
@ -1986,7 +1986,7 @@
|
|||
<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>
|
||||
<expression>
|
||||
|
@ -2003,7 +2003,7 @@
|
|||
<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>
|
||||
<expression>
|
||||
|
@ -2017,4 +2017,52 @@
|
|||
<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,11 +8,29 @@
|
|||
|
||||
<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>
|
||||
<expression>
|
||||
<dif>
|
||||
|
@ -30,7 +48,6 @@
|
|||
<name>Gear AGL Altitude M</name>
|
||||
<type>gain</type>
|
||||
<gain>1.0</gain>
|
||||
<update-interval-secs type="double">0.05</update-interval-secs>
|
||||
<input>
|
||||
<expression>
|
||||
<product>
|
||||
|
|
|
@ -1 +1 @@
|
|||
4058
|
||||
4059
|
Reference in a new issue