3/24/2015 common­Loading Firmware onto Pixhawk | ArduPlane

http://plane.ardupilot.com/wiki/common­loading­firmware­onto­pixhawk/ 2/4

Select the COM port

Open the Mission Planner and select the com port drop­down on the upper­right corner of the

screen (near the Connect button). Select AUTO or PX4 FMU. Don’t hit Connect just yet.

Install firmware

On the Mission Planner’s Initial Setup >> Install Firmware screen select the appropriate icon

that matches your frame (i.e. Quad, Hexa). Answer “Yes” when it asks you “Are you sure?”.

After the Mission Planner detects which board you are using (i.e. Pixhawk) it will ask you to

unplug the board, plug it back in and then press OK within a few seconds (during this brief

period the bootloader accepts requests to upload new firmware).

If all goes well you will see some status appear on the bottom right including the words,
3/24/2015 common­Loading Firmware onto Pixhawk | ArduPlane

http://plane.ardupilot.com/wiki/common­loading­firmware­onto­pixhawk/ 3/4

“erase...”, “program...”, “verify..” and “Upload Done”. The firmware has been succesfully

uploaded to the board.

You can teste the firmware is basically working by switching to the Mission Planner’s Flight

Data screen and pressing the “Connect” button. The HUD should update as you tilt the board.

Re­Installing the Mission Planner and Pixhawk Drivers

If the driver failed to install correctly when the Pixhawk was first plugged in or you received the

message “Error: No response from board” when uploading follow these instructions which may

resolve the problem.

1. Backup the Mission Planner’s logs directory if there are dataflash or tlogs from earlier flights

you would like to keep. Normally the logs directory can be found in “C:\Program Files

(x86)\APM Planner\logs” or “C:\Program Files (x86)\Mission Planner\logs”.

2. Uninstall the Mission Planner using the “Uninstall Mission Planner” application which can

normally be found in your Start menu >> All Programs >> Mission Planner (or APM

Planner).

3. Open a file explorer and delete the “C:\Program Files (x86)\Mission Planner” or “C:\Program

Files (x86)\APM Planner” directories if they exist

4. Uninstall the Pixhawk driver:

1. Open the Start >> All Programs >> Accessories >> System Tools >> Control Panel >>

Devices and Printers

2. while the Pixhawk is still plugged in right­mouse­button click on the PX4 FMU device

and select Properties, the select the Hardware tab and select Properties

3. On the General tab select Change Settings, on the Driver tab select Uninstall

4. On the Confirm Device Uinstall window click the “Delete the driver software for this

device” and press “OK”
3/24/2015 common­Loading Firmware onto Pixhawk | ArduPlane

http://plane.ardupilot.com/wiki/common­loading­firmware­onto­pixhawk/ 4/4

5. Re­install the mission planner from the latest MSI. This should install the latest mission

planner and also automatically reinstall the latest Pixhawk drivers onto your computer.

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.
3/24/2015 common­Loading Firmware onto PX4 | ArduPlane

http://plane.ardupilot.com/wiki/common­load­firmware­px4/ 1/9

APM firmware can be used with PX4 FMU and PX4 IO autopilot boards, allowing you to use

the same advanced, community­developed APM firmware with the high performance PX4

processor. This page provides instructions for downloading the latest firmware onto PX4 using

Mission Planner, either as a part of first time setup or whenever you need to update the

firmware.

Contents [hide]

1 Load firmware onto PX4 FMU

2 Load Firmware onto PX4 IO Board

2.1 Load Firmware onto PX4 IO Board (Newer Versions)

2.2 Load Firmware onto PX4 IO Board (Older Versions)

3 Load MavLink Parameters From PX4 to Mission Planner Program

Load firmware onto PX4 FMU

Connect your PX4 FMU board’s micro USB port (shown below) to your computer using the

supplied micro USB cable. Click on images to enlarge.

ArduPilot > ArduPlane > common­Loading Firmware onto PX4

Loading Firmware onto PX4

ArduPlane
3/24/2015 common­Loading Firmware onto PX4 | ArduPlane

http://plane.ardupilot.com/wiki/common­load­firmware­px4/ 2/9

Open Mission Planner, and use the drop­down menus in the upper­right corner of the screen

(near the Connect button) to connect to your PX4. Select the COM port listed as PX4 FMU and

set the Baud rate to 115200 as shown. Don’t hit Connect just yet.

Now we’ll select which firmware to download to the PX4 FMU; this depends on the

configuration of your copter.

Select the Hardware tab. Mission Planner will display the available firmware for copters as

shown below. PX4 is compatible with ArduCopter v3.0.0 and later only.

Choose your copter’s frame by clicking the corresponding icon: Quad, Hexa, Y6, or other.

(We’ll specify + or x configuration later.) Once you select your frame, Mission Planner will

automatically detect the latest firmware version for your copter and prompt you to confirm the

download. After selecting Yes, the progress bar will display the progress of the download,

After downloading the firmware, Mission Planner will detect the PX4 FMU and initiate the

installation process by prompting the following dialog:
3/24/2015 common­Loading Firmware onto PX4 | ArduPlane

http://plane.ardupilot.com/wiki/common­load­firmware­px4/ 3/9

On the PX4 FMU board, press the reset button located to the right of the micro USB port. In

Mission Planner, select OK within five seconds on pressing the reset button. Mission Planner

will erase the contents of the PX4 FMU and program the selected firmware to the board.

To load the firmware, the PX4 is in upload mode, but in order to communicate with Mission

Planner, the PX4 needs to be in USB MavLink mode. To perform this mode change, Mission

Planner will prompt the following dialog:

Unplug the USB cable from your computer’s USB port, and plug it back in. This will switch the

PX4 FMU into USB MavLink mode.

When the download status reads Done, your firmware download is complete.

Load Firmware onto PX4 IO Board

1. The PX4IO board requires its own firmware to be directly loaded onto it separately from the
3/24/2015 common­Loading Firmware onto PX4 | ArduPlane

http://plane.ardupilot.com/wiki/common­load­firmware­px4/ 4/9

PX4 FMU board itself.

2. There are two methods for loading firmware onto the PX4 IO board

3. The old hard method using the SD card as a temporary transfer media.

4. And the new method loading it directly from the firmware stored on the PX4 FMU itself.

Load Firmware onto PX4 IO Board (Newer Versions)

New Method for APM:Copter version 3.1 and later, APM:Plane version 2.75 and later and

APM:Rover version 2.43 and later.

1. After loading your vehicles appropriate firmware onto your PX4FMU using Mission Planner

disconnect the USB cable.

2. While holding down the PX4’s Safety Button Connect the vehicles battery.

3. You will hear several tone sequences followed by two beeps indicating successful loading of

the firmware to the PX4IO board.

1. The tone sequence for a PX4 should sound like this Wav file link: New IO board

firmware loaded successfully

4. Release the Safety Button and disconnect the Battery.

5. For complete information on PX4 Sound sequences go to this Link: PX4_Sound_meaning

Load Firmware onto PX4 IO Board (Older Versions)

Old Method for APM:Copter prior to version 3.1, APM:Plane prior to version 2.75 and

APM:Rover prior to version 2.43.

The PX4 IO module requires separate firmware from the PX4 FMU module. To load the PX4

IO firmware, we will use the micro SD card and USB SD card reader supplied with the PX4 IO

board.
3/24/2015 common­Loading Firmware onto PX4 | ArduPlane

http://plane.ardupilot.com/wiki/common­load­firmware­px4/ 5/9

Insert SD card into USB reader; connect reader to your computer’s USB port. This will load the

SD card as a removable storage device in your computer’s file structure.

In Mission Planner, select the Firmware tab and select the PX4IO Firmware button in the

bottom­right corner of the screen. This will prompt Mission Planner to download the required

file to the micro SD card. From the dialog shown below, select OK.

After selecting OK, Mission Planner will call a Save As window to allow you to save the

firmware file to the SD card.

Select the Removable Disk drive. If there are any files already saved there, select and delete

them. Save the file to the Removable Disk drive as px4io.bin. (Make sure to add the proper
3/24/2015 common­Loading Firmware onto PX4 | ArduPlane

http://plane.ardupilot.com/wiki/common­load­firmware­px4/ 6/9

.bin file extension before saving.)

If you receive an error message, it could be due to a file structure error and can be fixed by

simply retrying to save the file to the Removable Disk drive.

Once the px4io.bin file has been saved to the SD card, Mission Planner will call the following

dialog with further instructions.

As the dialog instructs, right­click on the Removable Disk drive from your computer’s file

structure, select Eject, and remove the USB SD card reader by from the computer. Select OK.

Remove the micro SD card from the USB reader and insert it into the PX4 FMU micro SD card

port. Ensure that your PX4FMU and PX4IO boards are fully connected and the cable from the

safety button to the port on the PX4IO board directly under the battery connector is connected.

