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-input>0</aileron-input>
<elevator-input>0</elevator-input>
<elevator-trim-fdm>0.0</elevator-trim-fdm>
<flap-pos type="int">0</flap-pos>
<rudder-trim-fdm>0.0</rudder-trim-fdm>
<speedbrake-arm>0</speedbrake-arm>

View file

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

View file

@ -1482,9 +1482,21 @@
</range>
</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">
<input>/controls/flight/elevator-trim-fdm</input>
<c1>0.5</c1>
<input>hydraulics/elevator-trim/actuator</input>
<c1>10.5</c1>
</lag_filter>
<aerosurface_scale name="hydraulics/elevator-trim/final-deg">
@ -1638,7 +1650,7 @@
</aerosurface_scale>
<aerosurface_scale name="hydraulics/rudder/trim-norm">
<input>/controls/flight/rudder-trim-fdm</input>
<input>/controls/flight/rudder-trim</input>
<range>
<min>-0.8</min>
<max>0.8</max>

View file

@ -681,48 +681,6 @@
<output>/controls/flight/auto-coordination</output>
</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 -->
<filter>

View file

@ -1 +1 @@
4673
4674