A3XX: Add Rollout mode to FMGC AP
This commit is contained in:
parent
70399d40a0
commit
312867ac60
6 changed files with 221 additions and 227 deletions
|
@ -20,6 +20,8 @@ setlistener("/sim/signals/fdm-initialized", func {
|
|||
var VS = getprop("/velocities/vertical-speed-fps");
|
||||
var TAS = getprop("/velocities/uBody-fps");
|
||||
var FPangle = 0;
|
||||
var gear1 = getprop("/gear/gear[1]/wow");
|
||||
var gear2 = getprop("/gear/gear[2]/wow");
|
||||
});
|
||||
|
||||
var APinit = func {
|
||||
|
@ -461,7 +463,7 @@ var ap_various = func {
|
|||
}
|
||||
|
||||
if (getprop("/it-autoflight/output/ap1") == 1 or getprop("/it-autoflight/output/ap2") == 1) {
|
||||
if (getprop("/controls/flight/aileron") > 0.4 or getprop("/controls/flight/aileron") < -0.4 or getprop("/controls/flight/elevator") > 0.4 or getprop("/controls/flight/elevator") < -0.4) {
|
||||
if (getprop("/controls/flight/aileron") > 0.3 or getprop("/controls/flight/aileron") < -0.3 or getprop("/controls/flight/elevator") > 0.3 or getprop("/controls/flight/elevator") < -0.3) {
|
||||
setprop("/it-autoflight/input/ap1", 0);
|
||||
setprop("/it-autoflight/input/ap2", 0);
|
||||
}
|
||||
|
@ -782,18 +784,15 @@ var aland1 = func {
|
|||
setprop("/it-autoflight/output/thr-mode", 1);
|
||||
setprop("/it-autoflight/mode/thr", "RETARD");
|
||||
}
|
||||
var gear1 = getprop("/gear/gear[1]/wow");
|
||||
var gear2 = getprop("/gear/gear[2]/wow");
|
||||
gear1 = getprop("/gear/gear[1]/wow");
|
||||
gear2 = getprop("/gear/gear[2]/wow");
|
||||
if (gear1 == 1 or gear2 == 1) {
|
||||
setprop("/it-autoflight/input/ap1", 0);
|
||||
setprop("/it-autoflight/input/ap2", 0);
|
||||
alandt1.stop();
|
||||
setprop("/it-autoflight/mode/lat", "RLOU");
|
||||
setprop("/it-autoflight/mode/vert", "ROLLOUT");
|
||||
}
|
||||
}
|
||||
|
||||
# Autoland Stage 2 Logic (Rollout)
|
||||
# Not yet working, planned.
|
||||
|
||||
# Managed Climb/Descent
|
||||
var mng_main = func {
|
||||
if (getprop("/autopilot/route-manager/route/num") > 0 and getprop("/autopilot/route-manager/active") == 1) {
|
||||
|
|
|
@ -143,8 +143,12 @@ setlistener("/it-autoflight/mode/lat", func {
|
|||
locupdate.start();
|
||||
}
|
||||
} else if (lat == "ALGN") {
|
||||
if (newlat != "LAND") {
|
||||
setprop("/modes/pfd/fma/roll-mode", "LAND");
|
||||
if (newlat != " ") {
|
||||
setprop("/modes/pfd/fma/roll-mode", " ");
|
||||
}
|
||||
} else if (lat == "RLOU") {
|
||||
if (newlat != " ") {
|
||||
setprop("/modes/pfd/fma/roll-mode", " ");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -228,6 +232,10 @@ setlistener("/it-autoflight/mode/vert", func {
|
|||
if (newvert != "FLARE") {
|
||||
setprop("/modes/pfd/fma/pitch-mode", "FLARE");
|
||||
}
|
||||
} else if (vert == "ROLLOUT") {
|
||||
if (newvert != "ROLLOUT") {
|
||||
setprop("/modes/pfd/fma/pitch-mode", "ROLLOUT");
|
||||
}
|
||||
} else if (vert == "T/O CLB") {
|
||||
if (newvertarm != "CLB") {
|
||||
setprop("/modes/pfd/fma/pitch-mode2-armed", "CLB");
|
||||
|
|
|
@ -102,24 +102,38 @@
|
|||
<border>1</border>
|
||||
<label>99999</label>
|
||||
<visible>
|
||||
<or>
|
||||
<equals>
|
||||
<property>/it-autoflight/output/fd1</property>
|
||||
<value>1</value>
|
||||
</equals>
|
||||
<equals>
|
||||
<property>/it-autoflight/output/fd2</property>
|
||||
<value>1</value>
|
||||
</equals>
|
||||
<equals>
|
||||
<property>/it-autoflight/output/ap1</property>
|
||||
<value>1</value>
|
||||
</equals>
|
||||
<equals>
|
||||
<property>/it-autoflight/output/ap2</property>
|
||||
<value>1</value>
|
||||
</equals>
|
||||
</or>
|
||||
<and>
|
||||
<or>
|
||||
<equals>
|
||||
<property>/it-autoflight/output/fd1</property>
|
||||
<value>1</value>
|
||||
</equals>
|
||||
<equals>
|
||||
<property>/it-autoflight/output/fd2</property>
|
||||
<value>1</value>
|
||||
</equals>
|
||||
<equals>
|
||||
<property>/it-autoflight/output/ap1</property>
|
||||
<value>1</value>
|
||||
</equals>
|
||||
<equals>
|
||||
<property>/it-autoflight/output/ap2</property>
|
||||
<value>1</value>
|
||||
</equals>
|
||||
</or>
|
||||
<not-equals>
|
||||
<property>modes/pfd/fma/pitch-mode</property>
|
||||
<value>LAND</value>
|
||||
</not-equals>
|
||||
<not-equals>
|
||||
<property>modes/pfd/fma/pitch-mode</property>
|
||||
<value>FLARE</value>
|
||||
</not-equals>
|
||||
<not-equals>
|
||||
<property>modes/pfd/fma/pitch-mode</property>
|
||||
<value>ROLLOUT</value>
|
||||
</not-equals>
|
||||
</and>
|
||||
</visible>
|
||||
<valign>center</valign>
|
||||
<property>/modes/pfd/fma/roll-mode</property>
|
||||
|
|
|
@ -407,10 +407,20 @@
|
|||
<property>/it-autoflight/output/vert</property>
|
||||
<value>5</value>
|
||||
</equals>
|
||||
<equals>
|
||||
<property>/it-autoflight/output/vert</property>
|
||||
<value>6</value>
|
||||
</equals>
|
||||
<and>
|
||||
<equals>
|
||||
<property>/it-autoflight/output/vert</property>
|
||||
<value>6</value>
|
||||
</equals>
|
||||
<equals>
|
||||
<property>/gear/gear[1]/wow</property>
|
||||
<value>0</value>
|
||||
</equals>
|
||||
<equals>
|
||||
<property>/gear/gear[2]/wow</property>
|
||||
<value>0</value>
|
||||
</equals>
|
||||
</and>
|
||||
<equals>
|
||||
<property>/it-autoflight/output/vert</property>
|
||||
<value>7</value>
|
||||
|
|
|
@ -27,6 +27,21 @@
|
|||
</equals>
|
||||
</condition>
|
||||
</enable>
|
||||
<input>
|
||||
<condition>
|
||||
<or>
|
||||
<equals>
|
||||
<property>/it-autoflight/output/ap1</property>
|
||||
<value>1</value>
|
||||
</equals>
|
||||
<equals>
|
||||
<property>/it-autoflight/output/ap2</property>
|
||||
<value>1</value>
|
||||
</equals>
|
||||
</or>
|
||||
</condition>
|
||||
<value>0</value>
|
||||
</input>
|
||||
<input>/controls/flight/aileron</input>
|
||||
<output>/controls/flight/aileron-input-fast</output>
|
||||
<max-rate-of-change>5</max-rate-of-change>
|
||||
|
@ -43,6 +58,21 @@
|
|||
</equals>
|
||||
</condition>
|
||||
</enable>
|
||||
<input>
|
||||
<condition>
|
||||
<or>
|
||||
<equals>
|
||||
<property>/it-autoflight/output/ap1</property>
|
||||
<value>1</value>
|
||||
</equals>
|
||||
<equals>
|
||||
<property>/it-autoflight/output/ap2</property>
|
||||
<value>1</value>
|
||||
</equals>
|
||||
</or>
|
||||
</condition>
|
||||
<value>0</value>
|
||||
</input>
|
||||
<input>/controls/flight/elevator</input>
|
||||
<output>/controls/flight/elevator-input-fast</output>
|
||||
<max-rate-of-change>5</max-rate-of-change>
|
||||
|
@ -221,19 +251,56 @@
|
|||
</input>
|
||||
<input>
|
||||
<condition>
|
||||
<or>
|
||||
<and>
|
||||
<or>
|
||||
<equals>
|
||||
<property>/it-autoflight/output/ap1</property>
|
||||
<value>1</value>
|
||||
</equals>
|
||||
<equals>
|
||||
<property>/it-autoflight/output/ap2</property>
|
||||
<value>1</value>
|
||||
</equals>
|
||||
</or>
|
||||
<equals>
|
||||
<property>/it-autoflight/output/ap1</property>
|
||||
<value>1</value>
|
||||
<property>/gear/gear[1]/wow</property>
|
||||
<value>0</value>
|
||||
</equals>
|
||||
<equals>
|
||||
<property>/it-autoflight/output/ap2</property>
|
||||
<value>1</value>
|
||||
<property>/gear/gear[2]/wow</property>
|
||||
<value>0</value>
|
||||
</equals>
|
||||
</or>
|
||||
</and>
|
||||
</condition>
|
||||
<property>/it-autoflight/internal/elevator-cmd</property>
|
||||
</input>
|
||||
<input>
|
||||
<condition>
|
||||
<and>
|
||||
<or>
|
||||
<equals>
|
||||
<property>/it-autoflight/output/ap1</property>
|
||||
<value>1</value>
|
||||
</equals>
|
||||
<equals>
|
||||
<property>/it-autoflight/output/ap2</property>
|
||||
<value>1</value>
|
||||
</equals>
|
||||
</or>
|
||||
<or>
|
||||
<equals>
|
||||
<property>/gear/gear[1]/wow</property>
|
||||
<value>1</value>
|
||||
</equals>
|
||||
<equals>
|
||||
<property>/gear/gear[2]/wow</property>
|
||||
<value>1</value>
|
||||
</equals>
|
||||
</or>
|
||||
</and>
|
||||
</condition>
|
||||
<value>0.05</value>
|
||||
</input>
|
||||
<input>
|
||||
<expression>
|
||||
<table>
|
||||
|
@ -441,14 +508,26 @@
|
|||
<input>
|
||||
<condition>
|
||||
<and>
|
||||
<equals>
|
||||
<property>/gear/gear[1]/wow</property>
|
||||
<value>0</value>
|
||||
</equals>
|
||||
<equals>
|
||||
<property>/gear/gear[2]/wow</property>
|
||||
<value>0</value>
|
||||
</equals>
|
||||
<or>
|
||||
<equals>
|
||||
<property>/it-autoflight/output/ap1</property>
|
||||
<value>1</value>
|
||||
</equals>
|
||||
<equals>
|
||||
<property>/it-autoflight/output/ap2</property>
|
||||
<value>1</value>
|
||||
</equals>
|
||||
<and>
|
||||
<equals>
|
||||
<property>/gear/gear[1]/wow</property>
|
||||
<value>0</value>
|
||||
</equals>
|
||||
<equals>
|
||||
<property>/gear/gear[2]/wow</property>
|
||||
<value>0</value>
|
||||
</equals>
|
||||
</and>
|
||||
</or>
|
||||
<equals>
|
||||
<property>/it-fbw/law</property>
|
||||
<value>0</value>
|
||||
|
@ -459,24 +538,34 @@
|
|||
</input>
|
||||
<input>
|
||||
<condition>
|
||||
<or>
|
||||
<and>
|
||||
<equals>
|
||||
<property>/gear/gear[1]/wow</property>
|
||||
<value>1</value>
|
||||
<property>/it-autoflight/output/ap1</property>
|
||||
<value>0</value>
|
||||
</equals>
|
||||
<equals>
|
||||
<property>/gear/gear[2]/wow</property>
|
||||
<value>1</value>
|
||||
<property>/it-autoflight/output/ap2</property>
|
||||
<value>0</value>
|
||||
</equals>
|
||||
<equals>
|
||||
<property>/it-fbw/law</property>
|
||||
<value>1</value>
|
||||
</equals>
|
||||
<equals>
|
||||
<property>/it-fbw/law</property>
|
||||
<value>2</value>
|
||||
</equals>
|
||||
</or>
|
||||
<or>
|
||||
<equals>
|
||||
<property>/gear/gear[1]/wow</property>
|
||||
<value>1</value>
|
||||
</equals>
|
||||
<equals>
|
||||
<property>/gear/gear[2]/wow</property>
|
||||
<value>1</value>
|
||||
</equals>
|
||||
<equals>
|
||||
<property>/it-fbw/law</property>
|
||||
<value>1</value>
|
||||
</equals>
|
||||
<equals>
|
||||
<property>/it-fbw/law</property>
|
||||
<value>2</value>
|
||||
</equals>
|
||||
</or>
|
||||
</and>
|
||||
</condition>
|
||||
<property>/controls/flight/aileron-input-fast</property>
|
||||
</input>
|
||||
|
@ -918,154 +1007,6 @@
|
|||
</config>
|
||||
</pid-controller-->
|
||||
|
||||
<filter>
|
||||
<name>IT-FBW: SPD PITCH TARGET CMD</name>
|
||||
<type>noise-spike</type>
|
||||
<enable>
|
||||
<condition>
|
||||
<and>
|
||||
<equals>
|
||||
<property>/gear/gear[1]/wow</property>
|
||||
<value>0</value>
|
||||
</equals>
|
||||
<equals>
|
||||
<property>/gear/gear[2]/wow</property>
|
||||
<value>0</value>
|
||||
</equals>
|
||||
<equals>
|
||||
<property>/it-fbw/spd-hold</property>
|
||||
<value>1</value>
|
||||
</equals>
|
||||
<or>
|
||||
<equals>
|
||||
<property>/it-fbw/law</property>
|
||||
<value>0</value>
|
||||
</equals>
|
||||
<equals>
|
||||
<property>/it-fbw/law</property>
|
||||
<value>1</value>
|
||||
</equals>
|
||||
</or>
|
||||
</and>
|
||||
</condition>
|
||||
</enable>
|
||||
<input>
|
||||
<expression>
|
||||
<table>
|
||||
<property>/controls/flight/elevator-input</property>
|
||||
<entry><ind> 0</ind><dep>129</dep></entry>
|
||||
<entry><ind>-1</ind><dep>106</dep></entry>
|
||||
</table>
|
||||
</expression>
|
||||
</input>
|
||||
<output>/it-fbw/spd-pitch-target</output>
|
||||
<max-rate-of-change>10</max-rate-of-change>
|
||||
</filter>
|
||||
|
||||
<pid-controller>
|
||||
<name>IT-FBW: SPD PITCH TARGET</name>
|
||||
<debug>false</debug>
|
||||
<enable>
|
||||
<condition>
|
||||
<and>
|
||||
<equals>
|
||||
<property>/gear/gear[1]/wow</property>
|
||||
<value>0</value>
|
||||
</equals>
|
||||
<equals>
|
||||
<property>/gear/gear[2]/wow</property>
|
||||
<value>0</value>
|
||||
</equals>
|
||||
<equals>
|
||||
<property>/it-fbw/spd-hold</property>
|
||||
<value>1</value>
|
||||
</equals>
|
||||
<or>
|
||||
<equals>
|
||||
<property>/it-fbw/law</property>
|
||||
<value>0</value>
|
||||
</equals>
|
||||
<equals>
|
||||
<property>/it-fbw/law</property>
|
||||
<value>1</value>
|
||||
</equals>
|
||||
</or>
|
||||
</and>
|
||||
</condition>
|
||||
</enable>
|
||||
<input>
|
||||
<property>/it-autoflight/internal/lookahead-10-sec-airspeed-kt</property>
|
||||
</input>
|
||||
<reference>
|
||||
<property>/it-fbw/spd-pitch-target</property>
|
||||
</reference>
|
||||
<output>
|
||||
<property>/it-fbw/spd-pitch-deg</property>
|
||||
</output>
|
||||
<config>
|
||||
<Kp>-0.50</Kp>
|
||||
<beta>1.0</beta>
|
||||
<alpha>0.1</alpha>
|
||||
<gamma>0.0</gamma>
|
||||
<Ti>5.0</Ti>
|
||||
<Td>0.0001</Td>
|
||||
<u_min>-10</u_min>
|
||||
<u_max>30</u_max>
|
||||
</config>
|
||||
</pid-controller>
|
||||
|
||||
<pid-controller>
|
||||
<name>IT-FBW: SPD PITCH</name>
|
||||
<debug>false</debug>
|
||||
<enable>
|
||||
<condition>
|
||||
<and>
|
||||
<equals>
|
||||
<property>/gear/gear[1]/wow</property>
|
||||
<value>0</value>
|
||||
</equals>
|
||||
<equals>
|
||||
<property>/gear/gear[2]/wow</property>
|
||||
<value>0</value>
|
||||
</equals>
|
||||
<equals>
|
||||
<property>/it-fbw/spd-hold</property>
|
||||
<value>1</value>
|
||||
</equals>
|
||||
<or>
|
||||
<equals>
|
||||
<property>/it-fbw/law</property>
|
||||
<value>0</value>
|
||||
</equals>
|
||||
<equals>
|
||||
<property>/it-fbw/law</property>
|
||||
<value>1</value>
|
||||
</equals>
|
||||
</or>
|
||||
</and>
|
||||
</condition>
|
||||
</enable>
|
||||
<input>
|
||||
<property>/orientation/pitch-deg</property>
|
||||
</input>
|
||||
<reference>
|
||||
<property>/it-fbw/spd-pitch-deg</property>
|
||||
</reference>
|
||||
<output>
|
||||
<property>/controls/flight/elevator-fbw-cmd</property>
|
||||
</output>
|
||||
<config>
|
||||
<Kp>-0.08</Kp>
|
||||
<beta>1</beta>
|
||||
<alpha>0.1</alpha>
|
||||
<gamma>0</gamma>
|
||||
<Ti>5</Ti>
|
||||
<Td>0.001</Td>
|
||||
<u_min>-1</u_min>
|
||||
<u_max>1</u_max>
|
||||
</config>
|
||||
</pid-controller>
|
||||
|
||||
<filter>
|
||||
<name>IT-FBW: PITCH OPTION</name>
|
||||
<debug>false</debug>
|
||||
|
@ -1076,14 +1017,26 @@
|
|||
<input>
|
||||
<condition>
|
||||
<and>
|
||||
<equals>
|
||||
<property>/gear/gear[1]/wow</property>
|
||||
<value>0</value>
|
||||
</equals>
|
||||
<equals>
|
||||
<property>/gear/gear[2]/wow</property>
|
||||
<value>0</value>
|
||||
</equals>
|
||||
<or>
|
||||
<equals>
|
||||
<property>/it-autoflight/output/ap1</property>
|
||||
<value>1</value>
|
||||
</equals>
|
||||
<equals>
|
||||
<property>/it-autoflight/output/ap2</property>
|
||||
<value>1</value>
|
||||
</equals>
|
||||
<and>
|
||||
<equals>
|
||||
<property>/gear/gear[1]/wow</property>
|
||||
<value>0</value>
|
||||
</equals>
|
||||
<equals>
|
||||
<property>/gear/gear[2]/wow</property>
|
||||
<value>0</value>
|
||||
</equals>
|
||||
</and>
|
||||
</or>
|
||||
<or>
|
||||
<equals>
|
||||
<property>/it-fbw/law</property>
|
||||
|
@ -1100,20 +1053,30 @@
|
|||
</input>
|
||||
<input>
|
||||
<condition>
|
||||
<or>
|
||||
<and>
|
||||
<equals>
|
||||
<property>/gear/gear[1]/wow</property>
|
||||
<value>1</value>
|
||||
<property>/it-autoflight/output/ap1</property>
|
||||
<value>0</value>
|
||||
</equals>
|
||||
<equals>
|
||||
<property>/gear/gear[2]/wow</property>
|
||||
<value>1</value>
|
||||
<property>/it-autoflight/output/ap2</property>
|
||||
<value>0</value>
|
||||
</equals>
|
||||
<equals>
|
||||
<property>/it-fbw/law</property>
|
||||
<value>2</value>
|
||||
</equals>
|
||||
</or>
|
||||
<or>
|
||||
<equals>
|
||||
<property>/gear/gear[1]/wow</property>
|
||||
<value>1</value>
|
||||
</equals>
|
||||
<equals>
|
||||
<property>/gear/gear[2]/wow</property>
|
||||
<value>1</value>
|
||||
</equals>
|
||||
<equals>
|
||||
<property>/it-fbw/law</property>
|
||||
<value>2</value>
|
||||
</equals>
|
||||
</or>
|
||||
</and>
|
||||
</condition>
|
||||
<property>/controls/flight/elevator-input-fast</property>
|
||||
</input>
|
||||
|
|
|
@ -1 +1 @@
|
|||
2111
|
||||
2112
|
Reference in a new issue