Now we’ll install the firmware to the PX4IO board from the SD card while holding down the

safety button by following these steps (read them first before beginning):

1. Hold down safety button on PX4IO board.
3/24/2015 common­Loading Firmware onto PX4 | ArduPlane

http://plane.ardupilot.com/wiki/common­load­firmware­px4/ 7/9

2. Connect the PX4 FMU to your computer using the micro USB cable.

3. Wait for the PX4 to play a sequence of three tones: a double high tone signifies success; a

double low tone signifies a failure.

4. Release safety button after you hear the tones.

5. You can remove the SD card from your PX4 board, place it in your card reader in your

computer.

1. Look at the file to confirm that it was copied to the PX4IO board correctly.

2. The text file will also contain a message of success or failure.

3. When you are done, be sure to put the SD card back in the PX4 it will not work without

the SD card being installed.

6. If your PX4 system is already connected to a receiver and PPM encoder your computer may

not provide sufficient USB power.

7. If this procedure fails, try either the Alternate Instructions using Battery below or the

powered USB hub as follows.

1. A Powered USB hub with a fast charge feature and sufficient current to power the PX4

system, receiver and encoder MAY work.

2. For some PX4 systems a powered USB hub with high current fast charge feature has

been shown to work, but it is not guaranteed.

Alternate Instructions using Battery:

1. Remove your propellers or place a towel over them before following this procedure.

2. Hold down PX4’s safety button.

3. While holding the button down plug in your vehicles battery (requires some dexterity).

4. Wait for the PX4 to play a sequence of three tones: a double high tone signifies

success; a double low tone signifies a failure.

5. Release safety button after you hear the tones and disconnect battery.

6. You can remove the SD card from your PX4 FMU board, place it in your USB SD card

reader in your computer.

1. Explore the contents of the SD card to confirm that it was copied to the PX4 IO board

correctly.

2. You can also open the .txt file with a text editor and it will confirm that the file was

successfully written to the PX4IO board.

3. When you are done, be sure to put the SD card back in the PX4 FMU it will not work

without the SD card being installed.

7. PX4 IO firmware installation is now complete.

8. If you encounter problems when loading MavLink parameters to or from your PX4, it is

possible there was an issue with the firmware installation and you should ensure these
3/24/2015 common­Loading Firmware onto PX4 | ArduPlane

http://plane.ardupilot.com/wiki/common­load­firmware­px4/ 8/9

steps were completed correctly.

Load MavLink Parameters From PX4 to Mission Planner

Program

1. Connect your PX4 to your computer via the USB cable.

2. Ensure that the COM window on the top right is displaying your PX4’s current port.

1. Open the Com port list by selecting the down arrow to the right of the Com window.

2. It should display something like COM 6 PX4 FMU V1.6 (COM6) Ensure that line is

selected.

3. In Mission Planner, select the Connect icon in the upper­right corner of the screen.

4. This will copy the PX4’s current MavLink parameters to the Mission Planner program.

5. Mission Planner will display a window showing the progress of the MavLink download.

When the window displays Done and Mission Planner shows the Disconnect option in place

of Connect, MavLink parameters have been successfully updated. If this process produces an

error or times out, try these troubleshooting steps:

Unplug and replug the PX4 USB, and try connecting again after waiting 10 seconds.

If it fails when you select the Connect icon, check that the “Com” window on the top right is

displaying your PX4’s com port.

Use the Flight Data screen in Mission Planner to see if you can see the HUD on the screen

move when you move the board.

Select the Status tab (within the Flight Data screen) to view inputs from the PX4’s sensors.

This will show you that the PX4 system is working.
3/24/2015 common­Loading Firmware onto PX4 | ArduPlane

http://plane.ardupilot.com/wiki/common­load­firmware­px4/ 9/9

Connect the GPS module by connecting the 5­pin­to­6­pin cable from the GPS module to

the beige GPS connector on the PX4FMU board (next to the 15 pin Multi connector).

Connect the white plug on the GPS adapter cable to the white connector on the GPS

board.

Once connected, the GPS may be able to show your position indoors (and the blinking

blue LED on the GPS will become solid on.).

This will show you that the GPS is working correctly with the PX4.

Additional firmware and alternate methods may be found here: ArduPilot Firmware

Builds Site.

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.
3/24/2015 APM and PX4 Configuration for ArduPlane | ArduPlane

http://plane.ardupilot.com/wiki/arduplane­setup/first­time­apm­setup/ 1/10

Note:

Note:

1. Before proceeding with the “Configuration” process:

2. Firmware for your Vehicle must have already been loaded to your APM or PX4 Flight

Controller system.

3. And you must have a properly set up RC transmitter (Tx) and receiver (Rx) pair.

1. More details are covered in the RC resource page.

Connect your APM (or PX4) to the computer via the micro USB port.

USB hubs may not provide adequate power, connect directly to your computer.

Ensure that the port assigned to your APM is shown as “Arduino Mega 2560′′ or that your

PX4 is shown as “COMx PX4 FMU Vx.x (COM x)” and the Baud rate is set to 115200.

Click on “Connect” button. The Mission Planner will now connect via MAVLink.

If this is the first time the APM is being used, the code will format it’s dataflash memory on

startup. This can interfere with the MAVLink connection and report a failure. If your

connection fails, let everything sit for a minute and try again. Troubleshooting Guide (Here!).

ArduPilot > ArduPlane > APM and PX4 Configuration for ArduPlane

APM and PX4 Configuration for

ArduPlane

ArduPlane
3/24/2015 APM and PX4 Configuration for ArduPlane | ArduPlane

http://plane.ardupilot.com/wiki/arduplane­setup/first­time­apm­setup/ 2/10

Contents [hide]

1 Setup steps

2 Calibrate your RC input

3 Set your flight modes

4 Configure your Hardware

5 Calibrate Your Accelerometers (optional)

6 Check for correct operation

7 (Enable the Accelerometer and Gyro Logs)

Setup steps

If you’re using a standard airframe, load a pre­made configuration file

For common airframes such as the Bixler, Skyfun and Skywalker, we have supplied

configuration files which are tuned for those aircraft. You can download theme (Here!) and use

the Mission Planner to write them to your APM or PX4. You’ll still need to configure them for

your own hardware, however, so continue with the steps below.

Calibrate your RC input
3/24/2015 APM and PX4 Configuration for ArduPlane | ArduPlane

http://plane.ardupilot.com/wiki/arduplane­setup/first­time­apm­setup/ 3/10

Ideally, you have already flown your airplane in manual RC mode and adjusted any trim

values necessary, so the RC outputs reflect these trim settings; if you haven’t already flown

your aircraft in RC mode and trimmed it out, you may need to do the RC calibration again

later, after you have flown the aircraft (this is easy to do at the field).

Turn on transmitter. Verify that the transmitter is in Airplane mode (APM needs airplane

mode regardless of the platform type being piloted).

In Mission Planner, click on the green “Calibrate Radio” button in the lower right of the

window.

Move the control sticks on your transmitter to their limits of travel and observe the results on

the radio calibration bars.

Red lines will appear across the calibration bars to indicate maximum and minimum

values. Move the Ch 5 and 6 toggle switches through their range of positions (Ch 7 and 8

are not used for basic operations).

NOTE: If you do not see results from the bars, try clicking “Calibrate Radio” one more time.

Your results should match with this table:

Ch 1: Roll left=low...Right=high

Ch 2: Pitch forward=low...Pitch back=high

Ch 3: Throttle down(off)=low...Throttle up=high

Ch 4: Yaw left=low...Yaw right=high

On this screen you can also reverse servos if necessary and set up elevon mode if desired.

Instructions on doing that are here.

Click on the green “Click when done” button when you have finished this RC calibration

routine.

Turn off your transmitter and disconnect the battery if it was connected.
3/24/2015 APM and PX4 Configuration for ArduPlane | ArduPlane

http://plane.ardupilot.com/wiki/arduplane­setup/first­time­apm­setup/ 4/10

Set your flight modes

1. One of the most useful features provided by APM is the ability to change Flight Modes onthe­fly. This will greatly assist you in running a variety of missions, and can even save your

craft in some scenarios.

2. This tab allows you to assign flight modes to various switch positions on your Tx.

3. (It’s also possible to switch flight modes from your computer through a data radio link)

4. You will need a switch (or mixed pair) assigned to Ch 5 on your Tx. The goal is to send a

PWM signal — for each desired flight mode — that falls somewhere near the middle of one

of the flight mode ranges, shown on the right.

5. If you have your transmitter turned on when you are setting the flight modes you can see

which switch positions will select the individual modes.

6. Engage each of the desired switch positions while subsequently choosing a mode from the

pull down menu.

1. NOTE: It’s not required to select different modes for all possible mode positions. In fact,

it’s best to start with Manual only; then gradually add more modes as you and your craft

