<?xml version="1.0"?>
<system name="DA62: FCS">
	<!-- [2] page 8
		Elevator deflects:	up	18 deg
					down	15 deg-->
	<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> -18 </min>
				<max>  15 </max>
			</range>
			<output>fcs/elevator-pos-deg</output>
		</aerosurface_scale>
		
		<aerosurface_scale name="Elevator Normalization">
			<input>fcs/elevator-pos-deg</input>
			<domain>
				<min> -18 </min>
				<max>  15 </max>
			</domain>
			<range>
				<min> -1 </min>
				<max>  1 </max>
			</range>
			<output>fcs/elevator-pos-norm</output>
		</aerosurface_scale>
	</channel>
	
	<!-- [2] page 6 
		Ailerons deflect:	up	25 deg
					down	15 deg-->
	<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> -25 </min>
				<max>  15 </max>
			</range>
			<output>fcs/left-aileron-pos-deg</output>
		</aerosurface_scale>
		
		<aerosurface_scale name="Right Aileron Control">
			<input>-fcs/roll-trim-sum</input>
			<range>
				<min> -25 </min>
				<max>  15 </max>
			</range>
			<output>fcs/right-aileron-pos-deg</output>
		</aerosurface_scale>
		
		<aerosurface_scale name="Left Aileron Normalization">
			<input>fcs/left-aileron-pos-deg</input>
			<domain>
				<min> -25 </min>
				<max>  15 </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-deg</input>
			<domain>
				<min> -25 </min>
				<max>  15 </max>
			</domain>
			<range>
				<min> -1 </min>
				<max>  1 </max>
			</range>
			<output>fcs/right-aileron-pos-norm</output>
		</aerosurface_scale>
	</channel>
	
	<!-- [2] page 8
		Rudder deflects:	left	30 deg
					right	30 deg-->
	<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> -30 </min>
				<max>  30 </max>
			</range>
			<output>fcs/rudder-pos-deg</output>
		</aerosurface_scale>
		
		<aerosurface_scale name="Rudder Normalization">
			<input>fcs/rudder-pos-deg</input>
			<domain>
				<min> -30 </min>
				<max>  30 </max>
			</domain>
			<range>
				<min> -1 </min>
				<max>  1 </max>
			</range>
			<output>fcs/rudder-pos-norm</output>
		</aerosurface_scale>
	</channel>
	
	<!-- [2] page 6 
		Flaps deflect:	crs	0 deg
				t/o	20 deg
				ldg	42 deg-->
	<channel name="Flaps">
		<kinematic name="Flaps Control">
			<input>fcs/flap-cmd-norm</input>
			<traverse>
				<setting>
					<position>  0 </position>
					<time>      0 </time>
				</setting>
				<setting>
					<position> 20 </position>
					<time>      4 </time>
				</setting>
				<setting>
					<position> 42 </position>
					<time>      3 </time>
				</setting>
			</traverse>
			<output>fcs/flap-pos-deg</output>
		</kinematic>
		
		<aerosurface_scale name="Flap Normalization">
			<input>fcs/flap-pos-deg</input>
			<domain>
				<min>  0 </min>
				<max> 42 </max>
			</domain>
			<range>
				<min> 0 </min>
				<max> 1 </max>
			</range>
			<output>fcs/flap-pos-norm</output>
		</aerosurface_scale>
	</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>
		
		<kinematic name="Landing Gear Control">
			<input>gear/gear-cmd-norm</input>
			<traverse>
				<setting>
					<position> 0 </position>
					<time>     0 </time>
				</setting>
				<setting>
					<position> 1 </position>
					<time>     5 </time>
				</setting>
			</traverse>
			<output>gear/gear-pos-norm</output>
		</kinematic>
	</channel>
	
	<channel name="Thruster">
		<summer name="Thrust Coefficient Left">
			<input>propulsion/engine[0]/thrust-coefficient</input>
			<output>systems/propulsion/thrust-coefficient-left</output>
		</summer>
		<summer name="Thrust Coefficient Right">
			<input>propulsion/engine[1]/thrust-coefficient</input>
			<output>systems/propulsion/thrust-coefficient-right</output>
		</summer>
		<summer name="Thrust Coefficient Left-Right">
			<input>systems/propulsion/thrust-coefficient-left</input>
			<input>-systems/propulsion/thrust-coefficient-right</input>
			<output>systems/propulsion/thrust-coefficient-left-right</output>
		</summer>
		<summer name="Thrust Coefficient">
			<input>systems/propulsion/thrust-coefficient-left</input>
			<input>systems/propulsion/thrust-coefficient-right</input>
			<output>systems/propulsion/thrust-coefficient</output>
		</summer>
	</channel>
</system>
