LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Controlling a Stepper using CANOpen Protocol

Solved!
Go to solution

Hello all,

 

I have the following hardware.

 

1. A Nanotec CANopen Motor controller (C5-E-2-09)

http://us.nanotec.com/products/1764-c5-e-canopen-motor-controller-for-stepper-and-bldc-motors/

 

2. A NEMA 17 Stepper motor

http://us.nanotec.com/products/677-l41-linear-actuators-with-lead-screw/

 

3. An Active USB interface

http://www.ixxat.com/products/products-industrial/pc-interfaces/pc-can-interfaces/details-pc-can-int...

 

I made all the connections.

 

I would like to use the CANopen protocol to control my stepper motor- a few steps forward or backward at a time and stopping to record sensor data through a COM port.

 

I understand that I might need the following CANopen library.

https://www.ni.com/docs/en-US/bundle/ni-industrial-communications-canopen/page/canopenhelp/canopen_h...

 

I have the following questions.

 

1. Is there a way to achieve my objective without needing to buy the CANopen module? I have the CAN drivers installed but I have read on various discussions that developing a code while figuring out the protocols might be a little tricky. I dont mind buying the library if that will save me some time and effort.

 

2. Do I need any additional hardware? (I have a power sourse capable of delivering the voltage and current required by the controller.)

 

Also, I would be really grateful if someone could point me to a few example of stepper motor control using CANopen protocol.

 

Thank you.

 

Regards,

Rahul

 

0 Kudos
Message 1 of 3
(4,814 Views)
Solution
Accepted by topic author rkorpu

You can program the motor controller via the micro-usb port using the NanoJ program provided by Nanotec.  These programs run from the embedded firmware on the controller and have to be downloaded to the controller first.

 

For a more interactive and on-the-fly development environment the CAN interface is the way to go.  In order to use the CAN interface you'll need a CAN master controller (CAN transciever) connected to your PC to command the  motor controller.  NI makes a number of USB to CAN interfaces that ship with the NI-XNET driver and allow you to create CAN frame definitions specific to your hardware.  The CAN frame protocol is defined in the programming manual for the C5-E motor.  

 

Also, many manufactures that use the CAN protocol in their hardware often provide CAN database files (*.xml, *.dbc, *.ncd).  You can import these CAN frame definitions into XNET so that you don't have to create the CAN frames (packets) one by one.  Buying the NI-CAN library should not be necessary.  

 

Good luck.

Message 2 of 3
(4,758 Views)
Solution
Accepted by topic author rkorpu

The CANOpen library you reference makes use of the old NI-CAN API that came with the old CAN interfaces from NI. All the newer CAN interfaces support instead the NI-XNET API which is not directly compatible with NI-CAN but you can let the NI-XNET driver install a compatibility layer so NI-CAN is emulated on top of NI-XNET. However this emulation is not fully transparent and I'm not sure that the CANOpen VI library would run on top of that emulated NI-CAN driver. NI doesn't recommend that approach at all but they haven't confirmed that it would or wouldn't work.

 

NI also sells a few special CANOpen compatible hardware interfaces which come with their own CANOpen specific API.

The CANOpen VI library you refer to, definitely won't work with your ixxat interface though!

 

If your device supports CAN frame based communication and comes with the according .dbc file though you just have to use NI-XNET directly to communicate with your device through an NI CAN interface. If you intend to keep using the ixxat interface you have to contact them about possible approaches to talk to your device. NI doesn't sell software drivers for 3rd party hardware.

 

 

Rolf Kalbermatter
My Blog
Message 3 of 3
(4,719 Views)