ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
3

How to control Maxon MCD Epos with ROS_canopen and IXXAT adapter

asked 2018-05-31 17:01:16 -0600

jdeleon gravatar image

updated 2018-06-07 04:06:14 -0600


Important Edit: for ROS CANopen you don't need to load the controllers, only the URDF file of the motor to get the joints and specifications of it.


Hi all, I am trying to build an RHex style robot.

RHex robot

For it locomotion I have selected 6 Maxon MCD Epos motors. That are connected via CAN with an IXXAT USB-to-CAN adapter.

Maxon MCD Epos

IXXAT adapter

First of all, I try to manage the MCD with the package epos_hardware ( link ), I get all the motors work but with a different configuration (the first one via USB-RS232 to the computer and then it generates a CAN network with the others motors). The problem is that the frequency to control the motors is only 3 Hz and I need at least 20 Hz.

So, having try ros package epos_hardware and testing that it can't connect to Maxon motors via Canopen I am trying to use ros_canopen package ( can_open ) and following the instructions from Mathias (Instructions)

But I'm having the same errors that CJ.

[ INFO] [1527765873.067864309]: Initializing XXX
[ INFO] [1527765873.068224620]: Current state: 1 device error: system:0 internal_error: 0 (OK)
[ INFO] [1527765873.068457195]: Current state: 2 device error: system:0 internal_error: 0 (OK)
[ INFO] [1527765881.288870355]: Current state: 2 device error: system:125 internal_error: 0 (OK)
[ INFO] [1527765881.288943915]: Current state: 0 device error: system:125 internal_error: 0 (OK)
[ INFO] [1527765881.288998158]: Current state: 0 device error: system:0 internal_error: 0 (OK)
[ INFO] [1527765881.289078940]: Current state: 0 device error: system:0 internal_error: 0 (OK)

And also, some errors with the controllers

[INFO] [1527765775.163013]: Controller Spawner: Waiting for service controller_manager/load_controller
[WARN] [1527765805.295161]: Controller Spawner couldn't find the expected controller_manager ROS interface.

I follow all the steps that Mathias explain in the other question.

  1. Setup SocketCAN Can0 port

  2. Prepare URDF with sane limits The xacro file of the robot is correct. You can download it from here

  3. Prepare EDS/DCF, take special care for the PDO mapping I generated all the 6 files with Maxon Epos Studio and change PDOmapping=0 to PDOmapping=1

  4. Prepare driver config

    • prepare chain config
    • configure motor-specific settings, especially unit conversions This is my yaml file with the configuration (canopen.yaml)

bus:

  device: can0
  loopback: false
  driver_plugin: can::SocketCANInterface
  master_allocator: canopen::SimpleMaster::Allocator
sync:
  interval_ms: 10
  update_ms: <interval_ms>
  overflow: 0
  #heartbeat: # simple heartbeat producer, optional!
  #rate: 20 # heartbeat rate
  msg: "77f#05" # message to send, cansend format: heartbeat of node 127 with status 5=Started

nodes:

node1:
    id: 1
    eds_pkg: canopen_chain_node # optionals package name for relative path
    eds_file: "config/MCDepos_node_1.dcf" # path to EDS/DCF file

  node2:
    id: 2
    eds_pkg: canopen_chain_node # optionals package name for relative path
    eds_file: "config/MCDepos_node_2.dcf" # path to EDS/DCF file

  node3:
    id: 3
    eds_pkg: canopen_chain_node # optionals package name for relative path
    eds_file: "config/MCDepos_node_3.dcf" # path to EDS/DCF file

  node4:
    id: 4
    eds_pkg: canopen_chain_node # optionals package name for relative path
    eds_file: "config/MCDepos_node_4.dcf" # path to EDS/DCF file

  node5:
    id: 5
    eds_pkg: canopen_chain_node # optionals package name for relative path
    eds_file: "config ...
(more)
edit retag flag offensive close merge delete

Comments

1

Hi jdeleon, I'm very interesting in using maxon controllers with ros_canopen as well. I have them working in ROS for many years with my own code but it's rather limited. Unfortunately the library they provide doesn't deal with CAN and PDO AFAIK. I'll try and share my results.

Cyril Jourdan gravatar image Cyril Jourdan  ( 2018-06-01 03:29:44 -0600 )edit

Hi @Cyril_J, thank you for your reply. Please, could you tell me how are you controlling Maxon Motors? I have been stuck with this problem for more than 8 months. And I need to get a solution.

Thank you!

Jorge

jdeleon gravatar image jdeleon  ( 2018-06-04 02:05:21 -0600 )edit

Did you manage to correct the issues with motor4? Could you launch correctly the canopen_motor_node? Can you update your post with the solutions? Thanks in advance. Best regards.

