again improve FBW Response, cleanup code

This commit is contained in:
Joshua Davidson 2017-05-31 15:02:01 -04:00
parent a3ee18adba
commit 8f3e8b4438
7 changed files with 98 additions and 706 deletions

View file

@ -76,14 +76,6 @@
<name>Custom engine values system</name>
<path>Aircraft/A320Family/Systems/engine-timing.xml</path>
</autopilot>
<autopilot n="6">
<name>Autobrake</name>
<path>Aircraft/A320Family/Systems/a320-autobrake.xml</path>
</autopilot>
<autopilot n="7">
<name>Spoilers</name>
<path>Aircraft/A320Family/Systems/a320-spoilers.xml</path>
</autopilot>
<autopilot n="8">
<path>Systems/fl2070_sound.xml</path>
</autopilot>

View file

@ -1,330 +0,0 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!-- Airbus A320 autobrake configuration -->
<!-- Adapated from the Boeing 777-200ER -->
<PropertyList>
<logic>
<name>Disabled state</name>
<!-- ensure output is consistent when no mode is selected-->
<enable>
<condition>
<equals>
<property>/autopilot/autobrake/step</property>
<value>0</value>
</equals>
</condition>
</enable>
<input><false/></input>
<output>/autopilot/autobrake/engaged</output>
</logic>
<logic>
<name>Max (RTO in Boeing terms) selected</name>
<input>
<equals>
<property>/autopilot/autobrake/step</property>
<value>3</value>
</equals>
</input>
<output>/autopilot/autobrake/max-selected</output>
</logic>
<logic>
<name>Autobrake Selected</name>
<input>
<greater-than>
<property>/autopilot/autobrake/step</property>
<value>0</value>
</greater-than>
</input>
<output>/autopilot/autobrake/selected</output>
</logic>
<logic>
<name>Throttles At Idle</name>
<input>
<!-- engine 0 -->
<and>
<or>
<less-than>
<property>/controls/engines/engine[0]/throttle</property>
<property>/autopilot/autobrake/config/idle-throttle</property>
</less-than>
<property>/controls/engines/engine[0]/reverser</property>
</or>
<!-- engine 1 -->
<or>
<less-than>
<property>/controls/engines/engine[1]/throttle</property>
<property>/autopilot/autobrake/config/idle-throttle</property>
</less-than>
<property>/controls/engines/engine[1]/reverser</property>
</or>
</and>
</input>
<output>/autopilot/autobrake/throttles-at-idle</output>
</logic>
<logic>
<name>Airborne</name>
<input>
<not><property>/gear/gear/wow</property></not>
</input>
<output>/autopilot/autobrake/airborne</output>
</logic>
<logic>
<name>High-speed</name>
<input>
<greater-than>
<property>/instrumentation/airspeed-indicator/indicated-speed-kt</property>
<value>40</value>
</greater-than>
</input>
<output>/autopilot/autobrake/above-40-kts</output>
</logic>
<logic>
<name>Spoilers deployed</name>
<input>
<greater-than>
<property>/surface-positions/speedbrake-pos-norm</property>
<value>0</value>
</greater-than>
</input>
<output>/autopilot/autobrake/spoilers-deployed</output>
</logic>
<!-- pilot brake input -->
<logic>
<name>Pilot Input</name>
<input>
<less-than>
<property>/autopilot/autobrake/config/pilot-input</property>
<expression>
<max>
<property>/controls/gear/brake-left</property>
<property>/controls/gear/brake-right</property>
</max>
</expression>
</less-than>
</input>
<output>/autopilot/autobrake/pilot-input</output>
</logic>
<flipflop>
<name>Autobrake Engage logic</name>
<debug>false</debug>
<type>RS</type>
<enable>
<condition>
<and>
<property>/autopilot/autobrake/selected</property>
<not>
<property>/autopilot/autobrake/max-selected</property>
</not>
</and>
</condition>
</enable>
<S>
<and>
<property>/autopilot/autobrake/throttles-at-idle</property>
<property>/autopilot/autobrake/spoilers-deployed</property>
<not>
<property>/autopilot/autobrake/airborne</property>
</not>
</and>
</S>
<R>
<false/>
</R>
<output>/autopilot/autobrake/engaged</output>
</flipflop>
<filter>
<name>MAX cancel logic</name>
<type>gain</type>
<gain>1.0</gain>
<debug>false</debug>
<enable>
<condition>
<property>/autopilot/autobrake/max-selected</property>
<property>/autopilot/autobrake/airborne</property>
</condition>
</enable>
<input><value>0</value></input> <!-- switch to 'off' -->
<output>/autopilot/autobrake/step</output>
</filter>
<flipflop>
<name>MAX engage logic</name>
<type>RS</type>
<debug>false</debug>
<enable>
<condition>
<property>/autopilot/autobrake/max-selected</property>
<property>/autopilot/autobrake/above-40-kts</property>
</condition>
</enable>
<S>
<and>
<property>/autopilot/autobrake/throttles-at-idle</property>
<property>/autopilot/autobrake/spoilers-deployed</property>
</and>
</S>
<R>
<false/>
</R>
<output>/autopilot/autobrake/engaged</output>
</flipflop>
<filter>
<name>Disengage logic</name>
<debug>false</debug>
<type>gain</type>
<gain>1.0</gain>
<enable>
<condition>
<property>/autopilot/autobrake/engaged</property>
<or>
<!-- disengage on pilot input -->
<property>/autopilot/autobrake/pilot-input</property>
<!-- disengage if the throttles are not at idle -->
<not><property>/autopilot/autobrake/throttles-at-idle</property></not>
<!-- disengage if the spoilers are retracted -->
<not><property>/autopilot/autobrake/spoilers-deployed</property></not>
</or>
</condition>
</enable>
<input><value>0</value></input> <!-- switch to 'off' -->
<output>/autopilot/autobrake/step</output>
</filter>
<!-- model the accelerometer portion of the AB system.
This could differentiate indicated-airspeed, but I suspect real-
world systems use accelerometers directly. -->
<filter>
<name>Deceleration Sensor</name>
<type>noise-spike</type>
<max-rate-of-change>5.0</max-rate-of-change>
<input>
<scale>-1</scale> <!-- deceleration, not acceleration -->
<property>/fdm/jsbsim/accelerations/udot-ft_sec2</property>
</input>
<output>/autopilot/autobrake/actual-decel-ftsec2</output>
</filter>
<!-- translate dial setting levels into target decelerations, based upon
information in the POH -->
<filter>
<name>Target Deceleration Table</name>
<type>gain</type>
<debug>false</debug>
<gain>1.0</gain>
<output>/autopilot/autobrake/target-decel-ftsec2</output>
<input>
<condition>
<not>
<property>/autopilot/autobrake/max-selected</property>
</not>
</condition>
<expression>
<!-- values taken from http://www.pprune.org/tech-log/304333-a320-autoland-distance-autobrake-vs-manual-landing-distance-autobrake-2.html#post3809602 -->
<table>
<property>/autopilot/autobrake/step</property>
<entry><ind>0</ind><dep>0</dep></entry>
<entry><ind>1</ind><dep>5.6</dep></entry>
<entry><ind>2</ind><dep>9.8</dep></entry>
</table>
</expression>
</input>
<input>
<condition>
<property>/autopilot/autobrake/max-selected</property>
</condition>
<!-- RTO setting applies max hydraulic pressure, simulate this
with a huge value here, to ensure the PI drives to 1.0 output -->
<value>50</value>
</input>
</filter>
<pi-simple-controller>
<name>Brake Effort Computer</name>
<debug>false</debug>
<enable>
<property>/autopilot/autobrake/engaged</property>
</enable>
<input><property>/autopilot/autobrake/actual-decel-ftsec2</property></input>
<reference>/autopilot/autobrake/target-decel-ftsec2</reference>
<output>/autopilot/autobrake/output-brake</output>
<min>0.0</min>
<max>1.0</max>
<config>
<Kp>1.0</Kp>
<Ki>0.0</Ki>
</config>
</pi-simple-controller>
<!-- left output summer -->
<filter>
<name>Left Output Summer</name>
<type>gain</type>
<gain>1.0</gain>
<input>
<condition>
<property>/autopilot/autobrake/engaged</property>
</condition>
<expression>
<max>
<property>/controls/gear/brake-left</property>
<property>/autopilot/autobrake/output-brake</property>
</max>
</expression>
</input>
<!-- default input -->
<input>
<property>/controls/gear/brake-left</property>
</input>
<output>/autopilot/autobrake/brake-left-output</output>
</filter>
<!-- right output summer -->
<filter>
<name>Right Output Summer</name>
<type>gain</type>
<gain>1.0</gain>
<input>
<condition>
<property>/autopilot/autobrake/engaged</property>
</condition>
<expression>
<max>
<property>/controls/gear/brake-right</property>
<property>/autopilot/autobrake/output-brake</property>
</max>
</expression>
</input>
<!-- default input -->
<input>
<property>/controls/gear/brake-right</property>
</input>
<output>/autopilot/autobrake/brake-right-output</output>
</filter>
</PropertyList>

