1
0
Fork 0

Control: Add support for seperated tiller, and fix NWS to match FCOM, fixes #3

This commit is contained in:
Josh Davidson 2020-05-24 14:40:06 -04:00
parent f0915ad5e0
commit af2ff9c847
6 changed files with 171 additions and 40 deletions

View file

@ -485,6 +485,7 @@
<y alias="/sim/model/autopush/force-y"/>
</tractor>
</external_reactions>
<zero type="int">0</zero>
</jsbsim>
</fdm>
@ -929,7 +930,10 @@
<systems>
<acconfig n="0">
<autoconfig-running>0</autoconfig-running>
<autoconfig-running type="bool">0</autoconfig-running>
<options n="0">
<seperate-tiller-axis type="bool">0</seperate-tiller-axis>
</options>
</acconfig>
<atc>
<transponder-code type="string">2000</transponder-code>

View file

@ -98,6 +98,7 @@ setprop("/systems/acconfig/options/allow-oil-consumption", 0);
setprop("/systems/acconfig/options/welcome-skip", 0);
setprop("/systems/acconfig/options/no-rendering-warn", 0);
setprop("/systems/acconfig/options/save-state", 0);
setprop("/systems/acconfig/options/seperate-tiller-axis", 0);
setprop("/systems/acconfig/options/pfd-rate", 1);
setprop("/systems/acconfig/options/nd-rate", 1);
setprop("/systems/acconfig/options/uecam-rate", 1);

View file

@ -466,10 +466,30 @@
</binding>
<live>true</live>
</checkbox>
<checkbox>
<label>Use Seperate Tiller Axis</label>
<halign>left</halign>
<property>/systems/acconfig/options/seperate-tiller-axis</property>
<binding>
<command>property-toggle</command>
<property>/systems/acconfig/options/seperate-tiller-axis</property>
</binding>
<binding>
<command>dialog-apply</command>
</binding>
<binding>
<command>nasal</command>
<script>
acconfig.writeSettings();
</script>
</binding>
<live>true</live>
</checkbox>
<checkbox>
<!-- TODO there might be a better way to formulate this. -->
<label>Save states between sessions</label>
<label>Save States Between Sessions</label>
<halign>left</halign>
<property>/systems/acconfig/options/save-state</property>
<binding>

View file

@ -6596,8 +6596,8 @@
<animation>
<type>rotate</type>
<object-name>tiller</object-name>
<property>fdm/jsbsim/fbw/rudder-pedal</property>
<factor>-70</factor>
<property>fdm/jsbsim/fbw/tiller-handle</property>
<factor>-75</factor>
<axis>
<object-name>tiller.axis</object-name>
</axis>
@ -6605,8 +6605,8 @@
<animation>
<type>rotate</type>
<object-name>tillerFo</object-name>
<property>fdm/jsbsim/fbw/rudder-pedal</property>
<factor>-70</factor>
<property>fdm/jsbsim/fbw/tiller-handle</property>
<factor>-75</factor>
<axis>
<object-name>tillerFo.axis</object-name>
</axis>

View file