get to know each other better.

2. NOTE: Flight Mode 6 cannot be changed from Manual. It is “hardware manual”, which

means that it’s controlled by the failsafe circuit on the APM or PX4 board to always be

able to return you to RC control as a safety measure.

7. Click the green ‘Save Modes’ button when done.
3/24/2015 APM and PX4 Configuration for ArduPlane | ArduPlane

http://plane.ardupilot.com/wiki/arduplane­setup/first­time­apm­setup/ 5/10

8. Full details on the available modes are (Here!)

9. If you want to get more than three modes from your transmitter, a guide is (Here!)

10. When you move the toggle switch, you will see the green highlight change to a different line.

You can use the drop­down menu on each line to assign that position to a mode.

Configure your Hardware

In this tab, you can tell APM or PX4 what optional sensors you have connected. Just click the

check box for any sensor you’re using. (Sonar is not currently supported with APM / PX4; it’s

primarily used for APM:Copter)
3/24/2015 APM and PX4 Configuration for ArduPlane | ArduPlane

http://plane.ardupilot.com/wiki/arduplane­setup/first­time­apm­setup/ 6/10

For the magnetometer (compass), you have a choice of calibration options once you enable

the sensor:

1. You can do nothing, and the code will try to figure out all the offsets and declination by

comparing the compass readings with the GPS and IMU readings over time in flight. Pro: No

user effort. Con: It takes a few minutes of flying to get right, so the compass is inaccurate at

first launch.

2. Manual calibration in the Mission Planner (above). You can enter your Declination as

instructed below and then press the “Live Calibration” button and move and rotate your

aircraft around for 30 seconds while it records the data and does some math to calibrate the

sensor. Pro: It works. Con: it’s a little awkward, especially for big aircraft. Also it doesn’t

reflect the magnetic interference that can occur when the motors are going in flight.

3. Replay a flight log. This is a very cool option, shown above as Log Calibration, where you

can just replay a previously recorded flight log (.tlog) and the code will compare the GPS

and IMU readings with the compass reading and make the necessary corrections. Pro:

Works great. Con: You must have already flown, if you load a .tlog file where you didn’t

actually fly you’ll mess up your calibration and will have to do it again or risk poor flight

performance.

To manually enter a declination for your geographic location, you can find the correct value by

clicking on the link to open a web browser. Enter your location and it will give you a declination,

as circled below:
3/24/2015 APM and PX4 Configuration for ArduPlane | ArduPlane

http://plane.ardupilot.com/wiki/arduplane­setup/first­time­apm­setup/ 7/10

In this case, I would enter “14.13” into the magnetometer line (the software converts from

decimal to degrees/minutes).

Calibrate Your Accelerometers (optional)

If you have a board that supports the EKF Inertial Navigation option and intend to use it by

setting AHRS_EKF_USE = 1, then you will need to calibrate your accelerometers. To do this,

select the INITIAL SETUP>>Mandatory Hardware>>Accel Calibration page in Mission Planner

. You will be asked to place the plane so that the autopilot board is level, on its right side, left

side, nose down, nose up and on its back, hitting any key when it has been repositioned each

time. It is important that you hold the plane still when you hit the key each time. This can be

hard to do with the size and shape of many planes, so is best done with the board before you

mount it in the plane. Once you have done this, do not perform the simpler Calibrate Level

function as this will overwrite your calibration values.
3/24/2015 APM and PX4 Configuration for ArduPlane | ArduPlane

http://plane.ardupilot.com/wiki/arduplane­setup/first­time­apm­setup/ 8/10

Check for correct operation

Switch to the Flight Data tab with MAVLink connected.

You will see the artificial horizon moving with the board. Remember to leave the board

stationary for 15­20 seconds when you switch into this tab, since the IMU must calibrate first.

Once it’s done, the HUD will start moving.
3/24/2015 APM and PX4 Configuration for ArduPlane | ArduPlane

http://plane.ardupilot.com/wiki/arduplane­setup/first­time­apm­setup/ 9/10

Mission Planner

(Enable the Accelerometer and Gyro Logs)

One of the Log types you will most want is the Accelerometer and Gyro log files which are

disabled by default.

To enable Accel and Gyro logs:

Unplug your APM or PX4 from the USB cable and plug it back in to reset it.

In Mission Planner click on the “Terminal” tab.

Hit the return key 3 times: you are now in CLI mode.

Type “logs” and the enter key

Type: “enable imu” and the enter key.

Accelerometer and Gyro logging are now enabled.

Disconnect and reconnect your USB cable and select the “Flight Data” tab in Mission

Planner.

Note: Although this type of log is very useful, it does steal significant CPU cycles, so for

maximum performance you may want to “disable” or “enable” it selectively..

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.
3/24/2015 APM and PX4 Configuration for ArduPlane | ArduPlane

http://plane.ardupilot.com/wiki/arduplane­setup/first­time­apm­setup/ 10/10
3/24/2015 Checking the Sensors | ArduPlane

http://plane.ardupilot.com/wiki/arduplane­setup/first­time­apm­setup/checking­the­sensors/ 1/2

With MAVlink connected, move the APM board and you should see the artificial horizon move

accordingly.

Remember how artificial horizons work: when the aircraft tilts to the right, the horizon tilts to the

left. (Just tilt your head and you’ll see what I mean). This is normal! Please don’t tell us it’s

reversed ;­)

In the below example, the quad is tilted a bit to the right.

Unless you have the GPS module connected, are outside and have GPS lock, the map will not

show your current position.

Raw sensor display

You can see the output from all the various sensors by clicking on the “Tuning” checkbox on

the bottom right of the display 1 This will bring up the graphical sensor display. If you click

on the legend at the top of it 2 , it will bring up a window “Graph This” that allows you to

choose which sensors and data outputs to display.

ArduPilot > ArduPlane > Checking the Sensors

Checking the Sensors

ArduPlane
3/24/2015 Checking the Sensors | ArduPlane

http://plane.ardupilot.com/wiki/arduplane­setup/first­time­apm­setup/checking­the­sensors/ 2/2

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.
3/24/2015 Reversing Servos and Setting Normal/Elevon Mode | ArduPlane

http://plane.ardupilot.com/wiki/arduplane­setup/first­time­apm­setup/reversing­servos­and­setting­normalelevon­mode/ 1/9

Every aircraft is different, and as people familiar with RC know, you’ve got to tell your RC

equipment which way the servos go and how that moves the control surfaces, a process that

involves “reversing” channels if needed. The same goes for an autopilot. This section will walk

you through this process.

Contents [hide]

1 Overview

2 Details of how this works behind the scenes in MAVLink

3 Getting the rudder direction right

4 Non­elevon EEPROM setup

5 Old style elevon mixing EEPROM setup (ELEVON_MIXING option)

6 New style elevon mixing EEPROM setup (ELEVON_OUTPUT option)

7 Setting up a VTAIL plane

8 Using MIXING_GAIN to control mixing throws

9 Important notes

Overview

First, make sure your control surfaces are going the right way in Manual Mode. In this mode,

the RC controls are sent straight through to the servos, without going through the autopilot (this

is the safety/failsafe mode that allows you to regain control even in the case of autopilot

failure). If any control surface is going in the wrong direction when you move your RC sticks,

use your transmitter’s channel reverse function to reverse it.

ArduPilot > ArduPlane > Reversing Servos and Setting Normal/Elevon Mode

Reversing Servos and Setting

Normal/Elevon Mode

ArduPlane
3/24/2015 Reversing Servos and Setting Normal/Elevon Mode | ArduPlane

http://plane.ardupilot.com/wiki/arduplane­setup/first­time­apm­setup/reversing­servos­and­setting­normalelevon­mode/ 2/9

Second, switch into FBWA mode and do the same thing, while connected to the Mission

Planner. You’re under autopilot control now, and you need to configure it for your particular

setup. As you move the RC sticks again, watch the control surfaces. If any is going in the

wrong direction, click the Reverse checkbox in the RC setup screen shown below.

Do this for all four channels shown. Just because it’s right in RC/Manual doesn’t mean it

will be right under Autopilot control. Check it in both modes!

To select elevon mode or reverse elevon channels, use the elevon checkboxes at the bottom:

Roll to the right illustrated below.
3/24/2015 Reversing Servos and Setting Normal/Elevon Mode | ArduPlane

http://plane.ardupilot.com/wiki/arduplane­setup/first­time­apm­setup/reversing­servos­and­setting­normalelevon­mode/ 3/9

It takes a little trial­and­error to set up elevons on any particular aircraft, but here are the basic

steps:

1. First, set it up in manual mode by setting up elevon mixing on your RC transmitter. It matters

which elevon is plugged into which channel! Typically, the left wing ailerons should be

plugged into Ch1 and the right wing into Ch2, as shown above.

2. Still in manual mode, check to see if you have to reverse any channels on your RC