View file

@ -1,77 +0,0 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!-- Airbus A320 speedbrake/ground spoiler configuration -->
<PropertyList>
<flipflop>
<name>Auto Speedbrake Engage logic</name>
<debug>false</debug>
<type>RS</type>
<enable>
<condition>
<and>
<equals>
<property>/controls/flight/speedbrake-arm</property>
<value>1</value>
</equals>
<less-than>
<property>/engines/engine[0]/reverser-pos-norm</property>
<value>0.01</value>
</less-than>
<less-than>
<property>/engines/engine[1]/reverser-pos-norm</property>
<value>0.01</value>
</less-than>
</and>
</condition>
</enable>
<S>
<and>
<less-than>
<property>/controls/engines/engine/throttle</property>
<value>0.15</value>
</less-than>
<less-than>
<property>/controls/engines/engine[1]/throttle</property>
<value>0.15</value>
</less-than>
<property>/gear/gear[1]/wow</property>
<property>/gear/gear[2]/wow</property>
<greater-than>
<property>/velocities/groundspeed-kt</property>
<value>60</value>
</greater-than>
</and>
</S>
<R>
<or>
<greater-than>
<property>/controls/engines/engine/throttle</property>
<value>0.16</value>
</greater-than>
<greater-than>
<property>/controls/engines/engine[1]/throttle</property>
<value>0.16</value>
</greater-than>
</or>
</R>
<output>/controls/flight/speedbrake-lever</output>
</flipflop>
<filter>
<name>Main speedbrake controller</name>
<type>gain</type>
<gain>1.0</gain>
<input>
<expression>
<max>
<property>/controls/flight/ground-spoilers</property>
<property>/controls/flight/speedbrake-lever</property>
</max>
</expression>
</input>
<output>/controls/flight/speedbrake</output>
</filter>
</PropertyList>

