<?xml version="1.0"?>  
<flight_control name="HK36 Flight Controls System"> 
	<channel name="Pitch">
		<summer name="Pitch Trim Sum">
			<input>fcs/elevator-cmd-norm</input>
			<input>fcs/pitch-trim-cmd-norm</input>
			<clipto>
				<min> -1 </min>
				<max>  1 </max>
			</clipto>
		</summer>
		
		<aerosurface_scale name="Elevator Control">
			<input>fcs/pitch-trim-sum</input>
			<range>
				<min> -0.3142 </min>
				<max>  0.2618 </max>
			</range>
			<output>fcs/elevator-pos-rad</output>
		</aerosurface_scale>
		
		<aerosurface_scale name="Elevator Normalization">
			<input>fcs/elevator-pos-rad</input>
			<domain>
				<min> -0.3142 </min>
				<max>  0.3142 </max>
			</domain>
			<range>
				<min> -1 </min>
				<max>  1 </max>
			</range>
			<output>fcs/elevator-pos-norm</output>
		</aerosurface_scale>
	</channel>
	
	<channel name="Roll">
		<summer name="Roll Trim Sum">
			<input>fcs/aileron-cmd-norm</input>
			<input>fcs/roll-trim-cmd-norm</input>
			<clipto>
				<min> -1 </min>
				<max>  1 </max>
			</clipto>
		</summer>
		
		<aerosurface_scale name="Left Aileron Control">
			<input>fcs/roll-trim-sum</input>
			<range>
				<min> -0.411 </min>
				<max>  0.212 </max>
			</range>
			<output>fcs/left-aileron-pos-rad</output>
		</aerosurface_scale>
		
		<aerosurface_scale name="Right Aileron Control">
			<input>-fcs/roll-trim-sum</input>
			<range>
				<min> -0.411 </min>
				<max>  0.212 </max>
			</range>
			<output>fcs/right-aileron-pos-rad</output>
		</aerosurface_scale>
		
		<aerosurface_scale name="Left Aileron Normalization">
			<input>fcs/left-aileron-pos-rad</input>
			<domain>
				<min> -0.411 </min>
				<max>  0.411 </max>
			</domain>
			<range>
				<min> -1 </min>
				<max>  1 </max>
			</range>
			<output>fcs/left-aileron-pos-norm</output>
		</aerosurface_scale>
		
		<aerosurface_scale name="Right Aileron Normalization">
			<input>fcs/right-aileron-pos-rad</input>
			<domain>
				<min> -0.411 </min>
				<max>  0.411 </max>
			</domain>
			<range>
				<min> -1 </min>
				<max>  1 </max>
			</range>
			<output>fcs/right-aileron-pos-norm</output>
		</aerosurface_scale>
	</channel>
	
	<channel name="Yaw">
		<summer name="Rudder Command Sum">
			<input>fcs/rudder-cmd-norm</input>
			<input>fcs/yaw-trim-cmd-norm</input>
			<clipto>
				<min> -1 </min>
				<max>  1 </max>
			</clipto>
		</summer>
		
		<aerosurface_scale name="Rudder Control">
			<input>fcs/rudder-command-sum</input>
			<range>
				<min> -0.464 </min>
				<max>  0.464 </max>
			</range>
			<output>fcs/rudder-pos-rad</output>
		</aerosurface_scale>
		
		<aerosurface_scale name="Rudder Normalization">
			<input>fcs/rudder-pos-rad</input>
			<domain>
				<min> -0.464 </min>
				<max>  0.464 </max>
			</domain>
			<range>
				<min> -1 </min>
				<max>  1 </max>
			</range>
			<output>fcs/rudder-pos-norm</output>
		</aerosurface_scale>
	</channel>
	<channel name="Spoilers">
		<switch>
			<default value="/controls/flight/spoilers"/>
			<test value="/controls/engines/engine[0]/mixture">
				/options/mixture-to-airbrake eq 1
			</test>
			<output>fcs/spoiler-cmd-norm</output>
		</switch>
		<kinematic name="Spoilers Control">
			<input>fcs/spoiler-cmd-norm</input>
			<traverse>
				<setting>
					<position> 0 </position>
					<time>     0 </time>
				</setting>
				<setting>
					<position> 1 </position>
					<time>     0.1 </time>
				</setting>
			</traverse>
			<output>fcs/spoiler-pos-norm</output>
		</kinematic>
	</channel>
	
	<channel name="Landing Gear">
		<switch name="fcs/gear-no-wow">
			<default value="1"/>
			<test logic="AND" value="0">
				gear/unit[1]/WOW eq 1
				gear/unit[2]/WOW eq 1
			</test>
		</switch>
		<switch>
			<default value="1"/>
			<test value="0">
				gear/unit[0]/WOW eq 0
			</test>
			<output>gear/unit[0]/castered</output>
		</switch>
		<fcs_function>
			<function>
				<value>0</value>
			</function>
			<output>fcs/steer-cmd-norm</output>
		</fcs_function>
	</channel>
	
	<channel name="Switches">
		<lag_filter>
			<input>/controls/switches/master</input>
			<c1>15.0</c1>
			<output>/controls/switches/master-pos</output>
		</lag_filter>
		<lag_filter>
			<input>/controls/switches/mode</input>
			<c1>15.0</c1>
			<output>/controls/switches/mode-pos</output>
		</lag_filter>
		<lag_filter>
			<input>/controls/switches/fuelpump</input>
			<c1>15.0</c1>
			<output>/controls/switches/fuelpump-pos</output>
		</lag_filter>
		<lag_filter>
			<input>/controls/switches/pos</input>
			<c1>15.0</c1>
			<output>/controls/switches/pos-pos</output>
		</lag_filter>
		<lag_filter>
			<input>/controls/switches/acl</input>
			<c1>15.0</c1>
			<output>/controls/switches/acl-pos</output>
		</lag_filter>
		<lag_filter>
			<input>/controls/switches/ldg</input>
			<c1>15.0</c1>
			<output>/controls/switches/ldg-pos</output>
		</lag_filter>
		<lag_filter>
			<input>/controls/switches/instr</input>
			<c1>15.0</c1>
			<output>/controls/switches/instr-pos</output>
		</lag_filter>
		<lag_filter>
			<input>/instrumentation/attitude-indicator/caged-flag</input>
			<c1>15.0</c1>
			<output>/instrumentation/attitude-indicator/cage-knob-pos</output>
		</lag_filter>
		
		<kinematic name="systems/fuel/tank-valve-pos">
			<input>systems/fuel/tank-valve</input>
			<traverse>
				<setting>
					<position> 0 </position>
					<time>     0 </time>
				</setting>
				<setting>
					<position> 1 </position>
					<time>     0.5 </time>
				</setting>
			</traverse>
		</kinematic>
	</channel>
	<property value="0.0">canopy/cmd-norm</property>
	<channel name="Canopy">
		<fcs_function name="canopy/position-raw-norm">
			<function>
				<table>
					<independentVar lookup="row">canopy/cmd-norm</independentVar>
					<independentVar lookup="column">velocities/vc-kts</independentVar>
					<tableData>
							0	29.99	30
						0	0	0	0
						1	1	1	0.1
					</tableData>
				</table>
			</function>
		</fcs_function>
		<kinematic name="canopy/position-norm">
			<input>canopy/position-raw-norm</input>
			<traverse>
				<setting>
					<position> 0 </position>
					<time>     0 </time>
				</setting>
				<setting>
					<position> 1 </position>
					<time>     3 </time>
				</setting>
			</traverse>
		</kinematic>
	</channel>
	<property value="0">fcs/tow/hook-lever</property>
	<channel name="Aerotow">
		<lag_filter>
			<input>fcs/tow/hook-lever</input>
			<c1>10.0</c1>
			<output>fcs/tow/hook-lever-pos</output>
		</lag_filter>
	</channel>
	

	
	<!--<channel name="Animation">
		<fcs_function name="systems/tail-shake-factor">
			<function>
				<table>
					<independentVar lookup="row">propulsion/engine[0]/prop-induced-velocity_fps</independentVar>
					<independentVar lookup="column">velocities/vc-kts</independentVar>
					<tableData>
							0	30
						0	0	0
						15	0	0
						45	1	0
					</tableData>
				</table>
			</function>
		</fcs_function>
	</channel>-->
	
</flight_control>
