Robotics StackExchange | Archived questions

Change a device state via "0x6041 Controlword"

Hello, this question is a follow up of this question. After a successful initialization, the motor jumps to Operation enabled state and immediately transits to Switch On Disabled (transition 9) of unknown cause . The transitions are controllable via 0x6041 Controlword object in float format, for example, sending a command by following rosservice call should perform transition 3,4 and set the device to Operation Enabled.

    rosservice call /artaban_motor/driver/set_object "node: 'front_left_joint_2_skelet_segment_upper'
    object: '6041'
    value: '591'
    cached: true"

Unfortunately, the service with any Controlword value does not actually change a device state and is not reflected in Statusword change. Do I get this service functionality right? Is there any other way, how to force the device to change a state? I use Maxon Epos4 controller with IDX56M motor.

image description

image description

Asked by martinlucan on 2021-11-29 05:25:42 UTC

Comments

Would it be possible to document your answer in the first question as it looks you successfully resolved?

Asked by osilva on 2021-11-29 07:42:41 UTC

Answers

Hi martinlucan, it seems that you try to set the Statusword read-only object. Your idexes are inverted: Controlword is 0x6040 and Statusword 0x6041.

I think something like this should work:

rosservice call /artaban_motor/driver/set_object front_left_joint_2_skelet_segment_upper '!!str 6040' '!!str 591' false

Asked by Cyril Jourdan on 2021-12-02 12:18:09 UTC

Comments

Thank you, you were actually, I somehow mixed up two objects. While addressing the right 6040 Controlword object, I have managed to reach the Operation enabled state, but just for a very short time period. The motor immediately transits back to its previous state. Do you have any clue what might force the device to do so?

Please find .dcf file in a link

Asked by martinlucan on 2021-12-06 09:12:35 UTC

Hi Martin, Looking at your DCF file, your PDO mapping is different than what ros_canopen expects, so this is most likely the issue. You need to redo the PDO mapping as follows:

RxPDO
- RxPDO1 1st object: Controlword (0x60400010)
- RxPDO1 2nd object: Target Velocity (0x60FF0020)
- RxPDO2 1st object: Target Position (0x607A0020)
- RxPDO2 2nd object: Profile Velocity (0x60810020)
- RxPDO3 1st object: Profile Acceleration (0x60830020)
- RxPDO3 2nd object: Profile Deceleration (0x60840020)
- RxPDO4 1st object: Target Torque  (0x60710010)
- RxPDO4 2nd object: Modes of Operation (0x60600008)

Asked by Cyril Jourdan on 2021-12-23 09:45:44 UTC

and TxPDO like this:

TxPDO
- TxPDO1 1st object: Statusword (0x60410010)
- TxPDO1 2nd object: Modes of Operation display (0x60610008)
- TxPDO2 1st object: Velocity demand value (0x606B0020)
- TxPDO2 2nd object: Velocity actual value (0x606C0020)
- TxPDO3 1st object: Position Actual value (0x60640020)
- TxPDO3 2nd object: Velocity actual value averaged (0x30D30120)

I made a tutorial and sample code for using maxon EPOS4 with ros_canopen here. Please have a look for further debugging and feel free to open a new question if needed. Let me know if that works.

Asked by Cyril Jourdan on 2021-12-23 09:51:07 UTC