PX4 / PX4-Autopilot

PX4 Autopilot Software
https://px4.io
BSD 3-Clause "New" or "Revised" License
8.47k stars 13.5k forks source link

Send Pre-arm setting to ESCs over CAN BUS #21142

Open TorbjornHouge opened 1 year ago

TorbjornHouge commented 1 year ago

Describe problem solved by the proposed feature

Currently, using PWM ESCs, the autopilot will output a disarmed PWM value (typically 1000 us) once pre-arm button is pressed. This is not sent on DRONECAN, making initialization of some ESCs troublesome since they then require an ARM-DISARM-ARM sequence in order to initialize properly.

Describe your preferred solution

Introducing a disarmed value for DRONECAN motors (similar to PWM_MAIN_DISx), and handling this the same way as for PWM during pre-arm. This value could be named UAVCAN_EC_DISx.

Describe possible alternatives

Have tried configuring ESCs, changing settings so that arming will ensure proper value to ESCs etc, but these solutions all have drawbacks leading to bad performance. The most realistic alternative may be to introduce a timer of configurable length (0 - 3 seconds or so) that when entering armed state, will output 0 for this time before changing to UAVCAN_EC_MINx. This is more of a workaround but may be done by only adding one parameter (or it can be hardcoded to e.g. 1 second).

Additional context

This is close to this issue, but not the exact equal. Still, it could be they should be considered the same.

AlexKlimaj commented 1 year ago

I have it implemented here. Just needs another pass on this PR to be merged. https://github.com/PX4/PX4-Autopilot/pull/19748

TorbjornHouge commented 1 year ago

Excellent, thanks. I hope it passes soon, it is much needed.