SpektrumRC / SRXL2

Library code and documentation for the Spektrum SRXL2 bi-directional serial protocol
http://www.srxl2.com/
MIT License
41 stars 13 forks source link

How to send drive signal to SpektrumRC ESC #3

Open spcrobocar opened 2 years ago

spcrobocar commented 2 years ago

Hi, I have a Arram Infraction V2 which has a Spektrum® Firma™ 150A Smart ESC. I would like to use a small Nvidia computer (Jetson Xavier NX) to control the car autonomously. To do that, the computer needs to send drive signal to the ESC. Could you please let me now first how to physically connect the ESC to the computer? Using i2c or USB?

Thank you very much.

jminer commented 2 years ago

Spektrum receivers communicate with the Smart ESC using 3.3V half-duplex UART on the signal pin. The UART is 115,200 baud or optionally 400,000 baud. There is more detail in the specification PDF in this repository. See section 5: https://github.com/SpektrumRC/SRXL2/blob/master/Docs/SRXL2%20Specification.pdf

SRXL2 requires relatively precise timing. I assume the Jetson will be running Linux, but I don't know if software running on an operating system can meet the timing requirements. You might need a microcontroller between the Jetson and ESC to handle the SRXL2 communication. As you can read in the spec, there is a 50ms handshake timeout and receivers normally send an SRXL2 packet to the ESC every 11ms. I don't know how strict the ESC is on packet timing. My coworker may know more about the timing requirements off the top of his head, but he's on vacation for the next week.

spcrobocar commented 2 years ago

Hi @jminer Thank you very much. Hopefully you coworker can help.

Another question, is it possible to link the Spektrum receiver and Jetson using wires so I can send signal to the computer from the transmitter?

iksaif commented 4 months ago

Hello,

I was looking into what would be necessary to add support to Smart ESC to Ardupilot (like https://github.com/ArduPilot/ardupilot/pull/17363) in particular to be able to get the extra telemetry (and possibly change the settings as well).

I found a few references:

But it's unclear what fields need to be set to be able to control the ESC (reading the telemetry sounds a bit easier).

Another issue would be the wiring, I guess we'd have to plug the signal wire to a serial port, but I was wondering if it would be possible to use the old PWM interface using the regular plug while using the programming port to fetch the telemetry (https://www.horizonhobby.com/on/demandware.static/Sites-horizon-us-Site/Sites-horizon-master/default/Manuals/Avian-Manual-EN.pdf) which might be easier to implement and wire.

AndersHoglund commented 3 weeks ago

You would need the full SRXL2 bus master protocol stack to talk to an ESC. Not published by @SpektrumRC. Requested here too: https://github.com/rotorflight/rotorflight-firmware/issues/173

Please @SpektrumRC , we need the missing file "spm_srxl_master.h". /A