CiA 402 Add-on - SYS TEC electronic GmbH

CiA 402 Add-on
Software Manual
Edition August 2008
system house for distributed automation
CiA 402 Add-on
In this manual are descriptions for copyrighted products which are not explicitly
indicated as such. The absence of the trademark (©) symbol does not infer that a
product is not protected. Additionally, registered patents and trademarks are
similarly not expressly indicated in this manual
The information in this document has been carefully checked and is believed to be
entirely reliable. However, SYS TEC electronic GmbH assumes no responsibility
for any inaccuracies. SYS TEC electronic GmbH neither gives any guarantee nor
accepts any liability whatsoever for consequential damages resulting from the use
of this manual or its associated product. SYS TEC electronic GmbH reserves the
right to alter the information contained herein without prior notification and
accepts no responsibility for any damages which might result.
Additionally, SYS TEC electronic GmbH offers no guarantee nor accepts any
liability for damages arising from the improper usage or improper installation of
the hardware or software. SYS TEC electronic GmbH further reserves the right to
alter the layout and/or design of the hardware without prior notification and
accepts no liability for doing so.
© Copyright 2008
SYS TEC electronic GmbH. rights – including those of
translation, reprint, broadcast, photomechanical or similar reproduction and
storage or processing in computer systems, in whole or in part – are reserved. No
reproduction may occur without the express written consent from SYS TEC
electronic GmbH.
Address:
EUROPE
NORTH AMERICA
SYS TEC electronic GmbH
August-Bebel-Str. 29
D-07973 Greiz
GERMANY
PHYTEC America LLC
203 Parfitt Way SW, Suite G100
Bainbridge Island, WA 98110
USA
Ordering
+49 (3661) 6279-0
Information: [email protected]
1 (800) 278-9913
[email protected]
Technical
Support:
+49 (3661) 6279-0
[email protected]
1 (800) 278-9913
[email protected]
Fax:
+49 (3661) 62 79 99
1 (206) 780-9135
Web Site:
http://www.systec-electronic.com
http://www.phytec.com
1st Edition August 2008
© SYS TEC electronic GmbH 2008
L-1096e_1
Table of Contents
1
2
3
4
5
6
Introduction......................................................................................... 1
The CiA 402 state machine................................................................. 2
API Description ................................................................................... 3
3.1 Configuration of the CiA 402 state-machine ............................... 4
3.2 API Functions............................................................................... 5
3.2.1 Function Ccm402Init ...................................................... 5
3.2.2 Function Ccm402SetState............................................... 6
3.2.3 Function Ccm402GetState .............................................. 7
3.2.4 Function Ccm402Process................................................ 8
3.2.5 Function Ccm402OperationModeChanged .................. 10
3.3 SDO Callback Functions............................................................ 11
3.3.1 Function Ccm402CbSetControlword............................ 11
3.3.2 Function Ccm402CbSetOperationMode....................... 12
3.4 PDO Callback Functions............................................................ 12
3.4.1 Function AppCbVarControlword ................................. 13
3.4.2 Function AppCbVarOperationMode............................. 13
3.5 Callback functions of the CiA 402 state machine...................... 14
3.5.1 Single-event referenced callback functions callded prior
state change ................................................................... 14
3.5.1.1 Function Ccm402SwitchOnDisabledAllowed
........................................................................ 14
3.5.1.2 Function Ccm402ReadyToSwitchOnAllowed
........................................................................ 15
3.5.1.3 Function Ccm402SwitchedOnAllowed ......... 16
3.5.1.4 Function Ccm402QuickStopAllowed............ 17
3.5.1.5 Function Ccm402OperationEnableAllowed.. 18
3.5.2 State-dependent cyclically referenced callback functions
....................................................................................... 18
3.5.2.1 Function Ccm402Operation........................... 19
3.5.2.2 Function Ccm402QuickStopOperation ......... 20
3.6 Operation Modes ........................................................................ 21
Object Dictionary.............................................................................. 23
4.1 Communication parameters........................................................ 23
4.2 Homing Mode ............................................................................ 25
4.3 Profile Position Mode................................................................. 26
4.4 Profile Velocity Mode................................................................ 26
4.5 Profile Torque Mode .................................................................. 27
4.6 Velocity Mode............................................................................ 28
4.7 Interpolated Position Mode ........................................................ 28
4.8 Manufacturer-specific Objects, Example application ................ 29
Abbreviations .................................................................................... 31
References .......................................................................................... 33
L-1096e_1
© SYS TEC electronic GmbH 2008
CiA 402 Add-on
Index ........................................................................................................... 35
© SYS TEC electronic GmbH 2008
L-1096e_1
Index of Tables and Figures
Figure 1:
State-machine according to CiA 402 (see also [1]) ................... 2
Table 1:
Operation Modes...................................................................... 21
Table 2:
CiA 402 specific object dictionary see also [1] ....................... 25
Table 3:
Object dictionary entries for "Homing Mode"......................... 25
Table 4:
Object dictionary entries for “Profile Position Mode” ............ 26
Table 5:
Object dictionary entries for “Profile Velocity Mode”............ 26
Table 6:
Object dictionary entries for “Profile Torque Mode” .............. 27
Table 7:
Object dictionary entries for “Velocity Mode”........................ 28
L-1096e_1
© SYS TEC electronic GmbH 2008
CiA 402 Add-on
© SYS TEC electronic GmbH 2008
L-1096e_1
IntroductionIntroduction
1 Introduction
This document describes the CiA 402 extenstion for the
SYS TEC electronic GmbH CANopen Protocol Stack.
The software implements the state-machine according to CiA 402 [1]
and contains all mandatory functions and objects. It supports singleand multi-axis operation.
L-1096e_1
© SYS TEC electronic GmbH 2008
1
CiA 402 Add-on
2 The CiA 402 state machine
internal Events
13
Power
Disabled
Fault
0 Start
7 Fault
Reaction Active
0
14
1 Not Ready to
Switch On
8 Fault
1
15
2 Switch On
Disabled
2
7
3 Ready to
Switch On
3
6
Power
Enabled
10
4 Switched On
9
8
4
5
5 Operation
Enable
Figure 1:
2
12
11
16
6 Quick Stop
Activ
State-machine according to CiA 402 (see also [1])
© SYS TEC electronic GmbH 2008
L-1096e_1
TAPI Description
3 API Description
The software contains the following files:
CCM\Ccm402St.c
generic implementation of the CiA 402
state-machine.
CCM\Ccm402Tp.c
contains function templates to be filled by
the user. These functions are called from
within the CiA 402 state-machine and act
as an interface to the application (call-back
functions).
Include\Ccm402.h
Function prototypes and definitions of the
CiA 402 extension.
Examples\ex_slv402.c Sample application to demonstrate the
usage of the CiA 402 extension.
Objdicts\DS402_1axis Sample object dictionary for a single axis
application. Includes the EDS file as well
as the corresponding ODBilder project
file.
Objdicts\DS402_2axis Sample object dictionary for a two-axis
application. Includes the EDS file as well
as the corresponding ODBilder project
file.
L-1096e_1
© SYS TEC electronic GmbH 2008
3
CiA 402 Add-on
3.1 Configuration of the CiA 402 state-machine
The configuration of the CiA 402 extension is independent from the
configuration of the CANopen stack. The following configuration
options are available in file Ccm402.h:
1. Number of axes (max. 8 according to CiA 402). The example
source code demonstrate the use of two axes. In case only one axis
is required by the user application the API get simplified and the
runtime performance increases.
#define CCM402_MAX_AXIS
1
Note: The number of axis must match the object dictionary
configuration. Hence, the object dictionary must support the
number of axis configured with CCM402_MAX_AXIS.
We provide example sources for single-axis and two-axis support.
In case multiple axis are required, the API functions will require
additional parameters which are activated by macro
CCM402_DECL_AXIS and CCM402_DECL_AXIS_. The makro
COMMA controls the usage of multiple axis in case multiple
instances are used.
2. Selection of supported motion profiles.
The user can deactivate not used profiles by setting the
corresponding definition to FALSE.
The following definitions are available:
#define
#define
#define
#define
#define
#define
4
CCM402_USE_PROFILE_POSITION_MODE
CCM402_USE_VELOCITY_MODE
CCM402_USE_PROFILE_VELOCITY_MODE
CCM402_USE_TORQUE_PROFILE_MODE
CCM402_USE_HOMING_MODE
CCM402_USE_INTERPOLATED_POSITION_MODE
© SYS TEC electronic GmbH 2008
FALSE
TRUE
TRUE
TRUE
FALSE
FALSE
L-1096e_1
TAPI Description
3.2 API Functions
3.2.1 Function Ccm402Init
Syntax:
#include <ccm402.h>
COPDLLEXPORT tCopKernel PUBLIC
Ccm402Init (
CCM_DECL_INSTANCE_HDL_
COMMA
CCM402_DECL_AXIS)
Parameters:
CCM_DECL_INSTANCE_HDL_:
COMMA:
Instance handle
Macro used to control multiple
axes and instances.
Number of axis (if multiple axis
are supported).
CCM402_DECL_AXIS:
Returns:
kCopSuccessful
0
The function executed successfully.
Description:
This function initialises the CiA 402 state machine for the specified
axis.
L-1096e_1
© SYS TEC electronic GmbH 2008
5
CiA 402 Add-on
3.2.2 Function Ccm402SetState
Syntax:
#include <ccm402.h>
COPDLLEXPORT
void
Ccm402SetState (
PUBLIC
CCM_DECL_INSTANCE_HDL_
tDs402States NewState_p,
WORD MEM *pwStatusword_p
CCM402_DECL_AXIS_)
Parameters:
CCM_DECL_INSTANCE_HDL_:
Instance handle
NewState_p:
The new CiA 402 state to be set.
*pwStatusword_p:
Pointer to the status word of the
axis to be updated with the new
state.
CCM402_DECL_AXIS_:
Number of axis (if multiple axis
are supported).
Returns:
Nothing
Description:
This function will register a new state in the CiA 402 state-machine of
the selected axis. Furthermore it registers the new state to the status
word of the selected axis (e.g. object 6041h for axis 0). The status
word must be defined in the application and connected to the
corresponding object dictionary entry (see also [3]).
6
© SYS TEC electronic GmbH 2008
L-1096e_1
TAPI Description
3.2.3 Function Ccm402GetState
Syntax:
#include <ccm402.h>
COPDLLEXPORT
tDs402States
PUBLIC Ccm402SetState (
CCM_DECL_INSTANCE_HDL_
COMMA
CCM402_DECL_AXIS)
Parameters:
CCM_DECL_INSTANCE_HDL_:
Instance handle
COMMA:
Macro used to control multiple
axes and instances.
CCM402_DECL_AXIS:
Number of axis (if multiple axis
are supported).
Returns:
tDs402States
Description:
This function returns the current state of the selected axis. The
following states are defined:
kDs402State_START
0 after Power-on or
reset
kDs402State_NOT_READY_TO_SWITCH_ON 1
kDs402State_SWITCH_ON_DISABLED
2
kDs402State_READY_TO_SWITCH_ON
3
kDs402State_SWITCHED_ON
4
kDs402State_OPERATION_ENABLE
5
kDs402State_QUICK_STOP_ACTIV
6
kDs402State_FAULT_REACTION_ACTIV
7
kDs402State_FAULT
8
L-1096e_1
© SYS TEC electronic GmbH 2008
7
CiA 402 Add-on
3.2.4 Function Ccm402Process
Syntax:
#include <ccm402.h>
COPDLLEXPORT tCopKernel PUBLIC
Ccm402Process (
CCM_DECL_INSTANCE_HDL_
WORD Controlword_p,
WORD MEM *pwStatusword_p
CCM402_DECL_AXIS_)
Parameters:
CCM_DECL_INSTANCE_HDL_:
Instance handle
Controlword_p:
CiA 402 control word of the
selected axis.
*pwStatusword_p:
Pointer to the status word of the
selected axis to be updated.
CCM402_DECL_AXIS_:
Number of axis (if multiple axis
are supported).
Returns:
kCopSuccessful
0
The function executed successfully.
Description:
This function processes the internals of the CiA 402 state-machine. It
will process the control words, set the states accordingly and reference
the registered call-back functions. The application must make sure to
call this function cyclically. A old-state – new-state comparison is
used to detect changes in the control word.
Which events may cause the state-machine to switch?
1. Control word change, pre-condition that the axis is in state
“Remote-Mode” (it can be controlled via CANopen)
8
© SYS TEC electronic GmbH 2008
L-1096e_1
TAPI Description
2. Events coming from the drive,
i.e. this requires a function to directly switch the state-machine
(see Function Ccm402SetState), .e.g. the drive is operated
without CANopen running (Remote-Mode deactivated).
There are functions (e.g. CDRVDLLEXPORT BOOL PUBLIC
Ccm402OperationEnableAllowed() that are referenced by the
state-machine whenever a state switch via CANopen occurs.
Pre-condition, “Remote-Mode” is active and the control word
has changed. This allows the application to bock or delay the
switch if the internal state of the axis.
The old control word may be overwritten only after the state-machine
has completed the state switch with its attached actions, i.e. the drive
permits the change to “Operation enable” for example
The status word is sent via PDO directly. The application must be
aware that there might be a time delay between the reception of the
control word and the corresponding actions/reactions.
L-1096e_1
© SYS TEC electronic GmbH 2008
9
CiA 402 Add-on
3.2.5 Function Ccm402OperationModeChanged
Syntax:
#include <ccm402.h>
COPDLLEXPORT tCopKernel PUBLIC
Ccm402OperationModeChanged (
CCM_DECL_INSTANCE_HDL
tObdInteger8 bNewOperationMode_p
CCM402_DECL_AXIS_)
Parameters:
CCM_DECL_INSTANCE_HDL:
Instance handle
bNewOperationMode_p:
New operation mode received
by CANopen
CCM402_DECL_AXIS_:
Number of axis (if multiple axis
are supported).
Returns:
kCopSuccessful
0
The function executed successfully.
Description:
This function indicates if the Operation Mode has changed. This
enables the application to react accordingly, e.g. to change a T/RPDO
(see also Section 4)
10
© SYS TEC electronic GmbH 2008
L-1096e_1
TAPI Description
3.3 SDO Callback Functions
SDO callback functions are called whenever a SDO read or write
access to one of the following objects occurs (see also [3])
0x6040 Control Word
0x6060 Operation Mode
These objects also need to exist in file objdict.h (e.g. using the
ODBuilder). The callback functions are implemented in file
Ccm402Tp.c and the user need to modify them according to
application requirements.
3.3.1 Function Ccm402CbSetControlword
Syntax:
#include <ccm402.h>
COPDLLEXPORT tCopKernel PUBLIC
Ccm402CbSetControlword (
CCM_DECL_INSTANCE_HDL_
tObdCbParam MEM* pParam_p)
Parameters:
CCM_DECL_INSTANCE_HDL_:
pParam_p:
Instance handle
Pointer to SDO parameter
structure, see also [3]
Returns:
kCopSuccessful
0
The function executed successfully.
Description:
Callback function for object 0x6040. Within this function, for
example, the application could implement that the control word is
modified only if the drive is in operation mode “Remote-Node” , i.e.
the drive is controlled via CANopen.
L-1096e_1
© SYS TEC electronic GmbH 2008
11
CiA 402 Add-on
3.3.2 Function Ccm402CbSetOperationMode
Syntax:
#include <ccm402.h>
COPDLLEXPORT tCopKernel PUBLIC
Ccm402CbSetOperationMode(
CCM_DECL_INSTANCE_HDL_
tObdCbParam MEM* pParam_p)
Parameters:
CCM_DECL_INSTANCE_HDL_:
pParam_p:
Instance handle
Pointer to SDO parameter
structure, see also [3]
Returns:
kCopSuccessful
0
The function executed successfully.
Description:
Callback function for object 0x6060. The user needs to populate this
function according to application requirements.
3.4 PDO Callback Functions
PDO callback functions are called whenever a object was written via
RPDO service (see also [3]).
The following objects feature a callback function for PDO access:
0x6040 Control word
0x6060 Operation mode
These callback functions need to be defined in the application (also
refer to file ex_slv402.c). The user needs to adapt the callback
functions according to application requirements.
12
© SYS TEC electronic GmbH 2008
L-1096e_1
TAPI Description
3.4.1 Function AppCbVarControlword
Syntax:
#include <ccm402.h>
tCopKernel PUBLIC
AppCbVarControlword (
void GENERIC * pArg_p)
Parameters:
pArg_p:
Pointer to argument of a
callback function, see also [3]
Returns:
kCopSuccessful
0
The function executed successfully,
to be set by the application, see
also [3]
Description:
Callback function for object 0x6040. The control word is accepted or
rejected depending on the operation mode. The user may modify the
function according to application requirements.
3.4.2 Function AppCbVarOperationMode
Syntax:
#include <ccm402.h>
tCopKernel PUBLIC
AppCbVarOperationMode(
void GENERIC * pArg_p)
Parameters:
pArg_p:
Pointer to argument of a
callback function, see also [3]
Returns:
kCopSuccessful
0
The function executed successfully,
to be set by the application, see
also [3]
Description:
Callback function for object 0x6060. Upon reception of the
corresponding variables the operaion mode is switched respectively
and the function Ccm402OperationModeChanged() is referenced.
L-1096e_1
© SYS TEC electronic GmbH 2008
13
CiA 402 Add-on
3.5 Callback functions of the CiA 402 state machine
The CiA 402 state machine references two kind of callback functions.
• Single-event referenced callback functions
• Cyclically referenced callback functions
3.5.1 Single-event referenced callback functions callded prior
state change
Theses callback functions are referenced before executing a state
change that was initiated via CANopen. The application can prevent
or delay this state change by setting the return value to FALSE. Te
functions are implemented in file Ccm402Tp.c. The user may
modify the functions according to application requirements. The
following sections describe the available functions.
3.5.1.1 Function Ccm402SwitchOnDisabledAllowed
Syntax:
#include <ccm402.h>
CDRVDLLEXPORT BOOL PUBLIC
Ccm402SwitchOnDisabledAllowed(
Parameters:
CCM_DECL_INSTANCE_HDL:
CCM_DECL_INSTANCE_HDL
COMMA
CCM402_DECL_AXIS)
Instance handle
COMMA:
Macro used to control multiple
axes and instances.
CCM402_DECL_AXIS:
Number of axis (if multiple axis
are supported).
Returns:
TRUE
FALSE
14
Application
allows
SWITCH_ON_DISABLED
Application
does
not
SWITCH_ON_DISABLED
state
allow
change
state
© SYS TEC electronic GmbH 2008
change
L-1096e_1
to
to
TAPI Description
Description:
This callback function is called after a state change to state
SWITCH_ON_DISABLED (Tansition 7, 9, 10, 12 or 15) was
requested by CANopen. The application may reject or delay this state
change by setting the return value to FALSE.
3.5.1.2 Function Ccm402ReadyToSwitchOnAllowed
Syntax:
#include <ccm402.h>
CDRVDLLEXPORT BOOL PUBLIC
Ccm402ReadyToSwitchOnAllowed(
Parameters:
CCM_DECL_INSTANCE_HDL:
CCM_DECL_INSTANCE_HDL
COMMA
CCM402_DECL_AXIS)
Instance handle
COMMA:
Macro used to control multiple
axes and instances.
CCM402_DECL_AXIS:
Number of axis (if multiple axis
are supported).
Returns:
TRUE
FALSE
Application
allows
READY_TO_SWITCH_ON
Application
does
not
READY_TO_SWITCH_ON
state
allow
change
state
to
change
Description:
This callback function is called after a state change to state
READY_TO_SWITCH_ON (Tansition 2, 6 or 8) was requested via
CANopen. The application may reject or delay this state change by
setting the return value to FALSE.
L-1096e_1
© SYS TEC electronic GmbH 2008
15
to
CiA 402 Add-on
3.5.1.3 Function Ccm402SwitchedOnAllowed
Syntax:
#include <ccm402.h>
CDRVDLLEXPORT BOOL PUBLIC
Ccm402SwitchedOnAllowed (
Parameters:
CCM_DECL_INSTANCE_HDL:
CCM_DECL_INSTANCE_HDL
COMMA
CCM402_DECL_AXIS)
Instance handle
COMMA:
Macro used to control multiple
axes and instances.
CCM402_DECL_AXIS:
Number of axis (if multiple axis
are supported).
Returns:
TRUE
FALSE
Application allows state change to state SWITCHED_ON
Application does not permit state change to SWITCHED_ON
Description:
This callback function is called after a state change request to state
SWITCHED_ON (Tansition 3 or 5) was received via CANopen. The
application may reject or delay this state change by setting the return
value to FALSE.
16
© SYS TEC electronic GmbH 2008
L-1096e_1
TAPI Description
3.5.1.4 Function Ccm402QuickStopAllowed
Syntax:
#include <ccm402.h>
CDRVDLLEXPORT BOOL PUBLIC
Ccm402QuickStopAllowed (
Parameters:
CCM_DECL_INSTANCE_HDL:
CCM_DECL_INSTANCE_HDL
COMMA
CCM402_DECL_AXIS)
Instance handle
COMMA:
Macro used to control multiple
axes and instances.
CCM402_DECL_AXIS:
Number of axis (if multiple axis
are supported).
Returns:
TRUE
FALSE
Application
does
not
QUICK_STOP_ACTIV
Application
does
not
QUICK_STOP_ACTIV
allow
state
change
to
permit
state
change
to
Description:
This callback function is called upon reception of state change request
to state QUICK_STOP_ACTIV (Tansition 11) via CANopen. The
application may reject or delay this state change by setting the return
value to FALSE.
L-1096e_1
© SYS TEC electronic GmbH 2008
17
CiA 402 Add-on
3.5.1.5 Function Ccm402OperationEnableAllowed
Syntax:
#include <ccm402.h>
CDRVDLLEXPORT BOOL PUBLIC
Ccm402OperationEnableAllowed(
Parameters:
CCM_DECL_INSTANCE_HDL:
CCM_DECL_INSTANCE_HDL
COMMA
CCM402_DECL_AXIS)
Instance handle
COMMA:
Macro used to control multiple
axes and instances.
CCM402_DECL_AXIS:
Number of axis (if multiple axis
are supported).
Returns:
TRUE
FALSE
Application allows state change to OPERATION_ENABLE
Application
does
not
permit
state
change
OPERATION_ENABLE
Description:
This callback function is called upon reception of state change request
to state OPERATION_ENABLE (Tansition 4 or 16) via CANopen.
The application may reject or delay this state change by setting the
return value to FALSE.
3.5.2 State-dependent cyclically referenced callback functions
These kind of state-dependent callback functions are referenced with
every execution of function Ccm402Process() and the CiA 402 state
machine is in certain states. This allows the application, for example,
for executing application specific commands depending on the
operation mode. These fuctions are implemented in file
Ccm402Tp.c and can be adapted according to application
requirements.
18
© SYS TEC electronic GmbH 2008
L-1096e_1
TAPI Description
3.5.2.1 Function Ccm402Operation
Syntax:
#include <ccm402.h>
CDRVDLLEXPORT void PUBLIC
Ccm402Operation(
Parameters:
CCM_DECL_INSTANCE_HDL_:
CCM_DECL_INSTANCE_HDL_
WORD Controlword_p,
WORD MEM *pwStatusword_p
CCM402_DECL_AXIS_)
Instance handle
Controlword_p:
CiA 402 control word of the
specified axis
*pwStatusword_p:
Pointer to status word variable
CCM402_DECL_AXIS_:
Number of axis (if multiple axis
are supported).
Returns:
Nothing
Description:
This function is called cyclically in state OPERATION_ENABLE.
Within this function the user-application must perform operationmode specific commands (e.g. start/stop movement). The application
needs to update the status word if necessary (e.g. demand
speed/position reached).
L-1096e_1
© SYS TEC electronic GmbH 2008
19
CiA 402 Add-on
3.5.2.2 Function Ccm402QuickStopOperation
Syntax:
#include <ccm402.h>
CDRVDLLEXPORT void PUBLIC
Ccm402QuickStopOperation(
CCM_DECL_INSTANCE_HDL_
WORD Controlword_p,
WORD MEM *pwStatusword_p
CCM402_DECL_AXIS_)
Parameters:
CCM_DECL_INSTANCE_HDL_:
Instance handle
Controlword_p:
CiA 402 control word of the
specified axis.
*pwStatusword_p:
Pointer to status word variable
of the specified axis.
CCM402_DECL_AXIS_:
Number of axis (if multiple axis
are supported).
Returns:
Nothing
Description:
This function is called cyclically in state QUICK_STOP_ACTIVE.
Within this function the user-application needs to implement the quick
stop functions and update the status word if necessary.
20
© SYS TEC electronic GmbH 2008
L-1096e_1
TAPI Description
3.6 Operation Modes
CiA 402 defines different operation modes for a drive. Remote
CANopen devices and the application may change the operation mode
by writing the new operation mode to object 0x6060. Remote
CANopen devices and the application may request the current
operation mode by reading object 0x6061. The operation modes
available depend on the drive and therefore on the user-application
respectively. The CiA 402 state machine will always use object
0x6060 and 0x6061 for activating/altering the operation mode.
Manufacturer-specific modes are supported.
The following modes are defined:
Value
-1 … -128
0
1
2
3
4
5
6
7
8… 127
Table 1:
Operation Mode
manufacture specific modes of
operation
Reserved
Profile Position Mode (pp)
Velocity Mode (vl)
Profile Velocity Mode (pv)
Torque Profile Mode (tq)
Reserved
Homing Mode (hm)
interpolated Position Mode
Reserved
Operation Modes
What happens if the operation mode was requested to change?
The corresponding callback functions are called (see also Sections 3.3
3.4 and 3.5). Within these callback function the user may define
application-specific actions (e.g. changing PDO configuration).
L-1096e_1
© SYS TEC electronic GmbH 2008
21
CiA 402 Add-on
22
© SYS TEC electronic GmbH 2008
L-1096e_1
Object Dictionary
4 Object Dictionary
4.1
Communication parameters
The following section describes profile-independent part of the
CiA 402 object dictionary definitions (see also [1],[2]). The user may
create additional objects as required by the application (e.g. using the
ODBuilder, [4]).
Index,
Subindex
0x1000
…
0x1400
0x1400,0
0x1400,1
0x1400,2
0x1402
Name
Device Type
Data
type
u32
Acces
type
const
0x00020192
RPDO1, controls the state machine
highest supported sub-index
COB-Id
transmission type
u8
u32
u8
ro
rw
ro
2
0x200 + node-ID
0xFF
0x1402,0
0x1402,1
u8
u32
ro
rw
0x1402,2
transmission type
u8
ro
0x1403
0x1403,0
0x1403,1
RPDO4, controls the state machine in
“Profile Velocity Mode”
highest supported sub-index
COB-Id
u8
u32
ro
rw
0x1403,2
transmission type
u8
ro
0x1404
RPDO5, controls the state machine in
“Profile Torque Mode”
highest supported sub-index
COB-Id
transmission type
0x1405
O
2
(0x80000400 or
0x400)+node-ID
FFh
O
2
(0x80000500 or
0x500)+node-ID
FFh
O
u8
u32
u8
ro
rw
ro
2
0x80000000
0xFF
0x1405,0
0x1405,1
0x1405,2
RPDO6, controls the state machine in
“Velocity Mode”
highest supported sub-index
COB-Id
transmission type
u8
u32
u8
ro
rw
ro
2
0x80000000
0xFF
0x1600
0x1600,0
0x1600,1
RPDO1 mapping parameter
highest supported sub-index
1st application object
u8
u32
ro
ro
1
0x60400010
0x1602
0x1602,0
0x1602,1
0x1602,2
RPDO3 mapping parameter
highest supported sub-index
1st application object
2nd application object
u8
u32
u32
ro
ro
ro
2
0x60400010
0x607A0020
0x1603
RPDO4 mapping parameter
L-1096e_1
© SYS TEC electronic GmbH 2008
Category
M
M
RPDO3, controls the state machine in
“Profile Position Mode”
highest supported sub-index
COB-Id
0x1404,0
0x1404,1
0x1404,2
Default value
O
M
M || O
M || O
23
CiA 402 Add-on
Index,
Subindex
0x1603,0
0x1603,1
0x1603,2
highest supported sub-index
1st application object
2nd application object
Data
type
u8
u32
u32
Acces
type
ro
ro
ro
2
0x60400010
0x60FF0020
0x1604
0x1604,0
0x1604,1
0x1604,2
RPDO5 mapping parameter
highest supported sub-index
1st application object
2nd application object
u8
u32
u32
ro
ro
ro
2
0x60400010
0x60710010
0x1605
0x1605,0
0x1605,1
0x1605,2
RPDO6 mapping parameter
highest supported sub-index
1st application object
2nd application object
u8
u32
u32
ro
ro
ro
2
0x60400010
0x60420010
0x1800
0x1800,0
0x1800,1
TPDO1, Status of state machine
highest supported sub-index
COB-Id
u8
u32
ro
rw
0x1800,2
0x1800,3
0x1800,5
transmission type
inhibit time
event timer
u8
u16
u16
ro
ro || rw
ro || rw
5
0x40000180 +
node-ID
0xFF
0
0
0x1802
0x1802,0
0x1802,1
TPDO3, Status of state machine in “Profile
Position Mode”
highest supported sub-index
COB-Id
u8
u32
ro
rw
0x1802,2
0x1802,3
0x1802,5
transmission type
inhibit time
event timer
u8
u16
u16
ro || rw
ro || rw
ro || rw
0x1803
0x1803,0
0x1803,1
TPDO4, Status of state machine in “Profile
Velocity Mode”
highest supported sub-index
COB-Id
u8
u32
ro
rw
0x1803,2
0x1803,3
0x1803,5
transmission type
inhibit time
event timer
u8
u16
u16
ro || rw
ro || rw
ro || rw
0x1804
TPDO5, Status of state machine in „Profile
Torque Mode”
highest supported sub-index
COB-Id
transmission type
inhibit time
event timer
0x1804,0
0x1804,1
0x1804,2
0x1804,3
0x1804,5
0x1805
0x1805,0
0x1805,1
0x1805,2
0x1805,3
24
Name
Default value
Category
M || O
M || O
M
TPDO6, Status of state machine in „Velocity
Mode”
highest supported sub-index
COB-Id
transmission type
inhibit time
O
5
(0x40000380 or
0xC0000380)
+ node-ID
1
0
0
O
5
(0x40000480 or
0xC0000480)
+ node-ID
1
0
0
O
u8
u32
u8
u16
u16
ro
rw
ro || rw
ro || rw
ro || rw
5
0xC0000000
1
0
0
O
u8
u32
u8
u16
ro
rw
ro || rw
ro || rw
5
0xC0000000
1
0
© SYS TEC electronic GmbH 2008
L-1096e_1
Object Dictionary
Index,
Subindex
0x1805,5
event timer
Data
type
u16
Acces
type
ro || rw
0
0x1A00
0x1A00,0
0x1A00,1
TPDO1 mapping parameter
highest supported sub-index
1st application object
u8
u32
ro
ro
1
0x60410010
0x1A02
0x1A02,0
0x1A02,1
0x1A02,2
TPDO3 mapping parameter
highest supported sub-index
1st application object
2nd application object
u8
u32
u32
ro
ro
ro
2
0x60410010
0x60640020
0x1A03
0x1A03,0
0x1A03,1
0x1A03,2
TPDO4 mapping parameter
highest supported sub-index
1st application object
2nd application object
u8
u32
u32
ro
ro
ro
2
0x60410010
0x606C0020
0x1A04
0x1A04,0
0x1A04,1
0x1A04,2
TPDO5 mapping parameter
highest supported sub-index
1st application object
2nd application object
u8
u32
u32
ro
ro
ro
2
0x60410010
0x60770010
0x1A05
0x1A05,0
0x1A05,1
0x1A05,2
TPDO6 mapping parameter
highest supported sub-index
1st application object
2nd application object
u8
u32
u32
ro
ro
ro
2
0x60410010
0x60440010
0x6040
0x6041
0x6060
0x6061
Controlword
Statusword
Operation mode
Operation display
u16
u16
i8
i8
rw
ro
rw
ro
0
0
See Table 1
See Table 1
Table 2:
4.2
Name
Default value
Category
M
M || O
M || O
M || O
M || O
M
M
M
M
CiA 402 specific object dictionary see also [1]
Homing Mode
The following objects are available for “Homing Mode”. The user
may define additional objects as required by the application using the
ODBuilder for example.
Index,
Subindex
0x6098
0x6099
0x6099,0
0x6099,1
0x6099,2
Table 3:
L-1096e_1
Name
Homing methode
Homing speeds
highest supported sub-index
Speed during search for switch
Speed during search for zero
Data
type
i8
Acces
type
rw
Default value
0
u8
u32
u32
ro
rw
rw
2
0
0
Category
M
M
M
M
M
Object dictionary entries for "Homing Mode"
© SYS TEC electronic GmbH 2008
25
CiA 402 Add-on
4.3
Profile Position Mode
The following objects are available for Profile Position Mode. The
user may define additional objects as required by the application using
the ODBuilder for example.
Index,
Subindex
0x6064
0x607A
0x6081
0x6083
0x6084
0x6086
0x6093
0x6094
0x6095
0x6097
Table 4:
4.4
Name
Position actual value, see TPDO3
Target position, see RPDO3
Profile velocity
Profile acceleration
Profile deceleration
Motion profile type
Position factor
Velocity encoder factor
Velocity factor 1
Acceleration factor
Data
type
i32
i32
u32
u32
u32
i16
u32
u32
u32
u32
Acces
type
ro
rw
rw
rw
rw
rw
rw
rw
rw
rw
Default value
Category
M
M
M
M
O
M
M
M
M
M
no
no
no
no
no
0
Object dictionary entries for “Profile Position Mode”
Profile Velocity Mode
The following objects are available for Profile Velocity Mode . The
user may define additional objects as required by the application using
the ODBuilder for example.
Index,
Subindex
0x6069
0x606A
0x606B
0x606C
0x6081
0x6083
0x6084
0x6086
0x60FF
Table 5:
26
Name
Velocity sensor actual value
Sensor selection Code
Velocity demand value,
Velocity actual value, see TPDO4
Profile Velocity
Profile acceleration
Profile deceleration
Motion profile type
Target Velocity, see RPDO4,
Data
type
i32
i16
i32
i32
u32
u32
u32
i16
i32
Acces
type
ro
rw
ro
ro
rw
rw
rw
rw
rw
Default value
0
no
no
no
0
Category
M
O
M
M
M
O
M
M
Object dictionary entries for “Profile Velocity Mode”
© SYS TEC electronic GmbH 2008
L-1096e_1
Object Dictionary
4.5
Profile Torque Mode
The following objects are available for Profile Torque Mode. The user
may define additional objects as required by the application using the
ODBuilder for example.
Index,
Subindex
0x6071
0x6073
0x6077
0x6087
0x6088
Table 6:
L-1096e_1
Name
Target torque, see RPDO5
max current
torque actual value
Torque slope
Torque profile type,
gibt die Art der Rampe an,
0 lineare Rampe (trapezförmig)
1 sin² Rampe
0x8000.. 0xFFFF herstellerspezifisch
Data
type
i16
u16
i16
u32
i16
Acces
type
rw
rw
ro
rw
rw
Default value
0
0
0
Category
M
O
O
M
M
Object dictionary entries for “Profile Torque Mode”
© SYS TEC electronic GmbH 2008
27
CiA 402 Add-on
4.6
Velocity Mode
The following objects are available for Velocity Mode. The user may
define additional objects as required by the application using the
ODBuilder for example.
Index,
Subindex
0x6042
0x6043
0x6044
0x6046
0x6046,0
0x6046,1
0x6046,2
0x6048
0x6048,0
0x6048,1
0x6048,2
0x6049
target velocity “Velocity Mode” (vl), see RPDO6
velocity demand (vl)
control effort (vl), see TPDO6,
Data
type
i16
i16
i16
velocity min max amount
Drehzahlbegrenzung
number of entries
velocity min amount,
velocity max amount
u32
array
u8
u32
u32
velocity acceleration,
Anstieg der Beschleunigungsrampe,
= Delta Speed/Delta Time
number of entries
Delta Speed
Delta Time
record
u8
u32
u16
velocity deceleration
Bremsrampe,
= Delta Speed/Delta Time
number of entries
Delta Speed
Delta Time
0x6049,0
0x6049,1
0x6049,2
Table 7:
4.7
Name
Acces
type
rw
ro
ro
Default
value
M
ro
ro
rw
2
0
no
M
M
M
M
ro
ro
rw
2
1000
no
record
u8
u32
u16
Category
M
M
M
M
M
M
M
ro
ro
rw
2
1000
no
M
M
M
Object dictionary entries for “Velocity Mode”
Interpolated Position Mode
There are no specific objects for this mode as they are applicationspecific and there are nor mandatory objects defined in CiA 402.
However, the user may define additional objects if required by the
application, using the ODBuilder for example.
28
© SYS TEC electronic GmbH 2008
L-1096e_1
Object Dictionary
4.8
Manufacturer-specific Objects, Example application
Index,
Subindex
0x5FFF
Name
Activate “Remote Mode” and simulates errors
Data
type
u8
Acces
type
rw
Default
value
0
Category
O
The above described object 0x5FFF is an application-specific object
(ex_slv402.c) used for simulating various error conditions of a
drive. It is also used to activate the Remote Mode (see also [1]).
This object is not part of CiA 402. It is for testing purpose only and
should be removed in final applications.
This object enables to simulate events remotely via SDO access if no
real application is present and therefore allows to trigger state machine
transmissions. Of course, these events later need to be
set/implemented by the application.
The following events are defined in file (ex_slv402.c) and are
available via SDO:
typedef enum
{
kFaultReaction_Activ
= 1,
kFaultReaction_Completed = 2,
kChange_Remote
= 4
}
tAppDriveFault;
kFaultReaction_Activ:
simulates an error that causes the state machine to transit to state
„Fault Reaction Active“ (Tansition 13 in Figure 1).
kFaultReaction_Completed:
simulates the error reaction within a drive and causes the state
machine to transit to state „Fault“ (Tansition 14 in Figure 1).
kChange_Remote:
simulates the state transition to state „Remote Mode“. Every time this
value is written to Object 0x5FFF the “Remote Mode” toggles
(ON/OFF).
L-1096e_1
© SYS TEC electronic GmbH 2008
29
CiA 402 Add-on
Note: After power-on and reset the Remote Mode is set to OFF and
the application cannot be controlled using the control word. If this is
required the Remote Mode must be enabled first.
30
© SYS TEC electronic GmbH 2008
L-1096e_1
Abbreviations
5 Abbreviations
hm
i8
i16
i32
M
O
pp
pv
rw
ro
tq
u8
u16
u32
vl
Homing Mode
CANopen data type INTEGER8
CANopen data type INTEGER16
CANopen data type INTEGER32
mandatory
optional
Profile Position Mode
Profile Velocity Mode
read write
read only
Profile Torque Mode
CANopen data type UNSIGNED8
CANopen data type UNSIGNED16
CANopen data type UNSIGNED32
Velocity Mode
L-1096e_1
© SYS TEC electronic GmbH 2008
31
CiA 402 Add-on
32
© SYS TEC electronic GmbH 2008
L-1096e_1
References
6 References
[1] CANopen Device Profile Drives and Motion Control, CiA 402,
Version 2.0 26.July 2002, CAN in Automation e.V.
[2] CANopen Device Profile Drives and Motion Control, Errata 1,
CiA 402, Version 0.9, February 2005, CAN in Automation e.V.
[3] CANopen User Manual, Software Manual, SYS TEC electronic
GmbH, Greiz, Doku-Nr.: L-1020
[4] CANopen Application Layer and Communication Profile, CiA
DSP301, Version 4.1 21.February 2006, CAN in Automation
e.V.
L-1096e_1
© SYS TEC electronic GmbH 2008
33
CiA 402 Add-on
34
© SYS TEC electronic GmbH 2008
L-1096e_1
Index
Index
Ccm402.h................................ 3, 4
CCM402_MAX_AXIS............... 4
Ccm402St.c................................. 3
Ccm402Tp.c................................ 3
control word................................ 8
Control word ................. 11, 12, 30
ex_slv402.c ........................... 3, 29
Fault .......................................... 29
Fault Reaction Active ............... 29
Homing Mode ........................... 25
Object Dictionary
Communication parameters ... 23
Operation mode................... 11, 21
Operation Mode ........................ 12
L-1096e_1
© SYS TEC electronic GmbH 2008
OPERATION_ENABLE ....18, 19
Profile Position Mode ...............26
Profile Torque Mode................. 27
Profile Velocity Mode............... 26
QUICK_STOP_ACTIVE ......... 20
READY_TO_SWITCH_ON .... 15
Remote mode ............................ 29
Remote Mode............................ 29
Remote- Mode ...................... 9, 11
State-machine.............................. 2
SWITCH_ON_DISABLED......15
SWITCHED_ON ...................... 16
Velocity Mode .......................... 28
35
CiA 402 Add-on
© SYS TEC electronic GmbH 2008
L-1096e_1
Suggestions for Improvement
Document:
Document number:
CiA 402 Add-on
L-1096e_1, Edition August 2008
How would you improve this manual?
Did you find any mistakes in this manual?
Submitted by:
Customer number:
Name:
Company:
Address:
Return to:
L-1096e_1
SYS TEC electronic GmbH
August-Bebel-Str. 29
D-07973 Greiz
GERMANY
Fax : +49 (0) 36 61 / 62 79 99
© SYS TEC electronic GmbH 2008
page
Published by
© SYS TEC electronic GmbH 2008
Ordering No. L-1096e_1
Printed in Germany