transmitter to ensure the control surfaces move the way they should in both pitch and roll.

3. Now that it’s working in manual, connect to your APM board with the Mission Planner. Go

through the regular setup process. When calibrating your RC input, don’t just move the

elevator and aileron sticks to the normal up down, left right positions. Instead, you

must move the stick to the CORNERS or the calibration will be wrong and the servos will

try to move too far. This is because now that you’ve switched your RC transmitter into

elevon mode, the elevator and airelon inputs are added when the stick is in the corner (full

left and full up as an example).

4. While still in the MP RC setup screen, switch into FBWA Mode. Move move the plane

around to test and watch the control surfaces. When you tip the nose of the plane down, the

two elevons should go up and vice versa. Likewise with roll; when you roll the plane, the
3/24/2015 Reversing Servos and Setting Normal/Elevon Mode | ArduPlane

http://plane.ardupilot.com/wiki/arduplane­setup/first­time­apm­setup/reversing­servos­and­setting­normalelevon­mode/ 4/9

elevons should move to counteract that and return the plane to level. You’ll probably have to

reverse something with the check boxes on that screen for correct motion. Just change one

thing at a time!

5. If you just can’t seem to find the right combination that works, try swapping your servo

cables, so that Right is in Output 1 and Left is Output 2. This is something of a last resort,

because you’ll have to start the setup from the top of this list again.

Details of how this works behind the scenes in

MAVLink

You need to choose if you want to use elevon mixing or not. If you have a ‘normal’ plane with

separate ailerons and elevator then you should set ELEVON_MIXING to 0 (the default). If you

have elevons you should set it to 1, or setup the new ELEVON_OUTPUT option (see below).

Getting the rudder direction right

A very common mistake is to have the rudder reversal set incorrectly. If you have it set

incorrectly then your plane can fly very badly, and may not be able to navigate at all.

To check your rudder reversal you need to do the following:

ensure the KFF_RDDRMIX parameter is set to a non­zero value. For this test you should set it

to a high value (such as 0.8) to ensure the rudder movement is large. Remember to reset it

back to a lower value afterwards.

put the plane into FBWA mode

with no stick input (hands off the transmitter) roll the aircraft to the right. The rudder should

turn towards the left as it tries to correct the roll.

Now roll the aircraft to the left. The rudder should turn to the right as it tries to correct the

roll.

If the rudder moves in the wrong direction you should change the RC4_REV parameter. A

value of 1 means no reversal. A value of ­1 means to reverse the rudder.

Non­elevon EEPROM setup
3/24/2015 Reversing Servos and Setting Normal/Elevon Mode | ArduPlane

http://plane.ardupilot.com/wiki/arduplane­setup/first­time­apm­setup/reversing­servos­and­setting­normalelevon­mode/ 5/9

For non­elevon setups (ie. setups with ELEVON_MIXING set to 0 and ELEVON_OUTPUT set

to 0), you have 4 parameters that control the servo reversals, one for each channel you can

reverse.

The 4 parameters are:

RC1_REV aileron reversal set to ­1 for reversal defaults to 1 (meaning no reversal)

RC2_REV elevator reversal set to ­1 for reversal defaults to 1 (meaning no reversal)

RC3_REV throttle reversal set to ­1 for reversal (for some gas planes)

RC4_REV rudder reversal set to ­1 for reversal defaults to 1 (meaning no reversal)

Old style elevon mixing EEPROM setup

(ELEVON_MIXING option)

For elevon based setups (where you have set ELEVON_MIXING to 1), you have 3 different

EEPROM parameters to setup. They are:

ELEVON_REVERSE reverse the sense of the elevon mixing set to 1 to reverse, defaults to 0

ELEVON_CH1_REVERSE reverse channel 1 elevon set to 1 to reverse, defaults to 0

ELEVON_CH2_REVERSE reverse channel 2 elevon set to 1 to reverse, defaults to 0

Please make sure that you do careful ground testing after setting these parameters. Also

remember that your RC transmitter must be set up to do elevon mixing, too!

Note: It is possible to configure differential spoilers with old style elevon mixing, although the

feature is not widely used and not well tested. Differential spoilers cannot currently be

configured with the new type elevon mixing.

New style elevon mixing EEPROM setup

(ELEVON_OUTPUT option)

As of ArduPlane 2.73 there is a new ELEVON_OUTPUT option. This option allows you to

setup your transmitter for normal aileron/elevator control and for ArduPlane to add elevon
3/24/2015 Reversing Servos and Setting Normal/Elevon Mode | ArduPlane

http://plane.ardupilot.com/wiki/arduplane­setup/first­time­apm­setup/reversing­servos­and­setting­normalelevon­mode/ 6/9

mixing on the output of channels 1 and 2. Using ELEVON_OUTPUT has a big advantage over

ELEVON_MIXING that your inputs won’t saturate the roll/pitch control in FBWA mode, which

means you can get better control of your plane.

Note that you cannot use the ELEVON_OUTPUT option on an APM1 board if you have the

flight mode channel (FLTMODE_CH) set to 8, as on the APM1 this will lead to hardware pass

through of controls when in manual, which means your transmitter must be setup for elevon

mixing. If using an APM2 or PX4 this is not a problem, and the ELEVON_OUTPUT option is

recommended.

The ELEVON_OUTPUT option is designed to operate exactly as a hardware elevon mixer

would operate. To set it up follow these steps:

Setup your transmitter with no elevon mixing

Set both RC1_REV and RC2_REV to 1 and ELEVON_MIXING to 0

Start by setting ELEVON_OUTPUT to 1. In later steps you may adjust this to 2, 3 or 4.

Put your APM into FBWA mode

Roll the plane to the right and observe what happens to the elevons

If the two elevons move in the same direction, then change ELEVON_OUTPUT to 2, and try

again.

If the elevons move in opposite directions, but the APM is correcting the roll in the wrong

direction (the left elevon is going down and the right one is going up) then change

RC1_REV to ­1

Next try pitching your plane up. If the elevons move in the wrong direction then change

RC2_REV to ­1

Now change to MANUAL mode and adjust your transmitter reversals for channels 1 and 2 to

produce the right movement in MANUAL mode.

Please make sure that you do careful ground testing after setting these parameters!

Please also see the note about the MIXING_GAIN parameter below.

Setting up a VTAIL plane

To setup a VTAIL plane, you can enable a software VTAIL mixer using the VTAIL_OUTPUT

option. The VTAIL_OUTPUT option works the same way as the ELEVON_OUTPUT option,

except that it operates on the elevator and rudder output channels (channels 2 and 4).
3/24/2015 Reversing Servos and Setting Normal/Elevon Mode | ArduPlane

http://plane.ardupilot.com/wiki/arduplane­setup/first­time­apm­setup/reversing­servos­and­setting­normalelevon­mode/ 7/9

Note that you cannot use the VTAIL_OUTPUT option on an APM1 board if you have the flight

mode channel (FLTMODE_CH) set to 8, as on the APM1 this will lead to hardware pass

through of controls when in manual, which means your transmitter must be setup for vtail

mixing. If using an APM2 or PX4 this is not a problem, and the VTAIL_OUTPUT option is

recommended for vtail planes. On an APM1 use a hardware vtail mixer instead.

The VTAIL_OUTPUT option is designed to operate exactly as a hardware vtail mixer would

operate. To set it up follow these steps:

Setup your transmitter with no vtail mixing

Set both RC2_REV and RC4_REV to 1 and KFF_RDDRMIX to 0.5

Start by setting VTAIL_OUTPUT to 1. In later steps you may adjust this to 2, 3 or 4.

Put your APM into FBWA mode

Pitch up the nose of the plane observe what happens to the vtail

If the two vtail segments move in opposite directions, then change VTAIL_OUTPUT to 2,

and try again.

If the two vtail segments move in the same direction, but the APM is correcting the pitch in

the wrong direction (both segments are moving up) then change RC2_REV to ­1

Next try rolling your plane to the right. The two vtail segments should move to try to turn the

plane left (to correct for the right roll). If they move in the wrong direction then set RC4_REV

to ­1

Now change to MANUAL mode and adjust your transmitter reversals for channels 2 and 4 to

produce the right movement in MANUAL mode.

Finally adjust the KFF_RDDRMIX to a value that gives the right amount of rudder movement

for coordinated turns on your plane. This may require some inflight tuning. A initial guess of

around 0.5 is likely to work for most planes.

Here’s a V­Tail movement diagram courtesy of Miami Mike:
3/24/2015 Reversing Servos and Setting Normal/Elevon Mode | ArduPlane

http://plane.ardupilot.com/wiki/arduplane­setup/first­time­apm­setup/reversing­servos­and­setting­normalelevon­mode/ 8/9

Please make sure that you do careful ground testing after setting these parameters!

Please also see the note about the MIXING_GAIN parameter below.

