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

ROS_CANOpen motor synchronization problem

asked 2019-01-12 01:16:17 -0500

jxy gravatar image

updated 2019-01-15 09:07:12 -0500

I am using ROS_CANOpen to control a differential drive robot, and using the "profiled position" drive mode. I used schunk_lwa4p as a template: https://github.com/ipa320/schunk_robo...

When I publish my target position to the topic /arm/joint_group_position_controller/command, sometimes my motors do not start at the same time. Checking my logs, I found that sometimes one motor will begin moving one sync interval later than the other. This is very noticeable because I am having to run at a very slow sync interval of 200ms as a result of this ROS_CANOpen issue: https://github.com/ipa320/schunk_robo... and the seemingly related https://github.com/ros-industrial/ros... (which increasing tx queue length helps but doesn't resolve).

It may be notable that I could not reproduce this problem using "profile velocity" mode.

Thank you for reading

edit retag flag offensive close merge delete

Comments

gvdhoorn gravatar image gvdhoorn  ( 2019-01-12 02:25:21 -0500 )edit

Correct. Is that ok?

jxy gravatar image jxy  ( 2019-01-12 07:07:07 -0500 )edit

cross-posting is typically frowned upon, as it leads to split discussions, with duplication of effort as a result.

gvdhoorn gravatar image gvdhoorn  ( 2019-01-12 07:58:46 -0500 )edit

Sorry about that. Should I delete one of them? I thought if there was a fix on my end it would get addressed here and if there was a fix needed on the ROS_CANOpen end it would get addressed there.

jxy gravatar image jxy  ( 2019-01-12 14:04:02 -0500 )edit

1 Answer

Sort by » oldest newest most voted
0

answered 2019-01-16 04:50:25 -0500

Mathias Lüdtke gravatar image

to control a differential drive robot, and using the "profiled position" drive mode

I don't think that profiled position mode is suitable for controlling a diffential drive. It is is setpoint-based, so the timing might vary between different modules.

I used schunk_lwa4p as a template

While you can reuse some parts of it, I don't think that it is helpful to use it as template. It is meant for schunk hardware with highly specific settings.

This is very noticeable because I am having to run at a very slow sync interval of 200ms

You should really try reduce this, I would target at least 20ms.

Checking my logs, I found that sometimes one motor will begin moving one sync interval later than the other.

The motion should get commanded in the same sync slot. How do you determine the start of the motion?

as a result of this ROS_CANOpen issue: https://github.com/ipa320/schunk_robo...

That's a non-issue, and quite specific the Schunk LWA hardware.

edit flag offensive delete link more

Comments

"You should really try reduce this, I would target at least 20ms."

If I set the sync interval lower than 200ms the startup/init sequence fails. The console prints "CAN not ready" and I don't know how to fix. ~10% of the time the init sequence succeeds and after that everything runs properly.

jxy gravatar image jxy  ( 2019-01-16 09:56:31 -0500 )edit

"CAN not ready" should be rare. You can try see whats happening in the candump.. Please make sure that your PDO mappings are correct: http://wiki.ros.org/canopen_402

Mathias Lüdtke gravatar image Mathias Lüdtke  ( 2019-01-16 14:09:11 -0500 )edit

PDO mappings look good. I noticed that the "CAN not ready" message correlates in time with the SYNC message going out from the master while the 2nd node on the bus is being initialized. Could this be the root cause? Is it possible to delay SYNCs until after all nodes have initialized?

jxy gravatar image jxy  ( 2019-02-05 17:49:09 -0500 )edit

Implementing the fix discussed here solved my issue:  https://github.com/ros-industrial/ros...

jxy gravatar image jxy  ( 2019-02-18 10:33:54 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2019-01-12 01:16:17 -0500

Seen: 428 times

Last updated: Jan 16 '19