Beruflich Dokumente
Kultur Dokumente
Revision Remarks
0.1 07/2017, First revision.
1 08/2017, Updated for motion task editing, formatting
Technical changes which improve the performance of the device may be made without prior notice!
Printed in the United States of America
This document is the intellectual property of Kollmorgen. All rights reserved. No part of this work may be repro-
duced in any form (by photocopying, microfilm or any other method) or stored, processed, copied or dis-
tributed by electronic means without the written permission of Kollmorgen.
1 Table of Contents
1 Table of Contents 3
2 Project Notes 5
3 Project Components 6
4 Introduction to the Sample Project 7
5 Configuration of the AKD 8
6 Starting with the Sample Project 9
6.1 Overview 9
6.2 GSD File Installation 9
6.3 PLC Device Selection 9
6.4 PLC IP Address 10
6.5 AKD Device Name 11
6.6 AKD IP Address 11
6.7 Compile and Download 12
6.8 Go Online 14
6.9 Ladder Programming 14
7 Function Block Reference 16
7.1 Telegram 400 Function Block 16
7.1.1 General Description 16
7.1.2 Notes 21
7.1.3 Detailed input description 21
7.1.4 Detailed output description 23
7.2 Direct Parameter Access Function Block 25
7.2.1 General Description 25
7.2.2 Notes 26
7.2.3 Detail input description 26
7.2.4 Detail output description 27
7.3 Edit Motion Task Position Function Block 28
7.3.1 General Description 28
7.3.2 Notes 29
7.3.3 Detail input description 30
7.3.4 Detail output description 30
8 Creating a New Project 31
8.1 PLC Device Selection 31
8.2 PLC IP Address 32
8.3 GSD File Installation 33
8.4 Add AKD Device 34
8.5 AKD Device Name 35
8.6 AKD IP Address 35
8.7 Create the Profinet Network 36
8.8 Add the Telegram 37
8.9 Telegram I/O Addresses 39
8.10 Compile and Download 39
8.11 Go Online 41
8.12 PLC Project Components 41
2 Project Notes
For better readability of the code, some variables have a prefix of a lower case letter, the definition is as fol-
lowing.
3 Project Components
The sample project contains the following components:
Other similar projects for AKD Profinet will have similar components, but each component may vary depend-
ing on the purpose of the project.
A new project can be created using the provided project components. The function blocks can even be mod-
ified to support other telegrams or added functionality. But the sample projects are provided as an initial com-
plete solution, which can then be modified by the integrator as needed.
Revision notes of the projects, components, and even this manual are listed in the ladder program properties
of each project. This includes which revision of each component that is used in each project revision. These
revision notes can also be found in the pdf printouts of the ladder programs.
This manual provides instructions and reference information for a sample project used in a Siemens PLC to
control the Kollmorgen AKD drive with Profinet fieldbus communications. The system contains an S7-1200
or S7-1500 PLC and an AKD-Pxxxxx-xxPN drive. The sample project applies to both the 1200 CPU and the
1500 CPU. The program code between those versions is identical. This sample project is for a single AKD
axis. However, it can be easily modified for a multi-axis system.
All Automation functions are controlled by the PLC. The functions covered are the following:
Each function is controlled by specific bits and variables and the actual values of the drive are read back in
cyclic communication.
This manual should help the PLC programmer understand the communication configuration and function
block integration, and perform some simple motion.
The communication between the AKD (connector X11) and the PLC (connector X1P1) is handled by the
Profinet RT protocol hereafter called Profinet. The physical connection is via standard Ethernet cable.
In the PLC, the instructions DPRD_DAT and DPWR_DAT are used to exchange cyclic data between the
two devices in “real time”. For the service channel parameter access, the instructions RDREC and WRREC
are used.
At some points this manual refers to the AKD Profinet manual. The latest manual can be found on the Koll-
morgen website.
Never use the sample project unchanged in an application. The Sample Project is intended as an example of
integrating the AKD into a TIA-Project. This Sample Project must be modified according to the real applic-
ation.
KOLLMORGEN cannot be held liable for any damage caused by the use of the Sample Project or any parts
of it.
The basic setup of the AKD has to be done in Workbench. The Profinet and Workbench connections can be
used at the same time. The limitation is with the parameter access, as Profinet can deny access to certain
parameters from outside. The drive should be commissioned and tested prior to setting up the Profinet
communications. The two important settings relating to Profinet communications are the drive’s name and
the drive’s IP address.
6.1 Overview
The sample project is made available as a TIA archive file. This allows the entire project to be contained in a
single file.
As the project opens, the GSD file will automatically be installed in your TIA system.
After opening the project, go into the “Device Configuration” screen and make the following changes. The
changes should be made in the offline mode. After making the changes, compile and download the project to
the PLC.
l Open the “Device Configuration” screen. (Expand PLC_1 in the Project Tree)
l Select the “Device View”.
l Open the “Device Configuration” screen. (Expand PLC_1 in the Project Tree)
l Select the “Device View”.
l Click on the image of the CPU.
l Click on “Properties”. (at the bottom)
l Click on “Ethernet addresses.”
l Enter the IP address you want to use for the PLC.
l Open the “Device Configuration” screen. (Expand PLC_1 in the Project Tree)
l Select the “Topology View” tab.
l Click on the icon of the AKD-Device.
l Select the “Device View” tab.
l Click on the icon of the AKD-Device (again).
l Right-click on the device name and click “Rename”.
l Enter the name you want to use.
After configuring a drive name in Workbench and saving it, the drive needs to be rebooted in order for the PLC
to recognize that new name.
l Open the “Device Configuration” screen. (Expand PLC_1 in the Project Tree)
l Select the “Topology View” tab.
This is the same IP address that is configured by either the rotary switches on the AKD drive or in
Workbench. It needs to have the same subnet as the PLC’s IP address.
l Select the “PLC_1” heading or the “Program blocks” heading in the project tree.
l Click the “Compile” button in the toolbar.
l Wait for the compile to complete.
l Click the “Download” button in the toolbar.
l Select the PN/IE network and your network hardware and start the search for the PLC.
l Select the PLC in the search results and click “Load”.
l The software will give you some instructions or options prior to downloading (click “Load”).
6.8 Go Online
Click the Go Online button on the toolbar to connect to the PLC. When the software is online, you will see the
header bars turn orange. There are colored status indicators next to some of the entries in the Project tree and
in the Network Overview. These indicators should be green. If the indicators are red, then an error exists.
One example of an error that is common is when the drive name has been saved in Workbench, but the drive
has not yet been rebooted. The PLC will not recognize the name of the drive and will indicate that an error
exists.
One item in particular that may need to be changed or removed is the homing command. By default, the lad-
der program issues the start home command when the drive is enabled for the first time after the drive boots
up. If you are using a multi-turn absolute feedback device, then you will probably want to remove the homing
altogether. Your application will dictate how the homing should be started. This goes for the position moves
and jog move as well.
The PNU read/write may or may not be needed. If it’s not used for your application, you can remove those lad-
der networks from the program.
Tag names can be changed as needed, but make sure the change is made to every instance of the tag.
Some functions in the sample project ladder program are not set up to be automated. For example, the PNU
read and writes must be activated manually in the program by forcing the state of the contacts. You will need
to complete the programming by providing digital inputs or other means of automation for these functions.
*The Profinet data are not mapped 1:1 into the AKD. The PROFIdrive data conversion has to be regarded.
Detailed information can be found in the input description or the Profinet manual.
7.1.2 Notes
The function block uses Telegram 400 for cyclic data communication. The AKD can also be controlled by any
of the other telegrams specified in the AKD Profinet manual.
The Profinet cycle time is 16ms. A new motion task is only accepted after a completed handshake which can
take up to eight cycles.
In the function block status word, the fault number is indicated if a drive fault is active. If only a warning and
no fault is active the warning number is indicated in the status double word. The number is only read on occur-
rence. To reread the number an iReset has to be performed.
In the workbench setup, the drive command source DRV.CMDSOURCE has to be set to zero (Service) and
the DRV.OPMODE to two (position mode). These settings are required for the drive to be position controlled
by Telegram 400.
This project has been createdusing aSiemens CPU1212C-DC/DC/DC and an AKD-P00306-NBPN-0000
with Firmware 1-16-00-002.
iInit
With the iInit active the Profinet communication gets reset with an all zero send command. Starts the pro-
cess of mapping Telegram 400. Only needs to run one time on program start to configure the data for Tele-
gram 400. Can be activated subsequent times to reinitialize the function block. It acts as a
PLC/communication reset.
iEstop
Executes an immediate QuickStop. STW1 Bit2 is set to 0. All motion is brought to halt and the drive is soft-
ware disabled. This uses DRV.DISMODE and the Controlled Stop parameters. To recover, iReset has to be
executed once. It inhibits all other STW1 commands until the controlled stop is complete. Only one scan is
required to start the controlled stop function. Multiple scans are required waiting for motion to stop, before any
other STW1 bits are valid. It sets all STW1 bits=0 when motion stops.
iSW_ENABLE
0 = disables the AKD
iStop
1 = Stop of all motion in progress without disabling the AKD. Commands a stop and pause of the motion task
(STW1 bits 4 and 5 = 0) and clears the bits that start jog and home moves (STW1 bits 8, 9, 11, 12 = 0).
iReset
1 = Reset of all active drive faults. The instruction gets executed once per rising edge. It turns on STW1 bit 7
and then turns it off after 3 scans. Only 1 scan required to start the reset.
iStart_Homing
1= Starts the homing according to the setup done in Workbench. The iCmdPos sets the homing distance
(HOME.DIST) in the AKD, which performs an immediate absolute move after homing The instruction gets
executed once per rising edge.
iStart_Jog
Starts a jog move. Uses iCmdVel as the jog speed, and iCmdAcc and iCmdDec for the ramps. iCmdVel,
iCmdAcc, and iCmdDec must be non-zero for a jog move to start.
A negative speed setpoint commands a jog move in the negative direction.
STW1 bit12=1 is set during enable process. STW1 bit 8 is used for the start jog command.
The axis needs to be homed to execute this command. Requires only one scan to start or stop the jog move.
Deactivating this input will stop the jog move.
iStart_Move
Starts a motion task position move. iMTNum defines which motion task is started. If iMTNum is set to
0x8000, then the “direct motion task” configured with the iCmdxxx parameters is executed. The instruction is
executed once per rising edge. The execution can take up to eight scans, during which time the iStart_Move
is ignored.
Turns on STW1 bit 6 to start the move, and looks for the "move acknowledgement" to turn off bit 6 after the
move has started.
Requires only momentary activation of this input for one scan to start the move, assuming no stop, home, or
jog commands are active.
Requires being deactivated for at least one scan after the move starts before triggering a new start move com-
mand.
Note: The AKD prevents any other motion (position move, jog, or homing) from being started while any of
these types of moves are in progress. The current motion must complete prior to setting the start bits for a sub-
sequent position move, homing move, or jog move.
iMT_Pause
Pauses (temporarily interrupts) a motion task.
Activating this input sets STW1 bit 5 = 0 to pause the move.
When this input is deactivated (bit 5 set back to 1), the move will continue from where it paused. If a Stop or a
Software disable gets executed, the continuing option is suspended.
iMT_MoveType
Selects the type of position move: 0 = Relative, 1 = Absolute.
This is the telegram data referred to in the AKD Profinet manual as “MDI_MOD”.
iMTNum
Selects the motion task to be executed. This is the telegram data referred to in the AKD Profinet manual as
“SATZANW”.
A value of 32768 (0x8000) selects the "Direct Motion Task", which uses the MDI profile data in the telegram
(iCmdxxx inputs) to define the Direct Motion Task (Motion Task 0).
Any value from 1 to 128 selects a preconfigured motion task saved in the drive.
iCmdPos
Target positon/distance for the direct motion task. This is the telegram data referred to in the AKD Profinet
manual as “MDI_TARPOS”.
The position resolution is per default scaled with 2^16 counts/rev. The resolution setting can be adjusted with
PNU 1002.
iCmdPos * 360° / Value PNU 1002 = Position in degrees.
It is also used for HOME.DIST (distance to be moved after homing).
iCmdVel
Target velocity for the direct motion task or real time jog command. This is the telegram data referred to in the
AKD Profinet manual as “MDI_VELOCITY”.
The velocity is scaled with 2^32 equals 12,000 rpm.
iCmdVel * 12000 rpm / 2^32 = Velocity in revolution per minute.
iCmdAcc
Target acceleration for the direct motion task or real time jog command. This is the telegram data referred to in
the AKD Profinet manual as “MDI_ACC”.
The acceleration is per default scaled with 2^16 equals 50,000,000 rpm/sec. The smallest possible value for
acceleration is 763 rpm/sec. To change the interpretation of an acceleration value, the PNU 1008 has to be
set to the according minimum value.
iCmdAcc / value PNU 1008 = Acceleration in revolution per minute per second.
iCmdDec
Target deceleration for a direct motion task or real time jog command. This is the telegram data referred to in
the AKD Profinet manual as “MDI_DEC”.
The deceleration is per default scaled with 2^16 equals 50,000,000 rpm/sec. The smallest possible value for
acceleration is 763 rpm/sec. To change the interpretation of a deceleration value, the PNU 1008 has to be set
to the according minimum value.
iCmdDec / value PNU 1008 = Acceleration in revolution per minute per second.
For a more detail instruction manual use the AKD workbench help at the designated commands.
oStatus
Shows the actual status word one (ZSW1) in the low word.
Shows any active fault or warning number in the high word.
oPosition
Actual position of the axis (XIST_A) as 32 Bit DWord. The position resolution is per default scaled with 2^16
counts/rev. The resolution setting can be adjusted with PNU 1002.
oPosition * 360° / Value PNU 1002 = Position in degree.
oVel
Actual speed of the axis (NIST_A) as 16 Bit Word. The velocity resolution is with 2^15 equals 12000 rpm
scaled.
oVel * 12000 rpm / 2^15 = Velocity in revolution per minute.
oCurrent
Actual current of the axis (ITIST_GLATT) as 16 Bit Word. The current resolution is with 2^14 equals the max-
imum current of the drive.
oCurrent * DRV.IPEAK / 2^14 = Current in ampere.
Multiplied with the KT of the motor, this gives the actual Torque.
oEnabled
Indicates that the drive is enabled.
oError
Indicates an error in the communication or the PLC command execution.
oMoving
Indicates an active discrete or continuous motion in progress, (jogging, motion task or homing).
oHomed
Indicates that the homing has been done successful. This must be TRUE to start any motion task or real time
jogging.
oInPos
Indicates that the actual position is within MT.POSWND, of the target position, of the executing motion task.
The movement doesn’t have to be finished at this moment. When a motion task is started, the oInPos always
goes Zero for a minimum of one cycle. This also happens if the motion task called gives an error or doesn’t do
any movement at all.
oFault
Indicates a fault on the AKD. The corresponding fault number is in the status word or can be read with PNU
947
oWarning
Indicates a warning on the AKD. The corresponding warning number is in the status word or can be read with
PNU 2791-2793.
7.2.2 Notes
The Format of the requested parameter must be 0x41, 0x42, or 0x43.
In read mode, (iRequestType = FALSE), the value of ioData always represents the last read data. In read
mode, ioData is read-only.
Reference the AKD parameter “PN.POSSCALE” for information on position scaling for PNU’s with index
greater than 2000.
iID
Hardware identifier of the telegram of the corresponding Profinet Device (AKD). The HW_SubModule can be
linked to this input or the value of the hardware identifier can be directly entered. The Value is found with the
properties of the telegram under hardware identifier.
iStartRequest
Starts a read or write command. The instruction gets executed once per rising edge.
iRequestType
Sets the mode to read or write.
0 = Read
1 = Write
iFormat
Sets the format (data size) of the requested parameter. If this value is outside the three possible values, an
error is indicated.
0x41 = Byte, 8Bit
0x42 = Word, 16 Bit
0x43 = DWord, 32 Bit
iPNUnumber
PNU address of the requested parameter. This can be seen in the AKD Profinet manual or in the Workbench
help.
iPNUsubIndex
PNU subindex of the requested parameter.This can be seen in the AKD Profinet manual or in the Workbench
help.
ioData
Output of the read data if iRequestType = FALSE, the value is updated when a new request is started. During
a request the data is zero.
Input if the data is written, iRequestType = TRUE. In write mode, the data is not changed at all in the function
block.
oDone
Is set TRUE with every successful request. The Data are valid form this moment. Done is reset with a new
request or a termination of the connection.
oError
Indicates an error with PNUWrite, PNURead or a validation fault. A validation fault is aninvalid input.
oStatus
Indicates the PNUWrite or PNURead status, only if the function has an error.
PNURead RDREC Static Read function for the service data channel objects
PNUWrite WRREC Static Write function for the service data channel objects
bDoWrite Bool Static Start write command
bDoRead Bool Static Start read command
byReadArray[0..147] Byte Static Data array for the read command
byWriteArray[0..15] Byte Static Data array for the write command
bPNUWriteBusy Bool Static Write command active
bPNUWriteDone Bool Static Write command finished
bPNUWriteError Bool Static Write command failed
dwPNUWriteStatus DWord Static Write command status
bPNUReadBusy Bool Static Read command active
bPNUReadDone Bool Static Read command finished
bPNUReadError Bool Static Read command failed
dwPNUReadStatus DWord Static Read command status
wDataLenght Word Static Length of the read data
bReqActive Bool Static Rising edge of a new request
wLenght Word Static Length of the write data
byReference Byte Static Reference number of the last request
bReadActive Bool Static Read common execution
bWriteActive Bool Static Write command execution
7.3.2 Notes
The function block performs a PNU write sequence that includes writing to MT.NUM, MT.LOAD, MT.P, and
MT.SET. It then reads the position value back from the task after issuing a new MT.LOAD command, and
compares the value with what was written. If the values are not the same, it tries the sequence a second
time.
If oDone is TRUE and oSuccess is FALSE, it means that the FB attempted to write the new position value
twice and failed both times. This can happen if the motion task was not created and saved in the AKD drive’s
memory.
Reference the AKD parameter “PN.POSSCALE” for information on position scaling for PNU’s with index
greater than 2000.
iStartRequest
Starts the sequence to write the motion task position. The instruction gets executed once per rising edge.
iTaskNumber
Selects the motion task. Must be a value ranging from 1 to 128.
iPosition
Sets the value of the position to write into the motion task.
oDone
Is set TRUEwhen the request has been completed. oDone is reset with a new request or a termination of the
connection.
oSuccess
Is set TRUEwhen the position value has been written successfully. oSuccess is reset with a new request or
a termination of the connection.
oError
Indicates an error with PNUWrite, PNURead or a validation fault. A validation fault is aninvalid input.
oStatus
Indicates the PNUWrite or PNURead status, only if the function has an error.
l Open the “Device Configuration” screen. (Expand PLC_1 in the Project Tree)
l Select the “Device View”.
l Click on the image of the CPU.
l Click on “Properties”. (at the bottom)
l Other field devices -> PROFINET IO -> Drives -> Kollmorgen -> AKD -> Head module
l Other field devices -> PROFINET IO -> Drives -> Kollmorgen -> AKD -> Module.
l Open the “Device Configuration” screen. (Expand PLC_1 in the Project Tree)
l Select the “Topology View” tab.
l Click on the icon of the AKD-Device.
l Select the “Device View” tab.
l Click on the icon of the AKD-Device (again).
l Right-click on the device name and click “Rename”.
l Enter the name you want to use.
l Open the “Device Configuration” screen. (Expand PLC_1 in the Project Tree)
l Select the “Topology View” tab.
l Click on the icon of the AKD-Device.
l Select the “Device View” tab.
l Click on the icon of the AKD-Device (again).
l Click on “Properties”. (at the bottom)
l Click on “Ethernet addresses”.
l Enter the IP address that you want to use for the AKD drive.
After the Profinet network connection is defined, the appropriate telegram must be added to the AKD-Device.
Drag and drop the telegram module from the hardware catalog into the Device Overview, (the possible area
highlights in blue under the interface line).
The telegram can be found in the Hardware catalog in the category Other field devices -> PROFINET IO ->
Drives -> Kollmorgen -> AKD -> Module.
Other telegrams that are supported by the AKD drive and descriptions of the data they contain are listed in the
AKD Profinet manual. The cyclic communication function block in the sample project works with Telegram
400, but you can use any of the available telegrams if you create a function block to support it. Telegram 400
consists of the data in telegram 9 plus some additional free mappable bytes.
l Select the “PLC_1” heading or the “Program blocks” heading in the project tree.
l Click the “Compile” button in the toolbar.
l Wait for the compile to complete.
l Click the “Download” button in the toolbar.
l Select the PN/IE network and your network hardware and start the search for the PLC.
l Select the PLC in the search results and click “Load”.
l The software will give you some instructions or options prior to downloading (click “Load”).
8.11 Go Online
Click the Go Online button on the toolbar to connect to the PLC. When the software is online, you will see the
header bars turn orange. There are colored status indicators next to some of the entries in the Project tree
and in the Network Overview. These indicators should be green. If the indicators are red, then an error
exists.
One example of an error that is common is when the drive name has been saved in Workbench, but the drive
has not yet been rebooted. The PLC will not recognize the name of the drive and throw and error.
ing from the sample project uses a global library. A global library is a location on your PC that is accessible by
any project in TIA Portal.
In order to use the function blocks from the sample project, the necessary files are:
FB1 – Function block for telegram 400
FB2 – Function block for PNU access
UDT – PLC data type file (maps the FB data to the telegram)
Optionally, you can use the ladder program from the sample project. The files are:
Main program
DB1 – Data block for FB1
DB2 – Data block for FB2
Tag table
The inputs and outputs of the function block must be defined. Commonly, tags are used these. You can drag
and drop tags from the tag table or select them from the available list for each input and output on the function
block.
The iID is the hardware submodule identification. This tells the function block which telegram is being used
for the AKD-Device.
8.14 Multi-Axis
The sample project can be easily modified for a multi-axis system containing multiple AKD drives by adding
duplicate AKD-Devices, function blocks, data blocks, and tags for each axis. It is important to keep the nam-
ing of the function blocks, data blocks, and tags in a convention that is easily understood so it is clear which
ones are for which axis.
Join the Kollmorgen Developer Network for product support. Ask the community ques-
tions, search the knowledge base for answers, get downloads, and suggest improve-
ments.