Pixhawk 2.1 – Full Setup Guide 2021


Pixhawk Hardware

What is the Pixhawk?

Pixhawk is a flight controller to set up autopilot for autonomous flying or for better control of the aircraft. In this SOP, we will be focusing on the setup and usage of the Pixhawk 2.1 on an autonomous plane.

Throughout this process ensure the aircraft’s propellor is removed and the transmitter is switched on before plugging in the battery.

We will be using the Pixhawk 2.1 system aka the hex cube.

The diagram above depicts the connections we use in setting up the Pixhawk 2.1 and a real-life setup. The system diagram shows the configuration for a quadcopter. However, other than the motor ESC connection, the rest are applicable still applicable to a fixed wing UAV.

There are 10 key components in the diagram that we need to take note of,

  1. Telemetry Transceiver: allows one to work with Ground Control Station software (GCS); transceiver connects to TELEM 1.
  1. GCS: Usually a laptop/tablet; Receives data and transmit instruction to aircraft. Transmit/receives using a transceiver linked to TELEM 1 transceiver.

  2. Buzzer: Provides auditory feedback on work done on the UAV; connected to Pixhawk carrier board port USB.
  1. PPM Encoder: Translate the Pulse-width modulation (PWM) signals from RC Receiver to pulse-position modulation (PPM); connected to Pixhawk carrier board RCIN pins at the bottom.

  2. RC Receiver: Receives RC transmitted signals and coveys to the flight controller; connected to the PPM Encoder.
  1. Safety Switch: Locks and unlocks motor; located together with the GPS.

  2. GPS & Compass: Housed externally in the circular housing; ensure arrow on housing points to the nose of the UAV, connected to the carrier board port GPS 1.

  1. Lithium-ion Polymer Battery: Used to power UAV; connected to the carrier board via the power brick.
  1. Power Brick: Used to power the Pixhawk 2.1; connected to the carrier board port POWER 1.
  2. Battery Checker: Warns user with an alarm if battery power goes below predefined value.
  3. Servos: Actuates the control surfaces of the aircraft; connects to the carrier board pins at the bottom, default outputs are
    1. Servo Output 1: Ailerons
    2. Servo Output 2: Elevator
    3. Servo Output 3: Throttle
    4. Servo Output 4: Rudder

Pixhawk Software

Ground Station Software (GCS)

There are 3 different GCS that we can choose from,

  1. Mission Planner (Windows)  (We will be using this)
  2. QGroundControl (Windows, Mac OS X, Linux, Android, iOS)
  3. APM Planner 2 (Windows, Mac OS X, Linux)

Flashing Firmware

When you first receive the Pixhawk module, there will be no software in it. We need to flash the module with the firmware. This firmware can be acquired from ArduPilot. The steps are as follows,

  1. Remove all accessories leaving only the flight controller on the carrier board
  2. Connect autopilot (pixhawk) using the micro USB cable to your computer
  3. Select COM port
    1. Set Baud rate to 115200 (top right) (Don’t hit Connect)
  4. On Mission Planner SETUP | INSTALL Firmware, select Arduplane (arducopter for drones)
    1. When prompted select Cubeblack for the platform
    2. When prompted, unplug FC from computer, click OK, plug FC back into the computer
  5. Connect once bootloader exits and enter main code
  6. Connect to the Mission Planer Flight Data Screen (HUD update as board tilts)

Setting up the Radio Transmitter

Arrange the servo inputs in the following order

  1. Aileron
  2. Elevator
  3. Throttle
  4. Rudder
  5. Mode switch

You can choose to map different inputs in GCS but easier to do in this sequence.

Setting up 3 PT Switch for Turnigy 9X Transmitter

