mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-16 06:03:34 +08:00
docs: auto-sync metadata [skip ci]
Co-Authored-By: PX4 BuildBot <bot@px4.io>
This commit is contained in:
@@ -13,24 +13,24 @@ The diagrams use the standard [PX4 notation](../contribute/notation.md) (and eac
|
||||
|
||||

|
||||
|
||||
* This is a standard cascaded control architecture.
|
||||
* The controllers are a mix of P and PID controllers.
|
||||
* Estimates come from [EKF2](../advanced_config/tuning_the_ecl_ekf.md).
|
||||
* Depending on the mode, the outer (position) loop is bypassed (shown as a multiplexer after the outer loop).
|
||||
- This is a standard cascaded control architecture.
|
||||
- The controllers are a mix of P and PID controllers.
|
||||
- Estimates come from [EKF2](../advanced_config/tuning_the_ecl_ekf.md).
|
||||
- Depending on the mode, the outer (position) loop is bypassed (shown as a multiplexer after the outer loop).
|
||||
The position loop is only used when holding position or when the requested velocity in an axis is null.
|
||||
|
||||
### Multicopter Angular Rate Controller
|
||||
|
||||

|
||||
|
||||
* K-PID controller. See [Rate Controller](../config_mc/pid_tuning_guide_multicopter.md#rate-controller) for more information.
|
||||
* The integral authority is limited to prevent wind up.
|
||||
* The outputs are limited (in the control allocation module), usually at -1 and 1.
|
||||
* A Low Pass Filter (LPF) is used on the derivative path to reduce noise (the gyro driver provides a filtered derivative to the controller).
|
||||
- K-PID controller. See [Rate Controller](../config_mc/pid_tuning_guide_multicopter.md#rate-controller) for more information.
|
||||
- The integral authority is limited to prevent wind up.
|
||||
- The outputs are limited (in the control allocation module), usually at -1 and 1.
|
||||
- A Low Pass Filter (LPF) is used on the derivative path to reduce noise (the gyro driver provides a filtered derivative to the controller).
|
||||
|
||||
::: info
|
||||
The IMU pipeline is:
|
||||
gyro data > apply calibration parameters > remove estimated bias > notch filter (`IMU_GYRO_NF0_BW` and `IMU_GYRO_NF0_FRQ`) > low-pass filter (`IMU_GYRO_CUTOFF`) > vehicle_angular_velocity (*filtered angular rate used by the P and I controllers*) > derivative -> low-pass filter (`IMU_DGYRO_CUTOFF`) > vehicle_angular_acceleration (*filtered angular acceleration used by the D controller*)
|
||||
gyro data > apply calibration parameters > remove estimated bias > notch filter (`IMU_GYRO_NF0_BW` and `IMU_GYRO_NF0_FRQ`) > low-pass filter (`IMU_GYRO_CUTOFF`) > vehicle_angular_velocity (_filtered angular rate used by the P and I controllers_) > derivative -> low-pass filter (`IMU_DGYRO_CUTOFF`) > vehicle_angular_acceleration (_filtered angular acceleration used by the D controller_)
|
||||
|
||||

|
||||
:::
|
||||
@@ -41,51 +41,51 @@ The diagrams use the standard [PX4 notation](../contribute/notation.md) (and eac
|
||||
|
||||

|
||||
|
||||
* The attitude controller makes use of [quaternions](https://en.wikipedia.org/wiki/Quaternion).
|
||||
* The controller is implemented from this [article](https://www.research-collection.ethz.ch/bitstream/handle/20.500.11850/154099/eth-7387-01.pdf).
|
||||
* When tuning this controller, the only parameter of concern is the P gain.
|
||||
* The rate command is saturated.
|
||||
- The attitude controller makes use of [quaternions](https://en.wikipedia.org/wiki/Quaternion).
|
||||
- The controller is implemented from this [article](https://www.research-collection.ethz.ch/bitstream/handle/20.500.11850/154099/eth-7387-01.pdf).
|
||||
- When tuning this controller, the only parameter of concern is the P gain.
|
||||
- The rate command is saturated.
|
||||
|
||||
### Multicopter Acceleration to Thrust and Attitude Setpoint Conversion
|
||||
|
||||
* The acceleration setpoints generated by the velocity controller will be converted to thrust and attitude setpoints.
|
||||
* Converted acceleration setpoints will be saturated and prioritized in vertical and horizontal thrust.
|
||||
* Thrust saturation is done after computing the corresponding thrust:
|
||||
1. Compute required vertical thrust (`thrust_z`)
|
||||
1. Saturate `thrust_z` with `MPC_THR_MAX`
|
||||
1. Saturate `thrust_xy` with `(MPC_THR_MAX^2 - thrust_z^2)^0.5`
|
||||
|
||||
Implementation details can be found in `PositionControl.cpp` and `ControlMath.cpp`.
|
||||
- The acceleration setpoints generated by the velocity controller will be converted to thrust and attitude setpoints.
|
||||
- Converted acceleration setpoints will be saturated and prioritized in vertical and horizontal thrust.
|
||||
- Thrust saturation is done after computing the corresponding thrust:
|
||||
1. Compute required vertical thrust (`thrust_z`)
|
||||
1. Saturate `thrust_z` with `MPC_THR_MAX`
|
||||
1. Saturate `thrust_xy` with `(MPC_THR_MAX^2 - thrust_z^2)^0.5`
|
||||
|
||||
Implementation details can be found in `PositionControl.cpp` and `ControlMath.cpp`.
|
||||
|
||||
### Multicopter Velocity Controller
|
||||
|
||||

|
||||
|
||||
* PID controller to stabilise velocity. Commands an acceleration.
|
||||
* The integrator includes an anti-reset windup (ARW) using a clamping method.
|
||||
* The commanded acceleration is NOT saturated - a saturation will be applied to the converted thrust setpoints in combination with the maximum tilt angle.
|
||||
* Horizontal gains set via parameter `MPC_XY_VEL_P_ACC`, `MPC_XY_VEL_I_ACC` and `MPC_XY_VEL_D_ACC`.
|
||||
* Vertical gains set via parameter `MPC_Z_VEL_P_ACC`, `MPC_Z_VEL_I_ACC` and `MPC_Z_VEL_D_ACC`.
|
||||
- PID controller to stabilise velocity. Commands an acceleration.
|
||||
- The integrator includes an anti-reset windup (ARW) using a clamping method.
|
||||
- The commanded acceleration is NOT saturated - a saturation will be applied to the converted thrust setpoints in combination with the maximum tilt angle.
|
||||
- Horizontal gains set via parameter `MPC_XY_VEL_P_ACC`, `MPC_XY_VEL_I_ACC` and `MPC_XY_VEL_D_ACC`.
|
||||
- Vertical gains set via parameter `MPC_Z_VEL_P_ACC`, `MPC_Z_VEL_I_ACC` and `MPC_Z_VEL_D_ACC`.
|
||||
|
||||
### Multicopter Position Controller
|
||||
|
||||

|
||||
|
||||
* Simple P controller that commands a velocity.
|
||||
* The commanded velocity is saturated to keep the velocity in certain limits. See parameter `MPC_XY_VEL_MAX`. This parameter sets the maximum possible horizontal velocity. This differs from the maximum **desired** speed `MPC_XY_CRUISE` (autonomous modes) and `MPC_VEL_MANUAL` (manual position control mode).
|
||||
* Horizontal P gain set via parameter `MPC_XY_P`.
|
||||
* Vertical P gain set via parameter `MPC_Z_P`.
|
||||
|
||||
- Simple P controller that commands a velocity.
|
||||
- The commanded velocity is saturated to keep the velocity in certain limits. See parameter `MPC_XY_VEL_MAX`. This parameter sets the maximum possible horizontal velocity. This differs from the maximum **desired** speed `MPC_XY_CRUISE` (autonomous modes) and `MPC_VEL_MANUAL` (manual position control mode).
|
||||
- Horizontal P gain set via parameter `MPC_XY_P`.
|
||||
- Vertical P gain set via parameter `MPC_Z_P`.
|
||||
|
||||
#### Combined Position and Velocity Controller Diagram
|
||||
|
||||

|
||||
|
||||
* Mode dependent feedforwards (ff) - e.g. Mission mode trajectory generator (jerk-limited trajectory) computes position, velocity and acceleration setpoints.
|
||||
* Acceleration setpoints (inertial frame) will be transformed (with yaw setpoint) into attitude setpoints (quaternion) and collective thrust setpoint.
|
||||
- Mode dependent feedforwards (ff) - e.g. Mission mode trajectory generator (jerk-limited trajectory) computes position, velocity and acceleration setpoints.
|
||||
- Acceleration setpoints (inertial frame) will be transformed (with yaw setpoint) into attitude setpoints (quaternion) and collective thrust setpoint.
|
||||
|
||||
<!-- The drawing is on draw.io: https://drive.google.com/open?id=13Mzjks1KqBiZZQs15nDN0r0Y9gM_EjtX
|
||||
Request access from dev team. -->
|
||||
|
||||
## Fixed-Wing Position Controller
|
||||
|
||||
### Total Energy Control System (TECS)
|
||||
@@ -117,7 +117,6 @@ An increase in pitch angle transfers kinetic to potential energy and a negative
|
||||
The control problem was therefore decoupled by transforming the initial setpoints into energy quantities which can be controlled independently.
|
||||
We use thrust to regulate the specific total energy of the vehicle and pitch maintain a specific balance between potential (height) and kinetic (speed) energy.
|
||||
|
||||
|
||||
#### Total energy control loop
|
||||
|
||||

|
||||
@@ -130,7 +129,6 @@ We use thrust to regulate the specific total energy of the vehicle and pitch mai
|
||||
|
||||
<!-- The drawing is on draw.io: https://drive.google.com/file/d/1bZtFULYmys-_EQNhC9MNcKLFauc7OYJZ/view -->
|
||||
|
||||
|
||||
The total energy of an aircraft is the sum of kinetic and potential energy:
|
||||
|
||||
$$E_T = \frac{1}{2} m V_T^2 + m g h$$
|
||||
@@ -178,7 +176,7 @@ The angular position of the control effectors (ailerons, elevators, rudders, ...
|
||||
Furthermore, since the control surfaces are more effective at high speed and less effective at low speed, the controller - tuned for cruise speed - is scaled using the airspeed measurements (if such a sensor is used).
|
||||
|
||||
::: info
|
||||
If no airspeed sensor is used then gain scheduling for the FW attitude controller is disabled (it's open loop); no correction is/can be made in TECS using airspeed feedback.
|
||||
If no airspeed sensor is used then gain scheduling for the FW attitude controller is disabled (it's open loop); no correction is/can be made in TECS using airspeed feedback.
|
||||
:::
|
||||
|
||||
The feedforward gain is used to compensate for aerodynamic damping.
|
||||
@@ -188,14 +186,12 @@ In order to keep a constant rate, this damping can be compensated using feedforw
|
||||
### Turn coordination
|
||||
|
||||
The roll and pitch controllers have the same structure and the longitudinal and lateral dynamics are assumed to be uncoupled enough to work independently.
|
||||
The yaw controller, however, generates its yaw rate setpoint using the turn coordination constraint in order to minimize lateral acceleration, generated when the aircraft is slipping. The turn coordination algorithm is based solely on coordinated turn geometry calculation.
|
||||
The yaw controller, however, generates its yaw rate setpoint using the turn coordination constraint in order to minimize lateral acceleration, generated when the aircraft is slipping. The turn coordination algorithm is based solely on coordinated turn geometry calculation.
|
||||
|
||||
$$\dot{\Psi}_{sp} = \frac{g}{V_T} \tan{\phi_{sp}} \cos{\theta_{sp}}$$
|
||||
|
||||
The yaw rate controller also helps to counteract [adverse yaw effects](https://youtu.be/sNV_SDDxuWk) and to damp the [Dutch roll mode](https://en.wikipedia.org/wiki/Dutch_roll) by providing extra directional damping.
|
||||
|
||||
|
||||
|
||||
## VTOL Flight Controller
|
||||
|
||||

|
||||
@@ -212,12 +208,11 @@ The inputs into this block are called "virtual" as, depending on the current VTO
|
||||
For a standard and tilt-rotor VTOL, during transition the fixed-wing attitude controller produces the rate setpoints, which are then fed into the separate rate controllers, resulting in torque commands for the multicopter and fixed-wing actuators.
|
||||
For tailsitters, during transition the multicopter attitude controller is running.
|
||||
|
||||
The outputs of the VTOL attitude block are separate torque and force commands for the multicopter and fixed-wing actuators (two instances for `vehicle_torque_setpoint` and `vehicle_thrust_setpoint`).
|
||||
The outputs of the VTOL attitude block are separate torque and force commands for the multicopter and fixed-wing actuators (two instances for `vehicle_torque_setpoint` and `vehicle_thrust_setpoint`).
|
||||
These are handled in an airframe-specific control allocation class.
|
||||
|
||||
For more information on the tuning of the transition logic inside the VTOL block, see [VTOL Configuration](../config_vtol/index.md).
|
||||
|
||||
|
||||
### Airspeed Scaling
|
||||
|
||||
The objective of this section is to explain with the help of equations why and how the output of the rate PI and feedforward (FF) controllers can be scaled with airspeed to improve the control performance.
|
||||
|
||||
Reference in New Issue
Block a user