ACSPL Programmers Guide
ACSPL Programmers Guide
Programmer's Guide
November 2021
Document Revision: 3.11.01
ACSPL+ Programmer's Guide
ACSPL+
COPYRIGHT
Changes are periodically made to the information in this document. Changes are published as release notes and later
incorporated into revisions of this document.
No part of this document may be reproduced in any form without prior written permission from ACS Motion Control.
TRADEMARKS
EtherCAT® is registered trademark and patented technology, licensed by Beckhoff Automation GmbH, Germany.
Any other companies and product names mentioned herein may be the trademarks of their respective owners.
PATENTS
www.acsmotioncontrol.com
NOTICE
The information in this document is deemed to be correct at the time of publishing. ACS Motion Control reserves the right to
change specifications without notice. ACS Motion Control is not responsible for incidental, consequential, or special damages
of any kind in connection with using this document.
Version 3.11.01 2
ACSPL+ Programmer's Guide
Revision History
Date Revision Description
September
3.02 Remove reference to obsolete SPiiPlus PCI device
2020
Version 3.11.01 3
ACSPL+ Programmer's Guide
Format Description
Blue Hyperlink
Flagged Text
Version 3.11.01 4
ACSPL+ Programmer's Guide
Related Documents
Documents listed in the following table provide additional information related to this document.
The most updated version of the documents can be downloaded by authorized users from
www.acsmotioncontrol.com/downloads.
Online versions for all ACS software manuals are available to authorized users at ACS Motion Control
Knowledge Center.
Document Description
SPiiPlus MMI
Explains how to use the SPiiPlus MMI Application Studio and
Application Studio User
associated monitoring tools.
Guide
SPiiPlus C Library
C++ and Visual Basic® libraries for host PC applications. This guide
Reference Programmer
is applicable for all the SPiiPlus motion control products.
Guide
SPiiPlus COM Library COM Methods, Properties, and Events for Communication with the
Programmer's Guides Controller.
SPiiPlus .NET Library .NET Methods, Properties, and Events for Communication with the
Programmer's Guide Controller.
SPiiPlus Utilities User A guide for using the SPiiPlus User Mode Driver (UMD) for setting
Guide up communication with the SPiiPlus motion controller
SPiiPlusNT-DC
Technical description of the SPiiPlusNT-DC product line.
Hardware Guide
PDMNT Product Guide Technical description of the PDMNT Universal Drive Module
Version 3.11.01 5
ACSPL+ Programmer's Guide
Document Description
SDMNT Product Guide Technical description of the SDMNT Universal Drive Module
UDMNT Installation
Technical description of the UDMNT Universal Drive Module
Guide
HSSI Expansion High-Speed Synchronous Serial Interface (HSSI) for expanded I/O,
Modules Guide distributed axes, and nonstandard devices.
Version 3.11.01 6
ACSPL+ Programmer's Guide
Table of Contents
1. Introduction 27
1.1 ACSPL+ Programming Language 27
2. SPiiPlus Architecture 28
2.1 Hardware Structure 28
2.1.1 Firmware 29
2.1.2 Controller Cycle and Servo Tick 29
2.1.3 Realtime and Background Tasks 29
2.2 User Application 31
2.2.1 Firmware, User Application and Tools 31
2.2.2 User Application Components 31
2.2.3 User Applications Categories 32
2.2.4 SPiiPlus MMI Application Studio 32
2.2.5 File Extensions Used in SPiiPlus MMI Application Studio 34
2.3 Programming Resources 34
2.3.1 Commands 34
2.3.2 Program Buffers 35
2.3.2.1 ACSPL+ Buffers Compilation Behavior 36
2.3.3 Declaration Buffer (D-Buffer) 36
2.3.3.1 Defining Global Objects in D-Buffer 36
2.3.3.2 D-Buffer Default Contents 36
2.3.4 Command Execution 37
2.3.4.1 Terminal Commands 37
2.3.4.2 ACSPL+ Commands 37
2.3.5 ACSPL+ Standard Variables 38
2.3.6 User-Defined Variables 38
2.3.7 Nonvolatile Memory and Power Up Process 38
2.4 Executing ACSPL+ Programs 39
2.4.1 Program Buffers 39
2.4.2 Execution of a Single Program 39
2.4.3 Concurrent Execution 40
2.4.4 Immediate Execution 40
2.4.5 Immediate Execution vs. Stored Program 41
Version 3.11.01 7
ACSPL+ Programmer's Guide
Version 3.11.01 8
ACSPL+ Programmer's Guide
Version 3.11.01 9
ACSPL+ Programmer's Guide
Version 3.11.01 10
ACSPL+ Programmer's Guide
Version 3.11.01 11
ACSPL+ Programmer's Guide
Version 3.11.01 12
ACSPL+ Programmer's Guide
Version 3.11.01 13
ACSPL+ Programmer's Guide
Version 3.11.01 14
ACSPL+ Programmer's Guide
Version 3.11.01 15
ACSPL+ Programmer's Guide
Version 3.11.01 16
ACSPL+ Programmer's Guide
Version 3.11.01 17
ACSPL+ Programmer's Guide
Version 3.11.01 18
ACSPL+ Programmer's Guide
Version 3.11.01 19
ACSPL+ Programmer's Guide
Version 3.11.01 20
ACSPL+ Programmer's Guide
Version 3.11.01 21
ACSPL+ Programmer's Guide
List Of Figures
Figure 2-1. SPiiPlus Controller Hardware Structure 28
Figure 2-2. Multiple SPs Connected via EtherCAT 29
Figure 2-3. The Internal Structure of the Controller Cycle 30
Figure 2-4. User Application Block Diagram 31
Figure 2-5. SPiiPlus MMI Application Studio Main Screen 33
Figure 2-6. Communication Terminal Window 35
Figure 4-1. GRTIME Behavior in PTP or TRACK Motion 114
Figure 4-2. Corner Processing - Exact Path Option 134
Figure 4-3. Corner Processing - Permitted Deviation, Permitted Radius and Corner Rounding
Options 135
Figure 4-4. Third-Order Velocity Profile 137
Figure 4-5. Primary Axes Motion 159
Figure 4-6. Secondary Axes Motion 160
Figure 4-7. Example of motion with segment commands 172
Figure 6-1. The Use of Limit Switches 241
Figure 6-2. Use of Variables in a Typical Motion Profile 245
Figure 6-3. 32-bit Error Data Number 261
Figure 6-4. Fault Examination Flow Chart 262
Figure 7-1. SPiiPlus-Plant Connections and Related Parameters 266
Figure 8-1. PEG Engines Output Mapping 289
Figure 8-2. Simultaneous Connection for Remote Support 320
Figure 8-3. UMD Log Settings - Dump on Request 323
Figure 8-4. UMD Log Settings - Continuous 324
Figure 8-5. Data Entry Dialog 351
Figure 8-6. Screen at the Conclusion of Calculation 352
Figure 8-7. Window Accessed by Download 353
Figure 8-8. Insensitivity Curve Illustration 355
Figure 8-9. Insensitivity Curve without Robust 357
Figure 8-10. Example 1 of Using DRA 359
Figure 8-11. Example 2 of using DRA (zoomed) 359
Figure 8-12. Example of Velocity Error 361
Figure 8-13. Bi-Quad Configured as a Notch Filter 362
Version 3.11.01 22
ACSPL+ Programmer's Guide
Version 3.11.01 23
ACSPL+ Programmer's Guide
List of Tables
Table 2-1. SPiiPlus MMI Application Studio Extensions 34
Table 3-1. Example of the possible index formats. 56
Table 3-2. Mathematical Operators 72
Table 4-1. Motor Modes 192
Table 6-1. Types of Malfuntions 211
Table 6-2. Faults and the Controller's Default Response 214
Table 6-3. Safety Inputs 222
Table 6-4. Safety Related Variables 223
Table 8-1. Minimum HW Revision that supports Position Events Generation (PEG)
Improvements 282
Table 8-2. Commands Associated with Incremental PEG 283
Table 8-3. Commands Associated with Random PEG 284
Table 8-4. Typical Times to Load PEG Engines for the products that support fast loading of
Random PEG arrays 286
Table 8-5. Typical Times to Load PEG Engines for the products that do not support fast
loading of Random PEG arrays 288
Table 8-6. PEG Output Signal Configuration 299
Table 8-7. GETCONF Return Values 305
Table 8-8. Variables and Functions for Hall Support 319
Table 8-9. Hardware Interrupt Callback Conditions 321
Table 8-10. String Format Type 329
Table 8-11. Channel Number Argument 332
Table 8-12. Trigger Bit and Interrupt for each Channel 335
Table 8-13. AST Bit Descriptions 346
Table 9-1. ECST Bits 366
Table 9-2. EtherCAT Error Codes 367
Table 9-3. Supported Error Counter Registers 371
Table 10-1. SPiiPlus Error Code Ranges 378
Table A-1. 387
Table A-2. 388
Table A-3. SPiiPlus CMnt-x/UDMpm-x/UDMpc-x/CMba-x/CMhp-x/CMxa-x/UDMba-x/UDMhp-389
Version 3.11.01 24
ACSPL+ Programmer's Guide
Version 3.11.01 25
ACSPL+ Programmer's Guide
x/UDMhv-x
Table A-25. IDMxx/ECMxx/UDMxx Encoder Mapping 409
Version 3.11.01 26
ACSPL+ Programmer's Guide
1. Introduction
1. Introduction
This guide provides a general overview for programming the SPiiPlus™ motion controller products
using the ACSPL+ programming language.
The term “controller” is used in this guide whenever information applies for both
controllers and control modules. If information applies to only one of these product
groups, the group is stated explicitly.
Version 3.11.01 27
ACSPL+ Programmer's Guide
2. SPiiPlus Architecture
2. SPiiPlus Architecture
This chapter provides an overview the SPiiPlus architecture.
The Motion Processing Unit (MPU), which executes most of the controller tasks, is a powerful x86
processor. The MPU is an EtherCAT bus master and the Servo Processors (SP) are EtherCAT slaves.
One master can control several slaves.
The master MPU runs compiled ACSPL+ programs and generates motion profiles to the SPs. Its
principle tasks are:
> Communication with the SPs
> Motion profile generation (calculation of APOS)
> Calculation of Reference Position (RPOS)
> Safety control
> Data collection
> Position Event Generation (PEG)
> Processing of Index and Mark inputs
> Execution of ACSPL+ programs
> Communicating to Serial Link or Ethernet
> Execution of Immediate commands received from the Host
> Housekeeping
The MPU is equipped with a Flash (nonvolatile) memory that retains the stored data after the power
to the controller is turned off.
The SP executes the realtime tasks, such as implementation of the realtime control algorithms. Each
SP controls four axes. The SP includes all the necessary peripherals that are needed for a high
performance axis control.
A single MPU module can manage several units over the EtherCAT bus thus expanding the number
of controlled axes. For example,
Version 3.11.01 28
ACSPL+ Programmer's Guide
2. SPiiPlus Architecture
The part of the system that is connected to the rest of the system via the EtherCAT bus
is called a UNIT.
2.1.1 Firmware
The firmware consists of a set of files factory-written in the flash memory.
You cannot erase or modify the firmware; however, you are able to update the firmware version
with a special tool that is part of the SPiiPlus MMI that is supplied with the controller.
The firmware files include the following:
> MPU program.
> Default values of the controller’s configuration variables.
The following MPU tasks are the realtime tasks that are executed each controller cycle:
> Communication with the SPs
> Motion profile generation (calculation of APOS)
> Calculation of Reference Position (RPOS)
> Safety control
> Data collection
> Position Event Generation (PEG)
Version 3.11.01 29
ACSPL+ Programmer's Guide
2. SPiiPlus Architecture
Background tasks are not synchronous with the MPU interrupt. Execution of a background
task may overlap two or more controller cycles.
The following MPU tasks are the background tasks and are asynchronous to the controller
cycle:
> Communicating to Serial Link or Ethernet
> Execution of Immediate commands received from the Host
> Housekeeping
The MPU interrupt invokes the realtime tasks. When all realtime tasks required in the current cycle
are completed, the controller starts executing the background tasks. If the background tasks
complete before the next MPU interrupt occurs, the controller remains idle for the rest of the cycle.
The exact time of the realtime and background tasks in each controller cycle depends on many
factors and cannot be precisely specified. The following paragraphs explain different situations in
controller cycle utilization.
If the background task execution does not finish in one controller cycle, the background execution is
interrupted and continues after execution of the realtime tasks during the next cycle. Therefore,
background tasks may overlap into the next MPU interrupt without causing a problem. However,
overflow of realtime tasks into the next MPU interrupt is abnormal, and may cause problems with
program execution. When this occurs, the controller latches the TIME OVERUSE fault. This fault has
no default response in the controller, but your application can monitor the fault and define a proper
response.
You can monitor if the usage of the controller cycle is close to critical. The SPiiPlus MMI
Application Studio Communication Terminal command: #Uwhen entered, reports the
usage as a ratio of realtime tasks execution time and the controller cycle. A maximum
value of 90% is considered dangerous. If the usage limit is reached, you have to modify
your application.
Version 3.11.01 30
ACSPL+ Programmer's Guide
2. SPiiPlus Architecture
Version 3.11.01 31
ACSPL+ Programmer's Guide
2. SPiiPlus Architecture
program. There are 10 buffers for ACSPL+ programs. An ACSPL+ program is executed inside
the controller with strict timing and with no communication delay.
ACSPL+ programs are almost always present in user applications. Occasionally, the ACSPL+
programs are absent and the host commands all controller actions.
> Configuration variables:
The firmware includes a set of predefined variables that can be used by ACSPL+ programs
and by Immediate commands. The configuration variables are included in this set. The
values of the configuration variables are defined by the user to tailor the controller
operation to a specific task and plant control. For example, ACC defines the acceleration
that is used for motion generation. The SAFINI variable defines the polarity of the input
safety signals.
The configuration variables must always be present in user applications.
> SP programs:
The firmware includes SP (Servo Processor) real time control programs as a standard part of
the controller.
Version 3.11.01 32
ACSPL+ Programmer's Guide
2. SPiiPlus Architecture
The main features of the SPiiPlus MMI Application Studio are, amongst others:
> Program Manager
Used for entering user-written programs into the motion controller’s buffers.
> Motion Manager
Used for completely defining the motion for all axes in the system.
> Communication Terminal
Used for entering commands directly into the controller.
> Scope
A digital oscilloscope providing a realtime graphic display of the motion.
> Variables Manager and Watch
Enables the user to set watch windows for the values of critical variables.
For complete details see SPiiPlus MMI Application Studio Guide.
Version 3.11.01 33
ACSPL+ Programmer's Guide
2. SPiiPlus Architecture
2.3.1 Commands
The controller supports a rich set of commands which are divided into two types of command sets:
> Terminal Commands
Terminal commands are those that are sent directly to the controller. They are entered
through the SPiiPlus MMI Application Studio Communication Terminal. The general structure
of the Communication Terminal windows is:
Version 3.11.01 34
ACSPL+ Programmer's Guide
2. SPiiPlus Architecture
The Communication Terminal window is described in the SPiiPlus MMI Application Studio
Guide.
As soon as the command is received through one of the communication channels it is
executed. Each Terminal command starts with ? (query command) or # (program
management command), for example:
Version 3.11.01 35
ACSPL+ Programmer's Guide
2. SPiiPlus Architecture
A buffer also provides isolation between the programs. All labels and local variables defined in a
program are isolated in their buffer and are inaccessible from any other buffer. For example, two
programs can contain identical user-defined labels, but the controller considers each label as
belonging only to the buffer in which it is contained, and relates to all references to the label
appropriately.
Axes and global variables defined in D-Buffer are not required to be defined in other buffers before
use. However, such redefinition is not an error, given all attributes of the definitions are identical.
The #SAVE and #SAVEPROG commands store the D-Buffer in the flash along with other buffers.
The values are also stored using the SPiiPlus MMI Application Studio Program Manager
Buffer Editor.
At start-up, the controller loads and compiles the D-Buffer before any other buffers.
After any change in the D-Buffer, all other buffers should be recompiled.
The default contents of D-Buffer differ from other buffers. The other buffers are initially empty by
default; however, the D-Buffer contains a set of definitions that provides compatibility with previous
firmware versions. The default contents of the D-Buffer are:
Version 3.11.01 36
ACSPL+ Programmer's Guide
2. SPiiPlus Architecture
axisdef X=0,Y=1,Z=2,T=3,A=4,B=5,C=6,D=7
axisdef x=0,y=1,z=2,t=3,a=4,b=5,c=6,d=7
global int
I(100),I0,I1,I2,I3,I4,I5,I6,I7,I8,I9,I90,I91,I92,I93,I94,I95,I96,I97,I98,I99
global real
V(100),V0,V1,V2,V3,V4,V5,V6,V7,V8,V9,V90,V91,V92,V93,V94,V95,V96,V97,V98,V99
This provides you with the means to define names for the axes in your system (axisdef). The two
100 element arrays, one an integer and one a real, are, however, for internal use.
Version 3.11.01 37
ACSPL+ Programmer's Guide
2. SPiiPlus Architecture
A user-defined variable can be declared as local or global. Local variables are accessible only within
the buffer that the declaration resides in. Global variables are common to all buffers and can be
accessed from any buffer.
Version 3.11.01 38
ACSPL+ Programmer's Guide
2. SPiiPlus Architecture
Version 3.11.01 39
ACSPL+ Programmer's Guide
2. SPiiPlus Architecture
command redirects execution and defines another line to be executed in the next
controller cycle.
> A number of commands can delay program execution. For example, the command:
WAIT 50
> will execute for 50 milliseconds instead of one controller cycle. The command:
TILL ^MST(0).#MOVE
Version 3.11.01 40
ACSPL+ Programmer's Guide
2. SPiiPlus Architecture
Within a controller cycle, the immediate line is executed after all lines from the running programs.
Therefore, in one cycle the controller executes a line from buffer 0, then a line from buffers 1, 2, up to
63, and then executes a Communication Terminal command line (if any has been received).
Version 3.11.01 41
ACSPL+ Programmer's Guide
2. SPiiPlus Architecture
require any intervention from the user. If a critical section requiring mutual exclusion comprises only
a few commands, then you simply place these commands in one line.
However, if a critical section is long, or combining it in one line is undesirable for any reason, another
solution must be found. The following construction implements a simple semaphore, which is ON
(one) while the program is inside the critical section, and is OFF (zero) otherwise.
The Enter and Exit lines enclose the critical section. If the program contains several critical sections,
each section must be enclosed with the same Enter and Exit lines as shown in the example above.
All programs that require mutual exclusion must include the same declaration of the Mutex variable
and the same embracing of each critical section.
This construction guarantees that only one of the concurrent programs may be inside a critical
section. If the second program tries to enter the critical section, the command TILL ^MUTEX delays
the program execution until the first program zeroes MUTEX on exit from critical section.
It should be noted that the solution is based on automatic one-line mutual exclusion. Therefore, the
two commands:
TILL ^Mutex; Mutex = 1
must be in one line. If they are placed in two sequential lines, they cannot provide mutual exclusion.
2.4.7.2 Synchronization
Assume two programs that run mostly asynchronously must execute certain commands at the
same time. There is a point in each program that whichever program comes to the point first, it must
wait for the second program to come to its synchronization point. Then the next lines in both
programs will be executed in the next controller cycle.
The problem is solved by the following construction:
The same definition of the SEM variable and the same line of synchronization point must be in the
second program.
Whichever program comes to its synchronization point first, the command TILL SEM = 2 provides
waiting for the second program. The assignment SEM = 0 provides reuse of the construction if
necessary.
The solution can be also be extended to three or more concurrent programs.
Version 3.11.01 42
ACSPL+ Programmer's Guide
2. SPiiPlus Architecture
Version 3.11.01 43
ACSPL+ Programmer's Guide
3. ACSPL+ Overview
3. ACSPL+ Overview
SPiiPlus enables running up to 64 separate ACSPL+ programs. The programs are stored in what are
referred to as “buffers”. The programs are entered via the SPiiPlus MMI Application Studio Program
Manager (see SPiiPlus MMI Application Studio User Guide for details).
This chapter provides a general overview of ACSPL+ programming.
For complete details of the ACSPL+ command set and variables refer to the SPiiPlus Command &
Variable Reference Guide.
Version 3.11.01 44
ACSPL+ Programmer's Guide
3. ACSPL+ Overview
Version 3.11.01 45
ACSPL+ Programmer's Guide
3. ACSPL+ Overview
3.1.7 Comments
A comment is text in a program that the controller stores along with the program but ignores while
executing the program. Comments are normally used to annotate a program.
A comment starts with an exclamation mark (!). An exclamation mark encountered in a line
designates all subsequent characters in the line as part of a comment. If the exclamation sign is the
first character in a line, the whole line is a comment.
! This entire line is a comment.
V0 = V1 !This comment starts from the exclamation mark.
3.2 Variables
Variables have the following attributes:
> Name
> Class (standard or user variable)
> Scope (global or local)
> Lifetime
> Accessibility (read-write, read-only, protected)
> Type (integer, real, or matrix)
> Size
> Value
The controller has a large set of ACSPL+ variables with predefined names. You cannot
change these names. These ACSPL+ variables can be used in ACSPL+ commands
without an explicit declaration.
Version 3.11.01 46
ACSPL+ Programmer's Guide
3. ACSPL+ Overview
ACSPL+ variables are mentioned throughout this guide where they relate to a particular element or
feature of ACSPL+. For details of the ACSPL+ variables see the SPiiPlus Command & Variable
Reference Guide.
User-defined variables are defined by explicit declarations. A declaration can appear as:
> A part of an ACSPL+ program. The declared variable becomes available when the program
is inserted into one of the program buffers and is compiled. Any attempt to query a variable
in a buffer window that has not been compiled will result in an error.
> An immediate ACSPL+ command. Only global variables can be used as a Terminal
command. The declared variable becomes available immediately after the controller
executes the command.
This declaration may appear in several program buffers. However, in distinction to local variables, all
these declarations are considered to be the same variable.
Using a ACSPL+ variable in a program does not require explicit declaration of the variable. However,
a global user variable must be declared before it can be used in a program. Terminal commands can
use any global variable without explicit declaration.
real LocVar
is the same as
Version 3.11.01 47
ACSPL+ Programmer's Guide
3. ACSPL+ Overview
The name of a local variable may also be the same as the name of a global variable. The controller
considers them as different. The program where the local variable is declared has access to the local
variable only.
The controller immediately accepts the declaration and creates the persistent global variable:
PERSISTENTVAR. The variable is now valid and can be queried as illustrated by the query command,
?PERSISTENTVAR, that follows.
The lifetime of a persistent global variable is not connected with any program. A persistent variable
survives any change in the program buffers and may be erased only by the explicit #VGV (Clear
Global Variables) Terminal command.
Version 3.11.01 48
ACSPL+ Programmer's Guide
3. ACSPL+ Overview
3.2.7.1 Initialization
MATRIX A(M)(N) can be initialized as a two-dimensional array (array of M rows, each of N size)
Preconditions:
Version 3.11.01 49
ACSPL+ Programmer's Guide
3. ACSPL+ Overview
Preconditions:
1. Number of rows of initialization values = matrix first dimension
2. Number of columns of initialization values = matrix second dimension
If preconditions are violated, then a compilation error will occur.
Example:
!///Compilation-time initializations///!
MATRIX A(2)(2)=((1,2),(3,4)) !Regular initialization of a 2x2 matrix
!///Compilation-time initializations///!
MATRIX C(2)(2)!Default initialization, filled by zeros
Version 3.11.01 50
ACSPL+ Programmer's Guide
3. ACSPL+ Overview
Version 3.11.01 51
ACSPL+ Programmer's Guide
3. ACSPL+ Overview
A global variable becomes active once the first program containing it is compiled in one of the
program buffers. The variable remains valid as long as at least one of the programs containing it
remains compiled.
Local and global variables are initialized to zero during compilation.
Examples of the global variable declarations:
Version 3.11.01 52
ACSPL+ Programmer's Guide
3. ACSPL+ Overview
Access to the value of a scalar variable is provided by its name. For example:
A typical use of an array requires access to a specific element of the array. To specify an element of
an array the array name must be followed by index specification. For example:
Indexing of arrays starts from zero. In the example above the first element of AR1 has index 0, the
last element has index 99.
For information on saving user arrays in the nonvolatile memory, see Nonvolatile Memory and
Power Up Process.
Version 3.11.01 53
ACSPL+ Programmer's Guide
3. ACSPL+ Overview
Each controller axis has an index. The index is an integer number from 0 to Number_Of_Axes-1.
Version 3.11.01 54
ACSPL+ Programmer's Guide
3. ACSPL+ Overview
The index of an axis is fixed, for example, INDEX 2 always refers to a specific physical axis. For
example:
VEL(1) – stores the velocity of the axis designated as 1.
ACC(5) – stores the acceleration of the axis designated as 5.
defines the name X for axis 23, W12 for axis 9, and T9 for axis 0.
AXISDEF can be repeated many times as you like to define all required names; however, the
following restrictions apply:
> Only one name can be defined for the same axis
> The names must be unique, i.e., you cannot define two axes with the same name
> The name must not conflict with any other name of variable, label, keyword, etc.
A compilation error occurs if one of the above restrictions is not satisfied.
Axis names must be defined either in D-Buffer - see Declaration Buffer (D-Buffer), or in a program,
where it is used. In any case, the axis definition has global scope; therefore the definition of the
same axis in a different program must be identical (similar rules apply to global variables). Axis
defined in D-Buffer can be used in any other buffer without re-definition.
AXISDEF Q=3
VEL(Q)=1000;
Version 3.11.01 55
ACSPL+ Programmer's Guide
3. ACSPL+ Overview
Axes-1. User axis names can be used for indexing, not only for explicit indexing, but also for prefix
and postfix indexing, for example: given the program includes declaration:
int AxisGroup(3)
AxisGroup(0)=0; AxisGroup(1)=1; AxisGroup(2)=2;
ENABLE AxisGroup(0)
ENABLE AxisGroup(1)
ENABLE AxisGroup(2)
PTP AxisGroup,1000,1500,1200
HALT AxisGroup(0)
HALT AxisGroup(1)
HALT AxisGroup(2)
DISABLE AxisGroup(0)
DISABLE AxisGroup(1)
DISABLE AxisGroup(2)
stop
Other formats of axis specification are also supported (actually, they are considered as special forms
of array specification):
1. Axis expression, like (0, 1, 2), (Ax1, Ax2, Ax3, Ax4).
2. The keyword: ALL that specifies all available axes.
Version 3.11.01 56
ACSPL+ Programmer's Guide
3. ACSPL+ Overview
STRUCT MyStruct{
!Fields and functions
}
3.5.3 Fields
In between the brackets will appear the fields of the STRUCT.
Fields can be of several types:
> INT
> REAL
> INT ARRAY
> REAL ARRAY
> STRUCTs (recursion of STRUCT types is not supported)
All fields must have unique names.
All fields must be defined before functions are defined.
D-Buffer:
STRUCT MyStruct{
int field1;
real field2
real arr(10)
}
Version 3.11.01 57
ACSPL+ Programmer's Guide
3. ACSPL+ Overview
Buffer 0:
MyStruct var;
var.field1 = 6
var.arr(4) = 9.3
Buffer 0:
MyStruct var;
var.field1 = 6
var.arr(4) = 9.3
D-Buffer:
STRUCT InternalStruct{
int field1;
real field2
real arr(10)
}
STRUCT ExternalStruct{
InternalStruct internal;
}
Buffer 0:
Version 3.11.01 58
ACSPL+ Programmer's Guide
3. ACSPL+ Overview
ExternalStruct var;
var.internal.field1 = 6
var.internal.arr(4) = 9.3
DBUFFER:
struct MyStruct{
int field1;
real field2
real arr(10)
real getFieldsTotal();
Version 3.11.01 59
ACSPL+ Programmer's Guide
3. ACSPL+ Overview
}
real MyStruct::getFieldsTotal(){
RET field1+ field2;
}
This feature is meant to allow the user to separate struct definition (signature) from its
implementation, making the struct easier to read and understand.
Version 3.11.01 60
ACSPL+ Programmer's Guide
3. ACSPL+ Overview
An expression is calculated each time that a command that includes the expression is executed.
During calculation of the expression each variable is substituted with its current value.
Examples:
dc Data,1000,V0,FPOS(0)
Where:
1. The first argument of the DC command is required to be an array, in this case it is the user
array, DATA, that is specified without indexes, as a whole.
2. The second argument is an expression that defines the number of samples to be collected,
in this case it is a simple expression: the constant 1000.
3. The third argument is an expression that defines the sampling period. The V0 variable is a
simple expression. Using a variable instead of an integer provides changing the sampling
period, based on V0, from one execution of this data collection to another.
Version 3.11.01 61
ACSPL+ Programmer's Guide
3. ACSPL+ Overview
4. The fourth argument must be a variable or an array element. The values of the variable (in
this case V0) will be collected in the array. The syntax of DC requires that the fourth element
be a variable or an array element. Neither a general expression nor an array without
indexes can be specified. An array without indexes neither can be specified. FPOS(0)
addresses element 0 of the array FPOS that corresponds to the 0 axis feedback position.
Only global variables can be declared with a tag. The following conditions also apply:
> The tag is not mandatory in the variable declaration. However, if the tag is not declared, the
variable cannot be accessed by tag.
> The value of TAG_NUMBER must be greater than 1000. Values below 1000 are reserved for
the standard ACSPL+ variables.
> The TAG_NUMBER value must be unique in the application.
> If more than one VARIABLE_NAME is included, when the program is compiled, the controller
builds a sequence of tag numbers: the specified TAG_NUMBER is attached to the first
variable in the list, TAG_NUMBER+1 value is attached to the second variable, TAG_
NUMBER+2 to the third, and so on.
Version 3.11.01 62
ACSPL+ Programmer's Guide
3. ACSPL+ Overview
index1, Integer indexes. The indexes must be omitted if the variable is scalar. The
index2 second index must be omitted if the variable is one-dimensional array.
Comments:
The GETVAR function reads the current value of the variable and returns it as a real value. The
SETVAR function assigns the specified VALUE to the variable designated by TAG_NUMBER.
Though the VALUE argument and the return value are defined as real, the functions can be used for
integer variables as well. The controller implements all necessary transforms automatically.
The functions provide read/write access to all standard ACSPL+ variables and to those user-defined
variables declared with TAG.
Version 3.11.01 63
ACSPL+ Programmer's Guide
3. ACSPL+ Overview
Version 3.11.01 64
ACSPL+ Programmer's Guide
3. ACSPL+ Overview
Other commands, such as GETSP, can also cause the function to hold the processor past
the controller cycle time (CTIME) limit; it is the user’s responsibility to use these functions
correctly.
If a function is defined in a regular buffer, the function will only be visible inside that buffer.
Since a function cannot be used before its signature is available, it is necessary to declare the
function before use.
A function defined in the D-Buffer is available from any buffer (including the communication
terminal).
Functions that are defined in D-Buffer do not require declaration to be used in other buffers.
A function defined in a local buffer can be declared anywhere before it is used, but the best practice
is to declare all functions in the top of the buffer.
A function declaration is just the function signature. Names specified in the function declaration
could later be changed in the function definition. Return-type, name of the function and function
parameter types in the definition must conform exactly to the function declaration.
EXAMPLES
1. Local function – the function is defined, and used only in buffer 0:
BUFFER 0:
!This is the function declaration
void myFunc(int param);
!The use of the function is only possible
!after the function has been declared
myFunc(25)
STOP
!This is the function definition
void myFunc(int param){
DISP "param = ", param
param = 3
Version 3.11.01 65
ACSPL+ Programmer's Guide
3. ACSPL+ Overview
RET
}
2. Global function
D-BUFFER:
!This is the function definition
void myFunc(int param){
DISP "param = ", param
param = 3
RET
}
BUFFER 0:
!The use of the function does not
!require declaration since the function
!was defined in D_Buffer
myFunc(25)
STOP
Version 3.11.01 66
ACSPL+ Programmer's Guide
3. ACSPL+ Overview
The user will only specify the data type (INT/ REAL) and leave the brackets empty (no size should be
specified). Such a parameter can also accept two dimensional arrays and use them as a single
dimension, although such usage must be implemented with great care.
Version 3.11.01 67
ACSPL+ Programmer's Guide
3. ACSPL+ Overview
Single dimension array parameters are not size validated at compilation (unlike regular arrays in
ACSPL+) and can accept any array of the same data-type (single / two dimensional).
If the user attempt to use an illegal index a runtime exception will be thrown.
Example – accept an array and change it
Example – single dimension array parameter accepts a two dimensional array, and uses it as a
single dimension array
Version 3.11.01 68
ACSPL+ Programmer's Guide
3. ACSPL+ Overview
RET
}
The user will specify only the data type (INT/ REAL) and the size of the second dimension (no size
should be specified for first dimension). Such a parameter can only accept two dimensional arrays
with the same second dimension size.
Validation of the second dimension is done in compile time if the value is known.
If the user attempts to use an illegal index, a runtime exception will be thrown.
Example – accept a two dimensional array
Version 3.11.01 69
ACSPL+ Programmer's Guide
3. ACSPL+ Overview
A function has access to the variables defined outside the function (local/ global/ constants). If a
variable is defined by the same name as an outside variable, hiding semantics will be used and any
mention of the shared name will refer to the local function variable.
A function can define variables of the following types:
> INT
> REAL
> INT/REAL arrays
printAxisPos(var1)
STOP
void printAxisPos(int Axis){
real arr(5)
DISP arr(3) ! Unknown value - arrays must be explicitly initialized
int var1 ! Hides the original var1
var1 = Axis - 1
DISP RPOS(var1)
ret
}
Version 3.11.01 70
ACSPL+ Programmer's Guide
3. ACSPL+ Overview
3.9 Expressions
3.9.1 General
An expression is a sequence of operators and operands that specify a calculation.
Version 3.11.01 71
ACSPL+ Programmer's Guide
3. ACSPL+ Overview
Expressions serve as building blocks for many ACSPL+ commands. For example, assignment
commands include expressions to the right of the equal sign:
V0 = V1 + 2*(V2 - V3)
When the controller executes a command that includes an expression, the expression is calculated
and the result is used as required by the command.
Complexity of expression ranges from the simplest expressions that include only one constant or
variable name, to extended formulae containing multiple operators and functions with several
levels of brackets. For example:
Operator Operation
++ Increment
+- Addition, Subtraction
If several operators appear on the same line or in a group, they have equal precedence.
Version 3.11.01 72
ACSPL+ Programmer's Guide
3. ACSPL+ Overview
Integer (0,1) is specified for the operators that produce only two values: 0 or 1 (logical
result).
3.9.4 Operands
An operator requires one or two operands.
> An operator that requires one operand is called a unary operator. A unary operator is placed
before its operand, with the exception of the increment operator.
> An operator that requires two operands is called a binary operator. A binary operator is
placed between its operands.
Unary operators:
integer real
Version 3.11.01 73
ACSPL+ Programmer's Guide
3. ACSPL+ Overview
Binary operators:
integer-
integer-real real-integer real-real
integer
. (bit selection) integer (0,1) integer (0,1) integer (0,1) integer (0,1)
Each operand can be either integer or real. If the operator requires, the controller automatically
converts the operand to the required type.
Operands can be one of the following:
> Constant
A constant can consist of any integer or real number. Integer constants can be presented in
decimal, hexadecimal and binary notation. Real constants can include a decimal point
and/or exponent.
> Symbolic constant
Symbolic constants are predefined in the controller. Each symbolic constant presents an
integer number.
> Scalar variable name or Array name with indexing
A variable name is a name of any standard or user-defined variable. If a user-defined name
is used, it must be declared before being used in the program. If the variable presents an
array, the name must be fully indexed to specify one element of the array.
> Function call or Expression
Any ACSPL+ function can be used in an expression. Using expression as an operand of
other expression provides unlimited variety of expressions. In many cases expression used
as operand must be enclosed in brackets. For example:
Version 3.11.01 74
ACSPL+ Programmer's Guide
3. ACSPL+ Overview
The following sections provide further elaborations on the operands and operators.
Version 3.11.01 75
ACSPL+ Programmer's Guide
3. ACSPL+ Overview
V1 = (V0 = 5) * V4
The expression in parenthesis, V0 = 5, results in 1 if V0 is equal to 5 and results in 0 if V0 is not equal
to 5. Therefore, this command assigns V1 with the current value of V4 if V0 equals 5, and assigns V1
with 0 if V0 has any other value.
First operand 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 1 0
Second operand 0 0 1 1 1 1 0 0 0 0 0 1 1 1 1 1 1 1 1 1 0 0 0 0 0 1 1 1 1 1 0 0
Result 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0
If both operands are logical, i.e., have only values of 0 or 1, the result is also logical. In this case the
operators can be treated as logical AND, OR and XOR. For example, the following condition:
(V0 = 5) & (I30 = 0)
is satisfied only if V0 is 5 and I30 is 0 simultaneously.
> ~ (inversion) – Provides bitwise inversion of its operand. If the operand is real, the controller
provides automatic conversion to integer before the operation. The result is always an
integer.
> ^ (logical not) – Accepts either an integer or real operand and calculates an integer result.
The result is 1 if the operand equals to 0, and is 0 if the operand is non-zero.
> ++ (incrementation) - Increments the value of an integer, an integer function parameter, or
an integer type structure field by 1.
The following two examples illustrate the difference between the ~ and ^ operations:
Version 3.11.01 76
ACSPL+ Programmer's Guide
3. ACSPL+ Overview
X 0 0 1 1 1 1 0 0 0 0 0 1 1 1 1 1 1 1 1 1 0 0 0 0 0 1 1 1 1 1 0 0
~X 1 1 0 0 0 0 1 1 1 1 1 0 0 0 0 0 0 0 0 0 1 1 1 1 1 0 0 0 0 0 1 1
^X 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
X 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
~X 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
^X 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Inversion is a bitwise operator, while the logical not applies to the entire value.
Version 3.11.01 77
ACSPL+ Programmer's Guide
3. ACSPL+ Overview
Syntax:
left-term = expression
left-term can be:
> Standard or user variable
> An element of a ACSPL+ or user array
> One bit of integer variable or integer array element
Assigning to an ACSPL+ variable is limited by the following rules:
> Assignment to read-only variable (for example, FPOS) is prohibited
> Assignment to a protected variable (for example, ERRI) is allowed in only in the
Configuration mode.
expression can be of integer or real type. By using different operators and parenthesis, an unlimited
number of expressions can be constructed.
After assignment, the previous value of the variable is replaced by the new value.
The controller executes assignment commands in the following order:
1. Calculate expression
2. Convert the type of calculated value to the type of left-term (if the types differ)
3. Assign the result to left-term
The following sections explain assignment for specific types of left-term.
Version 3.11.01 78
ACSPL+ Programmer's Guide
3. ACSPL+ Overview
Examples:
Version 3.11.01 79
ACSPL+ Programmer's Guide
3. ACSPL+ Overview
Although bit assignments are applicable to any integer variable or array element, they are mainly
used for changing flag variables and output bits.
Examples:
Version 3.11.01 80
ACSPL+ Programmer's Guide
3. ACSPL+ Overview
program execution rate (see SPiiPlus Command & Variable Reference Guide for details on the PRATE
variable).
Example:
The following example is a program that tests the WAIT command:
V0 = 0 Assign 0 to V0
loop 100
V1 = TIME
WAIT V0
DISP TIME - V1
V0 = V0 + 1
END End loop
Stop End of program
If the controller cycle is 1 millisecond and PRATE is 1, the program displays a list of numbers from 2 to
101. The first number, 2, corresponds to the standard execution time of two lines, because the first
time the additional delay provided by the WAIT command is zero. Each loop executed adds one to
the requested delay, therefore the displayed time grows correspondingly.
The bit: AST(0).#MOVE is raised as long as the 0 axis is involved in a motion. Inversion of the bit (^AST
(0).#MOVE), causing the bit to become non-zero, occurs when the motion ends for any reason.
Version 3.11.01 81
ACSPL+ Programmer's Guide
3. ACSPL+ Overview
Therefore the above TILL command provides a delay of execution of the next command until the
motion is over.
In the following example, the program starts a data collection and then a motion. The feedback
position is sampled with a period of 1 millisecond and stored in the data array. After the data
collection finishes, the data array contains a transient process of ptp motion. Synchronous data
collection used in the example displays its state in the AST(1).#DCit which is raised as long as the data
collection is in progress. The collected data can be safely used only after the data collection process
has terminated. Her , the TILL command validates that both the motion and the data collection are
over:
The following example provides the 3 axis motion in negative direction until a general purpose input
becomes active and then terminates the motion:
In the following example a general purpose output must be activated 25 millisecond before the
motion end. The ACSPL+ GRTIME variable (for details on the GRTIME variable, see The GRTIME
Variable) contains the estimated time that remains to the motion end.
The output activation, OUT0.4 = 1, is placed in the same line as the TILL command in order to avoid
one controller cycle delay between program lines.
3.10.3 Autoroutines
The technique of autoroutines is similar to hardware interrupts. In distinction to routines that must
be explicitly executed (by way of the CALL command), the autoroutine is automatically executed
when a specific condition is satisfied. The routine interrupts the currently executing program,
executes the commands specified in the autoroutine body, and then returns control to the
interrupted program.
Version 3.11.01 82
ACSPL+ Programmer's Guide
3. ACSPL+ Overview
3.10.3.1 ON Command
Description:
The ON command flags the routine as an autoroutine and specifies the condition upon which the
execution of the routine is based.
Syntax:
ON expression
Comments:
The value of EXPRESSION defines the condition. The condition is considered true if the expression
calculates to a non-zero result. A zero result corresponds to a false condition, and the routine is not
executed.
The controller never executes the ON command directly.
If the program execution flow hits an ON command, the controller asserts a run time
error and aborts the program. Therefore you must either end the program before the
ON command, or use an unconditional GOTO command to skip over the routine.
Instead of direct execution, the controller registers an autoroutine when the program containing the
routine is compiled. Then the controller calculates the expression each controller cycle in parallel
with executing ACSPL+ programs. If the expression calculates to a non-zero value, the controller
interrupts the ACSPL+ program being executed in the same buffer where the autoroutine is located,
and transfers the execution point to the autoroutine. If no ACSPL+ program is executed in the buffer,
the controller does not interrupt any program and simply starts the autoroutine execution.
The controller implements edge-detection in autoroutine condition verification. If a condition
becomes true, the controller activates the autoroutine only once. If the condition remains true
afterwards, the controller does not activate the autoroutine again. The condition must become false
and then become true again in order to activate the autoroutine again.
Version 3.11.01 83
ACSPL+ Programmer's Guide
3. ACSPL+ Overview
in buffer 2 that interrupts the program will be executed four lines per one controller cycle. When the
RET command that terminates the autoroutine is executed, the controller switches back to the rate
of one line per one cycle.
3.10.3.4 Examples
The following fragment demonstrates a typical use of autoroutine for processing the controller
faults. The autoroutine provides an error message when the Drive Alarm of 0 axis occurs:
The following autoroutine responds when either the Left Limit or Right Limit are activated:
Version 3.11.01 84
ACSPL+ Programmer's Guide
3. ACSPL+ Overview
The following example assumes that an extra ventilator must be activated when the motor
overheat input signal is activated for the axis 2. The ventilator is controlled by the output bit: OUT0.4.
The ventilator must be disabled when the signal returns to inactive state.
All bits, not only faults, can be used in autoroutine conditions. Assuming that output OUT0.6 (of the 0
axis) is connected to a LED indicator, the following autoroutines signals the motion state bit to
activate the indicator, and deactivate it when the 0 axis is no longer in motion:
The condition of an autoroutine can be any type of expression, not only bit verification. The
following autoroutine provides an alarm message if a fault occurs in the controller:
The above autoroutine displays the alarm message only on the first fault. If one fault bit is already
raised, and another fault occurs, the second fault does not cause the alarm message.
The ACSPL+ MERR (motor error) array can be used for motor failure processing. While a motor is
enabled, the corresponding element of MERR is zero. If a motor is disabled, the element stores the
reason why the motor was disabled. Codes greater than or equal to 5010 correspond to fault
conditions. The following autoroutine displays a message when the controller disables the 0 axis
due to any fault.
Version 3.11.01 85
ACSPL+ Programmer's Guide
3. ACSPL+ Overview
The ACSPL+ AERR array can be used to detect abnormal motion termination.
The ACSPL+ MERR and AERR variables expose only those faults that cause motor disable or
abnormal motion termination.
The following Terminal command displays change in buffer state after the START command was
executed:
Version 3.11.01 86
ACSPL+ Programmer's Guide
3. ACSPL+ Overview
STOP 3
The following command executed in buffer 0 terminates the programs currently executed in all
buffers except buffer 0:
STOPALL
The following Terminal command displays change in buffer state after executing the STOP
command:
Version 3.11.01 87
ACSPL+ Programmer's Guide
3. ACSPL+ Overview
pause 0
The following Terminal command displays change in buffer state after executing the pause
command:
resume 0
The following Terminal command displays change in buffer state after executing the resume
command:
Version 3.11.01 88
ACSPL+ Programmer's Guide
3. ACSPL+ Overview
Comments:
The commands alter the NOAUTO bit in the ACSPL+ PFLAGS variable that controls autoroutine
activation (see SPiiPlus Command & Variable Reference Guide for details on the PFLAGS variable).
If the bit is reset, the controller starts verifying the condition of an autoroutine and can activate the
autoroutine as soon as the buffer is compiled. Setting the bit prevents the autoroutine activation
even if the buffer is compiled and the condition is true.
Examples:
The following dialog shows the effect of the commands on the buffer state:
Version 3.11.01 89
ACSPL+ Programmer's Guide
4. ACSPL+ Motion Programming
Version 3.11.01 90
ACSPL+ Programmer's Guide
4. ACSPL+ Motion Programming
If the MFLAGS.#ENMOD bit is 1, the ENTIME value defines the time of enable execution. In executing
the ENABLE command, an ACSPL+ program always waits for ENTIME milliseconds. If then the drive
alarm fault is zero, the ENABLE command is considered successful; otherwise the ENABLE command
fails.
If the MFLAGS.#ENMOD bit is 0, the ENTIME value defines the maximum time allotted for ENABLE
execution. Executing ENABLE, an ACSPL+ program monitors the drive alarm input signal. As soon as
the drive alarm becomes inactive, the ENABLE command finishes execution with success. If the
drive alarm signal does not change to inactive state within ENTIME milliseconds, the ENABLE
command fails.
Examples:
Versions 2.60 and later support COMMUT command in GANTRY mode. Commutation of
the primary axis will automatically trigger commutation of the secondary axis.
Version 3.11.01 91
ACSPL+ Programmer's Guide
4. ACSPL+ Motion Programming
Commutation using the SPiiPlus MMI Adjuster is described in depth in the SPiiPlus MMI Application
Studio User Guide.
Motor movement during commutation very much depends on the motor drive settings. The
COMMUT command will not operate properly if the SLPKP variable is set to zero, or the integrator is
very low.
Syntax:
COMMUT axis, [excitation_current,] [settle_time,] [slope_time][gantry_commut_delay]
Arguments
Specifies the time that the excitation current rises from zero to the desired
value. The argument can be omitted in which case the default value is 0
slope_time providing an immediate build-up of the excitation current. Slope time is
required only in special cases and it is usually recommended to omit this
argument in which case the excitation current is built instantly.
Optional – can be used only in Gantry mode. It defines the delay time in
gantry_ milliseconds after the commutation of the primary axis is completed and
commut_delay before the commutation of the complimentary axis begins. The default
value is 500 msec.
The COMMUT command executes the autocommutation algorithm three times for verification and
elimination of unstable equilibrium. The approximate execution time of the command is therefore
3*(SETTLE_TIME + SLOPE_TIME).
It should be noted that:
> In air bearing systems a lower EXCITATION_CURRENT may be required.
> In high friction systems a higher EXCITATION_CURRENT value is required.
The EXCITATION_CURRENT should be the same as that which you determined in the initial
commutation adjustment process.
Version 3.11.01 92
ACSPL+ Programmer's Guide
4. ACSPL+ Motion Programming
The SETTLE_TIME parameter determines the settling time for the autocommutation process initiated
by the COMMUT command. The entire autocommutation process lasts approximately three times
longer, since the command executes the algorithm three times for verification.
The SETTLING_TIME should be the same as that you have determined in the initial commutation
adjustment process.
Version 3.11.01 93
ACSPL+ Programmer's Guide
4. ACSPL+ Motion Programming
otherwise the command does not overwrite the previously stored code and the cause
specified in the command is ignored.
> KILL command with single-axis motion, default connection
Assume, axis 1 executes motion PTP/V 1,6000,20000.
Once KILL 1 is executed, the motor starts decelerating from its instant velocity using
constant deceleration value specified by the KDEC(1) variable. Deceleration time is given by:
V1 / KDEC(1)
where V1 is the instant velocity at the moment of the KILL command. V1 is not necessarily
20000 as specified in the motion command, it can be lower if the KILL command is
executed in acceleration or deceleration phases of the motion.
Typically, the motor finishes the KILL process and stops before it reaches the final motion
point of 6000. However, if KDEC(1) < DEC(1) (not recommended in most applications), the
motor can overrun the final point.
The motion is considered to continue execution as long as the kill process is executed. Bit AST
(1).#MOVE remains 1 while the motor is decelerating and drops to 0 once the motor reaches
zero reference velocity. Bit MST(1).#MOVE also remains 1 while the motor is decelerating but
drops to 0 only when the motor reference velocity is zero and the motor position error PE(1)
remains less than TARGRAD(1) for more than SETTLE(1) milliseconds.
> KILL command with several single-axis motions, default connection
Assume, each of the axes 0, 2, 4 executes independent single-axis motion.
The command KILL (0,2,4),6088 is equivalent to KILL 0,6088; KILL 2,6088; KILL 4,6088 and
acts on each motion independently. Each motor uses its own component of KDEC and the
time of the KILL process is different for the motors.
The reason for the KILL, 6088 (user-defined code), is stored in MERR(0) (for the 0 axis),
MERR(2)(for the 2 axis) and MERR(4) (for the 4 axis). However, if at the moment one of
these variables contains a non-zero value, the value is not overwritten and the previously
stored cause is retained.
The command KILL 4 (again with default connection) kills the axis 4 motor and terminates
the axis 4 motion, but does not affect motors and motions of axes 0 and 2.
> KILL command with multi-axis motion, default connection
Assume, motion MPTP (0,1,4) is executed.
The command KILL 1 causes the axis 1 motor to start decelerating from its instant velocity
using the constant deceleration value specified by the KDEC(1) variable. The deceleration
continues until the motor reaches zero velocity.
The behavior of 0 and 4 axes is different. Once the KILL 1 is executed, the motion starts a
third-order deceleration process just as if a HALT command was executed. The 0 and 1 axes
continue moving in the common motion. The vector deceleration of the motion is DEC(0)
and the vector jerk is JERK(0).
If command KILL (1,4) is executed, the KILL process applies to 1 and 4 axes motors. Each
motor decelerates independently from its instant velocity to zero using the constant
decelerations KDEC(1) and KDEC(4). At the same time the 0 axis motor decelerates using the
third-order profile and the DEC(0) deceleration value, just as if a HALT command was
executed.
If command KILL (0,1,4) is executed, each motor decelerates independently from its instant
velocity to zero using the constant decelerations KDEC(0), KDEC(1) and KDEC(4).
In all cases bits AST.#MOVE and MST.#MOVE of axes 0,1, and 4 remain 1 as long as any of the
Version 3.11.01 94
ACSPL+ Programmer's Guide
4. ACSPL+ Motion Programming
motor continues decelerating. Once all motors reach zero velocity, bits AST(0).#MOVE, AST
(1).#MOVE and AST(4).#MOVE drop to zero. Bit MST(0).#MOVE drops to zero as soon as
position error PE(0) remains less than TARGRAD(0) for more than SETTLE(0) milliseconds. So
do bits MST(1).#MOVE and MST(4).#MOVE (for the 1 and 4 axes respectively).
> KILL command with non-default connection
If a motor is in non-default connection but depends only on the corresponding axis the
effect of the KILL command is similar to the case of default connection. For example, if the
connection was specified as
(in this case the DEPENDS command is not necessary), the KILL 0 command starts the same
kill process on the 0 axis motor and the halt process on the motion that involves the 0 axis.
All above considerations about the idle motor, single-axis motion and multi-axis motion
remain the same.
The result is a little different if a motor depends on another axis or on several axes, for
example:
(in this case the DEPENDS command is required). The difference is that the KILL 2 command
applies the halt operation to all executed motions involving any of the axes 0, 2, or 4.
Correspondingly, bits AST(2).#MOVE and MST(2).#MOVE remain 1 as long as any of these
motions continues its termination process.
A KILLALL command always terminates all executed motions and therefore makes no
difference between the default and non-default connection.
Version 3.11.01 95
ACSPL+ Programmer's Guide
4. ACSPL+ Motion Programming
Although the SET command resembles the ASSIGNMENT command, execution of the SET command
is different from ASSIGNMENT. The SET command induces a complex operation in the controller
instead of a simple assignment.
Regardless of the left-side variable, execution of the SET command starts with calculation of
EXPRESSION. The result of the calculation provides the right-side value. Then the execution depends
on the variable specified on the left side.
The following are examples of the use of SET.
> SET RPOS and SET FPOS
The SET command that contains RPOS or FPOS, shifts the origin of an axis. For example,
command
SET FPOS(0) = 0
places the origin of the 0 axis to the point where the motor is located this moment.
FPOS and RPOS provide a reference and a feedback value for a motor. If a control loop
works properly, FPOS follows RPOS with small or zero error.
If the error is zero, both SET FPOS and SET RPOS provide the same result: both FPOS and
RPOS become equal to the right-side value. This is not a simple assignment, and the
command adjusts the controller offsets so that the periodic calculation of FPOS and RPOS
will provide the required results.
If the error is non-zero, the result of SET FPOS and SET RPOS may differ slightly. Consider the
following example:
Version 3.11.01 96
ACSPL+ Programmer's Guide
4. ACSPL+ Motion Programming
In both SET commands no physical motion occurs. The 0 axis remains in the same position,
only the internal offsets in the controller are adjusted to shift the origin as required.
Even if a motor is idle, several identical SET FPOS commands may place the origin at slightly
different points due to the jitter in feedback.
If a motor is flagged by the Default Connection bit (MFLAGS.#DEFCON), the RPOS and APOS
variables are conjugate. Therefore, any command that changes RPOS, also changes the
corresponding APOS to the same value.
> SET F2POS
The command SET F2POS shifts the origin of the secondary axis feedback. For example,
command
SET F2POS(0) = 0
places the origin of the 0 axis secondary feedback to the point where the motor is currently
located.
As a result of the command execution, F2POS becomes equal to the right-side value. This is
not a simple assignment, as the command adjusts the controller offsets so that the periodic
calculation of F2POS will provide the required result (the specified value in the current
point).
Even if a motor is idle, several identical SET F2POS commands may place the origin in
slightly different points due to the jitter in feedback.
In the case of non-default connection the controller adjusts offsets only for the motors
that depend on the specified axis. Therefore, the depends command is significant in a
connection specification. If dependence is specified incorrectly, one or more motors can
jump once SET APOS=… is executed.
Version 3.11.01 97
ACSPL+ Programmer's Guide
4. ACSPL+ Motion Programming
For most applications there is no need for the GROUP commands in that the controller
automatically creates and splits groups. Mainly you would include the command in order to
keep a check that you have included all of the relevant axes in the subsequent motion
commands. If you include a motion command that does not relate to all of the axes in the
group (without a previous SPLIT command), the controller issues an error.
> The SPLIT command breaks down an axis group previously created with a GROUP
command.
> The SPLITALL command breaks down all axis groups previously created with a GROUP
command.
Syntax:
GROUP axes_specification
SPLIT axes_specification
SPLITALL
The format of the AXES_SPECIFICATION is a list of the axes separated by commas and enclosed in
parentheses, for example (0,1,2,4). After power-up, each controller axis is a single axis, no axis group
exists. One-axis motion does not require any axis group. One-axis motion can be activated
immediately after power-up, assuming that the motor is enabled. Several one-axis motions can be
activated in parallel, and do not require any axis group definition.
An axis can belong to only one group at a time. If the application requires restructuring the axes, it
must split the existing group and only then create the new one.
For example, the command:
GROUP (0,2,3)
Version 3.11.01 98
ACSPL+ Programmer's Guide
4. ACSPL+ Motion Programming
The SPLIT command must specify the same axes as the GROUP command that created the group.
After the SPLIT command the group no longer exists.
If the SPLIT command specifying an axis that is currently in motion is executed within
the buffer, the buffer execution is suspended until the motion is completed. However, if
the SPLIT command is sent from the host or as a Terminal command, it returns error
3087: "Command cannot be executed while the axis is in motion”.
The SPLITALL command breaks up all existing groups. An ACSPL+ program that starts in an unknown
environment (not just after power-up) can execute the SPLITALL command in order to ensure that
no axes are grouped.
4.1.7 GO Command
The GO command starts a motion that was created using the /W switch (see SLAVE Command). A
motion that has been created without this switch starts automatically after creation and does not
require the GO command.
Syntax:
GO axes_specification
In simple cases AXES_SPECIFICATION is a single axis like 0 or 13, or a string consisting of axis
enclosed in parentheses and separated by commas, for example: (0, 2, 13), or the keyword: ALL
(specifying all of the axes).
There following possibilities are available:
> Starting single-axis motion
A GO command specifies one axis that is not included in any group. The command starts the
last created motion for the same axis. If the motion was not created, or has been started
before, the command has no effect. For example:
Version 3.11.01 99
ACSPL+ Programmer's Guide
4. ACSPL+ Motion Programming
In simple cases AXES_SPECIFICATION is a single axis like 0 or 13, a string consisting of axis enclosed in
parentheses and separated by commas, for example: (0, 2, 13), or the keyword: ALL (specifies all
available non-dummy axes).
In multi-axis motion, smooth vector velocity profiles do not always assure smooth
motion of the coordinates. The user application must provide nearly tangent motion
trajectories in the junction point to avoid jumps in coordinate velocity, which may cause
damage to equipment.
VEL Velocity
ACC Acceleration
DEC Deceleration
JERK Jerk
Although the IMM command resembles the ASSIGNMENT command, execution of the IMM
command differs from normal assignment to the same variables.
As in conventional assignment, execution of the IMM command starts from calculation of the right-
side expression. The calculated right-side value is assigned to the left-side variable. Execution of flat
assignment finishes at this point.
The difference between the conventional ASSIGNMENT and the IMM commands becomes apparent
when the command executes while a motion is in progress. The ASSIGNMENT command does not
affect the motion in progress or any motion that was already created and is waiting in a motion
queue. Only the motions created after the ASSIGNMENT command is executed will use the motion
parameters changed by the command. The IMM command, on the other hand, not only changes the
specified variable, but also affects the motion in progress and all motions waiting in the
corresponding motion queue. To change a motion on-the-fly, the IMM command must change a
variable of the axis that is a single axis of the motion or a leading axis if the motion is in axis group.
Use the maximum motion profile values in the axis group as a whole rather than
m
those of the leading axis.
w Create the motion, but do not start until the GO command is issued.
PTP 0, 1000
If the axis is moving when the command is issued, the controller creates the motion and inserts it
into the axis motion queue. The motion waits in the queue until all motions before it finish, and only
then starts.
This command creates a motion of the 0 axis to the absolute target point of 1000. If the axis is idle
when the command is issued, the motion starts immediately.
If the E switch is specified, the controller will wait until the motion terminates before executing the
next command. The E switch is a convenient substitute for following the PTP command with
another command that waits for motion termination, for example, the command:
PTP/e 2,1000
is equivalent to:
PTP 2,1000
TILL ^AST(1).#MOVE
Appending the W switch to the PTP command prevents the motion from starting immediately even
if the axis is idle. The command:
PTP/w 0, 1000
creates a motion to the absolute target point 1000, but the motion will not start until the GO 0
command is issued.
In the two examples above the value 1000 is an absolute target point. To specify a relative value
you use the R switch:
PTP/r 0, 1000
This command creates a motion to a relative target point, which will be defined exactly only when
the motion starts. When the motion starts, the target point is calculated as the instant axis position
plus the specified value. For example, the following two commands
PTP 0, 1000
PTP/r 0, 1000
are equivalent to
PTP 0, 1000
PTP 0, 2000
In the previous examples the motion executed using the default velocity VEL(0) for the specified
axis. To override the default velocity you use the V switch, as shown in the following example:
The motion created will ignore the default velocity VEL(0) and execute at a velocity of 15000. The
default value VEL(0) remains unchanged.
You can combine several switches in one command. For example, the command
creates a temporary axis group that includes axes 0, 2 and 4 and executes motion in one group.
Temporary axis groups are automatically created and split-up by the controller. A group is
automatically split-up if the following motion does not address all the axes in the group.
The controller normally takes the motion parameter values from the leading axis. However this can
be overridden by using the /M switch, which causes the controller to calculate the maximum
allowed common motion velocity, acceleration, deceleration and jerk, for example:
The calculation examines the VEL, ACC, DEC, JERK parameters of the axes involved and the
projections of the motion vector to the axes.
If the M switch is combined with the V switch, the M switch is ignored for the velocity
and the velocity specified in the command is used. However, common acceleration,
deceleration, and jerk are still calculated.
meet the criterion for settling. In terms of ACSPL+ variables, this criterion means that (abs(TPOS-
FPOS) < TARGRADA/B/C for a period of SETTLEA/B/C)
When the move and settle feature is activated by the SETCONF(318) to either single mode (value 1) or
auto mode (value 2), the elapsed time of the motion up to entry to the TARGRAD<x> radius may be
retrieved from the corresponding variables MSTIMEA, MSTIMEB, and MSTIMEC.
Example Code
! User units – mm
!Example 1 – Motor is settled to 1 micron window
! Window A
TARGRADA(0) = 1e-3 !Set threshold to 1um
SETTLEA(0) = 100 ! Stay in window for 100ms till assigning value to
MSTIMEA
! Window C
TARGRADC(0) = 1e-3 !Set threshold to 1um
SETTLEC(0) = 5 ! Stay in window for 5ms till assigning value to MSTIMEC
setconf(318, 0, 1)
!Example 3
!setconf(318, 0, 2) !Uncomment for running example 3
enable(0)
PTP/e(0), 1
wait 1000
PTP/e(0), 0
stop
Example 1 Results
The motor is considered settled 85ms after the motion started. MSTIMEA is updated 100ms after the
motor is within 1µm from target position abs(TPOS-FPOS) MST.25 is set once this condition is
satisfied.
Example 2 Results
The motor is considered settled 26ms after the motion started. In this case, the motor is considered
settled before the motion profile is completed. MSTIMEB variable is updated 150ms after the motor
is within the 75µm from target position abs(TPOS-FPOS) MST.26 is set once this condition is satisfied.
Example 3 Results
The value of MSTIMEC is updated each time the abs(TPOS-FPOS) is within TARGRADC for a period of
SETTLEC. MST.27 bit is cleared each time the condition above is not satisfied anymore, meaning that
the value in MSTIMEC is no longer valid. Only after the condition is satisfied again, the bit is set.
w Create the motion, but do not start until the GO command has been issued.
v Use the velocity specified in the command instead of the default velocity.
Use the point sequence as a cyclic array: after positioning to the last point do
c
positioning to the first point and continue.
MPTP 0, 1000
This command creates a multi-point motion of the 0 axis and specifies a dwell time of 1000 msec at
each point. If dwell is not required, DWELL_TIME may be omitted. The MPTP command itself does not
specify any point, so the created motion starts only after the first point is specified. The points of
motion are specified by the POINT or MPOINT commands that follow the MPTP command.
Consider the following program fragment:
The MPTP command creates the multipoint motion. However, the motion does not start until a point
is defined. After the first POINT command the motion starts if all involved axes are idle (not involved
in some previous motion), or waits until a motion that is in progress ends, and then starts. The four
POINT commands specify the following sequence:
The controller performs sequential positioning to each point. The ENDS command informs the
controller that no more points will be specified for the current motion. The motion cannot finish until
the ENDS command executes. If the ENDS command is omitted, the motion will stop at the last point
of the sequence and wait for the next point. No transition to the next motion in the queue will occur
until the ENDS command executes.
Normally, multi-point motion starts with the first POINT command, and the next POINT command
executes while the motion is already in progress. However, sometimes you may need to delay
starting the motion until all points are defined. You use the W switch to prevent the motion from
starting until a GO command executes. The motion created by the command:
MPTP/w 0, 1000
Adding the R switch to the MPTP command causes all points to be treated as relative. The first point
is relative to the position when the motion starts, the second point is relative to the first, and so on.
The previous example, using the MPTP/R command, will look like this:
PTP (0,1), 0, 100 Create PTP motion to the first point (this
serves as the reference point).
MPTP/r (0,1) Create multipoint motion in group (0,1)
with no dwell time.
POINT (0,1), 100, 100 Add point.
POINT (0,1), 100, -100 Add point.
POINT (0,1), -100, -100 Add point.
ENDS (0,1) End the point sequence.
The MPTP command uses the default velocity VEL for positioning to each point. The V switch allows
using a specific velocity for each positioning. The desired velocity must be specified in the POINT
command after the point coordinates. The previous example is modified for using different
velocities:
Several switches can be appended to one command. For example, the command:
MPTP/rv 0, 1000
creates a multi-point motion with dwell time of 1000msec. The points will be specified by relative
coordinates, and velocity will be specified for each point.
If the corresponding motion command is MPOINT without the V switch or PATH without the T switch
(see PATH Command), a column of the matrix must contain the coordinates of the point. Therefore,
if the AXIS_DESIGNATORS includes M axes, the matrix must contain exactly M rows.
If the corresponding motion command is MPTP/V, the matrix must contain M+1 rows. An additional
value in each column specifies the desired velocity for transition from the previous to the current
point. The velocity is specified in position units per second.
If the corresponding motion command is PATH/T, the matrix must contain M+1 rows. An additional
value in each column specifies the time interval between the previous and the current point. The
time is specified in milliseconds.
The following example illustrates how the MPOINT command can be used for adding points on-the-
fly. The example also shows a simple approach to synchronization between the host computer that
calculates the points and the controller that executes the motion.
The host computer calculates the desired points and transmits the coordinates via the Ethernet link.
The motion involves 6 axes. Therefore, each point specification contains 6 real numbers.
Because transmitting each point separately would be very ineffective in the Ethernet, the host
calculates the desired points in advance and transmits them in batches of 50 points. The controller
executes the motion. As soon as the controller is ready to accept the next batch of points and the
host is ready to send the batch, the next transmission occurs, and so on. The pace of the host and
the controller may be very different. However, the host is assumed fast enough to calculate the
next 50 points before the controller has moved through the previous 50 points.
The controller executes the following program:
double HPoints(50)(6);
int N, HSync, NBuf;
HANDLE Com;
open communication, start program in buffer NBuf of the controller;
while (Continue)
calculate N (<= 50) points in array HPoints;
Synchronization between the host and the controller is provided by the SYNC variable. When the
host has finished transmitting the next batch of points to the controller, it writes to SYNC the
number of points in the batch. The controller waits for non-zero SYNC and then adds the points to
the motion. When the controller has added the points, it writes zero to SYNC, which signals to the
host to transmit the next batch of points.
When the host comes to the end, it writes -1 to SYNC to indicate the end of the motion.
SLPMIN and SLPMAX variables can be changed only when the motor is disabled.
GMTYPE
A new GMTYPE is created for 20 KHz motions. GMTYPE for BPTP/2 is 43. 43 = 11 (BPTP) + 32.
GMTYPE over 32 will represent 20KHz motion.
Compatibility
The feature supports dynamic error compensation. The value used for compensation will be the one
calculated once per controller cycle.
The feature uses the Reverse data collection mechanism to communicate with the DSP, which
prevents it from working with other features that use the mechanism: SPINJECT, SPRT, Fast PEG
loading.
The new feature will not support the following commands: CONNECT, BREAK and HALT.
DSP interface
The feature is supported in the standard version of the DSP.
To determine if the desired DSP supports the feature, a new variable is queried in the DSP- "desired_
position_20i" of type int.
Status command
To start operating in the 20KHz mode, the FW will send to the DSP a signal by changing the
Controller-DSP status variable bit 29 that will represent the 20KHz motion status.
Data format
The data (reference positions) will be sent in the format of fixed point 32.32 (total 8 Byte)
The data written to the memory as two int variables.
The position data is sent to the DSP in the reverse data collection packet in the following position:
Data collection
The following variables may be collected for this motion type:
GPATH, GVEL, GACC, GJERK, APOS, PPOS, PPOSCOMP.
PPOS, PPOSCOMP – two new variables, specifying the reference position generated in the current
cycle as opposed to the delay used to calculate FPOS).
The new values will be collected automatically, when a specified variable is collected in a frequency
that is higher than the controller’s.
Problem: this could cause undesirable behavior for a user that is unaware of the feature and would
like to collect DSP variables. See discussion below.
To resolve this issue, a new, “smart” data collection item is created.
The new item has two references, one to the standard variable (e.g. APOS[6] ) and one to the
custom 20 KHz array (e.g. APOS_20KHZ[6] ).
When a 20 KHz motion generation is active for the axis, the custom data is collected. When a
standard motion generator is active or there is no motion at all, the standard variable is collected
instead.
4.2.6.2 BPTP
Description
BPTP defines a motion profile using the MotionBoost Feature.
Syntax
BPTP[/switch] axis_list, destination_point, [value of Tf, value of Vf]
Switches
Arguments Comments
Minimum travel time in seconds, The calculated travel time will be at least
/t
the specified value. Incompatible with the /d switch.
Travel Time – specifies the exact travel time for the motion in seconds.
All other considerations are ignored, which could cause a safety fault
/d
during motion execution.
Incompatible with the /t switch.
/r Relative motion
/w Create the motion, but to not start until the GO command is issued.
Use the motion profile values of the axis group as a whole, rather than
/m those of the leading axis, without exceeding any of the defined axes
motion VEL, ACC, DEC, JERK values.
Use the motion profile values of the axis group as a whole, rather than
those of the leading axis, without exceeding any of the defined axes
/q
motion VEL, ACC, DEC, JERK values. Not compatible with /2 switch. Range
is 0-25 ms.
Use of the /d switch to specify minimum travel time overrides all other parameters
which might limit velocity and requires careful attention to safety considerations.
The BPTP/2 command is limited to at most 2 axes per Servo Processor and at most 4
axes per system.
Arguments
axis_list
destination-point
Value of Tf
Value of Vf
GPHASE
Two options are available.
> • Four phases (For motion in positive direction; for motion in negative direction reverse the
inequality signs)
1. Acceleration buildup
> • RJERK>0, RACC>0
2. Acceleration finishing
> RJERK<0, RACC>0
3. Deceleration buildup
> RJERK<0, RACC<0
4. Deceleration finishing
> RJERK>0, RACC<0
Examples
BPTP 0, 100
If the axis is moving when the command is issued, the controller creates the motion and inserts it
into the axis motion queue. The motion waits in the queue until all motions before it finish, and
only then starts.
BPTP/2 (0,1),1,1
GMTYPE
The motion GMTYPE is 11, or 43 if using the /2 suffix for 20 kHz control.
4.2.6.3 BPTPCalc
Description
The BPTPCALC function calculates and allows the user to set the motion variables according to a
desired motion time. When the travel time and distance are known in advance, the BPTPCALC
should be used to generate new VEL, ACC and JERK values.
Syntax
Arguments
1 - Velocity
Index 2 - Acceleration
3 - Jerk
Example
enable(0)
STOP
w Create the motion, but do not start until the GO command has been issued.
v Use the velocity specified in the command instead of the default velocity.
JOG 0
This command creates a jog motion of the 0 axis in positive direction using the default velocity VEL
(0).
Motion direction may be specified in the command:
JOG 0, -
This command creates a jog motion of the 0 axis in negative direction using the default velocity VEL
(0).
The command:
JOG 0, +
JOG 0
The V switch allows a specific velocity to be used instead of the default velocity VEL. The command:
JOG/V 0, 30000
ignores the default velocity and creates a jog motion with a velocity of 30000.
As with other types of motion, jog motion may be terminated by the HALT, KILL, or BREAK
commands. Unlike any other motion, jog motion also terminates when the next motion command
for the same axis executes. For example, the following program fragment:
JOG 0, +
WAIT 500
JOG 0, -
provides jogging in the positive direction for 500msec and then switches to the negative direction.
The controller automatically ensures a smooth transition from motion to motion.
Jogging can also occur in an axis group. For example, the following program fragment
creates jogging in three axes: 0 in the negative direction, and 1 and 4 in the positive direction. The
motion uses the default velocity VEL(0) as a vector velocity for the three-axis motion.
If the axis is idle, the track motion is activated immediately. If the axis is moving, the controller
creates the motion and inserts it into the axis motion queue. The motion waits in the queue until all
previous motions in the queue are executed, and then starts.
When the track motion starts, the controller copies the current value of the reference position
(RPOS) element to target position (TPOS) element. For example, when the command is executed,
RPOS(0) is copied to TPOS(0). No change of RPOS and no physical motion occur at this time.
Afterwards, the axis waits until the TPOS element is assigned a different new value. As soon as the
program executes:
the controller generates a PTP motion to the point designated by the value of the NEWTARGET user
variable. After the 0 axis reaches NEWTARGET, the axis waits for the next change of TPOS. The next
assignment to TPOS(0) automatically activates the next PTP motion and so on. Therefore, track
motion is executed as a sequence of PTP motions.
The motion state bits AST.#MOVE, AST.#ACC, MST.#MOVE, and MST.#ACC reflect the state of each
PTP motion in the track sequence exactly as they do for ptp motion. Between PTP motions, while
the axis waits for the next TPOS assignment, the motion bits are zero (with the exception of the
MST.#MOVE bit, which can be 1 if the position error exceeds the TARGRAD limit).
The following ACSPL+ program fragment defines sequential positioning to points 1000, 2000, 10000,
11000:
While the code with the PTP commands looks shorter and simpler, there are applications where
track motion is preferable to point-to-point motion.
Track motion is not terminated automatically. If TPOS is not changed, the axis track motion remains
at the last target point until TPOS is assigned a new value, and then motion continues.
TRACK terminates due to:
> Any subsequent motion command (except TRACK) for the motion axis involved in a track
motion, except the case when the next motion is a group motion.
> Any fault activation that disables the drive or kills the motion.
> User termination by HALT, KILL, or DISABLE command.
The motion profile while in Track mode, like in a standard PTP motion, is defined by the ACSPL+
variables VEL, ACC, DEC and JERK. The track command accepts the values of these variables at the
beginning of each component PTP motion within the track motion. Therefore, if an application
assigns a new value to VEL, ACC, DEC or JERK, while track mode is in effect, then the new value will
be used the next time that the application initiates a motion (by assigning a new value to TPOS).
The following ACSPL+ program fragment sets a specific velocity for each PTP motion:
In the example above the application updates TPOS only after the previous PTP motion ends.
In the following example the application updates TPOS while the motion is still in progress:
In this case, the controller does not execute two separate motions. As soon as TPOS is changed to
2500 (before the controller reaches 2000), the controller changes the move on-the-fly to the new
target position of 2500. The on-the-fly change is done smoothly, similar to end-point correction on-
the-fly.
The same result is provided by the following fragment:
The TRACK command may also be used for programming multi-axes motion, for example, the
command
creates track motion of 0, 2 and 3 axes. The multi-axis track motion is executed as a sequence of
PTP motions. A new PTP motion starts each time when one or more elements of TPOS that
correspond to the involved axes are changed. Consider the following example:
In the following example TPOS is updated while the previous motion is still in progress:
In the above case, the controller does not execute two separate motions. As soon as TPOS is
updated, the controller changes on-the-fly from PTP motion towards 0=2000, 3=1000 to PTP
motion towards 0=2000, 3=1000. The transition from the first motion to the second is done
smoothly. While each PTP motion follows a straight trajectory, the transition between the motion is
not straight, as shown in the following diagram:
0 = F(S)
1 = FY(S)
The second stage supplies the current values of the involved axes. The functions FX, FY depend only
on the specified segments. Only the second stage builds the shape of the path in the XY plane. The
first stage provides the motion progress along the path. If the function F of the first stage is
modified, this affects the motion velocity and time, but does not alter the final shape of the path.
The including the S or P switch with the MSEG command affects the first stage of the motion
generation process by causing the distance S to follow the value MPOS (Axis Master) of the leading
axis in the group. For position lock (P switch), following is strict:
S = MPOS
S = MPOS + C
In both cases the second stage of the motion generation remains unchanged and depends only on
the specified segment sequence.
Segment commands specify a path on the plane, and the MPOS value of the leading axis defines
motion progress along the path.
Formulas that calculate the MPOS value must be defined before using the master command.
v Use the velocity specified for each segment instead of the default velocity
Use the segment sequence as a cyclic array: after the last segment return to the
c
first segment and so on.
Slaved motion - the motion advances in accordance to the master value of the
s
leading axis (velocity lock).
Extrapolated - if a master value travels beyond the specified path, the last or the
e
first segment is extrapolated.
Stalled - if a master value travels beyond the specified path, the motion stalls at the
t
last or first point.
The E and T switches are relevant only for slaved motion and must be used with S or P switch. For
discussion of slaved motion see SLAVE Command.
Segmented motion can be executed in an axis group with any number of controller axes.
The MSEG command specifies axis group and the initial starting point:
This command creates a segmented motion of the X axis group and specifies the coordinates of
initial point on the plane. The MSEG command itself does not specify any segment, so the created
motion does not start immediately. A LINE or ARC command must follow the MSEG command to
specify the segment sequence.
Consider the following program fragment:
The MSEG command creates the segmented motion. The motion does not start, because no
segment is defined yet. After the first ARC1 command the motion starts if the axis group is idle (not
involved in some previous motion). If the group is not idle, motion will start when the previous
motion stops. The four segment commands specify the following path (where X is the direction of
the 0 axis and Y is the direction of the 1 axis):
Y
Start
(-1000,1000)
(1000,1000)
X
(-1000,1000)
(1000, -1000)
ARC1 and ARC2 differ only by the required arguments. ARC1 requires the coordinates of the center
point, final point, and the direction of rotation. ARC2 requires the coordinates of the center point and
the rotation angle (in radians). Each command produces the same result, so selection of either ARC1
or ARC2 depends on the available data. If you know the coordinates of the center point, coordinates
of the final point and the direction of rotation, ARC1 is preferable. If you know the coordinates of the
center point and rotation angle, ARC2 is preferable.
The ROTATION_DIRECTION argument can be:
> + (plus) – for counter clockwise
> - (minus) – for clockwise rotation
The entire sequence of segmented motion must be terminated with an ENDS command. The ENDS
command informs the controller that no more segments will be specified for the specified motion.
The motion cannot finish until the ENDS command executes. If the ENDS command is omitted, the
motion will stop in the last point of the sequence and wait for the next point. No transition to the
next motion in the queue will occur until the ENDS command is executed.
Segmented motion usually starts with the first segment command (LINE, ARC1, or ARC2). The next
segment command therefore executes while the motion is already in progress. This is generally not
a problem, because the program execution rate is higher than typical motions time. However,
sometimes you may need to delay starting the motion until all points are defined. In this case you
append the W switch to the command to prevent the motion from starting until the GO command is
issued. The motion, created by the command:
MSEG/w (0,1),1000,1000
Several switches can be attached to one command. For example, the command
creates a segmented motion with individual velocity for each segment. The motion does not start
until the GO (0,1) command is issued.
Arguments
As mentioned above, all coordinates, specified in the segment commands, are absolute in the
working plane. Projection is a matrix that connects the plane coordinates and the axis values as
specified in the mseg command. If the axis group contains two axes, and no PROJECTION command
is specified, the controller provides a default projection that corresponds to a 2x2 matrix:
1 0
0 1
The matrix directly connects the first coordinate of the working plane to the first axis of the axis
group and the second coordinate to the second axis.
The matrix can also define rotation and scaling. The full transform also includes an implicit offset.
The controller calculates the offset automatically in such a way that the initial coordinates specified
in the mseg command match the desired axis values at the moment when the motion starts. The
offset provides the full path to be relative to the starting point.
If an axis group contains N axes, the controller extends the default matrix to N lines. The additional
lines are filled by zeros:
1 0
0 1
0 0
… …
0 0
The matrix connects only the first two axes to the plane coordinates. Therefore the segmented
motion will involve only the first two axes in the group.
If N = 1, the MSEG command applies to a single axis, and the matrix contains the first line only:
1 0
In this case the axis will follow the first coordinate of the working plane.
You can replace the default matrix with the PROJECTION command.
Example:
!matrix values.
VEL(0)=1000;ACC(0)=10000;DEC(0)=10000 !Axis motion parameters
ENABLE (0,4,5) !Required command.
GROUP (0,4,5) !Required command.
SET FPOS(0)=0;SET FPOS(4)=0;SET FPOS(5)=0 !Set axes’ FPOS=0
MSEG (0,4),0,0 !Define original plane.
PROJECTION (0,4,5),M !PROJECTION of the 0, 4 and 5
!axes by matrix M
ARC2 (0,4),750,0,6,24 !ARC2 performed on new plane.
ENDS (0,4) !Concludes MSEG.
STOP !End Program
If the group contains N axis, the matrix in the projection command must be of size Nx2.
The program executes the line command 2000 times. The line segments build up a curve close to
the Archimedean spiral:
Y
Cyclic segmented motion does not automatically finish. You must use one of the
commands HALT, KILL, or BREAK to stop cyclic motion
ENABLE (0,1)
MSEG/c (0,1),1000,1000 !Create segmented motion in group X, coordinates of
!the initial point are (1000,1000)ARC1
(0,1), 1000,0,1000,–1000,– !Add arc segment with center (1000,0), and
!final point (1000,-1000), clockwise rotation
LINE (0,1),–1000,–1000 !Add line segment with final point (-1000,- 1000)
> Detection of segments, where required velocity violates axis velocity/acceleration and jerk
limits
> Velocity limitation at corners and segments where required velocity violates axis velocity,
acceleration and jerk limits
> Building up velocity profiles using the multi-segment look-ahead algorithm
> Corner rounding using different criteria
> Support of up to 6 axes
> Corner rounding according to permitted deviation: the user specifies the motion trajectory
maximum permitted deviation from the corner point. The controller inserts an additional
segment in the corner so that the resulting path is smooth and complies with the maximum
deviation.
> Corner rounding according to permitted radius: the user specifies the additional segment
maximum permitted rounding radius. The controller inserts an additional segment in the
corner so that the resulting path is smooth and complies with the maximum permitted
radius.
> Automatic corner rounding: the user specifies the maximum segment length for automatic
corner rounding. The controller applies automatic corner rounding if the length of both
segments in the pair is less than the maximum segment length.
The following picture illustrates the option:
Figure 4-3. Corner Processing - Permitted Deviation, Permitted Radius and Corner Rounding
Options
During movement on an arc segment, a coordinate acceleration (RACC) may exceed the
acceleration limit (ACC) by factor of up to 1.41.
The allowed acceleration deceleration is defined by ACC only. The DEC parameter is not used by the
algorithm.
Changing of the controller cycle time parameter (CTIME) may affect the automatic corner
processing calculations. The user needs to check the system performance after the
CTIME change.
Changing of the controller cycle time parameter (CTIME) may affect the automatic corner
processing calculations. The user needs to check the system performance after the
CTIME change.
The motion starts from zero velocity, accelerates to the required velocity, goes through the specified
segments at the required velocity, and then decelerates approaching the final point of the last
segment with zero velocity and acceleration. The diagram also explains that the required velocity
actually defines maximal velocity through the path; on specific intervals the velocity is lower than
required.
A number of factors can affect the velocity diagram. The following conditions apply additional
restrictions to velocity in specific points or on intervals:
> The user specifies a new required velocity in a segment definition. The new velocity
remains active for the specified segment and for all subsequent segments.
> The user specifies lower (or zero) velocity in the segment final point. The specification
defines velocity in one point, but doesn’t change required velocity for subsequent
segments.
> The user specifies required velocity greater than axis velocity (VEL value) of one or more
involved axes. On some segments the required vector velocity can be achieved, on others
the axis velocity would be surpassed. The controller reveals such segments, and limits the
vector velocity accordingly.
> The controller detects a corner. Depending on the specified options, the controller either
uses specified corner velocity or calculates reduced velocity in the corner point to comply
with acceleration/jerk limitations (ACC and JERK) for all axes.
> The controller reveals an arc segment that requires either centripetal acceleration or jerk
greater than axis acceleration (ACC parameter) or axis jerk (JERK) of one or more involved
axes. The controller reduces velocity on this segment to comply with acceleration/jerk
limitations (ACC and JERK) for all axes.
> The controller detects a curvature discontinuity point (linear-to-arc or arc-to-arc junction).
Depending on the specified options, the controller either uses specified curvature
discontinuity velocity or calculates reduced velocity in the point to comply with jerk
limitations (JERK) for all axes.
After all velocity restrictions are exposed, the controller builds a third-order velocity profile that
never exceeds the required velocity.
A curvature discontinuity point is a smooth connection of two adjacent segments, if the two
segments have different or differently-directed curvatures. Most smooth connections are actually
discontinuity points. In a discontinuity point, all related coordinates show discontinuity in
acceleration.
When using one of the above products, configure the controller time (CTIME) to 1
millisecond and ensure that a maximum of one XSEG motion is executed
simultaneously.
> any additional axes (up to four) added to the axes list are considered as secondary axes
The ARC1, ARC2 and LINE axis lists should be identical to the XSEG axis list.
For each axis, ARC1 and LINE specify the primary axes destination coordinate. ARC2 specifies the
secondary axes destination coordinates (destination coordinates of the primary axes are calculated
from the arc parameters). For details, see ARC1, ARC2, LINE.
4.6.12 XSEG...ENDS
Segmented Motion. XSEG...ENDS enables the user to incorporate the following into the motion
application:
> Corner detection
> Detection of segments, where required velocity violates axis velocity/acceleration limits
> Velocity limitation at corners and problematic segments
> Building a velocity profile using multi-segment look-ahead algorithm
The following commands are used within the block to define the segmented motion:
> ARC1 - adds an arc segment to a segmented motion and specifies the coordinates of center
point, coordinates of the final point, and the direction of rotation
> ARC2 - Adds an arc segment to a segmented motion and specifies the coordinates of center
point, rotation angle and direction.
> LINE - Adds a linear segment to a segmented motion.
> ENDS- terminates the motion sequence
Syntax
XSEG
[/switches] (axis_list), initial_position_axis1,initial_position_axis2[,initial_position_axis3…,initial_
position_axis6], [,velocity][,end_velocity][,junction_velocity][,angle][,curvature_velocity][,deviation]
[,radius][,maximal_length] [,starvation_margin [,segments_buffer]]
Segment commands (ARC1, ARC2, LINE)
ENDS
Arguments
Argument Description
initial_position_
Initial position of the first axis.
axis1
initial_position_
Initial position of the second axis.
axis2
initial_position_
axis3
Mandatory only if AXIS_LIST contains more than 2 axes. Number of initial
…
positions must correspond to the number of axes in AXIS_LIST.
initial_position_
axis6
Argument Description
real buf(18750)
For details on how to declare a buffer with more than 100,000 elements,
refer to XARRSIZE in the SPiiPlus ACSPL+ Command and Variable
Reference Guide.
Switches
There are three types of optional switches:
> General
General
With this switch, use 2 motion coordinate axes only (X,Y). Using 3 or more
coordinates causes a runtime error.
Velocity look-ahead
Decelerate to corner.
The switch requires an additional parameter that specifies corner velocity. The
controller detects corner on the path and decelerates to the specified velocity
before the corner. The specified value should be less than the required velocity;
/j otherwise the parameter is ignored.
If switch J is not specified while switch A is specified, zero value of corner velocity
is assumed.
If switches J and A are not specified, the controller provides automatic calculation
of the corner processing.
Do not treat junction as a corner, if junction angle is less than or equal to the
specified value in radians.
The switch requires an additional parameter that specifies negligible angle in
radians.
/a
If switch A is not specified while switch J is specified, the controller accepts default
value of 0.01 radians that is about 0.57 degrees.
If switches J,A,D, and Yare not specified, the controller provides automatic
calculation of the corner processing.
Corner rounding
Use a corner rounding option with the specified permitted deviation. The switch
requires additional parameter that specifies maximal allowed deviation of motion
/g
trajectory fromthe corner point. The switch cannot be specifiedtogether with
switches u and h
Use a corner rounding option with the specified permitted curvature. The switch
requires additional parameter that specifies maximal allowed rounding radius of
/u
the addtional segment. The switch cannot be specified together with switches g
and h
Use automatic corner rounding option. The switch requires additional parameter
that specifies the maximum length of the segment for automatic corner rounding.
If a length of one of the segments that built a corner exceeds the specified
/h maximal length, the corner will not be rounded. The automatic corner rounding is
only applied to pair of linear segments. If one of the segments in a pair is an arc,
the rounding is not applied for this corner. The switch cannot be specified together
with switches g and u.
XSEG without switches does not require any additional parameters except the initial
point coordinates, for example, XSEG (0,1),0,0 creates segmented motion for axes 0 and
1 with initial point (0,0) with required velocity derived from the axis 0.
IMM – Changes the motion velocity, acceleration, or jerk. The new value takes effect immediately
Comments
XSEG without switches does not require any additional parameter, except initial point coordinates.
For example, the command: XSEG (0,1),0,0 creates Extended Segmented Motion for axes 0 and 1
with initial point (0,0) and required velocity derived from the axis 0.
Some switches, however, require an additional parameter to be specified. If more than one
parameter is required, the parameters should be separated by comma, and the order of parameters
is fixed in the following order:
1. Required velocity (used with /v)
2. Final velocity (used with /f)
3. Corner velocity (used with /j)
4. Angle (used with /a)
5. Curvature velocity (used with /d)
6. Deviation (used with /g)
7. Radius (used with /u)
8. Maximal segment length (used with /h)
Examples are:
Segmented motion for axes 0 and 1 with initial point (0,0) with
XSEG/vf
required velocity 100 units/sec; at the end of each segment, the
(0,1),0,0,100,50
motion should decelerate to 50 units/sec.
Segmented motion for axes 1 and 2 with initial point (1000,1000) and
XSEG/vja
required velocity is 100 units/sec. If the path contains a junction, and
(1,2),1000,1000,
the junction angle is more than 0.05 radians, the velocity decelerates
100,20,0.05
to 20 unit/sec in the junction point.
4.6.13 ARC1
Description
Use ARC1 to specify the center point and final point coordinates of an arc and the direction of
rotation. Direction is designated by a plus sign (+) or (–) for clockwise or counterclockwise rotation
depending on the encoders’ connections. When ARC1 is used for Extended Motion, it must be
initialized with XSEG...ENDS.
Syntax
ARC1 [/switches] (axis_list), center_point_axis1, center_point_axis2, destination_point_axis1,
destination_point_axis2, [destination_point_axis3, … destination_point_axis6,] direction, [,velocity]
Argument Description
center_point_
Center point position for the first axis
axis1
center_point_
Center point position for the second axis
axis2
destination_
Destination position of the first axis
point_axis1
destination_
Destination position of the second axis
point_axis2
destination_
point_axis3 Mandatory only if AXIS_LIST contains more than 2 axes.
… Destination position of the rest of axes. Number of destination positions
destination_ must correspond to the number of axes in the AXIS_LIST.
point_axis6
Argument Description
index Defines the first element (starting from zero) of the variables array, to
which values data will be written. If argument is omitted, values data is
written to the variables array starting from the first element (index 0).
For information on optional switches for this command, see Using ARC1, ARC2 and LINE
Switches.
4.6.14 ARC2
Description
Use ARC2 to specify the center point and rotation angle in radians of an arc segment. Designate
direction by positive or negative rotation angle, depending on the encoders’ connections. When
ARC2 is used for Extended Motion, it must be initialized with XSEG...ENDS.
Syntax
ARC2 [/switches] (axis_list), center_point_axis1, center_point_axis2, rotation_angle [,destination_
point_axis3, … destination_point_axis6][,velocity][,end_velocity][,time][,values, variables[,index
[,masks]]]
Arguments
Argument Description
center_point_
Center point position for the first axis
axis1
center_point_
Center point position for the second axis
axis2
destination_
point_axis3 Mandatory only if AXIS_LIST contains more than 2 axes.
… Destination position of the rest of axes. Number of destination positions
destination_ must correspond to the number of axes in the AXIS_LIST.
point_axis6
Argument Description
values Defines the values to be written to variables array at the beginning of the
current segment execution. values is a one-dimensional user defined
array of integer or real type with maximum size of 10 elements .
index Defines the first element (starting from zero) of the variables array, to which
values data will be written. If argument is omitted, values data is written to the
variables array starting from the first element (index 0).
For information on optional switches for this command, see Using ARC1, ARC2 and LINE
Switches.
4.6.15 LINE
Description
Use LINE to add a linear segment that starts at the current point and ends in the destination point to
the motion. When LINE is used for Extended Motion, it must be initialized with XSEG...ENDS.
Syntax
LINE [/switches] (axis_list), destination_point_axis1,destination_point_axis2
[,destination_point_axis3 … ,destination_point_axis6][,velocity][,end_velocity][,time]
[,values,variables[,index[,masks]]]
Arguments
Argument Description
destination_
Destination position of the first axis
point_axis1
destination_
Destination position of the second axis
point_axis2
destination_
point_axis3
Mandatory if AXIS_LIST contains more than 2 axes.
… Destination position of the rest of axes. Number of destination positions
must correspond to the number of axes in AXIS_LIST.
destination_
point_axis6
Argument Description
index Defines the first element (starting from zero) of the variables array, to
which values data will be written. If argument is omitted, values data is
written to the variables array starting from the first element (index 0).
For information on optional switches for this command, seeUsing ARC1, ARC2 and LINE
Switches
Synchronize user variables with segment execution. The switch requires additional
/o
two or three parameters that specify values, user variable and mask.
Specify segment processing time The switch requires an additional parameter that
specifies the segment processing time in milliseconds. Unlike the required velocity
/t specification, the segment processing time defines velocity at the current segment
only, and has no effect on the subsequent segments. The switch cannot be
specified together with /V.
For ARC1, ARC2, and LINE some switches require an additional parameter to be specified. If more
than one parameter is required, the parameters should be separated by a comma, and the order of
parameters is fixed in the following order:
1. Required velocity (used with /V)
2. Final velocity (used with /F)
3. Segment processing time (used with /T)
4. /O switch parameters
Examples:
LINE/v (1,0), 1000, - Add line segment with end point (1000, -1000) and segment velocity
1000, 500 500.
arc1/vf (0,1), 0, 0,
Add arc segment with center (0,0), end point (100,100), clockwise
100, 100, +, 500,
direction, segment velocity 500 and end velocity 100
100
int Value(1)
int Mask(1)
Value(0) = 1; Mask Add arc segment with center (0,0) and 180 degree (π) angle. At the
(0) = 5 beginning of the segment execution, sets bit 0 and reset bit 2 of digital
outputs OUT(2).
ARC2/o (0,1), 0, 0,
3.141529, Value,
OUT, 2, Mask
4.6.17 Examples
4.6.17.1 Simple Two Axes Example
The following is a simple program example employing Extended Segmented Motion:
The XSEG command creates the segment motion. The motion does not start at this moment. Actual
motion starts once the previous motion ends and one or more segments are added. The four
segment commands specify the following path:
The LINE command may specify one axis that actually moves in this segment. Other
axes specified in XSEG hold their positions while the linear segment is in progress.
XSEG creates the segment motion for four axes: primary axes (0,1) and secondary axes (2,3). Actual
motion starts once the previous motion ends and one or more segments are added. The four
segment commands specify the following path:
In comparison with 2-axes example, xseg, line, arc1 and arc2 commands specify four axes, first two
of them are treated as primary axes.
> XSEG specifies the initial point coordinates for all four axes in the order the axes
appear in the axis list.
> ARC1 specifies the arc segment with a center, final point and rotation for
primary axes, and a linear segment with the final point for secondary axes.
> LINE specifies the final points of the linear segment for primary and secondary
axes.
> ARC2 specifies the arc segment with a center and angle for the primary
segment, and a linear segment with the final point for secondary axes.
> ENDS informs the controller that no more segment for this motion will be
added.
If the IMM command occurs either before the start XSEG, or after XSEG termination, its
action follows standard rules of IMM action in idle mode (or other motion whichever is
executed in the moment of IMM command).
If the IMM command is issued, and XSEG motion is at a specific point of execution, all XSEG
segments can be subdivided as follows:
> Segments before the current segment; these segments has been passed and are of no
interest.
> Current segment the current point belongs to.
> Segments after the current segments already included in segment queue and processed by
look-ahead algorithm.
> Future segments not included yet in segment queue.
If the IMM command specifies a new velocity, the velocity is expected to affect all XSEG segments
after the current point, including the section of current segment after the current point. However,
there are some limitations:
> Individual velocity can be specified for any segment. Individual velocity should not be
exceeded; actual velocity is required to be equal or (in some cases) less than the specified
one.
> The look-ahead algorithm may apply additional limitations to velocity on a segment or in a
junction point. The limitations are not eliminated by imm command.
Taking the above considerations into account, the velocity specified by the IMM command is not a
strict velocity setting from this point on; rather it operates as additional limitation that affects actual
velocity along with other limitations.
If the IMM command specifies a new velocity while XSEG motion is in progress, the controller
response includes the following actions:
> The specified velocity replaces the required velocity for the rest of the XSEG motion.
Therefore, the new value will act as the required velocity for a segment, if no individual
velocity is specified.
> The specified velocity defines velocity restriction for the rest of the XSEG motion. The
velocity restriction will take part in any velocity calculation; so that actual velocity can
appear equal or lower, but not higher than the specified velocity.
> The velocity profile for the queued segments, including the section of the current segment
after the current point, is recalculated taking into account the new required velocity and
velocity restriction. This way, operation of imm command is identical for queued and future
segments.
If the IMM command specifies new acceleration or jerk, the new value replaces the required value
for the rest of the XSEG motion. However, unlike the velocity case, the queued segments are not
recalculated. Therefore the new acceleration or jerk takes effect with some unspecified delay.
In some cases it is required to temporaryily pause a segmented motion while remaining on the
trajectory. The imm command allows specifying zero velocity for the leading axis in order to pause
the currently executed segmented motion. The controller will immediately start decelerating to zero
velocity and the motion will be paused on the current or one of the subsequent segments.
In order to resume the motion, the imm command for the leading axis should be sent with a non-
zero velocity value. The controller will immediately start accelerating to the specified velocity value.
There is an additional restriction that if the newly specified velocity is greater than the current
required velocity, the new velocity is not effective for already queued segments; it is effective for
the future segments only. In other words, lower velocity takes effect immediately; greater velocity
takes effect with some unspecified delay.
The rounding option is applied only if the angle between segments is more than XSEGAMIN and less
than XSEGAMAX.
XSEGAMIN also defines the minimal angle for corner processing, and its value is used by default for
corner processing if /a is not specified.
Motion velocity V, acceleration A, and jerk J are derived from the time parameters as follows:
If blending is active, sequential motions are executed without deceleration to zero. Actually, the
next motion starts acceleration stage once the previous motion achieves the start point of
deceleration stage. Then until the end of acceleration stage, the actual motion appears a mix of the
previous and the next motions. In one-axis motion, this approach provides smooth transition from
velocity of previous segment to velocity of the next segment. In multi-axis motion, blending
additionally provides geometrical smoothing of corners, although exact control of the smoothing
trajectory is not possible.
For sequential motions without blending, total motion time (including jerk sections) is
If the user specify time parameters that don’t comply with the specified limitations, the controller
provides the following handling of these specific cases:
> Currently executed segment final point coordinates, defined by the user: TPOS. With a
blending, the final point is never reached.
Arguments Comments
Initial jerk time (Tj) in milliseconds. The specified jerk time will be
jerk_time used for all segments until jerk_time argument is specified in LINE,
ARC1 or ARC2 command.
Switches
Switch Comments
Do not start until the GO command is executed. If the switch is not specified,
w
the motion starts immediately after the first motion segment is defined.
4.7.3.4 LINE
This format of LINE is used for blended segment motion and in this form must be initialized with
BSEG...ENDS. The command adds to the motion path a linear segment that starts in the current point
and ends in the destination point.
Syntax
LINE[/suffixes] (axis_list),destination_point_axis1,destination_point_axis2
[,segment_time [,acceleration_time [,jerk_time [,dwell_time]]]]
Arguments
Arguments Comments
4.7.3.5 ARC1
This format of ARC1 is used for blended segment motion and in this form must be initialized with
BSEG...ENDS. The command adds to the motion path an arc segment that starts in the current point
and ends in the destination point with the specified center point.
Syntax
ARC1[/suffixes] (axis_list),
center_point_axis1,center_point_axis2,
destination_point_axis1,destination_point_axis2, direction
[,segment_time [,acceleration_time [,jerk_time [,dwell_time]]]]
Arguments
Argument Commments
4.7.3.6 ARC2
This format of ARC2 is used for blended segment motion and in this form must be initialized with
BSEG...ENDS. The command adds to the motion path an arc segment that starts in the current point
and specified as the center point and rotation angle.
Syntax
ARC2[/suffixes] (axis_list),
center_point_axis1,center_point_axis2,
rotation_angle
[,segment_time [,acceleration_time [,jerk_time [,dwell_time]]]]
Arguments
Arguments Comments
Suffix Comments
Specifies jerk time (Tj) in milliseconds. The suffix requires additional parameter
that specifies jerk time in milliseconds. The suffix defines required jerk time for
s
the current segment and for all subsequent segments. If the suffix is not
specified, the previously defined jerk time is used.
Some suffixes require additional parameter to be specified. If more than one parameter is required,
the parameters should be separated by comma, and the order of parameters is fixed in the
following order:
1. Segment time (used with /m suffix)
2. Acceleration time (used with /a suffix)
3. Jerk time (used with /s suffix)
4. Dwell time (used with /d suffix)
The BSEG command creates the Blended segmented motion for axes 0 and 1 and initial point (1000,
1000). Initial blended motion parameters are specified as following: initial segment time 100msec,
initial acceleration time 20msec and initial jerk time 5msec.
The motion does not start at this moment. Actual motion starts once the previous motion ends and
one or more segments are added.
The ARC1 command adds a first arc segment with center (1000,0), final point (1000,-1000), clockwise
rotation. The initial segment, acceleration and jerk time parameters are used for the first arc
segment.
The LINE command adds a second segment with final point (-1000,-1000). The initial segment,
acceleration and jerk time parameters are used for the first arc segment.
The ARC2 command adds a third arc segment with center (-1000,0) and rotation angle -180°. The
new segment time 50msec is specified.
The last LINE command adds a fourth segment with final point (1000,1000). For this segment new
segment time 25msec and new acceleration time 10msec are specified.
The ENDS command informs the controller, that no more segments will be specified for the motion.
MASTER MPOS(axis_index)=value
Only one component of the MPOS (master position) variable is allowed as MPOS(AXIS_INDEX).
In the simplest case the master value follows the feedback of another axis:
When the command executes, the controller stores the formula specified to the right of the equals
sign, and then calculates the master value MPOS(0) according to this formula (in the example above,
it simply assigns the current FPOS(1) value to MPOS(0)). The controller does this calculation every
controller period, independent of program execution. Even if the program that executed the
MASTER command terminates, the controller continues calculating the last specified master
expression, until the another master command for the same axis executes.
The master value can be redefined at any time by the application. If the program that executed the
above command then executes the command.
A more sophisticated use of the MASTER command connects the axis to another axis feedback with
a scale factor:
The following example defines axis 2 to follow the RPOS (reference position) of axis 0 translated
through a conversion table (cam motion):
In this example TABLE is a user-defined array that contains a table for conversion.
Similarly, the MASTER value may be connected to other sources such as the sum of two or more
axes, or to an analog input.
w Create the motion, but do not start until the GO command has been issued.
p Use position lock instead of velocity lock (see Velocity Lock vs. Position Lock).
Slave motion is governed by the variables of the slaved axis. These include:
Default jerk. The slave uses this variable only in asynchronous motion to
JERK
overtake the master.
Default acceleration. The slave uses this variable only in asynchronous motion
ACC
to overtake the master.
Default velocity. The slave uses this variable only in asynchronous motion to
VEL
overtake the master.
Once started, slaved motion terminates only if a failure occurs, or one of the commands HALT, KILL,
or BREAK is executed. The HALT and KILL commands provide deceleration to zero and then the next
motion starts. If no next motion was created, the axis becomes idle. The BREAK command provides
smooth transition to the next motion without stopping, if a next motion is waiting in the queue.
4.8.2.1 Synchronization
In slaved motion the slave is usually synchronized to the master, meaning that the APOS axis
reference follows the MPOS master value strictly or with a constant offset. However, there are two
cases when synchronism is not attainable:
> The slaved motion starts, and positions (position lock) or velocities (velocity lock) of the
master and slave differ. The motion starts as asynchronous.
> The motion was synchronized, but the acceleration of the master exceeds the allowed limit
(the XSACC variable of the axis) for the slave. The slave comes out of synchronization.
In both cases, the motion continues asynchronously, and the correspondence between APOS and
MPOS appears broken. The controller tries to regain synchronization by having the slave pursue the
master within the maximal allowed motion parameters. When the slave overtakes the master,
synchronization is re-established and the motion continues as synchronous.
Only individual axes are allowed to be used in a SLAVE command. Groups are not allowed. The
created motion starts immediately if the axis is idle; otherwise the motion waits in the motion
queue until all motions created before for the axis finish. The following command creates a slaved
motion of the 0 axis:
SLAVE 0
The slave axis in a master-slave motion may show its state (through the AST variable)
as accelerating and in motion even when the master axis is motionless. This reflects the
fact that the axis is set to follow the motion of the other axis and is not following a
motion profile of its own.
APOS(0) = MPOS(1) + C
Where C is constant in velocity lock mode and is zero in position lock mode.
When the MSEG command includes the p switch (see MSEG, LINE, ARC1, ARC2, STOPPER Commands),
this activates the position lock mode of slaved motion. When synchronized, the APOS axis reference
follows the MPOS strictly:
APOS(0) = MPOS(1)
When the motion is asynchronous for any reason (see above), the controller tries to regain
synchronism by having the slave pursue the master with the maximal allowed motion parameters.
The difference between position lock and velocity lock manifests itself at the moment of regaining
synchronization:
> Velocity lock motion switches to synchronized when the slave velocity reaches the master
velocity (with allowed error defined by the SYNV variable of the slaved axis). At this
moment the difference between the master position and the slave position is latched as
the constant offset C, which then remains unchanged as long as the motion is synchronous.
> Position lock motion switches to synchronized when the slave position overtakes the
master position, i.e., when APOS = MPOS.
Each time the motion loses and regains synchronization, the velocity lock offset C may latch a
different value. Under the same conditions, the position lock motion each time re-establishes the
strict equality APOS = MPOS.
Use the point sequence as a cyclic array, that is, after positioning to the last point
c
return to the first point and repeat.
Non-uniform time interval; the time interval is specified for each point along with
t
the point coordinates.
Points for arbitrary path motion are defined by POINT and MPOINT commands (see MPTP, POINT,
MPOINT, and ENDS Commands).
The ENDS command terminates the point sequence. After the ENDS command, no POINT or MPOINT
commands for this motion are allowed.
The trajectory of the motion follows through the defined points. Each point presents the instant
desired position at a specific moment. Time intervals between the points are uniform, or non-
uniform as defined by the T switch.
Motion generated by the PATH command does not use the standard motion profile. Typically, the
time intervals between the points are short, so that the array of the points implicitly specifies the
desired velocity in each point. For this reason, variables VEL, ACC, DEC, JERK have no affect on this
motion.
If the time interval does not coincide with the controller cycle, the controller provides linear
interpolation of the points.
Commands HALT, KILL, KILLALL (see HALT Command and KILL and KILLALL Commands) are executed
in a specific way with this type of motion; as with other motion types, the controller provides a
smooth deceleration profile using DEC (HALT command) or KDEC (KILL, KILLALL commands) for the
leading axis. However, unlike other motions types, the controller does not provide following the
motion trajectory during deceleration.
Arbitrary path motion created without the T switch implies uniform intervals between the points. If
PATH is not specified with the T switch, the TIME_INTERVAL argument has to be included. The
argument defines time interval between the motion points in milliseconds.
If PATH is specified with the T switch, it must not have TIME_INTERVAL specification. Instead, the
TIME_INTERVAL must be specified for each point as an additional argument for the POINT command
or as additional array column in the MPOINT command.
The BREAK command (see BREAK Command) is not supported when using the PATH
command.
In many cases functional dependence between two or more values cannot be expressed as an
analytic formula. The most common presentation of those functions is a table of function values in
specific points.
For example, a machine axis was graduated with an external laser interferometer. The result of
graduation is a table like the following:
Commande
d position 100 200 300 400 500 600 700 …
(x)
Actual
103 199 294 402 500 598 705 …
position (p)
The table defines a functional dependence p=f(x) that cannot be expressed analytically.
The argument values for x in the definition table are knots, and the function values for p are control
points.
A 3rd order polynomial spline provides an approximation of the table-driven function that can
provide the function value not only in the knots, but at any point. Between each two knots the
spline is expressed as:
where coefficients a0, a1, a2, a3 have different values at different intervals.
The SPiiPlus controller also supports two-dimensional splines. In this case, the definition table is a
two-dimensional matrix. Knot points are defined for two arguments x and y, and the matrix
contains corresponding p values. Knot values divide the XY plane into rectangular cells. The matrix
defines the function values in the cell vertices. Within each cell, the interpolating spline is expressed
as:
Use the point sequence as a cyclic array, that is, after positioning to the last point
c
return to the first point and repeat.
Non-uniform time interval; the time interval is specified for each point along with
t
the point coordinates.
Points for PV and PVT motion are defined by the POINT and MPOINT commands (see POINT
Commandand MPOINT Command).
The POINT and MPOINT commands serve the same function for defining points along
the path as the POINT and MPOINT commands for multiple point-to-point motion (see
MPTP, POINT, MPOINT, and ENDS Commands); however, the controller employs a
different algorithm when calculating the spline motion.
The ENDS command terminates the point sequence. After the ENDS command, no POINT or MPOINT
commands for this motion are allowed.
The trajectory of the motion follows through the defined points. Time intervals between the points
are uniform, or non-uniform as defined by the t switch.
Motion generated by the PVSPLINE command does not follow the standard motion profile. Variables
VEL, ACC, DEC, JERK have no effect on this motion. The motion profile is defined exclusively by the
positions and velocities specified by the POINT and MPOINT commands.
The HALT command (see HALT Command) is executed in a specific way with this type of motion. As
with other motion types, the controller provides a smooth deceleration profile with the DEC value of
the leading axis. However, unlike other motions types, the controller does not follow the motion
trajectory during deceleration.
Spline motion created without the t switch implies uniform intervals between the points. If
PVSPLINE does not include the t switch, the time_interval argument has to be included. The
argument defines time interval between the motion points in milliseconds.
If PVSPLINE includes the t switch, the time_interval argument must not be included. Instead, the
time interval must be specified for each point as an additional argument for the POINT command or
as additional array row in the MPOINT command.
The PVSPLINE command itself does not specify any point, so the created motion starts only after the
first point is specified. The points of motion are specified by the POINT or MPOINT commands that
follow the PVSPLINE command.
For each segment the controller constructs a third-order polynomial and calculates the reference
coordinates using the polynomial.
The spline provides exact track through the specified points and exact specified velocity at the
points. The spline also provides continuous velocity at all intermediate points.
In general the spline does not guarantee acceleration continuity at the connection points. However,
the acceleration can be continuous if the proper velocity values are specified, and many host-based
programs that prepare data for PV-interpolation actually calculate velocity values that will provide
continuous acceleration.
The time interval between the points may be either uniform or non-uniform. In both cases the time
interval is not required to be an integer or to be equal to an integer number of controller cycles. The
controller uses the exact specified time interval to calculate the interpolated reference positions.
The following drawing illustrates the PV spline interpolation:
T 2T 3T 4T 5T 6T 7T 8T
In the POINT command the axis_designators must specify the same axes in the same order as in the
axis_designators of the corresponding PVSPLINE command.
The other arguments contain different values depending on corresponding PVSPLINE command.
If the related motion command is PVSPLINE without the t switch for M axes, there has to be 2*M
arguments: 2 arguments per axis involved. The arguments specify the end point coordinates and
the coordinate velocities at the end point in the following order:
> The end point coordinate for each axis involved (M values)
> The velocity at the end point for each axis involved (M values)
Each coordinate is specified in user units of the corresponding axis, each velocity is specified in user
units per second.
If the related motion command is PVSPLINE/t for M axes, there have to be 2*M+1 arguments: 2*M
arguments specify the end point coordinates and velocities, and the last argument specifies the
time interval between the previous and the current point. The time is specified in milliseconds.
The following example illustrates how the PVSPLINE command can be used for adding points on-
the-fly. The example also shows a simple approach to synchronization between the host-based
program that calculates the points and the controller that executes the motion.
The host-based program calculates the desired points and transmits the coordinates via Ethernet
link. The motion involves 6 axes. Therefore, each point specification contains 12 real numbers (6
coordinates and 6 velocities).
Because transmitting each point separately would be a very inefficient use of the Ethernet, the host
calculates the desired points in advance and transmits them in batches of 50 points. The controller
then executes the motion. As soon as the controller is ready to accept the next batch of points and
the host is ready to send that batch, the next transmission occurs, and so on.
The pace of the host and the controller do not have to be identical. However, the host is assumed to
be fast enough to calculate the next 50 points before the controller has moved through the
previous 50 points.
The controller executes the following program:
The program running on the host looks like the following pseudo code:
double HPoints(12)(50);
int N, HSync;
HANDLE Com;
open communication, start program in buffer NBuf of the controller;
while (Continue)
calculate N (<= 50) points in array Hpoints;
acsc_WriteReal(Com, NBuf, "Points" , 0, 11, 0, N-1, HPoints, 0) ;
acsc_WriteInteger(Com, NBuf, "Sync", -1, -1, -1, -1, &N, 0);
do
acsc_ReadInteger(Com, NBuf, "Sync", -1, -1, -1, -1, &HSync, 0);
while HSync;
reset Continue to zero if all points have been calculated;
end;
N = -1
acsc_WriteInteger(Com, NBuf, "Sync", -1, -1, -1, -1, &N, 0);
Synchronization between the host and the controller is provided by the Sync user variable. When
the host has finished transmitting the next batch of points to the controller, it writes to Sync the
number of points in the batch. The controller waits for non-zero Sync and then adds the points to
the motion. When the controller has added the points, it writes zero to Sync, which signals to the
host to transmit the next batch of points.
When the host comes to the end, it writes -1 to Sync, to indicate the end of the motion.
4.11 SmoothPath
SmoothPath is a new spline-based motion profile capability that provides smooth, constant speed,
multi-axis motion. The 2-axis SmoothPath feature is available in SPiiPlus controllers with a
MotionBoost license. 3+ axis SmoothPath is supported by special controller configurations only -
please contact your ACS sales or support representative for more information.
SmoothPath motion may be implemented by ACSPL+ commands (SmoothPath ACSPL+) and by
GSP Commands (SmoothPath G-code).
Arguments
Switches
Acceleration consideration.
G Allow the motion generator to deviate from the specified axes acceleration
parameter during velocity profile generation.
Return Value
None
4.11.1.2 SEGMENT
Description
Add a new control point to the SPATH motion generator
Syntax
SEGMENT[/switches](axis_list),coordinates[,velocity][,required_velocity]
Arguments
Switches
Return Value
None
4.12 NURBS
NURBS stands for Non-Uniform Rational B-Spline.
Arguments
Switches
Do not start until the go command. If the suffix is not specified, the motion starts
/w
once the first three spline points are specified.
Specify required velocity. The suffix requires an additional parameter that specifies
/v required velocity. If the suffix is not specified, the feed rate is derived from the
leading axis parameters.
Return Value
None
Comments
Example
Set FPOS(0) = 0
SET FPOS(1) = 0
ENABLE (0,1)
NURBS/V (0,1), 1000
npoint(0,1), 0, 0
npoint(0,1), 100, 0
npoint(0,1), 100, 100
npoint(0,1), 200, 100
npoint(0,1), 200, 200
npoint(0,1), 300, 200
npoint(0,1), 300, 300
npoint(0,1), 400, 300
npoint(0,1), 400, 400
ENDS(0,1)
STOP
The list of coordinate values separated by commas. The list must specify
coordinates one value for each axis in axis_list. The list defines coordinates of one
control point of the spline.
Optional, only used with switch /v or /f. The value changes the required
velocity feed rate. The new value is valid for all spline segments after the
corresponding control point.
Switches
Return Value
None
RPOS is calculated
according to the
Correspondence of commanded
Reference Position (RPOS) RPOS follows RPOS follows motion.
and Feedback Position FPOS FPOS FPOS follows the
(FPOS) RPOS as provided
by control loop
algorithm.
The control
Position Error (PE) Zero Zero algorithm calculates
PE = RPOS - FPOS
Bit 1 in the MFLAGS variable enables or disables open-loop mode. The following diagram explains
transition between the three modes:
Disabled
Mode
Command Command
DISABLE DISABLE
Command Command
ENABLE if ENABLE if
MFLAGS.1=1 MFLAGS.1=0
Command
MFLAGS.1 = 0
Open -loop Enabled
Mode Mode
Command
MFLAGS.1 = 1
The circles in this diagram represent the motor modes and the arrows with rectangles show the
controller commands that switch the controller from one mode to another.
As shown in the diagram, a motor can be switched from the enabled mode to the open-loop mode
and back without changing to the disabled mode. The controller provides a smooth transition
between the modes. Even if the motor experiences uncontrolled movement while in the open-loop
mode, switching back to the enabled mode does not cause any motor jump. However, be careful if
you execute a motion while the controller is in open-loop mode. Once the command switches back
to enabled mode, the controller continues the motion from the point where it finds the motor. No
motor jump occurs, but the motion trajectory and the final point may be shifted by the value of
uncontrolled offset in the open-loop mode.
While in open-loop mode, the controller calculates the drive voltage output based on the DCOM
variable. The DCOM variable sets the drive output as a percentage of the maximum available drive
output voltage. For example, the UDI provides differential drive output in the range from -10V to
+10V. Therefore, assigning 100 to DCOM provides +10V on the drive output, assigning -100 provides -
10V, and assigning 0 provides 0V.
The following program fragment shows an example of torque control implementation through the
open-loop mode.
NVEL is an array of 8 real values, one per axis. A non-zero value in any NVEL element determines
that the motion of the corresponding axis will be executed with non-zero start and finish velocities.
If an NVEL element is zero, the normal motion profile starts from zero velocity and finishes at zero
velocity. If an element is non-zero, in the beginning of motion the velocity immediately jumps to the
value specified in the NVEL element and then continues normal motion profile. In the end, the
motion approaches the final point at velocity specified in the NVEL element, then the velocity
immediately drops to zero.
In a typical application, the step motor does not require acceleration build-up phases; the motion
profile is trapezoidal:
GPHASE = 0 2 4 6
VEL
NVEL
Time
KILL and HALT commands are also affected, i.e., they slow down the velocity to the value specified in
the NVEL element and then the velocity drops to zero.
If the absolute value of the VEL value is less than the NVEL value, the VEL value is ignored. In this
case the motion profile is rectangular:
GPHASE = 0 4
NVEL
Time
Also ignored are the velocity specified in a motion command or in an IMM command if its absolute
value is less than NVEL. In all cases, the actual motion velocity is not less than NVEL.
Multi-axis motion is not typical for an axis with non-zero minimal velocity. If, however, the axis is
involved in multi-axis motion, the controller uses NVEL as follows:
> If the axis is a leading axis in the motion, its NVEL is used as a minimal vector velocity in the
motion profile
> If the axis is not leading, its NVEL is ignored.
In both cases, the axis velocity can be lower than the NVEL value. Therefore, be careful in defining
multi-axis motion that involves both stepper motors and servo motors.
If a non-default connection is specified (see Non-Default Connections), the axis and the motor are
different entities. In this case, NVEL refers to the axis, but not to the motor. For example, if NVEL0 is
set to 500, the velocity of any motion of the X axis will be limited from below to 500 units per
second irrespective of which motor is affected by the motion.
4.15.1 CSCREATE
Description
The CSCREATE command creates the new Local Coordinate System (LCS) relative to the Machine
Coordinate System or the previous LCS, depending on the applied switches.
Syntax
Arguments
The group of 3 axes. Valid values are: 0, 1, 2 ... up to the number of axes in the
axis_list
system minus 1.
(Optional)
rot_axis
The rotation axis: 0 – X, 1 – Y, 2 – Z
(optional)
rot_angle
Rotation angle value: (-3.14159 : +3.14159) in radians
Switches
The new LCS is relative (additive) to the existing LCS (otherwise the new LCS is
/r
relative to the Machine Coordinate System).
4.15.2 CSDESTROY
Description
The CSDESTROY command cancels the active Local Coordinate System and sets the Machine
Coordinate System or previous Local Coordinate System.
Syntax
Arguments
The group of 3 axes. Valid values are: 0, 1, 2 ... up to the number of axes in the
axis_list
system minus 1.
(Optional)
restore_flag
Set to 1 to restore the previous LCS; 0 or omitted value restores the MCS.
Unpredictable and dangerous motion may result if CSDESTROY is called before the
motion involving the coordinate system created by CSCREATE is complete.
Example 2
This example demonstrates rectangular motion in MPTP mode.
Example 3
This example demonstrates round rectangular motion in XSEG mode.
XSEG/z (X,Y), 0, 0
LINE (X,Y), 100, 0
ARC2 (X,Y), 100, -30, -3.14159
LINE (X,Y), 0, -60
ARC2 (X,Y), 0, -30, -3.14159
ENDS(X,Y)
CSDESTROY (X,Y,Z) !restore machine coordinate system
When you are operating a system whose configuration is currently unknown, you can
use the Terminal command: #SI (see SPiiPlus ACSPL+ Command & Variable Reference
Guide for details on Terminal commands) to find out the correlation between the
IN/OUT array indexes and I/O.
The port number to which the bits belong. The controller’s digital input/output
ports are numbered from 0 to N-1, where N is the number of controller ports
port_#
(see the controller’s Hardware Guide for the number of input/output for your
controller).
The specific bit within the port. Each port is divided into 32 bits that are
numbered from 0 to 31. For example:
IN0.1 – input 1 of port 0
.bit_#
IN3.19 – input 19 of port 3
OUT0.5 – output 5 of port zero
OUT3.19 – output 19 of port 3
Rather than explicitly designating the port number, you can use an integer user-defined variable
that equates to the number. In this case you have to include the parentheses, for example:
IN(U_VAR).1 - where U_VAR is an integer variable the value of which equates to the port number.
If the controller provides only 32 inputs or less, all inputs/outputs are located in port
zero. In this case the port number can be omitted, and input is referred as: IN.0 (for
input 0), IN.22 (for input 22), OUT.0 (for output 0), OUT.2 (for output 2), etc.
10111001,00011010,00000100,00000000
10111001,00011010,00000100,00000000 10111001,00011010,00000100,00000000
10111001,00011010,00000100,00000000 10111001,00011010,00000100,00000000
OUT6.1 = IN0.0 & IN0.1 Set OUT6.1 to logical AND of inputs IN0.0 and IN0.1
Set signals OUT0.0 and OUT0.8 to one. Set all other bits of
OUT0 = 0x0101
OUT0 to zero
OUT0 = (OUT0 & ~0x0101)|(V1 & Copy bits 0 and 8 from V1 to OUT0. Do not alter other bits
0x0101) of OUT0
while IN0.1 & Execute the subsequent commands up to command end while both IN0.1
IN0.2 and IN0.2 are one
1. real T1
2. int Bits
3. Start:
4. OUT0.0 = MST0.#INPOS
5. if T1 <= TIME
6. if Bits.0 T1 = T1 + 30000 else T1 = T1 + 15*60000 end
7. Bits.0 = ^Bits.0
8. end
9. OUT0.4 = IN0.4 & Bits.0
10. goto Start
11. on IN0.15; killall; ret
Line1 – Definition of local variable T1 that is used to store the next switch time. T1 may be defined as
integer, but as a real, it can provide continuous running for an extended period without overflow.
The program relies on the automatic initialization of all local variables to zero when they are
declared.
Line2 – Definition of a local variable: Bits. In this program only one bit of Bits is used. One temporary
integer variable can be used for storing 32 temporary bits.
Line3 – A label: Start. A typical case in PLC programming is a long program cycle that executes to the
end and returns to the beginning. In the example shown above, the execution period is quite short
even with default rate of ‘one Line per each controller cycle’. In a long program, the execution cycle
can reach hundreds of milliseconds.
This is a good reason to divide a typical PLC program into slow and fast sections.
Line 4 – OUT0.0 reflects the ‘in position’ state of the motor. If the motor is not in position, the output
is 0. If it is in position, the output is 1.
Lines 5-9 – OUT0.4 controls a periodic activity that must be executed every 15 minutes for a 30-
second period. It is executed only if IN0.4 is active. In a typical application, the output might be
connected to lubrication pump.
Line10 – Returns the motion to the Start point.
Line11 – An autoroutine that provides extra fast response to IN0.15, typically an emergency input.
The whole autoroutine is implemented in one line providing an immediate kill of all motions within
one controller cycle when input port 0 bit 15 is 1.
5.1.8.1.1 SPICFG
Description
SPICFG configures and initializes the SPI interface.
Syntax
SPICFG (SlaveIndex, Mode, NumberOfWords, Polarity,Size,Frequency)
Arguments
The mode of the SPI interface. The following modes are supported:
> 0 - Slave
> 1 - Master
Mode
> 2 - SlaveListenOnly
> 3 - Disable
> 4 - Master Single Transaction (Used by ACSPL+ SPIWRITE)
Clock Polarity.
Four types are available:
> Rising Edge – 0
Polarity
> Rising Edge with Delay – 1
> Falling Edge – 2
> Falling Edge with Delay - 3
2 800
3 1000
4 1500
5 2000
6 2500
7 3000
8 3500
9 4000
10 5000
Return Value
None
Comments
When the SPI interface is not required anymore, SPICFG should be called with Mode=3 (disable)
parameter.
Example
5.1.8.1.2 SPIRXN
Description
SPIRXN is a variable that shows the number of actual words that contain data transmitted from the
SPI external interface. The range is from 0 to 8.
Accessibility
Read-only
Comments
SPIRXN value is 0 if the SPI is disabled. This variable is supported by the UDMsm, IDMsm and ECMsm
products only.
5.1.8.1.3 EXTIN
Description
EXTIN is an integer array, the size of which is determined by the total number of SPI input signals in
the system, and reads the current state of the inputs. The number of inputs depends on the number
of SPI modules in the system.
Comments
The SPIRXN variable is updated every cycle with the number of active elements.
Tag
42
Accessibility
Read-Only
5.1.8.1.4 EXTOUT
Description
EXTOUT is an integer array, the size of which is determined by the total number of SPI output signals
in the system, which can be used for reading or setting the current state of the outputs. The number
of outputs depends on the number of SPI inputs in the system.
Syntax
EXTOUT(index) = value
Arguments
Comments
When used with an SPI interface in master mode, the EXOUT function should be used.
The SPICFG function sets the number of elements which contain data.
Tag
43
Accessibility
Read-Write
Related ACSPL+ Variables
EXTIN, OUT
COM Library Methods and .NET Library Methods
ReadVariable, WriteVariable, GetExtOutput, SetExtOutput, GetExtOutputPort, SetExtOutputPort
C Library Functions
acsc_ReadInteger, acsc_WriteInteger, acsc_GetExtOutput, acsc_SetExtOutput, acsc_
GetExtOutputPort, acsc_SetExtOutputPort
> Analog input - accepts analog signal from an external source, such as a sensor or a
potentiometer.
> Analog output - provides analog signal to an external receiver, such as an actuator or a
measuring device.
Analog inputs/outputs have no predefined function in the controller. You can connect signals to
inputs/outputs and process them as required by the application.
When you are operating a system whose configuration is currently unknown, you can
use the Terminal command: #SI (see SPiiPlus ACSPL+ Command & Variable Reference
Guide for details on Terminal commands) to find out the correlation between the
AIN/AOUT array indexes and I/O.
value = AIN(index)
AOUT(index) = value
Where:
The value returned is scaled by percent and ranges from -100 to +100.
For model-dependent analog I/O information (for example, the number and range of inputs and
outputs) see the controller’s Installation Guide.
Example:
The following ACSPL+ program assigns X-axis feedback position to output #3 and acceleration to
output #1. In the example the user variables: SF1 and SF2 are scale factors.
6. Fault Handling
Fault handling is not only a concern for isolating motion faults, it is also a vital concern to personal
and equipment safety.
Safety features are necessary to protect both the equipment and you from potential injury. SPiiPlus
controllers include numerous safety-related features, but the final responsibility for the safe use of
the controller in a particular application lies with you. Before you create your application make sure
that you thoroughly read and understand this chapter.
This chapter addresses:
> Safety Controls
> Working with Fault Procedures
Some alarms, limits, and errors involve protection against potentially serious bodily
harm and equipment damage. Be aware of the implications before changing or
disabling any alarm, limit, or error.
Safety control is one of the highest-priority tasks of the controller. The controller continually
monitors safety conditions each controller cycle, in parallel to its other activities.
The controller sets one of the fault bits of the ACSPL+ FAULT variable when it detects a malfunction.
The response to a fault may vary from sending a fault message to complete termination of all
activities. For each fault type you can enable/disable the default controller response or define your
own autoroutine response.
User error Defining a required velocity that is invalid or beyond the limits.
Improper or
A loose connection in the feedback encoder wiring.
broken wiring
Power amplifier The power amplifier malfunctions and sends a fault signal to the
malfunction controller.
Motor
A motor overheats.
malfunction
Controlled plant
The Emergency Stop input is activated.
malfunction
Controller The Main Processor Unit (MPU) and the Servo Processors (SPs) work
hardware together to detect malfunctions in the controller. Examples include the
malfunctions servo processor alarm and the servo interrupt.
6.1.3 Faults
When the controller detects a malfunction, it raises a specific fault bit. Fault bits are grouped into
ACSPL+ FAULT and S_FAULT variables.
In certain cases, you may want to define which fault conditions are examined in a specific
application. The ACSPL+ FMASK and S_FMASK variables specify which fault conditions must be
examined in a particular application.
See SPiiPlus Command & Variable Reference Guide for complete details of these variables.
Right Limit restricts the motion in the positive direction and the Left Limit in the
negative direction.
The faults reported by the ACSPL+ fault variables, as well as those latched in MERR are:
NETWORK
ERROR. The The controller
controller raises disables all axes
2 #NT Network the fault bit until a valid network
when a loss of Sync signal is
network is received.
detected.
The controller
disables the
ENCODER NOT violating motor. The
CONNECTED. The error code is latched
controller raises in the MERR variable
7 #ENCNC Motor the fault bit and remains active
when the until you resolve the
primary encoder problems and
is not connected. enable the motor
again or issue the
FCLEAR command.
No default response.
ENCODER 2 NOT The error code is
CONNECTED. The latched in the MERR
controller raises variable, and
the fault bit remains active until
8 #ENC2NC Motor
when the you resolve the
secondary problems and
encoder is not enable the motor
connected. again or issue the
FCLEAR command.
DRIVE ALARM.
The controller
raises the fault The controller
9 #DRIVE Motor bit when the disables the
signal from the violating motor.
drive reports a
failure.
The controller
disables the
violating motor. The
ENCODER ERROR.
error code is latched
The controller
in the MERR variable
raises the fault
10 #ENC Motor and remains active
bit when the
until you resolve the
primary encoder
problems and
malfunctions.
enable the motor
again or issue the
FCLEAR command.
The controller
disables the
ENCODER 2
violating motor. The
ERROR. The
error code is latched
controller raises
in the MERR variable
the fault bit
11 #ENC2 Motor and remains active
when the
until you resolve the
secondary
problems and
encoder
enable the motor
malfunctions.
again or issue the
FCLEAR command.
NON-CRITICAL
POSITION ERROR.
The controller
raises the fault
bit when the
position error
(PE) limit is
exceeded. The
limit depends on
the motor state
and is defined by
the following
12 #PE Motor variables: None.
ERRI if the motor
is idle (not
moving)
ERRV if the
motor is moving
with constant
velocity
ERRA if the
motor is
accelerating or
decelerating
CRITICAL
POSITION ERROR.
The controller
raises the fault
bit when the
position error
(#PE) exceeds
the value of the
critical limit. The controller
13 #CPE Motor Whereas #PE disables the
errors occur violating motor.
during normal
operation, #CPE
is assumed to
occur outside
normal operation
parameters and
#CPE is greater
than #PE.
VELOCITY LIMIT.
The controller
raises the fault
bit when the
absolute value of The controller kills
14 #VL Motor
the reference the violating motor.
velocity (RVEL)
exceeds the limit
defined by the
XVEL variable.
ACCELERATION
LIMIT. The
controller raises
the fault bit
when the
absolute value of The controller kills
15 #AL Motor
the reference the violating motor.
acceleration
(RACC) exceeds
the limit defined
by the XACC
variable.
CURRENT LIMIT.
The controller
raises the fault
bit, when the
RMS current
The controller
calculated in the
16 #CL Motor disables the
Servo Processor
violating motor.
exceeds the limit
value defined by
either the XRMS,
XRMSD, or
XRMSM variable.
SERVO
PROCESSOR
The controller
ALARM. The
disables the
controller raises
violating motor. The
the fault bit
error code is latched
when the axis
in the MERR variable
Servo Processor
17 #SP Motor and remains active
loses its
until you resolve the
synchronization
problems and
with the main
enable the motor
processor. The
again or issue the
fault indicates a
FCLEAR command.
fatal problem in
the controller.
HSSI NOT
CONNECTED. The
controller raises
20 #HSSINC Motor the fault bit if the None.
HSSI expansion
module is not
connected.
There is no
External The controller
23 #EXTNT EtherCAT device
Network Error disables all axes.
connected.
PROGRAM
FAULT. The
controller raises
the fault bit
when a run time The controller kills all
25 #PROG System
error occurs in motors.
one of the
executing
ACSPL+
programs.
MEMORY FAULT.
The user
The controller kills all
26 #MEM System application
motors.
requires too
much memory.
TIME OVERUSE.
The user
application
27 #TIME System No default response.
consumes too
much time in the
controller cycle.
The controller
EMERGENCY disables all motors.
STOP. The
controller raises It does
28 #ES System the fault bit not stop
when the ES the
signal is program
activated. buffers.
SERVO
INTERRUPT. The
servo interrupt
that defines the
controller cycle is The controller
29 #INT System
not generated. disables all motors.
The fault
indicates a fatal
controller
problem.
INTEGRITY
VIOLATION. The
controller raises
30 #INTGR System the fault bit No default response
when an
integrity problem
is detected.
Fault
Bit Fault Fault Description
Category
FDEF, S_FDEF variables are protected and can be assigned only in protected mode (see Application
Protection).
Table 6-4. Safety Related Variables
> Saved configuration values: files PAR.$$$ and PARn.$$$ , where n = 0,1…
> Saved ACSPL+ programs: files ACSPLnn.$$$, where nn = 00, 01, 02…
Firmware and the default files are present in the controller from the beginning and can be replaced
only by the Upgrade and Recovery Wizard of the SPiiPlus MMI Application Studio.
The saved files compose the user application. Saved files are created or replaced by the memory
management commands (See SPiiPlus Command & Variable Reference Guide).
Integrity Control is active for the all files specified above. The controller stores the size and checksum
of each file, existing or created. The controller then compares the stored size/checksum with
size/checksum of the actual file to expose damaged files. Validation is performed automatically on
power-up. After power-up you can use the IR command to validate files (see Integrity Report
Command).
#IR
Size Checksum
Registered Actual Registered Actual
C:\
sb1218pc.frm 001DA050 001DA050 DF4F97F0 DF4F97F0
model.inf 000014C3 000014C3 C5CC6B93 C5CC6B93
array.txt 00000010 00000010 00D4FF89 00D4FF89
1.prg 000002CB 000002CB D19BF636 D19BF636
ECAT.XML 00052B0A 00052B0A 4D35D447 4D35D447
C:\SB4\SP\
sp.### 0004FF0C 0004FF0C BCBB37F5 BCBB37F5
ADJ0.$$$ 0000017D 0000017D 8E1A3690 8E1A3690
sp.##1 0003DC8E 0003DC8E 0B678F5D 0B678F5D
c:\sb4\startup\
Acspl_e.$$$ 0000010B 0000010B 6C441150 6C441150
Par.$$$ 000001E9 000001E9 704245FA 704245FA
You can also use the ACSPL+ USAGE variable (see SPiiPlus Command & Variable
Reference Guide) to monitor the usage. This variable is particularly useful in
autoroutines for halting a program if the MPU usage is excessive.
SLDBITS SLDRA SLDRAIF SLDROUT SLDRX SLDZMIN SLDZMAX SLEBIASA SLEBIASB SLFRC SLFRCD
SLHRS SLIFAC SLIFILT SLIKI SLILI SLIKP SLIOFFS SLPBITS SLPKI SLPKP SLPKPIF SLPKPSF SLPLI SLPMAX
SLPMIN SLPROUT SLSTHALL SLVB0DD SLVB0DF SLVBITS SLVB0ND SLVB0NF SLVKI SLVKIIF SLVKISF
SLVKP SLVKPIF SLVKPSF SLVLI SLVNFRQ SLVNWID SLVNATT SLVSOF SLVSOFD SLVRAT SLVROUT
SLXROUT SLZFF SLVB1DD SLVB1DF SLVB1ND SLVB1NF E_MODE E_PAR_A E_PAR_B SLFRCN SLDZTIME
SLVKPDCF SLPKPDCF SLVKIDCF SLGCAXN
The user is able to change the protection attribute for each variable individually.
The following command specifies the variable to be protected:
setprotection variable = 1
The following command specifies the variable to be not protected:
setprotection variable = 0
The variable is any standard variable name except the read only variables.
Only standard variables can be protected. Assignment to a user variable is allowed in any controller
mode.
If a variable represents an array, all elements of the array share the same protection attribute.
Therefore the array as a whole can be protected or not protected. Protection cannot be specified for
individual elements of the array.
The setprotection command can be executed only in configuration mode.
#SC
Bit Code Fault 0 1 2 3 4 5 6 7
0 #RL Right Limit K K K K K K K K
1 #LL Left Limit K K K K K K K K
2 #NT Network error D D D D D D - -
3 #FAN Cooling Fan Fault - - - - - - - -
4 #HOT Overheat - - - - - - - -
5 #SRL Software Right Limit K K K K K K K K
6 #SLL Software Left Limit K K K K K K K K
7 #ENCNC Encoder Not Connected D D D D D D D D
8 #ENC2NC Encoder2 Not Connected - - - - - - - -
9 #DRIVE Drive Alarm KD KD KD KD KD KD KD KD
10 #ENC Encoder Error D D D D D D D D
11 #ENC2 Encoder 2 Error - - - - - - - -
12 #PE Position Error
13 #CPE Critical Position Error KD KD KD KD KD KD KD KD
14 #VL Velocity Limit K K K K K K K K
15 #AL Acceleration Limit K K K K K K K K
16 #CL Overcurrent KD KD KD KD KD KD KD KD
Addresses the left limit fault bit of axis 2. The bit is raised if the 2 left limit
FAULT(2).#LL
switch is activated.
FAULT Addresses the drive fault bit of axis 3. The bit is raised if the 3 drive safety
(3).#DRIVE input is active.
Addresses the aggregated Left Limit fault bit. The bit is raised if the Left
S_FAULT.#LL
Limit switch of any motor is activated.
Addresses aggregated Drive fault bit. The bit is raised if the Drive safety
S_FAULT.#DRIVE
input of any motor is active.
Use the bit designators of the system faults to address the system fault bits.
Examples:
Addresses the Emergency Stop fault bit. The bit is raised when the
S_FAULT.#ES
Emergency Stop safety signal is active.
Addresses the Program fault bit. The bit is raised when any program
S_FAULT.#PROG
has failed due to a run-time error.
The number in the left column is the bit number, followed by an ON/OFF indicator and the fault
description and the bit name in parentheses. In the above example all the faults are OFF except for
the Left Limit fault of one or more axes.
The S_FAULT variable indicates that there is a motor fault, but does not specify which motor has
failed. To determine which motor has failed, query the FAULT variable, or use ?$ to query the state
of all motors.
Fault bits can be queried individually:
?S_FAULT.#LL
1
?FAULT(0).#LL, FAULT1.#LL
0
1
The controller answers a query of an individual bit by showing the numerical value of the bit: either
0 or 1.
if FAULT(0).#LL | FAULT(0).#RL disp "X limit Display a warning if any limit switch of X
switch"end motor is active
The condition IF S_FAULT is satisfied if S_FAULT is non-zero, i.e., if any bit of S_FAULT is raised. Any
fault, either system or motor, raises a bit in S_FAULT. Therefore a non-zero S_FAULT indicates that
one or more faults are active.
The variables FAULT and S_FAULT display the current state of the faults. A conditional command
based on these variables uses the fault state at the instant when the command is executed. For
example, if the X left limit was activated but then released, FAULT0.#LL is zero, and the command if
FAULT0.#LL considers the condition unsatisfied.
on FAULT(0).#LL Start the autoroutine when an 0 axis Left Limit fault occurs
A fault-processing autoroutine can reside in any program buffer. When the buffer is compiled, the
controller checks the autoroutine condition each controller cycle. When the condition is satisfied, the
controller interrupts the program that is currently executing in the buffer that the autoroutine
resides in, and starts the autoroutine execution.
A fault-processing autoroutine can supplement or replace the default response to a fault. If the
corresponding FDEF or S_FDEF bit enables the default response, the autoroutine starts and
executes in parallel with the default response. If the corresponding FDEF or S_FDEF bit is zero, the
default response is disabled, and the autoroutine is the only controller response.
The controller examines all autoroutine conditions each controller cycle. However, if an
autoroutine is executing in a buffer, and a condition of the second autoroutine in the
same buffer is satisfied, the second autoroutine will start only after termination of the
subroutine currently executing. Therefore, if an application includes a time-consuming
autoroutine, avoid placing safety autoroutines that require short response times in the
same buffer with the time-consuming autoroutine.
Examples:
The following autoroutine displays a message when the Drive Alarm signal becomes active for the 0
axis motor:
on FAULT(0).#DRIVE
disp "Axis 0 Drive Alarm"
ret
In the following autoroutines, the 0 and 2 axes motors must be disabled simultaneously. Therefore,
if one of the drives fails, the second must be disabled as well. The default response disables the 0
axis motor if the 0 Drive Alarm occurs and disables the 2 axis motor if the 2 Drive Alarm occurs. The
following pair of autoroutines supplements the default response by disabling a motor if the other
motor fails:
When a 0 axis drive fault occurs, the following autoroutine terminates the controller activity for all
motors:
The S_FAULT variable contains the bits of the aggregated motor faults. These bits provide a
convenient alternative to the motor faults if an application requires common processing of a motor
fault irrespective of which motor caused the fault.
For example, the following autoroutine displays a message when the Left Limit switch of any motor
is activated:
on S_FAULT.#LL
disp "One of the Left Limit Switches is Activated"
ret
Autoroutine conditions can contain more than one fault bit, as is shown here in the first line of the
example:
on S_FAULT.#LL | S_FAULT.#RL
disp "Some Limit Switch Activated"
ret
The S_FAULT variable (used without a bit extension) indicates whether a fault has been detected by
the controller. The following example shows an autoroutine that provides an alarm message if any
fault occurs in the controller:
on S_FAULT
disp "Something happened"
ret
The controller activates an autoroutine when the condition of the autoroutine changes from false to
true. If the condition remains true, the autoroutine is not activated again until the condition
becomes false, and then true again. Therefore the above autoroutine displays the alarm message
only on the first fault. If one fault bit is already raised, and another fault occurs, the second fault does
not generate an alarm message.
The following autoroutine displays a fault message each time a fault occurs:
int LastFault
on LastFault <> S_FAULT
if (LastFault ~ S_FAULT) & S_FAULT
disp "Something happened"
end
LastFault = S_FAULT
ret
In the above example the local variable LastFault stores the current value of S_FAULT. The exclusive
OR (~) of LastFault and S_FAULT detects the bits of S_FAULT that changed. The AND (&) with S_
FAULT retains only the bits that changed from zero to one, and not from one to zero.
Certain safety variables provide protection against potential serious bodily injury and
damage to equipment. Be aware of the implications before disabling any alarm, limit or
error.
The ACSPL+ variables define which faults are examined and processed. If a bit of FMASK or S_FMASK
is zero, the corresponding fault is disabled and the bit of FAULT or S_FAULT is not raised.
FMASK and S_FMASK are queried like any other variable, and the controller reports the status of
each meaningful bit.
Example:
?FMASK(0)
0 ON Right Limit (#RL)
1 ON Left Limit (#LL)
2 ON Network error (#NT)
4 ON Overheat (#HOT)
5 ON Software Right Limit (#SRL)
6 ON Software Left Limit (#SLL)
7 ON Encoder Not Connected (#ENCNC)
8 ON Encoder 2 Not Connected (#ENC2NC)
9 ON Driver Alarm (#DRIVE)
10 OFF Encoder Error (#ENC)
Normally, you enable or disable fault detection through the Adjuster wizard of the SPiiPlus MMI
Application Studio (see the SPiiPlus MMI Application Studio User Guide) when initially configuring the
controller. The configured values of FMASK and S_FMASK are then stored in the flash memory and
left unchanged during the application lifetime.
Changes to safety variables after initial controller configuration may affect your application. The
following section is relevant only if you need to enable or disable faults after initial configuration.
Example:
The bits of SAFIN and S_SAFIN reflect the physical states of the signals, while the bits of SAFINI and
S_SAFINI define the logical processing of the signals. SAFINI and S_SAFINI variables have no effect
on the physical signal, and the bits of variables SAFIN and S_SAFIN, which display the raw values of
the safety inputs are unaffected by the bits of SAFINI, S_SAFINI
The variables SAFINI and S_SAFINI are queried like any other variable. The controller reports the
status of each meaningful bit that corresponds to a safety signal.
Example:
?SAFINI(0)
0 ON Right Limit (#RL)
1 ON Left Limit (#LL)
4 OFF Overheat (#HOT)
9 OFF Driver Alarm (#DRIVE)
?S_SAFINI
28 OFF Emergency Stop (#ES)
31 OFF Component Failure (#FAILURE)
In the above example, the fact that the response to the SAFINI(0) query shows that RL and LL are ON
(bits 0 and 1) indicates that you have defined inverse polarity (low active level) for signals #RL, #LL of
the 0 axis.
Normally, you define the signal polarity through the Adjuster wizard of the SPiiPlus MMI Application
Studio (see the SPiiPlus MMI Application Studio User Guide) when initially configuring the controller.
The configured values of SAFINI and S_SAFINI are then stored in the flash memory and are not
changed during the application's lifetime.
Example:
> In the strict mode the next motion command cannot activate the motion and fails. The
motion cannot be activated as long as the reason for the previous kill is non-zero for any
involved motor.
The reason for a kill operation is stored in the MERR variable. In the strict mode as long as a MERR
element is non-zero, the corresponding motor cannot be put in motion. Commands ENABLE and
FCLEAR clear the MERR elements for the specified motors and enable the next motion.
The same rules apply to the results of a KILL command with non-zero second argument (the reason
for the kill - see KILL and KILLALL Commands). The reason is stored in the MERR element and in the
strict mode the next motion cannot be activated until the reason is cleared.
In the regular mode the behavior is simple and totally compatible with previous versions. However,
you may prefer the strict mode, especially during application development. The following example
gives a hint why the strict mode may be preferable:
Reciprocated:
PTP/r 0,10000
PTP/r 0,-10000
GOTO Reciprocated
Under normal conditions the motor continuously moves forward and backward by 10,000 units.
Assume, however, that the first motion brings the motor to the right limit switch. The first motion
terminates prematurely, because the motor is killed. However, the program continues running and
executes the second motion command. In the regular mode the second motion starts successfully
because it is directed out of the limit. Then the first motion command again brings the motor to the
limit. Therefore, in the regular mode the reciprocated motion continues and there is no clear
indication of abnormal condition.
Assume further, for the same application, that a broken connection to the right limit switch causes
the controller to mistakenly continuously detect that the right limit has been passed. The first motion
fails immediately after start, but the second one executes. The result is that the motors move in a
negative direction by steps of 10,000 units.
In the strict mode, the behavior is more predictable. After the first motion failed, the second one
cannot start and the program itself terminates with error. You can check the information in MERR
and PERR to disclose the reason for the failure.
If at any point of the application a fault is an expected condition and the program must continue, the
program in the strict mode must analyze the MERR element and execute the FCLEAR command
before activating the next motion.
To overcome this, run #HWRES (Reboot controller) in the SPiiPlus MMI Application Studio
Communication Terminal, or perform a complete power down, and then power up to reset this
node.
Other nodes may keep functioning, if their response to Network Fault is masked.
= Hazardous Area
= Prohibited Area
=Limit Switch
Based upon
SAFIN.#LL, SAFIN.#RL (in each element of SAFIN)
safety signals
Internal
safety None
condition
Default
FDEF.#LL, FDEF.#RL (in each element of FDEF)
response bits
Autoroutine examples:
The first example supplements the default processing of X limit faults with alarm messages:
DISP "0 Left Limit switch activated" Display the message: 0 Left Limit switch activated.
RET
DISP "0 Right Limit switch activated" Display the message: 0 Right Limit switch activated.
RET
This second example implements an autoroutine that disables the motor rather than the default
response of killing the motion in case of a right limit or left limit fault. This response may be superior
to the default response if the motor is equipped with a brake that is activated by the disable
command because the brake may stop the motor faster than a kill command.
ON FAULT(2).#RL | FAULT When there is a right limit or left limit fault in the 2 axis
(2).#LL. motor.
RET
Inversion bits
Based upon
None
safety signals
Internal
safety See explanation below.
condition
Default
FDEF.#SLL, FDEF.#SRL (in each element of FDEF)
response bits
The controller kills the violating motor. As long as the fault is active, the
Default
controller kills any motion that tries to move the motor in the direction of
response
the limit. Motion in the direction out of the limit is allowed.
ON FAULT(0).#SLL
DISP "0 Software Left Limit violated"
RET
ON FAULT(0).#SRL
DISP "0 Software Right Limit violated"
RET
Use the #PE fault to detect non-critical violation of position accuracy, and the #CPE (see Critical
Position Error: #CPE) fault to detect uncontrolled, excessive error that indicates loss of control.
The following ACSPL+ variables are associated with position errors:
> ERRI – Maximum position error while the motor is idle (not moving)
> ERRV – Maximum position error while the motor is moving with constant velocity
> ERRA – Maximum position error while the motor is accelerating or decelerating
> DELI – Delay on transition from ERRA to ERRI
> DELV – Delay on transition from ERRA to ERRV
The controller raises the FAULT.#PE bit if the position error exceeds the maximum specified value,
which is equal to ERRI, ERRV or ERRA depending on the motion state.
The variables DELI and DELV are used in a similar manner with the #CPE fault.
The following diagram illustrates the use of these variables for a typical motion profile that includes
acceleration, constant velocity and deceleration:
V
PE > ERRI PE > ERRA PE > ERRV PE > ERRA PE > ERRI
DELV DELI
ON FAULT(1).#PE
DISP "Accuracy violation - the motion was killed"
RET
The next example corrects the motion conditions by reducing the velocity (VEL1) until the error
returns to within limits, instead of killing the motion.
The above autoroutine executes an undefined number of loops with delays in each
loop. Therefore, the execution time may be significant. As long as the autoroutine
executes, no other autoroutine in the same buffer can be activated. Do not place this
autoroutine in the same buffer that contains any time-critical autoroutine.
Use #PE fault (see Non-Critical Position Error: #PE) to detect non-critical violations of position
accuracy, and the #CPE fault to detect uncontrolled, excessive error that indicates loss of control.
#CPE should be greater than #PE.
The following ACSPL+ variables are associated with critical position error:
> CERRI - Critical position error if the motor is idle (not moving)
> CERRV - Critical position error if the motor is moving with constant velocity
> CERRA - Critical position error if the motor is accelerating or decelerating
> DELI - Delay on transition from CERRA to CERRI
> DELV - Delay on transition from CERRA to CERRV
The variables DELI and DELV are used also in the condition for the #PE fault.
The controller raises the fault bit if the position error exceeds the critical value. The critical value is
equal to CERRI, CERRV or CERRA depending on the motion stage. The following diagram illustrates
the use of these variables for a typical motion profile that includes acceleration, constant velocity
and deceleration:
V
CPE > CERRI CPE > CERRA CPE > CERRV CPE > CERRA CPE > CERRI
DELV DELI
ON FAULT(3).#CPE
DISP "Axis 3 shows abnormal error. The motor was disabled."
RET
Based upon
None
safety signals
The controller latches fault #ENC if the phase shift between the signals of
the primary encoder is lost, indicating a faulty encoder or noisy
Internal environment.
safety
condition The controller latches fault #ENC2 if the phase shift between the signals of
the secondary encoder is lost, indicating a faulty encoder or noisy
environment.
Default
FDEF.#ENC, FDEF.#ENC2 (in each element of FDEF)
response bits
The controller disables the violating motor. The faults remain active until the
Default
user resolves the problems and enables the motor again or executes the
response
FCLEAR command.
Unlike most faults, #ENC and #ENC2 faults are latched. The fault bits remain raised even after the
cause of the fault has been eliminated. Only the next enable command resets the fault bits.
Occurrence of an #ENC fault indicates a serious problem in motor control. Do not disable the default
response unless it is absolutely necessary in your application, i.e., keep FDEF.#CPE = 1.
Autoroutine examples
The following autoroutine supplements the default response with an alarm message:
ON FAULT(2).#ENC
DISP "Encoder Error in 2 axis. The motor was disabled."
RET
If the controller detects a pair of differential encoder inputs that are not in opposite states (high and
low level), it raises the fault because this may indicate a problem such as a short circuit or
unconnected wire.
An #ENCNC fault indicates a serious problem in motor control. Do not disable the default response
unless it is absolutely necessary in your application, i.e., keep FDEF.#CPE = 1.
Autoroutine examples
The following autoroutine supplements the default response with an alarm message:
ON FAULT(0).#ENCNC
DISP "Axis 0: Encoder Not Connected. The motor was disabled."
RET
Based upon
SAFIN.#DRIVE (in each element of SAFIN)
safety signals
Internal The controller never sets the fault bit while the motor is disabled. The
safety controller starts monitoring the fault condition when the period of time
condition defined by variable ENTIME elapses after the motor has been enabled.
Default
FDEF.#DRIVE (in each element of FDEF)
response bits
Default
The controller disables the violating motor.
response
ON FAULT(2).#DRIVE
DISP "Axis 2 Drive Alarm. The motor was disabled"
RET
Autoroutine examples:
The first autoroutine activates the OUT(0).1 output, which could be wired to switch on an additional
motor ventilation fan. The second routine switches off the fan when the fault is no longer active:
ON FAULT(1).#HOT
OUT(0).1 = 1
RET
ON ^FAULT(1).#HOT
OUT(0).1 = 0
RET
reached this velocity. The fault can also be used for program testing without physical motion, while
motors are disabled.
Autoroutine example:
The autoroutine informs you about the violation.
ON FAULT(2).#VL
DISP "Axis 2 velocity limit was exceeded"
RET
ON FAULT(0).#AL
DISP "Axis 0 Acceleration limit exceeded. The motor was disabled."
RET
The current limit fault is based on the Servo Processor algorithm that calculates the RMS value of the
motor current. When the calculated RMS current exceeds the allowed value the Servo Processor
reports an error that the MPU translates into a current limit fault.
Current limit processing uses the following ACSPL+ variables:
> XRMS – Maximum allowed RMS current for each drive
> XRMSD – Maximum allowed RMS current for each drive
> XRMSM – Maximum allowed RMS current for each motor
> XCURI – Maximum instantaneous current if the motor is idle (not moving)
> XCURV – Maximum instantaneous current if the motor is moving
Use the SPiiPlus MMI Application Studio SAFETY AND FAULTS CONFIGURATOR to configure the
specified variables.
Autoroutine example:
The following autoroutine kills the motion (and displays an alarm message) instead of the motor.
(The default response can be disabled by adding FDEF.#CL = 0 to the ACSPL+ program.)
ON FAULT(1).#CL
KILL 1
DISP "Axis 1 RMS current limit exceeded. Motor halted."
RET
#SP indicates that communication between the MPU and one of the servo processors failed. The
occurrence of the #SP fault indicates a serious hardware problem.
Do not disable the default response unless it is absolutely necessary in your application, i.e., keep
FDEF.#SP = 1.
This fault may be caused by a problem in the SP program. If the SP program hangs, the fault remains
permanent. If the SP program time exceeds the tick time (50 µsec), the fault is intermittent.
The disable reason reported by the controller is 5027 'Servo Processor Alarm'.
Autoroutine example:
The following autoroutine supplements the default response with an alarm message.
ON FAULT(1).#SP
DISP "Axis 1 Servo Processor Alarm"
RET
Internal safety condition The controller raises fault bit #HSSINC if HSSI is not connected.
ON FAULT(0).#HSSINC
DISP "Axis 0: HSSI not connected."
RET
Autoroutine example:
The following autoroutine kills all motions but does not disable the motors (this assumes that the
default response has been disabled by S_FDEF.#ES = 0).
ON S_FAULT.#ES
KILLALL
RET
Internal safety The controller latches the fault when any ACSPL+ program
condition encounters a run-time error.
Default response
S_FDEF.#PROG
bits
Unlike most faults, the #PROG fault is latched. Once raised, the bit remains raised until the controller
resets it on execution of any command that compiles or starts a program in any buffer.
Autoroutine examples:
The following autoroutine supplements the controller's default response, terminating all concurrent
programs and displaying an alarm message.
ON S_FAULT.#PROG
STOPALL
DISP "Run-time error"
RET
A run time error in a buffer stops all activity in the buffer. Therefore, the above autoroutine cannot
intercept an error that occurred in the buffer where the autoroutine is located. However, it
intercepts an error in any other buffer.
This autoroutine can supplement the default response (S_FDEF.#PROG = 1) or can replace it (S_
FDEF.#PROG = 0).
The following autoroutine does the same (stops all programs) and also provides a diagnostic
message.
ON S_FAULT.#PROG
STOPALL
I0 = 0
LOOP IO
IF PERR(I0) >= 3020
DISP "Program ", I0, " failed. Error ", PERR(I0)
END
IO = 1O + 1
END
RET
The ACSPL+ PERR variable contains the termination codes of the ACSPL+ programs. Each element of
PERR contains a termination code for a different buffer. At power-up all elements of PERR are reset
to 0. When a program in any buffer finishes or terminates for any reason, the corresponding
element of PERR is assigned with a code that specifies the termination reason. The element resets
to zero again once the corresponding buffer is compiled or its program execution starts.
Termination codes from 3000 to 3020 indicate normal termination. Codes greater than or equal to
3020 indicate run-time errors (see SPiiPlus Command & Variable Reference Guide for a complete
breakdown of the termination codes).
Based upon
None
safety signals
Internal safety The controller latches the fault bit when the user application requires more
condition memory than is available in the controller.
Default
S_FDEF.#MEM
response bits
Default
The controller kills all executed motions.
response
Unlike most faults, the #MEM fault is latched. Once raised, the bit remains raised until the controller
resets it on execution of any command that compiles or starts a program in any buffer.
Because the controller uses dynamic memory handling, the amount of the memory available for a
specific user application cannot be exactly determined. If an application raises this fault, you need to
reduce the size of the application or add memory.
The following recommendations may be useful in eliminating the error:
> Reduce the length of ACSPL+ programs.
> Reduce the volume of user local and global variables. Pay special attention to arrays.
> Limit the length of commands that are sent to the controller. Do not use commands that
exceed 2032 characters.
> Simplify the formulae used with the CONNECT and MASTER commands.
Autoroutine example:
The following autoroutine terminates all executing programs and displays an error message when
the fault occurs.
ON S_FAULT.#MEM
STOPALL
DISP "Memory overflow"
RET
This routine can supplement the default response (S_FDEF.#PROG = 1) or can replace it (S_
FDEF.#PROG = 0).
Internal safety condition The user application demands too much processing time.
The controller raises the fault bit when the user application consumes too much processing time and
S_FMASK.#TIME bit is raised.
The structure of the controller’s realtime cycle is discussed in Realtime and Background Tasks.
As the realtime processing time varies between cycles, the fault may occasionally occur and requires
no special attention. However, frequent or permanent occurrence of the fault requires measures to
correct the situation.
The controller has no default response to the fault. To monitor this fault, you must define your own
autoroutine.
The following recommendations may be useful in reducing real time processing time, thereby
eliminating the fault:
> Reduce the number of concurrently executed programs.
> Reduce the program execution rates (variables PRATE, ONRATE).
> Reduce the number of command specified in one program line.
> Reduce the number of autoroutines.
> Simplify the conditions in the autoroutines.
> Reduce the number of concurrently executed motions.
> Avoid short-time motions.
> Use segmented motion instead of a series of short PTP motions.
> Simplify the formula used in the CONNECT and MASTER commands.
Autoroutine example:
The following autoroutine accumulates statistics on the fault. The routine measures a time of 1000
fault occurrences and then displays the average time between faults. The routine relies on zero
initialization of the local variables.
Internal safety The controller raises the fault bit when the servo interrupt is not
condition generated or is irregular.
Default response
S_FDEF.#INT
bits
The Servo Interrupt fault indicates a serious failure. Do not disable the default response
unless it is absolutely necessary in your application, i.e., keep FDEF.#INT = 1.
The MPU sets the fault if the 1ms interrupt is not received. The probable cause is a hardware
problem. The controller response to the fault is to disable all motors. The disable reason reported by
the controller is 5029 'Servo Interrupt'.
Autoroutine example:
The following autoroutine supplements the default response with termination of all ACSPL+
programs and an alarm message.
ON S_FAULT.#INT
STOPALL
DISP "Main interrupt is missing"
RET
Some components other than Drive, for example, power supply, I/O extension card or encoder card,
may have fault outputs that are common for all components. The controller provides system faults
that by default disable all axes if fault occurs.
The controller provides special functions that retrieve the card malfunctioned information (according
to address on the I2C bus) and the fault reason. This allows to user to write an ACSPL+ application
that provides user-defined responses for different component faults. The components that have
such outputs provide a special jumper that connects or disconnects the fault output to the
controller.
Component Failure fault is treated as any other system fault. There is a dedicated bit 31 (#FAILURE)
for this fault in S_FAULT, S_FMASK, S_SAFIN, S_SAFINI and S_FDEF.
You use this variable for triggering a response that you have
S_FDEF.#FAILURE programmed.
(orS_FDEF.31) 1 = An MC4U hardware component other than the drive, such as
the Power Supply, I/O card, or encoder card, has failed.
S_SAFIN.#FAILURE Indicates the actual status of the Component Failure controller input
(or S_SAFIN.31) - see Examining System Fault Conditions.
S_SAFINI.#FAILURE
Used for inverting the Component Failure input logic.
(or S_SAFINI.31)
# Local variables
INT res, error, i2c_addr, dev, nexterr
ON S_FAULT.#FAILURE
REP:
res = GETCONF(247, 0)
error = res & 0x7FFF
nexterr = res.15
i2c_addr.0 = res.16
i2c_addr.1 = res.17
i2c_addr.2 = res.18
dev.0 = res.24
dev.1 = res.25
dev.2 = res.26
dev.3 = res.27
dev.4 = res.28
dev.5 = res.29
dev.6 = res.30
dev.7 = res.31
DISP “ERROR =”,error
DISP “I2C ADDRESS =”,i2c_addr
DISP “DEVICE =”,dev
IF(nexterr)
GOTO REP
RET
The SAFIN and S_SAFIN variables are normally read-only. However, they can be written
to when working with the Simulator, to simulate safety inputs.
Internal Safety
Conditions
XOR
Variable FMASK
AND
Variable FAULT
Internal Safety
Conditions XOR
Variable S_FMASK
AND
Variable S_FAULT
The upper part of the diagram shows how motor faults are examined. The list of faults is identical for
each motor and the controller repeats the process for each motor. The end product is the ACSPL+
FAULT variable.
The lower part of the diagram shows the elements that go into constructing the S_FAULT variable.
Part of its bits are set as the OR-aggregate of the FAULT elements, and other bits are determined by
examining the system faults.
IF SAFIN(0).#DRIVE V0 = 1 ELSE V0 = -1
END
assigns a value of 1 to variable V0 if the Drive Alarm signal of the 0 axis motor is high and -1 if low.
The SAFINI configuration variable defines which level of motor safety input causes a fault. In the
above diagram XOR is a bit-wise operation. Therefore, if a bit of SAFINI is zero, high voltage of the
corresponding signal causes fault. If a bit of SAFINI is 1, low voltage causes fault. Only those bits of
SAFINI that correspond to the meaningful bits of SAFIN are used in fault processing. Other bits have
no effect.
In addition to the safety inputs, the controller examines a number of internal safety conditions for
each motor each controller cycle. The faults caused by the motor safety inputs and the faults
detected by internal conditions provide a set of motor faults.
A detected motor fault is stored in a bit of variable FAULT only if the corresponding bit of variable
FMASK is 1. If a bit of FMASK is zero, the controller does not raise the corresponding fault bit even if
the fault condition or safety input is true. If a bit of FMASK is set to 1, the corresponding bit of FAULT
is immediately set when the fault occurs. The bit rises to 1 or drops to zero in the same controller
cycle as the corresponding safety input or internal safety condition shows change in the fault state.
Only those bits of FAULT that correspond to the motor faults are meaningful.
When a bit is raised, it activates the default response to the fault. An Autoroutine that processes the
fault must use the bit of FAULT in as the condition.
The controller's default safety configuration and responses fit the needs of most
applications.
Only an experienced user should make modifications to the safety configuration.
Improper configuration may result in unsafe operation, may damage the equipment,
and may constitute a hazard to personnel.
As mentioned earlier in this chapter, the controller response to a fault can be modified with the
ACSPL+ FDEF/S_FDEF variables and with autoroutines.
The #SC terminal command reports the current safety system configuration (see Report Safety
Configuration).
There are several other options for safety system configuration:
Safety groups
Two or more axes can be combined in a safety group. All axes belonging to the safety
group respond to any fault synchronously. If a fault affects one axis in the group, it
immediately affects all the other axes in the group (refer to the SAFETYGROUP command in
the SPiiPlus Command & Variable Reference Guide).
Kill -disable response
In response to a fault, the controller executes KILL, decelerates the motor to zero velocity,
and then disables the motor.
Changing response without an autoroutine
An axis can respond to a fault in one of the following basic ways:
No response
Kill response
Disable response
Kill-disable response
For each type of fault, the controller defines a default response, which can be overridden
with an autoroutine. The SAFETYCONF command (refer to the SAFETYCONF command in the
SPiiPlus Command & Variable Reference Guide) switches an axis between the four basic
fault responses. An autoroutine is only required if the desired response is not one of the
these.
Fault generalization
The fault response for a specific fault and a specific axis can be generalized to affect all the
axes. For example, by default the 0 Drive Alarm fault disables the 0 axis motor, but has no
affect on the 1 axis motor or any other motor. However, if you generalize the Drive Alarm
fault for axis 1, the 1 axis motor will be affected by a Drive Alarm fault on any axis.
Specific motor configuration
The default configuration for all axes is identical. For example, the default response to a
Limit Switch fault is to kill motion. However, the response can be modified individually for
each motor. For example, if a Limit Switch fault occurs, the 0 axis motor can be killed while
the 1 axis motor is disabled.
The ACSPL+ variables that provide access from your application to the control object are shown to
the left. The following variables are available:
> RPOS – Reference Position, array of eight elements, contains the desired motor position
calculated by the controller.
> FPOS – Feedback Position, array of eight elements, reads the current motor position.
> IND – Index Position, array of eight elements, reads the position of the last encountered
encoder index.
> MARK – Mark Position, array of eight elements, reads the position of the last encountered
Mark signal.
> M2ARK – Secondary Mark Position, array of eight elements, reads the position of the last
encountered Mark2 signal.
> FAULT – Faults, array of eight elements, the bits of the variable report the axis-related
faults detected by the safety control
> S_FAULT – System Faults, scalar, the bits of the variable report the system faults detected
by the safety control.
> IN – General Purpose Inputs, array of eight elements, each bit reports the state of one
general-purpose input.
> OUT – General Purpose Outputs, array of eight elements, each bit defines the state of one
general-purpose output.
> AIN – Analog Inputs, array of 16 elements, each element reads the numerical value of the
voltage supplied to one analog input. The number of analog inputs varies depending on the
controller model.
> AOUT – Analog Outputs, array of 16 elements, each element defines the voltage generated
by one analog output. The number of analog inputs varies depending on the controller
model.
> EXTIN – Extended Inputs, array of eight elements, each bit represents a bit in the input or
HSSI register.
> EXTOUT – Extended Outputs, array of eight elements, each bit represents a bit in the HSSI
register
Internal Multiplier x4
EFAC(0) = 1 / (500*4)
Where:
Internal Multiplier x4
User units mm
User units mm
Internal Multiplier x4
User units mm
The above is only accurate for Digital encoders.In the case of SIN-COS encoders, FPOS(0)
is an interpolated value that contains a position in between zero-crossing of the SIN-
COS signals.
Interpolation is done in the software and the hardware has the ability of latching only
the zero crossings of the sine-cosine.So when you reset IST(0).#IND on the rising edge
of the pulse, it latches the current value of the zero-crossing counter.
This is a low resolution counter that counts the quadrants of the SIN-COS. If the rising
edge is detected a little bit before the zero crossing, the counter still has the previous
zero-crossing position as shown in the following diagram:
The latching is done on the “Quad” signal that has a coarse resolution.So IND holds the
zero-crossing position of SIN-COS only.
The following program fragment reports the index value each time that the index is encountered:
The analog inputs are represented by the integer array: AIN and the analog outputs are represented
by the integer array: AOUT. Each analog input/output is represented by one array element. The
range of the AIN and AOUT arrays depends on the type of the input or output and the bit resolution
of the ADC or DAC.
Example: for ±10V analog outputs, the AOUT range is from -100 (for -10V) to +100 (for +10V).
Example: for ±10V analog inputs ,the AIN range is from-100 (for -10V) to+100 (for +10V) .
If an analog output is connected to a drive, it has a dedicated destination and cannot be used as a
general-purpose analog output.
For model-dependent analog I/O information (for example, the number and range of inputs and
outputs) see the controller's Hardware Guide.
The following example represents an autoroutine in the UDI that displays a message when the
voltage in the 1st analog input rises above +7.5V.
8. Advanced Features
This chapter describes various advanced ACSPL+ programming features that are available to you.
Topics covered are:
> Data Collection
> PEG Overview
> Sin-Cos Encoder Multiplier Configuration
> Interrupts
> Dynamic Braking
> Constant Current Mode
> Hall Sensor Commutation
> Communicating with the SPiiPlus C Library
> Communicating with Non-ACS Devices
> TRIGGER Command
> Dynamic TCP/IP Addressing
> Non-Default Connections
> Input Shaping
> DRA Algorithm
> BI-Quad Filter
8.1.1 DC Command
Description
The DC command is used for executing data collection.
Syntax
DC [/switch] [axis], array_name, #_of_samples, period, list_of_variables
STOPDC [/switch] [integer]
Where switch can be one or a combination of:
Create the synchronous data collection, but do not start until a GO command is
w
issued. W can only be used with the S switch.
c Start cyclic data collection (can be used with switches S and W).
> Data collection started by the DC command without the S switch is called system data
collection.
> Data collection started by the DC/S command is called axis data collection.
> Data collection started by the DC/C command is called cyclic data collection.
Unlike the standard data collection that finishes when the collection array is full, cyclic data collection
does not self-terminate. Cyclic data collection uses the collection array as a cyclic buffer and can
continue to collect data indefinitely. When the array is full, each new sample overwrites the oldest
sample in the array. Cyclic data collection can only be terminated by the STOPDC Command.
Arguments
Array that stores collected data. The array must be previously defined as
global, integer or real. The array size must be compatible with the number of
array_name
samples and number of stored variables (see Understanding System Data
Collection).
Sampling period in milliseconds. Actual sampling period may differ from this
value, because the controller rounds it to an integer number of controller
periods. For example if you set the period to 3.3 milliseconds, the controller
period
will round it to 3 milliseconds. If switch T is included in the command, the
parameter defines a minimal period (see explanation of temporal data
collection below).
number_of_ The number of samples to collect, the maximum value depends on the size
samples of the array.
sampling_
The time, in millisecords, that each sample is taken.
period
The minimum sampling period is 0.05 millisecond, which defines a sampling frequency of 20kHz.
The maximum sampling period is limited by CTIME value. By default, CTIME is 1 millisecond, which
restricts sampling period to 1 millisecond maximum.
The controller rounds the specified period to an integer number of minimal periods and restricts it to
the permitted range.
Axis State – Bit #DC in this bit-mapped variable is ON while an axis (started with
AST /S) data collection for the corresponding axis is in progress. The bit is OFF if no
axis collection for the axis is executed.
DC Period (axis variable) – When an axis data collection for the corresponding
axis terminates, the variable stores the sampling period. Unless a temporal data
DCP collection was executed, the variable is always equal to the requested period
specified in the DC command. For temporal data collection (/T) the variable may
be greater than the requested minimal period.
System State – Bit: #DC in this bit-mapped variable is ON while a general (started
S_ST without /S) data collection, either standard or cyclical, is in progress. The bit is OFF
if no general collection is executed.
Data collection is disabled when the SPiiPlus MMI Application Studio SCOPE is operating.
When the controller executes the DC command, it starts a separate real-time data collection process
that progresses in parallel with ACSPL+ programs and motion execution. Each sampling period the
process latches the values of all specified variables and stores them in the specified array. The
process continues until the specified number of samples is stored, or the command STOPDC is
executed. After process termination the array contains a time series of the specified variables that
may then be used for data analysis.
This is shown in the following example:
> In the first line, a matrix consisting of two lines and 1,000 columns is set up for data
collection
> The second line starts the data collection of the Feedback Position values for axes 0 and 1.
990 samples are to be collected, with a period of three milliseconds. The first step of the
data collection stores the current value of FPOS0 in DCA(0)(0) and FPOS1 in DCA(1)(0). The
second step stores FPOS0 in DCA(0)(1) and FPOS0 in DCA(1)(1).
Each variable is stored in one line of the array. Therefore the first dimension of the array (the
number of lines) must be equal or greater than the number of variables. If the number of lines is
greater than the number of variables, the extra array lines remain unaffected by the data collection.
If only one variable is specified for data collection, a one-dimensional array is allowed.
Each sample of data collection fills up one column of the array. Therefore the second dimension of
the array (number of columns) must be equal or greater than the requested number of samples. If
the number of columns is greater than the number of samples, the extra array columns remain
unaffected by the data collection. The following examples show incorrect usages of the DC
command.
The following DC command is not allowed because the number of variables exceeds the number of
array lines:
The following DC command is not allowed, because the number of required samples exceeds the
number of array columns:
If /S is not specified, the system data collection process starts immediately after executing the dc
command. Normally, data collection stops automatically after <number of samples> x <period>
milliseconds. If the STOPDC command executes while the data collection is in progress, the data
collection stops prematurely, and the remaining array columns remain unaffected. To terminate
system data collection, the STOPDC command must contain no parameters.
The variable S_DCN provides the number of samples stored during data collection.
global int Set up a one-dimensional 1000-line array for collecting data about a user-
IA, IC(1000) defined integer variable.
global real
Set up a two dimensional array with two columns and 2000 lines for collecting
RA(2)
data about a real user-defined variable.
(2000)
DC IC, 1000,
Collect 1000 samples of AOUT on the 0 axis at a rate of one per millisecond.
1, AOUT(0)
DC RA, Collect 2000 samples of FPOS on axis D, at a rate of 3 per millisecond (it should
2000, 2.5, be noted that the command calls for 2.5 milliseconds, but the controller rounds
IA, FPOS(7) it up to the nearest whole number).
DC RA,
Collect 500 samples of the ACSPL+ variable TIME at a rate of one per
500, 1,
millisecond
TIME
Data collection initiated by the DC command with no associated parameters is stopped by the
STOPDC command with no associated parameters. To stop synchronous data collection initiated by
the DC/S command, the STOPDC command must also include the S switch and the axis specification.
The DC/S command synchronizes the data collection start to the motion of an axis, but is not limited
to collecting data only of that axis. Any parameter for any other axis may be specified for data
collection. For example, the command
synchronizes data collection to the start of motion of axis 0, but collects data on both axes 0 and 1.
Only one data collection process, started by the DC command, can execute at a time. The next DC
command can execute only after the data collection started by the previous DC command finishes.
However, data collection, initiated by the DC/S command, may progress in parallel with the data
collection initiated by the DC command. Moreover, several data collection processes initiated by the
DC/S command may progress in parallel, providing they refer to different axes or axis groups. For
example these two commands are executed serially:
DC/s 0, Array,500,1,FPOS(0)
DC/s 0, Array,500,1,FPOS(1)
While these commands are executed in parallel (unless the 0 and 1 axes belong to the same axis
group):
DC/s 0,Array,500,1,FPOS(0)
DC/s 1,Array,500,1,FPOS(1)
It should be noted that the syntax of STOPDC that terminates synchronous data collection has been
changed. If your application uses synchronous data collection, slight changes may be required. To
terminate a synchronous data collection that was commanded by a DC/S command, the STOPDC
command must also have switch S. For example:
DC/s Start synchronous data collection by axis 0 to a global real array ARR
0,ARR,50,10,VAR1 of size 50, sampling period 50, collect global variable VAR1.
The SPiiPlus EtherCAT-based motion controllers provide the user with up to 6 identical PEG engine
units. Each PEG engine can operate in one of the following two modes:
Incremental PEG mode
> Provides the ability to generate a fix width pulse whenever a fixed position interval has
passed, starting at a predefined start point and ending at a predefined end point
> Incremental PEG commands are summarized in Incremental PEG Mode of Operation.
> Running Incremental PEG leads you through a step-by-step approach to setting and
activating Incremental PEG
> A programming example is given in PEG_I.
Random PEG mode
> Provides the ability to control a PEG pulse and a four-bit vector at pre-defined positions,
which are stored as a 256/1024 member user-defined array
> Random PEG commands are summarized in Random PEG Mode of Operation. It also leads
you through a step-by-step approach to setting and activating Random PEG.
> A programming example is given in PEG_R.
Each PEG engine can generate 1 PEG pulse: PEGx_PULSE (both in Incremental and Random modes)
signal and 4 state signals (in Random mode only): PEGx_STATEy - a 4-bit output vector, on each
random position PEG event. State signals are set to a defined logical level or set to generate a pulse
on transition, as defined by a 256/1024 member PEGx_STATE_ARRAY integer array.
The PEG engines can be configured to be triggered by a position of any of the controller Encoders,
with certain restrictions that result from the board’s architecture.
The PEG engine outputs can be assigned to 10 physical interface outputs and the PEG pulse width
and polarity are programmable.
Routing of Fast General Purpose Outputs to the Physical PEG Outputs
The PEG pulse signals can be assigned in parallel to opto-isolated General Purpose digital outputs.
There are 10 physical output pins that are shared between the PEG engines’ outputs. A special
command: ASSIGNPOUTS provides the means for routing Fast General Purpose outputs to the
physical PEG outputs.
The schematic block diagram of the PEG engines’ architecture (see Figure 8-1 ) is useful for
understanding the signal paths and routing. To configure the PEG operation, see ASSIGNPOUTS for
the mapping of PEG engine outputs to physical outputs.
For complete details on each command and its parameters see PEG Commands.
The following features are supported by ACS Motion Control products starting at the harware
revisions specified in Table 8-1.
> Time-based PEG
> Incremental PEG (PEG_I) Improvement - error accumulation prevention by taking into
account the rounding of the distance between incremental PEG events
SPiiPlusNT-LT / DC-LT D1
SPiiPlusNT-HP / DC-HP D1
SPiiPlusNT-LD / DC-LD D1
UDMNT A6
UDMPC C9
SPiiPlusCMBA UDMBA B8
SPiiPlusCMHP / UDMHP B8
UDMLC A8
UDMMC A1
UDILT B2
UDIHP B2
PDICL A2
UDMSD N/A
NPMPM N/A
NPMPC N/A
UDMCB A
UDMPA A
Table 8-2 summarizes the commands used for Incremental PEG setup and operation.
Digital output
ASSIGNPOUTS Assignment of physical output pins.
pins assignment
The Incremental PEG is set and activated by issuing the following commands:
1. Configuring specific PEG engines to specific encoders through the ASSIGNPEG command.
2. Assigning the physical output pins through the ASSIGNPOUTS command.
3. Setting Incremental PEG for the specific axis using PEG_I axis, width, first_point, interval,
last_point
4. Waiting for PEGREADY to be ‘1’ before activating PEG.
5. Starting PEG.
PEG firing is initiated if the specific PEG engine is configured properly by ASSIGNPEG and
PEG_I is issued. PEG continues to be fired periodically until last_point is reached.
Incremental PEG is activated periodically starting from the first_point position event, and
stops at the last_point position event. All pulses, including the last pulse, are of equal
duration (width).
PEG is generated only after first_point is reached. If first_point is not reached during the
motion, PEG will not be generated.
It is recommended that first_point position be the maximum current position for movement
in the positive direction and the minimum current position for movement in the negative
direction, before PEG engine activation.
Stopping the PEG motion with STOPPEG (optional).
6. STOPPEG is a synchronous delayed command which stops the PEGs from firing.
Since the Incremental PEG mechanism does not keep track of the direction of the
movement, you may have to issue STOPPEG after last_point has been reached. This is
needed in order to avoid unintentional PEG firing due to a rapid reversal of a movement’s
direction once last_point has been passed.
If STOPPEG has been executed before last_point has been reached, you can use STARTPEG
to continue PEG from the current position.
Table 8-3 summarizes the commands used for Random PEG setup and operation.
Table 8-3. Commands Associated with Random PEG
The Random PEG is set and activated by issuing the following commands:
1. Setting the event position array: PEGx_POS_ARRAY. The array has a maximum of 256/1024
members.
2. Setting the output states array: PEGx_STATE_ARRAY. This array contains the state vectors
which are to be issued per position event of the PEGx_POS_ARRAY.
3. Assigning the specific PEG engine to a specific encoder through the ASSIGNPEG command.
4. Assigning the physical output pins through the ASSIGNPOUTS command.
5. Setting Random PEG for the specific axis using PEG_R axis, width, mode, first_index, last_
index, PEGx_POS_ARRAY, PEGx_STATE_ARRAY.
6. Waiting for PEGREADY to be ‘1’ before activating PEG.
7. Starting PEG.
PEG firing is initiated if the specific PEG engine is configured properly by ASSIGNPEG and
ASSIGNPOUTS and PEG_R is issued. PEG continues to be fired upon position match until last_
point is reached.
8. Stopping PEG with STOPPEG (optional).
STOPPEG stops the PEGs from firing. If STOPPEG has been issued and the motion has not
reached last_point, you can use STARTPEG to continue PEG from the current position.
The Random PEG Arrays are loaded by issuing the following commands:
1. Load arrays.
2. Activate PEG.
3. Start movement.
The movement will cause the PEG signals to be fired each time a position match event
occurs. Following the last_point event, the sequence above is repeated with the movement
activated in the opposite direction.
This still allows loading 3 axes of the same Servo Processor in parallel, for example:
TILL AST(AXIS0).#PEGREADY
TILL AST(AXIS1).#PEGREADY
TILL AST(AXIS2).#PEGREADY
1 13 13 14 14 15 15
2 13 13 14 14 15 15
4 13 13 14 14 15 15
8 13 13 14 14 15 15
16 13 14 14 16 16 18
32 14 15 17 18 19 21
64 16 17 21 22 24 27
128 19 22 27 32 33 42
256 25 32 39 51 52 71
512 38 52 65 90 91 129
HSSI devices (HSSI-IO16, HSSI-ED2, etc.) cannot be used for the same Servo Processor
when fast loading of Random PEG arrays is activated. SPRT and SPINJECT commands
cannot be used for the same Servo Processor when fast loading of Random PEG arrays
is activated.
Table 8-5. Typical Times to Load PEG Engines for the products that do not support fast loading
of Random PEG arrays
1 16 17 24 25 29 30
2 17 18 26 28 31 33
4 19 21 30 34 37 42
8 23 27 38 46 49 60
16 31 39 55 70 73 100
Since the priority of loading PEG engine command is low, it is recommended not to use
‘SETSP’ / ‘GETSP’ commands and change tuning parameters in parallel with the loading
process, otherwise loading times can be higher than the times mentioned in the table
The PEG output state signals can be configured to reflect the programmed states or be set to pulses
(negative or positive) which are generated on the PEG event. The MC4U provides 10 physical PEG
signals through the pins of its front panel Encoder connectors. Thus, an assignment of the 30 PEG
engines’ outputs, i.e., 1 pulse and 4 state signals per engine, to 10 physical output pins is defined as
part of the engines’ configuration.
Use the ASSIGNPEG and ASSIGNPOUTS commands to assign the mapping. A schematic block diagram
aids in understanding the PEG engine output mapping to physical outputs.
PEG engines and associated output signals are indexed 0, 1, 2 and 4, 5, 6. Engines 3 and 7 are
reserved for future expansion. It should be noted that some of the PEG output pins are shared with
pins assigned for HSSI outputs and thus cannot be used simultaneously.
There can be either 4 or 8 Encoder connectors, depending on the controller model, for example,
CMnt-x/UDMpm-x/UDMpc-x/CMhv-x/UDMhv-x/CMba-x/CMhp-x/CMxa-x/UDMba-x/UDMhp-
x/UDMxa-x/ PDIcl-x may have up to four encoders and three PEG engines. The assignment of
Encoders to the controller’s Servo Processor imposes certain restrictions on the PEG configurations,
as detailed in this document:
> Encoders: 0(X), 1(Y), 2(A), and 3(B) are physically assigned to Servo Processor 0
> Encoders: 4(Z), 5(T), 6(C), and 7(D) are physically assigned to Servo Processor 1
8.2.1.3.2 ASSIGNPEG
Description
The ASSIGNPEG function is used for engine-to-encoder assignment as well as for the additional
digital outputs assignment for use as PEG pulse outputs. The parameters are different from the
original SPiiPlus definitions.
Syntax
ASSIGNPEG[/f] axis, engines_to_encoders_code, gp_out_assign_code
Arguments
The axis index, valid numbers are: 0, 1, 2, ... up to the number of axes in the
axis system minus 1.
Axis parameter can be any axis number of the same unit.
The axis parameter actually serves to determine the Servo Processor used, not the
physical axis.
Comments
> ASSIGNPEG is a blocking command - the ACSPL+ progam moves to the next line or
command only after this command has been fully executed or an error is generated.
> The axis parameter can be any of the axes controlled by the same servo processor, the
result will be the same.
> If switch: /f is included, fast loading of Random PEG arrays is activated.
HSSI devices (HSSI-IO16, HSSI-ED2, etc.) cannot be used for the same Servo Processor
when fast loading of Random PEG arrays is activated.
SPRT and SPINJECT commands cannot be used for the same Servo Processor when fast
loading of Random PEG arrays is activated.
Comments
ASSIGNPEG is a blocking command in the sense that the ACSPL+ progam moves to the next line or
command only after this command has been fully executed or an error is generated.
The axis parameter can be any of the axes controlled by the same servo processor, the result will be
the same.
Related ACSPL+ Commands
PEG_I, ASSIGNPOUTS, PEG_R, STARTPEG, STOPPEG
COM Library Methods
None
C Library Functions
acsc_AssignPegNT
8.2.1.3.3 ASSIGNPOUTS
Description
The ASSIGNPOUTS function is used for setting Fast General Purpose output pins assignment and
mapping between FGP_OUT signals to the bits of the ACSPL+ OUT(x) variable, where x is the index
that has been assigned to the controller in the network during System Configuration.
The assignments can be obtained by running #SI in the SPiiPlus MMI Appication Studio
Communication Terminal. For example, the following is a fragment from the response
to this command:
OUT is an integer array that can be used for reading or writing the current state of the General
Purpose outputs - see SPiiPlus ACSPL+ Command & Variable Reference Guide.
Each PEG engine has 1 PEG pulse output and 4 state outputs for a total of 5 outputs per PEG engine
and a total of 30 outputs for the whole PEG generator. The controller supports 10 physical output
pins that can be assigned to the PEG generator. The user defines which 10 outputs (of the 30) of the
PEG generator are assigned to the 10 available physical output pins. Some of the output pins are
shared between the PEG and the HSSI.
The tables in Appendix A define how each of the 30 outputs of the 6 PEG engines can be routed to
the 10 physical output pins - 4 PEG out signals, 3 PEG state signals, and 3 HSSI signals. Note that
some of the signals cannot be routed to physical pins.
Syntax
ASSIGNPOUTS axis, output_index, bit_code
Arguments
The axis index, valid numbers are: 0, 1, 2, ... up to the number of axes in the
system minus 1.
axis
For controllers with firmware version 2.15 or higher, the axis parameter can
be any axis number of the unit.
output_
0 for OUT_0, 1 for OUT_1, ..., 9 for OUT_9
index
Bit code for engine outputs to physical outputs mapping according to:
SPiiPlusNT/DC-LT/HP/LD-x Mapping of Engine Outputs to Physical Outputs
(Servo Processor 0)
SPiiPlusNT/DC-LT/HP/LD-x Mapping of Engine Outputs to Physical Outputs
(Servo Processor 1)
CMnt-x/UDMpm-x/UDMpc-x/CMhv-x/UDMhv-x Mapping of Engine Outputs
to Physical Outputs (Servo Processor 0)
CMnt-x/UDMpm-x/UDMpc-x/CMhv-x/UDMhv-x Mapping of Engine Outputs
to Physical Outputs (Servo Processor 0)
CMba-x/CMhp-x/CMxa-x/UDMba-x/UDMhp-x/UDMxa-x Mapping of Engine
Outputs to Physical Outputs (Servo Processor 0, OUT_0-4)
bit_code CMba-x/CMhp-x/CMxa-x/UDMba-x/UDMhp-x/UDMxa-x Mapping of Engine
Outputs to Physical Outputs (Servo Processor 0, OUT_5-9)
UDMnt-x/UDMpa-x/UDMcb-x Mapping of Engine Outputs to Physical Outputs
(Servo Processor 0)
UDMlc-x/UDMmc-x/UDIlt-x/UDIhp-x/PDIcl-x Mapping of Engine Outputs to
Physical Outputs (Servo Processor 0)
NPMpm-x/NPMpc-x Mapping of Engine Outputs to Physical Outputs (Servo
Processor 0)
IDMsm/UDMsm/ECMsm Mapping of Engine Outputs to Physical Outputs
(Servo Processor 0)
IDMsa/UDMsa/ECMsa Mapping of Engine Outputs to Physical Outputs (Servo
Processor 0)
Comments
ASSIGNPOUTS is a blocking command in the sense that the ACSPL+ progam moves to the next line
or command only after this command has been fully executed or an error is generated.
Examples
The following examples illustrate using the ASSIGNPOUTS in order to use PEG outputs as GP outputs
Example 1:
ASSIGNPOUTS 0, 2, 0b111
This defines the Z_PEG output as FGP_OUT2 and maps it to the bit 18 of the ACSPL+ OUT variable (see
ASSIGNPOUTS).
If you run, for example:
OUT(x).18=0
Where x is the index assigned to the controller during System Configuration, FGP_OUT2 output will
be activated.
Then if you run:
OUT(x).18=0
ASSIGNPOUTS 4, 7, 0b111
This defines the X_STATE2 output as FGP_OUT6 and maps it to the bit 22 of the ACSPL+ OUT variable
(see ASSIGNPOUTS).
8.2.1.3.4 STARTPEG
Description
The STARTPEG command initiates the PEG process on the specified axis. The command is used in
both the Incremental and Random PEG modes.
Syntax
STARTPEG axis
Arguments
The axis index, valid numbers are: 0, 1, 2, ... up to the number of axes in the
axis
system minus 1.
Comments
STARTPEG is a blocking command in the sense that the ACSPL+ progam moves to the next line or
command only after this command has been fully executed or an error is generated.
If "STOPPEG" below has been issued before the last PEG position, you have to use STARTPEG to
resume PEG engine firings from the current point.
Related ACSPL+ Commands
ASSIGNPEG, ASSIGNPOUTS, ASSIGNPOUTS, ASSIGNPOUTS, STOPPEG
Related ACSPL+ Variables
AST
COM Library Methods
None
C Library Functions
acsc_StartPegNT
8.2.1.3.5 STOPPEG
Description
The STOPPEG command terminates the PEG process immediately on the specified axis. The
command is used in both the Incremental and Random PEG modes.
Syntax
STOPPEG axis
Arguments
The axis index, valid numbers are: 0, 1, 2, ... up to the number of axes in the
axis
system minus 1.
Comments
STOPPEG is a blocking command in the sense that the ACSPL+ progam moves to the next line or
command only after this command has been fully executed or an error is generated.
Example
8.2.1.3.6 PEG_I
Description
The PEG_I command is used for setting the parameters for the Incremental PEG mode.
Syntax
PEG_I [/awi] axis, width, first_point, interval, last_point
Arguments
The axis index, valid numbers are: 0, 1, 2, ... up to the number of axes in the
axis
system minus 1.
PEG is generated only after the first pre-defined start point is reached. If the current
encoder position exceeds pre-defined start point no PEG pulses are fired. It is
recommended to activate the PEG engine before the maximum current position for
movement in the positive direction and the minimum current position for movement in
the negative direction.
Comments
> If the switch: /w is included, the execution of the command is delayed until the execution of
the STARTPEG command.
> If the switch: /i is included, the PEG pulse output signal is inverted.
> If the switch: /a is included, error accumulation is prevented by taking into account the
rounding of the distance between incremental PEG events.
You must use this switch if interval does not match the whole number of encoder counts.
Using this switch is recommended for any application that uses the PEG_I command,
regardless if interval matches the whole number of encoder counts.
Example
In this example, PEG pulses are fired on axis 6 based on axis encoder 7.
GLOBAL AXIS6
GLOBAL AXIS7
AXIS6=6 ! Axis assignment
AXIS7=7
ST:
peg_i AXIS6,0.5,-100,-200,-10000
TILL AST(AXIS6).#PEGREADY
!Wait till command executes and configuration is set, in order to ensure
!proper PEG engine's execution prior to start of movement
ptp/e AXIS6,-12000
stoppeg AXIS6 ! Prevent PEG pulses' firing on the 'way back'
ptp/e AXIS6,0
goto ST
stop
8.2.1.3.7 PEG_R
Description
The PEG_R command is used for setting the parameters for the Random PEG mode.
Syntax
PEG_R[/wid] axis, width, mode, first_index, last_index, POS_ARRAY, STATE_ARRAY
Arguments
The axis index, valid numbers are: 0, 1, 2, ... up to the number of axes in
axis
the system minus 1.
STATE_ The Outputs States array defining the four PEG output states, maximum of
ARRAY 256/1024 members
> The parameters that can be set by the command differ from those that could be set for
SPiiPlusCM/SPiiPlusSA/SPiiPlus3U controllers with the addition of the new first_index and
last_index parameters.
> When the PEG pulse is activated, the voltage between the two differential PEG outputs (+)
and (-) drops to -5V. When the PEG pulse is de-activated, the voltage between the two
differential PEG outputs is 5V.
> In PEG_R, the number of position-based pulses is limited to eight pulses per controller cycle
and the minimum time interval must be >200nsec.
> When using a Sin-Cos encoder, PEG is triggered at the zero crossing of the sine-cosine
waves and not at the precise interpolated position.
> The last three arguments are optional. If STATE_ARRAY is omitted, the controller generates
the PEG pulses at each position but does not change the state of any output. If time-based-
pulses and time-based-period are omitted, the controller does not generate time based
pulses.
> The dynamic loading feature is limited by the loading frequency. If a high loading frequency
is required, the loading capacity may not suffice to keep the FIFO loaded.
> Dynamic loading can only be implemented on a PEG engine with fast loading (ASSIGNPEG
/f)
> If the FIFO is emptied before all data arrays have been loaded, a memory overflow fault will
be thrown.
Loading Frequency Table
1 200
0.5 400
0.25 800
0.2 1000
Example
In this example PEG pulses are fired on axes 0, 1, and 2 according to encoder of axis 0.
GLOBAL AXIS0
GLOBAL AXIS1
GLOBAL AXIS2
AXIS0=0
AXIS1=1
AXIS2=2
assignpouts AXIS0, 0, 0b000 !Assign bit code 000 from SAnt-x Mapping of
Engine outputs to AXIS0,
!at Pin0
assignpouts AXIS1, 1, 0b000
assignpouts AXIS2, 2, 0b001
ST:
peg_r AXIS0,0.5,0x4444,0,15,ARR,STAT !Activate random PEG for axis 0
peg_r AXIS1,0.5,0x4444,0,15,ARR,STAT
peg_r AXIS2,0.5,0x4444,0,15,ARR,STAT
ptp/e AXIS0,5000
stoppeg AXIS0 ! Prevent PEG pulses' firing on the 'way back'
ptp/e AXIS0,0
goto ST
stop
This example shows the setup for dynamic PEG loading and a PTP motion command.
INT AXIS = 0
! Initialize PEG Arrays
!........
!........
STOP
8.2.1.3.8 ASSIGNMARK
Description
Description
The ASSIGNMARK function is used for Mark inputs-to-encoder assignment. It allows mapping
available physical Mark inputs pins to different encoders.
Syntax
ASSIGNMARK[/i] axis, mark_type, inputs_to_encoder_bit_code
Arguments
The axis index, valid numbers are: 0, 1, 2, ... up to the number of axes in the
Axis
system minus 1.
1 for Mark-1
mark_type
2 for Mark-2
Comments
If the switch: /i is included, the MARK input signal is inverted.
In IDMxx/ECMxx/UDMxx products, the latching for all encoders happens at the same time.
8.2.1.4.1 GETCONF
Description
GETCONF retrieves system configuration data that was configured by SETCONF.
Some keys relate to data that is set by the system and not by SETCONF, for keys set by
SETCONF see SETCONF Arguments.
Syntax
GETCONF(key,index)
Arguments
Return Value
GETCONF return values are described in Table 8-7 according to key.
Returns the mask that determines, for each digital input, whether the leading or
trailing signal edge triggers an interrupt.
The mask contains a bit for each available input signal. The location of bits in the
mask corresponds to the location of bits in variable IN0.
Returns the current assignment of the brake output associated with the specified
axis.
-1: Output follows the corresponding bit of OUT0
29 AANNOO: Brake output supplies the brake control signal where:
> AA - is the axis designation (00-99)
> NN - digital output index (00-99)
> OO - specific output (00-99)
Returns the mask that determine whether a digital input triggers on a single
edge, or on both edges. If value = 0, the trigger edge is determined by key 26.
The location of bits in the mask corresponds to the location of bits in variable IN0.
37
1: The controller generates an interrupt on both edges.
0: The controller generates an interrupt on one edge.
After power-up the mask contains 0 in all bits.
Used to view the actual assignment of digital outputs to PEG states and PEG
pulses outputs.
71
Returns the bit code according to or for SPiiPlusNT/DC-LT/HP/LD-x, or for SPiiPlus
CMnt-x-320/UDMpm-x-320, depending on the axis.
Used to view the actual output pins assignment for PEG engines.
73 Returns the bit code according to or ,for SPiiPlusNT/DC-LT/HP/LD-x, or or for
SPiiPlus CMnt-x-320/UDMpm-x-320, depending on the axis.
Returns the status if fast loading of Random PEG arrays for the relevant Servo
Processor is activated or deactivated:
0: fast loading of Random PEG arrays is deactivated
1: fast loading of Random PEG arrays is activated.
78
Returns the maximum USAGE value since power-up or since last call to the
79
SETCONF(79) command.
Returns the UnitID of the network unit that the specified digital input is assigned
80 to.
Index = 0, 1, 2... up to total number of digital inputs in the system minus 1.
Returns the UnitID of the network unit that the specified digital output is assigned
81 to.
Index = 0, 1, 2... up to total number of digital outputs in the system minus 1.
Returns the UnitID of the network unit that the specified analog input is assigned
82 to.
Index = 0, 1, 2... up to total number of analog inputs in the system minus 1.
Returns the UnitID of the network unit that the specified analog output is
83 assigned to.
Index = 0, 1, 2... up to total number of analog outputs in the system minus 1.
86 Returns the number of allowed single EtherCAT frames that were actually lost.
Index = 0:
Returns number of regular ACSPL+ program buffers.
Index = 7:
99
Returns total number of axes to which the controller is configured.
Index = 8:Key
Returns the maximum number of data bytes in the SAFE format message.
Upon receipt of a Drive Alarm signal, the controller stores a general Drive Alarm
code (5019) in the MERR variable. The extended Drive Fault status code can be
obtained by executing GETCONF(246, Axis).
246
The following extended Drive Fault statuses are supported (the MERR code
appears in brackets) by the DDM3U Motor Drive:
> Drive Alarm (5060)
Returns the state of the STO signals for the axis selected by index
253 bit 0: STO1
bit 1: STO2
Returns the current Hall state, which can be 0, 1, 2, 3, 4, or 5, of the axis given by
262 axis_def (a number: 0, 1, 2, ... up to the number of axes in the system minus 1). It
returns -1 for invalid states.
When a SIN-COS encoder is used, there are rare cases in which a homing
repeatability error of 1 quadrant (quarter of a sine-period) may occur. This key is
used for supporting SIN-COS repeatability. For example:
If an axis is enabled while moving, the motor back-EMF may generate high
currents during the ENABLE process which can potentially damage the drive or
the motor.
To avoid such damage the controller should check the motor velocity during the
ENABLE process and triggers a fault (error 5104 – “motor is moving”) if it is above
a threshold. The threshold is proportional to SLCPRD (commutation period) for a
brushless motor(MFLAGS().8=1). It is proportional to XVEL(maximal velocity) for a
DC-brush motor (MFLAGS().8=0)
Usually the user should not modify the factor, but in special specific cases it may
need to be increased. A typical example where modification might be needed is a
dual loop system with high resolution encoder on the load and low resolution
270 encoder at the motor (used for commutation). The threshold may be multiplied by
a factor using a special SETCONF command.
> SETCONF(270, <axis>, <value>) The value is – 1.0 by default.
> GETCONF(270, <axis>) returns the current value of the factor.
The SETCONF command should be executed after each controller powerup.
Because of the potential damage to the drive and the motor, the
user is advised to set this value only after consulting the factory.
Contact [email protected] .
Returns an integer value that contains the TCP/IP address currently assigned to
the controller. The index argument has to be zero, for example,
310
GETCONF(310, 0)
If a TCP/IP protocol is not configured, or not supported, the return value is zero.
Returns the RAM load in percentage, the amount of total physical memory, or the
amount of free physical memory as:
?B/GETCONF(229,0)
?X/GETCONF(229,0)
Output:
00000001
Reports the actual state of the output pins of the mechanical brake for the given axis in hexidecimal
format.
Example 3:
?X/GETCONF(310,0)
Output:
6e00000a
The address of a controller whose TCP/IP address is 10.0.0.100
8.2.1.4.2 AST.#PEGREADY
Description
AST is an integer array containing a set of bits used for displaying the current axis state. Bit 4
(#PEGREADY) has been added to indicate the readiness of a PEG engine.
Syntax
AST(AXIS#).#PEGREADY
AXIS# identifies the axis and can take on values of AXIS0 through AXIS_Last, where _Last is the
number of axes in the system minus 1.
Return value
> 0 - Indicates that the engine is not configured and motion should not be started.(default)
> 1 - Indicates that all values are loaded and the PEG engine is ready to respond to movement
(the user can start a motion).
Comments
The #PEGREADY bit is reset to ‘0’ when PEG is activated.
1/(250*1024) = 0.00000390625
Encoder-related features: index, Mark, PEG use the same user unit. However, actual resolution of
these functions is lower than the resolution of encoder feedback. As mentioned above, the
resolution of index, mark and PEG corresponds to 4 counts per encoder sine period. In the former
example the resolution will be 1/(250*4) = 0.001mm.
The controller continuously checks the integrity of the encoder multiplier feedback. If any error
occurs, the controller activates the Encoder Error fault.
8.4 Interrupts
Typically, you work with the SPiiPlus interrupts using the SPiiPlus C Library and do not need the low-
level details specified in this section. Refer to the SPiiPlus C Library Reference document for
explanation of the interrupt managing functions.
Bit Description
3 PEG 0
4 PEG 1
5 PEG 3
6 PEG 4
7 MARK 1 0
8 M2ARK 0
9 MARK 1 2
10 M2ARK 2
11 MARK 1 3
12 M2ARK 3
13 MARK 1 4
14 M2ARK 4
15 Emergency Stop
Bit Description
20 Program termination
23 Digital input
Bit Description
28 System error (the controller raises this interrupt if system error occurred)
29 EtherCAT error (the controller raises this interrupt if EtherCAT error occurred)
Controller cycle (the controller raises this interrupt in the beginning of each
30
controller cycle)
When a software interrupt occurs, the corresponding tag contains detailed information about the
interrupt source. For example, the tag of the Physical Motion End interrupt specifies the axes that
caused the interrupt. When a specific software interrupt has occurred, the next interrupt of the
same type can be generated only after the host drive reads both interrupt status register and writes
zero to the corresponding tag.
Bit Description
Bit Description
Bit Description
Bit Description
Bit Description
> In subsequent power-ups, the motor will start moving according to the Hall sensors until it
encounters the first change in the Hall sensors. At this point, commutation will switch to full
sinusoidal commutation.
> The quality of commutation relies on the physical alignment of the Hall sensors relative to
the magnetic field of the motor, and in most cases is done very accurately by the motor
manufacturers. Using this method, factors like high friction, vertical load, etc. have no effect
on the commutation quality.
> The connection sequence of the three Hall sensors is not important. Simply verify that the
three sensors are connected, and that the Hall counter counts 0,1,2,3,4,5. It does not matter
if the Hall counters count is opposite of the encoder. This situation is identified and dealt
with during the initial adjustment.
The variables and functions for supporting Hall operations are:
Table 8-8. Variables and Functions for Hall Support
Variable/Function Description
Returns the Hall counter of the axis specified by Index. The Hall
GETCONF(110, Index) direction bit is not taken into account. This function is used by the
Adjuster commutation program.
GETCONF(111, Index) This function is used by the Adjuster Wizard during commutation.
After hardware reset, if the Hall commutation was successful, the firmware
automatically sets bit MFLAGS.9 = 1, if MFLAGS.27 = 1.
For proper Hall commutation, the encoder resolution and number of poles should be
defined correctly. The current loop should be adjusted.
The Callback mechanism provides the fastest response to the controller events. The implementation
is transparent for user applications. In all communication channels, the callback API consists of the
functions, SetCallback and SetCallbackExt.
8.8.2.1 Timing
Callback operations include sending/receiving a message that requires much more time. Specific
rates depend on the communication channel rate.
From the viewpoint of callback mechanism, all communication channels are functionally equivalent,
but differ in timing.
The following interrupts are generated by the controller firmware and therefore are called software
interrupts:
> Physical motion end
> Logical motion end
> Motion failure (Motion interruption due to a fault)
Emergency The message is sent when bit S_FAULT.#ES changes from zero to one.
stop The message is disabled if S_FMASK.#ES is zero.
Mark 1 and The message is sent when corresponding IST.#MARK or IST.#MARK2 bit
Mark 2 changes from zero to one.
The message is sent when the corresponding AST.#PEG bit changes from
PEG
one to zero.
For a description of all the UMD functions see SPiiPlus Utilities User Guide.
To establish a remote connection using TCP/IP, select Enable Access from Remote Application on
the User Mode Driver (UMD) Remote Connection tab.
If the default port is not busy, no communication error messages are encountered, and no problem
is anticipated. In this case, use the function acsc_SetServerExt with the ACSC_DEFAULT_REMOTE_
PORT parameter to set the remote port address from the user application.
If the default port (9999) is busy, the UMD will return the following error message:
Requested port 9999 is in use by another application. Select another port in the Remote
Connection tab.
In this case, proceed as follows:
1. From the Remote Connection tab, select Change from the Remote Port Connection list.
2. Enter the remote port address in the Enter valid port number dialog.
3. From the Remote Connection tab, select Enable Access from Remote Application. As soon
as the check box is selected, communication with the remote port is attempted. If
communication does not succeed, the following error message appears:
Requested port [port number] is in use by another application. Select another port in the
Remote Connection tab.
4. Repeat Steps 1-3 until communications are established. When communications are
successfully established, the UMD stores the settings.
5. Click OK and then Close.
6. In the user application, use the function acsc_SetServerExt and specify the same port
number that was entered in the UMD GUI.
Every time the User Mode Driver (UMD) initializes, the availability of the specified port is
checked. If the system configuration or port number have changed, the UMD generates
an error message and the Enable Access from Remote Application on the UMD
Remote Connection tab check box will be cleared.
> Dump on Request – all the binary data that is stored in the internal binary buffer and is
flushed by explicit request to the file, see acsc_FlushLogFile.
> Continuous – this is a background thread that takes care of periodic file updates. It reads
the binary buffer and performs text formatting to the file.
Perform the Dump on Request as follows:
1. From the UMB Log Settings tab, select Dump on request as the Log File Mode.
2. Select the Log file path
Refer to the screen shot and note that Dump button appears and that Maximum logging time is
disabled.
The Infinite setting is not recommended because of a possible disk overflow situation.
5. After clicking Start Log, and the log is active, and the Stop Log button appears.
Currently only serial channels can be connected to devices such as these. All functions
described below are implemented for RS232 serial channels only.
The controller responds with a table that specifies the configuration for each supported
communication channel.
For any specific hardware configuration, not all listed channels may be physically
available.
#CC
Channel Type Commandant
1 Serial Command Rate:115200
2 Serial Special Rate:9600 Parity:Even
10 TCP/IP Command Connection:point-to-point Peer:10.0.0.96
The SETCONF function with key 302 assigns a communication channel for special input as follows:
SETCONF(302, channel, {0|1})
Where:
Indicates the assigned COM channel, it can be one of the following values:
channel 1 – COM1
2 – COM2
The values that can be used in connection with the channel are:
> 1 – assigns the channel for special input
> 0 – returns the channel to regular command processing.
If a channel is assigned for special input, the controller does not process commands from this
channel. Any input from this channel can be processed only by the INP function (see INP Function).
Output to the channel is provided by regular DISPand SENDcommands (see SPiiPlus Command &
Variable Reference Guide).
While a channel can be set to special communication mode by the SETCONF command
through the same communication channel, the channel cannot be returned to normal
mode through the same channel. The reason is that in special communication mode the
channel does not process commands and therefore cannot execute SETCONF. You have
to use another channel to return the channel to the regular command processing mode.
The GETCONF function with key 302 retrieves the state of a communication channel as follows:
GETCONF(302, channel)
The function returns:
> 0 – if the channel is in normal command-processing mode
> 1 – if the channel is in special-communication mode
Where:
Indicates the assigned COM channel, it can be one of the following values:
channel 1 – COM1
2 – COM2
Parameters Description
Option is bit mask of the communication options. The bits are interpreted
as follows:
options > Bit 2: 0 - normal stop bit, 1 - extended stop bit
> Bit 3: 0 - no parity, 1 - check parity
> Bit 4: 0 - odd parity, 1 - even parity
Example
In order to save the specified setting in the controller, the following ACSPL+ program should be
prepared and saved in one of the available buffers.
The program has an AUTOEXEC label that means that it will automatically start after the
controller power-up.
AUTOEXEC:
CONID = 32 ! Set Slave address 32
setconf(302, 2, 2) ! Set COM2 for MODbus communication
setconf(303, 2, 19200) ! Set baud rate 19200
setconf(304, 2, 0x18) ! Set even parity
STOP
Arguments
Indicates the assigned COM channel, it can be one of the following values:
channel 1 – COM1
2 – COM2
timeout Maximum waiting time (in milliseconds) for response from the channel.
Arguments
E Identical to the E format except that E rather than E indicates the exponent.
f Where dddd is one or more decimal digits. The number of digits before the
decimal point depends on the magnitude of the number, and the number
of digits after the decimal point depends on the requested precision.
If an input string argument contains n format specifiers, the specifiers apply to the n subsequent
expression arguments.
The DISP command processes the arguments from left to right. The processing is as follows:
> Expressions:
The expression is evaluated and the ASCII representation of the result is placed in the
output string. The format of the result is determined by a formatting specification (if any) in
the input string.
> Input strings:
Text is sent as-is to the output string. Escape sequences are replaced by the ASCII codes
that they represent. Formatting specifications are applied to the results of any expressions
that follow the string.
Examples:
The output string is sent to a communication channel. The channel is specified by the current value
of standard DISPCH (default channel) variable. The following values are available:
1 – Serial communication channel COM1.
2 – Serial communication channel COM2.
6 – Ethernet network (TCP).
7 – Ethernet network (TCP).
8 – Ethernet network (TCP).
9 – Ethernet network (TCP).
10 – Ethernet Point-to-Point network. (UDP)
-1 – No default channel is specified, the DISP command uses the last channel activated by the
host.
-2 – All channels.
In order to receive unsolicited messages by a host application, perform the following:
1. Set DISPCH to -2.
2. Set bit 4 of COMMFL to 1.
3. Send SETCONF(306,-1,1) from the same communication channel where unsolicited
messages are expected to be received.
In order to stop the receipt of unsolicited messages by a host application:
Send SETCONF(306,-1,0) from the same communication channel where there is no need any more to
receive unsolicited messages.
Syntax
SEND channel-number, disp-arguments
Where:
channel-number is an integer identifying the communication channel to which the message will be
sent (see below).
Table 8-11. Channel Number Argument
Channel # Description
-1 No default channel is specified, uses the last channel activated by the host
-2 All channels
disp-arguments are the same as those detailed for the DISP command (see DISP Command).
Return value
The function returns a string composed of the array elements interpreted as characters.
Comments
Each element of the variable array is interpreted as an ASCII character. If an element value is in the
range from 0 to 255, it is directly converted to the corresponding ASCII character. Otherwise, the
value’s modulo 256 is converted.
If neither start_index nor number is specified, the conversion takes all elements of the array. If only
start_index is specified, the conversion takes all characters from the specified index to the end of
array. Specifying number limits the number of characters in the resulting string.
The function can be used within the SEND or the DISP GUI.
Example
The following example provides a mirror for channel 2, so that any received character is sent back:
int Char(1)
INP(2,Char,,1)
SEND 2,str(Char)
Arguments
Return value
The function returns the number of actually assigned characters.
Comments
The function decomposes string into individual characters and assigns the characters to the
sequential elements of the variable array.
Each ASCII character is represented as its numerical value and stored in a separate element of the
array.
If start_index is specified, the first character is assigned to the array element with the specified
index. If start_index is omitted, the assignment starts from the first element of the array.
Ifnumber is omitted, the function assigns all characters of the string. If number is specified, the
function assigns the specified number of characters. In both cases the assignment stops when the
last array element is reached.
Arguments
Comments
One TRIGGER command can cause triggering many times. The controller continues calculating the
expression until another TRIGGER command is executed in the same channel. Each time when the
expression changes its value from zero to non-zero, the controller raises the trigger bit and
produces the interrupt.
The table specifies triggering bit and interrupt tag for each triggering channel:
Table 8-12. Trigger Bit and Interrupt for each Channel
0 AST0.11 0x00000001
1 AST1.11 0x00000002
2 AST2.11 0x00000004
3 AST3.11 0x00000008
4 AST4.11 0x00000010
5 AST5.11 0x00000020
6 AST6.11 0x00000040
7 AST7.11 0x00000080
> If the TCPIP variable stored in the flash is not zero, SETCONF(310) must be used only with
non-zero address arguments. In other words, if the controller is configured for static
addressing, switching to a dynamic address is not allowed.
> SETCONF(310) has a long execution time. During this time, communication with the
controller is impossible using any communication channel. Use SETCONF(310) only within
the controller initialization sequence. Avoid attempts to communicate with the controller
and the motor ENABLE command or motion commands while SETCONF(310) is in progress.
AUTOEXEC:
WHILE GETCONF(310,0) = 0
SETCONF(310,0,0)
END
! continue initialization
As a result, the controller waits at the beginning of initialization until the DHCP server
succeeds to in supplying a TCP/IP address.
The ROFFS variable is an 8 element array, one element per axis, that reads the offset calculated by
the controller in the connect formula. As long as the motor is in the default connection
(MFLAGS.#DEFCON = 1), offset ROFFS is zero. However, once you have specified a CONNECT (see
CONNECT Command) formula:
the controller calculates offset ROFFS(axis) to prevent any immediate change of RPOS(axis) that
may cause a jump of the motor. Then the controller calculates formula:
RPOS(axis) = F(…) + ROFFS(axis)
The controller recalculates the offset to prevent motor jump when any of the following commands
is executed:
> CONNECT
> SET
> ENABLE
> DISABLE
> KILL
ROFFS reads the current value of the offset. Watching the offset value facilitates development and
debugging of application with complex kinematics.
The DAPOS variable is an 8 element array, one element per axis, that reads the Axis Position
synchronous with the Reference Position. The variable supplements the existing APOS variable. The
problem of the APOS variable is that the axis position is not synchronous with the RPOS and FPOS.
For this reason watching APOS against RPOS or FPOS in the SPiiPlus MMI Application Studio Scope is
inconvenient.
DAPOS reads the same values of axis position, but synchronously with RPOS and FPOS. Using
synchronous axis position facilitates analysis and debugging of the CONNECT formula.
Use only DAPOS for watching the axis position in the Scope.
The CONNECT command cannot be executed as long as the default connection bit
(MFLAGS.#DEFCON) is raised.
Syntax:
CONNECT RPOS (axis) = expression
WhereRPOS(axis) is an axis RPOS variable (for example, RPOS(0)), which receives the value of the
expression.
For more information about RPOS and other common motion variables refer to the SPiiPlus
Command & Variable Reference Guide.
The connect command is not an assignment command (see Assignment Command). It does not
simply assign the result of the formula on the right side to the axis RPOS. The formula is not
evaluated when the connect command is executed (which would be the case for an assignment
command); instead, the formula is stored and then evaluated by the controller every controller cycle
to calculate the corresponding RPOS.
After power-up the controller always starts with the default connection. The default connection
means the following for each axis:
> Bit MFLAGS.#DEFCON is raised.
> The default connect formula is defined as CONNECT RPOS = APOS.
> APOS and RPOS are linked, i.e., explicit (through the SET command see SET Command) or
implicit change of one of these variables causes the same change in the other one.
Once an application resets MFLAGS.#DEFCON, it can then execute a CONNECT and (typically) a
DEPENDS command. At this point, the motor is considered to be in non-default connection.
Consider the following examples:
The commands
MFLAGS(1).#DEFCON = 0
CONNECT RPOS(1) = APOS(0)
DEPENDS 1, 0
connect the 1 axis motor position to the 0 axis reference. If the 0 axis motor is also connected to the
0 axis reference, this provides gantry-like motion of two motors.
The command
PTP 0, 1000
connects the 0 axis motor position to the 0 axis reference plus analog input 1. In this case the 0 axis
provides a motion and the analog input (for example, an external sensor) supplies a correction for
the 0 axis motor.
The following commands
MFLAGS(2).#DEFCON = 0
connect RPOS(2) = APOS(2) + APOS(3)
depends 2, (2,3)
connect the 2 axis motor to the sum of 2 and 3 axes. The axes can each execute an independent
motion, with the 2 axis motor following the sum of the two motions. Or the axes can participate in a
single multi-axis motion.
The following illustrate uses of the CONNECT command.
A typical location for a CONNECT command is after the homing process in the code that follows an
AUTOEXEC label (see Names: Variable and Label). The following pseudocode executes homing of X
and Y axes and configures them as a gantry pair that follows the motion on the X axis:
A more sophisticated application may require changing the connection in the middle of operations.
The controller applies no limitations regarding when a connection can be changed. In a typical case,
changing connection requires three commands:
a motor jump. Using this implicit offset the controller ignores any explicit offset specified in the
CONNECT formula. For example, the following commands have exactly the same effect:
and
The DEPENDS command cannot be executed as long as the default connection bit
(MFLAGS.#DEFCON) is raised.
Syntax
DEPENDS dependent_axis, axes_specification
Comments
The dependent_axis argument specifies an axis and the axes_specification argument specifies one
or more axes on which the motor depends.
Typically, a DEPENDS command will follow a CONNECT command. Whereas a CONNECT command
can define a mathematical correspondence between a motor’s reference position (RPOS) and one
or more axis positions (APOS), a DEPENDS command specifies the logical dependence between a
motor and axes.
The DEPENDS command is necessary because generally the controller is not capable of deriving the
dependence information from the CONNECT formula alone. For this reason, once a CONNECT
command is executed, the controller resets the dependence information of the motor; the motor
depends only on the corresponding axis.
Dependence information, as specified using a DEPENDS command, is required in the following
cases. If the dependence information is not provided correctly, the controller may display strange
behavior.
> A motor/axis query (for example, ?0) returns the non-default dependence for that motor.
> When initiating a motion, the controller verifies if each motor dependent on the axes
involved is enabled. If one or more motors are disabled, the motion does not start.
> If in the process of motion a motor is disabled or killed due to a fault or due to a DISABLE or
KILL command, the controller immediately terminates all motions involving the axes that
the motor depends on.
> Once a SET APOS=… command is executed, the controller adjusts offsets in the connection
formula of the motors that depend on the specified axis.
from/to Restricts the range within which the matching value is searched.
Comments
The function is useful in the case of non-default connections if a motor depends only on the same
axis, a typical example is error compensation. For example, the following connection:
can be used to find matching APOS(1) in the range -1000 to +1000 and to set offset ROFFS1 to zero.
In mathematical terms, the function finds the root of equation:
RPOS = F(x)
where RPOS is the current value of the RPOS variable and F(x) is the connect formula specified by
you with APOS substituted for x.
The function succeeds if the unique root exists in the specified range. If there are several roots in the
range, the function returns one of them. If the root does not exist, the function result is incorrect. It is
your responsibility to restrict the range so that the function provides proper result.
8.13.1 INSHAPEON
Description
The INSHAPEON function starts Input Shape algorithm for specified axis. The result is a dynamic
output signal equal to the convolution of the input signal and the convolution pulses.
Syntax
INSHAPEON Axis_Index, T_array, A_array
Arguments
Return Value
None
Comments
Vectors T_array and A_array define characteristics of the convolution pulses. The array sizes should
be identical.
Vector T_array contains real numbers, so fractional numbers may be specified. However, the
position of each pulse is rounded to a multiple of the controller cycle. If the controller cycle is one
millisecond, the numbers in T_array are rounded to integers. The elements of T_array must be
arranged in ascending order.
The sum of A_array entries must equal 1.
See the Using the Convolve Web Site chapter in the ACSPL+ Programmers Guide to get the
explanation how to calculate the T_array and A_array parameters
Examples
enable 0
InShapeOn 0, CnvT, CnvA
ptp/e 0,0
ptp/e 0,50
till ^MST(0).#MOVE
InShapeOff 0
stop
!In this case we need to multiply CnvT array by CTIME. Here CTIME = 0.5
global real CnvT(5), CnvA(5), CnvB(420)
CnvT(0)=0*CTIME; CnvT(1)=1*CTIME ; CnvT(2)=214*CTIME ;CnvT(3)=253*CTIME;
CnvT(4)=501*CTIME
CnvA(0)=22960/1e5; CnvA(1)=10361/1e5; CnvA(2)=3186/1e5; CnvA
(3)=45767/1e5;
CnvA(4)=17726/1e5
enable 0
InShapeOn 0, CnvT, CnvA
ptp/e 0,0
ptp/e 0,30
till ^MST(0).#MOVE
!InShapeOff 0
stop
8.13.2 INSHAPEOFF
Description
The INSHAPEOFF function stops Input Shape algorithm for specified axis
Syntax
INSHAPEOFF Axis_Index
Arguments
Return Value
None
8.13.3 AST
The #INSHAPE bit is set to 1 after calling INSHAPEON. The bit is set to zero after calling INSHAPEOFF.
Description
AST is an integer array, with one element for each axis in the system, the elements of which contain
a set of bits used for displaying the current axis state.
Syntax
[command] AST(axis_index).bit_designator
Arguments
Designates the specific axis, valid numbers are: 0, 1, 2, ... up to the number
axis_index
of axes in the system minus 1.
0: modulation is off
#LCMODUL 22
1: modulation is active
0: hold is off
#HOLD 24
1: hold is in progress
Tag
7
Accessibility
Read-Only
Related ACSPL+ Commands
MASTER, SLAVE
Related ACSPL+ Variables
MST
COM Library Methods and .NET Library Methods
ReadVariable, GetAxisState
C Library Functions
acsc_ReadInteger, acsc_GetAxisState
8.13.4 APOSFILT
Description
APOSFILT is real array with one element for each axis in the system. The array elements store the
current desired motor position, including the filtering operation result, such as input shaping.
APOSFILT updates on every controller cycle according to the filtering algorithm. When
the filtering algorithm is not configured, APOSFILT = APOS.
TAG
368
ACCESSIBILITY
Read-Only
RELATED ACSPL+ COMMANDS
All motion commands
RELATED ACSPL+ VARIABLES
FPOS, RPOS, APOS,
.NET LIBRARY METHODS
ReadVariable(), WriteVariable()
C LIBRARY FUNCTIONS
acsc_ReadReal(), acsc_WriteReal()
Use the name and password that you received from ACS Motion Control along with the
controller.
The first time you log into the web site, you will be required to review the licensing agreement for
use of the site. For each subsequent log-in you will be reminded of the licensing agreement and
remaining number of trials until expiration of the account will be displayed.
> Constraint - Set to Digital Positive Mixed Constr.. This gives you the maximum freedom for
selecting other design parameters.
> Output Format - Set to Standard Format.
> Axis - Set the required axis
> Frequency or DeltaT - Set DeltaT value according to the controller parameter CTIME (Cycle
Time). CTIME defines the controller cycle in milliseconds, and DeltaT should be defined in
seconds; therefore, if CTIME=1, set DeltaT=0.001. Frequency is automatically computed.
> Amplitude Sum - Set = 100000
> Measured Frequency and Damping entries - Enter from one up to six vibration frequencies
and the associated damping for each frequency. The vibration frequencies are modeled as
second order systems, which are normally characterized by a natural frequency and
damping ratio (or zeta).
The damped natural frequency will be less than the natural frequency by the factor,
The frequencies are referred to as “measured frequencies” because the program performs
the calculations to convert them to “undamped natural frequencies”.
> Hardware ID, Location, Tooling ID and Notes - optional fields that can be used to document
a configuration for a specific machine. Text entered into these fields is copied into the
output file as a comment.
> Robust check box - should normally be selected to design a “robust” Input Shaper™ for a
range of ±15% of the nominal frequency. This box can be left unchecked when the range of
frequency variation is less than ±5%. Non-robust Input Shapers™ are 50% shorter in
duration than a robust Input Shapers™. Please refer to the discussion on Insensitivity
Curves below for more information.
When all of the data has been entered, press the Calculate to start the calculation. It can take
several seconds to complete the calculation.
Click Download to access another window that contains the results of the calculation. A sample
output file is shown below for the design of an Input Shaper with the following parameters:
> Measured Vibration Frequency - 100 Hz
> Damping - 0.05
> Delta T for trajectory generation - 0.001 second
> Amplitude sum - 100000
> Robust was selected - (Constraint = 1)
This is an illustration of the output.
The output from the calculation is five impulses that characterize the Input Shaper™. The delays are
specified in terms of digital time steps and for Delta T =.001 second, the delays would be at 0, 0.002,
0.005, 0.007 and 0.011 seconds.
The reported Time values should be used in the T argument of the inshape function. The reported
Amp values are multiplied by 100000. The following example shows how the inshape arguments
should be initialized to use the reported values:
The results from the calculation can be saved directly by using the web browser file GUI File gSave
as …. Save the results as a text file (*.txt), so Input Shaper™ coefficients can be downloaded into a
controller. The same file will sent by email to the email account specified when the account was
created.
Click the Curve option (shown above) to display the useful frequency range for the Input Shaper™. A
new window, opens to display the Insensitivity Curve. This plot is the Insensitivity Curve for the
example:
The Insensitivity Curve displays the theoretical amount of residual vibration that results after
applying the Input Shaper™ to the system. The horizontal axis is the vibration frequency of the
system and the vertical axis is the percentage of remaining or residual vibration. When the residual
vibration = 0, for a perfect linear system, there should be no vibration after applying the Input
Shaper™. In the case shown above, the residual vibration should be 0 at a frequency of 100 Hz,
which was the design frequency.
If the frequency of the actual system is not equal to 100 Hz, there will be residual vibration present.
This level of vibration is expressed on a percentage basis. If the residual vibration equals 100%, then
the no vibration reduction has occurred. For the Input Shaper™ shown above, the system vibration
frequency could vary between 85 to 115 Hz and the residual vibration should be less than 5% (or
when compared to the case of not using the Input Shaper™, the vibrations should be reduced by
95%).
Vibration reduction is expressed for a “perfect” linear system. There are some examples
of perfect, linear systems in the real world that do achieve close to 100% cancellation.
One good example of a “perfect” system is a simulation. Input Shaping usually performs
very well in simulation. However for most physical systems, the vibration reduction will
usually be in the range of 95 to 98% of the original vibrations.
The frequency range for the Insensitivity Curve can be changed by selecting new minimum and
maximum frequency values and then clicking New Curve. The damping ratio can also be changed to
determine the effect of changes in the estimated damping of the system. In general, changes in
damping in the range from 0.005 to 0.1 have a limited effect on the Insensitivity Curve. When the
system damping ratio is greater than 0.1, the effectiveness of the Input Shaper™ will be improved
by specifying a damping ratio that is close to that of the actual system.
The Insensitivity Curve can also be used to examine the effect of selecting whether or not an Input
Shaper™ should be designed using the Robust selection. If Robust is not selected for a particular
frequency, the useful range of the Input Shaper™ will be reduced. For example the Insensitivity
Curve for the same Input Shaper™ without Robust is:
In this case, the frequency range for 95% cancellation of the vibration is much smaller, 95 to 105Hz.
However the benefit is that the duration of the Input Shaper™ will be 50% less.
It is possible to use non-robust setting to design an Input Shaper™ that will be effective over a
wider range of frequencies. Two frequencies can be specified to create a frequency band for
vibration cancellation.
The most common use of the algorithm is to improve the settling of systems mounted on passive
isolation platforms. Passive isolation is typically used to isolate systems from disturbances
transmitted from the floor. They employ a seismic mass supported on a soft spring made of rubber,
metal, or air. The spring’s damping action absorbs vibrations above the spring’s resonance. For this
reason, passive isolation manufacturers usually try to lower spring resonant frequency to increase
the effective isolation range. When a servo force is applied to generate motion, it also acts on the
isolated stationary base, causing it to vibrate. Because the frequency is low (usually below 1 Hz, to 10
Hz) and damping is very light, the isolation system continues vibrating long after the motion profile
has ended. This vibration acts as disturbance to the servo system, introduces position error, and
extends the settling time.
The Disturbance Rejection algorithm is used to minimize the latter effect and improve the position
error during settling. The green graph shows the velocity command (in [mm/sec]) of a linear stage
mounted on passive isolation, with a resonant frequency of approximately 5 Hz. The red graph
shows the position error with a standard PIV algorithm. The 5Hz disturbance is clearly observed
during settling. The disturbance is relatively small (less than 1 micron), yet it may be critical if the
required settling window is very small (as an example, the resolution of semiconductor instruments
is approaching and in some cases going below 1nm). This disturbance can be minimized by
increasing the PIV gains (SLVKP, SLVKI, SLPKP - see SPiiPlus ACSPL+ Command and Variable
Reference Guide), yet it cannot necessarily be eliminated and if the values of the PIV gains are too
high this may lead to marginal stability. A better solution is using the DRA algorithm. As it can be
seen in the blue graph the disturbance is fully eliminated.
If tuned properly the algorithm has minimal effect on the servo stability margins.
DRA is usually not very effective if the vibration frequency is relatively high (>10Hz), or
the system bandwidth is very low.
Excessive values of SLRA, and SLDRX may cause servo instability, ringing and increased standstill
jitter. In such cases the parameters should be significantly reduced. With good settings, you should
usually be able to double the parameters without getting instability.
Velocity error (1 division = 0.02 mm/sec) during settling process of a linear axis. The maximal value
of the periodical error is used to determine the SLDRX parameter.
The Bi-Quad filter is the most general 2nd order filter. It has two poles and two zeros. It can be
thought of as a high-pass filter in series with a low-pass filter. The transfer function of the Bi-Quad
filter is as follows:
Where:
> ωN and ωD are the numerator (high-pass filter zero) and denominator (low-pass filter pole)
frequencies, respectively.
> ζN and ζD are the numerator and denominator damping ratios, respectively.
The Bi-Quad filter can be used to compensate mechanical resonances, improve stability margins and
system bandwidth.
The Bi-Quad filter can be configured as an additional Notch using the following formulas:
> Set the numerator and denominator frequencies equal to the Notch frequency in[Hz]:
>
> Set the numerator damping ratio equal to half the ratio between the Notch width and
Notch frequency:
>
Maximal recommended ratio between width and frequency= 1/3.
> Set the denominator damping ratio equal the numerator damping ratio times the Notch
attenuation (in absolute value):
>
Below there are several examples that demonstrate the generality of the Bi-Quad filter.
SLVB0NF = SLVB0DF
SLVB0ND < SLVB0DD
All bits (except #INSYNC in some cases) should be true for proper bus functioning, for
monitoring the bus state, checking the #OP bit is sufficient. Any bus error will reset the
#OP bit.
9.2.1.2 ECERR
Any EtherCAT error sets ECST.#OP to false and the error code is latched in the ECERR variable. The
only way to reset the error state and to clear the ECERR value is by calling ECRESTART function.
The EtherCAT error codes are:
Table 9-2. EtherCAT Error Codes
9.2.1.3 #ETHERCAT
The #ETHERCAT command is available for gaining complete information about the connected
EtherCAT slaves: The command is entered through the SPiiPlus MMI Application Studio
Communication Terminal. The command provides the following:
> Slave number
> Vendor ID
> Product ID
> Revision
Internal EtherCAT offset (in bytes or bits) of network variable (which can be
seen by running the #ETHERCAT command).
OFFSET
> No suffix: EtherCAT offset in bytes
> "/b" suffix: the offset is in bits
Comments:
Once the function is called successfully, the Firmware copies the value of the network input variable
at the corresponding EtherCAT offset into the ACSPL+ variable, every controller cycle.
There is no restriction on number of mapped network variables.
The mapping is allowed only when stack is operational, that is, ECST.#OP is true.
In the event of incorrect parameters or stack state, the function will produce the corresponding
runtime error.
9.3.1.2 ECOUT
Description:
The ECOUT function is used for mapping output variables to the EtherCAT network.
Syntax:
ECOUT[/B](int offset, Varname)
Arguments:
Internal EtherCAT offset (in bits or bytes) of network variable (which can be
seen by running the #ETHERCAT command).
OFFSET
> No suffix: EtherCAT offset in bytes
> "/b" suffix: the offset is in bits
It’s recommended to use the ECGETOFFSET function to retrieve the offset, in bytes or in
bits.
It’s possible to use combine the “/r suffix with the “/b” suffix.The syntax is as following:
Comments:
The Firmware copies the value of ACSPL+ variable into the network output variable at the
corresponding EtherCAT offset, every controller cycle.
There is no restriction on number of mapped network variables.
The mapping is allowed only when stack is operational, that is, ECST.#OP is true.
In the event of incorrect parameters or stack state, the function will produce the corresponding
runtime error.
9.3.1.3 ECUNMAP
Description:
The ECUNMAP is used for resetting all previous mapping defined by ECIN and ECOUT.
Syntax:
ECUNMAP
Comments:
The function call is legal only when stack is operational, that is, ECST.#OP is true.
9.3.1.4 ECCLRREG
Description
ESC Error Counters Registers Clear. The ECCLRREG function clears the contents of the error counters
registers.
Syntax
void ECCLRREG(index,offset)
Arguments
Return Value
None
Comments
When the Offset value is -1, all error counters in all slaves are cleared. Otherwise, only the specific
register at the specified Offset is cleared.
After executing the ECCLRRG function, we recommend to execute the FCLEAR function without
parameters before running ECGETREG.
Example
Run the following code example in a Program Buffer.
ECCLRREG(0,0x310)
FCLEAR
STOP
You can also enter this code in the SPiiPlus MMI Application Studio Connection Terminal:
ECCLRREG(0,-1).
9.3.1.5 ECGETREG
Description
ESC Error Counters Registers (Beckhoff Memory). The ESCs have numerous error counters that help
you detect and locate errors. The ECGETREG function enables you to view the contents of these
registers.
Syntax
int ECGETREG(index,offset)
Arguments
Return Value
None
Comments
The fsupported error counter registers are:
Table 9-3. Supported Error Counter Registers
Forwarded RX Error
0x309
Counter
Forwarded RX Error
0x30A
Counter (CRC C/D)
Forwarded RX Error
0x30B
Counter
ECAT Processing Unit Invalid frame passing the EtherCAT Processing Unit
0x30C
Error Counter (additional checks by processing unit).
Example
Run the following code example in a Program Buffer.
I0=ECGETREG(0,0x310)
STOP
You can also enter this code in the SPiiPlus MMI Application Studio Connection Terminal:
?ECGETREG(0,0x310)
.
9.3.1.6 ECGETSLAVES
Description
This function is used to retrieve the number of slaves in an EtherCAT network.
Syntax
ECGETSLAVES
Arguments
None
Return Value
Number of EtherCAT slaves in the network.
Comments
If a slave was added or removed, the ECRESCAN command should be used before using
ECGETSLAVES again.
9.3.1.7 ECUNMAPIN
Description
This function is used to reset all previous mapping defined by ECIN to a specfic offset.
Syntax
ECUNMAPIN(ECOffset)
Arguments
ECOffset An integer providing the offset to which a variable was mapped using ECIN.
Return Value
None
Comments
The mapping is allowed only when stack is operational.
Example
Given the previous execution of ECIN(48,I0), ECUNMAPIN(48) will unmap only I0.
9.3.1.8 ECUNMAPOUT
Description
This function is used to reset all previous mapping defined by ECOUT to a specfic offset.
Syntax
ECUNMAPOUT(ECOffset)
Arguments
Return Value
None
Example
Assuming previous execution of ECOUT(48,I0) and ECOUT(50,I1), executing ECUNMAPOUT(48) will
unmap only I0.
The #ETHERCAT command can be used to check if a slave has Mailbox support.
9.3.2.1 COEWRITE
Description:
The COEWRITE function is used to write a value into a given slave.
Syntax:
COEWRITE[/size] (int slave,int Index,int Subindex,real Value)
Arguments:
Comments:
In case of wrong parameters, the corresponding runtime error will be generated. The function
cannot be used in the SPiiPlus MMI Application Studio Communication Terminal. The function delays
the buffer execution on its line until it is successful or fails the whole buffer with timeout or other
error.
This function with the “/d” suffix provides the capability of reading a double type (64 bit).
9.3.2.2 COEREAD
Description:
The COEREAD function is used to read a value from a given slave.
Syntax:
real COEREAD[/size] (int slave,int Index,int Subindex)
Arguments:
Comments:
The function returns the received value or fails with runtime error.
In case of wrong parameters, the corresponding runtime error will be generated. The function
cannot be used in the SPiiPlus MMI Application Studio Communication Terminal. The function delays
the buffer execution on its line until it is successful or fails the whole buffer with timeout or other
error.
This function with the “/d” suffix provides the capability of reading a double type (64 bit).
EtherCAT codes
7000 - Stored in the ECALERR variable, and a value "0" indicates
based on AL
7999 no error.
Status codes
VEL(0) = 1000
FPOS(0) = 0
Motor 0(X): enabled, idle, in positionAxis 0(X): motion was killed by user
Motor 13(Axis13): enabled, idle, in positionMotor 13(Axis13): motion failed, reason 5011
If a motor is disabled or a motion is killed due to a fault, the controller stores the reason in the
corresponding element of the MERR (Motor Error) variable.
You can also specify a termination code for commands KILL, KILLALL, DISABLE or DISABLEALL. If one
of the commands is used with a non-zero reason argument, the specified code is stored in one or
more corresponding elements of MERR as a termination/disable code.
In a case where no error prompt is issued, you must analyze the state of the motor in order to
detect whether the motor was disabled or a motion was killed abnormally. For example:
Motor 2(Z): disabled Disable reason: 5023 - Critical Position ErrorAxis 2(Z): motion was killed
because a motor was disabled
17
Fee 10 11 12 13 14 15 16 18 19 20
0
dba 0 0 0 0 0 0 0 0 0 00
0
ck 00 00 00 00 00 00 00 00 00 0
0
10 10 11 12 13 15 16 17 18 18
Act 19
01 9 9 9 9 0 01 0 0 9
ual 991
2 98 85 81 97 07 3 23 05 93
Erro +1 - - +1 +2
-2 -3 +7 +5 -7 -9
r 2 15 19 3 3
Only the third row is entered to a controller variable and is stored in the flash X_ERROR file. Details of
the calibration routine, which can be implemented using ACSPL+, are not discussed here.
An application that uses the file may provide an initialization routine like this:
The CONNECT function specifies that the reference position be calculated by subtracting the
interpolated error from the desired position so that the actual value will be closer to the desired
value.
WRITE X_CALREAD X_CAL Write to and read from calibration table from the flash memory.
And the X_CALIBR file can also contain a table with non-uniform points.
By using this CONNECT, the value added to desired position changes immediately when the direction
of the motion changes. In many cases such jumps in the desired position are harmful. In this case
the third parameter in the DSIGN function (see SPiiPlus Command & Variable Reference Guide) can be
used to gradually implement the backlash compensation. In the following example the backlash
compensation is introduced by small steps, so that the compensation growth to the entire value by
20 milliseconds:
If the 0 axis executes master-slave motion slaved to some physical value like encoder feedback, the
RVEL value contains noise that can cause undesirable switching of the backlash sign. In this case the
second parameter of the DSIGN function can be used to introduce anti-bouncing effect. In the
following example the backlash compensation changes its sign only if RVEL holds its new sign for
more than 10 milliseconds:
AUTOEXEC:
WRITE CAMTABLEREAD Write to and read from calibration table from the
CAMTABLE,CAMTABLE flash memory.
12.6 Joystick
Assume that a joystick that controls the motion of an X,Y table is connected to analog inputs AIN(0),
AIN(1). The velocity of each coordinate must be proportional to the corresponding analog input.
Analog input lower than 20 counts must be ignored to avoid motion due to analog drift or bias. The
X (axis 0) motion is limited in the range from -500 to 100000 counts. The Y (axis 1) motion is limited
in the range from -500 to 500000 counts.
The following program fragment initializes the joystick motion:
real JK
JK = 10 Joystick factor
The illustration below shows the rotation of the plane from the original (x, y, z) plane to a rotated
(x’’’, y’’’, z’’’) plane.
Where R is the product of the rotation matrices used to shift the plane, represents the vector
coordinates in the rotated plane, and represents the vector coordinates in the initial plane. For
example, rotation about the Z axis can be expressed as: . The three-dimensional
rotation matrix is expressed as the product of all three individual matrices:
This allows the final plane coordinates to be solved for from the initial plane coordinates. To utilize
this rotation on the ACS controller, it is also necessary to solve this equation such that the initial
plane coordinates are solved for using the final plane coordinates, or . In this
With these equations, it is now possible to utilize the SET and CONNECT equations to establish a
rotated plane on the controller. Consider RPOS of the axes to be the axis positions in the initial plane,
and APOS to be the commanded positions in the rotated plane. It is now possible to use the
CONNECT equation to allow the controller to automatically calculate the actuator positions based on
user commanded positions in the rotated plane. See below for an example of how this is done:
Bit Code Encoder 0(X) Encoder 1(Y) Encoder 2(A) Encoder 3(B)
PEG0
010 PEG1 no no
PEG2
PEG1
011 PEG0 no no
PEG2
PEG0
100 PEG1 no no no
PEG2
PEG0
101 no PEG1 no no
PEG2
The Bit Code affects all of the connectors in the row, see Bit Code assignment example.
Table A-2.
Bit Code Encoder 4(Z) Encoder 5(T) Encoder 6(C) Encoder 7(D)
PEG4
010 PEG5 no no
PEG6
PEG5
011 PEG4 no no
PEG6
PEG4
100 PEG5 no no no
PEG6
PEG4
101 no PEG5 no no
PEG6
The Bit Code affects all of the connectors in the row, see Bit Code assignment example.
SPiiPlus CMnt-x/UDMpm-x/UDMpc-x/CMba-x/CMhp-x/CMxa-x/UDMba-x/UDMhp-x/UDMxa-
x/CMhv-x/UDMhv-x/UDMnt-x/UDMpa-x/UDMcb-x Mapping PEG Engines to Encoders (Servo
Processor 0)
Bit Code Encoder 0(X) Encoder 1(Y) Encoder 2(A) Encoder 3(B)
PEG0
010 PEG1 no
PEG22
PEG1
011 PEG0 no
PEG22
PEG0
100 PEG1 no no
PEG22
PEG0
101 no PEG1 no
PEG22
PEG01, 2
110 PEG11, 2
PEG21, 2
PEG01, 2
111 PEG11, 2
PEG21, 2
The Bit Code affects all of the connectors in the row, see Bit Code assignment example.
Bit Code Encoder 0(X) Encoder 1(Y) Encoder 2(A) Encoder 3(B)
001 no PEG0 no no
010 no no PEG0 no
011 no no no PEG01
100 no no no no
101 no no no no
110 no no no no
The Bit Code affects all of the connectors in the row, see Bit Code assignment example.
Table A-5.
Bit Code Encoder 0(X) Encoder 1(Y) Encoder 2(A) Encoder 3(B)
PEG0
010 no no no
PEG1
PEG0
011 no no no
PEG1
Bit Code Encoder 0(X) Encoder 1(Y) Encoder 2(A) Encoder 3(B)
SPiiPlusNT/DC-LT/HP/LD-x General Purpose Outputs Assignment for Use as PEG Pulse Outputs
(Servo Processor 0)
SPiiPlusNT/DC-LT/HP/LD-x General Purpose Outputs Assignment for Use as PEG Pulse Outputs
(Servo Processor 0)
The Bit Code affects the entire row, see Bit Code assignment example.
Table A-7. SPiiPlusNT/DC-LT/HP/LD-x General Purpose Outputs Assignment for Use as PEG Pulse
Outputs (Servo Processor 1)
SPiiPlusNT/DC-LT/HP/LD-x General Purpose Outputs Assignment for Use as PEG Pulse Outputs
(Servo Processor 1)
The Bit Code affects the entire row, see Bit Code assignment example.
Table A-8.
The Bit Code affects the entire row, see Bit Code assignment example.
Table A-9.
00
PEG0
(default)
0..7 01 PEG0
0
02 PEG0
03 PEG0
00 PEG1
01
8..15 PEG1
(default)
1
02 PEG1
03 PEG1
00 PEG2
16..23 01 PEG2
2
02
PEG2
(default)
03 PEG2
00 PEG3
01 PEG3
3 24..31
02 PEG3
03 PEG3
assignpeg 0, 0x03020100
This code configures the default mapping: PEG0 to Encoder0, PEG1 to Encoder 1, PEG2 to Encoder2
and PEG3 to Encoder3.
Bit Code: 111 is used for switching the physical output pins to Fast General Purpose
Outputs, see Bit Code: 111.
OUT_
OUT_ OUT_7X_ OUT_6X_ OUT_5X_
Bit Code 9HSSI0_
8HSSI0_DO STATE2 STATE1 STATE0
CON
Bit Code: 111 is used for switching the physical output pins to Fast General Purpose
Outputs, see Bit Code: 111.
OUT_1 OUT_0
Bit Code
(Y_PEG) (X_PEG)
Encoder X
001 Encoder X Phase B
Phase A
Encoder Y
010 Encoder Y Phase B
Phase A
Bit Code: 111 is used for switching the physical output pins to Fast General Purpose
Outputs, see Bit Code: 111.
OUT_6 OUT_5
Bit Code
(X_STATE1) (X_STATE0)
OUT_6 OUT_5
Bit Code
(X_STATE1) (X_STATE0)
PEG2_
100 Reserved Reserved Reserved Reserved
PULSE
PEG2_ PEG0_
PULSE or PULSE or
101 Reserved Reserved Reserved
PEG1_ PEG2_
PULSE PULSE
PEG0_ PEG0_
PULSE or PULSE or
PEG1_ PEG1_
110 Reserved Reserved Reserved
PULSE or PULSE or
PEG2_ PEG2_
PULSE PULSE
Bit Code: 111 is used for switching the physical output pins to Fast General Purpose
Outputs, see Bit Code: 111.
For Bit Codes 101 and 110, the OUT_0 (X_PEG) and OUT_1 (Y_PEG) mappings are supported
for default PEG pulse polarity only.
Encoder X Encoder X
101 Reserved Reserved Reserved
INDEX INDEX
OUT_1 OUT_0
Bit Code
(X_STATE1) (X_STATE0)
Bit Code: 111 is used for switching the physical output pins to Fast General Purpose
Outputs, see Bit Code: 111.
OUT_0
Bit Code
(X_PEG)
001 Reserved
010 Reserved
011 Reserved
100 Reserved
OUT_0
Bit Code
(X_PEG)
101 Reserved
110 Reserved
111 FGP_OUT0
Bit Code: 111 is used for switching the physical output pins to Fast General Purpose
Outputs, see see Bit Code: 111.
Table A-19. NPMpm-x/NPMpc-x Mapping of Engine Outputs to Physical Outputs (Servo Processor
0)
OUT_1 OUT_0
Bit Code
(Y_PEG) (X_PEG)
0000
0
0(X) 1(Y) 4(Z) 5(T) - - - -
(defa
ult)
0000
1(Y) 4(Z) 5(T) 0(X) - - - -
1
0001
4(Z) 5(T) 0(X) 1(Y) - - - -
0
0010
- 1(Y) 4(Z) 5(T) 0(X) - - -
0
0100
- - 4(Z) 5(T) 0(X) 1(Y) - -
0
1000
- - - - 4(Z) 5(T) 0(X) 1(Y)
0
The Bit Code affects all of the inputs in the row, see Bit code affects.
0000
0 GP GP GP GP
- - - -
(defa IN6 IN7 IN4 IN5
ult)
0000 GP GP GP GP
- - - -
1 IN7 IN4 IN5 IN6
0001 GP GP GP GP
- - - -
0 IN4 IN5 IN6 IN7
GP GP GP GP
00011 - - - -
IN5 IN6 IN7 IN4
0010 GP GP GP GP
- - - -
0 IN7 IN4 IN5 IN6
GP GP GP GP
00101 - - - -
IN6 IN4 IN5 IN7
GP GP GP GP
00110 - - - -
IN6 IN7 IN5 IN4
GP GP GP GP
00111 - - - -
IN6 IN7 IN4 IN5
0100 GP GP GP GP
- - - -
0 IN4 IN5 IN6 IN7
GP GP GP GP
01001 - - - -
IN6 IN7 IN4 IN5
GP GP GP GP
01010 - - - -
IN6 IN7 IN4 IN5
GP GP GP GP
01011 - - - -
IN7 IN6 IN4 IN5
GP GP GP GP
01100 - - - -
IN4 IN6 IN7 IN5
GP GP GP GP
01101 - - - -
IN5 IN6 IN7 IN4
GP GP GP GP
01110 - - - -
IN6 IN7 IN4 IN5
GP GP GP GP
01111 - - - -
IN7 IN4 IN5 IN6
1000 GP GP GP GP
- - - -
0 IN4 IN5 IN6 IN7
GP GP GP GP
10001 - - - -
IN5 IN6 IN7 IN4
Mark-1 and Mark-2 Inputs to Encoders Mapping for with SPiiPlus CMnt-x/UDMpm-x/UDMpc-
x/CMba-x/CMhp-x/CMxa-x/UDMba-x/UDMhp-x/UDMxa-x/CMhv-x/UDMhv-x
Bit
Mar Mar Mar Mar Mar Mar Mar Mar
code
k-1 k-2 k-1 k-2 k-1 k-2 k-1 k-2
Input Input Input Input Input Input Input Input
Mar Mar
GP GP GP GP
010 - k-2 1 k-2 1 -
IN4 IN5 IN6 IN6
(Y) (Y)
GP GP GP GP
011 - - - -
IN7 IN6 IN7 IN7
Byte Code 3 2 1 0
Mark0: 0x00
Mark0: 0x00 Mark0: 0x00 Mark0: 0x00
Mark1: 0x01 (default)
Mark1: 0x01 Mark1: 0x01
Mark2: 0x02 (default) Mark1: 0x01
Value Mark2: 0x02
Mark3: 0x03 (default) Mark2: 0x02 Mark2: 0x02
(default)
Mark3: 0x03 Mark3: 0x03 Mark3: 0x03