Using MIXING_GAIN to control mixing throws

If you use the ELEVON_OUTPUT or VTAIL_OUTPUT options, you may find the

MIXING_GAIN parameter useful to control the gain of the mixer.

The default is a gain of 0.5, which ensures that over the full range of the mixer both inputs

have authority (it can’t saturate). That also means that if you have one input of the mixer (eg.

aileron on an elevon plane) at full range, and the other input neutral, then the output is only

1750. That may not be enough roll authority for some planes.

If you change the MIXING_GAIN to 1.0 then you will get the full range of output from a single

channel, although if you have full aileron deflection and full elevator at the same time you will

saturate the mixer. It will clip output outside of the valid range of 900 to 2100 microseconds.

So if you have found ELEVON_OUTPUT doesn’t have enough authority then try raising the

MIXING_GAIN.

Important notes

Whenever you change your firmware your EEPROM settings will revert to the defaults if the

new firmware has an incompatible EEPROM format. The release notes for a release will

contain a note if this happens. The developers are careful to try to minimise the number of

times this is needed. Please use the APM mission planner or your ground control station to

save your settings, and carefully check them after any firmware change.

make sure you always do ground tests before every flight to ensure your channel mixing

and reversals are all correct. Be careful to check that not only are your transmitter controls

correct, but that the APM responds correctly to attitude changes in the plane when in FBWA

mode.

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.
3/24/2015 Reversing Servos and Setting Normal/Elevon Mode | ArduPlane

http://plane.ardupilot.com/wiki/arduplane­setup/first­time­apm­setup/reversing­servos­and­setting­normalelevon­mode/ 9/9
3/24/2015 Throttle Arming in ArduPlane | ArduPlane

http://plane.ardupilot.com/wiki/arduplane­setup/first­time­apm­setup/arming­throttle/ 1/6

Warning:

A software safety feature that requires the throttle to be explicitly armed by a pilot is available

for APM:Plane (first introduced in version 2.77). This is especially applicable to electric planes.

The idea is to prevent an unexpected throttle up when someone’s hand is near a propeller.

This feature in no way removes the need to respect the prop! When the plane is powered,

ALWAYS avoid placing hands into the same plane that the propeller spins, even when the

throttle is disarmed. If all is not well with the autopilot electronics or software there is

always a slight possibility that signal could unintentionally reach the motor. Even though

this is unlikely (and made even less likely by safety features such as this) it only takes one

time to chew up a finger or hand!

Parameters governing throttle arming are introduced in the ARMING section of the parameters

wiki page. This page discusses throttle arming in greater detail and walks through the typical

procedures for using this safety feature. This page makes the assumption that you begin will

all the ARMING_ parameters set to 0. Modifying parameters is outside the scope of this page

and varies depending which ground control software you are using. In Mission Planner, it is

easiest to find the ARMING_ parameters by using the Config/Tuning screen and selecting the

“Full Parameter List” menu item.

Contents [hide]

1 A Note About PX4 Arming

2 A note about APM1 and channel 8

3 IMPORTANT: RC Transmitter Calibration

4 Simplest Solution: Use Only ARMING_REQUIRE

5 Increased Safety: Perform System Checks Before Arming Throttle

ArduPilot > ArduPlane > Throttle Arming in ArduPlane

Throttle Arming in ArduPlane

ArduPlane
3/24/2015 Throttle Arming in ArduPlane | ArduPlane

http://plane.ardupilot.com/wiki/arduplane­setup/first­time­apm­setup/arming­throttle/ 2/6

6 Disabling Rudder Arming

A Note About PX4 Arming

A safety feature of PX4 / Pixhawk is that all servo output is kept at at minimum values until the

safety button is pushed. This has the nice effect of (usually) disabling electric motors and it is

quite possible to use only this safety feature for propeller safety. However:

1. This feature is not available for the APM.

2. Generally during pre­flight checks it is desirable to verify servo operation (e.g., to check

ailerons are deflecting in the expected direction). This can more safely be done with the

throttle disabled. When the button is pushed all servos are enabled, including the motor —

unless this additional software throttle safety is used.

A note about APM1 and channel 8

The APM1 has a hardware multiplexor on channel 8 which forces pass­thru of the first 4

channels if channel 8 is above 1750. This means the arming code is bypassed if you use

channel 8 for your flight mode switch. So if you want to use arming on an APM1 then you

should change FLTMODE_CH to another channel (say channel 5) and setup your

transmitter/receiver to put the mode switch on that other channel.

IMPORTANT: RC Transmitter Calibration

It is essential that your RC radio transmitter be calibrated correctly before continuing. Please

see the Calibrate your RC input section of the first time setup wiki page if you don’t know how

to calibrate your radio.

During RC calibration throttle ups are possible, even with safeties enabled and you

should therefore remove the propeller or move the plane to a safe area and secure it..

Depending on the ground control software you use, the RC3_MIN value may be continuously

changing during calibration. Also, if the RC3_MIN value is inadvertently set incorrectly the

plane may throttle up after a bad calibration (e.g., if the low stick setting was not captured).

Note that if you have RCMAP_THROTTLE set to something other than 3, then the RCn_MIN

value used will be the one for the channel you have selected as the throttle channel.
3/24/2015 Throttle Arming in ArduPlane | ArduPlane

http://plane.ardupilot.com/wiki/arduplane­setup/first­time­apm­setup/arming­throttle/ 3/6

When calibrating your RC input you should also be careful to set the minimum value of the

throttle (usually RC3_MIN) to the minimum value when in normal flight control. Don’t set it to

the value used by your transmitter when in throttle failsafe or you won’t be able to arm using

the rudder as the APM will think you are at a non­zero throttle level.

Simplest Solution: Use Only ARMING_REQUIRE

The simplest way to use the throttle arming feature is to require the user to request the throttle

to arm. ARMING_REQUIRE has three possible values, 0, 1 and 2. They have the following

effect:

ARMING_REQUIRE=0: No effect. Throttle arming safety is not employed.

ARMING_REQUIRE=1: Before the user arms throttle, send minimum PWM to the throttle

channel (which is usually channel 3). Therefore the RC3_MIN PWM value is sent on the

servo output rail.

ARMING_REQUIRE=2: Before the user arms throttle, send no PWM signal to the throttle

channel (usually channel 3). Some ESCs are not happy with this and will continuously beep,

some will not. Some users may prefer this setting as it ensures no signal is sent to the ESC

when disarmed.

When the ARMING_REQUIRE parameter is set to 1 or 2 (and ARMING_CHECK and

ARMING_DIS_RUD are set to 0), all that is required to arm the throttle is to either:

1. Arm the throttle via the ground control software.

OR

2. Arm the throttle by applying full right rudder input for several seconds.

To arm throttle in Mission Planner, use the Flight Data screen, then select the Actions tab.

This provides an “Arm/Disarm” button that can be used to arm and disarm the throttle.
3/24/2015 Throttle Arming in ArduPlane | ArduPlane

http://plane.ardupilot.com/wiki/arduplane­setup/first­time­apm­setup/arming­throttle/ 4/6

Location of the Arm/Disarm button in Mission Planner (button circled in red

near the bottom of the image).

Alternatively, apply full right rudder to your RC transmitter for several seconds to arm the

throttle. Whichever method you choose should result in a message from your ground control

software stating that throttle arming was successful. Mission planner displays a message in

the artificial horizon on the Flight Data screen:
3/24/2015 Throttle Arming in ArduPlane | ArduPlane

http://plane.ardupilot.com/wiki/arduplane­setup/first­time­apm­setup/arming­throttle/ 5/6

Message on the artificial horizon in Mission Planner stating that arming was

successful.

Increased Safety: Perform System Checks Before Arming

Throttle

If desired, the ARMING_CHECK parameter can also be set to 1 in order to perform system

health checks before arming throttle when a user attempts to arm. See wiki documentation on

the ARMING_CHECK parameter to see what is checked.

One thing to be aware of if you typically do not fly with a ground control station: it will be

difficult to determine why your autopilot is not arming if you are not connected to a

ground control station when arming. The ARMING_CHECK parameter should probably be

left at 0 when at the an airfield without a ground control station.
3/24/2015 Throttle Arming in ArduPlane | ArduPlane

http://plane.ardupilot.com/wiki/arduplane­setup/first­time­apm­setup/arming­throttle/ 6/6

The following are possible system health messages that may return if ARMING_CHECK is

enabled and the autopilot rejects a request to arm the throttle:

Message: “Hardware Safety Switch.” Solution: push the hardware safety switch on the PX4

or Pixhawk (does not apply to APM).

Message: “Battery failsafe on.” Solution: Ensure your battery is charged. If it is, ensure your

battery failsafe values are set correctly. For more information on failsafes, see the Failsafe

Functions wiki page.

