Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Discussion] Integrated companion/fc pulled out #2250

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from
Draft
Binary file modified assets/flight_controller/arkpab/arkpab_back2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/flight_controller/arkpab/arkpab_main.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/flight_controller/arkpab/arkpab_top.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/flight_controller/arkv6x/ark_v6x_front.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
56 changes: 35 additions & 21 deletions de/advanced_config/land_detector.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ You can set [COM_DISARM_LAND](../advanced_config/parameter_reference.md#COM_DISA
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](#states).
Information about how the parameters affect landing can be found below in [Land Detector States](#mc-land-detector-states).
:::

Other key parameters that you may need to tune in order to improve landing behaviour on particular airframes are:
Expand All @@ -25,44 +25,38 @@ Incorrectly setting `MPC_THR_HOVER` may result in ground-contact or maybe-landed
:::

* [MPC_THR_MIN](../advanced_config/parameter_reference.md#MPC_THR_MIN) - the overall minimum throttle of the system. This should be set to enable a controlled descent.
* [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.


## Fixed Wing Configuration

The complete set of relevant parameters is available under the [LNDFW](../advanced_config/parameter_reference.md#land-detector) prefix. These two parameters are sometimes worth tuning:

* [LNDFW_AIRSPD_MAX](../advanced_config/parameter_reference.md#LNDFW_AIRSPD_MAX) - the maximum airspeed allowed for the system still to be considered landed. The default of 8 m/s is a reliable tradeoff between airspeed sensing accuracy and triggering fast enough. Better airspeed sensors should allow lower values of this parameter.
* [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. This parameter can be adjusted to ensure land detection triggers earlier or later on throwing the airframe for hand-launches.


<span id="states"></span>
## Land Detector States

### Multicopter Land Detection
### MC Land Detector States

In order to detect landing, the multicopter first has to go through three different states, where each state contains the conditions from the previous states plus tighter constraints. If a condition cannot be reached because of missing sensors, then the condition is true by default. For instance, in [Acro mode](../flight_modes/acro_mc.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 some predefined time. If one condition fails, the land detector drops out of the current state immediately.
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.

If one condition fails, the land detector drops out of the current state immediately.

#### Ground Contact

This state is reached if following conditions are true for 0.35 seconds:
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) + ([MPC_THR_HOVER](../advanced_config/parameter_reference.md#MPC_THR_HOVER) - [MPC_THR_MIN](../advanced_config/parameter_reference.md#MPC_THR_MIN)) * (0.3, unless a hover thrust estimate is available, then 0.6), or velocity setpoint is 0.9 of land speed but vehicle has no vertical movement.
- 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.


#### Maybe Landed

This state is reached if following conditions are true for 0.25 seconds:
Conditions for this state:

- all conditions of ground contact are true
- 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.

Expand All @@ -71,5 +65,25 @@ If the vehicle is in position or velocity control and maybe landed was detected,

#### Landed

This state is reached if following conditions are true for 0.3 seconds:
- all conditions of maybe landed are true
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. Better airspeed sensors should allow lower values of this parameter.
* [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.

:::note
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.
2 changes: 1 addition & 1 deletion de/flight_controller/pixhawk6x.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ The Pixhawk®​ 6X is perfect for developers at corporate research labs, startu
* IO Processor: STM32F100
* 32 Bit Arm® Cortex®-M3, 24MHz, 8KB SRAM
* On-board sensors
* Accel/Gyro: ICM-20649
* Accel/Gyro: ICM-20649 or BMI088
* Accel/Gyro: ICM-42688-P
* Accel/Gyro: ICM-42670-P
* Mag: BMM150
Expand Down
10 changes: 7 additions & 3 deletions de/tutorials/video_streaming_wifi_broadcast.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Alpha AWUS036ACH is a medium power card that uses a lot of current while transmi

For **Raspberry PI** (UAV or ground) it must be directly connected to 5V BEC (or high current power adapter in case of ground pi) in one of two ways:

- Make a custom USB cable ([cut `+5V` wire from USB plug and connect it to BEC])(https://electronics.stackexchange.com/questions/218500/usb-charge-and-data-separate-cables)
- Make a custom USB cable [(cut `+5V` wire from USB plug and connect it to BEC)](https://electronics.stackexchange.com/questions/218500/usb-charge-and-data-separate-cables)
- Cut a `+5V` wire on PCB near USB port and wire it to BEC (don't do this if doubt - use custom cable instead).

You must also add a 470uF **low ESR capacitor** (like ESC has) between **card +5v and ground** to filter voltage spikes. You should integrate the capacitor with a custom USB cable. Without the capacitor you can get packet corruption or packet loss. Be aware of [ground loop](https://en.wikipedia.org/wiki/Ground_loop_%28electricity%29) when using several ground wires.
Expand All @@ -72,7 +72,9 @@ You must also add a 470uF **low ESR capacitor** (like ESC has) between **card +5
### Using a Linux Laptop as GCS (Harder than using a RasPi)
1. On **ground** Linux development computer:
```
sudo apt install libpcap-dev libsodium-dev python3-all python3-twisted
sudo apt install python3-all libpcap-dev libsodium-dev python3-pip python3-pyroute2 \
python3-future python3-twisted python3-serial iw virtualenv \
debhelper dh-python build-essential -y
git clone -b stable https://github.com/svpcom/wfb-ng.git
cd wfb-ng && make deb && sudo apt install ./deb_dist/wfb-ng*.deb
```
Expand Down Expand Up @@ -135,5 +137,7 @@ You can use any other Linux ARM board, but you need to use an Ethernet or USB ca

## Theory

WFB-ng puts the WiFi cards into monitor mode. This mode allows to send and receive arbitrary packets without association and waiting for ACK packets. [Analysis of Injection Capabilities and Media Access of IEEE 802.11 Hardware in Monitor Mode](https://github.com/svpcom/wfb-ng/blob/master/doc/Analysis%20of%20Injection%20Capabilities%20and%20Media%20Access%20of%20IEEE%20802.11%20Hardware%20in%20Monitor%20Mode.pdf) [802.11 timings](https://github.com/ewa/802.11-data)
WFB-ng puts the WiFi cards into monitor mode. This mode allows to send and receive arbitrary packets without association and waiting for ACK packets.
- [Analysis of Injection Capabilities and Media Access of IEEE 802.11 Hardware in Monitor Mode](https://github.com/svpcom/wfb-ng/blob/master/doc/Analysis%20of%20Injection%20Capabilities%20and%20Media%20Access%20of%20IEEE%20802.11%20Hardware%20in%20Monitor%20Mode.pdf)
- [802.11 timings](https://github.com/ewa/802.11-data)

3 changes: 2 additions & 1 deletion en/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -320,10 +320,11 @@
* [DroneCAN Peripherals](dronecan/README.md)
* [PX4 DroneCAN Firmware](dronecan/px4_cannode_fw.md)
* [ARK CANnode](dronecan/ark_cannode.md)
* [Integrated FC/Companion](companion_computer/integrated_companion.md)
* [Holybro Pixhawk RPI CM4 Baseboard](companion_computer/holybro_pixhawk_rpi_cm4_baseboard.md)
* [Companion Computers](companion_computer/README.md)
* [Pixhawk + Companion Setup](companion_computer/pixhawk_companion.md)
* [Companion Computer Peripherals](companion_computer/companion_computer_peripherals.md)
* [Holybro Pixhawk RPI CM4 Baseboard](companion_computer/holybro_pixhawk_rpi_cm4_baseboard.md)
* [Development](development/development.md)
* [Getting Started](dev_setup/getting_started.md)
* [Recommended Hardware/Setup](dev_setup/config_initial.md)
Expand Down
2 changes: 1 addition & 1 deletion en/advanced_config/imu_factory_calibration.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ This data will then be used when the parameters are set (or reset) to their defa

:::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.
PX4 will store the data to `/fs/mtd_caldata`.
:::

:::note
Expand Down
4 changes: 1 addition & 3 deletions en/companion_computer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ Communications with the ground stations and the cloud are usually routed via the
Controller boards that come with a pre-integrated companion computer and flight controller can significantly ease both software and hardware setup.
In some cases the boards are set up to allow easy replacement of flight controller and/or companion computer parts.

The following boards are known to provide a good integration with PX4:

- [Holybro Pixhawk RPI CM4 Baseboard](../companion_computer/holybro_pixhawk_rpi_cm4_baseboard.md)
For more information see [Integrated FC/Companion Computers](companion_computer/integrated_companion.md).


## Supported Companion Computers
Expand Down
22 changes: 22 additions & 0 deletions en/companion_computer/integrated_companion.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Integrated Flight Controller/Companion Computer

Controller boards that come with a _pre-integrated_ [companion/mission computer](../companion_computer/README.md) and [flight controller](../flight_controller/README.md) are recommended for supporting computationally expensive features, such as [object avoidance](../computer_vision/obstacle_avoidance.md) and [collision prevention](../computer_vision/collision_prevention.md).

If you need a companion computer, then using a pre-integrated board is likely to significantly reduce your costs.

## Supported Boards

The following boards are known to provide a good integration with PX4:

- [Holybro Pixhawk RPI CM4 Baseboard](../companion_computer/holybro_pixhawk_rpi_cm4_baseboard.md) - Baseboard with plugin Raspberry Pi and [Pixhawk Autopilot Bus](../flight_controller/pixhawk_autopilot_bus.md) compatible flight controllers.

## Software Setup

The companion computer and flight controller must be set up to communicate with each other (typically using MAVLink and ROS2, over Ethernet or a serial port), and may also be set up to communicate with ground controllers, cloud and other systems.

The setup depends on the companion computer and its operating system, and how the companion and flight controller are connected.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is still a bit further out but ideally we'll standardize this as well, so there's a common way to update and run components (e.g. avoidance or a custom ros flight mode).

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Certainly it would be good if the PX4 project had a recommended companion OS and update method for that OS. That would make it possible to have turnkey instructions and CI testing that would work for 80% of the world.

Everyone seems to want their own OS though, so perhaps all that would need to be containerized?

Anyway, not my problem to solve.

Setup information for common configurations is provided in [Companion computers](../companion_computer/README.md).

## Further Information

- [Companion computer](../companion_computer/README.md): General companion/flight controller hardware and software setup.
2 changes: 1 addition & 1 deletion en/complete_vehicles/px4_vision_kit.md
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ To flash the USB image to the *UP Core*:
1. Open a terminal and run the following command to copy the image onto internal memory (eMMC).
The terminal will prompt for a number of responses during the flashing process.
```sh
cd ~/catkin_ws/src/px4vision_ros
cd ~/catkin_ws/src/px4vision_ros/tools
sudo ./flash_emmc.sh
```

Expand Down
15 changes: 4 additions & 11 deletions en/config/safety.md
Original file line number Diff line number Diff line change
Expand Up @@ -222,19 +222,12 @@ Parameter | Description
[COM_OBL_ACT](../advanced_config/parameter_reference.md#COM_OBL_ACT) | Failsafe action if no RC is available: Land mode, Hold mode, Return mode.
[COM_OBL_RC_ACT](../advanced_config/parameter_reference.md#COM_OBL_RC_ACT) | Failsafe action if RC is available: Position mode, Altitude mode, Manual mode, Return mode, Land mode, Hold mode.

### Mission Feasibility Checks

### Mission Failsafe

The Mission Failsafe checks prevent a previous mission being started at a new takeoff location or if it is too big (distance between waypoints is too great).
The failsafe action is that the mission will not be run.

The relevant parameters are shown below:

Parameter | Description
--- | ---
[MIS_DIST_1WP](../advanced_config/parameter_reference.md#MIS_DIST_1WP) | The mission will not be started if the current waypoint is more distant than this value from the home position. Disabled if value is 0 or less.
[MIS_DIST_WPS](../advanced_config/parameter_reference.md#MIS_DIST_WPS) | The mission will not be started if any distance between two subsequent waypoints is greater than this value.
A number of checks are run to ensure that a mission can only be started if it is _feasible_.
For example, the checks ensures that the first waypoint isn't too far away, and that the mission flight path doesn't conflict with any geofences.

As these are not strictly speaking "failsafes" they are documented in [Mission Mode > Mission Feasibility Checks](../flight_modes/mission.md#mission-feasibility-checks).

### Traffic Avoidance Failsafe

Expand Down
Loading