A3XX: Improve Autobrake system
This commit is contained in:
parent
204b2a0a89
commit
48a5a19b97
5 changed files with 33 additions and 9 deletions
|
@ -494,6 +494,11 @@
|
|||
<start type="bool">0</start>
|
||||
<bleed type="bool">0</bleed>
|
||||
</APU>
|
||||
<autobrake>
|
||||
<active type="bool">0</active>
|
||||
<brake-left type="double">0</brake-left>
|
||||
<brake-right type="double">0</brake-right>
|
||||
</autobrake>
|
||||
<electric>
|
||||
<avionics-switch type="bool">true</avionics-switch>
|
||||
</electric>
|
||||
|
|
|
@ -21,13 +21,9 @@ var autobrake_init = func {
|
|||
setprop("/controls/autobrake/mode", 0);
|
||||
}
|
||||
|
||||
# Override FG's generic brake, so we can use toe brakes to disconnect autobrake
|
||||
# Override FG's generic brake
|
||||
controls.applyBrakes = func(v, which = 0) {
|
||||
if (getprop("/systems/acconfig/autoconfig-running") != 1) {
|
||||
wow0 = getprop("/gear/gear[0]/wow");
|
||||
if (getprop("/controls/autobrake/mode") != 0 and wow0 == 1 and getprop("/controls/autobrake/active") == 1) {
|
||||
arm_autobrake(0);
|
||||
}
|
||||
if (which <= 0) {
|
||||
interpolate("/controls/gear/brake-left", v, 0.5);
|
||||
}
|
||||
|
@ -64,7 +60,7 @@ var arm_autobrake = func(mode) {
|
|||
}
|
||||
}
|
||||
|
||||
# Autobrake enable if armed
|
||||
# Autobrake loop
|
||||
var absChk = maketimer(0.2, func {
|
||||
thr1 = getprop("/controls/engines/engine[0]/throttle");
|
||||
thr2 = getprop("/controls/engines/engine[1]/throttle");
|
||||
|
@ -82,4 +78,7 @@ var absChk = maketimer(0.2, func {
|
|||
if (getprop("/controls/autobrake/mode") == 3 and getprop("/controls/gear/gear-down") == 0) {
|
||||
arm_autobrake(0);
|
||||
}
|
||||
if (getprop("/controls/autobrake/mode") != 0 and wow0 == 1 and getprop("/controls/autobrake/active") == 1 and (getprop("/controls/gear/brake-left") > 0.05 or getprop("/controls/gear/brake-right") > 0.05)) {
|
||||
arm_autobrake(0);
|
||||
}
|
||||
});
|
||||
|
|
|
@ -824,5 +824,25 @@
|
|||
</actuator>
|
||||
|
||||
</channel>
|
||||
|
||||
<channel name="Brakes">
|
||||
|
||||
<switch name="rubbish/left-brake-cmd-norm">
|
||||
<default value="/controls/gear/brake-left"/>
|
||||
<test value="/controls/autobrake/brake-left">
|
||||
/controls/autobrake/active EQ 1
|
||||
</test>
|
||||
<output>fcs/left-brake-cmd-norm</output>
|
||||
</switch>
|
||||
|
||||
<switch name="rubbish/right-brake-cmd-norm">
|
||||
<default value="/controls/gear/brake-right"/>
|
||||
<test value="/controls/autobrake/brake-right">
|
||||
/controls/autobrake/active EQ 1
|
||||
</test>
|
||||
<output>fcs/right-brake-cmd-norm</output>
|
||||
</switch>
|
||||
|
||||
</channel>
|
||||
|
||||
</system>
|
||||
|
|
|
@ -1573,8 +1573,8 @@
|
|||
<property>/controls/autobrake/decel-rate</property>
|
||||
</reference>
|
||||
<output>
|
||||
<property>/controls/gear/brake-left</property>
|
||||
<property>/controls/gear/brake-right</property>
|
||||
<property>/controls/autobrake/brake-left</property>
|
||||
<property>/controls/autobrake/brake-right</property>
|
||||
</output>
|
||||
<config>
|
||||
<Kp>0.45</Kp>
|
||||
|
|
|
@ -1 +1 @@
|
|||
4315
|
||||
4316
|
Reference in a new issue