Adding support for high voltage ESC via half duplex RS485 RCOutput

Hello,

My current octocopter build involves a high voltage ESC (24S) that is not supported by Ardupilot. It uses a custom protocol (similar to Dshot) that I must add support for. I have this working in a standalone C++ application using USB-half-duplex RS485 differential pair. The protocol involves sending an array of bytes indicating throttle level, etc and then responds with encoded telemetry bytes. Baud rate is 115200, with approximately 250hz update rate. I have added RS485 transceivers to Motor 1-8 pin on the CUAV X7 autopilot (no IOMCU thankfully). When dshot is enabled, I can see the protocol on the scope transferred to a differential pair. So electrically, good to go.

I have analyzed the RCOutput.c for bidirectional dshot and was curious if using this code as a base to implement this custom protocol would be the best way forward for the application.

I also see several serial read/write calls in this library, but comments indicate that when sending serial passthrough to the motor pins, it disables standard motor control output.

Question is: would it be best to start fresh adding support for this ESC, modify the dshot protocol, or use the serial (RCOutput::serial_read_bytes, et al) commands and hack it in that way.

Thanks for any help on this topic!

The serial stuff is all for blheli passthrough - you should not use that for motor control. You can try using bdshot as a basis but this is one of the most complicated areas of the codebase so I am not sure your changes of success would be high. If you didn’t have 8 motors you would probably have more luck simply writing a half-duplex serial driver and using a set of UARTs - but sounds like that is not possible.

If half-duplex, or full duplex is possible, the FETtec device driver is a much better starting point.