@ -719,15 +719,148 @@
<channel name="Tiller">
<switch name="hydraulics/tiller/switch">
<switch name="/controls/gear/steering-switched">
<default value="/controls/flight/rudder"/>
<test logic="AND" value="/controls/flight/aileron">
fbw/fmgc/enabled eq 0
<test value="0">
/gear/gear[0]/wow ne 1
</test>
<test value="/controls/gear/steering">
/systems/acconfig/options/seperate-tiller-axis eq 1
</test>
<test value="/controls/flight/aileron">
/controls/flight/aileron-drives-tiller eq 1
</test>
<test value="fbw/fmgc/yaw-cmd">
</switch>
<lag_filter name="fbw/tiller-handle">
<input>/controls/gear/steering-switched</input>
<c1>20</c1>
</lag_filter>
<pure_gain name="/controls/gear/steering-deg">
<input>/controls/gear/steering</input>
<gain>75</gain>
</pure_gain>
<pure_gain name="hydraulics/tiller/autopush-cmd-deg">
<input>hydraulics/tiller/autopush-cmd</input>
<gain>75</gain>
</pure_gain>
<fcs_function name="hydraulics/tiller/fmgc-cmd-gain">
<function>
<table>
<independentVar lookup="row">/velocities/groundspeed-kt</independentVar>
<tableData>
0.5 0
1.0 6
40.0 6
130.0 0
</tableData>
</table>
</function>
</fcs_function>
<pure_gain name="hydraulics/tiller/fmgc-cmd-deg">
<input>fbw/fmgc/yaw-cmd</input>
<gain>hydraulics/tiller/fmgc-cmd-gain</gain>
</pure_gain>
<switch name="hydraulics/tiller/rudder-cmd-input">
<default value="/controls/flight/rudder"/>
<test value="/controls/flight/aileron">
/controls/flight/aileron-drives-tiller eq 1
</test>
</switch>
<pure_gain name="hydraulics/tiller/rudder-cmd-input-deg">
<input>hydraulics/tiller/rudder-cmd-input</input>
<gain>75</gain>
</pure_gain>
<fcs_function name="hydraulics/tiller/rudder-cmd-deg"> <!-- Combines rudder and tiller into just rudder (or aileron) -->
<function>
<table>
<independentVar lookup="row">zero</independentVar> <!-- Take advantage of the table lookup to interpolate -->
<independentVar lookup="column">hydraulics/tiller/rudder-cmd-input-deg</independentVar>
<independentVar lookup="table">/velocities/groundspeed-kt</independentVar>
<tableData breakPoint="0.5">
-75 -66 -40 -20 -1 1 20 40 66 75
0 0 0 0 0 0 0 0 0 0 0
1 0 0 0 0 0 0 0 0 0 0
</tableData>
<tableData breakPoint="1.0">
-75 -66 -40 -20 -1 1 20 40 66 75
0 -75 -45 -15 -4 0 0 4 15 45 75
1 -75 -45 -15 -4 0 0 4 15 45 75
</tableData>
<tableData breakPoint="20.0">
-75 -66 -40 -20 -1 1 20 40 66 75
0 -75 -45 -15 -4 0 0 4 15 45 75
1 -75 -45 -15 -4 0 0 4 15 45 75
</tableData>
<tableData breakPoint="40.0">
-75 -1 1 75
0 -6 0 0 6
1 -6 0 0 6
</tableData>
<tableData breakPoint="130.0">
-75 -1 1 75
0 0 0 0 0
1 0 0 0 0
</tableData>
</table>
</function>
</fcs_function>
<fcs_function name="hydraulics/tiller/tiller-cmd-deg">
<function>
<sum>
<table>
<independentVar lookup="row">/velocities/groundspeed-kt</independentVar>
<independentVar lookup="column">/controls/gear/steering-deg</independentVar>
<tableData>
-75 -66 -40 -20 -1 1 20 40 66 75
0.5 0 0 0 0 0 0 0 0 0 0
1.0 -75 -45 -15 -4 0 0 4 15 45 75
20.0 -75 -45 -15 -4 0 0 4 15 45 75
70.0 0 0 0 0 0 0 0 0 0 0
</tableData>
</table>
<product>
<property>hydraulics/tiller/rudder-cmd-input</property>
<table>
<independentVar lookup="row">/velocities/groundspeed-kt</independentVar>
<tableData>
0.5 0
1.0 6
40.0 6
130.0 0
</tableData>
</table>
</product>
</sum>
</function>
</fcs_function>
<switch name="hydraulics/tiller/cmd-deg">
<default value="hydraulics/tiller/rudder-cmd-deg"/>
<test value="0">
/gear/gear[0]/wow ne 1
</test>
<test value="hydraulics/tiller/autopush-cmd-deg">
/sim/model/autopush/connected eq 1
</test>
<test value="hydraulics/tiller/fmgc-cmd-deg">
fbw/fmgc/enabled eq 1
</test>
<test value="hydraulics/tiller/tiller-cmd-deg">
/systems/acconfig/options/seperate-tiller-axis eq 1
</test>
<clipto>
<min>-75</min>
<max>75</max>
</clipto>
</switch>
<switch name="hydraulics/tiller/elec-pwr">
@ -755,46 +888,19 @@
</test>
</switch>
<fcs_function name="hydraulics/tiller/function">
<function>
<ifthen>
<eq>
<property>/sim/model/autopush/connected</property>
<value>1</value>
</eq>
<product>
<property>hydraulics/tiller/autopush-cmd</property>
<value>75</value>
</product>
<table>
<independentVar lookup="row">/velocities/groundspeed-kt</independentVar>
<independentVar lookup="column">hydraulics/tiller/switch</independentVar>
<tableData>
-1 0 1
0.500 0 0 0
1.000 -75 0 75
30.000 -47 0 47
30.001 -6 0 6
135.000 0 0 0
</tableData>
</table>
</ifthen>
</function>
</fcs_function>
<switch name="fcs/steer-rate">
<default value="0"/>
<test logic="OR" value="75">
/sim/model/autopush/connected eq 1
/systems/acconfig/autoconfig-running eq 1
</test>
<test logic="OR" value="12">
<test logic="OR" value="75"> <!-- 12 is way too slow, maybe that was meant for half powered? -->
hydraulics/tiller/hyd-pwr eq 1
</test>
</switch>
<actuator name="fcs/steer-deg">
<input>hydraulics/tiller/function</input>
<input>hydraulics/tiller/cmd-deg</input>
<rate_limit>fcs/steer-rate</rate_limit>
<output>fcs/steer-pos-deg[0]</output>
</actuator>

View file

@ -1 +1 @@
34
35