ALS technical notes: Difference between revisions

Jump to navigation Jump to search
Line 423: Line 423:




Another method when using JSBSIM would be to use a combination of FCS Functions and Filters
Another method when using JSBSIM would be to use a combination of FCS Functions and Filters.


<syntaxhighlight lang="xml">
<syntaxhighlight lang="xml">
Line 506: Line 506:
</syntaxhighlight>
</syntaxhighlight>


You could reduce the above method to
You could reduce the above method and eliminate the "filters" by doing the following.
<syntaxhighlight lang="xml">
<syntaxhighlight lang="xml">
<?xml version="1.0"?>
<?xml version="1.0"?>
Line 556: Line 556:
     </channel>
     </channel>
</system>
</system>
</syntaxhighlight>
Yet another method (currently used in the c172p) limits movement to a range of table entries. This gives the developer the ability to control the behavior even more.
<syntaxhighlight lang="xml">
<PropertyList>
    <filter>
        <name>splash-xa</name>
        <update-interval-secs type="double">0.1</update-interval-secs>
        <type>gain</type>
        <gain>1.0</gain>
        <input>
            <expression>
                <table>
                    <property>/velocities/airspeed-kt</property>
                    <entry><ind>  0 </ind><dep> -0.33 </dep></entry>
                    <entry><ind>  4 </ind><dep> -0.33 </dep></entry>
                    <entry><ind>  5 </ind><dep> -1.7  </dep></entry>
                    <entry><ind>  50 </ind><dep> -2.1  </dep></entry>
                </table>
            </expression>
        </input>
        <output>
            <property>/environment/aircraft-effects/splash-xa</property>
        </output>
    </filter>
    <filter>
        <name>splash-za</name>
        <update-interval-secs type="double">0.1</update-interval-secs>
        <type>gain</type>
        <gain>1.0</gain>
        <input>
            <expression>
                <table>
                    <property>/velocities/airspeed-kt</property>
                    <entry><ind>  0 </ind><dep>  0.82 </dep></entry>
                    <entry><ind>  4 </ind><dep>  0.82 </dep></entry>
                    <entry><ind>  5 </ind><dep> -0.17 </dep></entry>
                    <entry><ind>  50 </ind><dep> -0.35 </dep></entry>
                </table>
            </expression>
        </input>
        <output>
            <property>/environment/aircraft-effects/splash-za</property>
        </output>
    </filter>
    <filter>
        <name>splash-xr</name>
        <update-interval-secs type="double">0.1</update-interval-secs>
        <type>gain</type>
        <gain>1.0</gain>
        <input>
            <expression>
                <table>
                    <property>/engines/active-engine/rpm</property>
                    <entry><ind>    0 </ind><dep> -0.33 </dep></entry>
                    <entry><ind>  600 </ind><dep> -0.33 </dep></entry>
                    <entry><ind>  601 </ind><dep> -1.3  </dep></entry>
                    <entry><ind> 1500 </ind><dep> -1.9  </dep></entry>
                </table>
            </expression>
        </input>
        <output>
            <property>/environment/aircraft-effects/splash-xr</property>
        </output>
    </filter>
    <filter>
        <name>splash-zr</name>
        <update-interval-secs type="double">0.1</update-interval-secs>
        <type>gain</type>
        <gain>1.0</gain>
        <input>
            <expression>
                <table>
                    <property>/engines/active-engine/rpm</property>
                    <entry><ind>    0 </ind><dep>  0.82  </dep></entry>
                    <entry><ind>  600 </ind><dep>  0.82  </dep></entry>
                    <entry><ind>  601 </ind><dep>  0.127 </dep></entry>
                    <entry><ind> 1500 </ind><dep> -0.29  </dep></entry>
                </table>0
            </expression>
        </input>
        <output>
            <property>/environment/aircraft-effects/splash-zr</property>
        </output>
    </filter>
    <filter>
        <name>splash-x</name>
        <update-interval-secs type="double">0.1</update-interval-secs>
        <type>gain</type>
        <gain>1.0</gain>
        <input>
            <condition>
                <greater-than-equals>
                    <property>/velocities/airspeed-kt</property>
                    <value>5</value>
                </greater-than-equals>
            </condition>
            <property>/environment/aircraft-effects/splash-xa</property>
        </input>
        <input>
            <condition>
                <less-than>
                    <property>/velocities/airspeed-kt</property>
                    <value>5</value>
                </less-than>
            </condition>
            <property>/environment/aircraft-effects/splash-xr</property>
        </input>
        <output>
            <property>/environment/aircraft-effects/splash-vector-x</property>
        </output>
    </filter>
    <filter>
        <name>splash-y</name>
        <update-interval-secs type="double">0.1</update-interval-secs>
        <type>gain</type>
        <gain>1.0</gain>
        <input>
            <value>0.0</value>
        </input>
        <output>
            <property>/environment/aircraft-effects/splash-vector-y</property>
        </output>
    </filter>
    <filter>
        <name>splash-z</name>
        <update-interval-secs type="double">0.1</update-interval-secs>
        <type>gain</type>
        <gain>1.0</gain>
        <input>
            <condition>
                <greater-than-equals>
                    <property>/velocities/airspeed-kt</property>
                    <value>5</value>
                </greater-than-equals>
            </condition>
            <property>/environment/aircraft-effects/splash-za</property>
        </input>
        <input>
            <condition>
                <less-than>
                    <property>/velocities/airspeed-kt</property>
                    <value>5</value>
                </less-than>
            </condition>
            <property>/environment/aircraft-effects/splash-zr</property>
        </input>
        <output>
            <property>/environment/aircraft-effects/splash-vector-z</property>
        </output>
    </filter>
</PropertyList>
</syntaxhighlight>
</syntaxhighlight>


373

edits

Navigation menu