Message: “Radio failsafe on.” Solution: Ensure that the RC transmitter is able to

communicate with the RC receiver. For more information on this failsafe, see the

documentation on the Throttle Failsafe.

Message: “Bad GPS Pos.” Solution: Need to get a 3D fix with the GPS receiver. After

ensuring your GPS receiver is functioning properly, ensure nothing aboard the plane or in

the immediate environment is interfering with GPS satellite signals.

Message: “No GPS detected. Solution: ensure your GPS receiver is functioning.

Message: “No compass detected.” Solution: If you do not intend to use a compass, then

change the COMPASS_USE parameter to 0. If you do, then you’ll need to ensure your

compass is installed and healthy.

Message: “Compass not calibrated.” Solution: Calibrate compass. In Mission Planner this is

accomplished in the Initial Setup screen, menu item Manadtory Hardware > Compass.

Message: “Compass not healthy.” Solution: Ensure you do not have the compass installed

near something that can induce a magnetic field, such as the motor. You also may try

recalibrating the compass.

Message: “Baro not healthy.” Solution: Try rebooting the autopilot. If this fails you will have

to diagnose what the problem is with the barometer.

Disabling Rudder Arming

Some pilots will not want to use the rudder arming capability. To only allow throttle arming via

the ground control software set the ARMING_DIS_RUD parameter to 1. The autopilot will no

longer arm throttle when full right rudder is applied on the RC transmitter.

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.
3/24/2015 ArduPlane’s Failsafe Function | ArduPlane

http://plane.ardupilot.com/wiki/arduplane­setup/apms­failsafe­function/ 1/8

ArduPlane has a limited failsafe function which is designed to do three things:

1. Detect complete loss of RC signal (if the RC receiver is able to generate a predictable

signal­loss behavior) and initiate a defined auto­mode response, such as returning to home.

Some RC equipment can do this, and some can’t (see below for details on how to use it if

yours supports this function).

2. Detect loss of telemetry for more than 20 sec and switch to return to launch (RTL) mode

(GCS Failsafe).

3. Detect loss of GPS for more than 20 seconds and switch into Dead Reckoning mode until

GPS signal is regained.

Here’s what the failsafe will not do:

1. Detect if one more more individual RC channel has failed or become disconnected

2. Detect if you’re flying too far away or are about to hit the ground

3. Detect autopilot hardware failures, such as low­power brownouts or in­air reboots

4. Detect if the ArduPlane software is not operating correctly

5. Detect other problems with the aircraft, such as motor failures or low battery situations

(although the latter can be set up through the main code if you have the right voltage/current

sensor)

6. Otherwise stop you from making setup or flight mistakes

Contents [hide]

1 ArduPlane Failsafe Documentation

2 Throttle Failsafe

3 GCS Failsafe

ArduPilot > ArduPlane > ArduPlane’s Failsafe Function

ArduPlane’s Failsafe Function

ArduPlane
3/24/2015 ArduPlane’s Failsafe Function | ArduPlane

http://plane.ardupilot.com/wiki/arduplane­setup/apms­failsafe­function/ 2/8

4 Failsafe Parameters and their meanings

5 Short failsafe action (ArduPlane:FS_SHORT_ACTN)

6 Long failsafe action (ArduPlane:FS_LONG_ACTN)

7 Failsafe battery voltage (ArduPlane:FS_BATT_VOLTAGE)

8 Failsafe battery milliAmpHours (ArduPlane:FS_BATT_MAH)

9 GCS failsafe enable (ArduPlane:FS_GCS_ENABL)

10 Code

ArduPlane Failsafe Documentation

Throttle Failsafe

How it works. Your RC transmitter outputs a PWM signal that is captured by your receiver and

relayed to the autopilot. Each channel on your transmitter has a PWM range usually between

1100 – 1900 with 1500 being its neutral position. When you start your radio calibration on the

mission planner, all your values will be at 1500. By moving your sticks, knobs and switches you

will set your PWM range for each channel. The autopilot monitors your throttle channel and if it

notices a drop lower than THR_FS_VALUE (Default is 950) it will go into failsafe mode.

RC transmitters usually have a default range for each channel that goes from ­100% to 100%,

however most transmitters will allow you to extend this to ­150% and 150% respectively. In the

default setup, bringing your throttle to ­100% will translate to a value close to 1100 and

bringing it to ­150% will translate to a value closer to 900. What we want to achieve is to let

your receiver know that the throttle can go as low as ­150% but keep the autopilot control

range between ­100% and 100%. Meaning that when flying, our throttle values will range

between 1100 – 1900.

If we lose RC communication, the receiver if set up properly, will drop to the lowest known

throttle value of ~900. This value falls bellow the THR_FS_VALUE and will trigger the

autopilot to go into failsafe mode.

First the autopilot will go into short failsafe (FS_SHORT_ACTN, 0=Disabled, 1=Enabled)

when it detects loss of signal for more than 1.5 sec. The default setting for short failsafe is

Circle mode.

If the RC signal is regained during the short failsafe, the flight will return to auto mode.

If the loss of signal is longer than 20 sec the autopilot will go into long failsafe

(FS_LONG_ACTN, 0=Disabled, 1=Enabled).

The default setting for long failsafe is RTL (Return to Launch).
3/24/2015 ArduPlane’s Failsafe Function | ArduPlane

http://plane.ardupilot.com/wiki/arduplane­setup/apms­failsafe­function/ 3/8

Once the long failsafe (RTL mode) has been entered at the conclusion of the short failsafe

the RTL mode will continue even if your RC signal is reacquired.

Warning: In firmware releases prior to 2.75 there is a bug where the short failsafe

goes to RTL mode instead of circle mode potentially resulting in a repeating loop

mode failure.

This will be fixed and short failsafe will correctly go to circle mode as of version 2.75

of ArduPlane firmware.

Ext. Range Normal Range Ext. Range

|‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐|‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐|‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐|

‐150% ‐100% 100% 150%

|_________________|

|

Failsafe

Setup.

1. Enable throttle failsafe by setting THR_FS_Value to 1 (0=Disabled, 1=Enabled).

2. First turn on your transmitter and enable the throttle range to extend past ­100%, we want to

extend the throttle range past its low threshold.

3. Once this is done, bind with your receiver. This will let your receiver know the lowest

possible value for your throttle channel.

4. Next revert the first change you made to the transmitter to limit the throttle to the original

range.

5. Do the radio calibration using the Mission Planner.

6. Once the radio calibration is completed, drop the throttle on your transmitter and read what

PWM value is being outputted to the mission planner on that channel.

7. Turn off the transmitter. You should see the value drop significantly. This will be the PWM

value relayed to the autopilot in the event RC link was lost during flight.

8. Make sure THR_FS_VALUE is an adequate number to trigger the failsafe function on the

autopilot.

9. Make sure FS_SHORT_ACTN and FS_LONG_ACTN are both enabled (set to 1).

10. Connect on the mission planner with your RC transmitter on. Verify on the bottom right

corner of the HUD that you are “flying” in a non auto mode (Manual, Stabilize, FBW are ok).

11. Turn off your transmitter. After 1.5 sec the flight mode should switch to Circle. After 20 sec

the flight mode should switch to RTL. If you observe this behavior, your failsafe function has
3/24/2015 ArduPlane’s Failsafe Function | ArduPlane

http://plane.ardupilot.com/wiki/arduplane­setup/apms­failsafe­function/ 4/8

been set up correctly.

Transmitter Tutorials:

Spektrum Setup

GCS Failsafe

How it works. When flying while using telemetry on the GCS, the autopilot can be

programmed to trigger into failsafe mode if it loses telemetry. In the event that the autopilot

stops receiving MAVlink (telemetry protocol) heartbeat messages for more than 20 sec, the

GCS failsafe (FS_GCS_ENABL, 0=Disabled, 1=Enabled) will trigger the autopilot to go into

long failsafe and change the flight mode to RTL.

Setup.

1. Set FS_GCS_ENABL to 1 to enable it.

2. Connect to the Mission Planner via telemetry. Verify on the bottom right corner of the HUD

that you are “flying” in a non auto mode (Manual, Stabilize, FBW are ok).

3. Unplug one of the telemetry radios. After a few minutes power off your autopilot.

(Remember the autopilot will not go into failsafe until 20 seconds of MAVlink inactivity have

passed).

4. Connect your autopilot to the mission planner and pull the logs. Verify on the log that the

autopilot went into RTL after 20 sec of MAVlink inactivity.

Failsafe Parameters and their meanings

Short failsafe action (ArduPlane:FS_SHORT_ACTN)

The action to take on a short (1.5 seconds) failsafe event in AUTO, GUIDED or LOITER

modes. A short failsafe event in stabilization modes will always cause a change to CIRCLE

mode. In AUTO mode you can choose whether it will RTL (ReturnToLaunch) or continue with

