Ask Your Question
0

Motor control using ROS, Epos2 and CANOpen

asked 2020-07-28 10:55:46 -0500

JulienTemplai gravatar image

Hello everyone,

I happen to be stuck for a few days now by problems some of the forum's members apparently already encountered, whence this question. I hope the latter will not be considered as superfluous, and that it could prove to be helpful to others.

My computer runs a 64-bit Debian GNU/Linux 10 (buster) OS, and ROS Noetic Ninjemys (rosversion -d says noetic). I besides installed the package "ros_canopen" from the "package.ros.org" repositories using sudo apt-get install ros-noetic-ros-canopen.

My current goal is to manage to send rotation speed commands to an AC motor equipped with a Hall sensor (similar to this model) through an EPOS2 70/10 electric drive, using the CANOpen communication protocol, and thus, the "ros_canopen" package. My problem is that I actually don't know where to start to achieve such objective.

After some researches, I ended up trying to follow the steps proposed here on the forum. I was though not even able to complete the first stage, consisting in setting-up SocketCAN. I met indeed two issues:

  1. When loading the drivers, the command sudo modprobe pcan returns modprobe: FATAL: Module pcan not found in directory /lib/modules/4.19.0-9-amd64
  2. When running sudo ip link set can0 up type can bitrate 1000000, which says sudo ip link set can0 up type can bitrate 1000000. The device "can0" does besides not appear in the list provided by ifconfig -a.

Could you please give me a clue about how to overcome those problems ?

An additional difficulty may come from the fact that I have chosen thus far to connect the EPOS2 controller to my computer using its USB output only. I do not employ any CAN-to-USB interface, simply because I do not have one to hand for now. Is such a device necessary to perform motor control ?

Could you finally please recommend me a tutorial, or give me pieces of advice, regarding motor control using the "ros_canopen" package.

Thanks a lot, regards,

Julien.

edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted
1

answered 2020-08-06 08:28:22 -0500

HHHCMH gravatar image

first you should have a usb-can dev and it could support pcan. For example,pcan-usb.After installing the driver, then you can use ifconfig -a to check can0 which exists or not . When you find can0, it shows that you install the driver correctly. Here is the website you can refer:http://www.peak-system.com/file...

edit flag offensive delete link more

Comments

Thank you for your answer. If I understand you correctly, a CAN-USB interface (such as this one) is definitely required to perform motor control using the "ros_canopen" package, isn't it ? I will besides check the Peak System's website as you suggested.

JulienTemplai gravatar image JulienTemplai  ( 2020-08-07 02:38:18 -0500 )edit
0

answered 2020-08-11 03:54:21 -0500

Mathias Lüdtke gravatar image

updated 2020-08-11 10:45:32 -0500

UPDATE: https://answers.ros.org/question/3581... is correct! You have to buy a (USB-)CAN device first.

For PEAK ones you can load the driver like this:

As documented in the wiki, you might want to try

sudo modprobe peak_usb

The pcan module needs to be downloaded from the PEAK website and installed manually.

However, the latest versions do not support SocketCAN ("NetDev") anymore, because it is now provided by the mainline kernel.. (peak_usb or peak_pci module).

edit flag offensive delete link more

Comments

Thanks for this additional information ! I will try to find a USB-CAN interface somewhere in my lab.

JulienTemplai gravatar image JulienTemplai  ( 2020-08-11 04:41:19 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2020-07-28 10:55:46 -0500

Seen: 414 times

Last updated: Aug 11 '20