MCP2551 connected to ESP32 not working when odrive is connected

I am working on a project where I used two ESP32s (1,2) to read data from sensors and send it to a third ESP32 (3) through can transceivers (MCP2551). I want to control two motors through an odrive based on the sensor values. The third ESP32 outputs correct sensor data when not connected to the odrive. However, when I connect the odrive, it stops receiving data from the two CAN connected to the other two ESP32s( 1 and 2 ).
I don’t know what is causing this issue. Any idea?

Well first off, idk why you didn’t just connect the CAN to the ODrive :slight_smile:

But you’re missing a GND between the three ESP32s.

Where is the power coming from for the ODrive and for the ESP32s? Careful not to make ground loops.

I have several other sensors connected to the third esp and need to right a control loop based on all the sensors. So, sticking with esp.
I haven’t showed it in the diagram but the three esp32s share a GND.

The odrive is powered with two 22 V in series and the third esp32 is powered directly through a USB. The other two esp32s are powered with from the USB and GND pin of the third ESP32. The ESPs are properly wired, I know that because it works without the odrive.

Sure but you don’t need UART, you can just use CAN to control the ODrive.

Anyway, if they all share a ground but have different power supplies you may want to put a digital isolator on the UART between the ODrive and the ESPs, and run completely separate power domains.

Thank you for your help.

In case I want to use CAN to set the communication between the third ESP and the odrive, can you direct me to any library to control the current of of the motors connected to the odrive via CAN communication from the ESP?