What Is PX4 and Who Should Use It?
PX4 is an open-source autopilot software stack maintained by Dronecode, a Linux Foundation project. It runs on a wide range of flight controller hardware — from the Pixhawk 6C to the Holybro Kakute F7 — and supports multirotor, fixed-wing, VTOL, ground rovers, and submarines.
PX4 is the right choice when you need:
- Fully autonomous waypoint missions
- Position hold, altitude hold, return-to-home without manual tuning
- ROS 2 integration via MAVROS for research or advanced autonomous operations
- Professional-grade data logging and simulation support (Gazebo, SITL)
- BVLOS compliance pathways
PX4 is probably not the right choice for pure FPV racing or freestyle flying — Betaflight handles those use cases with significantly less setup overhead. If you're deciding between platforms, see the Betaflight vs ArduPilot comparison and the PX4 vs ArduPilot deep-dive.
Browse flight controllers compatible with PX4 in the component database.
Hardware Requirements
Minimum Recommended Hardware
| Component | Minimum Specification |
|---|---|
| Flight Controller | Pixhawk 4 Mini, Holybro Kakute F7, any Pixhawk-standard FMUv5+ |
| GPS/Compass | M8N or better (M9N, F9P recommended) |
| RC Receiver | Any SBUS, PPM, or CRSF receiver |
| Telemetry (optional) | SiK radio pair (915 MHz or 868 MHz) |
| Computer | Windows 10/11, macOS 12+, or Ubuntu 20.04+ |
| USB Cable | USB-C or micro-USB depending on FC |
PX4 officially supports the Pixhawk FMUv2 through FMUv6 hardware standards. The Pixhawk 6C (FMUv6C) is the current reference platform with the best sensor suite: dual IMUs, integrated barometer, and dedicated CAN bus for peripherals.
For builds where weight matters, the Holybro Kakute H7 and Matek H743 also run PX4 while fitting in a 30×30mm FC stack. These work well for 5–7" long-range builds that need PX4's autonomous capabilities.
QGroundControl Installation
QGroundControl (QGC) is PX4's primary ground control station. It handles firmware flashing, calibration, mission planning, and real-time monitoring.
Download QGroundControl from the official Dronecode releases page. Versions exist for Windows, macOS, Linux, Android, and iOS. The desktop version has the most complete feature set.
On macOS: You may need to allow the app in System Preferences → Security & Privacy after the first launch attempt is blocked.
On Linux: Install the AppImage, make it executable with chmod +x QGroundControl.AppImage, then run it. You may also need to add your user to the dialout group to access serial ports:
sudo usermod -aG dialout $USER
# Log out and back in for the change to take effect
On Windows: Install the MSI package and install the WinUSB driver when prompted. If your Pixhawk uses an STM32 bootloader, you may also need the Zadig USB driver tool to assign the correct driver.
Firmware Flashing
Connect the Flight Controller
Connect the flight controller to your computer via USB. Do not power it from a battery during initial firmware flashing.
In QGroundControl, click the Q icon (top-left) → Vehicle Setup → Firmware.
QGC will prompt you to unplug and replug the FC. Once detected, it presents firmware options:
- PX4 Pro Stable Release — use this for real builds
- PX4 Pro Beta Testing — use only for testing specific beta features
- Custom firmware file — for loading a specific build from CI
Select PX4 Pro Stable and click OK. QGC downloads and flashes the firmware, which takes 30–90 seconds.
Verify the Flash
After flashing, the FC reboots and QGC reconnects automatically. The bottom status bar should show "Connected" and the vehicle icon should appear. If QGC shows "Disconnected" after 30 seconds, unplug/replug and check that the correct serial port is selected in the comm settings.
Airframe Selection
PX4 uses airframe configurations — pre-defined parameter sets for different vehicle geometries. Navigate to Vehicle Setup → Airframe.
Common airframe selections:
| Vehicle Type | Recommended Airframe Config |
|---|---|
| Standard X-frame quadcopter | Generic Quadrotor X |
| H-frame quadcopter | Generic Quadrotor H |
| 5" FPV racer | Generic 250 Racer |
| Hexacopter X | Generic Hexarotor X |
| Fixed-wing | Generic Plane (or specific model if listed) |
| VTOL tilted-rotor | Standard VTOL |
After selecting the airframe, QGC will prompt you to apply and restart. The FC reboots with the default parameter set for that airframe. You can then modify individual parameters.
PX4's parameter system is powerful but overwhelming at first. Stick to the Setup wizard until you understand what each parameter does.
Sensor Calibration
Sensor calibration is not optional. PX4 requires all sensors to be calibrated before it will arm. Navigate to Vehicle Setup → Sensors.
Compass Calibration
The compass calibration routine compensates for hard and soft iron errors from the drone's frame and electronics.
- Click Compass → OK to start
- Follow the onscreen instructions: rotate the drone in all orientations shown (typically 6 faces of a cube)
- Take the drone away from magnetic interference — no metal tables, no computers nearby
- Rotate slowly and smoothly — abrupt jerks produce poor calibration data
If the compass calibration fails repeatedly, check that the GPS/compass module is properly connected and that no strong magnetic material (steel screws, etc.) is near the GPS mast.
Accelerometer Calibration
The accelerometer calibration establishes the reference for level flight.
- Click Accelerometer → OK
- Place the drone on a flat, level surface
- Follow the prompts: hold in each of 6 orientations (flat, nose down, nose up, left side, right side, upside down)
- Each orientation must be held still — wait for the progress bar to fill before moving
Level Horizon Calibration
After accelerometer calibration, perform the level horizon calibration on the exact surface where you intend to fly. This compensates for slight offsets in how the FC is mounted relative to the frame.
- Place the drone on a flat level surface in its normal flying orientation
- Click Level Horizon
- Do not touch the drone until it completes (approximately 5 seconds)
Radio Calibration
Connect your RC transmitter and ensure the receiver is bound. Navigate to Vehicle Setup → Radio.
- Move all sticks to their extreme positions (full travel in every direction)
- QGC records the min/max values for each channel
- Ensure the channel assignments match (throttle, roll, pitch, yaw, flight mode switches)
Check the channel ordering and stick reversal for your specific transmitter. The PX4 default expects Mode 2 (throttle on left) but you can configure Mode 1 or any channel remapping.
Browse receivers compatible with PX4 in the component database.
ESC Calibration
PX4 supports multiple ESC protocols: PWM, DSHOT (300, 600, 1200), DroneCAN. If using DSHOT, ESC calibration is automatic — DSHOT is a digital protocol that doesn't require endpoint calibration.
For PWM ESCs, calibrate through QGC:
- Navigate to Vehicle Setup → Power
- Set the minimum PWM value (usually 1000µs) and maximum PWM value (usually 2000µs)
- Many PWM ESCs require a manual calibration sequence: power on with throttle at maximum, wait for confirmation tones, drop throttle to minimum, wait for armed tone
For BLHeli_32 or AM32 ESCs, use the ESC configurator app (over USB passthrough or Betaflight-based passthrough) to set parameters before switching to PX4.
Flight Modes Explained
PX4's flight modes are more prescriptive than Betaflight's. Understanding each mode is essential before first flight.
| Mode | Description | Stabilization | Position Hold | GPS Required |
|---|---|---|---|---|
| Manual | Raw RC passthrough | No | No | No |
| Stabilized | Self-leveling, no position hold | Attitude | No | No |
| Altitude | Hold altitude, drift in wind | Attitude + baro | No | No |
| Position | Full position hold in wind | Full 3-axis | Yes | Yes |
| Mission | Autonomous waypoint execution | Full | Yes | Yes |
| Return (RTH) | Return to launch point | Full | Yes | Yes |
| Offboard | External computer control (ROS) | Full | Yes | Yes |
| Acro | Rate mode, no stabilization | Rate only | No | No |
For a first flight, configure your RC switches for:
- Stabilized mode (default, safe)
- Position mode (when GPS lock acquired)
- Return mode (emergency switch)
Never attempt a first flight without a working return-to-home switch configured. PX4's RTH is reliable and can save the aircraft if you become disoriented.
Pre-Arm Checks
PX4 performs pre-arm checks before allowing the vehicle to arm. All checks must pass. Common pre-arm failures and solutions:
| Pre-Arm Failure | Cause | Solution |
|---|---|---|
| RC not calibrated | Radio calibration not run | Complete radio calibration |
| Compass inconsistent | Bad calibration or magnetic interference | Recalibrate away from interference |
| GPS fix not acquired | No satellite lock | Wait for 3D fix (6+ satellites) |
| Gyro calibration required | First boot or FC replaced | Calibrate accelerometer |
| Airspeed sensor | Fixed-wing without airspeed sensor | Disable check in parameters if not using |
| Battery failsafe | Low battery at startup | Charge battery |
To view the current pre-arm state, check the Vehicle Status section in QGC's fly view. Arm failures are listed with specific error codes.
First Flight
Follow this procedure for your first PX4 flight:
Pre-flight:
- All pre-arm checks passing in QGC
- GPS fix acquired (at least 6 satellites, HDOP < 1.5)
- Battery fully charged
- Props secure and correctly oriented (CW/CCW matched to motor positions)
- Flight mode switch confirmed working on bench (watch QGC mode display change)
Takeoff:
- Arm in Stabilized mode (not Position mode — you want to feel the aircraft's raw behavior first)
- Throttle up slowly to hover threshold (approximately 50% for most builds)
- Hold 1–2m altitude for 30–60 seconds, making small corrective inputs
- Observe oscillations or drift — if severe, land and check prop balance and FC vibration dampening
First autonomous hover:
- Gain altitude to 5m in Stabilized mode
- Acquire good GPS lock (watch satellite count and HDOP in QGC)
- Switch to Position mode
- Release all sticks — the drone should hold position within 1–2m
Tuning Basics
PX4's default rates and PIDs work well for most standard builds. If you observe oscillations, follow this sequence:
- Check for vibration: Examine the IMU vibration levels in QGC (Vehicle → Status). Values above 60 m/s² suggest mechanical vibration issues (prop balance, motor bearings) that must be fixed before tuning PIDs.
- Reduce rate P gains: If the drone oscillates, reduce MC_ROLLRATE_P and MC_PITCHRATE_P by 10% at a time. Reflfly.
- Adjust autotuning: PX4 v1.14+ includes an automatic tuning function. Fly to 15m, hover, then initiate autotune. The drone performs controlled maneuvers and identifies optimal gains automatically.
For a complete understanding of how PX4 compares to ArduPilot for different use cases, see the PX4 vs ArduPilot guide.
Frequently Asked Questions
Can I use PX4 with any flight controller?
PX4 runs on any flight controller that supports its Hardware Abstraction Layer (HAL) — primarily hardware following the Pixhawk FMUv2–v6 standards, plus a growing list of community-supported boards. Check the official PX4 hardware support list before purchasing. Not all FCs marketed as "PX4 compatible" have full support — some lack drivers for all sensors or have known issues with certain firmware versions.
How long does the complete setup process take?
For someone new to PX4, allow 3–4 hours for a first setup including QGC installation, firmware flashing, calibration, and first hover. Subsequent builds take 60–90 minutes once you're familiar with the workflow. The most time-consuming step is usually waiting for GPS lock in a new location and troubleshooting pre-arm check failures.
Do I need a telemetry radio?
A telemetry radio is strongly recommended for any autonomous mission work. Without it, you can still fly but cannot monitor GPS status, battery voltage, or flight mode in real time from a laptop — you must rely entirely on the drone's behavior and the RC controller display. For pure manual flying in Stabilized mode, telemetry is optional. For missions, waypoints, and BVLOS, it's essential.
What is SITL and should I use it?
Software-In-The-Loop simulation runs the full PX4 stack on your computer, connected to a physics simulator (Gazebo, jMAVSim). You can test mission scripts, flight modes, and RC setups without a physical aircraft. SITL is highly recommended before attempting first autonomous flights — especially for mission execution and failsafe testing. Set it up by following the official PX4 SITL documentation.
My drone drifts in Position mode. What should I check?
First, verify GPS accuracy: HDOP should be below 1.5 and satellite count above 8 for good position hold. Compass interference is the second most common cause — if the compass is near high-current wires, it will show incorrect heading data, causing the position controller to fight the wrong direction. Finally, check that the home position was set correctly (the point where you armed the vehicle). Large initial position error causes apparent drift.
How do I log flights and review data?
PX4 writes dataflash logs to the SD card (if fitted) automatically on every arm. Logs are in .ulg format and can be reviewed with QGroundControl's log analysis view or uploaded to PX4's online flight review tool at logs.px4.io. Key things to check after a first flight: vibration levels (IMU.AccX/Y/Z), EKF position error, and actuator outputs. See the flight controller database for SD card support details on specific boards.
Was this guide helpful?
Related Articles
PX4 vs ArduPilot: The Complete Comparison for Drone Developers
A thorough comparison of PX4 and ArduPilot flight firmware — architecture, hardware support, use cases, community, and which to choose.
Best Flight Controllers for Drones — 2026 Buyer's Guide
A comprehensive buyer's guide to the best flight controllers in 2026 — by category, use case, and budget — with spec comparisons and firmware compatibility notes.
Betaflight vs ArduPilot: When to Use Which Firmware
A detailed comparison of Betaflight and ArduPilot — use cases, control loop architecture, GPS dependency, waypoint support, hardware compatibility, and how to choose.