View file

@ -1,68 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<PropertyList>
<name>failures-dlg</name>
<layout>vbox</layout>
<text>
<label>Failures</label>
</text>
<hrule/>
<text>
<label>Engine fire</label>
</text>
<group>
<layout>hbox</layout>
<checkbox>
<label>Engine 1</label>
<property>engines/engine[0]/on-fire</property>
<binding>
<command>dialog-apply</command>
</binding>
<live>true</live>
</checkbox>
<checkbox>
<label>Engine 2</label>
<property>engines/engine[1]/on-fire</property>
<binding>
<command>dialog-apply</command>
</binding>
<live>true</live>
</checkbox>
<checkbox>
<label>APU</label>
<property>engines/apu/on-fire</property>
<binding>
<command>dialog-apply</command>
</binding>
<live>true</live>
</checkbox>
</group>
<hrule/>
<group>
<layout>vbox</layout>
<button>
<legend>Close</legend>
<default>true</default>
<key>Esc</key>
<padding>10</padding>
<binding>
<command>dialog-apply</command>
</binding>
<binding>
<command>dialog-close</command>
</binding>
</button>
</group>
</PropertyList>

View file

@ -4,7 +4,10 @@
<PropertyList>
<!-- Aileron/Spoileron/Speedbrake Control -->
<!-- =============================================================== -->
<!-- Aileron Control -->
<!-- =============================================================== -->
<filter>
<debug>false</debug>
<type>gain</type>
@ -183,6 +186,10 @@
<max-rate-of-change>2.5</max-rate-of-change>
</filter>
<!-- =============================================================== -->
<!-- Spoiler Control -->
<!-- =============================================================== -->
<filter>
<debug>false</debug>
<type>gain</type>
@ -432,7 +439,10 @@
<output>/controls/flight/aileron-sum</output>
</filter>
<!-- Elevator Control -->
<!-- =============================================================== -->
<!-- Elevator Control -->
<!-- =============================================================== -->
<filter>
<debug>false</debug>
<type>gain</type>
@ -552,7 +562,10 @@
<output>/controls/flight/elevator-sum</output>
</filter>
<!-- Rudder -->
<!-- =============================================================== -->
<!-- Rudder Control -->
<!-- =============================================================== -->
<filter>
<debug>false</debug>
<type>gain</type>
@ -612,5 +625,79 @@
<output>/controls/flight/rudder-fdm</output>
<max-rate-of-change>2.5</max-rate-of-change>
</filter>
<!-- =============================================================== -->
<!-- Speedbrake Logic -->
<!-- =============================================================== -->
<flipflop>
<name>Auto Speedbrake</name>
<debug>false</debug>
<type>RS</type>
<enable>
<condition>
<and>
<equals>
<property>/controls/flight/speedbrake-arm</property>
<value>1</value>
</equals>
<less-than>
<property>/engines/engine[0]/reverser-pos-norm</property>
<value>0.01</value>
</less-than>
<less-than>
<property>/engines/engine[1]/reverser-pos-norm</property>
<value>0.01</value>
</less-than>
</and>
</condition>
</enable>
<S>
<and>
<less-than>
<property>/controls/engines/engine/throttle</property>
<value>0.15</value>
</less-than>
<less-than>
<property>/controls/engines/engine[1]/throttle</property>
<value>0.15</value>
</less-than>
<property>/gear/gear[1]/wow</property>
<property>/gear/gear[2]/wow</property>
<greater-than>
<property>/velocities/groundspeed-kt</property>
<value>60</value>
</greater-than>
</and>
</S>
<R>
<or>
<greater-than>
<property>/controls/engines/engine/throttle</property>
<value>0.16</value>
</greater-than>
<greater-than>
<property>/controls/engines/engine[1]/throttle</property>
<value>0.16</value>
</greater-than>
</or>
</R>
<output>/controls/flight/speedbrake-lever</output>
</flipflop>
<filter>
<name>Main speedbrake controller</name>
<type>gain</type>
<gain>1.0</gain>
<input>
<expression>
<max>
<property>/controls/flight/ground-spoilers</property>
<property>/controls/flight/speedbrake-lever</property>
</max>
</expression>
</input>
<output>/controls/flight/speedbrake</output>
</filter>
</PropertyList>

