Skip to the content
FixTheRobot Explore Robotics / UAV / Module 6 / M6-T12

UAV Systems Engineering · Module 6

M6-T12: QGroundControl

QGroundControl is more than a map: it is the calibration tool, the parameter editor, the mission planner and the MAVLink inspector.

  • Lesson 12 of 16
  • UAV Software and Flight-Controller Integration
  • Implementation-specific
  • About 5 minutes to read

Most of the bench and field work on a PX4 vehicle happens in QGroundControl: sensor calibration, safety configuration, parameter review, mission upload and live monitoring. Using it deliberately (with a checklist and a saved record) is what separates a repeatable test from an anecdote.

Learning objectives

After this lesson, you should be able to:

  • Connect QGroundControl to a simulated and a real vehicle and read its status.
  • Calibrate sensors and configure safety settings, and know what each calibration changes.
  • Manage parameters: export, compare and restore.
  • Use the MAVLink inspector, analyze tools and logs for engineering diagnosis.

Conceptual explanation

Implementation-specific QGroundControl is the reference ground station for PX4 and also works with ArduPilot. Its menus and views change between releases; the workflow here is stable but the labels may differ. Follow the user guide for your version.

QGroundControl (QGC) is a cross-platform ground control station. The views you will use most:

  • Vehicle setup: firmware, airframe, sensor calibration (gyro, accelerometer, magnetometer), radio, flight modes, power and safety (failsafes, geofence, return settings).
  • Parameters: view, search and edit every autopilot parameter; export the whole set to a file and compare against a baseline.
  • Plan: create waypoint missions, set altitude and speed per item, upload and download them.
  • Fly: live map, telemetry, mode switching and commands.
  • Analyze tools: the MAVLink Inspector (live message rates and fields), MAVLink console (a shell onto the autopilot), log download and the vibration view.
A QGroundControl sessionConnect, check status and calibration, set parameters, plan or upload a mission, fly under supervision, and download the log after landing. Every step leaves a record that belongs in the test report.ConnectUDP / serialSetupsensors, radio, safetyParametersreview, diffPlan / flymission, monitorLogdownload, archiveQGroundControl is the operator’s window. Treat it as a measurement and control tool, not just a map.
The engineering workflow. Each step leaves a file or a note for the test record.
Animation of an accelerometer calibration. A cube representing the vehicle is placed in six orientations, each with a different axis pointing up, while the raw readings are recorded. After each pose the reading is added as a point on a three-dimensional-looking plot; the raw readings lie on a distorted shifted ellipsoid, and after the least-squares fit they land on a sphere of radius g. The residual of the norm against g shrinks from several tenths of a metre per second squared to a few hundredths.
Six static poses give the accelerometer’s response to ±gg on each axis: enough to estimate three biases, three scale factors and the misalignments, because in every pose the true specific force has magnitude gg. The quality check is the spread of the corrected norm around gg. Synthetic raw data with a bias of about 0.2 m/s20.2\,\mathrm{m}/\mathrm{s}^{2} and scale errors of about 2 %. (Looping, about 6 seconds; drawn and computed for this course with illustrative values.)

Engineering intuition

Use QGC like a lab instrument. Before every flight, note the firmware version, load the parameter file, and compare it with the baseline. After every flight, download the log and write down what happened. If something odd occurs in the air, the MAVLink Inspector and the console let you check, in seconds, whether the vehicle believes what you believe: the estimator status, the sensors and the failsafe flags.

The calibrations deserve respect. A gyro or accelerometer calibration depends on the vehicle being still and level; a compass calibration depends on the environment being free of magnetic disturbance. A bad calibration looks like a controller or estimator bug in the air.

Mathematical formulation

Calibration fits a model to raw readings. For an accelerometer, the sensor output arawa_{\text{raw}} relates to the true specific force by scale factors, axis misalignment and bias: araw=M a+ba_{\text{raw}}=M\,a+b. The six-position calibration collects stationary readings in six orientations (±xx, ±yy, ±zz up), where ∥a∥=g\Vert a\Vert =g is known, and solves for MM and bb:

Accelerometer calibration model
M−1(araw−b)=atrue,∥atrue∥=g  in every static pose\mathbf M^{-1}(\mathbf a_{\text{raw}} - \mathbf b) = \mathbf a_{\text{true}}, \qquad \lVert\mathbf a_{\text{true}}\rVert = g \ \text{ in every static pose}

Magnetometer calibration fits an ellipsoid (hard-iron offset and soft-iron distortion) to readings taken while rotating through all orientations, mapping them to a sphere of radius equal to the local field magnitude. The quality of both depends on pose diversity: a calibration with poses in only one plane leaves the other axes unconstrained. A useful check after calibrating is the residual: the spread of ∥M−1(araw−b)∥\Vert M^{-1}(a_{\text{raw}}-b)\Vert across poses, which should be small compared with gg.

MM, bb
accelerometer scale/misalignment matrix and bias.
gg
gravity magnitude (≈9.81 m/s2)(\approx 9.81\,\mathrm{m}/\mathrm{s}^{2}).

Architecture and data flow

