<?xml version="1.0"?>

<!-- McDonnell Douglas DC-10 FCC -->
<!-- Copyright (c) 2026 Josh Davidson (Octal450) -->

<system name="DC-10: FCC">
	
	<property value="0">/systems/fcc/aileron-out-enable</property>
	<property value="0">/systems/fcc/cws-roll/input</property>
	
	<!-- Properties for tuning -->
	<property value="0">/systems/fcc/cws-roll/p-gain-tune</property>
	<property value="0">/systems/fcc/cws-roll/i-gain-tune</property>
	<property value="0">/systems/fcc/cws-roll/d-gain-tune</property>
	<property value="0">/systems/fcc/cws-pitch/p-gain-tune</property>
	<property value="0">/systems/fcc/cws-pitch/i-gain-tune</property>
	<property value="0">/systems/fcc/cws-pitch/d-gain-tune</property>
	<property value="0">/systems/fcc/yaw/yd-p-gain-tune</property>
	<property value="0">/systems/fcc/yaw/tc-p-gain-tune</property>
	<property value="0">/systems/fcc/yaw/tc-d-gain-tune</property>
	
	<channel name="Libraries">
		
		<switch name="/systems/fcc/fcc1-power">
			<default value="0"/>
			<test logic="OR" value="1">
				/systems/electrical/bus/dc-1 ge 24
				/systems/electrical/bus/l-emer-dc ge 24
			</test>
		</switch>
		
		<switch name="/systems/fcc/fcc2-power">
			<default value="0"/>
			<test logic="OR" value="1">
				/systems/electrical/bus/dc-3 ge 24
				/systems/electrical/bus/r-emer-dc ge 24
			</test>
		</switch>
		
		<switch name="/systems/fcc/power-avail">
			<default value="0"/>
			<test logic="OR" value="1">
				/systems/fcc/fcc1-power eq 1
				/systems/fcc/fcc2-power eq 1
			</test>
		</switch>
		
		<switch name="/systems/fcc/afs/enabled">
			<default value="0"/>
			<test logic="AND" value="1">
				/it-autoflight/output/ap1 eq 1
				/it-autoflight/input/fgs1-sel eq 2
			</test>
			<test logic="AND" value="1">
				/it-autoflight/output/ap2 eq 1
				/it-autoflight/input/fgs2-sel eq 2
			</test>
		</switch>
		
		<switch name="/systems/fcc/cws/enabled">
			<default value="0"/>
			<test value="0"> <!-- Either CMD engages overrides CWS -->
				/systems/fcc/afs/enabled eq 1
			</test>
			<test logic="AND" value="1">
				/it-autoflight/output/ap1 eq 1
				/it-autoflight/input/fgs1-sel eq 1
			</test>
			<test logic="AND" value="1">
				/it-autoflight/output/ap2 eq 1
				/it-autoflight/input/fgs2-sel eq 1
			</test>
		</switch>
		
		<fcs_function name="/systems/fcc/cws-roll/phidot-rad_sec">
			<function>
				<toradians>
					<property>/orientation/roll-rate-degps</property>
				</toradians>
			</function>
		</fcs_function>
		
		<fcs_function name="/systems/fcc/cws-pitch/thetadot-rad_sec">
			<function>
				<toradians>
					<property>/orientation/pitch-rate-degps</property>
				</toradians>
			</function>
		</fcs_function>
		
		<summer name="/it-autoflight/input/alt-diff">
			<input>/instrumentation/altimeter/indicated-altitude-ft</input>
			<input>-/it-autoflight/input/alt</input>
		</summer>
		
		<fcs_function name="/it-autoflight/input/alt-diff-abs">
			<function>
				<abs>
					<property>/it-autoflight/input/alt-diff</property>
				</abs>
			</function>
		</fcs_function>
		
		<summer name="/it-autoflight/internal/alt-diff">
			<input>/instrumentation/altimeter/indicated-altitude-ft</input>
			<input>-/it-autoflight/internal/alt</input>
		</summer>
		
		<fcs_function name="/it-autoflight/internal/alt-diff-abs">
			<function>
				<abs>
					<property>/it-autoflight/internal/alt-diff</property>
				</abs>
			</function>
		</fcs_function>
	
	</channel>
	
	<channel name="Envelope Protection Calculations" execrate="8"> <!-- Also check dc-10-performance.xml -->
		
		<!-- Takeoff/Go Around Speeds -->
		<!-- This requires calculation of Vmcg, V1, and Vr as well -->
		<switch name="/systems/fcc/speeds/flaps-wow-switch">
			<default value="fcs/flap-pos-deg"/>
			<test value="/systems/fcc/speeds/flaps-wow-switch">
				position/wow eq 0
			</test>
		</switch>
		
		<switch name="/systems/fcc/speeds/altitude-ft-latch">
			<default value="/systems/fcc/speeds/altitude-ft-latch"/>
			<test logic="AND" value="/position/altitude-ft">
				position/wow eq 1
				/velocities/groundspeed-kt lt 30
			</test>
		</switch>
		
		<switch name="/systems/fcc/speeds/tat-c-latch">
			<default value="/systems/fcc/speeds/tat-c-latch"/>
			<test logic="AND" value="propulsion/tat-c">
				position/wow eq 1
				/velocities/groundspeed-kt lt 30
			</test>
		</switch>
		
		<!-- Vmcg -->
		<fcs_function name="/systems/fcc/speeds/vmcg">
			<function>
				<table>
					<independentVar lookup="row">/systems/fcc/speeds/altitude-ft-latch</independentVar>
					<independentVar lookup="column">/systems/fcc/speeds/tat-c-latch</independentVar>
					<tableData>
						       15   20   25   30   35   40   45   50
						    0  137  136  136  136  134  131  129  126
						 1000  135  134  134  133  131  129  126  124
						 2000  133  132  132  131  129  126  124  121
						 3000  131  131  130  129  126  124  121  121
						 4000  129  129  128  126  124  121  119  119
						 5000  127  126  125  124  121  119  116  116
						 6000  125  124  123  121  119  116  116  116
						 7000  122  122  120  118  116  114  114  114
						 8000  120  119  118  116  113  113  113  113
						 9000  118  117  116  114  112  112  112  112
						10000  116  115  113  112  110  110  110  110
					</tableData>
				</table>
			</function>
		</fcs_function>
		
		<!-- V1 -->
		<fcs_function name="/systems/fcc/speeds/v1-table">
			<function>
				<table>
					<independentVar lookup="row">inertia/weight-kg</independentVar>
					<independentVar lookup="column">/systems/fcc/speeds/flaps-wow-switch</independentVar>
					<tableData>
						        10   11   12   13   14   15   16   17   18   19   20   21   22   23   24   25   28
						160000  100  100   98   98   97   97   96   96   96   96   95   95   94   94   94   94   93
						165000  103  103  102  102  101  101  100  100   99   99   98   98   97   97   97   97   96
						170000  106  106  105  105  104  104  103  103  102  102  102  102  101  101  100  100   99
						175000  110  110  108  108  107  107  106  106  105  105  105  105  104  104  103  103  103
						180000  113  113  111  111  110  110  109  109  109  109  108  108  107  107  107  107  106
						185000  116  116  114  114  113  113  112  112  112  112  111  111  110  110  110  110  109
						190000  119  119  118  118  117  117  116  116  115  115  114  114  114  114  113  113  112
						195000  122  122  121  121  119  119  118  118  117  117  117  117  116  116  116  116  114
						200000  125  125  124  124  122  122  121  121  120  120  120  120  119  119  119  119  117
						205000  128  128  126  126  125  125  124  124  123  123  122  122  122  122  121  121  120
						210000  131  131  129  129  128  128  127  127  126  126  125  125  125  125  124  124  123
						215000  134  134  132  132  131  131  130  130  129  129  128  128  127  127  127  127  126
						220000  137  137  135  135  134  134  133  133  132  132  131  131  130  130  130  130  129
						225000  139  139  138  138  136  136  135  135  134  134  133  133  133  133  132  132  131
						230000  142  142  141  141  139  139  138  138  137  137  136  136  136  136  135  135  134
						235000  145  145  143  143  142  142  140  140  139  139  138  138  138  138  137  137  136
						240000  147  147  146  146  145  145  143  143  142  142  142  142  141  141  140  140  139
						245000  150  150  148  148  147  147  145  145  144  144  144  144  143  143  143  143  141
						250000  153  153  151  151  150  150  148  148  147  147  147  147  146  146  146  146  144
						255000  155  155  153  153  152  152  150  150  149  149  149  149  148  148  148  148  146
						260000  158  158  156  156  155  155  153  153  152  152  152  152  151  151  151  151  149
						265000  160  160  158  158  157  157  155  155  154  154  154  154  153  153  153  153  151
						270000  163  163  161  161  160  160  158  158  157  157  156  156  156  156  156  156  154
						275000  165  165  163  163  162  162  160  160  159  159  158  158  158  158  158  158  156
						280000  168  168  166  166  165  165  163  163  162  162  161  161  161  161  160  160  158
						285000  170  170  168  168  167  167  165  165  164  164  163  163  163  163  162  162  160
						290000  172  172  170  170  169  169  167  167  166  166  165  165  165  165  164  164  162
					</tableData>
				</table>
			</function>
		</fcs_function>
		
		<fcs_function name="/systems/fcc/speeds/v1-delta">
			<function>
				<sum>
					<table>
						<independentVar lookup="row">/systems/fcc/speeds/altitude-ft-latch</independentVar>
						<tableData>
							    0   0
							10000  14
						</tableData>
					</table>
					<table>
						<independentVar lookup="row">/systems/fcc/speeds/tat-c-latch</independentVar>
						<tableData>
							25   0
							60  10
						</tableData>
					</table>
				</sum>
			</function>
			<clipto>
				<min>0</min>
				<max>21</max>
			</clipto>
		</fcs_function>
		
		<fcs_function name="/systems/fcc/speeds/v1">
			<function>
				<max>
					<sum>
						<property>/systems/fcc/speeds/v1-table</property>
						<property>/systems/fcc/speeds/v1-delta</property>
					</sum>
					<property>/systems/fcc/speeds/vmcg</property>
				</max>
			</function>
		</fcs_function>
		
		<!-- Vr -->
		<fcs_function name="/systems/fcc/speeds/vr-table">
			<function>
				<table>
					<independentVar lookup="row">inertia/weight-kg</independentVar>
					<independentVar lookup="column">/systems/fcc/speeds/flaps-wow-switch</independentVar>
					<tableData>
						        10   11   12   13   14   15   16   17   18   19   20   21   22   23   24   25   28
						160000  126  126  125  125  123  123  122  122  121  121  120  120  119  119  119  119  117
						165000  129  129  128  128  126  126  125  125  124  124  123  123  122  122  122  122  120
						170000  132  132  131  131  129  129  128  128  127  127  126  126  125  125  125  125  123
						175000  135  135  134  134  132  132  131  131  130  130  129  129  128  128  128  128  126
						180000  138  138  136  136  135  135  134  134  133  133  132  132  131  131  130  130  128
						185000  141  141  139  139  138  138  137  137  136  136  135  135  134  134  133  133  131
						190000  144  144  142  142  140  140  139  139  138  138  137  137  136  136  135  135  133
						195000  147  147  145  145  143  143  142  142  141  141  140  140  139  139  138  138  136
						200000  149  149  147  147  145  145  144  144  143  143  142  142  141  141  140  140  139
						205000  152  152  150  150  148  148  147  147  146  146  145  145  144  144  143  143  142
						210000  154  154  152  152  150  150  149  149  148  148  147  147  146  146  145  145  144
						215000  156  156  154  154  153  153  151  151  150  150  149  149  148  148  147  147  146
						220000  158  158  156  156  155  155  153  153  152  152  151  151  150  150  149  149  147
						225000  161  161  159  159  157  157  156  156  155  155  154  154  153  153  152  152  149
						230000  163  163  161  161  159  159  158  158  157  157  156  156  155  155  154  154  151
						235000  166  166  163  163  161  161  160  160  159  159  158  158  157  157  156  156  154
						240000  168  168  165  165  164  164  162  162  161  161  160  160  159  159  158  158  156
						245000  170  170  168  168  166  166  164  164  163  163  162  162  161  161  160  160  158
						250000  172  172  170  170  168  168  166  166  165  165  164  164  163  163  162  162  160
						255000  174  174  172  172  170  170  168  168  167  167  166  166  165  165  164  164  162
						260000  176  176  174  174  172  172  170  170  169  169  168  168  167  167  166  166  163
						265000  178  178  176  176  174  174  172  172  171  171  170  170  169  169  168  168  165
						270000  180  180  178  178  176  176  174  174  173  173  172  172  171  171  170  170  167
						275000  182  182  180  180  178  178  176  176  175  175  174  174  173  173  172  172  169
						280000  184  184  182  182  180  180  178  178  177  177  176  176  175  175  174  174  171
						285000  186  186  183  183  181  181  180  180  178  178  177  177  176  176  175  175  172
						290000  187  187  184  184  182  182  181  181  179  179  178  178  177  177  176  176  173
					</tableData>
				</table>
			</function>
		</fcs_function>
		
		<fcs_function name="/systems/fcc/speeds/vr-delta">
			<function>
				<sum>
					<table>
						<independentVar lookup="row">/systems/fcc/speeds/altitude-ft-latch</independentVar>
						<tableData>
							    0  0
							10000  7
						</tableData>
					</table>
					<table>
						<independentVar lookup="row">/systems/fcc/speeds/tat-c-latch</independentVar>
						<tableData>
							25  0
							60  5
						</tableData>
					</table>
				</sum>
			</function>
			<clipto>
				<min>0</min>
				<max>10</max>
			</clipto>
		</fcs_function>
		
		<fcs_function name="/systems/fcc/speeds/vr-calc">
			<function>
				<sum>
					<property>/systems/fcc/speeds/vr-table</property>
					<property>/systems/fcc/speeds/vr-delta</property>
				</sum>
			</function>
		</fcs_function>
		
		<fcs_function name="/systems/fcc/speeds/vr">
			<function>
				<max>
					<property>/systems/fcc/speeds/vr-calc</property>
					<property>/systems/fcc/speeds/v1</property>
					<property>/systems/fcc/speeds/vmcg</property>
				</max>
			</function>
		</fcs_function>
		
		<!-- V2 -->
		<fcs_function name="/systems/fcc/speeds/v2-table">
			<function>
				<table>
					<independentVar lookup="row">inertia/weight-kg</independentVar>
					<independentVar lookup="column">/systems/fcc/speeds/flaps-wow-switch</independentVar>
					<tableData>
						        10   11   12   13   14   15   16   17   18   19   20   21   22   23   24   25   28
						160000  149  149  148  148  146  146  145  145  143  143  142  142  142  142  141  141  138
						165000  151  151  150  150  148  148  147  147  145  145  144  144  144  144  143  143  140
						170000  153  153  151  151  150  150  148  148  147  147  146  146  145  145  144  144  142
						175000  155  155  153  153  152  152  150  150  149  149  148  148  147  147  146  146  144
						180000  157  157  155  155  153  153  152  152  151  151  149  149  149  149  148  148  145
						185000  159  159  157  157  155  155  154  154  153  153  151  151  151  151  150  150  147
						190000  160  160  158  158  157  157  155  155  154  154  153  153  152  152  151  151  148
						195000  162  162  160  160  159  159  157  157  156  156  155  155  154  154  153  153  150
						200000  164  164  162  162  160  160  159  159  157  157  156  156  155  155  154  154  151
						205000  166  166  164  164  162  162  161  161  159  159  158  158  157  157  156  156  153
						210000  167  167  165  165  164  164  162  162  161  161  159  159  158  158  158  158  155
						215000  169  169  167  167  166  166  164  164  163  163  161  161  160  160  159  159  156
						220000  170  170  168  168  167  167  165  165  164  164  162  162  161  161  160  160  157
						225000  172  172  171  171  169  169  167  167  166  166  164  164  163  163  162  162  159
						230000  173  173  172  172  170  170  168  168  167  167  165  165  164  164  163  163  160
						235000  175  175  174  174  172  172  170  170  169  169  167  167  166  166  165  165  162
						240000  177  177  175  175  173  173  172  172  170  170  169  169  168  168  167  167  164
						245000  179  179  177  177  175  175  174  174  172  172  171  171  170  170  169  169  166
						250000  180  180  178  178  176  176  175  175  173  173  172  172  171  171  170  170  167
						255000  182  182  180  180  178  178  177  177  175  175  174  174  173  173  172  172  169
						260000  184  184  182  182  179  179  178  178  176  176  175  175  174  174  173  173  170
						265000  186  186  184  184  181  181  180  180  178  178  177  177  176  176  175  175  172
						270000  187  187  185  185  183  183  181  181  180  180  178  178  177  177  176  176  173
						275000  189  189  187  187  185  185  183  183  181  181  180  180  179  179  178  178  175
						280000  190  190  188  188  186  186  184  184  182  182  181  181  180  180  179  179  176
						285000  192  192  190  190  188  188  186  186  184  184  183  183  182  182  181  181  178
						290000  193  193  191  191  189  189  187  187  185  185  184  184  183  183  182  182  179
					</tableData>
				</table>
			</function>
		</fcs_function>
		
		<fcs_function name="/systems/fcc/speeds/vr-to-v2-delta">
			<function>
				<sum>
					<table>
						<independentVar lookup="row">/systems/fcc/speeds/altitude-ft-latch</independentVar>
						<tableData>
							    0  17
							10000  10
						</tableData>
					</table>
					<table>
						<independentVar lookup="row">/systems/fcc/speeds/tat-c-latch</independentVar>
						<tableData>
							25  0
							60 -5
						</tableData>
					</table>
				</sum>
			</function>
			<clipto>
				<min>8</min>
				<max>17</max>
			</clipto>
		</fcs_function>
		
		<fcs_function name="/systems/fcc/speeds/v2">
			<function>
				<ifthen>
					<lt>
						<property>/systems/fcc/speeds/vr-calc</property>
						<property>/systems/fcc/speeds/vmcg</property>
					</lt>
					<sum>
						<property>/systems/fcc/speeds/vmcg</property>
						<property>/systems/fcc/speeds/vr-to-v2-delta</property>
					</sum>
					<property>/systems/fcc/speeds/v2-table</property>
				</ifthen>
			</function>
		</fcs_function>
		
		<fcs_function name="/systems/fcc/speeds/v2-plus-10">
			<function>
				<sum>
					<property>/systems/fcc/speeds/v2</property>
					<value>10</value>
				</sum>
			</function>
		</fcs_function>
		
		<switch name="/systems/fcc/speeds/v2-target-ias-input">
			<default value="/instrumentation/airspeed-indicator/indicated-speed-kt"/>
			<test logic="AND" value="/systems/fcc/speeds/v2-target-ias-input">
				/systems/engines/any-engine-out eq 1
			</test>
		</switch>
		
		<fcs_function name="/systems/fcc/speeds/v2-target"> <!-- Target V2 for TAKE OFF or G/A -->
			<function>
				<floor>
					<sum>
						<ifthen>
							<eq>
								<property>/systems/engines/any-engine-out</property>
								<value>1</value>
							</eq>
							<min>
								<max>
									<property>/systems/fcc/speeds/v2-target-ias-input</property>
									<property>/systems/fcc/speeds/v2</property>
								</max>
								<property>/systems/fcc/speeds/v2-plus-10</property>
							</min>
							<property>/systems/fcc/speeds/v2-plus-10</property>
						</ifthen>
						<value>0.5</value>
					</sum>
				</floor>
			</function>
		</fcs_function>
		
		<!-- Vmo/Mmo -->
		<fcs_function name="/systems/fcc/speeds/mmo-kts">
			<function>
				<product>
					<quotient>
						<property>/instrumentation/airspeed-indicator/indicated-speed-kt</property>
						<max> <!-- Prevent divide by 0 -->
							<property>/instrumentation/airspeed-indicator/indicated-mach</property>
							<value>0.0001</value>
						</max>
					</quotient>
					<value>0.88</value>
				</product>
			</function>
		</fcs_function>
		
		<switch name="/systems/fcc/speeds/vmo-mmo">
			<default value="356"/>
			<test logic="AND" value="/systems/fcc/speeds/mmo-kts">
				/systems/fcc/speeds/mmo-kts lt 356
				position/wow eq 0
			</test>
		</switch>
		
		<pure_gain name="/systems/fcc/speeds/vmax">
			<input>/systems/fcc/speeds/vmo-mmo</input>
			<gain>1.0</gain>
			<clipto>
				<min>100</min>
				<max>100000</max>
			</clipto>
		</pure_gain>
		
		<fcs_function name="/systems/fcc/nlg-timer-1/wow-timer-cmd">
			<function>
				<sum> <!-- Inverter, so that it is 1 at sim start -->
					<product>
						<property>gear/unit[0]/WOW</property>
						<value>-1</value>
					</product>
					<value>1</value>
				</sum>
			</function>
		</fcs_function>
		
		<actuator name="/systems/fcc/nlg-timer-1/wow-timer-pos">
			<input>/systems/fcc/nlg-timer-1/wow-timer-cmd</input>
			<rate_limit sense="incr">1000</rate_limit>
			<rate_limit sense="decr">1</rate_limit> <!-- 1 second -->
		</actuator>
		
		<fcs_function name="/systems/fcc/nlg-timer-1/wow-timer">
			<function>
				<sum> <!-- Inverter, so that it is 1 at sim start -->
					<product>
						<property>/systems/fcc/nlg-timer-1/wow-timer-pos</property>
						<value>-1</value>
					</product>
					<value>1</value>
				</sum>
			</function>
		</fcs_function>
		
		<!-- Vss -->
		<fcs_function name="/systems/fcc/speeds/vss">
			<function>
				<table>
					<independentVar lookup="row">inertia/weight-kg</independentVar>
					<independentVar lookup="column">fcs/flap-pos-deg</independentVar>
					<independentVar lookup="table">fcs/slat-pos-deg</independentVar>
					<tableData breakPoint="0"> <!-- Values clipped and rounded down so Vmin (FAA Stall * 1.3) won't exceed flap max (as per manual) -->
						        0       15      25      28      35      50
						140000  144.22  136.92  132.31  131.54  129.88  128.22
						160000  153.53  145.38  141.54  140.77  138.99  136.26
						180000  162.38  153.85  149.23  148.46  146.31  142.91
						200000  170.63  161.54  156.92  155.38  152.93  147.24
						220000  178.56  169.23  163.85  163.08  156.15  149.61
						240000  185.73  176.15  170.77  170.01  161.15  149.61
						260000  193.14  183.08  177.69  176.53  161.15  149.61
						280000  199.93  190.01  184.23  176.53  161.15  149.61
					</tableData>
					<tableData breakPoint="31">
						        0       10      15      20      25      28      35      50
						140000  119.19  115.99  113.85  112.33  111.47  110.89  109.48  108.07
						160000  126.75  123.24  120.95  119.42  118.40  117.69  116.19  113.89
						180000  133.92  130.11  127.59  126.06  125.02  124.36  122.55  119.68
						200000  140.64  136.67  134.15  132.47  131.34  130.63  128.56  124.98
						220000  147.05  142.62  140.41  138.35  137.30  136.55  134.34  130.14
						240000  153.07  148.65  145.98  143.99  142.82  142.07  139.77  135.00
						260000  158.87  154.52  151.62  149.56  148.16  147.37  145.03  139.77
						280000  164.52  159.94  156.74  154.74  153.33  152.58  150.24  144.19
					</tableData>
				</table>
			</function>
			<clipto>
				<min>0</min>
				<max>/systems/fcc/speeds/vmax</max>
			</clipto>
		</fcs_function>
		
		<!-- Vmin -->
		<fcs_function name="/systems/fcc/speeds/vmin">
			<function>
				<product>
					<difference>
						<property>/systems/fcc/speeds/vss</property>
						<value>15</value>
					</difference>
					<sum>
						<value>1.3</value> <!-- 1.3 Vstall -->
						<table>
							<independentVar lookup="row">atmosphere/density-altitude</independentVar>
							<tableData>
								    0  0.0000
								45000  0.2302
							</tableData>
						</table>
					</sum>
				</product>
			</function>
			<clipto>
				<min>/systems/fcc/speeds/vss</min>
				<max>/systems/fcc/speeds/vmax</max>
			</clipto>
		</fcs_function>
		
		<fcs_function name="/systems/fcc/speeds/vmin-mach">
			<function>
				<product>
					<quotient>
						<property>/instrumentation/airspeed-indicator/indicated-mach</property>
						<max> <!-- Prevent divide by 0 -->
							<property>/instrumentation/airspeed-indicator/indicated-speed-kt</property>
							<value>0.0001</value>
						</max>
					</quotient>
					<property>/systems/fcc/speeds/vmin</property>
				</product>
			</function>
		</fcs_function>
	
	</channel>
	
	<channel name="Yaw Damper Logic">
		
		<switch name="/systems/fcc/yaw/avail-upper-a">
			<default value="0"/>
			<test logic="AND" value="1">
				/controls/fcc/yd-upper-a eq 1
				<test logic="OR">
					/systems/hydraulics/sys-1-psi ge 2200
					/systems/hydraulics/nrmp/sys-2-to-sys-1 ge 2200
				</test>
				/systems/electrical/bus/dc-3 ge 24
				/systems/failures/fcc/yd-upper-a ne 1
			</test>
		</switch>
		
		<switch name="/systems/fcc/yaw/avail-upper-b">
			<default value="0"/>
			<test logic="AND" value="1">
				/controls/fcc/yd-upper-b eq 1
				<test logic="OR">
					/systems/hydraulics/sys-1-psi ge 2200
					/systems/hydraulics/nrmp/sys-2-to-sys-1 ge 2200
				</test>
				/systems/electrical/bus/dc-3 ge 24
				/systems/failures/fcc/yd-upper-b ne 1
			</test>
		</switch>
		
		<switch name="/systems/fcc/yaw/avail-lower-a">
			<default value="0"/>
			<test logic="AND" value="1">
				/controls/fcc/yd-lower-a eq 1
				<test logic="OR">
					/systems/hydraulics/sys-2-psi ge 2200
					/systems/hydraulics/nrmp/sys-3-to-sys-2 ge 2200
				</test>
				/systems/electrical/bus/dc-1 ge 24
				/systems/failures/fcc/yd-lower-a ne 1
			</test>
		</switch>
		
		<switch name="/systems/fcc/yaw/avail-lower-b">
			<default value="0"/>
			<test logic="AND" value="1">
				/controls/fcc/yd-lower-b eq 1
				<test logic="OR">
					/systems/hydraulics/sys-2-psi ge 2200
					/systems/hydraulics/nrmp/sys-3-to-sys-2 ge 2200
				</test>
				/systems/electrical/bus/dc-1 ge 24
				/systems/failures/fcc/yd-lower-b ne 1
			</test>
		</switch>
		
		<switch name="/systems/fcc/yaw/active">
			<default value="0"/>
			<test logic="OR" value="0">
				position/wow eq 1
				position/gear-agl-ft lt 50
			</test>
			<test logic="OR" value="1">
				/systems/fcc/yaw/avail-upper-a eq 1
				/systems/fcc/yaw/avail-upper-b eq 1
				/systems/fcc/yaw/avail-lower-a eq 1
				/systems/fcc/yaw/avail-lower-b eq 1
			</test>
		</switch>
		
		<switch name="/systems/fcc/yaw/upper-active">
			<default value="0"/>
			<test logic="OR" value="1">
				/systems/fcc/yaw/avail-upper-a eq 1
				/systems/fcc/yaw/avail-upper-b eq 1
			</test>
		</switch>
		
		<switch name="/systems/fcc/yaw/lower-active">
			<default value="0"/>
			<test logic="OR" value="1">
				/systems/fcc/yaw/avail-lower-a eq 1
				/systems/fcc/yaw/avail-lower-b eq 1
			</test>
		</switch>
		
		<summer name="/systems/fcc/yaw/channels-active">
			<input>/systems/fcc/yaw/upper-active</input>
			<input>/systems/fcc/yaw/lower-active</input>
		</summer>
	
	</channel>
	
	<channel name="CWS Logic">
		
		<switch name="/systems/fcc/cws-roll/in-detent">
			<default value="/systems/fcc/cws-roll/in-detent"/>
			<test logic="AND" value="1">
				/controls/flight/aileron lt 0.02
				/controls/flight/aileron gt -0.02
				/systems/fcc/cws-roll/input lt 0.02
				/systems/fcc/cws-roll/input gt -0.02
			</test>
			<test logic="OR" value="0">
				/controls/flight/aileron gt 0.045
				/controls/flight/aileron lt -0.045
				/systems/fcc/cws-roll/input gt 0.045
				/systems/fcc/cws-roll/input lt -0.045
			</test>
		</switch>
		
		<switch name="/systems/fcc/cws-pitch/in-detent">
			<default value="/systems/fcc/cws-pitch/in-detent"/>
			<test logic="AND" value="1">
				/controls/flight/elevator lt 0.02
				/controls/flight/elevator gt -0.02
				/systems/fcc/cws-pitch/input lt 0.02
				/systems/fcc/cws-pitch/input gt -0.02
			</test>
			<test logic="OR" value="0">
				/controls/flight/elevator gt 0.045
				/controls/flight/elevator lt -0.045
				/systems/fcc/cws-pitch/input gt 0.045
				/systems/fcc/cws-pitch/input lt -0.045
			</test>
		</switch>
		
		<switch name="/systems/fcc/cws/active-no-wow">
			<default value="0"/>
			<test logic="AND" value="1">
				/systems/fcc/cws/enabled eq 1
				/systems/fcc/afs/enabled eq 0
			</test>
		</switch>
		
		<switch name="/systems/fcc/cws/active">
			<default value="0"/>
			<test logic="AND" value="1">
				/systems/fcc/cws/active-no-wow eq 1
				position/wow eq 0
			</test>
		</switch>
	
	</channel>
	
	<channel name="Gains">
		
		<fcs_function name="/systems/fcc/cws-roll/p-gain">
			<function>
				<product>
					<table>
						<independentVar lookup="row">velocities/vc-kts</independentVar>
						<tableData>
							140 -20
							360  -7
						</tableData>
					</table>
					<!--property>/systems/fcc/cws-roll/p-gain-tune</property--> <!-- For tuning -->
					<property>/systems/fcc/cws/active</property>
				</product>
			</function>
		</fcs_function>
		
		<fcs_function name="/systems/fcc/cws-roll/i-gain">
			<function>
				<product>
					<table>
						<independentVar lookup="row">velocities/vc-kts</independentVar>
						<tableData>
							140 -28
							360 -14
						</tableData>
					</table>
					<!--property>/systems/fcc/cws-roll/i-gain-tune</property--> <!-- For tuning -->
					<property>/systems/fcc/cws/active</property>
				</product>
			</function>
		</fcs_function>
		
		<fcs_function name="/systems/fcc/cws-roll/d-gain">
			<function>
				<product>
					<table>
						<independentVar lookup="row">velocities/vc-kts</independentVar>
						<tableData>
							140 -2.9
							360 -0.7
						</tableData>
					</table>
					<!--property>/systems/fcc/cws-roll/d-gain-tune</property--> <!-- For tuning -->
					<property>/systems/fcc/cws/active</property>
				</product>
			</function>
		</fcs_function>
		
		<fcs_function name="/systems/fcc/cws-pitch/p-gain">
			<function>
				<product>
					<table>
						<independentVar lookup="row">velocities/vc-kts</independentVar>
						<tableData>
							140  30
							360  20
						</tableData>
					</table>
					<!--property>/systems/fcc/cws-pitch/p-gain-tune</property--> <!-- For tuning -->
					<property>/systems/fcc/cws/active</property>
				</product>
			</function>
		</fcs_function>
		
		<fcs_function name="/systems/fcc/cws-pitch/i-gain">
			<function>
				<product>
					<table>
						<independentVar lookup="row">velocities/vc-kts</independentVar>
						<tableData>
							140  60
							360  40
						</tableData>
					</table>
					<!--property>/systems/fcc/cws-pitch/i-gain-tune</property--> <!-- For tuning -->
					<property>/systems/fcc/cws/active</property>
				</product>
			</function>
		</fcs_function>
		
		<fcs_function name="/systems/fcc/cws-pitch/d-gain">
			<function>
				<product>
					<table>
						<independentVar lookup="row">velocities/vc-kts</independentVar>
						<tableData>
							140  5.0
							360  1.8
						</tableData>
					</table>
					<!--property>/systems/fcc/cws-pitch/d-gain-tune</property--> <!-- For tuning -->
					<property>/systems/fcc/cws/active</property>
				</product>
			</function>
		</fcs_function>
		
		<fcs_function name="/systems/fcc/yaw/yd-p-gain">
			<function>
				<product>
					<table>
						<independentVar lookup="row">velocities/vc-kts</independentVar>
						<tableData>
							140 -7.5
							360 -1.0
						</tableData>
					</table>
					<!--property>/systems/fcc/yaw/yd-p-gain-tune</property--> <!-- For tuning -->
					<property>/systems/fcc/yaw/active</property>
				</product>
			</function>
		</fcs_function>
		
		<fcs_function name="/systems/fcc/yaw/tc-p-gain">
			<function>
				<product>
					<table>
						<independentVar lookup="row">velocities/vc-kts</independentVar>
						<tableData>
							140  1.5
							360  0.5
						</tableData>
					</table>
					<!--property>/systems/fcc/yaw/tc-p-gain-tune</property--> <!-- For tuning -->
					<property>/systems/fcc/yaw/active</property>
				</product>
			</function>
		</fcs_function>
		
		<fcs_function name="/systems/fcc/yaw/tc-d-gain">
			<function>
				<product>
					<table>
						<independentVar lookup="row">velocities/vc-kts</independentVar>
						<tableData>
							140  3
							360  1
						</tableData>
					</table>
					<!--property>/systems/fcc/yaw/tc-d-gain-tune</property--> <!-- For tuning -->
					<property>/systems/fcc/yaw/active</property>
				</product>
			</function>
		</fcs_function>
	
	</channel>
	
	<channel name="FCC: Roll CWS">
		
		<switch name="/systems/fcc/cws-roll/phidot-switched">
			<default value="/systems/fcc/cws-roll/phidot-rad_sec"/>
			<test value="0">
				gear/unit[0]/WOW eq 1
			</test>
		</switch>
		
		<lead_lag_filter name="/systems/fcc/cws-roll/phidot-leadlag">
			<input>/systems/fcc/cws-roll/phidot-switched</input>
			<c1>1.05</c1>
			<c2>1.0</c2>
			<c3>0.97</c3>
			<c4>1.0</c4>
		</lead_lag_filter>
		
		<fcs_function name="/systems/fcc/cws-roll/aileron-nul">
			<function>
				<ifthen>
					<eq>
						<property>/systems/fcc/cws-roll/in-detent</property>
						<value>1</value>
					</eq>
					<value>0</value>
					<property>/controls/flight/aileron</property>
				</ifthen>
			</function>
		</fcs_function>
		
		<fcs_function name="/systems/fcc/cws-roll/input">
			<function>
				<table>
					<independentVar lookup="row">attitude/roll-rad</independentVar>
					<independentVar lookup="column">/systems/fcc/cws-roll/aileron-nul</independentVar>
					<tableData>
						          -1    0    1
						-1.047200 -0.5  1.0  1.0
						-0.523599 -1.0  0.0  1.0
						 0.523599 -1.0  0.0  1.0
						 1.047200 -1.0 -1.0  0.5
					</tableData>
				</table>
			</function>
		</fcs_function>
		
		<switch name="/systems/fcc/cws-roll/input-switch">
			<default value="/systems/fcc/cws-roll/input"/>
			<test value="0">
				/systems/fcc/cws-roll/in-detent eq 1
			</test>
		</switch>
		
		<actuator name="/systems/fcc/cws-roll/input-slow">
			<input>/systems/fcc/cws-roll/input-switch</input>
			<rate_limit>1.5</rate_limit>
		</actuator>
		
		<lag_filter name="/systems/fcc/cws-roll/input-demand">
			<input>/systems/fcc/cws-roll/input-slow</input>
			<c1>3.5</c1>
		</lag_filter>
		
		<pure_gain name="/systems/fcc/cws-roll/rate-demand">
			<input>/systems/fcc/cws-roll/input-demand</input>
			<gain>0.261799</gain>
		</pure_gain>
		
		<summer name="/systems/fcc/cws-roll/rate-error">
			<input>/systems/fcc/cws-roll/phidot-leadlag</input>
			<input>-/systems/fcc/cws-roll/rate-demand</input>
		</summer>
		
		<scheduled_gain name="/systems/fcc/cws-roll/p-gain-scheduled"> <!-- Schedule gain to compensate for inactive ailerons -->
			<input>/systems/fcc/cws-roll/p-gain</input>
			<table>
				<independentVar lookup="row">/systems/fcc/aileron-out-enable</independentVar>
				<tableData>
					0  1.00
					1  0.72
				</tableData>
			</table>
		</scheduled_gain>
		
		<scheduled_gain name="/systems/fcc/cws-roll/i-gain-scheduled"> <!-- Schedule gain to compensate for inactive ailerons -->
			<input>/systems/fcc/cws-roll/i-gain</input>
			<table>
				<independentVar lookup="row">/systems/fcc/aileron-out-enable</independentVar>
				<tableData>
					0  1.00
					1  0.72
				</tableData>
			</table>
		</scheduled_gain>
		
		<scheduled_gain name="/systems/fcc/cws-roll/d-gain-scheduled"> <!-- Schedule gain to compensate for inactive ailerons -->
			<input>/systems/fcc/cws-roll/d-gain</input>
			<table>
				<independentVar lookup="row">/systems/fcc/aileron-out-enable</independentVar>
				<tableData>
					0  1.00
					1  0.72
				</tableData>
			</table>
		</scheduled_gain>
		
		<switch name="/systems/fcc/cws-roll/trigger">
			<default value="0"/>
			<test value="-1">
				/systems/fcc/cws/active ne 1
			</test>
			<test logic="OR" value="1">
				/systems/fcc/cws-roll/pid le -0.999
				/systems/fcc/cws-roll/pid ge 0.999
			</test>
		</switch>
		
		<pid name="/systems/fcc/cws-roll/pid">
			<input>/systems/fcc/cws-roll/rate-error</input>
			<kp>/systems/fcc/cws-roll/p-gain-scheduled</kp>
			<ki>/systems/fcc/cws-roll/i-gain-scheduled</ki>
			<kd>/systems/fcc/cws-roll/d-gain-scheduled</kd>
			<trigger>/systems/fcc/cws-roll/trigger</trigger>
			<clipto>
				<min>-1.0</min>
				<max>1.0</max>
			</clipto>
		</pid>
		
		<lag_filter name="/systems/fcc/cws-roll/output">
			<input>/systems/fcc/cws-roll/pid</input>
			<c1>10</c1>
		</lag_filter>
		
		<switch name="/systems/fcc/roll-output">
			<default value="/controls/flight/aileron"/>
			<test value="/systems/fcc/cws-roll/output">
				/systems/fcc/cws/active eq 1
			</test>
			<test value="/systems/fcc/afs/roll-cmd">
				/systems/fcc/afs/enabled eq 1
			</test>
		</switch>
	
	</channel>
	
	<channel name="FCC: Pitch CWS">
		
		<switch name="/systems/fcc/cws-pitch/thetadot-switched">
			<default value="/systems/fcc/cws-pitch/thetadot-rad_sec"/>
			<test value="0">
				gear/unit[0]/WOW eq 1
			</test>
		</switch>
		
		<lead_lag_filter name="/systems/fcc/cws-pitch/thetadot-leadlag">
			<input>/systems/fcc/cws-pitch/thetadot-switched</input>
			<c1>1.05</c1>
			<c2>1.0</c2>
			<c3>0.97</c3>
			<c4>1.0</c4>
		</lead_lag_filter>
		
		<fcs_function name="/systems/fcc/cws-pitch/elevator-nul">
			<function>
				<ifthen>
					<eq>
						<property>/systems/fcc/cws-pitch/in-detent</property>
						<value>1</value>
					</eq>
					<value>0</value>
					<property>/controls/flight/elevator</property>
				</ifthen>
			</function>
		</fcs_function>
		
		<fcs_function name="/systems/fcc/cws-pitch/input">
			<function>
				<table>
					<independentVar lookup="row">attitude/pitch-rad</independentVar>
					<independentVar lookup="column">/systems/fcc/cws-pitch/elevator-nul</independentVar>
					<tableData>
						          -1    0    1
						-0.349066 -1.0 -1.0  0.5
						-0.174533 -1.0  0.0  1.0
						 0.383972 -1.0  0.0  1.0
						 0.558505 -0.5  1.0  1.0
					</tableData>
				</table>
			</function>
		</fcs_function>
		
		<switch name="/systems/fcc/cws-pitch/input-switch">
			<default value="/systems/fcc/cws-pitch/input"/>
			<test value="0">
				/systems/fcc/cws-pitch/in-detent eq 1
			</test>
		</switch>
		
		<scheduled_gain name="/systems/fcc/cws-pitch/input-gain">
			<input>/systems/fcc/cws-pitch/input-switch</input>
			<table>
				<independentVar lookup="row">velocities/vc-kts</independentVar>
				<tableData>
					140  0.83
					360  1.00
				</tableData>
			</table>
		</scheduled_gain>
		
		<actuator name="/systems/fcc/cws-pitch/input-slow">
			<input>/systems/fcc/cws-pitch/input-gain</input>
			<rate_limit>1.5</rate_limit>
		</actuator>
		
		<lag_filter name="/systems/fcc/cws-pitch/input-demand">
			<input>/systems/fcc/cws-pitch/input-slow</input>
			<c1>3.5</c1>
		</lag_filter>
		
		<pure_gain name="/systems/fcc/cws-pitch/rate-demand">
			<input>/systems/fcc/cws-pitch/input-demand</input>
			<gain>-0.087266</gain>
		</pure_gain>
		
		<summer name="/systems/fcc/cws-pitch/rate-error">
			<input>/systems/fcc/cws-pitch/thetadot-leadlag</input>
			<input>-/systems/fcc/cws-pitch/rate-demand</input>
		</summer>
		
		<switch name="/systems/fcc/cws-pitch/trigger">
			<default value="0"/>
			<test value="-1">
				/systems/fcc/cws/active ne 1
			</test>
			<test logic="OR" value="1">
				/systems/fcc/cws-pitch/pid le -0.999
				/systems/fcc/cws-pitch/pid ge 0.999
			</test>
		</switch>
		
		<pid name="/systems/fcc/cws-pitch/pid">
			<input>/systems/fcc/cws-pitch/rate-error</input>
			<kp>/systems/fcc/cws-pitch/p-gain</kp>
			<ki>/systems/fcc/cws-pitch/i-gain</ki>
			<kd>/systems/fcc/cws-pitch/d-gain</kd>
			<trigger>/systems/fcc/cws-pitch/trigger</trigger>
			<clipto>
				<min>-1.0</min>
				<max>1.0</max>
			</clipto>
		</pid>
		
		<lag_filter name="/systems/fcc/cws-pitch/output">
			<input>/systems/fcc/cws-pitch/pid</input>
			<c1>10</c1>
		</lag_filter>
		
		<switch name="/systems/fcc/pitch-output">
			<default value="/controls/flight/elevator"/>
			<test value="/systems/fcc/cws-pitch/output">
				/systems/fcc/cws/active eq 1
			</test>
			<test value="/systems/fcc/afs/pitch-cmd">
				/systems/fcc/afs/enabled eq 1
			</test>
		</switch>
	
	</channel>
	
	<channel name="FCC: Elevator Feel">
		
		<switch name="/systems/fcc/elevator-feel/power">
			<default value="0"/>
			<test logic="OR" value="1">
				/systems/electrical/bus/dc-1 ge 24
				/systems/electrical/bus/dc-2 ge 24
				/systems/electrical/bus/dc-3 ge 24
				/systems/electrical/bus/l-emer-dc ge 24
				/systems/electrical/bus/r-emer-dc ge 24
			</test>
		</switch>
		
		<switch name="/systems/fcc/elevator-feel/auto">
			<default value="0"/>
			<test logic="AND" value="1">
				/controls/fcc/elevator-feel-man ne 1
				/systems/fcc/elevator-feel/power eq 1
				/systems/failures/fcc/elevator-feel ne 1
			</test>
		</switch>
		
		<switch name="/systems/fcc/elevator-feel/switch"> <!-- Manual knob control is in libraries.xml -->
			<default value="/systems/fcc/elevator-feel/speed"/>
			<test value="velocities/vc-kts">
				/systems/fcc/elevator-feel/auto eq 1
			</test>
			<output>/systems/fcc/elevator-feel/speed</output>
			<clipto>
				<min>120</min>
				<max>300</max>
			</clipto>
		</switch>
		
		<fcs_function name="/systems/fcc/elevator-feel/gain">
			<function>
				<table>
					<independentVar lookup="row">/systems/fcc/elevator-feel/speed</independentVar>
					<tableData>
						120  1.000
						140  0.975
						200  0.850
						300  0.625
					</tableData>
				</table>
			</function>
		</fcs_function>
		
		<pure_gain name="/systems/fcc/elevator-feel/output">
			<input>/systems/fcc/pitch-output</input>
			<gain>/systems/fcc/elevator-feel/gain</gain>
		</pure_gain>
		
		<pure_gain name="/systems/fcc/elevator-feel/afs-output">
			<description>Schedule the AFS the same as yoke for when AFS is disconnected with yoke movement</description>
			<input>/systems/fcc/afs/pitch-cmd</input>
			<gain>/systems/fcc/elevator-feel/gain</gain>
		</pure_gain>
		
		<switch name="/systems/fcc/elevator-output">
			<default value="/systems/fcc/elevator-feel/output"/>
			<test value="/systems/fcc/elevator-feel/afs-output">
				/systems/fcc/afs/enabled eq 1
			</test>
		</switch>
	
	</channel>
	
	<channel name="FCC: Yaw Axis and Yaw Damper">
		
		<switch name="/systems/fcc/yaw/autoland-switch">
			<default value="0"/>
			<test logic="AND" value="1">
				/systems/fcc/afs/enabled eq 1
				/it-autoflight/output/lat eq 4
			</test>
		</switch>
		
		<fcs_function name="/systems/fcc/yaw/rudder-nul">
			<function>
				<table>
					<independentVar lookup="row">/controls/flight/rudder</independentVar>
					<independentVar lookup="column">/systems/fcc/yaw/autoland-switch</independentVar>
					<tableData>
						       0  1
						-1.00 -1  0
						-0.02  0  0
						 0.02  0  0
						 1.00  1  0
					</tableData>
				</table>
			</function>
		</fcs_function>
		
		<washout_filter name="/systems/fcc/yaw/r-washout">
			<input>velocities/r-rad_sec</input>
			<c1>0.5</c1>
		</washout_filter>
		
		<switch name="/systems/fcc/yaw/r-switched">
			<default value="/systems/fcc/yaw/r-washout"/>
			<test logic="OR" value="0">
				/systems/fcc/yaw/active ne 1
				/systems/fcc/yaw/autoland-switch eq 1
			</test>
		</switch>
		
		<scheduled_gain name="/systems/fcc/yaw/yd-p-gain-scheduled"> <!-- Schedule gain to compensate for inactive channels -->
			<input>/systems/fcc/yaw/yd-p-gain</input>
			<table>
				<independentVar lookup="row">/systems/fcc/yaw/channels-active</independentVar>
				<tableData>
					0  1
					1  2
					2  1
				</tableData>
			</table>
		</scheduled_gain>
		
		<pure_gain name="/systems/fcc/yaw/yd-f">
			<input>/systems/fcc/yaw/r-switched</input>
			<gain>/systems/fcc/yaw/yd-p-gain-scheduled</gain>
			<clipto>
				<min>-0.5</min>
				<max>0.5</max>
			</clipto>
		</pure_gain>
		
		<switch name="/systems/fcc/yaw/slip-skid-switched">
			<default value="aero/beta-rad"/>
			<test value="0">
				position/wow eq 1
			</test>
		</switch>
		
		<lag_filter name="/systems/fcc/yaw/slip-skid">
			<input>/systems/fcc/yaw/slip-skid-switched</input>
			<c1>2.5</c1>
		</lag_filter>
		
		<scheduled_gain name="/systems/fcc/yaw/tc-p-gain-scheduled"> <!-- Schedule gain to compensate for inactive channels -->
			<input>/systems/fcc/yaw/tc-p-gain</input>
			<table>
				<independentVar lookup="row">/systems/fcc/yaw/channels-active</independentVar>
				<tableData>
					0  1
					1  2
					2  1
				</tableData>
			</table>
		</scheduled_gain>
		
		<scheduled_gain name="/systems/fcc/yaw/tc-d-gain-scheduled"> <!-- Schedule gain to compensate for inactive channels -->
			<input>/systems/fcc/yaw/tc-d-gain</input>
			<table>
				<independentVar lookup="row">/systems/fcc/yaw/channels-active</independentVar>
				<tableData>
					0  1
					1  2
					2  1
				</tableData>
			</table>
		</scheduled_gain>
		
		<pid name="/systems/fcc/yaw/tc-pd">
			<input>/systems/fcc/yaw/slip-skid</input>
			<kp>/systems/fcc/yaw/tc-p-gain-scheduled</kp>
			<ki>0.0</ki>
			<kd>/systems/fcc/yaw/tc-d-gain-scheduled</kd>
			<clipto>
				<min>-0.2</min>
				<max>0.2</max>
			</clipto>
		</pid>
		
		<switch name="/systems/fcc/yaw/tc-pd-s">
			<default value="/systems/fcc/yaw/tc-pd"/>
			<test logic="OR" value="0">
				/systems/fcc/yaw/active ne 1
				/systems/fcc/yaw/autoland-switch eq 1
			</test>
		</switch>
		
		<switch name="/systems/fcc/yaw/afs-cmd">
			<default value="0"/>
			<test value="/systems/fcc/afs/yaw-cmd">
				/systems/fcc/yaw/autoland-switch eq 1
			</test>
		</switch>
		
		<summer name="/systems/fcc/yaw/output-sum">
			<input>/systems/fcc/yaw/yd-f</input>
			<input>/systems/fcc/yaw/tc-pd-s</input>
			<input>/systems/fcc/yaw/afs-cmd</input>
		</summer>
		
		<switch name="/systems/fcc/yaw/upper-output">
			<default value="/systems/fcc/yaw/afs-cmd"/> <!-- AFS keeps working even if YD is unavail -->
			<test value="/systems/fcc/yaw/output-sum">
				/systems/fcc/yaw/upper-active eq 1
			</test>
		</switch>
		
		<switch name="/systems/fcc/yaw/lower-output">
			<default value="/systems/fcc/yaw/afs-cmd"/> <!-- AFS keeps working even if YD is unavail -->
			<test value="/systems/fcc/yaw/output-sum">
				/systems/fcc/yaw/lower-active eq 1
			</test>
		</switch>
		
		<summer name="/systems/fcc/rudder-upper-output">
			<input>/systems/fcc/yaw/rudder-nul</input>
			<input>/systems/fcc/yaw/upper-output</input>
			<clipto>
				<min>-1.0</min>
				<max>1.0</max>
			</clipto>
		</summer>
		
		<summer name="/systems/fcc/rudder-lower-output">
			<input>/systems/fcc/yaw/rudder-nul</input>
			<input>/systems/fcc/yaw/lower-output</input>
			<clipto>
				<min>-1.0</min>
				<max>1.0</max>
			</clipto>
		</summer>
	
	</channel>

</system>
