<?xml version="1.0" encoding="UTF-8" ?>

<!--
 ATR 72-500 for FlightGear YASim FDM
 By Ryan M

 Specifications can be viewed on Airliners.net:
 http://www.airliners.net/aircraft-data/stats.main?id=42

 And Wikipedia (of course ;) ):
 http://en.wikipedia.org/wiki/ATR_72#Specifications_.28ATR_72.E2.80.93500.29
-->

<airplane mass="28550">

	<approach speed="90" aoa="7.0" fuel="0.2">
		<control-setting axis="/controls/engines/engine[0]/throttle-lever" value="0.6" />
		<control-setting axis="/controls/engines/engine[1]/throttle-lever" value="0.6" />
		<control-setting axis="/controls/engines/engine[0]/condition-lever" value="1.0" />
		<control-setting axis="/controls/engines/engine[1]/condition-lever" value="1.0" />
		<control-setting axis="/systems/hydraulics/blue/flight/flaps" value="1.0" />
		<control-setting axis="/systems/hydraulics/green/gear/gear-down" value="1.0" />
		<solve-weight idx="0" weight="600" />
		<solve-weight idx="1" weight="8829" />
	</approach>

	<!-- Service ceiling is actually 25000 ft -->
	<cruise speed="276" alt="20000" fuel="0.8">
		<control-setting axis="/controls/engines/engine[0]/throttle-lever" value="0.9" />
		<control-setting axis="/controls/engines/engine[1]/throttle-lever" value="0.9" />
        	<control-setting axis="/controls/engines/engine[0]/condition-lever" value="1.0" />
		<control-setting axis="/controls/engines/engine[1]/condition-lever" value="1.0" />
		<control-setting axis="/systems/hydraulics/blue/flight/flaps" value="0.0" />
		<control-setting axis="/systems/hydraulics/green/gear/gear-down" value="0.0" />
		<solve-weight idx="0" weight="600" />
		<solve-weight idx="1" weight="8829" />
	</cruise>

	<cockpit x="11.0" y="0.6" z="-1.0" />

	<!-- FUSELAGE -->
	<!-- Main fuselage -->
	<fuselage ax="10.363" ay="0.0" az="-1.73" bx="-5.05" by="0.0" bz="-1.73" width="2.7" taper="1.0" midpoint="1.0" />
	<!-- Nose cone -->
	<fuselage ax="13.581" ay="0.0" az="-2.118" bx="10.363" by="0.0" bz="-1.73" width="2.7" taper="0.0" midpoint="1.0" />
	<!-- Rear cone -->
	<fuselage ax="-5.05" ay="0.0" az="-1.73" bx="-13.585" by="0.0" bz="-1.155" width="2.7" taper="0.184" midpoint="0.0" />

	<!-- WINGS -->
	<wing x="1.12" y="0.0" z="-0.24" length="13.524" chord="2.5" sweep="0.0" taper="0.57" camber="0.1" incidence="3.0" twist="-1.0" idrag="2.0">
		<stall aoa="15.0" width="5.0" peak="0.8" />
		<flap0 start="0.086" end="0.707" lift="1.5" drag="2.0" />
		<flap1 start="0.707" end="0.98" lift="1.2" drag="1.5" />
		<spoiler start="0.11" end="0.7" lift="0.0" drag="1.0" />
		<control-input axis="/systems/hydraulics/blue/flight/flaps" control="FLAP0" />
		<control-input axis="/controls/flight/aileron" control="FLAP1" split="true" />
		<control-input axis="/controls/flight/aileron-trim" control="FLAP1" split="true" />
		<control-output control="FLAP0" prop="/surface-positions/flap-pos-norm" />
		<control-output control="FLAP1" side="left" prop="/surface-positions/left-aileron-pos-norm" />
		<control-output control="FLAP1" side="right" prop="/surface-positions/right-aileron-pos-norm" />
		<control-speed control="FLAP0" transition-time="10.0" />
		<control-speed control="FLAP1" transition-time="1.5" />
	</wing>

	<!-- ELEVATORS -->
	<hstab x="-12.07" y="0.0" z="2.93" length="3.36" chord="1.92" sweep="4.0" taper="0.63" camber="0.01" twist="-1.0" idrag="2.0">
		<stall aoa="15.0" width="5.0" peak="0.8" />
		<flap0 start="0.0" end="0.969" lift="1.5" drag="1.5" />
		<control-input axis="/controls/flight/elevator" control="FLAP0" />
		<control-input axis="/controls/flight/elevator-trim" control="FLAP0" />
		<control-output control="FLAP0"  prop="/surface-positions/elevator-pos-norm" />
	</hstab>

	<!-- TAIL -->
	<vstab x="-8.39" y="0.0" z="-0.87" length="6.17" chord="7.68" sweep="41.393" taper="0.24">
		<stall aoa="15.0" width="5.0" peak="0.8" />
		<flap0 start="0.0" end="0.85" lift="1.2" drag="1.3" />
		<control-input axis="/controls/flight/rudder" control="FLAP0" invert="true" />
		<control-input axis="/controls/flight/rudder-trim" control="FLAP0" invert="true" />
		<control-output control="FLAP0" prop="/surface-positions/rudder-pos-norm" min="1" max="-1" />
	</vstab>

	<!-- ENGINES -->
	<propeller x="2.327" y="3.86" z="-0.61" mass="396.8" moment="27.928" radius="1.965" cruise-power="2100.0" cruise-speed="280" cruise-rpm="1200.0" cruise-alt="20000.0" min-rpm="900.0" max-rpm="1300.0">
		<turbine-engine eng-power="2750.0" eng-rpm="1300.0" alt="15000.0" flat-rating="2475.0" min-n2="70" max-n2="100" bsfc="0.459" />
		<actionpt x="4.827" y="3.86" z="-0.61" />
		<control-input axis="/controls/engines/engine[0]/throttle-lever" control="THROTTLE" />
		<control-input axis="/controls/engines/engine[0]/condition-lever" control="CONDLEVER" />
	</propeller>
	<propeller x="2.327" y="-3.86" z="-0.61" mass="396.8" moment="27.928" radius="1.965" cruise-power="2100.0" cruise-speed="280" cruise-rpm="1200.0" cruise-alt="20000.0" min-rpm="900.0" max-rpm="1300.0">
		<turbine-engine eng-power="2750.0" eng-rpm="1300.0" alt="15000.0" flat-rating="2475.0" min-n2="70" max-n2="100" bsfc="0.459" />
		<actionpt x="4.827" y="-3.86" z="-0.61" />
		<control-input axis="/controls/engines/engine[1]/throttle-lever" control="THROTTLE" />
		<control-input axis="/controls/engines/engine[1]/condition-lever" control="CONDLEVER" />
	</propeller>
	<!-- Reverse thrusters (YASim does not have reverse thrust for turboprops, so thrusters are used instead) -->
	<thruster x="4.827" y="3.86" z="-3.747" vx="-1" vy="0" vz="0" thrust="3000">
		<control-input axis="/controls/engines/engine[0]/reverser-cmd-norm" control="THROTTLE" src0="0" dst0="0" src1="1" dst1="1" />
	</thruster>
	<thruster x="4.827" y="-3.86" z="-3.747" vx="-1" vy="0" vz="0" thrust="3000">
		<control-input axis="/controls/engines/engine[1]/reverser-cmd-norm" control="THROTTLE" src0="0" dst0="0" src1="1" dst1="1" />
	</thruster>

	<!-- LANDING GEARS -->
	<!-- Pushback -->
	<thruster x="11.837" y="0.0" z="-3.747" vx="1" vy="0" vz="0" thrust="9000">
		<control-input axis="/sim/model/pushback/force" control="THROTTLE" src0="-1" dst0="-1" src1="1" dst1="1" />
	</thruster>

	<!-- Nosegear -->
	<gear x="11.837" y="0.0" z="-3.747" compression="0.3">
		<control-input axis="/controls/gear/steering-deg" control="STEER" src0="-60" dst0="-1" src1="60" dst1="1" />
		<control-input axis="/systems/hydraulics/green/gear/gear-down" control="EXTEND" />
		<control-output control="EXTEND" prop="/gear/gear[0]/position-norm" />
		<control-output control="STEER" prop="/gear/gear[0]/steering-norm" />
		<control-speed control="EXTEND" transition-time="10.0" />
	</gear>
	<!-- Left main gear -->
	<gear x="0.88" y="1.922" z="-3.859" compression="0.4" sfric="0.7" dfric="0.5">
		<control-input axis="/systems/hydraulics/green/gear/brake-left" control="BRAKE" />
		<control-input axis="/systems/hydraulics/blue/gear/brake-parking" control="BRAKE" />
		<control-input axis="/systems/hydraulics/green/gear/gear-down" control="EXTEND" />
		<control-output control="EXTEND" prop="/gear/gear[1]/position-norm" />
		<control-speed control="EXTEND" transition-time="10.0" />
	</gear>
	<!-- Right main gear -->
	<gear x="0.88" y="-1.922" z="-3.859" compression="0.4" sfric="0.7" dfric="0.5">
		<control-input axis="/systems/hydraulics/green/gear/brake-right" control="BRAKE" />
		<control-input axis="/systems/hydraulics/blue/gear/brake-parking" control="BRAKE" />
		<control-input axis="/systems/hydraulics/green/gear/gear-down" control="EXTEND" />
		<control-output control="EXTEND" prop="/gear/gear[2]/position-norm" />
		<control-speed control="EXTEND" transition-time="10.0" />
	</gear>

	<!-- FUEL AND PAYLOAD -->
	<!-- Total fuel capacity: 11,025 pounds -->
	<!-- Left wing fuel tank -->
	<tank x="1.1" y="5.0" z="-0.2" jet="true" capacity="5512.0" />
	<!-- Right wing fuel tank -->
	<tank x="1.1" y="-5.0" z="-0.2" jet="true" capacity="5512.0" />

	<!-- Crew -->
	<weight x="11.0" y="0.0" z="-1.5" mass-prop="/sim/weight[0]/weight-lb" idx="0" />
	<!-- PAX/Cargo -->
	<weight x="1.0" y="0.0" z="-1.5" mass-prop="/sim/weight[1]/weight-lb" idx="1" />

	<!-- Ballast to adjust center of gravity -->
	<ballast x="10.0" y="0.0" z="-2.0" mass="10000.0" />

</airplane>
