Acspl Software Guide Revision 3 00

353
ACSPL SB Motion Controller Programming Language Software Guide Document part no. TM-000SW-00 Document revision no. 3.00

Transcript of Acspl Software Guide Revision 3 00

Page 1: Acspl Software Guide Revision 3 00

ACSPL SB Motion Controller Programming

Language

Software Guide

Document part no. TM-000SW-00 Document revision no. 3.00

Page 2: Acspl Software Guide Revision 3 00

Document revision no. 3.00 (January 2002) Document part no. TM-000SW-00

COPYRIGHT Copyright © 1996 - 2002 ACS-Tech80 Ltd. Changes are periodically made to the information contained in this guide. The changes are published in release notes and will be incorporated into future revisions of this guide. No part of this guide may be reproduced in any form, without permission in writing from ACS-Tech80.

TRADEMARKS ACS-Tech80 and PEG are trademarks of ACS-Tech80 Ltd. Microsoft, Visual Basic, and Windows are registered trademarks of Microsoft Corp. The names of actual companies and products mentioned herein may be the trademarks of their respective owners.

Website: http://www.acs-tech80.com/ E-mail: [email protected] [email protected]

ACS-Tech80 Inc. 7351 Kirkwood Lane North, Suite 130 Maple Grove, MN 55369 USA Tel: (1) (763) 493-4080 (800-545-2980 in USA) Fax: (1) (763) 493-4089

ACS-Tech80 BV Antonie van Leeuwenhoekstraat 18 3261 LT Oud-Beijerland THE NETHERLANDS Tel: (31) (186) 623518 Fax: (31) (186) 624462

ACS-Tech80 Ltd. Ramat Gabriel Industrial Park POB 5668 Migdal Ha'Emek, 10500 ISRAEL Tel: (972) (4) 6546440 Fax: (972) (4) 6546443

NOTICE Information deemed to be correct at time of publishing. ACS-Tech80 reserves the right to change specifications without notice. ACS-Tech80 is not responsible for incidental, consequential, or special damages of any kind in connection with this document.

Refer connection, installation, maintenance, adjustment, servicing, and

operation to qualified personnel.

Page 3: Acspl Software Guide Revision 3 00

Changes to this Guide

Ver. Date Section Change ECR

2.0 Mar/00 3.3.7 Array of Variables Size: 100, Data Range: ±(231-1)

2.0 Mar/00 3.3.7 Array of Grid delta data range: 1 - 106

2.0 Mar/00 3.4.5 Not (logical operator) example changed to till ^X_MOVE

2.0 Mar/00 3.3.7 V array range: V0 - V99

2.0 Mar/00 6.17.2 disp <string variable>: As of firmware version 19d - displays actual string and not string's numerical value.

2.0 Mar/00 3.4.1 Till <condition>: Condition can be a mathematical, relational, or state condition or a logical combination of two conditions.

2.0 Mar/00 3.4.1 Description of background tasks suspended during "disabled" state updated.

2.0 Mar/00 3.4.18 F8 key definition corrected to 0, 66.

2.0 Mar/00 6.6.8 Tell servo response: In the DSP Status example (ST), the bit order for each DSP has been corrected: (i.e., ABCD instead of DCBA).

2.0 Mar/00 7.2 Acceleration Feed forward (AF) range updated to: 0 - 32767.

2.0 Mar/00 7.2 Array Offset (AO) range in Programming mode updated to : ±(231-1)

2.0 Mar/00 7.2 Baud Rate (BR) range updated to: 300, 1200, 2400, 4800, 9600, 19200, 38400, 57600

2.0 Mar/00 7.2 Begin Velocity (BV) range updated to: 0 - 128,000,000

2.0 Mar/00 7.2 Commutation Offset (CO) deleted.

2.0 Mar/00 7.2 Time Interval Factor (IF) range updated to: 0 - 250.

2.0 Mar/00 7.2 Linear Acceleration (LA) range updated to: 1,000 - 2,000,000,000

2.0 Mar/00 7.2 Linear Velocity (LV) range updated to: ±128,000,000

2.0 Mar/00 7.2 Target Radius (TR) range updated to: 1 - 32,000

2.10 Oct./00 ALL RELEASE NOTES SINCE PUBLICATION OF FIRST EDITION (1996) INTEGRATED INTO GUIDE. Many parts of the guide have been rewritten to reflect new developments and in response to user requests.

2.10 Oct./00 1.2 General explanation of product-dependencies expanded.

2.10 Oct./00 7.1.9 Detailed list of product-dependent parameter properties added. List is in alphabetical order.

2.10 Oct./00 3.4.16 Description of new automatic routine, AUTO_SYS, added.

2.10 Oct./00 3.4.5 Description of new arithmetic operator, modulo, added.

2.10 Oct./00 5.11.1 Description of automatic commutation setup added.

Page 4: Acspl Software Guide Revision 3 00

Ver. Date Section Change ECR

2.10 Oct./00 3.3.11, 5.12.1, 6.15

Description of arbitrary path with automatic cyclic buffering added.

2.10 Oct./00 7.3.4 Description of error ?18 ("No empty space in the cyclic buffer.") added.

2.10 Oct./00 5.5.4 Description of fast response reporting for selected parameters added.

2.10 Oct./00 6.17.3 Description of enhanced handling of Begin/End messages added.

2.10 Oct./00 7.3.4 Descriptions of error messages?04 ("Character overflow in message") and ?05 ("Frame error in character") added.

2.10 Oct./00 7.2 Reference for free segments (FS) parameter added.

2.10 Oct./00 7.2 Reference for next segment (NS) parameter added.

2.10 Oct./00 7.2 Reference for last system error (LS) parameter added.

2.10 Oct./00 7.2 Reference for transmission number (TA) parameter added.

2.10 Oct./00 7.2 Reference for limit wait time (LW) parameter added.

2.10 Oct./00 7.2 Reference for position error (PE) parameter: servo section updated for GA=0.

2.10 Oct./00 7.2 Range of target radius (TR) parameter updated to [1. .32000].

2.10 Oct./00 7.2 Reference for acknowledge number (AK) parameter added.

2.10 Oct./00 7.3.5 List of last system error (LS) codes added.

2.10 Oct./00 7.4 List of PC Keyboard Special (Extended-ASCII) Codes added.

2.10 Oct./00 5.2 Description of searching for index expanded and updated.

2.10 Oct./00 6.17.2 Description of lost message protection updated for disp command.

2.10 Oct./00 4.10.2 Description of electronic cam updated.

2.10 Oct./00 7.2 Range of interval factor (IF) parameter updated to [1 . .250].

2.10 Oct./00 7.2 Range of path generation (PG) updated to 12 bits.

2.10 Oct./00 3.3.3 Description of setting master commands updated for parameters that can be set with bit masking.

2.10 Oct./00 3.4.10, 5.14

Description of how to program the 7-segment display (not all controllers) added. Includes new statement: show, and new parameters: sf and sd.

2.10 Oct./00 3.4.18 Description of new operator-controller statements added: inkey, echo, noecho.

2.10 Oct./00 4.8 Description of improvements to motion mode 12 (master-slave) added.

2.10 Oct./00 5.16.1 Description of motion mode 17 (ultra-fast path generation) added. This mode is only supported in products with FIFO214.

2.10 Oct./00 5.16.2 Description of gantry axis support added. This feature is only available in specially modified versions of SB214PC.

Page 5: Acspl Software Guide Revision 3 00

Ver. Date Section Change ECR

2.10 Oct./00 5.6 Description of limited data collection at a rate of 20 kHz added. This feature is not supported in all products - consult factory.

2.10 Oct./00 7.2 Reference for AF BV KD LA la LD ld LV SV TL VA VD VK VM VV FN FT ED ID IL ET DU DL parameter updated.

2.10 Oct./00 5.4 Description of registration mark movement updated.

2.10 Oct./00 3.1.2 Description of waking the controller updated - now up to 16 controllers per serial link.

2.10 Oct./00 4.1.2 Parabolic profile is no longer a standard feature. If this feature is desired, a special firmware version must be ordered from the factory.

2.10 Oct./00 3.4.17 Description of new variables, Mask and Pend, for controlling automatic subroutine activation - added.

2.10 Oct./00 7.2 Reference for tb ao TS parameter added.

2.10 Oct./00 5.5.2 Description of real time data collection updated.

2.10 Oct./00 4.5 Motion mode 8 not supported in the SB14.

2.10 Oct./00 4.6 Motion mode 9 not supported in the SB14.

2.10 Oct./00 7.2 Reference for sf sd parameter added (7-segment products only).

2.10 Oct./00 5.10.1 Example updated.

2.10 Oct./00 4.11 Description of motion mode 21 updated.

2.10 Oct./00 3.4.6 Description of array variables updated.

2.10 Oct./00 Product coverage expanded to include: SB10xx, SB11xx, SB12xx, SB13xx, Unilitex (SB601/2), SB214xx, SB14, SB116 (includes SB104), and DCL1000.

2.11 Nov./00 2 Changed operation mode names from Direct Mode to Direct Operation and Programming Mode to Programmed Operation.

2.11 Nov./00 3.4 Expanded introduction to Programmed Operation, including clarification of use of ACS Debugger, explanation of compilation, and instructions for speeding up program execution.

2.11 Nov./00 4.12 Hardware limits explanation for MM22 added.

2.11 Nov./00 4.11 Software limits explanation for MM21 added.

2.11 Nov./00 4.6 Explanation of VO added to MM9 description. Also drawing of MM9 updated.

2.12 Dec./00 3.1 Expanded explanation of serial communications added.

2.12 Dec./00 5.7 PEG explanation updated.

2.12 Dec./00 3.4.16 AUTOEXEC description updated.

2.12 Dec./00 3.4.18 In the function keys section, a description of issues that can arise when using the ACS Debugger terminal window or another terminal application was added.

Page 6: Acspl Software Guide Revision 3 00

Ver. Date Section Change ECR

2.12 Dec./00 4.1, 4.2, 4.3, 4.4, 4.5

Updated descriptions of motion modes 0, 1, 3, 4, 8

2.12 Dec./00 7.2 Reference for IN parameter updated.

2.13 Jan./01 3.3.4 Description of formats of responses to Report commands updated.

2.13 Jan./01 3.4.4 Guidelines for label usage updated.

2.13 Jan./01 5.5.1 Description of analog I/O channel data collection updated.

2.13 Jan./01 3.3.1 Description of use of parameters as subcommands updated.

2.13 Jan./01 4.11 Description of MM21 updated.

2.13 Jan./01 3.3.8 Description of Begin on Input updated for coordinated move.

2.13 Jan./01 4.3 Description of motion mode 3 updated for coordinated move.

2.14 Jan./01 3.4.3 Discussion of execute by label vs. execute by line number updated.

2.14 Jan./01 6.17 Description of host protocol safeguards for noisy environment updated.

2.14 Jan./01 7.1 Tables of Set and Report parameters updated.

2.14 Jan./01 Changed term "ACSPL states" to "state variables"

2.14 Jan./01 4.8 Description of Master-Slave motion (MM12) updated.

2.15 Feb./01 5.5.2 Description of data collection operation updated.

2.15 Feb./01 4.10.1 Description of arbitrary path generation (MM16) updated.

2.15 Feb./01 4.10.2 Description of cam operation (MM16) updated.

2.15 Feb./01 5.12.2 Description of safety limits updated.

2.15 Feb./01 5.15 Description of gantry implementation added.

2.15 Feb./01 5.11.2 Description and example of hardware commutation using encoder + hall feedback added.

2.15 Feb./01 3.1 Description of serial communications, particularly waking the controller and multiple drop connection, expanded.

3.00 Dec/01 Cover Cover page and contact information updated. Linked images embedded.

3.00 Dec/01 3.4.7 $_HOT Reflects safety inputs handled by the application only. Must be specifically processed by ACSPL program.

Ltd13

3.00 Dec/01 3.4.16.16 AUTO_HT$ definition updated Ltd13

3.00 Dec/01 3.4.17 Auto routine MASK description updated (1 changed to 0)

3.00 Dec/01 3.4.13 Due to internal format of this statement, only variables V0...V29 can be used in string to variable conversion.

Ltd15

3.00 Dec/01 3.4.13 As of firmware V19d, disp <string variable> displays the string. Prior to that version, it displayed the string's numerical value.

3.00 Dec/01 All Remove Path-Velocity mode.

Page 7: Acspl Software Guide Revision 3 00

Ver. Date Section Change ECR

3.00 Dec/01 7.2 AO/ao range in programming mode: Program mode: ±(231-1) updated

3.00 Dec/01 7.2 BR Since version 19f, if upon power up baud rate has some other value, it gets 9600. If any other value is attempted to be set via Set command, error 21 is reported and present value stays unchanged.

3.00 Dec/01 2 New chapter added that describes updates to Hardware, Software, and Firmware. This will make finding Release Note information easier.

3.00 Dec/01 7.2, 3.2.1 Note added regarding HP and HT parameters.

Page 8: Acspl Software Guide Revision 3 00

CONTENTS I

ACSPL Software Guide - Document revision no. 3.00

CONTENTS

FIGURES

1. INTRODUCTION 1-1

1.1. Related ACS-Tech80 Software Utilities and Libraries 1-1

1.2. General and Product-Dependent Syntax 1-2

1.3. Guide Overview 1-3

1.4. Conventions Used in this Guide 1-3

2. PRODUCT UPDATES 2-1

2.1. Firmware Bug Corrections 2-1 2.1.1. Corrections Made in Version 19d 2-1 2.1.2. Corrections Made in Version 19e 2-1 2.1.3. Corrections Made in Version 19j 2-1 2.1.4. Corrections Made in Version 19m 2-2

2.2. Work Around Procedures 2-2 2.2.1. SI (Safety Inputs) Parameters 2-2

3. PROGRAMMING THE CONTROLLER WITH ACSPL 3-1

3.1. Setting Up Serial Communication 3-1 3.1.1. Mode Of Operation 3-2 3.1.2. Waking the Controller 3-2

Page 9: Acspl Software Guide Revision 3 00

I I CONTENTS

ACSPL Software Guide - Document revision no. 3.00

3.1.3. Displaying Your Typed Input 3-5 3.1.4. Changing the Baud Rate 3-6

3.2. Basics of Operation and Communication 3-6 3.2.1. Overview of Communication Protocols 3-6

3.3. Direct Mode Operation 3-7 3.3.1. Command Syntax 3-9 3.3.2. Typing a Command Line 3-9 3.3.3. Set Master Command 3-10 3.3.4. Report Master Command 3-11 3.3.5. Group Master Command 3-14 3.3.6. Tell Master Commands 3-16 3.3.7. Array Master Command 3-23 3.3.8. Motion Execution Master Commands 3-27 3.3.9. Wake Master Command. 3-31 3.3.10. Acknowledge Message Master Command 3-32 3.3.11. Automatic Cyclical Buffering Commands 3-32 3.3.12. Memory Management Master Commands 3-33 3.3.13. More Examples 3-35

3.4. Program Mode Operation 3-36 3.4.1. Understanding ACSPL Programming 3-37 3.4.2. Getting Started 3-39 3.4.3. Editing Commands 3-41 3.4.4. Program Structure 3-45 3.4.5. Operators 3-47 3.4.6. Variables 3-48 3.4.7. State Variables 3-54 3.4.8. Assignment Command 3-56 3.4.9. Displaying Messages 3-58 3.4.10. 7-Segment Programming: "show" Statement 3-59 3.4.11. Including Direct Commands in a Program 3-61 3.4.12. Including Remarks In A Program 3-62 3.4.13. Strings 3-63 3.4.14. Controlling Program Flow 3-64 3.4.15. Timing 3-71 3.4.16. Automatic Subroutines 3-72 3.4.17. Controlling Automatic Subroutine Activation - Mask and Pend 3-78 3.4.18. Operator-Controller Interaction 3-81 3.4.19. Partial Communication Shutdown 3-86 3.4.20. Stepping Through A Program 3-86

Page 10: Acspl Software Guide Revision 3 00

CONTENTS I I I

ACSPL Software Guide - Document revision no. 3.00

4. MODES OF MOTION 4-1

4.1. Mode 0 - Linear Point To Point (PTP) 4-2 4.1.1. Smoothed Trapezoidal Profile 4-2 4.1.2. Parabolic Profile 4-4

4.2. Mode 1 - Repetitive Linear Point To Point 4-5

4.3. Mode 3 - Move By Sequence 4-6

4.4. Mode 4 - Circular Point To Point 4-9

4.5. Mode 8 - Point To Point With Multiple Velocities 4-10 4.5.1. Profile Definition 4-11 4.5.2. Restrictions 4-12

4.6. Mode 9 - Search For Contact 4-12 4.6.1. Method Of Operation 4-12

4.7. Mode 10 - Jogging (Continuous Velocity) 4-14

4.8. Mode 12 - Master-Slave 4-15 4.8.1. Method Of Operation 4-21 4.8.2. Superimposed Move 4-21 4.8.3. 'On the Fly' Switching Between Master-Slave Mode and Non-slaved Velocity 4-22 4.8.4. Using Master Index 4-23 4.8.5. Flying Shears Implementation 4-24

4.9. Mode 15 - Continuous Path Following 4-26

4.10. Mode 16 - Arbitrary Path Generation and Electronic Cam 4-28 4.10.1. Arbitrary Path Generation 4-29 4.10.2. Cam 4-42

4.11. Mode 21 - Manual Joystick Mode 4-54 4.11.1. Method of Operation 4-55

4.12. Mode 22 - Position Tracking 4-56

5. ADVANCED FUNCTIONS 5-1

5.1. Accuracy Enhancement Using Error Mapping 5-1 5.1.1. Parameter Definition 5-2 5.1.2. Error Array (AE) For XY 5-3 5.1.3. Error Vector For Z And T Axes 5-4 5.1.4. Method Of Operation 5-4

Page 11: Acspl Software Guide Revision 3 00

IV CONTENTS

ACSPL Software Guide - Document revision no. 3.00

5.2. Searching For Index 5-6 5.2.1. Switching from One Encoder to Another 5-6 5.2.2. Reading Master Index 5-7

5.3. Homing 5-7

5.4. Registration Mark Movement 5-8 5.4.1. Necessary Conditions 5-8 5.4.2. ACSPL Support 5-9 5.4.3. What Happens When a Move Command Fails 5-9

5.5. Real Time Data Collection 5-12 5.5.1. Parameter Definitions 5-12 5.5.2. Method of Operation 5-13 5.5.3. Velocity/Smoothness Measurement 5-16 5.5.4. Fast Response Reporting for Selected Parameters 5-18

5.6. Limited Data Collection at a Rate of 20 kHz 5-19

5.7. Position Event Generator (PEG™) 5-19 5.7.1. Incremental Mode 5-20 5.7.2. Random Mode 5-20 5.7.3. Definition of Parameters 5-21 5.7.4. Method of Operation 5-23 5.7.5. Optimizing Array Usage 5-26

5.8. How To Detect If The Motor Moves Away From Its Target 5-27

5.9. How To Detect If The Tracking Error Limit Is Exceeded 5-28

5.10. Using a Stepper With Encoder Feedback 5-28 5.10.1. Verify Enable (VE) Parameter 5-29

5.11. S/W and H/W Sinusoidal Commutation for AC Synchronous (DC Brushless) Motors 5-30

5.11.1. Software Commutation Using ACS Adjuster 5-30 5.11.2. Hardware Commutation With Encoder + Hall Sensor Feedback (Program Example) 5-32

5.12. Special Input/Output Signals 5-41 5.12.1. Dedicated Output Signals 5-41 5.12.2. Safety Input Signals 5-41

5.13. Arbitrary Path with Automatic Cyclic Buffering 5-43 5.13.1. Detailed Description of Automatic Cyclical Buffer Commands 5-45

5.14. Programming the 7-Segment Display 5-49

Page 12: Acspl Software Guide Revision 3 00

CONTENTS V

ACSPL Software Guide - Document revision no. 3.00

5.14.1. Example Using Operational Error Messages 5-52

5.15. Gantry Implementation 5-54 5.15.1. Starting Procedure 5-55 5.15.2. Limit Behavior 5-55 5.15.3. Homing 5-56 5.15.4. Fault Response 5-56 5.15.5. Tuning 5-57 5.15.6. Gantry Example 5-57

5.16. Special Products 5-60 5.16.1. Motion Mode 17 - Ultra-Fast Path Generation (requires FIFO214) 5-60 5.16.2. Gantry Axis Support (requires modified SB214PC) 5-60

6. COMMUNICATION WITH HOST COMPUTER 6-1

6.1. General 6-2 6.1.1. Data Representation 6-2 6.1.2. Special Characters 6-2 6.1.3. Check-Sum Character 6-2 6.1.4. Notation Conventions 6-2

6.2. The Controller's Prompt 6-3

6.3. The Controller's Error Response 6-3

6.4. SET Commands 6-4

6.5. REPORT Commands 6-5 6.5.1. Responses to the REPORT Command 6-5 6.5.2. Report of Parameters With Bitmapped Information 6-7 6.5.3. Report Of Parameters With True/False Information 6-9

6.6. TELL Commands 6-10 6.6.1. TELL Motors And Motion Status (T0 Command) 6-10 6.6.2. TELL The Result Of Last 'Begin Motion' (T1 Command) 6-12 6.6.3. TELL The Cause Of Motion's End For Each Motor (T2 Command) 6-12 6.6.4. TELL Program Status (T3 Command) 6-13 6.6.6. TELL The Last Program Message (T4 Command) 6-13 6.6.8. TELL Servo Processors Status (T5 Command) 6-14 6.6.9. TELL Firmware Memory Status (T6 Command) 6-14 6.6.10. TELL Voltages Value (T8 Command) 6-15 6.6.11. TELL Controller's Internal Memory State (T9 Command) 6-15

6.7. Array SEt Commands 6-16

Page 13: Acspl Software Guide Revision 3 00

VI CONTENTS

ACSPL Software Guide - Document revision no. 3.00

6.7.1. Responses To The Array Set Command 6-16 6.7.2. Array Setting For Continuous Path Following 6-18 6.7.3. Array Set Of Indices 6-18 6.7.4. Array Set Of Variables 6-19

6.8. Array REport Command 6-19 6.8.1. Response to Array Common REport Command (Continuous Path) 6-20 6.8.2. Array Of Indices 6-21 6.8.3. Array Report Of Variables 6-21

6.9. Group Command 6-22 6.9.1. Responses To The Group Command 6-22

6.10. Begin Motion Command 6-23 6.10.1. Responses To The Begin Motion Command 6-23

6.11. End Motion Command 6-24 6.11.1. Response To The End Motion Command 6-24

6.12. Kill Motion Command 6-25 6.12.1. Response To The Kill Motion Command 6-25

6.13. Move Command 6-25

6.14. Wake Command 6-26 6.14.1. Response To The Wake Command 6-26

6.15. Automatic Cyclical Buffering Commands 6-26 6.15.1. n$<format> 6-26 6.15.2. nC<set of axes><format> 6-27 6.15.3. n 6-27 6.15.4. N$<data . . .data> 6-27

6.16. Using ACSPL Under Host Protocol 6-27 6.16.1. The Form Of The Response To PC Command 6-28 6.16.2. Controller's Transmissions Of DISP Statement In A Running Program 6-28

6.17. Safeguards for Noisy Environment 6-29 6.17.1. Protecting Controller Reception Against Noise 6-29 6.17.2. Protecting Host Against 'Lost' disp Messages 6-29 6.17.3. Synchronizing Begin/End Commands and Messages 6-33

7. REFERENCE 7-1

7.1. Set and Report Parameters 7-1 7.1.1. Motor and Feedback - General 7-1

Page 14: Acspl Software Guide Revision 3 00

CONTENTS VI I

ACSPL Software Guide - Document revision no. 3.00

7.1.2. Servo Control 7-2 7.1.3. Stepper Control 7-2 7.1.4. Commutation 7-3 7.1.5. Profile Generation 7-3 7.1.6. Motor Safety and Controller Integrity 7-6 7.1.7. Special Functions 7-7 7.1.8. System 7-8 7.1.9. Product-Dependent Parameter Properties 7-10

7.2. Set and Report Parameters Dictionary 7-21

7.3. Errors 7–73 7.3.1. Begin Error Messages 7–73 7.3.2. End Error Messages 7–74 7.3.3. Program Errors and Messages 7–74 7.3.4. General Errors 7–76 7.3.5. Last System (LS) Errors 7–78

7.4. PC Keyboard Special (Extended-ASCII) Codes 7–80

INDEX

Page 15: Acspl Software Guide Revision 3 00
Page 16: Acspl Software Guide Revision 3 00

FIGURES ix

ACSPL Software Guide - Document revision no. 3.00

FIGURES

FIGURE 4-1 EFFECT OF SF IN POINT TO POINT MOVE 4-4 FIGURE 4-2 PARABOLIC PROFILE 4-5 FIGURE 4-3 MOVE BY SEQUENCE 4-8 FIGURE 4-4 CIRCULAR POINT TO POINT 4-10 FIGURE 4-5 MULTIPLE VELOCITIES POINT TO POINT 4-11 FIGURE 4-6 SEARCH FOR CONTACT 4-14 FIGURE 4-7 SUPERIMPOSED MOVE ILLUSTRATING USE OF MD 4-22 FIGURE 4-8 FLYING SHEARS MOTION PROFILE 4-26 FIGURE 4-9 CONTINUOUS PATH 4-28 FIGURE 4-10 TWO-DIMENSIONAL PATH APPROXIMATING A CIRCLE 4-34 FIGURE 4-11 GRAPH OF PATH VERSUS TIME FOR X AXIS 4-34 FIGURE 4-12 GRAPH OF VELOCITY VERSUS TIME FOR X AXIS 4-35 FIGURE 4-13 AN ELEVEN-SEGMENT ARBITRARY PATH. 4-36 FIGURE 4-14 ARBITRARY PATH WITH REVERSAL (AND RESUMPTION) 4-38 FIGURE 4-15 COLLECTED PATH OF A (CROSSES ARE SAMPLED POSITIONS) 4-42 FIGURE 4-16 ARBITRARY PATH (MM16), RESULT OF SAMPLING PATH A

(CROSSES ARE ENDPOINTS) 4-42 FIGURE 4-17 CAM OPERATION - MECHANICAL VERSION 4-43 FIGURE 4-18 START OF CAM OPERATION DEPENDING ON MASTER LOCATION4-49 FIGURE 4-19 CAM - NON CYCLIC MODE 4-50 FIGURE 4-20 CAM - CYCLIC MODE 4-51 FIGURE 4-21 JOYSTICK METHOD OF OPERATION FA1=0 4-55 FIGURE 4-22 JOYSTICK METHOD OF OPERATION FA1=1 4-55

Page 17: Acspl Software Guide Revision 3 00

x FIGURES

ACSPL Software Guide - Document revision no. 3.00

FIGURE 5-1 ERROR MAPPING ALGORITHM 5-4 FIGURE 5-2 REGISTRATION MARK MOVE - POSITION PROFILE 5-11 FIGURE 5-3 REGISTRATION MARK MOVE - VELOCITY PROFILE 5-11 FIGURE 5-4 STRUCTURE OF PEG DATA (RANDOM MODE) 5-22 FIGURE 5-5 PEG - INCREMENTAL MODE 5-24 FIGURE 5-6 PEG - RANDOM MODE WITH RELATIVE POSITIONING 5-26 FIGURE 5-7 STRUCTURE OF PEG DATA WITH (LEFT) AND WITHOUT (RIGHT)

OPTIMIZATION 5-27 FIGURE 5-8 MAGNETIC PITCH 5-31 FIGURE 5-9 HARDWARE COMMUTATION PROGRAM FLOW 5-33 FIGURE 5-10 DRIVE FAULT DETECTION CIRCUIT 5-43 FIGURE 5-11 7-SEGMENT DISPLAY 5-49 FIGURE 5-12 GANTRY APPLICATION EXAMPLE 5-55

Page 18: Acspl Software Guide Revision 3 00

INTRODUCTION 1-1

ACSPL Software Guide - Document revision no. 3.00

1. INTRODUCTION

Your ACS-Tech80 control product comes with two guides.

Software Guide (this book) Describes ACSPL: the complete set of commands and options for the ACS-Tech80 line of controllers and how to use them to write motion control applications. Some information described here is hardware dependent and may not be supported by your controller model (for example, single axis controllers will not support features applying for multi-axis controllers).

Hardware and Setup Guide Tells you how to get your ACS-Tech80 motion control product up and running. It provides detailed specifications, as well as mounting, wiring, and tuning information.

1.1. Related ACS-Tech80 Software Utilities and Libraries

ACS Tools ACS Software Tools are a set of Windows utilities provided with your control product. • ACS Adjuster for setting up and tuning your ACS-Tech80 control

product.

• ACS Debugger for programming your ACS-Tech80 control product.

• ACS Saver and ACS Loader for downloading the setup and program data from one control product's memory and uploading the data to another unit.

Page 19: Acspl Software Guide Revision 3 00

1-2 INTRODUCTION

ACSPL Software Guide - Document revision no. 3.00

ACSLIB Libraries (Option) ACSLIB, which is available for purchase separately, is a set of comprehensive C, C++, and Visual Basic® libraries for host applications running in DOS, Windows 3.11/95/98/NT or Linux. Full, multithreading support.

1.2. General and Product-Dependent Syntax This guide contains general ACSPL information that applies for the following ACS-Tech80 product models: SB10xx series of universal digital motion control products. SB11xx series of universal digital motion control products. SB12xx, SB13xx series of universal digital motion control products. Unilitex (where x = 1 or 2) series of universal digital motion control products. SB214xx series of multi-axis motion controllers. SB14 universal digital motion control product. SB116 (includes SB104) universal digital motion control products. DCL1000 series of universal digital drives. Products can differ in terms of features and parameter properties, depending on the options ordered, the product hardware, and the product firmware version. To display the product's firmware version in Direct mode (Section 0), enter RVR. Firmware versions are referred to by the final two digits and the letter that follows them. For example, firmware version 32.11-19c would be referred to as V19c. The major product-dependent features of ACSPL, and the products that support them, are listed below.

A comprehensive list of product-dependent parameter properties is listed in Section 7.1.9. See also your product's Hardware and Setup Guide and its Release Notes, if there are any.

Feature See also Comment

7-segment display (option) Section 5.14 Supported only by SB12xx, SB13xx, and SB214SA.

CAN communication (option)

Hardware guide Supported only by Unilitex, SB12xx, SB13xx, and SB214SA.

Dual loop control 1291/91ND/92, 1391, SB214PC2/4 (not all firmware versions)

Parabolic profile Section 4.1.2 No longer standard. Supported only in firmware V17o or earlier. For more information consult factory.

Page 20: Acspl Software Guide Revision 3 00

INTRODUCTION 1-3

ACSPL Software Guide - Document revision no. 3.00

Feature See also Comment

Motion mode 8 (MM8) - Point to Point with Multiple Velocities and Motion mode 9 (MM9) - Search for Contact

Sections 4.5 and 4.6

Supported by all products except SB14.

Motion profile Chapter 4 Not supported by DCL drives. These products support only features related to power amplification.

1.3. Guide Overview • Chapter 2 Product Updates

Describes updates to Hardware, Software, and Firmware. • Chapter 3 PROGRAMMING THE CONTROLLER WITH ACSPL

Describes the ACS-Tech80 programming language (ACSPL). How to operate the controller directly or via compiled program.

• Chapter 4 MODES OF MOTION Describes all the modes of motion that are supported by the ACS-Tech80 line of controllers.

• Chapter 5 ADVANCED FUNCTIONS Describes the advanced functions supported by ACSPL. These functions turn ACS-Tech80 controllers into very versatile and powerful tools.

• Chapter 6 COMMUNICATION WITH HOST COMPUTER Describes how to communicate with the host computer.

• Chapter 7 REFERENCE Lists parameter groups, parameter special features and product-dependencies, detailed parameter descriptions, error message definitions, and ASCII codes.

1.4. Conventions Used in this Guide Bold

(Courier font)

ACSPL elements as you must type them on your keyboard or as they will appears on your display. Used in examples.

Bold ACSPL elements, such as parameters, when mentioned in the text.

Shaded text Examples. $ Placeholder for axis notation (X, Y, Z, T, etc.). # Placeholder for user-supplied data. <> Encloses language elements that are required. For

example, if a Carriage Return (abbreviated to CR) is required, this is indicated as follows: <cr>

[] Encloses language elements that are optional.

Page 21: Acspl Software Guide Revision 3 00

PRODUCT UPDATES 2-1

ACSPL Software Guide - Document revision no. 3.00

2. PRODUCT UPDATES

The following are excerpts form Release Notes apply to ACS-Tech80 SB Series Motion Controllers, Motion Control Modules, and supporting tools (including Hardware, Software, and Firmware). Some of these updates relate to all products and some relate only to specific products and/or to specific applications.

2.1. Firmware Bug Corrections

2.1.1. Corrections Made in Version 19d 1. Attn: Master-Slave mode users. This bug was introduced in V19b and fixed in 19d.

At TF >1 there was a precision loss in reports of Master Index, Master Position, Master Relative.

2. Attn: Dual Loop users. This bug was introduced in V19b and fixed in 19d. Wrong report of $_MARK2 status in ACSPL for dual loop axes.

2.1.2. Corrections Made in Version 19e 1. Attn: CAM mode users.

LI, UI change on the fly in cyclic CAM provided.

2. Attn: Stepper users. Stepper Deceleration Current (P4 parameter) could be overwritten (wrong value used during motion) in previous versions.

2.1.3. Corrections Made in Version 19j 1. Upon power up with non-default HT, HP, communication via RS-232 could be "blocked."

Page 22: Acspl Software Guide Revision 3 00

2-2 PRODUCT UPDATES

ACSPL Software Guide - Document revision no. 3.00

2. Using Limit Switches as general inputs (FA.5 = 1) could cause irrelevant in this case End Messages.

3. Software Limits check in motion (could cause false S/W limit trapping when moving through CP=0).

2.1.4. Corrections Made in Version 19m 1. "case" statement insertion bug (caused hang-up if previous program containing "case" was

deleted rather than cleared).

2. Attn: for applications using nonzero Friction Number (FN) parameters. Several bugs concerning friction compensation algorithm, fixed. (I.e.: overwriting of FN value upon power up, unstable behavior in dead zone).

3. Attn: for “old filters” applications using stepper motor with encoder feedback (parameter VE != 0). Limit handling is fixed.

2.2. Work Around Procedures

2.2.1. SI (Safety Inputs) Parameters There is a known bug in SB1292 and Unilite2 , that allows the user to change polarity of Drive Logic, while it mustn't be available. This can cause Error 26 (Drive fault). To overcome it, you should check the proper bit in Input Logic and fix it manually, if necessary, as follows (even though Safety Inputs mapping differs from controller to controller)

Page 23: Acspl Software Guide Revision 3 00

PROGRAMMING THE CONTROLLER WITH ACSPL 3-1

ACSPL Software Guide - Document revision no. 3.00

3. PROGRAMMING THE CONTROLLER WITH ACSPL

ACSPL (ACS-Tech80 programming language) is an intuitive, powerful language for operating the controller. Before the controller can be operated, it must be set up and tuned. These tasks are described in the controller's Hardware and Setup Guide and in the ACS Adjuster user's guide. ACS Adjuster is part ACS Tools, a suite of Windows applications provided with the controller. ACS Adjuster is used for adjusting the controller's digital filter and includes a soft oscilloscope and other useful utilities.

3.1. Setting Up Serial Communication The control product can communicate via serial link with a host computer or a terminal. The serial link can be CAN or RS-232/422/485. CAN communications support is product-dependent and optional. Currently CAN support is available with SB1292, SB1381 SB1391 SB214SA and Unilite. If your control product supports CAN, refer to your ACSCAN user's guide. RS232 communications support is standard in all standalone control products. RS-422/485 communications support is product-dependent. Currently it is supported by: SB1292, SB1381 SB1391 SB214SA, Unilite, SB1001 SB1003 SB1091 and SB214ND. Wiring information concerning the serial links can be found in the controller's Hardware and Setup Guide. Generally, it is recommended to use the ACS Adjuster application for tuning the controller and the ACS Debugger application for programming the controller. These applications come with the

Page 24: Acspl Software Guide Revision 3 00

3-2 PROGRAMMING THE CONTROLLER WITH ACSPL

ACSPL Software Guide - Document revision no. 3.00

controller as part of the ACS Tools collection of Windows applications. Each of them includes a "smart" terminal window for communicating directly with the controller. However, some users may prefer to communicate with the controller using a different terminal application. This section describes how to setup a terminal application for an RS-xxx communications session with the controller. For information about the hardware aspects of RS-xxx connections, see your control product's hardware and setup guide.

3.1.1. Mode Of Operation The basic settings for the terminal are: • COM PORT: Select the port on your terminal that is connected to

the control product. If you do not know which COM port, select each COMx starting with COM1 until you find the correct one.

• BAUD RATE (all products): 300, 1200, 4800, 9600 (default). Additional BAUD RATES as of firmware version 19: 19200, 38400, or 57600.

• NO PARITY

• 1 START BIT

• 8 DATA BITS

• 1 STOP BIT

• FLOW CONTROL: Xon/Xoff

• ECHO: Yes

• ADD CARRIAGE RETURN TO LINE FEEDS: No

• WRAP LINES THAT EXCEED TERMINAL WIDTH: Recommended

• EMULATION: tty - (recommended)

Depending on your terminal application, it may start the communication session automatically, or you may need to initiate the session. For example in the Hilgraeve HyperTerminal application that is provided with Microsoft® Windows®, you need to initiate the session by selecting the Call option from the Call menu.

When your communications connection is working properly, the controller's MP_ON LED (stand-alone models) will blink each time you type a carriage return.

3.1.2. Waking the Controller The controller has a unique identification number n, which can be from 0 to 15 (F hex), and which is set through the ID parameter (setting parameters is described in Section 0). Up to 16 controllers

Page 25: Acspl Software Guide Revision 3 00

PROGRAMMING THE CONTROLLER WITH ACSPL 3-3

ACSPL Software Guide - Document revision no. 3.00

can be connected in a multiple drop serial communications connection (described later in this section). One or more controllers can receive data (typically from a terminal application), however only one controller can transmit data to the terminal application. The controller with transmit "privilege" is considered "awake." By default the controller with ID = 0 is designated "awake". However, you can change this using the Wake command (Section 3.3.9). The awake controller's ID number (or a symbol for the number) is displayed in the terminal application's prompt during the communications session (see more about this later in this Section). Note: Decimal representation is used with the ID parameter and Hex representation is used with the Wake command. If no prompt is displayed in your terminal application when you start a communications session, but you see that the MP_ON LED is working correctly, then the problem may be that the ID of the controller you are trying to receive from is not the ID of the awake controller. If you are working with a single controller, try changing the awake ID number to be the ID of the controller. To do so, issue the following Wake command iteratively for n:

@Wn<cr>

where the "@" character broadcasts the command to all connected controllers (see Section 3.3.1), n ranges from 0 to F hex, and <cr> means "type a carriage return." You will find that there will be no reply from the controller unless and until n equals the controller's ID. At that point the controller is awake and you should see the prompt with the controller's ID number displayed in your terminal application. If you are working with multiple controllers, you also need to wake up the specific controller that you want to work with. To do so is a bit more complicated because, since there are other controllers on the communications link, you cannot know if you have awakened your target controller simply by waiting for the prompt to appear in your terminal application. The fact that a prompt appears means that a controller is awake, but that might not be the controller you are interested in working with. Therefore you need to add another step after waking a controller: issuing a command that produces output from the controller. By doing so, you can see which controller produces the output. That is the currently awake controller. One way of doing this is to issue a motor activation command, which causes the controller to activate the motor to which it is attached.

Warning: Before issuing any commands that affect motor operation, verify that no damage will be caused by doing so. If you prefer not to enable the motor now, you can instead check for the controller that is awake by setting an output (assuming the outputs are connected). This is done using with a Set output command sequence (SHI<output number>). The Set command is described later in this chapter.

Page 26: Acspl Software Guide Revision 3 00

3-4 PROGRAMMING THE CONTROLLER WITH ACSPL

ACSPL Software Guide - Document revision no. 3.00

Here is an example of using motor activation to find the awake controller in a multiple drop connection. Assume that three controllers with ID numbers 0, 2, and 3 respectively are connected and the controller that you want to work with has ID number 3, but you don't know that. Issue the following command (enter the text in courier bold format on the left side of the example box): @W0 Try waking controller 0. This will result in the prompt 0> displaying in your terminal application since there is a controller with ID 0.

SXMO1 Try enabling the motor attached to controller 0. If there is a motor attached to controller 0 it will be enabled. You will be able to see that the controller is not the one you want. (If you want to disable the motor, issue the command: SXMO0.) Repeat the series of commands, each time iterating the digit after @W. When you reach @W3 you will have woken the controller that you want. This will be proved when you enable its motor.

3.1.2.1. Multiple Drop Connection Up to 16 controllers can be connected to a serial link. Before making the multiple drop connection, connect each of the controllers by itself to the host serial link and follow the steps below to assign each controller a unique ID: 1. Set a different ID for each controller (factory default ID is 0).

2. Connect the first controller to the computer. Run a terminal application on the computer (for example, ProComm or Windows Terminal) for communicating with the controller.

3. Set the controller's ID to 1 (SID1<cr>).

4. Execute a SAVE command (SAVE<cr> twice.)

5. The new ID becomes effective after the next power up.

6. Connect the second unit.

7. Set its ID to 2 (SID2<cr>).

8. Execute a SAVE command (SAVE<cr> twice.).

9. The new ID becomes effective after the next power up.

10. Repeat the above for each additional unit up to ID = 15.

At this point you are ready to make the multiple drop connection, as described in the Hardware and Setup Guide. Multiple drop connection was originally supported for up to ten controllers. It has since been expanded to support up to sixteen controllers. However due to the original 1-byte format used for the Wake command and for displaying the prompt, the syntax is a little different for controllers 11 to 16. The following table lists these differences. Note that the 1-byte legacy format determines that the prompts for controllers 11 to 16 are not the

Page 27: Acspl Software Guide Revision 3 00

PROGRAMMING THE CONTROLLER WITH ACSPL 3-5

ACSPL Software Guide - Document revision no. 3.00

controller ID. Rather they are the ASCII characters that come after the ASCII codes for 0 to 9[r7].

Set ID Wake Prompt ASCII for prompt SID0 @W0 0> "0" = 30h . . . . . . . . . . . . SID9 @W9 9> "9" = 39h SID10 @WA :> ":" = 3Ah SID11 @WB ;> ";" = 3Bh SID12 @WC <> "<" = 3Ch SID13 @WD => "=" = 3Dh SID14 @WE >> ">" = 3Eh SID15 @WF ?> "?" = 3Fh

3.1.3. Displaying Your Typed Input At this point you should see the controller ID prompt on your terminal display (for example, 0>). When you enter text it should be displayed in your terminal application. If it isn't, it means the terminal is not echoing. If you are unable to get the terminal to echo your typing, you can get the echo from the controller instead. The following code will accomplish this task. The code itself may not be clear to you until you read more of this guide, but for now, type it in as is. Prepare a text file with exactly the following - including the blank lines at the top and before "C":

E P I X: echo stop Y: noecho

stop

C XX

Transfer the text file to the controller. You should now receive an echo from the controller on your terminal. If you wish to stop the echo, type: PXY<cr> If you want to resume the echo, type: PXX<cr>

Page 28: Acspl Software Guide Revision 3 00

3-6 PROGRAMMING THE CONTROLLER WITH ACSPL

ACSPL Software Guide - Document revision no. 3.00

3.1.4. Changing the Baud Rate The serial communication baud rate can be set via the BR parameter. When the baud rate is changed, the new value becomes effective only after a SAVE command, followed by a HWRES command, or after switching power off and then back on. Setting parameters and using commands is explained later in this chapter. Examples of using BR: SBR4800<cr> Sets BR to 4800 bps. SBR300<cr> Sets BR to 300. SBR 50<cr> Wrong value. BR←9600. Communication error 21 prompted.

3.2. Basics of Operation and Communication The motion controller can operate in either of two modes, each mode having its own subset of ACSPL: • Direct mode - An operator or a host computer communicates with

the controller via a serial connection or a bus. The controller receives, interprets, and executes each command on the fly.

• Program mode - A sequence of commands (a program) is written on a computer, downloaded to the controller, compiled, saved in the controller’s memory, and executed.

The controller can operate independently or it can maintain a communications link with an operator or with a host computer. Direct mode and Program mode are described in detail later in this chapter.

3.2.1. Overview of Communication Protocols Before looking at the two operating modes, it is helpful to understand the ACSPL communications protocols. This section provides the necessary introduction while a more detailed description is provided in Chapter 6, on page 6-1. The communication protocol determines how data is formatted when passed between the outside world (an operator at a terminal or a program running on a host computer) and the controller. There are two main communication protocols: terminal and host. The communication protocol is selected using the HT and auxiliary HP parameter. Terminal protocol is normally used for operator - controller communication and host protocol is used for computer - controller communication. Note that the name of the communication protocol refers to how data is represented, not the entity doing communicating with the controller. For example, Terminal protocol could be used for communication with a host computer instead of host protocol (although this is not a likely scenario).

Page 29: Acspl Software Guide Revision 3 00

PROGRAMMING THE CONTROLLER WITH ACSPL 3-7

ACSPL Software Guide - Document revision no. 3.00

Generally terminal protocol format is used to represent ACSPL throughout this guide, except for Chapter 5 and where noted otherwise.

There is a third communication protocol called handheld terminal, which is designed for use with handheld terminals. Handheld terminal protocol is a reduced version of terminal protocol. The difference between protocols can be clearly seen in the following examples, all of which are responses to the same command, ROP (Report Output Port). Terminal protocol:

--- Output Port --- Output 1 = Off (User) Output 2 = Off (User) Output 3 = Off (User) O- 4/ Motor's break= Off (User) O- 5/ B\E motion X = Off (User) O- 6/ X Ready = Off (User) O- 7/ Early Ready X= Off (User) O- 8/ Intrp.Comp. X= Off (User)

Handheld terminal protocol:

OP:6543210987654321 00000000

Host protocol:

0OP<00><00><00><00><CF> Note: If, upon Power Up, memory checksum failure is encountered, default (legible for human operator) communication protocol settings are forced: HT = 1(Terminal), HP = 0.

3.3. Direct Mode Operation As mentioned earlier, in direct mode operation command lines are downloaded via serial link to the controller and executed on the fly. The source of the commands can be a program on a host computer or a human operator using a terminal application. ACS Debugger, (which comes with the controller), includes a terminal window, which can be used for this purpose. Alternatively, you can use another terminal application, such as PROCOMM™. The time it takes for a command to execute is a function of the command itself, the complexity of any other tasks running at the same time, and the communications overhead. For example, the time from issuing a Begin command to the start of motion may take between 4ms to 15 ms. A command consists of at least a master command. Master commands are:

S for Setting parameter and output values. R for Reporting parameter, input, and output values. G for defining Group report structures.

Page 30: Acspl Software Guide Revision 3 00

3-8 PROGRAMMING THE CONTROLLER WITH ACSPL

ACSPL Software Guide - Document revision no. 3.00

T for Telling and changing status. A for setting and reporting the various Arrays. B, M, GO, E, K, KM

for motion execution (BEGIN, MOVE, GO, END, KILL, KILL MASTER).

W for Waking up another controller in a multi-controller environment.

C to aCknowledge ACSPL display messages. N, n for automatic cyclical buffering RESET, CLEAR, SAVE, LOAD, HWRES

for managing memory.

The master command defines the general type of action. Some master commands require one or more additional qualifiers, referred to as subcommands. Example of master command and subcommands:

BCI In this example, Begin (B) is the master command, Common (C) and Input (I) are subcommands. This combination tells the controller to get ready to begin motion in all axes (i.e., common) when a certain input (defined by I's value) is activated.

Subcommands can be of several types. The most prevalent type (used with the Set, Report, and Group master commands) are controller parameters, which are represented by two-character mnemonics.

Throughout this guide, parameters are introduced and described where they apply. In addition, Chapter 7 is a reference section where Sections 7.1 to 7.1.8 group parameters by function, Section 7.1.9 lists all the parameters with brief descriptions including special features and product-dependencies, and Section 7.2 provides a detailed reference for each parameter.

Subcommands that are not parameters are described in the related master command descriptions. A parameter can apply either per axis (referred to as axis parameter) or for the controller as a unit (referred to as system parameter). An example of an axis parameter is LV (XLV, YLV, etc.). An example of a system parameter is VV (i.e., there is just one VV to handle all the axes). These rules of applicability (axis vs. system) are, for uniformity's sake, maintained for single-axis controllers too. Therefore, when working with a single-axis controller, include X with axis parameters even though there are no other axes. In addition to the master commands described in this section, there is another group, which is only used for programming purposes. Those master commands are described in Section 3.4.3.

Page 31: Acspl Software Guide Revision 3 00

PROGRAMMING THE CONTROLLER WITH ACSPL 3-9

ACSPL Software Guide - Document revision no. 3.00

3.3.1. Command Syntax <MC>[AXIS]<SC>[data]<cr>

<MC> Master command(s). Case sensitive (most are uppercase).

[AXIS] Axis (axes). Uppercase. <SC> Subcommand(s). Case sensitive. [data] Data. <cr> Carriage return.

• Delimitor characters (for example, commas) are not allowed. • Within a command, spaces are allowed only between

subcommands. (A common error is to leave a space between a subcommand and data that follows).

• Spaces are also allowed between commands. • Most master commands require at least one subcommand - there

are a few exceptions where subcommands are optional. • The maximum length of a command line is 254characters

(including <cr>). • When a master command is preceded by the "at" character (@),

all controllers on that serial communication link will execute the master command (broadcast command).

Example:

SXLV30000 Set X Linear Velocity to 30000 Master command is S (Set) Axis is X Subcommand is LV (Linear Velocity) Data is 30000 (new linear velocity)

3.3.2. Typing a Command Line When you are properly connected to the controller, the system prompts you with the Identification Number (ID) of the controller. For example, if ID is 0, the prompt will be "0>". After each command line the same prompt is displayed, unless the entry is incorrect. In that case the prompt is followed by ? and the relevant error code. For example, if the ID is 20 and a error 20 occurs, the prompt will be "0?20". (For a complete of the error codes see page 7–76.) As was mentioned earlier, the controller supports two primary communication protocols: host and terminal. Normally when working with the controller from a terminal application, you would use terminal protocol. If, however, you attempt to communicate from a terminal application with the controller when it is set to host protocol communication, (see page 6-1), you will get this error response: 0?o. In that case, switch

Page 32: Acspl Software Guide Revision 3 00

3-10 PROGRAMMING THE CONTROLLER WITH ACSPL

ACSPL Software Guide - Document revision no. 3.00

to terminal protocol communication by typing SHT<cr>. The prompt should then return to normal (ID followed by >). If the command line includes an unrecognized command (either master command or subcommand), the controller stops interpreting the command line at the faulty command. This does not affect the interpretation already carried out on any commands that preceded the faulty command. If the command line is valid, the system responds with the normal prompt. If part of the command line is not valid, the system responds with an error prompt.

The reference to an axis or axes in the following examples depends on the controller you work with. If you work with a single-axis controller, only the X axis is valid; if you work with a four-axis controller the X,Y,Z and T axes are valid; etc.

3.3.3. Set Master Command The Set master command is used for setting parameter values.

3.3.3.1. Set Command Syntax All Set commands start with the master command S, followed by axis definition (optional), subcommand, data (optional) and carriage return.

S[axis]<SC>[data]<cr> Reminder: More than one parameter (subcommand) can be set with the same S command.

Set an axis parameter: Set the wait time for the Z axis to 500 msec

SZWT500<cr> S Set master command Z Z Axis WT Wait Time subcommand 500 Data - 500 msec <cr> End of command

Set an axis parameter: Set the relative position for Y axis to 4500

SYRP4500<cr> S Set master command Y Y Axis RP Relative Position subcommand 4500 Data - the value for the relative position <cr> End of command

Set two parameters for the same axis on the same command line: Set the linear velocity to 5000 and the linear acceleration to 10000 for X axis

SXLV5000 LA10000<cr>

Page 33: Acspl Software Guide Revision 3 00

PROGRAMMING THE CONTROLLER WITH ACSPL 3-11

ACSPL Software Guide - Document revision no. 3.00

S Set master command X X Axis LV Linear Velocity subcommand 5000 Data - the value for the linear velocity LA Linear Acceleration subcommand 10000 Data - the value for the linear acceleration <cr> End of command

Set a system parameter: Set output 7 High

SHI7<cr> S Set master command HI Output HIgh subcommand 7 Data; the number of the output <cr> End of command Parameters can also be set using binary format: xxxx .. xxB, where x is 0 for clearing a bit or 1 for setting a bit. Some parameters can also be set using a bit mask. In that case, in addition to 0 and 1, an uppercase X is used to indicate that the corresponding bit remains unchanged. The following parameters can be set with bit masking: OM - Output Mask DC - Data Collection PG - Path Generation IL - Input Logic (safety inputs that are referred to by IS) IN - INput logic (inputs that are referred to by IP) Set IL.0 without reading the present value of IL and without affecting other bits:

SILXXXXXXXXXXXXX1B. Set IL.2 and 5 only and clear IL.6:

SILXXXXXX01XX1XXB

3.3.4. Report Master Command The Report master command is used for reporting the values of all parameters, including the status of inputs and outputs.

3.3.4.1. Report Command Syntax All Report commands start with the master command R, followed by axes definition (optional), subcommand(s) (optional) and terminating carriage return.

R [axes]<SC><cr>

When a Report command specifies a particular axis (or axes), it becomes the ‘default axis’.

Page 34: Acspl Software Guide Revision 3 00

3-12 PROGRAMMING THE CONTROLLER WITH ACSPL

ACSPL Software Guide - Document revision no. 3.00

When a report command does not explicitly specify an axis, the default axes are reported. More than one parameter (subcommand) can be set with the same R command. RX<cr> will report the content of the current group for X

axis. The X-axis becomes the ‘current axis’. RYZ<cr> will report the content of the current group for Y

and Z axes. Y and Z-axes become the ‘current axes’.

R CP<cr> will report the current position of the ‘current axes’.

R CPDP<cr> will report the current position and desired position of the ‘current axes’.

As was mentioned earlier, the format of the controller output in response to a report command depends on the communication protocol used (host, terminal, or handheld) and the type of parameter. For a description of the response formats in host protocol, see Section 6.5.1. In terminal protocol, the full parameter name is displayed followed by the value. In the following examples, terminal protocol is the communications format. The format of the response to a Report command depends on the parameter being reported. Some parameters, like the ones in the following group of examples, are reported in numeric format. Report Wait Time of Z axis.

RZ WT<cr> R Report master command Z Z Axis WT Wait Time subcommand <cr> End of command The response to this report request is: Z Wait Time = 500

Report Position Error of X axis

RX PE<cr> R Report master command X X axis PE Position Error subcommand <cr> End of command The response to this report request is: X Position Error = 10

Report Current Position of Y axis.

RY CP<cr> R Report master command

Page 35: Acspl Software Guide Revision 3 00

PROGRAMMING THE CONTROLLER WITH ACSPL 3-13

ACSPL Software Guide - Document revision no. 3.00

Y Y axis CP Current Position subcommand <cr> End of command The response to this report request is: Y Current Position = 4567 Report Current Position and Position Error of Z axis

RZ CP PE <cr> R Report master command Z Z axis CP Current Position subcommand PE Position Error subcommand <cr> End of command The response to this report request is: Z Current Position = 4567 Position Error = 10

Report Current Position of X and Y axes

RXY CP <cr> R Report master command XY axes CP Current Position subcommand <cr> End of command The response to this report request is: X Y Current Position = 4896 1000 The parameters in the next group of examples are reported in symbolic format. Terminal protocol example for a disabled motor: Assuming that the 'current axis' is X, the response to RMO is: X MOtor enabled = Off For an enabled motor, the response to RMO is: X MOtor enabled = On Where a quadrature encoder is used, the response to RET is: X Encoder Type = 10 A&B,I In handheld terminal protocol (HHT), only the parameter mnemonic is displayed rather than the full name. The mnemonic is followed by the numeric value or descriptive value.

Page 36: Acspl Software Guide Revision 3 00

3-14 PROGRAMMING THE CONTROLLER WITH ACSPL

ACSPL Software Guide - Document revision no. 3.00

Handheld terminal protocol examples The response to R CPDP: XCP: 0 XDP: 0 The response to RXET where a quadrature encoder is used (note the difference between this response and the terminal protocol response above): XET: 3 For a disabled motor, the response to RXMO is: XMO: Off For an enabled motor, the response to RXMO is: XMO: On In terminal and handheld terminal protocols, some parameters that are by definition bitmapped are reported in binary format: xxxx . . . xxB. These include: IN, IL, HP, FA, and PG. Response to RIN command for SB1291: INput port logic = 00000000 In terminal protocol, some digital input/output parameters are reported in verbose binary format. In this format each bit is reported in full on its own line. Response to RIL command for SB1291: safety Inputs Logic X Right Limit Logic= Off X Left Limit Logic= Off X Drive Logic= Off Emerg. Stop Logic= Off

3.3.5. Group Master Command The Group master command is used to define several parameters as a group for reporting. This grouping enables you to view several parameters with a single Report master command.

3.3.5.1. Group Command Syntax Group Commands start with the master command G, followed by a number, and subcommands.

G#<SC>.....<SC><cr> There are 9 groups. Most of them contain factory default parameters. Each group may be set with up to 15 parameters. Once a group is defined, it can be reported with the RG# command. Once a report command explicitly specifies a group number, this group becomes the ‘current group’. When a report command does not explicitly specify a group number, the reported group is the ‘current group’.

Page 37: Acspl Software Guide Revision 3 00

PROGRAMMING THE CONTROLLER WITH ACSPL 3-15

ACSPL Software Guide - Document revision no. 3.00

Define as Group number 8 the following parameters: Desired Position, Position Error and Current Position.

G8 DP PE CP<cr> G Group Master command 8 Group number DP Desired Position subcommand PE Position Error subcommand CP Current Position subcommand <cr> End of command A typical response to a Report Group 8 Command (RG8) is: ---- Group #3 ---- X Y Desired Position = 50000 0 Position Error = 0 0 Current Position = 100 1000 If Linear Velocity, Linear Acceleration and Linear Deceleration are set as follows: SXLV1000 LA50000 LD60000<cr> SYLV75000 LA40000 LD45000<cr> and they are defined as Group 4 G4 LV LA LD<cr> The controller's response to the RG4<cr> command is then: ---- Group #4 ---- X Y Linear Velocity = 1000 75000 Linear Acceler = 50000 40000 Linear Deceler = 60000 45000 Group 4 becomes the ‘current group’. The response to RY<cr> command: ---- Group #4 ---- Y Linear Velocity = 75000 Linear Acceler. = 40000 Linear Deceler = 45000 The Y axis becomes the ‘current axis’. Now the response to the command

R CP <cr> will be current position of Y axis only. The response to the command

RX <cr> ---- Group #4 ---- X Linear Velocity = 1000 Linear Acceler = 50000 Linear Deceler = 60000 The X axis becomes the ‘current axis’.

Page 38: Acspl Software Guide Revision 3 00

3-16 PROGRAMMING THE CONTROLLER WITH ACSPL

ACSPL Software Guide - Document revision no. 3.00

3.3.6. Tell Master Commands The Tell master commands are used to retrieve motion, memory and program status, and to clear the memory failure flag. Normally the controller generates two-digit codes for motion and program status. The codes are updated upon events such as motion begin, motion end, program begin, program normal-end, program error. By default, these codes are not displayed: they must be retrieved using Tell commands.

To override the default and have the controller display the status codes, set the IC parameter accordingly. See Section 7-21 for more information about the IC parameter.

All Tell master commands start with T followed by a number. T#<cr>

ACSPL supports the following Tell master commands: T0 Tell Motor And Motion Status T1 Tell Result Of Last 'Begin Motion' Command T2 Tell The Cause Of Motion's End T3 Tell Program Status T4 Tell Last Program Message T5 Tell Servo Processors Status T6 Tell Firmware Memory Status T7 Ignore memory checksum error T8 Diagnostic command for various voltages (SB214 only). T9 Tell Memory Status

3.3.6.1. T0 - Tell Motor And Motion Status The controller responds with the following information: • State of motor axes: motor is enabled/disabled, waiting/not waiting

for an input, moving/not moving, waiting between moves. • Motion mode. • Secondary mode (like sequence type when in mode 3). • Step number, when moving through an array of points (mode 3,

15,16). Example of T0 response: Motor X is enabled and NOT running in Repeat PTP Mode Motor Y is enabled and NOT running in Joystick Mode Motor Z is disabled Motor T is disabled Motors are NOT in common motion

Page 39: Acspl Software Guide Revision 3 00

PROGRAMMING THE CONTROLLER WITH ACSPL 3-17

ACSPL Software Guide - Document revision no. 3.00

3.3.6.2. T1 - Tell Result Of Last 'Begin Motion' Command Each time the controller starts a motion a status message is generated. This message is retrieved by the T1 master command. In addition, a Begin message can be sent "online" through the communication link. The Begin message is sent only when the value of the Initiate Communication (IC) parameter equals 1, 3, 5 or 7. (Bit IC.0 is 1)

The syntax of the response is:

<ID> [Axis] B <Data> <cr> Where: <ID> The controller's ID. [Axis] The reported axis. X,Y,Z or T. <Data> A code for the result of the operation. <cr> End of Message.

The possible values for the <Data> field are:

1 Motion has begun successfully. 9 The required motion is common and the other axis failed to

move. 10 In Continuous Path mode: the length of the first segment is

not enough to enable the development of the desired vector velocity using the specified vector acceleration. (The Continuous Path mode is not available in single axis controllers.)

11 In Continuous Path mode: the length of the last segment is not enough to enable the deceleration to zero velocity, using the specified acceleration.

12 In Master Slave mode (mode 12): the required master is not defined ($MA=0). In Path Generation mode (mode 16) when CAM option is used: the master axis is not defined. In Continuous Path mode (mode 15): Lower Index is greater than Upper Index (LI>UI).

14 In Arbitrary Path generation: {DT=1 & LI>512 or DT=1 & [0 >= TX(512+LI) or TX(512+LI) > 32000]} For a single axis controller, in Arbitrary Path mode with the CAM option when XUI>511.

19 The combination of the motion parameters does not enable the creation of the desired profile in Multiple Velocities mode (mode 8) or Search mode (mode 9). (See pages 4-10 and 4-12)

20 The motor is in a disable state. 21 The required motion mode is not valid.

Page 40: Acspl Software Guide Revision 3 00

3-18 PROGRAMMING THE CONTROLLER WITH ACSPL

ACSPL Software Guide - Document revision no. 3.00

22 Either the required motion is common but the two axes are not in the same motion mode or common (coordinated) motion is not allowed.

23 The required target is out of the permitted range. The target is not in the range: [Position Low _ Position High].

24 The controller could not calculate the motion with the existing parameters (Target, Velocity and/or Acceleration, too small/ large radius etc.).

25 The motion mode is common, but the Begin command has been issued for one axis (BX or BY instead of BXY).

90 Memory failure in the data area has been detected. To recover, issue a RESET command.

91 Memory failure in the code area (firmware) has been detected. The firmware must be replaced!.

If the controller is connected to a terminal, and the operator has started a new command, the Begin message will interrupt the command but it will be sent with a preceding <cr> in order to enhance readability. The part of the entered command is not lost, and the command may be continued from the interrupted spot. The operator has started entering the command RG1. In the meantime, a motion has just begun, and only the letters RG were entered. The command is interrupted, and the message: 0XB01 appears at the beginning of the next line. The operator may now enter '1' followed by a <cr> to get his report. The Begin message is ready within 5msec. after the required motion has started (or failed). If the controller is busy with another transmission (like a report), when a Begin message is available, the current transmission is not interrupted. Only when the current transmission is completed, will the controller transmit the Begin message. If more than one Begin message are ready while the controller is busy with another transmission, the messages are accumulated and sent together as soon as the controller is ready to transmit them. Responses to commands received through the communication link have priority on Begin messages. Up to 16 messages may be accumulated if the controller is handling other transmissions. The Begin message value can be retrieved by an ACSPL program via the $_BEGIN state variable. If an automatic subroutine is used to detect the reason for a failure, make sure that the subroutine is delayed for at least 5 msec before recording the value of $_BEGIN. Example of T1 response: Results of last BEGIN motion: X - 0 Y - 1 Z - 20

Page 41: Acspl Software Guide Revision 3 00

PROGRAMMING THE CONTROLLER WITH ACSPL 3-19

ACSPL Software Guide - Document revision no. 3.00

T - 24

3.3.6.3. T2 - Tell The Cause Of Motion's End Each time the controller completes or aborts a motion a status message is generated. This message is retrieved by the T2 master command. In addition, an End message can be sent "on line" through the communication link. The End message is sent only when the value of the Initiate Communication (IC) parameter equals 2, 3, 6 or 7. (Bit IC.1 is 1). The syntax of the response is:

<ID> [Axis] E <Data> <cr> Where: <ID> The controller's ID. [Axis] The reported axis. X, Y, Z or T. <Data> A code for the result of the operation. <cr> End of Message.

The possible values for the <data> field are:

1 Motion was successfully completed. 2 Motion was 'killed' by the user. 9 Motor was automatically stopped while running in common

motion and another motor failed to complete the motion. 12 Motor was automatically disabled because the servo processor

that controls the axis does not function. 14 Motion failed to continue. The reason: In arbitrary path mode,

{DT=1 & ES > 512 or DT=1 & [TX(512+ES)<=0 or > 32000]}. KL determines the nature of stopping. (See Arbitrary Path Generation on page 4-28)

19 Sensor was not detected within the required range. (See Search for Contact on page 4-12)

20 Motor was disabled by the user while running. 21 Motor was automatically disabled because of encoder error.

The encoder is either not connected or the encoder’s lines are noisy.

22 Motor was automatically disabled due to an emergency stop signal.

23 Motor was automatically stopped while running into its left limit. 24 Motor was automatically stopped while running into its right

limit. 25 Motor was automatically disabled when Error Limit (ER), or

Error during Acceleration (EA) is exceeded.

Page 42: Acspl Software Guide Revision 3 00

3-20 PROGRAMMING THE CONTROLLER WITH ACSPL

ACSPL Software Guide - Document revision no. 3.00

26 Motor was automatically disabled because of fault feedback indication from the driver (short current or over heat).

27 Motor was automatically disabled because of over current. The actual rms current exceeds the value specified by the Current Limit parameter (CL).

28 Motor was automatically disabled because of over current. The instantaneous current in one of the phases exceeds the nominal peak value by more than 20%.

The End message is ready within 5 msec. after the required motion has stopped. If the controller is busy with other transmission (like a report), when an End message is available, the current transmission is not interrupted. Only when the present transmission is completed, it will transmit the End message. If more than one End message is ready while the controller is busy with other transmission, the messages are accumulated and sent together as soon as the controller is ready to transmit them. Responses to commands received through the communication link have priority on End messages. Up to 16 messages may be accumulated if the controller is handling other transmissions. The End message value can be retrieved by an ACSPL program via the $_END state variable. If an automatic subroutine is used to detect the reason for a failure, make sure that the subroutine is delayed for at least 5 msec before recording the value of $_END. Example of T2 response: Results of last END motion: X - 0 Y - 1 Z - 21 T - 27

3.3.6.4. T3 - Tell Program Status (For Program Mode Only) The controller responds with the following information regarding ACSPL programs: • Is the program compiled. • Is the program running, stepping or suspended and in which line • Program 's memory status and checksum

Example of T3 response: Program is running at line 149 Program is compiled. Program area is OK Program check sum is 284D

Page 43: Acspl Software Guide Revision 3 00

PROGRAMMING THE CONTROLLER WITH ACSPL 3-21

ACSPL Software Guide - Document revision no. 3.00

A ‘Stepping’ message appears when an ACSPL program is in step mode. The ‘suspension’ state is caused by the following situations: • A Begin command was issued and not handled yet. • An ACSPL program is executing an ‘exec’ statement - as long as

the statement is not completed. • During the deceleration of a ‘kill’ process that was initiated by an

ACSPL program. This may take a long time with high velocity and low KD value.

• A calculated motion is waiting to be started (not for modes 1 and 3).

• In Master Slave mode, while a Master Distance (MD) profile is being executed.

• During the enable process of a motor. • During calculation of a deceleration profile in response to a Move

command (Registration Distance). • When a velocity change is issued in Jog mode (mode 10) - until

the motor starts acceleration/deceleration toward the new velocity. This may take a long time with a large velocity change and low acceleration when a new LV command is issued.

Most of these situations will cause a suspension of a few msec except for the exceptions mentioned. However, if a command is issued while the controller is still busy with a previous command, it may be suspended for a considerable time. 1: let XAP=100000 2: exec BX 3: let XAP=200000 4: exec BX 5: let XAP=-3000000 6: exec BX When the program executes line 2 the motor starts to move. While moving towards the first point (100,000) the controller executes lines 3 and 4. At line 4 the program is suspended until the second move (towards 200,000) starts. For the same reason the program will be suspended at line 6.

3.3.6.5. T4 - Tell Last Program Message (program mode only) When a program is terminated, a message that describes the reason is generated. This Tell command responds with a code for that message. Example of T4 response: Results of last PROGRAM execution - 01 01 code for the ‘program has been executed successfully’.

Page 44: Acspl Software Guide Revision 3 00

3-22 PROGRAMMING THE CONTROLLER WITH ACSPL

ACSPL Software Guide - Document revision no. 3.00

The available messages are: 1 The program has been executed successfully. 2 An automatic routine has been invoked and executed

successfully. 4 When in Step mode, after execution of each statement. 7 The operator terminated the program. 8. A program stop command was issued while no program was

running. Warning. 83 Program is not compiled. Run-time error. 84 Zero divide. Run-time error. 85 The specified start location is not found. Run-time error. 86 Illegal variable reference. Run-time error. 87 ret statement without call. Run-time error. 88 Out of program (stop command is missing). Run-time error. 89 Call nesting is too deep. Run-time error. 90 A check sum error is detected in the program area. Run-time

error. 91 Executed END without reason. Run-time error. 92 Executed loop nesting is too deep. Run-time error. 93 Square root of a negative number. Run-time error. 94 Case nesting is too deep. Run time error.

3.3.6.6. T5 - Tell Servo Processors Status Describes the status of the servo processors and the checksum of their memories.

Example of T5 response: X DSP Program compiled. Running; NOT inBreak; NOT RdyStep; in Idle. Y DSP Program compiled. Running; NOT inBreak; NOT Rdy Step; NOT in Idle. Z DSP Program compiled. Running; NOT inBreak; NOT RdyStep; in Idle. T DSP Program compiled. Running; NOT inBreak; NOT RdyStep; in Idle. DSP Program area is OK DSP Program check sum is 03DD

3.3.6.7. T6 - Tell Firmware Memory Status Checks the integrity of the firmware (EPROMs) and responds with the version of the software. It is described by the two first and the two last digits of the version.

Page 45: Acspl Software Guide Revision 3 00

PROGRAMMING THE CONTROLLER WITH ACSPL 3-23

ACSPL Software Guide - Document revision no. 3.00

If the software version is V9.11-16 then the response to T6 is: Code area is OK Code checksum is 9116 The calculation of the checksum takes several seconds.

3.3.6.8. T7 - Ignore Checksum Error Fakes "memory OK" status if there is a checksum error and you still need to proceed without RESET (e.g., to investigate the problem). Not recommended for common usage.

3.3.6.9. T8 - Tell Voltages Status This Tell command checks and reports the value of the following voltages: +12V, -12V and Vpp (used for nonvolatile memory programming). This command is currently applicable only for the SB214. Example of T8 response: Vpp test is OK +12V test is OK -12V test is OK

3.3.6.10. T9 - Tell Memory Status The memory is divided into 3 parts: Parameters and internal (hidden) variables, group structure, and targets array points. The integrity of each part is checked and reported. Typical reports of T9 master command: Variable data is OK Group report data is OK Array data is OK Memory check sum is 14DD

In terminal protocol (HT=1), T9 does not check the integrity of the program memory. This is done by master command T3. In host protocol (HT=0), T9 checks the integrity of all memory areas including program, servo processors and firmware. Therefore, the response to T9 command in host protocol takes several seconds.

3.3.7. Array Master Command ACSPL supports addressing predefined controller memory areas as arrays. Some of the arrays are designed for use with specific modes or functions and some are designed for more general purposes, such as data storage The master command for working with arrays is A (Array). Subcommands that can be used with the A command are: • SEt array value(s) • REport array value(s)

Page 46: Acspl Software Guide Revision 3 00

3-24 PROGRAMMING THE CONTROLLER WITH ACSPL

ACSPL Software Guide - Document revision no. 3.00

• CLear all or part of the array. The syntax is as follows:

3.3.7.1. Array Set Master Command A [type] [axis] SE [m] [data] <cr>

where: [type] type of array. (Required for some of the arrays) [axis] X, Y, Z, or T axis (when applicable) [m] the index of the starting element in the array

[data] string of numbers separated by spaces

AXSE5 2300 3400 0 -500<cr>

A Array command X X Axis SE SEt subcommand 5 Start index 2300 3400 0 -500 Data <cr> End of command Array X is assigned the following values: TX(5) = 2300 TX(6) = 3400 TX(7) = 0 TX(8) = -500

3.3.7.2. Array Report Master Command A [type] [axis] RE [m] [n] <cr>

where: [type] type of array (when applicable) [axis] X, Y, Z, or T axis (when applicable) [m] the index of the starting element in the array (optional) [n] the index of the last element in the array (optional)

This command can retrieve up to 100 elements of an array in one report. The active part of the array is defined by the array Lower Index (LI) and the array Upper Index (UI) master commands. Three forms of this command are, therefore, supported: • The [m] and [n] are not defined:

The command reports the first 100 elements, or all the elements, if there are less then 100 elements in the array.(UI-LI<100) When YLI=200; YUI=205 AYRE<cr> command reports 6 elements: TY(200),TY(201)...TY(205)

Page 47: Acspl Software Guide Revision 3 00

PROGRAMMING THE CONTROLLER WITH ACSPL 3-25

ACSPL Software Guide - Document revision no. 3.00

When YLI=100; YUI=300 AYRE<cr> command reports 100 elements: TY(100),TY(101)...TY(199)

• Only [m] is defined:

The command reports the element whose index equals [m]. AYRE5<cr> command reports one elements: TY(5)

• Both [m] and [n] are defined:

The command reports the elements whose indices are between the [m] and the [n]. If [n]- [m]>100 then only the first 100 elements are reported (starting from the m’th element).

When YLI=0; YUI=1023 AYRE200 205<cr> command reports 6 elements: TY(200),TY(201)...TY(205) When YLI=0; YUI=1023 AYRE100 300<cr> command reports 100 elements: TY(100),TY(101)...TY(199)

3.3.7.3. Array Clear Master Command A [type] [axis] CL [m] [n] <cr>

where: [type] type of array (when applicable) [axis] X, Y, Z, or T axis (when applicable) [m] the index of the starting element in the array [n] the index of the last element in the array

This command fills the defined elements with zeros. The [m] and [n] indices must be specified.

AXCL100 125 <cr> fills the content of the array, starting at entry 100, up to entry 125 (inclusive), with zero. TX(100), TX(101),...TX(125) = 0

3.3.7.4. Summary Of Array Types The following table summarizes the types of arrays supported by ACSPL.

Type Of Array Command Size Data Range

Comments

Array of axis position targets

A [axis] SE [m] [data] A [axis] RE [m] [n] A [axis] CL [m] [n]

1,024 ±(109-1) For Prog. mode syntax, see page 3-52

Page 48: Acspl Software Guide Revision 3 00

3-26 PROGRAMMING THE CONTROLLER WITH ACSPL

ACSPL Software Guide - Document revision no. 3.00

Type Of Array Command Size Data Range

Comments

Array of Common position targets

ACSE[m] [data] ACRE[m] [n] ACCL[m] [n]

32 ±(109-1) For Prog. mode syntax, see page 3-53

Array of Indices

AISE[m] [data] AIRE[m] [n] AICL[m] [n]

10 0 - 65,535 For Prog. mode syntax, see page 3-50

Array of Variables

AVSE[m] [data] AVRE[m] [n] AVCL[m] [n]

100 ±(231-1) For Prog. mode syntax, see page 3-50

Array of grid point's Errors

AESE[m][n][data] AERE[m][n]

2,400 ±32,767 For Prog. mode syntax, see page 5-1

Array of Function keys

AFSE[m][data] AFRE[m][n] AFCL[m][n]

8 For Prog. mode syntax, see FKEY on page 3-82

Array of timers AtSE[m] [data] AtRE[m] [n] AtCL[m] [n]

3 0 - (109-1) m=0 TIME m=1 TIMER1 m=2 TIMER2 For Prog. mode syntax, see page 3-51

Array of sine Table

As[axis]SE[m] [data] As[axis]RE[m] [n] As[axis]CL[m] [n]

128/256 ±32,767 Stepper, Brushless, AC commutation. Prog. mode syntax: s$ (#)

Array of sine offset

Ao[axis]SE[m] [data] Ao[axis]RE[m] [n] Ao[axis]CL[m] [n]

128/0 ±127 Stepper correction.Prog. mode syntax: o$ (#)

Array of forward error

Af[axis]SE[m] [data] Af[axis]RE[m] [n] Af[axis]CL[m] [n]

72 ±32,767 Z, T axes only. No prog. mode support.

Array of backward error

Ab[axis]SE[m] [data] Ab[axis]RE[m] [n] Ab[axis]CL[m] [n]

72 ±32,767 Z,T axes only No prog. mode support.

Array of grid delta

Ag[axis]SE[m] [data] Ag[axis]RE[m] [n] Ag[axis]CL[m] [n]

60 1 - 106 See: page 5-1 No prog. mode support.

Array of VMEbus IRQs

AQSE[m] [data] AQRE[m] [n] AQCL[m] [n]

20 0 - 65, 535 For SB214VME only No prog. mode support.

Page 49: Acspl Software Guide Revision 3 00

PROGRAMMING THE CONTROLLER WITH ACSPL 3-27

ACSPL Software Guide - Document revision no. 3.00

Type Of Array Command Size Data Range

Comments

Array of D values

AD[axis]SE[m] [data] AD[axis]RE[m] [n] AD[axis]CL[m] [n]

30 -32,767 - 65,535

Real time control parameters. Prog. mode syntax: D$ (#)

Array of K values

AK[axis]SE[m] [data] AK[axis]RE[m] [n] AK[axis]CL[m] [n]

20 -32,767 - 65,535

Real time control parameters. Prog. mode syntax: K$ (#)

Array of J values

AJ[axis]SE[m] [data] AJ[axis]RE[m] [n] AJ[axis]CL[m] [n]

20 -32,767 - 65,535

Real time control parameters. Prog. mode syntax: J$ (#)

Array of system errors

AeRE[m] AeCL[m] [n]

8 byte Stack of eight recent system errors. No prog. mode support.

AXRE5 reports element X(5) only. AYRE2 4 reports elements Y(2), Y(3), Y(4). AZRE reports all elements from ZLI to ZUI (or first 100)

AISE0 5 87 assigns to I0 the value 5, and to I1 the value 87.

AVSE7 76 -887 assigns to V7 the value 76, and to V8 the value -887.

ACRE5 The controller's response is: 5: C 1000 2000 90000 ACRE (assuming XLI=1, XUI=3) The response is: 1:L 5000 0 2:C 5000 5000 180000 3:L 0 10000

3.3.8. Motion Execution Master Commands The Motion Execution master commands are:

Begin Starts a motion of an axis. End Terminates an axis motion (not immediately). Move Starts a “registration” motion of an axis. GO Starts a motion after a B[axis]I command when BG

parameter is set to 0. Kill Terminates immediately an axis motion.

Page 50: Acspl Software Guide Revision 3 00

3-28 PROGRAMMING THE CONTROLLER WITH ACSPL

ACSPL Software Guide - Document revision no. 3.00

KM (Kill Master

Terminates immediately a superimposed motion while in Master Slave mode.

Before the controller can cause a motion, the motion mode (type of motion) must be defined. The motion mode is defined by the MM parameter. The motion modes are described in detail in Chapter 4.

3.3.8.1. BEGIN The Begin command initiates a move. The command syntax is B followed by a list of axis names (or by C if all the axes are involved). If it is desired, the move can be sychronized with an event, where the event is either an input or a GO command. For such a move, use the I subcommand after the B command. This combination of B with I is referred to as Begin on Input command. The syntax for the Begin command is:

B<axes or C>[I]<cr>

The Begin on Input command delays the execution of a move until an event occurs. The controller calculates all motion parameters and once the event occurs, the motion starts within 1 msec. The event can be either a change in one of the inputs or a GO command. Which of these two event types will be used to trigger the Begin command is defined by the BG parameter. If a GO command is used, it can be issued by an operator at a terminal, a host computer, or by a statement in the ACSPL program. The values of BG are:

BG Motion starts 0 on digital input. 1 on GO command.

The number of the digital input is defined by the Input Source parameter (IS). The polarity of the input is defined by the input logic parameter (IN). The Begin on Input command can be used to synchronize motion of axes that are controlled by different controllers. To do that you should issue a Begin on Input command to each controller and afterwards broadcast a GO command (@GO [axes] <cr>). After a Begin on Input command is issued, the controller calculates the motion profile parameters and enters into a ‘Ready’ state. This state indicates that the controller is ready to respond to the input (or GO command). This state can be signaled by a dedicated output. See page 5-32. Begin motion of X axis

BX <cr> B Master command X Axis name

Page 51: Acspl Software Guide Revision 3 00

PROGRAMMING THE CONTROLLER WITH ACSPL 3-29

ACSPL Software Guide - Document revision no. 3.00

<cr> End of command

The following examples involve coordinated motion (motion involving more than one axis). Begin motion of X,Y,T axes

BXYT<cr> B Master command XYT axis names <cr> End of command Begin all axes on input

BXYZTI <cr> B Master command XYZT Common mode; all axes I Begin on Input <cr> End of command An alternative form of this command is:

BCI <cr> In a coordinated motion it is the BG parameter, GO command, and input of the "lowest" axis that are used with the Begin on Input command. The lowest axis is determined according to the order X, Y, Z, T. For example, given the parameter settings: XIS = 1, YIS = 2, ZIS = 4, TIS = 7 - Input 1 assigned to X axis, input 2 to Y axis, etc, XBG = 0, YBG = 0, ZBG = 1, TBG = 0 - Axes X Y and T begin on assigned input, Axis Z begins on GO command, the following command lines will determine how the coordinated motion is begun as indicated: BCI - input 1 will begin motion (recall that "C" is same as "XYZT") BYZI - input 2 will begin motion BZTI - GOZ command will begin motion

3.3.8.2. END The End command terminates a move process. The command syntax is E followed by a list of axes, or by C if all axes must be stopped.

E<axis><cr> The effect of an End command depends on the type of motion mode. In repetitive or cyclic modes (1, 3, 16), the End command prevents the next sequential move or cycle.

Page 52: Acspl Software Guide Revision 3 00

3-30 PROGRAMMING THE CONTROLLER WITH ACSPL

ACSPL Software Guide - Document revision no. 3.00

In continuous modes (10, 12, 21, 22), the End command stops motion. In single-profile modes (0, 4, 8, 9, 15), the End command has no effect. In response to an End command, the current motion is not terminated immediately (except in modes 10, 21 and 22). The motion terminates only when the axis reaches its present target point. For an immediate stop use the Kill command. End motion of Y axis

EY <cr> E Master command Y Axis notation <cr> End of command

End motion of all axes

EXYZT <cr> E Master command XYZT All axes <cr> End of command

End motion of X and Y axes

EXY <cr> E Master command X Axis notation Y Axis notation <cr> End of command

3.3.8.3. MOVE The Move command modifies the current target point. The new target point equals the registration position (M1) plus the Registration Distances (RD). See Registration Move on page 5-8. Start a registration move in axis X MX<cr>

3.3.8.4. GO After a Begin on Input command, if $BG=1, the motion will start when the controller receives the GO command. If $BG=0 motion will start when a proper input is activated (The input is defined by the Input Source (IS) parameter). The syntax of the command is GO followed by the first axis that is specified by the Begin command. After BXI command GOX After a BYZTI command GOY

Page 53: Acspl Software Guide Revision 3 00

PROGRAMMING THE CONTROLLER WITH ACSPL 3-31

ACSPL Software Guide - Document revision no. 3.00

3.3.8.5. KILL The Axis Kill command stops the motion immediately in a controlled manner, using the Kill Deceleration parameter (KD). X axis is moving in Point to Point motion mode 0.

KX<cr> stops the motion using XKD. In a coordinated motion, when the Kill command is issued for all the coordinated axes, the Vector Kill deceleration parameter (VK) is used. If the Kill command is issued for just some of the coordinated axes, in any case all the axes will be killed, each one of them using its own Kill Deceleration (KD). In this case the deceleration profile is not coordinated. X,Y, Z and T are moving in a coordinated Point to Point move. KX<cr> or KY<cr> or KZ<cr> or KXT<cr> stops all axes. Each one of them using its own Kill Deceleration (KD). For the same move, the command

KXYZT<cr> stops all axes but in a coordinated manner, using Vector Kill deceleration (VK). In Motion Mode 21 Kill aborts the motion without any deceleration. In Motion Mode 22 Kill acts as an End command.

3.3.8.6. KILL MASTER Kill Master distance (KM) master command stops the superimposed moves for all slave axes when moving in master-slave mode (MM12). See Section 4.8.

3.3.9. Wake Master Command. The Wake command is used in a multicontroller environment to wake up another unit for communication with the host/terminal. The 'W' must be preceded by '@' (the broadcast command ). The Wake Command starts with the '@' followed by 'W' and an ID number.

@W<ID><cr>

Wake up unit #3. @W3 <cr>

@ Broadcast to all controllers W Master command 3 Controller ID <cr> End of command

Page 54: Acspl Software Guide Revision 3 00

3-32 PROGRAMMING THE CONTROLLER WITH ACSPL

ACSPL Software Guide - Document revision no. 3.00

Up to 16 controllers can be connected to the same serial link. The controller’s ID range is 0 - F. Only the controller with the corresponding ID becomes active. If the ID does not exist there will be no response to the WAKE command.

3.3.10. Acknowledge Message Master Command In order to improve the reliability of the communication between the host computer and the controller, an acknowledge feature can be activated. For a full description see Enhanced protocol for Noisy environment on page 6-29.

3.3.11. Automatic Cyclical Buffering Commands These commands apply only for Automatic Cyclical Buffering, which is a subset of Motion Mode 16 (Arbitrary Path). The commands are only summarized here. For a complete description of the commands and their use see Section 5.12.1, page 5-41.

Note: This section deals with two distinct commands "next" (written 'n') and "Next" (written 'N').

3.3.11.1. n$<format> The next command (n) followed by an axis defines the data format for subsequent Next commands for that axis. <format> can be p (position only) or pt (position and time).

3.3.11.2. nC<set of axes><format> The next command (n) combined with Common subcommand (C) defines the data format for subsequent Next commands for multi-axis arbitrary path. <format> can be p (position only) or pt (position and time)

3.3.11.3. n<cr> The next command (n) followed immediately by a carriage return reports the current data format(s) for the Next commands, as determined by n$ and nC.

3.3.11.4. N$<data . . .data> The Next command (N) is used to enter data into the cyclical buffers. The data format of the Next command is determined by the n$, nC commands.

Page 55: Acspl Software Guide Revision 3 00

PROGRAMMING THE CONTROLLER WITH ACSPL 3-33

ACSPL Software Guide - Document revision no. 3.00

3.3.12. Memory Management Master Commands The memory of the controller consists of two parts: • A volatile RAM working memory. • A non-volatile flash type EEPROM back-up memory.

Only programs and parameters that are currently stored in the RAM working memory are used by the controller. The EEPROM back-up memory is equivalent to the hard disk in a PC. Upon power-up the complete content of the EEPROM non-volatile memory is loaded into the RAM. Any changes in the content of the RAM - altering parameters, program editing - will be lost when power is removed, unless a SAVE to the EEPROM non-volatile memory command is executed. When you change a parameter or a program, and you want to recover the old set of parameters and programs, use the LOAD command. The memory management command set includes the following master commands: LOAD Loads parameters and program from the nonvolatile

memory into the RAM. SAVE Saves the RAM contents in the nonvolatile memory.

CLEAR Erases all programs from the RAM RESET Resets controller’s parameters to factory defaults and

erases all programs both in the RAM and in the nonvolatile memory.

HWRES Hardware Reset. Resets the processors in the same way as after power up.

To avoid catastrophic results, each of these commands must be typed twice in a row, to be executed. You will be prompted to type the command again.

3.3.12.1. LOAD This command loads all parameters and ACSPL programs from the non-volatile EEPROM memory into the RAM working memory, completely overwriting the present content of the RAM. The command cannot be executed in the following cases (error 15) : • When a motor is enabled. • When Program Protect (PP) parameter is greater than 0. • While a program is running.

Example LOAD<cr>

the controller will ask you to repeat this command.

3.3.12.2. SAVE This command stores a copy of the content of the RAM working memory into the EEPROM non-volatile memory, completely

Page 56: Acspl Software Guide Revision 3 00

3-34 PROGRAMMING THE CONTROLLER WITH ACSPL

ACSPL Software Guide - Document revision no. 3.00

overwriting the present content of the EEPROM. The save process may take from 5 to 40 seconds. The typical number of saves that can be made is 100,000 (It is guaranteed for 10,000 times). The save process verifies that all data are written correctly by reading it after it is written. If an error is found, the controller responds with an error ?03. The number of accumulated errors during all save processes is kept in the Flash erR (FR) parameter. This parameter is kept in the EEPROM and is cleared only after a RESET command. Example

SAVE<cr> the controller will ask you to repeat this command.

Turning the power off during the save process results in erroneous memory and requires a RESET command.

It is recommended to set the QP parameter (for each axis) to a positive value before executing a SAVE command.

3.3.12.3. CLEAR This command erases all ACSPL programs in the RAM working memory. It does not affect the EEPROM non-volatile memory. To clear also the EEPROM non-volatile memory, use CLEAR command followed by the SAVE command. The command cannot be executed in the following cases (error 15): • From an ACSPL program. • When Program Protect (PP) parameter is greater than 0. • While a program is running.

Example CLEAR<cr>

the controller will ask you to repeat this command.

3.3.12.4. RESET This command resets all programs, parameters, group structure and the content of the arrays to factory default, and clears the EEPROM non-volatile memory. Because the RESET command changes all parameters to their factory defaults and clears all user’s programs, you must setup the controller before using it again (e.g. filter adjustment or loading ACSPL programs). Example

RESET<cr> the controller will ask you to repeat this command.

Page 57: Acspl Software Guide Revision 3 00

PROGRAMMING THE CONTROLLER WITH ACSPL 3-35

ACSPL Software Guide - Document revision no. 3.00

3.3.12.5. HWRES The HWRES command resets the processor. Its effect is similar to that of turning the power OFF and ON again. Example

HWRES<cr> the controller will ask you to repeat this command.

Note that it takes a few seconds to execute each of these commands. The controller prompts back (0>) only when execution is fully completed.

3.3.13. More Examples

How to make a single axis point to point move. SXMO1 Set X axis MOtor to 1

= on. Enable the X motor.

SXMM0 Set X axis Motion Mode = 0

Set to point to point mode.

SXAP1500 Set X axis Absolute Position = 1500

The target position is 1500.

SXLV5000 Set X axis Linear Velocity to 5000

Set Linear Velocity to 5000 counts/second.

BX Begin X axis motion Execute the move.

How to make an interpolated linear point to point move of X and Y axes. SXMO1 Enable the X motor. SYMO1 Enable the Y motor. SXMM0 Set X to point to point mode. SYMM0 Set Y to point to point mode. SXRP25000 Make a relative move of 25,000 counts for X

axis. SYRP15000 and 15,000 counts for Y axis. SVV20000 Set Vector Velocity to 20,000 counts/second. SVA2000000 Set Vector Acceleration to 2,000,000

counts/second2. SVD3000000 Set Vector Deceleration to 3,000,000

counts/second2. BXY Execute the interpolated move.

a How to activate the X axis in constant velocity mode. SXMM10 velocity mode. SXLV-20000 Set Set X to the velocity to 20,000

Page 58: Acspl Software Guide Revision 3 00

3-36 PROGRAMMING THE CONTROLLER WITH ACSPL

ACSPL Software Guide - Document revision no. 3.00

counts/sec, negative direction. BX Start moving. SXLV14500 Change the velocity “on the fly” to 14,500

counts/sec. EX Stop motion. The motor decelerates to a

stop.

3.4. Program Mode Operation Most Direct Mode commands and constructs have corresponding programming statement counterparts. In other words, instead of setting a parameter from an external terminal application or host program, you can run a program on the controller to set the parameter. Examples: Direct Mode Program Mode SXMM10 let XMM = 10

AZSE5 1234 TZ (5) = 1234

ATSE5 1234 5678 TT (5) = 1234

TT (6) = 5678

T1 disp X_BEGIN, Y_BEGIN (for a two-axis controller)

The examples above are simple and are intended just to show some instances of Direct Mode commands and the corresponding Program Mode statements. It should be understood that Program Mode also enables certain types of operations that cannot be done in Direct Mode. For example, in Direct Mode you cannot carry out arithmetic operations. There are several Direct Mode commands that are not supported by Program Mode counterparts. These commands are: • Motion execution: B, M, GO, E, K, KM

• Memory management: RESET, CLEAR, SAVE, LOAD, HWRES

• Group: G

• Next: N

• Wake: W

However, there is a mechanism for including these commands, or any other Direct Mode commands, in a program. The mechanism is the exec statement, described in Section 3.4.11. (Normally G and N are not used in a program.) There are a number of reasons why you might decide to operate the controller using a program. These include:

Page 59: Acspl Software Guide Revision 3 00

PROGRAMMING THE CONTROLLER WITH ACSPL 3-37

ACSPL Software Guide - Document revision no. 3.00

• Where sequences of commands are repeated, the sequences can be written as procedures in a program and stored in the controller’s EEPROM (non-volatile memory).

• With a program stored in it, the controller can be operated as a standalone unit.

• A program enables you to perform very complex time event procedures and to define precisely the steps required from the controller.

In this section, examples are given in Program Mode format. Starting in Chapter 4, examples are in Direct Mode format, except where Program Mode implementation is more applicable.

3.4.1. Understanding ACSPL Programming The controller comes with a set of software tools that includes the ACS Debugger. This application features a terminal program for direct mode operation and a development environment for program mode operation. The ACS Debugger is the recommended application for working with the controller. Alternatively, text editors like Notepad and communication software packages like PROCOMM can be used. The program memory space (RAM) varies from 4 Kbytes to 32 Kbytes depending on the controller model. This size is typically sufficient for 200 to 2500 program statements. The RAM is backed by a nonvolatile EEPROM. Many programs can be stored in memory but only one can be active. The number of programs is limited only by the amount of available memory. The tasks involved with ACSPL programming are: • Prepare and load an ACSPL program

• Compile the program

• Store and/or execute the program

These tasks are implemented using Direct Mode commands, which are described later in this section. If you use the ACS Debugger, these commands are either available in the user interface as menu options and/or toolbar buttons or are automatically implemented for you. If you prefer to use another application for your programming, you will need to issue the Direct Mode commands yourself.

3.4.1.1. Preparing and Loading ACSPL Program You can prepare your ACSPL program in one of the following ways: • Write the program on your host PC using ACS Debugger's editing

window and load it to the controller using ACS Debugger's loading commands. When you attempt to load the program, the controller checks it line-by-line for errors. If the controller reports an error, ACS Debugger stops loading the program and displays the line number

Page 60: Acspl Software Guide Revision 3 00

3-38 PROGRAMMING THE CONTROLLER WITH ACSPL

ACSPL Software Guide - Document revision no. 3.00

and the error. In such a case, correct the error and reload the program.

• Write the program in another text editor and then load it as a program file to the controller using a terminal application with file transfer capability. Before you can do the transfer, you need to put the controller into programming state followed by insertion state. The commands for changing the controller state are described later in Section 3.4.3. When you transfer the program file, the controller will display any errors that it detects in the terminal application window. Note that it is your responsibility to deal with the errors - the terminal application does not stop loading the program file even if the controller detects an error.

• Write the program directly on the controller using ACS Debugger's terminal window or another terminal application. To do so, you will need to use the Direct Mode editing commands described later in Section 3.4.3. Here too it is your responsibility to deal with any errors that the controller detects.

3.4.1.2. Compiling an ACSPL Program Your program needs to be compiled once it has been loaded to the controller. How compilation is invoked depends on the method that you used to prepare and load the program. If you used ACS Debugger's editing and loading features, the compilation is done automatically. Otherwise you will need to issue a Compile command as described later in Section 3.4.3. Compilation is not in the sense of converting the statements to optimized code native to the controller. Rather it consists of linking internal references (and reporting any errors encountered in that process) and some compression.

3.4.1.3. Storing and/or Executing an ACSPL Program When you load your program, it is stored in the controller RAM. If power is interrupted to the controller, the program will be lost. To avoid this, the program can be saved in the controller's nonvolatile memory (overwriting anything previously stored there) using the SAVE command, which is described in Section 3.3.12. ACSPL programs are interpreted at execution time. While many commands execute in 1 msec, some take longer. For a list of the factors that can affect command exection time, see "suspension state" the description of the T3 command in Section 3.3.6. Parameters can add to execution time. For example the execution time for the disp command, which displays a message via the communications link, depends on the length of the message. Execution time can be optimized but there is a cost in terms of response to external requests. The execution rate is set by default to be minimum 1 msec per command, with the controller assigning at least that interval to each command execution, even if it is more than necessary. This minimum interval can be suspended with the disable

Page 61: Acspl Software Guide Revision 3 00

PROGRAMMING THE CONTROLLER WITH ACSPL 3-39

ACSPL Software Guide - Document revision no. 3.00

command. In that case, even if a command executes in less than 1 msec, the next command executes immediately.

3.4.2. Getting Started When you are properly connected to the controller, the system prompts you with the Identification Number (ID) of the controller. (e.g. 0> when the ID is 0) At this stage you may enter the Program Editor by typing P<cr>. Once you are in the Editor you can Insert lines, Delete lines, List program lines, Compile the program, eXecute and Stop it.

3.4.2.1. Your First Programming Session Move the X axis a relative distance of 5000 and report when finished.

Prompt User’s entry Comments 0> P<cr> enter the Program editor P>1 I<cr> enter the Insert mode I>1 EXAMPLE: <cr> assign the program a label (name) I>2 let XMM=0<cr> set Motion Mode - Linear Point to

Point I>3 let XMO=1<cr> enable the MOtor I>4 let XRP=5000<cr> set Relative Position parameter to

5000 I>5 exec BX<cr> execute a direct command - Begin

motion in X axis I>6 till ^X_MOVE wait for completion of motion I>7 disp “OK” <cr> display message I>8 stop<cr> end of program I>9 <cr> return to program editor P>9 1,8L<cr> list the eight lines of the program The complete program is then listed: 1: EXAMPLE: 2: let XMM = 0 3: let XMO = 1 4: let XRP = 5000 5: exec BX 6: till ^X_MOVE 7: disp “OK” 8: stop P>1 To compile the program type: C<cr> The controller responds with this message 8 statements compiled. 16280 free bytes left. P>1 To run the program type :X EXAMPLE<cr> or X1<cr>

Page 62: Acspl Software Guide Revision 3 00

3-40 PROGRAMMING THE CONTROLLER WITH ACSPL

ACSPL Software Guide - Document revision no. 3.00

Summary of editing steps • In order to get into the Programming state you should type P. The

prompt changes from 0> to P>1 to indicate that you are in Programming state at line number 1.

• To start Inserting lines into the program you should type I. The prompt changes to I>1 to indicate that you are in insert mode at line number 1.

• Now you are ready to type the program lines. The first line in a program normally defines the label (or name) of the program.

• As you type your program, the prompt keeps indicating that you are in Insert mode and the current line number.

• When you finish typing the program press <cr> to return to program mode.

• To view the complete program you can List it by typing the line numbers you wish to view followed by L. The complete program is then listed.

• Before a program can be executed it must be Compiled. This is done by typing C. The controller responds with a compilation message.

• To run the program now, just type X followed by the label of the program (or the line number).

All editing commands must be typed in uppercase letters. The next step in editing a program is making changes to it. This is done with the Insert and Delete commands.

In the program EXAMPLE let us change the Relative Position parameter RP from 5000 to 6500. Prompt User’s Entry Comments 0> P<cr> enter the Program editor P> 4L view line 4 4:let XRP=500 P>4 D delete line number 4 P>4 I insert a new line number 4 I>4 let XRP=6500<cr> set the new value of RP I>5 <cr> return to program editor P>5

To run the changed program it should be compiled again.

Page 63: Acspl Software Guide Revision 3 00

PROGRAMMING THE CONTROLLER WITH ACSPL 3-41

ACSPL Software Guide - Document revision no. 3.00

3.4.3. Editing Commands

3.4.3.1. Program The P command puts the controller in Programming state. After this command is issued, the prompt changes to P>1 indicating that you are in programming state and at line number 1. If a program is already stored in the controller’s memory, each time you press the <cr> key the next program line is displayed. Pressing the - (minus) key, displays the previous line. The programming commands (enabled once the controller is in Programming state) are described below. You can also use programming commands directly by preceding them with P (without first entering Programming mode). To Exit the programming state type E. When using a range of line numbers with an editing command (for example, with Delete or List), use either a comma or a space to separate the range limits, but not both.

3.4.3.2. Insert The I command enables you to Insert lines into a program (including an "empty" program). It also enables you to send program files to the controller, if your terminal application supports file transfer. If there is no program in the memory the controller returns the I>1 prompt and is ready to accept your first line. To insert a new line (or new lines) into an existing program type the line number of the new command line followed by I<cr>. The existing lines are “pushed” down and are renumbered automatically.

Insert new lines into the following EXAMPLE program. 1: EXAMPLE: 2: let XMM = 0 3: let XMO = 1 4: let XRP = 5000 5: exec BX 6: till ^X_MOVE 7: disp “OK” 8: stop Insert between lines 2 and 3 the following new lines: let XLA=50000 let XLV=7500 To do that follow these steps: Prompt User’s entry Comments 0> P<cr> enter the Program editor P>1 3I<cr> insert line number 3 I>3 let XLA=50000<cr> type the line number 3

Page 64: Acspl Software Guide Revision 3 00

3-42 PROGRAMMING THE CONTROLLER WITH ACSPL

ACSPL Software Guide - Document revision no. 3.00

I>4 let XLV=7500<cr> type the new line number 4 I>5 <cr> return to program editor P>5 1,10L<cr> list the program

This is the new edited program: 1: EXAMPLE: 2: let XMM = 0 3: let XLA=50000 4: let XLV=7500 5: let XMO = 1 6: let XRP = 5000 7: exec BX 8: till ^X_MOVE 9: disp “OK” 10: stop

Each line is checked for syntax errors. If one is found, the inserted line is not accepted, an error message is issued and the editor does not advance to a new line.

3.4.3.3. Delete The D command lets you Delete lines from a program. To delete a line type the line number followed by D<cr>. To delete line number 7 type:

7D<cr>

To delete a range of lines type the range followed by D<cr>. To delete lines 7 to 18 type:

7,18D<cr>

3.4.3.4. List The L command enables you to List lines in the program. To list a single line type the line number followed by L<cr>. To list line number 7 type

7L<cr>

To list a range of lines type the range followed by L<cr>. To list lines 7 to 18 type:

7,18L<cr>

To list the first 10 lines which follow a label of a program type L/ followed by the label. To list the first 10 lines of program EXAMPLE type:

L/EXAMPLE<cr>

Page 65: Acspl Software Guide Revision 3 00

PROGRAMMING THE CONTROLLER WITH ACSPL 3-43

ACSPL Software Guide - Document revision no. 3.00

The List command can also be used to download programs from the controller, if your terminal application supports routing terminal output to a file (although this procedure is easier to accomplish using ACS Debugger). To accomplish this, enter the command:

1,<number>L

where <number> is a value ≥ number of lines in the program. The resulting file will include the List command that you entered and each program line will be preceded by the line number followed by a colon (:). To upload the program back to the controller (in programming state), first delete the List command line from the file. The line numbers do not have to be deleted.

3.4.3.5. List Labels The A command enables you to list labels in the program. To list all the labels in the memory type A<cr>. (When current line is 1.) A typical response to A command may be: 1:AUTOEXEC: 23:TEST: 35:DRIFT: 54:RUN:

To list labels in a range type the range of lines followed by A<cr>. To list the labels in the range 10 to 40 type:

10,40A The response will be: 23:TEST: 35:DRIFT:

To list all the labels from a certain line type the line number followed by A<cr>. To list all the labels from line 30 onward type:

30A The response will be: 35:DRIFT 54:RUN

3.4.3.6. Compile When you finish typing the program lines, you must Compile the program. This is done with the C<cr> command. The compilation lists the line number where the first error is found and the code of the error. When an error is located the compilation stops. A successful compilation ends with a message indicating the numbers of compiled lines and the free memory left.

Page 66: Acspl Software Guide Revision 3 00

3-44 PROGRAMMING THE CONTROLLER WITH ACSPL

ACSPL Software Guide - Document revision no. 3.00

A typical response to C<cr> command is: 7 statements compiled. 16280 free bytes left.

3.4.3.7. Execute The X command is used to eXecute a compiled program. To execute a program type the X command followed by a space and the label of the program. To execute program TEST type:

X TEST<cr> The program which follows the label TEST will be executed. The controller exits the program mode. To execute the program again type PX TEST<cr> To start execution from a certain line, enter the X command followed by the line number. To execute a program starting at line number 12 type: X 12<cr> The program which follows line number 12 will be executed. Executing by label is more flexible but more time consuming than executing by line number. If your ACSPL program is debugged, you don't expect to modify it soon, and program execution is time critical, then consider listing all labels (PA - see List Labels description) and replacing each PX<label> by the corresponding PX# .

3.4.3.8. Stop The S command Stops a running program. To stop a running program type S<cr> if you are in Programming state or PS<cr> if you are in Direct mode.

3.4.3.9. Saving The Program You must remember that a new program or changes to an existing program are lost when the controller is switched off or when a Hardware Reset (HWRES) is executed. To retain the program in the non-volatile memory you must save it. This is done with the SAVE command. To save the content of the RAM in the non-volatile memory type: SAVE<cr> The controller responds with following message: SAVE command takes a few seconds to save user's programs and par. in EEPROM. Please enter the command again if you wish to execute it. Type SAVE<cr> again to execute the SAVE command.

Page 67: Acspl Software Guide Revision 3 00

PROGRAMMING THE CONTROLLER WITH ACSPL 3-45

ACSPL Software Guide - Document revision no. 3.00

3.4.4. Program Structure ACSPL programs consist of one or more lines of source text with the following format: <line number> <label> <line number> <statement> ............. ............ <line number> <statement> <line number> stop

3.4.4.1. Subroutine A subroutine is a labeled set of statements ending with a ret or stop, to be executed when a call command is reached. When the ret command is encountered, control returns to the statement that follows the calling command. When a stop command is encountered the program stops. The format of a subroutine is: <line number> <label> <line number> <statement> ............. ............ <line number> <statement> <line number> ret or stop

ACSPL supports a special class of subroutines - Automatic Subroutines - which are invoked when a certain condition is met. (See Automatic Subroutines on page 3-72)

3.4.4.2. Line Numbers Line number is an integer that identifies program lines. ACSPL inserts the line numbers automatically when you write the program. (You do not type the line numbers.) Line numbers are used for editing and listing only. They cannot be referred to in the program. They can be used with the Program eXecution (PX) command to set the point to start execution from (see PX description in this section).

Page 68: Acspl Software Guide Revision 3 00

3-46 PROGRAMMING THE CONTROLLER WITH ACSPL

ACSPL Software Guide - Document revision no. 3.00

3.4.4.3. Statements Statements are the building blocks that make up programs. • A line can contain only one statement. • A line can contain up to 254 characters (including <cr>).

3.4.4.4. Labels A label serves to identify the statements immediately following it. Labels are referred to by flow control statements (see Section 3.4.14) and execute (X) commands (see Section 3.4.3). • A label must appear on a line by itself. • Labels must begin with a letter and can contain up to 8 alpha-

numeric characters. • Case is significant; MOVE_X and move_x are not equivalent. • A label must be followed by a colon. However, statements that

refer to the label (e.g., goto) must not include the colon. • In a statement that refers to a label (e.g., goto) the label must be

entered exactly as written. For example, there can be no following spaces.

• A subroutine must start with a label. Repeat: statement ............. ........... goto Repeat MOVE_X: legal label MOVE_1: legal label move_x: legal label 1_MOVE: illegal; a label must begin with a letter MOVE_X illegal; a label must be followed by a MOVE_X: let illegal; a label must be alone on a line FIRST_PROGRAM: illegal; a label cannot contain more then

8 characters

The following labels are reserved and have special meaning (See Automatic Subroutines on page 3-72): AUTOEXEC, AUTO_IN#, AUTO_M1$, AUTO_T1, AUTO_T2, AUTO_EX$, AUTO_LL$, AUTO_RL$, AUTO_ERR, AUTO_FLT, AUTO_ES, AUTO_SL$, AUTO_EN$, AUTO_TE$, AUTO_KB, AUTO_EI, AUTO_HT$, FKEY_0#

Page 69: Acspl Software Guide Revision 3 00

PROGRAMMING THE CONTROLLER WITH ACSPL 3-47

ACSPL Software Guide - Document revision no. 3.00

3.4.5. Operators ACSPL supports the following operators which are classified into four major groups: • arithmetic • relational • logical • mathematical

3.4.5.1. Rules • Only one mathematical operation can be performed in a program

line. V1=V2-V10*5 is an illegal operation it should be written as follows: V1=V10*5 V1=V2-V1 V1=(V2-V10)*5 is an illegal operation it should be written as follows: V1=V2-V10 V1=V1*5 • ACSPL supports only integer numbers (positive and negative).

If you want to add 1% to the Linear Velocity the calculation should be as follows: V2=XLV*101 V2=V2/100 let XLV=V2 Direct multiplication by 1.01 would be rejected by the editor. • Constants used in statements must appear on the right side of the

operator.

3.4.5.2. Arithmetic Operators + Addition V0= V1+100

- Subtraction V0= V1-100

* Multiplication V0= V1*100

/ Division V0= V1/100

% Modulus V0= V1%100

Note about modulus: If the value of the second operand is not 0, the result is the remainder of the integer division of the first operand by the second operand. If the value of the second operand is 0, the result equals the value of the first operand. Examples: V1= V2 % V3

Page 70: Acspl Software Guide Revision 3 00

3-48 PROGRAMMING THE CONTROLLER WITH ACSPL

ACSPL Software Guide - Document revision no. 3.00

If V2=11, V3=3 ⇒ V1 = 2 If V2= 13, V3=-3 ⇒ V1 = 1 If V2= 21, V3=0 ⇒ V1 = 21

3.4.5.3. Relational Operators = equals if XRP=10000

< smaller than till XCP<2000

> greater than, till YCP>5000

<= smaller than or equal to if XCP<=1000

>= greater than or equal to till XLV>=7500

<> not equal if XLA<>500000

3.4.5.4. Logical Operators & And V1=V2 & V3

| Or V2=V4 | V5

^ Not till ^X_MOVE

~ XOR V1=V0 ~ IP

3.4.5.5. Mathematical Operators abs Absolute of a variable V1=abs(V0)

min Minimum value of an array V1=min(TX)

max Maximum value of an array V1=max(TX)

avg average value of an array V3=avg(TY)

sqr Square root of a variable V6=sqr(V10)

Indirect addressing is not supported in abs and sqr operators.

3.4.6. Variables A variable is a name of a location in memory which holds information. The following type of variables are supported: • Internal • Program • Set • Report • Target Points Arrays • Sine tables and offsets • Servo processor’s arrays

Page 71: Acspl Software Guide Revision 3 00

PROGRAMMING THE CONTROLLER WITH ACSPL 3-49

ACSPL Software Guide - Document revision no. 3.00

3.4.6.1. Internal An internal variable holds information which describes motion status. These variables can be read only and cannot be changed by the program.

$_BEGIN Holds the result of the last BEGIN motion command. Its

content is identical to the value received in response to a T1 command. When a new begin status is produced, the variable is updated within approximately 5 msec. The Begin message value can be retrieved by an ACSPL program via the $_BEGIN state variable. If an automatic subroutine is used to detect the reason for a failure, make sure that the subroutine is delayed for at least 5 msec before recording the value of $_BEGIN.

$_END When a motion ends this variable holds the reason for the stop. Its content is identical to the value received in response to a T2 command. When a new end status is produced, the variable is updated within approximately 5 msec. The End message value can be retrieved by an ACSPL program via the $_END state variable. If an automatic subroutine is used to detect the reason for a failure, make sure that the subroutine is delayed for at least 5 msec before recording the value of $_END.

$_MOTION Holds the current stage of the velocity profile. $_MOTION can have one of the following values: 0 No motion. 1 Acceleration is being built. 2 Acceleration is constant. 3 Velocity is constant. 4 Velocity is being reduced (deceleration).

A laser controlled by output 3 must be activated when the X motor reaches constant velocity, and turned off when the X motor starts to decelerate. exec BX Motion begin command. till X_MOTION=3 Wait till reaching constant velocity. let HI=3 Activate the laser. till X_MOTION=4 Wait till decelerating. let LO=3 Turn the laser off.

Page 72: Acspl Software Guide Revision 3 00

3-50 PROGRAMMING THE CONTROLLER WITH ACSPL

ACSPL Software Guide - Document revision no. 3.00

3.4.6.2. Program The program variables are pre-defined locations in the memory of the controller for use by a program. Each variable has its own valid range of values, and may be read or written by a program.

I0 - I9 Ten built in indices (counters) for general purpose. Each

index (counter) may contain a positive value in the range (0-65535). They may be used for indirect references or assignments with all the array variables and as loop counters.

I5 = 100 I6 = V20/50 V9 = I1

V0 - V99 An array of 100 elements for general purposes. Each element can contain a value in the range (-2,147,483,648 - 2,147,483,647). Each element can be manipulated by arithmetical assignment and logical operations. By using an I# index, they can also be addressed indirectly .(In this case the index should be enclosed in parentheses) V13= 0 V(I5) = XLV * 5 let YCP = V5 V23=I3 The following loop is executed 30 times, resetting the contents of the V array. At the end I0=0: I0=29 loop I0 V(I0)=0 end

A0 - A<total>

Read only analog variables that hold the digital representation of the analog inputs. V0 = XA1 V1 = YA1 V4 = ZA0 The total number of analog variables is product dependent. See the product-dependent table in Chapter 6 or your product's hardware guide for more information. For example: In SB214 series controllers A0 and A1 are system parameters. The analog input range is [0-5V]. They are converted by a 10 bit Analog to Digital converter. 0 represents 0V, 1023 represents 4.995V

Page 73: Acspl Software Guide Revision 3 00

PROGRAMMING THE CONTROLLER WITH ACSPL 3-51

ACSPL Software Guide - Document revision no. 3.00

Another example: In the SB100x controllers A0 and A1 are axis parameters. The analog input range is ±10 V. They are converted by a 12 bit Analog to Digital converter. -2047 represents -10 V, +2047 represents +9.995 V.

S0 - S9 An array of 10 string variables. Each string variable can hold up to 10 characters. By using an I# index, they can also be addressed indirectly .(In this case the index should be enclosed in parentheses) S0=“O.K” S(I2)=“o.k” See also string operation: page 3-62

INT_LINE When the program flow is interrupted by a call command or by a transfer to an automatic subroutine, the line number to which the control returns after encountering a ret command, is stored in the INT_LINE variable. INT_LINE can be changed by a program to a different value by the 'INT_LINE = <label> statement. Thus, causing the program to continue, upon a ret statement, from a different location. INT_LINE is equal to -1 before the first call is encountered. if INT_LINE = 15 | INT_LINE = V3 do INT_LINE = ERR_PRG end ... ... ERR_PRG: disp " Error.." See: Subroutine on page 3-45 Call command on page 3-65 Automatic Subroutines on page 3-72

TIME A built in timer which increments automatically every 1 msec. It holds a positive number in the range (0 - 4,294,967,295) - It is set automatically to zero upon power-up. It can be assigned any desired value by an assignment statement. TIME = V1 TIME = 5000 See: Timing on page 3-71

Page 74: Acspl Software Guide Revision 3 00

3-52 PROGRAMMING THE CONTROLLER WITH ACSPL

ACSPL Software Guide - Document revision no. 3.00

TIMER1 TIMER2

Two built in timers that, as long as their content is greater than zero, decrement automatically (down to zero) by 1 every 1 msec. Each one may hold a positive number in the range (0 - 4,294,967,295). They are set automatically to zero upon power-up. They can be assigned any desired value by an assignment statement. When the value reaches 0, the appropriate AUTO_T# automatic subroutine (if it exists) is activated. See: Timing on page 3-71 Array of timers on page 3-26

3.4.6.3. Set The set variables are controller parameters that can be written using the SET command in Direct mode. The set variables can be accessed by using their mnemonics. Within a program, those variables can be changed by a let assignment statement. If the parameter is an axis specific parameter, the mnemonic must be preceded by the axis notation. See Section 7.2 for a parameter reference. let XLV=50000 let YGA=5 let OP=255

3.4.6.4. Report The report variables are controller parameters that can be read using the REPORT command in Direct mode. All the set variables (excluding $ZP, $zp, $MD, $MZ, HI, LO) are report variables as well. See Section 7.2 for a parameter reference. They are accessed by using their mnemonics. If the parameter is an axis specific parameter the mnemonic must be preceded by the axis notation. V0=XCP V1=IP

3.4.6.5. Target Points Arrays T$(0) - T$(1023) An array of 1024 elements (per axis) which is used

by motion modes 3,16 and by PEG™ and Data Collection functions. They may also be used as a general purpose pool of storage variables. Each array element may be read or written using direct or indirect addressing. The range of each element is ±(109-1) This addressing can be done only by one of the V0 - V29 variables. V1= TX(I5)

Page 75: Acspl Software Guide Revision 3 00

PROGRAMMING THE CONTROLLER WITH ACSPL 3-53

ACSPL Software Guide - Document revision no. 3.00

V(I5)= TY(8) TT(15)= V1 TZ(16)= V(I5) See also Direct mode representation: on page 3-25

3.4.6.6. Continuous Path Arrays The segments of a path, which are used in continuous path (see mode 15 on page 4-26) may be referred by a program via the three arrays: CX(j) Each entry holds either the X coordinate of the end of a linear

segment, or the X center coordinate of a circular segment. 0 <= j <= 31.

CY(j) Each entry holds either the Y coordinate of the end of a linear segment, or the Y center coordinate of a circular segment. 0 <= j <= 31.

CA(j) Each entry holds the rotation angle for that segment. If CA(j) is zero, it means that the j'th segment is linear. 0 <= j <= 31.

See also Direct mode representation: see page 3-24.

j CX(j) CY(j) CA(j) Comments 0 1000 2000 0 Describes a linear segment which

ends at (1000,2000) 1 1000 1000 180000 Describes a circular segment

whose center is (1000,1000) and a rotation of 180° about the center point.

2 1000 5000 0 Describes a linear segment which ends at (1000,5000)

3.4.6.7. Sine Table Array and Sine Offset Array These arrays are used for commutation of AC brushless, DC brushless and step motors. They can be addressed in program mode as:

s$(0) - s$(255) for sine tables array o$(0) - o$(127) for sine offset array

Motor commutation is based on these arrays. Do not change their contents! The sine table can be used to implement a sine function. If you do so, bear in mind that: • 0 is represented as 0

• -1 is represented as -32767

• 1 is represented as 32767

• s$(0) holds the sine of 0

Page 76: Acspl Software Guide Revision 3 00

3-54 PROGRAMMING THE CONTROLLER WITH ACSPL

ACSPL Software Guide - Document revision no. 3.00

• s$(64) holds the sine of π/2

• s$(128) holds the sine of π

• s$(192) holds the sine of 3π/2

3.4.6.8. Servo Processor Arrays (D, K, J) These arrays are used for internal data exchange between the controller's CPU and its Servo Processors. Normally the arrays are set up when the controller is tuned.

Critical internal operations, including control loops, are based on these arrays. Do not change their contents!

They can be addressed in program mode as: D$(0) - D$(29) J$(0) - J$(19) K$(0) - K$(19)

3.4.7. State Variables The state variables describe the dynamic status of the controller. Each state variable is either true (1) or false (0). • State variables are used only in conditional statements. • There are two types of state variables: internal and input port.

3.4.7.1. Internal $_ERROR True whenever a Begin or End message with a value

greater than 9 is generated. It is false when $_END, $_BEGIN < 9 and upon enable motor command. The AUTO_FLT automatic routine is invoked once, when $_ERROR becomes true, and the causing error condition has not invoked the specific automatic error routine.

$_ENABLE True if the motor is enabled. $_READY True if a motion is ready to be executed after a 'Begin

on Input' command. $_READY is true just after motion calculations are done. When the appropriate input is activated, or a GO command is issued the motion starts and the state becomes false.

$_MOVE True while a motion is in progress. $_LL True if the left limit switch is active. The AUTO_LL$

automatic routine is invoked when this state becomes true. Note that the active state is defined by the Input Logic (IL) parameter.

$_RL True if the right limit switch is active. The AUTO_RL$ automatic routine is invoked when this state becomes true. Note that the active state is defined by the Input Logic (IL) parameter.

Page 77: Acspl Software Guide Revision 3 00

PROGRAMMING THE CONTROLLER WITH ACSPL 3-55

ACSPL Software Guide - Document revision no. 3.00

$_SYNC True when in Master-Slave mode and the slave is synchronized to the master. See MM12 on page 4-15

$_MD True when a Master Distance superimposed profile is in process. Its main usage is to indicate when a new MD can be issued while the present MD is not complete yet. See MM12 on page 4-15

$_INDEX True when the encoder index is encountered. It is false upon power-up. It becomes false after reading the index position ($IX).

$_MINDX True when the master encoder index is encountered. It is false upon power-up. It becomes false after reading the master index position ($MI).

$_MARK1 True when the registration input is encountered. It is false upon power-up. It becomes false after reading the registration position ($M1). The AUTO_M1$ automatic subroutine is invoked when the state becomes true.

$_ENER True when the encoder circuitry detects an illegal signal. It can be reset by turning the power off and on by RESET and HWRES commands, or by changing the Encoder Type ($ET). The AUTO_EN$ automatic routine is invoked when the state becomes true.

$_ENCNC True when the encoder is not connected. The AUTO_EN$ automatic routine is invoked when the state becomes true.

ES True if the Emergency Stop switch is active. The AUTO_ES automatic routine is invoked when the state becomes true. Note that the active state is defined by the Input Logic (IL) parameter.

$_HOT Reflects safety inputs handled by the application only. Must be specifically processed by ACSPL program. True when the motor’s temperature sensing input is open (=motor is hot). The AUTO_HTX automatic routine is invoked once, whenever this state becomes True.

HOST_ACK True when HP.4=0 or at=0 or AN=TN. It is False when HP.4=1 and at>0 and AN<>TN. See Enhanced protocol for Noisy Environment on page 6-29

DC_ON True when Data Collection is in process. $_PEG True when the $ axis PEG function is in process.

Available for X and Y axes only. $_RD True when the Registration Distance move is in

process. See Registration Move on page 5-8 MASTER True if the controller is awake. It is useful for

communication and synchronization of two, or more, controllers.

3.4.7.2. Input The input port state variables describe the status of inputs 1 - 80. Each input port state is true if the appropriate input is active.

Page 78: Acspl Software Guide Revision 3 00

3-56 PROGRAMMING THE CONTROLLER WITH ACSPL

ACSPL Software Guide - Document revision no. 3.00

The 80 input state variables are IN1, IN2,... IN80.

Input 1 to input 5 are supported by automatic routines. The report variable IP holds the status of IN1 to IN16. The least significant bit (in binary representation) represents INPUT 1. IP range is [0 - 65535]

IN16 IN15 IN14 IN13 IN12 IN11 IN10 IN9 IN8 IN7 IN6 IN5 IN4 IN3 IN2 IN1 Binary Value decimal IP value

bit 15 bit14 bit13 bit12 bit11 bit10 bit9 bit8 bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 3 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 1 11 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 15

When it is necessary to ignore any input, it is done by using the logical ‘AND’ operation. The SB1003 supports 80 inputs when the SB1003 I/O extension board is used. Inputs 17 to 80 are addressed via the N1.....N4 parameters. Ignore inputs 4 - 16: V0= IP & 7 1 1 0 0 0 0 1 1 0 0 0 0 1 1 0 1 IP

AND logical operator 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 decimal value 7 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 result V0

Ignore inputs 5 - 16: V1= IP & 15 1 1 0 0 0 0 1 1 0 0 0 0 1 1 0 1 IP

AND logical operator 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 decimal value 15 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 1 result V1

The controller is connected to a PLC via 5 of its inputs. Inputs 1 - 4 are used to signal the controller to which pre-assigned target point {TX(0) to TX(15)} it should move. Input 5 is used to signal motion execution. 1: AUTO_IN5: An automatic routine. 2: I0=IP & 15 Ignore inputs 5-16. 3: V0=TX(I0) Choose the target point. 4: let XAP=V0 5: exec BX

3.4.8. Assignment Command Values are assigned to variables in two ways: • The let command for Set Variables. • Using the ‘= ‘(assignment operator).

Page 79: Acspl Software Guide Revision 3 00

PROGRAMMING THE CONTROLLER WITH ACSPL 3-57

ACSPL Software Guide - Document revision no. 3.00

3.4.8.1. Set Variables Assignment Assignment of a value to a Set Variable must be done with the let command following this syntax: let <set variable> = <constant> or <variable> let XAP = 100000 let YLV = V21 let ZRP = V(I5)

3.4.8.2. Variables Assignment Values are assigned to all other variables by the ‘=‘ (assignment operator) according to this syntax: < variable> = <constant> or <variable> or <expression> TT(99) = V(I8) CA(I3) = V(I4)

I0 = 255 V4 = V3 I4 = 100 I5 = I4 + 1 I6 = I6 - 1 I0 = V20 / 10 V0 = -10 V9 = I1 V11 = ZAV V12 = V25 V20 = YLV * 2 V21 = V15 + XCP V29= TIME + 1000 V0 = V3 * V5 V7 = YAV + 1000 V(I2) = V10 & V(I9) V13 = TZ(I5) TIME = 0 TIMER1 = V1

S0 = "ACS" S1 = "-128" V0 = S0 (the value of V0 is 0) V0 = S1 (the value of V0 = -128) See: Strings on page 3-62

V5=-5 V12=-405 I0=8 V(I0)=abs(V5) (the value of V8 is 5) V6=abs(V12) (the value of V6 is 405)

Page 80: Acspl Software Guide Revision 3 00

3-58 PROGRAMMING THE CONTROLLER WITH ACSPL

ACSPL Software Guide - Document revision no. 3.00

V3=49 V4=33 V2=-25 V21=sqr(V3) (the value of V21 is 7) V22=sqr(V4) (the value of V22 is 5) V23=sqr(V2) Run-time error 93. Program is aborted.

Note: abs and sqr do not support indirect addressing. (e.g. V9=abs(V(I9)) is wrong.) Min, Max and Average. Statistical operators are operating on the part of T$ arrays that is defined by DL (Data collection Lower index) and DU (Data collection Upper index) set variables. They are most useful for data collection analysis. Error collection results are assigned to T$ array. The collected values are:

TX(0) TX(1) TX(2) TX(3) TX(4) TX(5) 50 37 125 -15 75 -37

let DL=0 let DU=5 V1=min(TX) (the value of V1 is 37) V2=max(TX) (the value of V2 is 125) V3=avg(TX) (the value of V3 is 39 )

3.4.9. Displaying Messages The disp command enables you to display messages via the communication link. The format of this command is: disp “<message>“, <variable>, <string variable> The list must be non-empty, but string constants, variables, and string variables can be in any order. (String variables are now correctly displayed as strings, and not as their decimal ASCII values as in earlier firmware versions). disp “Hello World” when this statement is executed it sends the following message to the host or terminal: Hello World

Page 81: Acspl Software Guide Revision 3 00

PROGRAMMING THE CONTROLLER WITH ACSPL 3-59

ACSPL Software Guide - Document revision no. 3.00

disp XLV,V5 if XLV=1000 and V5=7 the command sends this message: 1000 7 disp "X position is:", XCP, ". Error is :" , XPE Assuming X Current Position is 10000 and Position Error is 1, the command sends the following message: X position is: 10000. Error is: 1

The length of the displayed data in one statement is limited to 120 characters. If during the execution of a program, a display command is reached, and at the same time, the controller is busy with information (commands or reports) entered or sent directly through the communication link, the current task is not interrupted. Thus, the program is suspended until the direct command is executed completely. If during the execution of a program, a display command is reached, and the transmission rate is lower than the rate at which the messages are produced, the program is not suspended, instead some of the messages are not transmitted at all. A ‘disp’ statement can also include a ‘chr(n)’ argument, where n can be either a constant in the range 0 .. 255 or I# (program counter). disp chr(27), chr(4), "Position is:", XCP The command sends a sequence of control symbols (e.g., for a given type of terminal) followed by a message stating the current position (e.g., XCP = 1234567): <Escape character> <End of transmission character> Position is: 1234567 disp chr(I5) The value of I5 (program counter no. 5) is converted into ascii and sent to the host or terminal. For information about disp safeguards against noise and other interruptions, see Section 6.17.2.

3.4.10. 7-Segment Programming: "show" Statement The “show”statement is only one of several ACSPL constructs for programming a 7-Segment display. See related variables sf, sd in Section 5.14 .

Page 82: Acspl Software Guide Revision 3 00

3-60 PROGRAMMING THE CONTROLLER WITH ACSPL

ACSPL Software Guide - Document revision no. 3.00

Not all control products include 7-segment displays.

The show statement is very similar to the disp statement (see Section 3.4.9). Both have the same format with the following differences: • The show statement results are sent to the 7-segment unit while

the disp statement results are directed to the communication channel.

• The disp statement results are influenced by the current protocol (terminal / host / HHT); The show statement results are always in ASCII (terminal protocol).

• Only alphanumeric characters and several marks (?, !,-) can be displayed. Lowercase letters are uppercased. Non-displayable characters are replaced by blanks.

• Leading blanks before numeric content is automatically suppressed to one blank.

• The total string length produced from a single show statement must not exceed 30 characters.

• While disp chr(xxx) displays the ASCII code symbol corresponding to byte ‘xxx’, show chr(xxx) sends a byte directly to the 7-segment LED. For the bitmapping of the segments and symbols see Section 5.14.

Example: Parameter sf is set to 2, parameter sd is set to 200 ms: The controller executes an ACSPL program. The program has an AUTO_FLT routine that shows the fault details once it is invoked: AUTO_FLT: V1 = V1 + 1 disp “FLT” if X_ERROR do S1 = “X” if X_END > 9 do V2 = X_END end else do V2 = X_BEGIN end end if Y_ERROR do S1 = “Y” if Y_END > 9 do V2 = Y_END end else do V2 = Y_BEGIN end end show V1, “ FAULTS ”, S1, “ ERROR ”, V2 ret

Page 83: Acspl Software Guide Revision 3 00

PROGRAMMING THE CONTROLLER WITH ACSPL 3-61

ACSPL Software Guide - Document revision no. 3.00

The 7-segment unit is empty (dark). X & Y are moving in a coordinated common point to point motion; Z is moving in constant velocity in positive direction; T is moving in constant velocity in negative direction. After a while, motor X fails to perform the desired motion profile and the coordinated motion of X & Y stops with End error messages of 25 and 9 respectively. The 7-segment unit now shows the following: (1) and waits 200 ms.; ( ) dark display - waits 200 ms.; (F) and waits 200 ms.; (A) and waits 200 ms.; (U) and waits 200 ms.; (L) and waits 200 ms.; (T) and waits 200 ms.; (S) and waits 200 ms.; ( ) dark display - waits 200 ms.; (X) and waits 200 ms.; ( ) dark display - waits 200 ms.; (E) and waits 200 ms.; (R) and waits 200 ms.; (R) and waits 200 ms.; (O) and waits 200 ms.; (R) and waits 200 ms.; ( ) dark display- waits 200 ms.; (2) and waits 200 ms.; (5) and waits for one second before showing The above cycle repeats itself until sf is changed or PX (program execute) command is issued.

3.4.11. Including Direct Commands in a Program The exec command enables execution of direct commands by the controller as if they were entered via the communication link. The syntax of this command is: exec <direct command> The exec command can be used to implement the complete set of direct mode commands. The following operations, when needed within a program, can only be implemented by using the exec command:

Begin exec BX begin motion of X axis Move exec MX start a new move in axis X End exec EY end motion of Y axis Kill exec KX stop motion of X axis Define Group exec G3 DP PE define as Group 3 the

Desired Position and Position Error

SAVE exec SAVE save current program to the EEPROM

Page 84: Acspl Software Guide Revision 3 00

3-62 PROGRAMMING THE CONTROLLER WITH ACSPL

ACSPL Software Guide - Document revision no. 3.00

To change set variables, the let command should be used rather than the exec command. The let command is executed faster. If during program execution, an exec command is reached and the controller is already handling (receiving or responding to) a direct command, then the program is suspended until the controller has completed handling the first direct command. The direct command is executed in the queue of direct commands to be processed with the corresponding timing overhead.

The syntax of the exec command is not checked for validity during compilation. Mistakes in this line will generate the same run time error and response as in Direct mode.

3.4.12. Including Remarks In A Program In a program which is longer than a few lines, it is helpful to include remarks. You can use remarks to comment on the commands in the program. It will make the program easier to read by separating it into sections. You add a remark by typing rem followed by a space and the comment you want to include. After you type rem and a space ACSPL ignores any other text on the line. You can type rem and leave the rest of the line blank to add space to the program. Remarks do not affect the way the program runs; they simply annotate the commands for anyone who reads the program. rem this subroutine handles x motor errors rem Enable X motor rem Wait for Input 2

If you prefer to save space in the controller memory, you can use ! instead of rem. Every program line starting with ! is stripped out when the program is loaded into the controller.

If you use ! instead of rem, then your remarks will be missing if you read the program back from the controller to your host computer for editing. Therefore, it is recommended to keep a copy of the program outside the controller (e.g., on the host computer) to avoid losing your remarks.

Page 85: Acspl Software Guide Revision 3 00

PROGRAMMING THE CONTROLLER WITH ACSPL 3-63

ACSPL Software Guide - Document revision no. 3.00

3.4.13. Strings ACSPL contains an array of 10 string variables S0 through S9. See: Operator-Controller Interaction on page 3-78.

3.4.13.1. Relational Operations The relational operators can be applied to string variables. However, when a comparison is made (in an if command, for example) only the first 4 characters are compared. if S3 = "YES" call sub1 if S1 <> "NO" call sub2 Two string variables can be compared. However, only the first 4 characters of each string are compared. if S3=S5 call sub3

3.4.13.2. Converting A String Into Its Numeric Value A string variable that contains numerical characters can be converted into numeric value by assigning it to a numeric variable. V(I8) = S3 V7 = S7 If the first character in the string is neither a numeric one, nor the minus sign, the conversion result is 0. If the string starts with a numeric character, and includes a nonnumeric character(s), the partial numeric string, up to the first nonnumeric character will be converted. string value conversion result S0="ACS" S1="-128" S2="B23" S4="16C56" S5="+341" S6=" 43" ; with a leading space

V0 = S0 V0 = S1 V2 = S2 V3 = S4 V3 = S5 V4 = S6

V0=0 V0= -128 V2=0 V3=16 V3=0 V4=0

Due to internal format of this statement, only variables V0...V29 can be used in string to variable conversion.

As of firmware V19d, disp <string variable> displays the string. Prior to that version, it displayed the string's numerical value.

Page 86: Acspl Software Guide Revision 3 00

3-64 PROGRAMMING THE CONTROLLER WITH ACSPL

ACSPL Software Guide - Document revision no. 3.00

3.4.14. Controlling Program Flow

3.4.14.1. Wait The wait command pauses the program for a specified length of time. The syntax of this command is: wait <constant> or wait <index> where <constant> is the pause time in milliseconds. <index> contains a value which is interpreted to milliseconds. wait 500 wait for 500 milliseconds wait I0 if I0=1500 then wait for 1.5 seconds

3.4.14.2. Till The till command pauses the program until a condition is met. The syntax of this command is: till <condition> where <condition> can be a mathematical, relational, or state varialbe condition or a logical combination of two conditions. till X_ENABLE Wait till motor X is enabled. till Y_READY Wait till motor Y is ready to move. till ^Z_MOVE Wait till motor Z is not moving. till MASTER Wait till the controller is awaked. till IN2 Wait till input 2 is on. till ^IN16. Wait till input 16 is off. till X_LL Wait till X’s left limit switch is activated. till ^T_MOVE & ^IN1 Wait till motor T is not moving and input 1

is off. till IN3 | IN4 Wait till either input port 3 or 4 are on. till XCP >= 500000 Wait till X Current Position is greater or

equal to 500000 counts. till XAV < V8 Wait till the X Actual Velocity is smaller

than the content of V8. till YES = 4 | IN1 Wait till segment 4 is reached by Y motor,

or input 1 is on. till T_MOTION = 3 & YCP > 100000 Wait till T linear velocity is

built and Y Current Position is greater than 100000 counts.

Page 87: Acspl Software Guide Revision 3 00

PROGRAMMING THE CONTROLLER WITH ACSPL 3-65

ACSPL Software Guide - Document revision no. 3.00

3.4.14.3. Goto The goto command transfers execution to the statement that follows the <label>. The syntax of this command is: goto <label> goto START goto MOVE_X

3.4.14.4. Call The call command transfers execution to a subroutine. The syntax of this command is: call <label> The command transfers the execution to the statements that follow the <label>. When a ret command is encountered the program returns to the statement immediately after the calling statement (return address). • The INT_LINE variable holds the line number of the return

address. • One subroutine may call another subroutine. The call nesting level

is limited to 10. 1: MAIN: 2: <statement> .......... 6: call SUB1 7: <statement> ......... 12: stop 13: SUB1: 14: <statement> 15: call SUB2 16: <statement> ......... 25: ret 26: SUB2: 27: <statement> 28: <statement> ......... 39: ret In this sample program the statement on line 6 transfers control to the subroutine SUB1 on line 13. The call command on line 15 transfers control to subroutine SUB2. When the ret on line 39 is encountered, control returns to the statement on line 16. When the

Page 88: Acspl Software Guide Revision 3 00

3-66 PROGRAMMING THE CONTROLLER WITH ACSPL

ACSPL Software Guide - Document revision no. 3.00

ret on line 25 is encountered, control returns to the statement on line 7.

3.4.14.5. Loop The loop command is used to perform a group of statements several times. The syntax of this command is: loop <constant> or loop <Index> <statements> ....... end The statements between the loop command and the end command are executed (<constant>+1) times. Then, execution continues from the statement following the end command. If I# counter is used, it decrements each time the statements are executed, until it becomes zero. The statements are executed (I# + 1) times. A loop can be a part of another loop statement. The loop nesting level is limited to 10. loop 4 Execute 5 times. loop I4 Assuming that I4=8, execute 9 times. After exiting

the loop, I4=0

DEMO1: V1=0 loop 9 V1=V1+1000 let XAP=V1 exec BX till X_END<>0 end disp “finished 10 moves”

I0=10 DEMO2: loop I0 ......... ......... end I0=10 if XCP>=200000 goto DEMO2

Page 89: Acspl Software Guide Revision 3 00

PROGRAMMING THE CONTROLLER WITH ACSPL 3-67

ACSPL Software Guide - Document revision no. 3.00

3.4.14.6. If The if command tests a condition and alters program flow if the condition is met. The syntax of this command has these forms: •••• if <condition> goto <label> •••• if <condition> call <label> If the condition is met (true), the call or goto commands are executed. If the condition is false, then the statement following this line is executed. •••• if <condition> do <statements> end If the condition is met (true), the following do block is executed. If the condition is false, then the statement following the end line is executed. The if line can be followed (optionally) by an else command which may take one of these forms: •••• else goto <label> •••• else call <label> •••• else do

<statements> end

This statement is executed when the condition is false. An if statement can be a part of another if statement. The if nesting level is limited to 10. A <condition> may consist of up to four different conditions which are related to each other with logical operators. if XCP >= 40000 goto PAINT if X_MOVE goto MOVING if ^Y_MOVE & Y_END > 9 call STOP_Y if X_ENABLE & XCP >V1 | IN4 & X_END >9 call EXEC1

if X_ENABLE do If X is enabled, then execute the following let XAP=1000 do block, else, execute another do block. exec BX end else do disp " X Motor is not enabled!" end

Page 90: Acspl Software Guide Revision 3 00

3-68 PROGRAMMING THE CONTROLLER WITH ACSPL

ACSPL Software Guide - Document revision no. 3.00

This example demonstrates if nesting and to what level of nesting each statement belongs. if I0 > 0 do ;Level 0 if V1 > 0 do ;Level 1 V5=YAP ;Level 2 if IN1 call L1 ;Level 2 if IN2 do ;Level 2 let OP=4 ;Level 3 call L2 ;Level 3 let YLV=V3 ;Level 3 end ;Level 2 else do ;Level 2 wait 500 ;Level 3 end ;Level 2 end ;Level 1 if V2=0 goto L3 ;Level 1 end ;Level 0 else call POSITION ;Level 0

3.4.14.7. Do A do block is a group of statements that follow an if or else command. A do block is terminated with an end command.

If X axis reaches position 120000 stop it. If not, goto subroutine VEL. After stopping X, check if Y is moving and stop it. If Y is stationary, goto label JOG. VEL: if XCP>=120000 do exec KX if Y_MOVE do exec KY end else goto JOG end goto VEL

3.4.14.8. Case The case statement allows an ACSPL program to react according to the state of individual bits of a variable. A case block consists of sub case blocks, each one headed by a case label. The case label defines the true condition for which the sub case block is executed. If more than one state bit is true, then all the corresponding sub case blocks will be executed. A case statement cannot be executed from within another case statement.

Page 91: Acspl Software Guide Revision 3 00

PROGRAMMING THE CONTROLLER WITH ACSPL 3-69

ACSPL Software Guide - Document revision no. 3.00

A case statement can execute a call statement to another subroutine in which another case block is used. Such case nesting is limited to 10 levels.

Syntax Of Case Block case <variable> <case label>: <statements> <case label>: <statements> break <case label>: <statements> <case label>: <statements> end

The syntax of the case label is: <bit number>_<bit state> Where: <bit number> a number in the range 1-32. It points to the bit

which is checked within the <variable> <bit state> the state of this bit. OFF (=0), ON (=1).

• More than one state may refer to the same block. • A case block is terminated by an end statement. Assume that V10 contains information received from the host computer about which function should be executed. If V10.0=1 set the velocity to 10,000 counts/sec. If V10.1=1 call the Home routine. If V10.2=0 disable the motor. If V10.2=1 enable the motor. If V10.0=1 and If V10.2=1 (V10=5) then the velocity is set to 10,000 and the motor is enabled. Case V10 01_On: let XLV=10000 02_On: call Home 03_Off: let XMO=0 03_On: let XMO=1 end

Page 92: Acspl Software Guide Revision 3 00

3-70 PROGRAMMING THE CONTROLLER WITH ACSPL

ACSPL Software Guide - Document revision no. 3.00

• If V10=1 (0...01 binary) the velocity is set to 10,000 (case 01 is

true). • If V10=4 (0...0100 binary) the motor is enabled (case 03 is true). • If V10=5 (0...0101 binary) both cases are true and are executed.

3.4.14.9. Break Used in case blocks. After the execution of a sub case block the program continuous to check the next sub case block. A break statement transfers the execution to the first statement after the end of the case block.

3.4.14.10. Disable Normally, one ACSPL statement is executed per 0.001 second, even if the actual execution time is less than 0.001 second. At the remaining time the controller checks the communication link and responds to its commands. When a till statement is executed, the program checks if the condition is true once per 0.001 second. Once the condition is met, the program advances immediately to the next statement. The disable statement cancels all background tasks and forces the continuous execution of the program’s statements. This speeds up the execution of the program by a factor of x2 to x3. The following background tasks are suspended during "disabled" state: • Input/output message processing (including exec command

processing, since the exec command parameters are redirected to the input queue for processing). The messages are buffered but not processed.

• Motion start/end processing, including the kill command and velocity update in jogging mode.

• Communication shutdown switch check. • 7-segment indicator output.

Disable state remains in effect until terminated by an enable statement.

3.4.14.11. Enable The enable statement terminates the disable state. When a program starts, it is always in enable state. Disable state is automatically switched into an enable state when the st parameter is set to 1. (step mode). If a program in a disable state is interrupted by an automatic routine, and this routine switches the program to enable state, then upon return to the calling routine the disable state is renewed.

Page 93: Acspl Software Guide Revision 3 00

PROGRAMMING THE CONTROLLER WITH ACSPL 3-71

ACSPL Software Guide - Document revision no. 3.00

3.4.15. Timing An internal clock in the controller starts working when the system is powered up. This internal clock enables you to check and program accurate time events. The variable TIME is used as a time counter. Its value is changed every 1 msec. Measure the time for a point to point motion CHECK: label of subroutine till X_MOVE wait for X axis to move TIME=0 reset the TIME variable till ^X_MOVE wait for X axis to stop V1=TIME record the time disp “MOTION time = “, V1 display the motion time

Two additional variables TIMER1 and TIMER2 are active and decrement their value every 1 msec as long as it is not 0. When their value reaches 0, an automatic subroutine (AUTO_T1 and AUTO_T2 respectively) is invoked.

In this example the TIMER1 is used as a 60 seconds time out. Start motion in X axis and wait for a signal in INPUT1. If this signal appears within 1 minute, the process is correct. If the signal does not appear within 1 minute, a warning message is issued and the process is stopped. let XMO=1 Enable X axis motor let LO=1 Switch off OUTPUT1 RUN: Label of program TIMER1=60000 Set the timer for 1 minute (60,000

msec) let XRP= 20000 Define Relative Position exec BX Begin motion in X axis till X_END=1 Wait for successful end of motion till IN1 Wait for a signal in INPUT1 goto RUN Start the process again If the process does not complete within

1 minute, AUTO_T1: the automatic subroutine is invoked. disp “faulty process” A message is displayed , let HI=1 a signal is sent to OUTPUT1 and stop the process is stopped

The following segment protects the program from hanging up if the X Current Position never reaches the value of V1. If that position is not

Page 94: Acspl Software Guide Revision 3 00

3-72 PROGRAMMING THE CONTROLLER WITH ACSPL

ACSPL Software Guide - Document revision no. 3.00

reached within 500msec, AUTO_T2 automatic subroutine is invoked, and sends a message to the host (terminal). TIMER2 = 500 till XCP > V1 TIMER2 = 0 ...... ...... stop AUTO_T2: disp "Motor has not reached the desired position" stop

3.4.16. Automatic Subroutines An automatic subroutine is invoked automatically when a certain condition is met. An automatic subroutine must follow these rules: • Its label must be one of the following reserved labels. • It should be terminated with a ret or stop command.

If a condition is met while the controller is not busy with another program, the automatic subroutine starts running in less than one msec. If a condition is met while a program is running, the current statement is completed, and then, the relevant automatic subroutine is invoked. Upon a ret command, the controller continues with the next statement of the interrupted program (unless the INT_LINE variable was altered by the subroutine. See page: 3-51). If a stop command is encountered in the subroutine the program stops. Automatic subroutines may also be activated by a call command.

3.4.16.1. AUTOEXEC When a program is labeled AUTOEXEC it is executed automatically two seconds after system power-up has completed. The delay enables the user to interfere (via the communication link) and prevent the execution. If a command line (even an empty command line containing only <cr>) is received within those first two seconds, the execution of the AUTOEXEC is prevented. When partial communication* is used, AUTOEXEC is executed immediately - without the two second delay.

* Set by DIP switch on the faceplate of the controller (see Section 3.4.19 and the hardware and setup

guide). The purpose of the partial communication option is to prevent the operator from interfering with program execution and from inserting wrong data or commands. When partial communication is set, serial communication is restricted to the following:

• The controller accepts only responses to input commands. • The controller sends only disp messages to the communication link.

Page 95: Acspl Software Guide Revision 3 00

PROGRAMMING THE CONTROLLER WITH ACSPL 3-73

ACSPL Software Guide - Document revision no. 3.00

Another way to prevent AUTOEXEC execution is to turn on both X-axis limit switches (right and left). The logic is as follows: when the controller reaches a point where it should invoke AUTOEXEC, it first checks the state of the limit switches and if they are both on, it doesn't proceed with AUTOEXEC execution. If you decide to use the limit-switch based method for preventing AUTOEXEC execution, bear in mind that the limits must remain on for at least two seconds (unless partial communication is used).

Upon power-up the motor is activated in jog mode (MM=10) and runs continuously: AUTOEXEC: let XMO=1 Enable the motor let XMM=10 Choose jogging mode 10 let XLV=50000 Set the speed to 50,000 counts/sec exec BX Start motion stop

3.4.16.2. AUTO_ES Invoked when the motor is enabled and one of these conditions is met: • Emergency Stop signal is active. (Error 22) • Drive fault signal is detected. (Error 26)

The following automatic subroutine is invoked either when Emergency-Stop is activated, or when a drive fault is detected. The program analyzes the cause, and sends the appropriate message to the host/terminal: AUTO_ES: if ES do Is it an Emergency ? disp "Emergency condition" Yes end else do Drive fault condition disp "Drive fault" end ret The polarity of this signal is defined by the Input Logic (IL) parameter.

3.4.16.3. AUTO_ERR Invoked when the absolute Position Error (of either X , Y, Z or T): • Exceeds the ERror limit (ER), while acceleration is zero, • Error during Acceleration (EA) when accelerating / decelerating.

(End message 25)

Page 96: Acspl Software Guide Revision 3 00

3-74 PROGRAMMING THE CONTROLLER WITH ACSPL

ACSPL Software Guide - Document revision no. 3.00

Whenever an excessive error develops, output 1, which controls a red light error indicator, is activated: AUTO_ERR: let HI=1 Activate output 1 ret

3.4.16.4. AUTO_LL$ Invoked if Left Limit switch is activated. AUTO_LLX: disp "Warning, X left limit is on" ret The polarity of this signal is defined by the Input Logic (IL) parameter.

3.4.16.5. AUTO_RL$ Invoked if Right Limit switch is activated. AUTO_RLT: disp " Warning, T right limit is on" ret The polarity of this signal is defined by the Input Logic (IL) parameter.

3.4.16.6. AUTO_IN# Invoked when INPUT # (1 TO 5) is activated. The polarity of this signal is defined by the INput logic (IN) parameter.

The following program implements a position jog. Each time input #1 is activated, the Y motor moves 100 counts forward: AUTO_IN1: let YMM=0 Set point to point mode let YRP=100 Set the distance exec BY Move till ^Y_MOVE Wait till motion ends ret

3.4.16.7. AUTO_SYS This new automatic routine is a powerful tool for handling and analyzing of system errors. Whenever a system error is produced (?##), this routine is activated. When a system error occurs, the error number is automatically assigned to the new parameter LS (Last System error) and the AUTO_SYS is activated.

Page 97: Acspl Software Guide Revision 3 00

PROGRAMMING THE CONTROLLER WITH ACSPL 3-75

ACSPL Software Guide - Document revision no. 3.00

AUTO_SYS is activated on errors in the range: 0≤ error number ≤ 41 and error # ≥ 90. (See definition of Last System error parameter in Chapter 7 and also list of errors in Section 7.3.5, page 7–78.)

An attempt is made to set a V variable which does not exist - AVSE121 ##. Error message ?19 is produced.. LS is set to 19. AUTO_SYS is invoked:

Protection against input bouncing

If an input is bouncing, the AUTO_IN subroutine may be activated repeatedly. To prevent the adverse effect of this situation, use a counter that counts the number of activations. Only when the counter equals 1, the desired process should be executed. The counter must be cleared elsewhere before the subroutine can be activated for the first time. The following example demonstrates how to prevent multiple moves when the Input1 might bounce. AUTO_IN1: V0=V0+1 Increment the counter if V0=1 do Check the counter let YMM=0 Set point to point mode let YRP=100 Set the distance exec BY Move till ^Y_MOVE Wait till motion ends end V0=V0-1 Decrement the counter ret

3.4.16.8. AUTO_T1 Invoked when TIMER1 is decreased from 1 to 0.

The subroutine displays the position of the two motors every half a second. TIMER1 may be initialized for the first time with a direct command AtSE1 500<cr> AUTO_T1: disp "X Position=",XCP," Y Position=",YCP TIMER1=500 Re-arm TIMER1 ret

3.4.16.9. AUTO_T2 Invoked when TIMER2 is decreased from 1 to 0.

Page 98: Acspl Software Guide Revision 3 00

3-76 PROGRAMMING THE CONTROLLER WITH ACSPL

ACSPL Software Guide - Document revision no. 3.00

3.4.16.10. AUTO_FLT AUTO_FLT is a general purpose handling subroutine which is invoked when the causing error condition has not invoked the specific error related automatic subroutine. For example, when the Emergency-Stop input is activated, generating End error message 22, if AUTO_ES does not exist AUTO_FLT is invoked. Motion error occurred and we want to analyze it. AUTO_FLT: wait 5 if X_BEGIN =20 goto MOT_OFF if X_BEGIN =10 | X_BEGIN =11 goto NO_CALC ret MOT_OFF: disp “Motor is off” ret NO_CALC: disp “Difficult to calculate” ret

3.4.16.11. AUTO_SL$ Invoked when a left or right software limit is reached. Useful when using master slave mode. The AUTO_SL$ is activated when the motor is located within the [$PL, $PH] range and is commanded to a position which exceeds the range [$PL, $PH]. AUTO_SLX: exec KX disp “motor exceeds the permitted range” ret

3.4.16.12. AUTO_M1$ Invoked when the axis registration mark is activated and the $_MARK1 was false. The purpose of this routine is to stop a motor very accurately relative to a sensor which is connected to the registration mark input. Assuming that the Z motor is moving, using mode 0, whenever a registration input is encountered, the target position is changed to 10000 counts away from the mark position. AUTO_M1Z: V1=ZM1 Must read the mark position let ZRD=10000 Set the Registration Distance exec MZ Execute the move if Z_RD do till ^Z_MOVE Wait till done disp "New position=",ZDP end else do

Page 99: Acspl Software Guide Revision 3 00

PROGRAMMING THE CONTROLLER WITH ACSPL 3-77

ACSPL Software Guide - Document revision no. 3.00

exec KZ V1=ZM1+ZRD let ZAP=V1 exec BZ till ^Z_MOVE end ret

3.4.16.13. AUTO_EX$ When the profile generation is done, in modes 0, 1, and 3, the controller starts an internal clock. This internal clock is initialized to a user defined parameter: Target radius Delay (TD). The parameter defines the time period in milliseconds in which the motor is allowed to be out the Target Radius without any notice. However, if this time period has elapsed and the motor is out of the Target Radius for at least one millisecond, AUTO_EX$ is invoked. The user can tailor the content of AUTO_EX$ to the needs of the application (send a message, operate an output etc.). The AUTO_EX$ routine is invoked only once per motion. If a Kill command was issued before the routine has been invoked, it is not invoked during the current motion. This feature may be used by stepper axis for position correction.

3.4.16.14. AUTO_EN$ Invoked when either $_ENER (encoder error), or $_ENCNC (encoder not connected) for the $ axis becomes true (End message 21).

3.4.16.15. AUTO_TE$ Invoked when abs($PE) > $TE while the motor is not accelerating or not decelerating. The purpose of this routine is to detect if during motion the instantaneous position error exceeds the Tracking Error (TE) parameter.

3.4.16.16. AUTO_HT$ Invoked when $_HOT becomes true indicating that the motor is hot. This feature is available for systems with built in drives. MOTOR HOT sensor unlike hardware limits or overcurrent does not invoke any automatic action from the controller (Motor Off or something of the sort). The suggested way to handle this situation is by writing a user's ACSPL autoroutine.

3.4.16.17. AUTO_EI invoked whenever a change is detected in the EI input. Its usage requires an extended I/O board. This routine is supported only by an extended model of the SB1003.

Page 100: Acspl Software Guide Revision 3 00

3-78 PROGRAMMING THE CONTROLLER WITH ACSPL

ACSPL Software Guide - Document revision no. 3.00

3.4.16.18. AUTO_KB invoked whenever a change is detected in the KB input. Its usage requires an extended I/O board. This routine is supported only by an extended model of the SB1003.

3.4.16.19. FKEY_0# Invoked when one of the function keys is pressed. The function key must be defined earlier in the program. See: Assigning and Reporting Function Keys on page 3-82.

3.4.17. Controlling Automatic Subroutine Activation - Mask and Pend

MASK_SYS, MASK_$, MASK_ALL, PEND_SYS and PEND_$ are variables applied when an automatic subroutines that handle interrupt events are invoked. Each of these automatic subroutines has a dedicated bit in a MASK variable and in a PEND variable. If the MASK bit has been set to 0 (default value is 1), the automatic subroutine is not executed when invoked. If the PEND bit has been set to 1, the invoking is "remembered" and the automatic subroutine will be executed once the MASK bit is set to 1. If the PEND bit has been set to 0, the invocation is "forgotten" and the automatic subroutine will not be executed even if the MASK bit is "restored" by setting it to 1. On power up all MASK bits are set to 1 (all automatic subroutines that handle interrupt events are enabled). All PEND bits are set to 0 (masked subroutines will not be executed even if mask is removed). In the bitmaps below, bits marked (IV) are reserved for possible future use. In MASK variables these bits should be kept set to '1', in PEND variables, these bits should be kept set to '0'.

MASK_SYS & PEND_SYS structure (low part): 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 IV IV

Where: Bit 0 AUTO_ES Bit 1 AUTO_IN1 Bit 2 AUTO_IN2 Bit 3 AUTO_IN3 Bit 4 AUTO_IN4 Bit 5 AUTO_IN5 Bit 6 AUTO_T1 Bit 7 AUTO_T2 Bit 8 AUTO_ERR Bit 9 AUTO_FLT

Page 101: Acspl Software Guide Revision 3 00

PROGRAMMING THE CONTROLLER WITH ACSPL 3-79

ACSPL Software Guide - Document revision no. 3.00

Bit 10 Reserved Bit 11 AUTO_EI Bit 12 AUTO_KB Bit 13 AUTO_SYS Bit 14 AUTO_FOC Bit 15

MASK_SYS & PEND_SYS structure (high part): 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 IV IV IV IV IV IV IV IV

Where: Bit 16 Bit 17 FKEY_01 Bit 18 FKEY_02 Bit 19 FKEY_03 Bit 20 FKEY_04 Bit 21 FKEY_05 Bit 22 FKEY_06 Bit 23 FKEY_07 Bit 24 FKEY_08 Bit 25 Bit 26 Bit 27 Bit 28 Bit 29 Bit 30 Bit 31

MASK_$ & PEND_$ structure: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 IV IV IV IV IV IV IV IV

Where: Bit 0 AUTO_M1$ Bit 1 AUTO_EX$ Bit 2 AUTO_LL$ Bit 3 AUTO_RL$ Bit 4 AUTO_SL$ Bit 5 AUTO_EN$ Bit 6 Bit 7 AUTO_TE$ Bit 8 AUTO_HT$ Bit 9

Page 102: Acspl Software Guide Revision 3 00

3-80 PROGRAMMING THE CONTROLLER WITH ACSPL

ACSPL Software Guide - Document revision no. 3.00

Bit 10 Bit 11 Bit 12 Bit 13 Bit 14 Bit 15

MASK_ALL may contain one of three values: -1 When MASK_SYS + MASK_$ bits are all set to 1 (all interrupts

are enabled). 0 When MASK_SYS + MASK_$ bits are all set to 0 (all interrupts

are disabled). 1 When MASK_SYS + MASK_$ have mixed bits (some

interrupts are enabled and some are disabled). PEND_ALL may be set with one of two values: 0 Clears PEND_SYS + PEND_$ - cancel all pending

interrupts. Else Sets all bits in the PEND variables. This will cause invocation

to all the existing automatic routines. Such an operation may be useful for debug or diagnostic.

Once an interrupt occurs, the corresponding bit in the relevant PEND variable will be set to 1. If the same bit in the parallel MASK variable is set to 1 - the interrupt may be serviced, meaning that if the appropriate automatic routine exists and other conditions are right for running an ACSPL – the automatic routine is invoked and the corresponding PEND bit is cleared. At the beginning of the interrupt processing, this bit is reset to 0. If an interrupt could not be processed because of its mask, the bit in the PEND variable will stay 1, until either the corresponding MASK bit is set to 1 or the PEND bit is reset by the user. Syntax: <Variable> = MASK_$ <oper> <var_const> <Variable> = MASK_SYS <oper> <var_const> <Variable> = MASK_ALL | PEND_ALL <Variable> = PEND_$ <oper> <var_const> <Variable> = PEND_SYS <oper> <var_const> MASK_$ = <var> <oper> <var_const> MASK_SYS = <var> <oper> <var_const> MASK_ALL = <var_const> PEND_$ = <var> <oper> <var_const> PEND_SYS = <var> <oper> <var_const> PEND_ALL = <var_const>

Page 103: Acspl Software Guide Revision 3 00

PROGRAMMING THE CONTROLLER WITH ACSPL 3-81

ACSPL Software Guide - Document revision no. 3.00

Examples: Disable AUTO_IN1 MASK_SYS = MASK_SYS & 65533 Enable AUTO_LLX & AUTO_RLX

MASK_X = MASK_X | 12 Two buttons are connected via IN1 & IN2. Each button activates a different process. Once a button is pressed, a process starts. The process ends when the button is released. While a process is running, the other button must not interfere; It should be effective only if it is pressed when the other button is released. The following ACSPL automatic routines should implement these requirements. AUTO_IN1: rem Disable IN2 processing. MASK_SYS = MASK_SYS & 65531 P1: < Process 1> If IN1 goto P1 rem Reset IN2 possible pending bit. PEND_SYS = PEND_SYS & 65531 rem Enable IN2 processing. MASK_SYS = MASK_SYS | 4 ret AUTO_IN2: rem Disable IN1 processing. MASK_SYS = MASK_SYS & 65533 P2: < Process 2> If IN2 goto P2 rem Reset IN1 possible pending bit. PEND_SYS = PEND_SYS & 65533 rem Enable IN1 processing. MASK_SYS = MASK_SYS | 2 ret

3.4.18. Operator-Controller Interaction ACSPL supports a number of features for operator-controller interaction.

3.4.18.1. input When an input command is reached in an ACSPL program, the running program expects the operator to supply data. The syntax of this command is:

Page 104: Acspl Software Guide Revision 3 00

3-82 PROGRAMMING THE CONTROLLER WITH ACSPL

ACSPL Software Guide - Document revision no. 3.00

S#=input(n) or S#=input • The response of the operator is stored in one of the String

Variables. S0 through S9. • The length of the string is limited to 10 characters. • When using the first syntax the execution resumes only after n

characters are typed.

DISP1: Label. disp “define motion axis ? (X or Y)” Ask for an instruction. S1=input(1) Wait for one character reply. if S1=“X” goto MOVE_X If “X” goto subroutine MOVE_X. if S1=“Y” goto MOVE_Y If “Y” goto subroutine MOVE_Y. disp “wrong axis” display error message. goto DISP1 and try again.

• When the second syntax is used the string of information is

terminated by <cr>.

DISP2: Label. disp “Type the move distance in microns “ Ask for

information. S0=input Assign it to S0 as a

character string. V0=S0 Convert it into numerical

value and assign it to V0. Disp “The required distance is:”, V0 disp “Is it correct ? (Y/N)” S1=input(1) if S1 <> “Y” & S1 <> “y” goto DISP2

Verify.

V1=V0*1600 Perform a mathematical operation.

let XRP=V1 Assign it to Relative Position.exec BX Begin motion.

3.4.18.2. inkey Usage: V# = inkey If this statement is executed in Direct mode, all subsequent incoming characters are received through a special channel instead of regular processing. In such a case, direct commands are not processed and FKEY_## automatic routines are not effective after the inkey statement is used. All the incoming characters are available to the ACSPL routine through the inkey statement. If a new character is received before the

Page 105: Acspl Software Guide Revision 3 00

PROGRAMMING THE CONTROLLER WITH ACSPL 3-83

ACSPL Software Guide - Document revision no. 3.00

previous one has been 'caught' by the inkey statement, it overrides the previous one without any error indication. If the statement is executed before a new character is available, the function returns 0; otherwise it returns the ASCII value of the new character. When an <Esc> key is pressed, the controller immediately returns to normal receive process. If the statement is executed while the controller is in Programming state, 0 is always returned. User_Key: V10 = inkey if V10 = 0 goto User_Key rem Check if '1' was pressed. if V10 = 49 do .... end

3.4.18.3. echo Usage: echo After this statement is executed, each character sent to the controller in Direct mode is transmitted back through the communication channel. The echo state is eliminated after a noecho statement is executed or a new protocol is selected. The controller always starts in a noecho state.

3.4.18.4. noecho Usage: noecho If this statement is executed in Direct mode, all the incoming characters are no longer transmitted back to the communication channel. The statement has no effect if the controller is not in echo state. The controller always starts in noecho state.

3.4.18.5. Assigning and Reporting Function Keys Up to 8 keys on a standard PC keyboard can be defined as a function key for user interaction with the ACSPL program. Examples: The "A" key, the "?" key, the "F7" key, or any other key on the keyboard. Each function key is supported by an ACSPL user defined automatic routine. The autoroutine names for these 8 user-defined function keys are FKEY_01 to FKEY_08. When the assigned key is pressed, the corresponding subroutine is invoked.

3.4.18.5.1. Considerations When Using a Terminal Application If you are communicating with the controller via the ACS Debugger terminal window or any other terminal application, there are two issues to be aware of. The first issue is that the ACS Debugger terminal window and some other terminal applications require that you enter a <cr> before it will

Page 106: Acspl Software Guide Revision 3 00

3-84 PROGRAMMING THE CONTROLLER WITH ACSPL

ACSPL Software Guide - Document revision no. 3.00

transmit your keyboard input. Therefore pressing a function key will not produce a result until you also press <cr>. The second issue that can arise, in the ACS Debugger window or any other terminal application that supports its own shortcut keys, is that there can be a conflict if you define an FKEY_0# that is the same as one of the terminal's shortcut keys. In some cases, you can disable the terminal's shortcut keys, as for example, in Hilgraeve's HyperTerminal, which is supplied with some versions Microsoft Windows (from the HyperTerminal File menu select the Properties option and the Settings tab). But what happens if you are working with a terminal that does not allow you to disable its shortcut key support, and you want to define an FKEY_0# that is also used as a terminal shortcut key? If you intend to constantly use the terminal, then you will have to change your FKEY_0# definitions so that they don't conflict with the terminal's shortcut keys. If however, you are only using the terminal for debugging then you can temporarily assign another key or key combination for any conflicting FKEY_0#s for the duration of the debugging session. Once you have completed the debugging (and therefore no longer need to use FKEY_0#s with the terminal) you can reassign the original FKEY_0#s that had been in conflict with the terminal shortcuts. See the example for F8 later in this section.

3.4.18.5.2. General Instructions for Using Function Keys In order for a function key to activate the corresponding automatic routine, the following conditions must be met: • An autoroutine labeled FKEY_0# must exist. See Section 3.4.16. • The program is compiled. • The function key is enabled (see below). • The function key is not part of a command, which means that the

function key cannot be used when entering a command. • The program runs in terminal protocol (HT=1). Function keys can be defined, deleted, activated and deactivated. A one- or two-byte code (decimal format) is used to represent the function key in the function key definition (described below). If the function key is an ASCII control-key combination or printable keyboard character (e.g., alphanumeric, punctuation, or symbol), then use the corresponding ASCII code for that function key (one-byte code). If the function key is a non-ASCII key, such as F1 to F12, arrow key, Alt-Shift-key combination, etc., then use the PC keyboard special (extended-ASCII) code sequence (two-byte code). See Section 7.4 on page 7–80 for the code sequence. The function keys are controlled by array master commands: AFSE for defining, and AFRE for reporting. The AFSE command syntax:

Page 107: Acspl Software Guide Revision 3 00

PROGRAMMING THE CONTROLLER WITH ACSPL 3-85

ACSPL Software Guide - Document revision no. 3.00

AFSE [key_numb] [ena/dis][key length][key code)] where

[key_numb] Function key number [1 - 8]. [ena/dis] 0 - disable. 1 - enable [key length] 0 - Delete the function

1 - The function key is composed of 1 character 2 - The function key is composed of 2 characters

[key code] The one- or two-byte code for that key. Define <Esc> (27) as FKEY_01: AFSE1 1 1 27 where

AFSE 1 define FKEY_01 1 enable it 1 it is composed of one character

27 the ASCII code 27 To disable FKEY_01: AFSE1 0 To activate: AFSE1 1 To delete: AFSE1 0 0 Define F8 key (on the PC keyboard) as FKEY_08 and enable it. F8 is defined by two characters - 0, 66 : AFSE8 1 2 0 66 Take an FKEY_08 that is intended to be defined as the F8 key and temporarily redefine it in order to debug using a terminal application that has its own internal shortcut assignment for F8: AFSE1 1 2 85 85 defines the combination 'UU' as FKEY_08 Once you have completed using the debugging, redefine the F8 as FKEY_08: AFSE1 1 2 0 66 defines 'F8' as FKEY_08. To disply the current FKEY_0# definitions, use the AFRE command syntax:

AFRE[#] # Key number.(optional) AFRE displays the status of all the function keys.

Page 108: Acspl Software Guide Revision 3 00

3-86 PROGRAMMING THE CONTROLLER WITH ACSPL

ACSPL Software Guide - Document revision no. 3.00

AFRE8 displays the status of FKEY_08 only: 8 on 2 0 68

• Function keys are not active under host protocol (HT=0) • In order to avoid unexpected responses, it is recommended to restrict the use of

the Function keys to non-standard keys, like Esc, F1, F2, Ctrl, Alt etc., The Function keys can be set from within the program by proceeding the command with exec. Define on a PC keyboard F4, Alt S and Ctrl F1 as FKEY_01 to FKEY_03. DEFINE: exec AFSE1 1 2 0 62 exec AFSE2 1 2 0 31 exec AFSE3 1 2 0 94 ret FKEY_01: disp “F4 is activates this routine” <statements> ret FKEY_02: disp “Alt S activates this routine” <statements> ret FKEY_03: disp “Ctrl F1 activates this routine” <statements> ret

3.4.19. Partial Communication Shutdown When the partial communication switch is ON, only responses to ACSPL 'Input' statements and user defined function keys (FKEY#) are accepted. Also, only messages that are generated by ACSPL 'disp' statements are transmitted. It is recommended to partially shut down the communication link when it is necessary to prevent erroneous operations by the user. For the switch description see the relevant Hardware and Setup Guide.

3.4.20. Stepping Through A Program Once you finished writing a program it is possible to run it one step at a time or start it at any line. This mode is very useful in the debugging stage thus enabling to check the result of each line in the program.

Page 109: Acspl Software Guide Revision 3 00

PROGRAMMING THE CONTROLLER WITH ACSPL 3-87

ACSPL Software Guide - Document revision no. 3.00

This mode is controlled by the st parameter. When st is set to 0 the complete program is executed, when it is set to 1 only the specified line is executed. To run a program line by line starting at line number 8 set st to 1 Sst1 and then PX 8. Successive PX commands will execute the next lines in the program. 1: let OP=1 2: exec BX 3: exec BY 4: stop If st=0, upon PX1 the whole program is executed. If st=1, upon PX1 Only Output1 is set. Now PX command will cause the X motor to move. An additional PX command will cause the Y motor to move. A program can be easily debugged by switching the st parameter ON and OFF within the program. TX array contains 10 target points TX(100) - TX(109). The motor should step through these points. The following program should accomplish this task. 1: PROG1: 2: let XMM=0 3: let XMO=1 4: I1=9 5: I0=100 6: loop I1 7: V1=TX(I0) 8: let XAP=V1 9: exec BX 10: till ^X_MOVE 11: I0=I0+1 12: I1=I1-1 13: end 14: stop When the program was executed, it was found that the motor ran only through five target points. To debug the program, set st to 1 before the statement 8: let XAP=V1 and reset st to zero after it. It will allow you to interrogate the relevant variables during the execution of the program.

Page 110: Acspl Software Guide Revision 3 00

3-88 PROGRAMMING THE CONTROLLER WITH ACSPL

ACSPL Software Guide - Document revision no. 3.00

This is the new program: 1: PROG1 2: let XMM=0 3: let XMO=1 4: I1=9 5: I0=100 6: loop I1 7: V1=TX(I0) 8: let st=1 9: let XAP=V1 10: let st=0 11: exec BX 12: till ^X_MOVE 13: I0=I0+1 14: I1=I1-1 15: end 16: stop ‘PX PROG1’ starts the execution. ‘T3’ will tell you that the program is “stepping” at line 9. Now you may interrogate the values of I0, I1, V1 and TX to see if the program is being executed as expected (I0=100, I1=9, V1=TX(100) ). A ‘PX’ command will execute statement 9. Additional ‘PX’ will cause the program to continue running until it executes statement 8 again and to enter the stepping mode. I0, I1 and V1 can be interrogated again. (I0=101, I1=7, V1=TX(101)). I1 should be 8 and not 7. This result points to the redundant statement 14: I1=I1-1, which unnecessarily decrements I1 in addition to the loop block. This statement should be removed. When the debugging process is completed, you should also remove statements 8 and 10.

Page 111: Acspl Software Guide Revision 3 00

MODES OF MOTION 4-1

ACSPL Software Guide - Document revision no. 3.00

4. MODES OF MOTION

Starting in this chapter, examples are in Direct Mode format, except where Program Mode implementation is more applicable.

The SB line of controllers supports the following modes of motion:

Mode 0 Linear point to point. Mode 1 Linear point to point, repetitive. Mode 3 Move by sequence. Mode 4 Circular interpolation. Mode 8 Multiple velocities - point to point. Mode 9 Search for contact. Mode 10 Jogging (Constant velocity). Mode 12 Master-Slave. Mode 15 Continuous path following. Mode 16 Arbitrary path generation and cam. Mode 21 Manual control by Joystick. Mode 22 Position tracking.

The Motion Mode is set using the Set Motion Mode (S$MM#) Command. Next, each participating motor must be enabled with an S$MO1 Command. Once the mode has been set and the motor(s) enabled, a Begin (or Begin on Input) Command must be sent to start motion. The Begin and Begin on Input commands are part of the Motion Execution commands. These commands are described in Section 3.3.8. In certain motion modes, the usage of some Motion Execution commands (for example End and Kill) varies. These variations are mentioned in the motion mode descriptions.

Page 112: Acspl Software Guide Revision 3 00

4-2 MODES OF MOTION

ACSPL Software Guide - Document revision no. 3.00

Changing motion parameters (velocity, acceleration) while in motion (on the fly) does not affect the present motion. The exception to this rule is that in Jogging Mode (mode 10) and Joystick Mode (mode 21), changing the Linear Velocity (LV) after a Begin Command has been issued causes an immediate change. Two modes, Mode 4 and Mode 15, by definition involve coordinated motion of X and Y. Mode 4 is circular interpolation and Mode 15 can include segments with circular interpolation. Modes 0, 1, 3, and 16 can be used for coordinated moves involving two or more axes. These modes can also be used for single-axis moves. Unless the motion mode requires coordinated motion, each axis may be operated in a different motion mode with its own set of motion parameters. For example, X motor can run in jogging mode while Y motor is running in linear point to point mode. For a coordinated motion (linear, circular etc.), both axes must be in the same mode. For an example of how to activate a motion in Program Mode, see Section 3.4.2.

4.1. Mode 0 - Linear Point To Point (PTP)

4.1.1. Smoothed Trapezoidal Profile In this mode, each motor moves to the next desired Absolute Position ($AP), developing a smooth trapezoidal velocity profile (Figure 4-1). In the case of a non-coordinated move, the following Begin command and axis parameters are used: • Begin command is B$ (BX, BY, BZ, or BT)

• Smooth Factor is $SF

• Linear acceleration is $LA

• Linear deceleration is $LD

• Linear velocity is taken to be the absolute value of $LV

In the case of a coordinated move, vector parameters are used instead of axis parameters. The following Begin command and vector parameters are used: • Begin command is B<axes>, for example, BXY, BXZT, BC, etc.

• Vector smooth factor VS instead of SF

• Vector acceleration VA instead of LA

• Vector deceleration VD instead of LD

• Vector velocity VV instead of LV

Vector parameters are applied to any coordinated move for any combination of axes. The actual values of the velocities and

Page 113: Acspl Software Guide Revision 3 00

MODES OF MOTION 4-3

ACSPL Software Guide - Document revision no. 3.00

accelerations of the participating axes are defined by vector projection.

To move the X motor to absolute position 100,000 with a velocity of 50,000 counts/sec SXMM0 Set point to point mode SXLV50000 Set linear velocity to 50,000 count/sec SXAP100000 Set absolute position to 100,000 SXMO1 Enable the motor BX Begin movement

To execute the above move when Input 1 is activated SXIS1 Set the input source for X to 1 SXBG0 Start the move when Input1 is activated BXI Begin on input Now when Input 1 is activated the axis moves. To execute the above move when a GO command is issued SXBG1 GO activated BXI GOX

To execute an interpolated YT move on GO command SYBG1 STBG1 BYTI GOY

Page 114: Acspl Software Guide Revision 3 00

4-4 MODES OF MOTION

ACSPL Software Guide - Document revision no. 3.00

Figure 4-1 Effect of SF in point to point move

The effect of $SF is demonstrated in the following two velocity profiles. (Figure 4-1) While the motor moves, the target position for the next move can be specified and a Begin Command can be issued. The controller calculates the motion parameters of the next move, and upon completion of the present motion, the new move is executed. Using this method, the (calculation) delay between two successive motion can be minimized. The controller can signal via an output, when it is ready to accept a new move command. (See page 5-32). Specifying a new position command too early will be rejected. Error message 16 is generated. If the motor is not in motion, and an error message 16 is received, an E$ command must be issued. Otherwise the E$ command has no relevance for this motion mode.

4.1.2. Parabolic Profile

As of firmware version 17o parabolic profile is no longer supported as a standard feature. To order an earlier firmware version with parabolic profile support, contact the factory.

The smooth trapezoidal velocity profile is not always suitable for a step motor. A parabolic velocity profile is more suitable and can increase the throughput. This profile is supported for a single axis in modes 0, 1, and 3. The move starts with velocity $VM and acceleration $LA. It accelerates in a constant jerk to velocity $LV and acceleration $la.

Page 115: Acspl Software Guide Revision 3 00

MODES OF MOTION 4-5

ACSPL Software Guide - Document revision no. 3.00

Deceleration starts with a value of $ld, reaching the target position with velocity $VM and deceleration $LD. Using a microstepper with a resolution of 250 microsteps/step, it is necessary to move one complete turn (50,000 microsteps) according to these parameters: (Figure 4-2) LA = 5,000,000 la = 1,000,000 ld = 1,000,000 LD = 4,000,000 VM = 100,000 LV = 1,000,000 RP = 50,000

Figure 4-2 Parabolic profile

4.2. Mode 1 - Repetitive Linear Point To Point In this mode, the axes develop the same smooth trapezoidal velocity profile as in motion mode 0. The difference here is that each axis moves repetitively between the last two target points (target points are set with S$AP or S$RP), stopping at each point for a period defined by the Wait Time parameter. If a Begin on Input command is used, then the appropriate input should be activated before each move. In the case of a non-coordinated move, the following Begin command and axis parameters are used:

Page 116: Acspl Software Guide Revision 3 00

4-6 MODES OF MOTION

ACSPL Software Guide - Document revision no. 3.00

• Begin command is B$ (BX, BY, BZ, or BT)

• Smooth Factor is $SF

• Linear acceleration is $LA

• Linear deceleration is $LD

• Linear velocity is taken to be the absolute value of $LV

• Wait time is $WT

In the case of a coordinated move, vector parameters are used instead of axis parameters. The following Begin command and vector parameters are used: • Begin command is B<axes>, for example, BXY, BXZT, BC, etc.

• Vector smooth factor VS instead of SF

• Vector acceleration VA instead of LA

• Vector deceleration VD instead of LD

• Vector velocity VV instead of LV

• Wait time is defined by the largest (WT) of participating axes (XWT, YWT, ZWT, or TWT)

Vector parameters are applied to any coordinated move for any combination of axes. The actual values of the velocities and accelerations of the participating axes are defined by vector projection. An End command (E$) stops the motion right after completion of the current move. A Kill command (K$) stops the motion immediately (in an orderly manner). If any of the parameters used with this motion mode (except WT) are changed, the motion is stopped after completion of the current move.

4.3. Mode 3 - Move By Sequence In this mode, the axes develop the same smooth trapezoidal velocity profile as in motion mode 0. The difference here is that the axis (or axes) steps through an array of predefined position coordinates, stopping at each point for a period defined by the Wait Time ($WT) parameter. The use of the parameters for defining the trapezoidal velocity profile is the same as in motion mode 0 (Section 4.1). The use of the WT parameter is the same as in motion mode 1 (Section 4.2) If a Begin on Input command is used, then the appropriate input should be activated before each move. This motion mode also involves target arrays (see Section 3.3.7) and the following additional parameters:

Page 117: Acspl Software Guide Revision 3 00

MODES OF MOTION 4-7

ACSPL Software Guide - Document revision no. 3.00

LI Lower Index. The first position entry in the target array. Range: [0 - 1023].

UI Upper Index. The last position entry in the target array. Range: [0 - 1023].

SQ SeQuence parameter determines if the move is executed from LI up to UI (SQ=0) or from UI down to LI (SQ=1).

AO Array Offset. A constant value which is added to every target point.

ES Executed Step. (Read-only parameter.) The index of the step that is currently being executed. Range: [0 - 1023].

The user defines each target's absolute coordinates using the Array Set (AXSE, AZSE) command (see the example later in this section). Each step length is limited to 32,000,000 counts. Zero length steps are allowed. A target array can be reviewed by the Array REport (AYRE, ATRE) Commands. The Array Offset ($AO) and SeQuence type ($SQ) parameters are not required for this motion mode. They add flexibility. For example, using $AO, it is possible to repeat an array of movements with a different reference point (origin) without altering the content of the target array. If the SQ parameter is changed, the motion is stopped after completion of the current step. If any of the profile parameters (SF/VS, LA/VA, LD/VD or LV/VV) is changed, the change takes effect in the next step.

The instructions in this example develop the trajectory shown in Figure 4-3. Set the Low & Upper Indices of the sequence array: SXLI0 UI4<cr> X Axis, LI=0 UI=4 SYLI0 UI4<cr> Y Axis, LI=0 UI=4 AYSE0 100 200 100 0 100 <cr>AXSE0 0 100 200 100 0 <cr>

Define the array's coordinates

Double checking AXRE AYRE<cr> Report the arrays coordinates. SXMO1 SYMO1<cr> Enable the motor SXMM3 SYMM3<cr> Change to Mode:3 SXSQ0 SYSQ0<cr> Set the SeQuence move through the

array from LI to UI. Now everything is ready for motion: Begin Common motion: BXY<cr> Start moving to XY(0) up to XY(4).

Page 118: Acspl Software Guide Revision 3 00

4-8 MODES OF MOTION

ACSPL Software Guide - Document revision no. 3.00

Figure 4-3 Move by sequence

The following example shows how to key a given Z move to completion of a certain X move. Assume that the X move is step number 5 and SQ = 0: till XES=5 Check that ES has reached 5. till X_MOVE Check that $_MOVE has changed to true

(move in step 5 begun).

till ^X_MOVE Check that $_MOVE has changed to false (move in step 5 complete and WT started).

exec BZ Begin Z motion.

The TX, TY, TZ, and TT arrays are also used for arbitrary path generation (motion mode 16), data collection, position event generation, and for general data storage. So take precautions not to accidentally overwrite array data or to prepare a way to restore data. There are a number of ways to do so, some of these are: • Use nonoverlapping areas of the array.

• Use ACS Saver/Loader to save and restore the arrays.

• Use the controller's SAVE and LOAD commands.

Example of using the SAVE and LOAD commands. Assume that the T$ arrays are assigned to position targets and you want to collect data without losing the contents of the arrays, follow these steps: 1. Execute a SAVE command, storing the present content of the

arrays in the nonvolatile memory. 2. Activate the data collection feature. 3. After using the data, restore the content of the arrays with a

LOAD command.

Page 119: Acspl Software Guide Revision 3 00

MODES OF MOTION 4-9

ACSPL Software Guide - Document revision no. 3.00

If a coordinated motion (more than one axis) is made in MM3, the LI and UI values of the "lowest" axis are applied to all the participating axes. The lowest axis is determined according to the order X, Y, Z, T. Note however that SQ, is per axis, so some of participating axes can move through array targets from LI to UI while others move from UI to LI. Therefore the ES values of these axes will be 'complementary'. Example: Given XLI=2, XUI=10, XSQ=0; YLI=5, YUI=18, and YSQ=1; - Note that YLI and YUI will be ignored. After BXY is issued: XES = 2, YES = 10; After the next BXY: XES = 3, YES = 9 etc.

4.4. Mode 4 - Circular Point To Point This mode applies only for X and Y motors. A common use for this mode is where X & Y motors are connected to an XY table and the table is to be moved in an arc (circular interpolation). The movement starts at the present (if at rest) XY location along an arc defined by Rotation Angle (RA) and the Center Coordinates ($CC). RA is limited to 7,200,000 millidegrees (20 revolutions). The tangent velocity and acceleration are determined by the Vector Velocity (VV) and Vector Acceleration (VA) parameters.

The maximum radius allowed is 8,000,000 counts. The minimum radius required is 160 counts. If the calculated radius is outside these limits, the motion will not be executed and a begin message error 24 is produced.

Example: Draw an arc with the following characteristics: (Figure 4-4) • Center at (X=0,Y=0) • Starting location (3000,0) • Rotation Angle of 90 degrees (90,000 millidegrees) • Vector Velocity 30,000 counts/sec • Vector Acceleration 1,000,000 counts/sec² • Vector Smooth factor of 5 Follow these steps: SXMO1 SYMO1<cr> Enable X & Y motors SXMM0 SYMM0<cr> Change to motion mode 0 (Linear Point

to Point SXAP3000 SYAP0<cr>

Move to starting location

BXY<cr> Go to starting point SRA90000<cr> Set Rotation Angle = 90 degrees

Page 120: Acspl Software Guide Revision 3 00

4-10 MODES OF MOTION

ACSPL Software Guide - Document revision no. 3.00

SVV30000<cr> Set Vector Velocity = 30,000 counts/sec SVA1000000<cr> Set Vector Acceleration = 1,000,000

counts/sec² SVD1000000<cr> Set Vector Deceleration = 1,000,000

counts/sec² SVS5<cr> Set Vector Smooth = 5 SXMM4 SYMM4<cr> Set Motion Mode to Circular (mode 4)

for both axes BXY<cr> Move

Figure 4-4 Circular point to point

4.5. Mode 8 - Point To Point With Multiple Velocities This motion mode was developed for dicing-saw type applications where it is needed to enter and exit the diced specimen at different speeds.

Attention: Motion mode 8 (and some associated variables) is not supported in the SB14.

The motor moves towards the specified target point using three different velocities. Each velocity has its own associated position where it starts to be built. (Figure 4-5)

Page 121: Acspl Software Guide Revision 3 00

MODES OF MOTION 4-11

ACSPL Software Guide - Document revision no. 3.00

Figure 4-5 Multiple velocities point to point

Where: BV Begin Velocity. The motor accelerates (at rate LA) from rest

to BV. LV Linear Velocity. The axis starts at the Begin Position (BP) to

accelerate (at rate LA) to LV. SV Search Velocity. The motor starts at the search point (SP) to

decelerate (at rate LD) to SV. The controller automatically resumes decelerating at rate LD

from the point where the deceleration will cause the move to stop at the target point (AP or RP).

Whenever the motor changes velocity, it uses Linear Acceleration (LA), Linear Deceleration (LD) and Smooth Factor (SF).

4.5.1. Profile Definition 1. Accelerate using SF and LA from 0 to Begin Velocity (BV). 2. Move towards Begin Position (BP) using Begin Velocity (BV). 3. At BP start to accelerate from BV to LV using SF, LA. 4. Move towards Search Point (SP) using Linear Velocity (LV). 5. At SP start to decelerate from LV to SV using SF and LD. 6. Move at SV and start deceleration from SV to 0 using SF and LD,

stopping at the specified target position.

Page 122: Acspl Software Guide Revision 3 00

4-12 MODES OF MOTION

ACSPL Software Guide - Document revision no. 3.00

If a given set of parameters does not allow such a profile, the motion may still be developed as long as BV, SV ≤ ≤ ≤ ≤ LV. The following may happen: 1. Steps 1 through 3 will be united into one acceleration curve that

may (or may not) reach LV. 2. Steps 4 through 6 will be united into one deceleration curve.

4.5.2. Restrictions Start point, BP, SP and the target point must follow these rules: start point ≤ ≤ ≤ ≤ BP ≤≤≤≤ SP ≤≤≤≤ target point, or start point ≥ BP ≥ SP ≥ target point. Otherwise Begin error #19 is generated. • BV ≤ LV and SV ≤ LV . Otherwise Begin error #19 is generated. • If LA or LD are too large, Begin error 24 is generated. • If the required distance to accelerate is greater than 231, a Begin

error message 24 is generated. • There is no restriction on the relation between BV and SV. • This mode may be used in single axis motions only.

4.6. Mode 9 - Search For Contact The Search for Contact mode has been specifically developed for Pick & Place applications. In these applications a part holder must descend at high speed reaching a predefined (programmable) point above a surface at low search velocity, keeps on moving at that velocity until a sensor or contact is activated (signaling that the surface has been reached), and then goes on moving a predefined distance beyond the location of the contact and stops (applying force).

Attention: Mode 9 (and some associated variables) is not supported in SB14.

4.6.1. Method Of Operation Upon a Begin command, a smoothed trapezoidal profile (using $SF, $LA, and $LV) is developed towards the specified Sensor Point ($SP). The axis reaches the $SP point at the Search Velocity ($SV). It continues to move at that velocity until a sensor (that is connected to one of the controller’s inputs) is activated. Then, it continues to move a programmable distance $RD (Registration Distance) beyond the position of the sensor and decelerates to a full stop using $SF (Smooth Factor) and $KD (Kill Deceleration) parameters. The position of the first successful detection is recorded into the $SS (Start Sensor) parameter.

Page 123: Acspl Software Guide Revision 3 00

MODES OF MOTION 4-13

ACSPL Software Guide - Document revision no. 3.00

The input to which the sensor is connected can be programmed using the SEnsor source (SE) parameter. When the motor starts to decelerate towards the Sensor Point ($SP) a dedicated output can be activated if desired. The VO parameter defines which output will be activated. When the motor reaches the Search Velocity, the dedicated output is deactivated.

To enable VO activation, the appropriate bit in OM must be set.

It is your responsibility to avoid assigning VO to any dedicated outputs (see Section 5.11.2 and the controller's hardware and setup guide), otherwise the conflicting functions will lead to undesireable results.

4.6.1.1. Bouncing Protection When the sensor is activated for the first time a dedicated timer is activated. If the state of the sensor does not change during the following SH milliseconds, then the descend towards the stop point starts. If its state changes during the SH period, then the sensor is considered to be inactive. The controller will continue to search for the sensor.

4.6.1.2. Sensor Failure Protection If the sensor is not detected within a programmable SD (max. Search Distance) beyond the start position the motor will stop at its start position plus the Search Distance. An End error message 19 will be generated. A begin error message 19 is generated when the combination of the motion parameters does not allow the creation of the search profile. Define: ∆ = Search Point - Current Position ∆1 = (Current Position + Search Distance) - Search Point ∆2 = The distance passed during the deceleration from Search

Velocity to full stop. Begin error message 19 is generated when:

LV < SV RD < ∆2 sign (RD) ≠ sign (∆0) ∆ < Search Distance ∆ < minimum distance needed to develop Search Velocity with

specified LA, SF. SV•SH > RD or SV•SH > (∆1 - ∆2)

MM9: rem This ACSPL program sets all the parameters rem and activates the search for contact move

Page 124: Acspl Software Guide Revision 3 00

4-14 MODES OF MOTION

ACSPL Software Guide - Document revision no. 3.00

rem (Figure 4-6) let XLV =75000 Linear Velocity of 75,000 counts/second.let XSF = 10 Smooth Factor is 10msec.

(0.01second). let XLA = 2000000 Linear Acceleration is 2,000,000

counts/sec/sec. let XSV = 8000 Search Velocity is 8,000 counts/second. let XSP = 20000 Search Point is at position 20,000

counts (at which the velocity is XSV). let XVO = 1 Use output 1 to signal that the search

point was reached. let XRD = 2000 Move 2,000 counts beyond the contact. let XKD = 3000000 Decelerate to the final stop point at

3,000,000 counts/sec/sec. let XSE = 2 Use input 2 as the sensor input. let XSH = 5 Bouncing time is 5msec (0.005 second). let XSD = 28000 Total search distance is 28,000 counts. let XMM=9 Set the motion mode. exec BX Start the move. stop

0

5000

10000

15000

20000

25000

0

10

20

30

40

50

60

70

80

Velocity [counts/msec] Position [counts]

Velocity Profile

SP

Contact

Position ProfileLV

LA LA

KDSV

SSRD

Figure 4-6 Search for contact

4.7. Mode 10 - Jogging (Continuous Velocity) Upon a Begin command, the motor accelerates, using Linear Acceleration ($LA), to the Linear Velocity ($LV) and runs continuously at that speed until a new velocity command is issued, or an End / Kill command is entered. Both the velocity and acceleration can be changed while the motor is running. The direction is specified by the sign of the Linear Velocity parameter ($LV).

Page 125: Acspl Software Guide Revision 3 00

MODES OF MOTION 4-15

ACSPL Software Guide - Document revision no. 3.00

When a Kill, or End command is issued, the motor decelerates using the Kill Deceleration ($KD), and Linear Acceleration parameters respectively. While moving in this mode it is possible to introduce an instantaneous change in the position (phase correction) by issuing a S$RP command. A large value of RP should be avoided.

Move the T axis at a constant velocity of 20,000 counts/second. afterwards change (on the fly) its velocity to 25,000 counts/second in the opposite direction. STMM10 Set the motion mode. STLV20000 Set the velocity to 20,000 counts/second. STLA1000000 Set the acceleration to 1,000,000

counts/sec/sec. SXLD2000000 Set the deceleration to 2,000,000

counts/sec/sec. STSF25 Set the smooth factor time to 25msec (0.025

second). BT Begin the move. STLV-25000 Change velocity and direction (minus sign). STRP20 Instantaneous change by 20 counts. ET Terminate the move.

4.8. Mode 12 - Master-Slave The Master-Slave Mode slaves the velocity and position of the controlled motor to an external Master encoder and at the same time can develop a profiled move that is superimposed on top of that velocity. In multi-axis controllers, Master-Slave mode can be applied to any or all of the axes on the slave. The master encoder is a secondary encoder. The primary encoder position is reported with the current position ($CP) parameter. Where there is a secondary encoder, its current position is reported with the encoder two ($E2) parameter. Secondary encoders are supplied for the following axes: SB214PC4 Z and T SB10x1, SB214PC2, SB1291, SB1291ND, SB1381, SB1391

X

SB1292 X and Y SB1003 Z

In the SB1002/3 there is an option to use any of the primary encoders as the master. However the mastering functionality is limited - there won't be a valid report of master index. For more information, see the description of FA below.

Page 126: Acspl Software Guide Revision 3 00

4-16 MODES OF MOTION

ACSPL Software Guide - Document revision no. 3.00

Master Slave mode is used for the following applications: • Electronic Gearing. • Flying Shears. • Tension Control. • Coil winding. • Web Processing. • High Speed Printing . • High Accuracy Laser Plotting. The main features of this mode are: • Two master encoders and up to four slaves (in four-axis products). • High resolution gear ratio - 1/8,000,000 • High speed (within 2 ms), 'on the fly' changing of gear ratio. • Superimposed smoothed trapezoidal profile move, phase

correction. • 'On the fly' switching between Master-Slave Mode and non-slaved

Velocity. • The Y axis can be controlled as a "standard' axis, while the X axis

is slaved to it. (Dual axis controller only.) • 'On the fly' index finding of both the Master and of the Slave. • The following Master encoder formats are supported:

∗ Quadrature pair. ∗ UP / DOWN pair. ∗ CLOCK / DIRECTION pair. ∗ C1/C0 two adjacent bits of a binary up-down counter pair.

• No position, nor time limits on the Master operation. • Unmatched following error between the Slave and the Master -

down to ±1 count, independent of the velocity (system dependent). • 'On the fly' superimposed registration move. • Full support by the ACSPL high level language, for simple

application implementation.

Page 127: Acspl Software Guide Revision 3 00

MODES OF MOTION 4-17

ACSPL Software Guide - Document revision no. 3.00

The following parameters are used in this mode: FA Function Available.

Bitmapped parameter. Only the FA bits that apply for master-slave are listed here. Defaults are 0. FA.0=1 Master parameters are updated also when

(Motion Mode <> 12). When $MM is set to 12, $FA.0 is automatically set to 1.

FA.0=0 Master parameters not updated when MM≠12. FA.2=0 The gear ratio is TC/2TF. FA.2=1 The gear ratio is TC/TF. FA.4 applies only for SB1002/3. The bit determines which encoder (primary or secondary) is used as the master encoder (the master axis is defined by $MA). FA.4=0 Master is secondary encoder. FA.4=1 Master is main encoder. FA.9 sets an optional functionality. When FA.9=1, the slave motor follows the predicted master position instead of the actual master position. The purpose is to compensate for a 2 ms delay. This feature, however, increases the processor usage and the slave's sensibility to master velocity deviations. Consult the factory if in doubt about using this feature. FA.9=0 Follow actual position (2 ms delay) FA.9=1 Follow predicted position.

FA also serves other functions. Be careful not to change other bits!

Setting XFA.2 to 1 in ACSPL: V1=XFA | 4 binary OR operation let XFA=V1 or exec SXFAxxxxx1xxB Clearing XFA.2 in ACSPL: V1=XFA & 251 binary AND operation let XFA=V1 or exec SXFAxxxxx0xxB

Page 128: Acspl Software Guide Revision 3 00

4-18 MODES OF MOTION

ACSPL Software Guide - Document revision no. 3.00

MA MAster slave configuration. (MA is also used in cam operation). If MA=0 then master/slave is disabled. If MA=1 then the X secondary encoder is the master (for a single-axis controller this is the only possible master). If MA=2 then the Y secondary encoder is the master. If MA=3 then the Z secondary encoder is the master. If MA=4 then the T secondary encoder is the master. To choose the Z secondary encoder as a master for X

SXMA3 To choose the X secondary encoder as the master for Y axis

SYMA1 To choose the X secondary encoder as the master for X

SXMA1

MI Master Index. MI holds the location of the last Master Index found, scaled by the gear ratio.

MP Master Position. It is updated every 0.001 second according to the master counter reading, scaled to the units of the slave. Initialized to zero on start up. Report only parameter.

MR Master Relative position When MS is on (=1) MR equals (DP - MP). When MS is on, the value of MR does not change unless an MD move is superimposed. At the end of the move the value of MR is equal to the old value plus MD. Report only parameter. Note: Switching from MM12 to MM10 and back during motion might change MR, since MS is off while MM=10.

MS Master-slave Synchronized. MS is 'ON' (=1) when the slave is synchronized to the master. (When MS=1, $_SYNC is true.) Report only parameter.

Page 129: Acspl Software Guide Revision 3 00

MODES OF MOTION 4-19

ACSPL Software Guide - Document revision no. 3.00

MV Master Velocity. Holds the velocity of the Master in counts/msec, e.g. the difference between the last two samples of the master encoder counter. The Master Velocity (MV) must not exceed 16,000,000 counts/sec. When a report of MV is requested, it is displayed in counts/s units. (Therefore the displayed value is accurate to within ±1000.) Report only parameter.

MZ Master Zero position. The command 'S$MZ<cr>' zeros the MR relative distance: MP ⇐ DP The S$MZ command is effective both in Master-Slave mode (MM12) and in Velocity Mode (MM10). Rollover This parameter can be used to implement Master-Slave rollover (in an application with endless Master-Slave motion. When the master reaches a predetermined position the following error occurs unless master position is externally changed: Example: if XMP < -999999999 | XMP > 999999999 do let XZP=0 let XMZ=0 end

TC Tracking Constant

Range [-32767 - +32767]. Together with TF defines the gear ratio (relation between the Master Velocity and the Tracking Velocity). The parameter can be set on the fly, provided that MR=0. Set/Report parameter. Factory default - 1.

TF Tracking Factor range [0 - 65,535]. Together with TC defines the gear ratio (relation between the Master Velocity and the Tracking Velocity). The parameter can be set on the fly, provided that MR=0. Set/Report parameter. Factory default - 0.

Page 130: Acspl Software Guide Revision 3 00

4-20 MODES OF MOTION

ACSPL Software Guide - Document revision no. 3.00

Gear ratio If FA.2=0 (FA=xxxxx0xxB) gear ratio = (TC/2TF) If FA.2=1 (FA=xxxxx1xxB) gear ratio = (TC/TF) To set the gear ratio to 1/8 (0.125) let TC=1, TF=3, FA.2=0 To set the ratio to 1/3 (0.3333) let TC=1, TF=3, FA.2=1

TS Tracking Sync range [0 - 255] (Prior to firmware v19 top limit

was 10). TS is a tolerance. If the slave actual velocity is within TV ± TS, the slave is considered synchronized. If the slave actual velocity goes outside the range, acceleration is developed in the slave to overcome the deviation. Set/Report parameter. Factory default - 2.

TV Tracking Velocity. The Slave can follow the Master Velocity with a Tracking Velocity. The relation between the Master Velocity and the Tracking Velocity (gear ratio) is programmable. When a report of TV is requested, it is displayed in counts/s. Report only parameter.

The following commands and subcommands are used in this mode:

KM Kill Master distance command.

This command is effective when the Master Distance (MD) is superimposed on the slaved move. The command gradually reduces the superimposed velocity to the master's velocity, using Smooth Factor and Linear Deceleration parameters. No message is produced for the command in any case (except for the standard prompt).

MD Master-slave relative Distance subcommand. A Set subcommand (parameter). Range: [-128,000,000 , +128,000,000]. It is used to specify a relative move for the slave while it is synchronized to the master. Setting MD initiates a superimposed movement. No Begin command is needed. When a 'S$MD' command is issued, it must not be issued again until the present move is completed. A '?16' is displayed to signal that the command is presently illegal. The completion of the move can be checked by looking at the value of MR, or at the state of ACSPL $_MD.

Page 131: Acspl Software Guide Revision 3 00

MODES OF MOTION 4-21

ACSPL Software Guide - Document revision no. 3.00

The following state variables are used in this mode:

$_MD The state is TRUE when a Master Distance superimposed

profile is in process. It is FALSE otherwise. Its main usage is to indicate that a new MD can be issued when a present MD has not been done yet. till ^ T_MD let TMD = 10000

$_MINDX Becomes true when the master encoder index is

encountered. It is false upon power-up, and after reading the index position (MI).

$_SYNC Reflects the status of the MS parameter.

4.8.1. Method Of Operation Upon a Begin command the relation

TV - Velocity Command <= TS is checked. If this relation is false, an acceleration profile, governed by Linear Acceleration and Smooth Factor parameters, is generated to bring the slave into synchronization with the master. Upon completion of the acceleration profile, the relation is checked again, so that if TV has changed significantly during the acceleration profile, the process repeats, until the relation is true. When the relation is true, it means that the velocity of the slave is close to the necessary Tracking Velocity. From now on, at each sampling period, the instantaneous value of TV is assigned to the slave velocity command. Since firmware V19a, the slave motor can be configured to follow the predicted master position instead of the actual master position. This is done in order to overcome the 2ms following delay. Thus Master and Slave, once synchronized by phase, stay synchronized at any velocity changes. This feature, however, increases the processor usage and the slave's sensibility to Master Velocity deviations. Consult the factory if in doubt about using this feature. See also FA parameter definition above. An End command develops a deceleration profile, using the Linear Deceleration and Smooth Factor parameters, from the current velocity to a full stop. A Kill command uses the KD (Kill Deceleration) parameter.

4.8.2. Superimposed Move If, while the slave is moving synchronously with the master, a point is reached by the slave where it is necessary to move the slave some

Page 132: Acspl Software Guide Revision 3 00

4-22 MODES OF MOTION

ACSPL Software Guide - Document revision no. 3.00

distance relative to the master, the MD parameter should be set to the necessary distance. A velocity profile is generated for the specified move and it is superimposed on top of the tracking velocity. The superimposed velocity profile is governed by the Linear Velocity (LV), Linear Deceleration (LD) and Smooth Factor (SF) parameters. Any change in these motion parameters is effective for the next MD profile generation. When executing a superimposed move, an output is turned on for the duration of the move, assuming that the appropriate output mask bit is set. The output used for this purpose is the same as the one used for Early Ready, see Section 5.11.2. Issuing a KM command kills the superimposed move. The extra velocity is decelerated to zero and the slave returns to tracking master velocity only.

Figure 4-7 Superimposed move illustrating use of MD

4.8.3. 'On the Fly' Switching Between Master-Slave Mode and Non-slaved Velocity

It is possible to switch on the fly from Master-Slave mode to Velocity mode (MM10). Upon the switch request (S$MM10), the controller sets the LV parameter to the last sampled Master Velocity then switches to mode 10 and continues moving. The transition from MM12 to MM10 is smooth, without any jerks. Automatically, $_SYNC becomes false. It is also possible to switch on the fly from Velocity mode 10 to Master-Slave mode. It is the responsibility of the user to make sure that at the moment of the switch, the velocity of the slave is very close to the Master Velocity, in order to prevent a jump. Automatically, $_SYNC becomes true. Example: X is the slave. The Master Velocity is 500,000 counts/sec and it is necessary to change the direction of the slave on the fly. Doing so by changing the XTC (X Tracking Constant) will result in a significant jerk and an error. The way to do it is to

Page 133: Acspl Software Guide Revision 3 00

MODES OF MOTION 4-23

ACSPL Software Guide - Document revision no. 3.00

switch to mode 10, change XTC to a negative number, sample the new Master Velocity, assign it to XLV, wait until the axis reaches the new velocity and then make the switch.

EX1:

till X_SYNC Make sure that the slave is synchronized.

let XMM=10 Switch to mode 10. V0 = XTC Change the sign of the Tracking

Constant. let XTC=-V0 V1=XMV Sample the new Master Velocity. let XLV=V1 Change speed. till X_MOTION=3 Wait till reaching the Master Velocity. let XMM=12 Switch back to Master-Slave mode. ret

Switching from MM12 to MM10 can be executed only when the two motors are synchronized and no MD superimposed move is in process. Switching from MM10 to MM12 can be executed only when the axis is moving at a constant velocity ($_MOTION = 3). The command S$ZP can also be executed while moving in MM12 and MM10. It is also possible to change the gear ratio when the Current Position becomes a very large number, by first executing a S$ZP command (to avoid arithmetic overflow).

Example: The X axis is moving in Master-Slave mode and both XCP and XMP are equal to 888,888,888, when it is needed to change XTC from 5 to 4. EX2: let XZP=0 Zero position let XMZ=0 Make the Master Position equals to XCP. let XTC=4 ret

4.8.4. Using Master Index Master Index (MI) holds the location of the last master index found, scaled by the gear ratio. Since both the index of the slave and the master index can be found on the fly, while moving, it is possible to bring two motors into synchronization (same speed) and into phase (same orientation).

It is assumed that the master is already moving when it is required to bring the slave into synchronization and into phase with the master. EX3:

Page 134: Acspl Software Guide Revision 3 00

4-24 MODES OF MOTION

ACSPL Software Guide - Document revision no. 3.00

let XMM=12 Activate Master-Slave mode. exec BX till X_SYNC let XMZ=0 Make XMP equal to XDP. V0=XIX A dummy read of the slave

and master indices in order to clear

V0=XMI The X_INDEX and X_MINDX status.

till X_INDEX & X_MINDX Wait till both indices are found.

V0=XIX V1=XMI V2=V0-V1

Calculate the offset between the location of the two indices.

let XMD=V2 Make the superimposed move required to correct the offset.

till ^X_MD Wait till the superimposed move (correction) is done.

let XMZ=0 Make XMP equal to XDP. ret

4.8.5. Flying Shears Implementation The following program implements a flying shears application. It assumes that the motion and the electronic gearing parameters (XTC, XTF) have been initialized. (-V0) is the necessary cut length. XMR holds the relative position between the master and the slave. It is set to zero (by let XMZ=0) after each cut. XCP is the Current Position of the slave. It is used in the program to constrain the area where the flying shears are activated. The shears are activated by setting Output Port to 1. It is assumed that the cutting process takes 1 second. It is assumed that the web material is fed from left to right, and that there are two limit switches on each end of the flying shears working area. The software limits XPL and XPH are set a few hundreds counts away from the hard limits. The AUTO_SLX routine takes care of exceptions. If the flying shears hits the left software limit (for example because the cut length is greater than the working area length or because the Master Velocity has been reduced), the motor stops and waits for the master to move the necessary distance, then it continues. This should prevent any cut inaccuracy. If the right software limit is reached, it means that the master could not be followed, as a result of a sudden increase in its speed, for example. The process is therefore reinitialized. The program tries to minimize the number of times that the limits are exceeded by adapting the velocity of the superimposed movement if a limit is reached. This velocity must be greater than the Tracking

Page 135: Acspl Software Guide Revision 3 00

MODES OF MOTION 4-25

ACSPL Software Guide - Document revision no. 3.00

Velocity. XLV is set to (XTV•V2/100). V2 is set to [120...150]% according to the cut length, master speed, and the limit exceeded. (Figure 4-8)

SHEARS: let XTS = 4 Set the sync range. V2 = 150 The relation XLV/XTV) is set to 1.5. V0 = -400000 V0 holds the (negative) cut length. let XMO = 1 Activate the slave motor. CONT1: let XMM = 12 Activate the Master-Slave Mode. exec BX Start the process. till X_SYNC Wait till the Master and Slave are in

synchronization. let XMZ=0 Zero out the relative distance

between the master and the slave. CUT_LOOP: till XCP > 0 Constrain the cutting area. call CUT Make the cut. let XMZ = 0 Zero out the relative distance

between the Master and the Slave (XMR <-- 0).

V1 = XTV * V2 V1 = V1/100 let XLV = V1

Measure the velocity and set the velocity of the move towards the next cut.

let XMD = V0 Move towards the next cutting location.

CONT2: till ^X_MD Wait till reaching there. goto CUT_LOOP Repeat. CUT: Cutting subroutine. let OP = 1 Activate the shears for one second. wait 1000 let OP = 0 Turn off the shears. ret AUTO_SLX: Dealing with exceptions. let OP = 0 Turn off the shears. exec KX Stop the movement completely. till ^X_MOVE Wait for a full stop. let XMO = 1 Ensure that the motor is enabled. if XDP<XPL goto LEFT If the left soft limit is reached goto

LEFT. RIGHT: The right limit is reached. let XMM=0 Change to point to point mode. let XAP = 0 Set home as target.

Page 136: Acspl Software Guide Revision 3 00

4-26 MODES OF MOTION

ACSPL Software Guide - Document revision no. 3.00

let XLV = 50000 Return to home at velocity of 50000 exec BX till ^X_MOVE Wait till home reached. V2 = 150 If the right limit was reached, reason

is that the superimposed velocity is too low. Increase the velocity.

INT_LINE=CONT1 Return to start point of cutting program.

goto EXIT_SLX LEFT: The left limit is reached. let XMM=12 Make sure that the mode is correct. let XLV = 50000 Set the velocity to 50000. till XMR < V0 Wait for the Master to move the

appropriate distance. exec BX Resume following master. till X_SYNC Continue till master velocity matched. V3 = V0 - XMR Determine distance remaining till start

of next cut. let XMD = V3 Move the necessary difference. V2 = 120 If the left limit was reached, reason is

that the superimposed velocity is too high. Decrease velocity.

INT_LINE=CONT2 Change the return address. EXIT_SLX: ret

Figure 4-8 Flying shears motion profile

4.9. Mode 15 - Continuous Path Following This mode applies only for X and Y motors.

Page 137: Acspl Software Guide Revision 3 00

MODES OF MOTION 4-27

ACSPL Software Guide - Document revision no. 3.00

In Continuous Path Mode, the X-Y axes follow a predefined path. The path is defined by an array of up to 32 mixed straight line segments and arc segments. (Only XY moves are supported.) The motion starts at the present position, accelerates to the specified vector velocity, keeps that velocity until the last segment, and then decelerates toward the end point of the path. • The array is set by the Array Common SEt (ACSE) Command. • An array can be reviewed by the Array Common REport (ACRE)

command. • A linear line segment is defined by its end point coordinates. An

arc segment is defined by its center coordinates, and by the angle of rotation.

• More than one path can be defined and stored, as long as the total number of segments is equal to, or less than 32. The selected path is controlled by Lower Index (LI) and Upper Index (UI) parameters of the X axis.

• The velocity, acceleration and smooth factor are specified by the Vector Velocity (VV), by the Vector Acceleration (VA) and Vector Smooth factor (VS) parameters.

• Each linear segment's length is limited to 128,000,000 counts. • The continuous path mode should also be used whenever it is

necessary to move a (linear) distance of more than 128,000,000 counts. It is done by dividing the total distance into linear segments, where each segment's length is less or equal to 128,000,000 counts. The maximum distance for a single move, using that method is limited to 4,096,000,000 counts (32 x 128,000,000)

• Zero length segments are not allowed. • Each arc's radius is limited to 8,000,000 counts. Each arc's angle

is limited to 7,200,000 millidegrees. • The first and last segments must be long enough to enable

acceleration and deceleration to and from the desired velocity within that segment. If the first or last segment is too short, the motion is not developed, and a Begin message 10 or 11 is generated.

Move continuously along the profile described in Figure 4-9. Assuming that X, Y is located at the starting point.

SVV10000 SVA500000<cr>

Set the Vector Velocity and Acceleration

Define the profile - ACSE0 L 3000 0 C 3000 577 120000 L 2500 2598 C 2000 2309 120000 L 500 866 C 1000 577 120000 <cr>

BXY<cr>

Execute the motion

Page 138: Acspl Software Guide Revision 3 00

4-28 MODES OF MOTION

ACSPL Software Guide - Document revision no. 3.00

Explanation of the definition of profile command

ACSE0

Array Common SEt Command Starting index is 0

L 3000 0 First segment is linear segment. Segment's end points X=3000 and Y=0.

C 3000 577 120000 2nd segment is an arc. Center's Coordinates.3000 577 Rotation Angle. 120 deg

L 2500 2598 3rd segment, linear C 2000 2309 120000

4'th segment, circular

L 500 866 5th segment, linear C 1000 577 120000 6th segment, circular <cr> end of command

Figure 4-9 Continuous path

4.10. Mode 16 - Arbitrary Path Generation and Electronic Cam

This mode can be used in various ways, as determined by the PG (path generation) parameter. There are two primary applications for this mode, distinguished by the type of motion profile generation: • Arbitrary path - Where the motion profile is generated according to

a user-defined table of position/time. • Electronic cam - Where the motion profile is generated according

to a user-defined table linking positions of two axes. Electronic cam can describe more complex dependencies than simple linear (master/slave) dependency.

Page 139: Acspl Software Guide Revision 3 00

MODES OF MOTION 4-29

ACSPL Software Guide - Document revision no. 3.00

4.10.1. Arbitrary Path Generation This path is composed of segments. The endpoints of the segments are derived from a table stored in the target arrays TX(i), TY(i), TZ(i), TT(i) - the same arrays that are used for Mode 3, for data collection, and for PEG functions. The controller derives the segments by piece-wise interpolation between the end points. The interpolation can be linear or spline cubic, depending on PG. The end points can be a series of absolute coordinate values or a series of relative distances, depending on PG. When linear interpolation is used, the time interval per segment can be fixed or random, depending on PG. When random time intervals are used, the intervals are stored in the upper half of the target arrays. When spline cubic interpolation is used, the time interval per segment is always fixed. The path definition can be updated 'on the fly', during execution. A particular case of 'on the fly' updating is automatic cyclical buffering, which is invoked by setting $PG.8 (described below) to 1. For more detailed information, see Section 5.12.1, page 5-41. This mode is affected by a number of parameters, including:

SQ SeQuence parameter determines if the move is executed from LI entry to UI entry (SQ=0) or from UI entry to LI entry (SQ=1). This does not apply to electronic cam operation.

LI Lower Index. The first entry of the active part of the array. Range: [0 - 1023].

UI Upper Index. The last entry of the active part of the array. Range: [0 - 1023].

PT Path Time interval. The time interval (in milliseconds) per segment when a fixed time interval is used. Range: [1 - 32000] milliseconds.

IF Interval Factor. Used to vary the path execution rate when random time intervals are used. The rate is scaled by IF/10. The rate can range from a low of 25 times slower (IF=250) to a high of 10 times faster (IF=1).

AO Array Offset. A constant value that is added to each target point. ES Executed Step. Holds the index of the current segment.

Range: [0 - 1023]. PG Path Generation. PG defines most of the path generation

characteristics. PG is a bitmapped parameter of word size (16 bits). Currently, the nine least significant bits are used. Each bit selects a characteristic. The bit assignments are described later in this section. (Some PG bits also apply for electronic cam.)

Coordinated motion (motion involving more than one axis) can be implemented in MM16 (except when MM16 is set for electronic CAM). In coordinated motion, with the exception of AO and ES, the parameter values of the "lowest" axis are used. The

Page 140: Acspl Software Guide Revision 3 00

4-30 MODES OF MOTION

ACSPL Software Guide - Document revision no. 3.00

"lowest" axis is determined according to the order X, Y, Z, T. For example, in a coordinated move involving the X and Y axes, the values XSQ , XLI, XUI, XPT, XIF, and XPG are used.

4.10.1.1. PG Bit Assignments The PG bit assignments are as follows (the bit names are abbreviated):

8 7 6 5 4 3 2 1 0 ACB NU Ex Spln Cam Kill DT Cyc Abs

NU - Not Used

Bit 0 - Abs (absolute or relative) Abs=1 The target array defines the absolute coordinates of the

segment endpoints. Each coordinate is T$(i)+$AO. The Array Offset (AO) parameter may be changed in order to execute a given pattern in different locations.

Abs=0 Each target array entry defines the relative distance from the previous point in the path. The starting point is the location ($DP) of the axis when the motion is started.

This bit applies only for arbitrary path generation and is ignored if the Cam bit is set.

Bit 1 - Cyc (single pass or cyclic) Cyc=0 Single pass

The path is executed once. Depending on SQ, the execution is from the LI coordinate to the UI coordinate or vice versa.

Page 141: Acspl Software Guide Revision 3 00

MODES OF MOTION 4-31

ACSPL Software Guide - Document revision no. 3.00

Cyc=1 Cyclic The target array (T$) is used as a cyclic buffer. The path is executed continuously: starting at the LI coordinate, going up to the UI coordinate, starting again at LI, etc. (Or vice versa depending on SQ.) Cyclic execution provides great flexibility. It can be used to repeat a pattern with or without an offset or to generate an "endless" path by uploading new data to the array while the path is being executed.

A cyclical move is infinite and will only stop when commanded to do so. An End command (E$) will stop the move upon completion of the current cycle (when UI or LI is reached, depending on SQ). If you want to stop the cycle sooner, change UI (or LI depending on SQ) to the index of the target where you want to stop and then issue the End command (E$). A Kill command (K$) will abort the cycle immediately with smooth deceleration.

Bit 2 - DT (distance time) DT=0 Fixed time interval

The time interval between every two adjacent points is fixed and defined by the Position Time parameter (PT).

DT=1 Random time The time interval for each segment i, as defined by T$(i), is T$(512+i)•$IF/10. When working with a variable time, the Target Array is divided into two parts; (i) T(i) where imax ≤ 511 holds the target coordinates and T(i+512) holds the corresponding time interval.

This bit is ignored if the Cam bit or the Spln bit is set.

Bit 3 - Kill (kill at end of pass) Kill = 0 When the end point of the last segment is reached, the

motor is commanded to stop instantaneously. It is the responsibility of the user to design the path in such a way that the velocity of the motor is gradually reduced upon approaching the end point.

Page 142: Acspl Software Guide Revision 3 00

4-32 MODES OF MOTION

ACSPL Software Guide - Document revision no. 3.00

Kill = 1 When the end point of the last segment is reached, the motor is KD (kill deceleration) decelerated to zero. Since the motor has some non-zero velocity, it does not stop exactly at the end point. This mode should particularly be used if the velocity approaching the last end point might be high. A sudden stop impact could cause damage to the system. It is recommended to use this mode during the development stage of an application.

This bit is ignored if the Cam bit is set.

Bit 4 - Cam (select arbitrary path or electronic cam) CAM=0 Standard arbitrary path generation (as described in this

section).

CAM=1 Electronic cam operation (described later in this chapter).

Bit 5 - Spln (spline interpolation) Spln=0 The segment midpoints are generated by linear

interpolation between the segment end points. The velocity changes instantaneously between segments.

Spln=1 The segment midpoints are generated by spline interpolation between the segment end points, providing a smoothed path with continuous velocity and acceleration. The type of spline interpolation is determined by bit 6 (EX).

This bit is ignored if the Cam bit is set. Figure 4-10, Figure 4-11, and Figure 4-12 illustrate the different results obtained using linear, smooth spline, and exact spline interpolation. The segment endpoints are shown in Figure 4-10.

Bit 6 - Ex (exact or smooth spline interpolation) EX=0 Smooth spline. Provides the smoothest acceleration

between segments, preventing jerks. Move does not pass exactly through the segment end points.

EX=1 Exact spline. Move passes through the segment end points. Velocity is continuous but acceleration is not and therefore jerks can occur between segments.

See Figure 4-10, Figure 4-11, and Figure 4-12 This bit applies only if bit 5 (Spln) is set.

Page 143: Acspl Software Guide Revision 3 00

MODES OF MOTION 4-33

ACSPL Software Guide - Document revision no. 3.00

Bit 8 - ACB (automatic cyclic buffering) ACB=0 No automatic cyclic buffering. ACB=1 Automatic cyclic buffering (see Section 5.12.1). This bit is ignored if the Cam bit is set.

4.10.1.2. Linear Interpolation vs Smooth and Exact Spline It is necessary to decide whether to use linear interpolation or spline (PG.5) and, if spline, then whether to use smooth or exact (PG.6). The following should be taken into consideration: Linear interpolation (PG.5=0) requires the least processing time during execution. However, the velocity within each segment is constant (no change in acceleration). Therefore if the velocity is changed significantly between segments the change is made as a jump. Furthermore, linear interpolation of a curve results in a polygon, therefore the larger the segment length, the larger the error at the midpoint. This can be compensated for by increasing the number of segments. Of course this in turn increases the processing time during execution. Spline approximates curves closer than linear interpolation and provides profiled velocity (no velocity jumps between segments). However, spline consumes more processor time during execution and is less flexible - it allows only a fixed time interval for the segments (PG.2=0). Smooth spline (PG.5=1, PG.6=0) also provides profiled acceleration (no jerks between segments). The tradeoff is that smooth spline passes close to, but not exactly over, the segment end points. Exact spline (PG.5=1, PG.6=1) doesn't provide profile acceleration, rather the acceleration changes with a jerk between segments. Differences between linear interpolation, smooth spline, and exact spline can be seen in Figure 4-10, Figure 4-11, and Figure 4-12.

Page 144: Acspl Software Guide Revision 3 00

4-34 MODES OF MOTION

ACSPL Software Guide - Document revision no. 3.00

Figure 4-10 Two-dimensional path approximating a circle

Figure 4-11 Graph of path versus time for X axis

Page 145: Acspl Software Guide Revision 3 00

MODES OF MOTION 4-35

ACSPL Software Guide - Document revision no. 3.00

Figure 4-12 Graph of velocity versus time for X axis

4.10.1.3. Method Of Operation 1. Define these parameters:

∗ Path Generation (PG). ∗ Lower Index and Upper Index (LI, UI). ∗ SeQuence type (SQ). ∗ Path Time interval (PT). ∗ Interval Factor (IF; if random time is used (PG.2=1)). ∗ Array Offset (AO)

2. Fill the array with the path data. 3. Set motion mode 16 (S$MM16). 4. Enable the motors (S$MO1). 5. Make sure that the axes are near the first target position to avoid

an excessive jump. Use motion mode 0 to bring the axes to or near the first target position.

6. Begin motion (B$, where $ can be one or more axes). Example: If using X and T axes: BXT<cr>

Page 146: Acspl Software Guide Revision 3 00

4-36 MODES OF MOTION

ACSPL Software Guide - Document revision no. 3.00

Figure 4-13 An eleven-segment arbitrary path.

The arbitrary path (Figure 4-13) is made of 11 segments (XLI=0, XUI=10). It is a two dimensional path, therefore only the control parameters of X are relevant. The coordinates are absolute (Abs=1), the path is finite (Cyc=0), the time interval is fixed at 100 milliseconds. SXLI0 UI10<cr> Set the limits of the X array. SXAO0 SYAO0 <cr> Set the array offset to zero. SXPT100<cr> Setting the time interval to 100. SXPG1<cr> The coordinates are absolute. Build the arrays AXSE0 0 1000 6500 11000 11500 11500 11000 5000 2500 500 0 0<cr> AYSE0 3000 5500 6500 5500 5000 1500 500 -1000 -1000 -500 0 3000<cr> BXY<cr> Execute. This generates the profile in

Figure 4-13. The following Set command lines illustrate some possible modifications that can be made by modifying the corresponding Set commands above. SXPG3<cr> Repeat the path infinitely (Cyc=1). SXPT200<cr> Slow down the speed by a factor of 2

by increasing the Path Time interval to 200 milliseconds.

SXPT50<cr> Increase the speed by a factor of 2 by reducing the Path Time interval to 50 milliseconds.

SXAO5000 SYAO7000<cr> Repeat the path with an XY offset of (5000, 7000).

4.10.1.4. Modifying the Path by Changing its Parameters Here is a further example showing how to modify the same path on the fly. Assume that the path in Figure 4-13 is executed repetitively.

Page 147: Acspl Software Guide Revision 3 00

MODES OF MOTION 4-37

ACSPL Software Guide - Document revision no. 3.00

Assume too that, depending on the state of a given input (in this case, input 1), each repetition of the path must be executed either fully, or skipping points 2, 7, 8, and 9. The change in the path is shown by the two dashed-dotted lines (between 1 and 3 and between 6 and 10). Changing parameters on the fly is explained in more detail later in this section. Note that the example is written in program mode because the path changes must be synchronized on the fly with the execution of certain segments. Note too that this example illustrates how to implement in program mode the same settings that were implemented in direct mode in the previous example. INIT16: let XLI = 0 let XUI = 10 let XAO = 0 let YAO = 0 let XPT = 100 let XPG = 3 Cyclic path, absolute coordinates.

TX(0) =0 TX(1) = 1000 TX(2) = 6500 TX(3) = 11000 TX(4) = 11500 TX(5) = 11500 TX(6) = 11000 TX(7) = 5000 TX(8) = 2500 TX(9) = 500 TX(10) = 0 TX(11) = 0

Assign the X target array values. Alternatively, this can be done as follows: exec AXSE0 0 1000 6500 11000 etc.

TY(0) =3000 TY(1) = 5500 TY(2) = 6500 TY(3) = 5500 TY(4) = 5000 TY(5) = 1500 TY(6) = 500 TY(7) = -1000 TY(8) = -1000 TY(9) = 500 TY(10) = 0

Assign the Y target array values. Alternatively, this can be done as follows: exec AYSE0 3000 5500 6500 etc.

TY(11) = 3000 exec BXY LOOP: if IN1 do Execute the reduced path. let XUI = 1 1st cycle ends at point 1 let XLI = 3 Next cycle will start from point 3 (skip 2). till XES=3 Wait till cycle has started. let XUI = 6 Change UI to finish this cycle at segment 6.

Page 148: Acspl Software Guide Revision 3 00

4-38 MODES OF MOTION

ACSPL Software Guide - Document revision no. 3.00

till XES = 6 Execute segments 3 to 6. let XLI = 10 Change LI to start next cycle at 10 (skip 7-9). till XES = 10 let XUI = 10 Change UI to complete the profile. end till XES <> 0 Wait till next loop starts. till XES = 0 goto LOOP

The following example illustrates how to reverse a path (Figure 4-14). Assume that if a defect is detected during path execution, your application requires that the last three segments be repeated (move back along the same path and then resume, so as not to damage the material). Assume too that the signal to repeat the segments (defect detected) is provided by input 1 and that PG=3 (cyclic move).

Figure 4-14 Arbitrary path with reversal (and resumption)

AUTO_IN1: V1 = XUI Store the initial UI. V2 = XLI Store the initial LI. V0=XES+1 LET XUI=V0 Stop after the next segment (allow a spare

segment to be sure). EXEC EX Stop cyclic path. till ^X_MOVE let XSQ = 1 Reverse the sequence. V0 = V0-1 let XUI = V0

Select the endpoint of the previous segment as the new starting point. First move is from current location to UI (since sequence is reversed).

V0 = V0 – 2 let XLI = V0

Prepare to move three segments in reverse along the same path.

Page 149: Acspl Software Guide Revision 3 00

MODES OF MOTION 4-39

ACSPL Software Guide - Document revision no. 3.00

let XPG = 1 Clear the Cyc bit (PG.1), making this a single pass.

exec BXY till X_MOVE till ^X_MOVE Finished reverse moves. let XSQ=0 Restore original sequence. let XPG = 3 Restore cyclic path. V0=V0+1 Prepare to resume moving forward. let XLI = V0 Select the endpoint of the previous segment

as the new starting point. First move is from current location to LI (since sequence is again ascending).

let XUI = V1 Restore initial UI. exec BXY till X_MOVE After moving resumes . . . let XLI = V2 Restore initial LI. ret

4.10.1.5. Changing Motion Parameters While Moving - General There are two general considerations to bear in mind when changing parameters on the fly. Spline Interpolation Considerations Bear in mind that spline is cubic interpolation: exact spline takes three consecutive points (rather than two points as in linear interpolation) and smooth spline takes four points. This creates additional limitations for spline interpolated moves. Avoid changing parameters that will affect the target points used to interpolate the current segment. Don’t change AO significantly and don’t modify PG, PT, and SQ. Regarding LI and UI: if the move is cyclic (PG.1 is 1), then don't change either LI or UI when moving within one or two segments from the end of the cycle. In a single pass move (PG.1 is 0), then only UI is relevant (when SQ is 0, otherwise only LI is relevant). Cyclic/Single Pass Considerations • If UI and/or LI are changed on the fly in a single pass move (PG.1

is 0), the change takes effect immediately. This means that (assuming SQ = 0), changes in LI won’t make any difference and changes in UI will cause the motion to stop at the new UI (or after the current segment, if the axis has passed the new UI already: ES > new UI). If SQ=1 the situation is reversed:changes in UI have not effect; and the motion will stop at the new LI (or after the current segment, if the axis has pass the new LI already: ES < new LI).

• If UI and/or LI are changed on the fly in a cyclic move (PG.1 is 1), the change takes effect at the end of the current cycle.

Page 150: Acspl Software Guide Revision 3 00

4-40 MODES OF MOTION

ACSPL Software Guide - Document revision no. 3.00

This means that the current cycle is completed with the old value of UI (assuming SQ is 0 or old value of LI assuming SQ is 1), The changes in LI and/or UI are then applied in the subsequent cycle.

4.10.1.5.1. Changing LI and/or UI The following examples illustrate considerations when changing LI (Lower Index) and/or UI (Upper Index) LI/UI SQ Cyc

l Spln Ex Safe to change when . . .

LI 0 Anywhere LI 1 0 1 0 $ES ≥ $LI+2 LI 1 0 1 1 $ES ≥ $LI+1 LI 0 1 1 1 $ES ≤ $UI - 1 LI 0 1 1 0 $ES ≤ $UI - 2 LI 1 1 1 1 $ES ≤ $UI + 1 LI 1 1 1 0 $ES ≤ $UI + 2 UI 0 Anywhere UI 0 0 1 0 $ES ≤ $UI-2 UI 0 0 1 1 $ES ≤ $UI-1 UI 0 1 1 1 $ES ≤ $UI - 1 UI 0 1 1 0 $ES ≤ $UI - 2 UI 1 1 1 1 $ES ≥ $LI + 1 UI 1 1 1 0 $ES ≥ $LI + 2

4.10.1.5.2. Changing AO (Array Offset) If Abs=0, there is no effect. If Abs=1, then the AOnew is effective starting with the next segment.

Do not change AO significantly (in other words, not enough to cause a jump) while moving in cyclic spline mode.

4.10.1.5.3. Changing PT (Path Time interval) If DT=1, there is no effect. If DT=0, then the PTnew is effective starting with the next segment.

Do not change PT while moving in a spline mode.

4.10.1.5.4. Changing IF (Interval Factor) If DT=0, there is no effect. If DT=1, then the IFnew is effective starting with the next segment.

4.10.1.5.5. Changing PG (Path Generation) The change is effective starting with the next segment. Do not change PG while moving in cyclic spline mode.

Page 151: Acspl Software Guide Revision 3 00

MODES OF MOTION 4-41

ACSPL Software Guide - Document revision no. 3.00

4.10.1.6. Timing Limitations Maximum time per segment in linear interpolation (PG.5 set to 0) is 32000. PT parameter is limited by this value. However, when using the random time option (PG.2 set to 1), time is kept in the upper half of the target array and can be modified by the IF parameter. The time interval for each segment i, as defined by T$(i), is T$(512+i)•$IF/10. If the expression result is greater than 32,000, then the value is internally limited to 32,000. In spline interpolation (PG.5 set to 1), the maximum time per segment is limited to 1000 msec. If it is greater than 1000, it is internally limited to 1000. (Recall that the random time interval is only applicable for linear interpolation.)

4.10.1.7. Teach and Go Implementation There are many uses for arbitrary path generation. A popular implementation is Teach and Go, which combines arbitrary path generation with data collection (See Section 5.5).. Suppose that we can connect the X and Y encoders from a instrument A moving in X and Y planes (for example, a plotter) to the encoder inputs of our controller B. While the instrument A is moving, its current XY positions are collected at an appropriate rate. After the data has been collected (and stored in the target arrays), it used as the shape definition for generating B's arbitrary path with a constant segment time. To move B at the same velocity as A, the PT parameter has to be set the same as the data collection rate. Figure 4-15 and Figure 4-16 show path A and path B. Note that for illustrative purposes (to emphasize the differences) the arbritrary path shown in Figure 4-16, is assumed to have been done using linear interpolation. In a real application spline interpretation would produce smoother results. Teach and Go can be used, for example, to teach a robot to repeat a human operator's motion. This is done by sampling the XY position of the robot arm as the operator manually moves it.

Page 152: Acspl Software Guide Revision 3 00

4-42 MODES OF MOTION

ACSPL Software Guide - Document revision no. 3.00

Figure 4-15 Collected Path of A (crosses are sampled positions)

Figure 4-16 Arbitrary path (MM16), result of sampling path A (crosses are

endpoints)

4.10.2. Cam Cam combines features from both master-slave (MM12) and arbitrary path (the other MM16 method). As in master-slave, the axis moving in cam is slaved to another axis. However this dependency, while linear, is not constant, rather it varies from segment to segment based on the target arrays of the two axes. Like an arbitrary path, each segment midpoint of slave position is a linear interpolation of the segment endpoints. However the

Page 153: Acspl Software Guide Revision 3 00

MODES OF MOTION 4-43

ACSPL Software Guide - Document revision no. 3.00

interpolation is based on the master position (and not on the time as it is in an arbitrary path). In other words, the position of the slave axis is determined by the position of the master axis. The exact relation between the slave and the master is defined by the values in the target arrays of these axes. Therefore, cam is implemented as a master-slave mode with a variable gear ratio. The master axis can be moving in any motion mode (taking into account the limitations described later in this section) or it can be moved by an external force, for example, by hand. The following drawing illustrates a mechanical cam system and shows how it can be translated into an electronic cam.

Figure 4-17 Cam operation - mechanical version

The parameters and arrays related to cam operation are listed below. Note that the parameter list differs from that of arbitrary path. Some of those parameters do not apply for cam operation. MA is specific to cam operation (and MM12 operation). Some of the parameters have limited usage.

Bear in mind that all the parameters listed below (except for AO) apply to the slave axis.

Page 154: Acspl Software Guide Revision 3 00

4-44 MODES OF MOTION

ACSPL Software Guide - Document revision no. 3.00

For example: If X is moving in cam operation (slave) and Y is the master, then XLI, XUI, XMA, XFA, XAO, YAO, and XPG define the motion (together with the X and Y target arrays). XES points to the table entries for the segment that is being interpolated. The master target array is used to determine which segment the master is in along its path of motion. The indexes used with the master target array are the slave UI, LI, and ES (in the example, XUI, etc.).

LI Lower Index. The first entry of the active part of the target arrays.

Range: [0 - 1023]. The slave LI is used for the LI of both the master and slave.

UI Upper Index. The last entry of the active part of the array. Range: [0 - 1023]. The slave UI is used for the UI of both the master and slave.

MA MAster axis. Range : 0...Number of axes in the controller. (MA=0 disables cam or master-slave operation; MA=1 - X axis etc.) Either secondary or primary encoder can be used as master encoder - as determined by the FA.4 parameter.. Note: By default, the secondary encoder is the MAster encoder, thus the axis can be its own master (which enables cam operation in single axis controllers - SXMA1)

FA When $FA.4 is 0 (factory default), a secondary encoder ($E2) on the axis defined by $MA is used as the master. When $FA.4=1 a primary encoder, as defined by $MA, is used as the master. The $FA.4 bit can be changed only when the slave axis is disabled. (System error 15 is generated when trying to change $FA.4 while the axis is enabled.) If $FA.4=1 and $MA=$ (choosing the slave encoder as the master encoder), upon a Begin command, a Begin error 14 is produced and motion is denied.

AO Array Offset. A constant value that is added to each target point. There are two AOs in cam operation, one for the master and one for the slave. When in Cyclic Cam (PG.1 set to 1) mode, both AOs are automatically updated every new cycle. See description of cyclic cam later in this section.

ao Master array offset. For single-axis controllers. Since these controllers cannot have a separate master and a separate slave axis, they require an additional parameter. When in Cyclic Cam mode (PG.1 set to 1), Xao and XAO are automatically updated every new cycle. See description of of cyclic cam later in this section.

Page 155: Acspl Software Guide Revision 3 00

MODES OF MOTION 4-45

ACSPL Software Guide - Document revision no. 3.00

ES Executed Step. Holds the index of the current segment. Range: [0 - 1023]. The slave ES is constantly updated to point to the segment in which the master is currently located. The endpoints of this segment are the master target array entries: Tmaster(ESslave-1) and Tmaster(ESslave). The slave's desired position is linearly interpolated between the slave's corresponding targets Tslave(ESslave-1) and Tslave(ESslave).

Example: In Figure 4-17, the master position (a) is located between endpoints TX(8) and TX(9). Therefore, YES is 9 and the slave's desired position (YDP) is the point corresponding to (a) on the segment defined by linear interpolation applied to the slave endpoints TY(8) and TY(9).

Bear in mind that the endpoints are subject to AO. The following expressions are valid for cam operation: AOMASTER + TMASTER(ESSLAVE-1) < CPMASTER < AOMASTER + TMASTER(ESSLAVE)

AOSLAVE + TSLAVE(ESSLAVE-1)< DPSLAVE < AOSLAVE + TSLAVE(ESSLAVE)

PG Path Generation. PG defines most of the path generation

characteristics. PG is a bitmapped parameter of word size (16 bits). Only bits one and four are used in cam operation. The bit assignments are described later in this section.

There is no coordinated motion in cam operation. Only one axis at a time per controller can be operated in cam mode.

4.10.2.1. PG Bit Assignments The PG bit assignments that are relevant for cam operation are as follows (the bit names are abbreviated):

8 7 6 5 4 3 2 1 0 NU Cam Cyc

NU - Not Used

Bit 1 - Cyc (single pass or cyclic) Cyc=0 Single pass

The path is executed once. Depending on SQ, the execution is from the LI coordinate to the UI coordinate or vice versa.

Page 156: Acspl Software Guide Revision 3 00

4-46 MODES OF MOTION

ACSPL Software Guide - Document revision no. 3.00

Cyc=1 Cyclic The target array (T$) is used as a cyclic buffer. The path is executed continuously: starting at the LI coordinate, going up to the UI coordinate, starting again at LI, etc. (Or vice versa depending on SQ.) Cyclic execution provides great flexibility. It can be used to repeat a pattern with or without an offset or to generate an "endless" path by uploading new data to the array while the path is being executed.

A cyclical move is infinite and will only stop when commanded to do so. An End command (E$) will stop the move upon completion of the current cycle (when UI or LI is reached, depending on SQ). If you want to stop the cycle sooner, change UI (or LI depending on SQ) to the index of the target where you want to stop and then issue the End command (E$). A Kill command (K$) will abort the cycle immediately with smooth deceleration.

Bit 4 - Cam (select arbitrary path or electronic cam) CAM=0 Standard arbitrary path generation (as described in this

section).

CAM=1 Electronic cam operation (described later in this chapter).

Page 157: Acspl Software Guide Revision 3 00

MODES OF MOTION 4-47

ACSPL Software Guide - Document revision no. 3.00

TSLAVE TMASTER

By definition, cam operation implements a given relationship between the master and slave positions: DPSLAVE = F(CPMASTER) where: F() is a function (rather than a constant gear ratio as in MM12).DPSLAVE - Slaved Desired Position CPMASTER - Master Current Position

The target arrays are the means for implementing F(). The contents of the target arrays are segment endpoints on the path of the function F().

Master targets are not required to be equidistant from one another. However, they must have nonzero length and be defined in ascending order:

Tmaster(LIslave) < Tmaster(LIslave+1) < . . . < Tmaster(UIslave-1) < Tmaster(UIslave)

The slave profile is not a smooth curve, rather it is composed of linear segments. For a given master CP between Tmaster(ESslave-1) and Tmaster(ESslave), the slave's desired position is linearly interpolated between the slave's corresponding targets Tslave(ESslave-1) and Tslave(ESslave). To implement cam operation in single-axis controllers, the X target array is split into two parts: TX(0) to TX(511) are used for the slave targets and TX(512) to TX(1023) are used for the master targets. Bear in mind that the endpoints are subject to AO.

Example (based on Figure 4-17): Assume that one full revolution occurs each 30,000. Master is X axis and slave is Y axis. YLI is set to 0. YUI is set to 9. Both XAO and YAO are set to 0. Targets are as follows: TX(0) = 0, TX(1) = 3000, TX(2)=6000, TX(3) = 9000, TX(4)=12000, TX(5) = 15000, TX(6)=18000, TX(7) = 21000, TX(8)=24000, TX(9) = 27000 TY(0) = 17000, TY(1) = 12000, TY(2)=8500, TY(3) = 6000, TY(4)=4000, TY(5) = 4000, TY(6)=4000, TY(7) = 6000, TY(8)=8500, TY(9) = 12000 If XCP=0, then YDP is 17000. If XCP=3000, then YDP=12000. If XCP=6000, then YDP=8500 If XCP=4500, then YDP=(12000 + 8500)/2 = 10250 This last YDP value is generated by linear interpolation. Here is how to calculate an interpolated point: Assume that XCP = 24600. This CP lies between TX(8) = 24000 and TX(9) = 27000. Therefore,

Page 158: Acspl Software Guide Revision 3 00

4-48 MODES OF MOTION

ACSPL Software Guide - Document revision no. 3.00

))8()9((()8()9()8()8( TYTY

TXTXTXXCPTYYDP −•

−−+=

)8500012000(240002700024000246008500 −•

−−+=

= 9200

4.10.2.2. Method of Operation

4.10.2.2.1. Beginning Cam Movement (Recall that the cam parameters are relevant only for the slave axis, except for AO, which has to be defined for both slave axis and master axis.) 1. Before operation: • Define Path Generation (PG) parameter. • Define Lower Index and Upper Index (LI, UI). • Fill the target arrays with the path data. • Define the master AO and the slave AO (defaults are 0). • Set motion mode 16 (S$MM16). • Enable the motors (S$MO1). 2. Verify that the axes are near the first target position to avoid an

excessive jump. Use motion mode 0 to bring the axes to or near the first target position.

3. Begin motion (B$). Upon the begin command: • The present locations of the master and the slave are sampled and

used as starting points (CP for the master and DP for the slave). • ESSLAVE is set according to the following rules:

ESSLAVE is set to LISLAVE, if [CPMASTER < AOMASTER + TMASTER(LISLAVE)]

In other words, ESSLAVE is assigned the value of LISLAVE if the master is to the left of the lowest target in the master target array.

ESSLAVE is set to UISLAVE+1, if [CPMASTER ≥ AOMASTER + TMASTER(UISLAVE)]

In other words, ESSLAVE is assigned the value of UISLAVE if the master is to the right of the highest target in the master target array.

Otherwise, ESSLAVE is set to the value that conforms to the following:

AOMASTER + TMASTER(ESSLAVE-1) < CPMASTER < AOMASTER + TMASTER(ESSLAVE)

Page 159: Acspl Software Guide Revision 3 00

MODES OF MOTION 4-49

ACSPL Software Guide - Document revision no. 3.00

AOSLAVE + TSLAVE(ESSLAVE-1) < DPSLAVE < AOSLAVE + TSLAVE(ESSLAVE)

In other words, ESSLAVE is set to point to the segment in which the master is currently located.

• The behavior of the slave depends on the location and direction of the master at the time of the Begin command (Figure 4-18).

Figure 4-18 Start of cam operation depending on master location

1. CPMASTER below the cam range (point A in Figure 4-18) and master is moving left (further away from the range):

Slave stays where it is. 2. CPMASTER below the cam range (point A) and master is moving

right (towards the start of the range): Slave starts following the master with a ratio that will cause

the slave to reach the start of the range at the same time as the master.

3. CPMASTER above the cam range (point B) and master is moving right (further away from the range):

Slave stays where it is. 4. CPMASTER above the cam range (point B) and master is moving

left (into the range from the top): Slave starts following the master with a ratio that will cause

the slave to reach the top of the range at the same time as the master.

5. CPMASTER inside the cam range (point C):

Controller attempts to bring the slave instantly into the correct position relative to master. If the slave is far from that

Page 160: Acspl Software Guide Revision 3 00

4-50 MODES OF MOTION

ACSPL Software Guide - Document revision no. 3.00

position (point C1), it will "jump" to the correct position. Therefore, it is recommended to locate the master outside the cam range before issuing a Begin command. This should be done by moving to the desired point using Point to Point mode (MM0) prior to activating the Cam.

4.10.2.2.2. Non-Cyclic Cam Movement

YAO+TY(XLI) YAO+TY(XUI)

Y POSITION

X POSITION

XAO+TX(XLI)

XAO+TX(XUI)

YCP

XDP

Figure 4-19 Cam - non cyclic mode

This description assumes that Y is the master and X is the slave and that both AOs are zero. The relationship between the master (Y) and the follower (X) is illustrated in Figure 4-19. There are no restrictions on the move of the master. It may move backwards and forwards, inside and outside of the range - TY(XLI) to TY(XUI). The slave moves as follows: • When the master is within the range, the slave follows the master

with a ratio that is calculated from the endpoints of the segment. The ratio changes from segment to segment. For segment ES, the ratio is

)1()()1()(

−−−−

XESTYXESTYXESTXXESTX

• When the master goes below the range - meaning that YCP becomes less than TY(XLI): the slave DP remains TX(XLI), which means that the slave doesn't move out of the range.

• When the master goes above the range - meaning that YCP becomes greater than TY(XUI): the slave DP remains TX(XUI), which means that the slave doesn't move out of the range.

The slave motion is endless until killed (K command).

Page 161: Acspl Software Guide Revision 3 00

MODES OF MOTION 4-51

ACSPL Software Guide - Document revision no. 3.00

4.10.2.2.3. Cyclic Cam Movement

Y POSITION

X POSITION

y1 y2 y3 y4 y5

Figure 4-20 Cam - cyclic mode

This description assumes that Y is the master and X is the slave. Cyclic mode is used where the pattern of the slave repeats cyclically during each master interval ∆={TY(XUI)-TY(XLI)} (Figure 4-20). In the figure, the master intervals are y2-y1, y3-y2, etc. There are no restrictions on the move of the master. It may move backwards and forwards. The slave moves as follows: • When the master is within the range of the cycle, the slave follows

the master exactly as it does in non-cyclic movement

• If the master goes above the range of the cycle, the following occur:

• YCP becomes greater than TY(XUI).

• XES, which was equal to XUI, is assigned the XLI of the new cycle.

• Both AOs are updated by the controller. The reason that the AOs are updated is to ensure that that the starting point of the new cycle will be offset properly. The AOs are updated as follows:

YAO ← {YAO + [TY(XUI) - TY(XLI)]} XAO ← {XAO + [TX(XUI) - TX(XLI)]} XES ← XLI Example based on Figure 4-20: Assume that at the start of cyclic cam operation, YAO was y1. When the Y position reaches y2, the YAO is updated as follows: Since TY(XUI) - TY(XLI) = y2 - y1, then YAO ← y1 + (y2-y1) = y2. Similarly, when the Y position reaches y3 then YAO← y3, etc.

Page 162: Acspl Software Guide Revision 3 00

4-52 MODES OF MOTION

ACSPL Software Guide - Document revision no. 3.00

In many applications the slave AO is not changed when updated because TX(XUI) = TX(XLI). This is because the application has the slave start the next cycle from the point that it completed the current cycle.

• If the master goes below the range of the cycle, the following occur:

• YCP becomes lower than TY(XLI).

• XES, which was equal to XLI, is assigned the XUI of the new cycle.

• Both AOs are updated by the controller as follows:

YAO ← {YAO - [TY(XUI) - TY(XLI)]} XAO ← {XAO - [TX(XUI) - TX(XLI)]} XES ← XUI

The slave motion is endless until either killed (K command) or ended (E command). A K command terminates the move instantaneously, using Kill Deceleration (KD). An E command stops the move only at the end of the current cycle. As mentioned earlier, for single-axis controllers, Xao is the master offset and XAO is the slave offset. AO, ao (array offset) automatic update enables virtually endless cyclic CAM operation (rollover). AO (or ao) increases until it reaches 231, at which point it is automatically reset to -231.

4.10.2.3. Cam Operation Limitations • Cam operation is very processor-time consuming. For this reason,

only one axis per controller can operate in cam mode at any given time.

• As mentioned earlier in this section, master targets are not required to be equidistant from one another. However, they must have nonzero length and be defined in ascending order.

• The master position is sampled every 0.001 seconds. Therefore, the distance that the master moves in 0.001 second must be less than the distance from one endpoint to the next (otherwise the slave will lose correspondence relative to the master). To prevent this, the distance between any two adjacent endpoints must conform with the following condition: |(maximum expected master velocity)•0.001| < [Tmaster(i)-Tmaster(i-1)].

• In cyclic cam operation both the master and slave AOs are updated automatically. However, a conflict arises if the master is operating in a mode that also uses AO. Specifically, this occurs with MM3 and with arbitrary path option in MM16 (PG.4 = 0). While these modes are not likely to be used for master motion, if they are used, the controller resolves the conflict ignoring cyclic operation and operating the slave in non-cyclic cam.

Page 163: Acspl Software Guide Revision 3 00

MODES OF MOTION 4-53

ACSPL Software Guide - Document revision no. 3.00

4.10.2.4. Changing Motion Parameters While Moving

Once cam operation has begun, do not issue an S$ZP## command (neither for the slave nor for the master) while the slave is moving within the range. It might cause an instantaneous jump of the Slave.

4.10.2.4.1. Changing LI and/or UI

• If UI and/or LI are changed on the fly in a single pass move (PG.1 is 0), the change takes effect immediately.

• If UI and/or LI are changed on the fly in a cyclic move (PG.1 is 1), the change takes effect at the end of the current cycle. This means that the current cycle is completed with the old value of UI (assuming master is moving in positive direction or old value of LI assuming master is moving in negative direction). The changes in LI and/or UI are then effective starting in the next cycle.

4.10.2.4.2. Changing AO (Array Offset) The new AO is effective starting with the next segment. In cyclic cam AO is automatically updated by the controller in the first segment of each new cycle. However, some applications also require that the new AO be further adjusted (typically by the host or by the ACSPL program). An example of such an application is where the start of each new cycle must be synchronized with a mark registered by the slave. In such a case, avoid adjusting the new AO during the first segment to prevent conflict with the controller.

4.10.2.4.3. Changing PG (Path Generation) Any change in PG.1 is applied only at the end of the current cycle. Do not change PG.4 while moving.

Page 164: Acspl Software Guide Revision 3 00

4-54 MODES OF MOTION

ACSPL Software Guide - Document revision no. 3.00

4.11. Mode 21 - Manual Joystick Mode In this mode, the motor moves in a speed that is proportional to the voltage output of a joystick, which is connected to the proper analog input. The digitized values of the analog inputs are contained the A0 and A1 parameters. For detailed information about these parameters, see Section 7.2. For information about product-dependent characteristics of these parameters, see Section 7.1.9 Certain details concerning motion mode 21 vary according to the characteristics of your controller's analog inputs. Therefore not all of the information in this description may apply for your product. Refer to your Hardware And Setup Guide for more information. The maximum speed is Linear Velocity (LV). Set the mode - SXMM21<cr> Begin - BX<cr> It is recommended that when a Begin, End or Kill command is issued, the velocity command voltage should be close to the zero velocity voltage in order to prevent trapping on error. An End or Kill command must be issued in order to terminate the motion and to be able to move in a different motion mode. The controller prevents the user from exceeding the software limits (PL, PH). Upon reaching either of these limits, the controller stops any further motion beyond the limit. However there is no error message. The only way for you to know about the event is to have compiled an AUTO_SL$ routine. You can disable the software limit checking by setting the value of PL equal to the value of PH. Analog control is a version of the joystick control mode 21. The mode is activated by setting $MM to 21 and FA to 2. Control parameters: Function Available (FA), bit 1. Your controller's analog control parameter ranges depend on its analog input resolution. To determine which range applies for your product, see the analog input description in the Hardware and Setup Guide. If the controller's analog input resolution is 12-bit [-2047, +2047], then the following parameters can vary: Lower Threshold (LT). Range: [-1883, +1883]. Default: -80 Upper Threshold (UT). Range: [-1883, +1883]. Default: +80

If the controller's analog input resolution is 10-bit [0, +1023], then the following parameters can vary: Lower Threshold (LT). Range: [42, +982]. Default: 460 Upper Threshold (UT). Range: [42, +982]. Default: 563

Page 165: Acspl Software Guide Revision 3 00

MODES OF MOTION 4-55

ACSPL Software Guide - Document revision no. 3.00

4.11.1. Method of Operation FA.1=0, MM=21 This is the standard joystick motion mode. Every 1 millisecond the analog input (A0 for X and A1 for Y) is sampled and a velocity command is generated according to the transfer function described in Figure 4-21. Note that changing the sign of LV will change the direction of the move.

Figure 4-21 Joystick method of operation FA1=0

FA.1=1 , MM=21 Every 1 millisecond the analog input is sampled. A velocity command is generated according to the transfer function that is described in Figure 4-22. Note that changing the sign of LV will change the direction of the move.

Figure 4-22 Joystick method of operation FA1=1

While moving in this mode it is possible to switch instantaneously to mode 10 on the fly (let MM=10). The value of the Linear Velocity parameter is automatically updated to the velocity of the axis at the moment of the switch.

Page 166: Acspl Software Guide Revision 3 00

4-56 MODES OF MOTION

ACSPL Software Guide - Document revision no. 3.00

4.12. Mode 22 - Position Tracking In this mode, you can instantaneously change the desired position of the axis, without developing a profiled motion towards a new target position. (The change in position is generated within 1 ms if positions are supplied in program mode, or with about 5 ms communication delay if supplied in direct mode.)

If the changes in distance are too large, the motor may be trapped on error. The procedure for position tracking is as follows

1. Set $MM to 22. 2. Issue a B$ command to start tracking. From that point until you issue an E$

command, any change in $AP or $RP results in an instantaneous jump to that position. There will be only one Begin message - upon Begin command, and only one End message - upon End command or an error (Position error, Motor Off, Emergency Stop, but not Limits)

It should be noted that a problem arises due to the fact that in this mode the move takes 1ms and therefore it cannot be aborted by a limit switch, since the limit is processed with a precision of 1 ms. Therefore, if them move exceeds a limit, the following occurs: The move is completed (triggering the limit switch as it does so). Any subsequent attempts to define a new target beyond the limit are ignored, the move is not made, and no error message is issued. If a diagnostic message is desireable in this case, prepare AUTO_LL$ and/or AUTO_RL$ routines.

Page 167: Acspl Software Guide Revision 3 00

ADVANCED FUNCTIONS 5-1

ACSPL Software Guide - Document revision no. 3.00

5. ADVANCED FUNCTIONS

5.1. Accuracy Enhancement Using Error Mapping Error Mapping enhances the accuracy that can be achieved by any single or dual axis positioning system. It is done by taking into account the errors that have been pre-measured at some number of position points, and altering the commanded target point in a way that minimizes the actual error at the point specified by the user. X and Y axes support a two dimensional Error Mapping. Z and T axes support only one dimensional Error Mapping.

Page 168: Acspl Software Guide Revision 3 00

5-2 ADVANCED FUNCTIONS

ACSPL Software Guide - Document revision no. 3.00

5.1.1. Parameter Definition $EM Error Mapping definition. $EM is a bitmapped parameter.

The three least significant bits are used. Bit 0 0 - Error Mapping is not used. 1 - Error mapping is used. Bit 1 0 - Use Grid Delta parameter. 1 - Use Grid Delta array. Bit 2 0 - If the Target Position is outside the grid, extrapolate

the error correction from the close grid. 1 - Do not extrapolate. Enable Error Mapping using a fixed Grid Delta without extrapolation outside the grid map.

SXEM1 (EM.0=1 EM.1, EM.2=0) Enable Error Mapping with variable Grid Delta and with extrapolation outside the grid map.

SXEM7 (EM.0, EM.1, EM.2=1)

$EM can be set only if the option is factory installed. The controller prompts with an error code 10 if the option is not installed.

$GS Grid Size. The size of the matrix that specifies the error grid. For example, (XGS=5, YGS=7) specifies a 35 points (5 X 7) error grid. The maximum grid size is (60 x 40) for XY and (72 x 1) for Z and for T.

$GD Grid Delta parameter. It specifies the distance, in counts (microsteps) between two adjacent points on the grid. It can be set differently for each axis. The range of $GD is [1 - 1,000,000]. If $EM=1 or $EM=5 then grid delta is constant and equals to GD parameter. If $EM =2 or $EM=6 then grid delta is defined by the grid delta vector (g$(i)) according to the target point.

$GO Grid Offset. The Grid Offset specifies the origin of the error mapping relative to the axis’ origin.

Page 169: Acspl Software Guide Revision 3 00

ADVANCED FUNCTIONS 5-3

ACSPL Software Guide - Document revision no. 3.00

$GC Grid Correction. A report request of GC yields the error correction needed for the a specified target point. If a motion is developed towards a target, motion will actually be calculated and developed towards the point: (XAP + XGC, YAP+YGC) instead of (XAP, YAP) for a XY move. For a single axis move motion will actually be calculated and developed towards the point: ($AP + $GC) instead of ($AP)

$CG Current Position minus Grid Correction ($CG=$CP-$GC). The value of $CG equals to the position without the error correction.

5.1.2. Error Array (AE) For XY The AE array contains the error corrections for X and Y at the grid points. The array dimension is [XGS x YGS]. The array is set by the AESE command. The general form of the command is: AESE(i,j)(X

i,Y

j)(X

i+1,Y

j) (X

i+2,Y

j)...(X

GS,Y

j) (X

1,Y

j+1) (X

2,Y

j+1).........(X

GS,Y

GS)<cr>

(i,j) determines the starting point, and each pair of values relates to the 'next' grid point. The order of the points entering is: all the points of the j'th row first ( from i to XGS), and then continue to (j+1)'th row (from 1 to XGS) up to the YGS'th row. Assuming XGS=YGS=3 AESE1 1 5 3 7 2 -1 3 -4 5 1 1 2 -1 3 0<cr> Sets the following XY points: (1,1) = (5,3) (2,1) = (7,2) (3,1) = (-1,3) (1,2) = (-4,5) (2,2) = (1,1) (3,2) = (2,-1) (1,3) = (3,0) AESE3 3 4 2<cr> sets the entry point (3,3) to (4,2)

Page 170: Acspl Software Guide Revision 3 00

5-4 ADVANCED FUNCTIONS

ACSPL Software Guide - Document revision no. 3.00

Figure 5-1 Error mapping algorithm

There are three ways to report the error map: • Report on grid point: AERE(i,j)<cr> reports the X, Y errors at grid

point (i,j). • Report the i'th row in the grid: AERE(i)<cr> • Report the entire grid: AERE<cr>. This option is useful only if the

total grid size is less than 100 points.

5.1.3. Error Vector For Z And T Axes There are two error vectors for each Z and T axis; f$ and b$. f$ contains the error corrections that are used in forward motion. b$ contains the error corrections that are used in backward motion. This feature is most useful when working with step motors that have a different hysteresis for each direction. To get the same error correction in both direction set f$ to be equal to b$.

5.1.4. Method Of Operation • Set $EM to the required mode of operation. • Set Grid Delta ($GD) for a fixed grid delta. Build the grid vector

(g$) for variable grid delta.

Page 171: Acspl Software Guide Revision 3 00

ADVANCED FUNCTIONS 5-5

ACSPL Software Guide - Document revision no. 3.00

• Set the Grid Size ($GS). $GSx$GD must be greater than the total travel of the axes when working with a fixed Grid Delta.

∑=

GS

iig

$

1)$( must be greater than the total travel of the axes for a

variable Grid Delta. • Using a high accuracy measurement device (Laser interferometer,

reference glass scale), command the axes to move to each grid point and measure the errors at that point.

• Assign the measured error table to the AE array for X and Y and f$, b$ for Z and T.

• Set $GO to the difference between the origin of the grid location and the origin of the axis.

Note that the $EM parameters are not backed by the non-volatile memory. They must be set after power-up.

The error correction mechanism is active only for modes 0, 1, 3. The dual axis module controls a 20x20 mm table. The resolution is 1µM (1000counts/mm). The X and Y grid size are 3. Grid Delta for X, and for Y are 10000. XGS = 3 YGS = 3 XGD = 10000 YGD = 10000 The measured error table is:

i,j X,Y positions Ex Ey 1,1 0,0 10 10 2,1 10000,0 20 10 3,1 20000,0 30 10 1,2 0,10000 10 20 2,2 10000,10000 20 20 3,2 20000,10000 30 20 1,3 0,20000 10 30 2,3 10000,20000 20 30 3,3 20000,20000 30 30

To enter the error grid table:

AESE1 1 10 10 20 10 30 10 10 20 20 20 30 20 10 30 20 30 30 30<cr>

Now, specifying a move to (X,Y) = (15000,15000) results in a move to (X,Y) = (15025,15025) A move to (X,Y) = (5000,0) results in a move to (X,Y) = (5015,10).

Page 172: Acspl Software Guide Revision 3 00

5-6 ADVANCED FUNCTIONS

ACSPL Software Guide - Document revision no. 3.00

5.2. Searching For Index Searching for encoder index can be done at any time, when the motor moves in any motion mode and at any speed. The accuracy is ±1 encoder count at any velocity up to 5,000,000 counts/sec. Thus, also during normal operation, the index can be checked, in order to verify that the accuracy has not been impaired by loss of encoder count. When the index input is activated, provided that the corresponding $_INDEX state variable is false, the content of the 16 bits encoder counter is latched into a 16 bits register. When a report of IX is requested, it is updated accordingly, and the $_INDEX state becomes true. Additional occurrences of index signals do not cause the latching of a new position until the previous IX position is read. Once the position is read, the $_INDEX state is automatically cleared. If more than one index mark has occurred since the last reading of IX, only the first one is latched into IX.

It is important to read the index location before the axis moves ±32000 counts away from the index. Otherwise, the content of IX will not be valid.

The use of an ACSPL program similar to the following one is recommended: IND: V0=ZIX Execute a dummy read in order to clear the

INDEX status till Z_INDEX and to enable new latching. V0=ZIX disp " Z Index position = " V0 stop

5.2.1. Switching from One Encoder to Another When $FA.3=0, $IX holds the index position of the primary encoder. The $_INDEX state indicates a new index. The state is set by hardware when index occurs at the primary encoder and its position is latched. The state is cleared by hardware when $IX value is read (reported either by ACSPL or in Direct mode). When $FA.3=1, $IX holds the index position of the secondary encoder. The $_INDEX state indicates a new index. The state is set by hardware when index occurs at the secondary encoder and its position is latched. The state is cleared by hardware when $IX value is read. When switching from primary encoder to secondary (switching $FA.3 between 0 and 1), the R$IX command will not yield a reliable value until the index signal has been detected.

Page 173: Acspl Software Guide Revision 3 00

ADVANCED FUNCTIONS 5-7

ACSPL Software Guide - Document revision no. 3.00

5.2.2. Reading Master Index Conditions enabling reading Master Index of the axis are the following: - $MA > 0 (otherwise $MI is reported as 0) - $FA.0 = 1 (otherwise $MI is reported as 0) Only index position at secondary encoder of MAster axis can be read as $MI. $MI is reported in slave units (i.e. master secondary encoder position is multiplied by $TC and scaled by $TF). The $_MINDX state variable indicates a new master index. The state is set by hardware when index occurs at the secondary encoder of master axis and its position is latched. The state is cleared by hardware when $MI value is read (reported either by ACSPL or in Direct mode).

5.3. Homing There are many ways to define an accurate physical home (zero position) of an axis. One of them is to define the home position as the first index position outside the left (lower) limit. The following ACSPL program executes the complete homing process. It consists of the following steps: • Move towards the left limit. • Find the first index outside the limit. • Move to the limit location. • Set the position counter to zero.

HOME: let XMM = 10 Use velocity mode. let XLV = -20000 To move towards the lower limit set LV to a

negative value. let XLA = 1000000 Define acceleration and deceleration. let XLD = 1000000 let XMO = 1 Enable the axis exec BX Move towards the limit. till X_LL Wait until the limit is reached. exec KX to ensure motion stop in all working modes. let XLV = 20000 Change to positive velocity. exec BX Move out of the limit. till ^X_LL Wait until out of the limit. V0 = XIX Clear the index flag. till X_INDEX Wait until the first index outside the limit is

detected. V0=XIX Record the index position. exec EX Stop the move. let XMM = 0 Change to point to point mode. let XAP = V0 Set the index location as the target. exec BX Move.

Page 174: Acspl Software Guide Revision 3 00

5-8 ADVANCED FUNCTIONS

ACSPL Software Guide - Document revision no. 3.00

till ^X_MOVE Wait until the move is finished. wait 200 Let it settle. let XZP = 0 Define this position as home. disp “At home” stop

5.4. Registration Mark Movement When the registration input is activated, provided that the corresponding $_MARK1 state variable is false, the instantaneous location, as measured by the encoder is automatically latched into the M1 parameter, and the $_MARK1 state becomes true. Additional occurrences of mark inputs do not cause the latching of a new position until the previous M1 position is read, directly via a report command, or indirectly by issuing an MX command. Once the position is read, the $_MARK1 state is automatically cleared. If more than one MARK signals have occurred since the last reading of M1, only the first one is latched into M1. The latched position accuracy is ±1 encoder count at any velocity up to 5,000,000 counts/sec! An AUTO_M1$ automatic routine is automatically activated when the $_MARK1 state becomes true, and should be used to execute the registration move as fast as possible. Upon a M command, the currently executed profile is aborted, and the motor continues to move in the last sampled velocity*. Assuming that the conditions that are mentioned below are true, the controller develops a deceleration profile towards a new target - (M1+RD) , using LD and SF parameters.

Special firmware versions are available with support for moving RD in minimal time, accelerating to maximum available velocity and decelerating to stop at target. For more information, consult the factory.

5.4.1. Necessary Conditions • The motor is moving in point to point mode (0,1,3), velocity mode

(10), or joystick mode (21). • It is a single axis move. • The direction of the registration move is the same as the direction

of the move. • The move parameters (LD, SF, and current velocity) and a 0.016

second calculation delay make the execution of the registration move feasible (i.e., RD is long enough to be calculated and performed in time, before the motor passes the target).

• The motor is currently not executing another registration move ($_RD is false).

* Some special firmware versions support the option to move an RD in minimal time, accelerating to

maximal velocity avaialble, and decelerating to stop at the target. Consult the factory.

Page 175: Acspl Software Guide Revision 3 00

ADVANCED FUNCTIONS 5-9

ACSPL Software Guide - Document revision no. 3.00

5.4.2. ACSPL Support • $_RD state variable. True while a registration move is being

executed. False otherwise. Right after a Move (M) command, it is recommended to check if $_RD is true. If it is false, then a program that deals with exceptions should be invoked. (See the example below.)

• AUTO_M1$ automatic routine is executed when the registration input is activated.

5.4.3. What Happens When a Move Command Fails • If M is issued via the communication link an error 15 is prompted. • According to the motion mode, the following is done:

MM=0,1,3 The motor will continue to run forever at the velocity that was sampled when the Move command was issued. The motion must be stopped by a Kill command.

MM10 The motor will continue to run forever at the velocity that was sampled when the Move command was issued. The velocity can be changed by setting LV.

MM21 The motor is under joystick control.

Notes • Move commands can be issued simultaneously for more than one

axis. • It is recommended to issue the Move command using AUTO_M1$

routine which is activated by the registration input. • $M1 are not updated automatically! The AUTO_M1$ must include

a command that reads it in order to force the updating action and to re-enable the registration action. It must be done before the motor moves 32,767 counts away from the registration point.

• Right after a Move command, it is recommended to check if $_RD is true. If it is false, then, a program that deals with exceptions should be invoked. It should do the following:

Stop the motor. Execute a move towards the desired point,.

• In Master-Slave mode a registration move is implemented by setting the MD parameter.

The X motor is moving in point to point mode (MM=0) from the origin to 100,000 (Case #1 in Figure 5-2). The acceleration is 3,000,000 counts/sec2 and the velocity is 200,000 counts/sec.. When reaching position 20,000 the registration input is activated. The AUTO_M1X is activated and the motor is commanded to

Page 176: Acspl Software Guide Revision 3 00

5-10 ADVANCED FUNCTIONS

ACSPL Software Guide - Document revision no. 3.00

move 30,000 counts away from the registration position and to stop there (Case #2). AUTO_M1X: Automatic routine that is invoked when

the registration input is activated. V0=XM1 Read the registration position. The

registration position must be read in order to update XM1. Otherwise, the move will be referenced to the previous registration position. Also, in case of failure (See next example), it is used for "manual" execution.

let XRD=30000 Registration Distance = 30,000 counts. If the registration distance is known prior to the occurrence of the registration mark, it can be assigned outside this routine.

exec MX Move command if ^X_RD call FAILURE Always check if the command

is executed! till ^X_MOVE Wait until the desired position is reached. disp "Current Position = " XCP Should be 50,000. ret FAILURE: This routine is invoked when the MX

command cannot be executed. exec KX Stop the motor. disp "Failure" V1=XMM Save the mode. let XMM=0 Switch to point to point mode. (let XRD=-15000) Case #3 V0=V0+XRD Calculate the desired target position. let XAP=V0 exec BX till ^X_MOVE let XMM=V1 Retrieve the working mode. ret

Same example as above, but now the acceleration is 100,000. It is physically impossible to command the motor to stop 30,000 counts away without reversing the velocity. This might not be allowed by the structure of the machine. If it is permitted, then, the above 'FAILURE' routine will do the job. If not, just put a STOP command after the disp "Failure" command.

Same as above. However the motor is commanded to move backwards 15,000 counts, reaching position 5,000. This is implemented by adding the bold line to the FAILURE routine (Case #3).

Page 177: Acspl Software Guide Revision 3 00

ADVANCED FUNCTIONS 5-11

ACSPL Software Guide - Document revision no. 3.00

Figure 5-2 and Figure 5-3 present the velocity and the position profile of the three cases. Data has been sampled using the Data Collection feature at the rate of 1kHz.

0

10000

20000

30000

40000

50000

60000

70000

80000

90000

100000

1 51 101 151 201 251 301 351 401 451 501 551 601 651 701

Time [msec]

Position [counts]

Case #1 - Original move

Registration input @ CP=20,000

Case #3Registration Distance = 15,000

Case #2Registration distance = 30,000

R MOVE 1.XLC

Figure 5-2 Registration mark move - position profile

-250

-200

-150

-100

-50

0

50

100

150

200

250

151 101 151 201 251 301 351 401 451 501 551 601 651 701

Time [msec]

Case #3 - Registration mark @ 20,000Registration distance = 15,000

Case #2 - Registration mark @ 20,000Registration distance = 30,000

Case #1 - No registration move

R_MOVE_2.xlc

Figure 5-3 Registration mark move - velocity profile

Page 178: Acspl Software Guide Revision 3 00

5-12 ADVANCED FUNCTIONS

ACSPL Software Guide - Document revision no. 3.00

5.5. Real Time Data Collection Data collection is a powerful diagnostic and digitizing tool. It can, for example, be used to analyze: • Overall system performance. • Identify mechanical disturbances. • Measure the accuracy of a circular move or any arbitrary path. • Measure constant velocity/smoothness performance using a high

frequency clock, digitizing a two dimensional arbitrary path made of up to 1024 points.

For statistical analysis, ACSPL supports MIN, MAX, and AVERAGE functions.

5.5.1. Parameter Definitions DC - Data Collection mask. It is an axis parameter. DC contains bit information on the enabled data collection parameters. The following real time parameters can be sampled:

LV Linear Velocity. CP Current Position. PE Position Error. DO Dac Out command. D1 DAC_1 output command. D2 DAC_2 output command. MP Master Position. AC Analog input channel. For X - A0 (Analog input 0),

For Y-A1 (Analog input 1). IO Input and Output ports. For X - IP, For Y-OP. DSP Debugging information collected from the Servo

Processor (for advanced users). MPU Debugging information collected from the main

processor unit (for advanced users).

DC bit assignment 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0 0 0 0 MPU DSP IO 0 0 AC MP D2 DO-servo

D1-stepper PE CP LV

ti Data collection Time Interval. ti determines the data

collection sampling time in milliseconds. Every ti milliseconds, the assigned parameters are sampled and stored into TX, TY, TZ, TT arrays. When velocity (LV) is one of the sampled parameters, ti is not used.

Page 179: Acspl Software Guide Revision 3 00

ADVANCED FUNCTIONS 5-13

ACSPL Software Guide - Document revision no. 3.00

SL Start Location indicates the position at which velocity data collection starts, and the position where the Position Event Generator starts.

PI Position Interval. PI serves two purposes: for velocity measurements and for position event generation. During velocity / smoothness measurement the controller measures how long it takes to move PI counts. When the PEG function is activated in incremental mode, a pulse is generated every PI counts.

DL Data Lower index. Data is collected into T$ arrays, starting at entry DL.

DU Data Upper index. Data is collected into T$ arrays, up to entry DU.

DS Data executed Step. DS points towards the current entry to the T$ arrays.

FE Special Function Enable. FE is used to enable special functions. Real time data collection, and Position Event Generator (PEG).

0 - Disable all. 1 - Enable and activate data collection. 2,4,6 - Enable and activate PEG.

The PEG and DC functions cannot be activated simultaneously. When the function is completed , the value of FE is automatically reset to zero.

DC_ON When FE is set to 1, DC_ON becomes true. Once DS reaches DU and the last sample is collected, DC_ON becomes false.

5.5.2. Method of Operation

This section doesn’t apply to LV collection – see Section 5.5.3.

Data for up to four parameters can be collected simultaneously per system (controller). The bitmap of the DC parameter determines the parameters to be collected. For each parameter, samples are stored in a separate Target array (TX, TY, TZ, and TT as applicable). Sampling is done simultaneously, with each sample stored in the same area of its Target array. The lower and upper borders of these areas are set by the DL and DU parameters respectively. To optimize the Target array usage and to enable several parameters for the same axis to be collected, the Target arrays are allocated not per axis when used for data collection. TDC, ZDC, YDC and XDC are regarded as joined (in that order) to form a single bitmap entity, where the least significant bit of XDC is

Page 180: Acspl Software Guide Revision 3 00

5-14 ADVANCED FUNCTIONS

ACSPL Software Guide - Document revision no. 3.00

the least significant bit of the entity and most significant bit of TDC is the most significant bit of the entity. The bits of this entity are checked starting from the least significant nonzero bit to the most significant nonzero bit. Data collected about the parameters assigned by these bits is stored in the Target arrays as follows: • TX array – first nonzero bit

• TY array – 2nd nonzero bit

• TZ array – 3rd nonzero bit

• TT array – 4th nonzero bit

The extra DC bits are ignored. Example: Collect YPE and YCP. Settings: XDC=0, YDC=6 (bits 1-CP and 2-PE) Allocation: YCP will be collected in TX array, YPE in TY array. Example: Collect YCP. Settings: XDC=0, YDC=2 (bit 1-CP) Allocation: YCP will be collected in TX array Once DC, DU, DL, and ti have been set, data collection can be activated by setting FE to 1. DS is set internally to DL-1. Every ti milliseconds, the selected data is recorded into the T$ arrays and DS is incremented. Collection stops when DS = DU.

Note regarding some single- and dual-axis controllers: To collect four parameters, single-axis controllers use TX only while dual-axis controllers use TX and TY. In the single-axis controller, the TX array is split into four parts: TX(0). TX(255) for the first parameter, TX(256) .. TX(511) for the second parameter, etc. In the dual-axis controller, each array (TX and TY) is split into two parts. This applies for the SB1291 and SB1291ND, regarding other models, see hardware guide or consult factory.

Suggested order for setting up and activating data collection: • Set the mask bits of the desired parameters in the Data Collection

mask (DC) of the desired axes. • Define the sampling time interval by setting data collection Time

Interval (ti). The units are 0.001 second. • Define how many samples should be collected and in what part of

the T$ arrays to store them, by setting DL, DU. • Activate the function by setting FE to 1. • Wait until either DS=DU, or until DC_ON is false (or until FE=0). Starting when input 1 is activated, record 1024 samples of X Position Error (XPE). Sampling interval is 1 millisecond.

Page 181: Acspl Software Guide Revision 3 00

ADVANCED FUNCTIONS 5-15

ACSPL Software Guide - Document revision no. 3.00

EX1: let XDC = 4 Setting bit #2. let ti = 1 Sampling interval = 0.001 second let DU = 1023 till IN1 Wait for input 1. let FE = 1 Activate data collection. till ^DC_ON Wait till 1024 samples are collected. disp "done" stop

After running, TX holds 1024 samples of XPE. The following program calculates the absolute value of the samples, the average, minimum and maximum value: STAT1: I0 = 1023 Calculate the absolute value of each

sample. loop I0

V0=TX(I0) V0=abs(V0) TX(I0) = V0

end

V0=min(TX) Calculate the minimum error. V1=max(TX) Calculate the maximum error. V2=avg(TX) Calculate the average error. disp "Average of XPE = ", V2 disp "Minimum value of XPE = ", V0 disp "Maximum value of XPE = ", V1 stop

It is assumed that X and Y axes are moved manually. While moving, it is required to digitize the move, by sampling XCP, YCP. The move time is limited to 10 seconds, so a sampling interval of 0.01 second is adequate. The user starts the process by pressing 'BG' and terminates it by pressing 'EN'. To repeat the move, using Path Generation mode (16), type 'PG'. It is assumed that the function keys FKEY_01, FKEY_02, and FKEY_03 are assigned to 'BG' , 'EN' , and 'PG" respectively. This is done at program initialization with the following commands: AFSE1 1 2 66 71 Sets function key 1 to be key

combination B+G. AFSE2 1 2 69 78 Sets function key 2 to be key

combination E+N. AFSE3 1 2 80 71 Sets function key 3 to be key

combination P+G. At the end of the process, TX and TY contain the digitized XCP and YCP data.

Page 182: Acspl Software Guide Revision 3 00

5-16 ADVANCED FUNCTIONS

ACSPL Software Guide - Document revision no. 3.00

FKEY_01: This routine is activated by typing 'BG'. let XDC=2 Setting bits 2 (XCP). let YDC=2 Setting bits 2 (YCP). let DL=0 let DU=1023

let ti=10 Time Interval of 10 milliseconds. let FE=1 till ^DC_ON

disp "Done. Size of the digitized array is " DS V0=DL let XLI = V0 V0=DS let XUI = V0 ret

FKEY_02: This routine is activated by typing 'EN' let FE=0 ret

FKEY_03: Repeat the move using mode 16. let XMO=1 let YMO=1 let XMM=16 let YMM=16

let XPT=5 Set the Path Time interval to 5 milliseconds, thus, doubling the speed.

exec BXY ret

5.5.3. Velocity/Smoothness Measurement Velocity and smoothness measurement is a special case of data collection. It provides the ability to make velocity measurements of a very small distance/time interval with high resolution. The user defines the Start Location (SL) and the Position Interval (PI). The controller measures the amount of time it takes to pass each of the consecutive PI's, up to 1024 intervals. The duration of the clock unit depends on the controller model. In the Unilitex, SB11xx, SB12xx and SB13xx, and SB214PC2/4 (some firmware versions), the clock unit is 50•10-9 seconds. In other controller models, the clock unit is 100•10-9 seconds. The clock counter size is 16 bits. Therefore, the value of PI should be restricted so that the time per interval is less than 65536 clock units. Example: For an SB1292 controller, the maximal time measured can be 65536•50• 10-9 ~= 3ms. If time to be measured is, let us say 0.004 seconds, the data recorded is (number of clock units counted) mod (65536).

Page 183: Acspl Software Guide Revision 3 00

ADVANCED FUNCTIONS 5-17

ACSPL Software Guide - Document revision no. 3.00

As long as the number of samples per millisecond does not exceed 5, the complete sampling is guaranteed to be made over adjacent intervals. When velocity is sampled, no other parameter can be collected at that time.

Using an encoder with 50 lines/mm, each encoder count (after 4X) equals 0.02mm. The nominal velocity is 100 mm/sec. For PI=4 (one encoder line), the nominal time interval is 0.02/100=0.0002 seconds = 2,000 clock counts. For velocity of 3mm/sec, the nominal time interval is 0.02/3=0.00667 seconds=66,666 clock units. The recorded value will be 66,666 - 65,536=1131. It is recommended to set PI to an integer number of encoder lines, in order to eliminate the jitters that is generated by electronic multiplication. Setting PI to 2 measures the duty cycle of one of the encoder channels. Setting PI to 1 measures the qaudrature phasing.

ti is not used during velocity measurement. If an additional parameter is active, it is sampled at the same rate that the velocity is being sampled.

The motor is equipped with a 2,000-line encoder. No external multiplier is used. The motor is commanded to move at a continuous velocity of 2 rps ( = 2000•4•2 = 16,000 counts/second). It is required to measure how long it takes to move every 16 counts. If the system is well adjusted and the performance of the system is good, the average clock counts per interval is 10,000. The program starts the move, initiates all the parameters, continuously measures the velocity, calculates the minimum and maximum deviation in tenth of a percent, and displays those values. VM: let XMM=10 Set to velocity mode. let XMO=1 Enable the motor. let XLV=16000 Set the speed. let XPI=16 Set the position interval to 16 counts let XDC=1 Sample velocity (DC=1). let FE=0 Stop any active function (PEG or DC). let DL=0 Set the array limits. let DU=1023 let XLI=0 let XUI=1023 exec BX Start moving. till X_MOTION=3 Wait till the nominal velocity is reached. VM1: V4=XCP+1000 Calculate a new start location for each

round of measurement. let XSL=V4 let FE=1 Start sampling.

Page 184: Acspl Software Guide Revision 3 00

5-18 ADVANCED FUNCTIONS

ACSPL Software Guide - Document revision no. 3.00

till FE=0 Wait until the sampling process is completed.

V0=min(TX) The sampled data is gathered into the TX array.

V1=max(TX) Calculate min, max and average values. and

V2=avg(TX) translate into tenth of a percent units. V0=V2-V0 V0=V0*1000 V0=V0/V2 V1=V1-V2 V1=V1*1000 V1=V1/V2 disp “Minimum dev. = “ V0 “Maximum dev. = “ V1 “Average clock count = “ V2 goto VM1 Repeat the process. stop

A typical display should look like: Minimum dev.=23 Maximum dev.=32 Average clock count = 9999

Minimum dev.=18 Maximum dev.=21 Average clock count = 10000

Minimum dev.=28 Maximum dev.=27 Average clock count = 9999

(23 means 2.3%)

5.5.4. Fast Response Reporting for Selected Parameters When FE.3 = 1, data in the target array may be automatically sent to the communication channel. If any of the $DC parameters is nonzero, the appropriate target array is transmitted. Each element is followed by <checksum> (when required) and by <cr>. The order of transmission is TX(i), TY(i), TZ(i), TT(i). When FE.0=1 (Data Collection is active): i ∈ (DL .. DU) and i < DS. When FE.0=0 (Data Collection is not active): i ∈ (DL .. DU) and I ≤ DS. Which means: If immediate transmission (FE.3) is activated when Data Collection is active, all the data collected till now is transmitted and all new data continues to be transmitted as soon as it is collected. Data transmission is over only after Data Collection finishes, and the recently collected data has been transmitted. If immediate transmission (FE.3) is activated when Data Collection is inactive, all the data collected previously (i.e., data within DL…DU) is transmitted. Once all collected parameters have been transmitted, FE.3 is set automatically to zero. During the collection process and/or the transmission, FE.3 may be cleared in order to terminate further transmission.

Page 185: Acspl Software Guide Revision 3 00

ADVANCED FUNCTIONS 5-19

ACSPL Software Guide - Document revision no. 3.00

If during the transmission data is temporarily not available (data collection is at a slower pace than transmission), other commands/reports can be processed and transmitted in the meantime. In such a case, new available data will be transmitted immediately following any other pending transmission. If FE.0 and FE.3 are set simultaneously (FE=9), and data collection cannot start for any reason, then FE.0 and FE.3 will be cleared and no transmission will take place. Restrictions: FE.0 cannot be set to 1 while FE.3=1. (FE.0 and FE.3 may be set simultaneously to 1.) If data is available when FE.3 is set to 1, the data will be transmitted completely before other commands can be processed and executed.

5.6. Limited Data Collection at a Rate of 20 kHz This operation is not supported by all controllers. Consult the factory for more information.

Method of operation: Set $WT to the internal address required for DC. Set $DC for DSP data collection. Perform a regular data collection session (even for only one element). Set D$(4) to a value in the range (1 .. 255). Procedure: The controller collects from the $WT address into the sine table array starting from sine(D04) and proceeding to sine(0). After D04 ticks, D04 0 (internally) and the sine table is set with the collected values. Data must be collected through regular DSP data collection from addresses D04 .. 0 into the array using D04 DC sessions.

The operation is available only when $XT = 1. After the procedure, the sine table is not valid anymore!

5.7. Position Event Generator (PEG™) The PEG function generates real-time, position triggered digital output events, with very small (electronic gate) delays. The PEG function is particularly useful for scanning applications, where it is necessary to activate external events based on position, high accuracy laser cutting, on the fly, accurate marking and more.

The PEG option must be installed. When the option is not installed, the controller prompts with an error code 10, when trying to enable the function.

The PEG function applies only for the X axis (digital outputs 1 to 5 and 8) and Y axis (digital outputs 9 to 13 and 16).

Page 186: Acspl Software Guide Revision 3 00

5-20 ADVANCED FUNCTIONS

ACSPL Software Guide - Document revision no. 3.00

In the SB14, SB214, and SB100x PEG applies on the X axis to outputs (1 to 8) and on the Y axis to outputs (9 to 16). Some controllers include special fast PEG outputs. Physically each PEG output shares the same source as a corresponding digital output but has a different output level. The fast PEG outputs are designed to minimize delays. See your controller hardware and setup guide for more information. There are two modes of PEG operation: incremental and random

5.7.1. Incremental Mode This mode is the fastest of the two, with its speed limited only by that of the output circuitry.[r44] However, it has the limitation that only a single fixed PEG output can be activated per axis and the triggering positions must be equidistant. Every PI encoder counts, starting at position SL (Start Location) a pulse is generated on output 8 (X PEG) and/or 16 (Y PEG). The process can be aborted by resetting FE (described later in this section) or it will stop when the EL (End Location) position is reached. The output pulse width is programmable via the MT (PEG Match Time) parameter. When moving in a positive direction, incremental PEG will take place as desired only when PEG is activated while the following condition is true: Current Position < $SL <= $EL. When moving in negative direction, incremental PEG will take place as desired only if Current Position > $SL >= $EL. Incremental PEG detects reaching EL with 1ms precision. Therefore, extra pulses can occur in the interval between the time that the system reaches EL and the time that the controller registers that fact.

5.7.2. Random Mode This mode is slower (up to 8 events per ms), however there can be multiple PEG outputs and the triggering positions do not have to be equidistant (but must be in either ascending or descending order). Positions can be relative or absolute. The X PEG positions trigger events for outputs 1 to 5 (1 to 7 for some controllers) and a pulse on output 8 and the Y PEG positions trigger events for outputs 9 to 13 (9 to 15 for some controllers) and a pulse on output 16. The pulse width is programmable via the MT (PEG Match Time) parameter.

Page 187: Acspl Software Guide Revision 3 00

ADVANCED FUNCTIONS 5-21

ACSPL Software Guide - Document revision no. 3.00

5.7.3. Definition of Parameters PM Peg Mask. This parameter controls which outputs are

assigned to the PEG function. Bits 0 to 7 control the X PEG and correspond to outputs 1 to 8. Bits 8 to 15 control the Y PEG and correspond to outputs 9 to 16.

$SL Start Location. Indicates where the Position Event Generator starts. (Also used for Velocity Measurement, as described in Section 5.5.3.)

$EL End Location. Incremental mode. When the position reaches the EL location the process stops. If EL=SL the process continuous as long as FE=2.

$PI Position Interval. Incremental mode. When the PEG function is activated, a pulse is generated every PI counts. (Also used for Velocity Measurement, as described in Section 5.5.3.)

$AL Array Lower index. Points to the first entry of the array. $AU Array Upper index. Points to the last entry of the array. $AS Array executed Step. Points to the next entry in the T$

array. FE Special Function Enable. FE is used to enable PEG

and data collection, described in Section 5.5. FE is bitmapped: bit 0 is data collection, bit 1 is X PEG, and bit 2 is Y PEG. Data collection and PEG cannot be enabled simultaneously, therefore the valid values are:

The PEG function is an option that requires hardware installation. When the option is not installed, the controller responds with an error code 10 and the function is not executed.

$EG Event Generator mode. The exact mode of operation is defined by the Position Event Generator mode (EG):

$EG=0 Random mode. Relative position. The first position entry in the T$ array is relative to the SL. Each subsequent position entry is relative to the previous position. For allocation of positions and events in the T$ array, see Figure 5-4.

$EG=1 Random mode. Absolute position. $EG= 2 Incremental mode. Each PI counts, a

pulse is generated on output 8 for X and output 16 for Y.

Page 188: Acspl Software Guide Revision 3 00

5-22 ADVANCED FUNCTIONS

ACSPL Software Guide - Document revision no. 3.00

$MT PEG Match Time. It defines the pulse width (in clock units) that is generated by output 8 for X and output 16 for Y, when a match happens. The clock unit depends on the controller model. In the Unilitex, SB11xx, SB12xx and SB13xx, and SB214PC2/4 (some firmware versions), the clock unit is 50•10-9 seconds. In other controller models, the clock unit is 100•10-9 seconds.

5.7.3.1. Additional State Variables These state variables apply only for programmed operation.

X_PEG Y_PEG

When the PEG is activated, this state becomes true. When the function is completed, it becomes false. (See examples)

Figure 5-4 Structure of PEG data (random mode)

For X PEG, the user loads the lower half of TX array (0 to 511) with the positions and, for each position, he loads the upper half of TX (512 to 1023) with events consisting of bit-mapped settings to apply to outputs 1 to 7 when the position is reached. (In addition a pulse is generated on output 8). For Y PEG, the same applies for the TY array and outputs 9 to 15, (with an additional pulse generated on output 16). If T$(i) holds the position information, then the corresponding event information is stored in T$(I+512). To set events in TX (outputs 1 to 7), store a bit map in byte format, where bit 0 sets output 1, bit 1 sets output 2, etc. The same principle applies for TY (outputs 9 to 15): bit 0 sets output 9, bit 1 sets output 10, etc. See also, the example later in this section.

Page 189: Acspl Software Guide Revision 3 00

ADVANCED FUNCTIONS 5-23

ACSPL Software Guide - Document revision no. 3.00

5.7.4. Method of Operation The following steps must be performed. The order is not important except that the first step is to set the FE parameter to 0 and the last step must be setting the FE parameter to 2, 4, or 6. • Set FE = 0. • Choose which outputs are controlled by the PEG by programming

the Peg Mask (PM). • Set MT, which determines the width of the pulse that is generated

whenever a position match occurs. The pulse width is MT clock units.

• Program EG according to the desired mode. • If EG=1 (random mode, absolute), load TX(i), where 0 ≤ i ≤ 511,

with the event locations for X axis or TY(i), where 0 ≤ i ≤ 511, with the event location for Y axis, using absolute coordinates. If EG=0 (random mode, relative), load SL with the Start Location, and TX(i) or TY(i), where 0 ≤ i ≤ 511, with the event locations, using relative coordinates.

• Load TX(i) (for X PEG) or TY(i) (for Y PEG) with the decimal representation of the desired output pattern at each point, where 512 ≤ i ≤ 1023.

• If incremental mode is used, load SL with the starting location, and PI with the desired interval.

• Activate the function by setting FE. To activate X PEG only FE=2, to activate Y PEG only FE=4, to activate both X and Y, set FE=6.

In incremental mode, resetting FE (=0) disables the function. In random mode, the function is automatically disabled (by setting FE to zero) when AS=AU. It can also be disabled by changing FE (e.g. to zero).

Note: If you want to change the PEG parameters, first disable PEG (e.g., by setting FE=0), then change the parameters, and then restore the value of FE. Values of SL, EL, MT and PI take effect only after FE has been set to 2, 4, or 6. For example: in an application involving moving back and forth and activating incremental PEG on each move (swapping the values of SL and EL each time), the following sequence must occur on each move: Reset the PEG option by issuing SFE0 command or verify that PEG ended by

waiting till FE = 0. Set new values for PEG parameters Set the PEG option in FE.

Example of incremental mode: Every 100 encoder counts, starting at 1000, a pulse should be generated, until the position reaches 1800. Each pulse width is 50 micro-seconds. The X motor is assumed to be at the origin before the process starts. (Figure 5-5) PEG_INC: let PM=128 Output 8 only is controlled by the PEG.

Page 190: Acspl Software Guide Revision 3 00

5-24 ADVANCED FUNCTIONS

ACSPL Software Guide - Document revision no. 3.00

let XZP=0 Verifies that CP < SL < EL. let XSL=1000 Start location. let XEL=1810 End Location. let XPI = 100 Position Interval = 100 counts. let XMT=1000 Pulse Match Time = 50•10-6/50•10-9 = 1000.

(Assuming SB1292 control module.) let XEG=2 Incremental mode. let FE = 2 Function enable. let XMM=0 let XMO=1 let XAP=1900 exec BX stop

Figure 5-5 PEG - Incremental mode

Example of random mode (Y PEG ): The settings for outputs 9-15 is defined at each position, according to the following table. The width of the pulse that is generated by output 16 is 10 microseconds. (Figure 5-6).

Position 1000 1400 1600 1800 2000 2300 Out_15 0 1 0 1 0 1 Out_14 1 1 1 1 0 0 Out_13 0 1 1 1 1 0 Out_12 1 0 1 0 1 0 Out_11 0 1 1 0 0 1 Out_10 0 1 1 0 0 0 Out_9 1 0 1 1 0 1 AS 0 1 2 3 4 5 TY if

YEG=0 YSL=900

100 400 200 200 200 300

TY(i+512) bin

0101001 1110110 0111111 1110001 0011000 1000101

TY(dec.) 41 118 63 113 24 69

Page 191: Acspl Software Guide Revision 3 00

ADVANCED FUNCTIONS 5-25

ACSPL Software Guide - Document revision no. 3.00

The example uses relative positioning. If absolute positioning were to be used, the values would be as follows. (Note: if absolute positioning is used, the PEG function only applies for the positions in the array whereas with relative positioning, the PEG function can be repeated with the offset defined by SL. See below.)

TY for YEG=1

1000 1400 1600 1800 2000 2300

PEG_RAN: let PM=65280 Outputs 9-16 are controlled by the

PEG let YMT=100 Pulse width = 10•10-6 / 100•10-9 =

100 (MT value is assuming controller is SB1003)

let YEG=0 Using relative position let YSL=900 Start Location let YAL=0 Define the number of events let YAU=5 exec AYSE0 100 400 200 200 200 300 TY content - event

locations exec AYSE512 41 118 63 113 24 69 TY content - output pattern let YMM=10 let YMO=1 exec BY Velocity mode. START: let FE = 4 Function Enable ret

To repeat the above pattern every 4000 counts: PEG_REP: call PEG_RAN WAIT: till ^Y_PEG V0=YSL+4000 let YSL=V0 let FE=4 goto WAIT stop

Page 192: Acspl Software Guide Revision 3 00

5-26 ADVANCED FUNCTIONS

ACSPL Software Guide - Document revision no. 3.00

Figure 5-6 PEG - Random mode with relative positioning

5.7.5. Optimizing Array Usage The T$ array locations for positions (T[0] - T[511]) and output events (T[512] - T[1023]) are the default locations. This is not the optimal resource allocation if you use less than the full array size. In such a case, you can set FA.6= 1. This will allows you to start storing the output events immediately after the last position. See Figure 5-7. It is your responsibility to make sure the positions and events are stored in the correct array locations. You must store the position-event pairs as follows: Without optimization (default): $FA.6=0. • 1st position at T$($AL), 1st event at T$(512+$AL).

• For subsequent position/event pairs: when position is at T$(i), the corresponding event is at T$(512+i).

• Last position at T$($AU), last event at T$(512+$AU).

Note that this leaves two gaps in the T$ array. With optimization: $FA.6=1. • 1st position at T$($AL), 1st event at T$($AU+1).

Page 193: Acspl Software Guide Revision 3 00

ADVANCED FUNCTIONS 5-27

ACSPL Software Guide - Document revision no. 3.00

• For subsequent position/event pairs: when position is at T$(i), the corresponding event is at T$($AU+i+1).

• Last position at T$($AU), last event at T$(2*$AU - $AL +1).

Note that the rest of the T$ array [(2*$AU - $AL + 2) … 1023] is free for other use, such as targets for MM16 or MM3. This is illustrated shown by the values used in the earlier example (F.6=0): let YAL=0 Define the number of

position/event pairs let YAU=5 exec AYSE0 100 400 200 200 200 300 TY positions exec AYSE512 41 118 63 113 24 69 TY output events

Optimized, the array is as follows (F.6=1): let YAL=0 Define the number of

position/event pairs let YAU=5 exec AYSE0 100 400 200 200 200 300 TY positions exec AYSE6 41 118 63 113 24 69 TY output events

Figure 5-7 Structure of PEG data with (left) and without (right) optimization

5.8. How To Detect If The Motor Moves Away From Its Target

When the profile generation is done, the controller starts an internal clock. This internal clock is initialized to a user defined parameter: Target radius Delay (TD). The parameter defines the time period in milliseconds in which the motor is allowed to be out the Target Radius without any notice. However, if this time period has elapsed and the

Page 194: Acspl Software Guide Revision 3 00

5-28 ADVANCED FUNCTIONS

ACSPL Software Guide - Document revision no. 3.00

motor is out of the Target Radius at least for one millisecond, an automatic routine is invoked: AUTO_EX$. (provided that such a routine is available and the program is compiled). The user can tailor the content of AUTO_EX$ to the needs of the application (send a message, operate an output etc.). The AUTO_EX$ routine is invoked only once per motion. If a Kill command is issued before the routine has invoked, it is not invoked during the current motion. This feature should be used for a step motor for position correction.

5.9. How To Detect If The Tracking Error Limit Is Exceeded

While not accelerating or decelerating, the controller monitors the absolute value of the Position Error ($PE). When this value exceeds the Tracking Error ($TE) limit, the automatic subroutine AUTO_TE$ is invoked. No error message is generated, and the axis is not disabled. The routine is invoked each time, when the Position Error becomes larger than the Tracking Error during a motion. While executing a XY linear interpolated move, whenever the Position Error exceeds the Tracking Error limit, the corresponding XY coordinates are displayed. Move: let XTE=10 let YTE=10 let XRP=100000 let YRP=150000 exec BX stop AUTO_TEX: V0=XCP V1=YCP disp “ X tracking error at X,Y = “ V0, V1 ret AUTO_TEY: V2=XCP V3=YCP disp “ Y tracking error at X,Y = “ V2, V3 ret

5.10. Using a Stepper With Encoder Feedback The primary encoder can be used for both stall detection and position verification and correction. The ratio between the number of encoder counts/rev and the number of microsteps/rev is programmable by the use of two parameters: Gear ratio = EC/2EF

Page 195: Acspl Software Guide Revision 3 00

ADVANCED FUNCTIONS 5-29

ACSPL Software Guide - Document revision no. 3.00

EC - verification Encoder Constant [1 - 65,535] EF - verification Encoder Factor [0 - 23]

X axis controls a stepper motor with 51,200 microsteps/rev, and a 1024 line quadrature encoder (= 4096 encoder counts/rev), the gear ratio is 12.5: XEC=25, XEF=1

5.10.1. Verify Enable (VE) Parameter The verification encoder related features are activated by the use of VE parameter. VE=0 No encoder feedback is used. The Current Position (CP) is derived from the generated command, and the Position Error (PE) is always zero. The velocity axis monitor signal is derived from the generated profile. VE=1 The verification function is activated. The Current Position (CP) reflects the position of the encoder in microsteps units as defined by the gear ratio. The velocity monitoring signal is derived from the encoder feedback. Upon setting the VE value to 1, CP gets the value of the present Desired Position (DP): CP ⇐⇐⇐⇐ DP, and the Position Error (PE) is therefore zero (PE = DP-CP). VE can be set to1 only when the axis is not in motion. When the verification function is active, the Position Error ($PE) is set to zero when the S$ZP command is used. $VE=2. Upon setting the $VE value to 2, $DP gets the (translated) value of the encoder position: $DP ⇐⇐⇐⇐ $CP. Once the encoder is initialized correctly, it is tracking the actual position of the axis even if the motor lost synchronization. When the stepper loses synchronization, it is recommended to use $VE=2 in order to reset $DP to fit the location as measured by the encoder. $VE can be set to 2 only when the verification is already active and the axis is not in motion.

5.10.1.1. Stall Detection Whenever VE>0, and (|PE| > ER), and error message 25 is generated, the move is terminated, and either AUTO_ERR or AUTO_FLT, user defined programs, is activated X ERror limit = 5000 (one tenth of a rev.). If the Position Error (XPE) has exceeded 5000, the following program will be automatically activated: AUTO_ERR: disp "Motor lost position"

Page 196: Acspl Software Guide Revision 3 00

5-30 ADVANCED FUNCTIONS

ACSPL Software Guide - Document revision no. 3.00

ret

5.10.1.2. Position Correction When VE>0,and a motion is executed, once the profile generation is done, the controller starts an internal clock. After TD milliseconds, the controller checks if the Position Error (PE) is smaller then the Target Radius (TR). If not, the AUTO_EX$ routine is activated.

XTR=125, XTD=25, and the motor was commanded to move to the origin by setting XAP=0. Assuming that at the end of the move XCP=300. The following routine will automatically be executed, trying to correct the position: AUTO_EXX: V0=XPE Record the error. EXEC KX let XVE=2 XDP should reflect the position of the

encoder. let XRP=V0 Move the difference. exec BX till ^X_MOVE ret Note that if the correction move happens to be insufficient, AUTO_EXX is called again to correct the correction.

5.11. S/W and H/W Sinusoidal Commutation for AC Synchronous (DC Brushless) Motors

ACS-Tech80 controllers support both software (encoder only) and hardware (encoder + Hall sensors) sinusoidal commutation. The recommended method for performing commutation is to use ACS Adjuster. This software tool carries out commutation quickly and easily. It performs either software or hardware commutation depending on the feedback definition. The rest of this section provides instructions and examples for understanding how commutation works for ACS-Tech80 controllers. The information answers questions that are frequently asked about commutation. In Section 5.11.2 there is an example of how to commutate AC Synchronous (DC Brushless) motors without using ACS Adjuster.

5.11.1. Software Commutation Using ACS Adjuster The controller is capable of commutating AC synchronous (DC brushless) motors. The controller generates two sinusoidal current command signals with a 120 degrees phase shift. It must be used with amplifiers that are designed to accept this type of command. The commutation is based on the encoder (feedback) reading.

Page 197: Acspl Software Guide Revision 3 00

ADVANCED FUNCTIONS 5-31

ACSPL Software Guide - Document revision no. 3.00

The user must set the following parameters: LR encoder Lines per Revolution. LF Encoder line Factor. CU Commutation Usage. Always select encoder (CU=2). XT aXis Type (always XT=3). NP Number of motor’s Poles.

When using a linear motor with a linear encoder, set NP to 2 and LR and LF so that they reflect the number of encoder counts per distance, where distance is defined as twice the magnet pitch and magnetic pitch is defined as the distance between two adjacent magnets ().

N S N S

Pitch

Figure 5-8 Magnetic pitch

Using a linear encoder with 50 lines/mm resolution, an external multiplier of 5, and magnet pitch of 30mm. The number of counts per twice the magnet pitch is

50x5x4x30x2=60,000 LR=30,000 LF=1 NP=2 For more information about commutation, see the Hardware and Setup Guide and the ACS Adjuster online Help.

5.11.1.1. Automatic Software Commutation Setup Automatic commutation setup is used when an incremental encoder (or laser interferometer) is the only feedback for both positioning and commutation (CU = 2). Some points about automatic commutation setup: • The commutation setup is completely transparent to the user. It is

automatically executed once after power up (or HWRES command) when the motor is enabled for the first time.

• During the commutation there is a small move (jerk or jump).

• The commutation setup is fast - approximately 2 seconds.

5.11.1.2. Software Commutation Operation The new system must be tuned using the ACS Adjuster. All parameters must be saved in the nonvolatile memory. Afterwards, whenever the motor is enabled on for the first time, the controller automatically executes the commutation setup.

Page 198: Acspl Software Guide Revision 3 00

5-32 ADVANCED FUNCTIONS

ACSPL Software Guide - Document revision no. 3.00

If the commutation setup completes successfully, commutation flag J$15 is set to 1. (Default value is 0). The total time that is assigned for the setup is controlled by the Enable Delay (ED) parameter. It takes approximately (ED+1500) millisecond to execute the process. During the commutaion setup, the controller will generate current/torque that is equal to torque limit (TL). If the rms current during the process exceeds the level set by CL, the process will fail, generating error message E27. Therefore, ensure that the rms current is not too high by adjusting TL and ED. It is recommended, for most applications, to set TL low (about 10% to 15% of its maximum value - see TL reference in Section 7.2 for range) and ED to between 1000 msecond and 2000 msecond. (If a higher TL value is required for the application, the higher value can be assigned after the commutation setup has successfully completed.) If the friction is high, then increase TL and reduce ED to 500 msecond. If the commutation setup fails (generating error message E25 or E27), verify that the controller has not mistakenly set J$15 to 1. If it has done so, then change J$15 back to 0 by issuing the command:

AJ$15 0

It may also be necessary to adjust TL before repeating commutation setup. If commutation setup is still not successful, verify that neither of the limit switches of the axis was activated during the commutation setup. Some applications involving encoders with very high resolution (<50 nanometer/count) require a customized program for the commutation setup. Contact ACS-Tech80 technical support.

5.11.2. Hardware Commutation With Encoder + Hall Sensor Feedback (Program Example)

The goal of this program example is to show how to carry out commutation when CU = 3 (encoder + Hall). Such a program might be needed when replacing a servo motor in the field where the encoder's index mark does not come prealigned with any particular place on the motor. You need execute this program only once (that after you have replaced the motor). The program determines the values for a number of parameters and saves those parameter values in the controller's nonvolatile memory. Each time that the controller is powered up after that, it will read the Hall sensors, move with trapezoidal commutation until it finds the index, and then changes to sinusoidal commutation.

Page 199: Acspl Software Guide Revision 3 00

ADVANCED FUNCTIONS 5-33

ACSPL Software Guide - Document revision no. 3.00

Figure 5-9 Hardware commutation program flow

Assumptions: • The program is written for a rotary motor with a thin index

(meaning that the direction of approach to the index is not a factor).

• The program does not include safety limit handling.

• The program is made for X axis alone.

If any of these assumptions do not hold true for your application, you should customize the program accordingly. Parameters defined by the program: Name Range Description K6 0/1 Defines motor phase order. K7 0 to

255 Pointer to controller's internal sine table.

K9 Scaling factor for internal calculations involving LR, NP, and the constant 6 (which is the number of Hall combinations that are possible for a pitch).

_h ±511 Holds the "distance" between the hall counter and the index location at the zero torque point in internal electrical angle units (units of internal sine

Page 200: Acspl Software Guide Revision 3 00

5-34 ADVANCED FUNCTIONS

ACSPL Software Guide - Document revision no. 3.00

table). _m ±1,000,

000 Holds the distance offset between the index location and the zero torque point of the magnetic field. Practically speaking, it is an index module relative to the magnetic pitch.

Algorithm: • Motor starts moving in open loop.

The following statements set the control to open loop: $GA=0 $GF=0 K$5=2 D$7=0 D$8=0 J$15=1

• The program checks the direction of the motor movement (positive/negative) when the program changes the value of K7. The program then defines K6 according to the direction of the motor movement.

• The motor continues to move in open loop until the controller detects the index.

• The controller stops the motor and starts collecting data about parameter CP2.

CP2 is the internal absolute position counter in the controller's DSP.

• The program stores collected data about CP2 and the value of K7 (which is unchanged from what it was at the moment the controller detected the index).

The value of K7 defines the index location in the motor's magnetic field.

• The value of CP2 is assigned to the program variable cp2. The reason for this is to make it possible to convert the value into internal sine table units.

• Now the program has all the data it requires for computing parameters: K7, _h, _m, and K9. The formulas can be found in the code of the example that follows.

• After computing the parameters, the program executes a Save (which saves the parameter values in nonvolatile memory).

To run the program, issue a command to execute INIT_X. The program: V95 - Constant = 0 V94 - Constant = 1 V93 - Constant = 2 V92 - Stores the raw value of DX(7) V91 - Constant = 0, initial value for negative direction step. V90 - Constant = 255, initial value for negative direction step. V89 - Stores the raw value of DX(8) V88 - Stores the raw value of XGA V87 - Stores the raw value of XGF

Page 201: Acspl Software Guide Revision 3 00

ADVANCED FUNCTIONS 5-35

ACSPL Software Guide - Document revision no. 3.00

V86 - Stores the value of K6 V85 - Temprory buffer for calculation of _h,_m V84 - Temprory buffer for calculation of cp2, and stores average value of J14, stores error code in AUTO_FLT, temporary buffer for setting DA,_h,_m V83 - Flag defined the finding of reference point V82 - Stores the value of CP2 in sin table units V81 - Stores avarage value of CP2 at index (from DSP register) V80 - Value of KX(7) at index point. V78 - Dummy parameter for reading the index and reset its flag. V77 - Stores the result of K7 calculation V71 - Store tha HALL value at index V70 - Stores the value of TL I0 - Used for calculalation LR*2^LF value I1 - Number of itterations in K6 finding procedure INIT_X is used for storing original values of parameters that will be used in the program INIT_X: V95 = 0 V94 = 1 V93 = 2 V90 = 255 V91 = 0 V92 = DX(7) V89 = DX(8) V88 = XGA V87 = XGF V86=KX(6) V83=0 let XZP=0 let XGA=0 let XGF=0 let TDC = 0 let YDC = 0 let ZDC = 0 DX(7) = V95 DX(8) = V95 KX(7)= V95 KX(5) = V93 JX(15) = V94 V70=XTL

Page 202: Acspl Software Guide Revision 3 00

5-36 ADVANCED FUNCTIONS

ACSPL Software Guide - Document revision no. 3.00

let XTL=100 let XDA=0 let XMO=1 wait 3000 V78 = XIX V78 = XM1 I1=5 call K7_0_X K6: disp " K6 defining..............." V84=XCP loop I1 call P_STEPX end V85=XCP V85=V85-V84 if V85>0 do V86=0 KX(6)=V86 !disp "K6 = 0" end if V85<0 do V86=1 KX(6)=V86 !disp "K6 = 1" end if V85=0 do disp "FAULT-MOTOR does not move" call RET_PARX stop end TOINDEX: V78=XIX disp " Searching index................." MOVINGX: if V86=1 do call N_STEPX end if V86=0 do call P_STEPX end

Page 203: Acspl Software Guide Revision 3 00

ADVANCED FUNCTIONS 5-37

ACSPL Software Guide - Document revision no. 3.00

if X_INDEX do V80=KX(7) V71=XHA call X_CP2 !disp "Hall at index = ", V71 V83 = 1 end if V83=1 goto TERMINX else goto MOVINGX TERMINX: call RET_PARX call CALCUL disp "SAVE OF RECEIVING PARAMETERS IS EXECUTING......" exec SAVE let XDC=0 stop P_STEP routine increments KX(7) by one each call and thus shifting the X Axis towards the positive limit (RLX). P_STEPX: KX(7)=V91 V91 = V91+1 if V91>255 do V91=V91-255 end wait 3 ret N_STEP routine decrements KX(7) by one each call and thus shifting the X Axis towards the negative direction. N_STEPX:

KX(7)=V90

V90 = V90-1

if V90<0 do

V90=V90+255

end

wait 5

ret

K7=-Sine(HA*42-41)+K7i Sign=1 if K6=0 ; Sign = -1 if K6=1 cp2 is CP2 expressed in sin table units (V82)

Page 204: Acspl Software Guide Revision 3 00

5-38 ADVANCED FUNCTIONS

ACSPL Software Guide - Document revision no. 3.00

cp2 = (CP2/LR)*(NP/2)*256 if cp2>256 use module(256) K7i is the value of K7 when axis meets index. This value should be constant per machine axis _h = Sine*(HA*42-cp2+21) _m = IX % (LR*2^LF) (module of last index) K9 = 2*LR/NP*6 CALCUL: cp2 calculation follows

V82=V81*256 256 full period of sin table V82=V82/XLR V81 = XCP2 got from the

X_CP2 routine V82=V82*XNP V82=V82/2 if V82 >255 do calculation of module V84= V82/255 V84= V84* 255 V82= V82-V84 cp2 is found end !disp "cp2 in sin units", V82 K7 and _h calculations follow

if V86=0 do V84=XHA*42 V85=V84-41 V85=-V85 V77=V85+V80 K7 is found KX(7)=V77 V85=V84-V82 V84=HA*42 V85=V85+21 _h is found let X_h=V85 !disp " _h = ", V85 end if V86=1 do V84=XHA*42 V85=V84-41 V77=V85+V80 K7 is found KX(7)=V77 V85=V84-V82 V84=HA*42 V85=V85+21

Page 205: Acspl Software Guide Revision 3 00

ADVANCED FUNCTIONS 5-39

ACSPL Software Guide - Document revision no. 3.00

V85=-V85 let X_h=V85 !disp " _h = ", V85 end _m calculation follows

V78=XIX if XLF=0 do V84=XLR end if XLF>0 do I0=XLF I0=I0-1 V84=1 loop I0 V84=V84*2 end V85=XLR V84=V85*V84 end V85=V78/V84 module of last index V85=V85*V84 V85=V78-V85 let X_m=V85 !disp "_m =", V85 K9 calculation follows

V85=XLR

V85=V85*2

V85=V85/XNP

V85=V85/6

KX(9)=V85

!disp " K9= ",V85

disp "COMMUTATION TERMINATED"

!disp "K7= ", V77

!disp "K7 at Index=", V80

ret

RET_PARX:

let XMO=0

let XGA=V88

Page 206: Acspl Software Guide Revision 3 00

5-40 ADVANCED FUNCTIONS

ACSPL Software Guide - Document revision no. 3.00

let XGF=V87

DX(7) = V92

DX(8) = V89

let XDA = 0

KX(5) = V94

let XTL=V70

ret

CP2 is internal counter that follows current position with respect to all controller parameters (ZP, LR etc.). The X_CP2 routine executes data collection on the CP2 parameter (a DSP parameter) X_CP2:

let XDC=1024

let XWT=352

let ti=1

let DL=0

let DU=127

let FE=1

till ^DC_ON

wait 300

The STAT routine defines the average value of CP2 (V81) STATX:

let DL=0

let DU=10

V81=avg(TX)

!disp "CP2= ", V81

ret

The K7_0 routine eliminates jerk when first setting K7=0 K7_0_X:

let XDA=1

CHEC_XDA:

V84=XDA

V84=V84+1

let XDA = V84

wait 10

if XDA<XTL goto CHEC_XDA

ret

stop

Page 207: Acspl Software Guide Revision 3 00

ADVANCED FUNCTIONS 5-41

ACSPL Software Guide - Document revision no. 3.00

5.12. Special Input/Output Signals

5.12.1. Dedicated Output Signals The 16 standard outputs can be used for general purpose as non dedicated outputs. The outputs can be assigned to the PEG function, or to some other predefined dedicated function. The X axis PEG uses outputs 1 to 8, and the Y axis PEG uses outputs 9 to 16. The other dedicated functions are to signal the following motion states: B/E motion, Ready, Early Ready and Interpolation complete. B/E motion Signals when the axis is in motion ("ON") or not in

motion ("OFF"). Ready After a Begin on Input (BXI), it signals when the

calculation are completed, and the axis is READY for motion.

Early Ready Signals that the axis is ready to accept a new move command ("Early Ready"). Also, when a superimposed move (MD) is executed in Master-Slave mode, this output is active.

Interpolation Complete

Signals that the axis interpolation (profile generation) for the present move is completed ("Intrp. Comp.").

The function of each output is controlled by the Output Mask (OM) and by the Peg Mask (PM) parameters. When the appropriate PM bit is set, the corresponding output serves the PEG function and cannot be changed by output handling commands. When the PM is cleared and the OM bit is set, the appropriate output serves the dedicated function as described above. When serving a dedicated function (not the PEG), the outputs can still be set and reset by the SHI, SLO and SOP commands, (and by the let HI, let LO, and let OP commands in ACSPL program. The output used by the dedicated functions is different from one controller to the next. For exact details see the appropriate Hardware and Setup Guide. To use outputs 1 and 2 for dedicated function: SOM3<cr> - (3d =00000011b)

5.12.2. Safety Input Signals The safety input signals consist of controller-level emergency stop (E-stop), right limit switch(es), left limit switch(es), and drive fault signal(s). The limit switches and the drive fault are per axis. The status of the safety input signals is bit-represented in the safety inputs (SI) parameter. The bit map of SI varies from product to product, depending on the number of axes. To view the bit mapping

Page 208: Acspl Software Guide Revision 3 00

5-42 ADVANCED FUNCTIONS

ACSPL Software Guide - Document revision no. 3.00

for your product, issue the verbose report command (RSI) in terminal protocol (HT=1). The polarity of the safety inputs can be controlled using the input logic (IL) parameter. The IL bitmap is the same as SI.

5.12.2.1. Emergency Stop (E-Stop) Upon receiving the E-Stop input signal, the controller disables all the motors on all the axes. However the motor still is subject to inertia and external forces.

Warning: The controller does not provide hardware facilities for hardware Emergency Stop or Safety Interlock. E-STOP input is only for indicating that an emergency situation exists. It cannot be used as the Emergency Stop for the entire system.

5.12.2.2. Limits The limit switches operate differently from the E-stop. Whereas E-stop disables the motor, when a limit switch is triggered, the controller attempts to prevent the motor from moving beyond the limit by applying viscous damping. The idea of the viscous damping is to try to keep the motor at its current position by commanding the desired position to be the current position. However rotation drifting can occur due to inertia, or due to an external driver offset if there is one, or due to forces such as gravity. There is a parameter, LW, that determines the length of time in which viscous damping is applied. See the description of LW in Section 7.2.

5.12.2.3. Drive Fault If your ACS-Tech80 control product does not include a drive, then you need to configure the controller's drive fault logic inputs by setting IL correctly. Examples of control products that do not include an internal drive: SB214SA, SB214PCx, SB214ND, etc.

5.12.2.3.1. Configuring a Controller's Drive Fault Logic Inputs The configuration depends on several factors: • The drive's fault detection circuit may have either a normally-open

or a normally-closed switch.

• The ACS-Tech80 controller's digital inputs may be source-type or sink-type, depending on the model and how it is configured. The controller's digital input interface is described in the hardware and setup guide.

Page 209: Acspl Software Guide Revision 3 00

ADVANCED FUNCTIONS 5-43

ACSPL Software Guide - Document revision no. 3.00

FIGURE 5-10 Drive fault detection circuit

You need to configure the drive fault logic according to how you made the connection between the controller and driver. When the motor is enabled, if the voltage applied to the processor is high (5V), the corresponding IL driver logic bit (for example, IL.8 for X axis) must be set to 0. On the other hand, if the voltage applied to the processor is low (0V), the IL driver logic bit must be set to 1 (for example, IL.8=1). Example based on FIGURE 5-10. This example ignores the status of the safety inputs and the state of any axis except X. Assume that the drive is connected to the X asix, has a normally-open fault contact, and that the controller's fault detection inputs are source-type. In this case, when the motor is enabled (normal situation), 5V is on the processor input and the IL must be 0. In other words, the processor expects 5V and will interpret 0V as a drive fault. If, on the other hand, the drive contact is normally-closed, then IL must be 256 (IL.8=1).

5.13. Arbitrary Path with Automatic Cyclic Buffering This method is used when an arbitrary path must be generated and the number of segments to be fed to the controller is greater than the capacity of the controller's array size. Data loading is supported on the fly, with minimal communication overhead, while the path is being executed. Normally the data is supplied from a host computer. The host does not have to check whether and where new data should be inserted and if the location is free. Parameters: $MM - Motion Mode. Must be 16. $PG - Path Generation. $PG.8 activates Automatic Cyclic Buffering. $LI - array Lower Index. $UI - array Upper Index.

Page 210: Acspl Software Guide Revision 3 00

5-44 ADVANCED FUNCTIONS

ACSPL Software Guide - Document revision no. 3.00

$FS - array Free Segment. (Number of free entries in the array.) $NS - array Next Segment. (Index of the array entry to loaded with next segment.) Commands (See also Section 3.3.11, page 3-32 for terminal protocol syntaxes and Section 6.15, page 6-26 for host protocol syntaxes): N - Next command. Used to deliver new data to the array. n - Defines the format (data structure) of the Next command. Operation: 1. Define the following parameters: $MM, $PG, $LI, $UI. 2. Set $SQ, $PG.1, $PG.4 to 0. 3. Verify that $FS is set to ($UI-$LI+1) 4. Verify that $NS is set to $LI if the array is empty, or to a value less than or equal to $UI if the array is not empty. 5. Define the format of the Next command (by setting n$). 6. Load as many points as possible into the controller before a Begin command is issued. It is recommended to load these points using the 'N' command: then the values of $FS and $NS are set automatically. These points may also be loaded by the Array Set command (A$SE). In such a case, the user must set the values of $FS, $NS manually. 7. Issue a Begin command. 8. More data should be transmitted to the controller as fast as the application allows. After each 'Next' command the application must check if the controller responded with a normal prompt, indicating that the data has been loaded correctly into the cyclic buffer. $FS and $NS are automatically updated accordingly. If there is no empty space in the buffer for the completed data, the controller responds with '?18': meaning that the completed data is ignored and must be re-transmitted. $FS reflects the number of free entries in the buffer. If the path is being executed faster than loading of new data, $FS will reach the value of ($UI-$LI+1) before the motion is completed. The motor(s) will stay in motion, waiting for new data. The motion can be stopped by the application by issuing an End or Kill command. An End command terminates the motion at the end of the current segment. A Kill command terminates the motion immediately in an orderly manner using $KD (Kill Deceleration) for single axis motion or $VK (Vector Kill deceleration) for multi-axis motion. Also: • Path data must comply with the path rules. For example, the

segment time must not exceed 32000 milliseconds.

• $SQ must be 0. Otherwise a Begin message 14 is generated.

• $PG.1 must be 0. Otherwise a Begin message 14 is generated.

• $PG.3 (KL) has no effect.

• $PG.4 (CAM) must be 0. Otherwise a Begin message 14 is generated.

Page 211: Acspl Software Guide Revision 3 00

ADVANCED FUNCTIONS 5-45

ACSPL Software Guide - Document revision no. 3.00

If an End command is issued while the motor is standing and there are no segments to execute: • If $PG.2=0 - An End message is produced within $PT

milliseconds.

• If $PG.2=1 - An End message is produced within the execution time of the last segment.

5.13.1. Detailed Description of Automatic Cyclical Buffer Commands

5.13.1.1. n$ This command defines the format of all subsequent Next commands for single axis. The syntax of the n$ command is as follows: n$ p Specifies that each data element in the Next command represents a new segment position. Therefore the format of subsequent Next command must be:

N$ <position 1> <position 2> ...<position i>... Data will be stored in the axis array in the following order: T$($NS) ⇐ <position 1> T$($NS+1) ⇐ <position 2> ... ... T$($NS+i-1) ⇐ <position i> ... n$ pt Specifies that each pair of data elements in the Next command represents new segment position and segment time. The format of the Next command is:

N$ <position 1> <time1> <position 2> <time2> ... <position i> <timei>...

The position data is stored into the lower part of the array T$($LI) .. T$($UI). ($LI and $UI must be ≤ 511). The time data is stored into the upper part of the array T$(512+$LI) .. T$(512+$UI). Data will be stored in the axis array in the following order: T$($NS) ⇐ <position 1>, T$($NS+512) ⇐ <time1> T$($NS+1) ⇐ <position 2>, T$($NS+512+1) ⇐ <time2> ... T$($NS+i-1) ⇐ <position i>, T$($NS+512+i) ⇐ <timei>

Page 212: Acspl Software Guide Revision 3 00

5-46 ADVANCED FUNCTIONS

ACSPL Software Guide - Document revision no. 3.00

... The factory default format is n$ p. The format of the command in host protocol is identical to the format in terminal protocol.

5.13.1.2. nC Defines format of the Next command for multi-axis arbitrary path using the automatic cyclic buffering ($PG.8=1). See also Next command below. nC <set of axes> p Specifies which axes participate and that each data element in the Next command represents a new segment position. The format of the nC command is:

nC <set of axes> p The Next command consists of packets of data, where each packet contains position points for all the axes that are defined by the nC command. Example:

nC XYZ p The Next commands must have the following format: NC <Xpos1> <Ypos1> <Zpos1> <Xpos2> <Ypos2> <Zpos2> Data will be entered as follows: TX(XNS) ⇐ <Xpos1> TY(XNS) ⇐ <Ypos1> TZ(XNS) ⇐ <Zpos1> TX(XNS+1) ⇐ <Xpos2> TY(XNS+1) ⇐ <Ypos2> TZ(XNS+1) ⇐ <Zpos2> nC <axes> pt Specifies which axes participate and that data in the Next command represent new segment position and time. The format of the nC command is:

nC {<axis>} pt The Next command consists of packets of data, where each packet contains position points and time for all the axes that are defined by the nC command. Position data is stored in the lower part of the axis' arrays. Time data is stored in the upper part of the lowest axis. Example:

nC YZ pt The Next commands must have the following format: NC <Ypos1> <Zpos1> <time1> <Ypos2> <Zpos2><time2>

Data will be entered as follows: TY(XNS) ⇐⇐⇐⇐ <Ypos1> TZ(XNS) ⇐⇐⇐⇐ <Zpos1>

Page 213: Acspl Software Guide Revision 3 00

ADVANCED FUNCTIONS 5-47

ACSPL Software Guide - Document revision no. 3.00

TY(XNS+512) ⇐⇐⇐⇐ <time1> TY(XNS+1) ⇐⇐⇐⇐ <Ypos2> TZ(XNS+1) ⇐⇐⇐⇐ <Zpos2> TY(XNS+513) ⇐⇐⇐⇐ <time2>

5.13.1.3. Next The Next command is used to enter data into the array buffers when using arbitrary path generation mode with automatic cyclic buffer. The format of the Next command is determined by the n$, nC commands. When n$ p format is defined, the format of the Next command is: N$ {<pos>} Example:

nX p X axis path, position with fixed time interval. The Next command is

NX <pos1> <pos2> <pos3> The data is entered into the X array as follows:

TX(XNS) ⇐⇐⇐⇐ <pos1> TX(XNS+1) ⇐⇐⇐⇐ <pos2> TX(XNS+2) ⇐⇐⇐⇐ <pos3>

When n$ pt format is defined, the format of the Next command is: N$ {<pos> <time>} Example:

nY pt Y axis path, position-time per segment The Next command is NY <pos1> <time1> <pos2> <time2> <pos3> <time3>... The data is entered into the Y array as follows: TY(YNS) ⇐ <pos1> TY(YNS+512) ⇐ <time1> TY(YNS+1) ⇐ <pos2> TY(YNS+513) ⇐ <time2> TY(YNS+2) ⇐ <pos3> TY(YNS+514) ⇐ <time3> When nC p format is defined, the format of the Next command is: NC {<pos1> <pos2>...<posj>} where: j is the number of axes that participate in the common motion. Example:

nC XYZ p common motion for XYZ, position with fixed time interval The Next command is NC <Xpos1> <Ypos1> <Zpos1> <Xpos2> <Ypos2> <Zpos2>

<Xpos3> <Ypos3> <Zpos3>

Page 214: Acspl Software Guide Revision 3 00

5-48 ADVANCED FUNCTIONS

ACSPL Software Guide - Document revision no. 3.00

The data is entered into the X Y Z arrays as follows: TX(XNS) ⇐ <Xpos1> TY(XNS) ⇐ <Ypos1> TZ(XNS) ⇐ <Zpos1> TX(XNS+1) ⇐ <Xpos2> TY(XNS+1) ⇐ <Ypos2> TZ(XNS+1) ⇐ <Zpos2> TX(XNS+2) ⇐ <Xpos3> TY(XNS+2) ⇐ <Ypos3> TZ(XNS+2) ⇐ <Zpos3> When nC pt format is defined, the format of the Next command is: NC {<pos1><pos2><...<posj><time>} where j is the number of axes that participate in the common motion. Example:

nC YZ pt common motion for Y Z, position-time per segment

NC <Ypos1> <Zpos1> <Ytime1> <Ypos2> <Zpos2> <Ytime2>

The data is entered into the Y Z arrays as follows: Position data into the lower part of the arrays. Time data into the upper part of the array. TY(YNS) ⇐ <Ypos1> TZ(YNS) ⇐ <Zpos1> TY(YNS+512) ⇐ <Ytime1> TY(YNS+1) ⇐ <Ypos2> TZ(YNS+1) ⇐ <Zpos2> TY(YNS+513) ⇐ <Ytime2>

Notes: The controller does not check consistency between an nC command's format and the next B<axes> command. The factory default for nC is 'nC XYZT p'. The format of the command in host protocol is identical to the format in terminal protocol. Once a Next command is received, the controller calculates the number of segments in the command. If the current value of Free Segments ($FS) is greater than or equal to this number, the controller stores the complete data into the array(s) and updates the value of $NS, $FS of the lowest axis. (other axes' FS may be changed and should be ignored). If the current value of Free Segments ($FS) is less than this number, the controller will ignore the whole data of that Next command and will generate an error message ?18. It indicates that there was not sufficient free space for all the data. When new data is accepted, for each new segment, the $FS and $NS of the lowest axis are updated as follows:

Page 215: Acspl Software Guide Revision 3 00

ADVANCED FUNCTIONS 5-49

ACSPL Software Guide - Document revision no. 3.00

$FS ⇐ $FS-1 $NS ⇐ ($NS+1) modulu ($UI+1) Although the $NS, $FS parameters are handled automatically by the controller, because of exceptions (like starting of a new path after aborting of the previous one), it is recommended to initialize the values of $FS, $NS prior to starting of a new path.

5.13.1.4. n<cr> Reports the format of all Next commands. The format of nX, nY, nZ and nT commands is reported in terminal protocol: Xp[t<space>] Yp[t<space>] Zp[t<space>] Tp[t<space>]<cr> C<axes>p[t] where <axes> is a string of upto 4 letters according to the axes that participate in the common motion. The C<axes> part is present only in multi axis controllers. Example: n$ for all axes was N$ p nC command was nC XZ p The response to the n<cr> command: Xp Yp Zp Tp CXZ p n$ command for each axis was: nX p, nY pt, nZ pt, nT p The nC command was nC ZT pt The response to the n<cr> command: Xp Ypt Zpt Tp CZT pt

5.14. Programming the 7-Segment Display

FIGURE 5-11 7-segment display

The display can transmit alphanumeric characters (A to Z, 0 to 9) and several punctuation marks (question mark "?," exclamation point "!," and hyphen "-").

Note all control products include a 7-segment display.

Page 216: Acspl Software Guide Revision 3 00

5-50 ADVANCED FUNCTIONS

ACSPL Software Guide - Document revision no. 3.00

During control unit startup, the 7-segment display goes on (i.e., displays an "8") for a few seconds to show it is functioning properly and then goes off. 7-segment display provides another type of operator interface. It is located on the front panel and allows displaying operation errors and program messages as a single-character ‘running string’. Its behaviour is controlled by ‘sf’ and ‘sd’ variables and “show” statement (see also Section 0). sf defines what kind of messages will be displayed; sd defines the time duration per symbol. (Note that there is a short blink between symbols, and a blank of 2*sd duration between different messages) If sf = 0, 7segment display is disabled; otherwise either error messages or ACSPL messages via show statement or both are displayed. System errors are displayed as: ‘?’ followed by a 2 digit error number; Program errors are displayed as: ‘P’ followed by a 2 digit error number. Begin error messages are displayed as: ‘B’ followed by the axis notation followed by a 2 digit begin message number. (Only Begin messages’ numbers which are greater than 9 are displayed). A Begin message overrides End message. End error messages are displayed as: ‘E’ followed by the axis notation followed by 2 digits end message number. (Only End messages’ numbers which are greater than 9 are displayed). An End message overrides a Begin message. This show mechanism allows several messages to be displayed one after the other with the following order: Last system error, Last program error, Last Begin or last End message for each axis (X, Y, Z and T). Then follows a message from a show statement if it exists and is allowed. If a new message is available in a certain group while the previous one is still in process, the new message overides the previous one. If sf.2 bit is set to 1 (see), a system message is cleared once a new command is received from the communication channel. A program message is cleared once a program execute command is received. A motion message is cleared once the motor is enabled, or a new motion is initiated for the axis. The show statement message is overridden by another such message and is cleared when PX (program execute) command is issued. All messages are cleared by setting sf to 0. Bitmapping of segments is as follows:

Page 217: Acspl Software Guide Revision 3 00

ADVANCED FUNCTIONS 5-51

ACSPL Software Guide - Document revision no. 3.00

0 -- 5 | | 1 -- 6 4 | | 2 -- . 3 7 Character set is as follows:

Digits 0 1 2 3 4 5 --

| | | | --

| |

-- | -- | --

-- | -- | --

| | - |

-- | -- | --

Leds # 0,1,2,3,4,5 1,2 0,1,3,4,6 0,1,2,3,6 1,2,5,6 0,2,3,5,6 Code 03f Hex 006 Hex 05b Hex 04f Hex 066 Hex 06d Hex

Digits 6 7 8 9 --

| -- | | --

-- | |

-- | | -- | | --

-- | | -- | --

Leds # 0,2,3,4,5,6 0,1,2 0,1,2,3,4,5,6 0,1,2,3,5,6 Code 07d Hex 007 Hex 07f Hex 06f Hex

Signs ? ! - (minus) --

| -- | .

| | .

--

Leds # 0,1,4,6,7 4,5,7 6 Code 0d3 Hex 0b0 Hex 040 Hex

Alpha A B C D E F --

| | -- | |

| -- | | --

-- | | --

| -- | | --

-- | -- | --

-- | -- |

Leds # 0,1,2,4,5,6 2,3,4,5,6 0,3,4,5 1,2,3,4,6 0,3,4,5,6 0,4,5,6 Code 077 Hex 07c Hex 039 Hex 05e Hex 079 Hex 071 Hex

Alpha G H I J K L --

| -- | | -- .

| | -- | |

| |.

| | | --

| -- | --

| | --

Leds # 0,2,3,4,5,6,7

1,2,4,5,6 1,2,7 1,2,3,4 3,4,5,6 3,4,5

Code 0fd Hex 076 Hex 086 Hex 01e Hex 078 Hex 038 Hex

Alpha M N O P Q R

-- | |.

-- | |

-- | | | | -- .

-- | | -- |

-- | | -- |

-- |

Leds # 2,4,6,7 2,4,6 0,1,2,3,4,5,7 0,1,4,5,6 0,1,2,5,6 0,5 Code 0d4 Hex 054 Hex 0bf Hex 073 Hex 067 Hex 021 Hex

Page 218: Acspl Software Guide Revision 3 00

5-52 ADVANCED FUNCTIONS

ACSPL Software Guide - Document revision no. 3.00

Alpha S T U V W --

| -- | -- .

-- | | .

| | | | --

| | --

| | | | -- .

Leds # 0,2,3,5,6,7 0,1,2,7 1,2,3,4,5 1,5,6 1,2,3,4,5,7 Code 0ed Hex 087h 03e Hex 062 Hex 0be Hex

Alpha X Y Z -- --

-- -- -- --

0 0,6 0,3,6 001 Hex 041 Hex 049 Hex

5.14.1. Example Using Operational Error Messages The show statement is not used in this example; (see Section 0). Only error messages are required. Parameter sf is set to 1, parameter sd has the factory default value of 500 ms. A four-axis controller is used; X & Y are moving in a coordinated common point to point motion; Z is moving in constant velocity in positive direction; T is moving in constant velocity in negative direction. The 7-segment unit is empty (dark). During motion, the host tries to set by mistake the parameter YFA. This creates an error message ?15. The 7-segments unit now shows the following: (?) and waits half a second; (1) and waits half a second; (5) and waits for one second before showing again the ‘?’ above.

After a while, motor X fails to perform the desired motion profile and the coordinated motion of X & Y stops with End error messages of 25 and 9 respectively. The 7-segments unit now shows the following: (?) and waits half a second; (1) and waits half a second; (5) and waits for one second; (E) and waits half a second; (X) and waits half a second; (2) and waits half a second; (5) and waits for one second (E) and waits half a second; (Y) and waits half a second; (0) and waits half a second; (9) and waits for one second before showing again the ‘?’ from above.

Page 219: Acspl Software Guide Revision 3 00

ADVANCED FUNCTIONS 5-53

ACSPL Software Guide - Document revision no. 3.00

After a while, motor T hits the left limit switch; It stops and produces an End error message number 23. The 7-segments unit now shows the following: (?) waits half a second; (1) waits half a second; (5) waits for one second; (E) waits half a second; (X) waits half a second; (2) waits half a second; (5) waits for one second (E) waits half a second; (Y) waits half a second; (0) waits half a second; (9) then waits another half second (between messages) (E) waits half a second; (T) waits half a second; (2) waits half a second; (3) waits for one second before showing again the ‘?’ from above.

The above cycle repeats itself until sf parameter is changed from 1 to 5 (setting bit 2 of sf tells to clear error message as soon as the corresponding errorless action is taken). So after a while, the host transmit a valid Set command for X axis. This cancels system error 0?15 showing. The 7-segments unit now shows the following: (E) waits half a second; (X) waits half a second; (2) waits half a second; (5) then waits another half second (between messages) (E) waits half a second; (Y) waits half a second; (0) waits half a second; (9) waits for one second (E) waits half a second; (T) waits half a second; (2) waits half a second; (3) waits for one second before showing again the ‘EX'

Page 220: Acspl Software Guide Revision 3 00

5-54 ADVANCED FUNCTIONS

ACSPL Software Guide - Document revision no. 3.00

After a while, the host issues a new Begin command to T axis in the positive direction. This clears the ET23 error message. The 7-segments unit now shows the following: (E) waits half a second; (X) waits half a second; (2) waits half a second; (5) waits for one second; (E) waits half a second; (Y) waits half a second; (0) waits half a second; (9) waits for one second before showing again the ‘EX’ from above.

After a while, the host issues Enable motor commands to X and Y axes. The 7-segments unit becomes empty (dark).

5.15. Gantry Implementation In a gantry application two axes move in response to the same single command. For example, two tables that move in parallel. This section describes the main requirements for a gantry application and includes program examples for: • point-to-point (PTP)

• limit behavior

• homing

• fault response

• tuning

The following assumptions hold for all the examples in this section: • One table is connected to the X axis (motor and encoder). The

other table is connected to the Y axis (motor and encoder).

• The connection is semi-rigid - meaning that there is no play in the connection but an unwanted offset might develop.

• The system has to be calibrated such that the direction of movement is perpendicular to the rod connecting the two tables.

• During preparatory alignment, the distance (referred to herein as D) between the two indexes has been determined. D will be used as a variable in the gantry homing procedure. D is represented in the program by the variable V99.

• If identical motors are used, with one of the motors enabled and the other disabled, the enabled motor can drag the other motor at low velocity. (At high velocity, this is not physically possible and attempting it will generate an E25 error.

Page 221: Acspl Software Guide Revision 3 00

ADVANCED FUNCTIONS 5-55

ACSPL Software Guide - Document revision no. 3.00

5.15.1. Starting Procedure

Figure 5-12 Gantry application example

There is a special start procedure to "lock" the two motors. GS: Label for this start procedure. V90=XLV V90 is assigned the linear velocity. V90=V90*1414 let VV=V90/1000

Vector velocity = linear velocity * square root of 2 (which is represented as 1414/1000).

V90=XLA V90 is assigned the linear acceleration. V90=V90*1414 let VA=V90/1000

Vector acceleration = linear acceleration * square root of 2.

let VD=V90/1000 Vector deceleration = Vector acceleration exec BXY Begin moving in common mode (locked). stop If you are working from a terminal in direct mode, first define the motion parameters the way you would for any motion application. The following are examples of parameters for moving in point-to-point (PTP) mode: SXMO0 Set X axis motion mode to point to point. SXLV100000 Set linear velocity for X axis. SXLA1000000 Set linear acceleration for X axis. SXLD1000000 Set linear deceleration for X axis. SXRP200000 Set relative position for X axis. Now, to run the two locked motors, invoke the start procedure with the command:

PXGS

To run the gantry application from a host computer, the host program should call GS:

call GS

5.15.2. Limit Behavior The following considerations should be taken into account when planning the installation of the limit sensors:

Page 222: Acspl Software Guide Revision 3 00

5-56 ADVANCED FUNCTIONS

ACSPL Software Guide - Document revision no. 3.00

a) It is desirable that the limit sensors be installed such that the two left limit sensors (for X and Y axes) are both connected to X_LL and that the two right limit sensors are both connected to X_RL. The connection should also be made such that if either of the sensors is triggered (logical OR), that will in turn trigger the controller's limit circuit.

Example of limit handling (SB214ND): If normally-closed (NC) sensors are used, they must be connected in series. If normally-open (NO) sensors are used, they must be connected in parallel.

b) In a case such as a homing procedure, where the triggering of a limit sensor causes the motors to change direction, the limits must be installed such that both indexes will be detected on the return move. In other words, care must be taken not to install an index beyond the point where the motors change direction. c) When either limit switch is triggered, both motors should react the same way.

5.15.3. Homing In a homing procedure the motors trigger the first limit sensor, whereupon the ACSPL program orders them to reverse direction. The motors continue to move until each motor detects its index (as mentioned in the previous section). For example, assume that the distance between the two indexes is D1. Ideally, D1 should equal D (the original distance when the application was aligned). Therefore

D - D1 = Misalignment of axes In order to correct the misalignment, one of the motors (in our example, motor Y), must independently move this distance (D - D1). This move completes the homing procedure.

5.15.4. Fault Response When two axes move together (common mode), a fault (for example a failure) on either axis causes the other axis to be disabled as well. This is a built-in feature (does not have to be included specifically in the ACSPL program). In the gantry program example later in this section, the AUTO_FLT routine sends an error message describing the type of error and stops the program execution. In the case of a fault, an imbalance can develop between the two motors (due to differences in inertia, friction, etc.).

Page 223: Acspl Software Guide Revision 3 00

ADVANCED FUNCTIONS 5-57

ACSPL Software Guide - Document revision no. 3.00

Once you have corrected the cause of the fault, you will need to correct the imbalance. In the program example, this is done by the ALIGNMNT routine. The routine is able to do so only because homing had been performed earlier. As a result of the homing, the axes were aligned. When the axes were aligned (before the fault occurred), the current position (CP) of X was equal to the CP of Y. Therefore, to correct the imbalance caused by the fault, the routine checks XCP and YCP and then sends a command to motor Y telling it to move the distance equal to XCP - YCP.

5.15.5. Tuning Ideally, each motor should be tuned separately. However, this is often not possible in gantry applications, where the mechanical connection between the motors may be fixed. There are two alternatives for tuning gantry motors together.

a) As stated earlier, one motor can drag the other motor at low velocity. Assuming that it is the X motor that is moving, you can tune it and then divide the gains (both velocity gain and position gain) in half. b) The other approach is more complex but does not require one motor to drag the other. This approach, like the previous one, assumes that the motors are identical. Set one motor to master-slave mode (MM12) and tune the other motor. Bear in mind that this approach requires constantly switching between the motors and synchronously changing gains and bandwidths. It should only be attempted by experienced personnel.

5.15.6. Gantry Example V99 defines offset between X_INDEX and Y_INDEX when gantry is mechanicaly adjusted. HOME: let XMM=0 Use motion mode 0 for moving two

axes in common mode. let YMM=0 let XRP=-99999999 A large distance to guarantee

reaching a left limit sensor. let YRP=-99999999 let XLV=20000 Define velocity. let XLA=1000000 Define acceleration and

deceleration. let XLD=1000000 let XMO=1 Enable two axes let YMO=1 SG is a start procedure and used instead of BX and BY call SG

Page 224: Acspl Software Guide Revision 3 00

5-58 ADVANCED FUNCTIONS

ACSPL Software Guide - Document revision no. 3.00

till X_LL wait until the limit is reached exec KXY to ensure motion stop in all working

modes let XLV=2000 let YLV=2000 let XRP=99999999 let YRP=99999999 rem Move to positive direction*

call SG till ^X_LL Wait until out of the limit V0=XIX V1=YIX till X_INDEX | Y_INDEX Wait until the first index outside the

limit is detected for two axes V0=XIX V1=YIX exec KXY Stop two axes after idexes are

detected V1=V0-V1 V1 stores difference between two

indexes V1=V99-V1 V1 defines error between X and Y

due nonperpendicularity hard Connection and moving connection V2=XCP V2=V0-V2 defines distance between current

position and X_INDEX let XRP=V2 defines relative position for MM0 let YRP=V2 call SG till X_MOVE & Y_MOVE till ^X_MOVE & ^Y_MOVE Wait untill two axes stop. The status

of two axes now is: X is on it's home position Y should be aligned

wait 200 let YRP=V1 the distance that Y should be

moved for alignment exec BY Alignment till Y_MOVE till ^Y_MOVE Alignment is finished let XZP=0 Define home position for two axes let YZP=0 disp " X and Y at home position"

stop SG is a special start procedure for defining parameters used in common motion. It should be called every time that the two axes move together. SG: V98=XLV V98=V98*1414 V98=V98/1000 let VV = V98 Define VV=1.414LV V98=XLA

Page 225: Acspl Software Guide Revision 3 00

ADVANCED FUNCTIONS 5-59

ACSPL Software Guide - Document revision no. 3.00

V98=V98*1414 V98=V98/1000 let VA=V98 Define VA=1.414LA let VD=V98 Define VD=1.414LD exec BXY ret stop AUTO_FLT detects the fault reason, sends corresponding message and stops the program execution AUTO_FLT: wait 7 V98=X_BEGIN if V98>8 do disp " X_Begin Motor Fault Error #", V98

end V98=X_END if V98>8 do disp " X_End Motor Fault Error #", V98

end V98=Y_BEGIN if V98>8 do disp " Y_Begin Motor Fault Error #", V98

end V98=Y_END if V98>8 do disp " Y_End Motor Fault Error #", V98

end stop ALIGNMNT: let XMO=1 let YMO=1 let YMM=0 V0=XCP V1=YCP V1=V1-V0 Define diference between two axes V1=-V1 let YRP=V1 the distance that shoulb be close for

Y to align two axes exec BY till Y_MOVE till ^Y_MOVE wait 20 disp "X and Y axes are aligned"

stop AUTO_LLX routine is used to prevent entering to the AUTO_FLT routine, since AUTO_FLT routine terminated by stop statement and terminate the program AUTO_LLX:

Page 226: Acspl Software Guide Revision 3 00

5-60 ADVANCED FUNCTIONS

ACSPL Software Guide - Document revision no. 3.00

ret

5.16. Special Products Certain products are specifically designed to support specialized functions.

5.16.1. Motion Mode 17 - Ultra-Fast Path Generation (requires FIFO214)

Motion Mode 17 is not standard. It requires a special support board on the PC – the FIFO214. Consult the factory for more information. In this mode, the host computer can transmit to the controller arbitrary path at 1,000 to 20,000 points/second. The PC host writes the path data into the FIFO. The (parallel) data is converted into a serial stream and transmitted directly to each axis’s servo processor, bypassing the main CPU. The data is 12 bits long and represent the position of each axis. Data update is available at different rates: every 50, 250, 500 or 1000 microseconds for each axis. Some restrictions apply to MM17: Motor type must be DC brush or brushless ($XT = 1/3) only; Motor control is available only with the PIV filter ($FT = 1); Sampling rate of the position filter is constant 20 KHz ($SA=20); Current protection is eliminated ($CL is not effective); Phase advance handling is eliminated; Control of 5th and 6th motors through X & Y secondary encoder inputs is not possible; A2, A3, A4 and A5 analog inputs are not available as general-purpose inputs. Special FIFO214 board is required.

5.16.2. Gantry Axis Support (requires modified SB214PC) The X axis may control two (drives and) motors, each with its own encoder, acting as a single gantry axis. For each motor the controller generates one (DC motor) or two (DC brushless with s/w commutation) drive commands. The second encoder may be connected via the secondary encoder input of X axis. When DX(23) is set to 1, both motors act as a single axis gantry. A special ACSPL routine is available from the factory for finding the indices of both axes. The remaining 2 (or 3) axes operate normally. DX(11) and DX(12) are the error offset between the gantry axes. Some restrictions apply to the gantry software: Motor type must be DC brush or brushless ($XT = 1 / 3); Motor control is available only with PIV filter ($FT = 1);

Page 227: Acspl Software Guide Revision 3 00

ADVANCED FUNCTIONS 5-61

ACSPL Software Guide - Document revision no. 3.00

Sampling rate of the position filter is constant 20 KHz ($SA = 20); Current protection is eliminated; Phase advance handling is eliminated; Control of 5th and 6th motors through X & Y secondary encoder inputs is not possible. A modified SB214PC board is required.

Page 228: Acspl Software Guide Revision 3 00

COMMUNICATION WITH HOST COMPUTER 6-1

ACSPL Software Guide - Document revision no. 3.00

6. COMMUNICATION WITH HOST COMPUTER

The controller supports the following communication protocols for data representation: • host protocol (HT=0). • Terminal protocol (HT=1) with/without checksum. • Handheld terminal protocol (HT=2) with/without checksum. The terminal protocol is designed for direct interaction with the operator. All displayed messages are in simple English. It is possible to use this mode with the addition of checksum (HP.0=1) for interaction with a host computer. The long and detailed messages are not easily handled by the host computer. The handheld terminal protocol is designed for working with a small display. All the messages are short and their length is limited to 16 characters per line. You can use this mode with the addition of checksum (HP.0=1) for interaction with a host computer. The structure of the messages is more suitable for the host computer to handle. The host protocol is designed exclusively for interaction with the host computer. Checksum is always added and the format of the data is binary. The structure of the messages is the most suitable for the host computer to handle. All these protocols support an enhanced mode (HP.4=1). All ACSPL display messages are in a special format and include a message number. The controller expects to receive an acknowledgment to each message it sends. The controller will repeat sending messages which are not acknowledged. This chapter describes the host protocol for controller - host computer communications and its enhanced reliability. The main features of the protocol are:

Page 229: Acspl Software Guide Revision 3 00

6-2 COMMUNICATION WITH HOST COMPUTER

ACSPL Software Guide - Document revision no. 3.00

• Checksum validation on each command. • Condensed messages. • Fixed data length.

6.1. General

6.1.1. Data Representation Data fields of SET and REPORT commands are represented in a signed binary form of 4 bytes ('long integer'). Such data type can represent whole numbers in the range: [ -2,147,483,648 .. 2,147,483,647 ]. The data is sent with the 'high' byte first.

6.1.2. Special Characters Since data is represented in binary form, a special character is used to distinguish between an End of Message character (<cr>) and a part of a data field which contains the value 0d Hex. This character is the <dle> - 10 Hex. Wherever a data field contains 0dH, the <dle> character must precede it in the message. If the <dle> character itself appears in a data field, it should appear twice consecutively). The <dle> character is not considered in the check-sum calculations.

6.1.3. Check-Sum Character Each command sent by the host computer and each response sent by the controller must be followed by a Check-sum character - <CS>. This byte appears in the message immediately before the End of Message character (<cr> - Carriage Return). It is generated by an arithmetic sum of all characters in the message preceding the Check-sum byte modulus 256. There are two special cases, when the check-sum value is 0d Hex (which is the value of <cr>), or 10 Hex (which is the value of <dle>). In such cases, 128 must be added to the check-sum byte (0d Hex --> 8d Hex, and 10 Hex --> 90 Hex).

6.1.4. Notation Conventions <cr> Represents the character 0d Hex (13 decimal) -the

Carriage Return character. It always appears at the end of each command line.

<##H> Hexa-decimal representation of one byte. Only the enclosed number<##> is transmitted. The 'H' character, or a leading zero appears only to emphasize the Hexa-decimal notation.

Page 230: Acspl Software Guide Revision 3 00

COMMUNICATION WITH HOST COMPUTER 6-3

ACSPL Software Guide - Document revision no. 3.00

6.2. The Controller's Prompt The controller's prompt to a computer is in the form:

<ID> <CS> <cr>

Where: <ID> Controller's ID (ASCII '0' to ASCII '9'). <CS> The check-sum byte. In the prompt case, it is identical

to the controller's ID itself. <cr> End of Message (0d Hex).

The controller's prompt is also used to acknowledge a successful operation that was required by some command. The controller parses a command from left to right. It is legal to use more than one command per input line but the controller response may differ, depending on the commands used. The controller responds to each command as it parses it. If the controller determines an error condition at some point in the input line, it stops parsing and responds with an error message (see xxxx). Some responses include a new line (<cr>) added at the end. If a response does not include the <cr>, the responses are concatenated.

6.3. The Controller's Error Response Whenever an operation could not be carried out exactly as required, the controller sends an answer in the form:

<ID> ? <#> <CS> <cr> Where:

<ID> Controller's ID (ASCII '0' to ASCII '9'). ? Fail indication (3f Hex).

<#> Fail information ( what was actually executed or the failure's reason) - one byte in binary format. Fail information in the range 0 to 20 indicates fatal errors. When fatal error is encountered, the controller stops interpreting the command line. Fail information of <0> (binary zero) means check-sum error in the received command. In such case, no interpretation takes place.

<CS> The check-sum byte. <cr> End of Message (0d Hex).

If a command line contains several commands (or subcommands) and the fail information field indicates a non-fatal error, this information relates to the last executed erroneous command. In the host protocol, the minimum length of a command is 3 characters:

<command> <checksum> <cr>

Page 231: Acspl Software Guide Revision 3 00

6-4 COMMUNICATION WITH HOST COMPUTER

ACSPL Software Guide - Document revision no. 3.00

if only the <cr> is received by the controller, it will respond with a checksum error message:

<ID> ‘?’ <0><cs> <cr> ID=0. The response is

0?<0> <6fH> <0dH> When using a terminal or a terminal emulator, it will look:

0?o For a list of all error messages see page 7–73.

6.4. SET Commands The SET command and its subcommands are used the same way as if the commands are sent in a terminal protocol with the following exceptions: • Each sub-command's data field is represented in 4 bytes (long

integer). • Each command line is followed by a check-sum byte. Possible responses to the SET command: • The controller's prompt if the set was done as requested. • Erroneous situations (the content of the Fail information field):

Set X's Wait Time to 50 msec. The command from a terminal is in the form: SXWT50<cr> The command from a host computer

SXWT <0H><0H><0H><32H> <88H><cr>

binary repr. of 50 check sum (83 + 88 + 87 + 84 + 0 + 0 + 0 + 50) modulus 256 =392 modulus 256 = 136 = 88H. The result from the controller, assuming that the controller's ID is '0':

0 0 <cr> I

D CS

Set X Axis GAin to 255 and X Axis Relative Position to -10000 counts. The command from a terminal: SXGA255 RP-10000<cr> The command from a host computer:

SXGA<0><0><0><0ffH> RP <0ffH><0ffH><0d8H><0f0H> <9aH><cr> binary repr. of 255 binary repr. of -10000 check sum

(83 + 88 + 71 + 65 + 0 + 0 + 0 + 255 + 82 + 80 + 255 + 255 + 216 + 240) modulus 256 = 1690 modulus 256 = 154 = 9aH

Page 232: Acspl Software Guide Revision 3 00

COMMUNICATION WITH HOST COMPUTER 6-5

ACSPL Software Guide - Document revision no. 3.00

Set Y Linear Velocity to 33 counts/second and next Absolute Position to 13 counts. The command from a terminal: SYLV33 AP13<cr> The command from a host computer: SYLV <0><0><0><21H> AP <0><0><0H><10H><0dH> <08dH><cr>

binary repr. of 33 binary repr. of 13 <10H> is a special <dle> character indicating that next character is not End of Message. Does not count in CS calculation.

check sum

Set Output port 0 "LOw" and output port 4 "HIgh". The command from a terminal: SLO0SHI4<cr> The command from a host computer: SLO<0><0><0><0>SHI<0><0><0><4><d7H><cr>. The response from the controller, assuming that the controller's ID is '0', will be:

0 ? <15H> <84H><cr>. ID error indication error number check sum

Error no. 21 indicates a range error in one of the parameters within the command. In this case, port 0 does not exist. The controller sets port 1 instead.

6.5. REPORT Commands The REPORT command and its subcommands are used the same way as if the commands are sent from a terminal with the following exception: Each command is followed by a check-sum byte.

6.5.1. Responses to the REPORT Command The controller sends its answer in the following form: <ID> { [ <Axis> ] <SC> <data> } [ ? <1> ] <CS> <cr>. Where:

<ID>- The controller's ID (ASCII '0' to ASCII '9'). <Axis> An optionally Axis designation (ASCII 'X' , 'Y', 'Z' or 'T')

Appears when the following Sub-Command is an axis' parameter.

<SC> Subcommand of either system or axis parameter. compounded of two ASCII letters.

<data> Four bytes holding the binary representation of the reported parameter.

'?' Fail indication (3f Hex). If the command line contains an unrecognized command (or subcommand).

Page 233: Acspl Software Guide Revision 3 00

6-6 COMMUNICATION WITH HOST COMPUTER

ACSPL Software Guide - Document revision no. 3.00

<1> Fail information. Binary 1 to indicate a fatal error. <CS> The check-sum byte. <cr> End of Message (0d Hex).

The section in-between the { } parentheses may be repeated. If other commands are combined in the same input line with a Report command and the result is, the response can be two or more messages. One message is the valid response to the Report command and the other is the controller error response (see also Section 6.3). Assuming that Group #1 contains the parameters LV and LA. Group#2 the parameters GA and KZ. The current axes are X, Y, Z and T. Terminal protocol response: RG1 ---- Group #1 ---- X Y Z T Linear Velocity = 10000 20000 30000 40000 Linear Acceler. = 100000 200000 300000 400000 0> 0> RG2 ---- Group #2 ---- X Y Z T GAin = 5 6 7 8 coeff.(K) 2nd Zero= 0 1 2 3 0> R<cr> ---- Group #1 ---- X Y Z T Linear Velocity = 10000 20000 30000 40000 Linear Acceler. = 100000 200000 300000 400000 0> Host protocol response: R<52><cr> 0XLV<00><00><27><10><10> YLV<00><00><4e><20> ZLV<00><00><75><30> TLV<00><00><9c><40> XLA<00><01><86><a0> YLA<00><03><10><0d><40> ZLA<00><04><93><e0> TLA<00><06><1a><80> <5e><cr>

Terminal protocol response: RXZ<cr> ---- Group #1 ---- X Z Linear Velocity = 10000 30000 Linear Acceler. = 100000 300000

Page 234: Acspl Software Guide Revision 3 00

COMMUNICATION WITH HOST COMPUTER 6-7

ACSPL Software Guide - Document revision no. 3.00

0> Host protocol response: RXZ<04> 0XLV<00><00><27><10><10> ZLV<00><00><75><30> XLA<00><01><86><a0> ZLA<00><04><93><e0> <6c><cr> Terminal protocol response: R GALV X Z GAin = 5 7 Linear Velocity = 10000 30000 0> Host protocol response: R<space>GALV<9c> 0XGA<00><00><00><05> ZGA<00><00><00><07> XLV<00><00><27><10><10> ZLV<00><00><75><30> <d0><cr> Terminal protocol response: RX KZ X coeff.(K) 2nd Zero= 0 0> Host protocol response: RX<space>KZ<6f> 0XKZ<00><00><00><00> <2d><cr> Terminal protocol response: RYZ GA Y Z GAin = 6 7 0> Host protocol response: RYZ<space>GA<ad> 0YGA<00><00><00><06> ZGA<00><00><00><07> <00><cr>

6.5.2. Report of Parameters With Bitmapped Information Each of the following parameters consists of 'bitmapped' information:

Page 235: Acspl Software Guide Revision 3 00

6-8 COMMUNICATION WITH HOST COMPUTER

ACSPL Software Guide - Document revision no. 3.00

IP, OP, SI, IL, IN, DC, OM, PM, OL, VN, BE, FM, FA, df, HP, N1, N2, N3, N4, O1,O2. • Report of Input Port: The command from a host computer:

RIP<0ebH><cr> The response of the controller, assuming that the controller's ID is '0':

0IP<0><0> < X X X X X X X X > < X X X X X X X X B > <CS><cr> | | | | | | | | | | | | | | | |

inputs 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1

When a port is set, the appropriate bit is 1. Unlike terminal protocol, in host protocol bits cannot be masked, they must be defined explicitly. • Report of Output Port: The command from a host computer:

ROP<0f1H><cr> The response of the controller, assuming that the controller's ID is '0':

0OP<0><0> < X X X X X X X X > < X X X X X X X X B > <CS><cr> | | | | | | | | | | | | | | | |

outputs 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1

When a port is set, the appropriate bit is 1. • Report of System Input: The command from a host computer:

RSI<0eeH><cr> The response of the controller, assuming that the controller's ID is '0':

0SI<0><0> < 0 0 0 X X X X X > < X X X X X X X X B > <CS><cr> | | | | | | | | | | | | |

bits 13 12 11 10 9 8 7 6 5 4 3 2 1

Where: Bit 13 EMERGENCY STOP Bit 12 T Driver Bit 11 Z Driver Bit 10 Y Driver Bit 9 X Driver Bit 8 Left Limit stop T Bit 7 Right Limit stop T Bit 6 Left Limit stop Z Bit 5 Right Limit stop Z

Page 236: Acspl Software Guide Revision 3 00

COMMUNICATION WITH HOST COMPUTER 6-9

ACSPL Software Guide - Document revision no. 3.00

Bit 4 Left Limit stop Y Bit 3 Right Limit stop Y Bit 2 Left Limit stop X Bit 1 Right Limit stop X

When a port is set, the appropriate bit will be 1. • Report Input Logic: The command from a host computer:

RIL<0e7H><cr> The response from the controller depends on the number of axes (see also the IL parameter and the SI parameter descriptions in Section 7.2). For a 4-axis controller, assuming that the controller's ID is '0':

0IL<0><0> < 0 0 0 X X X X X > < X X X X X X X X B > <CS><cr> | | | | | | | | | | | | |

bits 13 12 11 10 9 8 7 6 5 4 3 2 1

Where: Bit 13 E STOP Bit 12 T Driver Bit 11 Z Driver Bit 10 Y Driver Bit 9 X Driver Bit 8 T Left Limit Bit 7 T Right Limit Bit 6 Z Left Limit Bit 5 Z Right Limit Bit 4 Y Left Limit Bit 3 Y Right Limit Bit 2 X Left Limit Bit 1 X Right Limit

6.5.3. Report Of Parameters With True/False Information Some parameters contain true/false information. They are set to 1 (True or ON) or to 0 (False or OFF). A report using terminal protocol (HT=1) produces an ON / OFF report. Using host protocol, 0 in the data field means False (OFF) and any non zero number means True (ON). Each of the following parameters consists of True / False information: MO, VE, BG, BO, st.

• Host / terminal:

Page 237: Acspl Software Guide Revision 3 00

6-10 COMMUNICATION WITH HOST COMPUTER

ACSPL Software Guide - Document revision no. 3.00

0 Terminal 1 Host 2 Handheld Terminal

• MOtor enabled: 0 Off Else On

• Initiate Communication: 0 Off Else Level of initiative.

• Output Mask: 0 All output ports are used by the user. Else The ports which are used by the controller are

bitmapped in the low byte of the result. I.e: Result of <0><0><0><3> indicates use of output ports 1 & 2 to signal Begin \ End motion and Ready of X motor.

6.6. TELL Commands The TELL command is used the same way as if the command is sent from a terminal with the following exception: • Each command is followed by a check-sum byte.

6.6.1. TELL Motors And Motion Status (T0 Command) The command from a terminal: T0<cr> The command from a host computer is in the form: T0<84H><cr>. The controller responds in the following form:

<ID> <MS><MM><SM><Step> <MS><MM><SM><Step> <MS><MM><SM><Step> <MS><MM><SM><Step> <GI><CS><cr>

X axis info Y axis info Z axis info T axis info Where: <MS> Motor's State. One byte holding bitmapped information in

the format: <000 X X 0 X X B> Bits: 5 4 3 2 1 Where: Bit 5: 0 - Motor is not waiting for an input or GO command 1 - Motor is ready and waiting for an input or GO

Page 238: Acspl Software Guide Revision 3 00

COMMUNICATION WITH HOST COMPUTER 6-11

ACSPL Software Guide - Document revision no. 3.00

command Bit 4: 0 - Motor is disabled 1 - Motor is enabled Bit 2: 0 - Motor is not in waiting 1 - Motor is waiting between motions Bit 1: 0 - Motor is not in motion 1 - Motor is in motion

<MM> Motion Mode. One byte holding binary number of the current motion mode.

<SM> Secondary motion Mode. One byte holding binary number of the current secondary motion mode. (Like current sequence type when the motion mode is 'Move by Sequence' or 'Path Generation').

<Step> Step within Motion. One byte holding binary number of the current step within motion. (like the index number while moving in 'Move by Sequence' mode or 'Path Generation' mode).

<GI> General Information, One byte holding bitmapped information with the format: <0000 X X X X B> Bits: 4 3 2 1 Where: Bit 4: 0 - Motor T is not in common motion 1 - Motor T is in common motion Bit 3: 0 - Motor Z is not in common motion 1 - Motor Z is in common motion Bit 2 0 - Motor Y is not in common motion 1 - Motor Y is in common motion Bit 1 0 - Motor X is not in common motion 1 - Motor X is in common motion

Assuming the controller's ID is '0'. Suppose the motors are in the following state: Motor X: disabled and its motion mode is not defined yet (mode 99). Motor Y: enabled, not in motion and its motion mode is linear point to point

(mode 0). Motor Z: enabled, in motion, motion mode is 'Move by sequence' (mode 3),

moving manually from Low Index to Upper Index (SeQuence 2), and motor is currently in step 12

Motor T: enabled, in motion and its motion mode is linear point to point repetitive (mode 1)

Page 239: Acspl Software Guide Revision 3 00

6-12 COMMUNICATION WITH HOST COMPUTER

ACSPL Software Guide - Document revision no. 3.00

Motors are not in common motion. The controller’s response:

0 <0><63H><0><0> <8><0><0><0>

<10H><0dH><3><2><0cH> <10H><0dH><1><0><0>

<0><cs><cr>

ID motor X motor Y motor Z motor T GI

6.6.2. TELL The Result Of Last 'Begin Motion' (T1 Command) The command from a terminal: T1<cr> The command from a host computer: T1<85H><cr>. The controller responds in the following form:

<ID> <Oper> <Data> <Data> <Data> <Data> <CS><cr> motor X motor Y motor Z motor T

Where: <ID> The controller's ID (ASCII '0' to ASCII '9'). <Oper> Operation's code. ASCII 'B' . <Data> One byte holding the result for the appropriate axis.

Assuming the controller's ID is '0'. Suppose the last Begin command was for 4 axes to perform a common motion, and motor 'X' was in disable state. The response from the controller: 0B<14H><9H><9H><9H><a1H><cr>

6.6.3. TELL The Cause Of Motion's End For Each Motor (T2 Command)

The command from a terminal: T2<cr> The command from a host computer: T2<86H><cr> The controller responds in the following form:

<ID> <Oper> <Data> <Data> <Data> <Data> <CS><cr> motor X motor Y motor Z motor T

Where: <ID> The controller's ID (ASCII '0' to ASCII '9'). <Oper> Operation's code. ASCII 'E'.

Page 240: Acspl Software Guide Revision 3 00

COMMUNICATION WITH HOST COMPUTER 6-13

ACSPL Software Guide - Document revision no. 3.00

<Data> One byte holding the result for the appropriate axis.

Assuming the controller's ID is '0'. Suppose the motors where running in common motion, and X motor ran into its left limit. The result from the controller: 0E<17H><9H><9H><9H><a7H><cr>

6.6.4. TELL Program Status (T3 Command) The command by a terminal is: T3<cr> The command by a host is: T3<87H><cr> The controller responds in the following form: <ID><PCS><ST><CS><cr> Where <ID> Controller's ID number <PCS> Program's memory checksum. Two bytes, binary

representation. The 'high' byte is sent first. <ST> A word, representing the current program status: <0FFFFH>- Program is not compiled. <0>- Program is compiled and not running else- Program is running, executing line number <ST>.

Assuming ID=0, program checksum of 3B4B, not compiled. The controller's response is: 0<3BH><4BH><0FFH><0FF><0B4H><cr>

The same program, compiled, checksum=0BB7E: 0<0BBH><7EH><0><0><69H><cr>

The same program, running, executing line number 2: 0<0BBH><7E><0><2><6BH><cr>

6.6.6. TELL The Last Program Message (T4 Command) The command from a terminal is: T4<cr> The command from a host is: T4<88H><cr> The controller responds in the following form: <ID><OPER><DATA><CS><cr> where:

Page 241: Acspl Software Guide Revision 3 00

6-14 COMMUNICATION WITH HOST COMPUTER

ACSPL Software Guide - Document revision no. 3.00

<ID> Controller's ID number <OPER> Operation's code. ASCII 'P' <DATA> One byte, holding the last program message (binary

representation). Assuming ID=1. A program has been executed without errors - program message=1. The response is: 0P<1><81H><cr>

6.6.8. TELL Servo Processors Status (T5 Command) The command from a terminal:

T5<cr> The command by a host is:

T5<89H><cr> Response to the host command:

<ID><QCS><ST><cs><cr> where: <ID> Controller's ID number. <QCS> Servo processors memory checksum. Two bytes binary

representation. 'High' byte is sent first. <ST> A word representing all 4 dsp status in the format:

15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 A B C D A B C D A B C D A B C D

T processor Z processor Y processor X processor A=0 A=1

Running NOT Running

B=0 B=1

NOT in break in break

C=0 C=1

NOT in ready step ready step

D=0 D=1

NOT in idle state in idle state

6.6.9. TELL Firmware Memory Status (T6 Command) Checks the integrity of the firmware (EPROMs) and responds with the version of the software. It is described by the two first and the two last digits of the version. The command from a terminal:

T6<cr> The command from a host computer:

Page 242: Acspl Software Guide Revision 3 00

COMMUNICATION WITH HOST COMPUTER 6-15

ACSPL Software Guide - Document revision no. 3.00

T6<8aH><cr> The controller's response consists of 4 bytes: If the firmware is valid, the response is: '<high(####)><low(####)><0ffH><0ffH>' If the firmware is invalid, the response is: '<high(####)><low(####)><000H><000H>' Where (####) is the calculated checksum.

6.6.10. TELL Voltages Value (T8 Command) The command from a terminal:

T8<cr> The command from a host computer:

T8<8cH><cr> The controller responds in the following form:

<ID> <0> <0> <0> <Voltage State> <CS> <cr> Where: <Voltage State> is one byte holding bitmapped information in the format:

0 0 0 0 0 A B C A=1 -12V supply is OK. A=0 else B=1 +12V supply is OK. B=0 else C=1 the non volatile memory programming supply is OK C=0 else

6.6.11. TELL Controller's Internal Memory State (T9 Command)

The command from a terminal: T9<cr> The command from a host computer: T9<8dH><cr> . The controller responds in the following form: <ID> <IMS> <CCS> <CS> <cr>. Where: <ID> The controller's ID (ASCII '0' to ASCII '9'). <IMS> Internal Memory State. Two bytes holding bitmapped

information in the format:

Page 243: Acspl Software Guide Revision 3 00

6-16 COMMUNICATION WITH HOST COMPUTER

ACSPL Software Guide - Document revision no. 3.00

15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0 0 0 0 0 0 0 0 0 0 x x x x x x

Where:

Bit 5 - Firmware code area Bit 4 - Servo Processors area Bit 3 - Program area Bit 2 - Array data Bit 1 - Group reports' area Bit 0 - Variables' area

A set bit means that the appropriate part of memory is kept OK.

<CCS> Controller's internal memory check-sum. Two bytes holding the binary representation of the check-sum. These bytes are sent with the 'high' byte first.

This command recalculates the checksum. It takes a few seconds to complete and receive a response. Assuming the controller's ID is '0'. Suppose the controller's internal memory is kept OK, and its check sum is 0b872 Hex. The response from the controller: 0<0><3fH><0b8H><72H><69H><cr>

Suppose the controller's internal memory is kept OK, except for the group reports' area, and the check sum is 0b872 Hex. The response from the controller:

0 <0><3dH> <0b8H><72H> <67H><cr> ID IMS CCS check sum

6.7. Array SEt Commands The Array command is used the same way as if the command is sent from a terminal with the following exceptions: • Each data field is represented in 4 bytes (long integer). • Each command is followed by a check-sum byte.

6.7.1. Responses To The Array Set Command If the set was done as requested - the controller's prompt. Erroneous situations: (the content of the Fail information field)

19 Fatal. Command was not executed. The reason: Start index to set

is out of the valid range. 20 Fatal. Command was not executed. The reason: Missing data for

the specified index.

Page 244: Acspl Software Guide Revision 3 00

COMMUNICATION WITH HOST COMPUTER 6-17

ACSPL Software Guide - Document revision no. 3.00

21 Non fatal. The data field in the sequence was out of the valid range of the Target Position parameter. It was set with the nearest valid value to the requested value.

Define 7 points starting in the first index with the following values: 0, 3200, 6400, 0, -100, -5000, 0 The command from a terminal will be in the form: AXSE1 0 3200 6400 0 -100 -5000 0<cr> The command from a host computer is: AXSE <0><0><0><1> <0><0><0><0> <0><0><0cH><80H> <0><0><19H><0> <0><0><0><0> <0ffH><0ffH><0ffH><9cH> <0ffH><0ffH><0ecH><78H> <0><0><0><0> <0d2H><cr> . The controller responds with it's normal prompt. The same example, but the first number (starting index) is missing. The command from a terminal: AXSE 0 3200 6400 0 -100 -5000 0<cr> The command from a host computer : AXSE <0><0><0><0> <0><0><0cH><80H> <0><0><19H><0> <0><0><0><0> <0ffH><0ffH><0ffH><9cH> <0ffH><0ffH><0ecH><78H> <0><0><0><0> <0d1H><cr> . The controller responds with an erroneous answer (Assuming the controller's ID is '0'.): 0?<13H><82H><cr> And no set operation takes place.

The same example as the first one but the second number (X(1)) is 900,000,000 (out of range). The command from a terminal : AXSE1 900000000 3200 6400 0 -100 -5000 0<cr> The command from a host computer: AXSE <0><0><0><1> <35H><0a4H><0e9H><0> <0><0><0cH><80H> <0><0><19H><0> <0><0><0><0> <0ffH><0ffH><0ffH><9cH> <0ffH><0ffH><0ecH><78H>

Page 245: Acspl Software Guide Revision 3 00

6-18 COMMUNICATION WITH HOST COMPUTER

ACSPL Software Guide - Document revision no. 3.00

<0><0><0><0><94H><cr> The controller responds with an erroneous answer (Assuming the controller's ID is '0'.): 0?<15H><84H><cr> And X(1) will be set to 850,000,000.

6.7.2. Array Setting For Continuous Path Following The command from an host computer is in the following form:

ACSE<SI>{<Type><data1><data2><[<data3>]}<cs><cr> Where:

<SI>- The data field of the starting index. (4 bytes) <type>- A letter which defines the segment type:

'L' - Linear segment 'C' - Circular (arc) segment

<data1>- If <type>='L': The X coordinate of the end of the segment If <type>='C': The X coordinate of the center of the arc.

<data2>- If <type>='L': The Y coordinate of the end of the segment. If <type>='C': The Y coordinate of the center of the arc.

<data3>- It exists only if <type>='C'. It is the rotation angle in millidegrees.

Define a continuous path which consists of 4 segments: 1. A linear segment ending at X,Y=(0,0). 2. A linear segment ending at X,Y=(10000,20000). 3. A circle with it's center at X,Y=(10000,25000). 4. A linear segment ending at X,Y=(0,0). This set should reside in the first 4 entries of the common motion array, starting at index 1. The command from a terminal is in the form: ACSE1 L 0 0 L 10000 20000 C 10000 25000 360000 L 0 0 <cr> The command from an host is in the form: ACSE <0><0><0><1> L <0><0><0><0> <0><0><0><0> L <0><0><27H><10H> <0><0><4eH><20H> C <0><0><27H><10H> <0><0><61H><0a8H> <0><5><7eH><40H> L <0><0><0><0> <0><0><0><0> <0ecH><cr> The controller responds with it's normal prompt.

6.7.3. Array Set Of Indices The AISE command structure is identical to the structure of AXSE command. Starting index can vary from 0 to 9. Set indices 1- 9 with the values 1,2, ...9 respectively.

Page 246: Acspl Software Guide Revision 3 00

COMMUNICATION WITH HOST COMPUTER 6-19

ACSPL Software Guide - Document revision no. 3.00

The command via a terminal is: AISE 1 1 2 3 4 5 6 7 8 9<cr> The command via a host is: AISE <0><0><0><1> <0><0><0><1> <0><0><0><2> <0><0><0><3> <0><0><0><4> <0><0><0><5> <0><0><0><6> <0><0><0><7> <0><0><0><8> <0><0><0><9><50H><cr>

6.7.4. Array Set Of Variables The AVSE command structure is identical to the structure of AXSE command. Starting index can vary from 0 to 29. Set variables 0 and 1 to 10 and 20 respectively. The command via a terminal is: AVSE0 10 20 <cr> The command via a host is: AVSE <0><0><0><0> <0><0><0><0AH> <0><0><0><14H><4DH><cr>

6.8. Array REport Command The Array REport Command is used in the same way as if the command is sent from a terminal with the following exceptions: • Each data field is represented in 4 bytes (long integer). • Each command is followed by a check-sum byte. The controller sends its answer in the following form:

<ID> { <data> } <CS> <cr> Where: <ID> Controller's ID (ASCII '0' to ASCII '9'). <data> Four bytes holding the binary representation of the

reported index.. For AXRE, AYRE, AZRE, ATRE, ACRE all data items from Low Index to Upper Index are sent, as long as (UI-LI<100). For AIRE command all the values I0 to I9 are sent. For AVRE command, all values V0 to V29 are sent.

Display all points from Low Index to Upper Index. The command from a terminal: AXRE<cr>

Page 247: Acspl Software Guide Revision 3 00

6-20 COMMUNICATION WITH HOST COMPUTER

ACSPL Software Guide - Document revision no. 3.00

The command from a host computer: AXRE<30H><cr> The controller's response, assuming that: • The controller's ID is '0'. •••• The Target Positions within the Low and Upper Indices are:

0, 3200, 6400, 0, -100, -5000, 0 0<0><0><0><0> <0><0><0cH><80H> <0><0><19H><0> <0><0><0><0> <0ffH><0ffH><0ffH><9cH> <0ffH><0ffH><0ecH><78H> <0><0><0><0> <0d0H><cr>

6.8.1. Response to Array Common REport Command (Continuous Path)

The controller's response is in the following form: <ID>{<type><data1><data2>[<data3>]}<cs><cr> Where: <ID> Controller's ID. <Type>- A letter which defines the segment type:

'L' - Linear segment 'C' - Circular (arc) segment

<data1>- If <type>='L': The X coordinate of the end of the segment.If <type>='C': The X coordinate of the center of the arc

<data2>- If <type>='L': The Y coordinate of the end of the segment.If <type>='C': The Y coordinate of the center of the arc

<data3>- It exists only if <type>='C'. It is the rotation angle in millidegrees.

All possible data fields are four bytes each, holding the binary representation of the data. All array's entries from Low Index to Upper Index are sent ( up to a maximum of 32 entries).

Report all entries from Low Index to Upper Index. The command from a terminal is: ACRE<cr> The command from an host computer is: ACRE<1bH><cr> Assuming: • The controller's ID is '0' • X axis' Low Index is 0 • X axis' Upper Index is 3 The command in terminal protocol:

ACRE <cr> The controller’s response using terminal protocol:

Page 248: Acspl Software Guide Revision 3 00

COMMUNICATION WITH HOST COMPUTER 6-21

ACSPL Software Guide - Document revision no. 3.00

0: L 1000 2000 | 2: C 500 600 90000 1: L 3000 4000 | 3: L 5000 6000 The command in host protocol:

ACRE<1b><cr> The response: 0L<00><00><03><e8> <00><00><07><d0> L<00><00><0b><b8> <00><00><0f><a0> C<00><00><01><f4> <00><00><02><58> <00><01><5f><90> L<00><00><13><88> <00><00><17><70> <ec><cr>

6.8.2. Array Of Indices The AIRE command structure is identical to the structure of AXRE command. The command via a terminal: AIRE<cr> The command from a host computer: AIRE<21H><cr>

Suppose that I(0)-Index 0- is 0, I(1)=1,...,I(9)=9. The response would be: <0><0><0><0> <0><0><0><1> <0><0><0><2> <0><0><0><3> <0><0><0><4> <0><0><0><5> <0><0><0><6> <0><0><0><7> <0><0><0><8> <0><0><0><9><5DH><cr>

6.8.3. Array Report Of Variables The AVRE command structure is identical to the structure of AXRE command. The command via a terminal: AVRE<cr> The command by a host: AVRE<2EH><cr> Suppose that V(0)-Variable 0- is 0, V(1)=1,...,V(29)=29. The response will be: <0><0><0><0>

Page 249: Acspl Software Guide Revision 3 00

6-22 COMMUNICATION WITH HOST COMPUTER

ACSPL Software Guide - Document revision no. 3.00

<0><0><0><1> <0><0><0><2> <0><0><0><3> <0><0><0><4> <0><0><0><5> <0><0><0><6> <0><0><0><7> <0><0><0><8> <0><0><0><9> <0><0><0><0AH> <0><0><0><0BH> <0><0><0><0CH> <0><0><0><10H><0DH> <0><0><0><0EH> <0><0><0><0FH> <0><0><0><10H><10H> <0><0><0><11H> <0><0><0><12H> <0><0><0><13H> <0><0><0><14H> <0><0><0><15H> <0><0><0><16H> <0><0><0><17H> <0><0><0><18H> <0><0><0><19H> <0><0><0><1AH> <0><0><0><1BH> <0><0><0><1CH> <0><0><0><1DH><0E3H><cr>

6.9. Group Command The Group command is used the same way as if the command is sent from a terminal with exception that each command is followed by a check-sum byte.

6.9.1. Responses To The Group Command The controller's prompt if the set was done as requested.

6.9.1.1. Erroneous Situations: (the content of the Fail information field)

1 Fatal. Command wasn't executed. The reason: An unrecognized subcommand.

22 Non fatal. An unrecognized Sub-Command was found within a data field. Interpretation continued after the erroneous field. This field will not affect the being defined group.

Page 250: Acspl Software Guide Revision 3 00

COMMUNICATION WITH HOST COMPUTER 6-23

ACSPL Software Guide - Document revision no. 3.00

Group number 5 with the variables: Current Position and Position Error. The command from a terminal: G5 CP PE<cr> The command from a host computer: G5CPPE<0a4H><cr> The controller responses with its normal prompt.

The same example, but instead of CP, PC was sent instead: The command from a terminal: G5 PC PE<cr> The command from a host computer: G5PCPE<0a4H><cr> The controller responses with an erroneous answer (Assuming the controller's ID is '0'): 0?<16H><85H><cr> And group report number 5 would include only the Position Error parameter.

6.10. Begin Motion Command The Begin motion command is used the same way as if the command is sent from a terminal with one exception: • Each command is followed by a check-sum byte. The Begin message is in the following form: <ID> { <Oper> <Axis> <Data> } <CS> <cr> Where: <ID> Controller's ID (ASCII '0' to ASCII '9'). <Oper> Operation's code. ASCII 'B'. <Axis> The reported axis. ASCII 'X', 'Y', 'Z', 'T' or 'C' when the

motion is common. <Data> One byte holding the result. Possible values are the

same values as received in the T1 command. { } Designate the repetitive part.

6.10.1. Responses To The Begin Motion Command • The controller's prompt, if the 'Initiate Communication' parameter

does not require a detailed report (IC = 0 or 2 or 4 or 6). • The controller sends a detailed answer - 'Begin message' - if the

'Initiate Communication' parameter requires a detailed report (IC =1 or 3 or 5 or 7).

• The Begin message is ready within 5 milli-seconds after the required motion has started (or failed).

If, when a Begin message is available, the controller is busy with other transmission (like a report), the current transmission will not be

Page 251: Acspl Software Guide Revision 3 00

6-24 COMMUNICATION WITH HOST COMPUTER

ACSPL Software Guide - Document revision no. 3.00

interrupted. Only after this transmission is completed, it will transmit the Begin message. If more than one Begin message is ready while the controller is busy with other transmission, the messages will be accumulated and be sent together as soon as the controller is ready to transmit them. Responses to commands received through the communication link has priority on Begin messages. Up to 16 messages may be accumulated if the controller is handling other transmissions. Begin a motion of motor X The command from a terminal: BX<cr> The command from a host computer would be in the form: BX<9AH><cr> Assuming that the motor is enabled, the controller's response: 0BX<1H><0BH><cr> Begin a motion of motors X and Z The command from a terminal: BXZ<cr> The command from a host computer would be in the form: BXZ<f4H><cr> Assuming that the motors are enabled, the controller's response: 0BX<1H><0BH><cr> 0BZ<1H><0DH><cr> See Begin messages on page 7–73

6.11. End Motion Command The End motion command is used the same way as if the command is sent from a terminal with one exception: • Each command is followed by a check-sum byte. The form of the End message : <ID> { <Oper> <Axis> <Data> } <CS> <cr> Where: <ID> Controller's ID (ASCII '0' to ASCII '9'). <Oper> Operation's code. ASCII 'E'. <Axis> The reported axis. ASCII 'X', 'Y', 'Z', 'T' or 'C' if the motion

is common <Data> One byte holding the result. Possible values are the same

values as received in the T2 command. { } - Designate the repetitive part.

6.11.1. Response To The End Motion Command • The controller's prompt, if the 'Initiate Communication' parameter

does not require a detailed report (IC =0 or 1 or 4 or 5).

Page 252: Acspl Software Guide Revision 3 00

COMMUNICATION WITH HOST COMPUTER 6-25

ACSPL Software Guide - Document revision no. 3.00

• The controller sends a detailed answer - 'End message', if the 'Initiate Communication' parameter requires a detailed report (IC = 2 or 3 or 6 or 7).

• The End message is ready within 5 milli-seconds after the required motion has started (or failed).

End motion of 4 axes. The command from a terminal: EC<cr>_H The command from a host computer EC<88H><cr> If 4 motors are running in common motion, the controller's ID is '0' and the IC parameter requires End messages, the response of the controller will be: 0EX<1><ceH><cr> 0EY<1><cfH><cr> 0EZ<1><d0H><cr> 0ET<1><caH><cr> See End messages on page 7–74

6.12. Kill Motion Command The Kill motion command is used the same way as if the command is sent from a terminal with one exception: • Each command is followed by a check-sum byte.

6.12.1. Response To The Kill Motion Command • The controller's prompt, if the 'Initiate Communication' parameter

does not require an End message (IC = 0 or 1 or 4 or 5). • The controller sends an End message.

Kill a motion. The command from a terminal would be in the form: KX<cr> The command from a host computer: KX<0A3H><cr> The response of the controller : 0EX<2H><0cFH><cr>

6.13. Move Command The Move command is used the same way as if the command is sent from a terminal with one exception: • The command is followed by a check-sum byte. Execute a registration distance move according to the mark and the RD parameter The command from a terminal: M<cr>

Page 253: Acspl Software Guide Revision 3 00

6-26 COMMUNICATION WITH HOST COMPUTER

ACSPL Software Guide - Document revision no. 3.00

The command from a host computer: MM<cr> If the axis is in manual mode, the controller answers with its prompt: 00<cr> (if the ID is 0)

6.14. Wake Command The Wake command is used in the same way as if the command is sent from a terminal with one exception: • The command is followed by a check-sum byte.

6.14.1. Response To The Wake Command • The controller's prompt if the required controller to be awaked

does not exist (or does not function). Or the new awaked controller's prompt.

• Erroneous situations (the content of the Fail information field):

19 - Fatal. Command was not executed. The reason: the specified controller's ID is out of the valid range. (should be in the range '0' to '9').

20 - Fatal. Command was not executed. The reason: Missing data field (the new controller's ID).

Wake up controller number 1. The command from a terminal: @W1<cr> The command from a host computer: @W1<e8H><cr> Assuming controller number 1 is connected and active, the result would be: 11<cr>

6.15. Automatic Cyclical Buffering Commands The commands in terminal protocol are summarized in Section 3.3.11, page 3-32. For a detailed description of Automatic Cyclical Buffering see Section 5.12.1, page 5-41.

Note: This section deals with two distinct commands "next" (written 'n') and "Next" (written 'N').

6.15.1. n$<format> Identical to terminal protocol.

Page 254: Acspl Software Guide Revision 3 00

COMMUNICATION WITH HOST COMPUTER 6-27

ACSPL Software Guide - Document revision no. 3.00

6.15.2. nC<set of axes><format> Identical to terminal protocol.

6.15.3. n The next command (n) by itself reports the current data format(s) for the Next commands, as determined by n$ and nC. The format in host protocol of the response to the next command is: <T_format> <Z_format> <Y_format> <X_format> <Common_descriptor> where: <$_format> is one byte with one of the following values: 0 - Axis is not available 1 - Position only 2 - Position and time data The <Common_descriptor> is available only for multi-axis controllers. It consists of 4 bytes: <0> <'C'> <Common_axes><Common_format>, where <Common_axes> is

7 6 5 4 3 2 1 0 0 0 0 0 dT dZ dY dX

dX=1 if X axis participates dY=1 if Y axis participates dZ=1 if Z axis participates dT=1 if T axis participates <Common_format> is one byte with one of the following values: 1 - position only 2 - position and time

6.15.4. N$<data . . .data> Identical to terminal protocol except for the data represention, which is hexadecimal instead of decimal.

6.16. Using ACSPL Under Host Protocol Most of the programming commands cannot be used under host protocol. The following commands are supported by the host protocol:

Page 255: Acspl Software Guide Revision 3 00

6-28 COMMUNICATION WITH HOST COMPUTER

ACSPL Software Guide - Document revision no. 3.00

Program Stop PS<0A3H><cr> Program Compile PC<93H><cr> Program eXecute (by label)

PX<label><CS><cr>

Program eXecute (by line number)

PX<ASCII line number><CS><cr>

6.16.1. The Form Of The Response To PC Command • When compilation is successful: <ID><CL><FB><CS><cr> Where:

<ID> Controller's ID number <CL The number of lines compiled (two bytes, lower byte is

sent first. Binary representation) <FB> The amount of free memory in bytes (two bytes, lower

byte is sent first. Binary representation) <CS> Checksum

• When the compilation fails: <ID>??<EL>?<EM><CS><cr>

Where: <EL> The erroneous line number (two bytes, lower byte is

sent first. Binary representation). <EM> Number of the Error Message (one byte, binary

representation).

A program contains 9 lines, compilation is successful and 3,976 bytes of memory are left free. The controller's response: 0<0><9><0FH><88H><0D0H><cr> If the program contains an END without a LOOP statement at line 10: 0??<0><0AH>?<47H><3EH><cr>

6.16.2. Controller's Transmissions Of DISP Statement In A Running Program

Strings in DISP statement are sent in ASCII format. Variables are sent in long (4 bytes) binary representation. The controller's ID is not sent at the beginning of such a transmission.

A running program contains the following statement: disp "XDP",XDP,"XCP",XCP When the statement is executed, the X Desired Position is 10,000, and the Current Position is 1,037: 0 XDP <00><00><27><10><10> XCP <00><00><04><10><0d> <4f> <cr> ID string data

10 - dle string data

10 - dle CS

Page 256: Acspl Software Guide Revision 3 00

COMMUNICATION WITH HOST COMPUTER 6-29

ACSPL Software Guide - Document revision no. 3.00

6.17. Safeguards for Noisy Environment The host communication protocol enables a high degree of communication reliability.

Warning. The mechanisms described in this section are primarily intended for use with host protocol. Great caution should be exercised if setting tt in terminal communication protocol. If you set it too low, you will effectively lock the keyboard.

6.17.1. Protecting Controller Reception Against Noise It is assumed that messages are sent from the host to the controller with no delay between the characters of the message. If the elapsed time between two received characters is too large, this is assumed to be due to noise on the channel or some other interference, and all received characters, except the last one, are ignored. The process followed by the controller is that each time that a new character other than <cr> is received, a timer is activated. If the value of the timer reaches tt (units are milliseconds) before the next character is received, the whole message is flushed from the communication receive buffer. Once <cr> is received (end of message), the whole message is processed. If tt=0, this mechanism is not activated. When BR>9600, tt must be set to 0 or ≥1. When BR=9600, tt must be set to 0 or ≥2. When BR=4800, tt must be set to 0 or ≥4. When BR=2400, tt must be set to 0 or ≥8. When BR=300, tt must be set to 0 or ≥64. This feature is effective when the communication line is noisy. If it is disabled, received legal commands could be blocked by the interfering noise.

6.17.2. Protecting Host Against 'Lost' disp Messages An acknowledge mechanism can be enabled for disp messages. The mechanism is described in this section and the conditions for enabling the mechanism are described later. Each disp message must be acknowledged by the host with a valid acknowledge command (C) within at milliseconds. The disp message remains in the output queue until either it is ackowledged or the acknowledge mechanism is disabled. This means that if a disp message is not successfully acknowledged, the controller retransmits the message until an acknowledge is received or until the acknowledge mechanism is disabled. If one of these conditions does not occur, the controller will not transmit the next disp message, and thereby hang the program. If the program is terminated before receiving acknowledgement of the last disp

Page 257: Acspl Software Guide Revision 3 00

6-30 COMMUNICATION WITH HOST COMPUTER

ACSPL Software Guide - Document revision no. 3.00

message, the controller also continues to retransmit until acknowledge or disabling of acknowledge mechanism. The controller numbers each disp message consecutively, returning to zero when it reaches message number 65,535. The message number, preceded by the characters PD, is added automatically to each disp message. The structure of the disp message depends on whether the acknowledge mechanism is enabled (conditions are described later).

When disabled (default) the structure of the disp message is: <Controller ID><message body><CS><cr> When enabled the structure of the disp message is: <Controller ID>PD<message number >< message body><CS><cr> where PD is a literal that indicates the start of the message number and <message #> is a number in the range [0..65535]. The format (ACSII or Hex) of both the message # and of any numeric values in the message body is determined by HT. HT=0 (host protocol) selects Hex while HT>0 selects ACSII.

6.17.2.1. disp Acknowledge Mechanism Parameters HP Host Protocol. HP.4 and at (described later in this section)

are the prerequisites for enabling the acknowledge mechanism. The acknowledge mechanism disabled by setting HP.4=0 or by setting at=0.

TN Transmission Number. A system parameter (report only). Range : [0..65535]. Upon power-up, TN is initialized to 0. Each time that a disp statement is executed, TN is incremented by 1. If the acknowledge mechanism is enabled, TN is transmitted to the host as the message number field (described later). Whenever the value of HP.4 is changed from 0 to 1, the TN is zeroed.

AN Acknowledge Number. A system parameter (report only). Range : [0..65535]. Upon power-up, AN is initialized to 0. Each time that a disp statement is acknowledged by the host, the controller checks that the message number in the acknowledgement matches the message number sent. If they match, AN is incremented. The controller's use of AN is described below. Whenever the value of HP.4 is changed from 0 to 1, the AN is zeroed.

Page 258: Acspl Software Guide Revision 3 00

COMMUNICATION WITH HOST COMPUTER 6-31

ACSPL Software Guide - Document revision no. 3.00

at acknowledge time. System parameter (set/report). Range - [0..10,000] milliseconds. Factory default - 0. at is saved in the nonvolatile memory. Each time that a disp message is generated, and at>0, a timer is activated. If an appropriate acknowledgement is not received within at milliseconds, the message is retransmitted. Retransmission of an unacknowledged disp message does not affect transmission of other types of messages that may be generated during the retransmission process. Once the timer is activated, the retransmission will stop if the acknowledgement mechanism is disabled (HP.4 is set to 0 or at is set to 0).

6.17.2.2. C - aCknowledge Command When the acknowledge mechanism is enabled, the host must acknowledge each message that it receives by the C (aCknowledge) command. Syntax: C<message number><CS><cr> where the message number must be that of the message received.

6.17.2.3. Program Mode Support for Acknowledge Mechanism HOST_ACK is a boolean ACSPL variable that indicates whether a valid acknowledgement has been received from the host. HOST_ACK is TRUE when: AN=TN : Valid acknowlegement received. (HOST_ACK is also TRUE while the acknowledgement mechanism is disabled (HP.4 is set to 0 or at is set to 0)). HOST_ACK is FALSE when: AN<>TN : Valid acknowlegement not received yet AND the acknowledgement mechanism is enabled (HP.4 =1 AND at >0)

6.17.2.4. Examples There are two ways that the acknowledgement mechanism can be used: • After each disp statement, add a till HOST_ACK statement. This

will prevent further execution of the program until the acknowledgement is received. It is recommended to use this method during development and debugging. Ex1: let at = 3000 let HP = 16 <ACSPL statements> disp "OK01" till HOST_ACK

Page 259: Acspl Software Guide Revision 3 00

6-32 COMMUNICATION WITH HOST COMPUTER

ACSPL Software Guide - Document revision no. 3.00

<ACSPL statements> disp "OK02" <etc.>

• Write the ACSPL program without any additions. Each time that a

new disp statement is encountered, the program will hang until the acknowledge for the previous disp message has been received. It is recommended to use this method in a working environment. Ex2: let at = 3000 let HP = 16 <ACSPL statements> disp "OK01" <ACSPL statements> disp "OK02" <ACSPL statements> disp "OK03" <etc.>

The following table shows the train of events for the previous example. In the table it is assumed that for some reason two errors occurred: • an invalid acknowledgement was sent by the host in response to

"OK02"

• "OK03" came corrupted the first time and therefore wasn't acknowledged by the host

disp TN AN Controller output Host response

Comment

0 0 Initial condition. "OK01" 1 0 PD00001 OK01

(repeats every 3 s) New disp message.

TN increments. Controller repeats till acknowleged.

C1 Valid acknowledgement. 1 1 AN increments. "OK02" 2 1 PD00002 OK02

(repeats every 3 s) New disp message.

TN increments. Controller repeats till acknowleged.

C7 Invalid acknowledgement. 2 1 C2 Valid acknowledgement. 2 2 AN increments.

Page 260: Acspl Software Guide Revision 3 00

COMMUNICATION WITH HOST COMPUTER 6-33

ACSPL Software Guide - Document revision no. 3.00

disp TN AN Controller output Host response

Comment

"OK03" 3 2 PD00003 OK03 New disp message. TN increments. Controller repeats till acknowleged.

Received corrupted - no acknowledgement sent.

PD00003 OK03 Since no acknowledgement received, controller continues to send disp message every 3 s.

C3 Valid acknowledgement. 3 3 AN increments.

6.17.3. Synchronizing Begin/End Commands and Messages When HP.6=1 each Begin and End message is accompanied by a four byte header. Each message must be acknowledged by the host with an acknowledge command (C) within at milliseconds. If the expected acknowledge is not received, the controller transmits it again. The controller will repeat the transmission of the unacknowledged message until it is acknowledged, or until the acknowledge mechanism is turned off. While waiting for an acknowledge, the controller may receive and execute commands. It may also transmit other messages to the host, as required (response to report command, for example). However, a retransmitted message is not mixed with other messages that are transmitted by the controller. The Begin/End acknowledge mechanism does not interfere with ACSPL messages acknowledge mechanism. The acknowledge format is: <Ack. Command><Axis><Message number><cr> where <Ack. Command> is ‘C’, <Axis> is ‘X’ / 'Y' / 'Z' / 'T' <Message number> is the number of the acknowledged message. Delay of an acknowledge may affect the operation of the controller: - For a given axis, if an End message is produced before a Begin message was acknowledged, then the End message will be assigned the same message number and only one acknowledge is expected. If both messages are acknowledged, one of them will be ignored without any negative side effects. - If a new motion command is issued before an acknowledge for a previous motion is received, the new motion will be delayed until the reception of an acknowledge for the previous motion. During the delay, ACSPL program may be suspended until the new motion starts.

Page 261: Acspl Software Guide Revision 3 00

6-34 COMMUNICATION WITH HOST COMPUTER

ACSPL Software Guide - Document revision no. 3.00

The acknowledge mechanism can be cleared in one of the following ways: - Changing HT. - Setting <at> to 0. - Changing HP.4 or HP.6. - Setting TN, AN, $TA, $AK to 0. Message structure: When HP.6=0 <ID><‘B’ / ‘E’><Axis>< number>[cs]<cr> When HP.6=1 <ID> SB <message number><‘B’> < Axis>< number>[cs]<cr> or <ID> SE <message number><‘E’> < Axis>< number>[cs]<cr> where: SB indicates a System Begin message header. SE indicates a System End message header. <Message number> is a number in the range [0,65535]. <Number> is the Begin/End result of the motion (1 byte).

Page 262: Acspl Software Guide Revision 3 00

REFERENCE 7-1

ACSPL Software Guide - Document revision no. 3.00

7. REFERENCE

7.1. Set and Report Parameters

7.1.1. Motor and Feedback - General Sub

Com. Description Axis Group Range Remarks

AV Actual Velocity X/Y/Z/T R ±32,000,000 BG Begin on input/GO X/Y/Z/T S/R 0,1 0 -B$I on input.

1 - on GO C1 CP Current Position X/Y/Z/T R ±2,147,483,647 Primary

feedback D1 Dac 1 command X/Y/Z/T R ±511 D2 Dac 2 command X/Y/Z/T R ±511 E2 Encoder #2 position X/Y/Z/T R ±2,147,483,647 Secondary

feedback ED Enable Delay time X/Y/Z/T S/R 1 -10,000 ET Encoder Type X/Y/Z/T S/R 0 – 6, 100 -106 Et 2’nd Encoder type X/Y/Z/T S/R 0 - 3 IS Input Source X/Y/Z/T S/R 1 – 16 IT IX IndeX position X/Y/Z/T R ±2,147,483,647

LW M1 Mark 1 - position X/Y/Z/T R ±2,147,483,647 M2 Mark 2 position X/Y/Z/T R Used in setup MO MOtor enabled X/Y/Z/T S/R 0,1 ON/OFF PE Position Error X/Y/Z/T R ±32,767 PE=0 when the

axis is disabled

Page 263: Acspl Software Guide Revision 3 00

7-2 REFERENCE

ACSPL Software Guide - Document revision no. 3.00

Sub Com.

Description Axis Group Range Remarks

RD Registration Dist. X/Y/Z/T S/R ±16,000,000 tb TD Target rad. Delay X/Y/Z/T S/R 1 – 32,000 msec TE Tracking Error X/Y/Z/T R 1 – 32,000 Counts TR Target Radius X/Y/Z/T S/R 1 – 255 XT ZP Zero Position X/Y/Z/T S ±999,999,999 zp zero position of 2’nd

encoder X/Y/Z/T S ±999,999,999

7.1.2. Servo Control Sub

Com. Description Axis Group Range Remarks

AF Acc. Feed forward X/Y/Z/T S/R 0 – 255 D4 D4 analog output X/Y/Z/T S/R ±511 DA DAc offset X/Y/Z/T S/R ±511

±1,638 SB214xx SB10x1/2/3

DO Dac Output X/Y/Z/T R ±511, ±1638 DT Drive Type X/Y/Z/T S/R 0, 1, 4 DCL only FN FT Filter Type X/Y/Z/T S/R 0, 1 PID / PIV GA GAin X/Y/Z/T S/R 0 – 4,095 GF Gain Factor X/Y/Z/T S/R -8 – 0 KZ coeff.(K) 2nd Zero X/Y/Z/T S/R 0 – 99 PF Pwm Frequency X/Y/Z/T S/R 2, 5, 10, 20 kHz PO POle X/Y/Z/T S/R ±2,047 SA SAmpling rate-kHz X/Y/Z/T S/R 4,5,10,20 Per axis VF ZE ZEro X/Y/Z/T S/R 0 - 4,095

7.1.3. Stepper Control Sub

Com. Description Axis Group Range Remarks

CL Current Level (%) X/Y/Z/T S/R 0 – 100 EC ver. Enc. Constant X/Y/Z/T S/R 1 – 32,767 EF ver. Enc. Factor X/Y/Z/T S/R 0 – 23 NF Next Full step X/Y/Z/T R ±2,147,483,647 stepper P0 P0 idle current X/Y/Z/T S/R 0 – 150 P1 P1 jerk current X/Y/Z/T S/R 0 – 150 P2 P2 accel. current X/Y/Z/T S/R 0 – 150 P3 P3 veloc. current X/Y/Z/T S/R 0 – 150 P4 P4 decel. current X/Y/Z/T S/R 0 – 150 PW Pulse Width (stepper) X/Y/Z/T S/R 400 – 30,000 nanosecond

Page 264: Acspl Software Guide Revision 3 00

REFERENCE 7-3

ACSPL Software Guide - Document revision no. 3.00

Sub Com.

Description Axis Group Range Remarks

VE Verify Ena./ dis. X/Y/Z/T S/R 0,1,2

7.1.4. Commutation Sub

Com. Description Axis Group Range Remarks

_h Hall Offset X/Y/Z/T S/R ±511 Commutation _m Index Offset X/Y/Z/T S/R ±1,000,000 Commutation CO Commutation Offset X/Y/Z/T S/R ±8,000,000 CU Commutation Usage X/Y/Z/T S/R 1, 2, 3 Type of

commutation feedback device

FC Field Current X/Y/Z/T S/R ±1638 ±511

AC induction motor control

HA HAll effect reading X/Y/Z/T R 0 - 5 LF Lines Factor X/Y/Z/T S/R 0 - 10 Total counts/rev LR Lines per Rev. X/Y/Z/T S/R 500- 32,767 LR •2LF NP Number of motor’s

Poles X/Y/Z/T S/R 2 - 64 Even numbers

only PA Phase Advance X/Y/Z/T S/R 0 - 255 RS ReSolver reading X/Y/Z/T R 0 - 4,095 SK Slip constant X/Y/Z/T S/R ±16,383 AC induction

motor XT aXis Type X/Y/Z/T S/R 0, 1, 2,3, 5

3, 5 0, 1, 2 ,3

SB1002/SB1003 SB10x1 SB214xx

7.1.5. Profile Generation Sub

Com. Description Axis Group Range Remarks

CM Curr motion Mode X/Y/Z/T R 0 – 99 MM next Motion Mode X/Y/Z/T S/R 0 – 99

7.1.5.1. General Profile Generation Sub

Com. Description Axis Group Range Remarks

AP next trgt Abs Pos X/Y/Z/T S/R ±999,999,999 DP Desired Position X/Y/Z/T R ±2,147,483,647 dp KD Kill Deceleration X/Y/Z/T S/R 1,000 –

127,000,000 Counts/second²

LA Linear Acceleration X/Y/Z/T S/R 1,000 – 127,000,000

Counts/second²

LD Linear Deceleration X/Y/Z/T S/R 1,000 – 127,000,000

Counts/second²

Page 265: Acspl Software Guide Revision 3 00

7-4 REFERENCE

ACSPL Software Guide - Document revision no. 3.00

Sub Com.

Description Axis Group Range Remarks

LV Linear Velocity X/Y/Z/T S/R ±32,000,000 Counts/second RP next trgt Rel Pos X/Y/Z/T S/R ±128,000,000 SF Smooth Factor X/Y/Z/T S/R 1 – 255 VA Vector Acceler. S/R 1,000 –

127,000,000

VD Vector Decel. S/R 1,000 – 127,000,000

VK Vector Kill decel. S/R 1,000 – 127,000,000

VS Vector Smooth fac. S/R 1 – 255 VV Vector Velocity S/R ±32,000,000

7.1.5.2. MM4 - Circular Point to Point Sub

Com. Description Axis Group Range Remarks

CA Current Angle R CC Center's Coords. X/Y/Z/T S/R ±999,999,999 RA Rotation Angle S/R ±7,200,000

7.1.5.3. MM12 - Master-Slave Sub

Com. Description Axis Group Range Remarks

MA MAster slave configuration

X/Y/Z/T S/R 0 – 4 0 - none 1 - X 2 - Y 3 - Z 4 - T

MC MI Master Index X/Y/Z/T R ±2,147,483,647 MD Master Distance X/Y/Z/T S ±128,000,000 MP Master Position X/Y/Z/T R ±2,147,483,647 MR Master Rel. pos. X/Y/Z/T R ±2,147,483,647 MS Master Sync. X/Y/Z/T R 0,1 ON/OFF MV Master Velocity X/Y/Z/T R ±32,000,000 MZ Master Zero pos. X/Y/Z/T S ±999,999,999 TC Tracking Constant X/Y/Z/T S/R ±32,767 TF Tracking Factor X/Y/Z/T S/R 0 - 65,535

7.1.5.4. MM16 - Arbitrary Path Sub

Com. Description Axis Group Range Remarks

ao AO Array Offset X/Y/Z/T S/R ±999,999,999 Also MM3 -

move by sequence

Page 266: Acspl Software Guide Revision 3 00

REFERENCE 7-5

ACSPL Software Guide - Document revision no. 3.00

Sub Com.

Description Axis Group Range Remarks

ES Executed Step X/Y/Z/T R 0 – 1,023 FS IF Interval Factor X/Y/Z/T S/R 10 – 250 LI array's Low Index X/Y/Z/T S/R 0 – 1,023 Also MM3 and

MM15 - cont. path following

NS PG Path Gen. mode X/Y/Z/T S/R 0 - 255 Binary PT Path Time X/Y/Z/T S/R 1 -- 32,000 SQ SeQuence type X/Y/Z/T S/R 0,1 Forward/Back;

also MM3 TS Track Sync. range X/Y/Z/T S/R 0 – 10 TV Tracking Velocity X/Y/Z/T R ±16,000,000 UI array's Upper Index X/Y/Z/T S/R 0 – 1,023 Also MM3 and

MM15

7.1.5.5. MM8 & MM9 - Multiple Velocity Point to Point & Search for Contact

Sub Com.

Description Axis Group Range Remarks

BP Begin Position X/Y/Z/T S/R ±999,999,999 MM8 BV Begin Velocity X/Y/Z/T S/R 0 - 32,000,000 MM8 SD Search Distance X/Y/Z/T S/R ±999,999,999 MM9 SE SEnsor input src. X/Y/Z/T S/R 1 – 16 MM9 SH Sensor High time X/Y/Z/T S/R 1 – 32,000 MM9 SO ShOrt time X/Y/Z/T S/R 0 – 255 MM9 SP Sensor Point X/Y/Z/T S/R ±999,999,999 MM9 SS Start Sensor pos. X/Y/Z/T R ±2,147,483,647 MM9 SV Search Velocity X/Y/Z/T S/R ±32,000,000 MM9 VO search Velocity

Output X/Y/Z/T S/R 1 - 16

7.1.5.6. Motion Mode - Other Sub

Com. Description Axis Group Range Remarks

LT Lower Threshold X/Y/Z/T S/R 42 – 982 MM21 - joystick UT Upper Threshold X/Y/Z/T S/R 42 – 982 MM21 - joystick WT Wait Time X/Y/Z/T S/R 0 – 65,535 MM1 - repetitive

point to point; MM3; also used in data collection

7.1.5.7. Parabolic Profile (Obsolete) Sub

Com. Description Axis Group Range Remarks

Page 267: Acspl Software Guide Revision 3 00

7-6 REFERENCE

ACSPL Software Guide - Document revision no. 3.00

Sub Com.

Description Axis Group Range Remarks

la lower acceleration X/Y/Z/T s/r 1000 - 127,000,000

used when VM>0

ld lower deceleration X/Y/Z/T s/r 1000 - 127,000,000

used when VM>0

VM Velocity Minimal X/Y/Z/T R 0 - 16,000,000

7.1.6. Motor Safety and Controller Integrity

7.1.6.1. Motor Safety Sub

Com. Description Axis Group Range Remarks

BO Break Open X/Y/Z/T S/R 0 ,1 ON/OFF CL Current Level X/Y/Z/T S/R 0 -100 percentage of the

normal current EA max. Err. in Accel. X/Y/Z/T S/R 10 – 32,000 ER maximum ERror X/Y/Z/T S/R 10 – 32,000 IL safety Inputs Logic S/R 0 - 8191 Binary OL Output Logic S/R 0 - 15 Binary, bit

assignment PH Position High X/Y/Z/T S/R ±999,999,999 right software

limit PL Position Low X/Y/Z/T S/R ±999,999,999 left software limit SI System Input R Binary TL Torque Limit X/Y/Z/T S/R 10 - 511

10 - 1638 SB214xx SB1000 not when moving

TO maximum TOrque X/Y/Z/T S/R 10 - 511 10 - 1638

SB214xx SB1000 While moving

7.1.6.2. Controller Integrity and Diagnostics Sub

Com. Description Axis Group Range Remarks

FR Flash eRror counter R 0 - 65,535 LS PP Prog. Protect line S/R 0 – 2,730 for ACSPL QP Qarea Protect line X/Y/Z/T S/R 0 – 9,999 for DSP program Qs SN Serial Number R st program step mode S/R 0,1 ACSPL step mode us US VR software VeRsion R

Page 268: Acspl Software Guide Revision 3 00

REFERENCE 7-7

ACSPL Software Guide - Document revision no. 3.00

7.1.7. Special Functions Sub

Com. Description Axis Group Range Remarks

FA Functions Avail. X/Y/Z/T S/R 0 – 255 Binary,bit assignment

FE Function Enable S/R 0,1,2,4,6 SC

7.1.7.1. PEG Sub

Com. Description Axis Group Range Remarks

AL Array Low X/Y/Z/T S/R 0 – 511 AS Array Step X/Y/Z/T R 0 – 511 AU Array Upper X/Y/Z/T S/R 0 – 511 EG Event Gen. mode X/Y/Z/T S/R 0,1,2 PEG function EL End Location X/Y/Z/T S/R ±999,999,999 PEG function MT Match Time (peg) X/Y/Z/T S/R 1 – 65,535 1 = 100•10-9 sec PI Position Interval X/Y/Z/T S/R ±32,767 PEG function PM Peg Mask S/R 0 – 65,535 Binary SL Start Location X/Y/Z/T S/R ±999,999,999

7.1.7.2. Error Mapping Sub

Com. Description Axis Group Range Remarks

CG Curr.pos-Grid cor. X/Y/Z/T R ±999,999,999 Error Mapping EM Error Mapping S/R 0 – 6 Error Mapping GC Grid Correction X/Y/Z/T R ±32,767 Error Mapping GD Grid Delta X/Y/Z/T S/R 1 – 1,000,000 Error Mapping GO Grid Offset X/Y/Z/T S/R ±999,999,999 Error Mapping GS Grid Size X/Y/Z/T S/R 2 – 72 Error Mapping

7.1.7.3. Data Collection and Monitoring Sub

Com. Description Axis Group Range Remarks

DC Data Collec. mask X/Y/Z/T S/R 0 - 4,095 Binary DL Data coll. Low index S/R 0 – 1,023 Data collection DS Data coll. exec. Step R 0 – 1,023 Data collection DU Data coll. Upper

index S/R 0 – 1,023 Data collection

MF Monitor Factor X/Y/Z/T S/R ±7 MN Motion moNitor X/Y/Z/T S/R 0 – 4 ti time interval S/R 1 – 32,000 Data collection

Page 269: Acspl Software Guide Revision 3 00

7-8 REFERENCE

ACSPL Software Guide - Document revision no. 3.00

7.1.7.4. 7-Segment Display Sub

Com. Description Axis Group Range Remarks

sf 7-segment function S/R 0 . . 7 sd 7-segment delay S/R 100 . . 1,000

S/R

7.1.7.6. Other (Special Products) Sub

Com. Description Axis Group Range Remarks

d1 display constant 1 X/Y/Z S/R -32,767 - 32,767 SB1003 with display board

d2 display constant 2 X/Y/Z S/R 1 - 32,767 SB1003 with display board

d3 display constant 3 X/Y/Z S/R -32,767 - 32,767 SB1003 with display board

df display function X/Y/Z S/R 0 -255 SB1003 with display board

dh display hysteresis X/Y/Z S/R 0 - 100 SB1003 with display board

dm display maximum value

X/Y/Z S/R 0 - 99,999,999 SB1003 with display board

dr display rate X/Y/Z S/R 0 -30,000 SB1003 with display board

dv display value X/Y/Z S/R 0 - 999,999,999 SB1003 with display board

7.1.8. System

7.1.8.1. Communications - General Sub

Com. Description Axis Group Range Remarks

AK AN Acknowledge Number R 0 - 65,535 at Acknowledge time S/R 0 - 10,000 msec. BE Begin/End masking S/R 0 - 255 Binary BR Baud Rate S/R 300 – 57600 FL Field Length S/R 3 – 10 HP Host Protocol S/R 0 - 65,535 Binary, bit

assignment HT Host/Terminal S/R 0,1,2 Binary, bit

assignment IC Initiate Comms. S/R 0 – 7 ID controller's ID S/R 0 – 9 TA TN Transmission Number R 0 - 65,535

Page 270: Acspl Software Guide Revision 3 00

REFERENCE 7-9

ACSPL Software Guide - Document revision no. 3.00

Sub Com.

Description Axis Group Range Remarks

tt Transmission time S/R 0, 2 - 30,000

7.1.8.2. Bus Communications Sub

Com. Description Axis Group Range Remarks

FG Flag reGister R Binary VME FM Function Mapping S/R 0,1 SG Status reGister R Binary VME VN Vector Number S/R 0 - 40FC hex VME only

7.1.8.3. Digital and Analog Input/Output Sub

Com. Description Axis Group Range Remarks

A0 Analog input 0 X/Y/Z/T R ±2,047 0 - 1,023

SB1001/2/3 SB214

A1 Analog input 1 X/Y/Z/T R ±2,047 0 - 1,023

SB1001/2/3 SB214

A2 Analog input 2 X/Y/Z/T R ±2,047 SB214PC3/4 A3 Analog input 3 X/Y/Z/T R ±2,047 SB214PC3/4 A4 Analog input 4 X/Y/Z/T R ±2,047 SB214PC3/4 A5 Analog input 5 X/Y/Z/T R ±2,047 SB214PC3/4 A6 A7 A8 D0 D0 analog output S/R ±127 EI Extended Input (32) R 0 - 4,294,967,295 SB1002/3 with

external I/O board HI HIgh output # S 1 – 16 IN INput port logic S/R 65,535 Binary IP Input Port R 65,535 Binary KB Keyboard Input R 0 - 4,294,967,295 SB1003 with

external I/O board LO LOw output # S 1 – 16 N1 extended iNput 1 R 0 - 65,355 SB1003 with

external I/O board N2 extended iNput 2 R 0 - 65,355 SB1003 with

external I/O board N3 extended iNput 3 R 0 - 65,355 SB1003 with

external I/O board N4 extended iNput 4 R 0 - 65,355 SB1003 with

external I/O board N5 N6 N7 N8 N9

Page 271: Acspl Software Guide Revision 3 00

7-10 REFERENCE

ACSPL Software Guide - Document revision no. 3.00

Sub Com.

Description Axis Group Range Remarks

NA NB NC O1 extended Output 1 S/R 0 - 65,355 SB1003 with

external I/O board O2 extended Output 2 S/R 0 - 65,355 SB1003 with

external I/O board OM Output Mask S/R 0 -65,535 Binary, bit

assignment OP Output Port S/R 0 -65,535 Binary, bit

assignment

7.1.9. Product-Dependent Parameter Properties The following table lists the parameters alphabetically (column 2) and product-dependent properties. See also the controller Hardware and Setup Guide and, if there are any, its Release Notes. A parameter can apply either per axis (referred to as axis parameter) or for the controller as a unit (referred to as system parameter). An example of an axis parameter is LV (XLV, YLV, etc.). An example of a system parameter is VV (i.e., there is just one VV to handle all the axes). These rules of applicability are maintained in single-axis controllers too for consistency. So X should be included for axis parameters even where there are no other axes. Note: A0 and A1 are axis parameters in some products and system parameters in other products (see table). Column 1 in the table indicates whether a parameter is an axis parameter or a system parameter. Key to table:

* Optional parameter (product dependent). ~ Obsolete parameter (exists only in older firmware versions). # Property is product-dependent.

Axis/ Sys.

Name Set/ Report

Default (if nonzero)

Range Notes

Axis _m * S/R ±1000000 Used in DCL1001, SB1001/2/3, SB1291/91ND/92, SB1191/2, SB1391/2, Unilite1/2.

Axis _h * S/R ±511 Used in DCL1001, SB1001/2/3, SB1291/91ND/92, SB1191/2, SB1391/2, Unilite1/2.

Page 272: Acspl Software Guide Revision 3 00

REFERENCE 7-11

ACSPL Software Guide - Document revision no. 3.00

Axis/ Sys.

Name Set/ Report

Default (if nonzero)

Range Notes

A

#

#

A0

A1

R

R

+/-2047 in Unilitex, SB11xx, SB12xx, SB13xx and SB1001/2/3.

0 . . .1023 in others.

Axis parameter in: SB1002/3, SB1291/91ND/92, SB1191/2, SB1391/2, Unilite1.

In all these products where A0 and A1 are per axis, joystick mode is controlled by $A0, and $DC.6 collects the value of $A0.

In multi-axis products where these parameters are system parameters, A0 controls joystick X (and is collected by XDC.6) and can also control axis Z; A1 controls joystick Y (and is collected by YDC.6) and can also control axis T.

Sys

A2 *

A3 *

A4 *

A5 *

R

R

R

R

+/-2047

All products other than ELGEMS, SB1291/91ND/92, SB1191/2, SB1391/2, Unilite1/2.

Sys

A6 *

A7 *

A8 *

R

R

R

+/-2047

Always 0 in SB1001, DCL1001.

Axis AF S/R 0...32767 New since firmware V19

Axis AK R 0...65535

Axis AL S/R 0...511

Sys AN R 0...65535

Axis ao S/R See AP New since firmware V19a; only in single axis products.

Axis AO S/R +/-2^31 Limited to +/-999999999 in firmware older than V19d.

Axis AP S/R +/-999999999

Axis AS R 0...511

Sys at S/R 0...10000

Axis AU S/R 511 0...511

Axis AV R +/-2^31 B

Sys BE S/R 255 0...255

Axis BG S/R 0,1

Page 273: Acspl Software Guide Revision 3 00

7-12 REFERENCE

ACSPL Software Guide - Document revision no. 3.00

Axis/ Sys.

Name Set/ Report

Default (if nonzero)

Range Notes

Axis BO S/R 0,1

Axis BP * S/R +/-999999999 MM8 removed from SB14.

Sys BR S/R 9600 0...57600 Baud rates above 9600 are standard only since V19a.

Axis BV * S/R 1000 See LV MM8 removed from SB14. C

Sys CA R +/-7200000

Axis C1 Cl/R 0...255

Axis CC S/R +/-999999999

Axis CG R +/-2^31

Axis CL S/R 100 0...100

Axis CM R 0...99

Axis CP R +/-2^31

1...3 SB1192, Unilite1/2.

1...7 SB1291/2, SB1391/2.

2...7 SB1291ND.

2 SB214PC2/PC3/PC4 (some firmware versions), SB1001/2/3.

Axis CU S/R #

2...6 SB214PC2/4 (some firmware versions), SB214SA.

D

Sys D0 S/R +/-127

Axis d1 * S/R 1 +/-32767 special display (modified SB1003 only).

Axis D1 R +/-511

Axis d2 * S/R 1 1...32767 special display (modified SB1003 only).

Axis D2 R +/-511

Axis d3 * S/R +/-32767 special display (modified SB1003 only).

Axis D4 S/R +/-511

+/-1900 SB1191/2, SB1291/2, SB1391/2.

+/-511 Unilite1/2, SB1291ND, SB214PC (some firmware versions), SB214SA.

Axis

DA

S/R

+/-590 SB214 series (including some SB214PC

firmware versions), SB1001/2/3.

Page 274: Acspl Software Guide Revision 3 00

REFERENCE 7-13

ACSPL Software Guide - Document revision no. 3.00

Axis/ Sys.

Name Set/ Report

Default (if nonzero)

Range Notes

Axis DC S/R 12 bit, mapped

Axis df * S/R 1 0...255 Special display (modified SB1003 only).

Axis dh * S/R 0...100 Special display (modified SB1003 only).

Sys DL S/R 0...1023

Axis dm * S/R +/-99999999 Special display (modified SB1003 only)

Axis

DO

R

+/-1638

+/-511

SB1191/2, SB1291/2, SB1391/2.

Unilite1/2, SB1291ND, SB214 series, SB1001/2/3.

Axis dp S/R +/-999999999

Axis DP R +/- 2^31

Axis dr * S/R 0...30000 Special display (modified SB1003 only).

Sys DS R 0...1023

Axis DT * S/R 0,1,4 DCL1001 only.

Sys DU S/R 1023 0...1023

Axis dv * S/R +/-999999999 Special display (modified SB1003 only). E

Axis E2 R +/-2^31

Axis EA S/R 127 10...32000

Axis EC S/R 1 1...32767

500 1...10000 SB1191/2, SB1291/2, SB1391/2, Unilite1/2.Axis

ED

S/R

2 1...10000 All other products.

Axis EF S/R 0...23

Axis EG S/R 0...2

Sys EI * R 32 bit Extended input (modified SB1003 only).

Axis EL S/R +/-999999999

Axis EM S/R 0...6

Axis ER S/R 127 10...32000

Axis ES R 0...1023

Axis Et S/R 3 0...3

Page 275: Acspl Software Guide Revision 3 00

7-14 REFERENCE

ACSPL Software Guide - Document revision no. 3.00

Axis/ Sys.

Name Set/ Report

Default (if nonzero)

Range Notes

Axis

ET

S/R

3

0-6, 100-106 All products except SB1292 (see below).

F

Axis FA S/R 9 bit, mapped

+/-1900 SB1191/2, SB1291/2, SB1391/2.

+/-511 Unilite1/2, SB1291ND, SB214 series 80MHz.

Axis

FC ~

S/R

+/-590 SB214 series 40MHz, SB1001/2/3.

Sys FE S/R 0...6

Sys FG R Flag Register. Used in SB214VME only.

Sys FL S/R 10 1...10

Sys FM S/R 0,1 Meaningful only in products with bus communication.

Axis FN S/R 0...255

Sys FR R (Flash Register).

Axis FS S/R 0...1024

Axis FT S/R 0#, 1# 0,1,2# Not used in SB214PC2/4 - some firmware versions, SB214SA, Unilite, SB1291, SB1292, SB1381, and SB1391.

G

Axis GA S/R 5, 1(NF) 0...4095 Different defaults for the group of products including SB214PC2/4 - some firmware versions, SB214SA, Unilite, SB1291, SB1292, SB1381, and SB1391 and the other products.

Axis GC R +/-2^31

Axis GD S/R 1 1...1000000

Axis GF S/R # -8...0

Axis GS S/R 2 2...72

Axis GO S/R +/-999999999 H

Axis HA R 0...5

Sys HI S 1...max. outputs See hardware guide for max # of outputs.

Page 276: Acspl Software Guide Revision 3 00

REFERENCE 7-15

ACSPL Software Guide - Document revision no. 3.00

Axis/ Sys.

Name Set/ Report

Default (if nonzero)

Range Notes

Sys HP S/R 6 bit, mapped

Sys HT S/R 1 0...2 I

Sys IC S/R 0...7

Sys ID S/R 0...25

Axis IF S/R 10 1...250

Sys IL S/R 0...65535

Sys IN S/R 0...65535

Sys IP R 0...65535

Axis IS S/R # 1...max inp but <= 16 See hardware guide for max # of outputs.

Axis IT Z/R 0...255 Index counTer.

Axis IX R +/-2^31

Sys KB R Keyboard input (meaningful in ELSCINT only).

1000-2*10^9 All products except for those listed below: Axis

KD

S/R

100000

1000-127*10^6 SB1001, DCL1001.

Axis KZ S/R 0...99 L

Axis la ~ S/R 100000 See LA Parabolic profile parameter; available only in firmware versions up to and including V17o.

1000-2*10^9 all products except for those listed below: Axis LA S/R 100000

1000-127*10^6 SB1001, DCL1001.

Axis ld ~ S/R 100000 See la Parabolic profile. Firmware V17o and older.

Axis LD S/R 100000 See LA

Axis LF S/R 0...10

Axis LI S/R 0...1023

Sys LO S See HI

Axis LR S/R 4000 500...32767

Sys LS S/R -1...265

Axis LT S/R 460 42...982 All products except for those listed below:

Page 277: Acspl Software Guide Revision 3 00

7-16 REFERENCE

ACSPL Software Guide - Document revision no. 3.00

Axis/ Sys.

Name Set/ Report

Default (if nonzero)

Range Notes

-80 -1883...1883 Unilitex, SB11xx, SB12xx, SB13xx, and SB1001/2/3.

+/-128000000 All products except for those listed below: Axis LV S/R 10000

+/-32000000 SB1001, DCL1001.

Axis LW S/R 0...30000 M

Axis M1 R +/-2^31

Axis M2 R +/-2^31

Axis MA S/R # 0...max axes

Axis MC Cl/R 0...65535

Axis MD S +/-128000000

Axis MF S/R -7...7

Axis MI R +/-2^31

Axis

MM

S/R

0-4, 8*, 9*, 10-12, 15, 16, 17*, 21, 22

MM8 and MM9 are not available in SB14.

MM17 is supported by only a special product (Exsight)with a FIFO board.

Axis MN S/R 0...4

Axis MO S/R 0,1

Axis MP R +/-2^31

Axis MR R +/-2^31

Axis MS R 0,1

1...65535 (units of 50ns) Unilitex, SB11xx, SB12xx and SB13xx, and SB214PC2/4 (some firmware versions).

Axis MT S/R 1

1...65535 (units of 100ns)

All other products.

Axis MV R +/-2^31

Axis MZ S See AP N

Sys

N1 *

N2 *

N3 *

N4 *

R

R

R

R

6...16 bit

6...16 bit

6...16 bit

6...16 bit

SB1291/91ND/92, SB1191/2, SB1391/2.

Axis NF R +/-2^31

Page 278: Acspl Software Guide Revision 3 00

REFERENCE 7-17

ACSPL Software Guide - Document revision no. 3.00

Axis/ Sys.

Name Set/ Report

Default (if nonzero)

Range Notes

Axis NP S/R 6 2...64

Axis NS S/R 0...1023 O

Sys

O1*

S/R

6...16 bit#

Meaningful only for SB1002/3.

Sys O2 * S/R 6...16 bit# Meaningful only for SB1002/3.

Sys OL S/R 0...65535

Sys OM S/R 0...65535

Sys OP S/R 0...65535 P

Axis P0 S/R 50 0...150

Axis P1 S/R 100 0...150

Axis P2 S/R 100 0...150

Axis P3 S/R 100 0...150

Axis P4 S/R 100 0...150

Axis PA S/R 0...255

Axis PE R +/-32767

10, 20 All products except those listed below:

20, 40 SB1191/2, SB1291/91ND/92, SB1391/2.

Axis PF S/R #

40 SB214PC2/4 (some firmware versions), SB14.

Axis PG S/R 1 9 bit, mapped

Axis PH S/R 128000000 See AP

Axis PI S/R +/-32767

Axis PL S/R 128000000 See AP

Sys PM S/R 0...65535

Axis PO S/R 2047

0...999 SB1001, DCL1001. Sys PP S/R 0

0...2730 All other products.

Axis PR S/R 0...8000000 Reserved.

Axis PT S/R 10 1...32000

Page 279: Acspl Software Guide Revision 3 00

7-18 REFERENCE

ACSPL Software Guide - Document revision no. 3.00

Axis/ Sys.

Name Set/ Report

Default (if nonzero)

Range Notes

200...60000 Unilitex, SB11xx, SB12xx and SB13xx, and SB214PC2/4 (some firmware versions).

Axis PW * S/R 10000

400...60000 All other products. Q

Axis QP S/R 0 0...9999

Axis qs R R

Sys RA S/R +/-7200000

Axis RD S/R +/-128000000

Axis RP S/R See AP

Axis RS * R 0...4095 Resolver reading. S

Axis SA S/R 4#, 20# 4, 5, 10, 20 Restricted to 20 in SB1001/2/3, DCL1001, and SB214PC2/4 (some firmware versions).

Sys SC R 4 bit, mapped

Axis SD * S/R See AP Not supported in SB14 (MM8, MM9 removed).

Axis SE * S/R # See IS Not supported in SB14 (MM8, MM9 removed).

Axis SF S/R 6 1...255

Sys sf S/R 0 0 . . 7 7-segment

Sys sd S/R 500 100 . . 1,000 7-segment

Sys SG R Status Register. Used in SB214VME only.

Axis SH * S/R 1 1...32000 Not supported in SB14 (MM9 removed).

Sys SI R 0...65535

Axis SK S/R 250 +/-16383

Axis SL S/R See AP

Sys SN R

Axis SO S/R 0...250

Axis SP * S/R See AP Not supported in SB14 (MM8, MM9 removed).

Axis SQ S/R 0,1

Axis SR S/R 256 256 Dummy (const).

Page 280: Acspl Software Guide Revision 3 00

REFERENCE 7-19

ACSPL Software Guide - Document revision no. 3.00

Axis/ Sys.

Name Set/ Report

Default (if nonzero)

Range Notes

Axis SS * R See AP Not supported in SB14 (MM8, MM9 removed).

Sys st S/R 0,1

Axis SV * S/R 1000 See LV Not supported in SB14 (MM8, MM9 removed).

T

Axis TA R 0...65535

Sys tb S/R 1 1,2

Axis TC S/R 1 +/-32767

Axis TD S/R 1 1...32000

Axis TE S/R 1000 1...32000

Axis TF S/R 0...65535

Axis TH ~ S/R always 0 In some products stays as placeholder

Sys ti S/R 1 1...32000

10...511 All products except for those listed below: Axis TL S/R #

10...1900 SB1191/2, SB1291/2, SB1391/2.

Sys TN R 0...65535

Axis TO S/R # See TL

Axis TR S/R 50 1...32000

Axis TS S/R 2 0...255 Till firmware V19b max value was 10.

Sys tt S/R 0...30000

Axis TV R +/-2^31 U

Axis UI S/R 1023 0...1023

Axis us R 0...100 QDSP usage (for qualified user).

Sys US R 0...100 MPU USage (for qualified user).

Axis UT S/R 563 42...982 V

Sys VA S/R 100000 See LA

Sys VD S/R 100000 See LA

Axis VE S/R 1 0...2

Axis VF S/R 0...32767

Page 281: Acspl Software Guide Revision 3 00

7-20 REFERENCE

ACSPL Software Guide - Document revision no. 3.00

Axis/ Sys.

Name Set/ Report

Default (if nonzero)

Range Notes

Sys VK S/R 100000 See LA

Axis VM ~ S/R See LV Parabolic profile (firmware v17o or older).

Sys VN S/R 0...40fcH Used in SB214VME only.

Axis VO S/R 5+ axis 0...16 or 8 Not supported in SB14 (MM8, MM9 removed).

Sys VR R

Sys VS S/R 6 0...255

Sys VV S/R 10000 See LV W

Axis WT S/R 0...65535

X

Axis XT S/R # 0...5# See hardware guide. Z

Axis ZE S/R # 4095

Axis ZP S See AP

Axis zp S See AP

Page 282: Acspl Software Guide Revision 3 00

REFERENCE 7-21

ACSPL Software Guide - Document revision no. 3.00

7.2. Set and Report Parameters Dictionary _h hall offset

Range ±511 Set (Direct mode) SX_h## Set (Program mode) let Y_h=##, Report (Direct mode) RX_h Report (Program mode) V#=X_h, disp T_h Holds the distance between the hall counter and the index location at the zero torque point in internal electrical angle units (units of internal sine table). Used for identification of the correct commutation of a AC synchronous (DC brushless) motor when encoder+hall (CU=3) are used.

_m index offset Range ±1,000,000 Set (Direct mode) SX_m## Set (Program mode) let Y_m=##, Report (Direct mode) RX_m Report (Program mode) V#=X_m, disp T_m Holds the distance offset between the index location and the zero torque point of the magnetic field. It is used for identification of the correct commutation of an AC synchronous (DC brushless) motor when encoder+hall (CU=3) are used.

A0 Analog input 0

Range 0 -1,023 (SB214xx); ±2,047 (SB1000) Report (Direct mode) RA0 (SB214xx); RXA0 (SB1000) Report (Program mode) V#=A0,till A0>#, disp A0 A0 represents the digital value of the analog input. The same input is also used for the joystick for X and Z axes. 0 represents 0V, 1,023 represents 4.99V. (SB214xx) -2,047 represents -10V, +2,047 represents 9.995. (SB1000)

A1 Analog input 1 Range 0 -1,023 (SB214xx); -2,048 - 2,047 (SB1000) Report (Direct mode) RA1 (SB214xx); RXA1 (SB1000) Report (Program mode) V#=A1,till A1>#, disp A1 A1 represents the digital value of the analog input 1. The same input is also used for the joystick for Y and T axes. 0 represents 0V, 1,023 represents 4.99V. (SB214xx) -2,047 represents -10V, +2,047 represents 9.995. (SB1000)

A2 Analog input 2 Range -2,048 - 2,047 Report (Direct mode) RA2 Report (Program mode) V#=A2,till A2>#, disp A2 A2 represents the digital value of the analog input 2. -2,048 represents -10V, +2,047 represents 9.995.

Page 283: Acspl Software Guide Revision 3 00

7-22 REFERENCE

ACSPL Software Guide - Document revision no. 3.00

A3 Analog input 3 Range -2,048 - 2,047 Report (Direct mode) RA3 Report (Program mode) V#=A3,till A3>#, disp A3 A3 represents the digital value of the analog input 3. -2,048 represents -10V, +2,047 represents 9.995.

A4 Analog input 4 Range -2,048 - 2,047 Report (Direct mode) RA4 Report (Program mode) V#=A4,till A4>#, disp A4 A4 represents the digital value of the analog input 4. -2,048 represents -10V, +2,047 represents 9.995.

A5 Analog input 5 Range -2,048 - 2,047 Report (Direct mode) RA5 Report (Program mode) V#=A5,till A5>#, disp A5 A5 represents the digital value of the analog input 5. -2,048 represents -10V, +2,047 represents 9.995.

AF Acceleration Feedforward (Servo only) Range 0 - 32767 as of firmware v19 Set (Direct mode) SXAF## SYAF## Set (Program mode) let XAF=##, let YAF=V# Report (Direct mode) RXAF Report (Program mode) V#=XAF, disp YAF The AF parameter adds an acceleration feedforward term to the output command. The value added is proportional to the instantaneous acceleration (in counts/msec²) command a(t), and is a(t)•AF AF has no effect during circular and continuous path modes. The following example demonstrates the improvement in the following error during acceleration, when AF is used. Set the acceleration and velocity to the maximum values that are anticipated in the application. Activate the motor in mode 1. Activate the program. The program measures the error during acceleration and displays it on the screen. Increase the value of XAF (SXAF##) by small increment (1, 2) and watch how the magnitude of the error is reduced. If the value of XAF is too large the error is impaired. Warning regarding older programs: The scaling of AF has changed starting with firmware versionV4.41m17a. Now, the high byte of AF represents the integer part and the low byte represents the fraction, so in programs that previously used non-zero AF values, AF must be multiplied by 256 to have the same effect.

XAF: I0=29 till X_MOTION=2 Waiting for acceleration period loop I0 V(I0)=XPE Data collection end I0=29 loop I0 disp V(I0) Display the results end wait 2000 goto XAF

Page 284: Acspl Software Guide Revision 3 00

REFERENCE 7-23

ACSPL Software Guide - Document revision no. 3.00

AK AcKnowledge number (for Begin/End messages)

Range 0 .. 65535 Report (Direct mode) R$AK Report (Program mode) V# = $AK, disp $AK AK is automatically incremented after receiving an acknowledge command from the host if the <Message no.> equals $AK and $AK <> $TA (acknowledge command was expected.) It is initialized to 0 upon power up and when changing HP.6 from 0 to 1. Used when HP.6 is set to 1. See Section 3.3.7.

AL Array Low index PEG Range 0 - 511 Set (Direct mode) SXAL## Set (Program mode) let YAL=##, Report (Direct mode) RXAL Report (Program mode) V#=XAL, disp YAL When the PEG function is in use, the active part of the data arrays are controlled by AL, and AU. Default - 0. See: PEG on page 5-18.

AN Acknowledge Number Range 0 - 65,535 Report (Direct mode) RAN Report (Program mode) V#=AN, disp AN AN is used when HP.4=1. Upon power up, AN is initialized to 0. Each time an ACSPL ‘disp’ command is acknowledged, the <Message#> equals AN and AN<>TN, AN is incremented by 1. Whenever the value of HP.4 is changed from 0 to 1, the content of AN is cleared to 0. See: Enhanced Host Protocol For Noisy Environment On Page 6-29

AO Array Offset Range Direct mode: ±(109-1) Program mode: ±(231-1) Set (Direct mode) SXAO## SYAO## Set (Program mode) let YAO=##, let XAO=V# Report (Direct mode) RXAO Report (Program mode) V#=XAO, disp YAO AO sets the reference point for the array of target points that is used in motion mode 3 & 16. It enables repeating of a pattern with a different reference location, without changing the content of the array points. TX(0)=10000, TX(1)=20000, XAO=0, XMM=3, XLI=0, XUI=1 Upon a BX command the motor moves to position 10000 and then to 20000. Now changing XAO to 33500, and sending a BX command, the motor will move to 43500 and 53500.

ao master Array Offset Range Direct mode: ±(109-1) Program mode: ±(231-1) Set (Direct mode) SXao## Set (Program mode) let Xao = #### Report (Direct mode) RXao Report (Program mode) V# = Xao ; disp Xao Applicable for single axis products only. Required in MM16, CAM mode, where separate array offsets are needed for slave and master, while both refer to the same axis X.

Page 285: Acspl Software Guide Revision 3 00

7-24 REFERENCE

ACSPL Software Guide - Document revision no. 3.00

AP next desired Absolute Position Range ±(109-1) Set (Direct mode) SXAP##, Set (Program mode) let YAP=##, let XAP= ##, Report (Direct mode) RXAP Report (Program mode) V#=XAP, disp YAP The AP parameter sets the target point for the next move. Note that the maximum distance per single move is limited to 128,000,000 counts. When AP is changed, RP (Relative Position) is also changed, to AP-DP. When a Begin motion command is issued, DP (present Desired Position) is set to AP. If the motor is already moving in a Point to Point motion, AP may be set for the next Target Position. A Begin command will cause motion calculation and the new motion will start immediately after the current motion is completed. Setting too many target points without executing them may cause ?16 when a new AP is set. In mode 10 (velocity) AP is changed automatically by the controller to ±999,999,999 when the Begin command is issued.

AS Array executed Step DC / PEG Range 0 - 1,023 Report (Direct mode) RXAS Report (Program mode) V#=XAS, disp YAS When either data collection or PEG function is in use, AS points to the current entry (index). See: PEG on page 5-18.

at acknowledge time Range 0 - 10,000 Set (Direct mode) Sat## Set (Program mode) let at=##, Report (Direct mode) Rat Report (Program mode) V#=at, disp at It is used when HP.4=1. Each time that a message is generated by an ACSPL disp statement, and at >0, a timer is activated. If an appropriate message acknowledge is not received within at milliseconds, the message is re-transmitted. Re- transmission of an un-acknoledged message does not affect other types of messages that may be produced during the re-transmission process. Once the timer is activated, the re-transmission will stop if: HP.4 is set to 0 at is set to 0 ACSPL is stopped for any reason. See: Enhanced Host Protocol For Noisy Environment on page 6-29

AU Array Upper index PEG Range 0 - 511 Set (Direct mode) SXAU## Set (Program mode) let XAU=##, Report (Direct mode) RYAU Report (Program mode) V#=XAU, disp YAU When the PEG function is in use, the active part of the data arrays is controlled by AL, and AU. Default - 511. See: PEG on page 5-18.

Page 286: Acspl Software Guide Revision 3 00

REFERENCE 7-25

ACSPL Software Guide - Document revision no. 3.00

AV Actual Velocity Report (Direct mode) RXAV RYAV Report (Program mode) V#=XAV,till YAV>#, disp XAV The AV represents the measured velocity in [counts/sec]. When a report AV command is issued, the controller measures the distance that the motor moves in 10 milliseconds and multiplies it by 100. Note: The accuracy of the Actual Velocity measurement is ±200 counts/sec.

BE Begin/End masking Range 0B .. 11111111B (0..255) Set (Direct mode) SBE<Binary number>B Set (Program mode) let BE=##, let BE=V# Report (Direct mode) RBE Report (Program mode) V#=BE, disp BE BE determines which axis' Begin/End message are to be sent to the host. When a bit is set, the appropriate message(s) will be sent. D7 | D6 | D5 | D4 | D3 | D2 | D1 | D0 | D0 - X's Begin message. D1 - X's End message. D2 - Y's Begin message. D3 - Y's End message. D4 - Z's Begin message. D5 - Z's End message. D6 - T's Begin message. D7 - T's End message.

BG Begin on Input/GO Range 0,1 Set (Direct mode) SXBG# Set (Program mode) let XBG=#, let YBG=V# Report (Direct mode) RZBG Report (Program mode) V#=XBG, disp TBG BG defines the trigger for executing the B$I command. When BG=0, the motion starts when the input which is designated by the $IS parameter is activated. When BG=1, the motion starts after a GO$ command is received via the serial link, or is generated by an ACSPL command (exec GO$)

BO Break Open Range 0, 1 Set (Direct mode) SXBO# Set (Program mode) let XBO=#, let YBO=V# Report (Direct mode) RXBO Report (Program mode) V#=XBO, disp YBO If a motor is disabled, its break can be released by setting BO to 1. It can be engaged by setting BO to 0. If BO is set when the motor is enabled, an operational error (15) is issued. If the motor is enabled while the break is released, an operational error (15) is issued. For SB1001/2/3 only.

Page 287: Acspl Software Guide Revision 3 00

7-26 REFERENCE

ACSPL Software Guide - Document revision no. 3.00

BP Begin Position Range ±999,999,999 Set (Direct mode) SXBP# Set (Program mode) let XBP=#, let YBP=V# Report (Direct mode) RZBP Report (Program mode) V#=ZBP, disp TBP MM8. When position=BP, the motor starts to accelerate from BV to LV. See MM8 on page 4-10

BR Baud Rate Range 300, 1200, 2400, 4800, 9600, 19200, 38400, 57600 Set (Direct mode) SBR### Report (Direct mode) RBR The serial communication Baud Rate is programmable via the BR parameter. The following rates are supported: 300, 1200, 2400, 4800, and 9600 (default), 19200, 38400, and 57600. When changed, BR must be SAVEd. The new baud rate will become effective only after the next power up (or HWRES). Factory default (after a RESET command) remains 9,600 bps. Since version 19f, if upon power up baud rate has some other value, it gets 9600. If any other value is attempted to be set via Set command, error 21 is reported and present value stays unchanged. SBR4800<cr> Setting BR to 4800 bps. SBR300<cr> Setting BR to 300. SBR 50<cr> Wrong value. BR=9600. communication error 21 is prompted.

BV Begin Velocity Range 0 - 128,000,000 Set (Direct mode) SXBV# Set (Program mode) let XBV=#, let YBV=V# Report (Direct mode) RXBV Report (Program mode) V#=ZBV, disp TBV MM8. At the beginning of the move the motor’s velocity is BV. See MM8 on page 4-10

CA Current Angle Report (Direct mode) RCA Report (Program mode) V#=CA, disp CA CA holds the actual (current) angle when executing circular interpolation.

CC Center Coordinate

Range ±109 -1 Set (Direct mode) SXCC## SYCC## Set (Program mode) let YCC=##, let XCC=V# Report (Direct mode) RXCC Report (Program mode) V#=XCC, disp YCC CC represents the X and Y center coordinates of an arc in circular modes 4, 15.

Page 288: Acspl Software Guide Revision 3 00

REFERENCE 7-27

ACSPL Software Guide - Document revision no. 3.00

CG Current position minus Grid correction Report (Direct mode) RXCG RYCG Report (Program mode) V#=XCG, disp YCG An error mapping parameter. It holds the difference between CP and GC (CG=CP-GC). See Error Mapping on page 5-1

CL Current Level Range 0 - 100 Set (Direct mode) SXCL### Set (Program mode) let XCL=## Report (Direct mode) RXCL Report (Program mode) V#=XCL, disp YCL Stepper: CL defines the maximum current per each phase of the step motor, as a percentage of the nominal current. If the specific drive unit is specified for maximum current Im, than the actual maximum current generated by the controller is Im•(CL/100)• (P#/100), where P# is the current setting for the different section of the velocity profile. See P0,P1,P2,P3,P4 . For example , if Im is 5A, and the motor is specified for maximum current of 3A/phase, set CL to 60%. Digital servo drives CL defines the maximum RMS current as a percentage of the nominal current of the drive. If the actual RMS value exceeds that level, the drive is disabled, and end error message 27 is generated. If the drive unit is specified for maximum current Im, then the actual maximum current generated by the controller is Im •CL/100. If Im is 5A and the motor is specified for maximum RMS current of 3A set CL to 60%. Controllers without drives When the square value of the (vector) current/torque command exceeds the corresponding value of CL, the motor is disabled, generating end error message 27. When CL=100% the current/torque command is limited to 512. (1 above the maximum DAC output which is 511). When CL=50% the current/torque command is limited to 256. The time constant of the current/torque command measurement is about 1 sec.

CM Current motion Mode Range 0 - 99 Report (Direct mode) RXCM RYCM Report (Direct mode) RXCM RYCM Report (Program mode) V#=XCM, disp YCM CM represents the mode of the current motion. Usually it is equal to MM (next Motion Mode). If the next Motion Mode is changed while the motor is moving, CM holds the current mode, and MM holds the next mode. For example, the motor moves in mode 0, and while moving the mode is changed to 10. The result of RXMM CM command (while moving in mode 0): next Motion Mode 10 Current motion Mode 0 When the motion ends, the result of the RXMM CM command: next Motion Mode 10 Current motion Mode 10

Page 289: Acspl Software Guide Revision 3 00

7-28 REFERENCE

ACSPL Software Guide - Document revision no. 3.00

CP Current Position Range ±2,147,483,647 Report (Direct mode) RXCP RYCP Report (Program mode) V#=XCP, disp YCP CP holds the instantaneous actual (current) position of the motor. In servo modules, CP always reflects the position as measured by the feedback device. In stepper, when verification encoder is not used, CP reflects the command. When verification encoder is used, it reflects the actual position as measured by the encoder, multiplied by the gear ratio. In Pulse/Direction, when verification is not used, CP reflects the number of actual pulses that were generated.

CU Commutation Usage Range 1, 2, 3 Set (Direct mode) SXCU## Set (Program mode) let XCU=## Report (Direct mode) RXCU Report (Program mode) V#=XCU, disp YCU CU defines the type of feedback device that is used for commutation of AC motors. CU=1- Resolver CU=2 - Encoder CU=3 - Encoder+Hall

CU bit 2 in dual loop products: CU.2=0 - regular commutation CU.2=1 - dual loop commutation

D0 Dac output 0 Range ±127 Set (Direct mode) SD0# Set (Program mode) let D0=# Report (Direct mode) RD0 Report (Program mode) V#=D0, disp D0 The multi purpose 8 bit DAC is controlled by D0. The analog output range is ±10V. (SB214xx only)

d1 display constant 1 modified SB1003 Range 32,768 .. 32,767 Set (Direct mode) SXd1## Set (Program mode) let Yd1=## Report (Direct mode) RXd1 Report (Program mode) V#=Yd1 See df parameter.

D1 Dac output 1 Range ±511 Report (Direct mode) RTD1 Report (Program mode) V#=XD1, disp ZD1 Each axis has two command signals to the drive - D1, D2. When the controller does the commutation (stepper or brushless DC; SB214xx only) both are used. D1 holds the instantaneous DAC output 1.

d2 display constant 2 modified SB1003 Range 1 .. 32,767 Set (Direct mode) SXd2## Set (Program mode) let Yd2=## Report (Direct mode) RXd2

Page 290: Acspl Software Guide Revision 3 00

REFERENCE 7-29

ACSPL Software Guide - Document revision no. 3.00

Report (Program mode) V#=Yd2 See df parameter.

D2 Dac output 2 modified SB1003 Range ±511 Report (Direct mode) RTD2 Report (Program mode) V#=XD2, disp ZD2 Each axis has two command signals to the drive - D1, D2. When the controller does the commutation (stepper or brushless DC; SB214xx only) both are used. D2 holds the instantaneous DAC output 2.

d3 display constant 3 modified SB1003 Range -32,768 .. 32,767 Set (Direct mode) SXd3## Set (Program mode) let Yd3=## Report (Direct mode) RXd3 Report (Program mode) V#=Yd3 See df parameter.

D4 D4 analog output Range ±511 Set (Direct mode) SXD4## Set (Program mode) let XD4=## Report (Direct mode) RXD4 Report (Program mode) V#= XD4, disp YD4 A multi purpose 10 bits D to A converter that is controlled by the D4 parameter. The analog output range is ±10V and is available at the A_OUT pin. The exact function of the A_OUT signal is defined by MN, DC and MF parameters.

DA DAc offset Range ±511(SB214xx) ±1,638 (SB1001/2/3) Set (Direct mode) SXDA## SYDA## Set (Program mode) let XDA=##, let YDA=V# Report (Direct mode) RXDA Report (Program mode) V#=YDA, disp XDA The DA parameter sets a bias to the output to correct for an offset in the analog portion of the servo loop. In the stepper controller the X and Y DAc offsets are used to compensate for offsets in the two phases of the step motor.

DC Data Collection mask Range 0 - 4,095 Set (Direct mode) SXDC## , SY<Binary number>B Set (Program mode) let YDC=## Report (Direct mode) RTDC Report (Program mode) V#=XDC, disp TDC See Data Collection on page 5-12

df display function modified SB1003

Range 0 - 255

Page 291: Acspl Software Guide Revision 3 00

7-30 REFERENCE

ACSPL Software Guide - Document revision no. 3.00

Set (Direct mode) SXdf## Set (Program mode) let Ydf=## Report (Direct mode) RZdf Report (Program mode) V#=Zdf df controls the function of the special display board for the SB1003. It is a binary parameter and can be set with don’t care indications. When $df & (00001111) = 0: The diplayed parameter is defined by the $DC parameter. If $DC.6=1, $A1 is displayed. If $DC=0, $d1=1, $d2=1 and $d3=0, the user can set the displayed value manually. When $df & (00001111) =1: The displayed parameter is derived from the target array T$(), according to the value of $A1: $dv <-- T$(i), where i=$LI+($A1+2048)*($UI-$LI)/4096 When $df.7=1: The displayed value is blibking. It will be turned on and off 4 times per second (4 Hz). Wen $df.6=1: The display unit is turned off. The display feature supports display of a transfer of a function: $dv = $dv x ($d1/$d2)+$d3 It supports hysteresis. $dh determines the minimum change in the display parmeter (before transformation) that will cause a change in the display. If the parameter value is out of range, the displayed value will be limited to the maximum, or minimum value that can be diplayed. The range is set by the Display Maximum ($dm). The display range is +/-$dm. When $dm=0, the range is defined.by the display device. The display update rate is programmable by the Display Rate ($dr) parameter. The units are 0.001 seconds. $dr must be set to a value that is a multiply of 20.

dh display hysteresis modified SB1003

Range 1 .. 100 Set (Direct mode) SXdh## Set (Program mode) let Ydh=## Report (Direct mode) RXdh Report (Program mode) V#=Ydh See df parameter.

DL Data collection Low index

Range 0 - 1,023 Set (Direct mode) SDL## Set (Program mode) let DL=## Report (Direct mode) RDL Report (Program mode) V#= DL, disp DL When the Data Collection function is activated, data are collected and stored in T$ arrays starting at entry DL up to entry DU. See Data Collection on page 5-12

dm display maximum modified SB1003 Range 0 .. 99,999,999 Set (Direct mode) SXdm## Set (Program mode) let Ydm=## Report (Direct mode) RXdm Report (Program mode) V#=Ydm See df parameter.

DO Dac Output

Page 292: Acspl Software Guide Revision 3 00

REFERENCE 7-31

ACSPL Software Guide - Document revision no. 3.00

Range ±511 (SB214xx) ±1,638 (SB1000)

Report (Direct mode) RXDO RYDO Report (Program mode) V#=XDO, disp YDO When using a driver with single line command, DO holds the instantaneous D to A converter output to the driver. When the controller also commutates the driver, than DO holds the current vector command. D1 and D2 hold the DAC outputs.

DP present Desired Position Range ±2,147,483,647 Report (Direct mode) RXDP RYDP Report (Program mode) V#=XDP, disp YDP DP holds the value of the present Desired Position. When a Begin command is issued, it is set to AP (next desired Absolute Position). In point to point move it contains the current target position.

dr display rate modified SB1003

Range 1 .. 30,000 Set (Direct mode) SXdr## Set (Program mode) let Ydr=## Report (Direct mode) RXdr Report (Program mode) V#=Ydr See df parameter. The display update rate is programmable by the Display Rate ($dr) parameter. The units are 0.001 seconds. $dr must be set to a value that is a multiply of 20. If it is set to a different value, the controller will set it to the closest lower value which is a multiply of 20, without any error message. For example, Sxdr19 will set Xdr to 0.

DS Data collection executed Step

Range 0 - 1.023 Report (Direct mode) RXDS Report (Program mode) V#=XDS, disp YDS When the Data Collection function is activated, DS points to the entry of T$ into which the current sampled data will be stored. See Data Collection on Page 5-12

DT Drive Type DCL only Range 0, 1, 4 Set (Direct mode) SXDT# Set (Program mode) let XDT=4 Report (Direct mode) RXDT Report (Program mode) disp XDT, V0=XDT XDT defines the type of driver (for DCL only). XDT=0 Torque mode. The generated torque (current) is directly related to the analog input level. XDT=1 Velocity mode. The generated velocity is directly related to the analog input level. XDT=4 Pulse/Dir following. For each pulse received via the secondary encoder input, the motor is

commanded to move 1 count.

Page 293: Acspl Software Guide Revision 3 00

7-32 REFERENCE

ACSPL Software Guide - Document revision no. 3.00

DU Data collection Upper index Range 0 - 1023 Set (Direct mode) SDU## Set (Program mode) let DU=## Report (Direct mode) RDU Report (Program mode) V#= DU, disp DU When the Data Collection function is activated, data are collected and stored in T$ arrays starting at entry DL up to entry DU. See Data Collection on page 5-12

dv display value modified SB1003 Range ±999,999,999 Set (Direct mode) SXdv## Set (Program mode) let Xdv=## Report (Direct mode) RXdv Report (Program mode) V#= Xdv, disp Ydv This is typically a report parameter. It contains the number that is to be displayed after the required transformation. Its value at startup is 0. For SB1003 only, requires a display board.

E2 2nd Encoder reading Range ±2,147,483,647 Report (Direct mode) RXE2 Report (Program mode) V#=YE2, disp XE2 E2 hold the instantaneous position of the secondary encoder. Its value can be changed by the S$zp<cr> command.

EA Error limit during Acceleration Range 10 - 32,000 Set (Direct mode) SXEA## SYEA## Set (Program mode) let XEA=##, let YEA=V# Report (Direct mode) RXEA Report (Program mode) V#=YEA, disp XEA EA specifies the maximum error that is allowed during acceleration. When the error during acceleration exceeds EA, the motor is automatically disabled and an error message 25 is generated. When ACS stepper is used, the parameter is effective only if verification encoder is enabled.

EC Verification Encoder Constant (Stepper only) Range 1 - 32,767 Set (Direct mode) SXEC### Set (Program mode) let XEC=## Report (Direct mode) RXEC Report (Program mode) V#=XEC, disp YEC It is used to define the conversion ratio of number of steps per one encoder count. The ratio is : EC/2EF.

ED Enable Delay time Range 1 - 10,000 Set (Direct mode) SXED### Set (Program mode) let XED=##, let YED=V## Report (Direct mode) RXED

Page 294: Acspl Software Guide Revision 3 00

REFERENCE 7-33

ACSPL Software Guide - Document revision no. 3.00

Report (Program mode) V#=XED, disp YED $ED specifies the required delay (milliseconds) after the motor is enabled. Within this period the FAULT feedback from the drive is ignored. In some drives, when enabled, there is a delay before the fault state becomes false. For example, if this delay is max 2 msec set $ED to 3. Factory default is: 2 The delay during automatic commutation setup is approximately 2 seconds regardless of the value of $ED.

EF verification Encoder Factor (Stepper only) Range 0 - 23 Set (Direct mode) SXEF## Set (Program mode) let XEF## Report (Direct mode) RXEF Report (Program mode) V#=XEF, disp YEF It is used to define the conversion ratio of number of steps per one encoder count. The ratio is : EC/2EF.

EG position Event Generator PEG Range 0 , 1, 2 Set (Direct mode) SXEG# Set (Program mode) let YEG=# Report (Direct mode) RXEG Report (Direct mode) (Program mode)

V#=XEG, disp YEG

EG defines the operation mode of PEG. 0 - Random mode, relative position. 1 - Random mode, absolute position. 2 - Incremental mode See PEG on page 5-18.

EI Extended Input (32) SB1002/3 only Range 0 - 4,294,967,295 Report (Direct mode) REI Report (Program mode) V#=EI, disp EI Requires an extended I/O board. For inputs 17 - 48. State variables IN17 - IN32 reflect the status of EI.0 - EI.15 State variables IN49 - IN64 reflect the status of EI.16 - EI.32

EL End Location PEG Range ±999,999,999 Set (Direct mode) SXEL## Set (Program mode) let XEL=##, let XEL=V# Report (Direct mode) RXEL Report (Program mode) V#=XEL, disp YEL When the PEG is activated in incremental mode, if $EL <> $SL, once the motor reaches the End Location, the PEG is disabled.

EM Error Mapping Range 0 - 6

Page 295: Acspl Software Guide Revision 3 00

7-34 REFERENCE

ACSPL Software Guide - Document revision no. 3.00

Set (Direct mode) SXEM## Set (Program mode) let YEM=## Report (Direct mode) RTEM Report (Program mode) V#=XEM, disp TEM EM enables the Error Mapping. EM is not saved in the non-volatile memory. After power-up, and RESET command, it is always 0. If needed, use AUTOEXEC routine to set it to 1. See Error Mapping on page 5-1 for a complete description of Error Mapping method of accuracy enhancement. To operate, the Error Mapping option must be installed. The controller prompts with an error code 10, if trying to set EM when the option is not installed.

ER ERror limit Range 10 - 32,000 Set (Direct mode) SXER## SYER## Set (Program mode) let YER=##, let XER=V# Report (Direct mode) RXER Report (Program mode) V#=YER, disp YER ERror limit specifies the maximum position error which is allowed, except during acceleration (then EA is used). When the error exceeds ER, the motor is automatically disabled and an error message is generated. During the initial set-up it is recommended to use a large ER value - in the same order of the distance to be moved - to prevent false error situations. Afterwards, while moving a large distance back and forth, using the maximum needed velocity and acceleration, it is recommended to reduce the ERror limit gradually till the motor traps on error. Then, increase the value by 100% . Such a value provides a good protective measure against any malfunction. By writing an automatic routine AUTO_ERR, the user has the option to execute whatever he finds necessary (in addition to disabling the motor), when a position error condition occurs. For example, the following AUTO_ERR routine will turn on and off output 4, till input 1 is set 'HIGH': AUTO_ERR:

L1:

let HI=4

wait 300

let LO=4

wait 300

if ^IN1 goto L1

ret

ES Executed Step Report (Direct mode) RXES , RYES Report (Program mode) V#=XES, disp YES ES points towards the currently executed step in the T$ array. It is active when motion mode 3 , or 16 is in use.

Page 296: Acspl Software Guide Revision 3 00

REFERENCE 7-35

ACSPL Software Guide - Document revision no. 3.00

ET Encoder Type Range 0 - 6 or 100 - 106 Set (Direct mode) SXET## SYET## Set (Program mode) let XET=##, let YET=V# Report (Direct mode) RXET Report (Program mode) V#=YET, disp XET The ET parameter defines the type of (encoder) feedback used, how the index is used when a quadrature encoder is used, and the maximum counting speed. The maximum counting speed can be one of two values for each range, depending on the clock (crystal) frequency of the controller's encoder circuitry. The maximum counting frequency is half the frequency of the clock. SB214ND, SB1001, SB1002/3, SB1091, and products other than those below:

When ET ∈ (0,6) the maximum counting speed is 10MHz. When ET ∈ (100,106) the maximum counting speed is 20MHz.

SB214PC2/4 - some firmware versions, SB214SA, Unilite, SB1291, SB1292, SB1381, and SB1391: When ET ∈ (0,6) the maximum counting speed is 20MHz. When ET ∈ (100,106) the maximum counting speed is 40MHz.

Type Description: 0,100 UpDn, I Up-Down type of input. The Index is independent on those signals.

This type of signals are produced by many laser interferometer feedback devices

1,101 Ct,Dr,I Count-Direction type of input. The Index is independent on those signals. This type should be used, for example, when using the output of a stepper indexer as the master input.

2,102 C0,C1,I Two adjacent bits of an up-down binary counter. The Index is independent on those signals This type should be used to interface a resolver to digital converter, or when an absolute encoder is in use

3,103 A•B,I Quadrature encoder type. The Index is independent on those signals. This is the factory default

4,104 !A•B•I Quadrature encoder type. The index is gated by !A and B 5,105 A•!B•I Quadrature encoder type. The index is gated by A and !B. 6,106 A•B•I Quadrature encoder type. The index is gated by A and B.

When using a master encoder, or an indexer, it should be connected to the Y encoder port, and the YET must be set accordingly

*Other *For special setup, consult factory. The ET parameter can be changed only when the axis is disabled.

When changing ET, execute a SAVE command, unless the change is a temporary one. SXET5<cr>

RXET<cr>

Encoder Type = A•!B•I

Page 297: Acspl Software Guide Revision 3 00

7-36 REFERENCE

ACSPL Software Guide - Document revision no. 3.00

Et 2’nd Encoder type Range 0,1,2,3 Set (Direct mode) SXEt## SYEt## Set (Program mode) let XEt=##, let YEt=V# Report (Direct mode) RXEt Report (Program mode) V#=YEt, disp XEt The Et parameter defines the type of secondary (encoder) feedback used and the gating made on the index line when a quadrature encoder is used. Type Description: 0 UpDn, I Up-Down type of input. The Index is independent on those signals.

This type of signals are produced by many laser interferometer feedback devices

1 Ct,Dr,I Count-Direction type of input. The Index is independent on those signals. This type should be used, for example, when using the output of a stepper indexer as the master input.

2 C0,C1,I Two adjacent bits of an up-down binary counter. The Index is independent on those signals This type should be used to interface a Resolver to Digital converter, or when an absolute encoder is in use

3 A•B,I Quadrature encoder type. The Index is independent on those signals. This is the factory default

.

When changing Et, execute a SAVE command, unless the change is a temporary one. SXEt3<cr>

RXEt<cr>

Encoder Type = A&B,I

FA Function Available Range 0 - 255 Set (Direct mode) SXFA0, SYFA<Binary number>B Set (Program mode) let ZFA=# Report (Direct mode) RZFA Report (Program mode) V#=XFA, disp YFA Bitmapped parameter. Defaults are 0. $FA.0 Determines if the master velocity, position, and master index position parameters are also

updated when not in master slave mode. When setting XMM to 12 $FA.0 is automatically set to 1.

$FA.0=0 they are not updated. $FA.0=1 they are updated. $FA.1 Determines the way the joystick operates. $FA.1=0 see: motion mode 21 on page 4-54. $FA.1=1 $FA.2 Determines the type of gear ratio used in motion mode 12. $FA.2=0 gear ratio is

2TF

TC

$FA.2=1 gear ratio is TFTC

$FA.3 Determines which encoder is used for position feedback control. (SB214PC4-3/4 only) $FA.3=0 main encoder ($CP). $FA.3=1 secondary encoder ($E2).

$FA.3 can be changed only when the $ motor is disabled. At startup the bit is set to zero. When using the secondary encoder for feedback control, a Zero Position operation can be used to the current main encoder. However, the zero position

Page 298: Acspl Software Guide Revision 3 00

REFERENCE 7-37

ACSPL Software Guide - Document revision no. 3.00

for the secondary encoder must not be used (S$zp). $FA.4 Determines which encoder is used as the master’s feedback (according to $MA).

(SB1002/3 only) $FA.4=0 secondary encoder ($E2). $FA.4=1 main encoder ($CP). $FA.5 Determines the axis behavior when a limit switch is activated. $FA.5=0 standard limit logic. The controller instructs the motor ‘where ever you are be

there ($DP ⇐ $CP) and prevents torque generation in the direction of the limit. It generates a viscous damping effect. As a result of offset the motor might drift out of the limit. If it drifts out of the limit, it will stop once the limit is exited.

$FA.5=1 internal handling of limit is disabled. The motion is not terminated. No torque will be generated in the direction of the limit. The automatic subroutines (AUTO_RL$, AUTO_LL$) are invoked. The user must take care of the situation by use of the automatic subroutines.

$FA.6 Additional new PEG handling mechanism. When using random mode ($EG=0,1), the event memory location can be programmed as follows:

$FA.6=0 event i is located at T$(i+512) $FA.6=1 event i is located at T$(i+$AU+1) $FA.8 $FA.8=1 Registration Mark move is made with acceleration/deceleration and not at

constant velocity, so as to perform the fastest move. This is effective at large Registration Distances. If you are interested in this feature, please consult the factory.

$FA.9 New master/slave functionality (MM12). When FA.9=1, the slave motor follows the predicted master position instead of the actual master position. This feature, however, increases the processor usage and the slave's sensibility to Master Velocity deviations. Consult the factory if in doubt about using this feature. See also MM12 description, page 4-15.

$FA.9=0 Activates this functionality. $FA.9=1 Factory default. (Slave follows actual master position, not predicted master

position.)

FC Field Current Range ±1,638 (SB1000); ±511 (SB214xx) Set (Direct mode) SXFC# Set (Program mode) let YFC=V0, let ZFC=150 Report (Direct mode) RTFC Report (Program mode) V0=XFC, disp YFC When controlling an AC induction motor (XT=5), it determines the level of the magnetic field current.

FE special Function Enable Range 0,1,2, 4, 6 Set (Direct mode) SFE# Set (Program mode) let FE=# Report (Direct mode) RFE Report (Program mode) V#=FE, disp FE

Page 299: Acspl Software Guide Revision 3 00

7-38 REFERENCE

ACSPL Software Guide - Document revision no. 3.00

FE is used to enable special functions. Currently two special functions are supported - real time data collection, and Position Event Generator (PEG). Parameter is bitmapped. FE.0 : Enable and activate data collection FE.1: Enable and activate X PEG. FE.2: Enable and activate Y PEG. FE.3: Enable and activate immediate transmission of collected data The valid combinations are: 0 - Disable all. 1 - Enable and activate data collection. 2 - Enable and activate X PEG. 4 - Enable and activate Y PEG. 6 - Enable and activate X & Y PEG. 8 - Enable and activate immediate transmission of data collected at the moment. 9 - Enable and activate data collection with immediate transmission. Note that PEG and Data Collection functions cannot be enabled at the same time. When the function is completed, the value of FE is automatically reset to zero.

The PEG function is an option that requires special hardware installation. When the option is not installed, the controller prompts with an error code 10, and the command is not executed.

FG Flags reGister SB214VME ONLY Report (Direct mode) RFG Report (Program mode) V#=FG, disp FG FG reflects the status of the FIFO Flag reGister. Bit 0 - (TFF) Transmit FIFO is full. Bit 1 - (TFE) Transmit FIFO is empty. Bit 2 - (RFF) Receive FIFO is full. Bit 3 - (RFE) Receive FIFO is empty.

FL Field Length Range 3 - 10 Set (Direct mode) SFL## Set (Program mode) let FL=## Report (Direct mode) RFL Report (Program mode) V#=FL, disp FL FL defines the field length of the numeric data (default =10). It should be used to adapt the response data length so that it fits the length of the display. Assuming: Group report 1 contains the X and Y Position Error. XPE = 1536, YPE = 356. The display length is 20 characters. FL = 5 RG1<cr> XPE: 1536 YPE: 356 Note: If the number of digits of the parameter value exceeds the Field Length, the display of data is corrupted.

Page 300: Acspl Software Guide Revision 3 00

REFERENCE 7-39

ACSPL Software Guide - Document revision no. 3.00

FM Function Mask Range 0,1 Set (Direct mode) SFM1 Set (Program mode) let FM=1 Report (Direct mode) RFM Report (Program mode) V#=FM, disp FM Even when the controller is set for bus communication, it scans the RS232 line periodically, so commands can be issued via the serial link. If the FM (Function Mapping) parameter is set to 0, the controller will transmit only through the serial link. This mechanism is a very useful debugging tool. If there is no communication between VME bus and the controller, send SFM0 command via the serial link and then communicate through it. Once the serial link is selected, the bus is inactive until FM is set to 1 through the serial link.

FN Friction Number (Servo only) Range 0 - 255 Set (Direct mode) SXFN## SYFN## Set (Program mode) let YFN=##, let XFN=V# Report (Direct mode) RXFN Report (Program mode) V#=YFN, disp YFN FN is effective only when $FT = 0. Note: FN was unavailable in some earlier firmware versions. The FN is used to overcome friction errors when working with velocity loop, and it is impossible to use the integrator to overcome the friction error. The function is implemented as follows: When PE<>0 add sign(PE)•FN•2GF to the DAC output.

FS array Free Segments Range 0 - 1024 Set (Direct mode) SXFS## SYFS## Set (Program mode) let YFS=##, let XFS=V# Report (Direct mode) RXFS Report (Program mode) V#=YFS, disp YFS $FS is used by the path generation with the new automatic cyclic buffering. It indicates how many new segments can be loaded into the cyclic buffer. For a multi-axis motion the FS of the lowest axis is used for all participating axes. It is initialized at start up to ($UI-$LI+1). When the automatic cyclic buffering is used ($PG.8=1), it is automatically incremented after execution of each segment in MM16 and decremented per each new segment that is received by the 'Next' command. If new segment data is loaded by using the A$SE command, then the user must update the value of $FS manually, before a 'Next' command is used. See also Section 5.12.1, page 5-41.

FT Filter Type Range 0, 1, 2 Set (Direct mode) SXFT# Set (Program mode) let XFT=0, let YFT=1 Report (Direct mode) RXFT Report (Program mode) V#=XFT, disp YFT

Page 301: Acspl Software Guide Revision 3 00

7-40 REFERENCE

ACSPL Software Guide - Document revision no. 3.00

When FT=0, a PID filter is used. (This is supported only to maintain compatibility with older controllers. It is unavailable for new controllers) When FT=1 (default), a PI with Velocity and Kalman filters is used. You must set $SA to 20. In SB1000, $FT is automatically set to 1. If $XT=5, $FT can not be set to 0. If $FT=0. $XT can not be set to 5. FT=2 is for PD stepper motors only. Allow $FT 2 when $XT = 2 and a delay is required between the new direction signal and the coming pulses; If $FT = 1, the signal is given by the DSP but its creation is managed by the MPU with some overhead. If $FT = 2, the direction signal is given through the STL MPU's signal. This option can be used pulse direction motors when unreasonable position errors occur during motion. Factory default is FT=1.

G# Group # Range 1 - 9 Report (Direct mode) RG1, RG9 Report (Program mode) If some parameters are interrogated frequently, it is a good idea to put them in one group by using the ‘G’ command and report them as a group. $CP and $PE are reported frequently. G8 CP PE <cr> put them in group No. 8 RG8 <cr> report the information for the current axes.

GA GAin (Servo only) Range 0 - 4,095 Set (Direct mode) SXGA## SYGA## Set (Program mode) let YGA=##, let XGA=V# Report RXGA Report (Program mode) V#=YGA, disp YGA

The GA parameter is the compensation GAin of the digital filter. The total gain is GA•2GF [1/256 - 4095].

GC Grid Correction Report (Direct mode) RXGC RYGC Report (Program mode) V#=XGC, disp YGC When the Error Mapping is enabled (EM is ON), a report request of GC yields the error correction needed for the target point. If a motion is developed towards a target, motion will actually be calculated and developed towards the point: (XAP + XGC, YAP+YGC) instead of (XAP, YAP). : Assuming that the error correction at each grid point is (10 , 10) and that the Grid Delta is 10,000 for both X and Y. SXAP5000 SYAP5000<cr> Set the target point. RXGC<cr> Report X grid correction. The controller's response: Grid Correction 5 The grid correction is calculated only upon a Begin command or due to a Report command. If XGC must be used in a program before the actual move, exec RXGC must be issued first.

GD Grid Delta Range 1 - 1,000,000 Set (Direct mode) SXGD## SYGD##

Page 302: Acspl Software Guide Revision 3 00

REFERENCE 7-41

ACSPL Software Guide - Document revision no. 3.00

Set (Program mode) let YGD=##, let XGD=V# Report RXGD Report (Program mode) V#=YGD, disp YGD The Grid Delta parameter determines the distance, in counts, between two adjacent points in the error grid map. It may be set differently for X and Y.

GF Gain Factor (Servo only) Range -8 - 0 Set (Direct mode) SXGF## SYGF## Set (Program mode) let XGF=##, let YGF=V# Report (Direct mode) RYGF Report (Program mode) V#=XGF, disp XGF

The GF parameter is the compensation Gain Factor of the digital filter. The total gain is GA•2GF [1/256 - 4095].

GO Grid Offset

Range ±(109-1) Set (Direct mode) SXGO## SYGO## Set (Program mode) let YGO=##, let XGO=V# Report (Direct mode) RXGO Report (Program mode) V#=YGO, disp YGO The Grid Offset specifies the origin of the error mapping relative to the XY origin.

GS Grid Size Range 2 - 72 Set (Direct mode) SXGS## Set (Program mode) let YGS=## Report (Direct mode) RXGS Report (Program mode) V#=XGS, disp YGS The range of GS for each axis is: X - 60 Y - 40 Z - 72 T - 72 GS sets the Grid Size, individually for each axis, for the error mapping. For XGS=10 and YGS=15, the error map consists of a 10x15 grid points.

HA HAll effect reading Range 0 - 5 Report (Direct mode) RXHA Report (Program mode) V#=XHA, disp XHA The Hall sensor (or equivalent device) is used for commutation right after power up when CU=3 (Encoder+Hall). HA reflects the status of the three Hall sensors after a simple transformation. The three Hall sensors must be connected in such a way that when the motor is rotated in the direction which the CP counts up (“positive”), HA should count 0,1,2,3,4,5,0,1,2,3,4.....If the order of counting is different, or HA shows also 6 or 7, it means that the Hall sensor is not connected properly.

HI set output HIgh Range 1 - 16 Set (Direct mode) SHI#

Page 303: Acspl Software Guide Revision 3 00

7-42 REFERENCE

ACSPL Software Guide - Document revision no. 3.00

Set (Program mode) let HI=#, let HI=V# The command turns on one output, the one specified in the data field. More than one output can be changed simultaneously by the set OP command.

HP Host Protocol Range 0 - 255 Set (Direct mode) SHP## , SHP<Binary number>B Set (Program mode) let HP=## Report (Direct mode) RHP Report (Program mode) V#=HP, disp HP HP.0=0 Checksum is not used in Terminal protocol (HT=1/2). Note that when HT=0, checksum is

always used. HP.0=1 Checksum is added to each message sent and received by the controller in Terminal

protocol (HT=1/2). HP.3=0 Messages are sent to the transmit FIFO as long as the FIFO is not full. HP.3=1 A new message is sent to the transmit FIFO only if the transmit FIFO is empty (meaning that

the host has already received the previous message). HP.4=0 Do not use Acknowledge mechanism for ACSPL displayed messages. HP.4=1 Use Acknowledge mechanism for ACSPL displayed messages. HP.6=0 Do not use Acknowledge mechanism for Begin/End messages. (see, 5.16.6) HP.6=1 Use Acknowledge mechanism for Begin/End messages (see 5.16.6). Note: If, upon Power Up, memory checksum failure is encountered, default (legible for human operator) communication protocol settings are forced: HT = 1(Terminal), HP = 0.

HT Host/Terminal communication protocol Range 0 - host, 1 - terminal, 2 - Hand-held terminal Set (Direct mode) SHT# or SHT Set (Program mode) let HT=#, let HT=V# Report (Direct mode) RHT Report (Program mode) V#=HT, disp HT HT = 0 Host communication protocol. HT = 1 Standard terminal protocol. HT = 2 Handheld terminal protocol. HT = 2 has the following effects: All parameter's report structure are condensed and include the parameter mnemonic and the numeric data. Examples: The response to RXCP<cr> command: XCP: 43433 The response to RG2<cr> (contains 3 parameters: GA,GF,ZE): XGA: 50 XGF: -2 XZE: 225 RIP<cr> (IN16 5 and 1 are on): 6543210987654321 1000000000010001 The upper line indicates the input number:16,15,14...2,1. ROP<cr> (Outputs 16, 10 and 3 are on): 6543210987654321 1000001000000100 T0<cr> (motor enabled, motion mode 10): X ena MM10 T1<cr>:

Page 304: Acspl Software Guide Revision 3 00

REFERENCE 7-43

ACSPL Software Guide - Document revision no. 3.00

BX1 T2<cr>: EX 26 T3<cr>: Prog not running Area Ok CS: E50F T9<cr>: Var.Grp.Ary.Prg. Ok Ok Ok Ok Memory CS: 1711 ACSPL disp statement does not force a new line at the end of the message. Two adjacent disp commands (even when separated by other ACSPL statements) will produce messages on the same line, next to each other. disp "" statement forces a new line and should be used when it is necessary to get the messages on two separate lines. Begin, End and Program messages ( IC>0 ) do not force a new line.

Note: If, upon Power Up, memory checksum failure is encountered, default (legible for human operator) communication protocol settings are forced: HT = 1(Terminal), HP = 0.

IC Initiate Communication Range 0 - 7 Set (Direct mode) SIC# Set (Program mode) let IC=#, let IC=V# Report (Direct mode) RIC Report (Program mode) V#=IC, disp IC The IC parameter provides means to send messages from the controller through the communication link on it's own initiative. Two kinds of messages may be sent by the controller: Motion execution messages (Begin, End), and Program messages. The Begin messages are explained under the description of T1 command. The End messages are explained under the description of T2 command. The ACSPL program messages are explained under the description of T4 command. When the IC parameter is set, it requires a data field which determines the initiative level. The 8 available levels are: 0 - none 1 - Begin 2 - End 3 - Begin & End 4 - Program 5 - Begin & Program 6 - End & Program 7 - Begin, End, Program

ID ID number Range 0 - 15 Set (Direct mode) SID## Report (Direct mode) RID Up to sixteen controllers can be chained via the serial link. The ID number of each unit must be set to a different number. Once the value of ID is changed, execute the SAVE command. The new ID number becomes effective after the next power up or HWRES command.

Page 305: Acspl Software Guide Revision 3 00

7-44 REFERENCE

ACSPL Software Guide - Document revision no. 3.00

IF time Interval Factor Range 1 - 250 Set (Direct mode) SXIF##, SYIF## Set (Program mode) let XIF=#, let YIF=V# Report (Direct mode) RXIF Report (Program mode) V#=XIF, disp YIF In arbitrary path generation (mode 16), using distance-time mode (DT=1), each individual time interval j is TX(512+j)•IF/10. Thus, it is possible to slow down the velocity of the path by a factor of up to 25, with a resolution of 10%.

IL Input Logic Range 0 - 8,191 Set (Direct mode) SIL#, SIL<Binary number>B Set (Program mode) let IL=#, let IL=V# Report (Direct mode) RIL Report (Program mode) V#=IL, disp IL The IL parameter controls the polarity logic of the safety inputs, see System Inputs, and has the same bit mapping (4-axis example): bit function 0 X Right Limit 1 X Left Limit 2 Y Right Limit 3 Y Left Limit 4 Z Right Limit 5 Z Left Limit 6 T Right Limit 7 T Left Limit 8 X drive fault feedback 9 Y drive fault feedback 10 Z drive fault feedback 11 T drive fault feedback 12 Emergency Stop Input *For other controllers (e.g., single-axis, dual-axis, etc.), the bitmap is different. 3-axes Controller Mapping bit 0 - Right Limit X, bit 1 - Left Limit X bit 2 - Right Limit Y, bit 3 - Left Limit Y bit 4 - Right Limit Z, bit 5 - Left Limit Z bit 6 - Drive X, bit 7 - Drive Y, bit 8 - Drive Z bit 9 - Emergency Stop 2-axes Controller Mapping bit 0 - Right Limit X, bit 1 - Left Limit X bit 2 - Right Limit Y, bit 3 - Left Limit Y bit 4 - Drive X, bit 5 - Drive Y bit 6 - Emergency Stop 1-axis Controller Mapping bit 0 - Right Limit X, bit 1 - Left Limit X bit 2 - Drive X bit 3 - Emergency Stop. An easy way to know the exact bitmap pattern is to perform a verbose report in terminal protocol. To alter Input Logic, both decimal and binary representation can be used. When using binary representation, the number must be followed by a B suffix. Example for 1-axis controller: To invert drive logic, issue a command SILX0XXB (X= don't change this bit, 0 - set this bit to 0).

Page 306: Acspl Software Guide Revision 3 00

REFERENCE 7-45

ACSPL Software Guide - Document revision no. 3.00

IN INput logic Range 0 - 65,535 Set (Direct mode) SIN#, SIN<Binary number>B Set (Program mode) let IN=#, let IN=V# Report (Direct mode) RIN Report (Program mode) V#=IN, disp IN The IN parameter controls the polarity logic of the general purpose inputs: Both decimal and binary representation can be used. When using binary representation, the number must be followed by a B suffix. The bit mapping of IN mirrors the bit mapping of IP.

IP Input Port Report (Direct mode) RIP Report (Program mode) V#=IP, disp IP In ACSPL, IP value is in the range of [0 - 65,535]. Input 1 is the least significant bit (bit 0 in binary representation), and input 16 is the 15'th bit. The response to ACSPL disp "Input=",IP statement, in the case that all the inputs are on: Input=65535 After a B$I (Begin on Input) command, in any motion mode, the $ motion starts when the appropriate input, as programmed by the IS parameter, is activated. In ACSPL, for each of the first 5 inputs, there is an automatic routine (AUTO_IN1 - AUTO_IN5) that is activated when a positive edge is detected on the specified input. For example, If a program labeled AUTO_IN3 has been compiled, it is automatically executed when Input 3 is changed from off to on.

IS Input Source Range 1 - 16 Set (Direct mode) SXIS# Set (Program mode) let YIS=#, let ZIS=V# Report (Direct mode) RXIS Report (Program mode) V#=YIS, disp ZIS IS controls which input will activate the motion in response to Begin on Input command. For example, to use input 1 for X axis - SXIS1<cr>. To use input 5 - SXIS5<cr>.

IX IndeX position Range ±2,147,183,647 Report (Direct mode) RXIX RYIX Report (Program mode) V#=ZIX, disp TIX IX holds the position of the index. The ACSPL index flag ($_INDEX) becomes false when reading the IX parameter. See Advanced Functions on page 5-1

KB KeyBoard input SB1002/3 only Range 0 - 4,294,967,295 Report (Direct mode) RKB Report (Program mode) V#=KB, disp KB Requires an extended I/O board. For inputs 49 - 80. State variables IN65 - IN80 reflect the status of KB.0 - KB.15 State variables IN33 - IN48 reflect the status of KB.16 - KB.31

Page 307: Acspl Software Guide Revision 3 00

7-46 REFERENCE

ACSPL Software Guide - Document revision no. 3.00

KD Kill Deceleration Range 1,000 - 2,000,000,000 Set (Direct mode) SXKD## SYKD## Set (Program mode) let XKD=##, let YKD=V# Report (Direct mode) RXKD Report (Program mode) V#=YKD, disp XKD The KD parameter sets the deceleration used for Kill command in non interpolated move.

KZ integration constant (Servo only) Range 0 - 99 Set (Direct mode) SXKZ## SYKZ## Set (Program mode) let XKZ=##, let YKZ=V# Report (Direct mode) RXKZ Report (Program mode) V#=XKZ, disp YKZ The KZ parameter controls the integration term of the digital filter. The higher the value, the higher the bandwidth of the integrator. A non-zero value minimizes the following error.

LA Linear Acceleration Range 1,000 - 2,000,000,000 Set (Direct mode) SXLA## SYLA## Set (Program mode) let XLA=##, let YLA=V# Report (Direct mode) RXLA Report (Program mode) V#=YLA, disp XLA The LA parameter sets the acceleration used by all types of non synchronized motions.

la lower acceleration Range 1000 - 127,000,000 Set (Direct mode) SXla## SYla## Set (Program mode) let Xla=##, let Yla=V# Report (Direct mode) RXla Report (Program mode) V#=Yla, disp Xla la defines the acceleration used when building a parabolic profile. See parabolic profile on page 4-4

LD Linear Deceleration Range 1000 - 2,000,000,000 Set (Direct mode) SXLD## SYLD## Set (Program mode) let XLD=##, let YLD=V# Report (Direct mode) RXLD Report (Program mode) V#=YLD, disp XLD The LD parameter sets the deceleration used by all types of non synchronized motions.

Page 308: Acspl Software Guide Revision 3 00

REFERENCE 7-47

ACSPL Software Guide - Document revision no. 3.00

ld lower deceleration Range 1000 - 127,000,000 Set (Direct mode) SXld## SYld## Set (Program mode) let Xld=##, let Yld=V# Report (Direct mode) RXld Report (Program mode) V#=Yld, disp Xld ld defines the deceleration used when building a parabolic profile. See parabolic profile on page 4-4

LF Lines Factor Range 0 - 10 Set (Direct mode) SXLF## Set (Program mode) let XLF=## Report (Direct mode) RXLF Report (Program mode) V#=XLF, disp YLF For commutation purposes, the exact number of feedback counts per one motor revolution must be defined. The number of counts per rev. is: LR•2LF Examples: • Using an encoder with 1000 lines, no external multiplier. The number of counts per rev. Is 4000.

LR=1000, LF=2. • Using an encoder with 500 lines, and an external multiplier of 5. The number of counts per rev. Is

10,000. LR=2500, LF=2. • Using an encoder with 500 lines, and an external multiplier of 16. The number of counts per rev. Is

32,000. LR=500, LF=6, or LR=8000 and LF=2. When using a resolver, the number of counts per rev. Is always 4096. LR=1024, LF=2. For proper operation the following condition must be met: 128 x NP < LR x 2LF otherwise an error ?15 will be generated upon motor enable command.

LI array Low Index Range 0 - 1023 Set (Direct mode) SXLI## SYLI## Set (Program mode) let XLI=##, let YLI=V# Report (Direct mode) RXLI Report (Program mode) V#=YLI, disp XLI The size of target points array is 1024. The activated portion of the array (mode 3, 15, 16) is controlled by the LI & UI parameters. For LI=5, UI=12 the motor steps through the points X(5)... X(12). For a common (interpolation) motion, the X axis LI and UI are used. Note the condition UI ≥ LI. Default - 0.

LO set output LOw Range 1 - 16 Set (Direct mode) SLO# Set (Program mode) let LO=#, let LO=V# The command turns off one output, the one specified in the data field. More than one output can be changed simultaneously, by the set OP command.

Page 309: Acspl Software Guide Revision 3 00

7-48 REFERENCE

ACSPL Software Guide - Document revision no. 3.00

LR Lines per Rev. Range 500 - 32,767 Set (Direct mode) SXLR## Set (Program mode) let XLR=## Report (Direct mode) RXLR Report (Program mode) V#=XLR, disp YLR For commutation purposes, the exact number of feedback counts per one motor revolution must be defined. The number of counts per rev. is: LR•2LF Examples: • Using an encoder with 1000 lines, no external multiplier. The number of counts per rev. Is 4000.

LR=1000, LF=2. • Using an encoder with 500 lines, and an external multiplier of 5. The number of counts per rev. Is

10,000. LR=2500, LF=2. • Using an encoder with 500 lines, and an external multiplier of 16. The number of counts per rev. Is

32,000. LR=500, LF=6, or LR=8000 and LF=2. When using a resolver, the number of counts per rev. Is always 4096. LR=1024, LF=2. For proper operation the following condition must be met: 128 x NP < LR x 2LF otherwise an error 15 will be generated upon motor enable command.

LS Last System error Range * Set (Direct mode) SXLS## SYLS## * Set (Program mode) let XLS=##, let YLS=V# Report (Direct mode) RXLS Report (Program mode) V#=YLS, disp XLS Whenever a system error is produced, LS is set to the error number and the ACSPL AUTO_SYS automatic routine may be invoked. Upon power up, LS is set to -1. See also description AUTO_SYS in Section 3.4.16, page 3-72 and list of LS error codes in Section 7.3.5, page 7–78. * The user may set its value to -1 only ('No error').

LT Lower Threshold Range 42 . . 982: (SB14, SB214xx, SB100x, and SB1091)

-1883 . . +1883: (Unilite, 1191, SB1291, SB1292, SB1381, and SB1391)

Set (Direct mode) SXLT## SYLT## Set (Program mode) let ZLT=##, let TLT=V# Report (Direct mode) RTLT Report (Program mode) V#=YLT, disp TLT LT sets the Lower Threshold of the dead band when using joystick. See Joystick mode on page 4-54.

LV Linear Velocity Range ±128,000,000 Set (Direct mode) SXLV## SYLV## Set (Program mode) let YLV=##, let XLV=V# Report (Direct mode) RXLV Report (Program mode) V#=YLV, disp YLV

Page 310: Acspl Software Guide Revision 3 00

REFERENCE 7-49

ACSPL Software Guide - Document revision no. 3.00

LV parameter sets the slew speed used while moving in point to point modes (0,1,2,3), jog mode (10), and the maximum joystick velocity (mode 21). A low value of LV provides the user with a very fine, high resolution, joystick control. The sign value is meaningful only in jogging mode (10).

LW Limit Wait time Range 0 .. 30000 Set (Direct mode) Set (Program mode) Report (Direct mode) Report (Program mode) LW controls the behavior of the axis when it hits a limit switch. If LW=0, then viscous damping is permanently active, assigning the desired position the value of the current position. This tells the axis "Wherever you are, stay there." If LW>0, then when the axis hits the limit switch, the viscous damping logic applies for the first LW milliseconds. Afterwards, the axis is held under position control, ignoring the limit status. It improves the behavior when limit is active in situations where external forces are present (gravity, offsets). Saved in the nonvolatile memory. Used when FA.5=0 (see page 7-36).

M1 registration Mark 1 position Report (Direct mode) RXM1 RYM1 Report (Program mode) V#=ZM1, disp TM1 M1 holds the position of the registration mark. Upon a positive edge (OFF to ON) on the registration input (X-6, Y-7, Z-9, T-10), the content of the encoder counter is recorded into M1.The ACSPL mark flag ($_MARK1) becomes false when reading M1.

MA MAster slave configuration Range 0 - 4 Set (Direct mode) SXMA## Set (Program mode) let XMA=## Report (Direct mode) RXMA Report (Program mode) V#=XMA, disp YMA MA selects which secondary axis acts as the master encoder. When MA=0 the master slave mode is not active. 1 - X 2 - Y 3 - Z 4 - T

MD Master-slave relative Distance Range ±128,000,000 Set (Direct mode) SXMD### Set (Program mode) let XMD=## In Master-Slave mode (12), it is used to specify to the slave a relative move while it is synchronized to the master. Setting MD initiates a super-imposed movement. No begin command is necessary. After a S$MD command, it must not be issued again until the present move is completed (as can be checked by monitoring the value of MR, or by checking the status of $_MD state). Otherwise an error message ?16 is generated.

MF Monitor Factor Range ±7

Page 311: Acspl Software Guide Revision 3 00

7-50 REFERENCE

ACSPL Software Guide - Document revision no. 3.00

Set (Direct mode) SXMF# Set (Program mode) let XMF=#, let YMF=V# Report (Direct mode) RXMF Report (Program mode) V#=ZMF, disp TMF The MF parameter sets the scale factor for the monitor signal (A_OUT pin of the I/O connector). The monitored variable is multiplied by 2MF and converted to an analog signal by a 8 bits DAC.

MI Master Index Report (Direct mode) RXMI Report (Program mode) V#=YMI, disp ZMI MI holds the position of the Master Index, in the units of the slave. The ACSPL index flag $_MINDX becomes false when reading the MI parameter.

MM Motion Mode Range 0 - 99 Set (Direct mode) SXMM## SYMM## Set (Program mode) let YMM=##, let XMM=V# Report (Direct mode) RXMM Report (Program mode) V#=XMM, disp YMM The following modes are currently supported: Mode 0 - Linear point to point. Mode 1 - Linear point to point repetitive. Mode 3 - Move by sequence. Mode 4 - Circular interpolation. Mode 8 - Multi velocity point to point. (Not available in SB14) Mode 9 - Search for contact. (Not available in SB14) Mode 10 - Jogging. Mode 12 - Master-Slave. Mode 15 - Continuous path following. Mode 16 - Arbitrary Path Generation. Mode 17 - Ultra-Fast Path Generation (special hardware requirement, see Section 5.16.1, on page 5-60). Mode 21 - Manual hand wheel - Joystick. Mode 22 - Position tracking.

MN motion MoNitor Range 0, 1, 2, 3 ,4 Set (Direct mode) SXMN# Set (Program mode) let YMN=# Report (Direct mode) RTMN Report (Program mode) disp XMN The $MN is used to assign the function of $ axis analog output. 0 -The analog output is controlled by $D4 parameter. 1 -The actual velocity is monitored. 2 -The acceleration is monitored. 3 - The monitored parameter is defined by the bit assignment of the $DC (Data Collection) parameter. 4 - Do not use. For testing purpose only. The MF parameter sets the scale factor for the monitored signal.

Page 312: Acspl Software Guide Revision 3 00

REFERENCE 7-51

ACSPL Software Guide - Document revision no. 3.00

MO MOtor enable Range 0 - disable, 1 - enable Set (Direct mode) SXMO# SYMO# Set (Program mode) let XMO=0, let YMO=1 Report (Direct mode) RXMO Report (Program mode) V#=XMO, disp YMO By assigning a value of 1 to MO, the motor is enabled. The following error messages may be issued after a motor enable command 12 The DSP does not function properly. 15 The motor is moving in a relatively high velocity during the enable process.

In SB1002/3 when the break is released ($BO=1). In SB1000 when this condition is not met: 128 x $NP < $LR x 2 $LF

90 The integrity of one of the following RAM areas is NOT OK: variables, program or DSP. 91 The integrity of the ROM area is NOT OK. In all these cases the motor remains disabled. E21, E22, E25, E26, E27, and E28 also cause motor disable. The motor is disabled by resetting MO to 0. Then, motion cannot be executed. Whenever a position error exceeds the ERror limit (ER), or the Error during Acceleration limit (EA), or Emergency Stop status is detected, the controller disables the motor by resetting MO to 0. The ACSPL state variable $_ENABLE reflects the value of the MO parameter: true when MO=1, false when MO=0. The enable process for an induction motor takes about 1 sec. This time is influenced by the Encoder Delay time ($ED) parameter.

MP Master Position Range ±2,147,183,647 Report (Direct mode) RXMP Report (Program mode) V#=XMP, disp XMP MP holds the instantaneous position of the master, scaled into the units of the slave.

MP = (Master encoder)•TC/2 TF or (master encoder) • TC/TF.

Upon start-up it is initialized to zero. MP ← DP upon a S$MZ command.

MR Master Relative position Range ±2,147,183,647 Report (Direct mode) RXMR Report (Program mode) V#=XMR, disp XMR In Master-Slave mode (12), MR=DP-MP. While in synchronization the value of MR is constant. It changes when the slave is not in synchronization, or when a MD move is super-imposed. At the end of a super-imposed move, the value of MR equals to the old value plus MD.

MS Master slave Sync. Range 0,1 Report (Direct mode) RTMS Report (Program mode) V#=XMS, disp YMS $MS is 1 when the slave is synchronized to the master. Otherwise $MS is zero.

MT peg Match Time period Range 1 - 65,535 Set (Direct mode) SXMT### Set (Program mode) let XMT=## Report (Direct mode) RXMT

Page 313: Acspl Software Guide Revision 3 00

7-52 REFERENCE

ACSPL Software Guide - Document revision no. 3.00

Report (Program mode) V#=XMT, disp XMT MT determines the width of the pulse that is generated whenever a position match happens. The pulse width is MT clock units. The clock unit depends on the controller model. In the Unilitex, SB11xx, SB12xx and SB13xx, and SB214PC2/4 (some firmware versions), the clock unit is 50•10-9 seconds. In other controller models, the clock unit is 100•10-9 seconds.

MV Master Velocity Range ±32,000,000 Report (Direct mode) RXMV Report (Program mode) V#=XMV, disp XMV MV holds the velocity of the master encoder in counts/sec.

MZ Master Zero position Set (Direct mode) SXMZ Set (Program mode) let XMZ=0 In Master-Slave mode (12) , the command 'SXMZ' zeroes MR. It is done by assigning the value of the instantaneous DP value to MP.

N1 extended iNput 1 SB1003 only Range 0 - 65,355 Report (Direct mode) RN1 Report (Program mode) V#=N1, disp N1 For inputs 17 - 32. Requires an Extended I/O board. State variables IN17 - IN32 reflect the status of N1.0 - N1.15 inputs.

N2 extended iNput 2 SB1003 Range 0 - 65,355 Report (Direct mode) RN2 Report (Program mode) V#=N2, disp N2 For inputs 65 - 80. Requires an Extended I/O board. State variables IN33 - IN48 reflect the status of N2.0 - N2.15 inputs.

N3 extended iNput 3 SB1003 Range 0 - 65,355 Report (Direct mode) RN1 Report (Program mode) V#=N3, disp N3 For inputs 33 - 48. Requires an Extended I/O board. State variables IN49 - IN64 reflect the status of N3.0 - N3.15 inputs.

N4 extended iNput 4 SB1003 Range 0 - 65,355 Report (Direct mode) RN4 Report (Program mode) V#=N4, disp N4 For inputs 49 - 64. Requires an Extended I/O board. State variables IN65 - IN80 reflect the status of N4.0 - N4.15 inputs.

Page 314: Acspl Software Guide Revision 3 00

REFERENCE 7-53

ACSPL Software Guide - Document revision no. 3.00

NF Next Full step (Stepper only) Range ±2,147,483,647 Report (Direct mode) RXNF Report (Program mode) V#=YNF, disp TNF Used in order to evaluate and to move towards the nearest full step position. The controller reports the absolute position of the nearest full step. Meaningful only when $XT=0.

NP Number of motor’s Poles Range 2 - 64 Set (Direct mode) SXNP## Set (Program mode) let XNP=##, let XNP=V# Report (Direct mode) RXNP Report (Program mode) V#=XNP, disp XNP NP is used by the commutation algorithm to define the relation between the mechanical orientation of the motor and the electrical orientation of the magnetic field. For proper operation the following condition must be met: 128 x NP < LR x 2LF otherwise an error 15 will be generated upon motor enable command.

NS array Next SegmentS Range 0 - 1023 Set (Direct mode) SXNS## Set (Program mode) let XNS=##, let XNS=V# Report (Direct mode) RXNS Report (Program mode) V#=XNS, disp XNS $NS indicates where in the array, new segment data is to be stored via the 'Next' command. $NS is automatically incremented when new data is received via a 'Next' command, as long as $FS>0. The array is used as a cyclic buffer. If $NS=J, new data is stored into entry J, and $NS is set to J+1. If $NS=$UI, new data is stored into entry $UI of the array and $NS is set to $LI. $NS must be set to a value in the range [$LI .. $UI]. If it is set to a value outside the range, error ?21 is produced and $NS is set to the nearest value inside the range. When the automatic cyclic buffering is used, the path generation starts with the segment that is pointed to by $NS and not by $LI. See also Section 5.12.1, page 5-41.

O1 extended Output 1 SB1003 Range 0 - 65,355 Set (Direct mode) SO1##, SO1<masked Binary number>B Set (Program mode) let O1=##, let O1=V# Report (Direct mode) RO1 Report (Program mode) V#=O1, disp O1 Requires an extended I/O board. Outputs 17 - 32

O2 extended Output 2 SB1003 Range 0 - 65,355 Set (Direct mode) SO2##, SO2<masked Binary number>B Set (Program mode) let O2=##, let O2=V# Report (Direct mode) RO2

Page 315: Acspl Software Guide Revision 3 00

7-54 REFERENCE

ACSPL Software Guide - Document revision no. 3.00

Report (Program mode) V#=O2, disp O2 Requires an extended I/O board. Outputs 33 - 48

OL enable Output Logic SB214 Range 0 - 15 Set (Direct mode) SOL##, SOL<masked Binary number>B Set (Program mode) let OL=## Report (Direct mode) ROL Report (Program mode) V#=OL OL.0 the least significant controls the polarity of the X enable signal. OL.1 controls the polarity of the Y enable signal. OL.2 controls the polarity of the Z enable signal. OL.3 controls the polarity of the T enable signal. OL.4 - OL.7 are not used. When the bit is set, the drive enable signal is inverted. (The MOTOR ON led will be off when the axis is enabled, and on when it is disabled).

OM Output Mask Range 0 - 65,535 Set (Direct mode) SOM#, SOM<Binary number>B Set (Program mode) let OM=#, let OM=V# Report (Direct mode) ROM Report (Program mode) V#=OM, disp OM The function of each output is controlled by the Output Mask Command (SOM). When the appropriate bit is set, that output port serves the dedicated function. When masked, outputs 1 to 16 can also be set and reset by the SHI, SLO, SOP Commands, and by the let HI, let LO, let OP commands in ACSPL program. (The dedicated function is described in the relevant HW and Setup Guide). The Output Mask can be set using decimal or binary numbers. If the data field length is 1 to 10 digits, the type of field must be specified. The default is decimal. If the field length is 11 to 16 digits, it is assumed that binary representation is used. To use outputs 1 and 2 for dedicated function: SOM3<cr> (3d =00000011b) or SOM11B<cr> To mask output 16: SOM32768<cr> or SOM1000000000000000<cr>

OP Output Port Range 0 - 65,535 Set (Direct mode) SOP#, SOP<masked Binary number>B Set (Program mode) let OP=#, let OP=V# Report (Direct mode) ROP Report (Program mode) V#=OP, disp OP OP holds (and sets) the status of the 16 outputs. The Output Port can be set using decimal or binary numbers. If the data field length is 1 to 10 digits, the type of field must be specified. The default is decimal. If the field length is 11 to 16 digits, it is assumed that binary representation is used. To set outputs 7 and 8 : SOP192<cr> or SOP11000000B<cr>

Page 316: Acspl Software Guide Revision 3 00

REFERENCE 7-55

ACSPL Software Guide - Document revision no. 3.00

To set output 16: SOP32768<cr> or SOP1000000000000000<cr>

Outputs masked by X character do not change their states. For example to change outputs 1(=1),3(=1) and 5 (=0) only by a single command: SOPXXXXXXXXXXX0X1X1B<cr>. This feature is not supported by ACSPL, unless used with the exec statement. In ACSPL, OP value is in the range of [0 - 65,535]. Output 1 is the least significant bit (bit 0 in binary representation), and output 16 is the most significant bit (bit 15). The response to ACSPL's disp "Output =",OP statement when all outputs are set: Output = 65535 Note that each output can be turned on and off also by HI and LO parameters. The Peg Mask (PM) parameter affects OP. When PM<>0 the appropriate output is taken directly from the PEG unit, and the setting of OP, LO or HI parameters have no effect on the actual output. However, reporting OP always reflects the actual status of the outputs. The Report Output port command in Terminal protocol (HT=1) gives details about which output is assigned to the PEG unit. Some outputs may serve some dedicated function. See page 5-32.

P0 idle current level (Stepper only) Range 0 - 150 Set (Direct mode) SXP0### Set (Program mode) let XP0=## Report (Direct mode) RXP0 Report (Program mode) V#=XP0, disp YP0 When the controller generates (commutates) directly the stepper phase currents, P0 defines the idle current per each phase of the step motor. If the specific drive unit is specified for maximum current Im, then the actual idle current generated by the controller is Im•CL•P0/10000. If Im is 5A, and the motor is specified for maximum current of 3A/phase, and idle current of 1.5A, set CL to 60% and P0 to 50%. Note that the maximum current is limited by the Im specification of the drive.

P1 jerk current (Stepper only) Range 0 - 150 Set (Direct mode) SXP1### Set (Program mode) let XP1=## Report (Direct mode) RXP1 Report (Program mode) V#=XP1, disp YP1 When the controller generates (commutates) directly the stepper phase currents, P1 defines the current per each phase of the step motor during the jerk portion of the velocity profile (jerk - building acceleration). If the specific drive unit is specified for maximum current Im, then the actual jerk current generated by the controller is Im•CL•P1/10000. If Im is 5A, and the motor is specified for maximum current of 3A/phase, and jerk current of 4.5A, set CL to 60% and P1 to 150%. Note that the maximum current is limited by the Im specification of the drive.

Page 317: Acspl Software Guide Revision 3 00

7-56 REFERENCE

ACSPL Software Guide - Document revision no. 3.00

P2 acceleration current (Stepper only) Range 0 - 150 Set (Direct mode) SXP2### Set (Program mode) let XP2=## Report (Direct mode) RXP2 Report (Program mode) V#=XP2, disp YP2 When the controller generates (commutates) directly the stepper phase currents, P2 defines the current per each phase of the step motor during the constant acceleration portion of the velocity profile. If the specific drive unit is specified for maximum current Im, then the actual acceleration current generated by the controller is Im•CL•P2/10000. If Im is 5A, and the motor is specified for maximum current of 3A/phase, and acceleration current of 4.5A, set CL to 60% and P2 to 150%. Note that the maximum current is limited by the Im specification of the drive.

P3 constant velocity current (Stepper only) Range 0 - 150 Set (Direct mode) SXP3### Set (Program mode) let XP3=## Report (Direct mode) RXP3 Report (Program mode) V#=XP3, disp YP3 When the controller generates (commutates) directly the stepper phase currents, P3 defines the current per each phase of the step motor during the constant velocity portion of the velocity profile. If the specific drive unit is specified for maximum current Im, then the actual acceleration current generated by the controller is Im•CL•P3/10000. If Im is 5A, and the motor is specified for maximum current of 3A/phase, and velocity current of 4.5A, set CL to 60% and P3 to 150%.

P4 deceleration current (Stepper only) Range 0 - 150 Set (Direct mode) SXP4### Set (Program mode) let XP4=## Report (Direct mode) RXP4 Report (Program mode) V#=XP4, disp YP4 When the controller generates (commutates) directly the stepper phase currents, P4 defines the current per each phase of the step motor during the deceleration portion of the velocity profile. If the specific drive unit is specified for maximum current Im, then the actual deceleration current generated by the controller is Im•CL•P4/10000. If Im is 5A, and the motor is specified for maximum current of 3A/phase, and deceleration current of 4.5A, set CL to 60% and P4 to 150%. Note that the maximum current is limited by the Im specification of the drive.

PA Phase Advance Range 0 - 255 Set (Direct mode) SXPA## Set (Program mode) let XPA=## Report (Direct mode) RXPA Report (Program mode) V#=XPA, disp YPA PA is used to improve the torque-speed characteristics at high speed, when the actual current through the motor lags the command.

Page 318: Acspl Software Guide Revision 3 00

REFERENCE 7-57

ACSPL Software Guide - Document revision no. 3.00

PE Position Error Range ±32,767 Report (Direct mode) RXPE ,RYPE Report (Program mode) V#=XPE, V#=YPE, disp XPE For servo: PE holds the instantaneous position error. When the motor does not move, it is equal to DP-CP (Desired Position - Current Position ). If the absolute value of PE is greater than ER (while acceleration is zero), or greater than EA (while acceleration is non zero), the motor is automatically disabled and an end error message 25 is generated. If an ACSPL's automatic routine named AUTO_ERR exists, it is executed. PE=0 when the axis is disabled. PE=0 when $GA=0. This provides the ability to execute commutation setup and servo tuning without changing the limit logic. For stepper: When VE=0 (No encoder feedback), PE ~ 0. When VE>0 (using encoder feedback), PE equals to the difference between the instantaneous desired position and the Current Position as measured by the encoder.

PF Pwm Frequency Range 10, 20 Set (Direct mode) SXPF# Set (Program mode) let YPF=10 Report (Direct mode) RZPF Report (Program mode) V0=XPF The frequency of the Pwm can be programmed to 10 or 20 kHz (SB1000, DCL only).

PG Path Generation mode Range 0 - 511 Set (Direct mode) SXPG### Set (Program mode) let XPG=## Report (Direct mode) RXPG (reported displayed in terminal: xxxx xxxx xxxx B) Report (Program mode) V#=XPG, disp YPG PG defines how the Path Generation (mode 16) operates. See MM16 on page 4-28

Bit BM EX SP CAM KL DT Cyc Abs PG = 8 7 6 5 4 3 2 1 0 Description

PH software Position limit High Range ±(109-1) Set (Direct mode) SXPH## Set (Program mode) let YPH=##, let XPH=V# Report (Direct mode) RXPH Report (Program mode) V#=XPH, disp YPH It is recommended to set the PH parameter to a small distance below the high (right) hardware limit. When executing a S$ZP command, it is the responsibility of the user to adjust ($PH). In any point to point mode, If a begin command is issued to a point beyond PH, the move is not executed and a begin error message 23 is generated. In joystick mode, if $PL ≠ $PH, the motor will not move beyond the software limits because the velocity is instantaneously reduced to zero. (If further user-defined steps are required in this case, use AUTO_SL$.) In all modes, when the limit is exceeded, AUTO_SL$ is activated. In all modes if upon the Begin command, $PL= $PH, the software limits are ignored.

Page 319: Acspl Software Guide Revision 3 00

7-58 REFERENCE

ACSPL Software Guide - Document revision no. 3.00

PI Position Interval Range ±32,767 Set (Direct mode) SXPI## SYPI## Set (Program mode) let XPI=##, let YPI=V# Report (Direct mode) RXPI Report (Program mode) V#=XPI, disp YPI PI serves two purposes: for velocity measurements and for position event generation. During velocity / smoothness measurement the controller measures how long it takes to move PI counts. When the PEG function is activated in incremental mode, a pulse is generated every PI counts.

PL software Position limit Low Range ±(109-1) Set (Direct mode) SXPL## SYPL## Set (Program mode) let YPL=##, let XPL=V# Report (Direct mode) RYPL Report (Program mode) V#=YPL, disp XPL It is recommended to set the PL parameter to a small distance below the low (left) hardware limit. When executing a S$ZP command, it is the responsibility of the user to adjust ($PL). In any point to point mode, If a begin command is issued to a point beyond PL, the move is not executed and a begin error message 23 is generated. In joystick mode, if $PL ≠ $PH, the motor will not move beyond the software limits because the velocity is instantaneously reduced to zero. (If further user-defined steps are required in this case, use AUTO_SL$.) In all modes, when the limit is exceeded, AUTO_SL$ is activated. In all modes if upon the Begin command, $PL= $PH, the software limits are ignored.

PM Peg Mask Range 0 - 65,535 Set (Direct mode) SPM## , SPM<Binary number>B Set (Program mode) let PM=##, let PM=V# Report (Direct mode) RPM Report (Program mode) V#=PM, disp PM PM controls which outputs are assigned to the PEG function. To assign outputs 1,2 and 8 set PM to 10000101B (=133D)

PO POle servo only Range ±2.047 Set (Direct mode) SXPO## SYPO## Set (Program mode) let YPL=##, let XPL=V# Report (Direct mode) RXPO Report (Program mode) V#=YPL, disp XPL The PO parameter is the compensation POle of the digital filter.

PP Program Protect line Range 0 - 2730 Set (Direct mode) SPP## Set (Program mode) exec SPP## Report (Direct mode) RPP

Page 320: Acspl Software Guide Revision 3 00

REFERENCE 7-59

ACSPL Software Guide - Document revision no. 3.00

Whenever PP>0, the Insert, Delete commands within lines 1 to PP are not permitted. Also RESET, CLEAR, and LOAD commands are prohibited. An error message 44 is generated whenever an illegal command is issued.

PT Path Time interval Range 1 - 32,000 milliseconds Set (Direct mode) SXPT## SYPT## Set (Program mode) let XPT=##, let YPT=V# Report (Direct mode) RXPT Report (Program mode) V#=XPT, disp YPT PT is used in Path Generation mode (16), to determine the time required to execute a segment. PT is used only when the DT bit in the XPG (YPG) parameter is 0. By increasing PT it is possible to slow down the velocity of the path.

PW Pulse Width Range 400 - 30,000 Set (Direct mode) SXPW## SYPW## Set (Program mode) let XPW=##, let YPW=V# Report (Direct mode) RXPW Report (Program mode) V#=XPW, disp YPW When controlling a step motor using Pulse/Dir mode, PW defines the pulse width in nano seconds.

QP Qdspl Protect line Range 0 - 9,999 Set (Direct mode) SXQP## Set (Program mode) exec SXQP## Report (Direct mode) RXQP Report (Program mode) When $QP>0 the real time control arrays D$, K$ cannot be changed. Also when executing a LOAD command, the servo processor program is not loaded.

RA Rotation Angle Range ±7,200,000 Set (Direct mode) SRA## Set (Program mode) let RA=##, let RA=V# Report (Direct mode) RRA Report (Program mode) V#=RA, disp RA RA parameter represents the rotation angle, in milli-degree units, of an arc in circular motion modes 4 (Positive value of RA - counter clockwise direction). If the necessary rotation (without a pause) is more than 20 full turns (RA=7,200,000), the continuous path mode should be used, with as many circular segments as necessary to cover the desired rotation. The maximum rotation using that method is 640 full turns (230,400 degrees).

Page 321: Acspl Software Guide Revision 3 00

7-60 REFERENCE

ACSPL Software Guide - Document revision no. 3.00

RD Registration mark Distance Range ±16,000,000 Set (Direct mode) SXRD### Set (Program mode) let YRD=## Report (Direct mode) RTRD Report (Program mode) V#=XRD, disp XRD RD holds the relative distance from the registration mark (M1) to be stopped when an MX (MY) command is issued.

RP Relative Position Range ±128,000,000 Set (Direct mode) SXRP## SYRP## Set (Program mode) let YRP=##, let XRP=V# Report (Direct mode) RXRP Report (Program mode) V#=XRP, disp YRP RP parameter represents the incremental distance and direction of the next move in modes 0, 22 and 10. When RP is changed, AP (next target Absolute Position) is changed to DP+RP (present Desired Position + Relative Position). When AP is changed, RP is changed to AP-DP. At the end of the motion, DP=AP, and RP=AP-DP=0. While running in constant velocity (MM10) the instantaneous position can be changed by setting $RP.

RS ReSolver reading Range 0 - 4,095 Report (Direct mode) RXRS Report (Program mode) V#=XRS, disp YRS The resolution of the Resolver to Digital converter (RDC) is 12 bits e.g. 4,096 counts per rev. RS holds the reading of the RDC. It reflects the absolute mechanical angle of the motor within 1 revolution. It is used for setup and testing purposes.

SA SAmpling rate Range 4, 5, 10, 20 Set (Direct mode) SXSA# Report (Direct mode) RYSA SA parameter sets the sampling rate of the servo loop. The units are kHz. It can be individually set for each axis.

SD Search Distance Range ±999,999,999 Set (Direct mode) SZSD## Set (Program mode) let ZSD=##, let ZSD=V# Report (Direct mode) RZSD Report (Program mode) V#=ZSD, disp ZSD SD specifies what is the maximum search distance in MM9. See Search for Contact on page 4-12.

sd Show Delay time Range 100 . . 1,000 Set (Direct mode) Set (Program mode)

Page 322: Acspl Software Guide Revision 3 00

REFERENCE 7-61

ACSPL Software Guide - Document revision no. 3.00

Report (Direct mode) Report (Program mode) This is a parameter for programming the 7-segment display (not available on all control products). sd defines the display time constant in milliseconds of each digit shown on the 7 segments unit. Factory default is 500. The parameter is SAVEd in the FEPROM. The delay between two consecutive messages is twice the Show Delay time but not less than 1 second. See Section 5.14.

SE SEnsor input source Range 1 .. 16 Set (Direct mode) SZSE## Set (Program mode) let ZSE=##, let ZSE=V# Report (Direct mode) RZSE Report (Program mode) V#=ZSE, disp ZSE SE controls which input is used as the contact (sensor) input by MM9 - Search for contact mode.

SF Smooth Factor Range 1 - 255 Set (Direct mode) SXSF## SYSF## Set (Program mode) let XSF=##, let YSF=V# Report (direct comm.) RTSF Report (Program mode) V#=XSF, disp YSF The Smooth Factor specifies the acceleration/deceleration build up time in milliseconds, when generating a motion profile. For example, if SF=5, the acceleration (and deceleration) is built within 5 msec. It is recommended to choose a Smooth Factor which is about four times the motor's electrical time constant. Choosing that value results in a smooth profile generation. A higher value results in a very smooth profile, but the price is a prolonged motion time. (When a Begin Common command is issued, the Vector Smooth factor (VS) is used).

sf Show Function Range 0 . . 7 Set (Direct mode) Set (Program mode) Report (Direct mode) Report (Program mode) This is a parameter for programming the 7-segment display (not available on all control products). sf contains a bit mask of the desired show function for the 7 segments unit. Factory default is 0; The parameter is SAVEd in the FEPROM. Possible values: 0 : The 7-segment unit is not used, display is blank. 1 (sf.0 ( 1) : The 7-segment unit is used to display internal error messages. 2 (sf.1 ( 1) : The 7-segment unit is used to show messages created by an ACSPL program using the show statement. A new message produced by the show function always overides a previous message. 3 (sf.0,1 ( 1) : Enable both mechanisms. See Section 5.14 for the order in which the messages are displayed Bit 2 of sf defines the criteria to clear the messages: If sf.2 = 0, any message is overridden only by another corresponding message. If sf.2 = 1, any error message is cleared by corresponding errorless action. See also Section 5.14.

Page 323: Acspl Software Guide Revision 3 00

7-62 REFERENCE

ACSPL Software Guide - Document revision no. 3.00

SG Status reGister SB214VME ONLY Range 0 - 1 Report (direct comm.) Report (Program mode) SG=1 when the controller’s receive buffer is full and the host computer must wait before it can issue more commands.

SH Sensor High time Range 1 - 32,000 Set (Direct mode) SZSH## Set (Program mode) let ZSH=##, let ZSH=V# Report (Direct mode) RZSH Report (Program mode) V#=ZSH, disp ZSH When using MM9 (search for sensor) the detection of a sensor is considered valid if the active state of that input does not change for SH milliseconds. It is used to debounce false contact activation. See Search for Contact on page 4-12.

SI System Input port Report (Direct mode) RSI Report (Program mode) V#=SI, disp SI SI holds the status of the system inputs to the controller. The bit mapping of SI varies from product to product (see also Input Logic, IL on page 7-44). To view the bit mapping for your product, issue the verbose report command (RSI) in terminal protocol (HT=1). Example of a response to RSI command with HT=1: ---System Input--- Right Limit Stop X = Off Left Limit Stop X = Off Right Limit Stop Y = Off Left Limit Stop Y = Off Right Limit Stop Z = Off Left Limit Stop Z = Off Right Limit Stop T = Off Left Limit Stop T = Off X Driver = On Y Driver = On Z Driver = On T Driver = On EMERGENCY STOP = Off When HT=2 : RSI<cr> (Driver is on, left limit is on): SI: ES DRVs LR--TZYX 0 0000 00000000 The polarity of the safety inputs can be changed via the Input Logic (IL) parameter.

SK Slip constant Range ±16,383 Set (Direct mode) SXSK## Set (Program mode) let XSK=##, let ZSK=V# Report (Direct mode) RXSK Report (Program mode) V#=XSK, disp YSK

Page 324: Acspl Software Guide Revision 3 00

REFERENCE 7-63

ACSPL Software Guide - Document revision no. 3.00

When controlling an AC induction motor (XT=5), it defines the relation between the torque command and the necessary slip frequency.

SL Start Location Range ±109-1 Set (Direct mode) SXSL## Set (Program mode) let XSL=## Report (Direct mode) RXSL Report (Program mode) V#=XSL, disp YSL The Start Location indicates the position at which velocity data collection starts, and where the Position Event Generator starts.

SN Serial Number Report (Direct mode) RSN SN holds the serial number of the module. It is programmed at the factory. Its length is 10 characters.

SO ShOrt time Range 0 .. 255 Set (Direct mode) SZSO## Set (Program mode) let ZSO=##, let ZSO=V# Report (Direct mode) RZSO Report (Program mode) V#=ZSO, disp ZSO When controlling a four phase stepper, SO is the time that the Settling output is on (shorting two phases once the move is completed). It is used to shorten the settling time of a four phase stepper motor.

SP Sensor Point Range ±999,999,999 Set (Direct mode) SZSP## Set (Program mode) let ZSP=##, let ZSP=V# Report (Direct mode) RZSP Report (Program mode) V#=ZSP, disp ZSP In MM9 (search for contact) the axis moves at LV velocity and reaches SP at SV velocity. See motion mode 9 on page 4-12.

SQ SeQuence type Range 0,1 Set (Direct mode) SXSQ# SYSQ# Set (Program mode) let XSQ=#, let YSQ=V# Report (Direct mode) RYSQ Report (Program mode) V#=XSQ, disp XSQ The SQ parameter controls the sequence of motions in modes 3, 16. SQ=0 Step through the array points, starting at point LI (Low Index), up to point UI (Upper Index). SQ=1 Step through the array points, starting at point UI (Upper Index) , down to point LI (Low Index).

SS Start Sensor position Range ±2,147,483,647 Report (Direct mode) RZSS Report (Program mode) V#=ZSS, disp ZSS

Page 325: Acspl Software Guide Revision 3 00

7-64 REFERENCE

ACSPL Software Guide - Document revision no. 3.00

SS records the position in which the sensor has been activated (in a valid way) for the first time.

st step mode Range 0 , 1

Set (Direct mode) let st=1 Sst# Report (Direct mode) Rst st controls the single step running mode of ACSPL program. When st=0, the complete program is executed. When st=1, only the specified line (implicit or explicit) is executed. Upon PX#, or PX<label> command, only line #, or the line following the <label> line is executed. More PX commands (without line number) result in execution of one line at a time. After the completion of a single line, a program message number 4 is generated.

SV Search Velocity Range 0 .. 128,000,000 counts Set (Direct mode) SZSV## Set (Program mode) let ZSV=##, let ZSV=V# Report (Direct mode) RZSV Report (Program mode) V#=ZSV, disp ZSV In MM9 (Search for contact) the sensor is searched using SV velocity. See Search for Contact on page 4-12.

TA TrAnsmission number Range 0 .. 65535 Report (Direct mode) R$TA Report (Program mode) V# = $TA, disp $TA TA is automatically incremented after acknowledgement of a Begin/End message, and a new Begin/End message is produced. TA is transmitted to the host as the <Message no.> field. Upon start up, $TA is initialized to 0. $TA is also initialized to 0 when HP.6 is changed from 0 to 1. Used when HP.6=1. See Section 6.17.2.

tb Time Base Range 1 .. 2 Set (Direct mode) Set (Program mode) Report (Direct mode) Report (Program mode) The parameter allows changing the 1ms time base to 2ms between interrupts. Choosing a value greater than 1, increases the controller throughput. Only the following units have been adjusted to work with Time Base different than one: $AV is still represented in counts/sec. TIME / TIMER1 / TIMER2 units remain milliseconds; 'wait n' ACSPL statement waits n milliseconds if n is divided by tb or it waits n+d milliseconds when d < tb and n+d is divided by tb. Any other velocity, acceleration or deceleration is used as if Time Base is 1 (i.e., needs scaling).

TC Tracking Constant Range ±32,767 Set (Direct mode) SXTC###

Page 326: Acspl Software Guide Revision 3 00

REFERENCE 7-65

ACSPL Software Guide - Document revision no. 3.00

Set (Program mode) let XTC=## Report (Direct mode) RXTC Report (Program mode) V#=XTC, disp YTC In Master/Slave mode (12), it is used to define the gear ratio between the master velocity (MV) and the slave tracking velocity (TV). A negative sign causes the slave to move in the opposite direction. TC can be changed on the fly, while moving, if $MR=0. The gear ratio can be defined using two methods. The method is defined by FA (bit2; see page 7-36).

(TC/2TF)•MV [FA(bit2)=0] or (TC/TF) •MV [FA(bit2)=1] To set the gear ratio to 1/65536, let TC=1, TF=16, FA=XXXXX0XXB To set the ratio to 1/3 (0.3333), let TC=1, TF=3, FA=XXXXX1XXB

TD Target Delay Range 1 - 32,000 Set (Direct mode) SXTD### Set (Program mode) let XTD=## Report (Direct mode) RXTD Report (Program mode) V#=YTD, disp XTD When a profile generation is being completed, in point to point motion mode, TD defines the time period (in milliseconds) in which the motor is allowed to move out of the target radius without any notice. If this time period has elapsed and the motor gets out of the target radius window for at least one millisecond AUTO_EX$ is invoked. In addition, independent of the motion mode, the maximum torque is limited to TL (Torque Low) instead of TO (TOrque limit). See Automatic routines on page 3-72

TE Tracking Error Range 1 - 32,000 Set (Direct mode) SXTE### Set (Program mode) let XTE=##, let YTE=V# Report (Direct mode) RXTE Report (Program mode) V#=XTE, disp XTE TE defines the maximum allowed position tracking error while not accelerating or decelerating. When the absolute value of PE is greater than TE, the automatic subroutine AUTO_TE$ is invoked. The axis is not disabled. See Automatic routines on page 3-72.

TF Tracking Factor Range 0 - 32,000 Set (Direct mode) SXTF### Set (Program mode) let XTF=## Report (Direct mode) RXTF Report (Program mode) V#=XTF, disp XTF In Master/Slave mode (12), it is used to define the gear ratio between the master velocity (MV) and the slave tracking velocity (TV). A negative sign causes the slave to move in the opposite direction. TC can be changed on the fly, while moving, if XMR=0. The gear ratio can be defined using two methods. The method is defined by FA (bit2: see page 7-36).

(TC/2TF)•MV [FA(bit2)=0] or (TC/TF) •MV [FA(bit2)=1] To set the gear ratio to 1/65536, let TC=1, TF=16, FA=XXXXX0XXB To set the ratio to 1/3 (0.3333), let TC=1, TF=3, FA=XXXXX1XXB

ti data collection time interval Range 1 - 32,000 Set (Direct mode) Sti##

Page 327: Acspl Software Guide Revision 3 00

7-66 REFERENCE

ACSPL Software Guide - Document revision no. 3.00

Set (Program mode) let ti=## Report (Direct mode) Rti Report (Program mode) V#=ti, disp ti TI determines the data collection sampling time in milliseconds. Every TI milliseconds, the assigned parameters are sampled and stored into TX, TY arrays. When velocity (XLV, YLV) is one of the sampled parameters, TI is not used. The one, or two parameters are sampled whenever the distance PI has been traveled.

TL Torque limit Low (Servo only) Range 10 - 511 for SB214xx, Unilite1, Unilite2

10 -1,638 for SB1001/2/3 Set (Direct mode) SXTL## SYTL## Set (Program mode) let XTL=##, let ZTL=V# Report (Direct mode) RYTL Report (Program mode) V#=YTL, disp XTL The TL parameter limits the maximum value of the output command when not moving. When moving, TO is used.

It is recommended to set TL to a value that is 20%-30% above the maximum torque disturbance anticipated when not moving. Thus, providing a protection against runaway if the feedback device fails, and motor protection if the axis is stacked. TD milliseconds after switching from moving to non-moving state, TL becomes effective. As soon as motion starts, TO becomes effective.

TN Transmission Number Range 0 - 65,535 Report (Direct mode) RTN Report (Program mode) V#=TN, disp TN Upon power up TN is initialized to 0. Each time that an ACSPL ‘disp’ statement is executed TN is incremented by 1. If HP.4=1, TN is transmitted to the host as the <Message#> field. Whenever the value of HP.4 is changed from 0 to 1, the content of TN is cleared to 0. See Enhanced Host Protocol for Noisy Environment on Page 6-29.

TO TOrque limit (Servo only) Range system dependent

10 - 511 for SB214xx 10 -1,638 for SB1xxx

Set (Direct mode) SXTO## SYTO## Set (Program mode) let XTO=##, let YTO=V# Report (Direct mode) RYTO Report (Program mode) V#=TTO, disp XTO The TO parameter limits the maximum value of the output command while moving. When not moving TL is used. A maximum allows for the full range (±10V).

Page 328: Acspl Software Guide Revision 3 00

REFERENCE 7-67

ACSPL Software Guide - Document revision no. 3.00

TR Target Radius Range 1 - 32,000 Set (Direct mode) SXTR## SYTR## Set (Program mode) let XTR=##, let YTR=V# Report (Direct mode) RYTR Report (Program mode) V#=YTR, disp XTR Servo When executing a motion, it is considered to be completed only after the motor has reached the specified location ± TR counts and the profile generation is complete. For example, assuming that the X motor is located at the origin ( CP=0), TR=10 and the next specified location is 1000. The motion is considered to be completed after the complete profile has been generated and the motor is located between 991 and 1009. Of course, the motor will keep on moving as close as possible to 1000. Stepper When VE is ON, and a motion is executed, once the profile generation is done, the controller starts an internal clock. After $TD milliseconds, the controller checks if Position Error ($PE) is smaller than the Target Radius ($TR). If not, the AUTO_EX$ automatic routine (if it exists) is activated. See Automatic routines on page 3-72.

TS Tracking Sync. range Range 0 - 255 since firmware V19 Set (Direct mode) SXTS### Set (Program mode) let XTS=## Report (Direct mode) RXTS Report (Program mode) V#=XTS, disp YTS In Master-Slave mode (12), it defines how close to the necessary Tracking Velocity the actual velocity of the slave (in counts/millisecond) should be , before the slave is synchronized to the master.

tt transmission time Range 0, 2 - 30,000 Set (Direct mode) Stt### Set (Program mode) let tt=##, let tt=V# Report (Direct mode) Rtt Report (Program mode) V#=tt, disp tt Each time a new character other than <cr> is received via the communication link, a timer is activated. If the value of the timer reaches tt before the next character is received, the whole message is flushed from the communication receive buffer. Once <cr> is received, the whole message is processed. If tt=0 this mechanism is not activated. Note that this mechanism is also effective in Terminal protocol. When BR=9600, tt must be set to 0 or to a value greater or equal to 2. When BR=4800, tt must be set to 0 or to a value greater or equal to 4. When BR=2400, tt must be set to 0 or to a value greater or equal to 8. When BR=300, tt must be set to 0 or to a value greater or equal to 64.

TV Tracking Velocity Report (Direct mode) RXTV Report (Program mode) V#=YTV, disp ZTV In master-slave mode (12) it defines the velocity in which the slave should track the master.

(TC/2TF)•MV (FA.2=0) (TC/TF) •MV (FA.2=1)

Page 329: Acspl Software Guide Revision 3 00

7-68 REFERENCE

ACSPL Software Guide - Document revision no. 3.00

UI array Upper Index Range 0 - 1023 Set (Direct mode) SXUI## SYUI## Set (Program mode) let YUI=##, let XUI=V# Report (Direct mode) RXUI Report (Program mode) V#=XUI, disp YUI The size of target points array is 1024. The activated portion of the array (mode 3, 15, 16) is controlled by the LI & UI parameters. For LI=5, UI=12 the motor steps through the points X(5)... X(12). For a common (interpolation) motion, the X axis LI and UI are used. Note the condition UI ≥ LI.

UT Upper Threshold Range 42 . . 982: (SB14, SB214xx, SB100x, and SB1091)

-1883 . . +1883: (Unilite, 1191, SB1291, SB1292, SB1381, and SB1391)

Set (Direct mode) SXUT## SYUT## Set (Program mode) let ZUT=##, let TUT=V# Report (Direct mode) RTUT Report (Program mode) V#=YUT, disp TUT UT sets the Upper Threshold of the dead band when using joystick. See Joystick Mode on page 4-54.

VA Vector Acceleration Range 1,000 - 2,000,000,000 since firmware V19 (for SB1001 1,000 -

127,000,000) Set (Direct mode) SVA## Set (Program mode) let VA=##, let VA=V# Report (Direct mode) RVA Report (Program mode) V#=VA, disp VA The VA parameter sets the vector acceleration used for all types of interpolated motions. The actual acceleration command for each axis is the instantaneous projection of the vector acceleration on the axis.

VD Vector Deceleration Range 1,000 - 2,000,000,000 Set (Direct mode) SVD## Set (Program mode) let VD=##, let VD=V# Report (Direct mode) RVD Report (Program mode) V#=VD, disp VD The VD parameter sets the vector deceleration used for all types of interpolated motions. The actual deceleration command for each axis is the instantaneous projection of the vector deceleration on the axis.

VE Verify Enable (Stepper only) Range 0, 1, 2 Set (Direct mode) SXVE# Set (Program mode) let YVE=#, let ZVE=V# Report (Direct mode) RXVE Report (Program mode) V#=XVE, disp YVE The verification encoder related features are activated by the use of $VE parameter

Page 330: Acspl Software Guide Revision 3 00

REFERENCE 7-69

ACSPL Software Guide - Document revision no. 3.00

$VE=0 No encoder feedback is used. The Current Position ($CP) is derived from the generated command, and the Position Error ($PE) is approximately zero. The velocity monitoring signal (available at the A_OUT pin) is derived from the generated profile

$VE=1 The verification function is activated. The Current Position ($CP) reflects the position of the encoder in steps/microsteps units as defined by the gear ratio. The velocity monitoring signal is derived from the encoder feedback. Upon setting the $VE value to 1, $CP gets the value of the present $DP (present Desired Position): $CP <-- $DP, and the Position Error ($PE) is therefore zero ($PE = $DP-$CP). $VE can be set to 1 only when the axis is not in motion.

$VE=2 Upon setting the $VE value to 2, $DP gets the (translated) value of the encoder position: $DP <-- $CP. Once the encoder is initialized correctly, it is tracking the actual position of the axis even if the motor lost synchronization. When the stepper loses synchronization, it is recommended to use $VE=2 in order to reset $DP to fit the location as measured by the encoder. $VE can be set to 2 only when the verification is already active and the axis is not in motion

Stall detection: Whenever $VE>0, and (|$PE| > $ER), and error message 25 is generated, the move is terminated, and either AUTO_ERR or AUTO_FLT, user defined programs, is activated X ERror limit = 5000 (one tenth of a rev.). If the Position Error (XPE) has exceeded 5000, the following program will be automatically activated: AUTO_ERR:

disp "Motor lost position"

ret

Position correction: When XVE>0, and a motion is executed, once the profile generation is done, the controller starts an internal clock. After XTD milliseconds, the controller checks if the Position Error (XPE) is smaller then the Target Radius (XTR). If not, the AUTO_EXX routine is activated. XTR=125, XTD=25, and the motor has been commanded to move to the origin by setting XAP=0. Assuming that at the end of the move XCP=300. The following routine is automatically executed, trying to correct the position: AUTO_EXX: exec KX terminate the hanging motion. let XVE=1 zero the error. exec BX Move the difference ret

Note that if the correction move happens to be insufficient, AUTO_EXX will be called again to correct the correction.

VK Vector Kill deceleration Range 1,000 -2,000,000,000 Set (Direct mode) SVK## Set (Program mode) let VK=##, let VK=V# Report (Direct mode) RVK Report (Program mode) V#=VK, disp VK The VK parameter sets the vector kill deceleration used for all types of interpolated motions when a kill command is issued. The actual deceleration command for each axis is the instantaneous projection of the vector deceleration on the axis.

Page 331: Acspl Software Guide Revision 3 00

7-70 REFERENCE

ACSPL Software Guide - Document revision no. 3.00

VM Velocity Minimal Range 0 - 32,000,000 Set (Direct mode) SXVM## SYVM## Set (Program mode) let XVM=##, let YVM=V# Report (Direct mode) RXVM Report (Program mode) V#=YVM, disp YVM The parameter VM in conjunction with the parameter SF can modify axis behavior in motion modes 0, 1 and 3. Normally, VM = 0. If specified VM > 0, a special velocity profile will be provided in the modes 0,1 and 3. The motion begins just from the velocity VM, gets acceleration up to velocity LV, then gets deceleration in order to reach the final point with the velocity VM (LV should be greater or equal to VM). The acceleration/deceleration profile is controlled by the parameters LA, la, LD, ld.

VN Vector Number SB214VME ONLY Range 0 - 32,767 Set (Direct mode) SVN## Set (Program mode) let VN=##, let VN=V# Report (Direct mode) RVN Report (Program mode) V#=VN, disp VN The VN parameter contains the IRQ level and the vector number information. It is a 16 bits number (VN15-VN0). VN1-VN0 - Forced to 0. VN7-VN2 - Vector number . Range [0 , 63] VN14-VN8 - IRQ level. Only one bit must be set. Set bit VN8 for level 1, set bit VN9 for level 2 and so on up to level 7 (VN14 is set). VN15 - Forced to 0. The Vector Number can be automatically changed according to the message type. The content of the appropriate i entry of the Q array is automatically loaded into VN before an interrupt is generated. The format of each Q element is identical to the format of VN. If a message is masked and is not generated, the content of VN will not be changed.

VO search Velocity Output Range 0 - (number of outputs) Set (Direct mode) SXVO## Set (Program mode) let XVO=## Report (Direct mode) RXVO Report (Program mode) V#=YVO disp XVO Used in MM9. If VO>0 and the appropriate bit in the Output Mask (OM) is set, and the appropriate bit in the Peg Mask (PM) is cleared, then the required output will be set when the motor starts to decelerate towards the sensor point. It is cleared when the motor reaches the Search Velocity. Note that there are only two outputs in SB1091, output1 and output8. See motion mode 9 on page 4-12.

VR software VeRsion Report (Direct mode) RVR VR holds the software version of the current release in use. For example, assuming version 4.41-16, the response to RVR command: software VeRsion = 4.41-16

VS Vector Smooth factor Range 1 - 255

Page 332: Acspl Software Guide Revision 3 00

REFERENCE 7-71

ACSPL Software Guide - Document revision no. 3.00

Set (Direct mode) SVS## Set (Program mode) let VS=## Report (Direct mode) RVS Report (Program mode) V#=VS, disp VS The Vector Smooth factor specifies the vector acceleration/deceleration build up time in milliseconds, when generating an interpolated motion profile. For example, if VS=5, the acceleration (and deceleration) is built within 5 msec. It is recommended to choose a VS value which is about four times the motor's electrical time constant. Choosing that value results in a smooth profile generation. A higher value results in a very smooth profile, but the price is a longer motion time.

VV Vector Velocity Range 1 - 128,000,000 Set (Direct mode) SVV## Set (Program mode) let VV=##, let VV=V# Report (Direct mode) RVV Report (Program mode) V#=VV, disp VV The VV parameter sets the Vector Velocity used for all types of interpolated motions. The actual velocity command for each axis is the instantaneous projection of the vector velocity on the axis.

WT Wait Time Range 0 - 65,535 Set (Direct mode) SXWT## SYWT## Set (Program mode) let XWT=##, let YWT=V# Report (Direct mode) RYWT Report (Program mode) V#=XWT, disp YWT When motion mode 1 or 3 is being used, motion execution is delayed for WT milliseconds. When a Begin motion command is issued for multiple axes, the max. ($WT) is used. (Note that ACSPL 'WAIT' statement has a different meaning: delay the next statement execution according to the 'WAIT' statement.)

XT aXis Type Range 0,1,2,3, 5 for SB214xx ,SB1002/3

3,5 for SB1001/1091 Set (Direct mode) SXXT## SYXT## Set (Program mode) let XXT=##, let ZXT=V# Report (Direct mode) RY XT Report (Program mode) V#=XXT, disp TXT The driving command signals are different for different types of motors/drivers combinations. XT=0 - Stepper control with current commutation - Two command signals per axis. XT=1 - Standard DC servo control. One command signal per axis. XT=2 - Stepper control. Pulse-Direction pair of signals per axis. Can be interfaced to standard stepper/micro-steppers drivers. XT=3 - Sinusoidal brushless control with current commutation. Two phase current commands per axis. Requires a driver that accepts two phase current commands and generates the third (and fourth) command on board. XT=5 - Sinusoidal commutation of a three phase AC induction motor.

Page 333: Acspl Software Guide Revision 3 00

7-72 REFERENCE

ACSPL Software Guide - Document revision no. 3.00

ZE ZEro (Servo only) Range 0 - 4,095 Set (Direct mode) SXZE## SYZE## Set (Program mode) let YZE=##, let XZE=V# Report (Direct mode) RXZE Report (Program mode) V#=XZE, disp YZE ZE parameter is the compensation zero of the digital filter.

ZP Zero Position Range ±(109-1) Set (Direct mode) SXZP## SYZP## Set (Program mode) let YZP=##, let XZP=V# Zero Position enables the user to change the frame of reference of the axis. The SXZP## command sets the motor Desired Position (DP) to the ## specified value. The difference between the old DP and the new DP value is added to CP, AP and RP. If a motor is moving in MM10 or MM12, the command may be issued while moving. Otherwise the motor must be stationary when this command is issued.

zp zero position of 2’nd encoder

Range ±(10 9 - 1) Set (Direct mode) SXzp## SYzp## Set (Program mode) let Yzp=##, let Xzp=V# zp sets the value of the secondary encoder ($E2) to the specified value.

Page 334: Acspl Software Guide Revision 3 00

REFERENCE 7–73

ACSPL Software Guide - Document revision no. 3.00

7.3. Errors

7.3.1. Begin Error Messages code comments

1 Motion has begun successfully. 9 The required motion is common and the other axis failed to move. 10 In Continuous Path mode, the length of the first segment is not

enough to enable the development of the desired vector velocity, using the specified vector acceleration. (The Continuous Path mode is not available in single axis controllers.)

11 In Continuous Path mode, the length of the last segment is not enough to enable the deceleration to zero velocity, using the specified acceleration.

12 In Master Slave mode (mode 12) the required master is not defined ($MA=0). In Path Generation mode (mode 16) when CAM option is used and the master axis is not defined. In Continuous Path mode (mode 15) when Lower Index is greater than Upper Index (LI>UI).

14 In Arbitrary Path generation {DT=1 & LI>512 or DT=1 & [0 => TX(512+LI) or TX(512+LI) > 32000]} For a single axis controller, in Arbitrary Path mode with the CAM option when XUI>511.

19 The combination of the motion parameters does not enable the creation of the desired profile in Multiple Velocities mode (mode 9) or Search mode (mode 8). (See Search for Contact on page 4-12)

20 The motor is in a disable state. 21 The required motion mode is not valid. 22 Either the required motion is common, but the two axes are not in

the same motion mode, or common (interpolation) motion is not allowed.

23 The required target is out of the permitted range. The target is not in the range: [Position Low - Position High].

24 The controller could not calculate the motion with the existing parameters (Target, Velocity and/or Acceleration, too small/ large radius etc.).

25 The motion mode is common, but the Begin command has been issued for one axis (BX or BY instead of BXY).

90 Memory failure in the data area has been detected. In order to enable motion a 'T7' command must be issued. It is recommended to issue a RESET.

91 Memory failure in the code area (firmware) has been detected. The firmware must be replaced!.

Page 335: Acspl Software Guide Revision 3 00

7–74 REFERENCE

ACSPL Software Guide - Document revision no. 3.00

7.3.2. End Error Messages code comments

1 Motion was successfully completed. 2 Motion was 'killed' by the user. 9 Motor was automatically stopped while running in common motion

and another motor failed to complete the motion. 12 Motor was automatically disabled because the servo processor that

controls the axis does not function. 14 Motion failed to continue. The reason: In arbitrary path mode, {DT=1

& ES > 512 or DT=1 & [TX(512+ES)<=0 or > 32000]}. KL determines the nature of stopping. (See Arbitrary Path Generation on page 4-28)

19 Sensor was not detected within the required range. See Search for Contact on page 4-12)

20 Motor was disabled by the user while running. 21 Motor was automatically disabled because of encoder error.

The encoder is either not connected or the encoder’s lines are noisy.22 Motor was automatically disabled due to an emergency stop signal. 23 Motor was automatically stopped while running into its left limit. 24 Motor was automatically stopped while running into its right limit. 25 Motor was automatically disabled when Error Limit (ER), or Error

during Acceleration (EA) is exceeded. 26 Motor was automatically disabled as a result of fault feedback

indication from the driver (short current or over heat). 27 Motor was automatically disabled because of over current. The

actual rms current exceeds the value specified by the Current Limit parameter (CL).

28 Motor was automatically disabled because of over current. The instantaneous current in one of the phases exceeds the nominal peak value by more than 20%.

7.3.3. Program Errors and Messages The programming error messages have three forms: 1. <ID>?##<cr> or 2. P?##<cr> or 3. I?##<cr> Where the <ID> is the controller's ID, and the ## is the error's code number. The first form of error message may appear when programming in Direct mode or if the error is detected while the program is running. The second and third forms may appear within the line editor.

Code Type Comments

1 Message Program finished successfully. 2 Message Automatic routine finished successfully.

Page 336: Acspl Software Guide Revision 3 00

REFERENCE 7–75

ACSPL Software Guide - Document revision no. 3.00

Code Type Comments 3 Message Program is paused by user. 4 Message Program is in step mode. 7 Message Program was stopped by user. 8 Operational error After a stop command: The program was

not running. 40 Edit error Command is not available under Host

protocol. 41 Edit error Command can't be executed while a

program is running. 42 Edit error Illegal range was specified. 43 Edit error Unrecognized edit command. 44 Operational error An attempt is made to delete or overwrite a

protected program statement (PP>0). 50 Insert error Unrecognized command. 51 Insert error Unrecognized set variable. 52 Insert error Unrecognized state. 53 Insert error Unrecognized variable. 54 Insert error Unrecognized index. 55 Insert error Unrecognized address variable. 56 Insert error Unrecognized array element. 57 Insert error Unrecognized relation. 58 Insert error Unrecognized operation. 59 Insert error Missing an equal sign. 60 Insert error Missing a label. 61 Insert error The label name is too large. 62 Insert error Illegal label name. 63 Insert error The label is already exists. 64 Insert error The specified index is not available. 65 Insert error Too many free constants. 66 Insert error Illegal constant. 67 Insert error Program is too large. 68 Insert error Statement is too large. 69 Insert error Illegal statement. 70 Compile error Loop without end. 71 Compile error END without reason. 72 Compile error A label was not found. 73 Compile error Loop nesting is too deep. 74 Compile error Missing END statement. 75 Compile error IF nesting too deep. 76 Compile error Else statement without reason 77 Compile error CASE nesting is too deep. 78 Compile error CASE already exists or case statement is

missing. 80 Internal error Unrecognized command was referenced. 81 Internal error Unrecognized data was referenced. 82 Internal error Illegal data location was referenced. 83 Run-time error Program is not compiled yet. 84 Run-time error Zero divide.

Page 337: Acspl Software Guide Revision 3 00

7–76 REFERENCE

ACSPL Software Guide - Document revision no. 3.00

Code Type Comments 85 Run-time error The specified start location is not found. 86 Run-time error Illegal variable reference. 87 Run-time error Ran into 'ret' statement without 'call'. 88 Run-time error Out of program. 89 Run-time error Call nesting is too deep. 90 Run-time error A check sum error is detected in the

program area. 91 Run-time error Executed END without reason. 92 Run-time error Executed loop nesting is too deep. 93 Run-time error Executing a square root of a negative

number. 94 Run-time error Executed case nesting is too deep.

7.3.4. General Errors Code Type Comments

0 Fatal A check-sum error was detected in the received command (only in host communication), or an empty command was received. In such case, no interpretation takes place.

1 Fatal Command (or subcommand) was not executed. The reason: An unrecognized subcommand.

3 Fatal SAVE (to EEPROM) operation has failed. 4 Fatal When an overflow condition is detected in one of

the characters of the received message. If no such error is detected, the message is checked for correct checksum, if so required by the active protocol.

5 Fatal When a frame error is detected in one of the characters of the received message. If no such error is detected, the message is checked for correct checksum, if so required by the active protocol.

10 Fatal Command was not executed. The reason: Optional feature. Requires special hardware.

12 Fatal The servo processor does not communicate with the main processor.

Page 338: Acspl Software Guide Revision 3 00

REFERENCE 7–77

ACSPL Software Guide - Document revision no. 3.00

Code Type Comments 15 Fatal Operation failed.

Error 15 reasons 1. Trying to enable the motor while the break is on. 2. Trying to activate the break while the motor is

enabled. 3. Trying to enable the motor while it is moving

relatively fast. 4. Trying to enable the motor when $XT=3, 5 and

$CU=0, or $LR, $LF are not well defined. 5. Trying to execute a registration move and it fails. 6. Setting $VE to 1,2 when the motor is moving or

is waiting for an input after a B$I comand. 7. Trying to change one of the following parameters

while the motor is enabled: $ET, $MA, $SA, $FA.3, $FA.4, $PW, $NP, $LR, $LF, $CU, $XT.

8. Trying to enable the PEG and Data Collection simultaneously (by setting FE to 3 for example).

9. Trying to execute a LOAD (from non volatile memory) command while one of the motors is enabled.

10. Trying to activate the PEG in random mode and AU > 511.

11. Trying to execute $ZP while: - The motor is moving in mode 12 and a superimposed move is being executed. - The motor is moving in a mode other than 10 or 12. - Waiting for an input (or GO) after a B$I command . - Controlling a brushless motor ($XT=3) using encoder+Hall ($CU=3), before crossing the index for the first time.

16 Fatal Command was not executed. Error 16 reasons: 1. Trying to change $EC or $EF while the motor is

moving, or waiting (for an input after a B$I command).

2. Trying to change $SQ, $PT, $PG while the motor is moving in spline (mode 16 and $PG.5=1).

3. Trying to change $TC or $TF and the motor is moving in mode 12 and $MR<>0.

4. Trying to start a new superimposed move (mode 12) before the completion of the present super-imposed move.

5. Trying to change the content of a continuous path array while the XY motors are moving in mode 15.

6. Trying to execute a LOAD (from the non volatile memory) command while one of the motors is moving.

7. Trying to set $AP or $RP while moving in a point to point mode (0,1,3) and the previous commanded move as not begun yet. Executing an E$ command will release this lock.

17 Fatal Command was not executed. The reason: The

command is not supported in the current version.

Page 339: Acspl Software Guide Revision 3 00

7–78 REFERENCE

ACSPL Software Guide - Document revision no. 3.00

Code Type Comments 18 Non

fatal Data sent to cyclic buffer is being ignored and must be retransmitted. The reason: No empty space in the cyclic buffer.

19 Fatal Array set command was not executed. The reason: Invalid data.

20 Fatal Command was not executed. The reason: Missing data field.

21 Non fatal

The data field of a subcommand or in a sequence was out of the valid range of the required parameter. The parameter was set with the nearest valid value to the requested value.

22 Non fatal

An unrecognized Sub-Command was found within a data field. Interpretation is continued after the erroneous field. This field will not effect the group being defined.

41 Non fatal

Operation cannot be executed while a program is running.

44 Non fatal

Delete or overwrite operations are not allowed. (See Program Protect (PP) parameter.)

90 Fatal Memory checksum error. 91 Fatal Firmware checksum error.

7.3.5. Last System (LS) Errors Code Comments

-1 No error 0 Checksum error 1 Unrecognized command 3 SAVE to flash memory operation failed. 10 Operation failed. Option. Special h/w key is required 17 This command is not supported. 19 Invalid data in an Array Set command 20 A data field is missing in the command 21 The data field of a sub-command or in a sequence is out of the

valid range. The parameter is set to a valid value that is the nearest to the required value.

22 An unrecognized subcommand was found within the data field of a Group command.

41 Operation is not allowed while an ACSPL program is running. 85 Trying to eXecute a program without specifying a valid start

location. 90 Data memory failure. Call factory. 91 Firmware memory failure. The firmware must be replaced. 121 The X axis servo processor does not communicate with the main

CPU. 151 Trying to enable a motor while the break is active. 152 Trying to change a control parameter while the motor is enabled. 153 Trying to enable a motor while it is moving relatively fast.

Page 340: Acspl Software Guide Revision 3 00

REFERENCE 7–79

ACSPL Software Guide - Document revision no. 3.00

Code Comments 154 Trying to enable a motor and XT=3 or 5, and $CU=0. 155 Trying to enable a motor and XT=3 or 5 and $LR, $LF are not well

defined. 156 This parameter cannot be changed while in motion 157 This parameter cannot be changed while in motion in MM12 158 Trying to activate data collection and PEG simultaneously. 159 Trying to LOAD from the flash memory when the motor is enabled.

160-163 A registration move is not allowed in the current motion state. 164 illegal PEG parameters. 165 Trying to set ZP when the motor is moving in MM 12 and a

superimposed move is in progress. 166 (DCL only). Trying to enable the axis when the h/w enable control

is in disable state. 167 (DCL only). The enable command is not allowed (FA.0=0). 168 Trying to set a parameter when a new motion has already been

calculated. 169 Trying to set $ZP while the axis is waiting for an input after a Begin

on Input command. End or Kill command must be issued first. 170 Trying to set $ZP when using a brushless motor ($XT=3)with

encoder + hall ($CU=3) before an index was found for the first time.

262 Trying to set $TC or $TF or $MD when the motor is moving in MM 12 and a superimposed move is in progress.

264 Trying to set $SQ or $PT or $PG while the axis is moving in spline mode (MM=16, $PG.5=1).

265 Trying to set $AP or $RP while the axis is moving in MM 0, 1 or 3 and an additional begin command was issued, but has not started yet. (End or Kill command must be issued first.)

Page 341: Acspl Software Guide Revision 3 00

7–80 REFERENCE

ACSPL Software Guide - Document revision no. 3.00

7.4. PC Keyboard Special (Extended-ASCII) CodesConstant Decimal

Value Key

F1 0, 59 Function Key 1 F2 0, 60 Function Key 2 F3 0, 61 Function Key 3 F4 0, 62 Function Key 4 F5 0, 63 Function Key 5 F6 0, 64 Function Key 6 F7 0, 65 Function Key 7 F8 0, 66 Function Key 8 F9 0, 67 Function Key 9

F10 0, 68 Function Key 10 F11 0, 133 Function Key 11 F12 0, 134 Function Key 12 SF1 0, 84 Shift F1 SF2 0, 85 Shift F2 SF3 0, 86 Shift F3 SF4 0, 87 Shift F4 SF5 0, 88 Shift F5 SF6 0, 89 Shift F6 SF7 0, 90 Shift F7 SF8 0, 91 Shift F8 SF9 0, 92 Shift F9 SF10 0, 93 Shift F10 SF11 0, 135 Shift F11 SF12 0, 136 Shift F12 CF1 0, 94 Ctrl-F1 CF2 0, 95 Ctrl-F2 CF3 0, 96 Ctrl-F3 CF4 0, 97 Ctrl-F4 CF5 0, 98 Ctrl-F5 CF6 0, 99 Ctrl-F6 CF7 0, 100 Ctrl-F7 CF8 0, 101 Ctrl-F8 CF9 0, 102 Ctrl-F9

CF10 0, 103 Ctrl-F10 CF11 0, 137 Ctrl-F11 CF12 0, 138 Ctrl-F12 AF1 0, 104 Alt-F1 AF2 0, 105 Alt-F2 AF3 0, 106 Alt-F3 AF4 0, 107 Alt-F4 AF5 0, 108 Alt-F5 AF6 0, 109 Alt-F6 AF7 0, 110 Alt-F7 AF8 0, 111 Alt-F8 AF9 0, 112 Alt-F9 AF10 0, 113 Alt-F10 AF11 0, 139 Alt-F11 AF12 0, 140 Alt-F12 ALTA 0, 30 Alt-A ALTB 0, 48 Alt-B ALTC 0, 46 Alt-C

Constant Decimal Value

Key

ALTD 0, 32 Alt-D ALTE 0, 18 Alt-E ALTF 0 , 33 Alt-F ALTG 0, 34 Alt-G ALTH 0, 35 Alt-H ALTI 0, 23 Alt-I ALTJ 0, 36 Alt-J ALTK 0, 37 Alt-K ALTL 0, 38 Alt-L ALTM 0, 50 Alt-M ALTN 0, 49 Alt-N ALTO 0, 24 Alt-O ALTP 0, 25 Alt-P ALTQ 0, 16 Alt-Q ALTR 0, 19 Alt-R ALTS 0, 31 Alt-S ALTT 0, 20 Alt-T ALTU 0, 22 Alt-U ALTW 0, 17 Alt-W ALTX 0, 45 Alt-X ALTY 0, 21 Alt-Y ALTZ 0, 44 Alt-Z ALT1 0, 120 Alt-1 ALT2 0, 121 Alt-2 ALT3 0, 122 Alt-3 ALT4 0, 123 Alt-4 ALT5 0, 124 ALt-5 ALT6 0, 125 Alt-6 ALT7 0, 126 Alt-7 ALT8 0, 127 Alt-8 ALT9 0, 128 Alt-9 ALT0 0, 129 Alt-0

ALTEQUAL 0, 131 Alt-= ALTMINUS 0, 130 Alt--

CTRLCURLF 0, 115 Ctrl Left Arrow CTRLCURRT 0, 116 Ctrl Right Arrow

CTRLEND 0, 117 Ctrl End CTRLHOME 0, 119 Ctrl Home CTRLPGDN 0, 118 Ctrl PgDn CTRLPGUP 0, 132 Ctrl PgUp

CURDN 0, 80 Down Arrow CURLF 0, 75 Left Arrow CURRT 0, 77 Right Arrow CURUP 0, 72 Up Arrow DELETE 0, 83 Del ENDKEY 0, 79 End

HOME 0, 71 Home INSERT 0, 82 Ins PGDN 0, 81 PgDn PGUP 0, 73 PgUp

REVTAB 0, 15 Shift-Tab

Page 342: Acspl Software Guide Revision 3 00

REFERENCE 7–81

ACSPL Software Guide - Document revision no. 3.00

Constant Decimal Value

Key

ALTACCENT 0, 41 Alt-' ALTPOST 0, 40 Alt-` ALTAST 0, 55 Alt-*

ALTBACKSLASH 0, 43 Alt-\ ALTBS 0, 14 Alt-Backspace ALTCB 0, 27 Alt-]

ALTCOMMA 0, 51 Alt-, ALTCURDN 0, 160 Alt Down Arrow ALTCURLF 0, 155 Alt Left Arrow ALTCURRT 0, 157 Alt Right Arrow ALTCURUP 0, 152 Alt Up Arrow ALTDELETE 0, 163 Alt Delete

ALTEND 0, 159 Alt End ALTENTER 0, 166 Alt Enter

ALTESC 0, 1 Alt-Escape ALTHOME 0, 151 Alt-Home

ALTINSERT 0, 162 Alt-Insert ALTKBMINUS 0, 74 Alt Grey Minus ALTKBPLUS 0, 78 Alt Grey Plus

ALTOB 0, 26 Alt-[ ALTPERIOD 0, 52 Alt-. ALTPGDN 0, 161 Alt-PgDn ALTPGUP 0, 153 Alt-PgUp

ALTRETURN 0, 28 Alt-Return ALTSEMI 0, 39 Alt-;

ALTSLASH 0, 53 Alt-/ ALTTAB 0, 165 Alt-Tab

ALTXSLASH 0, 164 Alt-Keypad-/ CTRLAST 0, 150 Ctrl-*

CTRLCENTER 0, 143 Ctrl-Center Key CTRLCURDN 0, 145 Ctrl DownArrow CTRLDELETE 0, 147 Ctrl-Delete CTRLINSERT 0, 146 Ctrl-Insert

CTRLKPMINUS 0, 142 Ctrl Keypad Minus CTRLKPPLUS 0, 144 Ctrl Keypad Plus CTRLPRTSC 0, 114 Ctrl-Print Screen

CTRLTAB 0, 148 Ctrl-Tab CTRLUP 0, 141 Ctrl Up Arrow

Page 343: Acspl Software Guide Revision 3 00

INDEX I -1

ACSPL Software Guide - Document revision no. 3.00

INDEX

A abs, ACSPL, 3-48, 3-58 AC motor

sinusoidal commutation, 5-30 AC motor commutation, 5-30 Acceleration Feedforward (AF), 7-22 Accuracy Enhancement, 5-1 aCknowledge command (C), 6-31 Acknowledge Number (AN), 6-30, 7-23 acknowledge time (an), 6-31 acknowledge time (at), 7-24 ACS Adjuster, 3-1 ACSPL

assignment commands, 3-56 call, 3-65 case, 3-68 compile, 3-43 continuous path array, 3-53 debugging, 3-86 delete, 3-42 direct commands, 3-61 disable, 3-70 displaying message, 3-58 do, 3-67, 3-68 editing, 3-41 else, 3-67 enable, 3-70 error message, 3-21 error messages, 7–74 execute, 3-44 goto, 3-65 if, 3-67 insert, 3-41 INT_LINE, 3-65

labels, 3-43, 3-46 line numbers, 3-45 list, 3-42 list labels, 3-43 loop, 3-66 operation rules, 3-47 operators, 3-47 program structure, 3-45 Programming mode, 3-36 protection against noise, 6-29 remarks, 3-62 Report, 3-52 save, 3-44 Set, 3-52 statements, 3-46 states, 3-54 status, 3-20 step mode, 3-20 stepping, 3-86 stop, 3-44 subroutine, 3-45 suspend, 3-21 suspend program, 3-62 suspended status, 3-59 syntax, 3-9 target points array, 3-52 till, 3-64 timers, 3-51 timing, 3-71 under Host protocol. variables, 3-48 wait, 3-64

Actual Velocity (AV), 7-25 Advanced Functions, 5-1 AFRE, 3-84 AFSE, 3-84 Analog input 0 (A0), 7-21

Page 344: Acspl Software Guide Revision 3 00

I -2 INDEX

ACSPL Software Guide - Document revision no. 3.00

Analog input 1 (A1), 7-21 Analog input 2 (A2), 7-21 Analog input 3 (A3), 7-22 Analog input 4 (A4), 7-22 Analog input 5 (A5), 7-22 analog variables, 3-50 angle of rotation, 4-27 arbitrary path

cyclic buffer mode, 5-43 Distance Time mode, 4-31

Arbitrary Path Mode 16, 4-28 Arithmetic Operators, 3-47 Array executed Step (AS), 5-21, 7-24 Array Low index (AL), 5-21, 7-23 array Low Index (LI), 7-47 Array master command, 3-23, 6-16 array Next Segment (NS), 7-

53 Array Offset (AO), 4-7, 4-29, 4-44, 7-23

changing on the fly, 4-40, 4-53 Array Upper index (AU), 7-24 array Upper Index (UI), 7-68 Array Upper index(AU), 5-21 Arrays

continuous path, 3-53 D, K, J, 3-54 target points, 3-52 types, 3-25

assignment, 3-56 function keys, 3-83 set variables, 3-57 variables, 3-57

AUTO_EI, 3-77 AUTO_EN$, 3-55, 3-77 AUTO_ERR, 3-73, 5-29 AUTO_ES, 3-55, 3-73 AUTO_EX$, 3-77 AUTO_FLT, 3-54, 3-76, 5-29 AUTO_HT$, 3-77 AUTO_HTX, 3-55 AUTO_IN#, 3-56, 3-74 AUTO_KB, 3-78 AUTO_LL$, 3-54, 3-74 AUTO_M1$, 3-55, 3-76, 5-8 AUTO_RL$, 3-54, 3-74 AUTO_SL$, 3-76 AUTO_SLX, 4-24 AUTO_SYS, 3-74 AUTO_T1, 3-71, 3-75 AUTO_T2, 3-71, 3-75 AUTO_TE$, 3-77 AUTOEXEC, 3-72 automatic commutation setup, 5-31

automatic subroutine, 3-72 emergency stop, 3-73 encoder error, 3-77 extended input, 3-77 function keys, 3-78, 3-83 general fault, 3-76 hot motor, 3-77 input, 3-74 keyboard, 3-78 limit, 3-74 out of target, 3-77 position error, 3-73 registration mark, 3-76 soft limit, 3-76 system errors, 3-74 timer, 3-75 tracking error, 3-77

avg, ACSPL, 3-48 axes synchronization, 3-28 aXis Type (XT), 5-31, 7-71

B baud rate, 3-6 Baud Rate (BR), 7-26 begin

error, 3-17 motion, 4-1

BEGIN, 3-8, 3-28 error, 7–73 motion, 6-23

Begin on Input/Go (BG), 7-25

Begin Position (BP), 4-11, 7-26 Begin Velocity (BV), 4-11, 7-26 Begin/End masking (BE), 7-

25 Begin/End messages

handling, 6-33 bouncing protection

input, 3-75 search for contact, 4-13

break case, 3-70

Break, 3-70 Break Open (BO), 7-25 broadcast command, 3-9, 3-31

C call, 3-51, 3-65

nesting level, 3-65 Cam, 4-42 Cam, cyclic, 4-51

Page 345: Acspl Software Guide Revision 3 00

INDEX I -3

ACSPL Software Guide - Document revision no. 3.00

case, 3-68 break, 3-69 label, 3-69 nesting level, 3-69

Center Coordinate (CC), 7-26

center coordinates, 4-27 characters

displaying, 3-59 showing, 3-60

chr, 3-59, 3-60 Circular Point To Point, 4-9 CLEAR, 3-8, 3-33, 3-34, 3-36 closed loop, stepper, 5-28 commands

AFRE, 3-84 AFSE, 3-84 assignment, 3-56 broadcast, 3-9 direct, 3-61 start motion, 3-28 terminate motion, 3-29

communication handling Begin/End messages, 6-33

communication errors, 7–76, 7–78 communication protection, 6-29 communication, partial shutdown, 3-72, 3-

86 commutation, 5-30

automatic setup, 5-31 sine table, 3-53

Commutation Usage (CU), 5-31, 7-28 commutation, linear motor, 5-31 compile, 3-43 constant velocity current

(P3), 7-56 contact search, 4-12 continuous path array, 3-53 Continuous Path Following, 4-26 Continuous Velocity, 4-14 Current Angle (CA), 7-26 current axes, 3-11 current group, 3-14 Current Level (CL), 7-27 Current motion Mode (CM),

7-27 Current Position (CP), 7-28 Current position minus Grid

correction (CG), 7-27 Current Position minus Grid Correction

(CG), 5-3 cyclic buffer mode

arbitrary path, 5-43

Cyclic, Cam, 4-51

D D array, 3-54 D4 analog output (D4), 7-29 DAc offset (DA), 7-29 Dac Output (DO), 7-30 Dac output 0 (D0), 7-28 Dac output 1 (D1), 7-28 Dac output 2 (D2), 7-29 Data Collection, 3-52, 5-12

smoothness measurement, 5-16 Data Collection (DC), 5-12 data collection (DC_ON) state, 3-55 Data collection executed Step (DS), 5-13,

7-31 Data collection Low index

(DL), 7-30 Data Collection mask (DC),

7-29 data collection time interval

(ti), 7-65 Data collection Upper index

(DU), 7-32 Data Lower (DL), 5-13 Data Representation, 6-2 Data Upper (DU), 5-13 debugging,, 3-86 deceleration current (P4), 7-

56 delete, 3-42 Direct mode, 3-6

examples, 3-35 disable, ACSPL, 3-70 disp, 3-58

chr(), 3-59 display constant 1 (d1), 7-28 display constant 2 (d2), 7-28 display constant 3 (d3), 7-29 display function (df), 7-29 display hysteresis (dh), 7-30 display maximum (dm), 7-30 display rate (dr), 7-31 display value (dv), 7-32 Distance Time (DT), arbitrary path, 4-31 do, 3-67, 3-68

Page 346: Acspl Software Guide Revision 3 00

I -4 INDEX

ACSPL Software Guide - Document revision no. 3.00

E E_STOP, 3-73 Early Ready signal, 5-41 edit, 3-41 EEPROM, 3-33, 3-34 Electronic Cam, 4-28, 4-42 Electronic Gearing, 4-16 else, 3-67 emergency stop, 3-73 emergency stop (ES) state, 3-55 Enable Delay time (ED), 7-32 enable motor, 4-1 ENABLE motor state, 3-54 enable Output Logic (OL), 7-

54 enable, ACSPL, 3-70 encoder, 5-31

error, 3-55 not connected (ENCNC) state, 3-55 search for index, 5-6

Encoder feedback, 5-28

encoder error automatic subroutine, 3-77

Encoder line Factor (LF), 5-31 Encoder Type (ET), 7-35 end

error, 3-19 END, 3-8, 3-29, 6-24

error, 7–74 End Location (EL), 5-21, 7-33 error, 7–73

ACSPL program, 7–74 BEGIN messages, 7–73 begin motion, 3-17 communication errors, 7–76 encoder, 3-77 encoder (ENER) state, 3-55 END messages, 7–74 end of motion, 3-19 flash memory, 3-34 last system (LS), 7–78 limit, 3-73 position, 3-73 state, 3-54 tracking, 3-77

Error Array, 5-3 ERror limit (ER), 7-34 Error limit during

Acceleration (EA), 7-32 error mapping, 5-3 Error Mapping, 5-1 Error Mapping (EM), 5-2, 7-33

Error Vector, 5-4 event generation, 5-19 Event Generator (EG), 5-21 exec, ACSPL, 3-61 execute program, 3-44 Executed Step (ES), 4-7, 4-29, 4-45, 7-

34 extended input

automatic subroutine, 3-77 Extended Input (EI), 7-33 extended iNput 1 (N1), 7-52 extended iNput 2 (N2), 7-52 extended iNput 3 (N3), 7-52 extended iNput 4 (N4), 7-52 extended Output 1 (O1), 7-53 extended Output 2 (O2), 7-53 Extended-ASCII Codes, 7–80

F fast response reporting, 5-18 fault

automatic subroutine, 3-76 Field Current (FC), 7-37 Field Length (FL), 7-38 Filter Type (FT), 7-39 firmware memory status, 3-22 FKEY_0#, 3-78, 3-83 Flags reGister (FG), 7-38 flash memory

error, 3-34 Flying Shears, 4-24 AcKnowledge number (AK,

7-23 Free Segments (FS), 7-39 Friction Number (FN), 7-39 Function Available (FA), 4-17, 4-54, 7-36 Function Enable (FE), 5-13, 5-21 function keys

assignment, 3-83 automatic subroutine, 3-78, 3-83

Function Mask (FM), 7-39

G GAin (GA), 7-40 Gain Factor (GF), 7-41 gear ratio

master-slave, 4-20

Page 347: Acspl Software Guide Revision 3 00

INDEX I -5

ACSPL Software Guide - Document revision no. 3.00

stepper motor, 5-28 GO, 3-8, 3-30 goto, 3-65 Grid Correction (GC), 5-3, 7-40 Grid Delta (GD), 7-40 Grid Delta vector (GD), 5-2 Grid Offset (GO), 5-2, 7-41 Grid Size (GS), 5-2, 7-41 Group # (G#), 6-22, 7-40

H HAll effect reading (HA), 7-

41 hall offset (_h), 7-21 handheld terminal, 6-1, 7-42 Homing, 5-7 host acknowledge (HOST_ACK) state, 3-

55 Host Protocol (HP), 7-42 Host protocol (HP=0), 6-1 Host/Terminal

communication protocol (HT), 7-42

hot motor (HOT) state, 3-55 HWRES, 3-35

I ID number, 3-2 ID number (ID), 7-43 idle current level (P0), 7-55 if, 3-67

nesting level, 3-67 incremental mode, PEG, 5-20 index

searching for, 5-6 index offset (_m), 7-21 IndeX position (IX), 7-45 INDEX state, 3-55 indices, 3-50 Initiate Communication (IC),

7-43 input

automatic subroutine, 3-74 states, 3-55

input bouncing protection, 3-75 Input Logic (IL), 7-44 INput logic (IN), 7-45

Input Port (IP), 7-45 Input Source (IS), 3-30, 7-45 insert, 3-41 INT_LINE, 3-51 INT_LINE, ACSPL, 3-65 integration constant (KZ), 7-

46 interface

operator, 3-81 internal states, 3-54 internal variables, 3-49 Interpolation signal, 5-41 Interval Factor (IF), 4-29

changing on the fly, 4-40

J J array, 3-54 jerk current (P1), 7-55 Jogging, 4-14 Joystick, 4-54

operation control, 7-36

K K array, 3-54 keyboard

automatic subroutine, 3-78 KeyBoard input (KB), 7-45 KILL, 3-8, 3-31, 6-25 Kill Deceleration (KD), 7-46 KILL MASTER, 3-31 Kill Master distance (KM), 4-20

L labels, 3-46. See list, execute

list, 3-43 reserved names, 3-46

Last System error (LS), 7-48 limit

motor behavior, 7-36 soft, 3-76

LIMIT state, 3-54 Limit Wait (LW), 7-49 line numbers, 3-45. See insert, list, delete Linear Acceleration (LA), 7-

46 Linear Deceleration (LD), 7-

46 Linear Velocity (LV), 7-48 Lines Factor (LF), 7-47

Page 348: Acspl Software Guide Revision 3 00

I -6 INDEX

ACSPL Software Guide - Document revision no. 3.00

Lines per Rev. (LR), 7-48 Lines per Revolution (LR), 5-31 list, 3-42 LOAD, 3-8, 3-33 Logical Operators, 3-48 loop, 3-66

nesting level, 3-66 lower acceleration (la), 7-46 lower deceleration (ld), 7-47 Lower Index (LI), 3-24, 4-7, 4-27, 4-29, 4-

44 changing on the fly, 4-40

Lower Threshold (LT), 4-54, 7-48 LS

error list, 7–78

M Manual Joystick, 4-54 MARK1, 5-8 MARK1 state, 3-55 Master Velocity (MV), 4-19 master Array Offset (ao), 7-

23 master commands, 3-16, 3-27, 3-33

Array, 3-23 BEGIN, 3-8, 3-28 broadcast command, 3-31 clear, 3-25 CLEAR, 3-8, 3-33, 3-34, 3-36 END, 3-8, 3-29 GO, 3-8, 3-30 hardware reset, 3-33 HWRES, 3-35 KILL, 3-8, 3-31 KILL MASTER, 3-31 LOAD, 3-8, 3-33 Memory Management, 3-33 Motion Execution, 3-27 MOVE, 3-8, 3-30 report, 3-24 Report, 3-11 Report Group, 3-14 RESET, 3-8, 3-33, 3-34, 3-36 SAVE, 3-8, 3-33, 3-36 Set, 3-10, 3-11 Tell, 3-16 Tell Firmware Memory, 3-22 Tell Last Program Message, 3-21 Tell Memory Status, 3-23 Tell Motor And Motion Status, 3-16 Tell Program Status, 3-16, 3-20 Tell Result Of Last 'Begin Motion'

Command, 3-17 Tell Servo Processor Status, 3-22 Tell The Cause Of Motion's End, 3-19

Tell Voltages Status, 3-23 Wake, 3-31

Master Distance (MD) state, 4-21

MASTER DISTANCE (MD) state, 3-55 Master Index (MI), 4-18, 7-50 Master Index (MINDX) state, 3-55 Master Position (MP), 4-18, 7-51 Master Relative position (MR), 4-18, 7-

51 MAster slave configuration (MA), 4-18, 7-

49 Master Slave state, 3-55 Master slave Sync. (MS), 7-

51 MASTER state, 3-55 Master Velocity (MV), 7-52 Master Zero position (MZ), 4-19, 7-52 master-slave

gear ratio, 4-20 rollover, 4-19

Master-Slave, 4-15 Master-slave relative Distance (MD), 4-20,

7-49 Master-slave Synchronized (MS), 4-18 Match Time (MT), 5-22 Mathematical Operators, 3-48 max, ACSPL, 3-48 Measurement

smoothness, 5-16 velocity, 5-16

memory, 3-37 flash error, 3-34 status, 3-22, 3-23

Memory Management, 3-33 message

ACSPL errors, 3-21 begin error, 3-17 displaying, 3-58 end of motion, 3-19

Method of Operation Error Mapping, 5-4 Joystick, 4-55 PEG, 5-23

Method Of Operation arbitrary path, 4-35 Data Collection, 5-13 master slave, 4-21 path generation, 4-35 search for contact, 4-12

min, ACSPL, 3-48 MINDX, 4-21 Mode 0 Linear point to point, 4-2 Mode 1 Repetitive linear point to point, 4-5

Page 349: Acspl Software Guide Revision 3 00

INDEX I -7

ACSPL Software Guide - Document revision no. 3.00

Mode 10 Jogging, 4-14 Mode 12 Master slave, 4-15 Mode 15 Continuous path following, 4-26 Mode 16 Arbitrary path generation, 4-28 Mode 21 Joystick, 4-54 Mode 22 Position tracking, 4-56 Mode 3 Move by sequence, 4-6 Mode 4 Circular point to point, 4-9, 7-4 Mode 8 Multiple velocity point to point, 4-

10 Mode 9 Search for contact, 4-12 Monitor Factor (MF), 7-49 Motion Execution commands, 3-27 motion messages, 3-17, 3-19 Motion Mode (MM), 7-50 motion MoNitor (MN), 7-50 Motion signal, 5-41 motor

enable, 4-1 moves away from target, 5-27

MOtor enable (MO), 7-51 motor temperature

automatic subroutine, 3-77 move

registration, 3-30 MOVE, 3-8, 3-30, 6-25

by sequence, 4-6 registration, 5-8 superimposed, 4-16

MOVE state, 3-54 Multiple Velocities, 4-10

N nesting

call, 3-65 case, 3-69 if, 3-67 loop, 3-66

next desired Absolute Position (AP), 7-24

Next Full step (NF), 7-53 Number of motor’s Poles (NP), 5-31, 7-

53

O operator

interface, 3-81 operators, 3-47

arithmetic, 3-47 logical, 3-48 mathematical, 3-48 relational, 3-48 rules, 3-47

out of target, 3-77 Output

Early Ready signal, 5-41 Interpolation Complete signal, 5-41 Motion signal, 5-41 Ready signal, 5-41

Output Mask (OM), 7-54 Output Port (OP), 7-54 Outputs, special functions, 5-41

P Parabolic Profile, 4-4 parameter definition

accuracy enhancment, 5-1 data collection, 5-12 mode 16, 4-29 PEG, 5-21

parameters commutation, 7-3 dictionary, 7-21 motion, 7-1 safety & protection, 7-6 servo control, 7-2 set and report, 7-1 special functions, 7-7 stepper control, 7-2

Parameters, 7-1 partial communication, 3-72, 3-86 Path Generation, 4-29 Path Generation (PG), 4-29, 4-45

changing on the fly, 4-40, 4-53 Path Generation mode (PG),

7-57 Path Time (PT), 4-29

changing on the fly, 4-40 Path Time interval (PT), 7-59 PC Keyboard Special Codes, 7–80 PEG, 3-52, 3-55, 5-19 Peg Mask (PM), 5-21, 5-23, 7-58 peg Match Time period

(MT), 7-51 Phase Advance (PA), 7-56 Pick and Place mode, 4-12 PLC, 3-56 Point to Point mode, 4-2 Point To Point With Multiple Velocities, 4-

10 POle (PO), 7-58 poles, motor, 5-31 Position correction, stepper, 5-30 Position Error (PE), 7-57 Position Event Generator, 5-19

Page 350: Acspl Software Guide Revision 3 00

I -8 INDEX

ACSPL Software Guide - Document revision no. 3.00

position Event Generator (EG), 7-33

Position Interval (PI), 5-13, 5-21, 7-58 Position Tracking, 4-56 position verification, stepper, 5-29 present Desired Position

(DP), 7-31 Profile Definition

multiple velocities, 4-11 program

error messages, 7–74 flow, 3-64 saving, 3-44 status, 3-20 structure, 3-45 suspended, 3-62

program flow, 3-64 call, 3-65 case, 3-68 disable, 3-70 do, 3-68 enable, 3-70 goto, 3-65 if, 3-67 loop, 3-66 till, 3-64 wait, 3-64

Program Protect (PP), 3-33, 3-34, 7-58 program variables, 3-50 Programming mode, 3-6, 3-36 protection

communication in noisy environment, 6-29

input bouncing, 3-75 sensor failure, 4-13

Pulse Width (PW), 7-59 Pwm Frequency (PF), 7-57

Q Qdspl Protect line (QP), 7-59

R RAM, 3-33 random mode,PEG, 5-20 Ready signal, 5-41 READY state, 3-54 realtional operations

strings, 3-63 Reference, 7-1 registration

Mark Movement, 5-8 move, 3-30

Registration Distance (RD), 4-12, 5-8

registration mark automatic subroutine, 3-76

registration Mark 1 position (M1), 7-49

Registration mark Distance (RD), 7-60

registration move (RD) state, 3-55 Relational Operators, 3-48 Relative Position (RP), 7-60 remarks, 3-62 Repetative Linear Point to Point, 4-5 Report master command, 3-11 Report Group master command, 3-14 report variables, 3-52 Report, Host protocol, 6-5 reporting

fast response, 5-18 reserved names

labels, 3-46 RESET, 3-8, 3-33, 3-34, 3-36 ReSolver reading (RS), 7-60 restrictions

mode 16, 4-41, 4-52 mode 8, 4-12

rollover master-slave, 4-19

Rotation Angle (RA), 7-59 RS232 mode of operation, 3-2

S SAmpling rate (SA), 7-60 save, 3-44 SAVE, 3-8, 3-33, 3-36 Search Distance (SD), 4-13, 7-60 Search For Contact, 4-12 Search Velocity (SV), 4-11, 4-12, 7-64 search Velocity Output (VO),

7-70 searching for index, 5-6 Searching For Index, 5-6 second Encoder type (Et), 7-

36 seconnd Encoder reading

(E2), 7-32 Sensor

failure protection, 4-13 Sensor High time (SH), 7-62 SEnsor input source (SE), 7-

61

Page 351: Acspl Software Guide Revision 3 00

INDEX I -9

ACSPL Software Guide - Document revision no. 3.00

Sensor Point (SP), 4-12, 7-63 SEnsor source (SE), 4-13 SeQuence (SQ), 4-7, 4-29 SeQuence type (SQ), 4-7, 7-63 sequence type, mode 16, 4-29 Serial Number (SN), 7-63 servo processor

status, 3-22 Servo Processor, arrays, 3-54 set

motion mode, 4-1 SET, 3-52

Host protocol, 6-4 Set master command, 3-10, 3-11 set output HIgh (HI), 7-41 set output LOw (LO), 7-47 set variables, 3-52 ShOrt time (SO), 7-63 show

chr(), 3-60 Show Delay time (sd), 7-60 Show Function (sf), 7-61 shut down, partial communication, 3-72, 3-

86 sine offset, 3-53 sine table, 3-53 sinusoidal commutation, 5-30 Slip constant (SK), 7-62 Smooth Factor (SF), 4-12, 7-61

effect of, 4-4 smoothness, measurement, 5-16 soft limit

automatic subroutine, 3-76 software Position limit High

(PH), 7-57 software Position limit Low

(PL), 7-58 software VeRsion (VR), 7-70 special Function Enable

(FE), 7-37 Spline Interpolation, 4-32 sqr, ACSPL, 3-48, 3-58 Stall detection, stepper, 5-29 Start Location (SL), 5-13, 5-16, 7-63 Start Sensor (SS), 4-12 Start Sensor position (SS),

7-63 state

registration move, 5-8 statements, 3-46

states, 3-54 $_INDEX, 5-6 $_MD, 4-21 $_MINDX, 4-21 $_PEG, 5-22 $_SYNC, 4-21 data collection, 3-55 emergency stop, 3-55 enable motor, 3-54 encoder error, 3-55 encoder not connected, 3-55 error, 3-54 host acknowledge, 3-55 hot motor, 3-55 index, 3-55 input, 3-55 internal, 3-54 limits, 3-54 mark1, 3-55 Mark1, 3-76 MASTER, 3-55 master distance, 3-55 master index, 3-55 master slave, 3-55 move, 3-54 PEG, 3-55 ready, 3-54 registration move, 3-55 SYNC, 3-55

status memory, 3-22 memory, 3-23 servo processor, 3-22

Status reGister (SG), 7-62 step mode

ACSPL, 3-20 debugging, 3-86

step mode (st), 7-64 Stepper

closed loop, 5-28 encoder feedback, 5-28 position correction, 5-30 stall detection, 5-29

stepper motor gear ratio, 5-28

stop emergency, 3-55, 3-73 execution of program, 3-44

string, 3-63 converting, 3-63 relational operations, 3-63

string variables, 3-51 subroutine, 3-45

automatic, 3-46, 3-51, 3-56, 3-72 superimposed move, 4-20 Superimposed move, 4-16 suspend program, 3-21, 3-62 suspend, ACSPL, 3-59

Page 352: Acspl Software Guide Revision 3 00

I -10 INDEX

ACSPL Software Guide - Document revision no. 3.00

SYNC, 4-21 SYNC state, 3-55 synchronization of axes, 3-28 syntax

ACSPL, 3-9 system errors

automatic subroutine, 3-74 System Input port (SI), 7-62

T T$ ACSPL program message, 3-21 T0 motor & motiom status, 3-16 T0 motor & motion status, 6-10 T1

$_BEGIN, 3-49 begin motion message, 3-17, 6-12

T2 $_END, 3-49 end of motion, 3-19, 6-12

T3 ACSPL program status, 3-20, 6-13 T4 tell last program message, 3-21, 6-13 T5 servo processor status, 3-22, 6-14 T6 firmware memory status, 3-22, 6-14 T8 Tell Voltages Status, 6-15 T8 Tell Voltages Status, 3-23 T9 Tell Memory Status, 3-23, 6-15 Target radius Delay TD, 3-77 Target Delay (TD), 7-65 target points array, 3-52 Target Radius (TR), 7-67 Target radius Delay (TD), 5-27 Tell commands, Host protocol, 6-10 Tell master commands, 3-16 temperature

automatic subroutine, 3-77 till, 3-64 TIME, 3-71 Time Base (tb), 7-64 time control, 3-71 Time Interval (ti), 5-12 time Interval Factor (IF), 7-

44 timer

automatic subroutine, 3-75 TIMER1, 3-71, 3-75 TIMER2, 3-71, 3-75 timers, 3-51 timing, 3-71 TOrque limit (TO), 7-66 Torque limit Low (TL), 7-66 Tracking Constant (TC), 4-19, 7-64 tracking error

automatic subroutine, 3-77

Tracking Error (TE), 3-77 Tracking Factor (TF), 4-19, 7-65 Tracking Sync (TS), 4-20 Tracking Sync. range (TS),

7-67 Tracking Velocity (TV), 4-20, 7-67 TrAnsmission number (TA),

7-64 Transmission Number (TN), 6-30, 7-66 Trapezoidal Profile, 4-2

U Upper Index (UI), 3-24, 4-7, 4-27, 4-29, 4-

44 changing on the fly, 4-40

Upper Threshold (UT), 4-54, 7-68

V V variables, 3-50 variables, 3-48

$_BEGIN, 3-49 $_END, 3-49 $_MOTION, 3-49 analog, 3-50 assignment, 3-57 index, 3-50 INT_LINE, 3-51 internal, 3-49 program, 3-50 report, 3-52 set, 3-52 string, 3-51, 3-63 TIME, 3-51

Vector Acceleration (VA), 4-27, 7-68 Vector Deceleration (VD), 7-

68 Vector Kill deceleration

(VK), 7-69 Vector Number (VN), 7-70 Vector Smooth factor (VS), 4-27, 7-70 Vector Velocity (VV), 4-27, 7-71 Velocity Minimal (VM), 7-70 velocity, parabolic profile, 4-4 velocity, smoothness, 5-16 velocity, trapezoidal profile, 4-2 verification Encoder

Constant (EC), 7-32

Page 353: Acspl Software Guide Revision 3 00

INDEX I -11

ACSPL Software Guide - Document revision no. 3.00

verification Encoder Factor (EF), 7-33

verification, stepper, 5-29 Verify Enable (VE), 5-29, 7-68 voltages

status, 3-23

W wait, 3-64 Wait Time (WT), 4-6, 7-71

Wake, 3-31, 6-26

Z ZEro (ZE), 7-72 Zero Position (ZP), 7-72 zero position of 2’nd

encoder (zp), 7-72