Automatic Takeoff and Landing
APM can automatically launch and land an aircraft, as part of a mission plan. Here’s how:
Auto takeoff instructions
The basic idea of automatic takeoff is for the APM to set the throttle to maximum and climb until a designated altitude is reached. To cause the plane to execute a takeoff, add a NAV_TAKEOFF command to your mission, probably as the first command. This goal is handled slightly differently depending on what sensors are attached, but the altitude parameter always specifies the altitude that must be attained before the APM will consider its takeoff complete and load the next Must command.
The APM will initially hold the wings level on takeoff, but as soon as a takeoff heading is established, the APM will adjust roll to maintain that heading.
If you do not have a magnetometer:
As soon as the ground speed, as measured by the GPS, exceeds 3 m/s, the takeoff heading will be set to the GPS ground course. This means that, in a crosswind, the APM may turn downwind somewhat during takeoff. Sometimes, the takeoff heading is accidentally set too early and this will cause the APM to turn the plane to an undesired heading during takeoff. To minimize this problem, try not to move the plane after Auto has been engaged except to throw it in the direction of takeoff. Try not to “wind up” by moving the plane backwards before throwing it. As much as possible, try to duplicate the behavior of a catapult launcher.
If you have a magnetometer:
As soon as the ground speed, as measured by the GPS, exceeds 3 m/s, the takeoff heading will be set to the magnetometer’s yaw sensor.
If you do not have an airspeed sensor:
The first parameter of the NAV_TAKEOFF command will specify the maximum pitch the APM will target on takeoff. The minimum pitch is automatically set to 5 degrees positive pitch. As the plane increases in speed (as measured by the GPS), its pitch will increase. The exact formula is:
target pitch = (GPS speed / cruise speed) x maximum pitch / 2
If you have an airspeed sensor:
The first parameter of the NAV_TAKEOFF command will specify the minimum pitch the APM will target on takeoff. The APM will adjust pitch to achieve airspeed_cruise (pitch up if airspeed is above cruise, pitch down if airspeed is below cruise), but it will not pitch below the minimum pitch set by NAV_TAKEOFF.
Auto landing instructions
To land the plane, simply add a NAV_LAND command to the end of your mission indicating the latitude, longitude and altitude of your desired touchdown point. In most cases, the altitude should be set to 0. During landing, the APM will shut down the throttle and hold the current heading as soon as the plane is within 2 seconds of the touchdown point horizontally, or as soon as the plane is lower than 3 meters above the touchdown point, whichever occurs first.
On approach, the APM will fly normally if you have an airspeed sensor. If you do not have an airspeed sensor, the APM will hold 0 pitch.
Here is an example mission around the Sparkfun building that autotakeoffs, goes around the building and then sets up a landing pattern for an autoland. Note that the waypoints kick in once the plane has reached 30m altitude after autotakeff, and that it lands at 0m altitude (altitude is given relative to home/launch altitude)
Note that in reality the above flight plan probably won’t result in a successful landing in the desired area. Waypoint 5 is set with an altitude of 100 meters, and waypoint 6, which is the landing waypoint, is only a short distance away. Unless the particular airplane used has a very fast descent rate when gliding with the motor off, it will not be able to come down from 100 meters in the short distance planned here. It is more appropriate to step the altitude down over a few waypoints and make sure that the distance between the waypoint before the landing point and the landing point is sufficiently large for the altitude which must be lost. Use of automatic flap deployment can be helpful here if your airplane has a relatively flat glide angle – look under “Optional Additions”.
Questions about this page? Comments? Suggestions? Post to APM Forum! Use the platform specific to your query, and make sure to include the name of the page you are referring to.