mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-27 02:33:34 +08:00
Move PX4 Guide source into /docs (#24490)
* Add vitepress tree * Update existing workflows so they dont trigger on changes in the docs path * Add nojekyll, package.json, LICENCE etc * Add crowdin docs upload/download scripts * Add docs flaw checker workflows * Used docs prefix for docs workflows * Crowdin obvious fixes * ci: docs move to self hosted runner runs on a beefy server for faster builds Signed-off-by: Ramon Roche <mrpollo@gmail.com> * ci: don't run build action for docs or ci changes Signed-off-by: Ramon Roche <mrpollo@gmail.com> * ci: update runners Signed-off-by: Ramon Roche <mrpollo@gmail.com> * Add docs/en * Add docs assets and scripts * Fix up editlinks to point to PX4 sources * Download just the translations that are supported * Add translation sources for zh, uk, ko * Update latest tranlsation and uorb graphs * update vitepress to latest --------- Signed-off-by: Ramon Roche <mrpollo@gmail.com> Co-authored-by: Ramon Roche <mrpollo@gmail.com>
This commit is contained in:
co-authored by
Ramon Roche
parent
8e6d2ebe4a
commit
88d623bedb
@@ -0,0 +1,36 @@
|
||||
# 飞控方向的高级调参
|
||||
|
||||
方向和水平可以用参数手动调整,以校正传感器板的小误差或者校准误差。
|
||||
|
||||
If there is a persistent drift bias (often seen in multirotors but not limited to them), it is a good strategy to trim it with the help of these fine-tuning offset angle parameters, instead of using the trimmers of your RC Transmitter.
|
||||
对于基本设置,请遵循下面链接的说明:
|
||||
|
||||
:::info
|
||||
These instructions are "advanced", and not recommended for regular users (the broad tuning is generally sufficient).
|
||||
:::
|
||||
|
||||
## 方向参数设置
|
||||
|
||||
The [SENS_BOARD_ROT](../advanced_config/parameter_reference.md#SENS_BOARD_ROT) parameter defines the rotation of the flight controller board relative to the vehicle frame, while the fine tuning offsets ([SENS_BOARD_X_OFF](../advanced_config/parameter_reference.md#SENS_BOARD_X_OFF), [SENS_BOARD_Y_OFF](../advanced_config/parameter_reference.md#SENS_BOARD_Y_OFF), [SENS_BOARD_Z_OFF](../advanced_config/parameter_reference.md#SENS_BOARD_Z_OFF)) set the rotation of the sensors relative to the board itself.
|
||||
The fine tuning offsets are added to the `SENS_BOARD_ROT` angle in order to determine the total offset angles for the Yaw, Pitch and Roll orientation of the flight controller.
|
||||
|
||||
First perform the normal calibration for [Flight Controller Orientation](../config/flight_controller_orientation.md) and [Level Horizon Calibration](../config/level_horizon_calibration.md) to set the [SENS_BOARD_ROT](../advanced_config/parameter_reference.md#SENS_BOARD_ROT) parameter.
|
||||
|
||||
The other parameters can then be set in order to fine-tune the orientation of the IMU sensors relative to the board itself.
|
||||
|
||||
You can locate the parameters in QGroundControl as shown below:
|
||||
|
||||
1. Open QGroundControl menu: **Settings > Parameters > Sensor Calibration**.
|
||||
2. The parameters as located in the section as shown below (or you can search for them):
|
||||
|
||||

|
||||
|
||||
## Parameter Summary
|
||||
|
||||
- [SENS_BOARD_ROT](../advanced_config/parameter_reference.md#SENS_BOARD_ROT): Rotation of the FMU board relative to the vehicle frame.
|
||||
- [SENS_BOARD_X_OFF](../advanced_config/parameter_reference.md#SENS_BOARD_X_OFF): Rotation, in degrees, around PX4FMU's X axis or Roll axis.
|
||||
Positive angles increase in CCW direction, negative angles increase in CW direction.
|
||||
- [SENS_BOARD_Y_OFF](../advanced_config/parameter_reference.md#SENS_BOARD_Y_OFF): Rotation, in degrees, around PX4FMU's Y axis or Pitch axis.
|
||||
Positive angles increase in CCW direction, negative angles increase in CW direction.
|
||||
- [SENS_BOARD_Z_OFF](../advanced_config/parameter_reference.md#SENS_BOARD_Z_OFF): Rotation, in degrees, around PX4FMU's Z axis Yaw axis.
|
||||
Positive angles increase in CCW direction, negative angles increase in CW direction.
|
||||
@@ -0,0 +1,205 @@
|
||||
# Bootloader 更新
|
||||
|
||||
The _PX4 Bootloader_ is used to load firmware for [Pixhawk boards](../flight_controller/pixhawk_series.md) (PX4FMU, PX4IO).
|
||||
|
||||
Pixhawk控制器通常预安装了适当的引导程序。
|
||||
但在某些情况下,当它不存在,或者有一个的旧版本需要更新。
|
||||
|
||||
此篇介绍了更新 Pixhawk bootloader 的几种常见方法。
|
||||
|
||||
::: info
|
||||
|
||||
- Most boards will need to use the [Debug Probe](#debug-probe-bootloader-update) to update the bootloader.
|
||||
- On [FMUv6X-RT](../flight_controller/pixhawk6x-rt.md) you can [install bootloader/unbrick boards via USB](bootloader_update_v6xrt.md).
|
||||
This is useful if you don't have a debug probe.
|
||||
- On FMUv2 and some custom firmware (only) you can use [QGC Bootloader Update](#qgc-bootloader-update).
|
||||
|
||||
:::
|
||||
|
||||
## 构建PX4 启动加载器
|
||||
|
||||
### PX4 Bootloader FMUv6X and later
|
||||
|
||||
从FMUv6X (STM32H7)的板子开始,使用代码树内的 PX4 bootloader。
|
||||
|
||||
This can be built from within the [PX4-Autopilot](https://github.com/PX4/PX4-Autopilot) directory using the `make` command and the board-specific target with a `_bootloader` suffix.
|
||||
|
||||
对于FMUv6X,命令是:
|
||||
|
||||
```sh
|
||||
make px4_fmu-v6x_bootloader
|
||||
```
|
||||
|
||||
This will build the bootloader binary as `build/px4_fmu-v6x_bootloader/px4_fmu-v6x_bootloader.elf`, which can be flashed via SWD or DFU.
|
||||
如果你正准备构建 bootloader,你应该已经熟悉这些选项之一。
|
||||
|
||||
如果需要 HEX 文件而不是 ELF 文件,请使用 objcopy 参数:
|
||||
|
||||
```sh
|
||||
arm-none-eabi-objcopy -O ihex build/px4_fmu-v6x_bootloader/px4_fmu-v6x_bootloader.elf px4_fmu-v6x_bootloader.hex
|
||||
```
|
||||
|
||||
### PX4 Bootloader FMUv5X and earlier
|
||||
|
||||
PX4 boards up to FMUv5X (before STM32H7) used the [PX4 bootloader](https://github.com/PX4/Bootloader) repository.
|
||||
|
||||
The instructions in the repo README explain how to use it.
|
||||
|
||||
## 构建旧的 PX4 启动加载器
|
||||
|
||||
The following steps explain how you can "manually" update the bootloader using a [compatible Debug Probe](../debug/swd_debug.md#debug-probes-for-px4-hardware):
|
||||
|
||||
1. Get a binary containing the bootloader (either from dev team or [build it yourself](#building-the-px4-bootloader)).
|
||||
|
||||
2. Get a [Debug Probe](../debug/swd_debug.md#debug-probes-for-px4-hardware).
|
||||
Connect the probe your PC via USB and setup the `gdbserver`.
|
||||
|
||||
3. Go into the directory containing the binary and run the command for your target bootloader in the terminal:
|
||||
|
||||
- FMUv6X
|
||||
|
||||
```sh
|
||||
arm-none-eabi-gdb px4_fmu-v6x_bootloader.elf
|
||||
```
|
||||
|
||||
- FMUv6X-RT
|
||||
|
||||
```sh
|
||||
arm-none-eabi-gdb px4_fmu-v6xrt_bootloader.elf
|
||||
```
|
||||
|
||||
- FMUv5
|
||||
|
||||
```sh
|
||||
```
|
||||
|
||||
::: info
|
||||
H7 Bootloaders from [PX4/PX4-Autopilot](https://github.com/PX4/PX4-Autopilot) are named with pattern `*._bootloader.elf`.
|
||||
Bootloaders from [PX4/PX4-Bootloader](https://github.com/PX4/PX4-Bootloader) are named with the pattern `*_bl.elf`.
|
||||
|
||||
:::
|
||||
|
||||
4. The _gdb terminal_ appears and it should display the following output:
|
||||
|
||||
```sh
|
||||
GNU gdb (GNU Tools for Arm Embedded Processors 7-2017-q4-major) 8.0.50.20171128-git
|
||||
Copyright (C) 2017 Free Software Foundation, Inc.
|
||||
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
|
||||
This is free software: you are free to change and redistribute it.
|
||||
There is NO WARRANTY, to the extent permitted by law.
|
||||
Type "show copying" and "show warranty" for details.
|
||||
This GDB was configured as "--host=x86_64-linux-gnu --target=arm-none-eabi".
|
||||
Type "show configuration" for configuration details.
|
||||
For bug reporting instructions, please see:
|
||||
<http://www.gnu.org/software/gdb/bugs/>.
|
||||
Find the GDB manual and other documentation resources online at:
|
||||
<http://www.gnu.org/software/gdb/documentation/>.
|
||||
For help, type "help".
|
||||
Type "apropos word" to search for commands related to "word"...
|
||||
Reading symbols from px4fmuv5_bl.elf...done.
|
||||
```
|
||||
|
||||
5. Find your `<dronecode-probe-id>` by running an `ls` command in the **/dev/serial/by-id** directory.
|
||||
|
||||
6. Now connect to the debug probe with the following command:
|
||||
|
||||
```sh
|
||||
tar ext /dev/serial/by-id/<dronecode-probe-id>
|
||||
```
|
||||
|
||||
7. Power on the Pixhawk with another USB cable and connect the probe to the `FMU-DEBUG` port.
|
||||
|
||||
::: info
|
||||
If using a Dronecode probe you may need to remove the case in order to connect to the `FMU-DEBUG` port (e.g. on Pixhawk 4 you would do this using a T6 Torx screwdriver).
|
||||
|
||||
:::
|
||||
|
||||
8. Use the following command to scan for the Pixhawk\`s SWD and connect to it:
|
||||
|
||||
```sh
|
||||
(gdb) mon swdp_scan
|
||||
(gdb) attach 1
|
||||
```
|
||||
|
||||
9. 将二进制文件加载到 Pixhawk 中 :
|
||||
|
||||
```sh
|
||||
(gdb) load
|
||||
```
|
||||
|
||||
After the bootloader has updated you can [Load PX4 Firmware](../config/firmware.md) using _QGroundControl_.
|
||||
|
||||
## QGC 引导加载器更新
|
||||
|
||||
The easiest approach is to first use _QGroundControl_ to install firmware that contains the desired/latest bootloader.
|
||||
You can then initiate bootloader update on next restart by setting the parameter: [SYS_BL_UPDATE](../advanced_config/parameter_reference.md#SYS_BL_UPDATE).
|
||||
|
||||
This approach can only be used if [SYS_BL_UPDATE](../advanced_config/parameter_reference.md#SYS_BL_UPDATE) is present in firmware.
|
||||
|
||||
:::warning
|
||||
Currently only FMUv2 and some custom firmware includes the desired bootloader.
|
||||
:::
|
||||
|
||||
步骤如下:
|
||||
|
||||
1. 插入 SD 卡(使能引导日志记录,便于调试任何可能的问题)。
|
||||
|
||||
2. [Update the Firmware](../config/firmware.md#custom) with an image containing the new/desired bootloader.
|
||||
|
||||
::: info
|
||||
The updated bootloader might be supplied in custom firmware (i.e. from the dev team), or it or may be included in the latest main branch.
|
||||
|
||||
:::
|
||||
|
||||
3. 等待飞控重启。
|
||||
|
||||
4. [Find and enable](../advanced_config/parameters.md) the parameter [SYS_BL_UPDATE](../advanced_config/parameter_reference.md#SYS_BL_UPDATE).
|
||||
|
||||
5. 重新启动(断开/重新连接飞控板)。
|
||||
Bootloader 更新只需要几秒钟即可完成。
|
||||
|
||||
Generally at this point you may then want to [update the firmware](../config/firmware.md) again using the correct/newly installed bootloader.
|
||||
|
||||
以下是更新FMUv2引导程序的一个具体例子。
|
||||
|
||||
### FMUv2 引导加载器更新
|
||||
|
||||
If _QGroundControl_ installs the FMUv2 target (see console during installation), and you have a newer board, you may need to update the bootloader in order to access all the memory on your flight controller.
|
||||
|
||||
:::info
|
||||
Early FMUv2 [Pixhawk-series](../flight_controller/pixhawk_series.md#fmu_versions) flight controllers had a [hardware issue](../flight_controller/silicon_errata.md#fmuv2-pixhawk-silicon-errata) that restricted them to using 1MB of flash memory.
|
||||
这个问题已在新版面解决, 但您可能需要更新工厂提供的引导程序,以便安装 FMUv3 固件并访问所有 2MB 可用内存。
|
||||
:::
|
||||
|
||||
要更新引导器:
|
||||
|
||||
1. 插入 SD 卡(使能引导日志记录,便于调试任何可能的问题)。
|
||||
|
||||
2. [Update the Firmware](../config/firmware.md) to PX4 _master_ version (when updating the firmware, check **Advanced settings** and then select **Developer Build (master)** from the dropdown list).
|
||||
_QGroundControl_ will automatically detect that the hardware supports FMUv2 and install the appropriate Firmware.
|
||||
|
||||

|
||||
|
||||
等待飞控重启。
|
||||
|
||||
3. [Find and enable](../advanced_config/parameters.md) the parameter [SYS_BL_UPDATE](../advanced_config/parameter_reference.md#SYS_BL_UPDATE).
|
||||
|
||||
4. 重新启动(断开/重新连接飞控板)。
|
||||
Bootloader 更新只需要几秒钟即可完成。
|
||||
|
||||
5. Then [Update the Firmware](../config/firmware.md) again.
|
||||
This time _QGroundControl_ should autodetect the hardware as FMUv3 and update the Firmware appropriately.
|
||||
|
||||

|
||||
|
||||
::: info
|
||||
If the hardware has the [Silicon Errata](../flight_controller/silicon_errata.md#fmuv2-pixhawk-silicon-errata) it will still be detected as FMUv2 and you will see that FMUv2 was re-installed (in console).
|
||||
在这种情况下,您将无法安装 FMUv3 硬件。
|
||||
|
||||
:::
|
||||
|
||||
## 其他飞控板(非 Pixhawk)
|
||||
|
||||
Boards that are not part of the [Pixhawk Series](../flight_controller/pixhawk_series.md) will have their own mechanisms for bootloader update.
|
||||
|
||||
For boards that are preflashed with Betaflight, see [Bootloader Flashing onto Betaflight Systems](bootloader_update_from_betaflight.md).
|
||||
@@ -0,0 +1,136 @@
|
||||
# PX4 Bootloader Flashing onto Betaflight Systems
|
||||
|
||||
This page documents how to flash the PX4 bootloader onto boards that are already flashed with Betaflight (e.g. [OmnibusF4 SD](../flight_controller/omnibus_f4_sd.md) or [Kakute F7](../flight_controller/kakutef7.md)).
|
||||
|
||||
There are three tools that can be used to flash the PX4 bootloader: _Betaflight Configurator_, [dfu-util](http://dfu-util.sourceforge.net/) command line tool, or the graphical [dfuse](https://www.st.com/en/development-tools/stsw-stm32080.html) (Windows only).
|
||||
|
||||
:::info
|
||||
The _Betaflight Configurator_ is easiest, but newer versions may not support non-betaflight bootloader update.
|
||||
You might try it first, but use the other methods if firmware update does not work.
|
||||
:::
|
||||
|
||||
## Betaflight Configurator Bootloader Update
|
||||
|
||||
:::info
|
||||
_Betaflight Configurator_ may not support PX4 Bootloader update, as of May 2023.
|
||||
Older versions should work, though the precise versions are not known.
|
||||
:::
|
||||
|
||||
To install the PX4 bootloader using the _Betaflight Configurator_:
|
||||
|
||||
1. Download or build [bootloader firmware](#bootloader-firmware) for the board you want to flash.
|
||||
|
||||
2. Download the [Betaflight Configurator](https://github.com/betaflight/betaflight-configurator/releases) for your platform.
|
||||
|
||||
:::tip
|
||||
If using the _Chrome_ web browser, a simple cross-platform alternative is to install the configurator as an [extension from here](https://chrome.google.com/webstore/detail/betaflight-configurator/kdaghagfopacdngbohiknlhcocjccjao).
|
||||
|
||||
:::
|
||||
|
||||
3. 将飞控板连接到 PC 并启动 Betaflight 配置器。
|
||||
|
||||
4. Press the **Load Firmware [Local]** button
|
||||

|
||||
|
||||
5. 从文件系统中选择 bootloader 二进制文件,然后烧写进飞控板的 flash。
|
||||
|
||||
现在,您应当可以在飞控板上安装 PX4 固件了。
|
||||
|
||||
## DFU Bootloader Update
|
||||
|
||||
This section explains how to flash the PX4 bootloader using the [dfu-util](http://dfu-util.sourceforge.net/) or the graphical [dfuse](https://www.st.com/en/development-tools/stsw-stm32080.html) tool (Windows only).
|
||||
|
||||
You will first need to download or build [bootloader firmware](#bootloader-firmware) for the board you want to flash (below, this is referred to as `<target.bin>`).
|
||||
|
||||
:::info
|
||||
All of the methods below are safe as the STM32 MCU cannot be bricked!
|
||||
DFU 不会被烧写覆盖,并且总是允许安装新固件,即便烧写失败。
|
||||
:::
|
||||
|
||||
### DFU mode
|
||||
|
||||
Both tools require the board to be in DFU mode.
|
||||
要进入 DFU 模式, 当将 USB 连接到电脑时按住启动按钮。
|
||||
The button can be released after the board has powered up.
|
||||
|
||||
### dfu-util
|
||||
|
||||
:::info
|
||||
The [Holybro Kakute H7 v2](../flight_controller/kakuteh7v2.md), [Holybro Kakute H7](../flight_controller/kakuteh7.md) and [mini](../flight_controller/kakuteh7mini.md) flight controllers may require that you first run an additional command to erase flash parameters (in order to fix problems with parameter saving):
|
||||
|
||||
```
|
||||
dfu-util -a 0 --dfuse-address 0x08000000:force:mass-erase:leave -D build/<target>/<target>.bin
|
||||
```
|
||||
|
||||
The command may generate an error which can be ignored.
|
||||
Once completed, enter DFU mode again to complete the regular flashing.
|
||||
:::
|
||||
|
||||
To flash the bootloader onto the flight controller:
|
||||
|
||||
```
|
||||
dfu-util -a 0 --dfuse-address 0x08000000 -D build/<target>/<target>.bin
|
||||
```
|
||||
|
||||
重新启动飞控板,并且不要按下启动按钮。
|
||||
|
||||
### dfuse
|
||||
|
||||
The dfuse manual can be found here: https://www.st.com/resource/en/user_manual/cd00155676.pdf
|
||||
|
||||
Use the tool to flash the `<target>.bin` file.
|
||||
|
||||
## Bootloader Firmware
|
||||
|
||||
The tools above flash pre-built bootloader firmware.
|
||||
Bootloader firmware can be built for most targets using the normal PX4 source code, while other targets can only be build using source in the bootloader repository.
|
||||
|
||||
Flight controllers that have bootloader PX4-Autopilot `make` targets, can build the bootloader from the PX4-Autopilot source.
|
||||
The list of controllers for which this applies can be obtained by running the following `make` command, and noting the `make` targets that end in `_bootloader`
|
||||
|
||||
```
|
||||
$make list_config_targets
|
||||
|
||||
...
|
||||
cuav_nora_bootloader
|
||||
cuav_x7pro_bootloader
|
||||
cubepilot_cubeorange_bootloader
|
||||
holybro_durandal-v1_bootloader
|
||||
holybro_kakuteh7_bootloader
|
||||
holybro_kakuteh7v2_bootloader
|
||||
holybro_kakuteh7mini_bootloader
|
||||
matek_h743-mini_bootloader
|
||||
matek_h743-slim_bootloader
|
||||
modalai_fc-v2_bootloader
|
||||
mro_ctrl-zero-classic_bootloader
|
||||
mro_ctrl-zero-h7_bootloader
|
||||
mro_ctrl-zero-h7-oem_bootloader
|
||||
mro_pixracerpro_bootloader
|
||||
px4_fmu-v6u_bootloader
|
||||
px4_fmu-v6x_bootloader
|
||||
```
|
||||
|
||||
To build for these flight controllers, download and build the [PX4-Autopilot source](https://github.com/PX4/PX4-Autopilot), and then make the target using the following commands:
|
||||
|
||||
```sh
|
||||
git clone --recursive https://github.com/PX4/PX4-Autopilot.git
|
||||
cd PX4-Autopilot
|
||||
make <target> # For example: holybro_kakuteh7mini_bootloader
|
||||
```
|
||||
|
||||
For other flight controllers download the [PX4/Bootloader](https://github.com/PX4/Bootloader) repository and build the source code using the appropriate targets:
|
||||
|
||||
```
|
||||
git clone --recursive https://github.com/PX4/Bootloader.git
|
||||
cd Bootloader
|
||||
make <target> # For example: omnibusf4sd_bl or kakutef7_bl
|
||||
```
|
||||
|
||||
## 重新安装 Beatflight 固件
|
||||
|
||||
In order to switch back to _Betaflight_:
|
||||
|
||||
1. Backup the PX4 parameters.
|
||||
You can do this by [exporting](../advanced/parameters_and_configurations.md#exporting-and-loading-parameters) them to an SD card.
|
||||
2. Keep the **bootloader** button pressed while attaching the USB cable
|
||||
3. Flash _Betaflight_ as usual with the _Betaflight-configurator_
|
||||
@@ -0,0 +1,108 @@
|
||||
# Bootloader Update Pixhawk V6X-RT via USB
|
||||
|
||||
This topic explains explains to flash [Pixhawk FMUv6X-RT](../flight_controller/pixhawk6x-rt.md) bootloader via USB _without needing a debug probe_.
|
||||
|
||||
## 综述
|
||||
|
||||
The _PX4 Bootloader_ is used to load firmware for [Pixhawk boards](../flight_controller/pixhawk_series.md) (PX4FMU, PX4IO).
|
||||
|
||||
Pixhawk控制器通常预安装了适当的引导程序。
|
||||
However in some cases it may not be present, or an older version may be present that needs to be updated.
|
||||
It is also possible that the device is bricked, so the device has to be erased and a new bootloader must be flashed.
|
||||
|
||||
Most flight controllers require a Debug probe in order to update the bootloader, as discussed in [Bootloader Update > Debug Probe Bootloader Update](../advanced_config/bootloader_update.md#debug-probe-bootloader-update).
|
||||
You can use this approach for the Pixhawk FMUv6X-RT, but if you don't have a debug probe you can use the instructions outlined in this topic instead.
|
||||
|
||||
## Building the PX4 FMUv6X-RT Bootloader
|
||||
|
||||
This can be built from within the PX4-Autopilot folder using the `make` command and the board-specific target with a `_bootloader` suffix.
|
||||
For FMUv6X-RT the command is:
|
||||
|
||||
```sh
|
||||
make px4_fmu-v6xrt_bootloader
|
||||
```
|
||||
|
||||
This will build the bootloader binary as `build/px4_fmu-v6xrt_bootloader/px4_fmu-v6xrt_bootloader.bin`, which can be flashed via SWD or ISP.
|
||||
如果你正准备构建 bootloader,你应该已经熟悉这些选项之一。
|
||||
|
||||
如果需要 HEX 文件而不是 ELF 文件,请使用 objcopy 参数:
|
||||
|
||||
```sh
|
||||
arm-none-eabi-objcopy -O ihex build/px4_fmu-v6xrt_bootloader/px4_fmu-v6xrt_bootloader.elf px4_fmu-v6xrt_bootloader.hex
|
||||
```
|
||||
|
||||
## Flashing the bootloader through USB
|
||||
|
||||
The Pixhawk V6X-RT comes with a build-in bootloader located on the ROM.
|
||||
To flash a new bootloader through USB you've got to download the [NXP MCUXpresso Secure Provisioning tool](https://www.nxp.com/design/design-center/software/development-software/mcuxpresso-software-and-tools-/mcuxpresso-secure-provisioning-tool:MCUXPRESSO-SECURE-PROVISIONING).
|
||||
The tool is available for Windows, Linux and macOS.
|
||||
|
||||
1. Install the _MCUXpresso Secure Provisioning_ application and launch the application:
|
||||
|
||||

|
||||
|
||||
2. On first start you have to create a "New Workspace".
|
||||
Select `i.mX RT11xx` and then select `MIMXRT1176`
|
||||
|
||||

|
||||
|
||||
3. After creating a "New Workspace" click on the **FlexSPI NOR - simplified** button
|
||||
|
||||

|
||||
|
||||
4. On the _Boot Memory Configuration_ window change the "Device type" to `Macronix Octal DDR` and press **OK**.
|
||||
|
||||

|
||||
|
||||
1. On the menu bar select **Tools > Flash Programmer**:
|
||||
|
||||

|
||||
|
||||
2. You should get this pop-up indicating the Pixhawk V6X-RT is not in the "ISP bootloader mode".
|
||||
|
||||

|
||||
|
||||
To get the Pixhawk V6X-RT into "ISP bootloader mode" there are 2 options:
|
||||
|
||||
1. Launch QGC connect the Pixhawk select **Analayze Tools** and then **MAVLINK Console**.
|
||||
On the console type `reboot -i`.
|
||||
This will put the Pixhawk V6X-RT into "ISP bootloader mode"
|
||||
|
||||

|
||||
|
||||
2. If the board is bricked and connecting to QGC is not possible you've open the FMUM module and press the BOOT button (circled in red in the picture below) while powering the board.
|
||||
|
||||
<img src="../../assets/advanced_config/bootloader_6xrt/bootloader_update_v6xrt_enter_isp_button.jpg" style="zoom:67%;" />
|
||||
|
||||
Press **YES** to launch the _Flash Programmer Tool_.
|
||||
|
||||
3. When the Flash Programming has started you get a popup to configure the target memory press **Yes**
|
||||
|
||||

|
||||
|
||||
4. When the Target Memory configuration is succesful you can press the the **Erase All** button
|
||||
|
||||

|
||||
|
||||
5. After erasing the flash press the **Load ...** button and then press the **Browse** button
|
||||
|
||||

|
||||
|
||||
6. Locate the `px4_fmu-v6xrt_bootloader.bin` file and press **Open** and then press on **Load**.
|
||||
|
||||

|
||||
|
||||
7. If the load is successful you should see the "Success: load from file" at the bottom right
|
||||
|
||||

|
||||
|
||||
8. Press the **Write** button to flash the PX4 bootloader
|
||||
|
||||

|
||||
|
||||
1. On success it should show "Success: Write memory 0x30000000 - 0x3XXXXXXX" Note: values might differ due to bootloader changes.
|
||||
|
||||

|
||||
|
||||
Now unplug the Pixhawk V6X-RT and re-power the board.
|
||||
After the bootloader has updated you can [Load PX4 Firmware](../config/firmware.md) using _QGroundControl_.
|
||||
@@ -0,0 +1,83 @@
|
||||
# 指南针动力补偿
|
||||
|
||||
罗盘(磁力计)应该安装在尽可能远离通过大电流的线缆的位置,因为大电流诱发的磁场会干扰罗盘的读数。
|
||||
|
||||
本文解释了如何在不能改变磁航向计安装位置的情况下如何补偿诱发磁场带来的影响。
|
||||
|
||||
:::tip
|
||||
Moving the compass away from power-carrying cables is the easiest and most effective way to fix this issue, because the strength of the magnetic fields decreases quadratically with the distance from the cable.
|
||||
:::
|
||||
|
||||
:::info
|
||||
The process is demonstrated for a multicopter, but is equally valid for other vehicle types.
|
||||
:::
|
||||
|
||||
<a id="when"></a>
|
||||
|
||||
## 本节补偿方法可用的前提
|
||||
|
||||
只有当下述的全部条件都满足时才建议采用功率补偿:
|
||||
|
||||
1. 磁航向计无法远离动力线缆。
|
||||
|
||||
2. There is a strong correlation between the compass readings and the thrust setpoint, and/or the battery current.
|
||||
|
||||

|
||||
|
||||
3. 无人机的线缆都是固定的或不会移动的(当通电的线缆能够移动会导致计算出的补偿参数失效)。
|
||||
|
||||
<a id="how"></a>
|
||||
|
||||
## 如何实现罗盘补偿
|
||||
|
||||
1. 确保无人机运行在支持电源补偿的固件版本上(当前的Master版,或v1.11.0之后的版本)。
|
||||
|
||||
2. Perform the [standard compass calibration](../config/compass.md#compass-calibration).
|
||||
|
||||
3. Set the parameter [SDLOG_MODE](../advanced_config/parameter_reference.md#SDLOG_MODE) to 2 to enable logging of data from boot.
|
||||
|
||||
4. Set the parameter [SDLOG_PROFILE](../advanced_config/parameter_reference.md#SDLOG_PROFILE) checkbox for _Sensor comparison_ (bit 6) to get more data points.
|
||||
|
||||
5. 固定好无人机使其无法移动,然后装好螺旋桨(这样电机可以获得与实际飞行中同样大的电流)。
|
||||
本例中用带子固定了无人机。
|
||||
|
||||

|
||||
|
||||
6. Power the vehicle and switch into [ACRO flight mode](../flight_modes_mc/acro.md) (using this mode ensures the vehicle won't attempt to compensate for movement resulting from the straps).
|
||||
|
||||
- 解锁无人机,然后缓缓将油门推到最大。
|
||||
- 慢慢将油门降到0
|
||||
- 给无人机加锁
|
||||
> <strong x-id="1">Note</strong> 谨慎地进行测试,并密切注意振动情况。
|
||||
|
||||
::: info
|
||||
Perform the test carefully and closely monitor the vibrations.
|
||||
|
||||
:::
|
||||
|
||||
7. Retrieve the ulog and use the python script [mag_compensation.py](https://github.com/PX4/PX4-Autopilot/blob/main/src/modules/sensors/vehicle_magnetometer/mag_compensation/python/mag_compensation.py) to identify the compensation parameters.
|
||||
|
||||
```sh
|
||||
python mag_compensation.py ~/path/to/log/logfile.ulg <type> [--instance <number>]
|
||||
```
|
||||
|
||||
where:
|
||||
|
||||
- `<type>`: `current` or `thrust` (power signal used for compensation)
|
||||
- `--instance <number>` (optional): The number is `0` (default) or `1`, the instance of the current or thrust signal to use.
|
||||
|
||||
::: info
|
||||
If your log does not contain battery current measurements, you will need to comment out the respective lines in the Python script, such that it does the calculation for thrust only.
|
||||
|
||||
:::
|
||||
|
||||
8. 这个脚本将返回基于推力和基于电流的补偿参数,并打印输出到控制台。
|
||||
脚本弹出的数值显示了每个罗盘匹配的程度,以及使用了建议的补偿值后数据将是什么样的。
|
||||
如果有电流测数,那么依据电流补偿通常可以获得更好的结果。这里是一个日志的例子,电流匹配得很好,然而因为不是线性关系推力参数则完全不可用。
|
||||
|
||||

|
||||
|
||||
9. Once the parameters are identified, the power compensation must be enabled by setting [CAL_MAG_COMP_TYP](../advanced_config/parameter_reference.md#CAL_MAG_COMP_TYP) to 1 (when using thrust parameters) or 2 (when using current parameters).
|
||||
此外,还要设置好每个罗盘每个轴的补偿参数值。
|
||||
|
||||

|
||||
@@ -0,0 +1,143 @@
|
||||
# 电调(ESC)校准
|
||||
|
||||
:::info
|
||||
These instructions are only relevant to [PWM ESCs](../peripherals/pwm_escs_and_servo.md) and [OneShot ESCs](../peripherals/oneshot.md).
|
||||
[DShot](../peripherals/dshot.md) and [CAN](../can/index.md) ESCs ([DroneCAN](../dronecan/escs.md)/Cyphal) do not require this kind of calibration.
|
||||
:::
|
||||
|
||||
电子速度控制器(ESC)根据飞行控制器的输入指令(FC)调节电机的速度(和方向)。
|
||||
电调响应的输入范围是可配置的,甚至同一型号的不同电调之间的默认范围也是不同的。
|
||||
|
||||
此校准将使用来自飞行控制器的固定最大值 (2000us) 和最小值 (1000us) PWM 输入更新所有ESC。
|
||||
因此,载具上的所有ESC/电机都将以同样的方式在整个输入范围内响应飞行控制器的输入。
|
||||
|
||||
建议使用此工具校准支持它的所有 PWM/OneShot ESC。
|
||||
|
||||
:::info
|
||||
Calibration is particularly important for low-cost ESC, as they commonly vary a lot in their response to input.
|
||||
|
||||
然而,也建议为高质量的控制员提供这种校准。
|
||||
即使这些都是工厂校准的,而且都应以同样的方式作出反应,但实际上输入范围可能有所不同。
|
||||
例如,如果控制器在离开工厂后被手动校准,它可能不再以同样的方式动作。
|
||||
:::
|
||||
|
||||
:::warning
|
||||
If you want to use an ESC that does not support this calibration, then it must be factory calibrated and respond consistently out of the box.
|
||||
This should be verified using [Actuator Testing](../config/actuators.md#actuator-testing).
|
||||
Jump to the [actuator configuration step (7)](#actuatorconfig_step) (which is still important).
|
||||
:::
|
||||
|
||||
OneShot ESCs should be [configured to use OneShot](../peripherals/oneshot.md#px4-configuration) before calibration. 您应该在更换ESC后校准,即使您先前已校准。
|
||||
|
||||
## 操作前提
|
||||
|
||||
校准序列要求您能够保持飞行控制器的供电,同时手动对ESC进行上电循环。
|
||||
|
||||
如果使用 Pixhawk 飞行控制器,推荐这样做的方式是通过USB单独为飞行控制器提供电力。 并在需要时连接/断开ESC的电池供电。
|
||||
Flight control systems that can't power the autopilot via USB will need a [different approach](#problem_power_module).
|
||||
|
||||
如果电池通过电源模块连接,校准程序可以检测电池连接并用它来驱动校准序列。
|
||||
如果无法检测到电池电力,则根据超时执行校准顺序。
|
||||
|
||||
## 步骤
|
||||
|
||||
校准电调:
|
||||
|
||||
1. 卸下螺旋桨。
|
||||
|
||||
:::warning
|
||||
Never attempt ESC calibration with propellers on!
|
||||
|
||||
The motors _should_ not spin during ESC calibration.
|
||||
但是,如果校准是在ESC 已经供电后开始的,或者如果ESC 对校准序列支持/检测不恰当, 它将响应PWM的输入,以最大速度运行电机。
|
||||
|
||||
:::
|
||||
|
||||
2. Map the ESCs you're calibrating as motors in the vehicle's [Actuator Configuration](../config/actuators.md).
|
||||
只有映射的驱动器才能获得输出,并且只有被映射为电机的ESC将被校准。
|
||||
|
||||
3. 拔下电池,断开ESC电源。
|
||||
飞行控制器必须保持供电,例如将USB连接到地面站。
|
||||
|
||||
4. Open the _QGroundControl_ **Settings > Power**, then press the **Calibrate** button.
|
||||
|
||||

|
||||
|
||||
5. 启动校准序列后,在没有错误的情况下,直接给 ESC供电 (您应该被提示):
|
||||
|
||||

|
||||
|
||||
校准将自动开始:
|
||||
|
||||

|
||||
|
||||
6. 在校准过程中,您应该听到来自ESC的特定模型不同的嘀音,它表明校准的各个步骤。
|
||||
|
||||
校准完成后会提示您。
|
||||
|
||||
<a id="actuatorconfig_step"></a>
|
||||

|
||||
|
||||
7. Go back to the [Actuator Configuration](../config/actuators.md) section.
|
||||
|
||||
在ESC 校准后,所有具有相同(重新)校准的 ESC的电机对同样的输入应以同样的方式动作。 驱动器配置中默认的 PWM 输出设置现在应该能开箱即用。
|
||||
|
||||
你需要确认电机确实正常工作。
|
||||
由于默认配置值已经设置为保守的设置,您可能也希望调整它们以适用于您的特定的 ESC。
|
||||
|
||||
::: info
|
||||
The steps below are similar to those described in [Actuator Configuration > Motor Configuration](../config/actuators.md#motor-configuration).
|
||||
|
||||
:::
|
||||
|
||||
验证以下值:
|
||||
|
||||
- The minimum value for a motor (default: `1100us`) should make the motor spin slowly but reliably, and also spin up reliably after it was stopped.
|
||||
|
||||
You can confirm that a motor spins at minimum (still without propellers) in [Actuator Testing](../config/actuators.md#actuator-testing), by enabling the sliders, and then moving the test output slider for the motor to the first snap position from the bottom.
|
||||
当你将滑块从解锁到最小值时,正确的值应该使电机立即和可靠地旋转。
|
||||
|
||||
要找到“最佳”最小值,请将滑块移动到底部(禁用)。
|
||||
Then increase the PWM output's `disarmed` setting in small increments (e.g. 1025us, 1050us, etc), until the motor starts to spin reliably (it is better to be a little too high than a little too low).
|
||||
Enter this value into the `minimum` setting for all the motor PWM outputs, and restore the `disarmed` output to `1100us`.
|
||||
|
||||
- The maximum value for a motor (default: `1900us`) should be chosen such that increasing the value doesn't make the motor spin any faster.
|
||||
|
||||
You can confirm that the motor spins quickly at the maximum setting in [Actuator Testing](../config/actuators.md#actuator-testing), by moving the associated test output slider to the top position.
|
||||
|
||||
To find the "optimal" maximum value, first move the slider to the bottom (disarmed).
|
||||
Then increase the PWM output's `disarmed` setting to near the default maximum (`1900`) - the motors should spin up.
|
||||
Listen to the tone of the motor as you increase the PWM maximum value for the output in increments (e.g. 1925us, 1950us, etc).
|
||||
The optimal value is found at the point when the sound of the motors does not change as you increase the value of the output.
|
||||
Enter this value into the `maximum` setting for all the motor PWM outputs, and restore the `disarmed` output to `1100us`.
|
||||
|
||||
- The disarmed value for a motor (default: `1000us`) should make the motor stop and stay stopped.
|
||||
|
||||
You can confirm this in [Actuator Testing](../config/actuators.md#actuator-testing) by moving the test output slider to the snap position at the bottom of the slider and observing that the motor does not spin.
|
||||
|
||||
If the ESC spins with the default value of 1000us then the ESC is not properly calibrated.
|
||||
If using an ESC that can't be calibrated, you should reduce the PWM output value for the output to below where the motor does not spin anymore (such as 950us or 900us).
|
||||
|
||||
::: info
|
||||
VTOL and fixed-wing motors do not need any special PWM configuration.
|
||||
With the default PWM configuration they will automatically stop during flight when commanded by the autopilot.
|
||||
|
||||
:::
|
||||
|
||||
## 故障处理
|
||||
|
||||
1. Calibration can state that it has succeeded even when it has failed.
|
||||
|
||||
This happens if you do not power the ESC at the right time, or the ESCs don't support calibration.
|
||||
This occurs because PX4 has no feedback from the ESC to know whether or not calibration was successful.
|
||||
You have to rely on interpreting the beeps during the calibration and subsequent motor tests to know for sure that the calibration worked.
|
||||
|
||||
<a id="problem_power_module"></a>
|
||||
|
||||
2. Calibration cannot be started if you have a power module configured and connected (for safety reasons).
|
||||
|
||||
Unplug power to the ESCs first.
|
||||
If you're blocked because a power module is necessary to keep your flight controller alive, but you can (un)power the ESCs separately, you can temporarily disable the detection of the power module just for the ESC calibration using the parameters [BATn_SOURCE](../advanced_config/parameter_reference.md#BAT1_SOURCE). Once the power module that's powering the autopilot is not detected as battery anymore a timing based calibration is possible.
|
||||
|
||||
3. PX4 will abort calibration (for safety reasons) if the system detects an increase in current consumption immediately after initiating calibration.
|
||||
This requires a power module.
|
||||
@@ -0,0 +1,275 @@
|
||||
# PX4以太网配置
|
||||
|
||||
以太网连接提供了一种快速、可靠和灵活的通信选择,可替代使用USB或其他串行连接。
|
||||
|
||||
它可以用于连接地面站、机载计算机和其他MAVLink系统。
|
||||
特别建议使用它连接到"原生"使用以太网的系统——例如IP数传。
|
||||
|
||||
本主题涵盖:
|
||||
|
||||
- [PX4 Ethernet Setup](#px4-ethernet-setup)
|
||||
- [Supported Flight Controllers](#supported-flight-controllers)
|
||||
- [Setting up the Ethernet Network](#setting-up-the-ethernet-network)
|
||||
- [PX4 Ethernet Network Setup](#px4-ethernet-network-setup)
|
||||
- [Ubuntu Ethernet Network Setup](#ubuntu-ethernet-network-setup)
|
||||
- [Companion Computer Ethernet Network Setup](#companion-computer-ethernet-network-setup)
|
||||
- [PX4 MAVLink Serial Port Configuration](#px4-mavlink-serial-port-configuration)
|
||||
- [QGroundControl Setup Example](#qgroundcontrol-setup-example)
|
||||
- [MAVSDK-Python Setup Example](#mavsdk-python-setup-example)
|
||||
- [ROS 2 Setup Example](#ros-2-setup-example)
|
||||
|
||||
## 支持的飞行控制器
|
||||
|
||||
PX4 supports Ethernet connectivity on [Pixhawk 5X-standard](https://github.com/pixhawk/Pixhawk-Standards/blob/master/DS-011%20Pixhawk%20Autopilot%20v5X%20Standard.pdf) flight controllers (and later) that have an Ethernet port.
|
||||
可能也支持其他板子。
|
||||
|
||||
支持的飞行控制器包括:
|
||||
|
||||
- [CUAV Pixhawk V6X](../flight_controller/cuav_pixhawk_v6x.md)
|
||||
- [Holybro Pixhawk 5X](../flight_controller/pixhawk5x.md)
|
||||
- [Holybro Pixhawk 6X](../flight_controller/pixhawk6x.md)
|
||||
- [RaccoonLab FMUv6X Autopilot](../flight_controller/raccoonlab_fmu6x.md)
|
||||
|
||||
## 设置以太网网络
|
||||
|
||||
要通过以太网连接系统,您需要将它们连接到同一个网络,以便每个系统有一个唯一的IP地址并且可以找到其他系统。
|
||||
可以使用DHCP服务器来分配地址,或者通过手动配置网络上每个系统的地址来完成。
|
||||
|
||||
我们不能提供一个确保可以在您的本地网络中工作的“开箱即用配置”。
|
||||
Therefore as an example of the kind of configuration you might do, below we show how to set up the systems on an IP network with static addresses in the range `10.41.10.Xxx`, where PX4 has a statically allocated address `10.41.10.2` (PX4-default) and the computer has address `10.41.10.1`.
|
||||
如果您想要连接一台机载计算机或其他系统到网络上,您可以使用类似的方法来分配一个静态地址。
|
||||
|
||||
:::info
|
||||
There is nothing "special" about the network configuration (other than perhaps the tools used to modify the network settings); it works much the same as any home or business network.
|
||||
这就是说,了解IP网络如何工作是非常有利的!
|
||||
:::
|
||||
|
||||
### PX4以太网网络设置
|
||||
|
||||
<!-- Information about NuttX network manager: https://github.com/PX4/PX4-Autopilot/pull/16330 -->
|
||||
|
||||
PX4 uses the [netman](../modules/modules_system.md#netman) module to apply and update network settings.
|
||||
|
||||
The default configuration first requests an IP address from DHCP, and if that fails will fallback to the default static address `10.41.10.2`.
|
||||
您可以显式设置任何静态 IP 地址(包括默认地址)来绕过初始的 DHCP,使连接速度稍快。
|
||||
|
||||
:::info
|
||||
If you want to use the default static IP address for PX4 you can skip forward to the next section.
|
||||
:::
|
||||
|
||||
Network settings are defined in the configuration file `/fs/microsd/net.cfg` on the SD card.
|
||||
This is a text file, that defines each setting on a new line as a `name=value` pair.
|
||||
配置文件看起来像这样:
|
||||
|
||||
```ini
|
||||
DEVICE=eth0
|
||||
BOOTPROTO=fallback
|
||||
IPADDR=10.41.10.2
|
||||
NETMASK=255.255.255.0
|
||||
ROUTER=10.41.10.254
|
||||
DNS=10.41.10.254
|
||||
```
|
||||
|
||||
值为:
|
||||
|
||||
- `DEVICE`: Interface name. Default is `eth0`.
|
||||
- `BOOTPROTO`: Protocol for getting PX4 IP address. Valid values for proto are: `dhcp`, `static`, `fallback` (use DHCP but fall back to static address after time, if that fails)
|
||||
- `IPADDR`: Static IP address (used if BOOTPROTO is `static` or `fallback`)
|
||||
- `NETMASK`: Network mask
|
||||
- `ROUTER`: The address of the default route.
|
||||
- `DNS`: The address of the DNS server.
|
||||
|
||||
To set the above "example" configuration using the _QGroundControl_:
|
||||
|
||||
1. 将飞行控制器通过USB线连接到计算机。
|
||||
|
||||
2. Open **QGroundcontrol > Analyze Tools > MAVLink Console**
|
||||
|
||||
3. Enter commands "like" the ones below into the _MAVLink Console_ (to write the values to the configuration file):
|
||||
|
||||
```sh
|
||||
echo DEVICE=eth0 > /fs/microsd/net.cfg
|
||||
echo BOOTPROTO=fallback >> /fs/microsd/net.cfg
|
||||
echo IPADDR=10.41.10.2 >> /fs/microsd/net.cfg
|
||||
echo NETMASK=255.255.255.0 >>/fs/microsd/net.cfg
|
||||
echo ROUTER=10.41.10.254 >>/fs/microsd/net.cfg
|
||||
echo DNS=10.41.10.254 >>/fs/microsd/net.cfg
|
||||
```
|
||||
|
||||
4. 一旦设置了网络配置,您可以断开 USB 电缆。
|
||||
|
||||
5. 重启飞行控制器以应用设置。
|
||||
|
||||
请注意,上述设置为飞行控制器在以太网网络上分配了一个地址。
|
||||
You also need to [configure the Ethernet port](#px4-mavlink-serial-port-configuration) to use MAVLink.
|
||||
|
||||
### Ubuntu以太网网络设置
|
||||
|
||||
If you're using Ubuntu for your ground station (or companion computer) then you can use [netplan](https://netplan.io/) to configure the network.
|
||||
|
||||
Below we show how you write a setup to the netplan configuration file "`/etc/netplan/01-network-manager-all.yaml`", which would run on the same network as used by the PX4 setup above.
|
||||
Note that there are many more [examples](https://netplan.io/examples/) and instructions in the [netplan](https://netplan.io/) documentation.
|
||||
|
||||
设置Ubuntu计算机:
|
||||
|
||||
1. In a terminal, create and open a `netplan` configuration file: `/etc/netplan/01-network-manager-all.yaml`
|
||||
Below we do this using the _nano_ text editor.
|
||||
|
||||
```
|
||||
sudo nano /etc/netplan/01-network-manager-all.yaml
|
||||
```
|
||||
|
||||
2. 将以下配置信息复制并粘贴到文件中(注意:缩进很重要!):
|
||||
|
||||
```
|
||||
network:
|
||||
version: 2
|
||||
renderer: NetworkManager
|
||||
ethernets:
|
||||
enp2s0:
|
||||
addresses:
|
||||
- 10.41.10.1/24
|
||||
nameservers:
|
||||
addresses: [10.41.10.1]
|
||||
routes:
|
||||
- to: 10.41.10.1
|
||||
via: 10.41.10.1
|
||||
```
|
||||
|
||||
保存并退出编辑器。
|
||||
|
||||
3. Apply the _netplan_ configuration by entering the following command into the Ubuntu terminal.
|
||||
|
||||
```
|
||||
sudo netplan apply
|
||||
```
|
||||
|
||||
### 机载计算机以太网网络设置
|
||||
|
||||
机载计算机的设置将取决于它的操作系统。
|
||||
|
||||
A Linux operating system may support `netplan`, in which case the instructions would be the same as above, but using a unique IP address.
|
||||
|
||||
## PX4 MAVLink 串口配置
|
||||
|
||||
The Ethernet port configuration sets the properties of the _serial link_ (which is how PX4 views the Ethernet connection).
|
||||
这包括被发送的 MAVLink 消息集合、数据传输速率、远程系统可以连接并监听的 UDP 端口等。
|
||||
|
||||
:::info
|
||||
You must separately configure the PX4 IP address and other _network settings_ ([as shown previously](#px4-ethernet-network-setup)).
|
||||
:::
|
||||
|
||||
PX4配置串行端口以通过MAVLink连接到地面站,使用下面的参数:
|
||||
|
||||
| 参数 | 值 | 描述 |
|
||||
| --------------------------------------------------------------------------------------------------------------------------------------------- | ------ | ------------------------------ |
|
||||
| [MAV_2_CONFIG](../advanced_config/parameter_reference.md#MAV_2_CONFIG) | 1000 | 配置以太网端口 |
|
||||
| [MAV_2_BROADCAST](../advanced_config/parameter_reference.md#MAV_2_BROADCAST) | 1 | Broadcast `HEARTBEAT` messages |
|
||||
| [MAV_2_MODE](../advanced_config/parameter_reference.md#MAV_2_MODE) | 0 | 发送“正常”的 MAVLink 消息集合(即地面站消息集合) |
|
||||
| [MAV_2_RADIO_CTL](../advanced_config/parameter_reference.md#MAV_2_RADIO_CTL) | 0 | 禁用MAVLink流量控制 |
|
||||
| [MAV_2_RATE](../advanced_config/parameter_reference.md#MAV_2_RATE) | 100000 | 最大发送速率 |
|
||||
| [MAV_2_REMOTE_PRT](../advanced_config/parameter_reference.md#MAV_2_REMOTE_PRT) | 14550 | MAVLink远程端口14550(地面站) |
|
||||
| [MAV_2_UDP_PRT](../advanced_config/parameter_reference.md#MAV_2_UDP_PRT) | 14550 | MAVLink网络端口14550(地面站) |
|
||||
|
||||
Normally a companion computer would use port `14540` (rather than `14550`) and stream the set of MAVLink messages specified in the `Onboard` profile.
|
||||
You can configure this setup by changing [MAV_2_REMOTE_PRT](../advanced_config/parameter_reference.md#MAV_2_REMOTE_PRT) and [MAV_2_UDP_PRT](../advanced_config/parameter_reference.md#MAV_2_UDP_PRT) to `14540` and [MAV_2_MODE](../advanced_config/parameter_reference.md#MAV_2_MODE) to `2` (Onboard).
|
||||
请注意,这仍将使用GCS配置文件正常工作。
|
||||
|
||||
For more information on MAVLink serial port configuration see [MAVLink Peripherals (GCS/OSD/Companion)](../peripherals/mavlink_peripherals.md)
|
||||
|
||||
## QGroundControl 设置示例
|
||||
|
||||
Assuming you have already [Set up the Ethernet Network](#setting-up-the-ethernet-network) so your ground station computer and PX4 run on the same network, and
|
||||
|
||||
要将 QGroundControl 通过以太网连接到 PX4 :
|
||||
|
||||
1. [Set up the Ethernet Network](#setting-up-the-ethernet-network) so your ground station computer and PX4 run on the same network.
|
||||
|
||||
2. 使用网线连接地面站计算机和PX4。
|
||||
|
||||
3. Start QGroundControl and [define a comm link](https://docs.qgroundcontrol.com/master/en/qgc-user-guide/settings_view/settings_view.html) (**Application Settings > Comm Links**) specifying the _server address_ and port as the IP address and port assigned in PX4, respectively.
|
||||
|
||||
假设值已按本主题其余部分所述设置,设置将如下所示:
|
||||
|
||||

|
||||
|
||||
4. 如果你选择这个链接,QGroundControl 应该会连接。
|
||||
|
||||
:::info
|
||||
[PX4 Ethernet Port Configuration](#px4-ethernet-network-setup) should not be needed (the default are appropriate for a GCS).
|
||||
:::
|
||||
|
||||
## MAVSDK-Python 设置示例
|
||||
|
||||
要在一台机载计算机上运行MAVSDK-Python:
|
||||
|
||||
1. [Set up the Ethernet Network](#setting-up-the-ethernet-network) so your companion computer and PX4 run on the same network.
|
||||
2. Modify the [PX4 Ethernet Port Configuration](#px4-ethernet-network-setup) to connect to a companion computer.
|
||||
You might change the parameters [MAV_2_REMOTE_PRT](../advanced_config/parameter_reference.md#MAV_2_REMOTE_PRT) and [MAV_2_UDP_PRT](../advanced_config/parameter_reference.md#MAV_2_UDP_PRT) to `14540`, and [MAV_2_MODE](../advanced_config/parameter_reference.md#MAV_2_MODE) to `2` (Onboard).
|
||||
3. Follow the instructions in [MAVSDK-python](https://github.com/mavlink/MAVSDK-Python) to install and use MAVSDK.
|
||||
|
||||
例如,您的代码将使用以下方式连接到PX4:
|
||||
|
||||
```python
|
||||
await drone.connect(system_address="udp://10.41.10.2:14540")
|
||||
```
|
||||
|
||||
:::info
|
||||
MAVSDK can connect to the PX4 on port `14550` if you don't modify the PX4 Ethernet port configuration.
|
||||
然而,这并不推荐,因为默认配置是针对与地面控制站(而不是机载计算机)通信进行优化的。
|
||||
:::
|
||||
|
||||
## ROS 2设置示例
|
||||
|
||||
:::info ROS / MAVROS 测试
|
||||
|
||||
- You have a supported autopilot hardware running PX4 firmware that includes [uXRCE-DDS](../middleware/uxrce_dds.md) middleware.
|
||||
Note that PX4 v1.14 and later include the required [uxrce_dds_client](../modules/modules_system.md#uxrce-dds-client) module by default.
|
||||
- [ROS 2](../ros2/user_guide.md) has been set up correctly on the companion computer.
|
||||
- 您已按照本页顶部讨论的以太网网络和端口设置进行了设置。
|
||||
|
||||
:::
|
||||
|
||||
设置 ROS 2:
|
||||
|
||||
1. 通过以太网连接您的飞行控制器和机载计算机。
|
||||
|
||||
2. [Start the uXRCE-DDS client on PX4](../middleware/uxrce_dds.md#starting-the-client), either manually or by customizing the system startup script.
|
||||
Note that you must use the IP address of the companion computer and the UDP port on which the agent is listening (the example configuration above sets the companion IP address to `10.41.10.1`, and the agent UDP port is set to `8888` in the next step).
|
||||
|
||||
3. [Start the micro XRCE-DDS agent on the companion computer](../middleware/uxrce_dds.md#starting-the-agent).
|
||||
For example, enter the following command in a terminal to start the agent listening on UDP port `8888`.
|
||||
|
||||
```sh
|
||||
MicroXRCEAgent udp4 -p 8888
|
||||
```
|
||||
|
||||
4. Run a [listener node](../ros2/user_guide.md#running-the-example) in a new terminal to confirm the connection is established:
|
||||
|
||||
```sh
|
||||
source ~/ws_sensor_combined/install/setup.bash
|
||||
ros2 launch px4_ros_com sensor_combined_listener.launch.py
|
||||
```
|
||||
|
||||
如果所有设置都正确,终端应显示如下输出:
|
||||
|
||||
```sh
|
||||
RECEIVED SENSOR COMBINED DATA
|
||||
=============================
|
||||
ts: 855801598
|
||||
gyro_rad[0]: -0.00339938
|
||||
gyro_rad[1]: 0.00440091
|
||||
gyro_rad[2]: 0.00513893
|
||||
gyro_integral_dt: 4997
|
||||
accelerometer_timestamp_relative: 0
|
||||
accelerometer_m_s2[0]: -0.0324082
|
||||
accelerometer_m_s2[1]: 0.0392213
|
||||
accelerometer_m_s2[2]: -9.77914
|
||||
accelerometer_integral_dt: 4997
|
||||
```
|
||||
|
||||
## See Also
|
||||
|
||||
- [Get The Pixhawk Raspberry Pi CM4 Baseboard By Holybro Talking With PX4](https://px4.io/get-the-pixhawk-raspberry-pi-cm4-baseboard-by-holybro-talking-with-px4/) (px4.io blog):
|
||||
- 展示如何通过有线以太网连接 Pixhawk 6X + Raspberry Pi 到 CM4 主板。
|
||||
- 博客从这个主题复制了很多材料。
|
||||
@@ -0,0 +1,77 @@
|
||||
# 飞行终止配置
|
||||
|
||||
The _Flight termination_ [failsafe action](../config/safety.md#failsafe-actions) may be triggered by a [safety check](../config/safety.md) (e.g. RC Loss, geofence violation, etc. on any vehicle type or in any flight mode), or by the [Failure Detector](../config/safety.md#failure-detector).
|
||||
|
||||
:::info
|
||||
Flight termination may also be triggered from a ground station or companion computer using the MAVLink [MAV_CMD_DO_FLIGHTTERMINATION](https://mavlink.io/en/messages/common.html#MAV_CMD_DO_FLIGHTTERMINATION) command.
|
||||
This is sent, for example, when you call the [MAVSDK Action plugin](https://mavsdk.mavlink.io/main/en/cpp/api_reference/classmavsdk_1_1_action.html#classmavsdk_1_1_action_1a47536c4a4bc8367ccd30a92eb09781c5) `terminate()` or `terminate_async()` methods.
|
||||
:::
|
||||
|
||||
When _Flight termination_ is activated, PX4 simultaneously turns off all controllers and sets all PWM outputs to their failsafe values.
|
||||
|
||||
根据所连接的设备,PWM 故障保护输出可以用来完成以下动作:
|
||||
|
||||
- Deploy a [parachute](../peripherals/parachute.md).
|
||||
- 伸展可伸缩起落架。
|
||||
- 将连接了 PWM 的云台移动到安全的方向(或将它回收)以保护摄像机。
|
||||
- 触发一个可充气的装置,如安全气囊。
|
||||
- 触发警报。
|
||||
|
||||
飞行终止是无法取消的。
|
||||
在飞行终止触发后,您应尽快拔下电池。
|
||||
您需要在重启载具或重新上电后才能再次使用。
|
||||
|
||||
:::tip
|
||||
PX4 does not know what safety devices are attached - it just applies a predefined set of PWM values to its outputs.
|
||||
:::
|
||||
|
||||
:::tip
|
||||
Failsafe values are applied to all outputs on termination.
|
||||
无法配置电机或特定安全装置为独立的特定时间(或其他方式)触发。
|
||||
:::
|
||||
|
||||
:::info
|
||||
This is _not_ an independent _Flight Termination System_.
|
||||
如果断电或者自驾仪完全失控,失效保护设备则不会触发。
|
||||
:::
|
||||
|
||||
## 硬件配置
|
||||
|
||||
Any _safety device(s)_ (e.g. a [parachute](../peripherals/parachute.md)) that can be triggered by changing a PWM value can be used, and may be connected to any free PWM port (both MAIN and AUX).
|
||||
|
||||
:::info
|
||||
If you're using Pixhawk-series board you will have to separately power the servo rail (i.e. from a 5V BEC, which is often also available from your ESC).
|
||||
:::
|
||||
|
||||
## 软件配置
|
||||
|
||||
The [Safety](../config/safety.md) topic explains how to set the _flight termination_ as the [failsafe action](../config/safety.md#failsafe-actions) to be performed for particular failsafe check.
|
||||
|
||||
The [Failure Detector](../config/safety.md#failure-detector) can also (optionally) be configured to trigger flight termination if the vehicle flips (exceeds a certain attitude) or if failure is detected by an external automatic trigger system (ATS):
|
||||
|
||||
- Enable the failure detector during flight by setting [CBRK_FLIGHTTERM=0](../advanced_config/parameter_reference.md#CBRK_FLIGHTTERM).
|
||||
- [Safety > Failure Detector > Attitude Trigger](../config/safety.md#attitude-trigger) explains how to configure the attitude limits that trigger _Flight termination_.
|
||||
::: info
|
||||
During _takeoff_ excessive attitutes will trigger _lockdown_ (kill motors, but not launch parachute) rather than flight termination.
|
||||
This is always enabled, irrespective of the value of `CBRK_FLIGHTTERM`.
|
||||
|
||||
:::
|
||||
- [Safety > External Automatic Trigger System (ATS)](../config/safety.md#external-automatic-trigger-system-ats) explains how to configure an external trigger system.
|
||||
|
||||
对于每个与安全装置相连的 MAIN 输出,其中“n”指 PWM 端口号,设置:
|
||||
|
||||
- [PWM_MAIN_DISn](../advanced_config/parameter_reference.md#PWM_MAIN_DIS1) to the device's "OFF" PWM value.
|
||||
- [PWM_MAIN_FAILn](../advanced_config/parameter_reference.md#PWM_MAIN_FAIL1) to the device's "ON" PWM value.
|
||||
|
||||
对于每个与安全装置相连的 AUX 输出,其中“n”指 PWM 端口号,设置:
|
||||
|
||||
- [PWM_AUX_DIS1](../advanced_config/parameter_reference.md#PWM_AUX_DIS1) to the device's "OFF" PWM value.
|
||||
- [PWM_AUX_FAILn](../advanced_config/parameter_reference.md#PWM_AUX_FAIL1) to the device's "ON" PWM value.
|
||||
|
||||
Finally, set the `PWM_AUX_FAILn` and `PWM_MAIN_FAILn` PWM values for any motors.
|
||||
|
||||
## 逻辑图解
|
||||
|
||||
下图显示了飞行终止的逻辑流程。
|
||||
|
||||

|
||||
@@ -0,0 +1,34 @@
|
||||
# IMU/指南针工厂校准
|
||||
|
||||
PX4 OEM制造商可以执行IMU和罗盘工厂校准,以便将加速度计、陀螺仪和磁力计校准的数值存储到持久存储器中(通常是EEPROM)。
|
||||
这将确保最终用户总是能够重置车辆配置并调整到安全状态以供飞行。
|
||||
|
||||
This procedure will write the following parameters to `/fs/mtd_caldata`: [CAL_ACC\*](../advanced_config/parameter_reference.md#CAL_ACC0_ID), [CAL_GYRO\*](../advanced_config/parameter_reference.md#CAL_GYRO0_ID), [CAL_MAG\*](../advanced_config/parameter_reference.md#CAL_MAG0_ID).
|
||||
当参数被设置(或重置)为其默认值时,此数据将被使用。
|
||||
|
||||
:::warning
|
||||
This feature relies on the FMU having a dedicated EEPROM chip or an accompanying IMU PCBA that has sufficient space for the data.
|
||||
PX4 will store the data to `/fs/mtd_caldata`, creating the file if necessary.
|
||||
:::
|
||||
|
||||
:::info
|
||||
These values cannot be stored in the [frame configuration](../dev_airframes/adding_a_new_frame.md) because they vary from device to device (the frame configuration defines the set of parameters that are applicable across all vehicles of the same type, such as the enabled sensors, [autopilot rotation](../config/flight_controller_orientation.md) and PID tuning).
|
||||
:::
|
||||
|
||||
## 执行工厂校准
|
||||
|
||||
1. Set the parameter [SYS_FAC_CAL_MODE](../advanced_config/parameter_reference.md#SYS_FAC_CAL_MODE) to 1.
|
||||
2. Perform all IMU calibrations: [accelerometer](../config/accelerometer.md#performing-the-calibration), [gyroscope](../config/gyroscope.md#performing-the-calibration) and [magnetometer](../config/compass.md#performing-the-calibration).
|
||||
3. Reboot the vehicle.
|
||||
This will write all `CAL_ACC*`, `CAL_GYRO*` and `CAL_MAG*` parameters into `/fs/mtd_caldata`.
|
||||
4. Set the parameter `SYS_FAC_CAL_MODE` back to 0 (default).
|
||||
|
||||
:::info
|
||||
If you only want to factory calibrate the accelerometer and the gyroscope you can set [SYS_FAC_CAL_MODE](../advanced_config/parameter_reference.md#SYS_FAC_CAL_MODE) to 2, in which case the magnetometer is omitted.
|
||||
:::
|
||||
|
||||
随后的用户校准将像往常一样生效(工厂校准数据仅用于参数默认值)。
|
||||
|
||||
## 更多信息
|
||||
|
||||
- [QGroundControl User Guide > Sensors](https://docs.qgroundcontrol.com/master/en/qgc-user-guide/setup_view/sensors_px4.html)
|
||||
@@ -0,0 +1,44 @@
|
||||
# 高级配置
|
||||
|
||||
本章节罗列的相关配置并不针对特定的载具,其特性很少被修改,或仅针对制造商/OEMs。
|
||||
|
||||
## 参数
|
||||
|
||||
- [Finding/Updating Parameters](../advanced_config/parameters.md)
|
||||
- [完整参数参考](../advanced_config/parameter_reference.md)
|
||||
|
||||
## 功能配置
|
||||
|
||||
- [使用 PX4 的导航滤波器 (EKF2)](../advanced_config/tuning_the_ecl_ekf.md)
|
||||
- [飞行终止配置](../advanced_config/flight_termination.md)
|
||||
- [着陆探测器配置](../advanced_config/land_detector.md)
|
||||
- [解锁前/解锁/加锁 配置](../advanced_config/prearm_arm_disarm.md)
|
||||
|
||||
## OEM/出厂校准
|
||||
|
||||
- [IMU 出厂校准](../advanced_config/imu_factory_calibration.md)
|
||||
- [传感器热补偿](../advanced_config/sensor_thermal_calibration.md)
|
||||
- [Compass Power Compensation](../advanced_config/compass_power_compensation.md)
|
||||
- [飞控方向高级配置](../advanced_config/advanced_flight_controller_orientation_leveling.md)
|
||||
- [静态压力构建](../advanced_config/static_pressure_buildup.md)
|
||||
|
||||
## 串口/以太网配置
|
||||
|
||||
- [Serial Port Configuration](../peripherals/serial_configuration.md)
|
||||
- [MAVLink Telemetry (OSD/GCS)](../peripherals/mavlink_peripherals.md)
|
||||
- [PX4 Ethernet Setup](../advanced_config/ethernet_setup.md)
|
||||
|
||||
## 其它选项
|
||||
|
||||
- [Bootloader 更新](../advanced_config/bootloader_update.md)
|
||||
- [通过 USB 更新 FMUv6X-RT bootloader](../advanced_config/bootloader_update_v6xrt.md)
|
||||
|
||||
## See Also
|
||||
|
||||
- [标准配置](../config/index.md) - 大多数 PX4 机体所需要的基本传感器/功能配置。
|
||||
- [飞控外设](../peripherals/index.md) - 设置特定传感器、可选传感器、执行器等。
|
||||
- 机体配置/调参:
|
||||
- [多旋翼配置/调参](../config_mc/index.md)
|
||||
- [直升机配置/调参](../config_heli/index.md)
|
||||
- [固定翼配置/调参](../config_fw/index.md)
|
||||
- [VTOL 配置/调参](../config_vtol/index.md)
|
||||
@@ -0,0 +1,100 @@
|
||||
# 着陆探测器配置
|
||||
|
||||
着陆探测器是一个动态飞行器模型,代表了从接触地面到着陆的关键飞行器状态。
|
||||
本节主题说明您可能希望调整的主要参数,以改善飞行器着陆行为。
|
||||
|
||||
## 自动上锁
|
||||
|
||||
当飞行器着陆时着陆探测器会为飞行器自动加锁。
|
||||
|
||||
You can set [COM_DISARM_LAND](../advanced_config/parameter_reference.md#COM_DISARM_LAND) to specify the number of seconds after landing that the system should disarm (or turn off auto-disarming by setting the parameter to -1).
|
||||
|
||||
## 多旋翼配置
|
||||
|
||||
The complete set of relevant landing detector parameters are listed in the parameter reference with the prefix [LNDMC](../advanced_config/parameter_reference.md#land-detector) (these can be edited in QGroundControl via the [parameter editor](../advanced_config/parameters.md)).
|
||||
|
||||
:::tip
|
||||
Information about how the parameters affect landing can be found below in [Land Detector States](#mc-land-detector-states).
|
||||
:::
|
||||
|
||||
为了改善特定机架上的着陆,您可能需要调整的其他关键参数包括:
|
||||
|
||||
- [MPC_THR_HOVER](../advanced_config/parameter_reference.md#MPC_THR_HOVER) - the hover throttle of the system (default is 50%).
|
||||
正确设置这一点是很重要的, 因为它使高度控制更加准确, 并确保正确的地面检测。
|
||||
没有安装有效载荷的穿越机或大型相机的无人机可能需要更低的悬停油门 (例如 35%)。
|
||||
|
||||
::: info
|
||||
Incorrectly setting `MPC_THR_HOVER` may result in ground-contact or maybe-landed detection while still in air (in particular, while descending in [Position mode](../flight_modes_mc/position.md) or [Altitude mode](../flight_modes_mc/altitude.md)).
|
||||
这将导致载具 "抽搐" (关闭电机,然后立即将其重新打开)。
|
||||
|
||||
:::
|
||||
|
||||
- [MPC_THR_MIN](../advanced_config/parameter_reference.md#MPC_THR_MIN) - the overall minimum throttle of the system.
|
||||
应该将其设置为可控的下降
|
||||
|
||||
- [MPC_LAND_CRWL](../advanced_config/parameter_reference.md#MPC_LAND_CRWL) - the vertical speed applied in the last stage of autonomous landing if the system has a distance sensor and it is present and working. Has to be set larger than LNDMC_Z_VEL_MAX.
|
||||
|
||||
### MC Land Detector States
|
||||
|
||||
为了探测着陆,多旋翼首先必须经历三个不同的状态,其中每个状态都包含来自先前状态的条件以及更严格的约束。
|
||||
如果由于缺少传感器而无法达到条件,则默认情况下认为该条件为真。
|
||||
For instance, in [Acro mode](../flight_modes_mc/acro.md) and no sensor is active except for the gyro sensor, then the detection solely relies on thrust output and time.
|
||||
|
||||
In order to proceed to the next state, each condition has to be true for a third of the configured total land detector trigger time [LNDMC_TRIG_TIME](../advanced_config/parameter_reference.md#LNDMC_TRIG_TIME).
|
||||
If the vehicle is equipped with a distance sensor, but the distance to ground is currently not measurable (usually because it is too large), the trigger time is increased by a factor of 3.
|
||||
|
||||
如果一个条件失败,则陆地探测器立即退出当前状态。
|
||||
|
||||
#### 地面接触
|
||||
|
||||
Conditions for this state:
|
||||
|
||||
- no vertical movement ([LNDMC_Z_VEL_MAX](../advanced_config/parameter_reference.md#LNDMC_Z_VEL_MAX))
|
||||
- no horizontal movement ([LNDMC_XY_VEL_MAX](../advanced_config/parameter_reference.md#LNDMC_XY_VEL_MAX))
|
||||
- lower thrust than [MPC_THR_MIN](../advanced_config/parameter_reference.md#MPC_THR_MIN) + (hover throttle - [MPC_THR_MIN](../advanced_config/parameter_reference.md#MPC_THR_MIN)) \* (0.3, unless a hover thrust estimate is available, then 0.6),
|
||||
- additional check if vehicle is currently in a height-rate controlled flight mode: the vehicle has to have the intent to descend (vertical velocity setpoint above LNDMC_Z_VEL_MAX).
|
||||
- additional check for vehicles with a distance sensor: current distance to ground is below 1m.
|
||||
|
||||
If the vehicle is in position- or velocity-control and ground contact was detected,
|
||||
the position controller will set the thrust vector along the body x-y-axis to zero.
|
||||
|
||||
#### 可能着陆
|
||||
|
||||
Conditions for this state:
|
||||
|
||||
- all conditions of the [ground contact](#ground-contact) state are true
|
||||
- is not rotating ([LNDMC_ROT_MAX](../advanced_config/parameter_reference.md#LNDMC_ROT_MAX))
|
||||
- has low thrust `MPC_THR_MIN + (MPC_THR_HOVER - MPC_THR_MIN) * 0.1`
|
||||
- no freefall detected
|
||||
|
||||
If the vehicle only has knowledge of thrust and angular rate,
|
||||
in order to proceed to the next state the vehicle has to have low thrust and no rotation for 8.0 seconds.
|
||||
|
||||
If the vehicle is in position or velocity control and maybe landed was detected,
|
||||
the position controller will set the thrust vector to zero.
|
||||
|
||||
#### 降落完成
|
||||
|
||||
Conditions for this state:
|
||||
|
||||
- all conditions of the [maybe landed](#maybe-landed) state are true
|
||||
|
||||
## Fixed-wing Configuration
|
||||
|
||||
Tuning parameters for fixed-wing land detection:
|
||||
|
||||
- [LNDFW_AIRSPD_MAX](../advanced_config/parameter_reference.md#LNDFW_AIRSPD_MAX) - the maximum airspeed allowed for the system still to be considered landed.
|
||||
Has to be a tradeoff between airspeed sensing accuracy and triggering fast enough.
|
||||
越好的空速传感器允许此参数的值越低。
|
||||
- [LNDFW_VEL_XY_MAX ](../advanced_config/parameter_reference.md#LNDFW_VEL_XY_MAX) - the maximum horizontal velocity for the system to be still be considered landed.
|
||||
- [LNDFW_VEL_Z_MAX](../advanced_config/parameter_reference.md#LNDFW_VEL_XY_MAX) - the maximum vertical velocity for the system to be still be considered landed.
|
||||
- [LNDFW_XYACC_MAX](../advanced_config/parameter_reference.md#LNDFW_XYACC_MAX) - the maximal horizontal acceleration for the system to still be considered landed.
|
||||
- [LNDFW_TRIG_TIME](../advanced_config/parameter_reference.md#LNDFW_TRIG_TIME) - Trigger time during which the conditions above have to be fulfilled to declare a landing.
|
||||
|
||||
:::info
|
||||
When FW launch detection is enabled ([FW_LAUN_DETCN_ON](../advanced_config/parameter_reference.md#FW_LAUN_DETCN_ON)), the vehicle will stay in "landed" state until takeoff is detected (which is purely based on acceleration and not velocity).
|
||||
:::
|
||||
|
||||
## VTOL Land Detector
|
||||
|
||||
The VTOL land detector is 1:1 the same as the MC land detector if the system is in hover mode. In FW mode, land detection is disabled.
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,106 @@
|
||||
# 查找/更新参数
|
||||
|
||||
PX4 behaviour can be configured/tuned using [parameters](../advanced_config/parameter_reference.md) (e.g. [Multicopter PID gains](../config_mc/pid_tuning_guide_multicopter.md), calibration information, etc.).
|
||||
|
||||
The _QGroundControl Parameters_ screen allows you to find and modify **any** of the parameters associated with the vehicle.
|
||||
The screen is accessed by clicking the **Q** application icon > **Vehicle Setup**, and then _Parameters_ in the sidebar.
|
||||
|
||||
:::info
|
||||
Most of the more commonly used parameters are more conveniently set using the dedicated setup screens, as described in the [Standard Configuration](../config/index.md) section.
|
||||
The _Parameters_ screen is needed when modifying less commonly modified parameters - for example while tuning a new vehicle.
|
||||
:::
|
||||
|
||||
:::warning
|
||||
While some parameters can be changed in flight, this is not recommended (except where explicitly stated in the guide).
|
||||
:::
|
||||
|
||||
<a id="finding"></a>
|
||||
|
||||
## 查找参数
|
||||
|
||||
You can search for a parameter by entering a term in the _Search_ field.
|
||||
This will show you a list of all parameter names and descriptions that contain the entered substring (press **Clear** to reset the search, and use the **Show modified only** checkbox to filter out unchanged parameters).
|
||||
|
||||

|
||||
|
||||
You can also browse the parameters by type and group by clicking on the buttons to the left (in the image below the _DShot_ group in the _Standard_ parameters is selected).
|
||||
|
||||

|
||||
|
||||
You can expand/collapse the "type" groupings as shown.
|
||||
Note that the groups at the bottom named _Component X_ are attached [DroneCAN peripherals](../dronecan/index.md#qgc-cannode-parameter-configuration) ("X" is the node id).
|
||||
[QGC can set the parameters](../dronecan/index.md#qgc-cannode-parameter-configuration) of these peripherals if they are attached to the Flight Controller when QGC is started.
|
||||
|
||||

|
||||
|
||||
:::tip
|
||||
If you can't find an expected parameter, see the [next section](#missing).
|
||||
:::
|
||||
|
||||
<a id="missing"></a>
|
||||
|
||||
## 找不到的参数
|
||||
|
||||
参数通常不可见,因为它们要么以其他参数为条件,要么不存在于固件中(见下文)。
|
||||
|
||||
### 条件参数
|
||||
|
||||
如果一个参数是以未启用的另一个参数为条件,则该参数不会被显示。
|
||||
|
||||
You can usually find out what parameters are conditional by searching the [full parameter reference](../advanced_config/parameter_reference.md) and other documentation.
|
||||
In particular [serial port configuration parameters](../peripherals/serial_configuration.md) depend on what service is assigned to a serial port.
|
||||
|
||||
### 固件中没有的参数
|
||||
|
||||
参数可能不在固件中,因为您使用了不同版本的 PX4,或者因为您构建的固件中没有包含相关的模块。
|
||||
|
||||
每个PX4版本都添加了新参数,现有参数有时被删除或重命名。
|
||||
You can check whether a parameter _should_ be present by reviewing the [full parameter reference](../advanced_config/parameter_reference.md) for the version you're targeting.
|
||||
您还可以在源代码和发布说明中查找参数。
|
||||
|
||||
参数可能不在固件中的另一个原因是如果其关联的模块没有被包含。
|
||||
This is a problem (in particular) for _FMUv2 firmware_, which omits many modules so that PX4 can fit into the 1MB of available flash.
|
||||
解决此问题有两种方法:
|
||||
|
||||
- Check if you can update your board to run FMUv3 firmware, which includes all modules: [Firmware > FMUv2 Bootloader Update](../config/firmware.md#bootloader)
|
||||
- If your board can only run FMUv2 firmware you will need to [rebuild PX4](../dev_setup/building_px4.md) with the missing modules enabled.
|
||||
You need reconfigure the PX4 firmware itself through make px4_fmuv2_default boardconfig where you can enabled/disable modules.
|
||||
|
||||
::: info
|
||||
You may also need to disable other modules in order to fit the rebuilt firmware into 1MB flash.
|
||||
Finding modules to remove requires some trial/error and depends on what use cases you need the vehicle to meet.
|
||||
|
||||
:::
|
||||
|
||||
<a id="changing"></a>
|
||||
|
||||
## 更改参数
|
||||
|
||||
要更改参数的值,请单击组或搜索列表中的参数行。
|
||||
单击后屏幕侧边会显示一个对话框,您在其中更改参数的值(这个对话框还提供了该参数的额外细节信息——包括是否需要重启才能使参数生效)。
|
||||
|
||||

|
||||
|
||||
:::info
|
||||
When you click **Save** the parameter is automatically and silently uploaded to the connected vehicle.
|
||||
根据参数,您可能需要重新启动飞控才能使更改生效。
|
||||
:::
|
||||
|
||||
## 工具
|
||||
|
||||
You can select additional options from the **Tools** menu on the top right hand side of the screen.
|
||||
|
||||

|
||||
|
||||
**Refresh** <br>Refresh the parameter values by re-requesting all of them from the vehicle.
|
||||
|
||||
**Reset all to firmware defaults** <br>Reset all parameters to their original default values in the firmware.
|
||||
|
||||
**Reset to vehicle's configuration defaults** <br>Reset all parameters to their original default values for the particular selected airfame configuration.
|
||||
|
||||
**Load from file / Save to file** <br>Load parameters from an existing file or save your current parameter settings to a file.
|
||||
|
||||
**Clear all RC to Param** <br>This clears all associations between RC transmitter controls and parameters.
|
||||
For more information see: [Radio Setup > Param Tuning Channels](../config/radio.md#param-tuning-channels).
|
||||
|
||||
**Reboot Vehicle** <br>Reboot the vehicle (required after changing some parameters).
|
||||
@@ -0,0 +1,239 @@
|
||||
# Arm, Disarm, Prearm Configuration
|
||||
|
||||
机体是有可移动的部件的,其中一些在通电后会有潜在的危险性(特别是电机和螺旋桨)!
|
||||
|
||||
为了减少发生事故的可能性, PX4 有明确的载具部件供电状态:
|
||||
|
||||
- **Disarmed:** There is no power to motors or actuators.
|
||||
- **Pre-armed:** Motors/propellers are locked but actuators for non-dangerous electronics are powered (e.g. ailerons, flaps etc.).
|
||||
- **Armed:** Vehicle is fully powered. 电机/螺旋桨可能转动(危险!)
|
||||
|
||||
:::info
|
||||
Ground stations may display _disarmed_ for pre-armed vehicles.
|
||||
虽然技术上不适合预解锁的载具,但它是“安全的”。
|
||||
:::
|
||||
|
||||
Users can control progression though these states using a [safety switch](../getting_started/px4_basic_concepts.md#safety-switch) on the vehicle (optional) _and_ an [arming switch/button](#arm_disarm_switch), [arming gesture](#arm_disarm_gestures), or _MAVLink command_ on the ground controller:
|
||||
|
||||
- A _safety switch_ is a control _on the vehicle_ that must be engaged before the vehicle can be armed, and which may also prevent prearming (depending on the configuration).
|
||||
通常,安全开关被集成到 GPS 单元中,但也可能是一个单独的物理组件。
|
||||
|
||||
:::warning
|
||||
A vehicle that is armed is potentially dangerous.
|
||||
安全开关是防止意外解锁发生的一个附加机制。
|
||||
|
||||
:::
|
||||
|
||||
- An _arming switch_ is a switch or button _on an RC controller_ that can be used to arm the vehicle and start motors (provided arming is not prevented by a safety switch).
|
||||
|
||||
- An _arming gesture_ is a stick movement _on an RC controller_ that can be used as an alternative to an arming switch.
|
||||
|
||||
- 也可以通过地面站发送 MAVLink 命令来解锁/锁定载具。
|
||||
|
||||
如果在解锁后的一段时间内没有起飞,和如果着陆后没有手动锁定, PX4 会自动锁定载具。
|
||||
这减少了解锁的载具在地面上的时间。
|
||||
|
||||
PX4 allows you to configure how pre-arming, arming and disarming work using parameters (which can be edited in _QGroundControl_ via the [parameter editor](../advanced_config/parameters.md)), as described in the following sections.
|
||||
|
||||
:::tip
|
||||
Arming/disarming parameters can be found in [Parameter Reference > Commander](../advanced_config/parameter_reference.md#commander) (search for `COM_ARM_*` and `COM_DISARM_*`).
|
||||
:::
|
||||
|
||||
## Arming/Disarming Gestures {#arm_disarm_gestures}
|
||||
|
||||
默认情况下,载具可以通过移动遥控器的油门/偏航摇杆到特定的位置,并保持 1 秒来解锁和锁定。
|
||||
|
||||
- **Arming:** Throttle minimum, yaw maximum
|
||||
- **Disarming:** Throttle minimum, yaw minimum
|
||||
|
||||
RC controllers will use different sticks for throttle and yaw [based on their mode](../getting_started/rc_transmitter_receiver.md#types-of-remote-controllers), and hence different gestures:
|
||||
|
||||
- **Mode 2**:
|
||||
- _Arm:_ Left stick to bottom right.
|
||||
- _Disarm:_ Left stick to the bottom left.
|
||||
- **Mode 1**:
|
||||
- _Arm:_ Left-stick to right, right-stick to bottom.
|
||||
- _Disarm:_ Left-stick to left, right-stick to the bottom.
|
||||
|
||||
The required hold time can be configured using [COM_RC_ARM_HYST](#COM_RC_ARM_HYST).
|
||||
Note that by default ([COM_DISARM_MAN](#COM_DISARM_MAN)) you can also disarm in flight using gestures/buttons: you may choose to disable this to avoid accidental disarming.
|
||||
|
||||
| 参数 | 描述 |
|
||||
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| <a id="MAN_ARM_GESTURE"></a>[MAN_ARM_GESTURE](../advanced_config/parameter_reference.md#MAN_ARM_GESTURE) | Enable arm/disarm stick guesture. `0`: Disabled, `1`: Enabled (default). |
|
||||
| <a id="COM_DISARM_MAN"></a>[COM_DISARM_MAN](../advanced_config/parameter_reference.md#COM_DISARM_MAN) | Enable disarming in flight via switch/stick/button in MC manual thrust modes. `0`: Disabled, `1`: Enabled (default). |
|
||||
| <a id="COM_RC_ARM_HYST"></a>[COM_RC_ARM_HYST](../advanced_config/parameter_reference.md#COM_RC_ARM_HYST) | Time that RC stick must be held in arm/disarm position before arming/disarming occurs (default: `1` second). |
|
||||
|
||||
## Arming Button/Switch {#arm_disarm_switch}
|
||||
|
||||
An _arming button_ or "momentary switch" can be configured to trigger arm/disarm _instead_ of [gesture-based arming](#arm_disarm_gestures) (setting an arming switch disables arming gestures).
|
||||
The button should be held down for ([nominally](#COM_RC_ARM_HYST)) one second to arm (when disarmed) or disarm (when armed).
|
||||
|
||||
A two-position switch can also be used for arming/disarming, where the respective arm/disarm commands are sent on switch _transitions_.
|
||||
|
||||
:::tip
|
||||
Two-position arming switches are primarily used in/recommended for racing drones.
|
||||
:::
|
||||
|
||||
The switch or button is assigned (and enabled) using [RC_MAP_ARM_SW](#RC_MAP_ARM_SW), and the switch "type" is configured using [COM_ARM_SWISBTN](#COM_ARM_SWISBTN).
|
||||
|
||||
| 参数 | 描述 |
|
||||
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| <a id="RC_MAP_ARM_SW"></a>[RC_MAP_ARM_SW](../advanced_config/parameter_reference.md#RC_MAP_ARM_SW) | RC arm switch channel (default: 0 - unassigned). If defined, the specified RC channel (button/switch) is used for arming instead of a stick gesture. <br>**Note:**<br>- This setting _disables the stick gesture_!<br>- This setting applies to RC controllers. It does not apply to Joystick controllers that are connected via _QGroundControl_. |
|
||||
| <a id="COM_ARM_SWISBTN"></a>[COM_ARM_SWISBTN](../advanced_config/parameter_reference.md#COM_ARM_SWISBTN) | Arm switch is a momentary button. <br>- `0`: Arm switch is a 2-position switch where arm/disarm commands are sent on switch transitions.<br>-`1`: Arm switch is a button or momentary button where the arm/disarm command ae sent after holding down button for set time ([COM_RC_ARM_HYST](#COM_RC_ARM_HYST)). |
|
||||
|
||||
:::info
|
||||
The switch can also be set as part of _QGroundControl_ [Flight Mode](../config/flight_mode.md) configuration.
|
||||
:::
|
||||
|
||||
## 自动上锁
|
||||
|
||||
By default vehicles will automatically disarm on landing, or if you take too long to take off after arming.
|
||||
The feature is configured using the following timeouts.
|
||||
|
||||
| 参数 | 描述 |
|
||||
| ----------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| <a id="COM_DISARM_LAND"></a>[COM_DISARM_LAND](../advanced_config/parameter_reference.md#COM_DISARM_LAND) | 降落后自动锁定超时时间. Default: 2s (-1 to disable). |
|
||||
| <a id="COM_DISARM_PRFLT"></a>[COM_DISARM_PRFLT](../advanced_config/parameter_reference.md#COM_DISARM_PRFLT) | Time-out for auto disarm if too slow to takeoff. Default: 10s (<=0 to disable). |
|
||||
|
||||
## Pre-Arm Checks
|
||||
|
||||
To reduce accidents, vehicles are only allowed to arm certain conditions are met (some of which are configurable).
|
||||
Arming is prevented if:
|
||||
|
||||
- The vehicle is not in a "healthy" state.
|
||||
For example it is not calibrated, or is reporting sensor errors.
|
||||
- The vehicle has a [safety switch](../getting_started/px4_basic_concepts.md#safety-switch) that has not been engaged.
|
||||
- The vehicle has a [remote ID](../peripherals/remote_id.md) that is unhealthy or otherwise not ready
|
||||
- A VTOL vehicle is in fixed-wing mode ([by default](../advanced_config/parameter_reference.md#CBRK_VTOLARMING)).
|
||||
- The current mode requires an adequate global position estimate but the vehicle does not have GPS lock.
|
||||
- Many more (see [arming/disarming safety settings](../config/safety.md#arming-disarming-settings) for more information).
|
||||
|
||||
The current failed checks can be viewed in QGroundControl (v4.2.0 and later) [Arming Check Report](../flying/pre_flight_checks.md#qgc-arming-check-report) (see also [Fly View > Arming and Preflight Checks](https://docs.qgroundcontrol.com/master/en/qgc-user-guide/fly_view/fly_view.md#arm)).
|
||||
|
||||
Note that internally PX4 runs arming checks at 10Hz.
|
||||
A list of the failed checks is kept, and if the list changes PX4 emits the current list using the [Events interface](../concept/events_interface.md).
|
||||
The list is also sent out when the GCS connects.
|
||||
Effectively the GCS knows the status of prearm checks immediately, both when disarmed and armed.
|
||||
|
||||
:::details
|
||||
Implementation notes for developers
|
||||
The client implementation is in [libevents](https://github.com/mavlink/libevents):
|
||||
|
||||
- [libevents > Event groups](https://github.com/mavlink/libevents#event-groups)
|
||||
- [health_and_arming_checks.h](https://github.com/mavlink/libevents/blob/main/libs/cpp/parse/health_and_arming_checks.h)
|
||||
|
||||
QGC implementation: [HealthAndArmingCheckReport.cc](https://github.com/mavlink/qgroundcontrol/blob/master/src/MAVLink/LibEvents/HealthAndArmingCheckReport.cc).
|
||||
:::
|
||||
|
||||
PX4 also emits a subset of the arming check information in the [SYS_STATUS](https://mavlink.io/en/messages/common.html#SYS_STATUS) message (see [MAV_SYS_STATUS_SENSOR](https://mavlink.io/en/messages/common.html#MAV_SYS_STATUS_SENSOR)).
|
||||
|
||||
## Arming Sequence: Pre Arm Mode & Safety Button
|
||||
|
||||
The arming sequence depends on whether or not there is a _safety switch_, and is controlled by the parameters [COM_PREARM_MODE](#COM_PREARM_MODE) (Prearm mode) and [CBRK_IO_SAFETY](#CBRK_IO_SAFETY) (I/O safety circuit breaker).
|
||||
|
||||
The [COM_PREARM_MODE](#COM_PREARM_MODE) parameter defines when/if pre-arm mode is enabled ("safe"/non-throttling actuators are able to move):
|
||||
|
||||
- _Disabled_: Pre-arm mode disabled (there is no stage where only "safe"/non-throttling actuators are enabled).
|
||||
- _Safety Switch_ (Default): The pre-arm mode is enabled by the safety switch.
|
||||
If there is no safety switch then pre-arm mode will not be enabled.
|
||||
- _Always_: Prearm mode is enabled from power up.
|
||||
|
||||
If there is a safety switch then this will be a precondition for arming.
|
||||
If there is no safety switch the I/O safety circuit breaker must be engaged ([CBRK_IO_SAFETY](#CBRK_IO_SAFETY)), and arming will depend only on the arm command.
|
||||
|
||||
The sections below detail the startup sequences for the different configurations
|
||||
|
||||
### 默认:COM_PREARM_MODE=Safety and Safety Switch
|
||||
|
||||
The default configuration uses safety switch to prearm.
|
||||
From prearm you can then arm to engage all motors/actuators.
|
||||
It corresponds to: [COM_PREARM_MODE=1](#COM_PREARM_MODE) (safety switch) and [CBRK_IO_SAFETY=0](#CBRK_IO_SAFETY) (I/O safety circuit breaker disabled).
|
||||
|
||||
The default startup sequence is:
|
||||
|
||||
1. Power-up.
|
||||
- All actuators locked into disarmed position
|
||||
- Not possible to arm.
|
||||
2. Safety switch is pressed.
|
||||
- System now prearmed: non-throttling actuators can move (e.g. ailerons).
|
||||
- System safety is off: Arming possible.
|
||||
3. Arm command is issued.
|
||||
|
||||
- The system is armed.
|
||||
- All motors and actuators can move.
|
||||
|
||||
### COM_PREARM_MODE=Disabled and Safety Switch
|
||||
|
||||
When prearm mode is _Disabled_, engaging the safety switch does not unlock the "safe" actuators, though it does allow you to then arm the vehicle.
|
||||
This corresponds to [COM_PREARM_MODE=0](#COM_PREARM_MODE) (Disabled) and [CBRK_IO_SAFETY=0](#CBRK_IO_SAFETY) (I/O safety circuit breaker disabled).
|
||||
|
||||
The startup sequence is:
|
||||
|
||||
1. Power-up.
|
||||
- All actuators locked into disarmed position
|
||||
- Not possible to arm.
|
||||
2. Safety switch is pressed.
|
||||
- _All actuators stay locked into disarmed position (same as disarmed)._
|
||||
- System safety is off: Arming possible.
|
||||
3. Arm command is issued.
|
||||
|
||||
- The system is armed.
|
||||
- All motors and actuators can move.
|
||||
|
||||
### COM_PREARM_MODE=Always and Safety Switch
|
||||
|
||||
When prearm mode is _Always_, prearm mode is enabled from power up.
|
||||
To arm, you still need the safety switch.
|
||||
This corresponds to [COM_PREARM_MODE=2](#COM_PREARM_MODE) (Always) and [CBRK_IO_SAFETY=0](#CBRK_IO_SAFETY) (I/O safety circuit breaker disabled).
|
||||
|
||||
The startup sequence is:
|
||||
|
||||
1. Power-up.
|
||||
- System now prearmed: non-throttling actuators can move (e.g. ailerons).
|
||||
- Not possible to arm.
|
||||
2. Safety switch is pressed.
|
||||
- System safety is off: Arming possible.
|
||||
3. Arm command is issued.
|
||||
- The system is armed.
|
||||
- All motors and actuators can move.
|
||||
|
||||
### COM_PREARM_MODE=Safety or Disabled and No Safety Switch
|
||||
|
||||
With no safety switch, when `COM_PREARM_MODE` is set to _Safety_ or _Disabled_ prearm mode cannot be enabled (same as disarmed).
|
||||
This corresponds to [COM_PREARM_MODE=0 or 1](#COM_PREARM_MODE) (Disabled/Safety Switch) and [CBRK_IO_SAFETY=22027](#CBRK_IO_SAFETY) (I/O safety circuit breaker engaged).
|
||||
|
||||
The startup sequence is:
|
||||
|
||||
1. Power-up.
|
||||
- All actuators locked into disarmed position
|
||||
- System safety is off: Arming possible.
|
||||
2. Arm command is issued.
|
||||
- The system is armed.
|
||||
- All motors and actuators can move.
|
||||
|
||||
### COM_PREARM_MODE=Always and No Safety Switch
|
||||
|
||||
When prearm mode is _Always_, prearm mode is enabled from power up.
|
||||
This corresponds to [COM_PREARM_MODE=2](#COM_PREARM_MODE) (Always) and [CBRK_IO_SAFETY=22027](#CBRK_IO_SAFETY) (I/O safety circuit breaker engaged).
|
||||
|
||||
The startup sequence is:
|
||||
|
||||
1. Power-up.
|
||||
- System now prearmed: non-throttling actuators can move (e.g. ailerons).
|
||||
- System safety is off: Arming possible.
|
||||
2. Arm command is issued.
|
||||
- The system is armed.
|
||||
- All motors and actuators can move.
|
||||
|
||||
### 参数
|
||||
|
||||
| 参数 | 描述 |
|
||||
| -------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| <a id="COM_PREARM_MODE"></a>[COM_PREARM_MODE](../advanced_config/parameter_reference.md#COM_PREARM_MODE) | Condition to enter prearmed mode. `0`: Disabled, `1`: Safety switch (prearm mode enabled by safety switch; if no switch present cannot be enabled), `2`: Always (prearm mode enabled from power up). Default: `1` (safety button). |
|
||||
| <a id="CBRK_IO_SAFETY"></a>[CBRK_IO_SAFETY](../advanced_config/parameter_reference.md#CBRK_IO_SAFETY) | Circuit breaker for IO safety. |
|
||||
|
||||
<!-- Discussion:
|
||||
https://github.com/PX4/PX4-Autopilot/pull/12806#discussion_r318337567
|
||||
https://github.com/PX4/PX4-user_guide/issues/567#issue-486653048
|
||||
-->
|
||||
@@ -0,0 +1,211 @@
|
||||
# 热校准和补偿
|
||||
|
||||
PX4 contains functionality to calibrate and compensate accelerometer, gyro, magnetometer, and barometric pressure sensors for the effect of changing sensor temperature on sensor bias.
|
||||
|
||||
This topic details the [test environment](#test_setup) and [calibration procedures](#calibration_procedures).
|
||||
At the end there is a description of the [implementation](#implementation).
|
||||
|
||||
:::info
|
||||
After thermal calibration, the thermal calibration parameters (`TC_*`) are used for _all_ calibration/compensation of the respective sensors.
|
||||
Any subsequent standard calibration will therefore update `TC_*` parameters and not the "normal" `SYS_CAL_*` calibration parameters (and in some cases these parameters may be reset).
|
||||
:::
|
||||
|
||||
:::info
|
||||
Releases up to PX4 v1.14, do not support thermal calibration of the magnetometer.
|
||||
:::
|
||||
|
||||
<a id="test_setup"></a>
|
||||
|
||||
## 测试设置/最佳实践
|
||||
|
||||
The [calibration procedures](#calibration_procedures) described in the following sections are ideally run in an _environmental chamber_ (a temperature and humidity controlled environment) as the board is heated from the lowest to the highest operating/calibration temperature.
|
||||
Before starting the calibration, the board is first _cold soaked_ (cooled to the minimum temperature and allowed to reach equilibrium).
|
||||
|
||||
:::info
|
||||
Active electric heating elements will affect the magnetometer calibration values.
|
||||
Ensure that heating elements are either inactive or sufficiently far from the sensor to avoid injecting noise into the magnetometer calibration.
|
||||
:::
|
||||
|
||||
对于冷却,您可以使用普通的家用冰箱达到 -20C,商用冰箱可以达到 -40C 的量级。
|
||||
The board should be placed in a ziplock/anti-static bag containing a silica packet, with a power lead coming out through a sealed hole.
|
||||
冷却后,可将袋子移至测试环境,并在同一袋中继续测试。
|
||||
|
||||
:::info
|
||||
The bag/silica is to prevent condensation from forming on the board.
|
||||
:::
|
||||
|
||||
它可以在没有商业级环境房间的情况下进行校准。
|
||||
可以使用内部空间很小的泡沫塑料盒来创造一个简单的环境容器。
|
||||
这允许自驾仪将空气相对快速地自加热(确保盒子有一个小孔以平衡容器内外压力,但仍然能够在容器内加热)。
|
||||
|
||||
使用这种设置可以将电路板加热到约 70C 。
|
||||
经验表明,许多普通电路板可以加热到这个温度不会产生不良副作用。
|
||||
如有疑问,请与制造商核实安全操作的温度范围。
|
||||
|
||||
:::tip
|
||||
To check the status of the onboard thermal calibration use the MAVlink console (or NuttX console) to check the reported internal temp from the sensor.
|
||||
:::
|
||||
|
||||
<a id="calibration_procedures"></a>
|
||||
|
||||
## 校准过程
|
||||
|
||||
PX4 支持两种校准过程:
|
||||
|
||||
- [onboard](#onboard_calibration) - calibration is run on the board itself. 该方法需要知道测试设置中可实现的温升量。
|
||||
- [offboard](#offboard_calibration) - compensation parameters are calculated on a development computer based on log information collected during the calibration procedure. 该方法允许用户可视地检查数据和曲线拟合的质量。
|
||||
|
||||
The offboard approach is more complex and slower, but requires less knowledge of the test setup and is easier to validate.
|
||||
|
||||
<a id="onboard_calibration"></a>
|
||||
|
||||
### 板载校准过程
|
||||
|
||||
Onboard calibration is run entirely on the device. It require knowledge of the amount of temperature rise that is achievable with the test setup.
|
||||
|
||||
To perform and onboard calibration:
|
||||
|
||||
1. 确保在校准前设置机架类型,否则在设置飞控板时校准参数将丢失。
|
||||
2. Power the board and set the `SYS_CAL_*` parameters to 1 to enable calibration of the required sensors at the next startup. [^1]
|
||||
3. Set the [SYS_CAL_TDEL](../advanced_config/parameter_reference.md#SYS_CAL_TDEL) parameter to the number of degrees of temperature rise required for the onboard calibrator to complete. 如果此参数太小,则校准将提前完成,并且校准的温度范围将不足以在电路板完全预热时进行补偿。 如果此参数设置得太大,则板载校准器将永远不会完成。 在设置此参数时,应考虑到电路板自加热导致的温度升高。 如果传感器的温升量未知,则应使用板外校准方法。
|
||||
4. Set the [SYS_CAL_TMIN](../advanced_config/parameter_reference.md#SYS_CAL_TMIN) parameter to the lowest temperature data that you want the calibrator to use. 更低的冷却温度能够用于减少冷却时间,同时保持对校准最低温度的控制。 如果校准器温度低于此参数设置的值,则不会使用传感器的数据。
|
||||
5. Set the [SYS_CAL_TMAX](../advanced_config/parameter_reference.md#SYS_CAL_TMAX) parameter to the highest starting sensor temperature that should be accepted by the calibrator. 如果起始温度高于此参数设置的值,校准将退出并报告错误。 Note that if the variation in measured temperature between different sensors exceeds the gap between `SYS_CAL_TMAX` and `SYS_CAL_TMIN`, then it will be impossible for the calibration to start.
|
||||
6. Remove power and cold soak the board to below the starting temperature specified by the `SYS_CAL_TMIN` parameter. 请注意,在校准开始之前启动过程有10秒的延迟,以允许所有传感器稳定,并且传感器在此期间会内部发热。
|
||||
7. Keeping the board stationary[^2], apply power and warm to a temperature high enough to achieve the temperature rise specified by the `SYS_CAL_TDEL` parameter. 校准期间,完成百分比将打印到系统控制台。 [^3]
|
||||
8. 校准完成后,断开电源,让电路板冷却到校准范围内的温度,然后再执行下一步。
|
||||
9. Perform a 6-point accel calibration via the system console using `commander calibrate accel` or via _QGroundControl_. 如果首次设置电路板,则还需要执行陀螺仪和磁力计校准。
|
||||
10. 在任何传感器校准之后的首次飞行之前,电路板必须重新上电,因为校准带来的突然的偏移变化可能会扰乱导航估计器,并且某些参数直到下次启动时才会被使用它们的算法加载。
|
||||
|
||||
<a id="offboard_calibration"></a>
|
||||
|
||||
### 板外校准过程
|
||||
|
||||
Offboard calibration is run on a development computer using data collected during the calibration test. This method provides a way to visually check the quality of data and curve fit.
|
||||
|
||||
To perform an offboard calibration:
|
||||
|
||||
1. 确保在校准前设置机架类型,否则在设置飞控板时校准参数将丢失。
|
||||
|
||||
2. Power up the board and set the [TC_A_ENABLE](../advanced_config/parameter_reference.md#TC_A_ENABLE), [TC_B_ENABLE](../advanced_config/parameter_reference.md#TC_B_ENABLE), [TC_G_ENABLE](../advanced_config/parameter_reference.md#TC_G_ENABLE), and [TC_M_ENABLE](../advanced_config/parameter_reference.md#TC_M_ENABLE) parameters to `1`.
|
||||
|
||||
3. Set all [CAL_ACC\*](../advanced_config/parameter_reference.md#CAL_ACC0_ID), [CAL_GYRO\*](../advanced_config/parameter_reference.md#CAL_GYRO0_ID), [CAL_MAG\*](../advanced_config/parameter_reference.md#CAL_MAG0_ID), and [CAL_BARO\*](../advanced_config/parameter_reference.md#CAL_BARO0_ID) parameters to defaults.
|
||||
|
||||
4. Set the [SDLOG_MODE](../advanced_config/parameter_reference.md#SDLOG_MODE) parameter to 2 to enable logging of data from boot.
|
||||
|
||||
5. Set the [SDLOG_PROFILE](../advanced_config/parameter_reference.md#SDLOG_PROFILE) checkbox for _thermal calibration_ (bit 2) to log the raw sensor data required for calibration.
|
||||
|
||||
6. 将电路板冷却到操作所需的最低温度。
|
||||
|
||||
7. Apply power and keeping the board still [^2], warm it slowly to the maximum required operating temperature. [^3]
|
||||
|
||||
8. 断开电源并取出 .ulog 文件。
|
||||
|
||||
9. Open a terminal window in the **Firmware/Tools** directory and run the python calibration script:
|
||||
|
||||
```sh
|
||||
python process_sensor_caldata.py <full path name to .ulog file>
|
||||
```
|
||||
|
||||
This will generate a **.pdf** file showing the measured data and curve fits for each sensor, and a **.params** file containing the calibration parameters.
|
||||
|
||||
10. Power the board, connect _QGroundControl_ and load the parameter from the generated **.params** file onto the board using _QGroundControl_. 由于参数的数量,加载它们可能需要一些时间。
|
||||
|
||||
11. After parameters have finished loading, set `SDLOG_MODE` to 1 to re-enable normal logging and remove power.
|
||||
|
||||
12. Power the board and perform a normal accelerometer sensor calibration using _QGroundControl_. 重要的是,此步骤在飞控板处于校准温度范围内进行。 此步骤后的首次飞行之前,应重新启动电路板,因为突然的偏置变化会扰乱导航估计器,并且某些参数直到下次启动时才会被使用它们的算法加载。
|
||||
|
||||
<a id="implementation"></a>
|
||||
|
||||
## 实施细节
|
||||
|
||||
Calibration refers to the process of measuring the change in sensor value across a range of internal temperatures, and performing a polynomial fit on the data to calculate a set of coefficients (stored as parameters) that can be used to correct the sensor data. Compensation refers to the process of using the internal temperature to calculate an offset that is subtracted from the sensor reading to correct for changing offset with temperature
|
||||
|
||||
The accelerometer, gyro, and magnetometer sensor offsets are calculated using a 3rd order polynomial, whereas the barometric pressure sensor offset is calculated using a 5th order polynomial. Example fits are show below:
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
### 校准参数存储
|
||||
|
||||
With the existing parameter system implementation we are limited to storing each value in the struct as a separate entry. To work around this limitation the following logical naming convention is used for the [thermal compensation parameters](../advanced_config/parameter_reference.md#thermal-compensation):
|
||||
|
||||
```sh
|
||||
TC_[type][instance]_[cal_name]_[axis]
|
||||
```
|
||||
|
||||
Where:
|
||||
|
||||
- `type`: is a single character indicating the type of sensor where `A` = accelerometer, `G` = rate gyroscope, `M` = magnetometer, and `B` = barometer.
|
||||
|
||||
- `instance`: is an integer 0,1 or 2 allowing for calibration of up to three sensors of the same `type`.
|
||||
|
||||
- `cal_name`: is a string identifying the calibration value. 它具有可能的值如下:
|
||||
|
||||
- `Xn`: Polynomial coefficient where n is the order of the coefficient, e.g. `X3 * (temperature - reference temperature)**3`.
|
||||
- `SCL`: scale factor.
|
||||
- `TREF`: reference temperature (deg C).
|
||||
- `TMIN`: minimum valid temperature (deg C).
|
||||
- `TMAX`: maximum valid temperature (deg C).
|
||||
|
||||
- `axis`: is an integer 0,1 or 2 indicating that the calibration data is for X,Y or Z axis in the board frame of reference. For the barometric pressure sensor, the `axis` suffix is omitted.
|
||||
|
||||
Examples:
|
||||
|
||||
- [TC_A1_TREF](../advanced_config/parameter_reference.md#TC_A1_TREF) is the reference temperature for the second accelerometer.
|
||||
- [TC_G0_X3_0](../advanced_config/parameter_reference.md#TC_G0_X3_0) is the `^3` coefficient for the first gyro x-axis.
|
||||
|
||||
### 校准参数使用
|
||||
|
||||
The correction for thermal offsets (using the calibration parameters) is performed in the [sensors module](../modules/modules_system.md#sensors).
|
||||
The reference temperature is subtracted from the measured temperature to obtain a delta temperature where:
|
||||
|
||||
```
|
||||
delta = measured_temperature - reference_temperature
|
||||
```
|
||||
|
||||
The delta temperature is then used to calculate a offset, where:
|
||||
|
||||
```
|
||||
offset = X0 + X1*delta + X2*delta**2 + ... + Xn*delta**n
|
||||
```
|
||||
|
||||
The offset and temperature scale factor are then used to correct the sensor measurement where:
|
||||
|
||||
```
|
||||
corrected_measurement = (raw_measurement - offset) * scale_factor
|
||||
```
|
||||
|
||||
If the temperature is above the test range set by the `*_TMIN` and `*_TMAX` parameters, then the measured temperature will be clipped to remain within the limits.
|
||||
|
||||
Correction of the accelerometer, gyroscope, magnetometer, or barometer data is enabled by setting [TC_A_ENABLE](../advanced_config/parameter_reference.md#TC_A_ENABLE), [TC_G_ENABLE](../advanced_config/parameter_reference.md#TC_G_ENABLE), [TC_M_ENABLE](../advanced_config/parameter_reference.md#TC_M_ENABLE), or [TC_B_ENABLE](../advanced_config/parameter_reference.md#TC_B_ENABLE) parameters to 1 respectively.
|
||||
|
||||
### Compatibility with legacy `CAL_*` parameters and commander controlled calibration
|
||||
|
||||
The legacy temperature-agnostic PX4 rate gyro and accelerometer sensor calibration is performed by the commander module and involves adjusting offset, and in the case of accelerometer calibration, scale factor calibration parameters. The offset and scale factor parameters are applied within the driver for each sensor. These parameters are found in the [CAL parameter group](../advanced_config/parameter_reference.md#sensor-calibration).
|
||||
|
||||
Onboard temperature calibration is controlled by the events module and the corrections are applied within the sensors module before the sensor combined uORB topic is published. This means that if thermal compensation is being used, all of the corresponding legacy offset and scale factor parameters must be set to defaults of zero and unity before a thermal calibration is performed. If an on-board temperature calibration is performed, this will be done automatically, however if an offboard calibration is being performed it is important that the legacy `CAL*OFF` and `CAL*SCALE` parameters be reset before calibration data is logged.
|
||||
|
||||
If accel thermal compensation has been enabled by setting the `TC_A_ENABLE` parameter to 1, then the commander controlled 6-point accel calibration can still be performed.
|
||||
However, instead of adjusting the `*OFF` and `*SCALE` parameters in the `CAL` parameter group, these parameters are set to defaults and the thermal compensation `X0` and `SCL` parameters are adjusted instead.
|
||||
|
||||
If gyro thermal compensation has been enabled by setting the `TC_G_ENABLE` parameter to 1, then the commander controlled gyro calibration can still be performed, however it will be used to shift the compensation curve up or down by the amount required to zero the angular rate offset. It achieves this by adjusting the X0 coefficients.
|
||||
|
||||
If magnetometer thermal compensation has been enabled by setting the `TC_M_ENABLE` parameter to 1, then the commander controlled 6-point accel calibration can still be performed.
|
||||
However, instead of adjusting the `*OFF` and `*SCALE` parameters in the `CAL` parameter group, these parameters are set to defaults and the thermal compensation `X0` and `SCL` parameters are adjusted instead.
|
||||
|
||||
### 局限
|
||||
|
||||
Scale factors are assumed to be temperature invariant due to the difficulty associated with measuring these at different temperatures. This limits the usefulness of the accelerometer calibration to those sensor models with stable scale factors. In theory with a thermal chamber or IMU heater capable of controlling IMU internal temperature to within a degree, it would be possible to perform a series of 6 sided accelerometer calibrations and correct the accelerometers for both offset and scale factor. Due to the complexity of integrating the required board movement with the calibration algorithm, this capability has not been included.
|
||||
|
||||
---
|
||||
|
||||
[^1]: The [SYS_CAL_ACCEL](../advanced_config/parameter_reference.md#SYS_CAL_ACCEL), [SYS_CAL_BARO](../advanced_config/parameter_reference.md#SYS_CAL_BARO) and [SYS_CAL_GYRO](../advanced_config/parameter_reference.md#SYS_CAL_GYRO) parameters are reset to 0 when the calibration is started.
|
||||
|
||||
[^2]: 气压传感器偏置的校准需要一个稳定的气压环境。 The air pressure will change slowly due to weather and inside buildings can change rapidly due to external wind fluctuations and HVAC system operation.
|
||||
|
||||
[^3]: Care must be taken when warming a cold soaked board to avoid formation of condensation on the board that can cause board damage under some circumstances.
|
||||
@@ -0,0 +1,42 @@
|
||||
# 静态压力生成
|
||||
|
||||
Air flowing over an enclosed vehicle can cause the _static pressure_ to change within the canopy/hull.
|
||||
Depending on the location of holes/leaks in the hull, you can end up with under or overpressure (similar to a wing).
|
||||
|
||||
The change in pressure can affect barometer measurements, leading to an inaccurate altitude estimate.
|
||||
This might manifest as the vehicle losing altitude when it stops moving in [Altitude](../flight_modes_mc/altitude.md), [Position](../flight_modes_mc/position.md) or [Mission](../flight_modes_mc/mission.md) modes (when the vehicle stops moving the static pressure drops, the sensor reports a higher altitude, and the vehicle compensates by descending).
|
||||
The problem is particularly visible on multicopters because fixed wing vehicles move with a more constant airspeed (and it is the airspeed deltas that are noticeable).
|
||||
|
||||
One solution is to use foam-filled venting holes to reduce the buildup (as much as possible) and then attempt dynamic calibration to remove any remaining effects.
|
||||
|
||||
:::tip
|
||||
Before "fixing" the problem you should first check that the Z setpoint tracks the estimated altitude (to verify that there are no controller issues).
|
||||
:::
|
||||
|
||||
:::info
|
||||
While it is possible to remove the barometer from the altitude estimate (i.e. only use altitude from the GPS), this is not recommended.
|
||||
GPS is inaccurate in many environments, and particularly in urban environments where you have signal reflections off buildings.
|
||||
:::
|
||||
|
||||
## Airflow Analysis
|
||||
|
||||
You can modify the hull by drilling holes or filling them with foam.
|
||||
|
||||
One way to analyse the effects of these changes is to mount the drone on a car and drive around (on a relatively level surface) with the hull exposed to air/wind.
|
||||
By looking at the ground station you can review the effects of movement-induced static pressure changes on the measured altitude (using the road as "ground truth).
|
||||
|
||||
This process allows rapid iteration without draining batteries: modify drone, drive/review, repeat!
|
||||
|
||||
:::tip
|
||||
Aim for a barometer altitude drop of less than 2 metres at maximum horizontal speed before attempting software-based calibration below.
|
||||
:::
|
||||
|
||||
## Dynamic Calibration
|
||||
|
||||
After modifying the hardware, you can then use the [EKF2_PCOEF\_\*](../advanced_config/parameter_reference.md#EKF2_PCOEF_XN) parameters to tune for expected barometer variation based on relative air velocity.
|
||||
For more information see [Using PX4's Navigation Filter (EKF2) > Correction for Static Pressure Position Error](../advanced_config/tuning_the_ecl_ekf.md#correction-for-static-pressure-position-error).
|
||||
|
||||
:::info
|
||||
The approach works well if the relationship between the error due to static pressure and the velocity varies linearly.
|
||||
If the vehicle has a more complex aerodynamic model it will be less effective.
|
||||
:::
|
||||
@@ -0,0 +1,848 @@
|
||||
# Using PX4's Navigation Filter (EKF2)
|
||||
|
||||
This tutorial answers common questions about use of the EKF algorithm used for navigation.
|
||||
|
||||
:::tip
|
||||
The [PX4 State Estimation Overview](https://youtu.be/HkYRJJoyBwQ) video from the _PX4 Developer Summit 2019_ (Dr. Paul Riseborough) provides an overview of the estimator, and additionally describes both the major changes from 2018/2019, major changes and improvements were added since then.
|
||||
:::
|
||||
|
||||
## 综述
|
||||
|
||||
PX4's Navigation filter uses an Extended Kalman Filter (EKF) algorithm to process sensor measurements and provide an estimate of the following states:
|
||||
|
||||
- Quaternion defining the rotation from North, East, Down local navigation frame to X, Y, Z body frame
|
||||
- IMU 处的速度 - 北,东,地 \(m/s)
|
||||
- Position at the IMU - Latitude (rad), Longitude (rad), Altitude (m)
|
||||
- IMU gyro bias estimates - X, Y, Z (rad/s)
|
||||
- IMU accelerometer bias estimates - X, Y, Z (m/s<sup>2</sup>)
|
||||
- 地球磁场组分 - 北,东,地 \(gauss\)
|
||||
- 飞行器机体坐标系磁场偏差 - X, Y, Z \(gauss\)
|
||||
- 风速-北, 东\(m/s\)
|
||||
- Terrain altitude (m)
|
||||
|
||||
To improve stability, an "error-state" formulation is implemented
|
||||
This is especially relevant when estimating the uncertainty of a rotation which is a 3D vector (tangent space of SO(3)).
|
||||
|
||||
EKF 在延迟的“融合时间范围”上运行,以允许相对于 IMU 的每次测量的不同时间延迟。
|
||||
为了保证所有传感器数据都能在正确的时间内使用,每个传感器的数据都是按照先入先出(FIFO)队列进行缓存,并由EKF从缓存区中读取。
|
||||
The delay compensation for each sensor is controlled by the [EKF2\_\*\_DELAY](../advanced_config/parameter_reference.md#ekf2) parameters.
|
||||
|
||||
互补滤波器用于使用缓冲的 IMU 数据将状态从“融合时间范围”向前传播到当前时间。
|
||||
The time constant for this filter is controlled by the [EKF2_TAU_VEL](../advanced_config/parameter_reference.md#EKF2_TAU_VEL) and [EKF2_TAU_POS](../advanced_config/parameter_reference.md#EKF2_TAU_POS) parameters.
|
||||
|
||||
:::info
|
||||
The 'fusion time horizon' delay and length of the buffers is determined by [EKF2_DELAY_MAX](../advanced_config/parameter_reference.md#EKF2_DELAY_MAX).
|
||||
This value should be at least as large as the longest delay `EKF2\_\*\_DELAY`.
|
||||
减少“融合时间范围”延迟减少了用于将状态向前传播到当前时间的互补滤波器中的误差。
|
||||
:::
|
||||
|
||||
EKF仅将IMU数据用于状态预测。
|
||||
在EKF推导中,IMU数据不作为观测值使用。
|
||||
The algebraic equations for the covariance prediction and measurement jacobians are derived using [SymForce](https://symforce.org/) and can be found here: [Symbolic Derivation](https://github.com/PX4/PX4-Autopilot/blob/main/src/modules/ekf2/EKF/python/ekf_derivation/derivation.py).
|
||||
Covariance update is done using the [Joseph Stabilized form](https://en.wikipedia.org/wiki/Kalman_filter#Deriving_the_posteriori_estimate_covariance_matrix) to improve numerical stability and allow conditional update of independent states.
|
||||
|
||||
### Precisions about the position output
|
||||
|
||||
The position is estimated as latitude, longitude and altitude and the INS integration is performed using the WGS84 ellipsoid mode.
|
||||
However, the position uncertainty is defined in the local navigation frame at the current position (i.e.: NED error in meters).
|
||||
|
||||
位置及速度状态变量在输出至控制回路之前会根据IMU与机体坐标系之间的偏差量进行修正。
|
||||
|
||||
The position of the IMU relative to the body frame is set by the `EKF2_IMU_POS_X,Y,Z` parameters.
|
||||
|
||||
In addition to the global position estimate in latitude/longitude/altitude, the filter also provides a local position estimate (NED in meters) by projecting the global position estimate using an [azimuthal_equidistant_projection](https://en.wikipedia.org/wiki/Azimuthal_equidistant_projection) centred on an arbitrary origin.
|
||||
This origin is automatically set when global position measurements are fused but can also be specified manually.
|
||||
If no global position information is provided, only the local position is available and the INS integration is performed on a spherical Earth.
|
||||
|
||||
## 运行单个EKF实例
|
||||
|
||||
The _default behaviour_ is to run a single instance of the EKF.
|
||||
在这种情况下,在EKF收到数据之前执行传感器选择和故障切换。
|
||||
这为防止有限数量的传感器故障,如数据丢失等,提供了保护。 但不能防止传感器提供的不准确数据超过EKF和控制循环的补偿能力。
|
||||
|
||||
运行单个EKF实例的参数设置为:
|
||||
|
||||
- [EKF2_MULTI_IMU](../advanced_config/parameter_reference.md#EKF2_MULTI_IMU) = 0
|
||||
- [EKF2_MULTI_MAG](../advanced_config/parameter_reference.md#EKF2_MULTI_MAG) = 0
|
||||
- [SENS_IMU_MODE](../advanced_config/parameter_reference.md#SENS_IMU_MODE) = 1
|
||||
- [SENS_MAG_MODE](../advanced_config/parameter_reference.md#SENS_MAG_MODE) = 1
|
||||
|
||||
## 运行多个EKF实例
|
||||
|
||||
根据IMU和磁强计的数量以及自动驾驶仪的CPU能力,EKF可以运行多个实例。
|
||||
这提供了一系列更广泛的传感器错误的保护,每个EKF实例使用不同的传感器组合实现了这一点。
|
||||
通过比较每个EKF实例的内部一致性,EKF选择器能够确定具有最佳数据一致性的EKF和传感器组合。
|
||||
这样可以检测和隔离IMU偏差、饱和或数据卡住等故障。
|
||||
|
||||
The total number of EKF instances is the product of the number of IMU's and number of magnetometers selected by [EKF2_MULTI_IMU](../advanced_config/parameter_reference.md#EKF2_MULTI_IMU) and [EKF2_MULTI_MAG](../advanced_config/parameter_reference.md#EKF2_MULTI_MAG) and is given by the following formula:
|
||||
|
||||
> N_instances = MAX([EKF2_MULTI_IMU](../advanced_config/parameter_reference.md#EKF2_MULTI_IMU) , 1) x MAX([EKF2_MULTI_MAG](../advanced_config/parameter_reference.md#EKF2_MULTI_MAG) , 1)
|
||||
|
||||
例如,一个带有 2 个IMU和 2 个磁强计的自动化驾驶仪可以在 EKF2_MULTI_IMU = 2 和 EKF2_MULTI_MAG = 2 的情况下运行,总共 4 个EKF实例,其中每个实例使用以下传感器组合:
|
||||
|
||||
- EKF instance 1 : IMU 1, magnetometer 1
|
||||
- EKF instance 2 : IMU 1, magnetometer 2
|
||||
- EKF instance 3 : IMU 2, magnetometer 1
|
||||
- EKF instance 4 : IMU 2, magnetometer 2
|
||||
|
||||
可处理的IMU或磁强计传感器的最大数量为每种传感器有4个,因此理论上最大有 4 x 4 = 16 个EKF实例。
|
||||
实际上,这种做法受到现有计算资源的限制。
|
||||
在开发这一功能的过程中,使用基于STM32F7的硬件的CPU进行测试,结果显示 4 个EKF实例具有可接受的处理负载和内存利用率裕度。
|
||||
|
||||
:::warning
|
||||
Ground based testing to check CPU and memory utilisation should be performed before flying.
|
||||
:::
|
||||
|
||||
If [EKF2_MULTI_IMU](../advanced_config/parameter_reference.md#EKF2_MULTI_IMU) >= 3, then the failover time for large rate gyro errors is further reduced because the EKF selector is able to apply a median select strategy for faster isolation of the faulty IMU.
|
||||
|
||||
多EKF实例的设置由以下参数控制:
|
||||
|
||||
- [SENS_IMU_MODE](../advanced_config/parameter_reference.md#SENS_IMU_MODE):
|
||||
Set to 0 if running multiple EKF instances with IMU sensor diversity, ie [EKF2_MULTI_IMU](../advanced_config/parameter_reference.md#EKF2_MULTI_IMU) > 1.
|
||||
|
||||
当设置为 1 (单个EKF 操作默认值)时,传感器模块选择EKF使用的IMU 数据。
|
||||
这种保护可防止来自传感器的数据丢失,但并不能防止不良的传感器数据。
|
||||
当设置为 0 时,传感器模块不进行选择。
|
||||
|
||||
- [SENS_MAG_MODE](../advanced_config/parameter_reference.md#SENS_MAG_MODE):
|
||||
Set to 0 if running multiple EKF instances with magnetometer sensor diversity, ie [EKF2_MULTI_MAG](../advanced_config/parameter_reference.md#EKF2_MULTI_MAG) > 1.
|
||||
|
||||
当设置为 1 (单个EKF 操作默认值)时,传感器模块选择EKF使用的磁强计数据。
|
||||
这种保护可防止来自传感器的数据丢失,但并不能防止不良的传感器数据。
|
||||
当设置为 0 时,传感器模块不进行选择。
|
||||
|
||||
- [EKF2_MULTI_IMU](../advanced_config/parameter_reference.md#EKF2_MULTI_IMU):
|
||||
This parameter specifies the number of IMU sensors used by the multiple EKF's.
|
||||
If `EKF2_MULTI_IMU` <= 1, then only the first IMU sensor will be used.
|
||||
When [SENS_IMU_MODE](../advanced_config/parameter_reference.md#SENS_IMU_MODE) = 1, this will be the sensor selected by the sensor module.
|
||||
If `EKF2_MULTI_IMU` >= 2, then a separate EKF instance will run for the specified number of IMU sensors up to the lesser of 4 or the number of IMU's present.
|
||||
|
||||
- [EKF2_MULTI_MAG](../advanced_config/parameter_reference.md#EKF2_MULTI_MAG):
|
||||
This parameter specifies the number of magnetometer sensors used by the multiple EKF's
|
||||
If `EKF2_MULTI_MAG` <= 1, then only the first magnetometer sensor will be used.
|
||||
When [SENS_MAG_MODE](../advanced_config/parameter_reference.md#SENS_MAG_MODE) = 1, this will be the sensor selected by the sensor module.
|
||||
If `EKF2_MULTI_MAG` >= 2, then a separate EKF instance will run for the specified number of magnetometer sensors up to the lesser of 4 or the number of magnetometers present.
|
||||
|
||||
:::info
|
||||
The recording and [EKF2 replay](../debug/system_wide_replay.md#ekf2-replay) of flight logs with multiple EKF instances is not supported.
|
||||
To enable recording for EKF replay you must set the parameters to enable a [single EKF instance](#running-a-single-ekf-instance).
|
||||
:::
|
||||
|
||||
## 它使用什么传感器测量值?
|
||||
|
||||
EKF 具有不同的操作模式,以允许不同的传感器测量组合。
|
||||
滤波器在启动时会检查传感器的最小可行组合,并且在完成初始倾斜,偏航和高度对准之后,进入提供旋转,垂直速度,垂直位置,IMU 增量角度偏差和 IMU 增量速度偏差估计的模式。
|
||||
|
||||
此模式需要 IMU 数据,一个偏航源(磁力计或外部视觉)和一个高度数据源。
|
||||
所有EKF操作模式都需要这个最小数据集。
|
||||
在此基础上可以使用其它传感器数据来估计额外的状态变量。
|
||||
|
||||
### IMU
|
||||
|
||||
- 三轴机体固连惯性测量单元,以最小100Hz的频率获取增量角度和增量速度数据 。
|
||||
注意:在 EKF 使用它们之前,应该使用圆锥校正算法校正 IMU 增量角度数据。
|
||||
|
||||
### 磁罗盘
|
||||
|
||||
Three axis body fixed magnetometer data at a minimum rate of 5Hz is required to be considered by the estimator.
|
||||
|
||||
::: info
|
||||
|
||||
- The magnetometer **biases** are only observable while the drone is rotating
|
||||
- The true heading is observable when the vehicle is accelerating (linear acceleration) while absolute position or velocity measurements are fused (e.g. GPS).
|
||||
This means that magnetometer heading measurements are optional after initialization if those conditions are met often enough to constrain the heading drift (caused by gyro bias).
|
||||
|
||||
:::
|
||||
|
||||
Magnetometer data fusion can be configured using [EKF2_MAG_TYPE](../advanced_config/parameter_reference.md#EKF2_MAG_TYPE):
|
||||
|
||||
0. Automatic:
|
||||
- The magnetometer readings only affect the heading estimate before arming, and the whole attitude after arming.
|
||||
- Heading and tilt errors are compensated when using this method.
|
||||
- Incorrect magnetic field measurements can degrade the tilt estimate.
|
||||
- The magnetometer biases are estimated whenever observable.
|
||||
1. Magnetic heading:
|
||||
- Only the heading is corrected.
|
||||
The tilt estimate is never affected by incorrect magnetic field measurements.
|
||||
- Tilt errors that could arise when flying without velocity/position aiding are not corrected when using this method.
|
||||
- The magnetometer biases are estimated whenever observable.
|
||||
2. Deprecated
|
||||
3. Deprecated
|
||||
4. Deprecated
|
||||
5. None:
|
||||
- Magnetometer data is never used.
|
||||
This is useful when the data can never be trusted (e.g.: high current close to the sensor, external anomalies).
|
||||
- The estimator will use other sources of heading: [GPS heading](#yaw-measurements) or external vision.
|
||||
- When using GPS measurements without another source of heading, the heading can only be initialized after sufficient horizontal acceleration.
|
||||
See [Estimate yaw from vehicle movement](#yaw-from-gps-velocity) below.
|
||||
6. Init only:
|
||||
- Magnetometer data is only used to initialize the heading estimate.
|
||||
This is useful when the data can be used before arming but not afterwards (e.g.: high current after the vehicle is armed).
|
||||
- After initialization, the heading is constrained using other observations.
|
||||
- Unlike mag type `None`, when combined with GPS measurements, this method allows position controlled modes to run directly during takeoff.
|
||||
|
||||
The following selection tree can be used to select the right option:
|
||||
|
||||

|
||||
|
||||
### 高度
|
||||
|
||||
A source of height data - GPS, barometric pressure, range finder, external vision or a combination of those at a minimum rate of 5Hz is required.
|
||||
|
||||
If none of the selected measurements are present, the EKF will not start.
|
||||
当检测到这些测量值时,EKF 将初始化状态并完成倾角和偏航对准。
|
||||
当倾角和偏航对齐完成后,EKF 可以转换到其它操作模式,从而可以使用其它传感器数据:
|
||||
|
||||
Each height source can be enabled/disabled using its dedicated control parameter:
|
||||
|
||||
- [GNSS/GPS](#gnss-gps): [EKF2_GPS_CTRL](../advanced_config/parameter_reference.md#EKF2_GPS_CTRL)
|
||||
- [Barometer](#barometer): [EKF2_BARO_CTRL](../advanced_config/parameter_reference.md#EKF2_BARO_CTRL)
|
||||
- [Range finder](#range-finder): [EKF2_RNG_CTRL](../advanced_config/parameter_reference.md#EKF2_RNG_CTRL)
|
||||
- [External vision](#external-vision-system): Enabled when [EKF2_HGT_REF](../advanced_config/parameter_reference.md#EKF2_HGT_REF) is set to "Vision"
|
||||
|
||||
Over the long term the height estimate follows the "reference source" of height data.
|
||||
This reference is defined by the [EKF2_HGT_REF](../advanced_config/parameter_reference.md#EKF2_HGT_REF) parameter.
|
||||
|
||||
#### Typical configurations
|
||||
|
||||
| | [EKF2_GPS_CTRL](../advanced_config/parameter_reference.md#EKF2_GPS_CTRL) | [EKF2_BARO_CTRL](../advanced_config/parameter_reference.md#EKF2_BARO_CTRL) | [EKF2_RNG_CTRL](../advanced_config/parameter_reference.md#EKF2_RNG_CTRL) | [EKF2_HGT_REF](../advanced_config/parameter_reference.md#EKF2_HGT_REF) |
|
||||
| -------------------------------------------- | ------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------- |
|
||||
| Outdoor (default) | 7 (Lon/lat/alt/vel) | 1 (enabled) | 1 ([conditional](#conditional-range-aiding)) | 1 (GNSS) |
|
||||
| Indoor (non-flat terrain) | 0 (disabled) | 1 (enabled) | 1 ([conditional](#conditional-range-aiding)) | 2 (range) |
|
||||
| Indoor (flat terrain) | 0 (disabled) | 1 (enabled) | 2 ([always enabled](#range-height-fusion)) | 2 (range) |
|
||||
| External vision | As required | As required | As required | 3 (vision) |
|
||||
|
||||
### Barometer
|
||||
|
||||
Enable/disable using [EKF2_BARO_CTRL](../advanced_config/parameter_reference.md#EKF2_BARO_CTRL) as a source for [Height](#height) data.
|
||||
|
||||
Note that data from only one barometer is fused, even if multiple barometers are available.
|
||||
The barometer with the highest [CAL_BAROx_PRIO](../advanced_config/parameter_reference.md#CAL_BARO0_PRIO) priority value is selected first, falling back to the next highest priority barometer if a sensor fault is detected.
|
||||
If barometers have equal-highest priorities, the first detected is used.
|
||||
A barometer can be completely disabled as a possible source by setting its `CAL_BAROx_PRIO` value to `0` (disabled).
|
||||
|
||||
See [Height](#height) more details about the configuration of height sources.
|
||||
|
||||
#### 静态气压位置误差校正
|
||||
|
||||
气压表示的海拔高度因机体风的相对速度和方向造成的空气动力扰动而发生误差。
|
||||
This is known in aeronautics as _static pressure position error_.
|
||||
使用ECL/EKF2估计器库的EKF2模块提供了补偿这些误差的方法,只要风速状态估计是激活的。
|
||||
|
||||
For vehicles operating in a fixed-wing mode, wind speed state estimation requires either [Airspeed](#airspeed) and/or [Synthetic Sideslip](#synthetic-sideslip) fusion to be enabled.
|
||||
|
||||
For multi-rotors, fusion of [Drag Specific Forces](#mc_wind_estimation_using_drag) can be enabled and tuned to provide the required wind velocity state estimates.
|
||||
|
||||
EKF2模块将误差建模为与机体固连的椭球体,在将其转换为高度估计之前,它指定了从大气气压中加/减的动态气压的分量。
|
||||
|
||||
以下方法可获得良好的调参参数:
|
||||
|
||||
1. Fly once in [Position mode](../flight_modes_mc/position.md) repeatedly forwards/backwards/left/right/up/down between rest and maximum speed (best results are obtained when this testing is conducted in still conditions).
|
||||
|
||||
2. Extract the `.ulg` log file using, for example, [QGroundControl: Analyze > Log Download](https://docs.qgroundcontrol.com/master/en/qgc-user-guide/analyze_view/log_download.html)
|
||||
|
||||
::: info
|
||||
The same log file can be used to tune the [multirotor wind estimator](#mc_wind_estimation_using_drag).
|
||||
|
||||
:::
|
||||
|
||||
3. Use the log with the [baro_static_pressure_compensation_tuning.py](https://github.com/PX4/PX4-Autopilot/tree/main/src/modules/ekf2/EKF/python/tuning_tools/baro_static_pressure_compensation) Python script to obtain the optimal set of parameters.
|
||||
|
||||
调整参数:
|
||||
|
||||
- [EKF2_PCOEF_XP](../advanced_config/parameter_reference.md#EKF2_PCOEF_XP)
|
||||
- [EKF2_PCOEF_XN](../advanced_config/parameter_reference.md#EKF2_PCOEF_XN)
|
||||
- [EKF2_PCOEF_YP](../advanced_config/parameter_reference.md#EKF2_PCOEF_YP)
|
||||
- [EKF2_PCOEF_YN](../advanced_config/parameter_reference.md#EKF2_PCOEF_YN)
|
||||
- [EKF2_PCOEF_Z](../advanced_config/parameter_reference.md#EKF2_PCOEF_Z)
|
||||
|
||||
#### Barometer bias compensation
|
||||
|
||||
A barometer at a constant altitude is subject to drift in its measurements due to changes in the ambient pressure environment or variations of the sensor temperature.
|
||||
To compensate for this measurement error, EKF2 estimates the bias using GNSS height (if available) a "non drifting" reference.
|
||||
No tuning is required.
|
||||
|
||||
### GNSS/GPS
|
||||
|
||||
#### 位置和速度测量
|
||||
|
||||
如果满足以下条件,GPS 测量将用于位置和速度:
|
||||
|
||||
- GPS use is enabled via setting of the [EKF2_GPS_CTRL](../advanced_config/parameter_reference.md#EKF2_GPS_CTRL) parameter.
|
||||
- GPS 信号质量检查已通过。
|
||||
These checks are controlled by the [EKF2_GPS_CHECK](../advanced_config/parameter_reference.md#EKF2_GPS_CHECK) and `EKF2_REQ_*` parameters.
|
||||
|
||||
For more details about the configuration of height sources, [click here](#height).
|
||||
|
||||
#### 偏航角测量
|
||||
|
||||
Some GPS receivers such as the [Trimble MB-Two RTK GPS receiver](https://www.trimble.com/Precision-GNSS/MB-Two-Board.aspx) can be used to provide a heading measurement that replaces the use of magnetometer data.
|
||||
在存在大型磁场异常的环境中工作时,或在高纬度地区,地球磁场具有很大的磁倾角时,这可能是一个重要的优势。
|
||||
Use of GPS yaw measurements is enabled by setting bit position 3 to 1 (adding 8) in the [EKF2_GPS_CTRL](../advanced_config/parameter_reference.md#EKF2_GPS_CTRL) parameter.
|
||||
|
||||
#### 从 GPS 速度数据获取偏航角
|
||||
|
||||
EKF在内部运行一个附加的多假设滤波器,它使用多个3-状态---北/东向(N/E)的速度和偏航角---的扩展卡尔曼滤波器(EKF)。
|
||||
然后使用高斯加和滤波器(GSF)合并这些偏航角的估计值。
|
||||
单个3-状态的EKF使用了IMU和GPS水平速度数据(加上可选的空速数据),而不依赖于事先对偏航角或磁强计测量有任何知识。
|
||||
这里提供了一个对于主滤波器的偏航角备份,当起飞后导航丢失,表明磁力计的偏航估计值不好时,它被用于重置主 EKF 滤波器的24-状态的中的偏航数据。
|
||||
This will result in an `Emergency yaw reset - magnetometer use stopped` message information message at the GCS.
|
||||
|
||||
Data from this estimator is logged when ekf2 replay logging is enabled and can be viewed in the `yaw_estimator_status` message.
|
||||
The individual yaw estimates from the individual 3-state EKF yaw estimators are in the `yaw` fields.
|
||||
The GSF combined yaw estimate is in the `yaw_composite` field.
|
||||
The variance for the GSF yaw estimate is in the `yaw_variance` field.
|
||||
所有角度的单位均为弧度。
|
||||
Weightings applied by the GSF to the individual 3-state EKF outputs are in the`weight` fields.
|
||||
|
||||
这也使得 ECL 能够在没有任何磁力计、或没有双天线 GPS 接收器的情况下运行,并提供偏航数据,只要起飞后能够进行某种水平的移动,偏航数据就变得可观测。
|
||||
To use this feature, set [EKF2_MAG_TYPE](../advanced_config/parameter_reference.md#EKF2_MAG_TYPE) to `none` (5) to disable magnetometer use.
|
||||
一旦机体完成了足够的水平移动,使偏航角可观测, 24-状态的主EKF将使其偏航角与GSF的估计值对齐,并开始使用 GPS。
|
||||
|
||||
#### 双 GPS 接收器
|
||||
|
||||
GPS接收器提供的数据可以用基于所报告数据的精确度的加权算法混合(如果两者都以相同的速度输出数据并使用相同的精确度,这样做效果最好)。
|
||||
如果来自接收器的数据丢失,该机制还提供了自动故障转移,(例如,它允许使用标准 GPS 作为更精确的 RTK 接收器的备份)。
|
||||
This is controlled by the [SENS_GPS_MASK](../advanced_config/parameter_reference.md#SENS_GPS_MASK) parameter.
|
||||
|
||||
The [SENS_GPS_MASK](../advanced_config/parameter_reference.md#SENS_GPS_MASK) parameter is set by default to disable blending and always use the first receiver, so it will have to be set to select which receiver accuracy metrics are used to decide how much each receiver output contributes to the blended solution.
|
||||
Where different receiver models are used, it is important that the [SENS_GPS_MASK](../advanced_config/parameter_reference.md#SENS_GPS_MASK) parameter is set to a value that uses accuracy metrics that are supported by both receivers.
|
||||
For example do not set bit position 0 to `true` unless the drivers for both receivers publish values in the `s_variance_m_s` field of the `vehicle_gps_position` message that are comparable.
|
||||
由于精确度定义方法不同,例如 CEP 对比 1-sigma 等等,不同制造商的接收器可能很难做到这一点。
|
||||
|
||||
在设置过程中应检查以下条目:
|
||||
|
||||
- 验证第二接收器的数据是否存在。
|
||||
This will be logged as `vehicle_gps_position_1` and can also be checked when connected via the _nsh console_ using the command `listener vehicle_gps_position -i 1`.
|
||||
The [GPS_2_CONFIG](../advanced_config/parameter_reference.md#GPS_2_CONFIG) parameter will need to be set correctly.
|
||||
- Check the `s_variance_m_s`, `eph` and `epv` data from each receiver and decide which accuracy metrics can be used.
|
||||
If both receivers output sensible `s_variance_m_s` and `eph` data, and GPS vertical position is not being used directly for navigation, then setting [SENS_GPS_MASK](../advanced_config/parameter_reference.md#SENS_GPS_MASK) to 3 is recommended.
|
||||
Where only `eph` data is available and both receivers do not output `s_variance_m_s` data, set [SENS_GPS_MASK](../advanced_config/parameter_reference.md#SENS_GPS_MASK) to 2.
|
||||
Bit position 2 would only be set if the GPS had been selected as the reference height source with the [EKF2_HGT_REF](../advanced_config/parameter_reference.md#EKF2_HGT_REF) parameter and both receivers output sensible `epv` data.
|
||||
- The output from the blended receiver data is logged as `ekf_gps_position`, and can be checked whilst connect via the nsh terminal using the command `listener ekf_gps_position`.
|
||||
- 如果接收器以不同的频率输出, 混合输出的频率将是较低的接收器的频率。
|
||||
在可能的情况下,接收器应配置为同样的输出频率。
|
||||
|
||||
#### 全球导航卫星系统性能要求
|
||||
|
||||
For the ECL to accept GNSS data for navigation, certain minimum requirements need to be satisfied over a period of time, defined by [EKF2_REQ_GPS_H](../advanced_config/parameter_reference.md#EKF2_REQ_GPS_H) (10 seconds by default).
|
||||
|
||||
Minima are defined in the [EKF2_REQ_\*](../advanced_config/parameter_reference.md#EKF2_REQ_EPH) parameters and each check can be enabled/disabled using the [EKF2_GPS_CHECK](../advanced_config/parameter_reference.md#EKF2_GPS_CHECK) parameter.
|
||||
|
||||
下表显示了从全球导航卫星系统数据中直接报告或计算的各种衡量标准,以及ECL使用的数据的最低要求值。
|
||||
In addition, the _Average Value_ column shows typical values that might reasonably be obtained from a standard GNSS module (e.g. u-blox M8 series) - i.e. values that are considered good/acceptable.
|
||||
|
||||
| 指标 | 最小需求 | 平均值 | 单位 | 备注 |
|
||||
| -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------- | --- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| eph | < 3 ([EKF2_REQ_EPH](../advanced_config/parameter_reference.md#EKF2_REQ_EPH)) | 0.8 | m | 水平位置误差的标准偏差 |
|
||||
| epv | < 5 ([EKF2_REQ_EPV](../advanced_config/parameter_reference.md#EKF2_REQ_EPV)) | 1.5 | m | 垂直位置误差的标准偏差 |
|
||||
| Number of satellites | ≥6 ([EKF2_REQ_NSATS](../advanced_config/parameter_reference.md#EKF2_REQ_NSATS)) | 14 | - | |
|
||||
| sacc | < 0.5 ([EKF2_REQ_SACC](../advanced_config/parameter_reference.md#EKF2_REQ_SACC)) | 0.2 | m/s | 水平速度误差的标准偏差 |
|
||||
| fix type | ≥ 3 | 4 | - | 0-1: 不修正, 2: 2D 修正, 3: 3D 修正, 4: RTCM 编码差分, 5: 实时动态定位, 浮动, 6: 实时动态定位, 固定, 8: 外推 |
|
||||
| PDOP | < 2.5 ([EKF2_REQ_PDOP](../advanced_config/parameter_reference.md#EKF2_REQ_PDOP)) | 1.0 | - | 精度降低位置 |
|
||||
| hpos drift rate | < 0.1 ([EKF2_REQ_HDRIFT](../advanced_config/parameter_reference.md#EKF2_REQ_HDRIFT)) | 0.01 | m/s | 根据所报告的全球导航卫星系统位置计算出的漂移率(在固定状态时)。 |
|
||||
| vpos drift rate | < 0.2 ([EKF2_REQ_VDRIFT](../advanced_config/parameter_reference.md#EKF2_REQ_VDRIFT)) | 0.02 | m/s | 根据所报告的全球导航卫星系统高度计算出的漂移率(在固定时)。 |
|
||||
| hspd | < 0.1 ([EKF2_REQ_HDRIFT](../advanced_config/parameter_reference.md#EKF2_REQ_HDRIFT)) | 0.01 | m/s | 所报告的全球导航卫星系统横向速度的筛选星等。 |
|
||||
| vspd | < 0.2 ([EKF2_REQ_VDRIFT](../advanced_config/parameter_reference.md#EKF2_REQ_VDRIFT)) | 0.02 | m/s | 所报告的全球导航卫星系统垂直速度的滤波量级。 |
|
||||
|
||||
:::info
|
||||
The `hpos_drift_rate`, `vpos_drift_rate` and `hspd` are calculated over a period of 10 seconds and published in the `ekf2_gps_drift` topic.
|
||||
Note that `ekf2_gps_drift` is not logged!
|
||||
:::
|
||||
|
||||
### 测距仪
|
||||
|
||||
[Range finder](../sensor/rangefinders.md) distance to ground is used by a single state filter to estimate the vertical position of the terrain relative to the height datum.
|
||||
|
||||
The fusion modes of operation are controlled by [EKF2_RNG_CTRL](../advanced_config/parameter_reference.md#EKF2_RNG_CTRL):
|
||||
|
||||
1. [Conditional range aiding](#conditional-range-aiding)
|
||||
2. [Range height fusion](#range-height-fusion)
|
||||
|
||||
For more details about the configuration of height sources, [click here](#height).
|
||||
|
||||
#### Conditional range aiding
|
||||
|
||||
Conditional range finder fusion (a.k.a. _Conditional range aid_) activates the range finder fusion for height estimation during low speed/low altitude operation (in addition to the other active height sources).
|
||||
If the range finder is set as the reference height source (using [EKF2_HGT_REF](../advanced_config/parameter_reference.md#EKF2_HGT_REF)), the other active height sources such as baro and GNSS altitude will adjust their measurement to match the readings of the range finder over time.
|
||||
When the conditions are not met to start range aiding, a secondary reference is automatically selected.
|
||||
|
||||
:::info
|
||||
Switching between height references causes the absolute altitude estimate to drift over time.
|
||||
This isn't an issue when flying in position mode but can be problematic if the drone is supposed to fly a mission at a specific GNSS altitude.
|
||||
If the absolute altitude drift is unwanted, it is recommended to set the GNSS altitude as the height reference, even when using conditional range aid.
|
||||
:::
|
||||
|
||||
It is primarily intended for _takeoff and landing_, in cases where the barometer setup is such that interference from rotor wash is excessive and can corrupt EKF state estimates.
|
||||
|
||||
Range aid may also be used to improve altitude hold when the vehicle is stationary.
|
||||
|
||||
:::tip
|
||||
[Terrain Hold](../flying/terrain_following_holding.md#terrain_hold) is recommended over _Range Aid_ for terrain holding.
|
||||
This is because terrain hold uses the normal ECL/EKF estimator for determining height, and this is generally more reliable than a distance sensor in most conditions.
|
||||
:::
|
||||
|
||||
_Conditional range aid_ is enabled by setting [EKF2_RNG_CTRL](../advanced_config/parameter_reference.md#EKF2_RNG_CTRL) = "Enabled (conditional mode)" (1).
|
||||
|
||||
It is further configured using the `EKF2_RNG_A_` parameters:
|
||||
|
||||
- [EKF2_RNG_A_VMAX](../advanced_config/parameter_reference.md#EKF2_RNG_A_VMAX): Maximum horizontal speed, above which range aid is disabled.
|
||||
- [EKF2_RNG_A_HMAX](../advanced_config/parameter_reference.md#EKF2_RNG_A_HMAX): Maximum height, above which range aid is disabled.
|
||||
- [EKF2_RNG_A_IGATE](../advanced_config/parameter_reference.md#EKF2_RNG_A_IGATE): Range aid consistency checks "gate" (a measure of the error before range aid is disabled).
|
||||
|
||||
#### Range height fusion
|
||||
|
||||
PX4 allows you to continuously fuse the range finder as a source of height (in any flight mode/vehicle type).
|
||||
This may be useful for applications when the vehicle is _guaranteed_ to only fly over a near-flat surface (e.g. indoors).
|
||||
|
||||
When using a distance sensor as a height source, fliers should be aware:
|
||||
|
||||
- Flying over obstacles can lead to the estimator rejecting rangefinder data (due to internal data consistency checks), which can result in poor altitude holding while the estimator is relying purely on accelerometer estimates.
|
||||
|
||||
::: info
|
||||
This scenario might occur when a vehicle ascends a slope at a near-constant height above ground, because the rangefinder altitude does not change while that estimated from the accelerometer does.
|
||||
The EKF performs innovation consistency checks that take into account the error between measurement and current state as well as the estimated variance of the state and the variance of the measurement itself.
|
||||
If the checks fail the rangefinder data will be rejected, and the altitude will be estimated from the accelerometer and the other selected height sources (GNSS, baro, vision), if enabled and available
|
||||
After 5 seconds of inconsistent data if the distance sensor is the active source oh height data, the estimator resets the height state to match the current distance sensor data.
|
||||
If one or more other sources of height are active, the range finder is declared faulty and the estimator continues to estimate its height using the other sensors.
|
||||
The measurements might also become consistent again, for example, if the vehicle descends, or if the estimated height drifts to match the measured rangefinder height.
|
||||
|
||||
:::
|
||||
|
||||
- The local NED origin will move up and down with ground level.
|
||||
|
||||
- Rangefinder performance over uneven surfaces (e.g. trees) can be very poor, resulting in noisy and inconsistent data.
|
||||
This again leads to poor altitude hold.
|
||||
|
||||
The feature is enabled by setting [EKF2_RNG_CTRL](../advanced_config/parameter_reference.md#EKF2_RNG_CTRL) to "Enabled" (2).
|
||||
To make the range finder the height reference when active, set: [EKF2_HGT_REF](../advanced_config/parameter_reference.md#EKF2_HGT_REF) to "Range sensor".
|
||||
|
||||
:::tip
|
||||
To enable the range finder fusion only when the drone is stationary (in order to benefit from a better altitude estimate during takeoff and landing) but not fuse the range finder the rest of the time, use the [conditional mode](#conditional-range-aiding) (1) of [EKF2_RNG_CTRL](../advanced_config/parameter_reference.md#EKF2_RNG_CTRL).
|
||||
:::
|
||||
|
||||
#### Range Finder Obstruction Detection
|
||||
|
||||
The EKF can detect whether the rangefinder path-to-ground is obstructed (perhaps by a payload) using a kinematic consistency check between the vertical velocity estimate and the numerical derivative of the range finder data.
|
||||
If the range finder is statistically inconsistent with EKF2, the sensor is rejected for the rest of the flight unless the statistical test passes again for at least 1 second at a vertical speed of 0.5m/s or more.
|
||||
|
||||
The check is only enabled when the rangefinder is not used as the primary height source, and is only active while the vehicle is not moving horizontally (as it assumes a static ground height).
|
||||
|
||||
For effective obstruction detection, the range finder noise parameter needs to be tightly tuned using flight data.
|
||||
The kinematic consistency gate parameter can then be adjusted to obtain the desired fault detection sensitivity.
|
||||
|
||||
调整参数:
|
||||
|
||||
- [EKF2_RNG_NOISE](../advanced_config/parameter_reference.md#EKF2_RNG_NOISE)
|
||||
- [EKF2_RNG_K_GATE](../advanced_config/parameter_reference.md#EKF2_RNG_K_GATE)
|
||||
|
||||
### 空速:
|
||||
|
||||
Equivalent Airspeed (EAS) data can be used to estimate wind velocity and reduce drift when GPS is lost by setting [EKF2_ARSP_THR](../advanced_config/parameter_reference.md#EKF2_ARSP_THR) to a positive value.
|
||||
Airspeed data will be used when it exceeds the threshold set by a positive value for [EKF2_ARSP_THR](../advanced_config/parameter_reference.md#EKF2_ARSP_THR) and the vehicle type is not rotary wing.
|
||||
|
||||
### 合成侧滑
|
||||
|
||||
Fixed-wing platforms can take advantage of an assumed sideslip observation of zero to improve wind speed estimation and also enable wind speed estimation without an airspeed sensor.
|
||||
This is enabled by setting the [EKF2_FUSE_BETA](../advanced_config/parameter_reference.md#EKF2_FUSE_BETA) parameter to 1.
|
||||
|
||||
<a id="mc_wind_estimation_using_drag"></a>
|
||||
|
||||
### 基于阻力比力的多旋翼风场估计
|
||||
|
||||
多旋翼平台可以利用沿 X 和 Y 机体轴的空速和阻力之间的关系来估计风速的北/东分量。
|
||||
This can be enabled using [EKF2_DRAG_CTRL](../advanced_config/parameter_reference.md#EKF2_DRAG_CTRL).
|
||||
|
||||
The relationship between airspeed and specific force (IMU accelerometer measurements) along the X and Y body axes is controlled by the [EKF2_BCOEF_X](../advanced_config/parameter_reference.md#EKF2_BCOEF_X), [EKF2_BCOEF_Y](../advanced_config/parameter_reference.md#EKF2_BCOEF_Y) and [EKF2_MCOEF](../advanced_config/parameter_reference.md#EKF2_MCOEF) parameters which set the ballistic coefficients for flight in the X and Y directions, and the momentum drag produced by the propellers, respectively.
|
||||
The amount of specific force observation noise is set by the [EKF2_DRAG_NOISE](../advanced_config/parameter_reference.md#EKF2_DRAG_NOISE) parameter.
|
||||
|
||||
以下方法可获得良好的调参参数:
|
||||
|
||||
1. Fly once in [Position mode](../flight_modes_mc/position.md) repeatedly forwards/backwards/left/right/up/down between rest and maximum speed (best results are obtained when this testing is conducted in still conditions).
|
||||
2. Extract the **.ulg** log file using, for example, [QGroundControl: Analyze > Log Download](https://docs.qgroundcontrol.com/master/en/qgc-user-guide/analyze_view/log_download.html)
|
||||
::: info
|
||||
The same **.ulg** log file can also be used to tune the [static pressure position error coefficients](#correction-for-static-pressure-position-error).
|
||||
|
||||
:::
|
||||
3. Use the log with the [mc_wind_estimator_tuning.py](https://github.com/PX4/PX4-Autopilot/tree/main/src/modules/ekf2/EKF/python/tuning_tools/mc_wind_estimator) Python script to obtain the optimal set of parameters.
|
||||
|
||||
### 光流
|
||||
|
||||
[Optical flow](../sensor/optical_flow.md) data will be used if the following conditions are met:
|
||||
|
||||
- 有效的测距仪数据可用。
|
||||
- [EKF2_OF_CTRL](../advanced_config/parameter_reference.md#EKF2_OF_CTRL) is set.
|
||||
- The quality metric returned by the flow sensor is greater than the minimum requirement set by the [EKF2_OF_QMIN](../advanced_config/parameter_reference.md#EKF2_OF_QMIN) parameter.
|
||||
|
||||
For better performance, set the location of the optical flow sensor as described [here](../sensor/optical_flow.md#ekf2).
|
||||
|
||||
If a stable hover can be achieved at low altitude above ground (< 10m) but slow oscillations occur at higher altitude, consider adjusting the [optical flow scale factor](../sensor/optical_flow.md#scale-factor).
|
||||
|
||||
### 外部视觉系统
|
||||
|
||||
Position, velocity or orientation measurements from an external vision system, e.g. Vicon, can be used.
|
||||
|
||||
The measurements that are fused are configured by setting the appropriate bits of [EKF2_EV_CTRL](../advanced_config/parameter_reference.md#EKF2_EV_CTRL) to `true`:
|
||||
|
||||
- `0`: Horizontal position data
|
||||
- `1`: Vertical position data.
|
||||
Height sources may additionally be configured using [EKF2_HGT_REF](../advanced_config/parameter_reference.md#EKF2_HGT_REF) (see section [Height](#height)).
|
||||
- `2`: Velocity data
|
||||
- `3`: Yaw data
|
||||
|
||||
Note that if yaw data is used (bit 3) the heading is with respect to the external vision frame; otherwise the heading is relative to North.
|
||||
|
||||
EKF 要考虑视觉姿态估计的不确定性。
|
||||
This uncertainty information can be sent via the covariance fields in the MAVLink [ODOMETRY](https://mavlink.io/en/messages/common.html#ODOMETRY) message or it can be set through the parameters [EKF2_EVP_NOISE](../advanced_config/parameter_reference.md#EKF2_EVP_NOISE), [EKF2_EVV_NOISE](../advanced_config/parameter_reference.md#EKF2_EVV_NOISE) and [EKF2_EVA_NOISE](../advanced_config/parameter_reference.md#EKF2_EVA_NOISE).
|
||||
You can choose the source of the uncertainty with [EKF2_EV_NOISE_MD](../advanced_config/parameter_reference.md#EKF2_EV_NOISE_MD).
|
||||
|
||||
## 我如何启用 'ecl' 库中的 EKF ?
|
||||
|
||||
EKF2 is enabled by default (for more information see [Switching State Estimators](../advanced/switching_state_estimators.md) and [EKF2_EN](../advanced_config/parameter_reference.md#EKF2_EN)).
|
||||
|
||||
## ecl EKF 和其它估计器相比的优点和缺点是什么?
|
||||
|
||||
与所有估计器一样,大部分性能来自调参以匹配传感器特性。
|
||||
调参是准确性和鲁棒性之间的折衷,虽然我们试图提供满足大多数用户需求的调优,但是应用程序需要调整更改。
|
||||
|
||||
For this reason, no claims for accuracy relative to the legacy combination of `attitude_estimator_q` + `local_position_estimator` have been made and the best choice of estimator will depend on the application and tuning.
|
||||
|
||||
### 缺点
|
||||
|
||||
- ecl EKF 是一种复杂的算法,需要很好地理解扩展卡尔曼滤波器理论及其应用于导航中的问题才能成功调参。
|
||||
因此,不知道怎么修改,用户就很难得到好结果。
|
||||
- ecl EKF 使用更多 RAM 和闪存空间。
|
||||
- ecl EKF 使用更多的日志空间。
|
||||
|
||||
### 优势
|
||||
|
||||
- ecl EKF 能够以数学上一致的方式融合来自具有不同时间延迟和数据速率的传感器的数据,一旦正确设置时间延迟参数,就可以提高动态操作期间的准确性。
|
||||
- ecl EKF 能够融合各种不同的传感器类型。
|
||||
- 当 ecl EKF 检测并报告传感器数据中统计上显着的不一致性,将帮助诊断传感器错误。
|
||||
- For fixed-wing operation, the ecl EKF estimates wind speed with or without an airspeed sensor and is able to use the estimated wind in combination with airspeed measurements and sideslip assumptions to extend the dead-reckoning time available if GPS is lost in flight.
|
||||
- ecl EKF估计3轴加速度计偏差,这提高了尾座式无人机和其它机体在飞行阶段之间经历大的姿态变化时的精度。
|
||||
- 联邦结构(组合姿态和位置/速度估计)意味着姿态估计受益于所有传感器测量。
|
||||
如果调参正确,这应该提供改善态度估计的潜力。
|
||||
|
||||
## 如何检查 EKF 性能?
|
||||
|
||||
EKF 输出,状态和状态数据发布到许多 uORB 主题,这些主题在飞行期间记录到 SD 卡上。
|
||||
The following guide assumes that data has been logged using the _.ulog file format_.
|
||||
The **.ulog** format data can be parsed in python by using the [PX4 pyulog library](https://github.com/PX4/pyulog).
|
||||
|
||||
Most of the EKF data is found in the [EstimatorInnovations](https://github.com/PX4/PX4-Autopilot/blob/main/msg/EstimatorInnovations.msg) and [EstimatorStatus](https://github.com/PX4/PX4-Autopilot/blob/main/msg/EstimatorStatus.msg) uORB messages that are logged to the .ulog file.
|
||||
|
||||
A python script that automatically generates analysis plots and metadata can be found [here](https://github.com/PX4/PX4-Autopilot/blob/main/Tools/ecl_ekf/process_logdata_ekf.py).
|
||||
To use this script file, cd to the `Tools/ecl_ekf` directory and enter `python process_logdata_ekf.py <log_file.ulg>`.
|
||||
This saves performance metadata in a csv file named **<log_file>.mdat.csv** and plots in a pdf file named `<log_file>.pdf`.
|
||||
|
||||
Multiple log files in a directory can be analysed using the [batch_process_logdata_ekf.py](https://github.com/PX4/PX4-Autopilot/blob/main/Tools/ecl_ekf/batch_process_logdata_ekf.py) script.
|
||||
When this has been done, the performance metadata files can be processed to provide a statistical assessment of the estimator performance across the population of logs using the [batch_process_metadata_ekf.py](https://github.com/PX4/PX4-Autopilot/blob/main/Tools/ecl_ekf/batch_process_metadata_ekf.py) script.
|
||||
|
||||
### 输出数据
|
||||
|
||||
- Attitude output data is found in the [VehicleAttitude](https://github.com/PX4/PX4-Autopilot/blob/main/msg/VehicleAttitude.msg) message.
|
||||
- Local position output data is found in the [VehicleLocalPosition](https://github.com/PX4/PX4-Autopilot/blob/main/msg/VehicleLocalPosition.msg) message.
|
||||
- Global \(WGS-84\) output data is found in the [VehicleGlobalPosition](https://github.com/PX4/PX4-Autopilot/blob/main/msg/VehicleGlobalPosition.msg) message.
|
||||
- Wind velocity output data is found in the [Wind.msg](https://github.com/PX4/PX4-Autopilot/blob/main/msg/Wind.msg) message.
|
||||
|
||||
### 状态
|
||||
|
||||
Refer to states\[24\] in [EstimatorStates](https://github.com/PX4/PX4-Autopilot/blob/main/msg/EstimatorStates.msg).
|
||||
The index map for states\[24\] is as follows:
|
||||
|
||||
- \[0 ... 3\] Quaternions
|
||||
- \[4 ... 6\] Velocity NED \(m/s\)
|
||||
- \[7 ... 9\] Position NED \(m\)
|
||||
- \[10 ... 12\] IMU delta angle bias XYZ \(rad\)
|
||||
- \[13 ... 15\] IMU delta velocity bias XYZ \(m/s\)
|
||||
- \[16 ... 18\] Earth magnetic field NED \(gauss\)
|
||||
- \[19 ... 21\] Body magnetic field XYZ \(gauss\)
|
||||
- \[22 ... 23\] Wind velocity NE \(m/s\)
|
||||
|
||||
### 状态方差
|
||||
|
||||
Refer to covariances\[24\] in [EstimatorStates](https://github.com/PX4/PX4-Autopilot/blob/main/msg/EstimatorStates.msg).
|
||||
The index map for covariances\[24\] is as follows:
|
||||
|
||||
- \[0 ... 3\] Quaternions
|
||||
- \[4 ... 6\] Velocity NED \(m/s\)^2
|
||||
- \[7 ... 9\] Position NED \(m^2\)
|
||||
- \[10 ... 12\] IMU delta angle bias XYZ \(rad^2\)
|
||||
- \[13 ... 15\] IMU delta velocity bias XYZ \(m/s\)^2
|
||||
- \[16 ... 18\] Earth magnetic field NED \(gauss^2\)
|
||||
- \[19 ... 21\] Body magnetic field XYZ \(gauss^2\)
|
||||
- \[22 ... 23\] Wind velocity NE \(m/s\)^2
|
||||
|
||||
### Observation Innovations & Innovation Variances
|
||||
|
||||
The observation `estimator_innovations`, `estimator_innovation_variances`, and `estimator_innovation_test_ratios` message fields are defined in [EstimatorInnovations.msg](https://github.com/PX4/PX4-Autopilot/blob/main/msg/EstimatorInnovations.msg).
|
||||
消息都有相同的字段名称/类型(但是单位不同)。
|
||||
|
||||
:::info
|
||||
The messages have the same fields because they are generated from the same field definition.
|
||||
The `# TOPICS` line (at the end of [the file](https://github.com/PX4/PX4-Autopilot/blob/main/msg/EstimatorInnovations.msg)) lists the names of the set of messages to be created):
|
||||
|
||||
```
|
||||
# TOPICS estimator_innovations estimator_innovation_variances estimator_innovation_test_ratios
|
||||
```
|
||||
|
||||
:::
|
||||
|
||||
一些观测值为:
|
||||
|
||||
- Magnetometer XYZ (gauss, gauss^2) : `mag_field[3]`
|
||||
- Yaw angle (rad, rad^2) : `heading`
|
||||
- True Airspeed (m/s, (m/s)^2) : `airspeed`
|
||||
- Synthetic sideslip (rad, rad^2) : `beta`
|
||||
- Optical flow XY (rad/sec, (rad/s)^2) : `flow`
|
||||
- Height above ground (m, m^2) : `hagl`
|
||||
- Drag specific force ((m/s)^2): `drag`
|
||||
- 速度和位置新息:每个传感器
|
||||
|
||||
此外,每个传感器都有其自己的字段,即横向和纵向位置和/或速度值(视情况而定)。
|
||||
这些基本上是自我描述的,现摘录如下:
|
||||
|
||||
```
|
||||
# GPS
|
||||
float32[2] gps_hvel # horizontal GPS velocity innovation (m/sec) and innovation variance ((m/sec)**2)
|
||||
float32 gps_vvel # vertical GPS velocity innovation (m/sec) and innovation variance ((m/sec)**2)
|
||||
float32[2] gps_hpos # horizontal GPS position innovation (m) and innovation variance (m**2)
|
||||
float32 gps_vpos # vertical GPS position innovation (m) and innovation variance (m**2)
|
||||
|
||||
# External Vision
|
||||
float32[2] ev_hvel # horizontal external vision velocity innovation (m/sec) and innovation variance ((m/sec)**2)
|
||||
float32 ev_vvel # vertical external vision velocity innovation (m/sec) and innovation variance ((m/sec)**2)
|
||||
float32[2] ev_hpos # horizontal external vision position innovation (m) and innovation variance (m**2)
|
||||
float32 ev_vpos # vertical external vision position innovation (m) and innovation variance (m**2)
|
||||
|
||||
# Fake Position and Velocity
|
||||
float32[2] fake_hvel # fake horizontal velocity innovation (m/s) and innovation variance ((m/s)**2)
|
||||
float32 fake_vvel # fake vertical velocity innovation (m/s) and innovation variance ((m/s)**2)
|
||||
float32[2] fake_hpos # fake horizontal position innovation (m) and innovation variance (m**2)
|
||||
float32 fake_vpos # fake vertical position innovation (m) and innovation variance (m**2)
|
||||
|
||||
# Height sensors
|
||||
float32 rng_vpos # range sensor height innovation (m) and innovation variance (m**2)
|
||||
float32 baro_vpos # barometer height innovation (m) and innovation variance (m**2)
|
||||
|
||||
# Auxiliary velocity
|
||||
float32[2] aux_hvel # horizontal auxiliary velocity innovation from landing target measurement (m/sec) and innovation variance ((m/sec)**2)
|
||||
float32 aux_vvel # vertical auxiliary velocity innovation from landing target measurement (m/sec) and innovation variance ((m/sec)**2)
|
||||
```
|
||||
|
||||
### 输出互补滤波器
|
||||
|
||||
输出互补滤波器用于将状态从融合时间范围向前传播到当前时间。
|
||||
To check the magnitude of the angular, velocity and position tracking errors measured at the fusion time horizon, refer to `output_tracking_error[3]` in the `ekf2_innovations` message.
|
||||
|
||||
索引映射如下:
|
||||
|
||||
- \[0\] 角度跟踪误差量级 (rad)
|
||||
- \[1\] 速度跟踪误差量级(m/s)。
|
||||
The velocity tracking time constant can be adjusted using the [EKF2_TAU_VEL](../advanced_config/parameter_reference.md#EKF2_TAU_VEL) parameter.
|
||||
减小此参数可减少稳态误差,但会增加 NED 速度输出上的观测噪声量。
|
||||
- \[2\] 位置跟踪误差量级 \(m\)。
|
||||
The position tracking time constant can be adjusted using the [EKF2_TAU_POS](../advanced_config/parameter_reference.md#EKF2_TAU_POS) parameter.
|
||||
减小此参数可减少稳态误差,但会增加 NED 位置输出上的观测噪声量。
|
||||
|
||||
### EKF 错误
|
||||
|
||||
EKF 包含针对严重条件状态和协方差更新的内部错误检查。
|
||||
Refer to the `filter_fault_flags` in [EstimatorStatus](https://github.com/PX4/PX4-Autopilot/blob/main/msg/EstimatorStatus.msg).
|
||||
|
||||
### 观测错误
|
||||
|
||||
有两种类型观测错误:
|
||||
|
||||
- 数据丢失。
|
||||
一个例子是测距仪无法提供返回数据。
|
||||
- 新息,即状态预测和传感器观测之间的差异过度。
|
||||
这种情况的一个例子是过度振动导致大的垂直位置误差,导致气压计高度测量被拒绝。
|
||||
|
||||
这两者都可能导致观测数据被拒绝,如果时间足够长,使得 EKF 尝试重置状态以使用传感器观测数据。
|
||||
所有观测结果均对新息进行了统计置信度检查。
|
||||
The number of standard deviations for the check are controlled by the `EKF2_*_GATE` parameter for each observation type.
|
||||
|
||||
Test levels are available in [EstimatorStatus](https://github.com/PX4/PX4-Autopilot/blob/main/msg/EstimatorStatus.msg) as follows:
|
||||
|
||||
- `mag_test_ratio`: ratio of the largest magnetometer innovation component to the innovation test limit
|
||||
- `vel_test_ratio`: ratio of the largest velocity innovation component to the innovation test limit
|
||||
- `pos_test_ratio`: ratio of the largest horizontal position innovation component to the innovation test limit
|
||||
- `hgt_test_ratio`: ratio of the vertical position innovation to the innovation test limit
|
||||
- `tas_test_ratio`: ratio of the true airspeed innovation to the innovation test limit
|
||||
- `hagl_test_ratio`: ratio of the height above ground innovation to the innovation test limit
|
||||
|
||||
For a binary pass/fail summary for each sensor, refer to innovation_check_flags in [EstimatorStatus](https://github.com/PX4/PX4-Autopilot/blob/main/msg/EstimatorStatus.msg).
|
||||
|
||||
### GPS 数据质量检查
|
||||
|
||||
在开始 GPS 辅助之前,EKF 应用了许多 GPS 数据质量检查。
|
||||
These checks are controlled by the [EKF2_GPS_CHECK](../advanced_config/parameter_reference.md#EKF2_GPS_CHECK) and `EKF2_REQ_*` parameters.
|
||||
The pass/fail status for these checks is logged in the [EstimatorStatus](https://github.com/PX4/PX4-Autopilot/blob/main/msg/EstimatorStatus.msg).gps_check_fail_flags message.
|
||||
当所有所需的 GPS 检查通过后,此整数将为零。
|
||||
If the EKF is not commencing GPS alignment, check the value of the integer against the bitmask definition `gps_check_fail_flags` in [EstimatorStatus](https://github.com/PX4/PX4-Autopilot/blob/main/msg/EstimatorStatus.msg).
|
||||
|
||||
### EKF 数值误差
|
||||
|
||||
EKF 对其所有计算使用单精度浮点运算,并使用一阶近似来推导协方差预测和更新方程,以降低处理要求。
|
||||
这意味着,当重新调整 EKF 时,可能遇到协方差矩阵运算条件恶劣,足以导致状态估计中的发散或显著错误的情况。
|
||||
|
||||
为防止这种情况,每个协方差和状态更新步骤都包含以下错误检测和更正步骤:
|
||||
|
||||
- 如果新息方差小于观测方差(这需要一个不可能的负值状态方差)或协方差更新将为任何一个状态产生负值方差,那么:
|
||||
- 跳过状态和协方差更新
|
||||
- 协方差矩阵中的相应行和列被重置
|
||||
- The failure is recorded in the [EstimatorStatus](https://github.com/PX4/PX4-Autopilot/blob/main/msg/EstimatorStatus.msg) `filter_fault_flags` message
|
||||
- 状态方差(协方差矩阵中的对角线)被限制为非负。
|
||||
- 状态方差应用数值上限。
|
||||
- 协方差矩阵强制对称。
|
||||
|
||||
After re-tuning the filter, particularly re-tuning that involve reducing the noise variables, the value of `estimator_status.gps_check_fail_flags` should be checked to ensure that it remains zero.
|
||||
|
||||
## 如果高度估计值发散了怎么办?
|
||||
|
||||
在飞行期间 EKF 高度偏离 GPS 和高度计测量的最常见原因是由振动引起的 IMU 测量的削波和/或混叠。
|
||||
如果发生这种情况,则数据中应显示以下迹象
|
||||
|
||||
- [EstimatorInnovations](https://github.com/PX4/PX4-Autopilot/blob/main/msg/EstimatorInnovations.msg).vel_pos_innov\[2\] and [EstimatorInnovations](https://github.com/PX4/PX4-Autopilot/blob/main/msg/EstimatorInnovations.msg).vel_pos_innov\[5\] will both have the same sign.
|
||||
- [EstimatorStatus](https://github.com/PX4/PX4-Autopilot/blob/main/msg/EstimatorStatus.msg).hgt_test_ratio will be greater than 1.0
|
||||
|
||||
建议第一步是确保使用有效的隔离安装系统将无人机与机身隔离。
|
||||
隔离安装座具有 6 个自由度,因此具有 6 个谐振频率。
|
||||
作为一般规则,隔离支架上的自动驾驶仪的 6 个共振频率应高于 25Hz,以避免与无人机动力学相互作用并低于电动机的频率。
|
||||
|
||||
如果谐振频率与电动机或螺旋桨叶片通过频率一致,则隔离安装件会使振动更严重。
|
||||
|
||||
通过进行以下参数更改,可以使 EKF 能更加抵御振动引起的高度发散:
|
||||
|
||||
- 将主要的高度传感器的新息门槛的值加倍。
|
||||
If using barometric height this is [EKF2_BARO_GATE](../advanced_config/parameter_reference.md#EKF2_BARO_GATE).
|
||||
- Increase the value of [EKF2_ACC_NOISE](../advanced_config/parameter_reference.md#EKF2_ACC_NOISE) to 0.5 initially.
|
||||
如果仍然出现发散,则进一步增加 0.1,但不要超过 1.0。
|
||||
|
||||
注意 这些变化的影响将使 EKF 对 GPS 垂直速度和气压的误差更敏感。
|
||||
|
||||
## 如果位置估计发散了应该怎么办?
|
||||
|
||||
位置发散的最常见原因是:
|
||||
|
||||
- 高振动级别。
|
||||
- 通过改进无人机的机械隔离来解决。
|
||||
- Increasing the value of [EKF2_ACC_NOISE](../advanced_config/parameter_reference.md#EKF2_ACC_NOISE) and [EKF2_GYR_NOISE](../advanced_config/parameter_reference.md#EKF2_GYR_NOISE) can help, but does make the EKF more vulnerable to GPS glitches.
|
||||
- 过大的陀螺仪偏差偏移。
|
||||
- 通过重新校准陀螺仪来修复。
|
||||
检查过度温度灵敏度(> 3 deg/sec 偏差在从冷机开始热启动时发生变化,如果受隔热影响以减缓温度变化的速度,则替换传感器。
|
||||
- 不好的偏航对齐
|
||||
- 检查磁力计校准和对齐。
|
||||
- 检查显示的航向 QGC 是否在 15 度以内
|
||||
- GPS 精度差
|
||||
- 检查是否有干扰
|
||||
- 改善隔离和屏蔽
|
||||
- 检查飞行位置是否有 GPS 信号障碍物和反射器(附近的高层建筑)
|
||||
- GPS 数据丢失
|
||||
|
||||
确定其中哪一个是主要原因需要对 EKF 日志数据进行系统分析:
|
||||
|
||||
- Plot the velocity innovation test ratio - [EstimatorStatus](https://github.com/PX4/PX4-Autopilot/blob/main/msg/EstimatorStatus.msg).vel_test_ratio
|
||||
- Plot the horizontal position innovation test ratio - [EstimatorStatus](https://github.com/PX4/PX4-Autopilot/blob/main/msg/EstimatorStatus.msg).pos_test_ratio
|
||||
- Plot the height innovation test ratio - [EstimatorStatus](https://github.com/PX4/PX4-Autopilot/blob/main/msg/EstimatorStatus.msg).hgt_test_ratio
|
||||
- Plot the magnetometer innovation test ratio - [EstimatorStatus](https://github.com/PX4/PX4-Autopilot/blob/main/msg/EstimatorStatus.msg).mag_test_ratio
|
||||
- Plot the GPS receiver reported speed accuracy - [SensorGps.msg](https://github.com/PX4/PX4-Autopilot/blob/main/msg/SensorGps.msg).s_variance_m_s
|
||||
- Plot the IMU delta angle state estimates - [EstimatorStatus](https://github.com/PX4/PX4-Autopilot/blob/main/msg/EstimatorStatus.msg).states\[10\], states\[11\] and states\[12\]
|
||||
- 绘制 EKF 内部高频振动指标:
|
||||
- Delta angle coning vibration - [EstimatorStatus](https://github.com/PX4/PX4-Autopilot/blob/main/msg/EstimatorStatus.msg).vibe\[0\]
|
||||
- High frequency delta angle vibration - [EstimatorStatus](https://github.com/PX4/PX4-Autopilot/blob/main/msg/EstimatorStatus.msg).vibe\[1\]
|
||||
- High frequency delta velocity vibration - [EstimatorStatus](https://github.com/PX4/PX4-Autopilot/blob/main/msg/EstimatorStatus.msg).vibe\[2\]
|
||||
|
||||
在正常操作期间,所有测试比率应保持在 0.5 以下,并且只有偶然的峰值高于此值,如下面成功飞行中的示例所示:
|
||||
|
||||

|
||||
|
||||
下图显示了具有良好隔离的多旋翼飞行器的 EKF 振动指标。
|
||||
可以看到着陆冲击和起飞和着陆期间增加的振动。
|
||||
如果收集的数据不足,使用这些指标无法提供有关最大阈值的具体建议。
|
||||
|
||||

|
||||
|
||||
上述振动指标的数值有限值,因为在接近 IMU 采样频率的频率下存在的振动(大多数电路板为 1kHz)将导致在高频振动指标中未显示的数据中出现偏移。
|
||||
检测混叠误差的唯一方法是它们对惯性导航精度和新息水平的提高。
|
||||
|
||||
除了生成 > 1.0 的大的位置和速度测试比率外,不同的误差机制还以不同的方式影响其它测试比率:
|
||||
|
||||
### 确定过度振动
|
||||
|
||||
高振动级别通常会影响垂直位置和速度新息以及水平分量。
|
||||
磁力计测试级别仅受到很小程度的影响。
|
||||
|
||||
\(在此插入示例绘图显示不好振动\)
|
||||
|
||||
### 确定过度的陀螺偏差
|
||||
|
||||
大的陀螺偏差偏移通常的特征是在飞行期间增量角度偏差值的变化大于 5E-4(相当于 ~3 度/秒),并且如果偏航轴受到影响,也会导致磁强计测试比大幅增加。
|
||||
除极端情况外,高度通常不受影响。
|
||||
如果滤波器在飞行前给定时间稳定,则可以容忍接通最高 5 度/秒的偏差值。
|
||||
如果位置发散,飞手进行的飞行前检查应防止解锁。
|
||||
|
||||
\(在此插入示例图表显示不好的陀螺偏差\)
|
||||
|
||||
### 确定较差的偏航精度
|
||||
|
||||
由于惯性导航和 GPS 测量计算出的速度方向不一致,因此不良偏航对准导致无人机开始移动时速度测试比率迅速增加。
|
||||
磁强计的新息受到轻微影响。
|
||||
高度通常不受影响。
|
||||
|
||||
\(在此插入示例绘图显示不好的偏航对齐\)
|
||||
|
||||
### 确定较差的GPS 数据精度
|
||||
|
||||
GPS 数据精度差通常伴随着接收器报告的速度误差的增加以及新息的增加。
|
||||
由多路径,遮蔽和干扰引起的瞬态误差是更常见的原因。
|
||||
下面是一个暂时失去 GPS 数据精度的例子,其中多旋翼飞行器开始从其游荡位置漂移并且必须使用摇杆进行校正。
|
||||
The rise in [EstimatorStatus](https://github.com/PX4/PX4-Autopilot/blob/main/msg/EstimatorStatus.msg).vel_test_ratio to greater than 1 indicates the GPs velocity was inconsistent with other measurements and has been rejected.
|
||||
|
||||

|
||||
|
||||
这伴随着 GPS 接收器报告的速度精度的上升,这表明它可能是 GPS 误差。
|
||||
|
||||

|
||||
|
||||
如果我们还看一下 GPS 水平速度新息和新息差异,我们可以看到北向速度新息伴随着这次 GPS “故障”事件的大幅增长。
|
||||
|
||||

|
||||
|
||||
### 确定 GPS 数据的丢失
|
||||
|
||||
GPS 数据的丢失将通过速度和位置新息测试比率 'flat-lining' 来显示。
|
||||
If this occurs, check the other GPS status data in `vehicle_gps_position` for further information.
|
||||
|
||||
The following plot shows the NED GPS velocity innovations `ekf2_innovations_0.vel_pos_innov[0 ... 2]`, the GPS NE position innovations `ekf2_innovations_0.vel_pos_innov[3 ... 4]` and the Baro vertical position innovation `ekf2_innovations_0.vel_pos_innov[5]` generated from a simulated VTOL flight using SITL Gazebo.
|
||||
|
||||
模拟的 GPS 在 73 秒时失锁。
|
||||
注意 GPS 丢失后,NED 速度新息和 NE 位置新息 'flat-line' 。
|
||||
注意在没有 GPS 数据的 10 秒后,EKF 使用最后的已知位置恢复到静态位置模式,并且 NE 位置新息开始再次改变。
|
||||
|
||||

|
||||
|
||||
### 气压计地面效应补偿
|
||||
|
||||
如果机体在降落期间在靠近地面时往往爬升回到空中, 最可能的原因是气压计地面效应。
|
||||
|
||||
这种情况是在推进器向地面推进并在无人机下空形成高压区时造成的。
|
||||
其结果是降低了对压力高度的解读,从而导致了不必要的爬升。
|
||||
下图显示了存在地面效应的典型情况。
|
||||
注意气压计信号如何在飞行开始和结束时消失。
|
||||
|
||||

|
||||
|
||||
You can enable _ground effect compensation_ to fix this problem:
|
||||
|
||||
- 从绘图中估算出气压计在起飞或着陆期间的跌落程度。 在上面的绘图中,人们可以看到降落过程中大约6米的气压计下沉。
|
||||
- Then set the parameter [EKF2_GND_EFF_DZ](../advanced_config/parameter_reference.md#EKF2_GND_EFF_DZ) to that value and add a 10 percent margin. 因此,在这种情况下,6.6米的数值将是一个良好的起点。
|
||||
|
||||
If a terrain estimate is available (e.g. the vehicle is equipped with a range finder) then you can additionally specify [EKF2_GND_MAX_HGT](../advanced_config/parameter_reference.md#EKF2_GND_MAX_HGT), the above ground-level altitude below which ground effect compensation should be activated.
|
||||
如果没有可用的地形估计,这个参数将不会产生任何效果,系统将使用继承法来确定是否应激活地面效果补偿。
|
||||
|
||||
## 更多信息
|
||||
|
||||
- [PX4 State Estimation Overview](https://youtu.be/HkYRJJoyBwQ), _PX4 Developer Summit 2019_, Dr. Paul Riseborough): Overview of the estimator, and major changes from 2018/19, and the expected improvements through 2019/20.
|
||||
Reference in New Issue
Block a user