the mission. If FS_SHORT_ACTN is 0 then it will continue with the mission, if it is 1 then it will

enter CIRCLE mode, and then enter RTL if the failsafe condition persists for 20 seconds.

VALUE MEANING

0 Continue
3/24/2015 ArduPlane’s Failsafe Function | ArduPlane

http://plane.ardupilot.com/wiki/arduplane­setup/apms­failsafe­function/ 5/8

1 Circle/ReturnToLaunch

Long failsafe action (ArduPlane:FS_LONG_ACTN)

The action to take on a long (20 second) failsafe event in AUTO, GUIDED or LOITER modes.

A long failsafe event in stabilization modes will always cause an RTL (ReturnToLaunch). In

AUTO modes you can choose whether it will RTL or continue with the mission. If

FS_LONG_ACTN is 0 then it will continue with the mission, if it is 1 then it will enter RTL mode.

Note that if FS_SHORT_ACTN is 1, then the aircraft will enter CIRCLE mode after 1.5 seconds

of failsafe, and will always enter RTL after 20 seconds of failsafe, regardless of the

FS_LONG_ACTN setting.

VALUE MEANING

0 Continue

1 ReturnToLaunch

Failsafe battery voltage (ArduPlane:FS_BATT_VOLTAGE)

Battery voltage to trigger failsafe. Set to 0 to disable battery voltage failsafe. If the battery

voltage drops below this voltage then the plane will RTL

Units: Volts

Failsafe battery milliAmpHours (ArduPlane:FS_BATT_MAH)

Battery capacity remaining to trigger failsafe. Set to 0 to disable battery remaining failsafe. If

the battery remaining drops below this level then the plane will RTL

Units: mAh

GCS failsafe enable (ArduPlane:FS_GCS_ENABL)

Enable ground control station telemetry failsafe. Failsafe will trigger after 20 seconds of no

MAVLink heartbeat messages. WARNING: Enabling this option opens up the possibility of your

plane going into failsafe mode and running the motor on the ground it it loses contact with your

ground station. If this option is enabled on an electric plane then either use a separate motor
3/24/2015 ArduPlane’s Failsafe Function | ArduPlane

http://plane.ardupilot.com/wiki/arduplane­setup/apms­failsafe­function/ 6/8

arming switch or remove the propeller in any ground testing.

VALUE MEANING

0 Disabled

1 Enabled

Code

Short Failsafe. events.pde line 4

static void failsafe_short_on_event()

{

// This is how to handle a short loss of control signal failsafe.

failsafe = FAILSAFE_SHORT;

ch3_failsafe_timer = millis();

gcs_send_text_P(SEVERITY_LOW, PSTR("Failsafe ‐ Short event on"));

switch(control_mode)

{

case MANUAL:

case STABILIZE:

case FLY_BY_WIRE_A: // middle position

case FLY_BY_WIRE_B: // middle position

set_mode(CIRCLE);

break;

case AUTO:

case GUIDED:

case LOITER:

if(g.short_fs_action == 1) {

set_mode(RTL);

}

break;

case CIRCLE:
3/24/2015 ArduPlane’s Failsafe Function | ArduPlane

http://plane.ardupilot.com/wiki/arduplane­setup/apms­failsafe­function/ 7/8

case RTL:

default:

break;

}

gcs_send_text_fmt(PSTR("flight mode = %u"), (unsigned)control_mode);

}

Long Failsafe. events.pde line 35

static void failsafe_long_on_event()

{

// This is how to handle a long loss of control signal failsafe.

gcs_send_text_P(SEVERITY_LOW, PSTR("Failsafe ‐ Long event on"));

APM_RC.clearOverride(); // If the GCS is locked up we allow

control to revert to RC

switch(control_mode)

{

case MANUAL:

case STABILIZE:

case FLY_BY_WIRE_A: // middle position

case FLY_BY_WIRE_B: // middle position

case CIRCLE:

set_mode(RTL);

break;

case AUTO:

case GUIDED:

case LOITER:

if(g.long_fs_action == 1) {

set_mode(RTL);

}

break;

case RTL:

default:

break;

}
3/24/2015 ArduPlane’s Failsafe Function | ArduPlane

http://plane.ardupilot.com/wiki/arduplane­setup/apms­failsafe­function/ 8/8

}

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.
3/24/2015 Advanced Failsafe Configuration | ArduPlane

http://plane.ardupilot.com/wiki/advanced­failsafe­configuration/ 1/8

The core failsafe functionality of APM:Plane is based on RTL (Return to Launch). It is able to

initiate a RTL if the aircraft loses contact with the ground station or loses RC control. That is

fine for most users, but in some situations more advanced failsafe capabilities are needed.

That is what the Advanced Failsafe options are for.

Contents [hide]

1 Background

2 Mission based

3 Enabling the AFS failsafe system

4 AFS Termination

5 Types of Failsafe Events

5.1 Geofence Breach

5.2 Maximum pressure altitude breach

5.3 GPS Loss

5.4 Ground station communications loss

5.5 RC Loss

5.6 Monitoring the AFS system

6 Manual Termination

7 Example AFS failsafe mission

8 Testing the AFS system in SITL

9 Additional tips for AFS failsafe users

10 Settings for Outback Challenge 2014

Background

The advanced failsafe options for APM:Plane were added for the Outback Challenge

ArduPilot > ArduPlane > Advanced Failsafe Configuration

Advanced Failsafe Configuration

ArduPlane
3/24/2015 Advanced Failsafe Configuration | ArduPlane

http://plane.ardupilot.com/wiki/advanced­failsafe­configuration/ 2/8

competition, and the features are designed to fit the rules of that competition. Whereas normal

failsafe is oriented around saving the aircraft in case control is lost by the pilot, the OBC rules

are oriented around ensuring safe operation in a defined region of airspace. This means that

the advanced failsafe options are designed to deliberately crash the aircraft if there is any risk

that it may fly outside of the region of airspace defined by a geographic boundary and a

maximum altitude.

While the advanced failsafe features of APM:Plane were designed for the OBC competition,

they can be useful in other situations, and are very flexible. They are also harder to configure,

so please read this page carefully several times before deciding whether to enable these

features on your aircraft.

Mission based

The key difference between normal failsafe and the advanced failsafe (AFS) options is that the

AFS options are mission based. When a failsafe option (such as loss of GPS lock or loss of

ground station communications link) happens, the AFS options specify a waypoint number in

the mission that the aircraft will switch to. This allows the pilot to configure a complex series of

actions to take when a failsafe event occurs – anything that can be scripted as an APM:Plane

mission can be made to happen on failsafe events.

Typically the pilot will setup the AFS options for failsafe conditions so that the aircraft will loiter

at its current location for some period of time (say one minute) and then proceed back towards

home via a pre­determined flight path. It may also include changes in airspeed, changes in

altitude, automatic landing or anything else that can be programmed in a mission. If the failsafe

event stops (for example GPS lock is regained) then the aircraft will switch back to the mission

item it was previously flying towards and continue the mission.

This makes the AFS options only really appropriate for AUTO missions. If you are primarily

flying APM:Plane in CRUISE mode or other modes then you should use the standard failsafe

options.

Enabling the AFS failsafe system

To enable the AFS failsafe system you need to set the AFS_ENABLE parameter to 1. The

default is zero, which means all the other options are disabled.

Note that the AFS system is only built into APM:Plane by default on higher end autopilot
3/24/2015 Advanced Failsafe Configuration | ArduPlane

http://plane.ardupilot.com/wiki/advanced­failsafe­configuration/ 3/8

boards like the PX4 and Pixhawk. On the APM2 you must recompile the firmware yourself to

use the AFS system.

AFS Termination

The concept of “flight termination” is key to understanding the AFS failsafe system.

Termination is where the aircraft deliberately dives into the ground by setting all control

surfaces to maximum and throttle to zero so as to enter a spin.

The AFS system will only start a termination if the AFS_TERM_ACTION is set to the magic

value 42. For any other value the AFS system will print a message on the GCS console saying

that it wants to terminate, but won’t actually change the control surfaces at all. Using a value

other than 42 is useful for test flights where you don’t want the aircraft to terminate on a failsafe

event.

Note that if AFS_TERM_ACTION is not set to 42 then other normal failsafe code is still active,

for example if you have a geofence enabled then the aircraft will fly back to the geofence return

point.

When enabled, the AFS termination system also sets up the secondary IO microcontroller on

the Pixhawk autopilot to terminate the aircraft if communication is interrupted between the main

FMU microcontroller and the IO microcontroller, for example if the flight firmware crashes.

An AFS flight termination is not recoverable. Once your aircraft starts a termination then is no

way to recover.

Types of Failsafe Events

The AFS failsafe system supports five of types of failsafe events:

geofence breach

maximum pressure altitude breach

GPS loss

Ground station communications loss

barometer failure

