# 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. (i.e. 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".

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!

## 综述

P/PID控制器的输入是飞行器尝试跟踪的期望设定值PID调参 ("低级"调参) 的目标是减小设定值和估计值之间的误差。 较小的PID增益将导致飞行器的不稳定

The setpoint-value tuning parameters can be split into two groups: tuning parameters for position mode and tuning parameters for mission mode. 某些参数将同时对两种模式产生影响。

## Definitions

The position controller (diagram here) consists of an outer P position-control loop and an inner PID velocity-control loop. 根据 飞行模式, 两个回路都是活动的, 或者只有速度控制回路是活动的。

## Implementations

Two different implementations are available for each mode and can be selected using the parameters MPC_POS_MODE and MPC_AUTO_MODE.

• Slew-rate (MPC_POS_MODE=1, MPC_POS_MODE=2, MPC_AUTO_MODE=0) - Used when quick response is more important than smooth motion (e.g.: inspection, aggressive flight with position hold, fast missions).

• This is a simple implementation where the jerk and acceleration is limited using slew-rates.
• In manual mode, it allows asymmetric profiles based on user intention (smooth acceleration and quick stop).
• The jerk and acceleration limits are not hard constraints.
• Jerk-limited (MPC_POS_MODE=3, MPC_AUTO_MODE=1) - 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.

The jerk-limited (smooth) type is used by default for all frames in both manual and auto modes; this may not be suitable for vehicles/use-cases that require a faster response - e.g. racer quads.