# roscanopen + cyclic position mode + nanotec controller

Hello all,

I have a nanotec integrated servo controller (the PD6-CB87S048030-E-09), with support for CanOpen in DS402 profile.

I am wondering about the cyclic synchronous position mode, which is described as:

In this mode, the motor controller receives an absolute positional specification at fixed time intervals via the field bus. In this case, the motor controller no longer computes ramps but only follows the specifications. The target position is transfered via PDO, to which the motor controller responds promptly. Note: The target specification is absolute and thus independent of how often it was sent per cycle.

Is the cycle being refered to here the period of the SYNC message, sent by the canopen master? On the ROS side, how often do i publish to <joint_name>/command, if the joint node is registered in cyclic synchronous position mode? Do i publish at a rate that is at least greater than the cycle period?

My application is a wheeled robot, and i'm using this controller for the steering column. My controller translates cmd_vel message to absolute angles for the steering columns in rads and publishes to /command topic on every update() call. Is it better to use profile position here?

edit retag close merge delete

Sorry I can't help you but I'm currently tasked with a similar project. I shall control several DB42M03 Motors using the CL3-E Controller. In the documentation they show the structure of the needed CAN message but not how to create them. Can you provide a code example how to control a motor via ros?

( 2017-11-14 04:01:59 -0500 )edit

ros_canopen only needs to be configured as shown in the wiki, using the manufacturer eds file ros_canopen also exposes a ros-control interface for the joints of your robot, so write a ros-controller that publishes to the /command topic of the joint interface, ros-canopen handles writing the canbus.

( 2017-11-14 10:10:54 -0500 )edit

Sort by » oldest newest most voted

Is the cycle being refered to here the period of the SYNC message, sent by the canopen master?

This depends on your config. If you set-uo synchronous PDOs it will be at SYNC rate, otherwise at PDO rate.

Note: The target specification is absolute and thus independent of how often it was sent per cycle.

Since you have to command the ramp, this does not hold. Have you considered using the PP mode?

On the ROS side, how often do i publish to <joint_name>/command, if the joint node is registered in cyclic synchronous position mode? Do i publish at a rate that is at least greater than the cycle period?

I would not use forward controllers with the synchronous modes. ROS topic are not real-time safe, neither is the ros_canopen implementation.

more

I asked a followup question above. excuse me for placing it in the wrong spot

( 2017-11-09 09:50:20 -0500 )edit

Thank you for your response Mathias.

"I would not use forward controllers with the synchronous modes. ROS topic are not real-time safe, neither is the ros_canopen implementation."

I think i understand what you mean. In cyclic synchronous position mode, ramps are not computed by the controller, and therefore the trajectory points need to be provided by the master at fixed intervals. Because of this, ros_canopen would not perform well because it is not real-time safe. Is my understanding correct?

In PP mode, absolute target specifications are given to the motor controller as well, but not at fixed intervals. They are sent whenever. When a target specification is sent to the motor controller, the motor controller computes the ramp to get to that position. So even though ros-canopen is not real-time safe, it does not affect the performance of your system because the motor controller handles the ramp computation. Are these statements correct?

I have some further questions:

In PP mode, if i am using PDO to send the absolute target position to the motor controller, i have two options: (1) Synchronous PDO, and (2) Asynchronous PDO.

In (1), the PDO is automatically sent at every SYNC interval. Say my motor is at position B. I want to move it to position A. I have to publish position A to <joint_name>/command at the next update() of my ros-controller, with a certain rate specification of x hz. this rate has to be greater than the sync rate, so the next sync interval retreives the most recent command.

In (2), Asynchronous PDOs are event-controlled. This means that when at least one of the process variables mapped in a PDO is altered, for example an input value, the PDO is immediately transmitted. if i am using (2) (async. PDOs), in the update() of my controller, when i write a new value to /command, is the PDO immediately updated in the motor controller? If i do not want to actuate my joint, i would have to continually write the last command at every update, so that the lack of change does not trigger a PDO transmission?

more

( 2018-02-07 13:48:21 -0500 )edit