DShot 电调
DShot is an alternative ESC protocol that has several advantages over PWM or OneShot:
- 低延迟
- 通过校验提高鲁棒性
- 由于协议使用数字编码,因此无需电调校准
- 很多电调支持数传反馈。
- 可以通过命令反转电机方向(而不是物理调换两根线/重新焊接)。
- 支持其他好用的命令。
本章介绍了如何连接和配置 DShot 电调。
Wiring/Connections
DShot ESC are wired the same way as PWM ESCs. 唯一的区别在于它们只能连接到FMU,通常只能连接到某些引脚的子集。
INFO
You may want to check the actuator configuration screen to see what pins are available for DShot on your controller before wiring up!
Pixhawk controllers with both an FMU and an IO board usually label them as AUX
(FMU) and MAIN
(IO), respectively. These match the PWM AUX
and PWM MAIN
output tabs on the actuator configuration screen. For these controllers connect the DShot ESC to the AUX
port.
Controllers that don't have an IO board usually label the (single) output port as MAIN
, and this is where you will connect your DShot ESC. If the controller without IO has its own firmware, the actuator assignment will be to the matching PWM MAIN
outputs. However if the same firmware is used for hardware with/without the IO board, such as for the Pixhawk 4 and Pixhawk 4 Mini, then actuator assignment tab used is the same in both cases: PWM AUX
(i.e. not matching the port label MAIN
in the "mini" case).
配置
WARNING
Remove propellers before changing ESC configuration parameters!
Enable DShot for your required outputs in the Actuator Configuration.
DShot comes with different speed options: DShot150, DShot300, DShot600 and DShot1200, where the number indicates the speed in kilo-bits/second. 您应该将参数设置为您的电调支持的最高速度(根据其说明书)。
然后连接电池并解锁无人机。 电调应该初始化,电机应该按照正确的方向转动。
- If the motors do not spin in the correct direction (for the selected airframe) you can reverse them in the UI using the Set Spin Direction option (this option appears after you select DShot and assign motors). You can also reverse motors by sending an ESC Command.
ESC Commands
Commands can be sent to the ESC via the MAVLink shell. See here for a full reference of the supported commands.
其中最重要的是:
Make a motor connected to to FMU output pin 1 beep (helps with identifying motors)
shdshot beep1 -m 1
Retrieve ESC information (requires telemetry, see below):
shnsh> dshot esc_info -m 2 INFO [dshot] ESC Type: #TEKKO32_4in1# INFO [dshot] MCU Serial Number: xxxxxx-xxxxxx-xxxxxx-xxxxxx INFO [dshot] Firmware version: 32.60 INFO [dshot] Rotation Direction: normal INFO [dshot] 3D Mode: off INFO [dshot] Low voltage Limit: off INFO [dshot] Current Limit: off INFO [dshot] LED 0: unsupported INFO [dshot] LED 1: unsupported INFO [dshot] LED 2: unsupported INFO [dshot] LED 3: unsupported
Permanently set the spin direction of a motor connected to FMU output pin 1 (while motors are not spinning):
Set spin direction to
reversed
:shdshot reverse -m 1 dshot save -m 1
Retrieving ESC information will then show:
shRotation Direction: reversed
Set spin direction to
normal
:shdshot normal -m 1 dshot save -m 1
Retrieving ESC information will then show:
shRotation Direction: normal
:::note
- The commands will have no effect if the motors are spinning, or if the ESC is already set to the corresponding direction.
- The ESC will revert to its last saved direction (normal or reversed) on reboot if
save
is not called after changing the direction.
:::
Telemetry
有些电调能够向飞控发送Telemetry数据,包括:
- 温度
- 电压
- 电流
- 累计消耗的电量
- 转速值
这些DShot 电调会有一条额外的连接线。
开启遥测数据功能(仅对于能支持遥测数据的电调):
- 把电调上的TELE端口连接到飞控上空的串口的 RX 端。
- Enable telemetry on that serial port using DSHOT_TEL_CFG.
重启后,您可以检查TELE数据传输是否正常工作(确保电池已连接),方法如下:
sh
dshot esc_info -m 1
TIP
You may have to configure MOT_POLE_COUNT to get the correct RPM values.
TIP
Not all DSHOT-capable ESCs support [esc_info]
(e.g. APD 80F3x), even when telemetry is supported and enabled. 显示的错误是:
sh
ERROR [dshot] No data received. If telemetry is setup correctly, try again.
查看制造商文档以获取详细信息。