A3XX: Automatic Bank Limits

This commit is contained in:
Joshua Davidson 2017-06-19 15:44:00 -04:00
parent 06c88fb418
commit f0f63c2f8f
4 changed files with 26 additions and 38 deletions

View file

@ -700,7 +700,7 @@ canvas.NDStyles["Airbus"] = {
init: func(nd,symbol),
predicate: func(nd) nd.aircraft_source.get_spd() > 100,
is_true: func(nd) {
nd.symbols.tas.setText(sprintf("%3.0f",getprop("/fdm/jsbsim/velocities/vtrue-kts") ));
nd.symbols.tas.setText(sprintf("%3.0f",getprop("/instrumentation/airspeed-indicator/true-speed-kt") ));
nd.symbols.tas.show();
},
is_false: func(nd) nd.symbols.tas.hide(),

View file

@ -20,7 +20,6 @@ var APinit = func {
setprop("/it-autoflight/input/lat", 5);
setprop("/it-autoflight/input/lat-arm", 0);
setprop("/it-autoflight/input/vert", 7);
setprop("/it-autoflight/input/bank-limit", 25);
setprop("/it-autoflight/input/trk", 0);
setprop("/it-autoflight/input/toga", 0);
setprop("/it-autoflight/input/spd-managed", 0);

View file

@ -211,6 +211,15 @@ var librariesLoop = maketimer(0.1, func {
} else {
setprop("/systems/shake/effect", 0);
}
var trueSpeedKts = getprop("/instrumentation/airspeed-indicator/true-speed-kt");
if(trueSpeedKts > 370) {
setprop("/it-autoflight/internal/bank-limit", 15);
} else if(trueSpeedKts > 300) {
setprop("/it-autoflight/internal/bank-limit", 20);
} else {
setprop("/it-autoflight/internal/bank-limit", 25);
}
});
var variousReset = func {

View file

@ -63,41 +63,11 @@
</Kp>
<Ki>0.0</Ki>
<min>
<condition>
<not-equals>
<property>/it-autoflight/output/lat</property>
<value>1</value>
</not-equals>
</condition>
<property>/it-autoflight/input/bank-limit</property>
<property>/it-autoflight/internal/bank-limit</property>
<scale>-1</scale>
</min>
<min>
<condition>
<equals>
<property>/it-autoflight/output/lat</property>
<value>1</value>
</equals>
</condition>
<value>-25</value>
</min>
<max>
<condition>
<not-equals>
<property>/it-autoflight/output/lat</property>
<value>1</value>
</not-equals>
</condition>
<property>/it-autoflight/input/bank-limit</property>
</max>
<max>
<condition>
<equals>
<property>/it-autoflight/output/lat</property>
<value>1</value>
</equals>
</condition>
<value>25</value>
<property>/it-autoflight/internal/bank-limit</property>
</max>
</config>
</pi-simple-controller>
@ -166,8 +136,13 @@
<gamma>0.0</gamma>
<Ti>10.0</Ti>
<Td>0.00001</Td>
<u_min>-25</u_min>
<u_max>25</u_max>
<u_min>
<property>/it-autoflight/internal/bank-limit</property>
<scale>-1</scale>
</u_min>
<u_max>
<property>/it-autoflight/internal/bank-limit</property>
</u_max>
</config>
</pid-controller>
@ -200,8 +175,13 @@
</enable>
<input>/orientation/roll-deg</input>
<output>/it-autoflight/internal/target-roll-deg</output>
<min>-25</min>
<max>25</max>
<min>
<property>/it-autoflight/internal/bank-limit</property>
<scale>-1</scale>
</min>
<max>
<property>/it-autoflight/internal/bank-limit</property>
</max>
</filter>
<filter>