Each of these types of failures has its own specific handling, which is described below.
3/24/2015 Advanced Failsafe Configuration | ArduPlane

http://plane.ardupilot.com/wiki/advanced­failsafe­configuration/ 4/8

Geofence Breach

If a geofence is enabled then the AFS failsafe module will monitor the aircraft for a breach of

the boundaries of the geofence (and lower and upper geofence altitudes if set). If a breach

happens then the AFS system will immediately terminate the flight (see termination above).

Maximum pressure altitude breach

When sharing airspace with other aircraft it is usual practice to define the available flight

altitudes in terms of a common reference pressure, typically QNH (a reference to “nautical

height”). The QNH reference pressure, measured in millibar, is distributed to all aircraft either

via a radio message or through aviation internet and weather sites.

Aircraft then use their barometer to measure the pressure relative to that QNH pressure, which

gives them an altitude reference which all aircraft in the area should be using.

The AFS failsystem system is able to enforce a pressure altitude limit by setting the QNH

pressure in the AFS_QNH_PRESSURE parameter, as a value in millibars. The pilot should

then also set a pressure altitude limit using the AFS_AMSL_LIMIT parameter (in meters). Note

that this pressure altitude limit is relative to sea level (AMSL stands for “above mean sea

level”).

If both of these parameters are set then the AFS system fill monitor pressure altitude and will

initiate a termination if the pressure altitude rises above the AFS_AMSL_LIMIT.

You need to be very careful to set the right AFS_QNH_PRESSURE for your local conditions

on the day of your flight, as the QNH pressure can be very different on different days.

In addition to the QNH pressure limit, the AFS system also monitors the health of your

barometer. If the barometer is unhealthy for 5 seconds then the AFS system will check the

AFS_AMSL_ERR_GPS parameter. If it is ­1 (the default) then the aircraft will terminate

immediately. If it is not ­1 then the AFS system will use the AFS_AMSL_ERR_GPS value as a

margin to add to the GPS height, and will allow the flight to continue if the GPS altitude plus

the AFS_AMSL_ERR_GPS value (in meters) is below the AFS_AMSL_LIMIT value. The

purpose of this margin is to account for the inaccuracy of GPS altitudes. A value of 200 is

reasonable for safety to ensure the AFS_AMSL_LIMIT pressure altitude is not breached.

GPS Loss
3/24/2015 Advanced Failsafe Configuration | ArduPlane

http://plane.ardupilot.com/wiki/advanced­failsafe­configuration/ 5/8

The AFS system monitors the health of your GPS receivers throughout the flight. If all of your

available GPS receivers lose position lock then this initiates a GPS failure failsafe.

When a GPS failure occurs (which is defines as loss of GPS lock for 3 seconds) the AFS

system will look at the AFS_WP_GPS_LOSS parameter. This parameter species a waypoint

number in your mission to use when a GPS failure occurs. If AFS_WP_GPS_LOSS is nonzero the aircraft will change current waypoint to the waypoint number specified in

AFS_WP_GPS_LOSS. You should setup your mission so that the aircraft will perform

whatever actions you want on GPS loss. For example, you could have a set of waypoints

starting at number 10 which first loiter on the spot for 30 seconds, and then proceed back to

the airfield. You would then set AFS_WP_GPS_LOSS to 10 to enable that part of the mission

on loss of GPS lock.

When setting up mission items for GPS lock it is sometimes useful to include “loiter at the

current location” waypoints. That is achieved by setting both the latitude and longitude of

LOITER mission commands to zero.

If the GPS recovers after a GPS failsafe has started then the aircraft will automatically resume

its mission where it left off.

If during a period of GPS loss the aircraft also loses communications with the ground station

then this is termed a “dual loss”, and the aircraft will terminate.

If AFS_MAX_GPS_LOSS is set to a non­zero number, then it is used as a maximum count of

the number of GPS failures that will be allowed while returning to the mission after GPS lock is

re­established. This counter is only incremented if the 2nd GPS failure happens at least 30

seconds after the previous one (to account for a short period of GPS failure).

Ground station communications loss

The AFS system monitors the health of the link between your ground station and your aircraft.

It does this by looking for HEARTBEAT MAVLink messages coming from the ground station.

If the aircraft does not receive a HEARTBEAT message for a period of 10 seconds then it

enters a GCS failsafe state. It then looks for a AFS_WP_COMMS parameter, and if that is nonzero it will change the current target waypoint to the one given in AFS_WP_COMMS. You

should set up a section of your mission with whatever actions you want to take on loss of

communications.
3/24/2015 Advanced Failsafe Configuration | ArduPlane

http://plane.ardupilot.com/wiki/advanced­failsafe­configuration/ 6/8

If GPS lock is lost at the same time as GCS communications is lost then that is considered a

“dual loss”, and the aircraft will immediately terminate.

Note that the monitoring of HEARTBEAT messages only tells the autopilot that it can see

messages from the ground station. It does not mean the ground station can see messages

from the aircraft. So it is quite possible for your ground station to be reporting loss of

communication while the aircraft is still receiving HEARTBEAT messages.

If AFS_MAX_COM_LOSS is set to a non­zero number, then it is used as a maximum count of

the number of communication failures that will be allowed while returning to the mission after

communications is re­established. This counter is only incremented if the 2nd comms failure

happens at least 30 seconds after the previous one (to account for a short period of

communications failure).

RC Loss

If RC control is lost a manual control mode for more than AFS_RC_FAIL_MS milliseconds then

flight termination is activated. This termination mode is only enabled if AFS_RC_FAIL_MS is

non­zero. For the OBC rules it should be set to 1500 (giving 1.5 seconds).

Monitoring the AFS system

The AFS system provides some additional parameters to make it easier to monitor the health

of the failsafe system using external electronics (such as an external failsafe board).

The key parameters are:

AFS_TERM_PIN: This is a digital pin which is set to a high voltage if termination is started.

Note that this pin will go high on termination even if the AFS_TERM_ACTION parameter is

not set to 42.

AFS_HB_PIN: This is a digital pin number for a pin which is toggled at a rate of 10Hz by the

failsafe system. If termination occurs and a AFS_TERM_PIN value is not set then the

heartbeat pin will stop toggling.

AFS_MAN_PIN: This is a digital pin number for a pin which goes high when the aircraft is in

MANUAL mode. It may be useful with some external failsafe boards to detect manual mode

and behave differently.
3/24/2015 Advanced Failsafe Configuration | ArduPlane

http://plane.ardupilot.com/wiki/advanced­failsafe­configuration/ 7/8

Manual Termination

Apart from automatic termination it is also important for the aircrafts operator to be able to

terminate the aircraft immediately if the think the aircraft is a danger to people or other aircraft.

To force an immediate termination you should use the AFS_TERMINATION parameter. By

setting that parameter to 1 the aircraft will immediately terminate.

Example AFS failsafe mission

Setting up a AFS failsafe mission takes time, and needs to be done very carefully. To help you

understand what is possible you may find the following example files useful

A waypoint mission for the 2014 Outback Challenge with waypoints for different AFS failures

commented in the file

A geofence file for the 2014 Outback Challenge

Testing the AFS system in SITL

It is highly recommended that you extensively test the AFS system using the SITL simulation

system before using it on a real aircraft. You can simulate all types of in­flight failures using the

SIM_* parameters. To start SITL in Kingaroy ready for OBC testing you would use:

sim_vehicle.sh ‐L Kingaroy ‐‐console ‐‐map

The key parameters for failsafe testing in SITL are:

Test GPS failure: param set SIM_GPS_DISABLE 1

Test RC failure: param set SIM_RC_FAIL 1

Test comms failure: set heartbeat 0

Test fence failure: switch to CRUISE mode and fly across boundary

Test QNH failure: param set AFS_AMSL_LIMIT 100

Additional tips for AFS failsafe users

You need to ensure that your geofence is enabled before takeoff. This can either be done as
3/24/2015 Advanced Failsafe Configuration | ArduPlane

http://plane.ardupilot.com/wiki/advanced­failsafe­configuration/ 8/8

part if your preflight checklist, or you could set it a FENCE_CHANNEL and enable it from within

your transmitter, ensuring that if your transmitter is out of range that the fence remains

enabled.

Settings for Outback Challenge 2014

To be compliant with the OBC 2014 rules you should have the following settings:

AFS_ENABLE: 1

AFS_WP_COMMS: waypoint number for OBC comms hold followed by two minute loiter,

then return to airfield home

AFS_WP_GPS_LOSS: waypoint number to loiter in place for 30 seconds, followed by return

to airfield home

AFS_TERM_ACTION: 42

AFS_AMSL_LIMIT: 914

AFS_QNH_PRESSURE: correct QNH pressure for the day

AFS_RC_FAIL_MS: 1500

AFS_MAX_GPS_LOSS: 2

AFS_MAX_COM_LOSS: 2

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.