Table of Contents

Advertisement

Quick Links

KOLLMORGEN
www.DanaherMotion.com
®
SERVOSTAR
MC
M-SS-005-03
Revision E
Firmware Version 5.0.0

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the Servostar M-SS-005-03 and is the answer not in the manual?

Questions and answers

Summary of Contents for Kollmorgen Servostar M-SS-005-03

  • Page 1 KOLLMORGEN www.DanaherMotion.com ® SERVOSTAR M-SS-005-03 Revision E Firmware Version 5.0.0...
  • Page 2 5/11/2005 Update examples 6/20/2005 Updated firmware version and dates ©1999 – 2005 Danaher Motion. All rights reserved. Printed in the USA. ® DANAHER MOTION is a registered trademark of Danaher Corporation. Danaher Motion makes every attempt to ensure accuracy and reliability of the specifications in this publication.
  • Page 3: Table Of Contents

    Danaher Motion 06/2005 Table of Contents Table of Contents OVERVIEW ..........................1 1. 1 SYSTEM HARDWARE ......................2 1. 2 OPERATING SYSTEM......................2 1. 3 MC-BASIC LANGUAGE COMPILER................. 2 1. 4 I/O............................3 1. 5 SERCOS ..........................3 1. 6 API............................4 1.
  • Page 4 Table of Contents 06/2005 Danaher Motion 2. 5 C-FUNCTIONS........................40 2.5.1.....................40 BJECT ILES 2.5.2....................41 ROTOTYPE 2.5.3................44 PECIAL ONSIDERATIONS 2. 6 SEMAPHORES ........................45 2.6.1..............45 UTUAL XCLUSION EMAPHORES 2.6.2..............46 YNCHRONIZATION EMAPHORES 2. 7 VIRTUAL ENTRY STATION....................46 2. 8 OUTPUT REDIRECTION ....................47 2.
  • Page 5 Danaher Motion 06/2005 Table of Contents 3.6.4..................63 TARTING OSITION 3.6.5. BASIC M ............63 OVES ETUP ROGRAM 3.6.6....................... 64 NITS 3.6.7....................64 OSITION NITS 3.6.8....................65 ELOCITY NITS 3.6.9..................65 CCELERATION NITS 3.6.10......................66 NITS 3.
  • Page 6 Table of Contents 06/2005 Danaher Motion 4.1.8.........................90 4.1.9..................98 ELOCITY VERRIDE 4. 2 MOTION EXAMPLES ......................98 4.2.1....................98 OSITION APTURE 4.2.2......................99 OMING 4.2.3....................101 EGISTRATION 4.2.4......................102 ATING 4.2.5......................102 LAMPING 4.2.6. PIPEMODE ....................103 MASTER-SLAVE........................105 5. 1 MASTER SOURCES ......................105 5.
  • Page 7 Danaher Motion 06/2005 Table of Contents 6.6.3......................123 OSITION 6.6.4......................124 ELOCITY 6. 7 ACCELERATION ......................124 6. 8 VELOCITY, ACCELERATION, DECELERATION AND JERK RATES......124 6. 9 MOTION........................... 125 6.9.1................125 TTACH ASK AND 6.9.2. ENABLE ......................125 6.9.3.
  • Page 8 Table of Contents 06/2005 Danaher Motion 9.1.3....................145 IMITATIONS 9.1.4.......................146 UNCTIONS 9. 2 WITH ..........................148 10. INPUT/OUTPUT ........................149 10. 1 STANDARD I/O ........................149 10. 2 SOFTWARE I/O ........................149 10.2.1. I/O ................149 ORIENTED OFTWARE 10.2.2. I/O............150 RIENTED OFTWARE 10. 3 PLS (PROGRAMMABLE LIMIT SWITCH) ..............150 10.3.1.
  • Page 9 Danaher Motion 06/2005 Table of Contents APPENDIX A ........................... 165 SAMPLE NESTING PROGRAM....................165 SUBROUTINE EXAMPLE......................166 SAMPLE AUTOSETUP PROGRAM ..................167 APPENDIX B............................ 171 NON-HOMOGENOUS GROUPS..................... 171 ........................171 INEMATICS COUPLING ..........................173 ..........................174 OINTS ....................... 175 OBOT ODELS ........................
  • Page 10 Table of Contents 06/2005 Danaher Motion ........................191 OVING RAME ......................192 RACKING ROCESS CUSTOMER SUPPORT ......................194 viii Rev E M-SS-005-03...
  • Page 11: Overview

    ® SERVOSTAR MC InstallationManual The SERVOSTAR MC is Danaher Motion’s multi-axis controller. The MC has the features and performance required of today’s multi-axis controllers, and is designed for easy integration into motion control systems and for simplicity of use. The key benefits of the product are:...
  • Page 12: System Hardware

    Overview 06/2005 Danaher Motion 1. 1 YSTEM ARDWARE The MC hardware is available in two types of implementation: a plug-in circuit board for a host computer, and a stand-alone model. The PCI plug-in board hardware installs in a host computer (typically a PC), running the Windows NT 4.0, Windows 2000/XP operating systems.
  • Page 13: I/O

    Danaher Motion 06/2005 Overview Camming links master and slave axes by a cam table. Camming has all the features of gearing, plus the cam table can have any number of points. The cam points are in x-y format so spacing can be provided independently.
  • Page 14: Api

    Overview 06/2005 Danaher Motion Because SERCOS is digital, it can transmit signals such as velocity and ® position commands with high resolution. The SERVOSTAR MC and accompanying drives ( SERVOSTAR CD series), support 32-bit velocity commands. This provides a much higher resolution than can be achieved with the analog interface.
  • Page 15: Serial Communication

    Danaher Motion 06/2005 Overview 1.8.1. Serial Communication The MC has two RS-232 ports, which can be used for user communication. When COM1 is used for communication with BASIC Moves over API, tasks cannot access it to eliminate interference with BMDS communications. Use...
  • Page 16: Tcp/Ip Communication

    Overview 06/2005 Danaher Motion 1.8.1.2. O ERIAL Configurate the serial port with OPEN. Set the following port properties: BaudRate - baud rate of the device set to a specified value. Parity – enable/disable parity detection. When enabled, parity is odd or even.
  • Page 17 Danaher Motion 06/2005 Overview There are several ways to set the IP address of the controller. By default, the MC boots without a valid IP address. The following options are available to set the IP address of the controller: Static IP address setting Use SYS.IPADDRESSMASK in the Config.prg file to assign the IP...
  • Page 18: Send /Receive Data

    Overview 06/2005 Danaher Motion The MC requests a connection from a remote host, according to a specific IP address and port. CONNECT blocks task execution until the connection is established or until the command fails. To unblock a task waiting in CONNECT, close the corresponding socket using CLOSE.
  • Page 19 Danaher Motion 06/2005 Overview If INPUT$ requests reading a data length larger than available data, the command returns only the available data: -->?LOC(1) -->STRING_VAR = INPUT$(20, #1) -->?STRING_VAR Hello World LOC can be used within the INPUT$: STRING_VAR = INPUT$(LOC(1), #1) A partial read of the input buffer is allowed.
  • Page 20 Overview 06/2005 Danaher Motion 1.8.3.3. S LOCK PRINTTOBUFF # and PRINTUSINGTOBUFF # allows buffering of data before actually being sent. This eliminates inter-character delays. printtobuff #handle,chr$(0); chr$(message_length); chr$(0);send=false printtobuff #handle,chr$(request[ii]);send=false printtobuff #handle,chr$(request[ii]);send=true 1.8.3.4. S NULL C ECEIVE HARACTER When using a specific protocol over Serial or TCP/IP ModBus RTU or ModBus TCP), the NULL character is part of the message.
  • Page 21: Basic Moves Development Studio

    Danaher Motion 06/2005 BASIC Moves Development Studio BASIC MOVES DEVELOPMENT STUDIO BASIC Moves Development Studio (BMDS) provides Windows-based project control for each application. BASIC Moves Development Studio supports development for multi-tasking and also provides numerous tools and wizards to simplify programming the MC.
  • Page 22: Instructions

    BASIC Moves Development Studio 06/2005 Danaher Motion To develop your application on the MC, you must install BASIC Moves Development Studio. Refer to the software installation section of the ® SERVOSTAR MC Installation Manual for detailed instructions. 2.2.1. Instructions Instructions are the building blocks of BASIC. Instructions set variables, call functions, control program flow, and start processes such as events and motion.
  • Page 23 Danaher Motion 06/2005 BASIC Moves Development Studio The term, Lvalue, is a shorthand notation, which indicates the value to the left of the equals sign. Valid Lvalues are variables or writable properties, which can be assigned. Expressions can be variables, constants, properties and function calls, as well as various combinations of them in arithmetic and logical statements .
  • Page 24: Constants And Variables

    BASIC Moves Development Studio 06/2005 Danaher Motion 2.2.3. Constants and Variables All constant, variable and system element names must start with an alphabetical character (a-z, A-Z) and may be followed with up to 31 alphabetical characters, numbers (0-9) and underscores (“_”). Keywords may not be used as names.
  • Page 25 Danaher Motion 06/2005 BASIC Moves Development Studio Besides these basic types, MC-BASIC also supports Structure-like variables and some MC-BASIC specific types, such as points (Joints and Locations), generic motion elements (Axes and Groups) and UEAs (user error assertions-Errors and Notes).
  • Page 26: Data Types

    BASIC Moves Development Studio 06/2005 Danaher Motion 2.2.4. Data Types MC-BASIC has two numeric data types: Long and Double. Long is the only integer form supported by MC-BASIC. Long and Double are MC-BASIC's primitive data types. Type Description Range Long...
  • Page 27 Danaher Motion 06/2005 BASIC Moves Development Studio MC-Basic has two UEA (user error assertion) data types (severities): Error and Note. Each UEA is defined with a string-type error message given by the user and a unique exception number, which might be determined either by ®...
  • Page 28 BASIC Moves Development Studio 06/2005 Danaher Motion 2.2.4.1. S TRUCTURES A structure is a new data type used for storing a list of variables of different type in one variable. 2.2.4.1.1 Definition Since a structure is a user-defined data type; it must first be defined.
  • Page 29: System Elements

    Danaher Motion 06/2005 BASIC Moves Development Studio For example: In config file -> Type X Type as Long Length as Long End Type In application file -> Dim shared s1 as X Program ?s1->Type End program Do not define the size of the structure data type. The size of the structure is constant.
  • Page 30: Units

    BASIC Moves Development Studio 06/2005 Danaher Motion Despite the syntax, properties are not data elements, since a system element and its properties are not located on a continuous block of memory. All properties return a value, so they can be printed, combined in expressions and passed by value to functions and subroutines.
  • Page 31 Danaher Motion 06/2005 BASIC Moves Development Studio The value of the expression (6.33 * 2.79) is converted from double to long when the value (17) is copied into I. In the conversion to long, the number is truncated to the integer portion of the floating-point value.
  • Page 32 BASIC Moves Development Studio 06/2005 Danaher Motion Bit-Wise Logical Operator Symbol Unary/Binary Operand Type Bitwise Negation BNot Unary long Bitwise And BAnd Binary long Bitwise Or Binary long Bitwise Xor BXor Binary long Shift Left Binary long Shift Right Binary...
  • Page 33: Math Functions

    Danaher Motion 06/2005 BASIC Moves Development Studio Bit-wise expressions differ from logical expressions in that there may be many results from a single operation. Bitwise operations are frequently used to mask I/O bits. For example, the standard SERVOSTAR MC inputs can be operated on with BAnd (Bitwise And) to mask off some of the inputs.
  • Page 34: String Functions

    BASIC Moves Development Studio 06/2005 Danaher Motion 2.2.10. String Functions Beginning with version 3.0, MC-BASIC supports all the common string functions supported in standard BASIC. For detailed information on any of ® the string functions (including examples), refer to the SERVOSTAR Reference Manual.
  • Page 35: System Commands

    Danaher Motion 06/2005 BASIC Moves Development Studio 2.2.11. System Commands The following commands provide information about the system. You can issue these commands at any time either from task, terminal or the CONFIG.PRG file (with some exceptions). For detailed information on any of ®...
  • Page 36 BASIC Moves Development Studio 06/2005 Danaher Motion System.DecelerationRate Queries or sets the system deceleration exchange rate. System.DIn Returns the value of one or more of the 23 digital inputs. System.DIn returns the values of the individual bits in the system input word. In order to read the value of a single input bit, bit number should be specified as System.DIn.<bit number>.
  • Page 37 Danaher Motion 06/2005 BASIC Moves Development Studio System.MotionAssistance Enables and disables display of additional notes returned from the motion task. System.Name Queries and sets the name of the controller. System.NoMotion Enables and disables the System.Motion monitoring apparatus. System.NumberAxes Returns the number of axes currently loaded in the system.
  • Page 38: Printing

    BASIC Moves Development Studio 06/2005 Danaher Motion With…End With Simplifies blocks of code, which set a number of parameters on the same motion element (axis or group). After a With is encountered, all parameters where the element is not specified are assumed to belong to the element specified in the With.
  • Page 39 Danaher Motion 06/2005 BASIC Moves Development Studio On the other hand, expressions separated by a semicolon or a space in the print command are printed adjacently. Print 1,2 Print 1;2 Print 1 2 PrintUsing introduces formatting for printing. You can control the format and the number of digits that print.
  • Page 40: Flow Control

    BASIC Moves Development Studio 06/2005 Danaher Motion To change printing to Binary format, type: System.PrintMode = BIN To restore printing to Decimal format, enter: System.PrintMode = DECIMAL Printing double floating point numbers is not affected by System.PrintMode. As an alternative to PrintMode, you can place the keywords Decimal, Hex or Binat the end of Print or PrintUsing to print expressions in these formats.
  • Page 41 Danaher Motion 06/2005 BASIC Moves Development Studio After you have specified the variable or expression, list one or more values or value ranges that the variable can take. There are four ways you can specify cases: Exact Value Logical Condition...
  • Page 42 BASIC Moves Development Studio 06/2005 Danaher Motion For example: For I = 2 TO 5 Print "I = " I 'Prints 2, 3, 4, 5 Next I For I = 4 TO 2 STEP –0.5 Print "I = " I 'Prints 4.0, 3.5, 3.0, 2.5, 2.0...
  • Page 43 Danaher Motion 06/2005 BASIC Moves Development Studio For example: Dim Shared i as Long Program i = 0 i = i + 1 Print i Loop Until i = 10 End Program or, equivalently, you can use Loop While: Dim Shared i as Long...
  • Page 44 BASIC Moves Development Studio 06/2005 Danaher Motion Catch statements are used within three types of error trapping blocks. The Try block is designed to trap synchronous errors within task context (For more details, see the Error Handling section). There is no explicit limitation on the number of Try blocks instances in a program.
  • Page 45 Danaher Motion 06/2005 BASIC Moves Development Studio An example of an OnError block, designed to stop motion in case of a motion error: OnError Catch 3001 To 3999 ‘ Motion errors System.Motion = 0 A1.Enable = 0 ? VESExecute("System.Motion = 1") A1.
  • Page 46: Program Declarations

    BASIC Moves Development Studio 06/2005 Danaher Motion 2. 3 ROGRAM ECLARATIONS You must declare the start of programs and subroutines. For programs, use Program…End Program. Use Sub…End Sub keywords for subroutines. 2.3.1. Program The Program…End Program keywords mark the boundary between the variable declaration section and the main program.
  • Page 47: User-Defined Functions

    Danaher Motion 06/2005 BASIC Moves Development Studio When a variable is passed by reference (whether the variable is local to the task or global), the address of the variable is passed to the subroutine, which changes the value of the original variable (if the code of the subroutine is written to do this).
  • Page 48: Libraries

    BASIC Moves Development Studio 06/2005 Danaher Motion ntheses are not used in function CALL if no parameters are passed. Pare Parameters (either scalar or array) passed to the function are used within the code of the function. Declare variable names and types of parameters in the declaration line of the function.
  • Page 49 Danaher Motion 06/2005 BASIC Moves Development Studio An MC-BASIC library is an ASCII file containing only the subroutines’ and functions’ code. The file does not have a main program part. The name of a library file must have the extension, .LIB. The format of a library file is: Declarations of static variables {PUBLIC} SUB <sub_name>...
  • Page 50: Global Libraries

    BASIC Moves Development Studio 06/2005 Danaher Motion 2.4.1. Global Libraries Global libraries are library files (.LIB), which, instead of being loaded from either the terminal or another task, are loaded from the configuration file (Config.Prg). Another option is loading from terminal, using LOADGLOBAL.
  • Page 51: Prototype File

    Danaher Motion 06/2005 BASIC Moves Development Studio 2.5.2. Prototype File For the MC-Basic language translator to match function parameters, provide a C-function prototype file (PROTO.PRO). It is important to understand that matching between the provided MC prototype and actual C implementation cannot be tested by the translator.
  • Page 52 BASIC Moves Development Studio 06/2005 Danaher Motion Example of calling a C-function from MC-Basic: Dim shared Str2global as string Dim shared Str1global as string Dim shared LongArray[100] as long Dim shared d1 as double program Use OLOAD to load the object file before loading the program...
  • Page 53 Danaher Motion 06/2005 BASIC Moves Development Studio Example of test.c: /* No Parameters */ int CFUNC_LV(void) return 1; double CFUNC_DV(void) return 2.2; char* CFUNC_SV(void) return "SV"; void CFUNC_VV(void) int fd = open("/tyCo/1",2,0); fdprintf(fd,"VV\r\n"); close(fd); /* A Single "By Value" Parameter */ int CFUNC_LL(int L) L = L + 1;...
  • Page 54: Special Considerations

    BASIC Moves Development Studio 06/2005 Danaher Motion return (D + L + atoi(S)); void CFUNC_VVALP(char* S, double D, int L) int fd = open("/tyCo/1",2,0); fdprintf(fd,"Original Values:%d, %f, %s\r\n", L, D, S); L = 10; D = 22.2; strcpy(S,"VValP"); fdprintf(fd,"New Value:%d, %f, %s\r\n", L, D, S);...
  • Page 55: Semaphores

    Danaher Motion 06/2005 BASIC Moves Development Studio 2. 6 EMAPHORES Semaphores are the basis for synchronization and mutual exclusion. The difference is that the mutual exclusion semaphore is created as “full” or “1”, while the synchronization semaphore is empty “0”. If the semaphore is used for protecting mutual resources, it is taken before accessing the resource and releases at the end.
  • Page 56: Synchronization Semaphores

    BASIC Moves Development Studio 06/2005 Danaher Motion 2.6.2. Synchronization Semaphores Synchronization semaphores are essential in producer-consumer applications where task A prepares some data, while task B consumes it. In this case, the semaphore may eliminate constant polling for ready data and save considerable CPU resources.
  • Page 57: Output Redirection

    Danaher Motion 06/2005 BASIC Moves Development Studio VES Example: Program Dim s2 as string Dim s1 as string S2="?sys.time" S1=VesExecute(s2) Print s1 S1=VesExecute(“sys.time”) ‘ incorrect, returns syntax error Print s1 End program Output: D:18:27:19 E:Error: 7039, "Syntax Error", Module: Translator 2.
  • Page 58: Open #, Input #, Close, Loc

    BASIC Moves Development Studio 06/2005 Danaher Motion 2.9.2. OPEN #, INPUT #, CLOSE, LOC See Serial port. 2.9.3. TELL Returns current file pointer, offset from the beginning of the file. Value has meaning only for SEEK to move the file pointer within a file.
  • Page 59: Project

    Danaher Motion 06/2005 Project PROJECT A project is all the software written for an application. The projects in MC- BASIC are multi-tasking. They consist of many tasks running concurrently with, and independently of, each other. The project is stored in multiple files, one file for each task.
  • Page 60 Project 06/2005 Danaher Motion A task-variable definition section The task-variable definition section, where all task variables are declared with the Dim…Shared command. The main program Most programming is done in the main programming section. The main programming section falls between the Program…End Program keywords.
  • Page 61: Configuration Task

    Danaher Motion 06/2005 Project Optional subroutines Each task can have any number of subroutines. Subroutines are component parts of the task, and consequently, they can only be called from within the task. If you want to call the same subroutine from two tasks, place one copy in each task.
  • Page 62: Program Declarations

    Project 06/2005 Danaher Motion 3. 3 ROGRAM ECLARATIONS You must declare the start of programs and subroutines. For programs, use the Program…End Program keywords. Use Sub…End Sub keywords for subroutines. The Program…End Program keywords mark the boundary between the variable declaration section and the main program. Each task must have only one Program keyword and end with the End Program keyword.
  • Page 63: Arrays

    Danaher Motion 06/2005 Project Use CALL to execute a subroutine: CALL <subroutine>({<p_1>...<p_n>}) where: <subroutine> is the name of the subroutine <p_1>...<p_n> are the subroutine parameters Parentheses are not used in a subroutine if no parameters are passed. MC-BASIC automatically checks the type of compliance between the subroutine declaration and the subroutine call.
  • Page 64 Project 06/2005 Danaher Motion The format of a library file is: Declaration of static variables ...Etc. {PUBLIC}SUB <sub_name_1> etc… {Declaration of variables local to the sub-program} {sub-program code} END SUB …etc … {PUBLIC} SUB <sub_name_n> etc… {Declaration of variables local to the sub-program}...
  • Page 65: Multi-Tasking

    Danaher Motion 06/2005 Project Functions are different from subroutines in one respect. Functions always return a value to the task that called the function. Otherwise, functions and subroutines use the same syntax and follow the same rules of application and behavior.
  • Page 66 Project 06/2005 Danaher Motion In this case, both Explorer and Word have their own contexts. They share one computer, but run as if the other were not present. There is inter-task communication. If you double-click on a document in the file manager, it launches Word to edit the file you clicked.
  • Page 67: Loading The Program

    Danaher Motion 06/2005 Project 3.4.1. Loading the Program BASIC Moves automatically loads all tasks in your project when you select Run Project. You can select Run Project by selecting it from the Debug menu, by pressing the F5 key, or by pressing the “Load Task”and “Run Task”...
  • Page 68 Project 06/2005 Danaher Motion StartTask starts tasks from the main task. For testing, you can use STARTTASK from the terminal window. DanaherMotion recommends you do not use STARTTASK in AutoExec.Prg. The syntax of STARTTASK is: StartTask <TaskName> {Priority = <Level>}{NumberOfLoops = <Loop Count>} NOL is a short form for NumberOfLoops.
  • Page 69: Monitoring Tasks From The Terminal

    Danaher Motion 06/2005 Project 3.4.4. Monitoring Tasks From the Terminal ® For detailed information on these commands, refer to the SERVOSTAR Reference Manual. TASK.STATUS provides the current state of any task. You can query TASK.STATE from the terminal window. You cannot use TASK.STATUS from within a program.
  • Page 70: Event Handler

    Project 06/2005 Danaher Motion 3. 5 VENT ANDLER The main program can contain sections which automatically handle events. This reduces the programming effort required to make tasks respond quickly and easily to realtime events. Event handlers begin with OnEvent and end with End OnEvent and occur just after the Program keyword.
  • Page 71: Eventon

    Danaher Motion 06/2005 Project Events can either be controlled from within the task in which they reside, or from the terminal. The main program or any subroutine can issue EventOn (to enable the OnEvent command) or EventOff (to disable it). OnEvents cannot be controlled from other tasks.
  • Page 72: Setting Up Axes

    Project 06/2005 Danaher Motion 3. 6 ETTING UP In this section, we set up the axes in the system. We will discuss units for position, velocity, and acceleration. We discuss how the SERVOSTAR MC’s acceleration profile works. We talk about how to set up limits for axes. We conclude with a discussion of a few advanced topics: an overview of SERCOS, simulated axes, and dual-loop position control.
  • Page 73: Drive Address

    Danaher Motion 06/2005 Project You can rename the axis. It is usually worthwhile to name the axes according to their function. It makes your program easier to understand and to debug. For example, you could enter: A1.AxisName = ConveyorAxis Later, you can query the velocity with: ? ConveyorAxis.VelocityFeedback...
  • Page 74: User Units

    Project 06/2005 Danaher Motion The motion program cycles axis A1 10 times. Most of this main program is commented out because this code enables the drive and generates motion commands. Remove the single-quote comment markers for the program to run. These lines are commented out because to ensure that it is safe to operate your machine before executing this program.
  • Page 75: Velocity Units

    Danaher Motion 06/2005 Project Determine POSITIONFACTOR (number of counts per meter): 1 meter = 200 turns on the screw = 600 turns into the gearbox = 600 * 65536 counts = 39,321,600 counts POSITIONFACTOR is set to the number of counts per meter: 39321600. If...
  • Page 76: Jerk Units

    Project 06/2005 Danaher Motion 3.6.10. Jerk Units It is also necessary to define the jerk factor, even if you always use the smooth factor. The smooth factor automatically defines the jerk value from the velocity and acceleration values, but it is a value before factors, therefore totally invalid values of jerk (internally) can be computed.
  • Page 77: Position And Velocity

    Danaher Motion 06/2005 Project 3. 8 OSITION AND ELOCITY Position and velocity are the key command and feedback signals for each axis. These properties are updated by the MC every SERCOS cycle and may be read at any time. Their properties are double-precision floating point numbers.
  • Page 78 Project 06/2005 Danaher Motion For example, a motor driving a rotating table is often configured as a rotary axis. In this case, the table units are set up as degrees and the units of the axis are set to repeat after 360°. In that way, the position repeats after every rotation of the table, rather than continuing to increase indefinitely.
  • Page 79: Limits

    Danaher Motion 06/2005 Project The MC provides the external position through the axis property, POSITIONEXTERNAL or PEXT. This variable contains the accumulated encoder movement of the drive’s external encoder input. It is updated every SERCOS cycle. You can access PEXT two ways: realtime or on a as-needed basis. To access PEXT on an as-needed based, issue IDNVALUE.
  • Page 80: Position Limits

    Project 06/2005 Danaher Motion The MC checks realtime limits each SERCOS update cycle. Changes in these limits affect current operations. VELOCITYFEEDBACK is checked against VELOCITYOVERSPEED in every SERCOS cycle. Drive limits are imposed by the SERVOSTAR CD drive. Changes in these limits affect current operations.
  • Page 81 Danaher Motion 06/2005 Project Care should be taken to set PEMAX to a value that matches the needs of the application. When the actual position following error (PE) exceeds PEMAX, motion stops. If the motion is stopped when this condition is detected, the axis is disabled.
  • Page 82 Project 06/2005 Danaher Motion In many cases, 100% feed-forward is not acceptable. In these cases, you can reduce the feed-forward to reduce overshoot. The larger the feed- forward gain, the greater reduction is seen steady-state following error. Most systems can tolerate the overshoot generated by feed-forward gains of 50%.
  • Page 83: Axis Velocity Limits

    Danaher Motion 06/2005 Project ISMOVING is a property that indicates the state of the motion profiler. The valid range of values is from –1 to 3, with the following meaning: -1 = element is a slave (gear or cam) unless an incremental move is...
  • Page 84: Verify Settings

    Project 06/2005 Danaher Motion Axis.DecelerationRate defines the axis deceleration maximum scaling factor from 0.1 to 100 persent independently of velocity, acceleration or jerk. <axis>.DecelerationRate may be modal or nodal. Axis.JerkRate defines the axis Jerk maximum scaling factor from 0.1 to 100 persents independently of velocity, acceleration or deceleration.
  • Page 85: Sercos

    (IEC 1491), supported by many companies around the world. SERCOS replaces analog connections with digital, high-speed fiber-optic communication. Danaher Motion supports 2/4/8/16 Mbit/s baud rate speeds. Danaher Motion selected the SERCOS interface because of numerous technical advantages: Determinism SERCOS provides deterministic communication to all drives.
  • Page 86: Communication Phases

    Project 06/2005 Danaher Motion 3.12.1. Communication Phases In SERCOS, one master controller and many drives are connected with the fiber optic cable to form a communication ring. The master attempts to establish communication in a step-by-step process. This process is referred to as bringing up the ring. Each step is defined in SERCOS as a phase.
  • Page 87: Telegram Types

    Danaher Motion 06/2005 Project The first telegram in a communication cycle is the Master Synchronization Telegram (MST). The MST, issued by the controller. It provides a single mark in time for all the drives. All feedback and command data are synchronized for all axes via the MST.
  • Page 88: Cyclic Vs. Non-Cyclic Communication

    SERCOS commands are organized according to an Identification Number or IDN. SERCOS defines hundreds of standard IDNs, which support configuration and operation. Manufacturers, such as Danaher Motion, provide IDNs specific to their products. IDNs are numbered. Standard IDNs are from 1 to 32767 (although only several hundred are used to date) and manufacturer IDNs are numbered from 32768 to 65535.
  • Page 89: Position And Velocity Commands

    Danaher Motion 06/2005 Project 3.12.6. Position and Velocity Commands The MC sends position and velocity commands in the cyclic data, and SERVOSTAR drives return position and velocity feedback in the cyclic data. This allows you to configure your system as a position or a velocity loop. It also allows you to switch between position and velocity loop on-the-fly.
  • Page 90 Project 06/2005 Danaher Motion Sercos.CycleTime is used to either set or query the SERCOS communications cycle time - rate of updating cyclic data (rate with which to the desired phase of communication (see Cyclic vs. Non-Cyclic Communication). This property is only set in SERCOS communication phases 0, 1, and 2, transferred from the MC to drives during phase 2 and becomes active in phase 3.
  • Page 91: Loops

    MOTIONLINK. This is a significant advantage when maintenance people unfamiliar with the design of the system do drive replacement. For this reason, Danaher Motion recommends that you configure your systems to download all parameters on power up. BASIC Moves provides a utility that reads all pertinent IDNs after the unit is configured and the ring is up and stores them in a task you automatically download each power up.
  • Page 92: Standard Position Loop

    Project 06/2005 Danaher Motion 3.13.1. Standard Position Loop Position loop is the standard operating mode of the SERVOSTAR system. For position operation, set the position loop gain to a value greater than zero. Typically, you set up the position loop using MOTIONLINK. See the ®...
  • Page 93: Velocity Loop

    Danaher Motion 06/2005 Project 3.13.3. Velocity Loop For some applications, the motor must be under velocity loop control. Maintaining a position is not important. The advantage is that the motor is more responsive (typically 3 to 5 times faster in settling time). When you configure an axis for velocity loop, you more or less fool the drive by setting gains to disable the position loop.
  • Page 94 Project 06/2005 Danaher Motion The units on a simulated axis are flexible. The simplest way to set the units is to set PFAC=1, which can be thought of as 1 simulated unit (eg, 1 meter, 1 inch). Set VFAC to PFAC/1000 for units-per-second or set to PFAC/60000 for units-per-minute such as rpm.
  • Page 95: Single-Axis Motion

    Danaher Motion 06/2005 Single-Axis Motion SINGLE-AXIS MOTION The SERVOSTAR MC supports three main types of motion: Single-axis motion Master-Slave motion Multiple-axes motion A motion generator controls all motion in the MC. This software device receives commands from MC tasks and produces position and velocity commands for the drives every servo cycle.
  • Page 96 Single-Axis Motion 06/2005 Danaher Motion If no other task is attached to the axis, the axis is immediately attached. If another task has already attached the axis, an error is generated. A TRY CATCH can be used to wait for an axis to be unattached.
  • Page 97: Motion Buffering

    Danaher Motion 06/2005 Single-Axis Motion The profile must be updated at regular intervals. The MC usually updates the profile every cycle time (1 ms update rate, if possible when the drive supports this update rate). The SERCOS telegram also gets longer with more axes.
  • Page 98: Acceleration Profile

    Single-Axis Motion 06/2005 Danaher Motion For example: ConveyorAxis.Acc = 100 Jog ConveyorAxis 1000 ACC = 10 Even though the acceleration rate of the conveyor axis is specified at 100 in the first line, JOG accelerates at 10 (the override value). Motion commands that do not specify an override acceleration rate accelerate at the permanent value.
  • Page 99: Stop

    Danaher Motion 06/2005 Single-Axis Motion The following axis properties can be overridden as part of JOG: TIMEJOG ACCELERATION DECELERATION SMOOTHFACTOR JERK VELOCITYRATE ACCELERATIONRATE DECELERATIONRATE JERKRATE 4.1.6. Stop STOP stops motion in the motion buffer. In the command, you must specify the axis.
  • Page 100: Move

    Single-Axis Motion 06/2005 Danaher Motion PROCEED has two purposes: to enhance safety and to allow motion to continue along the original path. The safety enhancement is provided by not allowing motion on an axis to restart without the task that stopped the motion issuing a PROCEED.
  • Page 101 Danaher Motion 06/2005 Single-Axis Motion 4.1.8.1. P OSITION INAL AND NCREMENTAL ERSUS BSOLUTE OVES POSITIONFINAL (the end of a move), is always specified in MOVE. The meaning of PFINAL depends on ABSOLUTE (ABS). This allows point-to- point moves to be specified two ways:...
  • Page 102 Single-Axis Motion 06/2005 Danaher Motion Ideally, settling time allows the motor to move to approach zero position error. However, you must allow for the condition where the position error never quite reaches zero. On the MC, you specify how low you consider to be low enough with <axis>.POSITIONERRORSETTLE (<axis>.PESETTLE):...
  • Page 103 Danaher Motion 06/2005 Single-Axis Motion StartType = InPosition (InPos) When STARTTYPE = INPOS, the motion generator delays executing the new motion command until the current move has completed and the position error is settled to near zero. INPOSITION is constant equal to 2.
  • Page 104 Single-Axis Motion 06/2005 Danaher Motion As you can see, the motor comes to rest because the MC waits for the following error to be small enough before proceeding to the next command. MainAxis.PESettle = 0.01 MainAxis.Tsettle = 10 Move MainAxis 100 Move MainAxis 200 StartType=InPos Normally, the ending speed of MOVE defaults to zero.
  • Page 105 Danaher Motion 06/2005 Single-Axis Motion Combining non-zero end-point moves in the motion buffer produces multi- step moves. For example: Program Attach A1 Call AxisSetup Call SercosSetup Sys.En = On A1.En = On Sys.Motion = On A1.Motion = On A1.Abs = Off A1.StartType = Gcom...
  • Page 106 Single-Axis Motion 06/2005 Danaher Motion PFINAL of the succeeding move must be far enough in front of PFINAL of the current move that the profile is possible with the acceleration limits. The generated profile always reaches the target position. If the acceleration and smooth limitations prevent attaining the required final velocity, the motion is terminated with the final velocity as close as possible to the required value.
  • Page 107 Danaher Motion 06/2005 Single-Axis Motion Synchronization is controlled with STARTTYPE = SYNCSTART (SYNC). The feature works by allowing you to load the motion generator with a motion command, but delaying the generation of motion until a SYNCSTART command is issued. For example, the following sequence:...
  • Page 108: Velocity Override

    Single-Axis Motion 06/2005 Danaher Motion 4.1.9. Velocity Override The MC can speed up or slow down all motion commands. This can be applied to the entire machine at once, or to individual axes, independently. This capability is used extensively in machine development as it enables you to adjust the entire machine speed in a single command.
  • Page 109: Homing

    Danaher Motion 06/2005 Single-Axis Motion Returns the state of the drive digital input 1 (ON or OFF). <axis>.In1 <axis>.In1Mode Specifies the functionality of the drive digital input 1. The value 16 (keyword capturing) selects the capture input. Returns the state of the drive digital input 2 (ON or OFF).
  • Page 110 Single-Axis Motion 06/2005 Danaher Motion <axis>.HomeDistanceMax Specifies the maximum distance from the point at which the homing process began (in either direction) that an axis is allowed to travel in order to find the hard- home position-switch-transition. Specifies the homing latch type: 0=Switch + <axis>.HomeType...
  • Page 111: Registration

    Danaher Motion 06/2005 Single-Axis Motion 4.2.3. Registration Registration applications are those that start motion and then modify the profile, based on a subsequent event. These applications generally involve discrete product processing, such as are common in the packaging, printing and converting industries. The event is usually generated by sensing a position on the product being processed (usually a mark is printed on the product and detected by an optical sensor).
  • Page 112: Gating

    Single-Axis Motion 06/2005 Danaher Motion The more accurately the position is determined, the more accurate the cut is with respect to the registration mark. If the process is feeding material at 10 ft/s, and the capture accuracy is ±3 microseconds, the mark is: 10 (ft/sec) * 3 µs = 3.225e-5 ft or about 0.0004 in.
  • Page 113: Pipemode

    Danaher Motion 06/2005 Single-Axis Motion This program works by starting a slow move with low torque. The move continues until position error is greater than 0.25 units. When the axis runs into a stop, position error accumulates because the profile continues. You must be careful to set the threshold of the event greater than the position error of normal operation.
  • Page 114 Single-Axis Motion 06/2005 Danaher Motion The data structure mapping depends on the PIPEMODE state: SYSTEM.PIPEMODE MC variables Byte offset Position (1) Position and Velocity (2) Sys.HostDouble[1] 0…7 A1.PCMD A1.PCMD Sys.HostDouble[2] 8…15 A2.PCMD A1.VCMD Sys.HostDouble[3] 16…23 A3.PCMD A2.PCMD Sys.HostDouble[4] 24…31 A4.PCMD A2.VCMD...
  • Page 115: Master-Slave

    Danaher Motion 06/2005 Master-Slave MASTER-SLAVE Master-Slave motion links the position of one axis (slave) to the position of another (master). The master axis is any axis controlled by the MC or an external axis. External axes are connected to the MC via the external encoder input on any of the drives controlled by the MC.
  • Page 116: Gearing

    Master-Slave 06/2005 Danaher Motion For optimal performance, the master axis should have an axis number less than the slave axis. If the slave axis is A1 and the master axis is A2, an additional time cycle is inserted in the motion.
  • Page 117: Incremental Moves

    Danaher Motion 06/2005 Master-Slave Set the proportional constant between the master and slave with <axis>.GEARRATIO: A1.GearRatio = 0.5 'Slave goes half the speed of master GEARRATIO is a double-precision floating-point number that is set to less than zero to reverse the direction of the slave.
  • Page 118: Camming

    Master-Slave 06/2005 Danaher Motion This next example shows the previous example, but with the starting after the incremental move is complete (STARTTYPE = GCOM): Jog A1 100 TimeJog=5000 Sleep 2000 A1.StartType=GCOM Jog A1 200 The resulting profile for this is: 5.
  • Page 119: Gearratio

    Danaher Motion 06/2005 Master-Slave Cam profiles do not need to return to the original position at the end of the profile. Cam tables are calculated either off-line and stored, or on the fly. Cams cycle either indefinitely or are specified to cycle a specific number of times.
  • Page 120 Master-Slave 06/2005 Danaher Motion In the unusual case that the master position is located exactly on one of the master position points, the slave position is the corresponding point of the master/slave point-pair. When the master is located between two points, the MC uses linear interpolation to calculate the position.
  • Page 121: Cam Cycles

    Danaher Motion 06/2005 Master-Slave In many applications, you must ensure that this quantity is precise or the master appears to creep over time. The MC uses double-precision math (16 digits of accuracy) for cam calculations. Use the MC to calculate mathematical expressions to obtain the greatest possible precision.
  • Page 122 Master-Slave 06/2005 Danaher Motion For example, suppose you want a cam to run four cycles as shown below: You would use the following line: CAM1.CYCLE = 4 ' Run cam1 four cycles If you want a cam to run the same table an indefinite number of times, use: CAM1.CYCLE = -1...
  • Page 123: Create Cam Tables

    Danaher Motion 06/2005 Master-Slave If you have linked cams, the cam cycle runs the number of times specified in CYCLES. For example, assume Cam1 is being driven by a forward rotating master. If CAM1.NEXT=CAM2 and CAM1.CYCLES=4, Cam1 cycles four times before transitioning to Cam2. Similarly, if the master is rotating backward and CAM1.PREVIOUS=Cam0, Cam1 cycles four times before...
  • Page 124 Master-Slave 06/2005 Danaher Motion If you are using a static table, use the Windows-based tools. This method is simpler and you have more tools available with which to graph and analyze the cam table. You can create point-pairs using windows applications such as a text editor, spread sheets (Excel), or mathematical programs (MatLab).
  • Page 125: Operating Cams

    Danaher Motion 06/2005 Master-Slave This stores the cam as MyCam.Cam in flash memory. The name of the file follows the 8.3 format. The filename cannot have more than 8 characters in the main part and 3 characters in the extension. The cam data file must have the .cam extension This file can be loaded at any time using...
  • Page 126 Master-Slave 06/2005 Danaher Motion Step 1: Allocate Space Allocate space for the cam with Common Shared <var> as Cam. All cams are global, so this line must be located in Config.Prg. For example: Common Shared CAM1 as Cam Step 2: Load Cam Data This can be accomplished in two ways. For a static...
  • Page 127 Danaher Motion 06/2005 Master-Slave Step 5: Enable the Axis At this point, camming is enabled. However, you must enable the drive to see motion: A1.Enable = ON Camming cannot be enabled if the axis is in a relative or absolute move, or during STOP.
  • Page 128 Master-Slave 06/2005 Danaher Motion Step 6: Read Dynamic Information There are numerous read-only properties regarding the operation of the cam. Axis Properties <axis>.ACTIVECAM provides the name of the cam being executed by that axis. Cam Properties <cam>.CAMCYCLE provides the number of cycles the cam has executed.
  • Page 129: Simulated And Master-Slave Axes

    Danaher Motion 06/2005 Master-Slave 5. 4 IMULATED AND ASTER LAVE Simulated axes are used to enhance machine control. They typically are with gearing and camming. Three common uses are: To act as fixed speed masters for slaved axes. To monitor physical axes.
  • Page 130 Master-Slave 06/2005 Danaher Motion For example: Program OnEvent Vel_Below_Min PseudoAxis.Vcmd < 100 Jog PseudoAxis 100 ‘This indirectly turns gearing off End OnEvent OnEvent Vel_Above_Min PseudoAxis.Vcmd >= 100 PseudoAxis.Slave=Gear End OnEvent Attach PseudoAxis EventOn Vel_Below_Min EventOn Vel_Above_Min While 1 Sleep 100...
  • Page 131: Groups

    Danaher Motion 06/2005 Groups GROUPS Groups allow you to control multiple axes as a single mechanism. With groups, the position command and feedback signals are no longer single values, but instead, are vectors with two or three elements. Velocity and acceleration no longer apply to a motor, but instead, apply to the combination of two or three motors moving in concert.
  • Page 132: Position

    Groups 06/2005 Danaher Motion Group acceleration is the orthogonal combination of the axes' acceleration. Group acceleration and deceleration are limited according to the axes‘ values.You can impose limits to constrain the time during which group acceleration and deceleration occurs. <group>.TIMEACCELERATION and <group>.TIMEDECELERATION define the duration of the acceleration...
  • Page 133: Velocity

    Danaher Motion 06/2005 Groups 6. 5 ELOCITY A group’s scalar velocity properties are always the orthogonal combination of the respective axes' velocity properties. Group velocity properties include: VELOCITYCOMMAND vector property vector property VELOCITYFEEDBACK VELOCITYCRUISE scalar property scalar property VELOCITYFINAL VELOCITYMAX...
  • Page 134: Velocity

    Groups 06/2005 Danaher Motion ISSETTLED is a binary (ON or OFF) property that indicates if the group is settled. To be settled, the motion profile must be complete and the orthogonal combination of axis position errors must be below POSITIONERRORSETTLE. The time condition must also be satisfied.
  • Page 135: Motion

    Danaher Motion 06/2005 Groups For example: Common Shared Gr1 as Group AxisName=A1 AxisName=A2 Gr1.VRate = 50 ‘ VelocityRate Gr1.ARate = 70 ‘ AccelerationRate 70% Gr1.DRate = 80 ‘ AccelerationRate 80% Gr1.JRate = 60 ‘ JerkRate 60% 6. 9 OTION A group is controlled by the motion generator. This software device receives commands from MC tasks and produces position and velocity commands for each drive in the group every SERVO cycle.
  • Page 136: Motion Flags

    Groups 06/2005 Danaher Motion 6.9.3. Motion Flags The last step in preparing a system for motion is to turn the motion flags ON. There are two motion flags: the system motion flag and the motion flags of each axis within the group. For example: System.Motion = ON...
  • Page 137: Proceed

    Danaher Motion 06/2005 Groups 6.9.5. PROCEED After a STOP, you must PROCEED to clear the motion buffer. You can use PROCEEDTYPE to specify which way the motion generator should continue: PROCEEDTYPE = CONTINUE The motion generator continues the stopped command until complete.
  • Page 138: Circle

    Groups 06/2005 Danaher Motion On the other hand: xyTableGroup.Absolute = FALSE Move xyTableGroup {100, 200} moves xyTableGroup a distance of (100, 200) units from the start position. ABSOLUTE defaults to INCREMENTAL. You can change ABSOLUTE any time, although the effect does not take place until you issue the next MOVE.
  • Page 139: Chain Commands

    Danaher Motion 06/2005 Groups CIRCLETARGET is a group size array. It specifies the target point of the circle. This array is not queried. CIRCLE, defined using CIRCLETARGET, is limited to 360 degrees. CIRCLEPOINT is a position array that specifies a point on the arc. The arc is calculated using the CIRCLETARGET and these points.
  • Page 140 Groups 06/2005 Danaher Motion When the second motion is completed before the first one, the system does not blend the first and the third motions together. The main parameter in this type of blending CP. It specifies the distance from the target point on which the blending (second motion) begins.
  • Page 141: Move Control

    Danaher Motion 06/2005 Groups For example. Dim Shared blen_value As Long Program Attach xyTable BlendingMethod = 2 BlendingFactor = 0 StartType = GCom For blen_value = 100 To 80 Step -5 Move xyTable {0,10} Abs=1 Vcruise=100 BlendingFactor=blen_value Move xyTable {10,20} Abs=1 Vcruise=100 BlendingFactor=blen_value...
  • Page 142: Settling Time

    Groups 06/2005 Danaher Motion 6.10.1. Settling Time The MC actively watches to determine if the groups are settled into position. In most applications, the group position feedback is slightly delayed from the position command. After a move is complete, some time is required for the actual position to settle out to the commanded position.
  • Page 143: Chain Moves

    Danaher Motion 06/2005 Groups If you want to delay the start of a new move until a condition has been met, use <axis>.STARTTYPE. There are four choices: StartType = GeneratorCompleted or GCOM When STARTTYPE=GCOM, the new move starts as soon as the motion generator completes the current move's motion.
  • Page 144: Synchronize Multiple Axes

    Groups 06/2005 Danaher Motion MyGroup.StartType is set to GCOM. The second move begins after the first move is complete. You must use STARTTYPE=GCOM when chaining a move after non-zero velocity end- move. You cannot use STARTTYPE=IMMED or SIMM because the new move overrides the old move.
  • Page 145: Cleara Pending Move

    Danaher Motion 06/2005 Groups For example: Group1.StartType = SYNC AuxAxis.StartType = SYNC Move Group1 {500, 500} VCruise = 2000 Sleep 1000 ‘Program delayed between Move Commands Move AuxAxis 100 VCruise = 1000 SyncStart Group1 AuxAxis causes the two profiles to start at the same time.
  • Page 146 Groups 06/2005 Danaher Motion If you use SYS.VORD and <group>.VORD simultaneously, the axis speed is reduced by the product of both override properties. For example: Sys.VOrd = 66 ‘Reduce entire system to 2/3 speed GroupB.VOrd = 50 ‘Reduce GroupB to 1/3 speed You cannot override an axis in a group.
  • Page 147: Compensation Tables

    Danaher Motion 06/2005 Compensation Tables COMPENSATION TABLES Groups allow you to control multiple axes as a single mechanism. With groups, the position command and feedback signals are no longer single values, but instead, are vectors with two or three elements. Velocity and acceleration no longer apply to a motor, but instead, apply to the combination of two or three motors moving in concert.
  • Page 148: Access Data

    Compensation Tables 06/2005 Danaher Motion The values in the “source” columns are in absolute units, while the “target” values are in relative units (i.e., the value specified in the table is added to the current position of the axis, whether it is a geared, cammed or a regular axis).
  • Page 149: Load/Save From A File

    Danaher Motion 06/2005 Compensation Tables 7.1.4. Load/Save From a File Another way to create a compensation table is to directly load it from a binary file stored on the Flash disk. The structure of the compensation file is: Header –...
  • Page 150 Compensation Tables 06/2005 Danaher Motion The table is composed from 4, 9, 3 entries for X, Y, Z axes, respectively. Common shared comp1 as comp ‘This declares a table in the system. CreateComp comp1 4 ,9, 3 Comp1.minposition[1] = 0.1 ‘Setting min for the X...
  • Page 151: Phaser

    Danaher Motion 06/2005 PHASER PHASER The purpose of PHASER is to amplify or attenuate the master input value before entering the cam table or before multiplying by the gear ratio. The master - slave connection is achieved either by a cam table or through gearing.
  • Page 152: Execute

    PHASER 06/2005 Danaher Motion 8.1.2. Execute PHASER is a slave command, although it acts on the master signal. In the command (like MOVE), the slave axis and offset value are essential. With PHASER, there is a new factor ratio that translates between slave and master units.
  • Page 153: Generic Elements

    Danaher Motion 06/2005 GENERIC ELEMENTS GENERIC ELEMENTS Writing complex multi-axis applications requires high level software organization. Avoid code repetition by encapsulating blocks of code into functions or subroutines. Code blocks of setup or query properties, which can be applied for all (or at least several) groups or axes in the system, and can be assembled into functions and subroutines.
  • Page 154: Declaration

    GENERIC ELEMENTS 06/2005 Danaher Motion 9.1.1. Declaration Generic elements resemble other MC-Basic variables (longs, doubles, strings) in declaration syntax and scope (global, static and local), as well as in the ability to define arrays of up to 10 dimensions. COMMON SHARED|DIM {SHARED} <axis_name> {[]…} AS GENERIC AXIS COMMON SHARED|DIM {SHARED} <group_name>...
  • Page 155: Limitations

    Danaher Motion 06/2005 GENERIC ELEMENTS The right-side element of the assignment statement can be either generic or a “real”. A group cannot be assigned to a generic axis, and an axis cannot assign a generic group. Common Shared Gen_Group As Generic Group...
  • Page 156: Functions

    GENERIC ELEMENTS 06/2005 Danaher Motion 9.1.4. Functions Generic elements can be defined “by reference” in MC-Basic functions and subroutines. Axes or groups passed as arguments could be either “real” or generic. For example, axis setup can be encapsulated in a subroutine. In this example, the subroutine arguments are “real”...
  • Page 157 Danaher Motion 06/2005 GENERIC ELEMENTS Generic elements can also serve as returned values of MC-Basic functions. Both “real” and generic elements can be assigned to returned values. For example, to generalize the former code, an axis-indexing function can be added, in which a “real” axis is assigned to the return value:...
  • Page 158: With

    GENERIC ELEMENTS 06/2005 Danaher Motion 9. 2 WITH WITH can be given in three contexts: configuration file, terminal and task. All three contexts of WITH can be applied to generic elements. With Gen_Axis PFac = 0x8000 VFac = PFac/1000 AFac = VFac/1000 JFac = AFac/1000 …...
  • Page 159: Input/Output

    Danaher Motion 06/2005 Input/Output INPUT/OUTPUT The MC provides numerous types of I/O. It includes more than 40 I/O points as standard plus the SERVOSTAR drive includes 5 I/O points per drive. In addition, you can input an external encoder through any SERVOSTAR drive.
  • Page 160: Long-Word-Oriented Software I/O

    Input/Output 06/2005 Danaher Motion 10.2.2. Long-Word-Oriented Software I/O The entire word (32 bits) of software input and output is accessed when a bit position is not included in the reference to the input or output variable. So the following statement is valid: System.VOut=System.VIn...
  • Page 161: Switch Positions

    Danaher Motion 06/2005 Input/Output 10.3.2. Switch Positions The basic mechanism of the PLS is the switch position(s) where the PLS output changes state. The figure belows shows a PLS output with one switch position at 100. More switch positions can be added. To have the PLS in the above example turn back off at 200, simply add a second position at 200 as shown below: You can add any number of positions.
  • Page 162: Repetition Interval

    Input/Output 06/2005 Danaher Motion There is no explicit limit to the number of positions you can have in a PLS, but the PLS positions must be increasing monotonic (Position2 must be greater than Position1, Position3 must be greater than Position2, etc.).
  • Page 163: Pls Output State

    Danaher Motion 06/2005 Input/Output 10.3.7. PLS Output State Query the digital output associated with the PLS to query the state of the PLS output. For example, assume the PLS output is assigned to SYSTEM.DOUT.1. To determine the output state of the PLS, query the state of SYSTEM.DOUT.1:...
  • Page 164: External Encoders

    Input/Output 06/2005 Danaher Motion Step 4 Set PLSREPEAT. If you want the PLS to repeat, set the value of PLSREPEAT to a non-zero, positive number. For example, to have the PLS repeat every 10,000 position units, enter: MyPLS.PLSRepeat = 10000 PLSREPEAT defaults to 0, indicating that there is no repetition.
  • Page 165: Pc104

    Danaher Motion 06/2005 Input/Output If you are using the encoder for master/slave operation or in a way that requires the value of the signal be updated to the MC every SERCOS cycle, you must configure the telegram for that axis as Telegram type 7. You also must specify that external position must be included in the telegram.
  • Page 166: Commands

    Input/Output 06/2005 Danaher Motion 10.5.3. Commands The MC supports PC104 with memory and I/O instructions. For further ® information on these commands, refer to the SERVOSTAR MC Reference Manual. If you are using memory-mapped PC104 cards, you will need the memory access commands, PEEK and POKE.
  • Page 167: Error Handling

    Danaher Motion 06/2005 Error Handling ERROR HANDLING Error handling is the method used to react to and process fatal and non-fatal errors that occur during the operation of the MC. You can handle non-fatal faults, but not fatal faults. Fatal faults cause a WatchDog timer to be triggered.
  • Page 168 Error Handling 06/2005 Danaher Motion During the internal error action, the synchronous error is logged in the MC and the task is idled. The default system error handler stops all motion and all attached tasks. In the figure above, there are two mechanisms for trapping and dealing with errors: OnError and Try/Finally blocks.
  • Page 169: System Context

    Danaher Motion 06/2005 Error Handling 11.1.1.2. INALLY Unlike an OnError block, the Try/Finally block may appear anywhere in the main program section of the task. It can be used to take specific action with relation to a particular area of your program code. This type of error handler block only traps synchronous errors in the task context.
  • Page 170: Terminal Context

    Error Handling 06/2005 Danaher Motion SYSTEM.ERRORPRINTLEVEL only affects printing to the message log window. Fatal faults and errors continue to be logged, and can be viewed using ?ERRORHISTORY. ERRORPRINTLEVEL applies only to asynchronous errors. Synchronous errors are not affected. 11.1.3. Terminal Context Terminal context is similar to task context, as commands are processed similarly.
  • Page 171: Watchdog Setup

    Danaher Motion 06/2005 Error Handling 11.2.1. WatchDog Setup To set up the MC to enable the WatchDog, follow these steps: Create a new task solely for the WatchDog. Use BASIC Moves with File, New. Define a local variable as a Long. For the example below, we use MyVar.
  • Page 172: Uea (User Error Assertion)

    Error Handling 06/2005 Danaher Motion Reset the WatchDog with an API command based on a timer. Run the following Visual BASIC code once upon initialization: Include KMAPI.BAS in your project KMExecuteCmd(MC, “MyVar=WDInit(5)”) KMExecuteCmd(MC, “WDCycle(MyVar)”) Run the following Visual BASIC code from a timer set for 50 ms: KMEXecuteEmd(MC, “WDCycle(MyVar)”)
  • Page 173: Deletion

    Danaher Motion 06/2005 Error Handling If the exception number is not specified, the system associates exceptions with some numeric value, which can be queried. However, the system will not guarantee that this value is the same from load to load. Do not make any assumption about this number.
  • Page 174: Log

    Error Handling 06/2005 Danaher Motion 11.4.4. Log User exceptions are printed and logged according to existing rules: A note is printed but not logged, Unhandled errors are printed and logge, etc. In addition, the application developer can log an error without any error handling.
  • Page 175: Sample Nesting Program

    Danaher Motion 06/2005 Appendix A APPENDIX A AMPLE ESTING ROGRAM Dim Shared I1 As Long Dim Shared I2 As Long Dim Shared I3 As Long Dim Shared I4 As Long Dim Shared I5 As Long Program If I1=0 Then 'First If...Then If I2=0 Then 'Second If...Then...
  • Page 176: Subroutine Example

    Appendix A 06/2005 Danaher Motion UBROUTINE XAMPLE Dim Shared var_x As Double Dim Shared var_y As Long Dim Shared array_z[2][2] As Double Dim Shared rows As Long Dim Shared columns As Long Program REM initialize variables var_x=29.3172 var_y=5 rows=2 colums=2 array_z[1][1]=125.6...
  • Page 177: Sample Autosetup Program

    Danaher Motion 06/2005 Appendix A AMPLE UTOSETUP ROGRAM Below is an example auto setup program. This sample covers several pages. You do not need to understand the program in detail at this point but you should familiarize yourself with the structure.
  • Page 178 Appendix A 06/2005 Danaher Motion Sys.Motion = on 'Allow system motion A1.Motion = on 'Allow motion in axis A1 For sample_int = 1 To 10 'Loop 10 times Move A1 to 5 position unit(s) Move A1 5 Absolute=0 Sleep 2000...
  • Page 179 Danaher Motion 06/2005 Appendix A rem ------------------------------------------------------------- rem Axis Set-up Routine Automatically Generated by Project Wizard rem ------------------------------------------------------------- Sub AxisSetup If Sercos.Phase = 4 then A1.enable = off 'make sure axis is disabled End If A1.PFac = 65536 'Revolutions A1.VFac = A1.PFac / 1000 'Revolutions/second A1.AFac = A1.PFac / 1000 / 1000...
  • Page 180 Appendix A 06/2005 Danaher Motion Configure the axis for Telegram Type 7 using IDN 15 WriteIDNValue Drive = A1.Dadd IDN = 15 Value = 7 Configure the AT for VFb, PFb, and PExt (IDNs 40, 51, 53) WriteIDNValue Drive = A1.Dadd IDN = 16 Value = 40,51,53 Configure the MDT for VCmd, PCmd (IDNs 36, 47) WriteIDNValue Drive = A1.Dadd IDN = 24 Value = 36,47...
  • Page 181: Appendix B

    Danaher Motion 06/2005 Appendix B APPENDIX B OMOGENOUS ROUPS Non-homogenous groups consist of different axes, both rotary and linear. A feature was added to support the definition of velocities for non-homogenous groups. In the setup, rotary and linear axes are declared. The system determines if it is a linear- or rotary-dominant group.
  • Page 182 Appendix B 06/2005 Danaher Motion The concept of joint coordinates is an n-tupple number. Each number represents the coordinate of the specific joint. The world coordinates are supported by different built-in types (XY, XYZ, XYZR) that describe each of the different world space representations.
  • Page 183: Coupling

    Danaher Motion 06/2005 Appendix B Once all axes are set up, groups contain these axes. You must have the same user units on all axes. Set the group scaling factors. There is no position factor for the group! Instead, PFAC for each axis is used.
  • Page 184: Joints

    Appendix B 06/2005 Danaher Motion There are some properties that are axis- or group-only properties. For example DRIVEADDRESS is an axis-only property. MOVE consists two different command behaviors, Move-Group and Move-Axis. Move- Group moves the whole group together. All the axes within the group start and end the motion at the same time.
  • Page 185: Robot Models

    Danaher Motion 06/2005 Appendix B Joint movement gives the illusion of moving one physical axis (MOVE J1 100), although several motors could be moving together. The movement is executed according to the specified joint’s movement parameters. For example: A1.Acc = 100...
  • Page 186: Interpolation

    Appendix B 06/2005 Danaher Motion In these cases, world-space is identical to joint-space. Each coordinate of the joint-space vector is directly translated into a coordinate of world-space. In groups with the robot model defined (model > 1), the translation between joint- and world- space is much more complex.
  • Page 187 Danaher Motion 06/2005 Appendix B The following graph shows MOVES as seen in joint-space. The following graph shows MOVES as seen in world-space. 6 80 6 60 6 40 6 20 6 00 5 80 5 60 5 40 5 20...
  • Page 188: Nterpolation

    Appendix B 06/2005 Danaher Motion The following graph shows MOVE as seen in joint-space. The following graph shows MOVES as seen in world-space. -300 -200 -100 There are four commands to make point-to-point movement in robot groups. There are two commands to interpolate the motion (MOVE and MOVES) and two commands to define the target point (JOINT and LOCATION).
  • Page 189: Cartesian Profile

    Danaher Motion 06/2005 Appendix B Cartesian Profile For kinematics parameters of straight-line (MOVES) motion (velocity, acceleration, deceleration), different joint parameters are obtained, depending on where in the robot working space the starting line is positioned. The further from the origin, the smaller joint velocities are obtained.
  • Page 190: Working Envelope

    The minimal working envelope radius (RMIN) is available to the user (contrary to RMAX). Danaher Motion recommends setting this value for each application, according to the physical setup of the robot. If a point is given inside RMIN, an error message is returned.
  • Page 191: Robot Configurations

    Danaher Motion 06/2005 Appendix B Program attach move {j1.pmin,j2.pmin,0,0} while ismoving sleep 1 End While Print "Plotting the workspace" move {j1.pmin,0,0,0} move {j1.pmax,0,0,0} move {j1.pmax,j2.pmax,0,0} detach End Program Robot Configurations In robot models, there are several joint points representing the same robot end-effector position for each location point.
  • Page 192: Declaration

    Appendix B 06/2005 Danaher Motion Declaration A point must be declared before you can use it. The declaration of points is defined according to the type of robot (XYZR, XYZ, etc.). The MC enables the declaration of point variables, which can be scalar or arrays. Point arrays may have up to 10 dimensions. Point variables are designed to hold a list of 2 to 10 double-type coordinates.
  • Page 193: Vectors

    Danaher Motion 06/2005 Appendix B Execution of the right side of the JOINT or LOCATION node results in pushing the number of the vector elements into the stack (as a long type constant). The point’s subtype (determined by the shape of the vector’s brackets) is pushed to the stack (as a long type constant) by executing the third side of the JOINT/LOCATION node.
  • Page 194: Point Assignment

    Appendix B 06/2005 Danaher Motion Point Assignment Point assignment uses the following syntax: <variable_name> = (<expr1>,<expr2>,<expr3>,…,<exprn>) () = #{} for location () = {} for joint The expression can be a constant or other vector variable of the same robot type, but the size of the right side of the expression must equal the left side.
  • Page 195 Danaher Motion 06/2005 Appendix B UERY Point variables, properties and vectors return a value, so they can all be queried through printing or assignment into a compatible point variable or read-write property. Common Shared SCARA As Group Axnm = A1 Axnm = A2 Axnm = A3 Axnm = A4 Model = 4...
  • Page 196: Points In Functions

    Appendix B 06/2005 Danaher Motion Points in Functions Point variables can be passed to functions and subroutines both by reference and by value. An entire array of points can also be passed (by reference) to a function or subroutine. On the other hand, point properties and vectors can only be passed by value.
  • Page 197: Motion Commands

    Danaher Motion 06/2005 Appendix B Motion Commands Some motion commands use point nodal parameters when applied on groups. For example: CIRCLE, MOVE and MOVES. Some nodal parameters can be assigned with both point types (LOCATION and JOINT), like CIRCLECENTER, CIRCLEPOINT and the target positions of MOVE and MOVES. Other nodal parameters can accept only location points, like TOOL, BASE, etc.
  • Page 198: Group Point Properties

    Appendix B 06/2005 Danaher Motion Group Point Properties Following modal-only and read-only group properties of the point data-type exist: DEST DEST_JOINT Target point of the movement. START START_JOINT Starting point of the movement. HERE POSITIONFEEDBACK or PFB Actual point of the robot (feedback).
  • Page 199: Query

    Danaher Motion 06/2005 Appendix B A function can return a structure variable like any other data type. For example: Dim Shared A as X Program Dim S1 as X S1 = MyFunc(1) End Program Function MyFunc(i1 as long) as X MyFunc->Type = 1...
  • Page 200: Limitations

    Appendix B 06/2005 Danaher Motion Limitations A whole structure cannot be printed. Mathematical, logic and bitwise operators cannot be used for whole structures. A whole structure cannot be used as a condition in flow control statements and event definitions. A whole structure cannot be recorded.
  • Page 201: Window Declaration

    Danaher Motion 06/2005 Appendix B You can classify objects in the working frame and only track certain types of objects. Each moving frame can have several master sources (external sources of moving position). The number of sources is the number of degrees of freedom of the moving frame. You can use several robots to track the same operating region, but the region must be presented as a different moving frame object.
  • Page 202: T Racking P Rocess

    Appendix B 06/2005 Danaher Motion The orientation is composed of two components: the master source (if there is one) and the orientation change due to movement. On the path, if the new position command is known, the new orientation can be calculated.
  • Page 203 Danaher Motion 06/2005 Appendix B Relative Approach Relative tracking algorithm (slave = 5) The system moves the initial (before tracking) robot position (<robot>.SETPOINT) in the same direction as the tracking object position. Once synchronization is achieved, the robot moves synchronously on the same relative position to the moving object at the moment of approach start (slave=0).
  • Page 204: Customer Support

    These distributors offer literature, technical assistance, and a wide range of models off the shelf for the fastest possible delivery. Danaher Motion sales engineers are conveniently located to provide prompt attention to customer needs. Call the nearest office for ordering and application information and assistance or for the address of the closest authorized distributor.

Table of Contents