mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-11-26 01:00:36 +08:00
docs(gripper): add DroneCAN EPM setup guide (#28049)
* docs(gripper): add DroneCAN EPM setup guide Signed-off-by: Maksim Drachov <maksim.drachov@outlook.com> * docs(docs): subedit * docs(dronecan): clarify gripper publications * payload_deliverer: clarify gripper command type * docs: convert FluxGrip image to PNG * docs: fix FluxGrip image path * Update src/modules/payload_deliverer/module.yaml --------- Signed-off-by: Maksim Drachov <maksim.drachov@outlook.com> Co-authored-by: Hamish Willee <hamishwillee@gmail.com>
This commit is contained in:
1 parent
ea58e72f11
commit
da47a168a5
9 files changed
+160
-11
No files matched your search
Binary file not shown.
|
After Width: | Height: | Size: 368 KiB |
@@ -378,6 +378,7 @@
|
||||
- [Gimbal \(Mount\) Configuration](advanced/gimbal_control.md)
|
||||
- [Grippers](peripherals/gripper.md)
|
||||
- [Servo Gripper](peripherals/gripper_servo.md)
|
||||
- [Electro-Permanent Magnet (EPM)](peripherals/gripper_epm.md)
|
||||
- [Peripherals](peripherals/index.md)
|
||||
- [ADSB/FLARM/UTM (Traffic Avoidance)](peripherals/adsb_flarm.md)
|
||||
- [On-Screen Display (OSD)](peripherals/osd.md)
|
||||
|
||||
@@ -380,6 +380,7 @@
|
||||
- [Gimbal \(Mount\) Configuration](/advanced/gimbal_control.md)
|
||||
- [Grippers](/peripherals/gripper.md)
|
||||
- [Servo Gripper](/peripherals/gripper_servo.md)
|
||||
- [Electro-Permanent Magnet (EPM)](/peripherals/gripper_epm.md)
|
||||
- [Peripherals](/peripherals/index.md)
|
||||
- [ADSB/FLARM/UTM (Traffic Avoidance)](/peripherals/adsb_flarm.md)
|
||||
- [On-Screen Display (OSD)](/peripherals/osd.md)
|
||||
|
||||
@@ -70,6 +70,8 @@ Supported hardware includes (this is not an exhaustive list):
|
||||
- [Ark Flow MR](ark_flow_mr.md)
|
||||
- [Avionics Anonymous Laser Altimeter UAVCAN Interface](../dronecan/avanon_laser_interface.md)
|
||||
- [RaccoonLab uRangefidner and Rangefinders Adapter](https://docs.raccoonlab.co/guide/rangefinder/)
|
||||
- Grippers
|
||||
- [DroneCAN Electro-Permanent Magnet (EPM)](../peripherals/gripper_epm.md)
|
||||
- Optical Flow
|
||||
- [Ark Flow](ark_flow.md)
|
||||
- [Ark Flow MR](ark_flow_mr.md)
|
||||
@@ -274,6 +276,13 @@ PX4 DroneCAN parameters:
|
||||
|
||||
- [UAVCAN_PUB_ARM](../advanced_config/parameter_reference.md#UAVCAN_PUB_ARM) ([Arming Status](https://dronecan.github.io/Specification/7._List_of_standard_data_types/#armingstatus)): Publish when using DroneCAN components that require the PX4 arming status as a precondition for use.
|
||||
|
||||
#### Grippers
|
||||
|
||||
DroneCAN grippers do not require any `UAVCAN_SUB_*`, `UAVCAN_PUB_*`, `CANNODE_SUB_*`, or `CANNODE_PUB_*` parameters.
|
||||
When DroneCAN is enabled, PX4 automatically publishes [`uavcan.equipment.hardpoint.Command`](https://dronecan.github.io/Specification/7._List_of_standard_data_types/#uavcanequipmenthardpoint) messages to forward `MAV_CMD_DO_GRIPPER` commands.
|
||||
|
||||
See [Electro-Permanent Magnet (EPM)](../peripherals/gripper_epm.md) for an example setup.
|
||||
|
||||
### ESC & Servos
|
||||
|
||||
[DroneCAN ESCs and servos](../dronecan/escs.md) require the [motor order and servo outputs](../config/actuators.md) to be configured.
|
||||
|
||||
@@ -17,8 +17,9 @@ There are many different gripper mechanisms ("jaws", "fingers", "electromagnets"
|
||||
|
||||
PX4 supports grippers that have simple triggers to hold and release, and that use the following interfaces (see linked documents for details):
|
||||
|
||||
- [PWM Servo Gripper](gripper_servo.md) - Grippers connected to autopilot PWM outputs
|
||||
- **MAVLink Gripper** (Untested) - Grippers that support the [MAV_CMD_DO_GRIPPER](https://mavlink.io/en/messages/common.html#MAV_CMD_DO_GRIPPER) MAVLink command.
|
||||
- [PWM Servo Gripper](../peripherals/gripper_servo.md) — Grippers connected to autopilot PWM outputs.
|
||||
- [DroneCAN Electro-Permanent Magnet (EPM)](../peripherals/gripper_epm.md) — EPM grippers controlled using DroneCAN hardpoint commands.
|
||||
- **MAVLink Gripper** (Untested) — Grippers that support the [MAV_CMD_DO_GRIPPER](https://mavlink.io/en/messages/common.html#MAV_CMD_DO_GRIPPER) MAVLink command.
|
||||
|
||||
## Using a Gripper
|
||||
|
||||
@@ -38,9 +39,14 @@ MAVLink applications, such as ground stations, can also control the gripper usin
|
||||
|
||||
PX4 gripper support is tied to the package delivery feature, which must be enabled and configured in order to be able to use a gripper.
|
||||
|
||||
1. Ensure your board has the Payload Deliverer module enabled: CONFIG_MODULES_PAYLOAD_DELIVERER.
|
||||
1. Set [PD_GRIPPER_TYPE](../advanced_config/parameter_reference.md#PD_GRIPPER_TYPE) to match your gripper.
|
||||
For example, set to `Servo` for a [Servo Gripper](gripper_servo.md).
|
||||
1. Ensure your board has the Payload Deliverer module enabled:
|
||||
|
||||
```ini
|
||||
CONFIG_MODULES_PAYLOAD_DELIVERER=y
|
||||
```
|
||||
|
||||
2. Set [PD_GRIPPER_TYPE](../advanced_config/parameter_reference.md#PD_GRIPPER_TYPE) to match your gripper.
|
||||
Set it to `Binary Grab/Release` for a [Servo Gripper](gripper_servo.md) or [DroneCAN EPM Gripper](../peripherals/gripper_epm.md).
|
||||
|
||||
### Gripper Actuator Mapping
|
||||
|
||||
@@ -85,7 +91,7 @@ To set the actuation timeout:
|
||||
|
||||
- Use the [Joystick](#qgc-joystick-configuration) to trigger gripper open and close actions.
|
||||
|
||||
1. Set [PD_GRIPPER_TO](../advanced_config/parameter_reference.md#PD_GRIPPER_TO) to whichever of the gripper open and close time is larger.
|
||||
2. Set [PD_GRIPPER_TO](../advanced_config/parameter_reference.md#PD_GRIPPER_TO) to whichever of the gripper open and close time is larger.
|
||||
|
||||
### Mission Command Timeout
|
||||
|
||||
@@ -113,7 +119,7 @@ To map joystick buttons in QGroundControl:
|
||||
|
||||

|
||||
|
||||
1. Select `Gripper Open` and `Gripper Close` actions for your desired joystick buttons, as shown above.
|
||||
2. Select `Gripper Open` and `Gripper Close` actions for your desired joystick buttons, as shown above.
|
||||
|
||||
You can test the actions by clicking on the mapped buttons and checking for gripper movement.
|
||||
If the gripper doesn't move as expected check the package delivery configuration and actuator mapping are set up properly.
|
||||
@@ -0,0 +1,130 @@
|
||||
# Electro-Permanent Magnet (EPM)
|
||||
|
||||
<Badge type="tip" text="PX4 v1.18" />
|
||||
|
||||
An electro-permanent magnet (EPM) uses a short electrical pulse to switch its magnetic state, and does not consume power continuously while holding a payload.
|
||||
|
||||
This topic explains how to connect and configure a [Zubax FluxGrip FG40](https://shop.zubax.com/products/zubax-epm) EPM as a DroneCAN gripper.
|
||||
The gripper can then be operated from a [payload delivery mission](../flying/package_delivery_mission.md), a joystick, or a MAVLink command.
|
||||
|
||||

|
||||
|
||||
::: info
|
||||
This setup was tested with a Holybro Pixhawk 6X Pro and FluxGrip firmware `502e1f5`.
|
||||
See the [FluxGrip documentation](https://fluxgrip.zubax.com/chapters/hardware/fg40.html#interface-and-power-supply) for product-specific setup and operating limits.
|
||||
:::
|
||||
|
||||
## PX4 Firmware Support
|
||||
|
||||
DroneCAN EPM operation is supported from PX4 v1.18 — the first PX4 version that supports gripper command forwarding using the DroneCAN hardpoint message ([uavcan.equipment.hardpoint](https://dronecan.github.io/Specification/7._List_of_standard_data_types/#uavcanequipmenthardpoint)).
|
||||
|
||||
The flight controller firmware must include both of the following modules (and of course the board must support CAN):
|
||||
|
||||
```ini
|
||||
CONFIG_DRIVERS_UAVCAN=y
|
||||
CONFIG_MODULES_PAYLOAD_DELIVERER=y
|
||||
```
|
||||
|
||||
You can check or add these settings in the board's `default.px4board` file under `boards/<vendor>/<board>/`, or use the [PX4 board configuration tool](../hardware/porting_guide_config.md#px4-menuconfig-setup).
|
||||
|
||||
Then [build PX4 and upload the firmware](../dev_setup/building_px4.md).
|
||||
For an FMUv6X flight controller this would be done as follows (replace `px4_fmu-v6x_default` with the build target for your flight controller):
|
||||
|
||||
```sh
|
||||
git submodule update --init --recursive
|
||||
make px4_fmu-v6x_default
|
||||
make px4_fmu-v6x_default upload
|
||||
```
|
||||
|
||||
## Hardware Setup
|
||||
|
||||
::: warning
|
||||
FluxGrip can briefly draw a high current when switching.
|
||||
FluxGrip can be powered from the flight controller power rail for testing purposes, provided that the rail meets its voltage and current requirements.
|
||||
For normal operation, use a suitable separate power supply for the EPM to reduce the load on the flight controller power rail and improve switching performance.
|
||||
Follow the voltage, current, and wiring requirements in the [FluxGrip documentation](https://fluxgrip.zubax.com/chapters/hardware/fg40.html#interface-and-power-supply).
|
||||
:::
|
||||
|
||||
1. Connect FluxGrip to the flight controller's `CAN1` port.
|
||||
2. Connect FluxGrip to its power supply.
|
||||
3. Check that the CAN bus is wired and terminated as described in [CAN Wiring](../can/index.md#wiring).
|
||||
4. Power the flight controller and FluxGrip.
|
||||
|
||||
When communication is working, the left CAN LED on FluxGrip is solid and the adjacent CAN LED blinks.
|
||||
|
||||
## PX4 Configuration
|
||||
|
||||
Set the following parameters in QGroundControl, and then reboot the flight controller:
|
||||
|
||||
| Parameter | Value | Description |
|
||||
| ---------------------------------------------------------------------------- | -------------------------------- | ----------------------------------------------------------------------------------------------------- |
|
||||
| [UAVCAN_ENABLE](../advanced_config/parameter_reference.md#UAVCAN_ENABLE) | `Sensors Automatic Config` (`2`) | Enables DroneCAN and dynamic node allocation. Use `3` instead if the vehicle also uses DroneCAN ESCs. |
|
||||
| [UAVCAN_BITRATE](../advanced_config/parameter_reference.md#UAVCAN_BITRATE) | `1000000` | Sets the CAN bus bitrate to 1 Mbit/s. |
|
||||
| [PD_GRIPPER_TYPE](../advanced_config/parameter_reference.md#PD_GRIPPER_TYPE) | `Binary Grab/Release` (`0`) | Enables the binary grab/release gripper interface used by the EPM. |
|
||||
|
||||
::: info
|
||||
You do not need to map a flight controller actuator output when controlling the EPM over DroneCAN.
|
||||
No DroneCAN subscription or publication parameters (`UAVCAN_SUB_*`, `UAVCAN_PUB_*`, `CANNODE_SUB_*`, or `CANNODE_PUB_*`) are required.
|
||||
PX4 automatically publishes the hardpoint command when DroneCAN is enabled.
|
||||
:::
|
||||
|
||||
## Test the Gripper
|
||||
|
||||
::: warning
|
||||
Remove the propellers and secure the vehicle before testing.
|
||||
The payload deliverer commands the gripper to the grab state when the module starts, so the EPM will magnetize during startup.
|
||||
:::
|
||||
|
||||
Open the QGroundControl [MAVLink Shell](../debug/mavlink_shell.md), then verify that the DroneCAN driver and payload deliverer are running:
|
||||
|
||||
```sh
|
||||
uavcan status
|
||||
payload_deliverer status
|
||||
```
|
||||
|
||||
Test both gripper states:
|
||||
|
||||
```sh
|
||||
# Release the payload (magnet off)
|
||||
payload_deliverer gripper_open
|
||||
|
||||
# Grab the payload (magnet on)
|
||||
payload_deliverer gripper_close
|
||||
```
|
||||
|
||||
PX4 sends these as `MAV_CMD_DO_GRIPPER` commands for hardpoint ID `0`.
|
||||
The release command has action `0`, and the grab command has action `1`.
|
||||
|
||||
After testing, the EPM can be operated using any of the methods described in [Grippers > Using a Gripper](gripper.md#using-a-gripper).
|
||||
|
||||
## LED Status
|
||||
|
||||
The Magnet LED, located to the right of the CAN LEDs, indicates the EPM state:
|
||||
|
||||
| State | Meaning |
|
||||
| -------------- | ---------------------------------------------------- |
|
||||
| Detect/Unknown | Initial state after FluxGrip is powered on. |
|
||||
| On | The EPM is magnetized and holding the payload. |
|
||||
| Off | The EPM is demagnetized and the payload is released. |
|
||||
| Fade-in | FluxGrip is switching to the magnetized state. |
|
||||
| Fade-out | FluxGrip is switching to the demagnetized state. |
|
||||
|
||||
If the Magnet LED blinks rapidly, FluxGrip failed to magnetize.
|
||||
Check the power supply and wiring, and contact [Zubax support](mailto:support@zubax.com) if the problem persists.
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
If FluxGrip does not respond:
|
||||
|
||||
1. Run `uavcan status` and confirm that the DroneCAN driver is running and FluxGrip is visible on the bus.
|
||||
2. Check that `UAVCAN_ENABLE` and `UAVCAN_BITRATE` are set as described above.
|
||||
3. Check CAN wiring, bus termination, and the EPM power supply.
|
||||
4. Run `payload_deliverer status` and confirm that the gripper is valid.
|
||||
5. If `payload_deliverer` is not available, rebuild the firmware with `CONFIG_MODULES_PAYLOAD_DELIVERER=y`.
|
||||
|
||||
## See Also
|
||||
|
||||
- [FluxGrip: Integration with PX4](https://forum.zubax.com/t/fluxgrip-integration-with-px4/2863) (Zubax Forum)
|
||||
- [FluxGrip Quickstart Guide](https://forum.zubax.com/t/fluxgrip-quickstart-guide/2335) (Zubax Forum)
|
||||
- [DroneCAN](../dronecan/index.md)
|
||||
- [Grippers](gripper.md)
|
||||
@@ -36,7 +36,7 @@
|
||||
void Gripper::init(const GripperConfig &config)
|
||||
{
|
||||
switch (config.type) {
|
||||
case GripperConfig::GripperType::SERVO:
|
||||
case GripperConfig::GripperType::GRAB_RELEASE:
|
||||
break;
|
||||
|
||||
case GripperConfig::GripperType::UNDEFINED:
|
||||
|
||||
@@ -45,7 +45,7 @@ using namespace time_literals;
|
||||
typedef struct GripperConfig {
|
||||
enum class GripperType {
|
||||
UNDEFINED = -1,
|
||||
SERVO = 0,
|
||||
GRAB_RELEASE = 0,
|
||||
};
|
||||
|
||||
GripperType type{GripperType::UNDEFINED};
|
||||
|
||||
@@ -7,11 +7,13 @@ parameters:
|
||||
# Gripper configuration
|
||||
PD_GRIPPER_TYPE:
|
||||
description:
|
||||
short: Type of Gripper (Servo, etc.)
|
||||
short: Gripper control type
|
||||
long: |
|
||||
Selects the types of control actions the gripper accepts.
|
||||
type: enum
|
||||
values:
|
||||
-1: Undefined
|
||||
0: Servo
|
||||
0: Binary Grab/Release
|
||||
min: -1
|
||||
max: 0
|
||||
default: 0
|
||||
|
||||
Reference in new issue
Block a user