3 Pt switch is needed to switch between modes in mission planner. This guides you through how to create a mix profile to set up a 3 PT switch on the Turnigy 9X Transmitter

  1. Go to AUX Channel
    1. Set up CH5 THR HOLD
  2. Go to PROG. MIX
    1. Create 3 mix
  1. MIX1 Settings
    1. STATE : ACT
    2. MASTER : FLP
    3. SLAVE : AUX
    4. OFFSET :000
    5. UPRATE : -100
    6. DNRATE : 100
    7. SW : NOR
    1. STATE : ACT
    2. MASTER : FLP[
    3. SLAVE : AUX
    4. OFFSET : 100
    5. UPRATE : -040
    6. DNRATE : 040
    7. SW : ID1
    1. STATE : ACT
    2. MASTER : FLP
    3. SLAVE : AUX
    4. OFFSET :000
    5. UPRATE : 025
    6. DNRATE :-025
    7. SW : ID2
  4. Take note that there are 2 options for AUX, select the first one.

Go onto Mission Planner to ensure that flap switch has been successfully programmed

Further Setup

Once we have flashed the arduplane firmware into the pixhawk module, we can proceed to calibrate our radio transmitter with the pixhawk using our GCS.

  1. Select Setup tab
  2. Run through the “Mandatory Hardware” Calibration
  3. Follow through instruction to calibrate accelerometer.
    1. Set aircraft level position with a slight positive AOA by tilting nose up and setting it as the level position.
  4. Follow through instruction to calibrate compass.
    1. If calibration fails, green bars reset to the left and calibration routine may restart.
    2. If calibration continues to fail, move to a different location away from magnetic disturbances.
    3. Compass still not calibrated after multiple attempts, Cancel and change “Fitness” drop down to a more relaxed settings.
  5. Install radio receiver onto the carrier board (Remove prop from plane)
  6. Back on the GCS, select “Mandatory Hardware” ⇾ “Radio Calibration”.
  7. Follow prompted instructions to calibrate radio input.
    1. If unable, plug in a battery to the receiver (PPM Encoder uses more power and may need a separate power source)
  8. Select “Servo Output”
  9. Ensure that functions listed in the “Servo Output” corresponds to the output wires.
    1. Ch1: Aileron
    2. Ch2: Elevator
    3. Ch3: Throttle
    4. Ch4: Rudder
  10. Select “Flight Mode” to set up the flight modes.
  11. Select “Failsafe” and set up failsafe.

Setting up the UAV

Now that we have calibrated our radio transmitter to the firmware in the pixhawk, we now need to check if the servos function according to the transmitter’s output.

  1. Turn on RC Transmitter and connect battery.
  2. In Fly-By-Wire-A (FBWA), ensure the following:
    1. At level: initial control surfaces position near trim values
    2. Sticks centred, move the aircraft: control surfaces move to counteract movement, e.g. aircraft pitch up, elevator moves down
  3. If any of the movements are reversed, reverse output of the corresponding servo by going to “Mandatory Hardware” ⇾ “Servo Output” and reverse the respective servos
  4. Move transmitter stick, ensure control surfaces move in the correct direction, e.g. elevator stick pulled down, elevator moves up
  5. Switch FC to “Manual” mode, ensure control surfaces move in the correct direction
  6. Trim the servos such that when transmitter stick is centred, servos are centred
  7. Adjust servo throw as required (adjusting servo throw increases/decreases servo max/min travel, ensure that control surfaces continues to move nearing the extreme values)
  8. Calibrate ESC
    1. Power off ESC, leave FC powered on
    2. In “Manual” mode, disable safety switch and arm plane
    3. Move throttle stick on transmitter to maximum
    4. Power on esc, ESC will beep to indicate it is in calibration mode
    5. Quickly lower throttle stick to 0, ESC should beep indicating calibrated successfully
    6. Slowly raise throttle to check if motor responds correctly

Mounting the Autopilot

Follow these steps when installing your pixhawk module into your UAV

  1. Mounted with the arrow (on GPS module) facing the nose of the aircraft
  2. Mounted near the centre of gravity
  3. Mounted on the chassis with 4 cubes of vibration dampening foam
  4. If mounted in a different orientation, edit the board orientation in the GCS (Board Orientation (AHRS_Orientation)

Magnetic Interference

Has an effect on navigation system

  1. Use external compass or GPS+Compass module on a mast up and away from magnetic source
  2. Keep wires between PDB, ESCs, battery as short as possible
  3. Twist wire between PDB, ESC and Battery; use grounded shield when possible
  4. Add aluminium shielding around wires from ESC to motors

First Flight

Now that both the software and hardware aspect of the UAV has been taken care of, we can start planning its first flight.

  1. Ensure that CoG is correct (typically ⅓ from the leading edge of the wing)
    1. After maiden flight, if constant massive elevator input is required to maintain level flight, CoG needs to be corrected (can be done by shifting battery forward/back)
  2. Ground Calibration
    1. Transmitter mode set to “Manual”, power on board, leave aircraft motionless until LEDs stop flashing blue and red (allow gyros to calibrate)
  3. Disengage safety switch by depressing it for 5 sec, led should turn from slow blinking to on continuously
    1. Depress again for 5 sec to toggle safety switch back on
    2. If led blinks fast, error has occurred and safety cannot be disengaged
  4. Wait for GPS lock, indicated by FC led turning green
  5. Check servo movements, ensure that in FWBA mode, control surfaces move in the correct direction to level the plane as you tilt the plane (DO THIS BEFORE EVERY FLIGHT)
  6. Arm the aircraft with appropriate arming method.

Level Adjustment

During the flight test, if the aircraft tends to turn in one direction / gain or lose altitude when sticks are centered, check the following;

  1. Power on FC on ground and connect to GCS, select FWBA mode on transmitter and select “Flight Data” tuning window
  2. Plot nav_roll and nav_pitch data
  3. If plot is not 0 when sticks are centred, repeat RC calibration or adjust transmitter trims
  4. If plot is 0, adjust AHRS_TRIM_X (roll) and AHRS_TRIM_Y (pitch) in CONFIG/TUNING | Full Parameter List

Pre-arm safety checks

In the event the aircraft is unable to arm, likely there is a pre-arm check failure. Follow the following steps to identify the failure

  1. Connect FC to GCS using USB or Telemetry
  2. Ensure GCS is connected to vehicle and push “Connect”
  3. Turn on transmitter and attempt to arm vehicle
  4. First cause of pre-arm check failure will be displayed in red on HUD window

Click to see the common causes of error and solutions to each error.

Configuring Arming

There are 3 parameters that control arming, they can be accessed through the GCS.

  1. ARMING_REQUIRE: controls whether arming is required, default is 1 (arming is required)
  2. ARMING_CHECK: Controls if checks are done before arming is allowed
  3. ARMING_RUDDER: Allow configuration of rudder based arming/disarming. =1 (able to arm with right rudder) / =2 (disarm with left rudder) / 0 = (only arm/disarm using GCS or RC channel input

If aircraft still cannot arm, refer to the previous section to identify pre-arm safety error that could be preventing arming failure.


  1. Where do I access specific parameters that I want to change e.g. ARMING_REQUIRE
    1. Go to CONFIG | FULL PARAMETER LIST, full list of parameters are shown, specific parameters can be toggled on or off, once changes are made, select “Write params” to save the changes
  2. Servo not moving after powering up
    1. Ensure that the servos’ output are properly setup in Mission Planner and Transmitter
    2. Ensure that servo rail is powered, 5v is required to power the servos

Mission Planner

Mission planner is our chosen GCS.

Useful tutorial: https://youtube.com/playlist?list=PLYsWjANuAm4p6qzsdJ4Jtnh0dVIGS8jOp


1. Circumference around waypoint, defines the waypoint range, once it hits within the circle, the aircraft will move to next waypoint. Technically Accuracy.

2.       Note : Max OPS altitude is 60m (200ft)

3.       Takeoff- Right Click, select takeoff, creates takeoff waypoint. Takeoff altitude-the altitude which considered as the takeoff is complete. (Can set as 60m) , click ok. Takeoff Pitch = 25-30 degrees, click ok. (Takeoff does not have a position)

4.       Land – Last Row. Create Waypoints, approach for landing. Land into the wind. Approach Path Points as follows

a.       90,65,35,15m, cut motor and glide to land.

b.      Landing Gradient 10-15%

5.       Save waypoint file.(right hand button)

Mapping Grid

1.       Right click, Add Polygon

2.       Right click, Auto WP > Survey(Grid)> Creates Auto way point .

3.       Select Camera type for grid spacing.

Flight Plan Tab

1.       Save the map required, (Prefetch Image Data Set).

a.       Hold Down alt key, click and drag box over map. Let go alt key

b.      Right click , map tool , prefetch

c.       At Zoom 16 can stop fetching data.

d.      Top left hand, Distance of total flight plan, and Home is distance from home waypoint.


1.       Set Loiter Point

2.       Set Cruise on flight data, Cruise mode; maintain heading, altitude and airspeed.- This is to go somewhere inbetween of the waypoints or loiter.

3.       Set Loiter waypoint number on flight data and press “SET WAYPOINT”


1.       Check Telemetry Module Connection. Check signal strength on top right hand corner of HUD.

2.       Data baudrate 57600 bits/sec

3.       Get Params : Downloading all the data from the aircraft.

4.       Check battery data, see if it is working. Check GPS fix

5.       Go to Flight plan > Loadup the WP point.


7.       Write Waypoints Button(right) > Points set to aircraft.

8.       Read WP after you write > If the flight plan is uploaded successfully, nothing should change.

9.       Back to flight data > Autopan to make map freestyle use, instead of follow aircraft.

10.   Flight Data > Toggle Arm and Disarm before flight. After a few seconds the arm message will turn off. Disarm text will never go away.

11.   Upload flight plan, repeat step 5,6,7,8

12.   When you don’t have proper waypoints set, it will always go to RTL mode.

13.   If you click loiter in the middle of all waypoints, it will just loiter at the exact point you clicked loiter.

14.   You can go to specific waypoint, using SET WP button. And will continue flying again from that waypoint. Press Auto. Change waypoint only during loiter.

15.   Right click > Flight to Alt, set > Fly to Here (EMERGENCY WAYPOINT)

16.   When reaching final landing waypoint, pull the pitch up and change to manual mode. Aircraft must disarm.

17.   Always prepare to change waypoint to landing approach start waypoint.

-By Nisanth Reddy.

Author: Blog Writer