Motion Control and Motor Drives

cancel
Showing results for 
Search instead for 
Did you mean: 

Using LabView and Modbus to Communicate with AKD Servo Drive

I’m working on a project to control a Kollmorgen AKD servo application using Modbus directly from LabVIEW.  I’m new to both LabVIEW and servo drives so forgive me if this seems simple.  I have established communications to the drive through Modbus and have been successful at some rudimentary control of the servo.  I know the drive only supports "Write Multiple Registers” and “Read Holding Registers” functions and there are scaling factors that need to be applied.  What I need is some help with taking the Modbus information supplied by Kollmorgen for each command and formatting it for communication to the servo and vice versa.  I need to understand how to take the supplied 8, 16, 32, and 64 bit information for commands, scale it, and format it into the two or four registers required for the drive to read the parameters.  In turn, I also need to understand how to take the same information and read it and scale it from the drive.  I’ve attached a spreadsheet with the particular commands I’m interested in and a sample VI that seems to work for speed control but to be honest, I'm not sure how/why.

Download All
0 Kudos
Message 1 of 11
(9,552 Views)

LarryLarder,

 

If you answer the following questions, I can get a better gage of how to go about steering you in the right direction:

 

-What card are you using to communicate with your AKD Drive?

-What is the model of your AKD Drive?

-What is the model of your servo?

-What driver are you using to communicate with your card as of now? Softmotion?

-Are you familiar with ethercat? Most AKD drives are ethercat compliant and work very well with out softmotion add-on.

 

Modbus will not be as robust as compared to ethercat. Here is a good overview of using ethercat with your AKD drive.

 

Also, there is a discussion about using Modbus with Softmotion located here. Although, I am not sure how helpful that this will be.

 

Best,

Jason M.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 11
(9,532 Views)

Jason,

 

Thanks for the reply.  To answer your questions:

 

  •  I am not using a card to communicate with the drive.  (I’m using an Ethernet cable directly from my PC  to the Ethernet port on the drive.)
  •  The drive model number is:  AKD-P00306-NBAN-0000
  •  The servo model number is:  AKM23D-ANBNC-00
  • As I am using no card, there is no driver.
  • I am not familiar with Ethercat
0 Kudos
Message 3 of 11
(9,528 Views)

LarryLarder,

 

Take a look at this forum. It details some basic uses of Modbus and your AKD Drive. Also, have you looked at the Kollmorgen AKD HMI Modbus Communications Manual yet? Let me know if this is sufficient to get you started, or if you have any specific questions that I can help you with.

 

Best,

Jason M.
Applications Engineer
National Instruments
0 Kudos
Message 4 of 11
(9,524 Views)

Thanks for the reference information.  I now have a working example that I'd like some help with.  Using the AKD Modus command to read angular displacement, I have developed the attached vi.  It works but it seems like it may be too complicated.  Is there a simpler way to combine the multiple registers and account for positive and negative values?  I also noticed that data is being coerced (red dots) in several places.  Is this a normal occurrence?

0 Kudos
Message 5 of 11
(9,468 Views)

LarryLarder,

 

Firstly, I wouldn't quite call this "too complicated." When I opened your VI I expected nested loops, sub VIs, and a block diagram that takes up multiple screens. While you could use a For Loop (with auto indexing enabled) instead of indexing your array 4 times, I think that this looks pretty clean. To respond to your data coercion question, this is not uncommon. You could always explicitly change the data type or use a different kind of indicator if you were worried about performance and "best practices." For combining multiple registers, you do a decent job or it as is. You could always use the aforementioned for loop and a single case structure, and combine the "divide by 1000, divide by 20, multiply by .343323," but as I said, that's personal preference.

 

Best,

Jason M.
Applications Engineer
National Instruments
0 Kudos
Message 6 of 11
(9,457 Views)

OK, I've got the ability to read values from the AKD drive pretty well sorted out.  I'm now having trouble with the ability to write.  I want to use Labview to program Motion Tasks in the AKD drive.  To do this I need to perform three commands: MT.NUM (specify the motion number), MT.P (specify the angular position), and MT.SET to set the parameters for the task.  MT.P requires sending a 64 bit signed float or a 32 bit signed float (requiring four or two registers respectively).  I used ModPoll to see what values the drive held in the MT.P registers after entering the desired angular position using the AKD Workbench software.  For example: using Workbench I entered 234.567 for the angular position and read 208 and -32506 from registers 2060 & 2061 (the 32 bit registers for MT.P).  After scouring the forum I put together the attached VI to try to write to the same registers but I can not seem to get the translation of the input (angular position) to the register values correct (entering 234.567 does not produce 208 and -32506 in registers 2060 & 2061).  Anyone have any ideas?

0 Kudos
Message 7 of 11
(9,372 Views)

LarryLarder,

 

Since you can read values from your AKD drive, your issue is with the ModBus communication. Since the issue is with ModBus, it will help you best to post on the Industrial Communications forum since ModBus is supported through that forum and ModBus users frequent that forum more than the Motion Control forum. One thing that may make it difficult to troubleshoot is that even though the AKD Workbench writes 208 and -32506 to registers 2060 and 2061 when 234.567 is input, we don’t really know how they’re converting that data or if something extra is being done to the data. I hope this information helps.

Blake C.
Applications Engineer
National Instruments
www.ni.com/support
0 Kudos
Message 8 of 11
(9,355 Views)

I want to make sure that I share the latest revision of the Getting Started with AKD EtherCAT® Drives and the LabVIEW NI SoftMotion Module document.

0 Kudos
Message 9 of 11
(5,214 Views)
I am currently working on the AKD servos command via Modbus, I found the same problems as those of you. Can you give me more details about your solution and thank you
0 Kudos
Message 10 of 11
(4,288 Views)