ros-industrial / ros2_canopen

CANopen driver framework for ROS2
https://ros-industrial.github.io/ros2_canopen/manual/rolling/
127 stars 52 forks source link

Mode switch timed out. #234

Open Vidicon opened 7 months ago

Vidicon commented 7 months ago

Describe the bug

We were trying to get a ENGEL HBI3760 working with the 402 driver, but we kept hanging on the [canopen_402_driver]: Mode switch timed out.

After looking through the logs, we found that the halt bit is set when it tries to change modes of operation, this does not work as that's not allowed in this motor:

In the datasheet on page 49:

Notice: Changing the mode of operation is not allowed, when the HALT-bit (Bit 8 of Controlword 6040h, chapter 5.3.1) is set!

as a quick test, when we change:

https://github.com/ros-industrial/ros2_canopen/blob/7687f3276107d81f52e1f961566942508eb07d85/canopen_402_driver/src/motor.cpp#L272 to if (okay || true)

the driver starts working,

is there a way to do fix this without changing the code, or what would be a better solution for this.

Setup: