Rexroth NYCe4000
Multi-axis motion control system
Software User Manual
2009-09
2/158
Bosch Rexroth AG
NYCe4000 Software User Manual
Title
Type of documentation
Document Typecode
Internal File Reference
Purpose of Documentation
Record of revisions
Rexroth NYCe4000 Software User Manual
User Manual
89.1.3
This document describes the software included in the Rexroth NYCe4000.
Description
Product release 1.4
List of trademarks
Release date
Notes
04.2007
First issue
Product release 2.0
10.2007
Second issue
Product release 2.1
10.2008
Product release 2.2
02.2009
IndraDrive support
Product release 2.2.1
09.2009
Camming, IndraDrive motors without
encoder flash memory, NY4111
FireWire is a registered trademark of Apple® Computer Inc.
Microsoft®, Windows XP® are either registered trademarks or trademarks of
Microsoft ® Corporation in the United States and/or other countries.
Products in this publication are referred to by their general trade names. In most,
if not all cases, these designations are claimed as trademarks or registered
trademarks of their respective companies.
Copyright
© Bosch Rexroth AG 2007
Copying this document, giving it to others and the use or communication of the
contents thereof without express authority, are forbidden. Offenders are liable for
the payment of damages. All rights are reserved in the event of the grant of a
patent or the registration of a utility model or design (DIN 34-1).
Validity
Published by
The specified data is for product description purposes only and may not be
deemed to be guaranteed unless expressly confirmed in the contract. All rights
are reserved with respect to the content of this documentation and the availability
of the product.
Bosch Rexroth AG
Luchthavenweg 20 ● 5657 EB Eindhoven ● The Netherlands
Telephone +31 (0)40 2578888 ● Fax +31 (0)40 2578800
http://www.boschrexroth.com/nyce
NYCe4000 Software User Manual
Bosch Rexroth AG
3/158
Contents
1
2
3
4
5
6
7
Introduction.................................................................................................... 7
1.1
General remark on XML formatted files.............................................. 7
1.2
Used abbreviations in this manual ..................................................... 7
Software Architecture and General Mechanisms............................................ 9
2.1
Software Architecture ......................................................................... 9
2.2
Configuration and Initialization ......................................................... 11
2.3
Process Diagnostics and Analysis ................................................... 12
2.4
Asynchronous Event Handling ......................................................... 12
2.5
Limitations ........................................................................................ 13
NYCE subsystem ........................................................................................ 15
3.1
General ............................................................................................ 15
3.2
Initialize and Terminate .................................................................... 15
3.3
Variable Set...................................................................................... 15
3.4
Variable Trace.................................................................................. 16
3.5
Miscellaneous .................................................................................. 21
3.6
Status and error codes ..................................................................... 22
Diagnostics and Error Handling (DEH)......................................................... 24
4.1
General ............................................................................................ 24
4.2
Generate logging information ........................................................... 24
4.3
Retrieve logging information............................................................. 25
4.4
Miscellaneous .................................................................................. 25
4.5
Example of using DEH ..................................................................... 25
4.6
Status and error codes ..................................................................... 26
Download (DWN)......................................................................................... 27
5.1
General ............................................................................................ 27
5.2
Firmware / Gateware........................................................................ 27
5.3
Miscellaneous .................................................................................. 28
5.4
Status and error codes ..................................................................... 28
System (SYS) .............................................................................................. 29
6.1
General ............................................................................................ 29
6.2
Events .............................................................................................. 29
6.3
Configuration.................................................................................... 30
6.4
Miscellaneous .................................................................................. 32
6.5
Status and error codes ..................................................................... 32
Node Hardware Interface (NHI) ................................................................... 33
7.1
General ............................................................................................ 33
7.2
Conversion ....................................................................................... 33
7.3
Basic node handling ......................................................................... 33
7.4
Parameters....................................................................................... 34
7.5
Variables .......................................................................................... 35
7.6
Variable latch set.............................................................................. 35
7.7
Events .............................................................................................. 36
7.8
Configuration.................................................................................... 38
4/158
Bosch Rexroth AG
NYCe4000 Software User Manual
8
9
7.9
Digital I/O ..........................................................................................39
7.10
Analog I/O.........................................................................................40
7.11
Latches .............................................................................................41
7.12
Counters ...........................................................................................41
7.13
Electronic camming...........................................................................42
7.14
Hardware Properties .........................................................................44
7.15
Miscellaneous ...................................................................................45
7.16
Status and error codes......................................................................45
Single Axis Control (SAC) and Multi Axes Control (MAC) ............................. 48
8.1
General .............................................................................................48
8.2
Conversion........................................................................................49
8.3
Basic axis control handling ...............................................................49
8.4
Parameters .......................................................................................50
8.5
Variables...........................................................................................53
8.6
Variable latch set ..............................................................................53
8.7
Events and Actions ...........................................................................54
8.8
Configuration ....................................................................................60
8.9
State Transitions ...............................................................................62
8.10
Function I/O ......................................................................................70
8.11
Error and Safety Handling.................................................................72
8.12
Motion ...............................................................................................84
8.13
Electronic Camming and Gearing .....................................................97
8.14
Synchronize Groups .......................................................................102
8.15
Spline..............................................................................................104
8.16
Position Force Control ....................................................................106
8.17
Modulo Axis ....................................................................................107
8.18
Test signal generator ......................................................................109
8.19
Output Triggers ...............................................................................112
8.20
Latches ...........................................................................................112
8.21
Markers...........................................................................................113
8.22
Monitor............................................................................................115
8.23
Autotweak .......................................................................................115
8.24
Sensor Linearization .......................................................................117
8.25
Miscellaneous .................................................................................119
8.26
Status and error codes....................................................................119
Single Axis Control Drivelink (SACDL) ....................................................... 124
9.1
General ...........................................................................................124
9.2
Parameters .....................................................................................124
9.3
Digital I/O ........................................................................................125
9.4
Analog I/O.......................................................................................127
9.5
Position Switch................................................................................127
10 .Net............................................................................................................ 128
10.1
Top-level classes ............................................................................128
10.2
Events.............................................................................................132
10.3
Variable Set and Tracing ................................................................132
10.4
Exceptions and error handling ........................................................135
10.5
Logging ...........................................................................................135
10.6
Code example using the .Net wrapper............................................137
NYCe4000 Software User Manual
Bosch Rexroth AG
5/158
11 Error codes of internal subsystems ............................................................ 139
11.1
CML subsystem error codes .......................................................... 140
11.2
CTR subsystem error codes........................................................... 145
11.3
ECG subsystem error codes .......................................................... 146
11.4
EDH subsystem error codes .......................................................... 147
11.5
EVH subsystem error codes........................................................... 148
11.6
GEN subsystem error codes .......................................................... 148
11.7
HNI subsystem error codes............................................................ 149
11.8
NCS subsystem error codes .......................................................... 150
11.9
NLM subsystem error codes .......................................................... 151
11.10
NNI subsystem error codes ....................................................... 151
11.11
OSAL subsystem error codes.................................................... 152
11.12
PDS subsystem error codes...................................................... 153
11.13
PPI subsystem error codes ....................................................... 154
11.14
SPG subsystem error codes...................................................... 154
11.15
STD subsystem error codes ...................................................... 155
11.16
TSK subsystem error codes ...................................................... 155
11.17
UTILS subsystem error codes ................................................... 156
6/158
Bosch Rexroth AG
NYCe4000 Software User Manual
NYCe4000 Software User Manual
Bosch Rexroth AG
7/158
Introduction
1 Introduction
The NYCe4000 Software Release is the NYCe4000 motion system software
package, consisting of:
software running on a host computer with the Windows XP® Professional
operating system,
software (called firmware) running on the NYCe4000 Motion Control Unit, and
drive gateware executed within the drive hardware.
The NYCe4000 software that runs on the Personal Computer (PC) gives the user
a standardized software interface between the application of the user that also
runs on the PC and the Digital Signal Processor (DSP) based NYCe4000 Motion
Control Units (MCU). This open standard is based on the Open Motion Control
(OMC) architecture and is implemented via several subsystems.
The standardized software interface gives the user a documented software
interface between the application and the motion control functionality. In this way
a motion application can be built on top of this documented interface layer,
maintaining compatibility with future enhancements.
Attention:
You must have “administrator” rights on the PC running a NYCe4000 application.
If you are logged on with insufficient rights, the error NCS_ERR_SYSTEM_ERROR
appears.
1.1
General remark on XML formatted files
The NYCe4000 tools and software API functions can read and write XML
formatted files on the host. You can also modify these XML (configuration) files
with a suitable (XML) editor. If you do not use the NYCe4000 tools, but use an
external editor to modify an XML formatted file, make sure that the file is saved
ANSI encoded. If the file is saved with a byte order mask (for example a UTF-8
byte order mask), the NYCe4000 tools and API functions report the error
SAC_ERR_OPEN_FILE_ERROR when such a file is opened.
1.2
Used abbreviations in this manual
The following table gives a summary of abbreviations used in this manual, see
also Table 2 “Host subsystems”.
8/158
Bosch Rexroth AG
NYCe4000 Software User Manual
Introduction
Table 1 Summary of used abbreviations
Abbreviation
Description
API
Application Programming Interface
CRC
Cyclic Redundancy Check
EEPROM
Electrical Erasable Read Only Memory
IEEE
Institute of Electrical and Electronics Engineers
MCU
Motion Control Unit
NY4110
MCU module with 3 FireWire interfaces
NY4111
MCU module with FireWire and Cat-5 interfaces
NY4120
PWM Drive Module
NY4130
DC Drive Module
NY4140
High Voltage Drive Module
NY4150
SERCOSIII Master Module
NY4170
High Voltage Piezo Drive Module
pu
Position unit (user-defined dimension of position)
SERCOSIII
Third generation SERCOS (Serial Real time Communication
System ) drive communication protocol based on the Ethernet
physical hardware architecture
UDSX
User Defined Sample Extension
NYCe4000 Software User Manual
Bosch Rexroth AG
9/158
Software Architecture and General Mechanisms
2 Software Architecture and General
Mechanisms
This chapter explains the NYCe4000 software architecture and the general
software mechanisms used throughout the NYCe4000 subsystems.
2.1
Software Architecture
The foundation of the NYCe4000 software is a strict software architecture. The
architecture consists of the following components.
software on a PC,
software on the motion controller,
software in the drive module, and
electronic hardware.
The software in the PC is simply called software or host software. The software
on the motion controller is called firmware and the software in the programmable
hardware components of the drive module is called gateware.
The host software consists of a number of subsystems. Each of these
subsystems has a certain scope. Fig. 1 shows the software subsystems in the
NYCe4000 software stack that runs on the host computer.
Fig. 1
NYCe4000 Host Software Stack
The host subsystems are listed in Table 2. The first part of the table lists the
subsystems described in this manual.
The subsystems in italic font do not have an application programming interface
(API). For this reason these subsystems are not explained in this software
manual. However, these subsystems are mentioned, because the return value of
an API function contains information from the subsystem that detected a warning
or error. For example, when an error occurs in the communication over the IEEE
1394 connection, the driver will generate an error with prefix HNI_ERR_.
10/158
Bosch Rexroth AG
NYCe4000 Software User Manual
Software Architecture and General Mechanisms
Table 2 Host subsystems
Subsystem
Description
NYCE
NYCe4000 subsystem
DEH
Diagnostics and Error Handling subsystem
DWN
Download subsystem
SYS
System subsystem
NHI
Node Hardware Interface subsystem
SAC
Single Axis Control subsystem
also containing the Multi Axis Control (MAC) subsystem and the
SACDL (SAC Drivelink) subsystem
SEQ
Sequencer subsystem (discussed in a separate manual)
SIM
Simulation subsystem (discussed in a separate manual)
CML
Configuration Mapping Layer
CTR
Control subsystem
ECG
Electronic Camming and Gearing subsystem
EDH
Error Detection and Handling subsystem
EVH
Event Handling subsystem
GEN
General subsystem
HNI
Host Network Interface subsystem
NCS
NYCe communication Services subsystem
NLM
Node Local Mechanism subsystem
NNI
Node Network Interface subsystem
OSAL
Operating System Abstraction Layer subsystem
PDS
Performance Diagnosis and Status subsystem
PPI
Peripheral Program Interface subsystem
SPG
Setpoint Generator subsystem
STD
State Transition Diagram subsystem
TSK
Task handler subsystem
UDC
User Definable Control subsystem
UTILS
Utility functions subsystem (for example XML file handling)
Most subsystems listed in the second part of the table (in italic font) have intuitive
names. An exception is the Configuration Mapping Layer, the top layer of the HAL
(Hardware Abstraction Layer). Among other things, CML translates an axis
number to a physical slot / unit. Many actions occur in the CML during the
initialization phase of the NYCe4000 node.
The system from a user point of view can be represented as shown in Fig. 2.
NYCe4000 Software User Manual
Bosch Rexroth AG
11/158
Software Architecture and General Mechanisms
System
Node 1
Axis
1
Fig. 2
Axis
2
SYS
Node 2
Axis
3
Axis
4
NHI
Axis
5
Axis
6
SAC
NYCe4000 System setup
The top layer is the system which controls a machine or robot. The system has
properties which can be accessed through the SYS layer and contains nodes
which form the middle layer. A node has properties and I/O which can be
accessed through the NHI layer and has axes which form the bottom layer. An
axis has properties and these can be accessed through the SAC layer.
A simulation environment that uses the SIM subsystem allows the simulation of a
NYCe4000 motion system on the PC. The SIM subsystem provides functionality
to set up a simulated network with a number of nodes. Once the simulated
system is appropriately defined and configured, an application on the host API
can run without the need of attaching NYCe4000 nodes with motors, mechanical
modules etc. to the PC. Using the simulation the user application can be tested
without:
mechanical modules available,
consuming valuable time on sparse mechanical modules or
damaging the machine when an application error occurs.
2.2
Configuration and Initialization
A NYCe4000 system is a highly flexible and configurable system. To maintain all
possible settings, each subsystem administrates its own set of parameters. These
parameters can be accesses by the functions calls XxxReadParameter and
XxxWriteParameter of the accompanying subsystems (for example
NhiReadParameter). These parameters all start with the three characters of the
subsystem followed by _PAR_ and a descriptive name of the parameter for
example NHI_PAR_NODE_SAMPLE_TIME. It is possible to upload the current
parameter settings of nodes and axes into a file by calling the functions
XxxUpload of the accompanying subsystem. These files are set up in an XML
standard. XxxSaveToFlash provides functionality to store the settings within the
flash memory of the appropriate node.
Flash memory is non-volatile, which means that it does not need power to
maintain the information stored in the memory. Therefore, settings and
configurations of a node and axes can be stored in the flash memory on the node
itself. Accessing the flash memory during time critical operations should be
avoided, because the accesses to the flash memory stalls the execution of the
firmware, which means that the real-time operations are not executed at each
sample interval during accessing the flash memory.
At start-up of a system it is possible to initialize nodes and axes using the
XxxInitialize function. Within this function call you can initialize from file or
from flash. To initialize from flash the macro USE_FLASH should be used as
second argument of the function XxxInitialize.
12/158
Bosch Rexroth AG
NYCe4000 Software User Manual
Software Architecture and General Mechanisms
Configuring a system can easily be done using the NYCe Tools.
The NYCeConfigurator has an intuitive graphical user interface that provides all
possible settings. The parameters available within the NYCe4000 system are
discussed throughout this manual.
2.3
Process Diagnostics and Analysis
Real-time process information can be retrieved from the NYCe4000 system
through the subsystems variables. Subsystem variables are among others, IO
states, controller output, axis position etc. These variables can be read by the
functions call XxxReadVariable of the accompanying subsystems. The variable
names all start with the three characters of the subsystem followed by _VAR_ or
_ASV_ and a descriptive name of the variable. Examples are
NHI_VAR_SAMPLE_DURATION and SAC_ASV_CTR_OUTPUT_FOR_TWEAK (ASV stands
for asynchronous variable).
A variable can be read any time separately, or in a user defined set of variables
called a variable set. It is even possible to trace a set of variables in time. Tracing
allows for a continuous real-time stream of information from the process. The
variable set and trace set functionalities are explained in chapters 3.3 and 3.4.
2.4
Asynchronous Event Handling
The NYCe4000 software supports a strongly event driven usage. This means that
it can react on events or triggers that can occur at unpredictable moments in time.
Each subsystem has a set of events. The names of the events are defined by
starting with the three characters of the subsystem followed by _EV_ and a
descriptive name of the event, for example SAC_EV_HOMING_COMPLETED. The axis
events, with prefix SAC_EV_, can also be handled real-time on the node to:
start or stop a motion, or
toggle digital outputs.
How to use these functionalities is explained in chapter 8.
A client application that runs on the host can subscribe to the occurrence of an
event by calling the function XxxDefineEventEnrolment of the appropriate
subsystem. When the event occurs, the user specified event handler is executed
asynchronously. The maximum number of events that a client application can
subscribe to is currently limited to 256 per node per process. A brief example is
shown in the following code section.
NYCe4000 Software User Manual
Bosch Rexroth AG
13/158
Software Architecture and General Mechanisms
:
int main()
{
:
:
// Do Event Enrolment for SAC Updates
retVal = SacDefineEventEnrolment( AxisId,
SAC_EV_HOMING_COMPLETED,
OnHomedEvent,
NULL );
:
:
}
//---------------------------------------------------------------// NYCe System SAC Event Handler
//---------------------------------------------------------------void OnHomedEvent( NYCE_ID
nyceId,
NYCE_EVENT
eventId,
NYCE_EVENT_DATA *pEventData,
void
*pUserData )
{
:
:
// nyceId:
contains the axis or node ID
// eventId:
contains the event ID
// pEventData: contains the event data provided by the system
// pUserData: contains the userData provided on the define of
//
the event enrolment
:
:
}
:
In this example the function OnHomedEvent is executed in a separate thread each
time the event SAC_EV_HOMING_COMPLETED is received at the host PC. The thread
responsible for executing the event handlers has a queue for the received events.
However, the thread can only execute one event handler at a time. Therefore, it is
the responsibility of the programmer to make sure that the execution of event
handlers is performed faster than the application is receiving events. Otherwise it
is possible that an application loses events when the queue overflows, which can
occur if the application receives more events than it processes up to the time that
the queue of received events is full.
The events available within the NYCe4000 system are discussed throughout this
manual.
2.5
Limitations
You can see all real NYCe4000 environments when the NYCeNetMonitor tool is
started. In real networks you can manipulate an axis in the NYCe4000
environment of another user. This behavior is not supported in real networks.
Pulses from encoders are counted in 32 bit counters. These counters can
overflow, because of the increased resolution of new developed encoders. For
example, when the application uses a 20 bit encoder, the counter will overflow
after 2(32-20) = 212 = 4096 revolutions. SinCos-based encoders generate the pulse
count resolution per quadrant. For SinCos-based encoders you must divide the
number of revolutions by 4 to find the revolution count when the software counter
will overflow. The 32 bit limitation in the software implies that the supported
maximum resolution of the encoder is 30 bits, for a single trajectory calculated by
the setpoint generator. The overflow event is reported with the error code
SAC_AX_ERR_SETPOINT_OVERFLOW, see 8.11 Error and Safety Handling. Note that
an overflow condition on a slave axis (gearing) does not generate an error.
If a NYCe4000 motion solution exists of more than one node, a host must be part
of the IEEE 1394b network otherwise the nodes will not run synchronized. When
the host is removed from the network, the nodes run asynchronous. A test with 2
nodes, both running at 2 kHz, showed that after 107 seconds the sample of one
node overtook the sample of the other node. 2 kHz represents a sample period of
500 µs. This means that the clock difference was approximately 0.0047 ‰.
The asynchronous behaviour of a multi-node network is important to consider if
the motion application uses for example electronic gearing or synchronized
groups. Also, due to the not real-time behaviour of Windows, it is possible that a
14/158
Bosch Rexroth AG
NYCe4000 Software User Manual
Software Architecture and General Mechanisms
NYCe4000 command / response sequence occasionally takes more time to
complete.
Data in NYCe4000 XML files can have decimal values. Make sure that the
fraction of decimal values are separated by a decimal point (“.”), not by a comma
(“,”). If a comma is used for the decimal fraction no error or warning is returned,
and all information following the comma is ignored. This behaviour does not
depend on the regional settings on the PC. Parameter XML files are generated by
NYCe4000 tools (for example NYCeConfigurator and NYCeTuner), so in this
case the observation is not relevant. However, user generated XML files (for
example cam tables) must use a decimal point to separate the decimal fraction
from the integer value.
NYCe4000 Software User Manual
Bosch Rexroth AG
15/158
NYCE subsystem
3 NYCE subsystem
The main goal of the NYCE subsystem is to provide the user with common
definitions and functionality which exceeds the context of single subsystems. The
definitions are among others, all return values, parameters, variables and events.
3.1
General
The NYCE subsystem is a coordinating layer for the other NYCe4000
subsystems. It provides functions to initialize and terminate NYCe4000 software
libraries required for all NYCe4000 applications and functions to handle variable
sets and variable traces. These and all other NYCE functions are explained in
subsequent chapters.
3.2
Initialize and Terminate
This module contains the functions:
NyceInit
NyceTerm
NyceGetNetworkType
Any application that uses NYCe4000 API functions should first call the NYCE
initialization function to initialize the NYCe4000 host software and claim required
resources. The NYCe4000 can be started in real network mode or in simulation
mode. This is indicated by the argument of this function, which is of the
enumeration type NYCE_NETWORK_TYPE. Depending on the value of this input
either the NCS or the SIM dynamic link library (dll) is loaded. NyceInit also
performs a check on the consistency of the software versions used.
The last NYCe4000 function called in a NYCe4000 application should be the
termination function. This function cleans up the administration on the host PC
and releases the claimed resources. Calling the functions NyceInit and
NyceTerm will not change the state of the nodes and axes in a system.
The function NyceGetNetworkType returns the initialized mode of the NYCE
subsystem. The return value can be NYCE_NET or NYCE_SIM. If the NYCE
subsystem is not initialized a warning will be issued and the networkType will be
set to the default NYCE_NET.
3.3
Variable Set
This module contains the functions:
NyceReadVariableSetElement
NyceReadVariableSet
The NYCE subsystem contains functionality to access a set of variables from the
other subsystems, which are guaranteed to be logged in the same system
sample. The system sample time is determined by the node in a system with the
largest sample time, which means the node with the lowest sample frequency.
For example, a system consisting of two nodes of which one node runs on a
sample frequency of 2 kHz and the other node runs at 4 kHz has a system
sample time determined by the node running at the sample frequency of 2 kHz.
Therefore the system sample time, in this example, is 0.5 ms. The system sample
time can be retrieved via a function in the SYS library.
16/158
Bosch Rexroth AG
NYCe4000 Software User Manual
NYCE subsystem
The actual content of the variable set is managed by the subsystems that are the
holders of the variables. The SAC and NHI subsystems include the functions
XxxAddVariableToSet and XxxDeleteVariableFromSet to manage the variable
set (where Xxx is Sac or Nhi). For example, one variable set can contain several
variables from the SAC subsystem and from the NHI subsystem over different
nodes and axes in a system. Variable sets functionality is based on variable trace
functionality.
When the entire variable set is read using NyceReadVariableSet, all data in the
set have the same sample time moment, which can never be guaranteed when
consecutive function calls are executed to retrieve a single variable (for example
NhiReadVariable). It is also possible to read a single variable from the set with
NyceReadVariableSetElement. This function returns the node or axis id to which
the variable belongs, the variable id itself and the value of the variable. The node
or axis id mentioned, is contained in the NYCE_ID.
3.4
Variable Trace
This module contains the functions:
NyceDefineTrace
NyceStartTrace
NyceStopTrace
NyceRetrieveTraceBlock
NyceUploadTrace
NyceGetTraceInfo
NyceGetTraceState
NyceGetTraceElement
NyceDeleteTrace
The NYCE subsystem includes functionality for defining and accessing variable
trace buffers. Variable trace buffers contain history of a number of variables. The
actual content of the trace buffer is managed by the subsystems that are the
holder of the variables, like explained in the previous chapter.
Tracing of variables offers a diagnostic functionality which allows several axis and
node variables of a system to be memorized for a certain time span. This is
particularly useful for tuning a system in the time or frequency domain.
Within NYCE it is possible to define properties of the trace buffer. The actual
content of the trace buffer is managed by the other subsystems, which contain
functions to add variables to the trace buffer and delete variables from the trace
buffer (XxxAddVariableToTrace and XxxDeleteVariableFromTrace where ‘Xxx’
stands for the initial letters of a subsystem, see chapter 2.1). The trace
functionality supports synchronous tracing of up to
NYCE_TRACE_MAX_VARS_PER_NODE variables per node with a maximum of 4 nodes.
If a trace contains more than 4 nodes, the functions XxxAddVariableToTrace
return the error HNI_ERR_SYSTEM_ERROR. Traced data is stored and accessible
during trace or at a later moment as long as no new trace is started.
The trace is defined with the function NyceDefineTrace. A trace definition
consists of specifying the number of variables to be traced, the trace update time
and trace window. The trace update time specifies the time between two
successive stores of trace data into the buffer. The granularity of the trace update
time is the sample time of the fastest node in the system. The trace window
specifies the number of samples that can be stored per variable. The total amount
of time for which data can be gathered in the trace buffer amounts to
traceWindow x traceUpdateTime x systemSampleTime.
The trace functionality works in a multi-process environment. The data and info of
a trace defined by one process can be retrieved by another process. However,
there is only one trace. This implies that different processes can be active which
NYCe4000 Software User Manual
Bosch Rexroth AG
17/158
NYCE subsystem
have conflicting behavior, mainly with respect to starting and stopping of the
trace. Therefore, the process, which successfully executes the trace definition,
becomes the owner of the trace. This is the only process, which is allowed to
perform a start, stop or delete of the trace. Ownership is terminated by deletion of
the trace. You can not call NyceDefineTrace a second time without a call of the
function NyceDeleteTrace. After a trace has been defined and you want to
redefine the trace, you must delete the defined trace first. Processes, which are
not owner of the trace can add and delete variables, and retrieve data and info
from the trace. All axes must be connected of which variables are traced.
If two processes both add the same variable, that variable is only once in the
trace data. If one application deletes the trace variable, the variable is still in the
trace data, because a counter keeps track how many times a variable is
requested to be traced.
If the number of added variables is less than the specified number of variables by
the function NyceDefineTrace and the trace is started, the NYCE subsystem will
not report an error. It is allowed to start a trace with less than the specified
number of variables. When the trace is stopped, the not-added variables contain
the value 0.
Var m-1
Var 3
Var 2
Var 1
Var 0
The trace buffer can be thought of as a table with one column per variable and
one row per sample. For each variable, the oldest value available is contained in
the first row of the table. A higher row index indicates a “fresher” value. This is
visualized in Fig. 3, where T=0 refers to the oldest data, and T=n-1 to the most
fresh data.
T=0
T=1
T=2
T=n-1
Fig. 3
Variable storage in trace buffer
The function NyceStartTrace starts tracing. Stopping the trace is done with the
function NyceStopTrace. Stopping the trace can be done with a ''trace stop
delay''. This parameter specifies the time (in seconds) the gathering of trace data
continues after the NyceStopTrace command is given. Four examples with a
specific trace stop delay (tsd) value are shown in Fig. 4.
18/158
Bosch Rexroth AG
NYCe4000 Software User Manual
NYCE subsystem
Buffer is filled with values directly
before the stop command
Trace data
stop, tsd = 0
Buffer is filled with values around
the stop command
Trace data
stop, 0<tsd<trace window
Trace data
Buffer is filled with values directly
after the stop command
stop, tsd = trace window
Trace data
Buffer is filled with values some
time after the stop command
stop, tsd > trace window
Fig. 4
Stopping the trace after a given delay
When the trace is finished, the trace data is ready to be retrieved. The content of
the entire trace memory is retrieved by using NyceUploadTrace. Additional
information concerning the content of the trace can be retrieved by the functions
NyceGetTraceInfo and NyceGetTraceElement. The latter function returns the
NYCE_ID and the variable id, corresponding to a certain “column” index of the
trace table.
To read trace data without stopping the trace, the function
NyceRetrieveTraceBlock is available. This function can also be used for
continuous monitoring of a set of variables.
When the content of the buffer is no longer needed, the client may call
NyceDeleteTrace.
Some traced variables are not available in the time span of one sample, because
the data is not yet available. The in-time availability of the data depends on which
PVL is used, the PVL on the MCU or the PVL on the drive module. When the PVL
on the MCU is used, all trace data of the same time stamp is kept together,
except the axis position of an MSM encoder. When the PVL on the drive is used,
some data is retrieved from the preceding PVL sample, see Fig. 5.
Fig. 5
The contents of trace data
NYCe4000 Software User Manual
Bosch Rexroth AG
19/158
NYCE subsystem
The contents of the trace data are following variables with their “origin”, when the
PVL on the drive is used:
Setpoint generator variables from “DSP sample 3”.
Test signal from “DSP sample 1” (DSP sample before sample 2, not shown).
I/O from “DSP sample 3”.
PVL output (position error, integrator buffer, controller out and controller out
before test signal addition) from “PVL sample 2.4”.
Axis position from MSM encoders from “PVL sample 2.4”.
Note that the axis position from MSM encoders is always from “PVL sample
2.4”, even when the PVL on the MCU is used.
Axis position from S0/S90, SinCos, EnDat and analog input encoders from
“DSP sample 3”.
See the NYCe4000 Hardware System Manual, chapter “Encoders” for detailed
timing information of the supported encoders.
If data is compared for analysis, you must consider the moment in time that
certain data becomes available. For example in NYCeScope, you can trace the
setpoint position, axis position and position error. The relation is of course
setpoint position = axis position + position error. You will see a difference of 2
samples which is correct, keeping the system delays in mind. In Fig. 5, the
setpoint generated in sample 1 (the sample before sample 2, not shown) is
synchronized at the PVL at the start of sample 2. The PVL interpolates this
setpoint during sample 2 and results in an update of the axis position.
The position error of the last PVL sample (2.4) is stored in the sync packet.
Thus, when you retrieve the axis position in sample 3 the position error is from the
previous sample, and the setpoint position is calculated 2 samples earlier.
However, the generated setpoint of sample 3 is stored in the trace data. In fact,
you can say that the setpoint value in the trace leads by 2 samples.
The trace functionality is managed using a state transition diagram. Fig. 6 shows
the states of the trace and the possible transitions between the trace states.
Fig. 6
Trace state transition diagram
20/158
Bosch Rexroth AG
NYCe4000 Software User Manual
NYCE subsystem
The following trace states are distinguished:
NYCE_TRACE_IDLE: This is the state after power up or after deletion of a trace.
NYCE_TRACE_INITIALIZED: In this state, the trace has been defined. Variables
from other subsystems can be added or deleted from the trace buffer.
NYCE_TRACE_RUNNING: In this state, the trace data are stored in circular buffers.
A stop trace command has not yet been given. In this state it is possible to
retrieve blocks of trace data. It is also possible to restart the trace by means of
a start trace command.
NYCE_TRACE_READY: Tracing has been stopped. The contents of the buffer can
be retrieved or uploaded until the trace is deleted, a new trace is defined, the
trace is restarted or variables are added or deleted.
NYCE_TRACE_STOPPING: In this state, the trace data are stored in one or more
circular buffers. A stop trace command has been given. Tracing will be stopped
after a certain delay, specified as a parameter of the stop command. In this
state it is possible to retrieve blocks of trace data. It is also possible to restart
the trace by means of a start trace command.
NYCE_TRACE_ERROR: While the trace buffer was being filled, tracing has been
stopped abruptly as a consequence of an asynchronous error, which made
further tracing impossible, for example a network or communication error. The
buffer contains valid data from before the occurrence of the error. The content
of the buffer can be retrieved or uploaded until the trace is deleted, a new trace
is defined, the trace is restarted or variables are added or deleted.
To further structure the information on traced data, a 32 bit trace time counter is
defined. This counter is set to 0 when the function NyceStartTrace is executed.
When the counter reaches the value 0 again, the trace is stopped. The counter is
directly related to the sample number of the node. To prevent the “trace stop”
condition when the counter reaches 0 again, the value of the trace time counter
can be calculated as follows:
traceUpdateTime is set with the function NyceDefineTrace.
traceSampleShift depends on the trace SampleTime as follows.
Table 3 traceSampleShift vs. SampleTime
SampleTime
traceSampleShift
8 kHz
1
4 kHz
2
2 kHz
4
1 kHz
8
The trace is stopped when traceTimeCounter equals 0 is detected, which means
that the sample number equals the sample number at the time that the function
NyceStartTrace was executed. When traceTimeCounter equals 0 is detected,
the traceState is immediately set to TRACE_READY. If trace variable data of other
nodes still had to be processed by the driver, these data are not processed.
traceTimeCounter remains set to the last completely read and processed set of
the selected variables. Note that setting traceUpdateTime not equal to 1 does not
imply that more trace data can be stored. Setting traceUpdateTime to 10, for
example, does not mean that the trace can be active 10 times longer.
NYCe4000 Software User Manual
Bosch Rexroth AG
21/158
NYCE subsystem
The traceTimeCounter value can be read with the function NyceGetTraceInfo.
To prevent an unexpected “stop trace”, make sure that traceTimeCounter can
not reach 0 again. Execution of a programmed NyceStopTrace followed by a
NyceStartTrace prevents the unexpected “stop trace”.
3.5
Miscellaneous
This module contains the functions:
NyceSuccess
NyceError
NyceGetStatusString
NyceGetErrorCodeString
NyceGetNodeStatusString
NyceGetVersion
NyceCheckApplVersion
The return values for functions of the NYCe4000 software API are universal to
ensure that all subsystems can interpret return values from other subsystems.
The type of the NYCe4000 return value is inspired by the NTSTATUS return value
type found in Windows driver code. The type for the return value of NYCe4000
software API functions is NYCE_STATUS. The type NYCE_STATUS is typedef-ed as a
32 bit unsigned integer. Fig. 7 shows how the data in this 32 bit type is coded.
31
S e v e rity :
0=SU C C ESS
1=ER RO R
Fig. 7
25
0
S u b s y s te m s p e c if i c
r e tu r n c o d e
S u b s y s te m
i d e n tif ie r
Contents of NYCE_STATUS type
The most significant bit 31 forms the severity of the return value and is coded as
follows:
0 - SUCCESS
1 - ERROR
In this context “SUCCESS” implies that the post condition of the function is
satisfied. If the execution of the function is completely in accordance with
expectations, the special, subsystem independent return value NYCE_OK, defined
0, is returned. This makes checking on full success easy and similar in all
subsystems. If a function execution is not in accordance with expectations, but,
nevertheless, after the execution the post condition is satisfied, the function also
has “SUCCESS”, but returns with a warning. An example of a return value, which
is considered successful but not NYCE_OK is SAC_WRN_AXIS_ALREADY_CONNECTED.
When the NYCE_STATUS type is cast to a signed integer, the sign of the obtained
value determines, if an error occurred or not. For example negative NYCE_STATUS
values indicate an error, while positive and zero values imply success.
Bit 25...30 are used to store the subsystem identifier from the subsystem where
the return value originates from. For each subsystem an identifier is defined in the
22/158
Bosch Rexroth AG
NYCe4000 Software User Manual
NYCE subsystem
general, public available, header file nycedefs.h. This ensures that all subsystems
can determine the origin of the NYCE_STATUS codes.
Bit 0...24 are used for subsystem specific status codes. These codes are defined
in the nycedefs.h file for both subsystems with and without a public (end user)
interface.
The name of a #define of a return value, which is not NYCE_OK, by convention
starts with
XXX_WRN_: if the return value indicates SUCCESS (bit 31 equal to 0)
XXX_ERR_: if the return value indicates ERROR (bit 31 equal to 1)
The function NyceSuccess returns TRUE if an error code indicates SUCCESS and
FALSE otherwise. Obviously, the function NyceError just works the other way
around. For debugging purpose the NYCE library provides the function
NyceGetStatusString. This function translates the return value in the
accompanying error code string. The maximum length of this string is
NYCE_MAX_STRING_LENGTH.
The NYCE subsystem is equipped with some more functions to retrieve strings
from enumerations or defines. These functions are, NyceGetNodeStatusString
which returns the string of the node status and NyceGetErrorCodeString which
returns the string of an error code. Error codes are discussed in detail in chapter
8.11.
The function NyceGetVersion returns the version of the NYCe subsystem while
NyceCheckApplVersion compares the given version with the version of the actual
NYCE subsystem in use.
3.6
Status and error codes
The following table gives a summary of the status and error codes returned from
a call of a function of the NYCE subsystem. Note that the application software
might have called a function of another NYCe4000 subsystem, but that function
called a NYCE subsystem function internally.
NYCe4000 Software User Manual
Bosch Rexroth AG
23/158
NYCE subsystem
Table 4 Status and error codes of the NYCE subsystem
Status / error code
description
NYCE_OK
Function completed successfully
NYCE_ERR_INVALID_OUTPUT_ARGUMENT
Wrong output argument
NYCE_ERR_INVALID_PARAMETER
Invalid parameter specified
NYCE_WRN_NO_VARIABLE_AT_INDEX
Wrong index in variable set
NYCE_ERR_SYSTEM_ERROR
System error
NYCE_ERR_OS_ERROR
Operating System returned an error
NYCE_ERR_NO_NODES
No nodes present in the IEEE1394 network
NYCE_ERR_WRONG_DEH_VERSION
Wrong version of DEH subsystem
NYCE_ERR_WRONG_OSAL_VERSION
Wrong version of OSAL subsystem
NYCE_ERR_WRONG_NCS_VERSION
Wrong version of NCS subsystem
NYCE_ERR_WRONG_SAC_VERSION
Wrong version of SAC subsystem
NYCE_ERR_WRONG_NHI_VERSION
Wrong version of NHI subsystem
NYCE_ERR_WRONG_SYS_VERSION
Wrong version of SYS subsystem
NYCE_ERR_WRONG_DWN_VERSION
Wrong version of DWN subsystem
NYCE_WRN_ALREADY_INITIALIZED
Warning, already initialized
NYCE_WRN_NET_USED
Warning, network used
NYCE_WRN_NOT_TERMINATED
Warning, function not terminated
NYCE_ERR_NOT_INITIALIZED
Not initialized
NYCE_ERR_INVALID_OUTPUT_SIZE
Invalid output argument
NYCE_ERR_WRONG_FIRMWARE_VERSION
Wrong firmware version
NYCE_ERR_WRONG_APPL_VERSION
Wrong application version
NYCE_ERR_WRONG_PLT_VERSION
Wrong version of PLT subsystem
NYCE_WRN_SIM_USED
Warning, simulation used
NYCE_ERR_WRONG_UTILS_VERSION
Wrong version of UTILS subsystem
NYCE_WRN_NO_NETWORK_INITIALIZED
Warning, no IEEE1394 network initialized
24/158
Bosch Rexroth AG
NYCe4000 Software User Manual
Diagnostics and Error Handling (DEH)
4 Diagnostics and Error Handling (DEH)
For debugging and logging purposes all NYCe4000 subsystems provide logging
information. The DEH subsystem can be used to retrieve the logged information
while running your application. This chapter explains how you can add logging
functionality to your application and how you can retrieve this logged information.
All NYCe4000 API functions have the logging functionality already integrated, and
you can use the NYCeLogger tool to activate specific logging (which submodule,
and what information should be logged) and view the logged data.
4.1
General
The logging functionality provides accurate information about the API functions
called in an application, the parameters, the return values and the time the
functions needed to complete. This functionality is very well suited to track down
performance problems. The logging functionality is implemented in 9 categories
which can be individually turned on or off through the appropriate API functions.
This gives the ability to turn on only the required logging categories, eliminating
unnecessary logged output.
4.2
Generate logging information
This module contains the functions:
DehLogFunctionEntry
DehLogPrimaryParameters
DehLogSecondaryParameters
DehLogOutputParameters
DehLogFunctionExit
DehLogEvent
DehLogUserMsg
The NYCe4000 API functions implement the logging functionality as follows:
DehLogFunctionEntry is called as soon as possible, since this function
creates a timestamp on function entry and logs the called function name.
DehLogPrimaryParameters is called before using the parameters. This way
the values of the primary function input arguments are logged.
DehLogSecondaryParameters is called before using the parameters. This way
the values of the secondary function input arguments are logged. Secondary
parameters are those parameters that are less interesting to log or take a
certain amount of processing time to log that data.
DehLogOutputParameters is called before leaving the function to log the
values of the function output arguments.
DehLogFunctionExit is called just before every function exit point (return
statement) such that the function name is logged and the execution time can
be calculated.
When an event is received, the event handler can call DehLogEvent to log the
event and throughout the source code DehLogUserMsg can be called to generate
additional logging or debugging information.
NYCe4000 Software User Manual
Bosch Rexroth AG
25/158
Diagnostics and Error Handling (DEH)
4.3
Retrieve logging information
This module contains the functions:
DehSetLoggingMask
DehSetSSLoggingMask
DehGetLoggingMask
DehGetSSLoggingMask
DehGetLoggingData
Logging can be turned on or off per process and per subsystem.
The function DehSetLoggingMask starts logging of a process. The logging is
started when the logging mask is not 0x0. The logging mask can be set using
following flags:
DEH_LOG_ENTRY
0x001
DEH_LOG_PRIPAR
0x002
DEH_LOG_SECPAR
0x004
DEH_LOG_OUTPAR
0x008
DEH_LOG_EXIT
0x010
DEH_LOG_ERROR_EXIT
0x020
DEH_LOG_EVENT
0x040
DEH_LOG_EVENT_DATA
0x080
DEH_LOG_USER_MSG
0x100
These flags correspond to the logging functions explained in chapter 4.2.
DEH_LOG_ERROR_EXIT only logs a DehLogFunctionExit when the logged return
value is an error. DEH_LOG_EVENT logs the event and if the DEH_LOG_EVENT_DATA
flag is set in the logging mask, the event data belonging to the event is logged.
DehGetLoggingMask returns the logging mask for a certain process.
Logging can also be turned on or off per subsystem (for example SAC or NHI) by
using the function DehSetSSLoggingMask.
DehGetSSLoggingMask returns the logging mask for a certain subsystem.
The function DehGetLoggingData is used to retrieve a single log entry from the
log buffer. The data retrieved is the oldest data available, which is deleted after
retrieval. Since the logged data is stored in a circular buffer, new data will
overwrite old data if the old data is not retrieved in time. The logNr pointer can be
used to detect if logged messages have been overwritten.
4.4
Miscellaneous
The module contains the function:
DehGetVersion
The function DehGetVersion returns the version of the DEH subsystem.
4.5
Example of using DEH
Logging of data is a 2-step process. First you add the function calls that generate
the logging information in which you are interested to the functions that you want
to monitor. Then you write a routine that defines and sets the logging mask, starts
the logging process and retrieves the logged information from the log buffer. The
log information is generated after you start the application.
26/158
Bosch Rexroth AG
NYCe4000 Software User Manual
Diagnostics and Error Handling (DEH)
For example, you are interested in the elapsed time in a certain routine. You add
the function call DehLogFunctionEntry at the start of that routine and add the
function call DehLogFunctionExit to the end of the routine.
Another routine calls the function DehSetLoggingMask with the mask bits
DEH_LOG_ENTRY and DEH_LOG_EXIT set.
You can develop your own software to retrieve the stored time stamps on entry
and exit of the routine from the log buffer using the DehGetLoggingData function
and calculate the elapsed time, but you can also use the NYCeLogger tool to
retrieve the logged data. See the NYCe4000 Tools Manual.
Example: Usage of the functions that produce log data.
MY_STATUS ExampleFunction(uint_32t parameter)
{
/* Log the entry time stamp */
DehLogFunctionEntry("ExampleFunction");
MY_STATUS retVal = NYCE_OK;
:
:
// my code
:
:
/* Log my parameter */
DehLogOutputParameters("parameter value=%d", parameter);
:
:
/* Log the exit time stamp */
DehLogFunctionExit("ExampleFunction", retVal);
return retVal;
}
4.6
Status and error codes
The following table gives a summary of the status and error codes returned from
a call of a function of the DEH subsystem. Note that the application software
might have called a function of another NYCe4000 subsystem, but that function
called a DEH subsystem function internally.
Table 5 Status and error codes of the DEH subsystem
Status / error code
description
DEH_ERR_SYSTEM_ERROR
DEH system error
DEH_ERR_INVALID_PARAMETER
Invalid parameter specified
DEH_WRN_NO_LOGGING_DATA
Warning, no logging data available
DEH_ERR_INVALID_OUTPUT_ARGUMENT
Invalid output argument
DEH_ERR_INVALID_NAME
Invalid name specified
DEH_ERR_TOO_MANY_LOGGING_PROCESSES
Too many logging processes
NYCe4000 Software User Manual
Bosch Rexroth AG
27/158
Download (DWN)
5 Download (DWN)
The download subsystem provides functionality to easily load the NYCe4000
hardware with the firmware and gateware containing the functionality of the
NYCe4000 Software Release. See also the NYCe4000 Software Release Bulletin
documentation on the CD-ROM and installed on the host PC.
5.1
General
Normally, after startup, firmware and gateware are loaded from flash memory.
Therefore, it is not necessary to download firmware or gateware after each
restart. The download of firmware or gateware is only necessary when firmware
or gateware must be upgraded, and can be performed with the NYCeCommand
or NYCeConfigurator or tool, see the NYCe4000 Tools Manual. The download
operations can also be performed from the application software.
5.2
Firmware / Gateware
This module contains the functions:
DwnDownloadPrimaryBoot
DwnEraseGateware
DwnDownloadGateware
DwnDownloadFirmware
DwnDowngradeFlash
DwnDownloadMicroware
DwnDownloadSerconGateware
The function DwnDownloadPrimaryBoot downloads a new primary boot
application, including DSP gateware. Use this function with care: when the
download fails, is interrupted or aborted, the MCU becomes unusable. Use this
function only once, when upgrading the MCU. This function blocks the calling
thread for several seconds.
The function DwnEraseGateware removes all drive gateware images from the
node after which other drive gateware image(s) can be downloaded using
DwnDownloadGateware. After the node is updated with new drive gateware
image(s) you must call DwnDownloadFirmware to download the accompanying
firmware file.
Note:
The drive gateware image(s) that you download depend on the installed drive
modules. You must fill the gateware banks starting with bank 0, and you must fill
the banks consecutively, that is, you can not skip a bank.
After downloading the firmware, the new firmware is not active immediately. It is
only stored in flash memory. To start the new firmware you must switch off the
24V system power supply, wait 5 seconds and switch on the 24V system power
supply to reset the node, or call the function SysResetNode.
You can use the function DwnDowngradeFlash to downgrade the flash memory to
an absolute minimum required. The only data that remains in the flash memory
are the bootloader and the flash configuration data (node name and sample time).
The function DwnDownloadMicroware downloads a microware image to the
NY4150 SERCOSIII Master Module. The microware is the software executed by
the microprocessor on the NY4150. As this microware image is not downloaded
into the MCU, but into the NY4150, the NY4150 drive gateware must already be
28/158
Bosch Rexroth AG
NYCe4000 Software User Manual
Download (DWN)
downloaded and started (power cycle the system, or call the function
SysResetNode after the NY4150 gateware is downloaded). This function blocks
the calling thread for several seconds.
The function DwnDownloadSerconGateware downloads the SERCON gateware to
the NY4150 SERCOSIII Master Module. As this SERCON gateware is not
downloaded into the MCU, but into the NY4150, the NY4150 drive gateware must
already be downloaded and started (power cycle the system, or call the function
SysResetNode after the NY4150 gateware is downloaded). This function blocks
the calling thread for several seconds.
The functions DwnDownloadMicroware and DwnDownloadSerconGateware do not
require a specific order. To start the new software, the node must be power
cycled (or the function SysResetNode must be called) after the download of the
microware image and the SERCON gateware.
5.3
Miscellaneous
This module contains the function:
DwnGetVersion
The function DwnGetVersion returns the version of the DWN subsystem.
5.4
Status and error codes
The following table gives a summary of the status and error codes returned from
a call of a function of the DWN subsystem. Note that the application software
might have called a function of another NYCe4000 subsystem, but that function
called a DWN subsystem function internally.
Table 6 Status and error codes of the DWN subsystem
Status / error code
description
DWN_ERR_INVALID_NODE_VERSION
Invalid node version
DWN_ERR_INVALID_PARAMETER
Invalid parameter specified
DWN_ERR_INVALID_SLOTTYPE
Invalid slot type
DWN_ERR_INVALID_OUTPUT_ARGUMENT
Invalid output argument specified
DWN_ERR_FILE_CREATE_ERROR
Create specified file failed
DWN_ERR_FILE_OPEN_ERROR
Open specified file failed
DWN_ERR_FILE_READ_ERROR
Read specified file failed
DWN_ERR_FILE_CONTENTS_ERROR
Content of specified file not correct
DWN_ERR_FILE_CLOSE_ERROR
Close specified file failed
DWN_ERR_SYSTEM_ERROR
DWN system error
DWN_ERR_NOT_IMPLEMENTED
Called DWN function not implemented
DWN_ERR_WRONG_FIRMWARE_VERSION
Wrong firmware version
DWN_ERR_STATE_ERROR
State error
DWN_ERR_FILE_SIZE_ERROR
Specified file has wrong size
NYCe4000 Software User Manual
Bosch Rexroth AG
29/158
System (SYS)
6 System (SYS)
The system subsystem provides functionality that applies for the whole
NYCe4000 motion system.
6.1
General
The main goal of this subsystem is among others to setup a system, check the
system configuration and monitor the network for changes.
6.2
Events
This module contains the functions:
SysDefineEventEnrolment
SysDeleteEventEnrolment
The general NYCe4000 event handling has already been explained in chapter
2.4. Within the SYS subsystem the SYS_EV_NETWORK_CHANGED event is generated
in several conditions. The condition can be retrieved by reading the event data
returned by the enrolment:
NCS_BUSRESET_OCCURRED at each IEEE 1394 bus reset.
NCS_NODE_CONFIG_CHANGE_OCCURRED at changes of node and axis names, axis
types, adding and removing axis from nodes, etc.
NCS_AXIS_CONFIG_CHANGE_OCCURRED at configuration or initialization of an
axis.
NCS_NETWORK_CONFIG_CHANGE_OCCURRED when physically adding or removing
nodes to or from a network.
When a SYS_EV_NETWORK_CHANGED event occurs, all nodes and axes must be
disconnected. To communicate with a disconnected node or axis, it must be
connected again. Also, the possibility exists that the event enrolments are no
longer valid, thus event enrolments must also be defined again. To define the
event enrolments, the ‘old’ event enrolments must be deleted. The delete
operation of the event enrolments will fail if the event enrolments were indeed no
longer valid. The error message can be ignored.
When a NCS_NETWORK_CONFIG_CHANGE_OCCURRED is detected all axis and node
IDs have become invalid. The application(s) should disconnect all nodes and
axes to which it had a connection. When connecting to the nodes and axes, the
applications obtain valid IDs by which nodes and axes can be accessed again.
30/158
Bosch Rexroth AG
NYCe4000 Software User Manual
System (SYS)
6.3
Configuration
This module contains the functions:
SysGetNrOfNodes
SysGetMcuUnitType
SysGetNodeName
SysSetNodeName
SysCheckConfiguration
SysGetNodeNumber
SysGetNodeStatus
SysGetSystemSampleTime
SysResetNode
SysResetNodes
SysGetNodeSerialNumber
A NYCe4000 motion system can consist of up to NYCE_MAX_NR_OF_NODES nodes.
The actual number of nodes in a motion system can be retrieved by the function
SysGetNrOfNodes.
A NYCe4000 node can be realized with several different MCU modules. The
function SysGetMcuUnitType returns the type of MCU of the specified node.
The function SysGetNodeNumber gets the node number of the specified node.
The numbering scheme of the nodes depends on how the nodes are physically
connected by the FireWire / Cat-5e / Cat-6 cables. The node numbers have a
relation with the physical location of the FireWire / Cat-5e / Cat-6 cables as
plugged in the nodes.
Host
1
2
3
Nodenr: 4
NodeName: W
1
2
3
Nodenr: 0
NodeName: Y
1
2
3
1
2
3
1
2
3
Nodenr: 1
NodeName: Z
Nodenr: 2
NodeName: X
Nodenr: 3
NodeName: V
Fig. 8
Node numbering in a NYCe4000 system
Note:
If the distance between the host and the first node is smaller than 4.5 meter, you
can use the NY4110 as MCU in that first node and FireWire cable for the
connection. If the distance is larger than 4.5 meter you must use the NY4111 and
Cat-5e cable (for distances up to 20 meter) or Cat-6 cable (for distances between
20 and the maximum of 50 meter). To use Cat-5e or Cat-6 cable, you must install
the NY4916/10 host adapter in the host.
To determine the node numbers of each node in the system do the following
steps.
NYCe4000 Software User Manual
Bosch Rexroth AG
31/158
System (SYS)
1. Count the NYCe4000 nodes in the system. The counter has the value 5 in the
example shown. Do not count the non-NYCe4000 nodes.
2. Start from the node to which the host is connected.
Every node can have a FireWire / Cat-5e / Cat-6 cable connected to each
port. Port 1 is the ‘highest’ and port 3 is the ‘lowest’ in order to find the node
numbers.
3. Decrement the counter value by 1.
4. To determine the number of a node you follow the FireWire / Cat-5e / Cat-6
connection from the highest port not yet traversed in that chain until you reach
the child node that has no connections to other nodes. Such a child node has
the node number equal to the value of the counter. Then you return to the
parent node to which this child node is connected.
5. Decrement the counter value by 1.
6. If the parent node has another child node connected to the next lower port,
repeat steps 4 and 5, else all child nodes connected are numbered. This
parent node has the node number equal to the value of the counter.
Repeat steps 4 and 5 until all nodes numbers are determined.
The path followed according to the steps 1 thru 6 in the example are the following.
NodeName ‘Y’ is the starting point, because this node is connected to the host.
Follow the highest port (2) of NodeName ‘Y’ to NodeName ‘X’. Since there are
nodes connected to NodeName ‘X’, follow the highest port (2) of NodeName ‘X’ to
NodeName ‘W’. As NodeName ‘W’ is the last node in this chain NodeName ‘W’
has node number 4. Then you return to NodeName ‘X’. NodeName ‘X’ has nodes
connected to the next lower port (3). Follow port 3 to NodeName ‘V’. As
NodeName ‘V’ is the last node in this chain, NodeName ‘V’ has node number 3.
Then you return to NodeName ‘X’. Since all nodes connected to NodeName ‘X’
have a node number, NodeName ‘X’ has node number 2. Then you return to
NodeName ‘Y’. NodeName ‘Y’ has nodes connected to the next lower port (3).
Follow port 3 to NodeName ‘Z’. As NodeName ‘Z’ is the last node in this chain,
NodeName ‘Z’ has node number 1. Then you return to NodeName ‘Y’. Since all
nodes are traversed, this node has node number 0.
It is of no relevance for the determination of the node numbers what type of MCU
is installed in a node. In the example as shown in Fig. 8 the nodes ‘X’, ‘W’ and ‘V’
can have an NY4110 installed if FireWire cables are used, and NY4111 installed
if Cat-5e or Cat-6 cables are used.
The name of each NYCe4000 node can be retrieved and changed by the
functions SysGetNodeName and SysSetNodeName. All node and axis names in a
system must be unique. This can be checked by calling SysCheckConfiguration.
This function checks if node names are valid, node names are unique, axis
names are valid, and axis names are unique.
The function SysGetNodeStatus retrieves the state of a node. A node can be in
several states, enumerated in NYCE_NODE_STATUS. These states have the prefix
NODE_STATUS_BL_ or NODE_STATUS_FW_. Here BL stands for boot loader and FW for
firmware. A node starts up with a boot loader and when the boot loader finds valid
firmware in flash memory it starts the firmware. The boot loader contains some
basic functionality such as downloading firmware.
The system sample time that can be retrieved by SysGetSystemSampleTime is
explained in chapter 3.3.
The function SysResetNode resets one node and the function SysResetNodes
resets all nodes synchronously. Note that any change to the configuration (add or
remove an axis, change a parameter value) is lost when the function
SysResetNode or SysResetNodes is called without first saving the changes to the
flash memory. To use the function SysResetNode or SysResetNodes it is not
necessary to be connected to the node.
The function SysGetNodeSerialNumber returns the serial number of the specified
node.
32/158
Bosch Rexroth AG
NYCe4000 Software User Manual
System (SYS)
6.4
Miscellaneous
This module contains the functions:
SysBlinkNode
SysGetVersion
The function SysBlinkNode starts or stops blinking the green led of a specific
node and the function SysGetVersion returns the version of the SYS subsystem.
6.5
Status and error codes
The following table gives a summary of the status and error codes returned from
a call of a function of the SYS subsystem. Note that the application software
might have called a function of another NYCe4000 subsystem, but that function
called a SYS subsystem function internally.
Table 7 Status and error codes of the SYS subsystem
Status / error code
description
SYS_ERR_INVALID_OUTPUT_ARGUMENT
Invalid output argument
SYS_ERR_INVALID_PARAMETER
Invalid parameter
SYS_ERR_NODE_DOES_NOT_EXIST
Specified node does not exist in network
SYS_ERR_FILE_CREATE_ERROR
Create specified file failed
SYS_ERR_FILE_OPEN_ERROR
Open specified file failed
SYS_ERR_FILE_CONTENTS_ERROR
Content of specified file not correct
SYS_ERR_INVALID_NODE_NAME
Specified node name does not exist
SYS_ERR_DUPLICATE_NAME
Specified name already exists
SYS_ERR_INVALID_AXIS_NAME
Specified axis name does not exist
SYS_ERR_INVALID_EVENT_ID
Invalid event ID
SYS_ERR_INVALID_FUNCTION
Invalid function
SYS_ERR_MAX_HANDLERS_REACHED
Maximum number of handlers reached
SYS_ERR_HANDLER_NOT_DEFINED
Handler not defined
SYS_ERR_NO_NODES
No nodes in IEEE1394 network
SYS_ERR_SYSTEM_ERROR
SYS system error
SYS_ERR_OS_ERROR
Operating System error
SYS_ERR_WRONG_FIRMWARE_VERSION
Wrong firmware version
SYS_ERR_NODE_IN_ERROR
Node in error
SYS_ERR_INVALID_MECHANISM_NAME
Invalid mechanism name
NYCe4000 Software User Manual
Bosch Rexroth AG
33/158
Node Hardware Interface (NHI)
7 Node Hardware Interface (NHI)
The NHI subsystem provides functionality to access and configure nodes. From a
software point of view a node is considered a processing unit with a number of
slots containing digital I/O, analog I/O and drives.
7.1
General
The NHI subsystem is divided in several modules. Each module consists of a
coherent set of user functionalities. Each functionality is implemented in one or
more functions.
The interface of the NHI library is a multi-client interface. A client is considered an
application that is connected to at least one node through the NHI library. The
NHI library can control up to 62 [NYCE_MAX_NR_OF_NODES] nodes. One client may
control several nodes, but this is limited to the maximum number of nodes. It is
possible that one individual node is accessed by more than one client, but this is
limited to a maximum of 16 [NYCE_MAX_NR_OF_CLIENTS] clients.
The main features of the NHI subsystem are: defining axes, configuring I/O,
handling I/O, handling state change events and providing information about the
configuration of the connected nodes.
7.2
Conversion
This module contains the functions:
NhiGetEventEnum
NhiGetEventString
NhiGetParIdEnum
NhiGetParidString
NhiGetVarIdEnum
NhiGetVarIdString
NhiGetMcuUnitTypeEnum
NhiGetMcuUnitTypeString
NhiGetUnitTypeEnum
NhiGetUnitTypeString
The functions within this module convert strings to enumeration values and vice
versa.
7.3
Basic node handling
This module contains the functions:
NhiConnect
NhiDisconnect
NhiInitialize
NhiResetNode
NhiConnect establishes a logical connection between a node and a calling client
process. The node identifier, that is returned, is used by the client process for
function calls to that particular node. If NhiConnect is called more than one time
from a client process for one specific node without calling a NhiDisconnect first,
34/158
Bosch Rexroth AG
NYCe4000 Software User Manual
Node Hardware Interface (NHI)
NhiConnect will return the node identifier for that specific node and the return
value NHI_WRN_ALREADY_CONNECTED to notify that the client process already has a
connection to the node.
At each NHI call with a node identifier as argument, the node identifier is
validated. When the identifier has become invalid, for example after reset of the
referenced node, one of the following values is returned by the function:
NCS_ERR_NODE_DOES_NOT_EXIST
NHI_ERR_NODE_REMOVED
When one of these values is returned by a function, all client processes should
disconnect from the node and connect again. These return values are a result of
a configuration change in the network as explained in chapter 6.2.
In case a client process does not call a NhiDisconnect before a new NhiConnect
when necessary, it just gets a new valid node identifier. The client process still
has to disconnect the old invalid node identifier to free the identifier. If not all client
processes disconnect the invalid node identifiers, it is possible that NHI returns
NHI_ERR_TOO_MANY_NODES on a NhiConnect because all possible node identifiers
have been distributed.
The function NhiInitialize initializes a node from flash or with the parameter
values within the XML file created with NhiUpload. To initialize a node from flash,
use the NHI_USE_FLASH define as input argument while calling NhiInitialize.
As the NY4150 SERCOSIII Master module does not support analog inputs and
digital I/O, these functionality-related parameters are not available.
If, for some reason, not all parameters are defined in the XML file, NhiInitialize
returns with the warning [NHI_WRN_PARAMETER_NOT_SPECIFIED] and uses the
current values for the missing parameters.
An error code returned by NhiInitialize can be related to a specific NHI
parameter identifier. By reading the variable [NHI_VAR_ID_OF_INVALID_PAR] the
user can verify this. If the value is not equal to [NYCE_NO_PAR_ID], the value
indicates a particular NHI parameter identifier.
NhiResetNode restarts the node, identified by its node id, in the same way when
power is applied to the node. After a reset the node is initialized using the node
sample time stored in flash and default parameters for the node and defined axes.
Note that any change to the configuration (add or remove an axis, change a
parameter value) is lost when the function NhiResetNode is called without first
saving the changes to the flash memory. To use the function NhiResetNode it is
necessary that a connection is created with the function NhiConnect.
Following events are available for state transitions in NHI.
NHI_EV_NETWORK_ERROR: This event occurs after a network error.
NHI_EV_COMMUNICATION_ERROR: This event occurs after an internal error in the
IEEE 1394 protocol.
7.4
Parameters
This module contains the functions:
NhiReadParameter
NhiWriteParameter
NhiSaveToFlash
NhiUpload
NhiReadParameter and NhiWriteParameter access single NHI parameters. All
NHI parameters can be stored in the flash memory of the specified node with the
function NhiSaveToFlash. It is also possible to upload the current NHI parameters
to an XML file on the host with the function NhiUpload.
As the NY4150 SERCOSIII Master module does not support analog inputs and
NYCe4000 Software User Manual
Bosch Rexroth AG
35/158
Node Hardware Interface (NHI)
digital I/O, these functionality-related parameters are not available.
The parameter NHI_PAR_NODE_SAMPLE_TIME sets the node sample time. The
node sample time can be set to 1 ms, 0.5 ms, 0.25 ms, and 0.125 ms. However, if
the node contains an NY4150, the node sample time is fixed at 1 ms. If the node
sample time is adjusted to an other value, the sample time is still 1 ms, and the
error CML_ERR_INVALID_PARAMETER is returned.
7.5
Variables
This module contains the functions:
NhiReadVariable
NhiAddVariableToTrace
NhiDeleteVariableFromTrace
NhiAddVariableToSet
NhiDeleteVariableFromSet
The function NhiReadVariable reads the actual value of a variable within a node.
As the NY4150 SERCOSIII Master module does not support analog I/O and
digital I/O, these functionality-related variables return a fixed value.
The functions NhiAddVariableToTrace and NhiAddVariableToSet return as
output argument the index on which the variable can be found in the trace or set.
This index should also be used as function argument to delete the variable from a
trace or set through the functions NhiDeleteVariableFromTrace and
NhiDeleteVariableFromSet. If the function NhiAddVariableToTrace or
NhiAddVariableToSet returns the error [HNI_ERR_SYSTEM_ERROR], check that the
variable set or trace set does not contain more than 4 nodes, as 4 nodes is the
maximum for a variable set or trace set. Variable traces and variable sets are
explained in more detail in chapters 3.3 and 3.4. Variable latch sets are described
in chapter 7.6.
7.6
Variable latch set
A variable latch set is a set of specified axis and node variables of which their
values are latched when a specific event occurs. A limited number of sets are
available per node. A latch set is specified and identified by its latchSetId, which
is an index in the range of 0 … [NYCE_MAX_NR_OF_LATCH_SETS_PER_NODE] -1.
Thus, there can be at maximum [NYCE_MAX_NR_OF_LATCH_SETS_PER_NODE] latch
sets defined in a node.
Each latch set can hold up to [NYCE_MAX_NR_OF_VARIABLES_PER_LATCH_SET]
variables. If you want to latch more variables on the same event, you can define
more latch sets for the same event.
This module contains the functions:
NhiAddVarToLatchSet
NhiClearLatchSet
NhiClearAllLatchSets
NhiGetLatchSetNrOfVars
NhiGetLatchSetState
NhiActivateLatchSet
NhiDeactivateLatchSet
NhiReadLatchSetValues
The function NhiAddVarToLatchSet adds a node variable of the specified node to
a latch set. You can only add variables to the latch set when the latch set is in the
NHI_LATCH_SET_STATE_IDLE state. The function returns an index which indicates
36/158
Bosch Rexroth AG
NYCe4000 Software User Manual
Node Hardware Interface (NHI)
the location in the variable set where the variable is added. With this index you
can retrieve the value of the variable after the specified event latched the variable.
The function NhiClearLatchSet removes the specified latch set on the specified
node. With the function NhiClearAllLatchSets you can remove all defined latch
sets on the specified node.
The function NhiGetLatchSetNrOfVars returns the number of variables in the
specified latch set, and can be used to determine if the latch set still has space to
add more variables to the latch set. The function NhiGetLatchSetState returns
the state of the specified latch set on the specified node. Remember that you can
only add a variable to a latch set if the latch set is in the idle state.
With the function NhiActivateLatchSet you can “arm” a latch set. Precondition is
that the specified latch set must be in the state NHI_LATCH_SET_STATE_IDLE. If a
latch set is armed, the values of the specified variables in the latch set are latched
when the specified event occurs.
With the function NhiDeactivateLatchSet you can set the specified latch set in
the idle state. Precondition is that the state of the specified latch set is either
NHI_LATCH_SET_STATE_ARMED or NHI_LATCH_SET_STATE_READY.
After the specified event occurred, the latched values can be read by the function
NhiReadLatchSetValues. Precondition is that the state of the specified latch set
is NHI_LATCH_SET_STATE_READY. Besides the node and latch set, you must
specify a pre-allocated array of sufficient size in which the latched values will be
loaded. After the function call you can read the value of a specific latched variable
in that array by specifying the index obtained when that variable was added to the
latch set. See also chapter 8.6 for the functions SacAddVarToLatchSet and
SacActivateLatchSet which specify an axis and an axis variable instead of a
node and a node variable.
7.7
Events
This module contains the functions:
NhiDefineEventEnrolment
NhiDeleteEventEnrolment
The functions NhiDefineEventEnrolment and NhiDeleteEventEnrolment to
define and delete event enrolments are discussed in chapter 2.4. All available
events in NHI are discussed within the appropriate module chapters of this
manual. For the NY4150 no event enrolments are possible based on analog
inputs or digital I/O, because the SERCOSIII Master module does not support
analog inputs and digital I/O.
When an event handler has been called, a union structure is transferred with the
event enrolment, if applicable. Table 8 lists node-based and slot-based events
together with the assigned fields in the union structure.
NYCe4000 Software User Manual
Bosch Rexroth AG
37/158
Node Hardware Interface (NHI)
Table 8 NHI events and returned information in the union structure
NHI event
union field
description
NHI_EV_SAFETY_INPUT_CHANGED
uDigIOLevel
NYCE_ACTIVE_LEVEL, NYCE_INACTIVE_LEVEL
NHI_EV_EMERGENCY_INPUT_CHANGED
uDigIOLevel
NYCE_ACTIVE_LEVEL, NYCE_INACTIVE_LEVEL
NHI_EV_NETWORK_ERROR
uStatus
NYCE_STATUS
NHI_EV_COMMUNICATION_ERROR
uStatus
NYCE_STATUS
NHI_EV_HEARTBEAT
n/a
for internal use only
NHI_EV_SAMPLE_OVERRUN
uEventLong
Node-based events
Counter with the number of samples that were executed
in time during current sample.
Slot-based events
NHI_EV_DIG_IO_STATE_CHANGE_SLOT_x
uDigIOChangeOfState.ioStatus
Actual status of the I/O mask.
uDigIOChangeOfState.ioMask
Mask indicating which I/O’s changed with respect to the
previous sample.
NHI_EV_AN_INy_LEVEL_CROSSING_SLOTx
uAnInLevelCrossing.anInValue
Measured analog input value.
uAnInLevelCrossing.trans
NO_TRANS, NEG_TO_AREA, AREA_TO_NEG,
POS_TO_AREA, AREA_TO_POS, NEG_TO_POS,
POS_TO_NEG
NHI_EV_DIGIN_COUNTER0_SLOTx
n/a
NHI_EV_DIGIN_COUNTER1_SLOTx
n/a
NHI_EV_DIGIN_COUNTER2_SLOTx
n/a
NHI_EV_DIGIN_COUNTER3_SLOTx
n/a
NHI_EV_ASPI_READ_REQUESTED_PORTy_SLOTx
n/a
NHI_EV_ASPI_READ_READY_PORTy_SLOTx
n/a
NHI_EV_ASPI_WRITE_READY_PORTy_SLOTx
n/a
n/a : no fields assigned
38/158
Bosch Rexroth AG
NYCe4000 Software User Manual
Node Hardware Interface (NHI)
7.8
Configuration
This module contains the functions:
NhiAddAxis
NhiDeleteAxis
NhiSetAxisName
NhiGetAxisName
NhiGetDefinedAxes
NhiGetNrOfAxes
NhiGetMcuUnitType
NhiGetMcuSerialNumber
NhiGetNrOfSlots
NhiGetUnitType
NhiGetUnitSerialNumber
NhiWriteUserDataToFlash
NhiReadUserDataFromFlash
NhiGetExpansionModule
NhiGetIndraDrives
Before an axis can be connected it must be created through the NHI subsystem.
NHI provides the functions NhiAddAxis, NhiDeleteAxis, and NhiSetAxisName to
create, delete and name axes. When an axis is created, the firmware creates the
axis and sends the event SYS_EV_NETWORK_CHANGED. The host software updates
the system administration. As these activities take some time it is advised to add
a delay of 100 ms after the call to NhiAddAxis if another call to NhiAddAxis
immediately follows to create another axis. This also applies when an axis is
deleted.
The function NhiGetAxisName returns the name of the axis specified by the node
id and the axis number. NhiGetDefinedAxes returns the number of axes and the
axis number for all axes for the specified node id. NhiGetNrOfAxes only returns
the number of axes for the specified node id.
The functions NhiGetMcuUnitType, NhiGetMcuSerialNumber, NhiGetNrOfSlots,
NhiGetUnitType, and NhiGetUnitSerialNumber provide the user with
information about the hardware configuration of the node.
The functions NhiWriteUserDataToFlash and NhiReadUserDataFromFlash
enables the user to write user data to and read user data from the flash memory.
The user data size is limited to NYCE_MAX_USER_DATA_FLASH_SIZE number of
bytes. The actual number of bytes is always written to the flash memory or read
from the flash memory. If the specified number of bytes is zero, a negative
number, or higher than NYCE_MAX_USER_DATA_FLASH_SIZE, the function
NhiWriteUserDataToFlash returns the error code NHI_ERR_INVALID_DATA_SIZE
and the function NhiReadUserDataFromFlash returns the error code
NHI_ERR_INVALID_PARAMETER. If the pointer to the specified user data is not
initialized, both functions return the error NHI_ERR_INVALID_OUTPUT_ARGUMENT.
If the read operation fails, NhiReadUserDataFromFlash returns the error code
NHI_ERR_INVALID_DATA_SIZE.
The function NhiGetExpansionModule retrieves the type of the expansion module
attached to a NY4120, NY4130, NY4140 or NY4170 drive, and its encoder signal
range. If no expansion module is found, the signal range will be 0 Vtt and the
expansion module will be set to NHI_NO_EXPANSION_MODULE.
The function NhiGetIndraDrives retrieves the state of the SERCOS network
connected to the NY4150 SERCOSIII Master module and the number of
IndraDrives in the SERCOS network. For every detected IndraDrive the drive unit
number is retrieved.
Note:
Reading from and writing to flash memory is not very fast and will occupy the
NYCe4000 Software User Manual
Bosch Rexroth AG
39/158
Node Hardware Interface (NHI)
node for a moment. Make sure these functions are not called while performing
time critical operations on the node.
7.9
Digital I/O
This module contains the functions:
NhiReadDigitalIO
NhiReadDigitalIORegister
NhiDefineDigitalIOActiveState
NhiDefineDigitalOutputType
NhiGetDigitalOutputType
NhiSetDigitalOutput
NhiClearDigitalOutput
NhiToggleDigitalOutput
These functions are not supported for the NY4150, because the SERCOSIII
Master module does not support digital I/O, and will return an error.
The enumeration NYCE_ACTIVE_STATE defines the possible active states of inputs
and outputs. NhiDefineDigitalIOActiveState defines the active level for an
input or output. Setting active levels can also be done through the parameter
NHI_PAR_DIGITAL_IO_ACTIVE_MASK_SLOTx. This parameter sets the active level
of the whole digital I/O register of a slot.
Note:
The active level can only be changed when the digital output is inactive.
Otherwise the function call returns CML_ERR_OUTPUT_TYPE_IS_ACTIVE.
With the function NhiDefineDigitalOutputType the digital outputs can be
configured as follows.
NHI_DIGOUT_STATE, the digital output is set to the active state after calling
NhiSetDigitalOutput and in the inactive state after calling
NhiClearDigitalOutput.
NHI_DIGOUT_PULSE, after the pulse active time the output is made inactive
again. If the output is set during the active state of the digital pulse output, the
pulse effectively restarts.
NHI_DIGOUT_PWM, after the on-delay time a block wave signal is set on the
output with the specified frequency and duty cycle. If the output is set during
the active state of the PWM output, the “set” effectively restarts with a new ondelay time.
Fig. 9
Parameters of the PWM output
By calling NhiToggleDigitalOutput a digital output of type NHI_DIGOUT_STATE is
inverted. On other types of outputs, the function has no effect, and results in an
error.
Digital outputs can also be set, cleared or toggled, if they have a specific axis I/O
function, for example if the output is configured as a brake or a trigger output. Set,
clear and toggle then operate in accordance with the way the outputs are
40/158
Bosch Rexroth AG
NYCe4000 Software User Manual
Node Hardware Interface (NHI)
configured in NHI. See chapter 8.10 for a description of the axis related output
functions.
The following events are available for digital I/Os.
NHI_EV_DIG_IO_STATE_CHANGE_SLOTx
For each slot an event can be generated on state changes of a defined set of
digital I/O signals. The parameter NHI_PAR_IO_EVENT_MASK_SLOTx defines the
set of the digital I/Os for which the event is generated. The value of this
parameter is a binary mask where the bits correspond with the digital I/Os
within the enumeration NYCE_DIG_IO_NR. The event is only generated for the
digital I/O signals indicated with a ‘1’ in this mask. The eventdata
(uDigIOChangeOfState), passed as an argument to the event handler,
contains all actual digital I/O states of the slot and a mask, indicating the digital
I/Os which caused the event.
NHI_EV_EMERGENCY_INPUT_CHANGED
Each node has one dedicated emergency input. The polarity of this input is set
by NHI_PAR_NODE_EMERGENCY_POLARITY using the enumeration
NYCE_ACTIVE_STATE. The NHI_EV_EMERGENCY_INPUT_CHANGED event occurs
when the input state changes. The event data uDigIOLevel contains the actual
logical state of the input defined by the enumeration NYCE_DIGITAL_IO_LEVEL.
All axes on the node will detect an error when the emergency input is activated
and execute the corresponding error handler. The axis error detection and
handling is explained in chapter 8.11.
NHI_EV_SAFETY_INPUT_CHANGED
Each node also has one dedicated safety input. The polarity of this input is set
by NHI_PAR_NODE_SAFETY_POLARITY also using the enumeration
NYCE_ACTIVE_STATE. The NHI_EV_SAFETY_INPUT_CHANGED event occurs when
the safety input changes. The event data uDigIOLevel contains the actual
logical state of the input using the enumeration NYCE_DIGITAL_IO_LEVEL. The
safety input is primarily used for safe service operations explained in the
chapter “Safety Mode Operation” on page 83.
7.10 Analog I/O
This module contains the function:
NhiWriteAnalogOutput
This module only contains a function to write analog outputs. The function is not
supported for the NY4150, because the SERCOSIII Master module does not
support analog I/O, and will return an error.
To get the values of the analog I/Os, the variables NHI_VAR_AN_INy_VALUE_SLOTx
and NHI_VAR_AN_OUTy_VALUE_SLOTx should be read.
Note:
Reading the analog output value results in the last written analog output value.
The reason for this is that the analog outputs are not read back in hardware.
The analog inputs of the NY4120 and NY4140 drive module can be configured to
measure a voltage or a current. The unit of the measurement (voltage or current)
is defined through the function NhiWriteParameter, with the parameter
NHI_PAR_ANINx_ADC_DIMENSION_SLOTy (where x=0,1 and y=0…7) and the
parameter value NHI_VOLTAGE or NHI_CURRENT. See also the NYCe4000 Software
Reference Manual and the NYCe4000 Hardware System Manual.
Following event is available for analog inputs.
NHI_EV_AN_INy_LEVEL_CROSSING_SLOTx
For analog inputs, three states are defined by two voltage levels, as shown in
NYCe4000 Software User Manual
Bosch Rexroth AG
41/158
Node Hardware Interface (NHI)
Fig. 10. Six transitions are possible indicated by the arrows. The minimum and
maximum levels can be defined by the parameters NHI_PAR_ANINy_MIN_SLOTx
and NHI_PAR_ANINy_MAX_SLOTx. The absolute minimum and maximum
voltages depend upon the hardware configuration.
max voltage
POS
POS_TO_AREA
POS_TO_NEG
max level
AREA_TO_POS
AREA
AREA_TO_NEG
min level
NEG
NEG_TO_AREA
NEG_TO_POS
min voltage
Fig. 10 Level crossing at analog I/Os
The event data returned by the event enrolment contains the actual analog input
value and the level crossing transition.
7.11 Latches
This module contains the functions:
NhiDefineLatch
NhiDeleteLatch
NhiGetDefinedLatches
These functions are not supported for the NY4150, because the SERCOSIII
Master module does not support digital inputs, thus no latch functionality, and will
return an error.
Per slot it is possible to define 4 digital inputs as latch. A latch stores an axis
position when the specified transition of a digital input occurs. Digital inputs are
defined in NHI as latches in such a way that they can be used by the I/O functions
for an axis. The axis latch functions can not be defined to an input that is not
configured as a latch input and a latch input can not be deleted when the axis
latch functionality is still defined for it. These errors are detected by the firmware.
See chapters 8.10 and 8.20 for a more detailed explanation of the use of the latch
functionality in SAC.
7.12 Counters
This module contains the functions:
NhiDefineDigitalInputCounter
NhiGetDigitalInputCounter
NhiDeleteDigitalInputCounter
NhiStartDigitalInputCounter
NhiStopDigitalInputCounter
These functions are not supported for the NY4150, because the SERCOSIII
Master module does not support digital inputs, thus no counter functionality, and
will return an error.
42/158
Bosch Rexroth AG
NYCe4000 Software User Manual
Node Hardware Interface (NHI)
Per slot, at most 4 digital inputs can be defined as counting inputs. The inputs
count edges at a signal frequency of at maximum the DSP sample frequency.
The fast inputs can count edges at a frequency of up to 250 kHz.
Note:
This means that edges of faster signals on a digital input can be missed.
An input can be associated with at most one counter otherwise an error is
returned. The definition of a counter is done with the function
NhiDefineDigitalInputCounter. The function returns a counter id and the
counter is initialized with the value 0. Before the same counter id can be used for
another input, the counter id must be released by the function
NhiDeleteDigitalInputCounter, which sets the counter value to -1.
The definition of a counting input can be retrieved with the function
NhiGetDigitalInputCounter.
Counting is started and stopped per counter with the functions
NhiStartDigitalInputCounter and NhiStopDigitalInputCounter. The actual
value of a counter is read with the variable NHI_VAR_DIGIN_COUNTERy_SLOTx.
The counter is implemented as a 32 bit signed integer. After 231-1 counts the
count value jumps to 0 and continues counting.
The counter is reset with NhiStartDigitalInputCounter.
The following event is available for digital input counters.
NHI_EV_DIGIN_COUNTERy_SLOTx
The parameter NHI_PAR_DIGIN_COUNTERy_EV_VALUE_SLOTx defines a criterion
for event detection of a digital input counter. The first DSP sample in which the
counter with id y of slot x is greater than or equal to this parameter, an event is
generated with event id NHI_EV_DIGIN_COUNTERy_SLOTx. No data are
associated with this event.
7.13 Electronic camming
This module contains the functions:
NhiEcgDefineCamMemory
NhiEcgDeleteCamMemory
NhiEcgDownloadCamTable
NhiEcgDownloadCamTableFromFile
The NHI functions for electronic camming define (allocate) and delete (release)
the memory for cam tables in the firmware and enables downloading of a cam
table from a structure defined by the application or from an XML formatted file.
The SAC camming functions are described in chapter 8.13.
The memory available for cam tables in the firmware is fixed in size. The available
size can hold a cam table of cubic splines with 4000 points, where each point is
defined by a masterPos, slavePos and velocityRatio field. As linear splines do
not have the velocityRatio field (in the firmware), the cam table can hold linear
splines with approximately 5000 points. More cam tables will together hold less
than the maximum number of points, because of some additional administration
overhead. Note that the velocityRatio field is always part of the data structure
at the application level, although the field has no meaning for linear splines.
Note:
If a cubic spline cam table is chosen, make sure that the first and the last cam
table points have identical velocityRatio values to assure velocity continuity
and prevent “infinite” acceleration.
NYCe4000 Software User Manual
Bosch Rexroth AG
43/158
Node Hardware Interface (NHI)
The function NhiEcgDefineCamMemory defines and allocates the memory on the
specified node. The number of tables and an array of cam table definitions must
be specified. Each element in the array camTableDefinitions defines the
properties of one cam table.
NhiEcgDefineCamMemory can be called more than once, as long as the total
number of cam tables is smaller than the allowed maximum number of tables
(NYCE_MAX_NR_OF_ECG_CAM_TABLES_PER_NODE), the tableId entry is unique on
the node, and the total memory storage is smaller than the fixed maximum size
reserved for cam tables. If no more memory is available for allocation to a cam
table, the ECG_ERR_MEMORY_OVERFLOW error is returned.
The function NhiEcgDeleteCamMemory deletes all memory definitions of cam
tables on the specified node. The memory definitions can only be deleted when
the cam table(s) are not in use, thus when no axis on the node is camming.
NhiEcgDeleteCamMemory returns the error ECG_ERR_TABLE_IN_USE if the cam
table is in use (SacEcgUnlock function has not yet been called for all axes in the
node).
A cam table structure with cam data, defined by the application, can be
downloaded to the specified node into the table specified by tableId with the
function NhiEcgDownloadCamTable. The memory space for the cam table must
have been allocated with the function NhiEcgDefineCamMemory before the cam
table can be downloaded.
With the function NhiEcgDownloadCamTableFromFile you can download a cam
table defined in an XML formatted file to the specified node into the table
specified by tableId. The table must have been allocated with the function
NhiEcgDefineCamMemory before the XML file can be downloaded into the cam
table memory.
It is possible to reuse a cam table (identified by tableId), when the cam table is
not in use, by simply downloading a new cam table, see Fig. 11.
Fig. 11
Cam tables in the (fixed) cam table memory space
In situation ‘a’, two cam tables are defined with one or two calls of the function
NhiEcgDefineCamMemory. The first cam table is defined with tableId ‘1’ and size
‘size 1a’, the second cam table is defined with tableId ‘2’ and size ‘size 2a’.
Subsequently, a cam table can be downloaded with one of the download
functions, specifying the tableId. The size of the cam table must be equal or
smaller than the size specified by the function call of NhiEcgDefineCamMemory.
In situation ‘b’, a third cam table is defined with tableId ‘3’ and size ‘size 3b’.
This third table is simply added in the cam table reserved memory space.
In situation ‘c’, the second cam table is no longer needed, and may be overwritten
with one of the download functions by specifying tableId ‘2’. The following notes
apply if an existing tableId is reused.
- The existing cam table data in the allocated memory is overwritten.
- If the cam table is in use on the node, the download functions return the error
ECG_ERR_TABLE_IN_USE.
44/158
Bosch Rexroth AG
NYCe4000 Software User Manual
Node Hardware Interface (NHI)
- If the new table is larger than the size previously defined, the download
functions return the error ECG_ERR_MEMORY_OVERFLOW.
Fig. 12 shows an example of an XML formatted file of a cam table. See the
NYCe4000 Software Reference Manual for the definition of the data structures.
Make sure that values which have a decimal fraction contain a decimal point to
separate the integer value from the decimal fraction, see also chapter 2.5.
Fig. 12
Example of a cam table of cubic splines in an XML file
For certain functionality the UTILS subsystem is used. For example, the function
NhiEcgDownloadCamTableFromFile can return the error code
UTILS_ERRR_XML_NODE_NOT_FOUND when no “velocityRatio” is specified for a cubic
spline point in a cam table. Note that in these error codes the word “NODE” does
not refer to a NYCe4000 node, but to an XML component, also called “node”.
7.14 Hardware Properties
This module contains the functions:
NhiGetNrOfDigitalInputs
NhiGetNrOfDigitalOutputs
NhiGetNrOfAnalogInputs
NhiGetNrOfAnalogOutputs
NhiGetNrOfAxisUnits
To be flexible in handling all possible hardware node configurations, the hardware
properties module provides functions to retrieve hardware properties of the
available hardware drives. As the NY4150 SERCOSIII Master module does not
support analog I/O and digital I/O, the functions NhiGetNrOfDigitalInputs,
NhiGetNrOfDigitalOutputs, NhiGetNrOfAnalogInputs and
NhiGetNrOfAnalogOutputs will return the value 0.
NYCe4000 Software User Manual
Bosch Rexroth AG
45/158
Node Hardware Interface (NHI)
7.15 Miscellaneous
This module contains the functions:
NhiGetVersion
NhiGetVersionInfo
NhiGetNodeName
NhiGetNrOfClients
NhiEnableContextLogging
NhiGetContextLogging
NhiSaveContextLoggingToFile
The function NhiGetVersion returns the version of the NHI subsystem, while the
function NhiGetVersionInfo retrieves all information about firmware, hardware,
microware and SERCON gateware versions. If a module does not have any
microware or SERCON gateware, the version fields are 0.
NhiGetNodeName returns the name of a certain node ID.
Since the NYCe4000 host software supports multi client applications the function
NhiGetNrOfClients returns the number of client applications that have a
connection to a certain node. The total number of client applications that can have
a connection to a node is limited to [NYCE_MAX_NR_OF_CLIENTS].
Context switch logging can be enabled and disabled for a specified node with the
function NhiEnableContextLogging. The scheduler in the MCU runs alternating
the firmware “main” program and sequences (if programmed and running). The
sample routine interrupts “main” and sequences (if programmed and running).
The context switch logging information shows what was executed by the MCU
(main, sample, or sequences) and for how much time.
The function NhiGetContextLogging retrieves the collected context switch
logging information of the node, stores this information in a buffer and terminates
the context switch logging.
The function NhiSaveContextLoggingToFile retrieves the collected context
switch logging information of the node, writes this information to a file in CSV
format (a new file is created or the information is appended to an existing file),
and terminates the context switch logging.
7.16 Status and error codes
The following table gives a summary of the status and error codes returned from
a call of a function of the NHI subsystem. Note that the application software might
have called a function of another NYCe4000 subsystem, but that function called a
NHI subsystem function internally.
46/158
Bosch Rexroth AG
NYCe4000 Software User Manual
Node Hardware Interface (NHI)
Table 9 Status and error codes of the NHI subsystem
Status / error code
description
NHI_ERR_INTERNAL_ERROR
NHI internal error
NHI_ERR_INVALID_NODE_ID
Invalid node ID
NHI_ERR_INVALID_SLOT_ID
Invalid slot ID
NHI_ERR_INVALID_BIT_NR
Invalid bit number
NHI_ERR_INVALID_ANALOGIO_NR
Invalid analog I/O number
NHI_ERR_INVALID_AXIS_NR
Invalid axis number
NHI_ERR_INVALID_PARAMETER
Invalid parameter
NHI_ERR_INVALID_OUTPUT_ARGUMENT
Invalid output argument
NHI_ERR_INVALID_DIGOUT_TYPE
Invalid digital output type
NHI_WRN_ALREADY_CONNECTED
Warning, already connected
NHI_ERR_TOO_MANY_CLIENTS
Too many clients
NHI_ERR_TOO_MANY_AXES
Too many axes
NHI_ERR_TOO_MANY_NODES
Too many nodes
NHI_ERR_FILE_OPEN_ERROR
Open specified file failed
NHI_ERR_FILE_READ_ERROR
Read specified file failed
NHI_ERR_FILE_CONTENTS_ERROR
Content of specified file not correct
NHI_ERR_NO_FIRMWARE_LOADED
No firmware loaded in MCU
NHI_ERR_ALREADY_DEFINED
Already defined
NHI_ERR_NOT_DEFINED
Not defined
NHI_ERR_LATCH_ALREADY_DEFINED
Latch already defined
NHI_ERR_INVALID_MCU_UNIT_TYPE
Invalid MCU unit type
NHI_ERR_INVALID_UNIT_TYPE
Invalid unit type
NHI_WRN_PARAMETER_NOT_SPECIFIED
Warning, parameter not specified
NHI_ERR_INVALID_PORT_ID
Invalid port ID
NHI_ERR_INVALID_PORT_TYPE
Invalid port type
NHI_ERR_INVALID_DATA_SIZE
Invalid data size
NHI_ERR_TIMEOUT
Timeout
NHI_ERR_INVALID_ASPI_STATE
Invalid ASPI state
NHI_ERR_NOT_SUPPORTED
Not supported
NHI_ERR_NODE_REMOVED
Node removed
NHI_ERR_NO_DIG_IO
No digital I/O
NHI_OK_NO_TRAILING_TRASH
No trailing trash
NHI_OK_1_BYTE_TRAILING_TRASH
1 byte trailing trash
NHI_OK_2_BYTE_TRAILING_TRASH
2 bytes trailing trash
NHI_OK_3_BYTE_TRAILING_TRASH
3 bytes trailing trash
NHI_ERR_INSUFFICIENT_MEMORY_AVAILABLE
Insufficient memory available
NHI_ERR_ECG_INVALID_XML_ROOT_NAME
Invalid XML root name
NYCe4000 Software User Manual
Bosch Rexroth AG
47/158
Node Hardware Interface (NHI)
NHI_ERR_ECG_INCOMPLETE_TABLE
ECG incomplete table
NHI_ERR_ECG_INVALID_NR_OF_POINTS
ECG invalid number of points
NHI_ERR_ECG_INVALID_CAM_TYPE
ECH invalid cam type
NHI_ERR_ECG_INVALID_NR_OF_TABLES
ECG invalid number of tables
NHI_ERR_ECG_INVALID_CAM_DATA
ECG invalid cam data
NHI_ERR_DUPLICATE_NODENAME
Duplicate file name specified
NHI_ERR_FILE_WRITE_ERROR
Write specified file failed
48/158
Bosch Rexroth AG
NYCe4000 Software User Manual
Single Axis Control (SAC) and Multi Axes Control (MAC)
8 Single Axis Control (SAC) and Multi Axes
Control (MAC)
The main goal of the SAC subsystem is to provide functionality to control and
monitor the axes in a motion system. Usually controlling an axis means
generating a setpoint position and forcing the measured position towards the
setpoint position. The monitoring functionality allows you to keep track of all
parameters, variables and events. This chapter also explains how to approach
groups of axes through the MAC functionality.
8.1
General
The SAC subsystem is divided in several modules. Each module consists of a set
of user functionalities. Each functionality is implemented in one or more functions.
The interface of the SAC library is a multi-client interface. A client is considered
an application that is connected to at least one axis through the SAC library. The
SAC library can control up to 128 [NYCE_MAX_NR_OF_AXES] axes. One client may
control several axes, but this is limited to a maximum of 128 axes. It is possible
that one individual axis is controlled by more than one client, but this is limited to
a maximum of 16 [NYCE_MAX_NR_OF_CLIENTS] clients. At API level the value of all
parameters and variables are expressed in the following basic or derived units:
time in [sec]
controller output in [cout]
frequency in [Hz and rad/s]
position in [pu]
velocity in [pu/s]
2
acceleration in [pu/s ]
3
jerk in [pu/s ]
voltage in [V]
ampere in [A]
increment in [inc]
force in [N]
All basic units speak for themselves, except the units for position and controller
output, which are explained below:
The position unit [pu] stands for the unit the user wants to use to specify the
position of an axis. Normally the user wants to specify the positions in meters,
millimeters, inches or increments for a linear axis and in degrees, radians,
revolutions or increments for a rotary axis. To use this, the position unit used
depends on the measurement system resolution. The resolution parameter
specifies the number of increments of the measurement system per position
[SAC_PAR_RESOLUTION]. This is expressed in the following equation:
positionunit[ pu ] # encoderincrements
1
SAC _ PAR _ RESOLUTION
For example, a rotary axis is equipped with an encoder with 2000 increments per
revolution. Setting the parameter SAC_PAR_RESOLUTION = 2000.0 means that all
position units [pu] are in revolutions. In case SAC_PAR_RESOLUTION = 2000.0/2•
means that all position units are in radians.
The unit [cout] stands for the unit that specifies the controller output. To use this,
a conversion factor must be specified [SAC_PAR_RES_CONTROLLER_OUT]. The factor
scales the controller output to allow thinking in your own preferred units (for
NYCe4000 Software User Manual
Bosch Rexroth AG
49/158
Single Axis Control (SAC) and Multi Axes Control (MAC)
example current, torque, force). This factor indicates the controller out level
necessary to create the maximum output. An example: the NY4120 drive can
deliver up to 20 amperes. If SAC_PAR_RES_CONTROLLER_OUT equals 20, for each
controller out unit [cout] 1 ampere will be generated. Hence, the controller output
unit becomes amperes. Note that for axis configured as “external drive”, the
maximum output is restricted by the maximum output of the analog output.
8.2
Conversion
This module contains the functions:
SacGetEventEnum
SacGetEventString
SacGetParIdEnum
SacGetParIdString
SacGetVarIdEnum
SacGetVarIdString
SacGetStateEnum
SacGetStateString
SacGetSpgStateString
SacGetSpgStateEnum
The functions within this module convert strings to enumeration values and vice
versa.
8.3
Basic axis control handling
This module contains the functions:
SacConnect
SacDisconnect
SacConnect establishes a logical connection between an axis and a calling client
process. The axis identifier, that is returned, is used by the client process for
function calls to that particular axis. If SacConnect is called multiple times from a
client process for one specific axis without calling a SacDisconnect, SacConnect
will return the axis identifier for that specific axis and the return value
SAC_WRN_ALREADY_CONNECTED to notify that the client process already had a
connection to the axis.
On each SAC call with an axis identifier as an argument, the axis identifier is
validated. When the identifier has become invalid, one of the following values is
returned by the function:
NCS_ERR_AXIS_DOES_NOT_EXIST
NHI_ERR_AXIS_REMOVED
If one of these values is returned by a function, all client processes should
disconnect the axis and connect again. These return values are a result of a
configuration change in the network as explained in chapter 6.2.
If a client process does not call a SacDisconnect before a new SacConnect, it just
gets a new valid axis identifier. The client process still has to disconnect the old
invalid axis identifier to free the identifier. If not all client processes disconnect the
invalid axis identifiers, it is possible that SAC returns SAC_ERR_TOO_MANY_AXES on
a SacConnect because all possible axis identifiers have been distributed.
50/158
Bosch Rexroth AG
NYCe4000 Software User Manual
Single Axis Control (SAC) and Multi Axes Control (MAC)
8.4
Parameters
This module contains the functions:
SacGetParameterBounds
SacReadParameter
SacReadParameterSet
SacWriteParameter
SacWriteParameterSet
SacSaveToFlash
SacUpload
SacGetParameterBounds reads the maximum and minimum value of the axis
parameter.
SacReadParameter and SacWriteParameter access single SAC parameters.
SacReadParameterSet and SacWriteParameterSet access SAC parameters
sets. Parameters sets contain several coherent parameters. All available
parameters are enumerated in the enumeration SAC_PARAM_SET_ID. For this
enumeration the following convention holds. All structure names of the
parameters sets are equal to the enumerations without the suffix _ID, for example
the function SacWriteParameterSet expects for the parameterset ID
SAC_CONTROLLER_PID_PARS_ID a pointer to a structure of type
SAC_CONTROLLER_PID_PARS.
The NY4120 and NY4140 drive modules have a specific digital input that can be
configured to function as a disable drive input. This functionality is enabled with
the parameter SAC_PAR_STOP_ALARM_ENABLE. The disable drive functionality is
default disabled. Setting the parameter to 0 disables the disable drive
functionality, setting the parameter to 1 enables the disable drive functionality.
The parameter SAC_PAR_STOP_ALARM_ACTIVE_LEVEL defines the active level.
Setting the parameter to 0 defines the active input level as “low”, and setting the
parameter to 1 defines the active input level as “high”. Default the active level is
set “high”. See also chapter 8.11.
All SAC parameters can be stored into flash on the node. It is also possible to
upload the current SAC parameters to an XML file on the host.
Parameters on IndraDrive
Some SAC parameters have specific value(s) for an IndraDrive.
The parameter SAC_PAR_POSITION_SENSOR_TYPE is set to the fixed value
SAC_NO_POSITION_SENSOR if the parameter is written via the function
SacInitialize or SacConfigureAxis. If the parameter value is changed, the
value is changed to the mentioned fixed value and the warning
SAC_WRN_PARAMETER_VALUE_CHANGED is returned.
The parameter SAC_PAR_INDRA_RESOLUTION can only be set to the following
values: 0.001, 0.0001, 0.00001 or 0.000001. The unit is degree for a rotational
encoder and millimeter for a linear encoder.
Table 10 lists the parameters that are set to a fixed value if the parameter is
written via the function SacInitialize or SacWriteParameterSet. If the
parameter value is changed, the value is changed to the fixed value and the
warning SAC_WRN_PARAMETER_VALUE_CHANGED is returned. You can read the
variable SAC_VAR_ID_OF_PAR_VALUE_CHANGED to determine for which parameter
the warning was given. The parameter value can be written via the function
SacWriteParameter, but the value must be equal to the fixed value, else the error
code listed in the table is returned.
NYCe4000 Software User Manual
Bosch Rexroth AG
51/158
Single Axis Control (SAC) and Multi Axes Control (MAC)
Table 10 SAC parameters with fixed values
SAC parameter
Fixed value
Unit
Error code
SAC_PAR_CC_SAMPLE_TIME
1.250e-4
s
CML_ERR_INVALID_CCL_FREQUENCY
SAC_PAR_PWM_FREQUENCY
4000
Hz
CML_ERR_INVALID_PWM_FREQUENCY
SAC_PAR_PVL_SAMPLE_TIME
5.0e-4
s
CML_ERR_INVALID_PVL_FREQUENCY
Table 11 lists the parameters that are set to a fixed value if the PVL is on the
IndraDrive and the parameter is written via the function SacInitialize or
SacWriteParameterSet. If the parameter value is changed via the function
SacInitialize or SacWriteParameterSet, the value is changed to the fixed
value and the warning SAC_WRN_PARAMETER_VALUE_CHANGED is returned. You can
read the variable SAC_VAR_ID_OF_PAR_VALUE_CHANGED to determine for which
parameter the warning was given. If the parameter value is changed (and the PVL
is on the IndraDrive) via the function SacWriteParameter, the value is not
changed and the error code CTR_ERR_NOT_SUPPORTED is returned.
Table 11 SAC parameters with fixed values (PVL on IndraDrive)
SAC parameter
Fixed value
Unit
SAC_PAR_VELOCITY_ESTIMATION_METHOD
SAC_VEL_EST_DERIVATIVE_SAMPLE
-
SAC_PAR_NR_OF_SAMPLES
1
-
SAC_PAR_THRESHOLD_VELOCITY
-1
pu/s
SAC_PAR_INTEGRATOR_SWITCH_OFF_MODE
SAC_INTEGRATOR_RESET_AND_DISABLE
-
SAC_PAR_MAX_INTEGRATOR_LEVEL
1.0e12
cout
SAC_PAR_LPF_DAMPING
½ 2
-
SAC_PAR_NFx_NUM_FREQ (x = A, B, C)
set to SAC_PAR_NFx_DEN_FREQ
Hz
SAC_PAR_NFx_NUM_DAMP (x = A, B, C)
0
-
SAC_PAR_SCM_ENABLE
FALSE
-
SAC_PAR_SCM_RESET_POS
0
pu
SAC_PAR_SCM_RESET_NEG
0
pu
SAC_PAR_SCM_RESTART_INT_POS
0
cout
SAC_PAR_SCM_RESTART_INT_NEG
0
cout
SAC_PAR_IFC_DEAD_ZONE_GAIN
0
-
SAC_PAR_IFC_DEAD_ZONE_CONTROL_OUT_POS
0
cout
SAC_PAR_IFC_DEAD_ZONE_CONTROL_OUT_NEG
0
cout
SAC_PAR_P_GAIN_AT_STAND_STILL
0
cout/pu
SAC_PAR_P_HALF_WAY_VEL
0
pu/s
SAC_PAR_I_GAIN_AT_STAND_STILL
0
rad/s
SAC_PAR_I_HALF_WAY_VEL
0
pu/s
SAC_PAR_D_GAIN_AT_STAND_STILL
0
couts/pu
SAC_PAR_D_HALF_WAY_VEL
0
pu/s
SAC_PAR_CLEGG_ENABLE
FALSE
-
52/158
Bosch Rexroth AG
NYCe4000 Software User Manual
Single Axis Control (SAC) and Multi Axes Control (MAC)
Table 12 lists the parameters that are set to a fixed value if the parameter is
written via the function SacInitialize or SacWriteParameterSet. If the
parameter value is changed via the function SacInitialize or
SacWriteParameterSet, the value is changed to the fixed value and the warning
SAC_WRN_PARAMETER_VALUE_CHANGED is returned. You can read the variable
SAC_VAR_ID_OF_PAR_VALUE_CHANGED to determine for which parameter the
warning was given. If the parameter value is changed via the function
SacWriteParameter, the value is not changed and the error code
CTR_ERR_NOT_SUPPORTED or EDH_ERROR_NOT_SUPPORTED is returned.
Table 12 SAC parameters with fixed values
SAC parameter
Fixed value
Unit
SAC_PAR_DITHER_FREQUENCY
0
Hz
SAC_PAR_DITHER_HIGH
0
cout
SAC_PAR_DITHER_LOW
0
cout
SAC_PAR_DITHER_DUTY_CYCLE
0
-
SAC_PAR_DITHER_TYPE
SAC_DITHER_BLOCK
-
SAC_PAR_FRF_INPUT_SELECTION
SAC_FRF_INPUT_NONE
-
SAC_PAR_FRF_OUTPUT_SELECTION
SAC_FRF_OUTPUT_NONE
-
SAC_PAR_FRF_VOLT_TO_POSITION
0
pu/V
SAC_PAR_FRF_VOLT_TO_CONTROLLER_OUT
0
cout/V
SAC_PAR_FRF_POSITION_TO_VOLT
0
V/pu
SAC_PAR_FRF_POSITION_TO_CONTROLLER_OUT
0
V/cout
SAC_PAR_ANTI_ALIASING_FILTERS_ENABLE
FALSE
-
SAC_PAR_POS_SERVO_OVER_VOLTAGE_LIMIT
5
V
SAC_PAR_POS_SERVO_UNDER_VOLTAGE_LIMIT
5
V
SAC_PAR_NEG_SERVO_OVER_VOLTAGE_LIMIT
-0
V
SAC_PAR_NEG_SERVO_UNDER_VOLTAGE_LIMIT
-0
V
SAC_PAR_MAX_CURRENT
0
A
SAC_PAR_MAX_I2T_LEVEL
0
As
2
Notes:
1. The parameter SAC_PAR_MAX_AXIS_VEL_NORMAL_MODE is mapped to the
IndraDrive parameter S-0-0091.
2. If the parameter SAC_PAR_MAX_AXIS_VEL_NORMAL_MODE is set to 0, the
behavior for the axis control is different for an axis on an IndraDrive,
compared to an axis on an NY4120, NY4130, NY4140 or NY4170 drive
module. If the parameter SAC_PAR_MAX_AXIS_VEL_NORMAL_MODE is set to 0 for
an axis on an NY4120, NY4130, NY4140 or NY4170 drive module, the
maximum velocity check is disabled, but if the parameter
SAC_PAR_MAX_AXIS_VEL_NORMAL_MODE is set to 0 for an IndraDrive-based
axis, the maximum allowed velocity is set equal to the parameter S-0-0113
(motor speed). Also, if the parameter SAC_PAR_MAX_AXIS_VEL_NORMAL_MODE
for an IndraDrive-based axis is set higher than the value of S-0-0113, the
maximum axis velocity in normal mode is limited to the value of S-0-0113.
NYCe4000 Software User Manual
Bosch Rexroth AG
53/158
Single Axis Control (SAC) and Multi Axes Control (MAC)
8.5
Variables
This module contains the functions:
SacReadVariable
SacAddVariableToTrace
SacDeleteVariableFromTrace
SacAddVariableToSet
SacDeleteVariableFromSet
SacReadState
The function SacReadVariable reads the actual value of a variable of an axis.
The functions SacAddVariableToTrace and SacAddVariableToSet return as
output argument the index on which the variable can be found in the trace or set.
This index should also be used as function argument to delete the variable from a
trace or set with the functions SacDeleteVariableFromTrace and
SacDeleteVariableFromSet. If the function SacAddVariableToTrace or
SacAddVariableToSet returns the error [HNI_ERR_SYSTEM_ERROR], check that the
variable set or trace set does not contain more than 4 nodes, as 4 nodes is the
maximum for a variable set or trace set. Further, a variable set or trace can
contain at maximum [NYCE_TRACE_MAX_VARS_PER_NODE] variables. Variable traces
and sets are explained in more detail in chapters 3.3 and 3.4.
8.6
Variable latch set
A variable latch set is a set of specified axis and node variables of which their
values are latched when a specific event occurs. A limited number of sets are
available per node. A latch set is specified and identified by its latchSetId, which
is an index in the range of 0 … [NYCE_MAX_NR_OF_LATCH_SETS_PER_NODE] -1.
Thus, there can be at maximum [NYCE_MAX_NR_OF_LATCH_SETS_PER_NODE] latch
sets defined in a node.
Each latch set can hold up to [NYCE_MAX_NR_OF_VARIABLES_PER_LATCH_SET]
variables. If you want to latch more variables on the same event, you can define
more latch sets for the same event.
This module contains the functions:
SacAddVarToLatchSet
SacActivateLatchSet
The function SacAddVarToLatchSet adds an axis variable of the specified axis to
a latch set. You can only add variables to the latch set when the latch set is in the
NHI_LATCH_SET_STATE_IDLE state. The function returns an index which indicates
the location in the latch set where the variable is added. With this index you can
retrieve the value of the variable after the specified event latched the variable.
With the function SacActivateLatchSet you can “arm” a latch set. Precondition is
that the specified latch set must be in the state NHI_LATCH_SET_STATE_IDLE. If a
latch set is armed, the values of the specified variables in the latch set are latched
when the specified event occurs.
After the specified event occurred, the latched values can be read by the function
NhiReadLatchSetValues. See chapter 7.6 for a detailed description of all
Variable Latch Set functions.
54/158
Bosch Rexroth AG
NYCe4000 Software User Manual
Single Axis Control (SAC) and Multi Axes Control (MAC)
8.7
Events and Actions
This module contains the functions:
SacDefineEventEnrolment
SacDefineEventAction
SacDeleteEventEnrolment
SacDeleteEventAction
SacDefineStartOnEvent
SacDeleteStartOnEvent
SacDefineStopOnEvent
SacDeleteStopOnEvent
SacSynchronize
These functions are divided in several subsections and are discussed below.
When an event handler has been called, a union structure is transferred with the
event enrolment, if applicable. Table 13 lists the SAC events per group together
with the assigned fields in the union structure.
NYCe4000 Software User Manual
Bosch Rexroth AG
55/158
Single Axis Control (SAC) and Multi Axes Control (MAC)
Table 13 SAC events and returned information in the union structure
SAC event
union field
description
Axis error group
SAC_EV_ERRH_WARNING
uErrorCode
SAC_EV_ERRH_SMOOTH_STOP
Contains the error code (NYCE_ERROR_CODE) of
the error that initiated the error handler.
SAC_EV_ERRH_QUICK_STOP
SAC_EV_ERRH_FULL_STOP
SAC_EV_ERRH_QSTOP_OPEN_LOOP
SAC_EV_ERRH_OPEN_LOOP
SAC_EV_ERRH_DISABLE_DRIVE
SAC_EV_ERRH_POS_CORRUPTED
SAC_EV_ERRH_COMMUNICATION_LOST
State transition group
SAC_EV_IDLE_STATE_EN
n/a
SAC_EV_INACTIVE_STATE_EN
SAC_EV_READY_STATE_EN
SAC_EV_READY_STOPPED_STATE_EN
SAC_EV_MOVING_STATE_EN
SAC_EV_ERROR_STATE_EN
SAC_EV_FREE_STATE_EN
SAC_EV_FREE_STOPPED_STATE_EN
SAC_EV_IDLE_STATE_LE
SAC_EV_INACTIVE_STATE_LE
SAC_EV_READY_STATE_LE
SAC_EV_READY_STOPPED_STATE_LE
SAC_EV_MOVING_STATE_LE
SAC_EV_ERROR_STATE_LE
SAC_EV_FREE_STATE_LE
SAC_EV_FREE_STOPPED_STATE_LE
Miscellaneous group
SAC_EV_HOMING_STARTED
n/a
SAC_EV_HOMING_COMPLETED
uHomeSuccessful
Indicates if the homing procedure was completed
successfully or not (TRUE or FALSE).
SAC_EV_CONTROLLER_READY
n/a
SAC_EV_CONTROLLER_STEADY
n/a
SAC_EV_PROBEx_DETECTED
uEventDouble
Actual axis position at the moment the input is
latched.
SAC_EV_INTERPOLANT_STARTED
uEventUlong
SAC_EV_START_TRIGGER
n/a
SAC_EV_STOP_TRIGGER
n/a
SAC_EV_STOP_ALARM
uEventUlong
SAC_EV_RECOVER_MODE_LE
n/a
Segment ID of the segment that is started.
Actual status of the stop alarm (active=1, inactive=0).
Marker group
SAC_EV_SINGLE_SHOT_MARKER
uEventUlong
Marker ID
uDigIOChangeOfState.ioStatus
Actual status of the I/O mask.
SAC_EV_PERMANENT_MARKER
SAC_EV_REPETITIVE_MARKER
SAC_EV_TIME_MARKER
IndraDrive specific events
SAC_EV_INDRA_DIG_IO_STATE_CHANGE
56/158
Bosch Rexroth AG
NYCe4000 Software User Manual
Single Axis Control (SAC) and Multi Axes Control (MAC)
uDigIOChangeOfState.ioMask
Mask indicating which I/O’s changed with respect to
the previous sample.
SAC_EV_INDRA_AN_IN0_LEVEL_CROSSING
uAnInLevelCrossing.anInValue
Measured analog input value.
uAnInLevelCrossing.trans
NO_TRANS, NEG_TO_AREA, AREA_TO_NEG,
POS_TO_AREA, AREA_TO_POS, NEG_TO_POS,
POS_TO_NEG
n/a : no fields assigned
Event Enrolments
Defining and deleting event enrolments is discussed in chapter 2.4. All available
events in SAC are discussed within the appropriate module chapters.
Event Actions
SacDefineEventAction defines how the occurrence of an event generated for an
axis will subsequently be handled by the axis controller on the node. When the
event occurs, the defined action is executed automatically without interference of
any client process on the host. SacDeleteEventAction deletes an action from an
event for an axis. All available event actions are defined with the enumeration
SAC_EVENT_ACTION. On execution of such an event action the accompanying
parameters are used. For example, when the event action SAC_AC_QUICK_STOP is
executed, the quick stop parameter SAC_PAR_QUICKSTOP_ACC will be used.
Start on Event
The start-on-event functionality starts a pending motion command on the
occurrence of an event. The event can be any sensible SAC event. The function
SacDefineStartOnEvent defines an event for this functionality. If one or more
events are defined, each motion command given after this call is started on the
occurrence of a defined event. Only one motion can be waiting on an event at a
time. If an event occurs while no motion command is pending, the event is
ignored. A motion command given while the axis is moving is queued and will be
executed only when the event occurs. This functionality stays active until all
defined events are deleted with function SacDeleteStartOnEvent. When the last
event is deleted the pending movement is cancelled.
Stop on Event
The stop-on-event functionality terminates the current motion command by
stopping the axis with a specified maximum acceleration and jerk on the
occurrence of an event. The maximum acceleration and jerk are specified by the
parameters SAC_PAR_TRIGGERED_STOP_ACC and SAC_PAR_TRIGGERED_STOP_JERK.
The event can be any sensible SAC event. The function SacDefineStopOnEvent
defines an event for this functionality. After this call each motion command is
terminated on the occurrence of a defined event. If a defined event occurs when
no motion command is executed the event is ignored. This functionality stays
active until all defined events are deleted with the function
SacDeleteStopOnEvent.
Synchronize
When you call a SAC function, it depends on the function whether the execution
of the requested operation is started and the function returns immediately to the
NYCe4000 Software User Manual
Bosch Rexroth AG
57/158
Single Axis Control (SAC) and Multi Axes Control (MAC)
caller, or that the requested operation will be completely performed before the
function returns to the caller. A function that starts the operation and immediately
returns to the caller (while the requested operation continues) is called an
asynchronous function. A function that returns to the caller after all operations are
completed is called a synchronous function.
All SAC functions validate the parameters passed to the function. If an invalid
parameter is detected, the function returns immediately with an error code. If the
parameters are valid, the asynchronous functions return immediately with a status
and more data depending on the called SAC function, and synchronous functions
will return with a status and more data depending on the called SAC function
when all operations are completed.
The function SacSynchronize enables the application to wait or poll for the
completion of a requested action of an asynchronous function, for example the
completion of a point to point movement, see Fig. 13.
The SacSynchronize function returns to the application in the following cases:
when the requested synchronize action has been completed,
when the specified time out time has expired,
when a state error occurred, because the request cannot be completed in the
current state of the axis.
Fig. 13
SacSynchronize used following an asynchronous SAC function
One parameter of the function SacSynchronize specifies for which action the
application wants to synchronize. It depends on the specified action whether
SacSynchronize blocks and waits until the requested synchronization action has
been completed or until a specified timeout expires. A timeout of 0.0s can be
specified to poll the status of a request since the function will return a timeout
error when the request is not yet executed. However, for backward compatibility,
SacSynchronize returns immediately with a status for the following synchronize
action requests.
-
SAC_REQ_INITIALIZE
SAC_REQ_ENABLE_POWER
SAC_REQ_LOCK
SAC_REQ_OPEN_LOOP
SAC_REQ_ENABLE_MOTION
SAC_REQ_RESET
SAC_REQ_SHUTDOWN
The available synchronize requests are defined with the enumeration
SAC_SYNC_REQUEST. The behavior of SacSynchronize for each defined
SAC_SYNC_REQUEST value is described below.
SAC_REQ_INITIALIZE
returns immediately with one of the following return status values:
- NYCE_OK when the axis is in the INACTIVE state
- EVH_ERR_STATE_ERROR when the axis is in any other state
SAC_REQ_ENABLE_POWER
returns immediately with one of the following return status values:
- NYCE_OK when the axis is in the FREE state
58/158
Bosch Rexroth AG
NYCe4000 Software User Manual
Single Axis Control (SAC) and Multi Axes Control (MAC)
- EVH_ERR_STATE_ERROR when the axis is in any other state
SAC_REQ_ALIGN_MOTOR
blocks and waits until align motor action completed, possible status return
values:
- NYCE_OK when the wake and shake state is equal to
SAC_MOVE_CURRENT_ANGLE_STATE_IDLE and SAC_VAR_BLAC_ALIGNED is true
- EVH_ERR_BLAC_NOT_ALIGNED when the wake and shake state is equal to
SAC_MOVE_CURRENT_ANGLE_STATE_RAMPING,
SAC_MOVE_CURRENT_ANGLE_STATE_MOVING,
SAC_MOVE_CURRENT_ANGLE_STATE_HOLDING or SAC_VAR_BLAC_ALIGNED is
false
- if none of the above conditions apply: wait
SAC_REQ_LOCK
returns immediately with one of the following return status values:
- NYCE_OK when the axis is in the READY or READY_STOPPED state
- EVH_ERR_STATE_ERROR when the axis is in any other state
SAC_REQ_MOTION_STARTED
blocks and waits until motion started action completed, possible status return
values:
- NYCE_OK when the axis is in the MOVING state
- EVH_ERR_STATE_ERROR when the axis is in the READY state with no pending
motion and SAC_VAR_HOME_STATUS is equal to “home not busy”
SAC_REQ_MOTION_STOPPED
blocks and waits until motion stopped action completed, possible status return
values:
- NYCE_OK when the axis is in the READY_STOPPED or FREE_STOPPED state. Or
when the axis is in the READY state with no pending motion and
SAC_VAR_HOME_STATUS is equal to “home not busy”
- EVH_ERR_STATE_ERROR when the axis is in the IDLE, ERROR or INACTIVE state
- if the axis is in the FREE or MOVING state: wait
SAC_REQ_HOMING_COMPLETED
blocks and waits until homed action completed. Note: this is no indication
whether homing failed or succeeded. Poll the variable SAC_VAR_HOMED to check
this condition. Status return value:
- NYCE_OK when no homing mode is active (anymore)
SAC_REQ_OPEN_LOOP
returns immediately with one of the following return status values:
- NYCE_OK when the axis is in the FREE or FREE_STOPPED state
- EVH_ERR_STATE_ERROR when the axis is in any other state
SAC_REQ_ENABLE_MOTION
returns immediately with one of the following return status values:
- NYCE_OK when the axis is in the READY or FREE state
- EVH_ERR_STATE_ERROR when the axis is in any other state
SAC_REQ_RESET
returns immediately with one of the following return status values:
- NYCE_OK when the axis is in the INACTIVE state
- EVH_ERR_STATE_ERROR when the axis is in any other state
SAC_REQ_SHUTDOWN
returns immediately with one of the following return status values:
- NYCE_OK when the axis is in the IDLE state
- EVH_ERR_STATE_ERROR when the axis is in any other state
NYCe4000 Software User Manual
Bosch Rexroth AG
59/158
Single Axis Control (SAC) and Multi Axes Control (MAC)
SAC_REQ_AXIS_SETTLED
blocks and waits until settling ready action completed. You can use this
synchronize request to wait until an axis is settled after a SacLock or SacHold.
Note: the behavior of SacSynchronize with this parameter is different on the
host and the node (in SEQ). Status return value:
- NYCE_OK when the controller state is STABILIZING or STEADY with no pending
motion and SAC_VAR_HOME_STATUS is equal to “home not busy”
SAC_REQ_AXIS_STEADY
blocks and waits until steady state is reached. If a feed override is active for the
axis, the time out value, if specified, is effectively divided by the feed override
value. Thus, if the feed override value is 0.5, the time out value is doubled.
Possible status return values:
- NYCE_OK when controller state is STEADY with no pending motion and
SAC_VAR_HOME_STATUS is equal to “home not busy”
SAC_REQ_MOVE_CURRENT_ANGLE
blocks and waits until move current angle ready action completed, possible
status return values:
- NYCE_OK when the wake and shake state is equal to
SAC_MOVE_CURRENT_ANGLE_STATE_IDLE
- EVH_ERR_STATE_ERROR when the wake and shake state is equal to
SAC_MOVE_CURRENT_ANGLE_STATE_DETECT or
SAC_MOVE_CURRENT_ANGLE_STATE_FIND_ZERO or
SAC_MOVE_CURRENT_ANGLE_STATE_SWITCHING
- if none of the above conditions apply: wait
Other possible SacSynchronize return codes are the following.
EVH_ERR_REQUEST_TIMEOUT
When the time out in the firmware has expired.
EVH_ERR_INVALID_PARAMETER or SAC_ERR_INVALID_PARAMETER
When an invalid request identifier or invalid time out time is specified.
SAC_ERR_AXIS_NOT_RESPONDING
When the time out on the host software has expired, for example when the
node communication failed.
SAC_WRN_COMPLETED_ON_OTHER_PROCESS
When SacSynchronize has returned on another process. This only applies
when a second SacSynchronize is performed from another process on the
same synchronization request (working in a multi-threaded application).
SAC_ERR_TIMEOUT_ON_OTHER_PROCESS
When SacSynchronize has detected a firmware time out on another process.
This only applies when a second SacSynchronize is performed from another
process on the same synchronization request (working in a multi-threaded
application).
The synchronization mechanism is intended for synchronization of the client
process with a single axis. It can, however, be used to do some synchronization
between multiple axes. Example:
Consider the case that multiple axes are moved by multiple calls with the function
SacPointToPoint. Then for each axis, SacSynchronize is called with a motion
stop request. When all SacSynchronize calls have returned with no error, all point
to point movements have stopped.
If several client processes synchronize on the same axis the SacSynchronize of
the first client process returns with NYCE_OK or a timeout error, the
SacSynchronize on the second process will also end, with the following warning
or error: SAC_WRN_COMPLETED_ON_OTHER_PROCESS or
SAC_ERR_TIMEOUT_ON_OTHER_PROCESS. The timeout of the second process is
ignored. When the other processes end earlier than the first process, SAC will
return SAC_ERR_AXIS_NOT_RESPONDING.
60/158
Bosch Rexroth AG
NYCe4000 Software User Manual
Single Axis Control (SAC) and Multi Axes Control (MAC)
8.8
Configuration
This module contains the functions:
SacConfigureAxis
SacGetAxisConfiguration
SacCheckAxisConfiguration
SacEnableEncoderPower
SacCalibrateCurrentOffsets
SacAlignMotor
SacMoveCurrentAngle
For every axis, the axis type, the position sensor interface and motor interface
must be configured. The function SacConfigureAxis is used to define the axis
type, axis unit on a specific drive, position sensor interface and motor interface
with the associated parameters.
The NY4120, NY4130 and NY4170 drive modules support 2 axes. If one axis is
defined with a digital encoder (MSM or EnDat2.2, see below), make sure that this
axis is not moving when the other axis is defined.
The NY4150 supports up to 8 IndraDrives. Each IndraDrive supports one axis.
The IndraDrive axis is connected when the function SacConfigureAxis is called.
The function SacGetAxisConfiguration is used to get the defined configuration
of an axis.
The axis is of one of the following types:
Virtual: no motor output and no position sensor interface.
Sensor: no motor output, position sensor interface only.
Open loop: motor output only, no position sensor interface.
Stepper: stepper motor, no position sensor interface.
Sensing stepper: stepper motor with position sensor interface. The position
sensor data is not used in the control algorithm. The position sensor is only
used to read the actual stepper position and can be used for homing of a
stepper axis. The resolution of the sensor must be higher or equal to half of a
micro step.
Servo: motor output and position sensor interface.
IndraBLAC: BLAC motor connected to an IndraDrive.
The following motor interfaces can be selected:
External drive: using an analog output. No extra parameters must be supplied.
Stepper motor: using 2 H-bridges. The number of micro steps per full step
must be specified.
DC motor: using 1 H-bridge.
Brushless DC motor: using 1½ H-bridges and three Hall sensor inputs for
commutation. The Hall sensor mapping must be supplied.
Brushless AC motor: using 1½ H-bridges and a position sensor for
commutation. The number of pole pairs, the number of increments per total
number of pole pairs and alignment parameters must be specified.
Brushless AC motor on an IndraDrive.
Note:
For all motor types, except for the external drive, the current control parameters
and PWM parameters must be specified.
NYCe4000 supports the following position sensor interfaces:
NYCe4000 Software User Manual
Bosch Rexroth AG
61/158
Single Axis Control (SAC) and Multi Axes Control (MAC)
Analog input.
S00/S90 with index encoder.
S00/S90 without index encoder.
Rexroth MSM incremental encoder.
Rexroth MSM absolute encoder.
SinCos encoder.
EnDat2.1 encoder.
EnDat2.2 encoder.
Hiperface encoder.
Note:
The sensor type for an IndraDrive is set to SAC_NO_POSITION_SENSOR.
The function SacCheckAxisConfiguration checks the configuration consistency.
The check verifies that a correct motor interface and position sensor interface are
defined for a specific axis type. The following configuration details are checked.
- The specified drive slot number is valid.
- The defined axis is supported by the drive module.
- The defined axis number is possible on the drive module (for example, the
NY4140 supports only one axis).
- The specified motor type is supported by the drive module.
- The specified motor type is supported by the axis (for example, a stepper
motor on a servo axis is not possible).
- The specified encoder is supported by the axis.
- The current control loop and PWM frequency has a valid setting (for NY4120
and NY4140).
- The PVL frequency is possible (restrictions on axis/encoder combinations).
With the function SacEnableEncoderPower the power supply for the encoder(s)
can be turned on and off. The function turns on/off the power supply for the
encoder(s) per slot for the NY4120 (thus both axes) and the NY4140. The
function turns on/off the power supply for the encoders per specified axis on the
NY4130 and NY4170. The function SacEnableEncoderPower is not supported for
an axis connected to an IndraDrive, the error SAC_ERR_INVALID_AXIS_TYPE is
returned. Note that the generated error, if the power is disabled, depends on the
type of encoder. See for hardware related details the NYCe4000 Hardware
System Manual.
The current calibration is performed by the functions SacLock, SacEnablePower
and SacAlignMotor, but also available to the user through the function
SacCalibrateCurrentOffsets to perform a recalibration. The first time an axis
goes to the “power enabled” state after shut down, the current flow through the H
bridges on the NY4120 and NY4140 drive modules is measured, while the H
bridges are in the open state. The actual current flow is of course zero, but the
measurement returns a small value, due to offsets in the hardware. The software
automatically compensates these offsets. The user can call the function
SacCalibrateCurrentOffsets to start this measurement in the application for
the specified axis, but is not necessary (in fact it will be a recalibration). The
specified axis must be in the SAC_INACTIVE state (when the controller is in “power
disabled”) else the error CML_ERR_STATE_ERROR is returned. It is mandatory that
the drive power is switched on and stable, because this power supply is needed
for the ADC’s used for the measurement. The function execution time is 32 ms.
The function SacAlignMotor is used to perform a magnetic alignment procedure
for a brushless AC motor. The following alignment procedures are available for
BLAC motors connected to an NY4120 or NY4140 drive module:
62/158
Bosch Rexroth AG
NYCe4000 Software User Manual
Single Axis Control (SAC) and Multi Axes Control (MAC)
Kick & Swing: alignment procedure with large possible displacement.
Wake & Shake: alignment with controllable maximum displacement.
Set commutation offset: alignment procedure for absolute position
measurement systems.
On encoder position: used for Rexroth MSM motors with a Rexroth MSM
absolute encoder.
Catch & Move: alignment method for axes against an endstop or non horizontal
axes.
If one of the alignment procedures for BLAC motors connected to an NY4120 or
NY4140 is executed on a BLAC motor connected to an IndraDrive, the error
CTR_ERR_INVALID_AXIS_TYPE is returned.
The following alignment procedures are available for BLAC motors connected to
an IndraDrive via the NY4150 SERCOSIII Master module. Note that for motors
with an integrated motor encoder it is not necessary to set the commutation
offset.
Saturation: a current is applied which saturates the iron material of the motor.
During the alignment procedure motor stand still is necessary.
Sine wave: a sinusoidal test signal is applied, and the controller in the
IndraDrive determines the commutation offset. For this method the axis must be
able to move easily and freely, in fact, unrestricted movement of the axis is
required (which generally causes problems).
The alignment procedure is defined through the parameter SAC_ALIGN_MODE. See
the NYCe4000 Tools Manual for a more detailed description of the different motor
and sensor related parameters and how they should be configured.
The function SacMoveCurrentAngle lets a brushless AC motor make a movement
by ramping up the quiescent current to a maximum value, and then rotating the
angle at which this current is applied. This function is not supported for an axis
connected to an IndraDrive and returns the error SAC_ERR_INVALID_MOTOR_TYPE.
8.9
State Transitions
This module contains the functions:
SacInitialize
SacLock
SacOpenLoop
SacEnableMotion
SacEnablePower
SacReset
SacShutdown
SacRelease
SacHold
SacDecouplePiezoStack
SacCouplePiezoStack
The function SacInitialize initializes an axis from flash or with the parameter
values within the XML file created with SacUpload. To initialize an axis from flash,
use the SAC_USE_FLASH define as input argument when calling SacInitialize.
If, for some reason, not all parameters are defined in the XML file, SacInitialize
returns with the warning [SAC_WRN_PARAMETER_NOT_SPECIFIED] and uses the
current values for the missing parameters.
An error code returned by SacInitialize can be related to a specific parameter
identifier. In that condition the error code returned by SacInitialize is
[XXX_ERR_INVALID_PARAMETER] (where XXX is de subsystem identifier), and only
in that case the variable [SAC_VAR_ID_OF_INVALID_PAR] contains the failing
NYCe4000 Software User Manual
Bosch Rexroth AG
63/158
Single Axis Control (SAC) and Multi Axes Control (MAC)
parameter. Note that the error code returned by SacInitialize can also indicate
a problem which is not related to a parameter. For example, in case of an invalid
voltage combination [EDH_ERR_INVALID_VOLTAGE_COMBINATION] is returned.
When SacInitialize is called to initialize an axis on an IndraDrive, a connection
is made with the IndraDrive and the IndraDrive is set in PM (Parameter Mode).
The SAC parameters that have a mapping to SERCOS parameters are written to
the IndraDrive. Then the IndraDrive switches to Ab mode.
If during SacInitialize a SAC parameter is initialized which has a fixed value,
the value is set to the fixed value and the SAC_WRN_PARAMETER_VALUE_CHANGED
warning is returned. In that case you can read the variable
SAC_VAR_ID_OF_PAR_VALUE_CHANGED to determine for which parameter the
warning was given.
With the function SacLock the firmware in the MCU synchronizes the axis position
and the setpoint position during the lock task.
During the lock operation the axis settling mechanism is started. See the
NYCe4000 Tools Manual for a detailed description of the axis controller settling
criteria. The settling criteria for the lock of an axis used by the settling mechanism
are identical to the settling criteria used during positioning.
Note:
When SacLock is called and the axis uses an MSM encoder, a mismatch between
setpoint, actual position and calculated position error may exist after the lock. The
value of the mismatch depends on the PVL frequency and the actual axis speed.
Even at stand-still a difference of one increment is possible. This behavior does
not change the functionality of the axis. See the NYCe4000 Hardware System
Manual for detailed information about the timing of the drive modules for the
encoder types.
The function SacShutdown shuts down the specified axis, and all warnings and
errors for the axis are cleared. After SacShutdown, the axis has the same
properties as a ‘fresh’ declared axis (the default settings). Only the defined event
enrolments for the specified axis are not removed when SacShutdown is called.
The “ext drive enable” output (if configured) is set to inactive.
Attention!
You can call the function SacShutdown in every state of an axis. This means that
even in the axis state SAC_MOVING, you can call SacShutdown. Make sure that this
can never occur! Remember that any functionality that has a relation with the axis
that is shut down is also affected, for example gearing, commutation correction,
UDSX and sequences.
When SacShutdown is called, the following actions are executed on the host.
All ECG slave axes are unlocked and unlinked if the master axis is shut down.
An ECG slave axis is unlocked and unlinked if the slave axis is shut down.
The shutdown task is sent from the host to the MCU.
The axis is removed from the error groups administration.
The axis is removed from the synchronization groups administration.
All SAC parameters of the axis are retrieved from the MCU.
In the MCU the following actions are executed.
Processing of the state transition.
At least a delay of one sample is awaited. The delay is needed to execute event
actions required for example to change an output on SAC_EV_IDLE_STATE_EN.
Remove active monitor output(s).
Remove LATCH information.
Remove configuration information.
Remove the specified axis from the synchronization groups.
Set the default settings for the axis. The axis is changed into NO_AXIS with
default parameter values, no function I/O is defined, no error group membership
is defined, and the default events and error handlers are specified.
64/158
Bosch Rexroth AG
NYCe4000 Software User Manual
Single Axis Control (SAC) and Multi Axes Control (MAC)
The function SacShutdown clears all errors on the IndraDrive(s), the IndraDrive(s)
switch to PM (Parameter Mode), and the axes are disconnected from the
IndraDrive(s).
The NYCe4000 system supports piezo (stack-based) motors through the NY4170
High Voltage Piezo Drive module (see the NYCe4000 Hardware System Manual).
If the axis is a piezo motor, the following precondition must be satisfied before the
function SacLock or SacEnablePower can be executed. The voltage of the piezo
stack and the amplifier output must both be lower than 5V. If the voltage is higher
than 5V, the error CML_ERR_PIEZO_STACK_VOLTAGE_TOO_HIGH or
CML_ERR_PIEZO_AMPLIFIER_OUTPUT_VOLTAGE_TOO_HIGH is returned.
If the axis is a piezo motor, it is not allowed to use the function SacLock in the
state SAC_FREE or SAC_FREE_STOPPED, use the function SacHold instead.
Likewise, it is not allowed to use the function SacOpenLoop in the state SAC_READY
or SAC_READY_STOPPED, use the function SacRelease instead.
The functions SacHold and SacRelease are not allowed for a BLAC motor on an
IndraDrive, and return the error code STD_ERR_INVALID_AXIS_TYPE. Use the
functions SacLock and SacOpenLoop instead.
With the function SacDecouplePiezoStack (only allowed in the axis state
SAC_FREE and SAC_FREE_STOPPED) the piezo stack can be disconnected from the
output of the amplifier. This allows the measurement of the degradation of the
piezo stack, as stacked piezo motors suffer from degradation during their life time.
A possible measurement method (implemented in the user application) will do the
following steps. First, set the axis to the open loop state, then apply a voltage for
a defined amount of time on the piezo stack with an open loop value and open
loop ramp. After that time the piezo stack is disconnected from the output of the
amplifier with the function SacDecouplePiezoStack and the application measures
the voltage on the piezo stack by reading the variable
SAC_VAR_PIEZO_STACK_VOLTAGE. During the voltage measurement, the controller
output is set to the measured voltage to get an accurate measured value (open
loop values set by the user are ignored when the piezo stack is disconnected).
The measured voltage is related to the internal resistance of the piezo motor and
gives an indication of the aging of the piezo motor.
The function SacCouplePiezoStack stops the voltage measurement. The actual
piezo stack voltage is set to the controller output and the output of the amplifier is
reconnected to the piezo motor. After the function SacCouplePiezoStack is
executed, a new open loop value with open loop ramp can be set, or the axis can
be locked.
The functions SacDecouplePiezoStack and SacCouplePiezoStack are only
supported if the drive is an NY4170, and the motor type is SAC_PIEZO_STACK.
The axis controller is highly state dependent. This means that the behavior of the
axis is influenced by what has happened previously with the axis. The state
dependent aspects are defined in a state transition diagram.
A state transition diagram is a conceptual machine with a given number of states.
The axis can only be in one state at a time. State transitions occur in response to
commands or events. In theory, state transitions take no time. In reality this may
not be possible because a state transition may involve particular actions. The
state transition diagram also determines which commands are accepted in the
different states.
Fig. 14 shows the state transition diagram used by SAC for an axis. The colored
boxes show the defined states. The small numbered blocks within the axis state
boxes specify which axis type supports that particular state. The defined axis
types are listed in Table 14.
NYCe4000 Software User Manual
Bosch Rexroth AG
65/158
Single Axis Control (SAC) and Multi Axes Control (MAC)
cold start
from any state
1
7
SAC_IDLE
7
5
4
3
2
1
from any state
except SAC_IDLE
0
2
from any state
except SAC_IDLE
3
4
6
SAC_INACTIVE
5
SAC_ERROR
6
7
5
4
3
2
1
0
7
5
4
3
2
1
0
5
power disabled
3
SAC_FREE
14
4
SAC_FREE_STOPPED
19
15
7
5
4
3
2
0
7
5
4
3
8
open loop
2
0
from any
closed loop
state
17
7
16
1
SAC_READY
12
SAC_READY_STOPPED
2
13
7
5
4
3
0
7
5
4
3
0
9
10
18
SAC_MOVING
7
5
closed loop
4
3
0
11
0
1
axis type
1
state enumeration value
1
state transition number
Fig. 14 Axis State Transition Diagram
3. Note applicable only to piezo motor axes.
- For state transitions 8 and 17, only the function SacHold is allowed.
- For state transitions 7 and 16, only the function SacRelease is allowed.
4. Note applicable only to IndraDrive axes.
- For state transitions 8 and 17, only the function SacLock is allowed.
- For state transitions 7 and 16, only the function SacOpenLoop is allowed.
66/158
Bosch Rexroth AG
NYCe4000 Software User Manual
Single Axis Control (SAC) and Multi Axes Control (MAC)
Table 14 State diagram axis types
Nr.
Axis type
0
Virtual axis
1
Sensor axis
2
Open loop axis
3
Stepper axis
4
Sensing stepper axis
5
Servo axis
7
IndraDrive axis
The state of the axis connected to an IndraDrive is also shown on the display on
the IndraDrive. Table 15 shows the relation between the NYCe4000 axis states
and the IndraDrive axis states.
Table 15 NYCe4000 axis state and IndraDrive axis state relation
NYCe4000 axis state
IndraDrive axis state, display indication,
and option
-
P-1, P0, P1, P2, P3
(SERCOS communication phases)
SAC_IDLE
PM
SAC_INACTIVE
Ab (normal condition)
bb (normal condition, but drive voltage
switched off)
SAC_FREE, SAC_FREE_STOPPED
AF, torque mode
SAC_READY, SAC_READY_STOPPED
- PVL on IndraDrive
- PVL on MCU
AF, position mode
AF, torque mode
SAC_MOVING
- PVL on IndraDrive
- PVL on MCU
AF, position mode
AF, torque mode
SAC_ERROR
Ab, Fxxxx (error), Exxxx (warning)
The text in the display of the IndraDrive is an abbreviation. PM stands for
Parameter Mode, Ab means „drive ready“ (in German “Antrieb bereit”) and bb
means „ready for operation” (in German “betriebsbereit”). AF means „drive
enable“ (in German “Antrieb Freigabe”).
Table 16 gives an overview of the commands and events that initiate the
transitions.
NYCe4000 Software User Manual
Bosch Rexroth AG
67/158
Single Axis Control (SAC) and Multi Axes Control (MAC)
Table 16 State transition, commands and events
State transition
Command / Event
1
SacShutdown accepted
2
SacInitialize accepted
3
SacReset accepted
4
Event: Fatal error detected at firmware level
5
SacEnablePower accepted
6, 8 and 17
SacLock accepted
8
SacHold accepted
7 and 16
SacOpenLoop accepted
7
SacRelease accepted
9
One of the SAC motion functions accepted
10
Event: setpoint generator ready
11, 12 and 14
SacQuickStop, SacSmoothStop or SacFullStop accepted and completed.
Event: Non-fatal error detected at firmware level
13 and 15
SacEnableMotion accepted
18
SacHome accepted and completed according to find-end-of-stroke mode
19
Event: Non-fatal error with open loop as end state forced by error handler
Errors cleared during state transitions
In the IDLE state, no errors are detected. The transition from IDLE to INACTIVE by
SacInitialize (the only possible transition from the IDLE state) will not reset any
errors.
In the INACTIVE state, errors are detected, but only the handlers “disable drive”
and more severe handlers result in a state transition (to the ERROR state). So, at
“reset” and at state transitions from INACTIVE (to FREE using SacEnablePower, to
READY using SacLock and to IDLE using SacShutdown), errors are cleared. Only
errors with handler “open loop” or less severe handlers can be present.
In the FREE and READY state there are no errors. Only the warnings are cleared at
the transitions to the IDLE state and INACTIVE state.
The same applies to the MOVING state, except when the setpoint generator is in a
STOPPING state (smooth, quick or full stop). So, when leaving the MOVING state
and the spgState is XXX_STOPPING, errors are cleared only at reset (to INACTIVE)
and shutdown (to IDLE). Only errors with handler “quick stop + open loop” and
less severe handlers can be present. At other transitions from MOVING (to READY or
READY_STOPPED) no errors are cleared.
In the READY_STOPPED state, errors with handler full stop or less severe handlers
are cleared at state transitions enable motion (to READY state), reset (to INACTIVE
state) and shutdown (to IDLE state). At the “open loop” transition to FREE_STOPPED
no errors or warnings need to be cleared.
In the FREE_STOPPED state, errors with handler “open loop” or less severe
handlers are cleared at state transitions enable motion (to FREE state), reset (to
INACTIVE state) and shutdown (to IDLE state) and lock (to READY_STOPPED).
Finally, from the ERROR state only reset to INACTIVE and shutdown to IDLE are
possible. At shutdown all errors are cleared, at reset almost all errors except the
communication lost errors (with the IndraDrive).
Table 17 shows the transitions between each pair of states. A dark table field
indicates that the transition is not possible or not relevant. The latter applies to
68/158
Bosch Rexroth AG
NYCe4000 Software User Manual
Single Axis Control (SAC) and Multi Axes Control (MAC)
transitions from a state into itself. Only a reset or initialize in the INACTIVE state is
significant, as this “transition” clears errors.
The white table fields show the name of the state transition and the error handler.
Errors are cleared if the severity of the last error handler executed is as indicated
or less severe. The grey fields show the transitions where no “clear error” is done.
Table 17 State transitions and errors cleared in the transitions
to :
IDLE
INACTIVE
FREE
READY
MOVING
READY_STOPPED
FREE_STOPPED
ERROR
from :
initialize:
IDLE
none
INACTIVE
FREE
shutdown:
reset or
enable
lock:
error #3:
open_loop
initialize:
power:
open_loop
none
open_loop
open_loop
shutdown:
reset:
lock or
error #1:
error #3:
warning
warning
hold:
none
none
none
READY
shutdown:
reset:
open loop
Move start:
stop:
error #2:
error #3:
warning
warning
or release:
none
none
none
none
none
MOVING
READY_STOPPED
FREE_STOPPED
shutdown:
reset:
at eos:
move
event #1:
event #2:
error #3:
quick_stop_
quick_stop_
none
ready:
none
none
none
open_loop
open_loop
none
shutdown:
reset:
enable
open loop or
error #3:
full_stop
full_stop
motion:
error #2:
none
full_stop
none
shutdown:
reset:
enable
lock:
error #3:
open_loop
open_loop
motion:
open_loop
none
open_loop
ERROR
shutdown:
reset:
comm._lost
pos_corrupt
The errors and events are defined as follows:
error #1
error #2
error #3
event #1
event #2
-
error with handler open loop or less severe
error with handler quick stop and open loop, or open loop
error with handler disable drive or more severe
stop ready and no open loop required after stop
(stop ready and open loop required after stop) or
error with handler open loop
NYCe4000 Software User Manual
Bosch Rexroth AG
69/158
Single Axis Control (SAC) and Multi Axes Control (MAC)
Each axis state listed in Fig. 14 indicates the status of several logical and physical
properties of the axis controller. Table 18 gives an overview of these properties.
Table 18 Logical and physical properties of the axis controller
Nr.
Axis state
Axis
Drive
Control
Setpoint
initialized
state
loop
generator
Brake
Error
0
SAC_MOVING
yes
enabled
closed
active
released
none
1
SAC_READY
yes
enabled
closed
idle
released
none
2
SAC_READY_STOPPED
yes
enabled
closed
disabled
released
non-fatal
3
SAC_FREE
yes
enabled
open
disabled
released
none
4
SAC_FREE_STOPPED
yes
enabled
open
disabled
released
non-fatal
5
SAC_ERROR
yes
disabled
disabled
disabled
applied
fatal
6
SAC_INACTIVE
yes
disabled
disabled
disabled
applied
none
7
SAC_IDLE
no
disabled
disabled
disabled
applied
none
The properties of the axis controller are explained below:
Axis initialized
No:
Yes:
The axis is not initialized.
The axis is initialized.
Drive state
Enabled:
Disabled:
A connection with the drive is established.
A connection with the drive is not established. The motor
windings are short-circuited to ground via the H-bridges of the
drive module for safety reasons.
Control loop
Disabled:
Open:
Closed:
The controller output is always 0.
The controller output is determined by a user defined value.
The controller output is determined on the basis of feed back
and feed forward values.
Setpoint generator
Disabled:
Idle:
Active:
The setpoint position is the axis position.
The setpoint position is constant. No setpoint generator active.
The setpoint position is determined by a setpoint generator.
Brake
Applied:
Released:
The configured brake output is activated.
The configured brake output is deactivated.
Error
None:
Non-fatal:
Fatal:
No error is detected.
An error of the none-fatal error class is detected.
An error of the fatal error class is detected.
70/158
Bosch Rexroth AG
NYCe4000 Software User Manual
Single Axis Control (SAC) and Multi Axes Control (MAC)
Events are available for all state entries and state exits. The events for entering a
state have the suffix _EN (for “enter”), and the events for leaving a state have the
suffix _LE (for “leave”). When a state is left and another state is entered the
accompanying events are generated. The events are the following.
SAC_EV_IDLE_STATE_EN
SAC_EV_INACTIVE_STATE_EN
SAC_EV_READY_STATE_EN
SAC_EV_READY_STOPPED_STATE_EN
SAC_EV_MOVING_STATE_EN
SAC_EV_ERROR_STATE_EN
SAC_EV_FREE_STATE_EN
SAC_EV_FREE_STOPPED_STATE_EN
SAC_EV_IDLE_STATE_LE
SAC_EV_INACTIVE_STATE_LE
SAC_EV_READY_STATE_LE
SAC_EV_READY_STOPPED_STATE_LE
SAC_EV_MOVING_STATE_LE
SAC_EV_ERROR_STATE_LE
SAC_EV_FREE_STATE_LE
SAC_EV_FREE_STOPPED_STATE_LE
8.10 Function I/O
This module contains the functions:
SacDefineFunctionIO
SacGetFunctionIO
SacDeleteFunctionIO
Digital I/O can be configured as motion specific I/O. The SacDefineFunctionIO
function defines a digital input or output for a specific I/O function. If the I/O is on
the IndraDrive, the slot number is NYCE_INDRA_SLOT.
SacGetFunctionIO retrieves the digital I/O that is coupled to a specific I/O
function and SacDeleteFunctionIO deletes a specific I/O function. The active
state of the digital I/Os are determined by the settings in NHI (see chapter 7.9).
The following motion specific input functionalities are available:
Area sensor: The area sensor input can be used for homing. Per axis only one
area sensor input can be defined. The digital inputs (NYCE_DIGINx,
NYCE_FASTINx) can be defined as area sensor inputs. To define the area
sensor input, specify the axis number, the desired function (SAC_AREA_SENSOR),
slot number and the NYCE I/O number as input parameters. The active level of
the area sensor input must be set to NYCE_ACTIVE_LOW.
Latches: The latch inputs are used for probing. Per axis four latch inputs can
be defined. The digital inputs should be defined as latch input by NHI (see
chapter 7.11), except for latches on an IndraDrive. The fast digital inputs of the
IndraDrive (NYCE_FASTINx) can be defined as latch inputs. Specify the axis
number, the desired function (SAC_LATCH_x), slot number and the NYCE I/O
number as input parameters. If the latch input is on an IndraDrive, first specify
the edge via the parameter SAC_PAR_INDRA_LATCHx_EDGE (where x is 0, 1, 2,
3). The latch functionality is discussed further in chapter 8.20.
Positive limit switch: The positive limit switch is used to mark the positive side
of the normal operation area of an axis. Per axis only one positive limit switch
input can be defined. The digital inputs (NYCE_DIGINx, NYCE_FASTINx) can be
defined as hardware positive limit switches. To define the limit switch, specify
the axis number, the desired function (SAC_POS_LIMIT_SWITCH), slot number
and the NYCE I/O number as input parameters.
Negative limit switch: The negative limit switch is used to mark the negative
side of the normal operation area of an axis. Per axis only one negative limit
switch input can be defined. The digital inputs (NYCE_DIGINx, NYCE_FASTINx)
NYCe4000 Software User Manual
Bosch Rexroth AG
71/158
Single Axis Control (SAC) and Multi Axes Control (MAC)
can be defined as hardware negative limit switches. To define the limit switch,
specify the axis number, the desired function (SAC_NEG_LIMIT_SWITCH), slot
number and the NYCE I/O number as input parameters.
Error inputs: Per axis a maximum of six error inputs can be defined. The digital
inputs (NYCE_DIGINx, NYCE_FASTINx) can be defined as error inputs. To
define the error inputs, specify the axis number, the desired function
(SAC_ERROR_x, where x is between 0 and 5), slot number and the NYCE I/O
number as input parameters. Error inputs are explained in detail in chapter
8.11.
Start trigger: The start trigger input is used for the start on event functionality.
The edge on which the start trigger is detected is defined by the parameter
SAC_PAR_START_TRIGGER_EDGE. The status change of the digital inputs
(NYCE_DIGINx, NYCE_FASTINx) can be defined as a start trigger input. To
define the start trigger input, specify the axis number, desired function
SAC_START_TRIGGER, slot number and the NYCE I/O number as input
parameters.
Stop trigger: The stop trigger input is used for the stop on event functionality.
The edge on which the start trigger is detected is defined by the parameter
SAC_PAR_STOP_TRIGGER_EDGE. The status change of the digital inputs
(NYCE_DIGINx, NYCE_FASTINx) can be defined as a stop trigger input. To
define the stop trigger input, specify the axis number, desired function
SAC_STOP_TRIGGER, slot number and the NYCE I/O number as input
parameters.
E stop: Emergency stop input, only available on the IndraDrive. The digital
inputs of the IndraDrive (NYCE_DIGINx, NYCE_FASTINx) can be defined as
emergency inputs, see chapter 9.3. To define the emergency input, specify the
axis number, desired function (SAC_E_STOP), slot number (NYCE_INDRA_SLOT)
and the NYCE I/O number as input parameters. The active level of the input
must be set to NYCE_ACTIVE_LOW.
Notes:
1. It is possible that an input has more than one function.
2. The input must be part of the node on which the axis has been defined, but
not necessarily on the same drive unit as the motor output and/or position
sensor interface of the axis.
3. It is possible that an input is used by more than one axis.
The following motion specific output functionalities are available:
Release brake: the brake output is used for brake functionality. The parameter
is SAC_RELEASE_BRAKE. The digital output type is configured through the NHI
function NhiDefineDigitalOutputType which is explained in chapter 7.9.
However, this functionality is not supported for the IndraDrive and the error
CML_ERR_INVALID_AXIS_TYPE is returned.
Drive enable: the drive enable output can be defined for motors controlled via
an analog output and an external drive, and activated with the parameter
SAC_EXT_DRIVE_ENABLE. However, this functionality is not supported for the
IndraDrive and the error CML_ERR_INVALID_AXIS_TYPE is returned.
Position switch, only available on the IndraDrive. When the axis position is in a
defined range, the specified output is activated. Specify NYCE_INDRA_SLOT in
the slotId field with the parameter SAC_POSITION_SWITCH. The range can be
specified with the function SacDLDefinePositionSwitchRange, see chapter
9.5.
The release brake output and drive enable output are modified by the relevant
state transitions shown in the axis state diagram (Fig. 14). For each state of an
axis the corresponding states of the release brake and drive enable outputs are
shown in Table 18. The states of the outputs can be overruled by the standard
NHI or SACDL digital I/O function calls.
72/158
Bosch Rexroth AG
NYCe4000 Software User Manual
Single Axis Control (SAC) and Multi Axes Control (MAC)
Notes:
1. It is possible that an output has more than one function.
2. The output must be part of the node on which the axis has been defined, but
not necessarily on the same drive unit as the motor output and/or position
sensor interface of the axis.
3. It is possible that an output is used by more than one axis.
4. The digital output must be configured within NHI, see chapter 7.9.
For triggers, the following events are available.
SAC_EV_START_TRIGGER
This event occurs when a movement is started on a trigger.
SAC_EV_STOP_TRIGGER
This event occurs when a movement is stopped on a trigger.
The NY4120, NY4130, NY4140 and NY4170 drive modules include three 5V
digital inputs per axis, DIG5VIN0A, DIG5VIN0B, DIG5VIN0C for axis0 and
DIG5VIN1A, DIG5VIN1B, DIG5VIN1C for axis1 (if available).
These inputs can also be used as additional S0/S90 counters, see the NYCe4000
Hardware System Manual). The variables SAC_VAR_SECONDARY_COUNTER_VALUE
and SAC_VAR_SECONDARY_COUNTER_DISPLACEMENT and the parameter
SAC_PAR_SECONDARY_COUNTER_DIRECTION can be read and used to implement
additional application functionality.
8.11 Error and Safety Handling
This module contains the functions:
SacDefineErrorHandler
SacGetErrorHandler
SacSetSafetyModeOperation
SacEnterSafetyMode
SacExitSafetyMode
SacClearWarning
SacSetRecoverMode
MacDefineErrorGroup
MacDeleteErrorGroup
SacGetEncoderError
Preventive safety precaution measures are provided to avoid accidents and
damage to the machine. For each axis, or a group of axes, it is possible to detect
several error conditions. All defined error conditions have an associated error
handler. The system will automatically execute the defined error handler
immediately after the detection of the error condition.
This error detection and handling functionality offers the possibility to set the
criteria for error detection through parameters and attach an error handler to each
defined error. For each error, a selection can be made from a subset of the error
handlers enumerated in order of increasing severity level in Table 19.
NYCe4000 Software User Manual
Bosch Rexroth AG
73/158
Single Axis Control (SAC) and Multi Axes Control (MAC)
Table 19 Error Handler Descriptions
Severity
Error Handler
Description
0
SAC_ERRH_NONE
No handling,
1
SAC_ERRH_WARNING
A warning signaled
2
SAC_ERRH_SMOOTH_STOP
Smooth Stop is executed on axis
3
SAC_ERRH_QUICK_STOP
Quick Stop is executed on axis
4
SAC_ERRH_FULL_STOP
Full Stop is executed on axis
5
SAC_ERRH_QSTOP_OPEN_LOOP
Quick Stop is executed on axis and
controller switches to open loop
6
SAC_ERRH_OPEN_LOOP
Controller switches to open loop
7
SAC_ERRH_DISABLE_DRIVE
Controller and drive are disabled
8
SAC_ERRH_POS_CORRUPTED
Controller and drive are disabled,
and position is lost (corrupted)
9
SAC_ERRH_COMMUNICATION_LOST
Controller and drive are disabled,
and position is lost (corrupted).
Recovery only possible by execution
of SacShutdown
For the error handlers “disable drive” (7), “position corrupted” (8) and
“communication lost” (9) the drive is disabled, which means that the motor
windings are short-circuited to ground. For applications with a high amount of
kinetic energy, care must be taken to prevent damage to the FETs of the Hbridge.
Not every handler is suitable for every error condition. For example, operating in
closed loop is not possible for a servo axis when its position sensor is defective.
That is the reason why the choice is limited for some error conditions.
The function SacDefineErrorHandler defines an error handler for a specific axis
error. For several axis errors it is required that an error handler must be defined of
a minimal severity level. The default error handler and minimum error handler for
each defined error are listed in Table 20. Note that not all errors listed in the table
can be configured with the function SacDefineErrorHandler. An attempt to
change the error handlers of the errors mentioned in footnote (1) with the function
SacDefineErrorHandler returns the error SAC_ERR_NON_CONFIGURABLE_ERROR.
Not the axis error, but how the error is handled indicates if the error is fatal, nonfatal or a warning. If the error handlers with severity level 7 or 8 are defined for an
axis error, this indicates that the axis error is fatal and the state of SAC changes
to SAC_ERROR, see Fig. 14. If the error handlers with severity level 2, 3, 4, 5 or 6
are defined for an axis error, this indicates that the axis error is non-fatal. The
handler with severity level 1 indicates that an axis error is a warning.
The function SacClearWarning clears and enables the detection of an axis error
that is handled by the warning error handler.
The parameters used by the error handler to execute a “smooth stop”, “quick
stop”, “full stop”, or “quick stop and open loop” are defined with the functions
SacWriteParameter and SacWriteParameterSet.
The function SacGetErrorHandler gets the error handler that is defined for a
specific axis error.
74/158
Bosch Rexroth AG
NYCe4000 Software User Manual
Single Axis Control (SAC) and Multi Axes Control (MAC)
Table 20 Default and Minimum Error Handlers
Error
Default Error Handler
Minimum Error Handler
SAC_AX_ERR_CABLE_ALARM
SAC_ERRH_POS_CORRUPTED
SAC_ERRH_POS_CORRUPTED
SAC_AX_ERR_POSITION_ERROR_EXCEEDED
SAC_ERRH_QUICK_STOP
SAC_ERRH_NONE
SAC_AX_ERR_POS_SW_END_SWITCH
SAC_ERRH_QUICK_STOP
SAC_ERRH_NONE
SAC_AX_ERR_NEG_SW_END_SWITCH
SAC_ERRH_QUICK_STOP
SAC_ERRH_NONE
SAC_AX_ERR_STEADY_STATE_ERROR
SAC_ERRH_DISABLE_DRIVE
SAC_ERRH_NONE
SAC_AX_ERR_SPLINE_BUFFER_EMPTY
SAC_ERRH_QUICK_STOP
SAC_ERRH_SMOOTH_STOP
SAC_AX_ERR_COLLISION_DETECTION
SAC_ERRH_DISABLE_DRIVE
SAC_ERRH_NONE
SAC_AX_ERR_EMERGENCY_STOP_INPUT
SAC_ERRH_QUICK_STOP
SAC_ERRH_SMOOTH_STOP
SAC_AX_ERR_ERROR_0_INPUT
SAC_ERRH_WARNING
SAC_ERRH_NONE
SAC_AX_ERR_ERROR_1_INPUT
SAC_ERRH_WARNING
SAC_ERRH_NONE
SAC_AX_ERR_ERROR_2_INPUT
SAC_ERRH_WARNING
SAC_ERRH_NONE
SAC_AX_ERR_ERROR_3_INPUT
SAC_ERRH_WARNING
SAC_ERRH_NONE
SAC_AX_ERR_ERROR_4_INPUT
SAC_ERRH_WARNING
SAC_ERRH_NONE
SAC_AX_ERR_ERROR_5_INPUT
SAC_ERRH_WARNING
SAC_ERRH_NONE
SAC_AX_ERR_STOP_ALARM
SAC_ERRH_OPEN_LOOP
SAC_ERRH_OPEN_LOOP
SAC_AX_ERR_POS_LIMIT_SWITCH_INPUT
SAC_ERRH_DISABLE_DRIVE
SAC_ERRH_NONE
SAC_AX_ERR_NEG_LIMIT_SWITCH_INPUT
SAC_ERRH_DISABLE_DRIVE
SAC_ERRH_NONE
SAC_AX_ERR_PEER_WARNING
SAC_ERRH_WARNING
SAC_ERRH_NONE
SAC_AX_ERR_PEER_SMOOTH_STOP
SAC_ERRH_SMOOTH_STOP
SAC_ERRH_NONE
SAC_AX_ERR_PEER_QUICK_STOP
SAC_ERRH_SMOOTH_STOP
SAC_ERRH_NONE
SAC_AX_ERR_PEER_FULL_STOP
SAC_ERRH_SMOOTH_STOP
SAC_ERRH_NONE
SAC_AX_ERR_PEER_QSTOP_OPEN_LOOP
SAC_ERRH_SMOOTH_LOOP
SAC_ERRH_NONE
SAC_AX_ERR_PEER_OPEN_LOOP
SAC_ERRH_SMOOTH_LOOP
SAC_ERRH_NONE
SAC_AX_ERR_PEER_DISABLE_DRIVE
SAC_ERRH_SMOOTH_STOP
SAC_ERRH_NONE
SAC_AX_ERR_PEER_POS_CORRUPTED
SAC_ERRH_SMOOTH_STOP
SAC_ERRH_NONE
SAC_AX_ERR_PEER_COMMUNICATION_LOST
SAC_ERRH_COMMUNICATION_LOST
SAC_ERRH_COMMUNICATION_LOST
SAC_AX_ERR_PHASE_ALARM
SAC_ERRH_POS_CORRUPTED
SAC_ERRH_POS_CORRUPTED
SAC_AX_ERR_MASTER_DIRECTION_ERROR
SAC_ERRH_QUICK_STOP
SAC_ERRH_SMOOTH_STOP
SAC_AX_ERR_MASTER_POSITION_OVERFLOW
SAC_ERRH_QUICK_STOP
SAC_ERRH_SMOOTH_STOP
SAC_AX_ERR_MASTER_POSITION_LOSS
SAC_ERRH_QUICK_STOP
SAC_ERRH_SMOOTH_STOP
SAC_AX_ERR_SETTLING_TIME_ERROR
SAC_ERRH_WARNING
SAC_ERRH_NONE
SAC_AX_ERR_POS_SERVO_OVER_VOLTAGE
SAC_ERRH_DISABLE_DRIVE
SAC_ERRH_NONE
SAC_AX_ERR_POS_SERVO_UNDER_VOLTAGE
SAC_ERRH_QUICK_STOP
SAC_ERRH_QUICK_STOP
SAC_AX_ERR_NEG_SERVO_UNDER_VOLTAGE
SAC_ERRH_QUICK_STOP
SAC_ERRH_QUICK_STOP
SAC_AX_ERR_NEG_SERVO_OVER_VOLTAGE
SAC_ERRH_DISABLE_DRIVE
SAC_ERRH_NONE
SAC_AX_ERR_OVER_TEMPERATURE
SAC_ERRH_WARNING
SAC_ERRH_NONE
SAC_AX_ERR_MAX_VELOCITY_EXCEEDED
SAC_ERRH_SMOOTH_STOP
SAC_ERRH_NONE
NYCe4000 Software User Manual
Bosch Rexroth AG
75/158
Single Axis Control (SAC) and Multi Axes Control (MAC)
SAC_AX_ERR_MAX_AXIS_VELOCITY_EXCEEDED
SAC_ERRH_SMOOTH_STOP
SAC_ERRH_NONE
SAC_AX_ERR_MAX_ACCELERATION_EXCEEDED
SAC_ERRH_SMOOTH_STOP
SAC_ERRH_NONE
SAC_AX_ERR_MAX_JERK_EXCEEDED
SAC_ERRH_SMOOTH_STOP
SAC_ERRH_NONE
SAC_AX_ERR_OVER_CURRENT
SAC_ERRH_DISABLE_DRIVE
SAC_ERRH_DISABLE_DRIVE
SAC_AX_ERR_SHORT_CIRCUIT
SAC_ERRH_DISABLE_DRIVE
SAC_ERRH_DISABLE_DRIVE
SAC_AX_ERR_INVALID_HALL_SENSOR
SAC_ERRH_DISABLE_DRIVE
SAC_ERRH_DISABLE_DRIVE
SAC_AX_ERR_COMMUNICATION_ERROR
SAC_ERRH_SMOOTH_STOP
SAC_ERRH_NONE
SAC_AX_ERR_NETWORK_ERROR
SAC_ERRH_SMOOTH_STOP
SAC_ERRH_NONE
SAC_AX_ERR_MARKER_MISSED
SAC_ERRH_WARNING
SAC_ERRH_NONE
SAC_AX_ERR_MAX_CURRENT_LEVEL_EXCEEDED
SAC_ERRH_DISABLE_DRIVE
SAC_ERRH_NONE
SAC_AX_ERR_MAX_I2T_LEVEL_EXCEEDED
SAC_ERRH_DISABLE_DRIVE
SAC_ERRH_DISABLE_DRIVE
SAC_AX_ERR_GENERAL_ENCODER_ERROR
SAC_ERRH_POS_CORRUPTED
SAC_ERRH_POS_CORRUPTED
SAC_AX_ERR_SINCOS_SIGNAL_TOO_WEAK
SAC_ERRH_POS_CORRUPTED
SAC_ERRH_POS_CORRUPTED
SAC_AX_ERR_SINCOS_SIGNAL_TOO_STRONG
SAC_ERRH_POS_CORRUPTED
SAC_ERRH_POS_CORRUPTED
SAC_AX_ERR_ENCODER_COMMUNICATION_LOST
SAC_ERRH_POS_CORRUPTED
SAC_ERRH_POS_CORRUPTED
SAC_AX_ERR_SETPOINT_OVERFLOW
SAC_ERRH_QUICK_STOP
SAC_ERRH_QUICK_STOP
SAC_AX_ERR_COMMUTATION_CORRECTION_ERROR
SAC_ERRH_QSTOP_OPEN_LOOP
SAC_ERRH_SMOOTH_STOP
SAC_AX_ERR_PIEZO_AMPLIFIER_VOLTAGE_ERROR
SAC_ERRH_DISABLE_DRIVE
SAC_ERRH_DISABLE_DRIVE
SAC_AX_ERR_SAMPLE_OVERRUN
SAC_ERRH_DISABLE_DRIVE
SAC_ERRH_NONE
SAC_AX_ERR_POSITION_ERROR_OVERFLOW
SAC_ERRH_OPEN_LOOP
SAC_ERRH_OPEN_LOOP
SAC_AX_ERR_DRIVE_TEMPERATURE_TOO_HIGH
SAC_ERRH_DISABLE_DRIVE
SAC_ERRH_DISABLE_DRIVE
SAC_AX_ERR_POS_DRIVE_VOLTAGE_TOO_HIGH
SAC_ERRH_DISABLE_DRIVE
SAC_ERRH_DISABLE_DRIVE
SAC_AX_ERR_POS_DRIVE_VOLTAGE_TOO_LOW
SAC_ERRH_DISABLE_DRIVE
SAC_ERRH_DISABLE_DRIVE
SAC_AX_ERR_NEG_DRIVE_VOLTAGE_TOO_LOW
SAC_ERRH_DISABLE_DRIVE
SAC_ERRH_DISABLE_DRIVE
SAC_AX_ERR_NEG_DRIVE_VOLTAGE_TOO_HIGH
SAC_ERRH_DISABLE_DRIVE
SAC_ERRH_DISABLE_DRIVE
SAC_ERRH_QUICK_STOP
SAC_ERRH_SMOOTH_STOP
SAC_AX_ERR_MAX_SAFETY_VELOCITY_EXCEEDED(1)
SAC_ERRH_QUICK_STOP
SAC_ERRH_SMOOTH_STOP
SAC_AX_ERR_MAX_SAFETY_ACCELERATION_EXCEEDED(1)
SAC_ERRH_QUICK_STOP
SAC_ERRH_SMOOTH_STOP
SAC_AX_ERR_MAX_SAFETY_JERK_EXCEEDED(1)
SAC_ERRH_QUICK_STOP
SAC_ERRH_SMOOTH_STOP
SAC_AX_ERR_INDRA_ERROR
SAC_ERRH_DISABLE_DRIVE
SAC_ERRH_DISABLE_DRIVE
SAC_AX_ERR_INDRA_WARNING
SAC_ERRH_WARNING
SAC_ERRH_NONE
SAC_AX_ERR_SERCOS_ERROR
SAC_ERRH_COMMUNICATION_LOST
SAC_ERRH_COMMUNICATION_LOST
SAC_AX_ERR_MICROWARE_ERROR
SAC_ERRH_COMMUNICATION_LOST
SAC_ERRH_COMMUNICATION_LOST
SAC_AX_ERR_DL_SYNC_READ_ERROR
SAC_ERRH_COMMUNICATION_LOST
SAC_ERRH_COMMUNICATION_LOST
SAC_AX_ERR_USER_ERROR_0
SAC_ERRH_NONE
SAC_ERRH_NONE
SAC_AX_ERR_USER_ERROR_1
SAC_ERRH_NONE
SAC_ERRH_NONE
SAC_AX_ERR_USER_ERROR_2
SAC_ERRH_NONE
SAC_ERRH_NONE
SAC_AX_ERR_USER_ERROR_3
SAC_ERRH_NONE
SAC_ERRH_NONE
SAC_AX_ERR_USER_ERROR_4
SAC_ERRH_NONE
SAC_ERRH_NONE
SAC_AX_ERR_SAFETY_INPUT
(1)
76/158
Bosch Rexroth AG
NYCe4000 Software User Manual
Single Axis Control (SAC) and Multi Axes Control (MAC)
SAC_AX_ERR_USER_ERROR_5
SAC_ERRH_NONE
SAC_ERRH_NONE
SAC_AX_ERR_USER_ERROR_6
SAC_ERRH_NONE
SAC_ERRH_NONE
SAC_AX_ERR_USER_ERROR_7
SAC_ERRH_NONE
SAC_ERRH_NONE
(1) These error handlers can only be configured with SacSetSafetyModeOperation
For all error handlers an event with the name SAC_EV_ERRH_xxx is defined for the
detection of an axis error. The event that belongs to the executed error handler is
triggered. The axis error that is detected is available as event data. The axis
errors are of type NYCE_ERROR_CODE. This error code can be converted to a string
with the function NyceGetErrorCodeString, see chapter 3.5.
Error Groups
With the functionality of Multi-Axis error groups, it is possible to define a group of
axes for which an error detected at one of the axes in the group results in the
detection of an error for all other axes in the group as well. It is possible to define
a total of 16 [NYCE_MAX_NR_OF_ERROR_GROUPS] error groups.
An error group of axes is defined with the function MacDefineErrorGroup. An axis
may be a member of only one group at a time. For that reason the following cases
are distinguished:
None of the axes specified in the new group is member of an existing error
group. In this case a new group is created, if a free group is available.
One or more axes specified in the new group are already member of one and
the same existing group. In this case the existing group is extended with the
axes in the new group.
If an axis in an error group encounters an error condition, that axis will execute
the assigned error handler and pass the appropriate SAC_AX_ERR_PEER_xxx error
to the other axes in the error group. The other axes in the error group execute (for
example) a disable drive error handler, a stop profile (smooth, quick or full stop)
error handler, or just the warning error handler as defined by the
SAC_AX_ERR_PEER_xxx error.
Note:
If an axis in an error group executes a (programmed) stop profile function
(SacSmoothStop, SacQuickStop, or SacFullStop) the other axes in the error
group are not affected.
A group is deleted by a call to the function MacDeleteErrorGroup.
When an axis is disconnected by its last client, the axis is removed from the error
group if applicable. When a group becomes empty this way, the group Id
becomes available for a new group to be defined.
Configurable Errors Explained
All available configurable axis errors that can be detected by the firmware and
hardware are explained below. Note that not all errors listed in Table 20 can be
configured with for example the function SacWriteParameter.
Cable Alarm
The cable alarm occurs when a S00/S90 cable breakage is detected.
Position Error Exceeded
The position error occurs when the position error exceeds the value of the
parameter SAC_PAR_MAX_DYN_POS_ERROR. The position error detection is switched
NYCe4000 Software User Manual
Bosch Rexroth AG
77/158
Single Axis Control (SAC) and Multi Axes Control (MAC)
off if the value is set to 0.0. The axis position is always monitored. The axis
position is allowed to deviate from the setpoint position by a small margin that can
be set. If the deviation is larger than the set margin an error is generated. The
error depends on the controller state, see Fig. 15.
Fig. 15
Position Error Exceeded vs Steady State Error
In all closed loop states (SAC_MOVING, SAC_READY and SAC_READY_STOPPED) the
actual axis position is checked with the allowed SAC_PAR_MAX_DYN_POS_ERROR
value. When the axis controller is in the state SAC_READY or SAC_READY_STOPPED
and the controller state is CTR_STEADY, the actual axis position is checked with the
allowed SAC_PAR_MAX_STEADY_STATE_ERROR value. See also NYCe4000 Tools
manual, chapter NYCeTuner, “Controller settling criteria”.
Positive and Negative Software End switch
You can define limits on the allowed working range of an axis as part of safety
precaution measures. For this purpose two position limits are implemented in the
software. After detection and handling of a positive or negative software end
switch condition, the user performs the recovery (defined by the application) of
the error. The recovery depends on the error handler that was executed after the
detection of the error condition. After the recovery, the axis is allowed to move in
the opposite direction to reset the software end switch position condition. When
the software end switch position condition is no longer active it is possible to
move again in both directions. The positions of the software end switches are
defined by SAC_PAR_POS_SW_END_SWITCH and SAC_PAR_NEG_SW_END_SWITCH. In
case SAC_PAR_POS_SW_END_SWITCH ≤ SAC_PAR_NEG_SW_END_SWITCH the software
end switches are switched off.
Note:
The software end switch functionality only operates after the axis is homed.
Even when an absolute encoder is used, the axis must be explicitly homed with
the SacHome function.
Steady State Error
The steady state error occurs when the position error exceeds the value of the
parameter SAC_PAR_MAX_STEADY_STATE_ERROR. The steady state error is
switched off if the value is set to 0.0. See “Position Error Exceeded” for detailed
information.
Spline Buffer Empty
The spline buffer empty error occurs when the spline buffer is empty while
performing a spline movement.
Collision Detection
The collision detection criterion is based on the controller output and estimated
velocity and is checked in all axis states except the idle state. The criterion is
defined as follows. When over a defined time span the velocity is less than a
threshold velocity and the controller output is greater than a threshold, a collision
is detected.
78/158
Bosch Rexroth AG
NYCe4000 Software User Manual
Single Axis Control (SAC) and Multi Axes Control (MAC)
This criterion requires the parameters:
SAC_PAR_COLLISION_TIME_WINDOW
SAC_PAR_COLLISION_CONTROLLER_OUT
SAC_PAR_COLLISION_VEL
The idea behind this criterion is that a collision results in a high controller output
with an unexpected low velocity. The time window makes the criterion more
robust for the cases where the controller output and the velocity estimates are
within the collision detection bounds for one or a few samples. Collision detection
is switched off if one of the parameter values is set to 0.0.
Emergency Stop Input
An emergency input is available on each node. The emergency stop error is
triggered for all axes on the node when the input becomes active. The active state
of the emergency input can be set by the parameter
NHI_PAR_NODE_EMERGENCY_POLARITY using the enumeration
NYCE_ACTIVE_STATE. Default the active level value is active high.
Error Inputs
A total of six error inputs can be defined. When an error input is activated the
corresponding error handler is executed.
Stop Alarm
The stop alarm error is discussed in section “Stop Alarm” on page 82.
Positive and Negative Limit switch
After detection of a positive or negative limit switch, the user performs the
recovery (defined by the application) of the error. The recovery depends on the
error handler that was executed after the detection of the error condition. After the
recovery, the axis is allowed to move in the opposite direction to de-activate the
limit switch input. When the limit switch input is no longer active it is possible to
move again in both directions.
Peer Error Handlers
When an axis in an error group detects an error, the configured error handler is
executed and broadcasts the executed error handler to the other members of the
same error group. The other members then execute the configured peer error
handler.
Phase Alarm
The phase alarm occurs when a S00/S90 phase difference less than 20
nanoseconds is detected.
Master Direction Error
The master direction error occurs when the slave is moving in the wrong direction
after the transition that the slave axis must gear with the master axis. See chapter
8.13 to read more about master and slave axes.
Master Position Overflow
The master position overflow error is generated when an overflow is avoided
before the slave position is calculated from a master position.
NYCe4000 Software User Manual
Bosch Rexroth AG
79/158
Single Axis Control (SAC) and Multi Axes Control (MAC)
Master Position Loss
The master position loss occurs when the master and slave axes are on different
nodes and the slave misses master positions that should have been sent over the
IEEE 1394 network.
Settling Time Error
The settling time error occurs when the settling time, as shown in Fig. 17 on page
85, exceeds the value of the parameter SAC_PAR_MAX_SETTLING_TIME. The error
detection is switched off if the value of the parameter is set to 0.0.
Voltage Errors
Two categories of limits are defined for the connected drive power to the drive
module, drive voltage limits and servo voltage limits. The drive voltage limits are
defined by the drive module type and these limit settings can not be changed. The
servo voltage limits can be set and may depend on the specifications of motor
connected to the drive module.
- SAC_AX_ERR_POS_SERVO_OVER_VOLTAGE or
SAC_AX_ERR_NEG_SERVO_OVER_VOLTAGE is detected, when the measured
servo voltage is higher than the value of the parameter
SAC_PAR_POS_SERVO_OVER_VOLTAGE_LIMIT, respectively
SAC_PAR_NEG_SERVO_OVER_VOLTAGE_LIMIT.
- SAC_AX_ERR_POS_SERVO_UNDER_VOLTAGE or
SAC_AX_ERR_NEG_SERVO_UNDER_VOLTAGE is detected, when the measured
servo voltage is lower than the value of the parameter
SAC_PAR_POS_SERVO_UNDER_VOLTAGE_LIMIT, respectively
SAC_PAR_NEG_SERVO_UNDER_VOLTAGE_LIMIT.
- SAC_AX_ERR_PIEZO_AMPLIFIER_VOLTAGE_ERROR is detected, when more than
4 consecutive samples the amplifier output on the NY4170 drive module has
a different value than (controller out * 135).
- SAC_AX_ERR_POS_DRIVE_VOLTAGE_TOO_HIGH,
SAC_AX_ERR_POS_DRIVE_VOLTAGE_TOO_LOW,
SAC_AX_ERR_NEG_DRIVE_VOLTAGE_TOO_LOW,
SAC_AX_ERR_NEG_DRIVE_VOLTAGE_TOO_HIGH are detected when the
measured drive voltage is higher than or lower than the specified limit values.
Over Temperature
The drive temperature is monitored by a temperature sensor on the drive module.
A SAC_AX_ERR_OVER_TEMPERATURE error is generated, when the measured
temperature is higher than the value of the parameter
NHI_PAR_OVER_TEMPERATURE_LIMIT_SLOTx (x: 0 … 7, default set to 90º Celsius).
The temperature error detection is disabled when the parameter value is 0.0.
However, independent of the NHI_PAR_OVER_TEMPERATURE_LIMIT_SLOTx
parameter, the drive is protected against over temperature. If the temperature of
the drive module exceeds the NYCE_MAX_TEMPERATURE_LIMIT value (fixed set to
110º Celsius), the SAC_AX_ERR_DRIVE_TEMPERATURE_TOO_HIGH error is
generated.
Maximum Setpoint Parameters Exceeded
A setpoint error occurs if one of the setpoint variables velocity, acceleration or jerk
exceeds the corresponding parameter values SAC_PAR_MAX_VEL_NORMAL_MODE,
SAC_PAR_MAX_ACC_NORMAL_MODE or SAC_PAR_MAX_JERK_NORMAL_MODE. The error
checks are switched off if the parameter value is set to 0.0.
Current errors
The NY4120 and NY4140 hardware foresees in over-current detections
SAC_AX_ERR_OVER_CURRENT and SAC_AX_ERR_SHORT_CIRCUIT. The error
SAC_AX_ERR_OVER_CURRENT occurs when the measured drive current is greater
than 20 amperes, which is the maximum range of the measurement logics on the
80/158
Bosch Rexroth AG
NYCe4000 Software User Manual
Single Axis Control (SAC) and Multi Axes Control (MAC)
drive, over a period of 10 milliseconds. Recovering from this error can be done by
software. It is sufficient to reset the axis and continue the application in an
appropriate manner.
The error SAC_AX_ERR_SHORT_CIRCUIT occurs when a current of approximately
50 to 60 amperes is detected in the drive. This indicates a short circuit in the
motor or cabling. To recover from this error one needs to check the motor and
motor cabling before continuing the application. The short circuit error is not
detected by the hardware that measures the current, but by separate hardware on
the drive.
However, it is likely that the maximum current allowed for a motor is below the
levels mentioned above. For this condition, the detection of a drive current error is
implemented in software. For the detection of this error the parameter
SAC_PAR_MAX_CURRENT_LEVEL must be set to a value not equal to 0. For a value
of 0 the detection is turned off. If the drive current in absolute value exceeds this
level, the error SAC_AX_ERR_MAX_CURRENT_LEVEL_EXCEEDED is detected.
I2 t
To protect the drive from overheating an I2t criterion is implemented that is based
on a temperature model:
dT
1
(T (t ) Tenv ) K * I 2 (t )
dt
This model describes that the change in temperature (T) is determined by a heat
exchange term and an input power term. The heat exchange term is proportional
by a factor (-1/ ) to the difference between actual temperature and environment
temperature (Tenv). The number is a time constant. The input power term is
proportional to the squared current amplitude. Following criterion is determined
from the model:
t
C (t ) : e
(t )
0.75 I 2 ( ) d
0
Here C(t) is the variable SAC_VAR_I2T_CRITERION_VALUE containing the current
value of the criterion. The time constant = 0.35 is determined empirically and
fixed. The threshold above which the error
SAC_AX_ERR_MAX_I2T_LEVEL_EXCEEDED is generated is set by the parameter
SAC_PAR_MAX_I2T_LEVEL. The default value of this parameter is for the NY4120
and NY4140 set to 35.0. The value 35.0 is based on the specifications that the
modules can deliver 20 amperes over a period of 0.1 seconds.
Invalid Hall Sensor
The Hall sensor error occurs when detecting that one of the specified Hall sensor
inputs is not connected correctly.
Communication error
This error is generated when an isochronous channel fails.
Network error
A failure in the asynchronous IEEE 1394b communication is reported by this
error.
NYCe4000 Software User Manual
Bosch Rexroth AG
81/158
Single Axis Control (SAC) and Multi Axes Control (MAC)
Marker Missed
The marker missed error is generated, when during one DSP sample more than 8
position marker output actions per slot are required.
General encoder error
The general encoder error occurs if a general encoder error is received from the
incremental or absolute Rexroth MSM encoder or the EnDat2.2 encoder interface.
If the general encoder error has occurred, the nature of the error can be retrieved
by using the SacGetEncoderError function. This function can only be called when
the axis is in the SAC_ERROR state and the error handler is
SAC_ERRH_POS_CORRUPTED.
SinCos signal too weak
The SinCos signal too weak error occurs when the sum of the squared sine and
squared cosine is lower than the minimum SinCos threshold level.
SinCos signal too strong
The SinCos signal too strong error occurs when the sum of the squared sine and
squared cosine is higher than the maximum SinCos threshold level.
Encoder communication lost
The encoder communication lost error is generated when the communication fails
with a Rexroth MSM incremental, Rexroth MSM absolute or EnDat2.2 encoder.
This error can be compared to the ‘Cable Alarm’ for S00/S90 encoders.
Setpoint overflow
The setpoint generator generates every sample the next wanted position. If the
calculated position does not fit in the assigned 30 bits for the internal variables, an
overflow will occur and this error is generated. For a jog profile (movement from
the current position to the position where the requested velocity is reached) the
movement distance between these 2 positions must fit in the 30 bit value.
This error can only occur during a jog movement and during a quick stop or
smooth stop.
If you start a jog movement and the acceleration parameter for quick stop is too
small, the error SPG_ERR_VELOCITY_TOO_HIGH_FOR_SAFE_STOP is reported,
because the distance needed in the stop profile will not fit in 30 bits.
Commutation correction error
Normally a brushless AC (BLAC) axis has a fixed commutation offset which is
calculated during the alignment and will not change. When the commutation angle
changes as function of the position of another axis, this can be considered as a
change of the commutation offset. Commutation correction is used when the
commutation offset of an axis depends on the position of another axis.
The error is generated when the commutation angle is not reliable anymore.
Possible causes are a too high velocity on one axis or both axes resulting in a
position deviation higher than allowed, or starting a home movement while the
commutation correction is active.
Sample overrun
A sample overrun occurs when the sample routine is called again before the
previous execution of the sample routine has completed. This occurrence is
administrated with a “nest count”. The counter is initialized to 0. When the sample
routine is called the counter is incremented by 1. At the end of the sample routine
the counter is decremented by 1. Sample overrun occurs if the counter has a
value higher than 1. The parameter NHI_PAR_NODE_SAMPLE_OVERRUN_THRESHOLD
defines the sample overrun counter value at which the error
SAC_AX_ERR_SAMPLE_OVERRUN is activated on all axes of the node on which this
82/158
Bosch Rexroth AG
NYCe4000 Software User Manual
Single Axis Control (SAC) and Multi Axes Control (MAC)
sample overrun condition occurs. The only allowed values for the parameter are 2
and 3, the default value is 2. If the sample routine is called
(NHI_PAR_NODE_SAMPLE_OVERRUN_THRESHOLD – 1) times nested, the error is
generated.
Position error overflow
The axis position error is limited to 19 bits if the PVL on the drive module is used.
The axis position error is limited to 32 bits if the PVL on the MCU is used. If the
axis position error limit is exceeded, the SAC_AX_ERR_POSITION_ERROR_OVERFLOW
error is generated.
IndraDrive error, IndraDrive warning
If an error or warning condition occurs on an IndraDrive, the message is
converted into one generic error with identifier SAC_AX_ERR_INDRA_ERROR or
SAC_AX_ERR_INDRA_WARNING. The specific IndraDrive error or warning code is
available in the variable SAC_VAR_INDRA_ERROR that can be read with the function
SacReadVariable, and is formatted as a floating point value. The description of
the error or warning code stored in the variable can be found in the BRC
documentation “Rexroth IndraDrive MPx02, MPx03, MPx04, MPx05 and HMV
Troubleshooting Guide”, order number R911297319. Note that the error and
warning codes are shown in the hexadecimal format in the BRC documentation.
SERCOS error
This error is generated when 2 successive SERCOS data messages fail to reach
their destination. The error will occur when one of the SERCOS cables is
unplugged. The error is also possible if SERCOS cables are unreliable or
insufficiently shielded.
Microware error
The error is reported if the microware on the NY4150 SEROCSIII Master module
does not respond in the defined time (or does not respond at all). This condition
can be caused by hardware problems on the NY4150 or problems in the
communication across the backplane. Another problem source can be a software
bug in the microware which causes the microware to become non-responsive.
Drivelink synchronization read error
The microware on the NY4150 detected a communication problem with the MCU.
This error can be caused by defective hardware or by sample overrun conditions.
User errors
8 user errors are available which can be activated by the function
SqcSetUserError or a UDC (User Definable Control). An axis can define an error
handler for each of these user errors. See the NYCe4000 Sequencer User
Manual for more information.
Stop Alarm
A fast method to stop a movement is switching the amplifier voltage
instantaneous to 0 Volt. The stop alarm is implemented in the gateware on the
NY4130 and NY4170, and implemented using a specific NYCe4000 digital input
and error handler on the NY4120 and NY4140.
NY4130
If the stop alarm is detected, the gateware on the NY4130 unconditionally
switches the amplifier output immediately to 0 Volts when using the internal
amplifier. Using an external amplifier, the gateware sets the corresponding
analog output to 0 Volts.
When the firmware detects that the stop alarm is activated, the corresponding
NYCe4000 Software User Manual
Bosch Rexroth AG
83/158
Single Axis Control (SAC) and Multi Axes Control (MAC)
error handler is executed, an event is sent to the host, and the I/O configured
as “external drive enable” is active. While the input of the stop alarm is active,
the power of the internal amplifier is enabled by gateware. The axis will be in
free stopped or error state due to the executed error handler (minimum error
handler is open loop).
While the stop alarm is active and the axis is in free stopped state, the safe
open loop value is set to the controller output by firmware. However, this value
is overruled by the gateware as long as the stop alarm is activated. The stop
alarm is reset automatically after the digital input is inactive.
NY4170
If the stop alarm is detected on the digital input Discharge0, the gateware on
the NY4170 reacts as described for the NY4130. In addition, the NY4170 has a
relay that disconnects the internal amplifier from the output to the piezo motor.
StopAlarm0 is the same input as Discharge0, but only affects the output for the
external amplifier. StopAlarm1 is the stop alarm input for the other axis on the
NY4170 (connects only to an external amplifier).
NY4120 and NY4140
A specific digital input on the NY4120 and NY4140 drive module can be defined
to operate as an alarm input with the function SacWriteParameter, see chapter
8.4 and NYCe4000 Hardware System Manual for more information.
The active level of the stop alarm can be configured through the parameter
SAC_PAR_STOP_ALARM_ACTIVE_LEVEL as active high or active low. Default is
active high.
The parameter SAC_PAR_STOP_ALARM_ENABLE enables/disabled the stop alarm
functionality on the NY4120 and NY4140 drive.
For stop alarm the event SAC_EV_STOP_ALARM is available. This event occurs
when the stop alarm is activated for a certain axis.
Recover Mode
By means of the function SacSetRecoverMode, it is possible to suppress detection
of all currently active user defined axis error inputs allowing a recovery by the
user. The error inputs are configurable function I/Os, discussed in chapter 8.10.
The axis leaves the recover mode automatically as soon as all error inputs are no
longer active. An axis error is always detected when an error input is activated,
even while operating in recover mode. The recover mode only suppresses the
error inputs that were active at the moment the recover mode was entered.
Safety Mode Operation
This safety mode operation functionality is primarily used for safe service
operations when the safety input, available on each node, is activated. The active
state of the safety input is set by the parameter NHI_PAR_NODE_SAFETY_POLARITY
using the enumeration NYCE_ACTIVE_STATE.
The function SacSetSafetyModeOperation sets the parameters for the safety
mode operation. The constraints for velocity, acceleration, jerk and controller
output to be taken into account in safety mode, are set. Maximum torque limits
are set to the IndraDrive. In addition, the function defines the error handler to be
activated when the safety input is activated, and the error handlers to be activated
when the specific safety constraint on velocity, acceleration or jerk is violated in
safety mode.
84/158
Bosch Rexroth AG
NYCe4000 Software User Manual
Single Axis Control (SAC) and Multi Axes Control (MAC)
The safety mode operation works as follows:
The safety input is active, which results in execution of the selected error
handler. The error cannot be reset as long as the safety input is active, as the
error is immediately detected again.
Safety mode operation is entered by the function SacEnterSafetyMode. This
function disables the detection of the safety input as an error, and it changes
the maximum controller output to the safety level. In addition, it installs
detection of violation of the safety constraints on velocity, acceleration and jerk
as an error check, which on occurrence activates the error handler installed for
this purpose.
Manipulate the machine until the safety input is inactive. The axis remains in
safety mode operation.
Safety mode operation is left by the function SacExitSafetyMode. This
function restores criterion parameters for error checking in normal mode with
respect to constraints on velocity, acceleration and jerk. It also restores the
normal value for the maximum controller output. Finally, it re-enables the
detection of the safety input active as an error.
When the safety input state changes, the event NHI_EV_SAFETY_INPUT_CHANGED
is generated.
Encoder error retrieval
The function SacGetEncoderError retrieves the active encoder error from the
digital Rexroth MSM encoder or EnDat2.2 interface. This function can be used for
both incremental and absolute Rexroth MSM encoders.
The function SacGetEncoderError can only be called when the axis is in the
SAC_ERROR state and the error handler is SAC_ERRH_POS_CORRUPTED.
8.12 Motion
This module contains the functions:
SacHome
SacPointToPoint
SacStartJog
SacStopJog
SacSetFeedOverride
SacFullStop
SacQuickStop
SacSmoothStop
This chapter discusses the motion functionality. While executing a movement the
controller of an axis transits 4 states of the controller. These states are:
-
moving
settling
stabilizing
steady
These states and their transitions are shown in Fig. 16. Fig. 17 shows the states
and transitions with respect to the setpoint position and axis position and
accompanying parameter settings.
NYCe4000 Software User Manual
Bosch Rexroth AG
85/158
Single Axis Control (SAC) and Multi Axes Control (MAC)
Fig. 16
CTR_MOVING
States for controller stabilization
CTR_SETTLING
CTR_STABILIZING
CTR_STEADY until next movement
Position
Overshoot
Setpoint
Position
Settling
Window
Motor
Position
Time in ready
windows
Settling time
Steady state delay
Time
Fig. 17 States for controller with respect to setpoint position and axis position
The transition from the state CTR_SETTLING to the state CTR_STABILIZING and the
transition from the state CTR_STABILIZING to the state CTR_STEADY are
determined by the settings of the parameters:
SAC_PAR_POS_READY_WIN
is the window (expressed in pu) when the position is within the set limits
SAC_PAR_VEL_READY_WIN
is the window (expressed in pu/s) when the velocity is within the set limits
SAC_PAR_TIME_IN_READY_WINDOWS
is the minimum time that the position and velocity are within the defined
window before the controller state changes from CTR_SETTLING to
CTR_STABILIZING.
SAC_PAR_STEADY_STATE_DELAY
is the delay time before the controller state changes from CTR_STABILIZING to
CTR_STEADY.
The parameter SAC_PAR_SETTLING_TIMEOUT sets the maximum time that the
controller is allowed or can be in the state CTR_SETTLING. After that time the
controller always makes the transition to the state CTR_STABILIZING. Even if an
axis is not settled within the timeout period, the controller will go the next state
(CTR_STABILIZING). No error handler is defined if an axis is not settled within the
specified SAC_PAR_SETTLING_TIMEOUT time.
The parameter SAC_PAR_MAX_SETTLING_TIME sets the maximum allowed settling
86/158
Bosch Rexroth AG
NYCe4000 Software User Manual
Single Axis Control (SAC) and Multi Axes Control (MAC)
time. You can define an error handler if the axis is not settled within the specified
SAC_PAR_MAX_SETTLING_TIME time. See the NYCe4000 Tools Manual for a
detailed description of the axis controller settling criteria. The condition
SAC_PAR_MAX_SETTLING_TIME < SAC_PAR_SETTLING_TIMEOUT must be met, else
the error will never occur.
The transitions within the controller state diagram generate following events:
SAC_EV_CONTROLLER_READY: This event occurs when the controller makes the
transition from the state CTR_SETTLING to the state CTR_STABILIZING.
SAC_EV_CONTROLLER_STEADY: This event occurs when the controller makes the
transition from the state CTR_STABILIZING to the state CTR_STEADY.
Homing
The homing functionality is used to define or find an absolute reference in a
positioning system.
The function SacWriteParameterSet specified with the parameter set identifier
SAC_HOME_PARS_ID writes the homing parameters, which specify the homing
mode to be used and how it must be executed. The function SacHome starts the
homing sequence for the specified mode.
The following variables are related to the homing functionality:
SAC_VAR_HOME_STATUS reflects the current status of the homing hardware of
the axis.
SAC_VAR_HOMED indicates whether the axis has been homed successfully.
The flag is always reset during SacShutdown (for any axis type), and for
stepper axes when the drive power is disabled.
SAC_VAR_HOMED_OLD_POSITION holds the old home position in terms of the
position coordinates that were valid before the last home command. This may
be used for determining the drift or reproducibility of the home position.
When the homing procedure detects the home position (for example, when the
index is detected), the current (not yet corrected) servo position is stored in
SAC_VAR_HOMED_OLD_POSITION. The servo position is set to
SAC_PAR_HOME_OFFSET, except when an absolute encoder is used. In that case,
the SAC_PAR_HOME_OFFSET value is added to the absolute encoder position value
at the home position. If the homing procedure is repeated and the system does
not have any drift the difference between SAC_VAR_HOMED_OLD_POSITION and
SAC_PAR_HOME_OFFSET should be 0. Note that the repeatability of the homing can
only be tested after a successful initial homing was executed.
The following events are available for homing.
SAC_EV_HOMING_STARTED: This event is generated when homing is started.
SAC_EV_HOMING_COMPLETED: This event is generated when the homing
procedure is completed.
There are 14 different homing modes defined, which can be divided in 3 ‘define
home’ modes (involving no movement of the axis) and 11 ‘search home’ modes
(involving movement of the axis). All homing modes are listed in Table 21.
The ‘search home’ modes with the position criterion are very robust using a low
saturation level and a high dynamic position error. However, these settings are
not functional after the homing procedure. With wrong settings a mechanical
construction can easily be damaged when driving into the mechanical stop with a
high current. To solve this problem two additional SAC parameters,
SAC_PAR_HOME_SAT_LEVEL and SAC_PAR_HOME_MAX_DYN_POS_ERROR, can overrule
the saturation level and maximum dynamic position error during homing.
If SAC_PAR_HOME_SAT_LEVEL is not equal to 0, the value overrules the setting of
NYCe4000 Software User Manual
Bosch Rexroth AG
87/158
Single Axis Control (SAC) and Multi Axes Control (MAC)
SAC_PAR_SAT_LEVEL during homing. If SAC_PAR_HOME_MAX_DYN_POS_ERROR is not
equal to 0, the value overrules the setting of SAC_PAR_MAX_DYN_POS_ERROR during
homing. The two parameters SAC_PAR_HOME_SAT_LEVEL and
SAC_PAR_HOME_MAX_DYN_POS_ERROR are default set to 0.
Note:
The SAC parameters SAC_PAR_HOME_SAT_LEVEL and
SAC_PAR_HOME_MAX_DYN_POS_ERROR are not supported for an IndraDrive-based
axis.
Table 21 Homing modes
Nr.
Homing mode
0
SAC_HOME_MODE_AXIS_POS
1
SAC_HOME_MODE_SETPOINT_POS
2
SAC_HOME_MODE_POS_ENCODER
3
SAC_HOME_MODE_INDEX_ONLY
4
SAC_HOME_MODE_AREA_ONLY
5
SAC_HOME_MODE_INDEX_AREA
6
SAC_HOME_MODE_END_OF_STROKE
7
SAC_HOME_MODE_AREA_NEAR_EOS
8
SAC_HOME_MODE_INDEX_NEAR_EOS
9
SAC_HOME_MODE_INDEX_ON_AREA_NEAR_EOS
10
SAC_HOME_MODE_LIMIT_SWITCH_ONLY
11
SAC_HOME_MODE_INDEX_LIMIT_SWITCH
12
SAC_HOME_MODE_LIMIT_SWITCH_NEAR_EOS
13
SAC_HOME_MODE_INDEX_LIMIT_SWITCH_NEAR_EOS
All homing modes are described in more detail in the following paragraphs.
Note:
When a SinCos encoder is used, the homing modes which use an index pulse
can be used by setting the threshold level for the SinCos reference signal. This
does not apply for EnDat2.1, EnDat2.2 and Hiperface encoders.
Define home “axis position” (0)
On execution of define home “axis position”, the axis position is set to the user
defined position (also called the home offset) and the axis setpoint position is
changed accordingly, such that the actual position error is unchanged. The axis
does not move. Fig. 18 illustrates the homing sequence for this mode.
axis position at SacHome = home offset
Fig. 18 Define home “axis position”
axis position
88/158
Bosch Rexroth AG
NYCe4000 Software User Manual
Single Axis Control (SAC) and Multi Axes Control (MAC)
Define home “setpoint position” (1)
On execution of define home “setpoint position”, the axis setpoint position is set to
the user specified position and the axis position is changed accordingly, such that
the actual position error is unaffected. The axis does not move.
Define home “position encoder” (2)
On execution of define home “position encoder”, the axis position - at which the
encoder has its zero position - is set equal to the home offset and the axis
setpoint position is changed accordingly such that the position error is unaffected.
The axis does not move. This procedure is especially useful if an absolute
encoder position is fed to the motion control unit as position control data. Fig. 19
illustrates the homing sequence for this mode.
zero position
encoder position
axis position at encoder
zero position = home offset
current position at SacHome
axis position
Fig. 19 Define home “position sensor”
If an incremental encoder is used instead of an absolute encoder, the axis has to
find its absolute position in its application. Normally, external sensors are used to
find the zero reference position.
Note:
The Hiperface “home on encoder position” is only supported for Bosch Rexroth
Hiperface encoders/motors, and EnDat2.1 “home on encoder position” is only
supported for Heidenhain EnDat2.1 encoders.
Home search “index only” (3)
On execution of home search “index only”, the (detected) index pulse is used to
determine the home position. Fig. 20 illustrates the homing sequence for this
mode. At “event” 1, the function SacHome is called. During “event” 2, the axis
performs a movement in the home search direction, which is determined by the
sign of the home velocity. At “event” 3, the index is found. The axis position is set
equal to the home offset and the axis setpoint position is changed accordingly,
such that the position error is unchanged. During “event” 4, the axis is stopped.
home search
direction
1
3
2
4
index
axis position at SacHome
Fig. 20 Home search “index only”
axis position is home offset
axis position
NYCe4000 Software User Manual
Bosch Rexroth AG
89/158
Single Axis Control (SAC) and Multi Axes Control (MAC)
Home search “area only” (4)
On execution of home search “area only”, the (activated) area switch is used to
determine the home position. The polarity of the area switch is important with this
mode. Fig. 21 illustrates the homing sequence for this mode with the area switch
initially not active. At “event” 1, the function SacHome is called. During “event” 2,
the axis performs a movement in the home search direction, which is determined
by the sign of the home velocity. At “event” 3, the area edge is found. The axis
position is set equal to the home offset and the axis setpoint position is changed
accordingly. The position error remains the same. During “event” 4, the axis is
stopped.
home search
direction
3
1
2
4
area switch active
axis position at SacHome
axis position is home offset
axis position
Fig. 21 Home search “area only”, area switch initially not active
Fig. 22 illustrates the homing sequence for this mode with the area switch initially
active. At “event” 1, the function SacHome is called. During “event” 2, the axis
performs a movement opposite to the home search direction, which is determined
by the sign of the home velocity. At “event” 3, the moving axis is reversed (not
stopped) after the area switch has become inactive. During “event” 4, the axis
performs a movement in the home search direction. At “event” 5 the area edge is
found. The axis position is set equal to the home offset and the axis setpoint
position is changed accordingly. The position error is unaffected. During “event” 6,
the axis is stopped.
5
6
home search
direction
4
1
3
2
area switch active
axis position is home offset
Fig. 22 Home search “area only”, area switch initially active
axis position
axis position at SacHome
90/158
Bosch Rexroth AG
NYCe4000 Software User Manual
Single Axis Control (SAC) and Multi Axes Control (MAC)
Home search “index and area” (5)
The home search “index and area” uses a combination of area switch and index
to determine the home position. The polarity of the area switch is important with
this mode. Fig. 23 illustrates the homing sequence for this mode with the area
switch initially not active. At “event” 1, the function SacHome is called. During
“event” 2, the axis performs a movement in the home search direction, which is
determined by the sign of the home velocity. During this movement, the area
switch active is found. The movement is continued until the first index is found. At
“event” 3, the first index is found. The axis position is set equal to the home offset
and the axis setpoint position is changed accordingly. The actual position error is
not altered by the changes. During “event” 4, the axis is stopped.
home search 1
direction
3
4
2
index
area switch active
axis position at SacHome
axis position
axis position is home
Fig. 23 Home search “index and area”, area switch initially not active
Fig. 24 illustrates the homing sequence for this mode with the area switch initially
active. At “event” 1, the function SacHome is called. During “event” 2, the axis
performs a movement opposite to the home search direction, which is determined
by the sign of the home velocity. During “event” 3, the axis is reversed (not
stopped) after the area switch has become inactive. During “event” 4, the axis
performs a movement in the home search direction and finds the area switch
active. This movement is continued until the first index is found. At “event” 5, the
first index is found. The axis position is set to the home offset and the setpoint
position is changed accordingly, taking into account the actual position error.
During “event” 6, the axis is stopped. Note that the index is not necessarily on the
area.
5
4
home search
direction
6
1
3
2
index
area switch active
axis position
axis position at SacHome
axis position is home
Fig. 24 Search home “index and area”, area switch initially active
Home search “end of stroke” (6)
The home search “end of stroke” starts a movement of the axis with constant
velocity, see Fig. 25. As soon as either the position error or the controller output
exceeds a certain threshold with sign of the direction of movement, it is assumed
that an end of stroke is detected. The axis switches to the SAC_FREE state with
constant controller output (SAC_PAR_HOME_EOS_OUTPUT) during a certain time
(SAC_PAR_HOME_EOS_OPEN_LOOP_TIME), “t” in Fig. 25. After that time the axis
position is set equal to the home offset and the controller output is set to zero.
NYCe4000 Software User Manual
Bosch Rexroth AG
91/158
Single Axis Control (SAC) and Multi Axes Control (MAC)
Fig. 25
“end of stroke” home
Home search “area near end of stroke” (7)
Find end of stroke in the direction specified by the home velocity and in
accordance with the specified criterion. Once found, search the edge of the area
sensor in opposite direction, and define the home position at that edge.
Home search “index near end of stroke” (8)
Find end of stroke in the direction specified by the home velocity and in
accordance with the specified criterion. Once found, search the first index in
opposite direction, and define the home position at that index.
Home search “index and area near end of stroke” (9)
Find end of stroke in the direction specified by the home velocity and in
accordance with the specified criterion. Once found, search the first index pulse
on the area sensor in opposite direction, and define the home position at that
index.
Home search “limit switch only” (10), “index and limit switch” (11), “limit switch
near end of stroke” (12) and “index and limit switch near end of stroke” (13)
The main goal of the homing functionality is to enable the user to use a limit
switch instead of an area switch when homing. For homing with limit switch,
exactly the same parameters are used as for homing with area switch. The use of
either area or limit is expressed by the “home mode” parameter. Essential
difference between homing with area and homing with limit switch are:
Before homing with limit switch is started, the detection of the limit switches is
disabled.
After homing with limit switch has been completed or aborted (due to an error),
detection of the limit switch results in an error again.
Obviously, instead of the area switch input, the limit switch input is inspected to
make decisions concerning the homing sequence.
Home search with area is based on the rising edge of the area. Therefore
“home” is usually found on the area. Home search with limit switch is based on
the falling edge of the limit switch. Therefore “home” is usually found in the
safe area of the axis, and not on the limit switch. The latter would result in an
error immediately after completion of the homing procedure. Note that
definition of active is configurable as active at high voltage or active at low
voltage. By rising edge the transition from inactive to active is meant, by falling
edge the transition active to inactive.
92/158
Bosch Rexroth AG
NYCe4000 Software User Manual
Single Axis Control (SAC) and Multi Axes Control (MAC)
Either the negative or the positive limit switch is used in the homing sequence. If
the home velocity parameter is positive, the positive limit switch is used. If this
parameter is negative, the negative limit switch is used.
Home search with software end switches enabled
When performing normal point-to-point movements and the position falls outside
the work area defined by the software end switches (positive and negative), an
error will be detected and the respective error handler is executed.
During a homing operation, however, this functionality is temporarily disabled. For
instance, on execution of define home “axis position” with the home offset outside
the work area, no error will be detected. However, when the axis is subsequently
moved one increment or more from the work area, an error will be detected. This
is not the case when the axis moves towards the work area.
Point-to-point
The point-to-point functionality moves the axis from the current position to the
requested destination. The destination for the axis can be programmed as an
absolute position or a relative position. The relative position is relative to the
current axis setpoint position. The client always specifies the maximum velocity,
acceleration, jerk and (especially for a stepper axis) the base velocity and preand post-delay for acceleration / deceleration. Based on these constraints, the
axis controller computes a smooth and time-optimal movement. The client can set
the point-to-point parameters with the function SacPointToPoint.
Quadratic / Stepper
Cubic
Position
Velocity
V0
Acceleration
2
1
2
3
4
4
5
6
7
6
Jerk
Time
Fig. 26
Time
Point-to-point profiles
There are two point-to-point profiles supported, based on the constraint chosen
for the jerk.
NYCe4000 Software User Manual
Bosch Rexroth AG
93/158
Single Axis Control (SAC) and Multi Axes Control (MAC)
If the jerk is set equal to SAC_INDEFINITE, a quadratic point-to-point profile is
started at stepper base velocity V0, with the pre- and post-delay for acceleration /
deceleration taken into account. For servo motors, the base velocity is usually 0.
If the jerk is set not equal to SAC_INDEFINITE, a cubic point-to-point profile is
started, where the stepper base velocity and the pre- and post-delay for
acceleration / deceleration are not taken into account.
Note:
The delays are not visible in the profile, only in the controller output and phase.
Fig. 26 shows a complete quadratic and cubic point-to-point profile. The profiles
are divided into the phases shown in Table 22.
Table 22 Point-To-Point phases
Nr.
Point-To-Point phase
1
linear increase in acceleration
2
constant acceleration
3
linear decrease in acceleration
4
constant velocity
5
linear increase in deceleration
6
constant deceleration
7
linear decrease in deceleration
Depending on the actual parameters of the point-to-point movement a cubic or
quadratic profile is used. For a quadratic profile, phases 1, 3, 5 and 7 are omitted,
resulting in steps in the acceleration. The use of a cubic point-to-point profile
results in a smoother movement.
A point-to-point movement can be commanded when the axis is at standstill, but
can also be commanded when the axis is moving. In the latter case, an end point
correction will be performed. The type of point-to-point profile used for the
movement depends only on the jerk or end-point correction.
Jogging
The jogging functionality moves the axis with a constant velocity. Jogging
movements can be programmed with either positive, negative or zero velocity.
The jogging movement is started by the function SacStartJog. The jogging
movement is stopped by the function SacStopJog.
There are two jogging profiles supported. The cubic profile is the same as for a
cubic point-to-point profile and the stepper profile is the same as for a stepper
point-to-point profile, as seen in Fig. 26. The only difference is that the duration of
phase 4 is unlimited. When SacStartJog is given, the profile phases 1, 2 and 3
are executed. When SacStopJog is given, profile phases 5, 6 and 7 are executed.
Feed Override
The feed override functionality applied on a profile effectively lengthens or
shortens the duration. Feed override is defined for point-to-point, jog and spline
profiles.
Applying a feed override factor, say α, to a point-to-point profile implies that the
setpoint velocity of the axis is multiplied by a factor α, the acceleration by a factor
94/158
Bosch Rexroth AG
NYCe4000 Software User Manual
Single Axis Control (SAC) and Multi Axes Control (MAC)
α2, and the jerk by a factor α3, in order to travel the trajectory the same way. The
duration of the setpoint profile is thus reduced by a factor α.
Fig. 27 displays three point-to-point movements with different feed override
factors:
1. Original point-to-point movement (feed override factor = 1)
2. Original point to point with feed override factor set to 2 during the movement.
3. Original point-to-point movement with feed override factor of 2 for the
complete movement.
A feed override equal to 1 corresponds to the “nominal” profile. The commanded
setpoint profile is not adjusted. Note that the constraints on velocity, acceleration
and jerk may be violated when α > 1 (these constraints are discussed in the
section ‘Configurable Errors Explained’ on page 76). On the other hand, if the
feed override α < 1 and during path planning time optimality has been pursued,
time optimality is lost. Both consequences, possible violation of constraints and
no time optimality are the responsibility of the user.
Position
3
2
1
Time
Velocity
Time
Acceleration
Feed override transition time (T)
Time
Fig. 27
Feed override on a point-to-point movement
On applying a new feed override factor a transition time (T) must be specified.
The transition time T > 0 is of interest when the feed override is modified during
the execution of a movement. This guarantees a smooth transition to the new
feed override factor by gradually increasing or decreasing the setpoint velocity
NYCe4000 Software User Manual
Bosch Rexroth AG
95/158
Single Axis Control (SAC) and Multi Axes Control (MAC)
and acceleration. If the transition time (T) equals zero, no smooth transition is
made. The new setpoint for velocity and acceleration are generated immediately.
When the new feed override parameters are used, depends on the state of the
axis. If the axis is not in the SAC_MOVING state, the new feed override parameters
will be used at the first next movement to be executed. If the axis is in the
SAC_MOVING state, the feed override parameters are used at the sample at which
the new parameters are activated.
To set a new feed override factor, the function SacSetFeedOverride is available.
Two variables are related to feed override.
SAC_VAR_FEED_OVERRIDE_STATUS indicates if the feed override is constant or
changing. The changing of the feed override occurs during the transition time.
SAC_VAR_ACTUAL_FEED_OVERRIDE holds the actual feed override value.
Stop
The stop functionality is used to interrupt each kind of movement immediately.
Three different functions are provided for this purpose:
SacSmoothStop
SacQuickStop
SacFullStop
The function SacSmoothStop stops a movement according to the “smooth stop”
profile. This profile decelerates according to specified values for deceleration and
jerk until the velocity of the axis is equal to zero. During a smooth stop, it is not
guaranteed that the velocity monotonously decreases to zero. This is in particular
true, when the jerk parameter is small with respect to the acceleration at the
moment the smooth stop is started.
The function SacQuickStop stops a movement according to the “quick stop”
profile. This profile decelerates according to a specified value for deceleration
only until the velocity of the axis is zero.
The function SacFullStop stops a movement according to the “full stop” profile.
The “full stop” functionality is intended for stepper motors only, but this
functionality can also be used with the other motor types.
Attention!
The “full stop” profile decelerates with an infinite deceleration. The velocity of the
axis is abruptly set to zero, and may cause damage to the machine. Also, note
that motors with a large load and connected by an NY4120 or NY4140 drive
module may return the mechanical energy stored in the machine converted into
electrical energy to the drive module. This so-called regeneration energy can
damage the drive module and/or drive power supply. See the chapter “NY4930
Brake Unit” in the NYCe4000 Standard Housings and Accessories Manual.
The functions SacSmoothStop, SacQuickStop and SacFullStop perform the
requested stop profile immediately on the specified axis, even when that axis is
member of a synchronized group. With the function MacStartSyncGroup you can
perform a stop profile synchronously for all axes in a group (see chapter 8.14).
Example of a smooth stop:
Suppose an axis is moving at a velocity of 10 pu/s with an acceleration of 40
pu/s2. At a certain moment, a smooth stop is started with a maximum acceleration
of 20 pu/s2 and a maximum jerk of 10 pu/s3. The change in acceleration of the
axis can be divided into three phases:
1. a decrease in acceleration from 40 pu/ s2 to 0 pu/s2
2. an increase in acceleration from 0 pu/ s2 to -20 pu/ s2 (note the minus sign)
3. a decrease in acceleration from -20 pu/ s2 to 0 pu/ s2 (note the minus sign)
96/158
Bosch Rexroth AG
NYCe4000 Software User Manual
Single Axis Control (SAC) and Multi Axes Control (MAC)
Phase 1 of the smooth stop lasts 40/10 = 4 seconds, during which time the axis
will continue to accelerate up to a velocity of 90 pu/s. In phase 2, the maximum
smooth stop acceleration is reached in 20/10 = 2 seconds. In phase 3, which also
lasts 2 seconds, the axis comes to a complete standstill. Between phases 2 and
3, during 2.5 seconds, the speed of the axis is decreased from 70 pu/s to 20 pu/s
with a constant acceleration of -20 pu/s2. The velocity, acceleration and jerk of the
axis during the smooth stop are displayed in Fig. 28.
In this total time of 10.5 seconds, the axis will cover a distance of 759,167 pu
before the axis will actually stop. According to the following equations, the
distance covered is calculated:
4
S1 v(t )dt v0 t 12 a0 t 2 16 j max t 3 10 * 4 12 * 40 * 16 16 * 10 * 64 466.667 pu
0
10.5
S2
4
v(t )dt 45 * 6.5 292.5 pu
S smooth S1 S 2 759.167 pu
Smooth stop
Velocity
90
90
70
70
45
45
S
20
10
0
S2
20
10
0
Time (sec)
4
2
2.5
Time (sec)
0,5
2
Acceleration
Acceleration
40
40
20
10
20
10
Time (sec)
-10
-20
Time (sec)
-10
-20
Jerk
Jerk
10
-10
Fig. 28
Quick stop
Velocity
Time (sec)
1 2 3 4 5 6 7 8 9 10 11
10
-10
Time (sec)
1 2 3
Smooth stop and quick stop profile
A quick stop with the same maximum acceleration as the smooth stop is now
initiated for the axis moving at a velocity of 10 pu/s. In this case, the axis will
always stop with a monotonously decreasing velocity. The axis now covers a
distance of only 2.5 pu before it stops. According to the following equation, the
distance covered is calculated:
1
Squick 10 0.5 2.5 pu
2
The velocity, acceleration and jerk of the axis during the quick stop are also
displayed in Fig. 28.
NYCe4000 Software User Manual
Bosch Rexroth AG
97/158
Single Axis Control (SAC) and Multi Axes Control (MAC)
8.13 Electronic Camming and Gearing
This module contains the functions:
SacEcgLink
SacEcgUnlink
SacEcgLockGear
SacEcgSetMasterSign
SacEcgUnlock
SacEcgSetMasterPos
SacEcgChangeMasterPos
SacEcgLockCam
SacEcgShiftCamTable
Electronic camming and gearing functionality enables one axis (the slave axis) to
move with a defined relation to another axis (the master axis).
With the gearing functionality the position of the slave axis follows the position of
master axis in such a way that the velocity of the slave axis is proportional to the
velocity of the master axis by a factor. This factor is called the gearing ratio, and
is a fixed ratio between the master and slave velocity. The master position may
either be a setpoint or a servo position of any type of axis; the slave position is
always a setpoint position.
With the camming functionality the position of the slave axis follows the position of
master axis defined by a function. The relation can be represented by the
formulae x s (t) = f( x m (t)) where f represents the cam function.
The cam function is defined using a cam table that specifies pairs of master and
slave positions for a given interval of the cam function.
Fig. 29
Master axis and slave axis relationships
Fig. 29 shows the possible master/slave relationships for camming and gearing,
except that for gearing no cam tables are involved. The network has 2 master
axes and 3 camming slave axes. Slave axis 1 has a local (on the same node)
master axis. Slave axes 2 and 3 have a master on another node in the network.
The cam tables are stored on the node, and any slave can use any cam table
located on the same node. Also, a cam table can be used by multiple slave axes
and multiple slave axes can be linked to one master. An axis can function as
master and slave at the same time. Make sure that no loops are created as this is
not checked in the software and will cause undefined behavior.
Due to performance issues ECG functionality at a sample frequency of 8 kHz over
multiple nodes where the master is not on the same node as the slave(s) is not
supported.
The function SacEcgLink links a slave axis to a master axis and defines the
master position source (axis or setpoint position). The slave axis may not already
be linked to another master axis and the slave axis can not be its own master
axis. If the slave axis is linked, it does not imply that the axis is already camming
or gearing, because the function SacEcgLockCam or SacEcgLockGear is not (yet)
called. The master position data is sent to the linked slave(s) after the link has
98/158
Bosch Rexroth AG
NYCe4000 Software User Manual
Single Axis Control (SAC) and Multi Axes Control (MAC)
been established. If a slave is not locked and the master position changes, the
error SAC_AX_ERR_MASTER_POSITION_LOSS (for example) can occur.
The function SacEcgLockGear starts the actual gearing, SacEcgLockCam starts the
actual camming with the specified parameters. The slave axis starts to follow a
transition profile after which it moves with velocity proportional to the velocity of
the master axis in case of gearing, and moves according to the specified cam
table in case of camming.
It is possible that the master axis is already moving at the moment the slave axis
is locked to the master axis for camming or gearing. In this situation, to avoid
discontinuity of the position and velocity, a gradual transition from the initial state
to the locked state is required. The special trajectory is called transition profile.
The slave axis follows the transition profile for as long as the master axis covers a
certain distance or has not reached its position which is specified in
masterEndPos. The transition profile is defined by the masterEndPos,
slaveEndPos and the SAC_ECG_LOCK_MODE.
Fig. 30
Transition from current position to locked position
In Fig. 30, the blue line defines the points in the cam table. The function
SacEcgLockCam is executed at the position “Current position”. Because the actual
master-slave position is generally not a point on the cam function, the transition
profile is used to ‘enter’ the cam function in a smooth way. The “Locked position”
is determined by the specified masterEndPos, slaveEndPos and the lock mode.
SAC_ECG_LOCK_MODE defines how the end positions must be interpreted. They can
be defined as relative or absolute positions or “auto lock mode”. For the relative
lock modes, masterEndPos and/or slaveEndPos is interpreted as a relative
position referenced by the current position. For the absolute lock modes,
masterEndPos and/or slaveEndPos is interpreted as an absolute position. If the
application does not care about the slave position, the lock mode can be set to
SAC_ECG_LOCK_MAS_ABS_SLAVE_AUTO or SAC_ECG_LOCK_MAS_REL_SLAVE_AUTO. In
these lock modes the slaveEndPos is calculated by the system.
After the transition is finished, the slave position is defined by the cam function as
function of the master position. The slave axis follows the master axis according
to the cam table, starting at a master position defined in the cam table specified
by masterTablePos.
Gearing or camming is stopped using the function SacEcgUnlock. The stop
camming or gearing is performed by using a “lock gear” with ratio 0 in lock mode
SAC_ECG_LOCK_MAS_REL_SLAVE_AUTO. Gearing or camming is also stopped when
a new movement is send directly to the slave axis. The lock also breaks when a
SacFullStop, SacQuickStop or a SacSmoothStop is executed on the slave axis
(the link remains active).
After SacEcgUnlock a call to SacSynchronize on SAC_REQ_MOTION_STOPPED is
NYCe4000 Software User Manual
Bosch Rexroth AG
99/158
Single Axis Control (SAC) and Multi Axes Control (MAC)
required, because the slave axis will transition from the state SAC_MOVING
(SAC_SPG_GEARING / SAC_SPG_CAMMING) to the state SAC_READY (SAC_SPG_IDLE).
It is possible that the slave axis is already in the state SAC_READY (SAC_SPG_IDLE)
when the function SacEcgUnlock is called, for example when the SacEcgLockGear
or SacEcgLockCam was not called, or the lock was broken. Even in this situation a
call to SacSynchronize on SAC_REQ_MOTION_STOPPED is required after the call of
SacEcgUnlock, else the error SPG_ERR_STATE_ERROR may be returned.
To gear or cam again, SacEcgLockGear or SacEcgLockCam must be called for the
concerning slave axis.
The function SacEcgUnlink removes the link between a slave axis and the master
axis. The link can only be removed if the axis is not camming or gearing.
Notes:
1. The encoder resolution of the master axis must have been defined correctly
(master axis already initialized) before performing a SacEcgLink. The encoder
resolution of the master axis may not be changed as long as the link exists.
2. Gearing or camming only operates as expected when all nodes involved use
the same sample frequency.
3. Keep in mind that a high-resolution encoder on a slave axis, combined with a
large gearing ratio, may cause an overflow of the 32 bit counter of the pulses
in the software. In that condition, the slave axis stops and the axis controller
remains in the state SAC_READY. No error is generated. See also chapter 2.5
“Limitations”.
4. If the axes that are geared or cammed together are not on the same node,
you must have a host in the IEEE 1394b network to make sure that the nodes
are synchronized. See also chapter 2.5 “Limitations”.
5. Camming and gearing functionality is not supported in sequences.
The setpoint of the slave axis is determined by the master position. The slave axis
predicts the next master position. Otherwise the slave setpoint would lag one
sample behind the master position. The master position is predicted by an
extrapolation method. A problem with extrapolation methods is the introduction of
high frequency noise. The methods perform poor for frequencies above fs/2•
where fs is the sample frequency. This noise on the setpoint will never affect the
stability of the slave axis. An additional low pass filtering is used to reduce the
high frequency noise which causes unnecessary dissipation in amplifier and
motor, and possible limit cycling. The low pass filter frequency is defined by the
parameter SAC_PAR_ECG_PREDICTION_FILTER_FREQ representing the break
frequency of the low pass filter, the damping ratio is fixed for this filter. When the
value for this parameter is low, less noise is introduced but the slave axis will
have more lag behind of the master axis. While increasing the value, noise in the
slave setpoint will increase but the slave axis will have less lag behind the master
axis.
The parameter SAC_PAR_ECG_PREDICTION_HORIZON sets the number of samples
the prediction filter predicts the master axis position. This parameter must be set
to a value at least matching the delay in the system. The prediction value is
among others depending on the number of samples delay between the master
axis and the slave axis. See Fig. 31 for delays in the system.
100/158 Bosch Rexroth AG
NYCe4000 Software User Manual
Single Axis Control (SAC) and Multi Axes Control (MAC)
MASTER
generation of
master setpoint
tspt
SLAVE
master position
available for
slave setpoint
generator
master setpoint
position available
for trace
tmdrv
trcv
master setpoint
processed
by controller
tspx
generation of
slave setpoint
tmc
master axis position
reaches setpoint
tcom
tapt
master axis position
available for trace
tapx
slave setpoint
position available
for trace
tspt
tsdrv
slave setpoint
processed
by controller
tsc
master position
available for
transmission
to slave
slave axis position
reaches setpoint
Fig. 31
tapt
slave axis position
available for trace
The delay times between the master axis and a slave axis
The delay times depend on the location of the controller(s), on the MCU, on the
drive module or on the IndraDrive, see Table 23.
NYCe4000 Software User Manual
Bosch Rexroth AG 101/158
Single Axis Control (SAC) and Multi Axes Control (MAC)
Table 23 Delay times relevant for the prediction value in master axis to slave axis
Delay time (*)
tmdrv , tsdrv
Detailed description
Time elapsed between generation of the setpoint of an axis and the
moment the setpoint is completely processed by the controller.
If the PVL controller is on the MCU the setpoint position is
immediately processed by the PVL, and the PVL output is
asynchronously passed to the drive. In this case the introduced
delay, tmdrv or tsdrv is less than 1 sample.
If the PVL controller is on the drive the setpoint position is passed
synchronously with the next DSP sample to the PVL, and it takes
almost another (DSP) sample before the setpoint interpolator in the
PVL controller reaches this position. In this case the introduced
delay, tmdrv or tsdrv is approximately 2 DSP samples.
If the PVL controller is on the IndraDrive the setpoint position is
passed to the NY4150, where it is passed to the IndraDrive during
the next DSP sample. It takes another DSP sample before this
position is completely processed in the controller. In this case the
introduced delay, tmdrv or tsdrv is approximately 3 DSP samples.
tmc , tsc
These are delays introduced in the controller of the master and the
slave, respectively, and strongly depend on the tuning of the
parameters of the master and slave control loop, and the dynamic
content of the setpoint signals. For example, accurate tuning of friction
and velocity feedforward can significantly reduce the “delay” during
constant velocity. For an ideal controller, the delay times tmc and tsc are
both 0.
Tapx
The time between the moment the axis actually reaches the setpoint
position and the moment this axis position can be transmitted.
For an axis on a drive module this delay tapx is 0 samples.
For an axis on an IndraDrive this delay tapx is 1 sample.
Tspx
The time between the moment the setpoint position is generated and
the moment this position can be transmitted. As the master position is
transmitted to the slave in the same sample in which the setpoint
position of the master is generated, this delay is always 0 samples.
Tcom
This is the actual communication time between the master and the
slave. The delay is always 1 sample, independent whether the master
and slave are on different nodes or on the same node.
Trcv
Time between the reception of the master position data and the
processing of these data in the slave setpoint generator. This delay is
always 0 samples.
(*) Delay times are rounded to integer multiples of the DSP sample time. A delay of 0
samples means that the described actions are performed in the same sample. A delay of n
samples indicates that n sample interrupts have occurred between the two actions. For
IndraDrive axes, and axes on drive modules running on the PVL on the drive, this gives a
total time which is accurate within less than 1 DSP sample. If for one or both of the axes the
PVL is running on the MCU, the controller output is communicated asynchronously to the
drive. In that case delays become dependent of the configuration of the node, the number of
axes, etc.
The delay times tspt and tapt are the delays between reaching the setpoint or axis
position and the moment they are shown in the trace. For axes on the drive
modules and IndraDrive setpoint positions the delays are 0 samples. For
IndraDrive axes, the axis position is delayed by 1 sample in the trace. This must
be taken into account when tuning the prediction horizon using trace data, for
example via the NYCeScope, but is not relevant for the actual performance.
102/158 Bosch Rexroth AG
NYCe4000 Software User Manual
Single Axis Control (SAC) and Multi Axes Control (MAC)
The prediction horizon must be set equal to the delay between master and slave
position as introduced by the system and the controller. The following summary
gives an overview of relevant delays. In this overview the delays of master and
slave controller, tmc and tsc are left out of consideration. Also, tspx and trcv are not
considered as they are 0 in practice.
The master position is a setpoint position. Delays are as follows.
- delay between master setpoint and slave setpoint position : tcom
- delay between master setpoint and slave axis position : tcom + tsdrv
- delay between master axis position and slave setpoint position : tcom – tmdrv
- delay between master axis position and slave axis position : tcom + tsdrv – tmdrv
Note that the delay between the positions usually depends on the drive
communication. Relevant delays can be negative (!). For example, if the master
is an IndraDrive and the slave is an axis on a drive module with the PVL on the
MCU, the delay between master and slave axis position is less than –1.
The master position is an axis position. Delays are as follows.
- delay between master setpoint and slave setpoint position : tmdrv + tapx + tcom
- delay between master setpoint and slave axis position : tmdrv + tapx + tcom + tsdrv
- delay between master axis position and slave setpoint position : tapx + tcom
- delay between master axis position and slave axis position : tapx + tcom + tsdrv
For applications, typically the delay between the master setpoint and slave
setpoint position is relevant and/or the delay between master axis and slave axis
position. Depending on the master/slave configuration and the selected master
source (setpoint or axis position), this delay ranges from –2 up to 5 samples.
The function SacEcgSetMasterSign sets the specified slave axis to use the
specified sign for the conversion of the master input to master displacements.
Default the master input conversion to master displacements uses a positive sign.
The function SacEcgSetMasterPos sets a new value for the current master axis
position on the specified slave axis. From the moment the slave axis is linked to a
master axis, the value is kept updated with the master displacements. The update
is stopped after the function SacEcgUnlink is executed.
It is the responsibility of the application for correct use of SacEcgSetMasterPos.
For example, the master position is not well defined on the slave axis when the
master axis is moving during the execution of SacEcgSetMasterPos.
The function SacEcgChangeMasterPos subtracts the specified master offset from
the master position variable of the slave axis. SacEcgChangeMasterPos can be
used to prevent roll-over on the master position variable, or to change this
variable for modulo operation on the actual master axis.
The function SacEcgShiftCamTable requests the slave axis to continue camming
with the same cam profile, but with a shifted cam function. The axis controller
must be in the state SAC_MOVING and the setpoint generator must be in the state
SAC_SPG_CAMMING.
8.14 Synchronize Groups
This module contains the functions:
MacDefineSyncGroup
MacGetSyncGroup
MacStartSyncGroup
MacDeleteSyncGroup
The Multi-Axis synchronization functionality offers the user the possibility to
synchronize the start of certain actions on a group of axes. The synchronization
groups are defined by the user. Actions that may be synchronized this way are
NYCe4000 Software User Manual
Bosch Rexroth AG 103/158
Single Axis Control (SAC) and Multi Axes Control (MAC)
the start of a movement, the modification of the feed override and a
synchronously executed stop profile.
Note:
If the axes that must be synchronized are not on the same node, you must have a
host in the IEEE 1394b network to make sure that the nodes are synchronized.
See also chapter 2.5 “Limitations”.
To allow synchronization of grouped actions the following functions are available:
MacDefineSyncGroup defines a group of axes which have to perform
synchronized actions. Definition of a group is only possible as long as group
identifiers are available. If all group identifiers are in use, the user must delete
an existing group before a new group can be defined.
MacGetSyncGroup retrieves the axis identifier of the axes contained in the
group with the specified group identifier. The axis identifiers returned are
ordered in the same way as they were when the group was defined.
MacStartSyncGroup starts the execution of a certain action for all axes
belonging to a group. If, for example, a point-to-point movement must be
started simultaneously on a number of axes, the command SacPointToPoint
is sent to each of the axes. However, if an axis is not a member of a
synchronized group, the command is executed on the axis at the moment the
command is received. Thus, no synchronization between the axes is possible.
If the axis is member of a synchronized group, the immediate execution of the
point-to-point movement is postponed. With the function MacStartSyncGroup
the specified movements are simultaneously started on all axes defined in the
group if the syncAction id is MAC_SYNC_MOTION.
With the syncAction id’s MAC_SYNC_SMOOTH_STOP, MAC_SYNC_QUICK_STOP, and
MAC_SYNC_FULL_STOP you can execute a stop profile synchronously on all axes
defined in the group. Note that a synchronous stop of axes in a group is not
possible with the function SacSmoothStop, SacQuickStop or SacFullStop
because these functions perform the requested action immediately on the
specified axis.
MacDeleteSyncGroup deletes a group of axes. After execution of this function
starting movements and changing feed override is possible in the normal way,
implying immediate execution of the respective command at reception.
The SAC commands related to a synchronized start of a movement are
SacPointToPoint, SacStartJog, SacStartInterpolation, SacEcgLockGear
and SacEcgLockCam.
The Multi-Axis Synchronization functionality uses the following sequence.
1. Define synchronization group (MacDefineSyncGroup)
2. Call SAC command related to a movement (for example SacPointToPoint) or
change feed override for the appropriate axes.
3. Start synchronization group (MacStartSyncGroup)
4. Delete synchronization group (MacDeleteSyncGroup).
If the group has been defined, the SAC commands related to a movement are not
executed immediately by the axes belonging to the group. These commands are
only executed by the axes of the group after the function MacStartSyncGroup is
called. Steps 1 and 4 must be called once. Steps 2 and 3 must be repeated each
time a certain action must be started synchronously for a group of axes.
Up to 16 [NYCE_MAX_NR_OF_SYNC_GROUPS] groups can be defined simultaneously.
These groups are not necessarily disjunctive, which means that one axis may be
a member of several groups. Each group is identified by an identifier when the
group is defined.
104/158 Bosch Rexroth AG
NYCe4000 Software User Manual
Single Axis Control (SAC) and Multi Axes Control (MAC)
Notes:
1. A home search (function SacHome) may only be executed by axes which do
not belong to a group.
2. The start of a move command is only synchronized for those axes of the
group that received a move command. Grouped axes which did not receive a
move command remain unaffected. The axes belonging to the group, which
are in the SAC_MOVING state, do not wait for group synchronization.
8.15 Spline
This module contains the functions:
SacClearInterpolantBuffer
SacStartInterpolation
SacStopInterpolation
SacWriteCubicInterpolant
SacWriteCubicIntBuffer
With the spline functionality, it is possible to build up a path from a number of
small segments. The axis controller computes a smooth profile through the
consecutive segments that are fed to it. A segment is defined by its end-position,
the velocity at that end-position and the traveling time to reach that end-position in
combination with a continuity requirement for the position and velocity at the start
of the segment. At each segment the spline profile is described by a third order
polynomial of time. Continuity of velocity is guaranteed at the junction points of
consecutive segments (Hermite splines). The velocity at these positions does not
have to be zero.
Note:
A spline profile does not have continuity of acceleration. If this type of continuity is
desired, the client should take care of this by appropriately choosing the traveling
times as well as the position and the velocity at the junction points.
The use of the spline functionality is illustrated by the example, shown in Fig. 32.
The point of interest of a motion system has to move from position A to position B
along an irregular path in a two-dimensional (2-D) space.
The motion system consists of two perpendicular axes: x and y. The 2-D path is
split in several small segments. The end-points of the segments are transformed
to axis positions. The velocity at each position is transformed to axis velocities.
A
B
Q
P
Fig. 32
A two-dimensional (2-D) path divided in a number of segments
Suppose the point of interest is at position P and the next position should be Q.
This last position is transformed to the axis positions Qx and Qy. The velocity at
NYCe4000 Software User Manual
Bosch Rexroth AG 105/158
Single Axis Control (SAC) and Multi Axes Control (MAC)
position Q is transformed to velocities Qx’ and Qy’. Assume that the traveling time
from position P to position Q is t.
These positions, velocities and traveling times are fed to the axis controllers of the
two axes in the following way:
Axis x gets at position P spline parameters Qx, Qx’ and t
Axis y gets at position P spline parameters Qy, Qy’ and t
The result is that the point of interest is at position Q; traveling time t after it was
at position P. In this way, the point of interest moves approximately along the
path. At least it is at the correct position at the end-point of the small segment.
The function SacWriteCubicInterpolant writes one spline segment to the
buffer. The axis controller uses a circular buffer to hold spline segments that are
not yet executed. The buffer may contain up to 128 segments. The end-position
as well as the velocity at the given position and the traveling time between two
consecutive positions is specified by the user. Apart from these parameters
another parameter is used: the generate event flag. This flag indicates whether or
not an event must be generated when the corresponding spline is started. The
last parameter is the splineId. With this splineId each spline segment can be
identified.
The function SacWriteCubicIntBuffer writes a maximum of 16 segments
[NYCE_MAX_NR_OF_SPLINE_SEGMENTS_WRITE] to the buffer.
The function SacStartInterpolation starts the spline interpolation. The axis
enters the SAC_MOVING state with setpoint state SAC_INTERPOLATING. The function
SacStopInterpolation indicates that the last spline has been written in the
buffer. The function SacClearInterpolantBuffer deletes all splines in the buffer.
To generate a profile made up from several splines, the following actions should
be done:
1. Send a number of absolute or relative splines to the spline buffer using the
function SacWriteCubicInterpolant.
2. Start spline interpolation using the function SacStartInterpolation.
3. Optionally: send an additional number of absolute or relative splines to the
spline buffer.
4. Stop spline interpolation using the function SacStopInterpolation.
The spline buffer should never become empty when the axis is making a spline
movement. Therefore, some splines should be sent to the axis controller before
the spline movement is started. If the buffer gets empty before the function
SacStopInterpolation is called, a spline buffer underflow error is detected and
the configured error handler is executed. See chapter ”Configurable Errors
Explained” on page 76 for an explanation of configurable error handling.
Notes:
1. When all splines in the buffer have been interpolated, the end velocity of the
last spline segment was 0 and the function SacStopInterpolation has been
called, the axis returns to the state SAC_READY.
2. When all splines in the buffer have been interpolated and either the end
velocity of the last spline is not equal to 0 or the function
SacStopInterpolation has not been called, a buffer underflow error is
detected.
The following event is available for splines.
SAC_EV_INTERPOLANT_STARTED: When a spline segment is started and an event
is generated, the splineId of the corresponding spline is returned as event data.
106/158 Bosch Rexroth AG
NYCe4000 Software User Manual
Single Axis Control (SAC) and Multi Axes Control (MAC)
8.16 Position Force Control
This module contains the functions:
SacPfcSetSensorConfiguration
SacPfcGetSensorConfiguration
SacPfcWriteForceProfile
SacPfcStartForceProfile
The position force control functionality is illustrated in Fig. 33. When the Z axis
moves down, the chip is pressed onto the substrate. The lever will rotate as a
result of the applied pressure.
Fig. 33
Position force control application
With the position force control functionality, it is possible to configure the force
sensor output and write the force segments into a force segment buffer. The force
segments in the buffer are executed by a new setpoint generator with state
SAC_SPG_PFC. A force segment consists of a ramp part and a plateau part. The
ramp part is defined by its end-force and the time to reach that end-force. The
plateau part is defined by the time to keep the force at the level which has been
reached at the end of the ramp.
The function SacPfcSetSensorConfiguration configures the force sensor of the
specified axis. You can set the sensor parameters only when the axis controller is
in the SAC_IDLE or SAC_INACTIVE state. The force sensor is configured with the
following properties.
The analog input (drive slot and number) used as force sensor input
The positive or negative relation between force and sensor output
The number of measurements (1 or 2) used to generate one average sensor
output
The scale factor that defines how many Newton (N) is represented by 1 Volt (V)
sensor output.
The function SacPfcGetSensorConfiguration retrieves the actual configuration
of the force sensor of the specified axis.
The function SacPfcWriteForceProfile writes the specified number of force
segments into the force segment buffer of the specified axis. If the buffer already
holds segments, they are overwritten by SacPfcWriteForceProfile.
The maximum number of force segments that can be written with this function is
limited to [SAC_MAX_NR_OF_FORCE_SEGMENTS]. Further, the maximum time of a
ramp or plateau is 1800 seconds. Writing the force segments is only allowed
when the axis controller is in the state SAC_READY, or in the state SAC_MOVING and
the setpoint generator is not in the state SAC_SPG_PFC.
The function SacPfcStartForceProfile starts the interpolation of the force
segments previously buffered for the specified axis. The force profile can only be
started when the axis controller is in the state SAC_READY, or in the state
NYCe4000 Software User Manual
Bosch Rexroth AG 107/158
Single Axis Control (SAC) and Multi Axes Control (MAC)
SAC_MOVING and the setpoint generator is not in the state SAC_SPG_PFC. When the
interpolation starts, the axis controller changes to the state SAC_MOVING and the
setpoint generator changes to the state SAC_SPG_PFC.
The parameter SAC_PAR_PFC_KP sets the proportional gain for the profiles, and is
specified in [pu/N].
The following events are associated with the position force control functionality.
SAC_EV_PFC_FORCE_THRESHOLD_CROSSED
The event is generated when the actual force sensor output crosses the defined
threshold value specified in [N]. Two 32-bit words of event data are sent:
- Actual force sensor output in [N].
- Threshold transition (NEG_TO_POS or POS_TO_NEG)
The threshold is defined with the parameter SAC_PAR_PFC_FORCE_THRESHOLD,
and is specified in [N].
SAC_EV_PFC_FORCE_SEGMENT_STARTED
This event is generated when the execution of a force segment is started if the
generateEvent flag is set to TRUE. The event data that are sent is one 32-bit
word, representing the segment number.
SAC_EV_PFC_FORCE_PROFILE_COMPLETED
This event is event is generated without any event data, after the last force
segments in the buffer has been executed.
With the function SacReadVariable the actual force sensor output and average
force sensor output (in [N]) can be traced through the variables
SAC_VAR_PFC_ACTUAL_FORCE and SAC_VAR_PFC_AVERAGE_FORCE.
8.17 Modulo Axis
It is possible to represent the position of an axis as a modulo position, for
example the position values the axis position is represented with, are restricted to
a particular interval. However, the axis position itself may not be restricted to this
range, but it may cover a considerably larger position span. Then, an arbitrary
axis position along the axis is projected onto a position in the defined interval.
In the following examples, the unit to be used for the description of positions,
position differences, ranges etcetera is the unit “measuring system increments”,
unless mentioned otherwise.
An example of a modulo representation of a position, is the measured position of
an axis driven by a motor with an absolute encoder as displayed in Fig. 34. The
position values on the measuring system are restricted to the interval [-8, 7], but
the axis position span may involve many motor rotations. A movement of +1
increment at motor position 6 makes the new motor position value to become 7;
the same movement at motor position 7 yields a new motor position value of -8.
Fig. 34
Absolute rotary axis position
108/158 Bosch Rexroth AG
NYCe4000 Software User Manual
Single Axis Control (SAC) and Multi Axes Control (MAC)
A modulo position interval is characterized by its minimal position value POS_MIN
and its maximal position value POS_MAX. The period of the modulo interval is
POS_RANGE where,
POS_RANGE = POS_MAX - POS_MIN + 1.
The values for POS_MIN and POS_MAX should satisfy the following conditions:
POS_MIN < POS_MAX
-POS_RANGE < POS_MIN < POS_RANGE
-POS_RANGE < POS_MAX < POS_RANGE
All absolute position values are recalculated to position values in the interval
[POS_MIN, POS_MAX] by use of the modulo POS_RANGE operation. For the example
of Fig. 34, a displacement of -5 from the position -6 yields a position of -11, which
is outside of the modulo interval. By adding POS_RANGE (=16), this position is
recalculated to a position value of 5, which is within the modulo interval.
The interpretation of the difference between two modulo positions may give rise to
ambiguity, which has to be resolved. To give an example, if x=5 and y=-6 for the
example of Fig. 34, the value of x-y is 11, indicating a large positive distance
between x and y. However, in the previous paragraph, it appears that the same
positions x and y may be separated by a (smaller) negative distance of -5.
Therefore, a criterion should be set to uniquely decide between these two
interpretations. First, it is noted that the value of the difference between two
modulo positions x and y satisfies:
-(POS_RANGE - 1) <= (x-y) <= (POS_RANGE -1)
This value set is subdivided in intervals in which the difference (x-y) is interpreted
as a positive distance, and intervals in which it is interpreted as a negative
distance.
This is done in the following way:
-(POS_RANGE-1) <= (x-y) < -(POS_RANGE/2): then d = (x-y)+POS_RANGE
-(POS_RANGE/2) <= (x-y) <= (POS_RANGE/2): then d = (x-y)
(POS_RANGE/2) <= (x-y) <= (POS_RANGE-1): then d = (x-y)-POS_RANGE
in which d is the distance from y to x.
The parameters SAC_PAR_POSITION_UPDATE_MODE, SAC_PAR_POSITION_MIN and
SAC_PAR_POSITION_MAX are relevant for modulo position handling. For correct
operation of modulo axes these parameters should only be changed in the state
SAC_INACTIVE.
To install the modulo position function for an axis the configuration parameters
must be set as follows:
SAC_PAR_POSITION_UPDATE_MODE
= 1 (modulo)
SAC_PAR_POSITION_MIN
= POS_MIN/SAC_PAR_RESOLUTION
SAC_PAR_POSITION_MAX
= POS_MAX/SAC_PAR_RESOLUTION
POS_MIN and POS_MAX are the minimum and maximum position in increments.
SAC_PAR_POSITION_MIN and SAC_PAR_POSITION_MAX must be chosen such that
the earlier mentioned conditions are satisfied. If not the modulo settings are not
activated. The modulo position function is un-installed by the following
configuration parameter setting:
SAC_PAR_POSITION_UPDATE_MODE
0 (linear)
NYCe4000 Software User Manual
Bosch Rexroth AG 109/158
Single Axis Control (SAC) and Multi Axes Control (MAC)
The following sections mention the remarks for the usage of modulo position with
certain motion commands. The motion commands not mentioned have no
remarks.
Point-to-point
The absolute position which is input to the point-to-point command is converted to
a position within the modulo interval. The axis moves from the old position y to the
new position x via the shortest path; the axis displacement d is (see the
displacement calculation in the previous section):
d = (x-y) if -(POS_RANGE/2) <= (x-y) < (POS_RANGE/2)
d = (x-y)+POS_RANGE if -(POS_RANGE-1) <= (x-y) < -(POS_RANGE/2)
d = (x-y)-POS_RANGE if (POS_RANGE/2) <= (x-y) <= (POS_RANGE-1)
If d is negative, the axis moves in negative direction; if d is positive, the axis
moves in positive direction.
The displacement which is input to the relative point-to-point command is not
limited.
Note:
It is not possible to use software end-switch checking in combination with modulo
position. Software end-switch checking should be disabled by setting the variable
SAC_PAR_POS_SW_END_SWITCH ≤ SAC_PAR_NEG_SW_END_SWITCH.
Spline
Before an absolute cubic spline is written to the spline buffer, its position value is
checked to belong to the interval [POS_MIN, POS_MAX]. If this condition is not
satisfied, the spline is not written to the spline buffer.
Before a relative cubic spline is written to the spline buffer, the absolute value of
its displacement is not checked. Note that long segments are allowed.
8.18 Test signal generator
This module contains the functions:
SacStartTestSignal
SacStopTestSignal
SacSetTestSignalCountDirection
SacSetTestSignalCounter
The test signal generation functionality is used to inject test signals in the control
loop of the motion controller. With these test signals, the dynamical behavior of
the motion controller and/or the mechanics can be observed. The test signals can
be injected at different points of the motion controller.
At the setpoint position
As addition to the controller output signal
When the test signal generator is switched on, the type of test signal, the settings
for this type and the injection point are necessary. The settings imply the signal
scaling and offset and, in case of periodical signals, also the frequency and the
number of periods to be generated. The test signal generator can only generate
one test signal type per axis at the same time. When another test signal type is
selected while the test signal generator is already running, the generation of the
current signal type will be stopped.
110/158 Bosch Rexroth AG
NYCe4000 Software User Manual
Single Axis Control (SAC) and Multi Axes Control (MAC)
For all test signal types, it is possible to multiply the generated test signal with a
scale factor and to add an offset to it. This is done using the following equation:
injected test signal scaling generated test signal offset
Block Wave Test Signal
The block wave is symmetrical around the zero or the offset value, displayed in
Fig. 35. The duty-cycle is 50% and the generated test signal is either –1.0 or +1.0.
The frequency should be larger than 0.0001 Hz and smaller or equal to half the
sample frequency. Note that the value of the test signal is generated once each
sample period. Therefore, the block wave test signal will always display some
jitter if the sample frequency is not exactly a multiple of the test signal frequency.
When switching on the block wave test signal, it will always start with +1.0 for half
the period time. The signal can be inverted by supplying a negative scaling factor.
signal
offset + scale
offset
offset - scale
Fig. 35
Block wave test signal
Sine Wave Test Signal
The generated sine wave test signal lies in the interval [–1.0, 1.0] and starts the
offset value, displayed in Fig. 36. The sine wave test signal has the same
restrictions as the block wave. Because the value of the test signal is generated
once each MCU sample period, the quality of the sine wave test signal will
degrade with higher test signal frequencies.
signal
offset + scale
offset
offset - scale
Fig. 36
Sine wave test signal
NYCe4000 Software User Manual
Bosch Rexroth AG 111/158
Single Axis Control (SAC) and Multi Axes Control (MAC)
Saw tooth Test Signal
The generated saw tooth test signal lies in the interval [–1.0, 1.0] and starts from
the offset value, displayed in Fig. 37. The saw tooth test signal has the same
restrictions as the block wave. Because the value of the test signal is generated
once each MCU sample period, the quality of the saw tooth test signal will
degrade with higher test signal frequencies.
signal
offset + scale
offset
offset - scale
Time (s
Fig. 37
Saw tooth test signal
Pseudo-Random Binary Sequence (PRBS) Test Signal
The generated PBRS signal is either -1.0 or +1.0, displayed in Fig. 38. These
values are randomly distributed in time. A new value is generated each sample
time.
signal
offset + scale
offset
offset - scale
Fig. 38
Pseudo-Random Binary Sequence test signal
Random Noise Test Signal
The generated random noise signal has a value randomly distributed between 1.0 and +1.0, displayed in Fig. 39. A new value is generated each sample time.
signal
offset + scale
offset
offset - scale
Fig. 39
Random Noise test signal
For each separate type of periodical test signal generator (for example block, sine
wave or saw tooth), the number of periods is counted. Depending on the actual
value of the count direction the counter is either incremented or decremented
each period. This is done at the beginning of each period. This implies that
112/158 Bosch Rexroth AG
NYCe4000 Software User Manual
Single Axis Control (SAC) and Multi Axes Control (MAC)
incomplete periods, for example due to a SacStopTestSignal, are counted as a
full period.
Modification of the count direction of a specific type of test signal generator is
possible by the function SacSetTestSignalCountDirection. The count direction
can only be modified, when the addressed generator is not active. The function
SacSetTestSignalCounter changes the actual value of the period counter of a
type of test signal generator. This can only be done when the generator type is
not active.
8.19 Output Triggers
This module contains the functions:
SacActivateOutputTrigger
SacDeactivateOutputTrigger
The output trigger functionality sets, resets or toggles an output when a specific
event occurs. The events can be any sensible SAC event. As the NY4150
SERCOSIII Master module does not support digital outputs, the output trigger
functionality can not use the NY4150, and will return an error code.
The output trigger functionality is activated by calling the function
SacActivateOutputTrigger. The function specifies the output identifier, action
and SAC event. The action specifies the way the output is adjusted when the
event occurs. The action can be defined as set, reset or toggle. Per event only
one action can be defined.
The user is responsible that no I/O conflicts occur with defining an output for this
functionality. An output can also be defined with the function
SacDefineFunctionIO.
The number of outputs used for this functionality is limited by the hardware.
The output trigger functionality is deleted by calling the function
SacDeactivateOutputTrigger.
The current state of the output is not changed when the output trigger functionality
is defined or deleted.
8.20 Latches
This module contains the functions:
SacActivateProbe
SacStartMultipleLatch
SacStopMultipleLatch
SacGetMultipleLatchPositions
Single latch inputs
An input can be configured as a latch input for a specific axis. First a latch input
needs to be defined as discussed in chapter 7.11 after which this input needs to
be coupled to a function as discussed in chapter 8.10. When an input is defined
as latch and coupled to a latch function, the latch can be used as a probe. A
probe is a switch or sensor which is used as accurate trigger to read the axis
position. When a specified probe signal change is detected the current position of
the axis is stored, not the setpoint position.
The function SacActivateProbe activates the probe signal detection. The
detection of the probe signal also deactivates it; it is not possible to deactivate it
with a function.
NYCe4000 Software User Manual
Bosch Rexroth AG 113/158
Single Axis Control (SAC) and Multi Axes Control (MAC)
Several variables are related to the probe functionality. SAC_VAR_PROBEx_POS
holds the position when the probe signal change is detected.
SAC_VAR_PROBEx_STATUS holds the actual probe status. The status indicates if the
probe is active or inactive and if the probe signal change is detected since the last
call to SacActivateProbe.
Multiple latch inputs
The position of the axis can be latched (once-only) at the specified edge, using
SacActivateProbe. Functions are available to perform multiple latching, but this
functionality is not supported for the NY4150 SERCOSIII Master module. If the
specified axis is on the NY4150, the error CML_ERR_UNDEFINED_IO_FUNCTION is
returned.
Multiple latching enables the latching of positions with a frequency up to the
sample frequency and an accuracy of up to 16ns, multiplied by the actual velocity.
With the function SacStartMultipleLatch multiple latching is started, or
restarted. Multiple latching is stopped with the function SacStopMultipleLatch or
as soon as SAC_MAX_NR_OF_LATCHED_POSITIONS (=32) positions have been
latched. Latched positions can be retrieved using
SacGetMultipleLatchPositions, which returns all positions latched since the
last call of SacStartMultipleLatch.
Following events are available for latches.
SAC_EV_PROBEx_DETECTED:
When the specified probe signal change is detected, also the appropriate probe
event is generated. The event data supplied with this event is the axis position.
8.21 Markers
This module contains the functions:
SacDefineSingleShotMarkers
SacClearSingleShotMarkerBuffer
SacDefinePermanentMarker
SacDeletePermanentMarker
SacDefineRepetitiveMarker
SacDeleteRepetitiveMarker
SacDefineTimeMarker
SacDeleteTimeMarker
Markers can be divided in two categories. Namely, position related and time
related markers. As the NY4150 SERCOSIII Master module does not support
digital outputs, the marker functionality can not use the NY4150, and will return an
error code.
Position markers
A position marker is an axis position. At this position an output action has to be
performed (set, clear or toggle) and/or an event message has to be transmitted.
Note:
The combination “action none” and “event flag = false” gives no response when
passing the marker area.
114/158 Bosch Rexroth AG
NYCe4000 Software User Manual
Single Axis Control (SAC) and Multi Axes Control (MAC)
Three types of markers are distinguished:
Single shot markers: single shot markers are detected only once. Per axis, a
circular buffer of 128 single shot markers is maintained. Markers can be added
to the buffer with up to 16 [SAC_MAX_NR_OF_SINGLE_SHOT_LOADABLE] at a time,
using the function SacDefineSingleShotMarkers. Per axis, the single shot
markers are detected in the order they are supplied by the application. When a
single shot marker is passed in the appropriate direction, the appropriate
output action is taken and/or the event SAC_EV_SINGLE_SHOT_MARKER is
generated. Thereafter, the marker is deleted from the buffer. The function
SacClearSingleShotMarkerBuffer deletes all single shot markers from the
single shot marker buffer.
Permanent markers: In contrary to single shot markers, permanent markers
are not deleted after detection. They are only deleted on explicit request.
Detection of permanent markers is independent of the order in which they have
been defined. Also, they are detected in arbitrary order. Using the function
SacDefinePermanentMarker, up to 16 [SAC_MAX_NR_OF_PERMANENT_MARKERS]
permanent markers per axis are defined. Permanent markers are deleted by
the function SacDeletePermanentMarker. For this type of markers, the event
SAC_EV_PERMANENT_MARKER is defined.
Repetitive markers: A repetitive marker is an infinite sequence of markers
detected when the axis position passes the defined marker position, or any
position equal to the marker position augmented with an integer multiple of
user definable marker repeat distances. Per axis, at most 2
[SAC_MAX_NR_OF_REPETITIVE_MARKERS] repetitive markers can be defined. For
definition and deletion, the functions SacDefineRepetitiveMarker and
SacDeleteRepetitiveMarker are available. The event
SAC_EV_REPETITIVE_MARKER is used to report detection of a repetitive marker.
Note:
For modulo axes, the marker repeat distance must be an integer fraction of the
modulo period.
On one node up to 8 marker actions per slot (drive unit) can be carried out per
DSP sample period.
When a marker has been missed, for example when to many single shot markers
are passed per DSP sample period, the axes for which one or more markers
could not be handled detect an error SAC_AX_ERR_MARKER_MISSED.
Time related markers
A time related marker is a time in seconds before the end of a movement. At this
time an output action has to be performed (set, clear or toggle) and/or an event
message has to be transmitted
Note:
The combination “action none” and “event flag = false” gives no reaction when
passing the marker area.
Per axis only one time marker can be defined by using the function
SacDefineTimeMarker. A movement is defined as Point-to-Point, QuickStop,
SmoothStop, Splines or Jogging. Setting the time marker is accepted in any axis
state and is active during either the current movement, if any, or when the first
movement is started after the function SacDefineTimeMarker. The time marker is
a single shot marker, after passing the marker, the marker must be defined again
to reactivate.
NYCe4000 Software User Manual
Bosch Rexroth AG 115/158
Single Axis Control (SAC) and Multi Axes Control (MAC)
In case the time is longer as the requested movement time, the action/event is
executed/generated immediately. In case of jog/splines movement the movement
time is only defined after the function SacStopJog/SacStopInterpolation is
given. The accuracy of the time marker is related to one node sample time. The
time marker can be cleared by using the function SacDeleteTimeMarker and
takes only effect if a time marker is defined and not yet detected.
Following events are available for markers. These events are discussed
throughout the chapter above.
SAC_EV_SINGLE_SHOT_MARKER
SAC_EV_PERMANENT_MARKER
SAC_EV_REPETITIVE_MARKER
SAC_EV_TIME_MARKER
8.22 Monitor
This module contains the functions:
SacStartMonitor
SacStopMonitor
SacGetMonitors
The monitor functionality can be used to put the value of a variable continuously
on an analog output. As the NY4150 SERCOSIII Master module does not support
analog outputs, the monitor functionality can not use the NY4150, and will return
an error code.
The analog output is updated with each sample period of the axis controller. The
function SacStartMonitor starts a monitor. The user has to specify which
variable he wants to observe and the scaling/offset that have to be applied before
putting the value on the analog output. The function SacStopMonitor stops a
monitor.
8.23 Autotweak
This module contains the functions:
SacTweakDownloadTableFromFile
SacTweakLoadTableFromFlash
SacTweakSaveTableToFlash
SacTweakDownloadTable
SacTweakReadTableFromFile
SacTweakWriteTableToFile
The control loop in the NYCe4000 is based on feedback and feedforward. In
general it can be stated that control performance increases when less feedback is
required. This is intuitively clear when one realizes that an error is necessary to
have feedback, so first there must be an error before the feedback part of the
controller is activated. Ideal feedforward avoids the establishment of an error.
Feedforward functionality in NYCe4000 is based on setpoint velocity,
acceleration, jerk and direction. However, position dependent feedforward can
further improve the motion performance in many systems.
The AutoTweak functionality improves control performance, for example for
repetitive movements, or for axes which are subject to certain position dependent
forces for example cogging, gravity, spring forces, or other disturbances.
Therefore, the AutoTweak measurement learns the position dependent
feedforward from the feedback which is usually required at each specific position.
116/158 Bosch Rexroth AG
NYCe4000 Software User Manual
Single Axis Control (SAC) and Multi Axes Control (MAC)
The measurement of the feedback is performed just before the feedforward
addition point.
The feedforward compensation is contained in a table, which is created during the
measurement procedure started from the NYCeTuner tool. The AutoTweak
function in NYCeTuner tool performs the measurements and handles the
gathered measurement data. During the measurement procedure data samples
are taken from the variable SAC_ASV_CTR_OUTPUT_FOR_TWEAK.
Measurement and application of position dependent feedforward only makes
sense for servo axes of which the position is well defined. In addition,
measurements are performed on axes in closed loop that have already been
homed.
The firmware interpolates the values from the table and adds these compensation
values to the feedforward when the axis is operating in closed loop. When the
axis is in open loop, the compensation values are directly added to the controller
output.
The AutoTweak function has 2 buttons to store the generated tweak table. The
button “Download to firmware” stores the table in the firmware. The button “Save
to flash” stores the table in the flash memory, but only if the table is already stored
in the firmware and the tweak function is enabled.
AutoTweak function
File...
XML file
data
NYCeTuner
SacTweakWriteTableToFile()
“Download to firmware”
SacTweakReadTableFromFile()
“Save to flash”
SacTweakDownloadTableFromFile()
Application
SacTweakDownloadTable()
firmware
SacTweakSaveTableToFlash()
SacTweakLoadTableFromFlash()
Flash memory
MCU
Fig. 40
Load and store options for the tweak table
The function SacTweakLoadTableFromFlash loads the table into firmware from
the flash memory. Likewise, the function SacTweakDownloadTable loads the table
into firmware from an application program and SacTweakDownloadTableFromFile
loads the table into firmware from a file. These functions can only be called while
the AutoTweak functionality is disabled.
The function SacTweakSaveTableToFlash stores the table from the firmware into
the flash memory.
SacTweakWriteTableToFile provides an interface to save the table to an XML
file and SacTweakReadTableFromFile reads it back from this file.
AutoTweak functionality can be activated by the parameter SAC_PAR_TWEAK_MODE.
The parameter SAC_PAR_TWEAK_MODE can only be set with the function
SacWriteParameter if the axis is homed, and can have the values
SAC_TWEAK_DISABLED, SAC_TWEAK_CLOSED_LOOP_STATES_ONLY,
SAC_TWEAK_CLOSED_LOOP_AND_FREE_STATE, or
SAC_TWEAK_ALL_POWER_ENABLED_STATES.
The parameter SAC_PAR_TWEAK_POSITION_SOURCE selects the position source
used for tweak (SAC_TWEAK_AXIS_POSITION or SAC_TWEAK_SETPOINT_POSITION).
While executing the AutoTweak measurement procedure in the NYCeTuner tool,
it is the responsibility of the user to avoid that parameters are changed or motion
NYCe4000 Software User Manual
Bosch Rexroth AG 117/158
Single Axis Control (SAC) and Multi Axes Control (MAC)
commands are issued by other processes. This would affect the quality of the
measurement.
AutoTweak is not supported on the IndraDrive, if the PVL on the IndraDrive is
used.
8.24 Sensor Linearization
This module contains the functions:
SacLinLutDownloadTableFromFile
SacLinLutDownloadTable
SacLinLutWriteTableToFile
A scale used on an encoder is always of limited accuracy. This is unfortunate in
itself, but fortunately many accuracy errors are reproducible while using the same
scale. This enables compensation in software for inaccuracies in the used scale.
A typical example is a linear motor with a linear scale.
Most of the time, an application does not need the high accuracy that can be
obtained by using very accurate scales. Instead, high accuracy is only needed in
one specific area, and low accuracy in the rest. An example is a ‘pick and place’
machine. This machine needs high accuracy when picking the product, but low
accuracy when moving to the target destination.
To compensate for the inaccuracies, these inaccuracies need to be measured.
The results of these measurements can then be used by the software to perform
the compensation. Performing these measurements is typically done using the
following steps:
1. The axis of which the scale has to be calibrated is homed. Homing is
necessary to define a reference point.
2. The exact position of the axis is either zero, or is measured with an external
measuring device, most likely a laser interferometer. When the position is
measured, the user can convert the measured value to encoder increments.
3. The axis is moved a defined number of encoder increments (measured by the
encoder) and the externally measured ‘real’ position is measured and
converted again.
4. The previous step is repeated until the desired area of the scale is processed.
The result is a table with corrected encoder positions. The table is downloaded to
the controller.
The compensation in the controller is performed at setpoint level. This means that
all entered positions are considered, calibrated and will be converted to ‘real’
positions in the firmware. This is also true when a position is read. The ‘real’
position is converted to a calibrated position and then returned to the application.
Fig. 41 shows the relationship between the linearized position variables and the
non-linearized position variables.
118/158 Bosch Rexroth AG
NYCe4000 Software User Manual
Single Axis Control (SAC) and Multi Axes Control (MAC)
non - linear
linear
LIN-
PTP , Spline
PTP , Spline target
position
SPG
LIN
Linear SPG position
Non-linear SPG
position
CTR
LIN
Linear axis position
Non-linear axis position
LIN-
= de-linearization
LIN
= linearization
Fig. 41
Relation between linearized and non-linearized position variables
The structure of the LINearization LookUp Table (LIN_LUT) XML file is defined as
shown in Fig. 42.
<LIN_LUT_TABLE>
<startPosition/>
<stepSize/>
<tableSize/>
<LinLut>
<point/>
<point/>
<point/>
</LinLut>
</LIN_LUT_TABLE>
Fig. 42
Sensor Linearization XML file structure
The fields in the XML file structure have the following meaning.
startPosition is the first encoder position value. This will often be a position at
the start of a track. With an encoder position value is meant encoder pulses
(not “pu”) from 0.
stepSize is the distance, in encoder positions, between the measurement points
during the calibration procedure. All stepSizes are equal over the entire track.
tableSize represents the number of steps over the entire track for which the
positions are calibrated. This is also the number of point entries specified in the
XML file. The number of calibration points is limited to 2700, defined by
[NYCE_MAX_LIN_LUT_POINTS_PER_AXIS].
points are the measured position values calculated in encoder positions from
startPosition. This means that the first value in the LinLut section of the XML file
represents the measured position while the application was positioned on the
encoder position startPosition during the calibration procedure.
The tables containing the calibration points can be sent to the node directly from
the XML file by the function call SacLinLutDownloadTableFromFile or as a
NYCe4000 Software User Manual
Bosch Rexroth AG 119/158
Single Axis Control (SAC) and Multi Axes Control (MAC)
structure by the function call SacLinLutDownloadTable. This structure can also
be saved to an XML file by the function call SacLinLutWriteTableToFile.
The download of the table is only possible when the linearization functionality is
disabled and the axis for which the table is downloaded is in the IDLE or
INACTIVE state. The download of a table overwrites a previously downloaded
table. If a table with more than 2700 points is downloaded the error code
SAC_ERR_MAX_NR_OF_POINTS_EXCEEDED is returned. Because the calibration data
table consists of equidistant points, the linearized value must be increasing. This
property is also checked when the lookup table is downloaded, and if this
constraint is not met, the error SAC_ERR_INVALID_LIN_LUT_DATA is returned.
The Sensor Linearization functionality can be activated by the parameter
SAC_PAR_LIN_LOOK_UP_TABLE_ENABLE through the function SacWriteParameter.
If this parameter is set to 0 the functionality is disabled, if this parameter is set to
1 the functionality is enabled. The linearization can only be enabled when a table
is previously downloaded, and no download is in progress. If an attempt is made
to enable the linearization through SacWriteParameter, the function returns the
error CTR_ERR_LIN_LUT_NOT_DOWNLOADED or
CTR_ERR_LIN_LUT_DOWNLOAD_IN_PROGRESS respectively. No error is generated if
the linearization is enabled while it was already enabled, or disabled while it was
already disabled.
The axis must be homed before the linearization can be enabled, because a fixed
physical reference point is required to map the linearization table to. If the
linearization is enabled when the axis is not homed the error
CTR_ERR_AXIS_NOT_HOMED is returned.
Sensor linearization can also be used with a rotation axis. However, for a rotation
axis the same limitation applies to the maximum number of calibration points
across the entire movement range. If a rotation axis can make an unlimited
number of revolutions, the axis must be configured as a modulo axis. In that
condition the linearization pattern can be repeated every revolution.
Remember that the shortest path is chosen when an absolute point to point
movement must be executed. For example, when a modulo 1 revolution axis is
defined, and a SAC point to point movement is executed from position 0 to
position 0.9 revolution, this movement will be realized by the controller as a
movement of 0.1 revolution. To realize a rotation of 2 revolutions on a modulo
axis, a relative point to point movement must be used.
8.25 Miscellaneous
This module contains the functions:
SacGetVersion
SacGetNrOfClients
SacGetAxisName
The function SacGetVersion returns the version of the SAC subsystem.
SacGetAxisName returns the name of an axis belonging to a certain axis ID.
Since the NYCe4000 host software supports multi client applications the function
SacGetNrOfClients returns the number of client applications having a connection
to a certain axis. The number of client applications that can have a connection to
an axis is limited to [NYCE_MAX_NR_OF_CLIENTS].
8.26 Status and error codes
The following tables give a summary of the status and error codes returned from
a call of a function of the SAC subsystem. Note that the application software
might have called a function of another NYCe4000 subsystem, but that function
called a SAC subsystem function internally.
120/158 Bosch Rexroth AG
NYCe4000 Software User Manual
Single Axis Control (SAC) and Multi Axes Control (MAC)
Table 24 Status codes of the SAC subsystem
Status code
description
SAC_ERR_IO_FUNCTION_ALREADY_DEFINED
I/O function already defined
SAC_ERR_TOO_MANY_CLIENTS
Too many clients
SAC_ERR_DISCONNECT_ERROR
Disconnect error
SAC_ERR_AXIS_NOT_RESPONDING
Axis not responding
SAC_ERR_FILE_OPEN_ERROR
Open specified file failed
SAC_ERR_FILE_READ_ERROR
Read specified file failed
SAC_ERR_FILE_CONTENTS_ERROR
Content of specified file not correct
SAC_ERR_FILE_WRITE_ERROR
Write specified file failed
SAC_ERR_ECG_INVALID_MASTER_AXIS_ID
ECG invalid master axis ID
SAC_ERR_ECG_SLAVE_ID_IS_MASTER_ID
ECG slave ID is master ID
SAC_ERR_ECG_SLAVE_ALREADY_LINKED
ECG slave already linked
SAC_ERR_ECG_NO_MASTER_LINKED
ECG no master linked
SAC_ERR_INVALID_AXIS_ID
Invalid axis ID
SAC_ERR_INVALID_MOTOR_TYPE
Invalid motor type
SAC_ERR_INVALID_AXIS_TYPE
Invalid axis type
SAC_ERR_INVALID_PARAMETER
Invalid parameter
SAC_ERR_INVALID_PAR_ID
Invalid parameter ID
SAC_ERR_INVALID_PARAM_SET_ID
Invalid parameter set ID
SAC_ERR_INVALID_VAR_ID
Invalid variable ID
SAC_ERR_INVALID_TYPE
Invalid type
SAC_ERR_INVALID_EVENT_ID
Invalid event ID
SAC_ERR_INVALID_ACTION
Invalid action
SAC_ERR_TOO_MANY_AXES
Too many axes
MAC_ERR_INVALID_GROUP_ID
Invalid group ID
MAC_ERR_TOO_MANY_SYNC_GROUPS
Too many sync groups
MAC_ERR_TOO_MANY_ERROR_GROUPS
Too many error groups
MAC_ERR_ERROR_GROUP_CONFLICT
Error group conflict
SAC_WRN_ALREADY_CONNECTED
Warning, already connected
SAC_ERR_NOT_SUPPORTED
Not supported
SAC_ERR_NO_FIRMWARE_LOADED
No firmware loaded in MCU
SAC_WRN_PARAMETER_NOT_SPECIFIED
Warning, parameter not specified
SAC_ERR_NOT_A_MONITOR
Not a monitor
SAC_ERR_NOT_ALL_MONITORS_FOUND
Not all monitors found
SAC_ERR_INVALID_CONVERSION
Invalid conversion
SAC_ERR_INVALID_DATA_SET_SIZE
Invalid data set size
SAC_ERR_INVALID_OUTPUT_SIZE
Invalid output size
SAC_ERR_INVALID_OUTPUT_ARGUMENT
Invalid output argument
NYCe4000 Software User Manual
Bosch Rexroth AG 121/158
Single Axis Control (SAC) and Multi Axes Control (MAC)
SAC_ERR_NON_CONFIGURABLE_ERROR
Non-configurable error
SAC_ERR_AXIS_REMOVED
Axis removed
SAC_ERR_AXIS_NAME_NOT_FOUND
Axis name not found
SAC_ERR_MAX_NR_OF_POINTS_EXCEEDED
Maximum number of points exceeded
SAC_ERR_INVALID_LIN_LUT_DATA
Invalid sensor linearization lookup table data
SAC_ERR_TIMEOUT_ON_OTHER_PROCESS
Timeout on other process
SAC_WRN_COMPLETED_ON_OTHER_PROCESS
Warning, completed on other process
SAC_ERR_ASYNC_VAR_NOT_FOR_TRACE
Asynchronous variable not for trace
SAC_ERR_ASYNC_VAR_NOT_FOR_VAR_SET
Asynchronous variable not for variable set
SAC_ERR_HOME_MODE_NOT_SUPPORTED
Home mode not supported
SAC_ERR_INVALID_ENCODER_TYPE
Invalid encoder type
SAC_ERR_INVALID_BIT_NR
Invalid bit number
SAC_ERR_INVALID_ANOUT_ID
Invalid analog output ID
SAC_WRN_PARAMETER_VALUE_CHANGED
Warning, parameter value changed
SAC_ERR_DUPLICATE_AXISNAME
Duplicate axis name
Table 25 Error codes of the SAC subsystem
Error code
description
SAC_AX_NO_ERROR
SAC function completed successfully
SAC_AX_ERR_CABLE_ALARM
Cable alarm
SAC_AX_ERR_POSITION_ERROR_EXCEEDED
Position error exceeded
SAC_AX_ERR_POS_SW_END_SWITCH
Positive software end switch
SAC_AX_ERR_NEG_SW_END_SWITCH
Negative software end switch
SAC_AX_ERR_STEADY_STATE_ERROR
Steady state error
SAC_AX_ERR_SPLINE_BUFFER_EMPTY
Spline buffer empty
SAC_AX_ERR_COLLISION_DETECTION
Collision detection
SAC_AX_ERR_EMERGENCY_STOP_INPUT
Emergency stop input
SAC_AX_ERR_ERROR_0_INPUT
Error 0 input
SAC_AX_ERR_ERROR_1_INPUT
Error 1 input
SAC_AX_ERR_ERROR_2_INPUT
Error 2 input
SAC_AX_ERR_ERROR_3_INPUT
Error 3 input
SAC_AX_ERR_ERROR_4_INPUT
Error 4 input
SAC_AX_ERR_ERROR_5_INPUT
Error 5 input
SAC_AX_ERR_STOP_ALARM
Stop alarm
SAC_AX_ERR_POS_LIMIT_SWITCH_INPUT
Positive limit switch input
SAC_AX_ERR_NEG_LIMIT_SWITCH_INPUT
Negative limit switch input
SAC_AX_ERR_PEER_WARNING
Peer warning
SAC_AX_ERR_PEER_SMOOTH_STOP
Peer smooth stop
SAC_AX_ERR_PEER_QUICK_STOP
Peer quick stop
122/158 Bosch Rexroth AG
NYCe4000 Software User Manual
Single Axis Control (SAC) and Multi Axes Control (MAC)
SAC_AX_ERR_PEER_FULL_STOP
Peer full stop
SAC_AX_ERR_PEER_QSTOP_OPEN_LOOP
Peer quick stop and open loop
SAC_AX_ERR_PEER_OPEN_LOOP
Peer open loop
SAC_AX_ERR_PEER_DISABLE_DRIVE
Peer disable drive
SAC_AX_ERR_PEER_POS_CORRUPTED
Peer position corrupted
SAC_AX_ERR_PEER_COMMUNICATION_LOST
Peer communication lost
SAC_AX_ERR_PHASE_ALARM
Phase alarm
SAC_AX_ERR_MASTER_DIRECTION_ERROR
Master direction error
SAC_AX_ERR_MASTER_POSITION_OVERFLOW
Master position overflow
SAC_AX_ERR_MASTER_POSITION_LOSS
Master position loss
SAC_AX_ERR_SETTLING_TIME_ERROR
Settling time error
SAC_AX_ERR_POS_SERVO_OVER_VOLTAGE
Positive servo over-voltage
SAC_AX_ERR_POS_SERVO_UNDER_VOLTAGE
Positive servo under-voltage
SAC_AX_ERR_NEG_SERVO_UNDER_VOLTAGE
Negative servo under-voltage
SAC_AX_ERR_NEG_SERVO_OVER_VOLTAGE
Negative servo over-voltage
SAC_AX_ERR_OVER_TEMPERATURE
Over-temperature
SAC_AX_ERR_MAX_VELOCITY_EXCEEDED
Maximum velocity exceeded
SAC_AX_ERR_MAX_ACCELERATION_EXCEEDED
Maximum acceleration exceeded
SAC_AX_ERR_MAX_JERK_EXCEEDED
Maximum jerk exceeded
SAC_AX_ERR_OVER_CURRENT
Over-current
SAC_AX_ERR_INVALID_HALL_SENSOR
Invalid Hall sensor
SAC_AX_ERR_COMMUNICATION_ERROR
Communication error
SAC_AX_ERR_NETWORK_ERROR
Network error
SAC_AX_ERR_MARKER_MISSED
Marker missed
SAC_AX_ERR_MAX_CURRENT_LEVEL_EXCEEDED
Maximum current level exceeded
SAC_AX_ERR_MAX_I2T_LEVEL_EXCEEDED
Maximum I2t level exceeded
SAC_AX_ERR_SHORT_CIRCUIT
Short circuit
SAC_AX_ERR_GENERAL_ENCODER_ERROR
General encoder error
SAC_AX_ERR_SINCOS_SIGNAL_TOO_WEAK
Sincos signal too weak
SAC_AX_ERR_SINCOS_SIGNAL_TOO_STRONG
Sincos signal too strong
SAC_AX_ERR_ENCODER_COMMUNICATION_LOST
Encoder communication lost
SAC_AX_ERR_MAX_AXIS_VELOCITY_EXCEEDED
Maximum axis velocity exceeded
SAC_AX_ERR_SETPOINT_OVERFLOW
Setpoint overflow
SAC_AX_ERR_COMMUTATION_CORRECTION_ERROR
Commutation correction error
SAC_AX_ERR_PIEZO_AMPLIFIER_VOLTAGE_ERROR
Piezo amplifier voltage error
SAC_AX_ERR_SAMPLE_OVERRUN
Sample overrun
SAC_AX_ERR_POSITION_ERROR_OVERFLOW
Position error overflow
SAC_AX_ERR_DRIVE_TEMPERATURE_TOO_HIGH
Drive temperature too high
SAC_AX_ERR_POS_DRIVE_VOLTAGE_TOO_HIGH
Positive drive voltage too high
NYCe4000 Software User Manual
Bosch Rexroth AG 123/158
Single Axis Control (SAC) and Multi Axes Control (MAC)
SAC_AX_ERR_POS_DRIVE_VOLTAGE_TOO_LOW
Positive drive voltage too low
SAC_AX_ERR_NEG_DRIVE_VOLTAGE_TOO_LOW
Negative drive voltage too low
SAC_AX_ERR_NEG_DRIVE_VOLTAGE_TOO_HIGH
Negative drive voltage too high
SAC_AX_ERR_INDRA_ERROR
IndraDrive error
SAC_AX_ERR_INDRA_WARNING
IndraDrive warning
SAC_AX_ERR_SERCOS_ERROR
SERCOS error
SAC_AX_ERR_MICROWARE_ERROR
Microware error
SAC_AX_ERR_DRIVELINK_ERROR
Drivelink error
SAC_AX_ERR_DL_SYNC_READ_ERROR
Drivelink sync read error
SAC_AX_ERR_DISABLE_DRIVE
Disable drive
SAC_AX_ERR_USER_ERROR_0
User error 0
SAC_AX_ERR_USER_ERROR_1
User error 1
SAC_AX_ERR_USER_ERROR_2
User error 2
SAC_AX_ERR_USER_ERROR_3
User error 3
SAC_AX_ERR_USER_ERROR_4
User error 4
SAC_AX_ERR_USER_ERROR_5
User error 5
SAC_AX_ERR_USER_ERROR_6
User error 6
SAC_AX_ERR_USER_ERROR_7
User error 7
SAC_AX_ERR_SAFETY_INPUT
Safety input
SAC_AX_ERR_MAX_SAFETY_VELOCITY_EXCEEDED
Maximum safety velocity exceeded
SAC_AX_ERR_MAX_SAFETY_ACCELERATION_EXCEEDED
Maximum safety acceleration
exceeded
SAC_AX_ERR_MAX_SAFETY_JERK_EXCEEDED
Maximum safety jerk exceeded
124/158 Bosch Rexroth AG
NYCe4000 Software User Manual
Single Axis Control Drivelink (SACDL)
9 Single Axis Control Drivelink (SACDL)
The NYCe4000 supports the Bosch Rexroth IndraDrive via the NY4150
SERCOSIII Master module (see NYCe4000 Hardware System Manual). Much
functionality of the IndraDrive to control an axis is transparently implemented in
the SAC subsystem. The SACDL subsystem supports the IndraDrive specific
functionality.
9.1
General
The SACDL subsystem is divided in several modules. Each module consists of a
set of user functionalities. Each functionality is implemented with one or more
functions.
Although much functionality of the IndraDrive is transparently implemented in the
SAC subsystem, the IndraDrive error and warning messages are not converted
into NYCe4000 messages. All IndraDrive errors and warnings are converted into
one generic error message with identifier SAC_AX_ERR_INDRA_ERROR or
SAC_AX_ERR_INDRA_WARNING. The specific IndraDrive error or warning code is
available in the variable SAC_VAR_INDRA_ERROR that can be read with the function
SacReadVariable, and is formatted as a floating point value. The description of
the error or warning code stored in the variable can be found in the BRC
documentation “Rexroth IndraDrive MPx02, MPx03, MPx04, MPx05 and HMV
Troubleshooting Guide”, order number R911297319. Note that the error and
warning codes are shown in the hexadecimal format in the BRC documentation.
All SACDL functions return the error code SAC_ERR_INVALID_AXIS_TYPE if the
specified axis has not been configured as an IndraDrive axis.
9.2
Parameters
This module contains the functions:
SacDLLoadDefaultParametersFromEncoder
SacDLLoadMotorParametersFromFile
SacDLSaveMotorParametersToFile
SacDLSaveMotorParametersToFlash
The function SacDLLoadDefaultParametersFromEncoder loads the parameters
from the motor encoder flash memory to the IndraDrive (if that functionality is
supported), and saves the parameters as NYCe4000 parameters in the firmware
and on the host. If the specified IndraDrive axis is a motor without motor encoder
flash memory, the error CML_ERR_INDRADRIVE_MOTOR_WITHOUT_ENC_MEMORY is
returned. When the function SacDLLoadDefaultParametersFromEncoder is
called, the following parameters are updated. Note that these values are
representative for an axis without a load.
-
SAC_PAR_KP
SAC_PAR_KI
SAC_PAR_KV
SAC_PAR_CC_KP
SAC_PAR_CC_KI
SAC_PAR_LLF_SWITCH
SAC_PAR_LLF_LAG_FREQ
SAC_PAR_LLF_LEAD_FREQ
SAC_PAR_PVL_SAMPLE_TIME
SAC_PAR_CC_SAMPLE_TIME
NYCe4000 Software User Manual
Bosch Rexroth AG 125/158
Single Axis Control Drivelink (SACDL)
The function SacDLLoadDefaultParametersFromEncoder can only be called
when the axis state is SAC_IDLE or SAC_INACTIVE, and the axis type is
SAC_INDRA_BLAC_AXIS (“IndraDrive axis” allocated to an IndraDrive for example
in NYCeConfigurator).
The functions SacDLLoadMotorParametersFromFile,
SacDLSaveMotorParametersToFile and SacDLSaveMotorParametersToFlash
are only supported for IndraDrive motors that do not have motor encoder flash
memory. If one of these functions specifies an axis that supports motor encoder
flash memory, the error CML_ERR_INDRADRIVE_MOTOR_WITH_ENC_MEMORY is
returned. The SAC variable SAC_VAR_INDRA_MOTOR_WITH_ENCODER_MEMORY
indicates whether the motor has motor encoder flash memory (value is TRUE) or
not (value is FALSE). This variable is updated when an axis is allocated to an
IndraDrive.
The function SacDLLoadMotorParametersFromFile loads the motor, encoder,
holding brake and motor temperature sensor parameters from the specified motor
XML file and writes these parameters into the working memory of the specified
axis on an IndraDrive. The function SacDLLoadMotorParametersFromFile can
only be called when the axis state is SAC_IDLE after the axis is allocated to an
IndraDrive.
The function SacDLSaveMotorParametersToFile reads the motor, encoder,
holding brake and motor temperature sensor parameters from the working
memory of the specified axis on an IndraDrive and writes these parameters to the
specified motor XML file.
Notes:
- Do not specify the file name which is used as a node, axis or network/system
configuration XML file. The resulting file is not XML-compliant.
- Specify a meaningful file name that identifies the IndraDrive to which the
motor is connected. If you have several IndraDrives in the application, you
can not recognize from the contents of the motor XML file to which IndraDrive
the motor XML file must be loaded.
The function SacDLSaveMotorParametersToFlash reads the motor, encoder,
holding brake and motor temperature sensor parameters from the working
memory of the specified axis on an IndraDrive and writes these parameters to the
flash memory of the IndraDrive. The function can only be called when the axis
state is SAC_IDLE after the axis is allocated to an IndraDrive.
9.3
Digital I/O
This module contains the functions:
SacDLGetNrOfDigitalInputs
SacDLGetNrOfDigitalOutputs
SacDLDefineDigitalIOActiveState
SacDLReadDigitalIORegister
SacDLReadDigitalIO
SacDLClearDigitalOutput
SacDLSetDigitalOutput
SacDLToggleDigitalOutput
Each IndraDrive supports digital inputs and digital outputs. These inputs and
outputs are used for motion related functionality, for example homing sensors,
end of stroke switches, etc. The total number of I/O available depends on the
connected IndraDrive model. Only one area sensor, 2 latch inputs (4 on the other
drive modules), one positive and one negative end of stroke switch, 6 error inputs
and 3 position switch outputs can be configured as motion I/O on the IndraDrive.
If the I/O is not configured for this functionality, the I/O can be used as general
inputs and outputs.
126/158 Bosch Rexroth AG
NYCe4000 Software User Manual
Single Axis Control Drivelink (SACDL)
The API functions use NYCE I/O numbers. See Table 26 for the mapping of the
NYCE I/O number to the IndraDrive C Advanced control unit I/O name.
Table 26 NYCE I/O numbers to IndraDrive C Advanced control unit I/O name mapping
NYCE I/O number
IndraDrive C Advanced control unit I/O name
NYCE_DIGIN0
I_3 Digital input
NYCE_DIGIN1
I_4 Digital input
NYCE_DIGIN2
I_5 Digital input
NYCE_DIGIN3
I/O_8 Bi-directional I/O
NYCE_DIGIN4
I/O_9 Bi-directional I/O
NYCE_FASTIN0
I_1 Probe input
NYCE_FASTIN1
I_2 Probe input
NYCE_DIGOUT0
Rel_1 Relay contact
NYCE_FASTOUT0
I/O_10 Bi-directional I/O
NYCE_FASTOUT1
I/O_11 Bi-directional I/O
The functions SacDLGetNrOfDigitalInputs and SacDLGetNrOfDigitalOutputs
return the number of available digital inputs and outputs, respectively, for the
specified axis on the IndraDrive.
The function SacDLDefineDigitalIOActiveState defines the active state of the
specified digital input or digital output for the specified axis on the IndraDrive. The
digital input or output is specified by its I/O number. Default, the active state of the
digital I/O is configured “active high”. The active state of each digital input or
output can be set to NYCE_ACTIVE_LOW or NYCE_ACTIVE_HIGH.
The active state can be set for all digital inputs and outputs by writing the
parameter SAC_PAR_INDRA_IO_ACTIVE_MASK. The mask contains a “1” at the bit
positions for which the related digital I/O must be “active high”, and a “0” for
“active low”.
The function SacDLReadDigitalIORegister retrieves the value of the digital I/O
status register of the I/O available on the specified axis on the IndraDrive. The
digital I/O register can also be read by the variable
SAC_VAR_INDRA_DIG_IO_STATUS.
The function SacDLReadDigitalIO reads the value of one digital input or output
on the specified axis on the IndraDrive. A “1” for the I/O bit indicates that the input
or output is active.
The functions SacDLClearDigitalOutput, SacDLSetDigitalOutput and
SacDLToggleDigitalOutput clears, sets and changes, respectively, the specified
output on the specified axis on the IndraDrive. The digital output is specified by its
I/O number.
A change of state event can be defined for the digital I/O by the function
SacDefineEventEnrolment with the event identifier
SAC_EV_INDRA_DIG_IO_STATE_CHANGE. The state event mask is set with the
parameter SAC_PAR_INDRA_IO_EVENT_MASK. A “1” in the bit position of a digital
input or output defines the I/O for which the change of state is detected.
If a state change is detected of the specified digital I/O, the event with the
associated event data (NYCE_DIG_IO_CHANGE_OF_STATE) is generated.
Note:
Because the status of the digital I/O is checked once per DSP sample, state
change events can be missed.
NYCe4000 Software User Manual
Bosch Rexroth AG 127/158
Single Axis Control Drivelink (SACDL)
9.4
Analog I/O
This module contains the functions:
SacDLGetNrOfAnalogInputs
SacDLGetNrOfAnalogOutputs
SacDLWriteAnalogOutput
SacDLGetNrOfAnalogInputs and SacDLGetNrOfAnalogOutputs return the
number of available analog inputs and outputs, respectively, for the specified axis
on the IndraDrive.
The function SacDLWriteAnalogOutput sets the specified value on the specified
analog output on the axis on the IndraDrive. The analog output is specified by its
I/O number. The actual values of the analog outputs can be read and traced with
the SAC variables SAC_VAR_INDRA_AN_OUT0_VALUE and
SAC_VAR_INDRA_AN_OUT1_VALUE. The voltage output range of the analog outputs
for the IndraDrive C Advanced is 0 … 5 V.
The analog input I_a_1 on the IndraDrive C Advanced control unit is read and
traced with the SAC variable SAC_VAR_INDRA_AN_IN0_VALUE. A maximum and
minimum level can be defined for the analog input with the parameters
SAC_PAR_INDRA_ANIN0_MAX_LEVEL and SAC_PAR_INDRA_ANIN0_MIN_LEVEL
respectively.
A level crossing event can be defined by the function SacDefineEventEnrolment
with the event identifier SAC_EV_INDRA_AN_IN0_LEVEL_CROSSING. If the analog
input crosses either the maximum or the minimum defined value, the event with
the associated event data (NYCE_LEVEL_CROSSING_DATA) is generated.
Note:
Because the analog input is read once per DSP sample, level crossing events
can be missed.
9.5
Position Switch
This module contains the functions:
SacDLDefinePositionSwitchRange
SacDLDeletePositionSwitchRange
The function SacDLDefinePositionSwitchRange defines 2 positions for the
specified axis on the IndraDrive, the ‘switch on position’ and the ‘switch off
position’ specified in [pu]. To define the position switch output, use the function
SacDefineFunctionIO and specify the axis number, the function
SAC_POSITION_SWITCH, the slot number (NYCE_INDRA_SLOT) and the NYCE I/O
number. Note that there are 3 outputs available that can be used as position
switch output, but only one range can be specified.
The function SacDLDeletePositionSwitchRange deletes the defined switch on
and switch off positions for the specified axis on the IndraDrive.
Both functions can only be called when the axis state is SAC_INACTIVE.
128/158 Bosch Rexroth AG
NYCe4000 Software User Manual
.Net
10 .Net
The NYCe4000 software includes a .Net API layer on top of the C API layer. The
.Net API layer is transparent, meaning that an absolute minimum of intelligence is
added to this interface layer, and offers all NYCe4000 functionality in an object
oriented environment for .Net languages. Fig. 43 gives a brief overview of the
classes defined in the .Net layer. There are many more classes, but for clarity
these are not shown in the diagram. For reference to the “traditional” C API, you
can relate the axis object to SAC, the node object to NHI, and the node manager
to SYS and DWN.
Fig. 43 NYCe4000 .Net classes overview
All objects with their associated methods are available in the namespace
“Bosch.Rexroth.NYCe4000”.
10.1 Top-level classes
The following classes belong to the top-level, see Fig. 43.
NodeManager class
The NodeManager object is a singleton object. Only one instance of this class
can exist per process. The NodeManager object contains a member called
Nodes, which is an instance of the NodeCollection class that contains all the
Node objects used in an application. The NodeManager class contains events
and many static methods and properties. These methods and properties are
mostly helper functions like retrieval of a version and result type checking.
NodeCollection class
The NodeCollection is a type safe collection for Node objects. When the “Add”
method is called the following actions are done:
- A new Node object is constructed.
- SeqConnect is called to obtain a SeqId for that node.
- The node object is added to the collection.
- A reference to the new created node is returned.
NYCe4000 Software User Manual
Bosch Rexroth AG 129/158
.Net
When removing a node, the Node object is disconnected (SEQ and NHI) and
removed from the collection. If no other references to the Node object exist, the
object is cleaned up by the garbage collector.
Node class
The Node class represents a node. The Node class has no public constructor. It
can be constructed by calling the “Add” method on the Nodes member
(NodeCollection) of the NodeManager and passing a node name as argument.
The Node class has a member called Areas. This is an AreaCollection object
that is reconstructed automatically when the Node is added to a
NodeCollection. The Node class has a member called Drives. This is a
DriveCollection object that is reconstructed automatically when the Node is
(Nhi)connected. The Node class has a member called Axes. This is a
DefinedAxisCollection object that is reconstructed automatically when the
Node is (Nhi)connected. The Node class implements the IDisposable interface
because the node needs to be disconnected properly and any event
subscriptions should be cancelled when the node is no longer referenced.
There are 2 properties to indicate the connection status of the Node. First, the
IsAttached property indicates if the Node has been added to a
NodeCollection and is thus connected (when no disconnect is executed after
the node was added). The second property is IsHardwareConnected. This
property indicates if a successful NhiConnect was done. The Node contains
members for NodeParameters and NodeVariables. Also, this class contains
events.
Mcu class
This abstract base class represents an MCU. The NY4110 and NY4111 class is
derived from this class. The class has an array of AxisUnit objects.
Drive class
This abstract base class represents a drive. The NY4120, NY4125, NY4130,
NY4140, NY4150, and NY4170 classes are all derived from this class. This
class has several arrays for I/O (for example DigitalInputs, AnalogOutputs,
etc.), AxisUnits, LatchInputs and DigitalInputCounters. The drive, and
with it these arrays, is automatically created when a node is (NHI) connected.
The Drive contains members for DriveParameters and DriveVariables. Also,
this class contains events.
DriveCollection class
Each Node object has a Drive member, which is an instance of the
DriveCollection class. The DriveCollection has a fixed capacity of 8. This
represents 8 drive slots that can be physically occupied or empty. If a slot is
occupied, the index in the DriveCollection contains a Drive (derived) object.
If a slot is empty, the index in the DriveCollection is null. The
DriveCollection of each Node is automatically populated each time a node is
(NHI) connected. Before doing so, any existing items in the collection are set to
null. If no other references to these ‘old’ objects exist, they are cleaned by the
garbage collector.
AxisUnit class
This class is used to tie an axis to a drive or MCU. This class does not contain
a public constructor. Each drive and MCU has a number of AxisUnit objects in
a member array called AxisUnits. The drive or MCU and with it this array of
axis units is automatically created when a node is (NHI) connected.
DefinedAxisCollection class
This class represents a collection of axes defined for a particular node. This
class does not contain a public constructor. Instead, an instance of this class is
available through the Axis member of the Node class. When (NHI) connecting a
node, either by adding a Node object to the NodeCollection or by calling the
Connect method of the Node, the axis definition is read from the node and the
Axis member of the Node is reconstructed. If the axis definition changes in
another process (node configuration change), you can reconstruct the axis
collection by calling the InitializeAxisDefinition method of the Node
object.
130/158 Bosch Rexroth AG
NYCe4000 Software User Manual
.Net
Axis class
The Axis class represents an axis. The Axis class has no public constructor. It
can be constructed by calling the “Add” method on the Axes member of the
Node and passing an axis name as argument. When (Nhi) connecting a node,
either by adding a Node object to the NodeCollection or by calling the Connect
method of the Node, the axes definition is read from the node and the Axes
member of the Node is reconstructed. The members of the Axis class can be
divided into 3 groups.
1. I/O functions
(AreaSensor, ErrorInputs, ExternalDriveEnable, Latches,
NegativeLimitSwitch, PositiveLimitSwitch, ReleaseBrake,
StartTriggerInput, StopTriggerInput).
Initially the I/O functions are not set. They are reconstructed with
information that is read from the node. To force reconstruction, call the
InitializeIOFunctions method of the Axis object. Also, when calling
InitializeParametersFromFile or InitializeParametersFromFlash the
I/O functions are reconstructed.
2. Configuration
(PositionSensorType, MotorType, AxisType)
Initially the configuration is not set. When calling the Configure method
these members are set. To force update of these members, call the
InitializeConfiguration method. Also, when calling
InitializeParametersFromFile or InitializeParametersFromFlash the
configuration is updated.
3. Other
(SplineBuffer, TweakTable, LinearLut, TestSignal,
SingleShotMarkerBuffer, PermanentMarkerBuffer,
RepetitiveMarkerBuffer, TimeMarkerBuffer, Monitors,
FocusControlLoop)
These members are constructed in the constructor of the Axis.
The Axis contains members for AxisParameters, AxisVariables and
AxisParameterSets. Also, this class contains events.
AreaCollection class
The AreaCollection class is a collection for Area objects. There is no public
constructor for this class. It can be accessed by using the Areas member of the
Node object. When adding a Node to the NodeCollection, thus connecting it, all
areas are read from the node and the AreaCollection of the node is
reconstructed. When another process changes the area definition of the node,
you can reconstruct it by calling the InitializeAreas method of the Node
object. Normally a user written application would subscribe to the
AreaDefinitionChanged event (on the Node) to get notified when another
process changes the area definition. By adding or removing Area objects to or
from the AreaCollection it is possible to change the area definition of the
node.
Area class
The Area class represents an area in the memory of the node. Node memory
can contain 0 or more user definable areas. These areas can contain a
sequence. The Area object can be constructed passing a desired memory size
as an argument to the constructor. The Sequence member of the area may
contain a Sequence object, indicating if a sequence is loaded into the node
memory. When adding a Node to the NodeCollection, thus connecting it, all
areas are read from the node and the AreaCollection of the node is
reconstructed. Normally when a node powers up, no sequence loaded in
memory will be started. To change this behavior and have a sequence
automatically started at boot time of the node, you can add the sequence to the
bootstrap. Set the AddToBootstrap property of the Area object to TRUE and call
the CreateBootstrap method of the Node. Use the ClearBootstrap method of
the Node to clear the bootstrap.
NYCe4000 Software User Manual
Bosch Rexroth AG 131/158
.Net
Sequence class
The Sequence class represents a sequence, where a sequence is small
application written in C, which can run on an MCU. A Sequence object can be
constructed, but can only be used when it is attached to an Area. Normal usage
of the Sequence class is as follows.
- Construct a new Sequence object.
- Set the Sequence member of an Area object to the new created Sequence
instance.
- Use the Compile method to compile and link a C source code file.
- Use the LoadInMcu method to deploy an executable to the MCU.
- Call the Start method to start the sequence.
The Sequence class has a member named Symbols. This member contains a
SymbolCollection object that can contain user specified symbols in the
sequence. The Sequence class also has a member named Stack. This member
contains a Stack object that represents the sequence stack. The Sequence
class implements the IDisposable interface to ensure that any event
subscriptions are cancelled before removing the Sequence object from memory.
This class also contains events.
Parameter class
The Parameter class represents a Node (Nhi) Parameter or Axis (Sac)
Parameter. Parameters can be read and written. Some Parameters are writeprotected on a lower level. Trying to write them will result in an exception. To
store all parameters to flash memory or file, call the SaveParametersToFlash or
SaveParametersToFile method of the Node or Axis object. To read all
parameter values from file or flash memory use the method
InitializeParametersFromFlash or InitializeParametersFromFile.
Objects like Node, Axis and Drive have a member called Parameters. This
member holds a class that contains all related Parameters.
ParameterSet class
This abstract base class represents a parameter set. Several parameter set
classes derive from this class. A ParameterSet can be thought of as a
collection of values that can be read or written simultaneously. All parameter
sets are grouped together in the AxisParameterSets class.
VariableSet class
The VariableSet contains the main functionality for retrieving values of
multiple variables and guarantees that all variables are read in the same
sample. This object does not contain the actual data of the added variables.
This was done to keep the data and the functionality separated. The
CreateSnapshot method returns a VariableSetSnapshot object which
contains the data of the variables.
The VariableSet contains a private VariableIndexCollection. The Add and
Remove methods require a Variable, not a VariableIndex, the methods
translate the parameter objects to VariableIndex objects which then are
added or removed from the collection. The VariableSet class also has a
GetData method to directly read a specific variable from the set.
VariableTrace class
The VariableTrace class is used for tracing multiple variables. Before tracing
can be done, the trace needs to be defined with the Define method. This
effectively creates a trace buffer large enough to contain the necessary data.
Variables can be added to or removed from the trace. Once this is done, the
trace owner can start the trace by calling the Start method. Values for
variables in the trace will be stored in the trace buffer until the Stop method is
called. Note that the actual trace buffer is not in the .Net layer. The user
specifically needs to create an immutable snapshot to get data from the native
trace buffer.
132/158 Bosch Rexroth AG
NYCe4000 Software User Manual
.Net
10.2 Events
Events implemented in .Net differ from the native NYCe4000 events in several
ways. When, for example, subscribing to the native event SEQ_EV_HOST by calling
the native function SeqDefineEventEnrolment, all SEQ_EV_HOST events from all
sequences in the whole node are send to the host application.
A sequence is represented by a Sequence object in the .Net wrapper. When you
are interested in receiving a Host event from a particular sequence, you are not
interested in receiving host events from other sequences in that node. To solve
this issue a check is added to the event callback function that checks if the event
originates from the correct sequence (Node and Area id must match). If the origin
matches the criteria, a .Net event is triggered. This origin check is applied in all
event callback functions. When dealing with Axis events, the test checks for a
correct Axis id. Node events can be Seq or Nhi events. In case of a Seq event
both the node id (Seq id) and the area id are checked. In case of a Nhi event, only
the node id (Nhi id) is checked.
Sequence object
Native event callback
delegate
.Net Event
.Net EventHandler
trigger .Net event
Check if event originates
from the correct sequence
native event
Fig. 44 NYCe4000 .Net events
Several node events belong to a specific drive slot and or I/O number. These
events are combined in the .Net wrapper. For example,
NHI_EV_AN_IN1_LEVEL_CROSSING_SLOT3 is an event specific to the 2nd analog
input on the drive in the 4th slot.
In .Net we use AnalogInput objects. All these AnalogInput objects have their
own slot id and I/O number. When subscribing to a LevelCrossing event on a
specific AnalogInput object, the original native event name is determined from
the AnalogInput’s slot id and I/O number.
10.3 Variable Set and Tracing
Several objects have variables accompanying them. Node, Drive, AnalogInput,
AnalogOutput, DigitalInputCounter and Axis all have a member called
Variables. This member is an instance of the xxxVariables class, where xxx is
the name of the object the member is part of (for example NodeVariables or
AnalogInputVariables). The xxxVariables class has several members that
represent the actual variables. To limit memory usage, these members are not
initially constructed. Only when a user accesses the Get property of the variable,
the constructor is called.
All variable objects have a Value property to directly get the value of the variable
(native call NhiReadVariable or SacReadVariable). To read the value of multiple
variables at the exact same moment (within the same sample), you must use a
VariableSet.
The VariableSet guarantees that all variables in that set are read in the same
sample. You can use the GetData method to read the variable data (native call
NyceReadVariableSetElement). To read all variables at the same time, you must
create a snapshot from the set. This can be done by calling the CreateSnapshot
method. This method returns a VariableSetSnapshot object.
The VariableSetSnapshot object is a read only snapshot of the VariableSet.
You can use the GetData method to get the data for a specific variable or you can
NYCe4000 Software User Manual
Bosch Rexroth AG 133/158
.Net
use the RawValues property to get an array of values for all variables in the
snapshot. The following code example shows the usage of a VariableSet.
NodeManager nodeManager;
Node node;
Variable variable1;
Variable variable2;
Variable variable3;
// Initialize the Nyce4000 software
NodeManager.Initialize();
// Get the one an only NodeManager object (singleton)
nodeManager = NodeManager.Instance;
//Add a new node
node = nodeManager.Nodes.Add("Node01");
//Add a new axis and connect
Axis ax1 = node.Axes.Add("Axis01");
ax1.Connect();
//Create 3 references to variables we will be tracing
variable1 = node.Drives[0].AnalogInputs[0].Variables.Value;
variable2 = node.Axes["Axis01"].Variables.AxisPos;
variable3 = node.Variables.SampleNumber;
//Create a new VariableSet
VariableSet set = new VariableSet();
//Add the variables.
set.Add(variable1);
set.Add(variable2);
set.Add(variable3);
// Read the value of variable2 directly, not using the set
Double DirectReadValue = variable2.Value;
// Read the value of variable2 using the set
Double SampedReadValue = set.GetData(variable2);
//Create a new snapshot
VariableSetSnapshot snapshot = set.CreateSnapshot();
//Read the value of variable2 from the snapshot
Double FrozenReadValue = snapshot.GetData(variable2);
//Read all values of all variables from the snapshot
GenericArray<Double> AllFrozenReadValues = snapshot.RawValues;
//Terminate
NodeManager.Terminate();
The VariableSet can only read a single value for each variable at any moment.
The VariableTrace may be used to acquire more variable samples during a time
window. The VariableTrace is a singleton object; only one instance exists. You
can use the Instance member to get a reference. By getting this Instance
property, the current trace definition is read. The native call NyceGetTraceInfo is
called to get the number of variables in the trace. Next, for each variable, a call is
made to NyceGetTraceElement.
The actual trace buffer in the native library can only have 1 owner. This owner
may start and stop the tracing. To become owner, an application must define the
size of the trace buffer. When an application attempts to define the size after
another application has already defined the size, an exception is thrown.
To get the complete contents of the variable trace buffer, use the
CreateSnapshot method with no arguments. This method returns a
VariableTraceSnapshot object. The CreateSnapshot method has another
override with two arguments. The first argument is the requested time of the first
sample. The second argument is the number of requested samples. If this method
is called and the requested data is available, it will be returned in a
VariableTraceSnapshot object.
134/158 Bosch Rexroth AG
NYCe4000 Software User Manual
.Net
It can happen that the first requested sample is no longer available or that the
requested number of samples is not available. When this occurs, the snapshot
contains only the data that was available.
The VariableTraceSnapshot object is a read only snapshot of the
VariableTrace. You can use the GetData method to get the data for a specific
variable or you can use the RawValues property to get an array of values for all
variables in the snapshot. The following code example shows the usage of a
VariableTrace.
NodeManager nodeManager;
Node node;
Variable variable1;
Variable variable2;
Variable variable3;
VariableTrace variableTrace;
VariableTraceSnapshot variableTraceSnapshot;
// Initialize the Nyce4000 software
NodeManager.Initialize();
// Get the one an only NodeManager object (singleton)
nodeManager = NodeManager.Instance;
//Get the VariableTrace object (singleton)
variableTrace = VariableTrace.Instance;
//Add a new node
node = nodeManager.Nodes.Add("Node01");
//Create 3 references to variables we will be tracing
variable1 = node.Drives[0].AnalogInputs[0].Variables.Value;
variable2 = node.Axes["Axis01"].Variables.AxisPos;
variable3 = node.Variables.SampleNumber;
//Define the trace
variableTrace.Define(3, 1000, 1);
//Add the variables.
//The number of variables should be equal to the size defined
variableTrace.Add(variable1);
variableTrace.Add(variable2);
variableTrace.Add(variable3);
//Trace state should now be initialized
Assert.AreEqual(NyceTraceState.Initialized, variableTrace.State);
//Start tracing
variableTrace.Start();
//Trace state should now be Running
Assert.AreEqual(NyceTraceState.Running, variableTrace.State);
//Give the variableTrace some time to trace the variables
Thread.Sleep(1000);
//Stop tracing
variableTrace.Stop(0);
Thread.Sleep(100);
//Trace state should now be Ready
Assert.AreEqual(NyceTraceState.Ready, variableTrace.State);
variableTraceSnapshot = variableTrace.CreateSnapshot();
//Get the trace data for the 1st variable from the snapshot
VariableTraceData variableTraceData =
variableTraceSnapshot.GetData(variable1);
//Write the values to the console
for (uint idx = 0; idx < 1000; idx++)
{
Console.WriteLine("{0}:{1}", idx, variableTraceData.Values[idx]);
}
//Delete the trace definition
variableTrace.DeleteDefinition();
//Terminate
NodeManager.Terminate();
NYCe4000 Software User Manual
Bosch Rexroth AG 135/158
.Net
For more information refer to the sections describing the Variable,
VariableTrace, VariableSet, VariableTraceSnapshot and
VariableSetSnapshot class.
10.4 Exceptions and error handling
Most native calls return a result code. These codes indicate success or failure.
Result codes are not exposed to the application in the .Net wrapper. Instead, the
user is informed by using exceptions. All code should contain proper try / catch
segments. For more information refer to the section describing the
Bosch.Rexroth.NYCe4000.Exceptions namespace.
By using exceptions, a .Net method can have only 2 possible outcomes. Either a
method succeeds or it does not. Error result codes from native calls are directly
translated into exceptions and when a native call succeeds no exception is
thrown. When a native call returns a warning result code, the result is treated like
a success code. This means that applications could possibly not notice a warning.
To enable the application to investigate result codes, the result codes are stored
in a queue. Each .Net method that uses one or more native calls stores the result
codes into the ResultInfoQueue. Each thread has a ResultInfoQueue that can
be reached through the static NodeManager.ResultInfoQueue.
The Bosch.Rexroth.NYCe4000.Exceptions namespace contains all exceptions
that can be thrown from the .Net wrapper. All exceptions are derived from the
N4KException class and only differ in name. Thus, DehException is used in case
of a failure in a native DEH function call, NhiException is used in case of a failure
in a native NHI function call, and so on for DWN, NYCE, SAC, SEQ and SYS.
10.5 Logging
The NYCe4000 software includes program tracing and these messages can be
received by for example NYCeLogger. In the .Net wrapper are all function calls
and function exits logged via the .Net trace mechanism. Both tracing of native
calls and tracing of event callbacks from the native library are available. All tracing
output is send to any attached trace listeners, see MSDN for more information.
By default a DefaultTraceListener is added to the trace listener collection. The
trace messages received by the DefaultTraceListener are written in the Output
window of Visual Studio. You can add trace listeners in the application code or
the application configuration file.
To enable tracing, an application must have the correct entries in its configuration
file. In the configuration file, both the trace switches and the listeners can be
defined. This is an example of a configuration file.
136/158 Bosch Rexroth AG
NYCe4000 Software User Manual
.Net
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.diagnostics>
<switches>
<!-NativeTrace can be set to the values below:
0 :Off
No tracing
1 :Error
Trace only error messages
2 :Warning
Trace error and warning messages
3 :Info
Trace error, warning and info messages
4 :Verbose
Trace error, warning and info messages and shows
additional information (Function invocation)
EventTrace can be set to the values below:
0 :Off
No tracing
1 :On
Traces all event call backs from the native library
-->
<add name="NativeTrace" value="3" />
<add name="EventTrace" value="1" />
</switches>
<trace autoflush="true" indentsize="4">
<listeners>
<add name="ListenerA"
type="System.Diagnostics.TextWriterTraceListener"
initializeData="d:\TraceLog.log" />
<add name="ListenerB"
type="System.Diagnostics.ConsoleTraceListener" />
<remove name="Default" />
</listeners>
</trace>
</system.diagnostics>
</configuration>
To receive trace messages you must add a switch in the configuration file of the
application. With the specified trace switch in the configuration file you can set the
desired information detail from the trace. Two trace switches are defined in the
example.
1. NativeTrace
This trace switch can be set to values 0 – 4, indicating the level off tracing.
All native function calls can be logged when this trace is active.
2. EventTrace
This is a Boolean switch.
All event call backs can be logged when this trace is active.
Two listeners are added and the default listener is removed in the example.
It is important to remember that configuration files are only read at start up. To
read an updated configuration file while your application is running add the
following code to your application.
Trace.Refresh();
This is an example of the output.
2008-01-30 09:01:14.642 NyceInit returned: NYCE_OK (0x00000000)
2008-01-30 09:01:14.830 SysGetNumberOfNodes returned: NYCE_OK (0x00000000)
2008-01-30 09:01:14.830 SysGetNodeName returned: NYCE_OK (0x00000000)
2008-01-30 09:01:14.846 SeqConnect returned: NYCE_OK (0x00000000)
2008-01-30 09:01:14.861 NhiConnect returned: NYCE_OK (0x00000000)
2008-01-30 09:01:14.861 NhiGetUnitType returned: NYCE_OK (0x00000000)
2008-01-30 09:01:14.892 [ERROR]NhiGetDigitalInputCounter returned:
NHI_ERR_NOT_DEFINED (0x86000013)
Note:
Visual Studio creates a copy of App.Config during debugging, and stores the
copy in the Debug directory. The name of the temporary configuration file is
<ApplicationName>.vshost.exe.config. When you are debugging the tracing,
NYCe4000 Software User Manual
Bosch Rexroth AG 137/158
.Net
remember that Trace.Refresh() only refreshes from this temporary configuration
file.
To enable logging to the DEH subsystem, a DehTraceListener is available. You
can add this listener to a configuration file in the <listeners> tag body as follows.
All .Net trace messages are subsequently logged in the DEH subsystem.
<add name="N4KDehListener"
type="Bosch.Rexroth.NYCe4000.DehTraceListener,NYCe4000" />
Note that you must specify the assembly name (NYCe4000) to enable the runtime
environment to find the listener. The example below shows how to log from an
application.
//Not needed when setting the mask via the NYCeLogger
Logger.SetMask(LoggingMaskFlags.LogUserMessage,
(uint)Process.GetCurrentProcess().Id);
//Actual logging
Trace.WriteLine("Hello World!");
Trace.WriteLine("Line #2");
The following output will appear in NYCeLogger.
Fig. 45 .Net events logged and displayed using NYCeLogger
10.6 Code example using the .Net wrapper
To write a program using the .Net environment entails the following steps:
-
Create a new project
Add a reference to Nyce4000.dll
Add the Using statements for Bosch.Rexroth.Nyce4000 namespace
Use the classes in the wrapper.
The NYCe4000 software offers an API help file (nyce4000_dotnet.chm) which is
installed on the hard disk during the installation of the NYCe4000 software.
The example in Fig. 46 shows the body of an application written in the C#
language using .Net. You would use NhiConnect(axisname) in the C API. In C#
you first must create a collection of axes via de NodeManager, and then you can
create an axis via DefinedAxisCollection.
138/158 Bosch Rexroth AG
NYCe4000 Software User Manual
.Net
Fig. 46 Code example, using C#
The example in Fig. 47 illustrates the strength of the .Net environment. The body
of the application is now written in Visual Basic.
Fig. 47 Code example, using VB
NYCe4000 Software User Manual
Bosch Rexroth AG 139/158
Error codes of internal subsystems
11 Error codes of internal subsystems
This chapter describes the error codes of the internal subsystems of NYCe4000.
An application calls functions declared in the API files, and many of these
functions call underlying subsystem functions. Error conditions in these underlying
functions can be detected and these errors are passed on to the application.
The following tables give a summary of the status and error codes returned from
a call of a function declared by one of the API files. Error and status codes of the
API file (for example SAC, NHI, etc.) itself are listed in the chapter that describes
the API functions.
The error codes of internal subsystems listed in this chapter are the following.
CML (Configuration Mapping)
CTR (Control)
ECG (Electronic Camming and Gearing)
EDH (Error Detection and Handling)
EVH (Event Handling)
GEN (General)
HNI (Host Network Interface)
NCS (NYCe Communication Services)
NLM (Node Local Mechanism)
NNI (Node Network Interface)
OSAL (Operating System Abstraction Layer)
PDS (Performance Diagnosis and Status
PPI (Peripheral Program Interface)
SPG (Setpoint Generator)
STD (State Transition Diagram)
TSK (Task handler)
UTILS (Utility functions)
140/158 Bosch Rexroth AG
NYCe4000 Software User Manual
Error codes of internal subsystems
11.1 CML subsystem error codes
Table 27 Error codes of the CML subsystem
Error code
description
CML_ERR_INVALID_PARAMETER
Invalid parameter
CML_ERR_INVALID_TASK_PAR_SIZE
Invalid task parameter size
CML_ERR_STATE_ERROR
State error
CML_ERR_INVALID_AXIS
Invalid axis
CML_ERR_INVALID_DATA_ID
Invalid data ID
CML_ERR_SLOT_STATE_ERROR
Slot state error
CML_ERR_UNDEFINED_IO_FUNCTION
Undefined I/O function
CML_ERR_INVALID_SLOT_ID
Invalid slot ID
CML_ERR_INVALID_AXIS_TYPE
Invalid axis type
CML_ERR_INVALID_MOTOR_TYPE
Invalid motor type
CML_ERR_INVALID_POS_SENSOR_TYPE
Invalid position sensor type
CML_ERR_AXIS_UNIT_IN_USE
Axis unit in use
CML_ERR_INVALID_DRIVE_TYPE
Invalid drive type
CML_ERR_AXIS_ALREADY_CONFIGURED
Axis already configured
CML_ERR_INVALID_SERVO_VOLTAGE
Invalid servo voltage
CML_ERR_NO_LATCH
No latch
CML_ERR_LATCH_IN_USE
Latch in use
CML_ERR_LATCH_ALREADY_DEFINED
Latch already defined
CML_ERR_LATCH_IO_ALREADY_USED
Latch I/O already used
CML_ERR_OUTPUT_TYPE_IS_ACTIVE
Output type is active
CML_ERR_INVALID_AXIS_UNIT_NR
Invalid axis unit number
CML_ERR_INVALID_DIG_IO_NR
Invalid digital I/O number
CML_ERR_INVALID_FREQ_COMBINATION
Invalid frequency combination
CML_ERR_MONITOR_OUTPUT_ACTIVE
Monitor output active
CML_ERR_INVALID_DATA_SIZE
Invalid data size
CML_ERR_INVALID_UNIT_NR
Invalid unit number
CML_ERR_ASPI_NOT_CONFIGURED
ASPI not configured
CML_ERR_ASPI_INVALID_DATA
ASPI invalid data
CML_ERR_ASPI_INVALID_PORT_TYPE
ASPI invalid port type
CML_ERR_ASPI_INVALID_STATE
ASPI invalid state
CML_ERR_ASPI_INVALID_DATA_SIZE
ASPI invalid data size
CML_ERR_INTERNAL_ERROR
CML internal error
CML_ERR_DRIVE_GW_NOT_LOADED
Drive gateware not loaded
CML_ERR_INVALID_ASYNC_VARIABLE_ID
Invalid asynchronous variable ID
CML_ERR_ALREADY_COUNTING
Already counting
NYCe4000 Software User Manual
Bosch Rexroth AG 141/158
Error codes of internal subsystems
CML_ERR_NY4199_UNAVAILABLE
NY4199 SinCos option unavailable
CML_ERR_ENCODER_ERROR
Encoder error
CML_ERR_ENCODER_COMMUNICATION_ERROR
Encoder communication error
CML_ERR_INVALID_PVL_FREQUENCY
Invalid PVL frequency
CML_ERR_INVALID_CCL_FREQUENCY
Invalid CCL frequency
CML_ERR_INVALID_PWM_FREQUENCY
Invalid PWM frequency
CML_ERR_INVALID_ANALOG_IO_NR
Invalid analog I/O number
CML_ERR_PIEZO_AMPLIFIER_OUTPUT_TOO_HIGH
Piezo amplifier output too high
CML_ERR_PIEZO_STACK_VOLTAGE_TOO_HIGH
Piezo stack voltage too high
CML_ERR_NOT_AVAILABLE
Not available
CML_ERR_FRF_OUTPUT_ACTIVE
Frequency Response Function
output active
CML_ERR_NOM_POS_DRIVE_VOLTAGE_TOO_HIGH
Nominal positive drive voltage too
high
CML_ERR_NOM_POS_DRIVE_VOLTAGE_TOO_LOW
Nominal positive drive voltage too
low
CML_ERR_DRIVE_INVALID_CALIBRATION_MARGIN
Drive invalid calibration margin
CML_ERR_CRC_ERROR
CRC error
CML_ERR_TIMEOUT
Timeout
CML_ERR_INVALID_PORT_ID
Invalid port ID
CML_ERR_INVALID_CHANNEL_ID
Invalid channel ID
CML_ERR_INVALID_BLOCK_ID
Invalid block ID
CML_ERR_INVALID_ADDRESS
Invalid address
CML_ERR_MEMORY_BLOCK_READ_ONLY
Memory block read only
CML_ERR_NOT_SUPPORTED
Not supported
CML_ERR_DIGITAL_INTERFACE_IN_USE
Digital interface in use
CML_ERR_NR_OF_DATA_BITS_NOT_SUPPORTED
Number of data bits not supported
CML_ERR_INVALID_COMMUTATION_PARAMETER
Invalid commutation parameter
CML_ERR_DRIVE_CONFIGURE_ERROR
Drive configure error
CML_ERR_DRIVE_STARTUP_ERROR
Drive startup error
CML_ERR_DRIVE_NOT_DETECTED
Drive not detected
CML_ERR_DRIVE_COMMUNICATION_ERROR
Drive communication error
CML_ERR_MICROWARE_VERSION_ERROR
Microware version error
CML_ERR_SERCON100M_UNAVAILABLE
SERCON100M unavailable
CML_ERR_INDRADRIVE_CONNECT_FAILED
IndraDrive connect failed
CML_ERR_INDRADRIVE_ENABLE_POWER_FAILED
IndraDrive enable power failed
CML_ERR_INDRADRIVE_RESET_FAILED
IndraDrive reset failed
CML_ERR_INDRADRIVE_LOCK_FAILED
IndraDrive lock failed
CML_ERR_INDRADRIVE_OPEN_LOOP_FAILED
IndraDrive open loop failed
CML_ERR_INDRADRIVE_DISCONNECT_FAILED
IndraDrive disconnect failed
142/158 Bosch Rexroth AG
NYCe4000 Software User Manual
Error codes of internal subsystems
CML_ERR_INDRADRIVE_ESTOP_ACTIVE_HIGH
IndraDrive Estop active high
CML_ERR_INDRADRIVE_IO_ALREADY_USED
IndraDrive I/O already used
CML_ERR_POS_SWITCH_NOT_CONFIGURED
Position switch not configured
CML_ERR_INDRADRIVE_W_SERCOS_PARAMETER_FAILED
IndraDrive W SERCOS parameter
failed
CML_ERR_INDRADRIVE_R_SERCOS_PARAMETER_FAILED
IndraDrive R SERCOS parameter
failed
CML_ERR_INDRADRIVE_W_CC_PARS_FAILED
IndraDrive W CC parameters failed
CML_ERR_INDRADRIVE_W_CTROUT_INV_FAILED
IndraDrive W controller out invert
failed
CML_ERR_INDRADRIVE_W_PWM_FAILED
IndraDrive W PWM failed
CML_ERR_INDRADRIVE_W_MS_DIR_FAILED
IndraDrive W MS dir failed
CML_ERR_INDRADRIVE_W_LATCH_FAILED
IndraDrive W latch failed
CML_ERR_INDRADRIVE_W_ESTOP_FAILED
IndraDrive W Estop failed
CML_ERR_INDRADRIVE_W_POS_SWITCH_FAILED
IndraDrive W position switch failed
CML_ERR_INDRADRIVE_FUNC_IO_FAILED
IndraDrive function I-O failed
CML_ERR_INDRADRIVE_W_INERTIA_FAILED
IndraDrive W inertia failed
CML_ERR_INDRADRIVE_W_FILTER_PARS_FAILED
IndraDrive W filter parameters
failed
CML_ERR_INDRADRIVE_W_SAT_LEVEL_FAILED
IndraDrive W saturation level failed
CML_ERR_INDRADRIVE_W_PVL_PARS_FAILED
IndraDrive W PVL parameters
failed
CML_ERR_INDRADRIVE_W_ALIGN_MODE_FAILED
CML_ERR_INDRADRIVE_W_MAX_PARS_FAILED
IndraDrive W align mode failed
IndraDrive W maximum parameters
failed
CML_ERR_INDRADRIVE_ACT_PROBE_FAILED
IndraDrive activate probe failed
CML_ERR_INDRADRIVE_START_ALIGNMENT_FAILED
IndraDrive start alignment failed
CML_ERR_INDRADRIVE_R_ALIGNMENT_STATUS_FAILED
IndraDrive R alignment status failed
CML_ERR_INDRADRIVE_W_ANOUT_FAILED
IndraDrive W analog out failed
CML_ERR_INDRADRIVE_LED_BLINK_FAILED
IndraDrive LED blink failed
CML_ERR_INDRADRIVE_R_ENCODER_DATA_FAILED
IndraDrive R encoder data failed
CML_ERR_INDRADRIVE_R_INDRADRIVE_INFO_FAILED
IndraDrive R IndraDrive info failed
CML_ERR_INDRADRIVE_S_MOTOR_PARS_FAILED
IndraDrive S motor parameters
failed
CML_ERR_INDRADRIVE_MOTOR_WITH_ENC_MEMORY
IndraDrive motor with encoder
memory
CML_ERR_INDRADRIVE_MOTOR_WITHOUT_ENC_MEMORY
IndraDrive motor without encoder
memory
CML_ERR_INDRADRIVE_W_RESOLUTION_FAILED
IndraDrive W resolution failed
CML_ERR_INDRADRIVE_READY_FOR_OPERATION
IndraDrive ready for operation
CML_ERR_INDRADRIVE_R_MOTOR_PARS_FAILED
IndraDrive R motor parameters
failed
CML_ERR_INDRADRIVE_R_P0018_FAILED
IndraDrive R P0018 failed
NYCe4000 Software User Manual
Bosch Rexroth AG 143/158
Error codes of internal subsystems
CML_ERR_INDRADRIVE_R_P0051_FAILED
IndraDrive R P0051 failed
CML_ERR_INDRADRIVE_R_P4014_FAILED
IndraDrive R P4014 failed
CML_ERR_INDRADRIVE_R_P4016_FAILED
IndraDrive R P4016 failed
CML_ERR_INDRADRIVE_R_P4017_FAILED
IndraDrive R P4017 failed
CML_ERR_INDRADRIVE_R_P4048_FAILED
IndraDrive R P4048 failed
CML_ERR_INDRADRIVE_R_S0109_FAILED
IndraDrive R S0109 failed
CML_ERR_INDRADRIVE_R_S0111_FAILED
IndraDrive R S0111 failed
CML_ERR_INDRADRIVE_R_S0113_FAILED
IndraDrive R S0113 failed
CML_ERR_INDRADRIVE_R_S0141_FAILED
IndraDrive R S0141 failed
CML_ERR_INDRADRIVE_R_P0074_FAILED
IndraDrive R P0074 failed
CML_ERR_INDRADRIVE_R_P0077_FAILED
IndraDrive R P0077 failed
CML_ERR_INDRADRIVE_R_S0116_FAILED
IndraDrive R S0116 failed
CML_ERR_INDRADRIVE_R_P0525_FAILED
IndraDrive R P0525 failed
CML_ERR_INDRADRIVE_R_S0206_FAILED
IndraDrive R S0206 failed
CML_ERR_INDRADRIVE_R_S0207_FAILED
IndraDrive R S0207 failed
CML_ERR_INDRADRIVE_R_P0512_FAILED
IndraDrive R P0512 failed
CML_ERR_INDRADRIVE_R_S0201_FAILED
IndraDrive R S0201 failed
CML_ERR_INDRADRIVE_R_S0204_FAILED
IndraDrive R S0204 failed
CML_ERR_INDRADRIVE_W_MOTOR_PARS_FAILED
IndraDrive W motor parameters
failed
CML_ERR_INDRADRIVE_W_P0018_FAILED
IndraDrive W P0018 failed
CML_ERR_INDRADRIVE_W_P0051_FAILED
IndraDrive W P0051 failed
CML_ERR_INDRADRIVE_W_P4014_FAILED
IndraDrive W P4014 failed
CML_ERR_INDRADRIVE_W_P4016_FAILED
IndraDrive W P4016 failed
CML_ERR_INDRADRIVE_W_P4017_FAILED
IndraDrive W P4017 failed
CML_ERR_INDRADRIVE_W_P4048_FAILED
IndraDrive W P4048 failed
CML_ERR_INDRADRIVE_W_S0109_FAILED
IndraDrive W S0109 failed
CML_ERR_INDRADRIVE_W_S0111_FAILED
IndraDrive W S0111 failed
CML_ERR_INDRADRIVE_W_S0113_FAILED
IndraDrive W S0113 failed
CML_ERR_INDRADRIVE_W_S0141_FAILED
IndraDrive W S0141 failed
CML_ERR_INDRADRIVE_W_P0074_FAILED
IndraDrive W P0074 failed
CML_ERR_INDRADRIVE_W_P0077_FAILED
IndraDrive W P0077 failed
CML_ERR_INDRADRIVE_W_S0116_FAILED
IndraDrive W S0116 failed
CML_ERR_INDRADRIVE_W_P0525_FAILED
IndraDrive W P0525 failed
CML_ERR_INDRADRIVE_W_S0206_FAILED
IndraDrive W S0206 failed
CML_ERR_INDRADRIVE_W_S0207_FAILED
IndraDrive W S0207 failed
CML_ERR_INDRADRIVE_W_P0512_FAILED
IndraDrive W P0512 failed
CML_ERR_INDRADRIVE_W_S0201_FAILED
IndraDrive W S0201 failed
CML_ERR_INDRADRIVE_W_S0204_FAILED
IndraDrive W S0204 failed
144/158 Bosch Rexroth AG
NYCe4000 Software User Manual
Error codes of internal subsystems
CML_ERR_INDRADRIVE_W_S0044_FAILED
IndraDrive W S0044 failed
CML_ERR_INDRADRIVE_W_S0076_FAILED
IndraDrive W S0076 failed
CML_ERR_INDRADRIVE_W_S0086_FAILED
IndraDrive W S0086 failed
CML_ERR_INDRADRIVE_W_S0160_FAILED
IndraDrive W S0160 failed
CML_ERR_INDRADRIVE_W_S0277_FAILED
IndraDrive W S0277 failed
CML_ERR_INDRADRIVE_W_S0278_FAILED
IndraDrive W S0278 failed
CML_ERR_INDRADRIVE_W_S0103_FAILED
IndraDrive W S0103 failed
CML_ERR_INDRADRIVE_SWITCH_TO_OM_FAILED
IndraDrive switch to OM failed
CML_ERR_INDRADRIVE_W_P0566_FAILED
IndraDrive W P0566 failed
CML_ERR_INDRADRIVE_SWITCH_TO_PM_FAILED
IndraDrive switch to PM failed
CML_ERR_INDRADRIVE_R_S0106_FAILED
IndraDrive R S0106 failed
CML_ERR_INDRADRIVE_R_S0107_FAILED
IndraDrive R S0107 failed
CML_ERR_INDRADRIVE_R_S0110_OR_P0051_FAILED
IndraDrive R S0110 or P0051 failed
CML_ERR_INDRADRIVE_INVALID_ADDRESS
IndraDrive invalid address
CMLFLASH_ERR_INVALID_DATA_ID
Flash invalid data ID
CMLFLASH_ERR_INVALID_VERSION
Flash invalid version
CMLFLASH_ERR_INVALID_NR_OF_CFG_DATA
Flash invalid number of config data
CMLFLASH_ERR_SAVE_TO_FLASH
Flash save to flash
CMLFLASH_ERR_INTERNAL_ERROR
Flash internal error
NYCe4000 Software User Manual
Bosch Rexroth AG 145/158
Error codes of internal subsystems
11.2 CTR subsystem error codes
Table 28 Error codes of the CTR subsystem
Error code
description
CTR_ERR_INVALID_PARAMETER
Invalid parameter
CTR_ERR_INVALID_TASK_PAR_SIZE
Invalid task parameter size
CTR_ERR_STATE_ERROR
State error
CTR_ERR_INVALID_AXIS
Invalid axis
CTR_ERR_INVALID_DATA_ID
Invalid data ID
CTR_ERR_TEST_SIGNAL_GENERATOR_ACTIVE
Test signal generator active
CTR_ERR_INVALID_MOTOR_TYPE
Invalid motor type
CTR_ERR_SAFETY_MODE_ACTIVE
Safety mode active
CTR_ERR_INVALID_CONTROLLER
Invalid controller
CTR_ERR_AUTO_TWEAK_NOT_DISABLED
Auto tweak not disabled
CTR_ERR_FFW_TABLE_NOT_DOWNLOADED
Feedforward table not downloaded
CTR_ERR_INVALID_FFW_TABLE_SIZE
Invalid Feedforward table size
CTR_ERR_FFW_TABLE_NOT_ENABLED
Feedforward table not enabled
CTR_ERR_INVALID_NR_OF_PERIODS
Invalid number of periods
CTR_ERR_INVALID_TIME
Invalid time
CTR_ERR_INTERNAL_ERROR
CTR internal error
CTR_ERR_LIN_LUT_NOT_DISABLED
Linearization lookup table not disabled
CTR_ERR_INVALID_LIN_LUT_TABLE_SIZE
Invalid linearization lookup table size
CTR_ERR_LIN_LUT_DOWNLOAD_IN_PROGRESS
Linearization lookup table download in
progress
CTR_ERR_LIN_LUT_NOT_DOWNLOADED
Linearization lookup table not
downloaded
CTR_ERR_AXIS_NOT_HOMED
Axis not homed
CTR_ERR_COMMUTATION_CORRECTION_ENABLED
Commutation correction enabled
CTR_ERR_BLAC_NOT_ALIGNED
BLAC not aligned
CTR_ERR_INVALID_CORRECTIVE_AXIS
Invalid corrective axis
CTR_ERR_CORRECTIVE_AXIS_NOT_HOMED
Corrective axis not homed
CTR_ERR_CORRECTIVE_AXIS_STATE_ERROR
Corrective axis state error
CTR_ERR_CORRECTIVE_AXIS_NOT_ON_SAME_NODE
Corrective axis not on same node
CTR_ERR_INVALID_DATA_SIZE
Invalid data size
CTR_ERR_OUTPUT_IS_EXTERNAL_DRIVE
Output is external drive
CTR_ERR_INVALID_AAF_SAMPLE_RATIO
Invalid anti-aliasing sample ratio
CTR_ERR_INVALID_AXIS_TYPE
Invalid axis type
CTR_ERR_POS_SWITCH_DEFINED
Position switch defined
CTR_ERR_INVALID_POSITION_RANGE
Invalid position range
CTR_ERR_NOT_SUPPORTED
Not supported
146/158 Bosch Rexroth AG
NYCe4000 Software User Manual
Error codes of internal subsystems
CTR_ERR_INVALID_SLOT_ID
Invalid slot ID
CTR_ERR_INVALID_AN_IN_NR
Invalid analog input number
CTR_ERR_INVALID_INDRA_RESOLUTION
Invalid IndraDrive resolution
11.3 ECG subsystem error codes
Table 29 Error codes of the ECG subsystem
Error code
description
ECG_ERR_INVALID_PARAMETER
Invalid parameter
ECG_ERR_INVALID_TASK_PAR_SIZE
Invalid task parameter size
ECG_ERR_STATE_ERROR
State error
ECG_ERR_INVALID_AXIS
Invalid axis
ECG_ERR_INVALID_DATA_ID
Invalid data ID
ECG_ERR_INVALID_DATA
Invalid data
ECG_ERR_NO_MASTER_LINKED
No master linked
ECG_ERR_DIRECTION_ERROR
Direction error
ECG_ERR_SLAVE_ALREADY_LINKED
Slave already active
ECG_ERR_INVALID_MASTER_ID
Invalid master ID
ECG_ERR_INTERNAL_ERROR
Internal error
ECG_ERR_INVALID_CAM_TYPE
Invalid cam type
ECG_ERR_INVALID_NR_OF_TABLES
Invalid number of tables
ECG_ERR_TOO_MANY_TABLES
Too many tables
ECG_ERR_INVALID_NR_OF_POINTS
Invalid number of points
ECG_ERR_MEMORY_OVERFLOW
Memory overflow
ECG_ERR_UNEXPECTED_TASK_MESSAGE_NR
Unexpected task message number
ECG_ERR_INVALID_NR_OF_POINTS_IN_TASK
Invalid number of points in task
ECG_ERR_INVALID_NR_OF_TASK_MESSAGES
Invalid number of task messages
ECG_ERR_NO_CAM_DATA_AVAILABLE
No cam data available
ECG_ERR_INCONSISTENT_CAM_TYPE
Inconsistent cam type
ECG_ERR_INCONSISTENT_NR_OF_POINTS
Inconsistent number of points
ECG_ERR_INVALID_CAM_DATA
Invalid cam data
ECG_ERR_NO_UNIQUE_TABLE_ID
No unique table ID
ECG_ERR_INVALID_TABLE_ID
Invalid table ID
ECG_ERR_TABLE_IN_USE
Table in use
NYCe4000 Software User Manual
Bosch Rexroth AG 147/158
Error codes of internal subsystems
11.4 EDH subsystem error codes
Table 30 Error codes of the EDH subsystem
Error code
description
EDH_ERR_INVALID_PARAMETER
Invalid parameter
EDH_ERR_INVALID_TASK_PAR_SIZE
Invalid task parameter size
EDH_ERR_STATE_ERROR
State error
EDH_ERR_INVALID_AXIS
Invalid axis
EDH_ERR_INVALID_DATA_ID
Invalid data ID
EDH_ERR_INVALID_GROUP_ID
Invalid group ID
EDH_ERR_INVALID_HANDLER_ID
Invalid handler ID
EDH_ERR_GROUP_ID_ALREADY_DEFINED
Group ID already defined
EDH_ERR_INTERNAL_ERROR
EDH internal error
EDH_ERR_POS_SERVO_VOLTAGE_TOO_LOW
Positive servo voltage too low
EDH_ERR_POS_SERVO_VOLTAGE_TOO_HIGH
Positive servo voltage too high
EDH_ERR_NEG_SERVO_VOLTAGE_TOO_LOW
Negative servo voltage too low
EDH_ERR_NEG_SERVO_VOLTAGE_TOO_HIGH
Negative servo voltage too high
EDH_ERR_NOT_SUPPORTED
Not supported
148/158 Bosch Rexroth AG
NYCe4000 Software User Manual
Error codes of internal subsystems
11.5 EVH subsystem error codes
Table 31 Error codes of the EVH subsystem
Error code
description
EVH_ERR_INVALID_PARAMETER
Invalid parameter
EVH_ERR_INVALID_TASK_PAR_SIZE
Invalid task parameter size
EVH_ERR_STATE_ERROR
State error
EVH_ERR_INVALID_AXIS
Invalid axis
EVH_ERR_INVALID_DATA_ID
Invalid data ID
EVH_WRN_REQUEST_ALREADY_DEFINED
Warning, request already defined
EVH_ERR_SYSTEM_ERROR
EVH system error
EVH_ERR_REQUEST_TIMEOUT
Request timeout
EVH_ERR_BLAC_NOT_ALIGNED
BLAC not aligned
EVH_ERR_INVALID_EVENT_ID
Invalid event ID
EVH_ERR_INVALID_ACTION_ID
Invalid action ID
EVH_ERR_TOO_MANY_MARKERS_DEFINED
Too many markers defined
EVH_ERR_INVALID_DATA_SET_ID
Invalid data set ID
EVH_ERR_INVALID_DATA_SET_SIZE
Invalid data set size
EVH_ERR_MARKER_ID_ALREADY_DEFINED
Marker ID already defined
EVH_ERR_INVALID_MARKER_REPEAT_DISTANCE
Invalid marker repeat distance
EVH_ERR_INTERNAL_ERROR
EVH internal error
EVH_ERR_TOO_MANY_SYNC_GROUPS
Too many sync groups
11.6 GEN subsystem error codes
Table 32 Error codes of the GEN subsystem
Error code
description
GEN_ERR_INVALID_AXIS
Invalid axis
GEN_ERR_INVALID_COMMAND
Invalid command
GEN_ERR_INVALID_GROUP
Invalid group
GEN_ERR_INVALID_SYNC_COMMAND
Invalid sync command
GEN_ERR_INVALID_DATA_ID
Invalid data ID
GEN_ERR_INTERNAL_ERROR
GEN internal error
GEN_ERR_INVALID_DATA_SIZE
Invalid data size
NYCe4000 Software User Manual
Bosch Rexroth AG 149/158
Error codes of internal subsystems
11.7 HNI subsystem error codes
Table 33 Error codes of the HNI subsystem
Error code
description
HNI_WRN_USER_ABORT
Warning, user abort
HNI_ERR_INVALID_PARAMETER
Invalid parameter
HNI_ERR_OS_ERROR
Operating System error
HNI_ERR_NETWORK_ERROR
Network error
HNI_ERR_SYSTEM_ERROR
HNI system error
HNI_ERR_INVALID_OUTPUT_ARGUMENT
Invalid output argument
HNI_ERR_WAIT_FOR_BUSRESET_TIMEOUT
Wait for bus reset timeout
HNI_ERR_WRONG_DRIVER_VERSION
Wrong driver version
HNI_ERR_INSUFFICIENT_ISOCH_CHANNELS
Insufficient isochronous channels
HNI_ERR_BUSRESET_DURING_TASK_EXECUTION
Bus reset during task execution
HNI_ERR_OPERATION_ABORTED
Operation aborted
HNI_ERR_INVALID_DEVICE_STATE
Invalid device state
HNI_ERR_INVALID_HANDLE
Invalid handle
HNI_WRN_DEVICE_BUSY
Warning, device busy
HNI_ERR_NETWORK_TIMEOUT
Network timeout
150/158 Bosch Rexroth AG
NYCe4000 Software User Manual
Error codes of internal subsystems
11.8 NCS subsystem error codes
Table 34 Error codes of the NCS subsystem
Error code
description
NCS_ERR_BUFFER_TOO_SMALL
Buffer too small
NCS_ERR_DUPLICATE_NAME
Duplicate name
NCS_ERR_INVALID_OUTPUT_ARGUMENT
Invalid output argument
NCS_ERR_INVALID_OUTPUT_SIZE
Invalid output size
NCS_ERR_INVALID_PARAMETER
Invalid parameter
NCS_ERR_INVALID_TRACE_STATE
Invalid trace state
NCS_ERR_NETWORK_ERROR
Network error
NCS_ERR_NO_VARIABLE_TO_TRACE
No variable to trace
NCS_ERR_OUT_OF_MEMORY
Out of memory
NCS_ERR_SYSTEM_ERROR
NCS system error
NCS_ERR_TRACE_FULL
Trace full
NCS_ERR_TRACE_NO_DATA
Trace no data
NCS_ERR_TRACE_NOT_STARTED
Trace not started
NCS_ERR_VARSET_FULL
Variable set full
NCS_ERR_NODE_DOES_NOT_EXIST
Node does not exist
NCS_ERR_AXIS_DOES_NOT_EXIST
Axis does not exist
NCS_WRN_USER_ABORT
Warning, user abort
NCS_ERR_ALREADY_INIT
Already initialized
NCS_ERR_NOT_INIT
Not initialized
NCS_ERR_DUPLICATE_NODENAME
Duplicate node name
NCS_ERR_DUPLICATE_AXISNAME
Duplicate axis name
NCS_ERR_NOT_TRACE_OWNER
Not trace owner
NCS_ERR_NO_ENROLMENT_DEFINED
No enrolment defined
NCS_ERR_WRONG_HNI_VERSION
Wrong HNI version
NCS_WRN_NOT_SUPPORTED_IN_SIMULATION
Not supported in simulation
NCS_ERR_MECH_DOES_NOT_EXIST
Mechanism does not exist
NCS_ERR_DUPLICATE_MECHNAME
Duplicate mechanism name
NCS_NETWORK_CONFIG_CHANGE_OCCURRED
Network configuration change occurred
NCS_NODE_CONFIG_CHANGE_OCCURRED
Node configuration change occurred
NCS_BUSRESET_OCCURRED
Bus reset occurred
NCS_AXIS_CONFIG_CHANGE_OCCURRED
Axis configuration change occurred
NCS_ERR_WRONG_NETSERVICE_VERSION
Wrong net service version
NCS_ERR_WRONG_SIMSERVICE_VERSION
Wrong sim service version
NCS_ERR_WRONG_FIRMWARE_VERSION
Wrong firmware version in MCU
NCS_WRN_WRONG_FIRMWARE_VERSION
Warning, wrong firmware version in MCU
NYCe4000 Software User Manual
Bosch Rexroth AG 151/158
Error codes of internal subsystems
NCS_ERR_WRONG_NET_VERSION
Wrong net version
NCS_ERR_WRONG_SIM_VERSION
Wrong sim version
NCS_ERR_NETSERVICE_NOT_AVAILABLE
Net service not available
NCS_ERR_SIMSERVICE_NOT_AVAILABLE
Sim service not available
NCS_NETWORK_OUT_OF_SYNC
Network out of sync
11.9 NLM subsystem error codes
Table 35 Error codes of the NLM subsystem
Error code
description
NLM_ERR_INVALID_TASK_ID
Invalid task ID
NLM_ERR_INVALID_TASK_PAR_SIZE
Invalid task parameter size
NLM_ERR_INVALID_DATA_SET_SIZE
Invalid data set size
NLM_ERR_INVALID_DATA_SET_ID
Invalid data set ID
11.10 NNI subsystem error codes
Table 36 Error codes of the NNI subsystem
Error code
description
NNI_ERR_EVENT_QUEUE_FULL
Event queue full
NNI_ERR_SYSTEM_ERROR
NNI system error
NNI_WRN_NO_MESSAGE
Warning, no message
NNI_WRN_STATE_ERROR
Warning, state error
NNI_ERR_REQUEST_BUFFER_FULL
Request buffer full
NNI_ERR_NETWORK_NOT_INITIALIZED
Network not initialized
NNI_ERR_PACKET_TO_LARGE
Packet too large
NNI_ERR_TRANSMIT_BUFFER_FULL
Transmit buffer full
NNI_ERR_MULTI_PACKET_TASKS_NOT_SUPPORTED
Multi packet tasks not supported
152/158 Bosch Rexroth AG
NYCe4000 Software User Manual
Error codes of internal subsystems
11.11 OSAL subsystem error codes
Table 37 Error codes of the OSAL subsystem
Error code
description
OSAL_ERR_SYSTEM_ERROR
OSAL system error
OSAL_ERR_INVALID_PARAMETER
Invalid parameter
OSAL_ERR_TIMEOUT
Timeout
OSAL_ERR_MUTEX_ERROR
Mutex error
OSAL_ERR_MUTEX_INVALID_PARAMETER
Mutex invalid parameter
OSAL_WRN_MUTEX_ALREADY_EXIST
Warning, mutex already exists
OSAL_ERR_EVENT_ERROR
Event error
OSAL_ERR_EVENT_INVALID_PARAMETER
Event invalid parameter
OSAL_WRN_EVENT_ALREADY_EXIST
Warning, event already exists
OSAL_ERR_SEM_ERROR
Semaphore error
OSAL_ERR_SEM_INVALID_PARAMETER
Semaphore invalid parameter
OSAL_WRN_SEM_ALREADY_EXIST
Warning, semaphore already exists
OSAL_ERR_SHM_ERROR
Shared memory error
OSAL_ERR_SHM_INVALID_PARAMETER
Shared memory invalid parameter
OSAL_WRN_SHM_ALREADY_EXIST
Warning, shared memory already exists
OSAL_ERR_SHM_NO_MEM
Shared memory no memory
OSAL_ERR_MBOX_ERROR
Mailbox error
OSAL_ERR_MBOX_INVALID_PARAMETER
Mailbox invalid parameter
OSAL_WRN_MBOX_ALREADY_EXIST
Warning, mailbox already exists
OSAL_ERR_MBOX_NO_MEM
Mailbox no memory
OSAL_ERR_MBOX_FULL
Mailbox full
OSAL_ERR_MBOX_INVALID_HANDLE
Mailbox invalid handle
OSAL_ERR_MBOX_MSG_TOO_BIG
Mailbox message too big
OSAL_WRN_MBOX_NO_MSG
Warning, mailbox no message
OSAL_ERR_TIME_ERROR
Timeout
OSAL_ERR_TIME_INVALID_PARAMETER
Time invalid parameter
OSAL_WRN_TIME_ALREADY_EXIST
Warning, time already exists
OSAL_ERR_OS_ERROR
Operating System error
OSAL_ERR_CRITSECT_INVALID_PARAMETER
Critical section invalid parameter
OSAL_ERR_CRITSECT_NOT_ENTERED
Critical section not entered
OSAL_ERR_STOPW_INVALID_PARAMETER
Stopwatch invalid parameter
OSAL_ERR_INVALID_OUTPUT_ARGUMENT
Invalid output argument
OSAL_ERR_ALREADY_INIT
Already initialized
OSAL_ERR_NOT_INIT
Not initialized
OSAL_WRN_SYSTEM_PROCESS
Warning, system process
NYCe4000 Software User Manual
Bosch Rexroth AG 153/158
Error codes of internal subsystems
OSAL_WRN_MUTEX_OWNED_THREAD_KILLED
Warning, mutex owned thread killed
11.12 PDS subsystem error codes
Table 38 Error codes of the PDS subsystem
Error code
description
PDS_ERR_MAX_VARS_REACHED
Maximum variables reached
PDS_ERR_MAX_TRACE_VARS_REACHED
Maximum trace variables reached
PDS_ERR_INVALID_TASK_PAR_SIZE
Invalid task parameter size
PDS_ERR_INVALID_PARAMETER
Invalid parameter
PDS_ERR_INVALID_MASTER_ID
Invalid master ID
PDS_ERR_INVALID_DATA_ID
Invalid data ID
PDS_ERR_INVALID_AXIS
Invalid axis
PDS_ERR_TOO_MANY_BC_MASTERS
Too many broadcast masters
PDS_ERR_NO_FREE_BC_CHANNEL
No free broadcast channel
PDS_ERR_OUTPUT_IS_EXTERNAL_DRIVE
Output is external drive
PDS_ERR_OUTPUT_ALREADY_CONFIGURED
Output already configured
PDS_ERR_OUTPUT_NOT_CONFIGURED
Output not configured
PDS_ERR_INVALID_SLOT_ID
Invalid slot ID
PDS_ERR_INTERNAL_ERROR
PDS internal error
PDS_ERR_INVALID_LATCH_SET_ID
Invalid latch set ID
PDS_ERR_INVALID_LATCH_SET_STATE
Invalid latch set state
PDS_ERR_LATCH_SET_VARIABLE_ALREADY_DEFINED
Latch set variable already defined
PDS_ERR_LATCH_SET_FULL
Latch set full
PDS_ERR_INVALID_ANALOG_OUT_NR
Invalid analog output number
154/158 Bosch Rexroth AG
NYCe4000 Software User Manual
Error codes of internal subsystems
11.13 PPI subsystem error codes
Table 39 Error codes of the PPI subsystem
Error code
description
PPI_ERR_STATE_ERROR
State error
PPI_ERR_FLASH_WRITE_ERROR
Flash write error
PPI_ERR_FLASH_ERASE_ERROR
Flash erase error
PPI_ERR_AXIS_IN_USE
Axis in use
PPI_ERR_CHECKSUM_FAILED
Checksum failed
PPI_ERR_WRITING_MCU_EEPROM
Writing MCU EEPROM
PPI_ERR_WRITING_DRIVE_EEPROM
Writing drive EEPROM
PPI_ERR_MCU_EEPROM_CRC_CORRUPT
MCU EEPROM CRC corrupt
PPI_WRN_DRIVE_EEPROM_CRC_CORRUPT
Warning, drive EEPROM CRC corrupt
PPI_ERR_INVALID_TASK_PAR_SIZE
Invalid task parameter size
PPI_ERR_INVALID_PARAMETER
Invalid parameter
PPI_ERR_INVALID_DATA_SET_SIZE
Invalid data set size
PPI_ERR_INVALID_DATA_SET_ID
Invalid data set ID
PPI_ERR_INTERNAL_ERROR
PPI internal error
PPI_ERR_MCU_WRONG_HW_VERSION
MCU wrong hardware version
PPI_ERR_DRIVE_WRONG_HW_VERSION
Drive wrong hardware version
11.14 SPG subsystem error codes
Table 40 Error codes of the SPG subsystem
Error code
description
SPG_ERR_INVALID_PARAMETER
Invalid parameter
SPG_ERR_INVALID_TASK_PAR_SIZE
Invalid task parameter size
SPG_ERR_STATE_ERROR
State error
SPG_ERR_INVALID_AXIS
Invalid axis
SPG_ERR_INVALID_DATA_ID
Invalid data ID
SPG_ERR_SPLINE_BUFFER_OVERFLOW
Spline buffer overflow
SPG_ERR_SPLINE_BUFFER_EMPTY
Spline buffer empty
SPG_ERR_LAST_SPLINE_VEL_NON_ZERO
Last spline velocity non-zero
SPG_ERR_INTERNAL_ERROR
SPG internal error
SPG_ERR_POSITION_OUT_OF_RANGE
Position out of range
SPG_ERR_VELOCITY_TOO_HIGH_FOR_SAFE_STOP
Velocity too high for safe stop
SPG_ERR_HOME_MODE_NOT_SUPPORTED
Home mode not supported
NYCe4000 Software User Manual
Bosch Rexroth AG 155/158
Error codes of internal subsystems
11.15 STD subsystem error codes
Table 41 Error codes of the STD subsystem
Error code
description
STD_ERR_INVALID_PARAMETER
Invalid parameter
STD_ERR_INVALID_TASK_PAR_SIZE
Invalid task parameter size
STD_ERR_STATE_ERROR
State error
STD_ERR_INVALID_AXIS
Invalid axis
STD_ERR_INVALID_DATA_ID
Invalid data ID
STD_ERR_BLAC_NOT_ALIGNED
BLAC not aligned
STD_ERR_INTERNAL_ERROR
STD internal error
STD_ERR_PIEZO_STACK_DECOUPLED
Piezo stack decoupled
STD_ERR_INDRA_BLAC_NOT_ALIGNED
IndraDrive BLAC not aligned
STD_ERR_INVALID_AXIS_TYPE
Invalid axis type
11.16 TSK subsystem error codes
Table 42 Error codes of the TSK subsystem
Error code
description
TSK_ERR_INVALID_AXIS
Invalid axis
TSK_ERR_INVALID_AXIS_TASK_ID
Invalid axis task ID
TSK_ERR_INVALID_DATA_ID
Invalid data ID
TSK_ERR_INVALID_NODE_TASK_ID
Invalid node task ID
TSK_ERR_INVALID_TASK_SIZE
Invalid task size
TSK_ERR_INVALID_TASK_PAR_SIZE
Invalid task parameter size
TSK_ERR_NO_WRITE_ACCESS
No write access
TSK_ERR_SAVE_TO_FLASH
Save to flash
TSK_ERR_STACK_OVERFLOW
Stack overflow
TSK_ERR_INCONSISTENT_FLASH_DATA
Inconsistent flash data
TSK_ERR_INVALID_DATA_SET_SIZE
Invalid data set size
TSK_ERR_INTERNAL_ERROR
TSK internal error
TSK_ERR_NODE_TASK_NOT_ALLOWED
Node task not allowed
TSK_ERR_AXIS_TASK_NOT_ALLOWED
Axis task not allowed
156/158 Bosch Rexroth AG
NYCe4000 Software User Manual
Error codes of internal subsystems
11.17 UTILS subsystem error codes
Table 43 Error codes of the UTILS subsystem
Error code
description
UTILS_ERR_XML_INTERNAL_ERROR
XML internal error
UTILS_ERR_XML_INVALID_PARAMETER
XML invalid parameter
UTILS_ERR_XML_INVALID_OUTPUT_ARGUMENT
XML invalid output argument
UTILS_ERR_XML_FILE_NOT_FOUND
XML file not found
UTILS_ERR_XML_FILE_WRITE_ERROR
XML write specified file failed
UTILS_ERR_XML_FILE_CONTENTS_ERROR
XML content of specified file not correct
UTILS_ERR_XML_NODE_NOT_FOUND
XML node not found
UTILS_ERR_XML_PROPERTY_NOT_FOUND
XML property not found
NYCe4000 Software User Manual
Bosch Rexroth AG 157/158
Error codes of internal subsystems
Bosch Rexroth AG
Electric Drives and Controls
P.O. Box 13 57
97803 Lohr, Germany
Bgm.-Dr.-Nebel-Str. 2
97816 Lohr, Germany
Phone
+49 9352 40-0
Fax
+49 9352 40-4885
www.boschrexroth.com
Bosch Rexroth AG
Electric Drives and Controls
Luchthavenweg 20
5657 EB Eindhoven,
The Netherlands
Phone
+31 40 257 8888
Fax
+31 40 257 8800
www.boschrexroth.com/nyce
© Copyright 2026