Control: Rework trim system, fix bugs

This commit is contained in:
Joshua Davidson 2018-10-15 16:29:00 -04:00
parent edb46c17e9
commit d3a35b41c9
5 changed files with 25 additions and 60 deletions

View file

@ -582,7 +582,6 @@
<aileron-drives-tiller type="bool">0</aileron-drives-tiller> <aileron-drives-tiller type="bool">0</aileron-drives-tiller>
<aileron-input>0</aileron-input> <aileron-input>0</aileron-input>
<elevator-input>0</elevator-input> <elevator-input>0</elevator-input>
<elevator-trim-fdm>0.0</elevator-trim-fdm>
<flap-pos type="int">0</flap-pos> <flap-pos type="int">0</flap-pos>
<rudder-trim-fdm>0.0</rudder-trim-fdm> <rudder-trim-fdm>0.0</rudder-trim-fdm>
<speedbrake-arm>0</speedbrake-arm> <speedbrake-arm>0</speedbrake-arm>

View file

@ -4895,11 +4895,9 @@
<button>3</button> <button>3</button>
<repeatable type="bool">true</repeatable> <repeatable type="bool">true</repeatable>
<binding> <binding>
<command>nasal</command> <command>property-adjust</command>
<script> <property>/controls/flight/elevator-trim</property>
var trim = getprop("/controls/flight/elevator-trim"); <step>0.01</step>
setprop("/controls/flight/elevator-trim", trim - 0.01);
</script>
</binding> </binding>
</action> </action>
<action> <action>
@ -4907,11 +4905,9 @@
<button>4</button> <button>4</button>
<repeatable type="bool">true</repeatable> <repeatable type="bool">true</repeatable>
<binding> <binding>
<command>nasal</command> <command>property-adjust</command>
<script> <property>/controls/flight/elevator-trim</property>
var trim = getprop("/controls/flight/elevator-trim"); <step>-0.01</step>
setprop("/controls/flight/elevator-trim", trim + 0.01);
</script>
</binding> </binding>
</action> </action>
</animation> </animation>
@ -4920,8 +4916,8 @@
<type>rotate</type> <type>rotate</type>
<object-name>trim_2_lts</object-name> <object-name>trim_2_lts</object-name>
<property>fdm/jsbsim/hydraulics/elevator-trim/cmd-deg</property> <property>fdm/jsbsim/hydraulics/elevator-trim/cmd-deg</property>
<factor>-15.55</factor> <factor>15.55</factor>
<offset-deg>-0.9</offset-deg> <offset-deg>1.4</offset-deg>
<axis> <axis>
<object-name>trim.axis</object-name> <object-name>trim.axis</object-name>
</axis> </axis>
@ -4931,7 +4927,7 @@
<type>rotate</type> <type>rotate</type>
<object-name>trim_1</object-name> <object-name>trim_1</object-name>
<property>controls/flight/elevator-trim</property> <property>controls/flight/elevator-trim</property>
<factor>-1000</factor> <factor>1000</factor>
<axis> <axis>
<object-name>trim.axis</object-name> <object-name>trim.axis</object-name>
</axis> </axis>

View file

@ -1482,9 +1482,21 @@
</range> </range>
</aerosurface_scale> </aerosurface_scale>
<switch name="hydraulics/elevator-trim/rate">
<default value="0.01"/>
<test value="0.02">
/systems/hydraulic/green-psi ge 1500
</test>
</switch>
<actuator name="hydraulics/elevator-trim/actuator">
<input>/controls/flight/elevator-trim</input>
<rate_limit>hydraulics/elevator-trim/rate</rate_limit>
</actuator>
<lag_filter name="hydraulics/elevator-trim/lag"> <lag_filter name="hydraulics/elevator-trim/lag">
<input>/controls/flight/elevator-trim-fdm</input> <input>hydraulics/elevator-trim/actuator</input>
<c1>0.5</c1> <c1>10.5</c1>
</lag_filter> </lag_filter>
<aerosurface_scale name="hydraulics/elevator-trim/final-deg"> <aerosurface_scale name="hydraulics/elevator-trim/final-deg">
@ -1638,7 +1650,7 @@
</aerosurface_scale> </aerosurface_scale>
<aerosurface_scale name="hydraulics/rudder/trim-norm"> <aerosurface_scale name="hydraulics/rudder/trim-norm">
<input>/controls/flight/rudder-trim-fdm</input> <input>/controls/flight/rudder-trim</input>
<range> <range>
<min>-0.8</min> <min>-0.8</min>
<max>0.8</max> <max>0.8</max>

View file

@ -681,48 +681,6 @@
<output>/controls/flight/auto-coordination</output> <output>/controls/flight/auto-coordination</output>
</filter> </filter>
<filter>
<debug>false</debug>
<type>noise-spike</type>
<enable>
<condition>
<greater-than-equals>
<property>/systems/hydraulic/green-psi</property>
<value>1500</value>
</greater-than-equals>
</condition>
</enable>
<input>/controls/flight/elevator-trim</input>
<output>/controls/flight/elevator-trim-fdm</output>
<max-rate-of-change>0.1</max-rate-of-change>
</filter>
<filter>
<debug>false</debug>
<type>noise-spike</type>
<enable>
<condition>
<or>
<greater-than-equals>
<property>/systems/hydraulic/green-psi</property>
<value>1500</value>
</greater-than-equals>
<greater-than-equals>
<property>/systems/hydraulic/blue-psi</property>
<value>1500</value>
</greater-than-equals>
<greater-than-equals>
<property>/systems/hydraulic/yellow-psi</property>
<value>1500</value>
</greater-than-equals>
</or>
</condition>
</enable>
<input>/controls/flight/rudder-trim</input>
<output>/controls/flight/rudder-trim-fdm</output>
<max-rate-of-change>0.5</max-rate-of-change>
</filter>
<!-- Braking --> <!-- Braking -->
<filter> <filter>

View file

@ -1 +1 @@
4673 4674