View file

@ -38,19 +38,19 @@
<table>
<independentVar lookup="row">/controls/flight/aileron-input</independentVar>
<tableData>
-1.0 -0.1
-0.7 -0.07
-0.5 -0.04
-0.3 -0.02
-1.0 -0.15
-0.7 -0.1
-0.5 -0.05
-0.3 -0.025
-0.15 -0.01
-0.05 -0.005
0.00 0.00
0.05 0.005
0.15 0.01
0.3 0.02
0.5 0.04
0.7 0.07
1.0 0.1
0.3 0.025
0.5 0.05
0.7 0.1
1.0 0.15
</tableData>
</table>
</sum>

View file

@ -1,212 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<PropertyList>
<name>lights-dlg</name>
<layout>vbox</layout>
<text>
<label>A320 Light Controller</label>
</text>
<hrule />
<group>
<layout>vbox</layout>
<text>
<label>Landing lights</label>
</text>
<group>
<layout>hbox</layout>
<checkbox>
<label>Left</label>
<property>controls/lighting/landing-lights[0]</property>
<binding>
<command>dialog-apply</command>
</binding>
<live>true</live>
</checkbox>
<checkbox>
<label>Nosegear</label>
<property>controls/lighting/landing-lights[1]</property>
<binding>
<command>dialog-apply</command>
</binding>
<live>true</live>
</checkbox>
<checkbox>
<label>Right</label>
<property>controls/lighting/landing-lights[2]</property>
<binding>
<command>dialog-apply</command>
</binding>
<live>true</live>
</checkbox>
</group>
<hrule/>
<text>
<label>Navigation/logo lights</label>
</text>
<group>
<layout>hbox</layout>
<button>
<legend>Off</legend>
<binding>
<command>dialog-apply</command>
</binding>
<binding>
<command>property-assign</command>
<property>controls/lighting/nav-lights-switch</property>
<value>0</value>
</binding>
</button>
<button>
<legend>1</legend>
<binding>
<command>dialog-apply</command>
</binding>
<binding>
<command>property-assign</command>
<property>controls/lighting/nav-lights-switch</property>
<value>1</value>
</binding>
</button>
<button>
<legend>2</legend>
<binding>
<command>dialog-apply</command>
</binding>
<binding>
<command>property-assign</command>
<property>controls/lighting/nav-lights-switch</property>
<value>2</value>
</binding>
</button>
</group>
<checkbox>
<label>Strobe lights</label>
<property>controls/lighting/strobe</property>
<binding>
<command>dialog-apply</command>
</binding>
<live>true</live>
</checkbox>
<!-- <checkbox>
<label>Wing lights</label>
<property>controls/lighting/wing-lights</property>
<binding>
<command>dialog-apply</command>
</binding>
<live>true</live>
</checkbox>-->
<checkbox>
<label>Beacon</label>
<property>controls/lighting/beacon</property>
<binding>
<command>dialog-apply</command>
</binding>
<live>true</live>
</checkbox>
<text>
<label>Cockpit dome lighting</label>
</text>
<slider>
<width>200</width>
<property>controls/lighting/dome-norm</property>
<step>0.5</step>
<min>0</min>
<max>1</max>
<binding>
<command>dialog-apply</command>
</binding>
</slider>
<text>
<label>Cabin lighting</label>
</text>
<slider>
<width>200</width>
<property>controls/lighting/interior</property>
<step>0.05</step>
<min>0</min>
<max>1</max>
<binding>
<command>dialog-apply</command>
</binding>
</slider>
<text>
<label>Overhead panel lighting</label>
</text>
<slider>
<width>200</width>
<property>controls/lighting/overhead-panel-norm</property>
<step>0.05</step>
<min>0</min>
<max>1</max>
<binding>
<command>dialog-apply</command>
</binding>
</slider>
<text>
<label>Pedestal/main panel lighting</label>
</text>
<slider>
<width>200</width>
<property>controls/lighting/main-panel-pedestal-norm</property>
<step>0.05</step>
<min>0</min>
<max>1</max>
<binding>
<command>dialog-apply</command>
</binding>
</slider>
<checkbox>
<label>3D light cones</label>
<property>controls/lighting/cones</property>
<binding>
<command>dialog-apply</command>
</binding>
<live>true</live>
</checkbox>
</group>
<hrule />
<group>
<layout>vbox</layout>
<button>
<legend>Close</legend>
<default>true</default>
<key>Esc</key>
<padding>10</padding>
<binding>
<command>dialog-apply</command>
</binding>
<binding>
<command>dialog-close</command>
</binding>
</button>
</group>
</PropertyList>