Compumotor 6000 Series Programmer’s Guide Compumotor Division Parker Hannifin Corporation p/n 88-014540-01
User Information WARNING ! ! Because software controls machinery, test any software control for safety under all potential operating conditions. Failure to do so can result in damage to equipment and/or serious injury to personnel. 6000 Series products and the information in this user guide are the proprietary property of Parker Hannifin Corporation or its licensers, and may not be copied, disclosed, or used for any purpose not expressly authorized by the owner thereof.
Change Summary 6000 Series Programmer’s Guide Re v D Rev D – summary of changes (minor) • Removed references to the Motion Architect User Guide. Motion Architect no longer ships with the printed manual. An on-line Adobe Acrobat PDF version is available from our web site (http://www.compumotor.com). • Clarified Command Value Substitution guidelines with a “rule of thumb” (see page 6). • Error programming correction: DO NOT use the ERRORP CLR command to cancel the branch to the error program (see page 31).
Topic Description Commanded Direction Reversal (CMDDIR) Enhancement: The commanded direction polarity reversal command (CMDDIR) is available for the 615n series, the 6270, and all stepper products (610n, AT6n00, 620n). The CMDDIR command allows you to reverse the direction that the controller considers to be the “positive” direction; this also reverses the polarity of the counts from the feedback devices.
Topic Description Error Checking Conditions Enhancements: (SEE_PG . _31) • 610n: The drive fault error (reported with error status bit #4 and axis status bit #14) can be caused by any one or combination of the factors list below.
Topic Description On-The-Fly Motion (continued) • Affected Commands: COMEXC . . . .COMEXC1 mode allows pre-emptive motion with buffered commands GO ...........Allows pre-emptive D, MC, MA, FOLRN, & FOLRD changes TAS & AS . .Bit #30 is set if the load has already passed the target position ..............(D) specified in a pre-emptive GO. (also sets error status bit #10) TER & ER . .Error status bit #10 is set if axis status bit #30 is set. Enhancements: (SEE_PG . _182) • New Commands: REGLOD . . . .
Topic Description Status Reporting Enhancements: (SEE_PG . _232) • New transfer (display status) commands: TASX ....... Transfer extended axis status. Bit assignments are as follows: .............. Bit #1: Motor fault (6104 only) .............. Bit #2: Drive low voltage fault (6104 only) .............. Bit #3: Drive over-temperature fault (6104 only) .............. Bit #4: Drive fault input is active TSEG .......
610n 615n 620n 625n 6270 AT6450 AT6250 AT6400 AT6200 New Commands in Revision 4.
T A B L E O F Overview About This Manual .................................................... i Organization of This Manual ................................. i Programming Examples ...................................... ii Reference Documentation................................... ii Assumptions of Technical Experience ................... ii Product Name References (What’s in a Name?) .......iii Before You Begin ....................................................iii Support Software .....................
Chapter 3. Basic Operation Setup Chapter 4. User Interface Options Before You Begin ...................................................78 Setup Parameters Discussed in this Chapter .........78 Using a Setup Program......................................79 Motion Architect ..............................................79 Resetting the Controller.....................................79 Participating Axes..................................................79 Memory Allocation.....................................
Chapter 6. Following Chapter 7. Troubleshooting Ratio Following – Introduction .................................192 What can be a master? ....................................192 Performance Considerations ............................193 Following Status.............................................193 Implementing Ratio Following ..................................194 Ratio Following Setup Parameters......................194 Slave vs. Master Move Profiles .........................
O V E R V I E W About This Manual This manual is designed to help you implement the 6000 Series Product's features in your application. Detailed feature descriptions are provided, including application scenarios and programming examples. For details on each 6000 Series command, refer to the 6000 Series Software Reference. Organization of This Manual The feature descriptions are grouped into chapters as listed below. User Guide Feedback Chapter Information Chapter 1.
Programming Examples Programming examples are provided to demonstrate how the 6000 product's features may be implemented. These examples are somewhat generalized, due to the diverse nature of the family of 6000 Series products and their application; consequently, some attributes, such as the number of axes used or the I/O bit pattern referenced, may differ from those available with your particular 6000 product.
Product Name References (What’s in a Name?) This document sometimes uses one product name to reference an entire subset of the 6000 family (e.g, “AT6n50” refers to the AT6450 and the AT6250; “AT6n00” refers to the AT6200 and the AT6400). Unless otherwise noted, references to a standard product are applicable to the OEM version as well (e.g., AT6400 and OEM-AT6400; 6200 and OEM6200).
Add-On Modules Add-on modules for Motion Architect are available to aide in other programming and setup tasks. These modules are available from your local Automation Technology Center (ATC) or distributor. For detailed user information, please refer to the respective user guide. • Servo Tuner™ (Tuning and Data Gathering Tool): Tune the servo drives and the 6000 servo controller and receive instant data feedback on customizable displays.
1 CHAP T E R ONE Programming Fundamentals IN THIS CHAPTER This chapter is a guide to general 6000 programming tasks. It is divided into these main topics: • • • • • • • • Motion Architect programming environment .............. 2 Command syntax ................................................. 3 Creating programs (program development scenario)...... 8 Storing programs ................................................. 1 2 Executing programs ..............................................
Motion & Control Motion Architect Programming Environment Every 6000 Series controller is shipped with Motion Architect, a Windows-based programming tool designed to simplify your programming efforts. The main features of Motion Architect are briefly described below. For detailed user information, refer to the Motion Architect User Guide. • Setup Module: Provides dialog boxes for you to select basic system setup parameters (I/O definitions, position feedback, etc.
Program Editor: Create and edit programs, save them, and then download them from the Terminal module. Terminal Emulator: Communicate directly with the 6000 controller. Download files containing stand-alone commands and/or complete programs or subroutines. Check system responses. Upload programs from the 6000 controller. Command Syntax Overview The 6000 Series language provides high-level constructs as well as basic motion control building blocks.
Description of Syntax Letters and Symbols The command descriptions provided within the 6000 Series Software Reference use alphabetic letters and ASCII symbols within the S yn t ax description to represent different parameter requirements (see example below). INEN Syntax Symbology ☞ Type Syntax Units Range Default Response See Also Letter / Symbol Input Enable Inputs or Program Debug Tools INEN...
General Guidelines for Syntax Topic Guideline Examples * Neutral Characters: • Space () • Tab () Using neutral characters anywhere within a command will not affect the command. Set velocity on axis 1 to 10 rps and axis 2 to 25 rps: V1Ø,25,, (In the examples on the right, a space is represented by , a tab is ), and a carriage return is .
Command Value Substitutions Many commands can substitute one or more of its command field values with one of these substitution items (demonstrated in the programming example below): VARB...... Uses the value of the binary variable to establish all the command fields. VAR ....... Places current value of the numeric variable in the corresponding command field. READ...... Information is requested at the time the command is executed. DREAD . . . .
* denotes operators that have a correlated status display command. (e.g., To see a full-text description of each axis status bit accessed with the AS operator, send the TASF command to the 6000 controller.) See page 232. Bit Select Operator A........... Acceleration AD ......... Deceleration ANI........ Voltage at the ANI analog inputs (servos with ANI option) * ANV........ Voltage at the joystick analog channels * AS ......... Axis status * ASX........
Related Operator Symbols Command arguments include special operator symbols (e.g., +, /, &, ', >=, etc.) to perform bitwise, mathematical, relational, logical, and other special functions. These operators are described in detail, along with programming examples, at the beginning of the Command Descriptions section of the 6000 Series Software Reference.
2. Define a program. Program Editor Terminal Emulator 1. Create program file(s) and save to disk. 2. Download files via the terminal emulator. 3. Repeat steps 1 & 2 to edit the code. • Communicate directly with the controller. • Download files containing complete 6000 programs or stand-alone 6000 commands. • Check system status responses. • Upload programs from the controller to disk. Type in the commands as shown in the Editor window below.
3. Download the program. FIRST: Before you can download the program, you must save it to your hard drive (select File/Save in the Editor). The file is saved with a “.PRG” extension. In the Save dialog box, name the file “EXAMPL.PRG”. Save the program first (Editor). Follow these steps to download the program file to the controller: 1. Power up the controller. Notice the power-up message (like the one shown below) display in your terminal emulator window. 2.
4. Run the program. WARNING: Executing this program will cause motion. If you coupled the motor(s) to the load, make sure it is safe to move the load without damaging equipment or injuring personnel. Other methods of executing programs are listed in Executing Programs (page 14). To run the program from the terminal emulator, type the name of the program (in this case it is EXAMPL) and press the carriage return or enter key.
Storing Programs Programs and compiled profiles are stored in the controller's memory (non-volatile memory for stand-alone products and volatile memory for bus-based products). Information on controlling memory allocation is provided below (see Memory Allocation). Storing Programs in Stand-Alone Products If you are using a stand-alone (serial interface) product, programs and compiled profiles are automatically stored in non-volatile memory (battery-backed RAM).
MEMORY command syntax (example) MEMORY8ØØØØ,7ØØØØ Memory allocation for Compiled Profiles (bytes). Storage requirements depend on the number of segments in the compiled profile (1 segment consumes 72 bytes). A segment could be one of these commands: Memory allocation for Programs (bytes). Storage requirements depend on the number of ASCII characters in the program. Contouring: PARCM PARCOM PARCOP PARCP PLIN Compiled Motion: GOBUF PLOOP GOBUF commands GOWHEN may require up to 4 TRGFN segments.
Executing Programs (options) Following is a list of the primary options for executing programs stored in your controller: Method Description See Also Execute from a terminal emulator Type in the name of the program and press enter. page 11 Execute as a subroutine from a “main” program Use an branch (GOTO, GOSUB, or JUMP) from the main program to execute another stored program. page 23 Execute automatically when the controller is powered up Stand-alone products only.
Set-up Program Execution for Stand-Alone Controllers If you created the set-up program in Motion Architect's Editor, you need to download it to the 6000 controller's non-volatile memory via the Terminal Emulator module (see Send Motion Program under the Transfers menu). If you created the set-up program in the terminal emulator, as in the example below, it is already stored to non-volatile memory.
Controlling Execution of Programs and the Command Buffer The 6000 controller command buffer is capable of storing 2000 characters waiting to be processed. (This is separate from the memory allocated for program storage – see Memory Allocation, page 12.) Three commands, COMEXC, COMEXK, and COMEXP, affect command execution. Three additional commands, COMEXL, COMEXR, and COMEXS, affect the execution of programs and the command buffer.
COMEXL (Save Command Buffer on Limit) The COMEXL command enables saving the command buffer and maintaining program execution when a hardware or software end-of-travel limit is encountered. For more information on end-of-travel limits, refer to page 90. COMEXP (Pause Command Execution Until In Position Signal) This feature is applicable only to stepper products, excluding the OEM-AT6400, 6104 and 6201. The COMEXP command enables waiting for the in-position signal (DRIVE connector pin 4).
Restricted Commands During Motion When motion is in progress, some commands cannot have their parameters changed until motion is complete (see table below). For the commands identified in the table, if the continuous command execution mode in enabled (COMEXC1) and you try to enter new command parameters, you will receive the error response MOTION IN PROGRESS.
Stand-Alone Products: • All 3 types of variables are automatically storied in non-volatile memory. • 6270: Numeric and string variables may be displayed with the RP240 (see page 133). Binary variables can be used to store 32-bit binary or hexadecimal values. Binary variables can also store I/O, system, axis, or error status (e.g., the VARB2=IN.12 command assigns input bit 12 to binary variable 2). Bitwise operations are performed using binary variables.
Division (/) Exam p le VAR3=10 VAR20=15.5 VAR20 VAR3=VAR3/VAR20 VAR3 VAR30=75 VAR30 VAR19=VAR30/VAR3 VAR19 Square Root Trigonometric Operations Sine Cosine 20 Exam p le R esp o n se *+15.5 *+0.64516 *+75.0 *+116.25023 R esp o n se VAR3=75 VAR20=25 VAR3=SQRT(VAR3) VAR3 *+8.660 VAR20=SQRT(VAR20)+SQRT(9) VAR20 *+8.0 The following examples demonstrate how to perform trigonometric operations with numeric variables.
Tangent Inverse Tangent (Arc Tangent) Boolean Operations Boolean And (&) Boolean Or (|) Boolean Exclusive Or (^) Boolean Not (~) Exam p le RADIAN0 VAR1=TAN(0) VAR1 VAR1=TAN(30) VAR1 VAR1=TAN(45) VAR1 VAR1=TAN(60) VAR1 RADIAN1 VAR1=TAN(0) VAR1 VAR1=TAN(PI/6) VAR1 VAR1=TAN(PI/4) VAR1 VAR1=TAN(PI/3) VAR1 Exam p le RADIAN0 VAR1=SQRT(2) VAR1=ATAN(VAR1/2) VAR1 VAR1=ATAN(.57735) VAR1 R esp o n se *VAR1=+0.0 *VAR1=+0.57735 *VAR1=+1.0 *VAR1=+1.73205 *VAR1=+0.0 *VAR1=+0.57735 *VAR1=+1.0 *VAR1=+1.
Using Binary Variables The following examples illustrate the 6000 Series product's ability to perform bitwise functions with binary variables. Storing binary values. The 6000 Series Language allows you to store binary numbers in the binary variables (VARB) command. The binary variables start at the left with the least significant bit, and increase to the right. For example, to set bit 1, 5, and 7 you would issue the command VARB1=b1xxx1x1. Notice that the letter b is required.
Program Flow Control Program flow refers to the order in which commands will be executed, and whether they will be executed at all. In general, commands are executed in the order in which they are received. However, certain commands can redirect the order in which commands will be processed. You can affect program flow with: • Unconditional Loops and Branches • Conditional Loops and Branches Unconditional Looping and Branching Unconditional Looping The Loop (L) command is an unconditional looping command.
Example A DESCRIPTION: The program cut1 is executed until it gets to the command GOSUB prompt. From there it branches unconditionally to the subroutine (actually a program) called prompt. The subroutine prompt queries the operator for the number of parts to process. After the part number is entered (e.g.
Flow Control Expression Examples This section provides examples of expressions that can be used in conditional branching and looping commands (UNTIL, WHILE, and IF) and the WAIT command.
Current Motor and Encoder Position (Stepper Products Only) Current Commanded & Actual Position (Servo Products Only) The current motor and encoder positions (PCE, PCM, PE, PER, PM, PMAS, PSHF, PSLV) can be used within an expression, if the operand is compared against a numeric variable or value. When making the comparison, the relational operators (=, >, >=, <, <=, <>) and logical operators (AND, OR, NOT) are used.
RP240 Data Read Immediate Mode (Stand-alone products only) The DREADI1 command allows continual numeric or function key data entry from the RP240 (when used in conjunction with the DREAD and/or DREADF commands). In this immediate mode, program execution is not paused (waiting for data entry) when a DREAD or DREADF command is encountered. Refer to the DREAD and DREADF command descriptions for programming examples. NOTES • While in the Data Read Immediate Mode, data is read into numeric variables only (VAR).
All commands between WHILE and NWHILE are repeated as long as the WHILE condition is true. The following example illustrates how a typical WHILE/NWHILE conditional loop works. In this example, the WHILE loop will execute if the expression is true. If the expression is false, the WHILE loop will not execute.
Program Interrupts (ON Conditions) While executing a program, the 6000 controller can interrupt the program based on several possible ON conditions: programmable input(s) status, user status, or the value of numeric variables #1 or #2. These ON conditions are enabled with the ONCOND command, and are defined with the commands listed below. After the ON conditions are enabled (with the ONCOND command), an ON condition interrupt can occur at any point in program execution.
Error Handling The 6000 Series products have the ability to detect and recover the following error conditions: DEBUG TOOLS For information on program debug tools, refer to page 231.
Canceling the Branch to the Error Program If an error condition occurs and the associated error-checking bit has been enabled with the ERROR command, the 6000 controller will branch to the error program. The error program will be continuously called/repeated until you cancel the branch to the error program. (This is true for all cases except error condition #9, PCUT or ENBL input activated, in which case the error program is called only once.
Error Program Set-up Example The following is an example of how to set up an error program. This particular example is for handling the occurrence of a user fault. Step 1 Create a program file (in Motion Architect's Editor module) to set up the error program: ; *********************************************************************** ; * Assign the user fault input function to programmable input #1.
Non-Volatile Memory (Stand-Alone Products Only) When using stand-alone serial-based 6000 controllers the items listed below are automatically stored in non-volatile memory (battery-backed RAM). Cycling power or issuing a RESET command will not affect these settings. Item 610n 615n 620n 625n 6270 Absolute position reference (PSET) ........................... n/a n/a n/a n/a • Commanded direction polarity (CMDDIR)................. • • • n/a • Compiled profiles (PCOMP) – see note below *.......
2 CHAP T E R T WO Communication IN THIS CHAPTER This chapter will help you understand these aspects of communicating with your 6000 Series product: • Motion Architect™ communication features........................................... 36 • DOS support software for stand-alone products ....................................... 37 • DOS support software for bus-based products ......................................... 38 • PC-AT bus communication registers — bus-based controllers only ............
Motion Architect Communication Features Motion Architect provides easy terminal emulation support in the Terminal, Panel, and Controller Tuner modules: • Terminal emulator window. • Communication setup parameters (board address and interrupts for bus-based controllers, and COM port selection for stand-alone controllers). • Download the bus-based product's soft operating system (prerequisite to connecting, programming, or sending/receiving motion programs).
DOS Support Software for Stand-Alone Products The 6000 DOS Support Disk, which provides a program for RS-232C terminal emulation and program editing for stand-alone products, is available from your local ATC or distributor (or contact Compumotor at the numbers listed on the inside cover of this manual). This program is designed to communicate to a Compumotor 6000 Series stand-alone product via your computer's RS-232C port. Installing and Running the Program Install ...... Place the disk in drive A.
DOS Support for Bus-Based Products NOTE This section uses a generic reference (“AT6nnn”) to represent all 6000 Series bus-based products. When referring to the file names and programming examples, substitute the name of your product where you read “AT6nnn”. For example, if you are using the AT6450, type “AT6450”. E x c e p tio n s : • OEM products: Use the root name of the product (e.g., if using an OEM-AT6400, type “AT6400”). • AT6200 and OEM-AT6200: Type “AT6400”.
Downloading the Operating System Before you can use the bus-based controller within your application you must first download the operating system (6000 Series Command Language). The file called AT6nnn.OPS on the supplied DOS Support Software Diskette contains the operating system. Use the file called AT6nnn.EXE to download the operating system. As an example, to download the controller's operating system, type AT6nnn at the DOS prompt and the operating system (AT6nnn.
Download from the Application Program This section describes how to download from C and PASCAL programs. Downloading from a C Program: To download the operating system from a C program, a child process must be created. The C command spawnl is used to create a child process in which the operating system is downloaded (see code example below). #include #include void main() { int error_code = 0; char *pathname = "C:\\AT6nnn\\AT6nnn.EXE"; char *args[] = { "AT6nnn.
Terminal Emulation Once the operating system has been downloaded, an application program can be run on the controller. The DOS Support Disk provides six terminal emulator programs to allow direct communication with the controller (see table below). Directory Terminal Emulator Program Name FASTTERM MC6ØTERM MC6ØTRMI QB45TERM TC2ØTERM TP5ØTERM FASTTERM.COM MC6ØTERM.EXE MC6ØTRMI.EXE QB45TERM.EXE TC2ØTERM.EXE TP5ØTERM.
Creating Your Own DOS-Based Application Program Creating a program to control an application can often be difficult. To ease the programming burden, Compumotor has provided communication interface routines for ASSEMBLY, BASIC, C, and PASCAL. The routines are supplied in the seven sub-directories on the DOS Support Disk (see table below). Directory File to use Function of the file FASTTERM FASTTERM.ASM Shows how to communicate with the controller using ASSEMBLY. MC6ØTERM MC6ØTERM.C MC6ØLIB.
PC-AT Bus Communication Registers Address (defaults in parenthesis) Function Base, Base+1 Read/write data to/from controller Base (300h)............................................. Write = Send data to controller (HB) Read = Receive data from controller (HB) Base+1 (301h) ........................................ Write = Send data to controller (LB) Read = Receive data from controller (LB) Base+2, Base+3 (302h,303h) Read/Write Fast Status area Base+2 ....................................................
Block 8 Block 7 Block 6 Block 5 Block 4 Block 3 Block 2 Block 1 Fast Status, Servos HEX Offset in Fast Status Area 00 02 04 06 08 0A 0C 0E 10 12 14 16 18 1A 1C 1E 20 22 24 25 26 28 2A 2C 2D 2E 30 31 32 33 34 35 36 37 38 3A 3C 3E Description Size Commanded Position (counts), axis 1 – see TPC Commanded Position (counts), axis 2 Commanded Position (counts), axis 3 Commanded Position (counts), axis 4 Feedback Device Position (counts), axis 1 – see TFB Feedback Device Position (counts), axis 2 Feedback
Retrieving information from the fast status area using C: The source code example below is written in Turbo C. If you are using Microsoft C, replace “inport” with “inpw”, replace “outport” with “outw”, replace “inportb” with “inp”, and replace “outportb” with “out”. This example is also provided on the DOS Support Disk in subdirectory SAMPLES, files TC2ØFAST.C and MC6ØFAST.C. #include
Retrieving information from the fast status area using PASCAL: The following is a source code example written in Turbo PASCAL. This source code example is also provided on the DOS Support Disk in subdirectory SAMPLES, file TP5ØFAST.PAS.
Retrieving information from the fast status area using QuickBASIC: The following is a source code example written in QuickBASIC. This source code example is also provided on the DOS Support Disk in subdirectory SAMPLES, file QB45FAST.BAS. DEFINT A-Z DECLARE DECLARE DECLARE DECLARE SUB SUB SUB SUB requeststatus() setpointer(statusoffset) readstatus() createposition() '--- AT6nnn default address.
QuickBASIC Source Code Example (continued) SUB createposition STATIC '************************************************************************ ' SUBPROGRAM : createposition ' PURPOSE : Manipulate the 4 bytes received from the fast status area into ' a position value. Only call createposition after calling readstatus. ' This function should only be called when reading commanded position ' or encoder position. ' REQUIRES : The 4 status bytes returned from readstatus - status1, ' status2, status3, status4.
Option Information # Provided * Equivalent Size Stepper Servo Status Command (words) (AT6n00) (AT6n50) 1 Commanded velocity (counts/sec) TVEL 2x4 • • 2 Axis status TAS 2x4 • • 3 Programmable input status (including triggers) Programmable output status (including aux.
Status Write (interrupt/status set/reset) Status Write (interrupt enable/disable) D7 D6 D5 D4 D3 1 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 1 D2 0 0 1 0 D1 0 1 0 0 D0 1 0 0 0 D7 D6 D5 D4 D3 0 0 1 D2 D1 D0 Function X Interrupt when output buffer has data: 1 = enable interrupt, 0 = disable interrupt Interrupt when input buffer empty : 1 = enable interrupt, 0 = disable interrupt General controller to PC-AT interrupt: 1 = enable interrupt, 0 = disable interrupt Card status updated interrupt: 1 = enable inte
DLLs (Dynamic Link Libraries) The information in this section is designed to help experienced Windows application programmers create Windows-based applications to interface with bus-based 6000 Series controllers. To help you develop your own Windows applications, Compumotor provides dynamic link libraries (DLLs) for Windows 3.1, Windows 95, and Windows NT.
Visual Basic™ Support NOTE To demonstrate how to use the DLL functions, we've provided all the files for a sample Visual Basic 3.0 project using WIN6400.DLL. Refer to page 57 for details. Visual Basic declarations for all DLL functions and subroutines are described below. Note that some functions are not applicable to all DLLs, and that the syntax for the SendAT6400Block and RecvAT6400Block functions is different when using WN956000.DLL.
DLL Functions for Visual Basic (continued) DLL Function: SendAT6400Block Description: Send a block of up to 256 characters to a 6000 bus-based product. SendAT6400Block will wait until the 6000 controller is ready before sending. By default SendAT6400 will wait forever until the 6000 controller is ready. SetTimeout allows control over this waiting period. Syntax: For WIN6400.DLL and NT6000.DLL: Declare Function SendAT6400Block% Lib "______.dll" (ByVal address%, ByVal cmd$, ByVal irqnum%) For WN956000.
DLL Functions for Visual Basic (continued) DLL Function: request_status Description: Syntax: Tell the controller to update the information in its fast status area. This function will wait until the fast status area has been updated. See set_pointer. Declare Function request_status% Lib "______.dll" (ByVal address%) “address” ..... Board address of the 6000 controller card (must be evenly divisible by 8). Return Value: “-1” indicates that the operating system is not loaded.
DLL Functions for Visual Basic (continued) DLL Function: SendAT6400File Description: Downloads a file of 6000 Series commands to a 6000 series product (one line at a time). Before downloading the file, ERRDEF and ERROK are set to zero. After downloading the file, ERRDEF and ERROK are set to their default values. Syntax: Declare Function SendAT6400File% Lib "______.dll" (ByVal handle%, ByVal address%, ByVal irqnum%, ByVal filename$, ByVal options$) “handle” ........
Sample file for fast status structure, function declarations, and global variables (WIN6400.DLL): SEE ALSO: Driver\vb30\AT6400.BAS '--------------------------------------------------------------------------' Get faststatus structure -- also provided in DRIVER\VB30\AT6400.
VB 3.0 Application Example To demonstrate how to use the DLL functions, we've provided all the files for a sample Visual Basic project using WIN6400.DLL for VB3.0 (see table below for list of files) The files are located in the MA6000\DRIVER\VB30 directory. The project was designed to be executed from Visual Basic 3.0 with no modifications. Project File (*.MAK) Forms (*.FRM) Basic Modules (*.BAS) Icons (*.ICO) AT6400.MAK ADDRESS.FRM AT6400.FRM AT_ERROR.FRM INFO.FRM RECEIVE.FRM STARTUP.FRM AT6400.
Visual C++™ Support Visual C++ declarations for all DLL functions and subroutines are described below. Note that some functions are not applicable to all DLLs, and that the “irqnum” variable is not part of the syntax for the SendAT6400Block and RecvAT6400Block function when using WN956000.DLL. TIP: Before you invoke Visual C++, copy the desired DLL file (WIN6400.DLL, NT6400.DLL or WN956000.DLL) and your controller's _______.
DLL Functions for Visual C++ (continued) DLL Function: SendAT6400Block Description: Send a block of up to 256 characters to a 6000 bus-based product. SendAT6400Block will wait until the 6000 controller is ready before sending. By default SendAT6400 will wait forever until the 6000 controller is ready. SetTimeout allows control over this waiting period. Syntax: wn956000.dll.....short WINAPI SendAT6400Block(short address, LPSTR cmd) nt6400.dll...........
DLL Functions for Visual C++ (continued) DLL Function: request_status Description: Syntax: Variable: Tell the controller to update the information in its fast status area. This function will wait until the fast status area has been updated. See set_pointer. wn956000.dll & nt6400.dll.........short WINAPI request_status(short address) win6400.dll ................................int FAR PASCAL request_status(WORD address) “address”..........
DLL Functions for Visual C++ (continued) DLL Function: Delay Description: Time delay in milliseconds. Syntax: wn956000.dll & nt6400.dll...........void WINAPI Delay (int delay) win6400.dll........void FAR PASCAL Delay (DWORD delay) “timedelay” .......Time delay in milliseconds. Variable: Return Value: NONE DLL Function: SendAT6400File Description: Downloads a file of 6000 Series commands to a 6000 series product (one line at a time). Before downloading the file, ERRDEF and ERROK are set to zero.
Visual C++ Sample Applications Source code for sample Windows applications are provided for each DLL. (For additional information, refer to the README.TXT files in the respective sub-directory.) • WN956000.DLL - Directory is MA6000\Drivers\win95 - Windows 95 (32-bit) application is called “Mawin95” - For details about each source file, refer to the README.TXT file. - The application must be compiled using the 32-bit version of Visual C++. • NT6400.DLL - Directory is MA6000\Drivers\nt35 - Windows NT 3.
PC-AT Interrupts NOTE This section uses a generic reference (“AT6nnn”) to represent all 6000 Series bus-based products. When referring to the file names and programming examples, substitute the name of your product where you read “AT6nnn”. (e.g., if you are using the AT6450, type “AT6450”) Exceptions: For the OEM-AT6400, AT6200, & OEM-AT6200 products, type “AT6400”. This section describes how to write PC-AT software that exploits the interrupt capability of the bus-based 6000 Series controller (AT6nnn).
8259 Interrupt Enable PC-AT Hardware Interrupt (highest to lowest priority) The PC-AT has two 8259 interrupt controllers that allow up to 15 different hardware devices to interrupt the PC-AT. The first 8259 (at base port address 20H) handles interrupts IRQ0-IRQ7. The second 8259 (at base port address A0H) handles interrupts IRQ8-IRQ15. The table below lists the PC-AT hardware interrupts by precedence (from highest to lowest priority). Programming of the 8259 controller establishes this precedence.
How to Use Interrupts This section leads you through the following steps for using interrupts: ➀ ➁ ➂ ➃ Install address of interrupt service routine (ISR) in 80x86 interrupt vector table Enable hardware interrupts (IRQ0-IRQ15) within 8259 interrupt controller Enable interrupt sources within AT6nnn Process interrupts in ISR a. Identify interrupt b. Process interrupt c. Clear interrupt d.
Setting a bit to zero (0) will enable a particular hardware interrupt. For example, to enable the IRQ5 interrupt: #define IRQ5_MASK Øx2Ø /* Bit 5 of 8259 IMR */ outp(0x21, inp(0x21) & ~IRQ5_MASK); /* Enable IRQ5 interrupt */ Because interrupts on the second 8259 controller are software redirected to IRQ2 on the first 8259, we must also enable the IRQ2 interrupt for these interrupts.
Bits 0, 1, 2 and 3 of the AT6nnn status register can be used to identify the interrupt. For example, if the AT6nnn general-purpose interrupt is enabled, then check bit 2 of the AT6nnn status register to see if a general-purpose interrupt occurred.
Interrupt-Driven Terminal Emulator MC6ØTRMI.EXE is an interrupt-driven terminal emulator for the AT6nnn that is provided (along with source code) on the AT6nnn DOS Support Disk. This software, written in Microsoft C 6.0, shows how to exploit three of the four available AT6nnn interrupts. • AT6nnn output-buffer-has-data interrupt • AT6nnn input-buffer-is-empty interrupt • AT6nnn general purpose interrupt (see INTHW command) The file MC6ØTRMI.C contains the background polling loop, and the file MC6ØLIBI.
AT6nnn Interrupt Driver The AT6nnn interrupt driver can be thought of as having a top half and a bottom half ( see illustration below). Top Half do_isr() undo_isr() ReadRingBuffer() WriteRingBuffer() inbuff[] outbuff[] Bottom Half AT6nnn_isr() The top half consists of those functions that can be called from your program (see table below).
Controlling Multiple Serial Ports Every stand-alone 6000 Series product has two serial ports. On existing 6000 products, the RS-232 connector (or Rx, Tx, and GND terminals on an AUX connector) is referenced as the “COM1” serial port, and the RP240 connector is referenced as the “COM2” serial port. Newer products have connectors labeled “COM1” (factory default function is RS-232) and “COM2” (factory default function is RP240). New features were added in software revision 4.
Setup for 6000 Language or RP240 To configure the COM ports for use with 6000 language commands or an RP240, use the DRPCHK command. The DRPCHK command affects the COM port selected with the last PORT command. The default for COM1 is DRPCHKØ; the default for COM2 is DRPCHK3. The DRPCHK setting is automatically saved in non-volatile memory. NOTE: Only one COM port may be set to DRPCHK2 or DRPCHK3 at any given time. DRPCHKØ .....Use the COM port for 6000 language commands only.
RS-232C Daisy-Chaining Up to ninety-nine stand-alone 6000 Series products may be daisy-chained. There are two methods of daisy-chaining: one uses a computer or terminal as the controller in the chain; the other uses one 6000 product as the master controller. Refer to you product's Installation Guide for daisy-chain connections.
To receive data from a particular controller on the chain, you must prefix the command with the appropriate unit's device address and an underline: C o m m an d s: 1_A *A50,50 ; Request acceleration information from unit #1 ; Response from unit #1 Use the E command to enable/disable RS-232C communications for an individual unit. If all 6000 controller units on the daisy chain are enabled, commands without a device address identifier will be executed by all units.
Daisy-Chaining from a Master 6000 Controller Controlling the daisy-chain from a master 6000 controller (the first unit on the daisy-chain) requires the programs stored in the master controller to control program and command execution on the slave controllers. The example below demonstrates the use of the WRITE command to send commands to other units on the daisy chain. NOTE The last unit on the daisy-chain must have RS-232C echo disabled (ECHOØ command).
RS-485 Multi-Drop (RS-485 Compatible Products Only) Up to 99 stand-alone 6000 Series products may be multi-dropped. Refer to your product's Installation Guide for multi-drop connections. To establish device addresses, using the ADDR command (the 6104 also allows you to set the device address with DIP switches, providing up to 31 unique addresses): The ADDR command allows you to establish up to 99 unique addresses.
3 CHAP T E R T HRE E Basic Operation Setup IN THIS CHAPTER This chapter will enable you to understand and implement these basic operation features: • Before You Begin (setup programs, Motion Architect, resetting, etc.) ............ 78 • Participating Axes................................................................................ 79 • Memory Allocation.............................................................................. 80 • Drive Setup .........................................................
Before You Begin WARNING The 6000 Product is used to control your system's electrical and mechanical components. Therefore, you should test your system for safety under all potential conditions. Failure to do so can result in damage to equipment and/or serious injury to personnel. Setup Parameters Discussed in this Chapter Other status commands are described on page 232. Setup Parameter Below is a list of the setup parameters discussed in this chapter.
Using a Setup Program The features described in this chapter are configured with certain 6000 Series commands, commonly referred to as “setup commands.” We recommend placing these commands (except MEMORY) into a special “setup program” that is executed to prepare the 6000 Series product for subsequent controller operations. Further details about setup programming is provided in the Creating and Executing a Setup Program section, page 14.
Memory Allocation For details about memory allocation, refer to the Storing Programs on page 12. CAUTION Issuing a new MEMORY command (e.g., MEMORY3ØØØØ,1ØØØØ) will erase all existing programs and compiled contouring path segments residing in the 6000 product's memory. To determine the status of memory allocation, use the TMEM command. If you are using a stand-alone serial product, do not place the MEMORY command in the program assigned as the startup (STARTP) program.
Drive Resolution (steppers only) This setup parameter is not required for packaged drive/controller products (e.g., 610n, 615n, 6201). The drive resolution controls the number of steps the stepper controller considers as a full revolution for the motor drive. The controller's resolution is set with the DRES command (default is 25,000 steps/rev). Refer to the user documentation that accompanied your drive if you need to change its resolution.
Start/Stop Velocity (steppers only) The Start/Stop Velocity (SSV) command specifies the instantaneous velocity to be used when starting or stopping. By using the SSV command, there will be no acceleration from zero units/sec to the SSV value; instead, motion will immediately begin with a velocity equal to the SSV value. This command is useful for accelerating past low-speed resonant points, where a full- or halfstepping drive may stall. With microstepping systems, this command is not necessary.
Axis Scaling FOLLOWING: Use the SCLMAS command to establish a distance scale factor for the master axis. Refer to page 196 for details. The scaling commands allow you to scale acceleration, deceleration, velocity, and position to values that are appropriate for your application. The SCALE, SCLA, SCLV, SCLD, PSCLA, PSCLV, and PSCLD commands are used to implement the scaling features.
Acceleration & Deceleration Scaling (SCLA and PSCLA) Steppers: If scaling is enabled (SCALE1), all accel/decel values entered are internally multiplied by the acceleration scaling factor to convert user units/sec2 to motor steps/sec2. The scaled values are always in reference to motor steps, not encoder steps, regardless of the ENC command setting.
SCLV/PSCLV Value (steps/unit) Velocity Resolution (units/sec) Decimal Places 1-9 10 - 99 100 - 999 1000 - 9999 10000 - 99999 100000 - 999999 1 0.1 0.01 0.001 0.0001 0.00001 0 1 2 3 4 5 Use the following equations to determine the maximum velocity range for your product type. Max. Velocity for Stepper Products 8, 000, 000 n SCLV n = PULSE x 16; If n < 5, then n is set equal to 5. If n > 5, then all fractional parts of n are truncated. Max.
Scaling Examples Steppers Axis #1 controls a 25,000 step/rev motor/drive system attached to a 5-pitch leadscrew. The user wants to program motion parameters in inches; therefore the scale factor calculation is: 25,000 steps/rev x 5 revs/inch = 125,000 steps/inch. For instance, with a scale factor of 125,000, the operator could enter a move distance value of 2.000 and the controller would send out 250,000 pulses, corresponding to two inches of travel.
Positioning Modes The 6000 controller can be programmed to position in either the preset (incremental or absolute) mode or the continuous mode. You should select the mode that will be most convenient for your application. For example, a repetitive cut-to-length application requires incremental positioning. X-Y positioning, on the other hand, is better served in the absolute mode.
Preset Positioning Mode A preset move is a point-to-point move of a specified distance. You can select preset moves by putting the 6000 controller into preset mode (canceling continuous mode) using the MCØ command. Preset moves allow you to position the motor/load in relation to the previous stopped position (incremental mode—enabled with the MAØ command) or in relation to a defined zero reference position (absolute mode—enabled with the MA1 command).
Continuous Positioning Mode The Continuous Mode (MC1) is useful in these situations: • Applications that require constant movement of the load • Synchronize the motor to external events such as trigger input signals • Changing the motion profile after a specified distance or after a specified time period (T command) has elapsed You can manipulate the motor movement with either buffered or immediate commands.
End-of-Travel Limits The 6000 controller can respond to both hardware and software end-of-travel limits. The purpose of end-of-travel limits is to prevent the motor's load from traveling past defined limits. HARDWARE LIMITS 6000 controllers are shipped from the factory with the hardware end-of-travel limits enabled, but not connected.
Homing (Using the Home Inputs) The homing operation is a sequence of moves that position an axis using the Home Limit input and/or the Z Channel input of an incremental encoder. The goal of the homing operation is to return the load to a repeatable initial starting location. Refer to the product's Installation Guide for instructions to wire hardware home limit switches.
Figures A and B show the homing operation when HOMBAC is not enabled. “CW” refers to the positive direction and “CCW” refers to the negative direction. Velocity Home Active Region Velocity Home Active Region Initial Position Position CCW Edge of Home CW Edge of Home CCW Limit CCW Edge of Home CW Limit Initial Position CCW Limit Figure A. Homing in a CW Direction (HOMØ) with backup to home disabled (HOMBACØ) Positive Homing, Backup to Home Enabled CW Edge of Home Position CW Limit Figure B.
Figures D through F show the homing operation for different values of HOMDF and HOMEDG, when HOMBAC is enabled. “CW” refers to the positive direction and “CCW” refers to the negative direction. Velocity Home Active Region Velocity Home Active Region Position Initial Position CCW Edge of Home CCW Limit Position Initial Position CW Edge of Home CW Limit CCW Edge of Home CW Edge of Home CCW Limit Figure D. Homing in a CW Direction (HOMØ) with HOMBAC1, HOMEDG1, HOMDFØ CW Limit Figure E.
Homing Using The Z-Channel Figures K through O show the homing operation when homing to an encoder index pulse, or Z channel, is enabled (HOMZ1). The Z-channel will only be recognized after the home input is activated. It is desirable to position the Z channel within the home active region; this reduces the time required to search for the Z channel. “CW” refers to the positive direction and “CCW” refers to the negative direction.
Closed-Loop Stepper Setup (steppers only) NOTE Closed Loop operation is not available for the OEM-AT6400. Closed-loop refers to operating with position feedback from an encoder. This section discusses how you can use an incremental encoder to perform closed-loop functions with the controller. When using an encoder in an application, you may configure the following (described below): • Encoder Resolution • Encoder vs.
Stall Detection & Kill-on-Stall The ESTALL1 command allows the controller to detect stall conditions. If used with Kill-onStall enabled (ESK1 command), the move in progress will be aborted upon detecting a stall. If queried with the ER or the AS commands, the user may branch to any other section of program when a stall is detected. Refer to the ENC, ER, and AS command descriptions in the 6000 Series Software Reference for more information. Stall Detection functions in either motor step or encoder step mode.
Encoder Polarity If the encoder input is counting in the wrong direction, you may reverse the polarity with the ENCPOL command. This allows you to reverse the counting direction without having to change the actual wiring to the encoder input. For example, if the encoder on axis 2 counted in the wrong direction, you could issue the ENCPOLx1 command to correct the polarity.
Servo Setup (servo products only) EXAMPLES Pages 103 and 104 show examples of servo setup commands as used in a setup program. Servo products are closed loop systems (see diagram below). As such, they require configuration so that the control algorithm can effectively calculate the value of the control signal output based on the feedback data from a feedback device, such as an encoder, resolver, ANI input, or LDT: • Tuning: - Select gains to achieve optimal servo performance.
Tuning For an overview of servo control terminology and techniques, refer to the Servo Tuner User Guide, or to your product's installation guide. To assure optimum performance and , you should tune your servo system. The goal of the tuning process is to define the gain settings, servo performance, and feedback setup (see command list below) that you can incorporate into your application program. (Typically, these commands are placed into a setup program – see examples on page 103).
Feedback Device Polarity Servo stability requires a direct correlation between the commanded direction and the direction of the feedback device counts (i.e., a positive commanded direction from the controller must result in positive counts from the feedback device). To change the commanded and feedback polarity, use the CMDDIR command instead (see page 101 for details).
Commanded Direction Polarity The CMDDIR command allows you to reverse the direction that the controller considers to be the “positive” direction; this also reverses the polarity of the counts from the feedback devices. Thus, using the CMDDIR command, you can reverse the referenced direction of motion without the need to (a) change the connections to the drive/valve and the feedback device, or (b) change the sign of all the motion-related commands in your program.
DAC Output Limits If you will not be using the entire -10V to +10V range of the 6000 controller's analog output, you can set up maximum (DACLIM) and minimum (DACMIN) limits. (DACMIN is available only for the 6270.) 6270 EXAMPLE: If are using a 4-20mA control loop, set the analog output jumpers to operate at ±20mA (instructions provided in the 6270 installation/user guide). Then issue these setup commands listed below.
Servo Setup Examples This section shows examples of how the servo setup commands might be incorporated into a setup program. More information on creating and executing setup programs is provided on page 14.
6270: DEF PWRUP DRIVE00 INDAX2 SSFR4 DRFLVL11 KDRIVE11 ; ; ; ; ; ; Begin definition of PWRUP program Disable both valves/drives Place both axes in use Select servo sampling frequency ratio Set drive fault level to active high Enable the DISABLE ON KILL feature for both axes ;************************************************************************ ;* setup for LDT * ;* (will need to switch between LDT, encoder, and ANI feedback) * ;************************************************************************
Target Zone Mode (Move Completion Criteria) Position Under default operation (Target Zone Mode not enabled), the 6000 product's move completion criteria is simply derived from the move trajectory. The 6000 product considers the current preset move to be complete when the commanded trajectory has reached the desired target position; after that, subsequent commands/moves can be executed for that same axis.
Programmable Inputs and Outputs (including triggers and auxiliary outputs) Programmable inputs and outputs allow the controller to detect and respond to the state of switches, thumbwheels, electronic sensors, and outputs of other equipment such as drives and PLCs. Based on the state of the inputs and outputs, read with the [IN] and [OUT] commands, the controller can make program flow decisions and assign values to binary variables for subsequent mathematical operations.
Programmable I/O Bit Patterns I/O specifications are provided in your product's installation guide. Product AT6200 The total number of inputs and outputs, including trigger inputs and auxiliary outputs, varies from one 6000 Series product to another. Consequently, the bit patterns for the programmable inputs and outputs also vary by product. For example, for the AT6400 the TRG-A trigger input is represented by programmable input bit #25, but for the ZETA6104 the TRG-A trigger input is bit #17.
Input Functions The input functions are assigned with the INFNCi-c command. The “i” represents the number of the input bit (see bit pattern table on page 107). The “” represents the number of the axis, if required. The “c” represents the letter designator of the function, A through Q (see list below). For example, the INFNC5-2D command configures output #5 to function as a stop input, stopping motion on axis #2 when activated.
Input Debounce Time Using the Input Debounce Time (INDEB) command, you can change the input debounce time for all general-purpose inputs (one debounce time for all), or you can assign a unique debounce time to each of the 2 trigger inputs. General-Purpose Input Debounce: The input debounce time for the 24 generalpurpose inputs is the period of time that the input must be held in a certain state before the controller recognizes it.
BCD Program Select (INFNCi-B) General-purpose inputs (not trigger inputs) can be defined as BCD program select inputs. This allows you to execute defined programs (DEF command) by activating the program select inputs. Program select inputs are assigned BCD weights. The table to the right shows the BCD weights of the controller's inputs when inputs 1-8 are configured as program select inputs. The inputs are weighted with the least weight on the smallest numbered input.
Kill (INFNCi-C) An input defined as a Kill input will stop motion on all axes, the program currently in progress will also be terminated, the commands currently in the command buffer will be eliminated, and the drive will be left in the enabled state (DRIVE1111). Servos: Motion is stopped at the rate set with the hard limit (LHAD& LHADA) commands.
User Fault (INFNCi-F) An input defined as a User Fault input acts as an immediate Kill (!K) command, stopping motion on all axes and terminating program execution. If error-checking bit #7 is enabled (e.g., ERROR.7-1), then a user fault input will cause a branch to the ERRORP error program (for more information, see Error Handling on page 30) and the occurrence of a user fault input will be reported by error bit #7 (see TERF, TER and ER commands).
Position Capture Accuracy Servos: If you are capturing the position/value of a feedback source (encoder, ANI, LDT) that is currently selected with the SFB command, the position capture accuracy is ±50 µs ∗ current velocity. If you are capturing the position of a device that is not selected with the SFB command, the last sampled position is simply stored as the captured position.
FMCNEW Function: (TRGFNcx1xxxxx) Allows a new Following master cycle to begin when the specified trigger input (c) goes active. For additional details on master cycles, refer to page 208 or to the FMCNEW command description. These trigger functions are cleared once the function is complete. To use the trigger to perform a GOWHEN function again, the TRGFN command must be given again.
Once you set up the jog functions and move profile, you can attach a switch to the designated jog inputs and perform jogging. (Jog motion will not occur unless Jog Mode is enabled with the JOG command.) The example below shows you how to define a program to set up jogging. Example Step 1 D ef in e p r o g r am f o r jo g set u p : DEF prog1 SCALE0 JOGA25 JOGAD25 JOGVL.
Program Security Issuing the INFNCi-Q command enables the Program Security feature and assigns the Program Access function to the specified programmable input. (INFNCi-Q) The program security feature denies you access to the DEF, DEL, ERASE, MEMORY, and INFNC commands until you activate the program access input. Being denied access to these commands effectively restricts altering the user memory allocation.
Output Status Code Examples As shown below, you can use the OUTFNC command to determine the current function and state (on or off) of one or all the outputs. The TOUT command also reports the outputs' state, but in a binary format (see bit pattern table on page 107). The TSTAT command also reports the outputs' functions (by letter designator) and their current state (see page 232). C o m m an d R esp o n se OUTFNC...........
Program in Progress (OUTFNCi-C) When assigned the Program in Progress function, the output will activate when a program is being executed. After the program is finished, the output's state is reversed. The action of executing a program is also reported with system status bit 3 (see TSSF, TSS and SS commands). Limit Encountered When assigned the Limit Encountered function, the output will activate when a hard or soft end-of-travel limit has been encountered.
Output on Position (OUTFNCi-H) Servos Only The Output on Position functions are assigned to the axes and corresponding auxiliary outputs: • • • • For axis 1: For axis 2: For axis 3: For axis 4: Function assigned only to OUT-A (e.g., OUTFNC25-H command for the AT6n50) Function assigned only to OUT-B (e.g., OUTFNC26-H command for the AT6n50) Function assigned only to OUT-C (e.g., OUTFNC27-H command for the AT6n50) Function assigned only to OUT-D (e.g.
Variable Arrays (teaching variable data) More on variables: see page 18. Variable data arrays provide a method of storing (teaching) variable data and later using the stored data as a source for motion program parameters. The variable data can be any value that can be stored in a numeric (VAR) variable (e.g., position, acceleration, velocity, etc).
Teach the Data to the Data Program The data that you wish to write to the data elements in the data program must first be placed into numeric variables (VAR). Once the data is stored into numeric variables, the data elements in the data program can be edited by using the Data Pointer (DATPTR) command to move the data pointer to that element, and then using the Data Teach (DATTCH) command to write the datum from the numeric variable into the element.
Summary of Related 6000 Series Commands A detailed description of each command is provided in the 6000 Series Software Reference. DATSIZ ..... Establishes the number of data elements a specific data program is to contain. A new DATPi program name is automatically generated according to the number of the data program (i = 1 through 50). The memory required for the data program is subtracted from the memory allocated for user programs (see MEMORY command). DATPTR .....
Step 1 Step 2 Step 3 Initialize a Data Program. DEL DATP1 ; Delete data program #1 (DATP1) in preparation for ; creating a new data program #1 DATSIZ1,1Ø ; Create data program #1 (named DATP1) with an allocation ; of 10 data elements. Each element is initialized to zero. Define the SETUP Subroutine. The SETUP subroutine need only run once. DEF SETUP ; Begin definition of the subroutine called SETUP JOYVH3,3 ; Set the high velocity speed to 3 units/sec JOYVL.2,.2 ; Set the low velocity to 0.
Step 4 Step 5 Define the D O P A T H Subroutine. DEF DOPATH ; Begin definition of the subroutine called DOPATH HOM11 ; Move both axes to the home position ; (absolute counters set to zero) A5Ø,5Ø ; Set up the acceleration V3,3 ; Set up the velocity DATPTR1,1,1 ; ; ; ; ; ; ; REPEAT ; Set up a repeat/until loop D(DAT1),(DAT1) ; The position of axis 1 and axis 2 are recalled into ; the distance command GO11 ; Move to the position T.5 ; Wait for 0.
4 CHAP T E R F OUR User Interface Options IN THIS CHAPTER This chapter explains how to use these user interface options in your application: • Safety Features .................................................................................... 126 • I/O Device Interface (thumbwheels, PLCs, etc.)......................................... 128 • RP240 Remote Operator Panel (stand-alone products only) .......................... 130 • Joystick Interface (including feedrate override)..............................
Safety Features WARNING The 6000 Product is used to control your system's electrical and mechanical components. Therefore, you should test your system for safety under all potential conditions. Failure to do so can result in damage to equipment and/or serious injury to personnel. To help ensure a safe operating environment, you should take advantage of the safety features listed below. These features must not be construed as the only methods of ensuring safety.
Options Overview (application examples) The following are some application examples for the basic user interface options. Your application may require any one or combination of these options. Stand-Alone Interface Options After defining and storing controller programs, the controller can operate in a stand-alone fashion. A program stored in the controller may interactively prompt the user for input as part of the program (input via I/O switches, thumbwheels, RP240, joystick).
Programmable I/O Devices Programmable I/O Functions Programmable inputs and outputs are provided to allow the controller to detect and respond to the state of switches, thumbwheels, electronic sensors, and outputs of other equipment such as drives and PLCs. Listed below are the programmable functions that may be assigned to the programmable I/O. Programmable I/O offering differs by product.
Thumbwheels You can connect the controller's programmable I/O to a bank of thumbwheel switches to allow operator selection of motion or machine control parameters. The controller allows two methods for thumbwheel use. One method uses Compumotor's TM8 thumbwheel module or IM32 input module. The other allows you to wire your own thumbwheels. The TM8 requires a multiplexed BCD input scheme to read thumbwheel data. Therefore, a decode circuit must be used for thumbwheels.
OUTPLC1,1-4,0,12 ; ; ; ; ; INPLC1,1-8,9 INLVL000000000 Step 3 Config PLC output set 1: outputs 1-4 are strobe outputs, no output enable bit, 12 ms strobe time per digit read. Configure PLC input set 1: inputs 1-8 are data inputs, input 9 is a sign input, no data valid input. Inputs 1-9 configured active low The thumbwheels are read sequentially by outputs 1-4, which strobe two digits at a time. The sign bit is optional.
Configuration NOTE As shipped from the factory, you can operate the RP240 from your 6000 product's “COM 2” or “RP240” port. This should be appropriate for the majority of applications. For more information on controlling your product's multiple serial ports, refer to page 70. Every stand-alone 6000 Series product has two serial ports.
Programming Example DEF panel1 REPEAT DCLEAR0 DWRITE"SELECT A FUNCTION KEY" DPCUR2,2 DWRITE"DIST" DPCUR2,9 DWRITE"GO" DPCUR2,35 DWRITE"EXIT" VAR1 = DREADF IF (VAR1=1) GOSUB panel2 ELSE IF (VAR1=2) DLED1 GO1 DLED0 NIF NIF UNTIL (VAR1=6) DCLEAR0 DWRITE"LAST FUNCTION KEY = F" DVAR1,1,0,0 END ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; Define program panel1 Start of repeat loop Clear display Display text "SELECT A FUNCTION KEY" Move cursor to line 2 column 2 Display text "DIST" Move cursor to line 2 co
• If you change the password with the DPASS command, the menu marked with [ALT] becomes the power-up menu. The default password is the root name for your product (e.g., “6250” for the OEM6250, “6104” for the ZETA6104). • Arrows indicate the menu path when you press the corresponding function key below the menu item. • To back up to the previous menu item, press the MENU RECALL button.
Running a Stored Program COMPUMOTOR NNNN MOTION CONTROLLER RUN JOG STATUS DRIVE DISPLAY ETC COMPUMOTOR NNNN MOTION CONTROLLER ACCESS RUN or PROGRAM/LABEL TO RUN IS: MAIN FIND ALPHA <-> TRACE PROGRAM/LABEL TO RUN IS: MAIN FIND ALPHA <-> TRACE STEP STEP After accessing the RUN menu, press F1 to “find” the names of the programs stored in the 6000 product's memory; pressing F1 repeatedly displays subsequent programs in the order in which they were stored in BBRAM.
Open Loop Jogging — 6270 ONLY RUN JOG: 6270 MOTION CONTROLLER STATUS DRIVE DISPLAY JOG CLOSED LOOP AXIS 1: L/R LO 0.5000 V ETC OPEN LOOP AXIS 2: U/D LO 0.5000 V EDIT JOG* * The HI and LO values in the open-loop jog menu represent volts. When using the open-loop jog mode, you should be aware of these conditions: - WARNING — The hardware and software end-of-travel limits are disabled. Make sure it is safe to operate without end-of-travel limits before using the open-loop jog function.
Status Reports: I/O, Limits, Position COMPUMOTOR NNNN MOTION CONTROLLER RUN JOG STATUS DRIVE DISPLAY ETC 6270 only DISPLAY: I/O LIMITS JOY POSITION: ENC COM POS ANI LDT IN: 0000_0000_0000_0000_0000_0000_00 OUT: 0000_0000_0000_0000_0000_0000_00 ENCODER1: AXIS 1: AXIS 2: COMMAND1,2: FEEDACK1,2: +0 +0 ANI1,2: +0 +0 LDT1,2: +0 +0 POS:1 POS:1 NEG:1 NEG:1 HOME:0 HOME:0 CH1,2,3: 1.250 AUX,TRG,SEL,VEL,REL: 00000 MOTOR1,2: ENCODER1,2: +0 +0 +0 +0 ENABLE:1 1.250 ERROR +0 +0 +0 1.
Enabling and Disabling the Drive(s) In the DRIVE menu, the current status of the drive(s) is displayed. To enable or disable the drive #1, press F1 or F2. To enable or disable the drive #2, press F3 or F4. This menu offers the same functionality as the DRIVE command. COMPUMOTOR NNNN MOTION CONTROLLER RUN JOG STATUS DRIVE DISPLAY ETC DRIVE 1: ON ON OFF DRIVE 2: ON ON OFF WARNING Shutting down a rotary drive system allows the load to freewheel if there is no brake installed.
Joystick and Analog Inputs The 6000 controller has up to four 8-bit analog input channels (CH1 - CH4). The analog inputs ☞ are configured as discrete single-ended inputs, with an input range of 0.0V to 2.5V. These inputs Refer to your Installation Guide for connection procedures. can be used to control an axis with a joystick (see Joystick Control). If you have a stepper product, you can use these inputs to scale velocity during feedrate override (see Feedrate Override).
The table below describes the analog inputs available for joystick control (see diagram for Joystick Control Inputs connections). The status of each input is reported with the TINOF and TINO commands. The INO operator allows you to use an input's bit status in an assignment or comparison operation. Joystick potentiometers are 5KΩ with 60° of usable travel adjusted to span 0Ω to 1KΩ.
Joystick Set Up Example This example represents a typical two-axis joystick application in which a high velocity range is required to move to a region, then a low velocity range is required for a fine search. After the search is completed it is necessary to record the load positions, then move to the next region. The joystick trigger input can be used to indicate that the position should be read. The joystick release is used to exit the joystick mode and continue with the motion program.
Feedrate Override (multi-axis steppers only) Feedrate override is used to synchronously scale all phases of motion on all axes (except distance). The amount of scaling is expressed in terms of percentage from 0 to 100. The percentage of feedrate can be controlled by an analog voltage or by the FRPER command. When feedrate override is enabled, the frequency at which the controller's motion algorithm updates the velocity output varies according to the feedrate percentage specified.
ANI Analog Input Interface Refer to your product's Installation Guide for ANI connection information. (only servo controllers with ANI option) 6000 Series servo controllers with the -ANI option offer ±10V, 14-bit analog inputs (referred to as “ANI” inputs). Each input has an anti-aliasing filter and is sampled at the servo sample rate (set with the SSFR command).
Host Computer Interface Another choice for a user interface is to use a host computer and execute a motion program using the RS-232C serial interface. A host computer may be used to run a motion program interactively from a BASIC or C program (high-level program controls the 6000 product and acts as a user interface). A BASIC program example (for the 6250 product) is provided below.
Graphical User Interface (GUI) Development Tools TO ORDER To order Motion OCX Toolkit™, DDE6000™, or Motion Toolbox®, contact your local Automation Technology Center (ATC) or distributor. Dynamic Link Libraries (DLLs) For detailed information about the DLLs, see page 51. To help you develop your own Windows applications, Compumotor provides dynamic link libraries (DLLs) for Windows 3.1, Windows 95, and Windows NT.
5 CHAP T E R F I VE Custom Profiling IN THIS CHAPTER This chapter explains how to use these custom profiling features: • S-Curve Profiling (servos only).................... 146 • Streaming Mode (bus-based steppers only) ...... 148 • Linear Interpolation .................................... 152 • Contouring (circular interpolation) ................ 153 • Compiled Motion Profiling ......................... 163 • On-the-Fly Motion (pre-emptive GOs)............ 178 • Registration .............................
S-Curve Profiling (servos only) S-curve programming requirements. Time Time Maximum Jerk Decel Accel Decel Accel S-curves improve position tracking. S-Curve Velocity Trapezoidal Velocity S-curve profiling is not available during Contouring. 6000 servo controllers allow you to perform S-curve move profiles, in addition to the usual trapezoidal profiles.
V S-Curve (Aavg > 1/2 Amax) V Pure S-Curve (Aavg = 1/2 Amax) T A max T A A A avg A max A avg T T AD avg AD AD avg AD max AD AD max • Once you enter an Aavg value that is ≠ zero and satisfies 1/2 Amax ≤ Aavg < Amax, S-curve profiling is enabled, but only in the operation that uses that particular Aavg command. For example, entering a HOMAA command enables S-curve acceleration profiling only for homing moves, not for other functions such as jogging (which would require the JOGAA command).
Example In this example, Axis 1 executes a pure S-curve profile that takes 1 second to reach a velocity of 5 rps and 1 second to return to zero velocity. Axis 2 executes a trapezoidal profile that takes 0.5 seconds to reach a velocity of 5 rps and 0.5 seconds to return to zero velocity.
Greater in-depth discussions on each SD command function are provided in the 6000 Series Software Reference. CAUTION Minimized Error Checking: In both streaming modes, the SD commands are executed in the motion trajectory update. Because of processing time constraints, error checking is minimal. For instance, a 2 in a field designated for a 1 or 0 may turn on unexpected outputs. Entering data greater than the maximum distance or frequency will cause unexpected motor positioning.
The grinding wheel is rotated by a constant velocity motor that is either on or off. The motor is controlled by a single output. During the X-axis traverse, the constant velocity motor is turned on just prior to grinding, and turned off immediately after grinding. Points ON and OFF in the above illustration are where the motor is turned on and off. The whole process will be initiated by an input, and will loop continuously until a second input is toggled.
GRINDING PROGRAM (continued) SD600 ; Total distance moves after this SD point = 100000 steps SD(VAR1) ; Loop 100 times for Part 1, 200 times for Part 2 SD500 ; Move 500 steps/update (Grinding section A) SD500000000 ; End loop SD700 ; Begin traverse to grind point B SD900 SD1100 SD1400 SD1700 SD2000 SD2200 SD400000012 ; Loop 12 times (distance = 30000 steps) SD2500 ; Move 2500 steps/update SD500000000 ; End loop SD2200 ; Decelerate to grind section B SD2000 SD1700 SD1400 SD1100 SD900 SD700 SD(VAR1) ; Loop 10
Linear Interpolation The controller allows you to perform linear interpolation, the process of moving two or three orthogonal (right angle) linear axes to achieve linear (straight line) motion; a fourth axis may also participate in the move profile. The task is to derive appropriate move parameters to move from a current location to a new location, where each position is specified by a set of Cartesian coordinates. All axes must start, accelerate, decelerate, and stop in a synchronized manner.
Contouring (Circular Interpolation) NOTE • Contouring is not applicable to single-axis products. • 2-axis products can accommodate only 2axis (X & Y) contouring. 6000 Series controllers allow you to define and execute two-dimensional motion paths. A path refers to the path traveled by the load in an X-Y plane, and must be defined before any motion takes place along that path. The X and Y axes can be specified as any of the controller's two axes.
You can store the maximum number of paths possible (see table above) as long as each path has at least one segment, and the sum of all the segments of all the paths does not exceed the controller's memory limitation for paths. All path definitions may be compiled and ready to execute at any time. Paths defined using 6000 commands are specified with a path name. Once a path definition is compiled, it may be executed repeatedly without being re-compiled.
P Y The P axis will keep a position that is proportional to the distance traveled along the X-Y path as the path is executed. This allows the P axis to act as the Z axis in helical interpolation (see drawing at left), or to control the motion of any object which moves with distance and velocity proportional to the path. The P axis must also be specified by the signed ratio of P axis travel to path travel. The magnitude of this ratio may range from 0.001 to 1000.
Coordinate systems allow the assignment of an arbitrary X-Y position as a reference position for subsequent absolute end-point specifications. The controller allows the use of two coordinate systems for use with absolute coordinate programming. These are called the Work coordinate system and the Local coordinate system. These are specified with the PWC and PLC commands. Neither coordinate system needs to represent the actual absolute position of the axes when the path actually executes.
Arc Segments 180° - Y Axis 90° + Increasing Degrees + - 270° Radius Tolerance Specifications Arcs are more complex to specify than lines, because there are four possible ways to get from the start point to the end point. The radius of an arc may either be specified directly or implied by the center specification. In the controller, all path descriptions refer to the X-Y plane. The general convention describing the X-Y plane, as viewed from a drawing, is as follows.
Center Specified Arcs End Point (150,50) R= 70.7 R = 100 Start Point (0,0) Center (100,0) Specification of an arc using the center method requires knowledge of the start point, the end point, and the center point of the arc. The X coordinate of the center is referred to with the letter I, and the Y coordinate of the center is referred to with the letter J. When an arc is specified with the center, another potential problem arises.
mechanical configurations will tolerate such abrupt changes, and the controller will accept such a program; however, it is generally good practice to design paths with smooth direction changes. This may be done by designing a path using arcs to round corners.
Outputs Along the Path For each segment, you may also specify an output pattern (POUT), which is to be applied to the programmable outputs at the beginning of that segment and remains throughout that segment. These segment-defined output patterns are stored as part of the compiled path definition. These outputs will change state at some time between 1.5 ms before the beginning of the segment and 0.5 ms after the beginning of the segment.
Executing the Path A PRUN command will cause the controller to find the named path definition block and execute the path described by those commands, if that pathname has already been compiled (PCOMP). The use of variables as parameters in the path definition statement is a method of allowing segment parameters to take new values each time the path is compiled. When the path is executing, the values of the variables do not affect the path parameters.
The third path consists of two pairs of the first two (see drawing below). Each pair is placed at variable locations within the Work coordinate system and the two pairs are connected with a Line segment. The Line leading into the first pair starts at (20,20) in the Work coordinate system. The first pair starts at (VAR1,2Ø) and the second pair starts at (VAR2,2Ø) in the Work coordinate system. HANDLE is defined using the Local coordinate system.
Compiled Motion Profiling 6000 Series products allow you to construct complex motion profiles for each individual axis. The profiles may contain: • • • • • • ☞ Contouring path segments are also stored in compiled memory (see page 13). Sequences of motion Loops Programmable output changes Embedded dwells Direction changes Trigger functions Related Commands: Brief descriptions of related commands are found on page 169. For detailed descriptions, refer to the 6000 Series Software Reference.
NOTE During compilation (PCOMP), most commands are executed the same as if no profile were being defined, even those which are not relevant to the construction of a profile. This is also true of non-compiled motion commands embedded in a compiled motion program during PCOMP. For this reason, it’s good to limit commands between DEF and END to those which actually assist in the construction of the profile.
Last Motion Segment Must End At Zero Velocity When defining a profile, the last segment of motion in preset mode (MCØ) must end at zero velocity. When not using compiled loops (PLOOP), and when in preset mode (MCØ), the last GOBUF will automatically end at zero velocity.
Compiled Following Profiles More details on Following are found in Chapter 6 (page 191). The new FOLRNF command designates that the motor will move the load the distance designated in a preset GOBUF segment, completing the move at the specified final ratio. For the Revision 4.0 release of the 6000 series, the only allowable value for FOLRNF is zero (0). FOLRNF is allowed for a segment only if the starting ratio is also zero, i.e.
Distance Calculations For Compiled Following Moves The graph below shows 6 possibilities of ratio change profiles for preset segments, with legal FOLMD and “D” values constrained by the requirement that the average ratio (given by “D”/FOLMD) is between R1 and R2. If the distance is outside these ranges, in the profile used to get from R1 to R2 over FOLMD (covering “D” slave distance), an error message will be generated during the PCOMP command.
Dwells and Direction Changes Compiled profiles may incorporate changes in direction only if the preceding motion segment has come to rest. This may be achieved for non-Following segments either by creating a continuous segment with a goal velocity of zero, or by preceding a preset segment with VFØ. It may be achieved for Following segments either by creating a continuous or preset segment with a goal ratio of zero, or by preceding a preset segment with FOLRNFØ.
Compiled Motion Versus On-The-Fly Motion The two basic ways of creating a complex profile are with compiled motion or with on-the-fly pre-emptive GO commands. With compiled motion, portions of a profile are built piece by piece, and stored for later execution. Compiled motion is appropriate for profiles with motion segments of pre-determined velocity, acceleration and distance.
GOWHEN Conditional GO: The GOWHEN command has been modified to allow use in compiled motion profiles. Now, when GOWHEN is compiled in a profile, the GOWHEN condition is stored as part of that profile instead of being executed immediately. When progress through the profile reaches the compiled GOWHEN, AS.26 is set, and the next segment’s execution will be suspended until the GOWHEN condition becomes true.
Program DEF PROFIL VAR10 = 4000 * VAR4 D(VAR10) V(VAR1) POUTA.1-1 GOBUF1 VAR10 = 4000 * VAR5 D(VAR10) V(VAR2) POUTA01 GOBUF1 VAR10 = 4000 * VAR6 D(VAR10) V(VAR3) POUTAx01 GOBUF1 POUTA.
Compiled Motion — Sample Application 2 Here’s an example of replacing a mechanical cam using a compiled Following profile. There is evenly spaced product coming in on a feeder belt. The feeder belt may vary in speed. The cam that you are replacing controls a push arm that will push the product into a box for shipping. You would also like the arm to retract at a faster rate than it extends. In other words, you would like to have a smooth push to load and a fast retract to set up for the next product.
; Program second move - positive slave move FOLMD6000 ; Over a distance of 6000 master steps D4000 ; slave will move 4000 steps FOLRNF0 ; and end at zero ratio GOBUF1 ; Build motion ; Program third move - negative slave move FOLRN3 ; New ratio to accommodate larger distance of slave travel FOLMD2000 ; Over a distance of 2000 master steps D-4000 ; slave will move -4000 steps FOLRNF0 ; and end at zero ratio GOBUF1 ; Build motion ; Program last move - dwell FOLMD2000 ; Over a distance of 2000 master steps D0 ;
Compiled Motion — Sample Application 3 In this application, there is a wheel that stamps a logo onto the product. The product is assumed to be entering at a constant and fixed spacing, each product is 4 inches in length with 2 inches separating each unit. The stamp wheel has a circumference of 9 inches, and must be traveling at a 1 to 1 ratio with the product at the time of stamping. The stamp wheel must then travel five inches in just 2 inches of master travel.
; Program second constant ratio FOLRN3 ; At a 3 to 1 ratio FOLMD1 ; Over a master distance of 1” D3 ; Slave will travel 3” GOBUF1 ; Build motion ; Program ramp to lower ratio FOLRN1 ; Go to a 1 to 1 ratio FOLMD0.5 ; Over a master distance of 0.5” D1 ; Slave will travel 1” GOBUF1 ; Build motion PLN1 ; Close motion loop ; Define the exit motion FOLRN0 ; Stop slave at zero ratio (and zero velocity) FOLMD1 ; Over a master distance of 1” D0.5 ; And a slave distance of 0.
The table below shows these relationships. The arm is directly driven with a servo motor having 4096 steps per revolution. The table shows increments of 30 degrees, which is about 341 servo motor steps, or about .524 slave inches measured around the circumference described by rotation of the arm. The plastic flow is measured with an encoder giving 1000 steps per inch of flow. To maintain ratios in terms of inches, FOLRD will always be 1000.
Finally, we need to design a segment used to create a smooth entry into the repetitive portion of the profile. We’ll assume that the home position of the arm is at 180 degrees, so it needs to achieve the FOLRN ratio of 1304 in 30 degrees (341 slave steps). Using the same averaging arithmetic as above, the required master distance for the entry segment is 523 steps. A sensor is positioned with this entry segment in mind, and wired to TRG-A.
On-the-Fly Motion (pre-emptive GOs) While motion is in progress, you can change these motion parameters to affect a new profile: • • • • • • • Acceleration and S-curve Acceleration (A and AA) Deceleration and S-curve Deceleration (AD and ADA) Velocity (V) Distance (D) Preset or Continuous Positioning Mode Selection (MC) Incremental or Absolute Positioning Mode Selection (MA) Following Ratio Numerator and Denominator (FOLRN and FOLRD, respectively) The motion parameters can be changed by sending the respec
The table below summarizes the restrictions on pre-emptive GOs.
Scenario #2: OTF change of distance, where new v commanded distance (D2) is less than the original distance (D1) that was pre-empted [D2 < D1]. In this example, D2 is beyond the position where the OTF change was entered, however D2 can not be reached with the commanded deceleration. In steppers, an instantaneous velocity change is made such that D2 can be reached with the commanded deceleration (in servos, motion is killed if the new destination cannot be reached with the commanded deceleration).
Sensors 3 2 3" 4" 4" 5" 3" 4" 5" 1 3" 3" Program (portion only) VAR1=0 VAR2=0 VAR3=0 A10 MC0 WHILE(VAR1<5 AND VAR2<18) WAIT(IN.1=B1) VAR1=VAR1+1 IF(IN.2=B1) IF(IN.3=B1) VAR3=5 VAR2=VAR2+5 ELSE VAR3=4 VAR2=VAR2+4 NIF ELSE VAR3=3 VAR2=VAR2+3 NIF V(VAR3) D(VAR2) WAIT(IN.1=B0) GO1 NWHILE WAIT(AS.
Registration When a registration input (assigned trigger input) is activated, the motion profile currently being executed is replaced by the registration profile with its own distance (REG), acceleration (A & AA), deceleration (AD & ADA), and velocity (V) values, and, if using a stepper, the positioning mode (ENC). The registration move may interrupt any preset, continuous, or registration move in progress.
Registration Move Status & Error Handling Axis Status — Bit #28: This status bit is set when a registration move has been initiated by any registration input (trigger). This status bit is cleared with the next GO command. AS.28 ...... Assignment & comparison operator — use in a conditional expression (see pg. 25). TASF........ Full text description of each status bit. (see “Reg Move Commanded” line item) TAS ......... Binary report of each status bit (bits 1-32 from left to right). See bit #28.
Registration – Sample Application 1 In this example, two-tiered registration is achieved (see illustration below). While axes 1 is executing it's 50,000-unit move, trigger input A is activated and executes registration move A to slow the load's movement. An open container of volatile liquid is then placed on the conveyor belts. After picking up the liquid and while registration move A is still in progress, trigger input B is activated and executes registration move B to slow the load to gentle stop.
Registration – Sample Application 2 A user has a line of material with randomly spaced registration marks. It is known that the first mark must initiate a registration move, and that each registration move cannot be interrupted or the end product will be destroyed. Since the distance between marks is random, it is impossible to predict if a second registration mark will occur before the first registration move has finished. DEL REGI2 DEF REGI2 INFEN1 INFNC25-H RE1 V2 AD.
Registration – Sample Application 3 A print wheel uses registration to initiate each print cycle. From the beginning of motion, the controller should ignore all registration marks before traveling 2000 steps. This is to ensure that the unit is up to speed and that the registration mark is a valid one.
GOWHEN Syntax Axis 1 Axis 2 Axis 3 GOWHEN (expression),(expression),(expression), . . . Relational Expression Syntax: ( ) Possible Operators: Possible Operators: FB........Feedback device position NMCY....Master cycle number PC........Commanded position PE........Encoder position PM........Motor position PMAS....Master position PSLC....Slave position PSHF....Following shift IN........Input state T..........
A WAIT will cause the 6000 controller program to halt program flow (except for execution of immediate commands) until the condition specified is satisfied. Common uses for this function include delaying subsequent I/O activation until the master has achieved a required position or an object has been sensed. GOWHEN VS WAIT By contrast, a GOWHEN will suspend the motion profile for a specific axis until the specified condition is met. It does not affect program flow.
Trigger Functions (TRGFN) The Trigger Functions command (TRGFN) allows you to assign additional functions to trigger inputs that have been defined as trigger interrupt inputs (INFNCi-H): In the TRGFN command syntax, each field of 8 enable bits is for one axis. The “c” in the first data field is for specifying the trigger input (TRG-A through TRG-D).
6 CHAP T E R SI X Following IN THIS CHAPTER This chapter will help you understand Ratio Following: • Introduction to Ratio Following .......................................................... 192 • Implementing Ratio Following ........................................................... 194 • Master Cycle Concept........................................................................ 207 • Technical Considerations for Following ................................................
Ratio Following – Introduction As part of its standard features, the 6000 Series Controller family allows you to solve applications requiring Ratio Following. Compiled Profiles You can pre-compile Following profiles (saves processing time). See page 166 for details. Ratio Following is, essentially, controlled motion based on the measurement of external motion.
Performance Considerations Position Sampling Period Steppers – 2 milliseconds. Servos – system update period (depends on SSFR and INDAX command values – see SSFR command description). GREATER DETAIL ... on the technical aspects of Following can be found on page 213, or in the associated command descriptions in the 6000 Series Software Reference. (see also page 33) When a slave is following a master, the 6000 controller does not simply measure the master velocity to derive slave velocity.
Implementing Ratio Following This section covers the basic elements of implementing Ratio Following: • • • • Applying Following setup parameters Move profiles Performing phase shifts (FSHFC and FSHFD) Application scenarios: - Electronic gearbox - Trackball Ratio Following Setup Parameters Prior to executing a Following move, there are several setup parameters that must be specified. These parameters may be established: ☞ Programming examples — see application examples later in this chapter.
NOTE • Servo controllers: The slave axis cannot use its own commanded position or its currently selected feedback device (encoder, ANI, or LDT) as the master input. • Stepper controllers: The slave axis cannot use its own commanded (motor) position as the master input. Also, a slave axis that is using the encoder step mode (ENC1) cannot use its own encoder as the master input. • Multiple axes may be slaved to the same count source (e.g., encoder) from the same master.
Define the Master and Slave Scaling Factors (SCLMAS) . . . . if required IF SCALING IS NOT USED (SCALEØ) Servos : • Slave distance values are entered in the units of the currently selected feedback device (i.e., the device selected with the SFB command). Master distance values are entered in actual master counts (counts from the selected encoder, ANI, LDT, or commanded position).
NOTE DEFINE SCALING FIRST NOTE If scaling is desired within a stored program, you must enable scaling (SCALE1) and define the scaling factors (SCLA, SCLV, SCLD, & SCLMAS) prior to defining (DEF), uploading (TPROG), or running (RUN) the program. This allows the 6000 Series product to store, display, and execute the scaled distance, acceleration, and velocity values within the stored program.
Define the Slave-to-Master Following Ratio (FOLRN & FOLRD) FOLRNF may be used to define a final ratio for compiled Following profiles (see page 166). The FOLRN and FOLRD commands establish the goal ratio between the slave and master travel, just as the V command establishes the goal velocity for a typical non-Following move. The FOLRN command specifies the ratio's numerator (slave travel), and the FOLRD command specifies the ratio's denominator (master travel).
Slave vs. Master Move Profiles Following Status (TFSF, TFS, and FS) bits 1-4 indicate the status of slave following motion. They mimic the meaning and organization of Axis Status (TASF and AS) bits 1-4, except that each bit indicates the current state of the ratio, rather than the current state of the velocity: Bit # 1 2 3 4 Continuous Positioning Mode Moves Function (YES = 1; NO = Ø) Slave in Ratio Move .......... A Following move is in progress Ratio is Negative ...............
Preset Positioning Mode Moves For preset positioning mode (MCØ) moves, the FOLMD parameter is the master distance over which the entire slave move is to take place. As an example, a slave is to move 20 inches over a master distance of 25 inches with a maximum ratio of 1:1 (ratio set with the FOLRN1 and FOLRD1 commands). The program and a diagram of the move profiles are provided below.
Performing Phase Shifts Following Status (TFSF, TFS and FS) bits 9-12 indicate the shift status of the slave. Shifting is super-imposed motion, but if viewed alone, can have its own status. In other words, bits 1012 describe only the shifting portion of motion. Bit # 9 Function (YES = 1; NO = Ø) OK to Shift .......................... Conditions are valid to issue shift commands (FSHFD or FSHFC). 10 Shifting now........................ A shift move is in progress. 11 Shift is Continuous.............
Phase Shift Examples An FSHFC or FSHFD move may be needed to adjust the slave position on the fly because of a load condition which changes during the continuous Following move. Below are programming examples to demonstrate both shift methods. FSHFC Example An operator is visually inspecting the slave's continuous Following motion with respect to the master. If he notices that the master and slave are out of synchronization, it may be desirable to have an interrupt programmed (e.g.
FSHFD Example In this example, the slave follows a master that moves in a continuous cycle. Once each cycle, the master and slave both pick parts. The master's part is detected by a sensor connector to trigger B, and the slave's part is detected by a sensor connected to trigger A. After both parts are detected, they must be aligned.
Electronic Gearbox Application for Ratio Following An electronic gearbox is a classic application for Ratio Following. Suppose we need a threeoutput gearbox, with all three outputs geared off the same input. Also, each gear ratio must be individually programmed. In this example, a 1000-line encoder is mounted to the input shaft of a master motor, giving 4000 master counts per revolution after quadrature. This encoder is fed into the encoder input on axis #4 (ENCODER 4 connector) of the 6000 controller.
Trackball Application for Ratio Following Motion A trackball is a two-axis, two-dimensional positioning device; just as a mouse is used to position the cursor on a computer screen, a trackball could be used to position an X-Y stage. In this example, a two-axis trackball is needed which can do fine and coarse positioning of an X-Y stage. The fine or coarse setting is selected by the user with a two-position switch connected to programmable input #1 on the 6000 controller.
Trackball Program (Continued) DEL FINE DEF FINE FOLRN.5,.5 GO11 VAR1=0 END ; ; ; ; ; Subroutine to assign fine positioning Fine positioning ratio is 0.5:1 Move to begin travel at new ratio Flag to indicate we are in fine mode Return to main loop DEL TRACK DEF TRACK IF(IN.1=b1 AND VAR1=0) GOSUB COARSE NIF IF(IN.
Master Cycle Concept Ratio Following can also address applications that require precise programming synchronization between moves and I/O control based on master positions or external conditions. The concept of the master cycle greatly simplifies the required synchronization. A master cycle is simply an amount of master travel over which one or more related slave events take place. The distance traveled by the master in a master cycle is called the master cycle length.
cycle length is less than the current master cycle position, the new master cycle position becomes equal to the old cycle position minus one or more multiples of the new cycle length.
Transfer and Assignment/ Comparison of Master Cycle Position and Number Position Sampling Period Steppers – 2 millisec. Servos – system update period (depends on SSFR & INDAX command values – see SSFR command). Using Conditional Statements with Master Cycle Position (PMAS) The current master cycle position and the current master cycle number may be displayed with the TPMAS and TNMCY commands, respectively.
Synchronizing Following Moves with Master Positions A final special case allows perfect synchronization between the start of a Following motion profile of a slave axis and a specified position of its master. If a GOWHEN(nPMAS >= xxx) expression is used to synchronize a slave with its own master, with the operator specifically “>=”, a special synchronization occurs.
Continuous Cut-to-Length Application This application requires automobile trim to be cut to a pre-defined length. The saw is controlled by axes #1 and #2 on the 6000 controller. It must be moving with the material while the cut is being made (axis #1), and also move perpendicular to the trim (axis #2) to actually make the cut. The trim comes in long stock which moves continuously under the cutting area.
The master cycle length will be set equal to the desired cut length (36" in the example below), which the operator can change by modifying variable VAR1. The cut cycle will be a continuous loop, but the first cut will be made 0.2 inches from the end of the stock to ensure an even first edge. Axis #1 will accelerate to the desired tracking ratio over 1 inch of master travel for all cuts. Assume that the home position of both axes is at position 0 inches.
Continuous Cut-to-Length Program (Continued) WAIT(1FS.4=b1) GOx1 ; ; ; WAIT(2AS.1=b0) ; S1 ; WAIT(MOV=b0) ; FOLEN0 ; OUT.6-0 ; MC0 ; D0,0 ; GO11 ; ; WAIT(MOV=b00) ; OUT.
Master Position Prediction Master Position Prediction is a technique used to compensate for the fact a slave's position command cannot be calculated and implemented infinitely fast. The master position prediction mode is enabled by default (FPPEN1) in the Following algorithm, but can be turned off as desired with the FPPENØ command. Position Sampling Period Steppers – 2 milliseconds. Servos – system update period (depends on SSFR and INDAX command values – see SSFR command description).
The bandwidth of the low-pass filter is controlled with the FFILT command: FFILT S et t in g Ø 1 2 3 4 L o w p ass F ilt er B an d wid t h ∞ (no filtering) – default setting 120 Hz 80 Hz 50 Hz 20 Hz NOTE Increasing the FFILT command value increases the filtering effect (lowers the bandwidth), but at the expense of increasing the phase tracking error (phase lag) of the slave axis. For more information on phase tracking, refer to Factors Affecting Following Accuracy below.
Maximum Velocity and Acceleration (Steppers Only) The slave's attempt to faithfully follow the master may command velocities and accelerations that the slave axis is physically not able to complete. Therefore, the FMAXV and FMAXA commands are provided to set the maximum velocity and acceleration at which the slave will be allowed to move. If the slave is commanded to move at rates beyond the defined maximums, the slave will begin falling behind it's commanded position.
Just as with a mechanical arrangement, the accuracy errors can build up with every link from the beginning to the end. The overall worst case accuracy error will be the sum of all the sources of error listed below. The errors fall into two broad categories, namely, master measurement errors and slave errors. These both ultimately affect slave accuracy, because the commanded slave position is based on the measured master position.
Master Position Prediction The master position prediction mode may be enabled or disabled with the FPPEN command, but each state contributes a different error. Disabled (FPPENØ): The slave position command is based on a master position that is 2 sample periods old. This means that master measurement error due to disabling the position prediction mode will be (2 sample periods ∗ master speed).
Repeatability of the Trigger Inputs and Sensors Some applications may use the trigger inputs for functions like registration moves, GOWHENs, or new cycles. For these applications, the repeatability of the trigger inputs and sensors add to the overall position error. In the 6000 controller, the position capture from the trigger inputs have approximately 100 µs repeatability, and the sensor repeatability (SR) should be determined, too. Velocity ∗ time = distance, so the error due to repeatability is (SR + 0.
Master and Slave Distance Calculations The formulas below show the relationship between master move distances and the corresponding slave move distances. These relationships may be used to assist in the design of Following mode moves in which both the position and duration of constant ratio are important. In such calculations, it is helpful to use SCLMAS and SCLD values which allow the master and slave distances to be expressed in the same units (e.g., inches or millimeters).
NOTE ☞ Profile depicts ratio vs. distance. D = where: FOLMD = Master distance Rpeak = Peak ratio reached during move D = Total slave distance Rpeak * FOLMD 2 Triangular profile if: Rmax Rpeak D < 1/2 DMAX Ratio Triangular Slave Moves D Distance FOLMD Distance Calculation Example In the example below, the desired travel during constant ratio is already contained in numeric variable #1 (VAR1), and may have been read from thumbwheels or a DATA command.
GO Command If a slave axis is in Following mode (FOLEN1), moves will ramp to a ratio (set with FOLRN and FOLRD). If it is not in Following mode, moves will ramp to a velocity (V). Switching in and out of Following mode does not change the value for final ratio or final velocity goals, but simply changes which parameter is used as the goal.
Conditional Statements Using PMAS The master cycle position (PMAS) value may be used in the comparison argument of these commands: • WAIT & GOWHEN: If it is desired to WAIT or GOWHEN on a master cycle position of the next master cycle, one master cycle length (value of FMCLEN) should be added to the master cycle position specified in the argument. This allows commands that sequence slave events through a master cycle to be placed in a loop.
Error Messages If an illegal programming condition is discovered while programming or executing programs, the 6000 controller responds with an error message. If a program execution error is detected, the program is aborted. The table below lists all the error messages that relate to Following, and indicates the command and cause that may generate them. These error messages are displayed only if the error level is set to level 4 with the ERRLVL4 command (this is the default setting).
Following Commands Detailed information about these commands is provided in the 6000 Series Software Reference . ERROR .....................Enable bit #14 to check for when a GOWHEN condition is already true when a subsequent GO, GOL, FSHFC, or FSHFD command is given. ERRORP....................If ERROR bit #14 is enabled, a GOSUB branch to the error program occurs if a GOWHEN condition is already true when a subsequent GO, GOL, FSHFC, or FSHFD command is given. FFILT .....................
7 CHAP T E R SE VE N Troubleshooting IN THIS CHAPTER • • • • • • Troubleshooting basics ................................................................. 228 Solutions to common problems (problem/cause/remedy table) .............. 228 Program debug tools - Status commands ................................................................ 232 - Error messages ................................................................... 236 - Trace mode ................................................................
Troubleshooting Basics When your system does not function properly (or as you expect it to operate), the first thing that you must do is identify and isolate the problem. When you have accomplished this, you can effectively begin to resolve the problem. The first step is to isolate each system component and ensure that each component functions properly when it is run independently. You may have to dismantle your system and put it back together piece by piece to detect the problem.
Problem Cause Solution Direction is reversed. (STEPPERS ONLY) 1. Direction connections to the drive are reversed. (n/a to 610n, 6201) 2. Phase of step motor reversed (motor does not move in the commanded direction). 1. Switch DIR+ with DIR- connection to drive. Direction is reversed, servo condition is stable. (SERVOS ONLY) 3. Phase of encoder reversed (reported TPE direction is reversed). 1. Command output (CMD) connections and feedback device connections or mounting are reversed.
Problem Cause Solution Joystick mode: Motor does not move. 1. Joystick Release input not grounded. 1. Ground Joystick Release input. (n/a to OEM-AT6n00 and single-axis products) 2. Check wiring for opens, shorts, and mis-wired connections. 2. Improper wiring. LEDs: LED on AT6nn0 PC card is off. All other LED states indicate hardware conditions; refer to your product's Installation Guide for details. 1. No power. 1. Check PC-AT power and check proper card installation in bus slot. 2.
Problem Cause Solution Programmable inputs not working. 1. input functions are not enabled — applicable to inputs that are assigned a function other than default (INFNCi-A). 2. IN-P (input pull-up) terminal not connected to a power supply. 3. If external power supply is used, the grounds must be connected together. 4. Improper wiring. 1. Output functions are not enabled — applicable to output that are assigned a function other than default (OUTFNCi-A). 2.
Status Commands Status commands are provided to assist your diagnostic efforts. These commands display status information such as, axis-specific conditions, general system conditions, error conditions, etc. Checking Specific Setup Parameters One way to check the conditions that are established with a specific setup command is to simply type in the command name without parameters. For example, type “ERES” to check the encoder resolution setting; the response would look something like: *ERES4ØØØ.
TASF Reports axis-specific conditions. * (TAS) † (AS) 1. Axis is in motion 2. Direction is negative 3. Accelerating 4. At velocity 17. Positive-direction software limit (LSPOS) encountered 18. Negative-direction software limit (LSNEG) encountered 19. Within deadband (EPMDB) — steppers only 20. In position (COMEXP) — AT6n00 only 5. Home Successful (HOM) 6. In absolute positioning mode (MA) 7. In continuous positioning mode (MC) 8. In Jog Mode (JOG) 21.
TFSF Reports Following Mode conditions (details on page 193). * (TFS) 1. Slave is in a Following ratio move 2. Current ratio is negative 3. Slave is changing ratio 4. Slave at ratio (constant non-zero ratio) 17. Master Position Prediction Mode enabled (FPPEN) 18. Master Position Filtering Mode enabled (FFILT) 19. RESERVED 20. RESERVED 5. FOLMAS Active 6. Following Mode enabled (FOLEN) 7. Master is moving 8. Master direction is negative 21. RESERVED 22. RESERVED 23. RESERVED 24. RESERVED 9.
List of All Status Commands SPECIAL NOTATIONS * The command responds with a binary report. This is used more by experienced 6000 programmers. Using the bit select operator (.), you can check the status of one particular bit (e.g., The 2TAS.1 command reports “1” if axis #2 is moving or “Ø” if it is not moving.). In the binary report, the bits are numbered left to right, 1 through n.
Error Messages Depending on the error level setting (set with the ERRLVL command), when a programming error is created, the 6000 controller will respond with an error message and/or an error prompt. A list of all possible error messages is provided in a table below. The default error prompt is a question mark (?), but you can change it with the ERRBAD command if you wish. At error level 4 (ERRLVL4—the factory default setting) the 6000 controller responds with both the error message and the error prompt.
Error Responses (continued) Error Response Possible Cause INVALID FOLMAS SPECIFIED Following: An illegal master was specified in FOLMAS. A slave may never use its own commanded position or feedback source as its master. INVALID RATIO Following: Error if the FOLRN:FOLRD ratio after scaling is > 127 when a GO is executed.
Identifying Bad Commands To facilitate program debugging, the Transfer Command Error (TCMDER) command allows you to display the first command that the controller detects as an error. This is especially useful if you receive an error message when running or downloading a program, because it catches and remembers the command that caused the error.
Trace Mode You can use the Trace mode to debug a program. The Trace mode allows you to track, command-by-command, the entire program as it runs. The 6000 controller will display all of the commands as they are executed. For stand-alone controller users, program tracing is also available on the RP240 display (see page 134). The example below demonstrates the Trace mode.
Single-Step Mode The Single-Step mode allows you to execute one command at a time. Use the STEP command to enable Single-Step mode. To execute a command, you must use the !# sign. By entering a !# followed by a delimiter, you will execute the next command in the sequence. If you follow the !# sign with a number (n) and a delimiter, you will execute the next n commands. The Single-Step mode is demonstrated below (using the programs from the Trace mode above).
Input and Output Bit Patterns Vary by Product Input and output bit patterns vary by product. For example, the 6250's input pattern comprises 24 general-purpose inputs (bits 1-24) and 2 trigger inputs (bits 25 & 26); in contrast, the OEM6250's input pattern comprises 16 general-purpose inputs (bits 1-16) and 2 trigger inputs (bits 17 & 18). To ascertain the bit pattern for your product, consult the I/O bit pattern table on page 107.
Inputs The steps below describe the use and function of the INEN command. You can use it to cause an input state to occur. The inputs will not actually be in this state but the 6000 controller treats them as if they are in the given state and will use this state to execute its program.
Downloading Error Table (bus-based controllers only) Error Description Reason/Corrective Action 1 Operating System File Not Found The operating system specified, or the default operating system (if unspecified) could not be found by the AT6nnn.EXE loader program. Put the AT6nnn.OPS in the same directory as the AT6nnn.EXE file. 2 Invalid Operating System File The operating system specified, or the default operating system (if unspecified) is not a valid operating system or is corrupted.
Technical Support For solutions to your questions about implementing 6000 product software features, first look in this manual. Other aspects of the product (command descriptions, hardware specs, I/O connections, graphical user interfaces, etc.) are discussed in the respective manuals listed above in Reference Documentation (see page ii). If you cannot find the answer in this documentation, contact your local Automation Technology Center (ATC) or distributor for assistance.
I N D E X 16-bit mode 39 6000 DOS Support Disk 37 8-bit mode 39 A absolute position absolute positioning mode 88 absolute zero position 88 establishing 88 status 88 acceleration change on the fly 87, 178 maximum (steppers) 216 S-curve profiling 146 scaling 84, 196 units of measure 87 access to RP240 functions 137 accuracy Following, factors affecting 216 position capture 113, 182 active damping 82 address conflict 228 daisy chain (RS-232) 72 downloading to 39 multi-drop (RS-485) 75 ANA output, use of 142
C communication (continued) C (tangent) axis, contouring 154, 159 C program, downloading from 40 CAD-to-motion software iv, 2 capture positions (motor, encoder, ANI, LDT, commanded) 112 carriage return, command delimiter 5 case sensitivity 5 CCW end-of-travel limits, see limits, end-of-travel center joystick position 138 center specified arcs 158 change summary i characters command delimiters 5 comment delimiter 5 field separators 5 limit per line 5 neutral (spaces) 5 checksum 33 circles 158 circular buff
debugging tools 231 analog channel voltages, simulating 242 error messages 236 from RP240 134 I.D.
in position input, effect on command execution 17 in position output 117 incremental positioning mode 88 initial master cycle position 208 input buffer is 256 bytes 50 input ring buffer 68 input-buffer-is-empty interrupt 68 inputs 107 analog 138, 141 ANI option 142 application example 127 overriding 140 bit patterns 107 drive fault 126 active level (DRFLVL) 80 status 233 enable (ENBL) 126 status 233 encoder, see encoder end-of-travel limits 89, 90, 126 home limits 91 jogging 114 joystick 138 kill 111 limits
master/slave daisy-chain 72, 74 mathematical operations 19 maximum acceleration (steppers) 216 maximum position error establishing 99 output to indicate when exceeded 118 maximum velocity (steppers) 216 memory allocation 12 compiled motion 163 contouring 153 cleared on bad checksum 33 expanded (-M option) 13 locking 15, 116 non-volatile 33 status 13 menus, RP240 133 messages, error 236 Microsoft ASSEMBLY 5.1 38 Microsoft C 6.0 38 Microsoft QuickBASIC 4.
positive-direction end-of-travel limits, see limits, end-of-travel potentiometer, joystick 138 power-up start program (STARTP) 15 clear RP240 menus 132 Following setup commands 195 will not execute 230 pre-emptive GOs, see on-the-fly motion prediction of master position, see master, master position prediction preset positioning mode 88 Following 200, 219 distance calculations 220 priority levels, PC-AT interrupts 64 product naming convention iii profiling, custom 145 program branch conditionally 24 uncondit
shift left to right (>>) 22 shift right to left (<<) 22 shutdown 126 LED status 230 on kill 82, 111 side-by-side editor and terminal 2 simulating analog input voltages 242 single-shot registration 182, 185 single-step mode 134, 240 status 233 slave commanded position 201 Following error 215 conditional go 186 definition of 194 distance move calculations 220 scaling 196 motor/drive accuracy 217 move profiles 199 ratio to master 198 status 193 resolution 217 scaling 196 shift, see shift soft limit, see limits
velocity change on the fly 87, 178 correction 216 maximum (steppers) 216 range due to PULSE (steppers) 221 resolution 138 scaling 84, 196 start/stop 82 streaming 148 status 233 TVEL & TVELA responses relative to Following 222 units of measure 87 Visual Basic support files 52 Visual C++ support files 58 W WAIT 24 compared to GOWHEN 188 status 233 using PMAS 209, 223 watchdog timer 126 web site (www.compumotor.
6000 Series Programmer’s Guide General Programming See also, page 1 Command syntax....................................................... page 3 Programming scenario (using Motion Architect)........ page 8 Program flow control (loops, branches, WAITs).........page 23 Error handling (programmed responses)................... page 30 Error messages..........................................................page 236 Debugging your programs..........................................