Skip to content

CAN bus troubleshooting #231

Description

@void-aere

Two issues with the can bus were identified today during testing. Here's how to get drive working despite them. Consider this a stopgap; these issues very much can and should be fixed, and soon, but in the meantime refer to this info.

1. Kernel Modules

It looks like the proper kernel modules are not being loaded on startup. This should be an easy fix but I haven't done it yet, so this works instead for now.

Before starting the drive motor_control_relay, load the following modules:

sudo modprobe can
sudo modprobe mttcan
sudo modprobe can_raw

I don't yet know which of these specifically is missing.

After this is done, bring down the interface: sudo ip link set can0 down. Trying to run the motor_control_relay will automatically configure it and bring it back up.

2. Bus Weirdness

For some reason, it looks like the motor_control_relay's commands to clear ODrive errors and put them in closed loop control are being received. However, manually sending the correct packets using cansend seems to work.

After starting the driver motor_control_relay, to actually put the ODrives in closed-loop control:

cansend can0 004#01c40200
cansend can0 007#08
cansend can0 024#01c40200
cansend can0 027#08
cansend can0 044#01c40200
cansend can0 047#08
cansend can0 064#01c40200
cansend can0 067#08

Each ODrive gets a command to clear its errors before being told to go into AxisState.CLOSED_LOOP_CONTROL.

jacob out

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingdrive

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions