<?xml version="1.0"?>

<!--
##############################################
# Copyright (c) Joshua Davidson (it0uchpods) #
##############################################
-->

<!-- Airbus A3XX Hydraulics System -->

<PropertyList>

 <!-- =============================================================== -->
 <!-- Surface Droop                                                   -->
 <!-- =============================================================== -->
 
	<filter>
		<name>Aileron Droop</name>
		<type>gain</type>
		<gain>1</gain>
		<update-interval-secs type="double">0.05</update-interval-secs>
		<input> 
			<expression>
				<table>
					<property>/velocities/airspeed-kt</property>
					<entry><ind> 62</ind><dep>0.5</dep></entry>
					<entry><ind>116</ind><dep>0.0</dep></entry>
				</table>
			</expression>
		</input>
		<output>/systems/hydraulic/aileron-droop</output>
	</filter>
	
	<filter>
		<name>Elevator Droop</name>
		<type>gain</type>
		<gain>1</gain>
		<update-interval-secs type="double">0.05</update-interval-secs>
		<input> 
			<expression>
				<table>
					<property>/velocities/airspeed-kt</property>
					<entry><ind> 72</ind><dep>0.5</dep></entry>
					<entry><ind>121</ind><dep>0.0</dep></entry>
				</table>
			</expression>
		</input>
		<output>/systems/hydraulic/elevator-droop</output>
	</filter>

 <!-- =============================================================== -->
 <!-- Aileron Control                                                 -->
 <!-- =============================================================== -->
 
	<!-- Aileron L -->

	<filter>
		<debug>false</debug>
		<type>gain</type>
		<gain>1.0</gain>
		<input>
			<condition>
				<and>
					<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>
					</or>
					<equals>
						<property>/controls/flight/speedbrake-norm</property>
						<value>1.0</value>
					</equals>
					<equals>
						<property>/gear/gear[1]/wow</property>
						<value>1</value>
					</equals>
					<equals>
						<property>/gear/gear[2]/wow</property>
						<value>1</value>
					</equals>
					<equals>
						<property>/systems/failures/aileron-left</property>
						<value>0</value>
					</equals>
				</and>
			</condition>
			<expression>
				<sum>
					<property>/controls/flight/speedbrake-norm</property>
					<table>
						<property>/controls/flight/roll-fbw</property> 
						<entry><ind>0.0</ind><dep>   0</dep></entry>
						<entry><ind>1.0</ind><dep>-1.0</dep></entry>
					</table>
				</sum>
			</expression>
			<scale>-0.5</scale>
		</input>
		<input>
			<condition>
				<or>
					<and>
						<less-than>
							<property>/systems/hydraulic/green-psi</property>
							<value>1500</value>
						</less-than>
						<less-than>
							<property>/systems/hydraulic/blue-psi</property>
							<value>1500</value>
						</less-than>
					</and>
					<equals>
						<property>/systems/failures/aileron-left</property>
						<value>1</value>
					</equals>
				</or>
			</condition>
			<property>/systems/hydraulic/aileron-droop</property>
		</input>
		<input>
			<condition>
				<and>
					<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>
					</or>
					<equals>
						<property>/systems/failures/aileron-left</property>
						<value>0</value>
					</equals>
				</and>
			</condition>
			<expression>
				<sum>
					<table>
						<property>/controls/flight/roll-fbw</property> 
						<entry><ind>-1</ind><dep>-0.5</dep></entry>
						<entry><ind> 0</ind><dep> 0.0</dep></entry>
						<entry><ind> 1</ind><dep> 0.5</dep></entry>
					</table>
					<table>
						<property>/fdm/jsbsim/fcs/flap-pos-deg</property> 
						<entry><ind>1</ind><dep>0.00</dep></entry>
						<entry><ind>5</ind><dep>0.13</dep></entry>
					</table>
				</sum>
			</expression>
		</input>
		<output>/controls/flight/aileron-left-cmd</output>
		<min>-0.5</min>
		<max>0.5</max>
	</filter>
	
	<filter>
		<debug>false</debug>
		<type>noise-spike</type>
		<input>/controls/flight/aileron-left-cmd</input>
		<output>/controls/flight/aileron-left</output>
		<max-rate-of-change>2.5</max-rate-of-change>
	</filter>
	
	<!-- Aileron R -->
	
	<filter>
		<debug>false</debug>
		<type>gain</type>
		<gain>1.0</gain>
		<input>
			<condition>
				<and>
					<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>
					</or>
					<equals>
						<property>/controls/flight/speedbrake-norm</property>
						<value>1.0</value>
					</equals>
					<equals>
						<property>/gear/gear[1]/wow</property>
						<value>1</value>
					</equals>
					<equals>
						<property>/gear/gear[2]/wow</property>
						<value>1</value>
					</equals>
					<equals>
						<property>/systems/failures/aileron-right</property>
						<value>0</value>
					</equals>
				</and>
			</condition>
			<expression>
				<sum>
					<property>/controls/flight/speedbrake-norm</property>
					<table>
						<property>/controls/flight/roll-fbw</property> 
						<entry><ind>-0.0</ind><dep>   0</dep></entry>
						<entry><ind>-1.0</ind><dep>-1.0</dep></entry>
					</table>
				</sum>
			</expression>
			<scale>0.5</scale>
		</input>
		<input>
			<condition>
				<or>
					<and>
						<less-than>
							<property>/systems/hydraulic/green-psi</property>
							<value>1500</value>
						</less-than>
						<less-than>
							<property>/systems/hydraulic/blue-psi</property>
							<value>1500</value>
						</less-than>
					</and>
					<equals>
						<property>/systems/failures/aileron-right</property>
						<value>1</value>
					</equals>
				</or>
			</condition>
			<property>/systems/hydraulic/aileron-droop</property>
			<scale>-1.0</scale>
		</input>
		<input>
			<condition>
				<and>
					<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>
					</or>
					<equals>
						<property>/systems/failures/aileron-right</property>
						<value>0</value>
					</equals>
				</and>
			</condition>
			<expression>
				<sum>
					<table>
						<property>/controls/flight/roll-fbw</property> 
						<entry><ind>-1</ind><dep>-0.5</dep></entry>
						<entry><ind> 0</ind><dep> 0.0</dep></entry>
						<entry><ind> 1</ind><dep> 0.5</dep></entry>
					</table>
					<table>
						<property>/fdm/jsbsim/fcs/flap-pos-deg</property> 
						<entry><ind>1</ind><dep> 0.00</dep></entry>
						<entry><ind>5</ind><dep>-0.13</dep></entry>
					</table>
				</sum>
			</expression>
		</input>
		<output>/controls/flight/aileron-right-cmd</output>
		<min>-0.5</min>
		<max>0.5</max>
	</filter>
	
	<filter>
		<debug>false</debug>
		<type>noise-spike</type>
		<input>/controls/flight/aileron-right-cmd</input>
		<output>/controls/flight/aileron-right</output>
		<max-rate-of-change>2.5</max-rate-of-change>
	</filter>
	
 <!-- =============================================================== -->
 <!-- Spoiler Control                                                 -->
 <!-- =============================================================== -->
	
	<!-- Spoiler L1 -->
	
	<filter>
		<debug>false</debug>
		<type>gain</type>
		<gain>1.0</gain>
		<input>
			<condition>
				<and>
					<greater-than-equals>
						<property>/systems/hydraulic/green-psi</property>
						<value>1500</value>
					</greater-than-equals>
					<not-equals>
						<property>/controls/flight/speedbrake-lever</property>
						<value>0.0</value>
					</not-equals>
					<or>
						<equals>
							<property>/gear/gear[1]/wow</property>
							<value>1</value>
						</equals>
						<equals>
							<property>/gear/gear[2]/wow</property>
							<value>1</value>
						</equals>
					</or>
					<equals>
						<property>/systems/failures/spoiler-l1</property>
						<value>0</value>
					</equals>
				</and>
			</condition>
			<property>/controls/flight/speedbrake-norm</property> 
		</input>
		<input>
			<condition>
				<or>
					<less-than>
						<property>/systems/hydraulic/green-psi</property>
						<value>1500</value>
					</less-than>
					<equals>
						<property>/systems/failures/spoiler-l1</property>
						<value>1</value>
					</equals>
				</or>
			</condition>
			<value>0.0</value>
		</input>
		<output>/controls/flight/spoiler-l1-cmd</output>
		<min>0.0</min>
		<max>1.0</max>
	</filter>
	
	<filter>
		<debug>false</debug>
		<type>noise-spike</type>
		<input>/controls/flight/spoiler-l1-cmd</input>
		<output>/controls/flight/spoiler-l1</output>
		<max-rate-of-change>0.6</max-rate-of-change>
	</filter>
 
	<!-- Spoiler L2 -->
	
	<filter>
		<debug>false</debug>
		<type>gain</type>
		<gain>1.0</gain>
		<input>
			<condition>
				<and>
					<greater-than-equals>
						<property>/systems/hydraulic/yellow-psi</property>
						<value>1500</value>
					</greater-than-equals>
					<not-equals>
						<property>/controls/flight/speedbrake-lever</property>
						<value>0.0</value>
					</not-equals>
					<equals>
						<property>/gear/gear[1]/wow</property>
						<value>0</value>
					</equals>
					<equals>
						<property>/gear/gear[2]/wow</property>
						<value>0</value>
					</equals>
					<equals>
						<property>/systems/failures/spoiler-l2</property>
						<value>0</value>
					</equals>
				</and>
			</condition>
			<expression>
				<sum>
					<table>
						<property>/controls/flight/speedbrake-norm</property> 
						<entry><ind>0.1</ind><dep>0.0</dep></entry>
						<entry><ind>0.5</ind><dep>0.3</dep></entry>
						<entry><ind>1.0</ind><dep>0.7</dep></entry>
					</table>
					<table>
						<property>/controls/flight/spoiler-left-fbw-cmd</property> 
						<entry><ind>0.1</ind><dep>   0</dep></entry>
						<entry><ind>1.0</ind><dep>-0.4</dep></entry>
					</table>
				</sum>
			</expression>
		</input>
		<input>
			<condition>
				<and>
					<greater-than-equals>
						<property>/systems/hydraulic/yellow-psi</property>
						<value>1500</value>
					</greater-than-equals>
					<not-equals>
						<property>/controls/flight/speedbrake-lever</property>
						<value>0.0</value>
					</not-equals>
					<or>
						<equals>
							<property>/gear/gear[1]/wow</property>
							<value>1</value>
						</equals>
						<equals>
							<property>/gear/gear[2]/wow</property>
							<value>1</value>
						</equals>
					</or>
					<equals>
						<property>/systems/failures/spoiler-l2</property>
						<value>0</value>
					</equals>
				</and>
			</condition>
			<expression>
				<sum>
					<table>
						<property>/controls/flight/speedbrake-norm</property> 
						<entry><ind>0.1</ind><dep>0.0</dep></entry>
						<entry><ind>0.5</ind><dep>0.3</dep></entry>
						<entry><ind>1.0</ind><dep>1.0</dep></entry>
					</table>
					<table>
						<property>/controls/flight/roll-fbw</property> 
						<entry><ind>0.0</ind><dep>   0</dep></entry>
						<entry><ind>1.0</ind><dep>-0.5</dep></entry>
					</table>
				</sum>
			</expression>
		</input>
		<input>
			<condition>
				<or>
					<less-than>
						<property>/systems/hydraulic/yellow-psi</property>
						<value>1500</value>
					</less-than>
					<equals>
						<property>/systems/failures/spoiler-l2</property>
						<value>1</value>
					</equals>
				</or>
			</condition>
			<value>0.0</value>
		</input>
		<input>
			<condition>
				<and>
					<greater-than-equals>
						<property>/systems/hydraulic/yellow-psi</property>
						<value>1500</value>
					</greater-than-equals>
					<equals>
						<property>/systems/failures/spoiler-l2</property>
						<value>0</value>
					</equals>
				</and>
			</condition>
			<expression>
				<table>
					<property>/controls/flight/spoiler-left-fbw-cmd</property> 
					<entry><ind>-0.1</ind><dep>  0</dep></entry>
					<entry><ind>-1.0</ind><dep>0.5</dep></entry>
				</table>
			</expression>
		</input>
		<output>/controls/flight/spoiler-l2-cmd</output>
		<min>0.0</min>
		<max>1.0</max>
	</filter>
	
	<filter>
		<debug>false</debug>
		<type>noise-spike</type>
		<input>/controls/flight/spoiler-l2-cmd</input>
		<output>/controls/flight/spoiler-l2</output>
		<max-rate-of-change>0.5</max-rate-of-change>
	</filter>
	
	<!-- Spoiler L3 -->
	
	<filter>
		<debug>false</debug>
		<type>gain</type>
		<gain>1.0</gain>
		<input>
			<condition>
				<and>
					<greater-than-equals>
						<property>/systems/hydraulic/blue-psi</property>
						<value>1500</value>
					</greater-than-equals>
					<not-equals>
						<property>/controls/flight/speedbrake-lever</property>
						<value>0.0</value>
					</not-equals>
					<equals>
						<property>/gear/gear[1]/wow</property>
						<value>0</value>
					</equals>
					<equals>
						<property>/gear/gear[2]/wow</property>
						<value>0</value>
					</equals>
					<equals>
						<property>/systems/failures/spoiler-l3</property>
						<value>0</value>
					</equals>
				</and>
			</condition>
			<expression>
				<sum>
					<property>/controls/flight/speedbrake-norm</property> 
					<table>
						<property>/controls/flight/spoiler-left-fbw-cmd</property> 
						<entry><ind>0.0</ind><dep>   0</dep></entry>
						<entry><ind>1.0</ind><dep>-0.5</dep></entry>
					</table>
				</sum>
			</expression>
		</input>
		<input>
			<condition>
				<and>
					<greater-than-equals>
						<property>/systems/hydraulic/blue-psi</property>
						<value>1500</value>
					</greater-than-equals>
					<not-equals>
						<property>/controls/flight/speedbrake-lever</property>
						<value>0.0</value>
					</not-equals>
					<or>
						<equals>
							<property>/gear/gear[1]/wow</property>
							<value>1</value>
						</equals>
						<equals>
							<property>/gear/gear[2]/wow</property>
							<value>1</value>
						</equals>
					</or>
					<equals>
						<property>/systems/failures/spoiler-l3</property>
						<value>0</value>
					</equals>
				</and>
			</condition>
			<expression>
				<sum>
					<property>/controls/flight/speedbrake-norm</property> 
					<table>
						<property>/controls/flight/roll-fbw</property> 
						<entry><ind>0.0</ind><dep>   0</dep></entry>
						<entry><ind>1.0</ind><dep>-0.5</dep></entry>
					</table>
				</sum>
			</expression>
		</input>
		<input>
			<condition>
				<or>
					<less-than>
						<property>/systems/hydraulic/blue-psi</property>
						<value>1500</value>
					</less-than>
					<equals>
						<property>/systems/failures/spoiler-l4</property>
						<value>1</value>
					</equals>
				</or>
			</condition>
			<value>0.0</value>
		</input>
		<input>
			<condition>
				<and>
					<greater-than-equals>
						<property>/systems/hydraulic/blue-psi</property>
						<value>1500</value>
					</greater-than-equals>
					<equals>
						<property>/systems/failures/spoiler-l3</property>
						<value>0</value>
					</equals>
				</and>
			</condition>
			<expression>
				<table>
					<property>/controls/flight/spoiler-left-fbw-cmd</property> 
					<entry><ind>-0.0</ind><dep>  0</dep></entry>
					<entry><ind>-1.0</ind><dep>0.5</dep></entry>
				</table>
			</expression>
		</input>
		<output>/controls/flight/spoiler-l3-cmd</output>
		<min>0.0</min>
		<max>1.0</max>
	</filter>
	
	<filter>
		<debug>false</debug>
		<type>noise-spike</type>
		<input>/controls/flight/spoiler-l3-cmd</input>
		<output>/controls/flight/spoiler-l3</output>
		<max-rate-of-change>0.4</max-rate-of-change>
	</filter>
	
	<!-- Spoiler L4 -->
	
	<filter>
		<debug>false</debug>
		<type>gain</type>
		<gain>1.0</gain>
		<input>
			<condition>
				<and>
					<greater-than-equals>
						<property>/systems/hydraulic/yellow-psi</property>
						<value>1500</value>
					</greater-than-equals>
					<not-equals>
						<property>/controls/flight/speedbrake-lever</property>
						<value>0.0</value>
					</not-equals>
					<equals>
						<property>/gear/gear[1]/wow</property>
						<value>0</value>
					</equals>
					<equals>
						<property>/gear/gear[2]/wow</property>
						<value>0</value>
					</equals>
					<equals>
						<property>/systems/failures/spoiler-l4</property>
						<value>0</value>
					</equals>
				</and>
			</condition>
			<expression>
				<sum>
					<property>/controls/flight/speedbrake-norm</property> 
					<table>
						<property>/controls/flight/spoiler-left-fbw-cmd</property> 
						<entry><ind>0.0</ind><dep>   0</dep></entry>
						<entry><ind>1.0</ind><dep>-0.5</dep></entry>
					</table>
				</sum>
			</expression>
		</input>
		<input>
			<condition>
				<and>
					<greater-than-equals>
						<property>/systems/hydraulic/yellow-psi</property>
						<value>1500</value>
					</greater-than-equals>
					<not-equals>
						<property>/controls/flight/speedbrake-lever</property>
						<value>0.0</value>
					</not-equals>
					<or>
						<equals>
							<property>/gear/gear[1]/wow</property>
							<value>1</value>
						</equals>
						<equals>
							<property>/gear/gear[2]/wow</property>
							<value>1</value>
						</equals>
					</or>
					<equals>
						<property>/systems/failures/spoiler-l4</property>
						<value>0</value>
					</equals>
				</and>
			</condition>
			<expression>
				<sum>
					<property>/controls/flight/speedbrake-norm</property> 
					<table>
						<property>/controls/flight/roll-fbw</property> 
						<entry><ind>0.0</ind><dep>   0</dep></entry>
						<entry><ind>1.0</ind><dep>-0.5</dep></entry>
					</table>
				</sum>
			</expression>
		</input>
		<input>
			<condition>
				<or>
					<less-than>
						<property>/systems/hydraulic/yellow-psi</property>
						<value>1500</value>
					</less-than>
					<equals>
						<property>/systems/failures/spoiler-l4</property>
						<value>1</value>
					</equals>
				</or>
			</condition>
			<value>0.0</value>
		</input>
		<input>
			<condition>
				<and>
					<greater-than-equals>
						<property>/systems/hydraulic/yellow-psi</property>
						<value>1500</value>
					</greater-than-equals>
					<equals>
						<property>/systems/failures/spoiler-l4</property>
						<value>0</value>
					</equals>
				</and>
			</condition>
			<expression>
				<table>
					<property>/controls/flight/spoiler-left-fbw-cmd</property> 
					<entry><ind>-0.0</ind><dep>  0</dep></entry>
					<entry><ind>-1.0</ind><dep>0.5</dep></entry>
				</table>
			</expression>
		</input>
		<output>/controls/flight/spoiler-l4-cmd</output>
		<min>0.0</min>
		<max>1.0</max>
	</filter>
	
	<filter>
		<debug>false</debug>
		<type>noise-spike</type>
		<input>/controls/flight/spoiler-l4-cmd</input>
		<output>/controls/flight/spoiler-l4</output>
		<max-rate-of-change>0.7</max-rate-of-change>
	</filter>
	
	<!-- Spoiler L5 -->
	
	<filter>
		<debug>false</debug>
		<type>gain</type>
		<gain>1.0</gain>
		<input>
			<condition>
				<and>
					<greater-than-equals>
						<property>/systems/hydraulic/green-psi</property>
						<value>1500</value>
					</greater-than-equals>
					<not-equals>
						<property>/controls/flight/speedbrake-lever</property>
						<value>0.0</value>
					</not-equals>
					<or>
						<equals>
							<property>/gear/gear[1]/wow</property>
							<value>1</value>
						</equals>
						<equals>
							<property>/gear/gear[2]/wow</property>
							<value>1</value>
						</equals>
					</or>
					<equals>
						<property>/systems/failures/spoiler-l5</property>
						<value>0</value>
					</equals>
				</and>
			</condition>
			<expression>
				<sum>
					<property>/controls/flight/speedbrake-norm</property> 
					<table>
						<property>/controls/flight/roll-fbw</property> 
						<entry><ind>0.0</ind><dep>   0</dep></entry>
						<entry><ind>1.0</ind><dep>-0.5</dep></entry>
					</table>
				</sum>
			</expression>
		</input>
		<input>
			<condition>
				<or>
					<less-than>
						<property>/systems/hydraulic/green-psi</property>
						<value>1500</value>
					</less-than>
					<equals>
						<property>/systems/failures/spoiler-l5</property>
						<value>1</value>
					</equals>
				</or>
			</condition>
			<value>0.0</value>
		</input>
		<input>
			<condition>
				<and>
					<greater-than-equals>
						<property>/systems/hydraulic/green-psi</property>
						<value>1500</value>
					</greater-than-equals>
					<equals>
						<property>/systems/failures/spoiler-l5</property>
						<value>0</value>
					</equals>
				</and>
			</condition>
			<expression>
				<table>
					<property>/controls/flight/spoiler-left-fbw-cmd</property> 
					<entry><ind>-0.0</ind><dep>  0</dep></entry>
					<entry><ind>-1.0</ind><dep>0.5</dep></entry>
				</table>
			</expression>
		</input>
		<output>/controls/flight/spoiler-l5-cmd</output>
		<min>0.0</min>
		<max>1.0</max>
	</filter>
	
	<filter>
		<debug>false</debug>
		<type>noise-spike</type>
		<input>/controls/flight/spoiler-l5-cmd</input>
		<output>/controls/flight/spoiler-l5</output>
		<max-rate-of-change>0.5</max-rate-of-change>
	</filter>
	
	<!-- Left Spoiler Sum -->
	
	<filter>
		<debug>false</debug>
		<type>gain</type>
		<gain>1.0</gain>
		<input>
			<expression>
				<sum>
					<property>/controls/flight/spoiler-l1</property>
					<property>/controls/flight/spoiler-l2</property>
					<property>/controls/flight/spoiler-l3</property>
					<property>/controls/flight/spoiler-l4</property>
					<property>/controls/flight/spoiler-l5</property>
				</sum>
			</expression>
		</input>
		<output>/controls/flight/spoiler-l-sum</output>
	</filter>
	
	<!-- Spoiler R1 -->
	
	<filter>
		<debug>false</debug>
		<type>gain</type>
		<gain>1.0</gain>
		<input>
			<condition>
				<and>
					<greater-than-equals>
						<property>/systems/hydraulic/green-psi</property>
						<value>1500</value>
					</greater-than-equals>
					<not-equals>
						<property>/controls/flight/speedbrake-lever</property>
						<value>0.0</value>
					</not-equals>
					<or>
						<equals>
							<property>/gear/gear[1]/wow</property>
							<value>1</value>
						</equals>
						<equals>
							<property>/gear/gear[2]/wow</property>
							<value>1</value>
						</equals>
					</or>
					<equals>
						<property>/systems/failures/spoiler-r1</property>
						<value>0</value>
					</equals>
				</and>
			</condition>
			<property>/controls/flight/speedbrake-norm</property> 
		</input>
		<input>
			<condition>
				<or>
					<less-than>
						<property>/systems/hydraulic/green-psi</property>
						<value>1500</value>
					</less-than>
					<equals>
						<property>/systems/failures/spoiler-r1</property>
						<value>1</value>
					</equals>
				</or>
			</condition>
			<value>0.0</value>
		</input>
		<output>/controls/flight/spoiler-r1-cmd</output>
		<min>0.0</min>
		<max>1.0</max>
	</filter>
	
	<filter>
		<debug>false</debug>
		<type>noise-spike</type>
		<input>/controls/flight/spoiler-r1-cmd</input>
		<output>/controls/flight/spoiler-r1</output>
		<max-rate-of-change>0.6</max-rate-of-change>
	</filter>
	
	<!-- Spoiler R2 -->
	
	<filter>
		<debug>false</debug>
		<type>gain</type>
		<gain>1.0</gain>
		<input>
			<condition>
				<and>
					<greater-than-equals>
						<property>/systems/hydraulic/yellow-psi</property>
						<value>1500</value>
					</greater-than-equals>
					<not-equals>
						<property>/controls/flight/speedbrake-lever</property>
						<value>0.0</value>
					</not-equals>
					<equals>
						<property>/gear/gear[1]/wow</property>
						<value>0</value>
					</equals>
					<equals>
						<property>/gear/gear[2]/wow</property>
						<value>0</value>
					</equals>
					<equals>
						<property>/systems/failures/spoiler-r2</property>
						<value>0</value>
					</equals>
				</and>
			</condition>
			<expression>
				<sum>
					<table>
						<property>/controls/flight/speedbrake-norm</property> 
						<entry><ind>0.1</ind><dep>0.0</dep></entry>
						<entry><ind>0.5</ind><dep>0.3</dep></entry>
						<entry><ind>1.0</ind><dep>0.7</dep></entry>
					</table>
					<table>
						<property>/controls/flight/spoiler-right-fbw-cmd</property> 
						<entry><ind>-0.1</ind><dep>   0</dep></entry>
						<entry><ind>-1.0</ind><dep>-0.4</dep></entry>
					</table>
				</sum>
			</expression>
		</input>
		<input>
			<condition>
				<and>
					<greater-than-equals>
						<property>/systems/hydraulic/yellow-psi</property>
						<value>1500</value>
					</greater-than-equals>
					<not-equals>
						<property>/controls/flight/speedbrake-lever</property>
						<value>0.0</value>
					</not-equals>
					<or>
						<equals>
							<property>/gear/gear[1]/wow</property>
							<value>1</value>
						</equals>
						<equals>
							<property>/gear/gear[2]/wow</property>
							<value>1</value>
						</equals>
					</or>
					<equals>
						<property>/systems/failures/spoiler-r2</property>
						<value>0</value>
					</equals>
				</and>
			</condition>
			<expression>
				<sum>
					<table>
						<property>/controls/flight/speedbrake-norm</property> 
						<entry><ind>0.1</ind><dep>0.0</dep></entry>
						<entry><ind>0.5</ind><dep>0.3</dep></entry>
						<entry><ind>1.0</ind><dep>1.0</dep></entry>
					</table>
					<table>
						<property>/controls/flight/roll-fbw</property> 
						<entry><ind> 0.0</ind><dep>   0</dep></entry>
						<entry><ind>-1.0</ind><dep>-0.5</dep></entry>
					</table>
				</sum>
			</expression>
		</input>
		<input>
			<condition>
				<or>
					<less-than>
						<property>/systems/hydraulic/yellow-psi</property>
						<value>1500</value>
					</less-than>
					<equals>
						<property>/systems/failures/spoiler-r2</property>
						<value>1</value>
					</equals>
				</or>
			</condition>
			<value>0.0</value>
		</input>
		<input>
			<condition>
				<and>
					<greater-than-equals>
						<property>/systems/hydraulic/yellow-psi</property>
						<value>1500</value>
					</greater-than-equals>
					<equals>
						<property>/systems/failures/spoiler-r2</property>
						<value>0</value>
					</equals>
				</and>
			</condition>
			<expression>
				<table>
					<property>/controls/flight/spoiler-right-fbw-cmd</property> 
					<entry><ind>0.1</ind><dep>  0</dep></entry>
					<entry><ind>1.0</ind><dep>0.5</dep></entry>
				</table>
			</expression>
		</input>
		<output>/controls/flight/spoiler-r2-cmd</output>
		<min>0.0</min>
		<max>1.0</max>
	</filter>
	
	<filter>
		<debug>false</debug>
		<type>noise-spike</type>
		<input>/controls/flight/spoiler-r2-cmd</input>
		<output>/controls/flight/spoiler-r2</output>
		<max-rate-of-change>0.5</max-rate-of-change>
	</filter>
	
	<!-- Spoiler R3 -->
	
	<filter>
		<debug>false</debug>
		<type>gain</type>
		<gain>1.0</gain>
		<input>
			<condition>
				<and>
					<greater-than-equals>
						<property>/systems/hydraulic/blue-psi</property>
						<value>1500</value>
					</greater-than-equals>
					<not-equals>
						<property>/controls/flight/speedbrake-lever</property>
						<value>0.0</value>
					</not-equals>
					<equals>
						<property>/gear/gear[1]/wow</property>
						<value>0</value>
					</equals>
					<equals>
						<property>/gear/gear[2]/wow</property>
						<value>0</value>
					</equals>
					<equals>
						<property>/systems/failures/spoiler-r3</property>
						<value>0</value>
					</equals>
				</and>
			</condition>
			<expression>
				<sum>
					<property>/controls/flight/speedbrake-norm</property> 
					<table>
						<property>/controls/flight/spoiler-right-fbw-cmd</property> 
						<entry><ind> 0.0</ind><dep>   0</dep></entry>
						<entry><ind>-1.0</ind><dep>-0.5</dep></entry>
					</table>
				</sum>
			</expression>
		</input>
		<input>
			<condition>
				<and>
					<greater-than-equals>
						<property>/systems/hydraulic/blue-psi</property>
						<value>1500</value>
					</greater-than-equals>
					<not-equals>
						<property>/controls/flight/speedbrake-lever</property>
						<value>0.0</value>
					</not-equals>
					<or>
						<equals>
							<property>/gear/gear[1]/wow</property>
							<value>1</value>
						</equals>
						<equals>
							<property>/gear/gear[2]/wow</property>
							<value>1</value>
						</equals>
					</or>
					<equals>
						<property>/systems/failures/spoiler-r3</property>
						<value>0</value>
					</equals>
				</and>
			</condition>
			<expression>
				<sum>
					<property>/controls/flight/speedbrake-norm</property> 
					<table>
						<property>/controls/flight/roll-fbw</property> 
						<entry><ind> 0.0</ind><dep>   0</dep></entry>
						<entry><ind>-1.0</ind><dep>-0.5</dep></entry>
					</table>
				</sum>
			</expression>
		</input>
		<input>
			<condition>
				<or>
					<less-than>
						<property>/systems/hydraulic/blue-psi</property>
						<value>1500</value>
					</less-than>
					<equals>
						<property>/systems/failures/spoiler-r3</property>
						<value>1</value>
					</equals>
				</or>
			</condition>
			<value>0.0</value>
		</input>
		<input>
			<condition>
				<and>
					<greater-than-equals>
						<property>/systems/hydraulic/blue-psi</property>
						<value>1500</value>
					</greater-than-equals>
					<equals>
						<property>/systems/failures/spoiler-r3</property>
						<value>0</value>
					</equals>
				</and>
			</condition>
			<expression>
				<table>
					<property>/controls/flight/spoiler-right-fbw-cmd</property> 
					<entry><ind>0.0</ind><dep>  0</dep></entry>
					<entry><ind>1.0</ind><dep>0.5</dep></entry>
				</table>
			</expression>
		</input>
		<output>/controls/flight/spoiler-r3-cmd</output>
		<min>0.0</min>
		<max>1.0</max>
	</filter>
	
	<filter>
		<debug>false</debug>
		<type>noise-spike</type>
		<input>/controls/flight/spoiler-r3-cmd</input>
		<output>/controls/flight/spoiler-r3</output>
		<max-rate-of-change>0.4</max-rate-of-change>
	</filter>
	
	<!-- Spoiler R4 -->
	
	<filter>
		<debug>false</debug>
		<type>gain</type>
		<gain>1.0</gain>
		<input>
			<condition>
				<and>
					<greater-than-equals>
						<property>/systems/hydraulic/yellow-psi</property>
						<value>1500</value>
					</greater-than-equals>
					<not-equals>
						<property>/controls/flight/speedbrake-lever</property>
						<value>0.0</value>
					</not-equals>
					<equals>
						<property>/gear/gear[1]/wow</property>
						<value>0</value>
					</equals>
					<equals>
						<property>/gear/gear[2]/wow</property>
						<value>0</value>
					</equals>
					<equals>
						<property>/systems/failures/spoiler-r4</property>
						<value>0</value>
					</equals>
				</and>
			</condition>
			<expression>
				<sum>
					<property>/controls/flight/speedbrake-norm</property> 
					<table>
						<property>/controls/flight/spoiler-right-fbw-cmd</property> 
						<entry><ind> 0.0</ind><dep>   0</dep></entry>
						<entry><ind>-1.0</ind><dep>-0.5</dep></entry>
					</table>
				</sum>
			</expression>
		</input>
		<input>
			<condition>
				<and>
					<greater-than-equals>
						<property>/systems/hydraulic/yellow-psi</property>
						<value>1500</value>
					</greater-than-equals>
					<not-equals>
						<property>/controls/flight/speedbrake-lever</property>
						<value>0.0</value>
					</not-equals>
					<or>
						<equals>
							<property>/gear/gear[1]/wow</property>
							<value>1</value>
						</equals>
						<equals>
							<property>/gear/gear[2]/wow</property>
							<value>1</value>
						</equals>
					</or>
					<equals>
						<property>/systems/failures/spoiler-r4</property>
						<value>0</value>
					</equals>
				</and>
			</condition>
			<expression>
				<sum>
					<property>/controls/flight/speedbrake-norm</property> 
					<table>
						<property>/controls/flight/roll-fbw</property> 
						<entry><ind> 0.0</ind><dep>   0</dep></entry>
						<entry><ind>-1.0</ind><dep>-0.5</dep></entry>
					</table>
				</sum>
			</expression>
		</input>
		<input>
			<condition>
				<or>
					<less-than>
						<property>/systems/hydraulic/yellow-psi</property>
						<value>1500</value>
					</less-than>
					<equals>
						<property>/systems/failures/spoiler-r4</property>
						<value>1</value>
					</equals>
				</or>
			</condition>
			<value>0.0</value>
		</input>
		<input>
			<condition>
				<and>
					<greater-than-equals>
						<property>/systems/hydraulic/yellow-psi</property>
						<value>1500</value>
					</greater-than-equals>
					<equals>
						<property>/systems/failures/spoiler-r4</property>
						<value>0</value>
					</equals>
				</and>
			</condition>
			<expression>
				<table>
					<property>/controls/flight/spoiler-right-fbw-cmd</property> 
					<entry><ind>0.0</ind><dep>  0</dep></entry>
					<entry><ind>1.0</ind><dep>0.5</dep></entry>
				</table>
			</expression>
		</input>
		<output>/controls/flight/spoiler-r4-cmd</output>
		<min>0.0</min>
		<max>1.0</max>
	</filter>
	
	<filter>
		<debug>false</debug>
		<type>noise-spike</type>
		<input>/controls/flight/spoiler-r4-cmd</input>
		<output>/controls/flight/spoiler-r4</output>
		<max-rate-of-change>0.7</max-rate-of-change>
	</filter>
	
	<!-- Spoiler R5 -->
	
	<filter>
		<debug>false</debug>
		<type>gain</type>
		<gain>1.0</gain>
		<input>
			<condition>
				<and>
					<greater-than-equals>
						<property>/systems/hydraulic/green-psi</property>
						<value>1500</value>
					</greater-than-equals>
					<not-equals>
						<property>/controls/flight/speedbrake-lever</property>
						<value>0.0</value>
					</not-equals>
					<or>
						<equals>
							<property>/gear/gear[1]/wow</property>
							<value>1</value>
						</equals>
						<equals>
							<property>/gear/gear[2]/wow</property>
							<value>1</value>
						</equals>
					</or>
					<equals>
						<property>/systems/failures/spoiler-r5</property>
						<value>0</value>
					</equals>
				</and>
			</condition>
			<expression>
				<sum>
					<property>/controls/flight/speedbrake-norm</property> 
					<table>
						<property>/controls/flight/roll-fbw</property> 
						<entry><ind> 0.0</ind><dep>   0</dep></entry>
						<entry><ind>-1.0</ind><dep>-0.5</dep></entry>
					</table>
				</sum>
			</expression>
		</input>
		<input>
			<condition>
				<or>
					<less-than>
						<property>/systems/hydraulic/green-psi</property>
						<value>1500</value>
					</less-than>
					<equals>
						<property>/systems/failures/spoiler-r5</property>
						<value>1</value>
					</equals>
				</or>
			</condition>
			<value>0.0</value>
		</input>
		<input>
			<condition>
				<and>
					<greater-than-equals>
						<property>/systems/hydraulic/green-psi</property>
						<value>1500</value>
					</greater-than-equals>
					<equals>
						<property>/systems/failures/spoiler-r5</property>
						<value>0</value>
					</equals>
				</and>
			</condition>
			<expression>
				<table>
					<property>/controls/flight/spoiler-right-fbw-cmd</property> 
					<entry><ind>0.0</ind><dep>  0</dep></entry>
					<entry><ind>1.0</ind><dep>0.5</dep></entry>
				</table>
			</expression>
		</input>
		<output>/controls/flight/spoiler-r5-cmd</output>
		<min>0.0</min>
		<max>1.0</max>
	</filter>
	
	<filter>
		<debug>false</debug>
		<type>noise-spike</type>
		<input>/controls/flight/spoiler-r5-cmd</input>
		<output>/controls/flight/spoiler-r5</output>
		<max-rate-of-change>0.5</max-rate-of-change>
	</filter>
	
	<!-- Right Spoiler Sum -->
	
	<filter>
		<debug>false</debug>
		<type>gain</type>
		<gain>1.0</gain>
		<input>
			<expression>
				<sum>
					<property>/controls/flight/spoiler-r1</property>
					<property>/controls/flight/spoiler-r2</property>
					<property>/controls/flight/spoiler-r3</property>
					<property>/controls/flight/spoiler-r4</property>
					<property>/controls/flight/spoiler-r5</property>
				</sum>
			</expression>
		</input>
		<output>/controls/flight/spoiler-r-sum</output>
	</filter>
	
 <!-- =============================================================== -->
 <!-- Roll Control                                                    -->
 <!-- =============================================================== -->
	
	<filter>
		<debug>false</debug>
		<type>gain</type>
		<gain>1.0</gain>
		<input>
			<expression>
				<product>
					<sum>
						<product>
							<sum>
								<property>/controls/flight/aileron-left</property>
								<property>/controls/flight/aileron-right</property>
							</sum>
							<value>1.75</value>
						</product>
						<product>
							<sum>
								<product>
									<property>/controls/flight/spoiler-l-sum</property>
									<value>-1.0</value>
								</product>
								<property>/controls/flight/spoiler-r-sum</property>
							</sum>
							<value>0.25</value>
						</product>
					</sum>
					<value>0.444444</value>
				</product>
			</expression>
		</input>
		<output>/controls/flight/aileron-sum</output>
		<min>-1.0</min>
		<max>1.0</max>
	</filter>

 <!-- =============================================================== -->
 <!-- Elevator Control                                                -->
 <!-- =============================================================== -->
 
	<filter>
		<debug>false</debug>
		<type>gain</type>
		<gain>1.0</gain>
		<input>
			<condition>
				<or>
					<and>
						<less-than>
							<property>/systems/hydraulic/green-psi</property>
							<value>1500</value>
						</less-than>
						<less-than>
							<property>/systems/hydraulic/blue-psi</property>
							<value>1500</value>
						</less-than>
					</and>
					<equals>
						<property>/systems/failures/elevator-left</property>
						<value>1</value>
					</equals>
				</or>
			</condition>
			<property>/systems/hydraulic/elevator-droop</property>
		</input>
		<input>
			<condition>
				<and>
					<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>
					</or>
					<equals>
						<property>/systems/failures/elevator-left</property>
						<value>0</value>
					</equals>
				</and>
			</condition>
			<expression>
				<table>
					<property>/controls/flight/elevator-fbw</property> 
					<entry><ind>-1</ind><dep>-0.5</dep></entry>
					<entry><ind> 0</ind><dep> 0.0</dep></entry>
					<entry><ind> 1</ind><dep> 0.5</dep></entry>
				</table>
			</expression>
		</input>
		<output>/controls/flight/elevator-left-cmd</output>
		<min>-0.5</min>
		<max>0.5</max>
	</filter>
	
	<filter>
		<debug>false</debug>
		<type>noise-spike</type>
		<input>/controls/flight/elevator-left-cmd</input>
		<output>/controls/flight/elevator-left</output>
		<max-rate-of-change>2.5</max-rate-of-change>
	</filter>
	
	<filter>
		<debug>false</debug>
		<type>gain</type>
		<gain>1.0</gain>
		<input>
			<condition>
				<or>
					<and>
						<less-than>
							<property>/systems/hydraulic/yellow-psi</property>
							<value>1500</value>
						</less-than>
						<less-than>
							<property>/systems/hydraulic/blue-psi</property>
							<value>1500</value>
						</less-than>
					</and>
					<equals>
						<property>/systems/failures/elevator-right</property>
						<value>1</value>
					</equals>
				</or>
			</condition>
			<property>/systems/hydraulic/elevator-droop</property>
		</input>
		<input>
			<condition>
				<and>
					<or>
						<greater-than-equals>
							<property>/systems/hydraulic/yellow-psi</property>
							<value>1500</value>
						</greater-than-equals>
						<greater-than-equals>
							<property>/systems/hydraulic/blue-psi</property>
							<value>1500</value>
						</greater-than-equals>
					</or>
					<equals>
						<property>/systems/failures/elevator-right</property>
						<value>0</value>
					</equals>
				</and>
			</condition>
			<expression>
				<table>
					<property>/controls/flight/elevator-fbw</property> 
					<entry><ind>-1</ind><dep>-0.5</dep></entry>
					<entry><ind> 0</ind><dep> 0.0</dep></entry>
					<entry><ind> 1</ind><dep> 0.5</dep></entry>
				</table>
			</expression>
		</input>
		<output>/controls/flight/elevator-right-cmd</output>
		<min>-0.5</min>
		<max>0.5</max>
	</filter>
	
	<filter>
		<debug>false</debug>
		<type>noise-spike</type>
		<input>/controls/flight/elevator-right-cmd</input>
		<output>/controls/flight/elevator-right</output>
		<max-rate-of-change>2.5</max-rate-of-change>
	</filter>
	
	<filter>
		<debug>false</debug>
		<type>gain</type>
		<gain>1.0</gain>
		<input>
			<expression>
				<sum>
					<property>/controls/flight/elevator-left</property>
					<property>/controls/flight/elevator-right</property>
				</sum>
			</expression>
		</input>
		<output>/controls/flight/elevator-sum</output>
		<min>-1.0</min>
		<max>1.0</max>
	</filter>
	
 <!-- =============================================================== -->
 <!-- Rudder Control                                                  -->
 <!-- =============================================================== -->
 
	<filter>
		<debug>false</debug>
		<type>gain</type>
		<gain>1.0</gain>
		<input>
			<condition>
				<or>
					<and>
						<less-than>
							<property>/systems/hydraulic/green-psi</property>
							<value>1500</value>
						</less-than>
						<less-than>
							<property>/systems/hydraulic/blue-psi</property>
							<value>1500</value>
						</less-than>
						<less-than>
							<property>/systems/hydraulic/yellow-psi</property>
							<value>1500</value>
						</less-than>
					</and>
					<equals>
						<property>/systems/failures/rudder</property>
						<value>1</value>
					</equals>
				</or>
			</condition>
			<value>0</value>
		</input>
		<input>
			<condition>
				<and>
					<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>
					<equals>
						<property>/systems/failures/rudder</property>
						<value>0</value>
					</equals>
				</and>
			</condition>
			<expression>
				<sum>
					<property>/controls/flight/rudder-fbw</property>
					<property>/controls/flight/rudder-trim</property> 
				</sum>
			</expression>
		</input>
		<output>/controls/flight/rudder-fdm-cmd</output>
		<min>-1.0</min>
		<max>1.0</max>
	</filter>
	
	<filter>
		<debug>false</debug>
		<type>noise-spike</type>
		<input>/controls/flight/rudder-fdm-cmd</input>
		<output>/controls/flight/rudder-fdm</output>
		<max-rate-of-change>2.5</max-rate-of-change>
	</filter>
	
 <!-- =============================================================== -->
 <!-- Speedbrake Logic                                                -->
 <!-- =============================================================== -->
 
	<!-- Speedbrake Sum -->
	
	<filter>
		<debug>false</debug>
		<type>gain</type>
		<gain>1.0</gain>
		<input>
			<condition>
				<and>
					<equals>
						<property>/gear/gear[1]/wow</property>
						<value>0</value>
					</equals>
					<equals>
						<property>/gear/gear[2]/wow</property>
						<value>0</value>
					</equals>
				</and>
			</condition>
			<expression>
				<product>
					<sum>
						<property>/controls/flight/spoiler-l-sum</property>
						<property>/controls/flight/spoiler-r-sum</property>
					</sum>
					<value>0.15</value>
				</product>
			</expression>
		</input>
		<input>
			<condition>
				<or>
					<equals>
						<property>/gear/gear[1]/wow</property>
						<value>1</value>
					</equals>
					<equals>
						<property>/gear/gear[2]/wow</property>
						<value>1</value>
					</equals>
				</or>
			</condition>
			<expression>
				<product>
					<sum>
						<property>/controls/flight/spoiler-l-sum</property>
						<property>/controls/flight/spoiler-r-sum</property>
					</sum>
					<value>0.1</value>
				</product>
			</expression>
		</input>
		<output>/controls/flight/speedbrake-output</output>
	</filter>
 
	<!-- Auto Speedbrake -->
	
	<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>

	<!-- Speedbrake Selector -->
	
	<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>
	
	<filter>
		<name>Speedbrake Norm</name>
		<type>noise-spike</type>
		<input>/controls/flight/speedbrake</input>
		<output>/controls/flight/speedbrake-norm</output>
		<max-rate-of-change>0.7</max-rate-of-change>
	</filter>
	
	<!-- Braking -->
	<filter>
		<name>Left Press</name>
		<type>gain</type>
		<gain>1</gain>
		<update-interval-secs type="double">0.05</update-interval-secs>
		<input> 
			<expression>
				<table>
					<property>/controls/gear/brake-left</property>
					<entry><ind>  0</ind><dep>0</dep></entry>
					<entry><ind>0.3</ind><dep>1000</dep></entry>
					<entry><ind>0.6</ind><dep>2000</dep></entry>
					<entry><ind>  1</ind><dep>3000</dep></entry>
				</table>
			</expression>
		</input>
		<output>/systems/hydraulic/brakes/pressure-left-psi</output>
	</filter>
	
	<filter>
		<name>Right Press</name>
		<type>gain</type>
		<gain>1</gain>
		<update-interval-secs type="double">0.05</update-interval-secs>
		<input> 
			<expression>
				<table>
					<property>/controls/gear/brake-right</property>
					<entry><ind>  0</ind><dep>0</dep></entry>
					<entry><ind>0.3</ind><dep>1000</dep></entry>
					<entry><ind>0.6</ind><dep>2000</dep></entry>
					<entry><ind>  1</ind><dep>3000</dep></entry>
				</table>
			</expression>
		</input>
		<output>/systems/hydraulic/brakes/pressure-right-psi</output>
	</filter>
	
	<!-- =============================================================== -->
	<!-- Landing Gear                                                    -->
	<!-- =============================================================== -->
	
	<filter>
		<name>Left Door</name>
		<type>gain</type>
		<gain>1</gain>
		<update-interval-secs type="double">0.05</update-interval-secs>
		<input> 
			<expression>
				<table>
					<property>/gear/gear[1]/position-norm</property>
					<entry><ind>  0</ind><dep>0</dep></entry>
					<entry><ind>0.19</ind><dep>1</dep></entry>
					<entry><ind>0.81</ind><dep>1</dep></entry>
					<entry><ind>  1</ind><dep>0</dep></entry>
				</table>
			</expression>
		</input>
		<output>/systems/hydraulic/gear/door-left</output>
	</filter>
	
	<filter>
		<name>Left Door Conversion to Degrees</name>
		<type>gain</type>
		<gain>1</gain>
		<update-interval-secs type="double">0.05</update-interval-secs>
		<input> 
			<expression>
				<table>
					<property>/systems/hydraulic/gear/door-left</property>
					<entry><ind>  0</ind><dep>0</dep></entry>
					<entry><ind>  1</ind><dep>-100</dep></entry>
				</table>
			</expression>
		</input>
		<output>/ECAM/Lower/door-left</output>
	</filter>
	
	<filter>
		<name>Right Door</name>
		<type>gain</type>
		<gain>1</gain>
		<update-interval-secs type="double">0.05</update-interval-secs>
		<input> 
			<expression>
				<table>
					<property>/gear/gear[2]/position-norm</property>
					<entry><ind>  0</ind><dep>0</dep></entry>
					<entry><ind>0.19</ind><dep>1</dep></entry>
					<entry><ind>0.81</ind><dep>1</dep></entry>
					<entry><ind>  1</ind><dep>0</dep></entry>
				</table>
			</expression>
		</input>
		<output>/systems/hydraulic/gear/door-right</output>
	</filter>
	
	<filter>
		<name>Right Door Conversion to Degrees</name>
		<type>gain</type>
		<gain>1</gain>
		<update-interval-secs type="double">0.05</update-interval-secs>
		<input> 
			<expression>
				<table>
					<property>/systems/hydraulic/gear/door-right</property>
					<entry><ind>  0</ind><dep>0</dep></entry>
					<entry><ind>  1</ind><dep>100</dep></entry>
				</table>
			</expression>
		</input>
		<output>/ECAM/Lower/door-right</output>
	</filter>
	
	<filter>
		<name>Nose Door</name>
		<type>gain</type>
		<gain>1</gain>
		<update-interval-secs type="double">0.05</update-interval-secs>
		<input> 
			<expression>
				<table>
					<property>/gear/gear[0]/position-norm</property>
					<entry><ind>  0</ind><dep>0</dep></entry>
					<entry><ind>0.19</ind><dep>1</dep></entry>
					<entry><ind>0.81</ind><dep>1</dep></entry>
					<entry><ind>  1</ind><dep>0</dep></entry>
				</table>
			</expression>
		</input>
		<output>/systems/hydraulic/gear/door-nose</output>
	</filter>
	
	<filter>
		<name>NLG Left Door Conversion to Degrees</name>
		<type>gain</type>
		<gain>1</gain>
		<update-interval-secs type="double">0.05</update-interval-secs>
		<input> 
			<expression>
				<table>
					<property>/systems/hydraulic/gear/door-nose</property>
					<entry><ind>  0</ind><dep>0</dep></entry>
					<entry><ind>  1</ind><dep>95</dep></entry>
				</table>
			</expression>
		</input>
		<output>/ECAM/Lower/door-nose-left</output>
	</filter>
	
	<filter>
		<name>NLG Right Door Conversion to Degrees</name>
		<type>gain</type>
		<gain>1</gain>
		<update-interval-secs type="double">0.05</update-interval-secs>
		<input> 
			<expression>
				<table>
					<property>/systems/hydraulic/gear/door-nose</property>
					<entry><ind>  0</ind><dep>0</dep></entry>
					<entry><ind>  1</ind><dep>-95</dep></entry>
				</table>
			</expression>
		</input>
		<output>/ECAM/Lower/door-nose-right</output>
	</filter>

</PropertyList>