Control trinamic servo drive using ros_canopen, error: Could not set transition
Hi, I am trying to use the following tutorial (http://wiki.ros.org/ros_canopen/Tutorials/UsingMaxonEPOS4inProfileOperatingModes) to run a motor(QMot QBL4208 family - BLDC) using Trinamic TMCM-1636 servo drive(link: https://www.trinamic.com/products/modules/details/tmcm-1636/). To keep things simple I didnt change the name of the package and left it as "epos4_canopen" and left the name "maxon" as it was. I am not using a maxon motor drive.
my rosdistro is: noetic, rosversion: 1.15.15
My files, including the candump and dcf files, are located here: https://github.com/nigel-bruce-khan/ros_canopen-tmcm-1636
I used the following guide to edit the eds file: https://www.trinamic.com/fileadmin/assets/Support/AppNotes/AN076-CANopenPDOs.pdf.
From the tutorial at the top, when I run the following line, rosservice call /maxon/driver/init
I get the error below:
success: False
message: "/home/nigel/catkin_ws/src/ros_canopen-noetic/canopen_master/include/canopen_master/objdict.h(496):\
\ Throw in function canopen::ObjectStorage::Entry<T> canopen::ObjectStorage::entry(const\
\ canopen::ObjectDict::Key&) [with T = short int]\nDynamic exception type: boost::wrapexcept<std::bad_cast>\n\
std::exception::what: std::bad_cast\n[canopen::tag_objectdict_key*] = 6071\n; Could\
\ not set transition"
And on the terminal with roslaunch epos4_canopen maxon_epos4.launch
running, I see the error below when I run the rosservice call /maxon/driver/init
command, seen above already:
auto-starting new master process[master]: started with pid [14675] ROS_MASTER_URI=http://localhost:11311 setting /run_id to 0e274dba-d864-11ed-95b4-9ff592fd9d67 process[rosout-1]: started with pid [14685] started core service [/rosout] process[maxon/canopen_motor-2]: started with pid [14693] process[maxon/controller_spawner-3]: started with pid [14694]
[ INFO] [1681215977.260201393]: Using fixed control period: 1.000000000
[ INFO] [1681215983.927060334]: Initializing...
[ INFO] [1681215983.927414235]: Current state: 1 device error: system:0 internal_error: 0 (OK)
[ INFO] [1681215983.927684087]: Current state: 2 device error: system:0 internal_error: 0 (OK)
[ WARN] [1681215986.033700874]: illegal transition 0 -> 2
[ INFO] [1681215986.034045603]: Current state: 2 device error: system:125 internal_error: 0 (OK)
[ INFO] [1681215986.034199377]: Current state: 0 device error: system:125 internal_error: 0 (OK)
[ INFO] [1681215986.034399236]: Current state: 0 device error: system:0 internal_error: 0 (OK)
[ INFO] [1681215986.034741540]: Current state: 0 device error: system:0 internal_error: 0 (OK)
[ERROR] [1681215986.035052640]: Initializing failed: /home/nigel/catkin_ws/src/ros_canopen-noetic/canopen_master/include/canopen_master/objdict.h(496): Throw in function canopen::ObjectStorage::Entry<T> canopen::ObjectStorage::entry(const canopen::ObjectDict::Key&) [with T = short int]
Dynamic exception type: boost::wrapexcept<std::bad_cast>
std::exception::what: std::bad_cast
[canopen::tag_objectdict_key*] = 6071
; Could not set transition
I have tried not mapping object 6071( Target torque ) in RxPDO 4. That results in the error below:
success: False
message: "/home/nigel/catkin_ws/src/ros_canopen-noetic/canopen_master/include/canopen_master/objdict.h(88):\
\ Throw in function const T& canopen::HoldAny::get() const [with T = canopen::NodeIdOffset<short\
\ int>]\nDynamic exception type: boost::wrapexcept<std::bad_cast>\nstd::exception::what:\
\ std::bad_cast\n; Could not set transition"
I tried changing the data type as suggested here (https://answers.ros.org/question/406364/canopen_master-initializing-failure-with-stdbad_cast-could-not-set-transition/) that resulted in the same error as the first one above. I could not find CANeds or something equivalent to check my eds/dcf file, so I am mostly working manually.
I tried using the TMCM Can_open IDE (https://www.trinamic.com/support/software/) to write the dcf file, but it only worked partially, and then I had to write some of the parameterValues manually.
I would really appreciate some help to deal with this error.
Thank you.
Update:
Check the updated dcf and candump files here: https://github.com/nigel-bruce-khan/ros_canopen-tmcm-1636
Could someone please help. I now get the error:
[ INFO] [1683032345.113865024]: Initializing...
[ INFO] [1683032345.114068387]: Current state: 1 device error: system:0 internal_error: 0 (OK)
[ INFO] [1683032345.114268962]: Current state: 2 device error: system:0 internal_error: 0 (OK)
[ERROR] [1683032348.119030454]: EMCY received: 81#20630100ff000000
[ERROR] [1683032349.116620258]: EMCY received: 81#0000000000000000
[ INFO] [1683032357.225372821]: Current state: 0 device error: system:0 internal_error: 0 (OK)
[ INFO] [1683032357.225477093]: Current state: 0 device error: system:0 internal_error: 0 (OK)
[ERROR] [1683032357.225746479]: Initializing failed: Transition timeout; Could not enable motor; Transition timeout
Asked by nigelbrucekhan on 2023-04-11 08:38:14 UTC
Comments