mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-01 02:55:07 +08:00
New Crowdin translations - zh-CN (#26148)
Fuzzing / Fuzzing (push) Has been cancelled
Container build / Set Tags and Variables (push) Has been cancelled
Docs - Deploy PX4 User Guide to AWS / build (push) Has been cancelled
Container build / Build Container (amd64) (push) Has been cancelled
Container build / Build Container (arm64) (push) Has been cancelled
Container build / Deploy To Registry (push) Has been cancelled
Docs - Deploy PX4 User Guide to AWS / deploy (push) Has been cancelled
Handle stale issues and PRs / stale (push) Has been cancelled
Fuzzing / Fuzzing (push) Has been cancelled
Container build / Set Tags and Variables (push) Has been cancelled
Docs - Deploy PX4 User Guide to AWS / build (push) Has been cancelled
Container build / Build Container (amd64) (push) Has been cancelled
Container build / Build Container (arm64) (push) Has been cancelled
Container build / Deploy To Registry (push) Has been cancelled
Docs - Deploy PX4 User Guide to AWS / deploy (push) Has been cancelled
Handle stale issues and PRs / stale (push) Has been cancelled
Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
This commit is contained in:
+43
-7
@@ -1,7 +1,13 @@
|
||||
# CAN
|
||||
# CAN (DroneCAN & Cyphal)
|
||||
|
||||
[控制器局域网(CAN)](https://en.wikipedia.org/wiki/CAN_bus)是一种可靠的有线网络,它能让诸如飞行控制器、电调、传感器及其他外设等无人机组件相互通信。
|
||||
它被设计为分布式架构,使用差分信号,即使在较长的电缆 (大型车辆上) 上也非常强大,避免单点故障。
|
||||
[Controller Area Network (CAN)](https://en.wikipedia.org/wiki/CAN_bus) is a robust wired network that allows drone components such as flight controller, ESCs, sensors, and other peripherals, to communicate with each other.
|
||||
|
||||
It is particularly recommended on larger vehicles.
|
||||
|
||||
## 综述
|
||||
|
||||
CAN it is designed to be democratic and uses differential signaling.
|
||||
For this reason it is very robust even over longer cable lengths (on large vehicles), and avoids a single point of failure.
|
||||
CAN 还允许来自外设的状态反馈,并通过总线方便的进行固件升级。
|
||||
|
||||
PX4 支持与 CAN 设备通信的两个软件协议:
|
||||
@@ -18,29 +24,36 @@ DroneCAN 和 Cyphal 都是早先一个叫做UAVCAN的项目。
|
||||
这两项协议之间的差异在[Cyphal vs. DroneCAN](https://forum.opencyphal.org/t/cyphal-vs-dronecan/1814)中作了概述。
|
||||
:::
|
||||
|
||||
:::warning
|
||||
PX4不支持KDECAN等无人驾驶飞机的其他CAN软件协议(撰写时)。
|
||||
:::
|
||||
|
||||
## 布线
|
||||
|
||||
CAN 网络的接线对于 DroneCAN 和 Cyphal/CAN 是一样 (实际上对所有的 CAN 网络都一样)。
|
||||
|
||||
设备以任意顺序连接成链。
|
||||
Devices within a network are connected in a _daisy-chain_ in any order (this differs from UARTs peripherals, where you attach just one component per port).
|
||||
|
||||
:::warning
|
||||
Don't connect each CAN peripheral to a separate CAN port!
|
||||
Unlike UARTs, CAN peripherals are designed to be daisy chained, with additional ports such as `CAN2` used for [redundancy](redundancy).
|
||||
:::
|
||||
|
||||
在链的任一端,应该在两个数据线之间连接一个 120Ω 的终端电阻。
|
||||
飞控和一些 GNSS 模块为了方便使用内置了终端电阻, 因此应该放在链的终端。
|
||||
否则,你可以使用终端电阻,比如 [Zubax Robotics 的这款](https://shop.zubax.com/products/uavcan-micro-termination-plug?variant=6007985111069)。如果你有JST - GH压接工具,也可以自己焊接一个。
|
||||
|
||||
下图显示了一个 CAN 总线连接飞控到 4 个 CAN 电调和一个 GNSS 的示例。
|
||||
It includes a redundant bus connected to `CAN 2`.
|
||||
|
||||

|
||||
|
||||
图中未显示任何电源接线。
|
||||
参考制造商的说明,确认组件是否需要单独供电,还是可以通过 CAN 总线供电。
|
||||
|
||||
:::info
|
||||
For more information, see [Cyphal/CAN device interconnection](https://wiki.zubax.com/public/cyphal/CyphalCAN-device-interconnection?pageId=2195476) (kb.zubax.com).
|
||||
虽然本文是以 Cyphal 协议为基础编写的,但同样适用于 DroneCAN 硬件和任何其他 CAN 设置。
|
||||
如需了解更复杂的场景,请参考 [论CAN总线拓扑结构与终端匹配](https://forum.opencyphal.org/t/on-can-bus-topology-and-termination/1685)。
|
||||
:::
|
||||
|
||||
### 连接器
|
||||
|
||||
@@ -54,7 +67,30 @@ Pixhawk标准兼容的 CAN 设备使用 4 引脚的 JST-GH 连接器为 CAN。
|
||||
|
||||
DroneCAN 和 Cyphal/CAN支持使用第二个(冗余) CAN 接口。
|
||||
这是完全可选的,但会增加连接的强度。
|
||||
所有Pixhawk飞行控制器都带有两个CAN接口; 如果您的外围设备也支持 2 CAN 接口,建议您同时进行电线连接以提高安全。
|
||||
|
||||
Pixhawk flight controllers come with 2 CAN interfaces; if your peripherals support 2 CAN interfaces as well, it is recommended to wire both up for increased safety.
|
||||
|
||||
### Flight Controllers with Multiple CAN Ports
|
||||
|
||||
[Flight Controllers](../flight_controller/index.md) may have up to three independent CAN ports, such as `CAN1`, `CAN2`, `CAN3` (neither DroneCAN or Cyphal support more than three).
|
||||
Note that you can't have both DroneCAN and Cyphal running on PX4 at the same time.
|
||||
|
||||
:::tip
|
||||
You only _need_ one CAN port to support an arbitrary number of CAN devices using a particular CAN protocol.
|
||||
Don't connect each CAN peripheral to a separate CAN port!
|
||||
:::
|
||||
|
||||
Generally you'll daisy all CAN peripherals off a single port, and if there is more than one CAN port, use the second one for [redundancy](redundancy).
|
||||
If three are three ports, you might use the remaining network for devices that support another CAN protocol.
|
||||
|
||||
The documentation for your flight controller should indicate which ports are supported/enabled.
|
||||
At runtime you can check what DroneCAN ports are enabled and their status using the following command on the [MAVLink Shell](../debug/mavlink_shell.md) (or some other console):
|
||||
|
||||
```sh
|
||||
uavcan status
|
||||
```
|
||||
|
||||
Note that you can also check the number of supported CAN interfaces for a board by searching for `CONFIG_BOARD_UAVCAN_INTERFACES` in its [default.px4board](https://github.com/PX4/PX4-Autopilot/blob/main/boards/px4/fmu-v6xrt/default.px4board#) configuration file.
|
||||
|
||||
## 固件
|
||||
|
||||
|
||||
Reference in New Issue
Block a user