QGC ↔ MAVLink (UDP from SITL or a telemetry radio, or a USB serial) ↔ PX4 MAVLink module ↔ uORB. Parameter reads and writes use the MAVLink parameter protocol; missions use the mission protocol; calibration commands are MAVLink commands with status messages back. The log download uses the MAVLink log-transfer messages. If several ground stations or a companion computer share the link, a MAVLink router distributes streams.

Real-world UAV applications

  • Bench setup and calibration of a new airframe.
  • Pre-flight checks and parameter baselines for test campaigns.
  • Mission planning for repeatable autonomy tests.
  • Live diagnosis during SITL and flight tests with the MAVLink Inspector and console.

Implementation example

This runs as shown. A six-position accelerometer calibration on synthetic data: raw readings with scale, misalignment and bias, solved by least squares, with the residual check.

import numpy as np
rng = np.random.default_rng(2)
g = 9.81
M_true = np.array([[1.02, 0.01, -0.005], [0.0, 0.98, 0.012], [0.003, -0.002, 1.01]]); b_true = np.array([0.15, -0.08, 0.22])
poses = np.array([[0, 0, 1], [0, 0, -1], [1, 0, 0], [-1, 0, 0], [0, 1, 0], [0, -1, 0]]) * g
raw = (M_true @ poses.T).T + b_true + 0.01 * rng.standard_normal(poses.shape)       # raw readings in the six static poses

# solve  raw = a_true M^T + b  for M and b by linear least squares (known true specific force in each pose)
X = np.hstack([poses, np.ones((6, 1))]); sol, *_ = np.linalg.lstsq(X, raw, rcond=None)
M_est, b_est = sol[:3].T, sol[3]
corr = np.linalg.solve(M_est, (raw - b_est).T).T
resid = np.linalg.norm(corr, axis=1) - g
print("bias error (m/s^2):", np.round(b_est - b_true, 3), " max |norm - g| after calibration: %.3f" % np.abs(resid).max())
assert np.allclose(b_est, b_true, atol=0.03) and np.abs(resid).max() < 0.05
print("uncalibrated max |norm - g|: %.3f" % np.abs(np.linalg.norm(raw, axis=1) - g).max())
Six-position accelerometer calibration on synthetic data. The residual of the norm against g is the quality check.

A pre-flight checklist to keep with the vehicle:

[ ] firmware version and hash recorded
[ ] parameter file diffed against baseline (no unexplained changes)
[ ] sensors calibrated this session or within the validity period; no calibration warnings
[ ] GNSS fix / vision odometry valid; EKF status OK; home position set
[ ] failsafe actions checked (link loss, RC loss, battery, estimator)
[ ] geofence and return altitude set for this site
[ ] mission uploaded and read back; first waypoint reasonable
[ ] logging enabled, card present; battery fully charged and voltage OK
[ ] pilot in the loop, kill switch tested, safety observer briefed
A pre-flight checklist template. Adapt to your vehicle and risk assessment.

Common engineering mistakes

Calibrating near metal or live wires

The compass calibration absorbs the disturbance and fails in flight.

Changing parameters without saving the old set

No way to know what changed; export before editing.

Not reading back the uploaded mission

Confirm the vehicle holds what you planned.

Ignoring calibration warnings

They are early signs of sensor problems.

Using a different QGC version without checking

Menus and defaults change; record the version.

Failure modes

Failure modes, symptoms and causes
Failure modeHow it shows upLikely cause
Calibration fails repeatedlyError after the last poseMagnetic disturbance, poor poses, damaged sensor
Parameters not savedChanges lost after rebootWrite failed or reboot required
No connectionQGC does not see the vehicleWrong port, baud rate, firewall or link configuration
Mission rejectedUpload errorInvalid item, missing home, frame mismatch

Debugging approach

  1. Use the MAVLink Inspector to confirm the vehicle is streaming and at what rate.
  2. Use the MAVLink console to read sensor and estimator status.
  3. Export the parameter set and diff it with the baseline.
  4. Download the log immediately after the flight and look at vibration and estimator status.

Practical exercises

  1. Connect QGC to PX4 SITL and list the first ten parameters and their values.
  2. Export the parameter set, change two parameters, export again and diff them.
  3. Plan a square mission, upload it and read it back.
  4. Use the MAVLink Inspector to measure the rate of the attitude and heartbeat messages.

Interview questions

Write an answer in your own words, then reveal the model answer. Nothing is sent anywhere.

Question 1

Why diff parameter sets before and after a test?

Model answer

Undocumented parameter changes make results irreproducible and can hide the cause of a failure; a diff against a baseline documents exactly what differs.

Question 2

What does the accelerometer calibration estimate?

Model answer

Bias, scale factor and axis misalignment, using static poses with known gravity; the residual of the norm against gg after calibration checks quality.

Question 3

What would you check first if the vehicle flies badly right after calibration?

Model answer

The calibration quality and warnings, the sensor values (norm of acceleration at rest, heading against a reference), and the estimator status in the log.

References and further reading

Primary papers, official documentation and standards. Each claim above that is specific to a tool or version points here.

What’s next

Mark this lesson

Saved in this browser and synced to your account when you are signed in.

Practice this lesson

M6-L3: Connect PX4 with QGroundControl

Connect QGC to SITL.

Next lesson

M6-T13: Flight logs and debugging

Analyse ULog files to diagnose tracking, estimator and failsafe behaviour using Flight Review, pyulog and plots.