akosodry gravatar image akosodry  ( 2018-06-07 02:01:20 -0600 )edit
2

Hi @akosodry, I have just update the situation. - I have no error with motor4. I don't know why. - I can launch correctly canopen_motor_node, but I can't initialize correctly the motors:

\ >\nstd::exception::what: std::bad_cast\n[canopen::tag_objectdict_key*] = 6061sub0\n
jdeleon gravatar image jdeleon  ( 2018-06-07 04:08:08 -0600 )edit

Thnk you @jdeleon for the detailed update. Its nice to have these reference subresults, without these and the forum it would have been much much difficult. I am starting to work on a Delta motors-based setup from saturday. If i succeed i will also try to help here.

akosodry gravatar image akosodry  ( 2018-06-07 04:13:40 -0600 )edit

Hi @jdeleon, I have exactly the same error during the driver/init service call. In my setup I've got an EPOS 2 70/10 motor controller which I would like to drive in current mode.

Soeren gravatar image Soeren  ( 2018-06-07 05:46:27 -0600 )edit

Hi @Soeren, this might be unrelated to your error, but I think maxon current mode is not a standard mode in CANOpen CiA 402, and also not listed in canopen_402. I'm using current mode a lot with EPOS2, so I'm very interested to know how to extend this package with custom modes.

Cyril Jourdan gravatar image Cyril Jourdan  ( 2018-06-07 09:30:41 -0600 )edit

Hi @akosodry, hope you be successful, which motors are you using?

jdeleon gravatar image jdeleon  ( 2018-06-08 01:56:48 -0600 )edit

1 Answer

Sort by » oldest newest most voted
3

answered 2018-06-15 00:44:55 -0600

Soeren gravatar image

Hi guys, I stopped working with ros_canopen_chain_node and motor_node when I saw that the messages on the CANbus sent by a device/setobject service call to change my controlword made no sense.

I'm now using the kaCanopen C++ library - Its well documented, full of examples and works like a charm! Maybe it's also worth a shot for all who are struggling with getting ros_canopen running!

Cheers, Sören

edit flag offensive delete link more

Comments

Hi @Soeren,

thank you for your message. I will try with that package.

Do you have Maxon motors?

jdeleon gravatar image jdeleon  ( 2018-06-19 08:12:27 -0600 )edit

In my setup I've got an EPOS 2 70/10 motor controller.

Soeren gravatar image Soeren  ( 2018-06-19 08:16:42 -0600 )edit

Does this package have an interface with ros_control ?

Cyril Jourdan gravatar image Cyril Jourdan  ( 2018-06-19 08:29:31 -0600 )edit

@Soeren, Could you share your project in github?

I try to compile the package, but as I'm using a IXXAT adapter, it is not supported:

"At the moment, the following drivers are available: lincan, peak_linux, serial, socket, virtual, dummy."

jdeleon gravatar image jdeleon  ( 2018-06-19 09:41:56 -0600 )edit

@Soeren, could you tell me which CAN adapter are you using?

Thank you!

jdeleon gravatar image jdeleon  ( 2018-06-21 01:45:46 -0600 )edit

@jdeleon, Just for information, if you need a cheap USB to CAN, the CANable works fine with SocketCAN, otherwise the Jetson TX2 is a good way to have embedded CAN bus. I use the IXAAT only as a bus sniffer on Windows.

Cyril Jourdan gravatar image Cyril Jourdan  ( 2018-06-21 02:09:16 -0600 )edit

thank you for the information @Cyril_J I use IXXAT because Maxon told me that was the one that really works. And it works with example cpp with linux.

The people from Maxon told me that maybe the problem could be with that the package uses the PDOs instead the SDOs

jdeleon gravatar image jdeleon  ( 2018-06-21 02:42:57 -0600 )edit

Thank you for the CANable adapter, but they don't send to Spain...

jdeleon gravatar image jdeleon  ( 2018-06-21 02:46:11 -0600 )edit

KaCanOpen implements both SDOs/PDOs, I don't think that's the problem, it's a driver issue. You can try the Peak PCAN which seems to be supported, or some SPI to CAN. Other option, I used to program CAN on the mbed microcontroller and linked that with RS232 to USB to the robot computer running ROS.

Cyril Jourdan gravatar image Cyril Jourdan  ( 2018-06-21 03:35:41 -0600 )edit

Hey @jdeleon I'm sorry I'm not allowed to share my project, but I can tell you that I'm using a PeakCan adapter. Cheers Sören

Soeren gravatar image Soeren  ( 2018-06-21 04:09:22 -0600 )edit

Question Tools

9 followers

Stats

Asked: 2018-05-31 17:01:16 -0600

Seen: 2,208 times

Last updated: Jun 07 '18