CANopen control MAxon EPOS2, Sparkfun CANshield and Seeedstudio CAN library

I just completed a project with Arduino Uno, CANbus shield and using de Seeedstudio CAN library controlling a maxon EPOS2 servodrive via CANopen. Works perfectly for me.

CANopen is just another way of using the 8 available databytes of an CAN message. Also the CAN ID’s used, have to conform the CANopen specification.

The Seedstudio CAN library allows to receive messages on interrupt, or polled. The interrupt method did not work for me, as I missed messages. Using polled reception and configuring the CAN message filters correctly worked best.

CANopen also allows messages to be Synced with the CANopen master (in this case my Arduino). You can control the CAN busload very nicely in using this mechanism. I was able to send data and receive status messages with 100Hz using a pre-stored motion profile on the uSD card.

The controller has 4 buttons;
-Start (with build in green led)
-Stop (with build in red led)
-Jog up
-Jog down

I have implemented a very simple state-machine, using switch/case statements.

Liked to share my code, could be usefull if you want to start a CANopen project.

MaxonEPOS2_DemonstratorV01.ino (17.6 KB)

Hello,

I have been playing with your code and keep getting these error's:

205: undefined reference to CAN' 215: undefined reference to CAN'
216: undefined reference to `CAN'

Do you have any ideas what I might be doing wrong?
I am a bit new to this, it could just be me missing something very simple.

Thanks

Iain

Hello

i've tried to compile the code and i've received the same error than you. I've been reviewing the code and I think the problem is that you need tu put before the void setup the next:

MCP_CAN CAN(10);

Where 10 is the number of the Chip Select of your Shield.
I've compiled the code and now I don't receive any error.

Hello.

As for me, an current control wants to control a motor made in maxon in Arduino and CAN-BUS shield and EPOS2.

Therefore, with the help of your cord, I intended to control it.

There was not an error, and the note was possible without a problem even if I compiled it, but there was no reaction.

If there is the part which I get a wrong because I list my cord here, would you point it out?

Kindly the answer thanking you in advance.

CAN_BUS.ino (3.48 KB)

Hello,

I downloaded the MaxonEPOS2_DemonstratorV01.ino file and tried it with EPOS4, but I could not.

I've revised the code as follows, but no results. What should I do? Can you help me?

Thanks in advance.

ardu_can_050519.ino (21 KB)