Multicopter Setpoint Tuning (Trajectory Generator)

This document provides an overview of the multicopter tuning parameters that change the user experience: how fast the vehicle reacts to stick movements or direction changes in missions, the maximum allowed velocity, etc.

In other words, this topic explains how to tune the parameters that affect the value of a desired setpoint rather than those that affect how well the vehicle tracks the setpoint).

The algorithm that generates those setpoints is called a "trajectory generator".

This guide is for advanced users/experts.

Follow the instructions in the Multicopter PID Tuning Guide before doing any of the tuning described here. Do not use these tuning parameters to fix bad tracking or vibration!


The input to the P/PID controller is a desired setpoint that the vehicle should attempt to track. PID Tuning ("Lower level tuning") aims to reduce the error between the desired setpoint and the estimate of the vehicle state.

The desired setpoint passed to the P/PID controller is itself calculated from a demanded setpoint based on a stick position (in RC modes) or from a mission command. The demanded setpoint can change very quickly (e.g. if a user moves stick from zero to maximum value as a "step"). Vehicle flight characteristics are better if the corresponding desired setpoint changes as a "ramp".

Setpoint value tuning ("higher level tuning") is used to specify the mapping between the demanded and the desired setpoints - i.e. defining the "ramp" at which the desired setpoint follows the demanded setpoint.

Poorly tuned P/PID Gains can lead to instability. Poorly tuned setpoint values cannot result in instability, but may result in either very jerky or very unresponsive reactions to setpoint changes.

Flight Modes Trajectory Support

Mission mode used the Jerk-limited trajectory all the time.

Position mode supports all the trajectory types listed below. It uses the Jerk-limited trajectory by default; the other types can be set using MPC_POS_MODE.

Altitude mode similarly uses the trajectory types selected by MPC_POS_MODE, but only for smoothing the vertical component (i.e. when controlling the altitude).

No other modes support trajectory tuning.

Trajectory Implementations

The following list provides an overview of the different trajectory implementations:

  • Jerk-limited (Default)
    • Used when smooth motion is required (e.g.: filming, mapping, cargo).
    • Generates symmetric smooth S-curves where the jerk and acceleration limits are always guaranteed.
    • May not be suitable for vehicles/use-cases that require a faster response - e.g. racer quads.
    • Set in position mode using MPC_POS_MODE=3.
  • Slew-rate
    • Used when quick response is more important than smooth motion (e.g.: aggressive flight with position hold).
    • This is a simple implementation where the jerk and acceleration is limited using slew-rates.
    • It allows asymmetric profiles based on user intention (smooth acceleration and quick stop).
    • The jerk and acceleration limits are not hard constraints.
    • Set in position mode using MPC_POS_MODE=1.
  • Simple position control
    • Sticks map directly to velocity setpoints without smoothing.
    • Useful for velocity control tuning.
    • Set in position mode using MPC_POS_MODE=0.
© PX4 Dev Team. License: CC BY 4.0            Updated: 2024-02-13 22:49:01

results matching ""

    No results matching ""