The aim of the project is to provide a flexible and portable interface for odrive brushless motor control hardware. Driver is written in C++ for performance and portability reason and communication with the hardware is performed using a USB port and odrive native format. The software is ported to ROS Operating System and the node is publishing status information about the motor controller and also listening for control command. For our test we are using the nvidia Xavier arm64 host.
Example Json configuration file:
[
{
"name":"config.brake_resistance",
"type":"float",
"value":0.0
},
{
"name":"axis0.motor.config.pole_pairs",
"type":"int32",
"value":5
},
{
"name":"axis0.motor.config.resistance_calib_max_voltage",
"type":"float",
"value":4.0
}
]
The driver based on for setting-up an axis channels for a specific application or BLDC motor. Then values can be read or set using a similar to odrivetool notation.
Driver implements a publisher providing status information for both odrive channels at fixed intervals. The information which is published includes the following fields:
float32 vbus # Bus voltage
int32 error0 # Axis 0 error
uint8 state0 # Axis 0 state
float32 vel0 # Axis 0 velocity
float32 pos0 # Axis 0 encoder position
float32 curr0B # Axis 0 motor channel B current
float32 curr0C # Axis 0 motor channel C current
float32 temp0 # Axis 0 invertr temperature
int32 error1 # Axis 1 error
uint8 state1 # Axis 1 state
float32 vel1 # Axis 1 velocity
float32 pos1 # Axis 1 encoder position
float32 curr1B # Axis 1 motor channel B current
float32 curr1C # Axis 1 motor channel C current
float32 temp1 # Axis 1 inverter temperature
A listener supports basic commands, such as enabling or disabling the closed loop, setting the velocity set-point etc. Following the list of basic command set that can be easily extended according to application needs:
// Listener commands
enum commands {
CMD_AXIS_RESET,
CMD_AXIS_IDLE,
CMD_AXIS_CLOSED_LOOP,
CMD_AXIS_SET_VELOCITY,
CMD_REBOOT
};
I'm trying to use this driver with the newer 0.5.4 firmware. It's telling me that it's having trouble reading from the USB. I know it's at least connected as it gives a different error if the USB is unplugged or I change the USB protocol on the odrive. What steps would I take to add/ remove commands? Are they in a particular order or does it not matter? Also, where did you find the commands? I was unable to locate them on the ODrive website or github.
Thanks