Leroy-Somer MD2 User Manual
Leroy-Somer MD2 User Manual

Leroy-Somer MD2 User Manual

Microprocessor card and software for mentor ii, vector, cde and hpcde drives

Advertisement

Quick Links

User Guide
MD29
Microprocessor card and software for
Mentor II, Vector, CDE
and HPCDE Drives
Part Number: 0400-0030
Issue Number: 4

Advertisement

Table of Contents
loading

Summary of Contents for Leroy-Somer MD2

  • Page 1 User Guide MD29 Microprocessor card and software for Mentor II, Vector, CDE and HPCDE Drives Part Number: 0400-0030 Issue Number: 4...
  • Page 2 Safety Information Persons supervising and performing the electrical installation or maintenance of a Drive and/or an external Option Unit must be suitably qualified and competent in these duties. They should be given the opportunity to study and if necessary to discuss this User Guide before work is started.
  • Page 3 General information The manufacturer accepts no liability for any consequences resulting from inappropriate, negligent or incorrect installation or adjustment of the optional operating parameters of the equipment or from mismatching the variable speed drive (Drive) with the motor. The contents of this User Guide are believed to be correct at the time of printing.
  • Page 4: Table Of Contents

    Contents Introduction Overview Memory PC requirements Technical data for the MD29 User knowledge Installation Installation procedure Configuring the system Getting Started Introduction Example DPL program Creating a DPL file using the DPL Toolkit DPL Programming Program headers Comments Variables Parameters Operators Tasks and real-time programming Instructions and functions...
  • Page 5 DPL Toolkit Overview of the DPL Toolkit File management Editing a program Applying styles Compiling and running a program Downloading a program 5-10 Running a program 5-11 Program monitoring and debugging facilities 5-11 Serial Communications Introduction Hardware connections ANSI communications Serial communications modes 6-13 ANSI instructions...
  • Page 6 Features Overview PLC parameters Introduction Encoder lines Position Enabling the position controller Default and Reset Values Parameter descriptions Logic diagrams 8-19 8.10 Using S-Ramps with Digital Lock 8-24 8.11 Cam function 8-25 8.12 Reference switching 8-28 8.13 Timer/Counter unit 8-30 8.14 Digital I/O ports 8-34...
  • Page 7: Introduction

    Introduction On a Variable Speed Drive (such as Mentor II, Vector or CDE), timing functions necessary for the correct operation of power devices are performed by its own microprocessor operating in real-time. This imposes limitations on the microprocessor when carrying out other duties, resulting in a reduction of flexibility of the Drive.
  • Page 8: Memory

    DPL Toolkit (Windows™ interface) The DPL Toolkit is contained on two diskettes. It is a program which runs in Microsoft® Windows™ Version 3.1x and Windows™ 95. Programs for the MD29 are written on a host using the DPL Toolkit. Serial communications link Host PC (Desk-top or industrial) The MD29 uses a high-level programming language called DPL...
  • Page 9: Pc Requirements

    PC requirements The minimum minimum requirement for the DPL Toolkit is as follows: compatible 386SX , Windows™ 3.1, 4Mb IBM AT A 486 with 8MB is recommended Technical data for the MD29 Intel 960 32-bit processor RISC 96kb of user program storage 8kb user 16MHz clock port for programming (...
  • Page 10 MD29 Introduction Issue code: 29nu4...
  • Page 11: Installation

    Installation The voltages present in the Drive are capable of inflicting a severe electric shock and may be lethal. The Stop function of the Drive does not remove dangerous voltages from the Drive or the driven machine. Warning AC supplies to the Drive must be disconnected at least 15 minutes before any cover is removed or servicing work is performed.
  • Page 12 Refer to the Mentor II User Guide for the mechanical details. Use the following procedure to fit the to the circuit board of MD29 MDA2B the Drive: Isolate the supply from the Drive. Remove the front cover from the Drive. Fit the four small securing pillars to the corners of the MD29 Find the 40-pin header connector on the...
  • Page 13 CDE7500 and HPCDE Drives Refer to the User Guide for the mechanical details. Use the following procedure to fit the to the control board in the MD29 IN–82 Drive, or to the board in the Drive: IN-90 HPCDE Isolate the supply from the Drive.
  • Page 14 Fit the 40-pin connector of the on to the connector on the MD29 IN–82 control board, ensuring the pins are aligned, and that the pillars on the control board are correctly aligned with the locating holes in the IN–82 MD29 Push the carefully into position.
  • Page 15 Vector Drive IN-31 MD29 Terminal Block Location of the MD29 on the IN-31 control board in the Vector Drive Location of the MD29 on the IN-31 control board in the Vector Drive Refer to the Vector User Guide for mechanical details. Use the following procedure to fit the to the control board in the...
  • Page 16 Locate the 40-pin connector of the on to the connector on the MD29 control board, ensuring the pins are aligned, and that the pillars IN–31 control board are correctly aligned with the locating holes on the IN–31 in the MD29 Push the carefully into position.
  • Page 17: Configuring The System

    Configuring the system Host PC connections serial port is a dedicated link to the host . The port is a 9-way RS232 Port RS232 female D-type connector. Ready-made cables for serial RS232 communications are generally available. The table below gives the minimum required connections between the MD29 and a 9-way and 25-way pin port connector.
  • Page 18 Windows 95 Insert disk 1 of the DPL Toolkit into the A: A: drive of the host PC. In the menu, select R R un... un..Type A:\SETUP Click on Downloading the system file has no pre-loaded system software. The first task is to program MD29 the system software using the DPL Toolkit.
  • Page 19 If the dialog box does not appear, and all the buttons in the lower toolbar of the window appear shaded (inactive), communications . Check the connecting cable is could not be established with the MD29 correct, and the correct port is used. Click on .
  • Page 20 Note The system files for MD29 issue 1 are located in directory MD29GUI\BIN\SYS\MD29ISS1. The Programmer Programmer dialog box appears. Click on (green light showing). The system file is now loaded into the MD29 MD29 2-10 Installation Issue code: 29nu4...
  • Page 21: Getting Started

    Getting Started Introduction This chapter explains the key elements of DPL programming, and the methods used to create, compile and run an example program using the DPL Toolkit. An example of a short program is given below, followed by explanations of the program instructions.
  • Page 22 Start #1.18 = 0 #1.18=#1.18+1 Is #1.18 < 1000? Flow diagram of program Flow diagram of program Sawtooth Sawtooth Program instructions $TITLE Sawtooth $VERSION 1.1.1 $DRIVE Mentor $AUTHOR MyName $COMPANY MyCo //Note: This is a comment. BACKGROUND Top: #1.18=0 #1.18<1000 DO WHILE #1.18=#1.18+1 LOOP...
  • Page 23 Explanation of the example program $TITLE Sawtooth The first line of a program must be program name. The name $TITLE can have a maximum of 64 characters. $VERSION 1.1.1 The second line is number. The number can have a maximum $VERSION of eight characters.
  • Page 24 Top: Top: Top: is a label which marks an absolute position in the program. A label must always be followed by a colon [: : ]. A label defines the destination of a statement. It can be given GOTO any name (eg. mylabel mylabel).
  • Page 25: Creating A Dpl File Using The Dpl Toolkit

    Creating a DPL file using the DPL Toolkit This section shows how to write, compile and download the example DPL program for the Mentor II Drive. Opening the DPL Toolkit In Windows 3.xx Program Manager, or Windows 95 Start menu, click on: The DPL DPL Toolkit Toolkit window appears.
  • Page 26 Open the File File menu and select Save As... Save As..The Save File As Save File As dialog box appears. In the Folders: Folders: list, select the Projects Projects directory. In the File File name: name: text box, type SAWTOOTH.DPL Click on .
  • Page 27 If the DPL source file is required to be downloaded to the , ensure MD29 the Embed DPL Source Code Embed DPL Source Code check box is checked. This facility allows the DPL program to be read back to the at a later date (if the computer copy becomes lost, for example).
  • Page 28 Connecting to the MD29 It is now necessary to establish communications from the host to the in order to download the compiled file. MD29 Use the following procedure: Click on . The Task Manager opens with the Task Manager toolbar appearing below the standard toolbar.
  • Page 29 In the Programmer Programmer dialog box, click on (green light showing). The files are now downloaded to SAWTOOTH SAWTOOTH . Down-loading takes a few seconds to complete. MD29 Note can hold only one compiled program (ie. .BIN file) MD29 in memory at one time. A program that is downloaded to will over-write an existing program.
  • Page 30 MD29 3-10 Getting Started Issue code: 29nu4...
  • Page 31: Dpl Programming

    DPL Programming This chapter explains the following parts of a DPL program: • Program headers • Comments • Variables • Parameters • Tasks • User-defined sub-routines • Instructions The explanation is followed by a section on optimizing DPL programs. Program headers program must begin with five program headers in the correct order, as follows: •...
  • Page 32 Drive name Syntax $DRIVE Drive name The type of Drive and its size must be specified in Drive name Drive name since $DRIVE the DPL Toolkit can be used with different types of Drive. This program header ensures that the program is correctly compiled for the option module and Drive.
  • Page 33: Comments

    Comments Comments are purely for information and explanation purposes. They act in the same way as commands by not acting on the program. Comments begin with a double forward slash [//] or a semi-colon [;]. They can be placed on their own line, or at the end of instruction lines. A Comment ends at the end of the line.
  • Page 34 Naming conventions The first character of a variable must be a letter. Subsequent characters may include letters, numbers and the underscore ( ) character. These may be in any order. Variable names are case sensitive (eg. the variable name speed% speed% is not the same as SPEED% SPEED%).
  • Page 35: Parameters

    Constant arrays contain fixed pre-defined values that cannot be changed Constant arrays by the DPL program when the program is being run. The values of the constant array are defined in the DPL program by using a special section called .
  • Page 36 Operators for floating-point and integer variables Plus – Minus Divide Multiply Operators for integer variables only & Logic AND 5 & 14 = 4 Example Example | Logic OR 5 | 14 = 15 Example Example Logic XOR 5 & 14 = 11 Example Example !Value Bit invert...
  • Page 37: Tasks And Real-Time Programming

    Tasks and real-time programming Real-time programming runs with reference to a clock to enable the user to specify the actual times instructions are executed, not just the order in which they are executed. When real-time programming, a task Structure (or philosophy) has to be maintained. programs contain sections called tasks, where a task enables a priority MD29 to be given to a sub-routine.
  • Page 38 BACKGROUND task task is used for functions and commands that do not BACKGROUND require time-related or encoder-related monitoring. This task would be used for the following: • Data logging • Checking digital inputs • Setting output status task runs after the task is completed.
  • Page 39 BACKGROUND Task giving way to the CLOCK Task CLOCK Task timing period INITIAL Task CLOCK Task BACKGROUND Task BACKGROUND Task giving way to the CLOCK Task, and the CLOCK Task giving way to the ENCODER Task ENCODER Task timing period INITIAL Task ENCODER...
  • Page 40 BACKGROUND task giving way to the ENCODER and CLOCK tasks timing periods begin. ENCODER CLOCK task runs until it is interrupted by the next task. CLOCK ENCODER The CLOCK task is completed when the ENCODER task has finished. task ends, leaving time for the task to run CLOCK BACKGROUND...
  • Page 41 CLOCK task task is used for time-related monitoring of the Drive, and CLOCK commands to the Drive (eg. controlled acceleration or deceleration ramp). The task has the second lowest priority. Only the task gives BACKGROUND way to the task. CLOCK The task is executed on a constant timebase;...
  • Page 42 EVENT task task runs when a specific event occurs. The source of the event EVENT is determined by the Timer/Counter Unit. task has the highest priority when the program is running. All EVENT other tasks give way to the task. EVENT Refer to Timer/Counter Unit in Chapter 8 Features for further information.
  • Page 43: Instructions And Functions

    Instructions and functions This section describes the different types of instructions which are used in programming. Conditional instructions A conditional instruction performs an operation according to a set condition (eg. Condition True False (Yes) (No) Procedure 1 Procedure 2 Example of an IF, THEN flow diagram Example of an IF, THEN flow diagram Loop instructions A loop instruction repeats a block of instructions until a specified...
  • Page 44 Flow-control instructions A Flow-control instruction causes the program to jump to a specified instruction or to be terminated (eg. GOTO Maths functions A Maths function applies a mathematical operative to an expression to return a value (eg. Signal-processing functions A Signal-processing function returns a value from a number of samples over a fixed time-period.
  • Page 45: Optimizing Programs

    Optimizing programs In order for programs to run effectively, the following are recommended. Integer variables Use integer variables where possible, rather than floating-point variables. The processing of a floating-point variable is 20 times slower than for an integer variable. (See instruction in Chapter 7 Reference.) Fixed-point arithmetic To represent decimal places, use fixed-point arithmetic.
  • Page 46 Integer division When using integer division, accuracy may be lost in the result, as shown in the following expression: If #1.18 is equal to 5 Then we have the following: a = 4.5 * (#1.18 /4) = 4.5 * (5 /4) = 4.5 * 1 = 4.5 The DPL compiler uses an integer divide, converts the result to a...
  • Page 47: Parameter Pointers

    #INT instruction instruction converts a parameter that requires floating-point The #INT variables to accept integer variables. This greatly increases processing speed. Example #2.00 = 2.1 // set #2.00 at 2.1 on CDE750 Drive //is the same as #INT2.00 = 21 // Reading is also possible: value% = #INT2.00 Parameter pointers...
  • Page 48: Defining Aliases (Constants)

    4.10 Defining aliases (constants) Sometimes it is useful to assign a meaningful name to a parameter or a value. For example: Parameter #1.18 could be referred to as SPEED_REFERENCE Instructions can be written in the form: SPEED_REFERENCE = MAX_SPEED Aliases are created using the directive.
  • Page 49: Dpl Toolkit

    DPL Toolkit This chapter describes operation of the DPL Toolkit, compiling of programs, and the debugging facilities. Overview of the DPL Toolkit The DPL Toolkit enables the user of the to amend, write and download MD29 programs to the . The Toolkit consists of a set of compilation tools MD29 and a comprehensive editor and debugger.
  • Page 50: File Management

    File management File management in the DPL Toolkit follows similar principles to that in other Windows applications. In addition to the standard procedures, there are procedures specific to the DPL Toolkit. These are given below. File menu The File File menu is as follows: Creating a In the File File menu, select New...
  • Page 51 The Add to Add to option allows files to be added to a menu for easy access. Add a filename to a When the Add to Add to option is selected, the following list appears. menu This list refers to two of the main menu items Favourite Favourite and Cue Cue Cards Cards in...
  • Page 52 File Viewer File Viewer allows the user to perform the following: • View a file without opening it • Copy text from an unopened file and paste it in the open file • Pre-select individual lines for copying in one operation Opening Do either of the following: File Viewer...
  • Page 53: Editing A Program

    Editing a program Edit menu The Edit Edit menu is as follows: The basic editing tools are similar to other Windows applications. The tools allow you to cut, copy, paste, clear and undo. Cutting a Select Cut Cut Line Line to delete highlighted instruction lines. line Find/Replace to find and replace characters and words.
  • Page 54 Use the following procedure to copy lines in a specific order from Appending instruction File Viewer to the program being written: lines Select in turn the lines shown in File Viewer that are to be copied to the new program. After each selection, click on (Append Append).
  • Page 55: Applying Styles

    Applying styles The Style Style menu is as follows: Styles Styles let you alter the way the DPL Toolkit screen appears. There are 48 background and text colours giving over 2000 combinations of colours that can be used. Under Font Font, there is an extensive list of text fonts including TrueType fonts.
  • Page 56: Compiling And Running A Program

    Compiling and running a program Task Manager toolbar The DPL Task Manager contains powerful compilation and debugging tools. These tools enable the programmer to check the program in great detail. Some of the debugging tools are automatic and check for programming errors.
  • Page 57 Debugging options The debugging options enable various debugging aids for the DPL program to be de-selected. See Program monitoring and debugging below for a description of these options. If errors are encountered in compiling the file, the Build Errors Build Errors window appears showing the program errors.
  • Page 58: Downloading A Program

    Errors and warnings An error indicates that the compiler could not interpret a line or command in the DPL program. This could occur if a command is mis-spelt, incorrectly used, etc. A warning indicates that the compiler understood the commands but the code may not function in the way you expected.
  • Page 59: Running A Program

    Running a program Click on (Restart Restart). This runs the DPL program from the beginning (ie. at the task). The Task Manager buttons for the tasks present in INITIAL the program are made active. Stopping the program Click on (Pause Pause).
  • Page 60 Breakpoints A breakpoint is a line in a task at which point the task will stop the program running and enter into single-stepping mode. Breakpoints are useful for checking when a program reaches a particular piece of code, or for checking the state of DPL variables at a particular point. Setting a Place the cursor on the line where the breakpoint is to be set.
  • Page 61 Example display Example display in in the the Watch Watch window window There are two section to the Watch Watch window. The top section shows the values of the parameters and variables being continuously continuously updated while the program is running. Values can be shown numerically and graphically. The bottom section allows snap-shot reading and writing of parameters and program variables.
  • Page 62 Use the following procedure for monitoring a parameter or variable: Click on the toolbar button for the required display method. Select the required parameter or variable to be watched, using one of the following methods: • In the parameter text box on the left, type in the name of the parameter or variable to be watched.
  • Page 63 Note If any changes are made to the program, it has to be re-saved, compiled and downloaded to the MD29 Saving the The settings of the Watch Watch window can be saved onto disk for later use. To achieve this, select Save Save in the File File menu of the Watch Watch window.
  • Page 64 System information System information gives the user information about the program in the , such as the program name, date of compiling, version number of the MD29 operating system, etc. MD29 To view this information, click on (System information System information). The System Information System Information message box appears, eg: MD29...
  • Page 65 The Log window The Log window can be used to show the following: • System messages (eg. the starting and stopping of a program) • Watch window values (useful for data logging) • The output of the DPL instruction (see PRINT instruction in PRINT Chapter 7, Reference).
  • Page 66 MD29 5-18 DPL Toolkit Issue code: 29nu4...
  • Page 67: Serial Communications

    Serial Communications Introduction A serial communications link enables one or more cards to be used in MD29 systems controlled by a host unit such as a or computer. The communications link uses the standard. RS485 may also act as the host in a system, controlling Drives, MD29 UD70 modules,...
  • Page 68: Hardware Connections

    Hardware connections The following table details the hardware connections for the RS485 communications port. RS485 4-wire RS485 2-wire Tx Rx Tx Rx DI0 * DI0 * DI0 * DI0 * DI1 * DI1 * DI1 * DI1 * Tx/Rx Tx/Rx Tx/Rx Tx/Rx DO *...
  • Page 69 Terminating the cable When a multi-drop system is used, connect a 120Ω resistor between RS485 the two receive lines of the last unit in the chain (ie. the unit farthest away from the host). Care must be taken to ensure that other units in the system do not have the resistor already fitted.
  • Page 70: Ansi Communications

    ANSI communications Using the standard ANSI slave protocol The standard built-in protocol which defines the message structure used to read and write parameters on the x3.28-2.5-A4. This section MD29 ANSI explains this protocol. The user may also create his own protocol by writing it in a DPL program, using low-level port commands such as (refer to GETCHAR...
  • Page 71 The character set used is called the low set. The set comprises 128 ASCII characters decimally numbered from 0 to 127. The first 32 characters in the set (hex. 00 to 1F) are used to represent special codes. These are the ASCII control codes, each of which has a particular meaning (eg.
  • Page 72 Addressing Each unit on a communications bus must be given a unique identity or ANSI address so that only the target unit will respond. The address MD29 comprises two parts: • The Group Address which is the first digit. • The Unit Address which is the second digit. Both the group address and unit address have a range of 1 to 9.
  • Page 73 Parameter identification All parameters are identified by four digits representing the menu and the parameter number, but without the decimal point. Example To send a message to menu 4, parameter 8, write 0408 (the leading zero must be included) To send to menu 16, parameter 10, write 1610 1610.
  • Page 74 Block checksum (BCC) In order to ensure that the messages from or to the do not become MD29 corrupted during transmission, all write messages and data responses are terminated by the block checksum character ( ). See Calculating the block checksum (BCC) later in this section. Reading parameters To read a parameter, the following message is sent: Control...
  • Page 75 Example To read the speed set-point of a Mentor II Drive that is unit 2 of group 1, send: Control Address Parameter Control The unit replies as follows: Control Parameter Data Control – Note When the replies to a command, the length of the MD29 data field returned is variable, depending upon the type of Drive, and the parameter being read.
  • Page 76 Writing to parameters To write data to a parameter (Drive or virtual), the message structure is comprised as follows: Control Address Control Parameter Data Control GA GA UA UA M1 M2 P1 P2 D1 ... Dn Where: Group address Unit address Menu number M1 M2 Parameter number...
  • Page 77 Re-writing data Once a write message which includes the address field has been sent and accepted with either a < > or < > response, subsequent write messages to that particular can use a re-write message structure in MD29 which the address does not need to be re-transmitted. The re-write structure is as follows: When a different is addressed, or an invalid character is received, the...
  • Page 78 The complete calculation is show in the table below: Character Binary Value XOR result 0011 0000 – 0011 0001 0000 0001 0011 0010 0011 0011 0011 0101 0000 0110 – 0010 1101 0010 1011 0011 0011 0001 1000 0011 0100 0010 1100 0010 1110 0000 0010...
  • Page 79: Serial Communications Modes

    Serial communications modes has ten communication modes as follows: MD29 • 4-wire and 2-wire standard slave ANSI • High-speed parameter transfer • Programmable master/slave modes • User modes • The has an additional mode for use with the I/O Box. MD29AN The available options are as follows (see Set-up parameters in Chapter 10 Parameters for details of the actual parameters):...
  • Page 80 Mode 6 User mode This mode turns off all internal protocols and allows the user to use the port directly from a DPL program. Typically, this mode will be used RS485 in conjunction with the DPL master commands ( ANSI ANSIREAD ANSIWRITE etc.).
  • Page 81 Using Modes 2 and 3 Source Destination Scale Scale ±16000 #xx.xx Any parameter Serial link Any parameter MD29 operating in Mode 2 MD29 operating in Mode 3 Functions of Modes 2 and 3 Functions of Modes 2 and 3 Using Modes 6, 7, 8 and 9 In Modes 6, 7 or 8, it is possible to use the as an master device...
  • Page 82: Ansi Instructions

    ANSI instructions The following instructions are available: RS485 ANSI Issue a Read command to a remote unit ANSIREAD Read a reply from a remote unit ANSIREPLY Issue a Write command to a remote unit ANSIWRITE Receive a single character directly GETCHAR Transmit a single character directly PUTCHAR...
  • Page 83 ENDIF CALL get_reply: // write accepted? IF reply% <> -65540 THEN // –65540 is ACK PRINT “Error in sending message to CD” ENDIF GOTO top: get_reply: { // sub-routine to wait for a reply timeout% = 0 // reset timer // returns –65536 if the reply has not been received yet reply% = ANSIREPLY LOOP WHILE reply% = –65536 AND timeout% <...
  • Page 84 Md29 6-18 Serial Communications Issue code: 29nu4...
  • Page 85: Reference

    Reference Tasks Refer also to Tasks and real-time programming in Chapter 4 DPL Programming. INITIAL task task is used typically to initialize program variables and Drive INITIAL parameters. task boots-up the DPL program and runs only when the INITIAL MD29 reset or at the moment power is applied to the Drive.
  • Page 86 CLOCK task task is used for time-critical monitoring of the Drive and CLOCK commands to the Drive (eg. controlled acceleration or deceleration ramp). task is executed on a fixed timebase, asynchronously to the CLOCK Drive. The actual timebase used depends on the set-up parameter (see Set- up Parameters in Chapter 10 Parameters), which can range from 1ms to 200ms).
  • Page 87 ERROR task task is executed when a run-time error occurs in a DPL program. ERROR Refer to section Advanced error-handling in Chapter 9 Diagnostics for further information. User-defined task User-defined tasks are sub-routines written by the user and are used in conjunction with the instruction (see instruction later in this...
  • Page 88: Instructions And Functions

    Instructions and functions The following instructions and functions may contain more than one form of syntax. Where there is more than one form, the first is for use with integer variables; the second is for use with floating-point variables. (See Chapter 4 DPL Programming).
  • Page 89 ANSIREPLY Syntax result% = ANSIREPLY This is a 4-wire port function which is used in conjunction with the RS485 functions. This function is typically used to obtain ANSIREAD ANSIWRITE the returned data from a Drive immediately after the issuing of ANSIREAD ANSIWRITE The following information is returned:...
  • Page 90 ARCTAN Syntax result = ARCTAN (expression) This mathematical function returns the arctangent of the expression in radians. Example x = ARCTAN(0.8) This returns the value 0.674740942 radians. See also instruction. AVERAGE Syntax result% = AVERAGE (input expression%, number of samples%) This signal-processing function returns the running average of the input for the desired number of samples.
  • Page 91 BCD2BIN Syntax int% = BCD2BIN (integer expression%) This function converts a binary coded decimal number to a normal binary integer. It is used to operate on digital input input data from from the I/O Box (eg. thumbwheel switches). (Binary coded decimal is a method of writing a decimal number in a binary format.) 954 in decimal format is represented as 1001 0101 0100 in Example...
  • Page 92 CALL Syntax CALL program-label: This is a flow control instruction which is used to execute a Standard Application Program, or a user-defined Task. After the sub-routine has been completed, the program returns to the line following the instruction [ CALL Example 1 ENCODER{ CALL diglk...
  • Page 93 DELAY Syntax DELAY (Integer expression%) instruction causes the program to pause for a time specified by DELAY the integer expression in increments of 0.1 second. This instruction cannot be relied on to produce an accurate time delay. In the worst case, the time delay could be 100ms shorter than that specified (it will never be longer).
  • Page 94 DO WHILE Syntax 1 DO WHILE Conditional expression Instruction LOOP Syntax 2 Instruction LOOP WHILE Conditional expression Syntax 3 DO WHILE Conditional expression LOOP This is a loop or iterative instruction which causes a block of instructions to be repeated until a specific expression becomes false. Syntax 1 Syntax 1 allows the conditional expression be evaluated first.
  • Page 95 Syntax result = EXP (expression) expression This mathematical function returns the exponential function (e Example X = EXP(4.5) This returns the value 90.0171313. See also instruction. FILTER Syntax result% = FILTER (input expression%, time constant %) result = FILTER (input expression, time constant%) This is a signal processing function which returns the output of a first-order filter function with input expression as the input.
  • Page 96 FLOAT Syntax result = FLOAT (integer expression%) This function converts an integer variable into a floating-point variable. Example error% = 123 result = error% / 1000 This produces an output of [result = 0] since 123 / 1000 = 0 in integer arithmetic.
  • Page 97 GOTO Syntax GOTO label This is an unconditional branch instruction which causes program execution to jump to, and continue from, the line specified by [label]. When declaring a label and when indicating which label to go to, a trailing [:] must be written with the label.
  • Page 98 Syntax 1 IF conditional expression THEN Instruction ENDIF Syntax 2 IF conditional expression THEN Instruction if condition is true ELSE Instruction if condition is false ENDIF Syntax 3 IF conditional expression 1 THEN Instructions if true, goto ENDIF ELSEIF conditional expression 2 THEN Instructions if true, goto ENDIF ELSEIF conditional expression 3 THEN...
  • Page 99 Example 3 uses the operator in the conditional expression. The following operators can be used to combine conditional expressions: Logical Logical Logical The following conditional operators may be used in the conditional expression: > Greater than < Less than >= Greater than or equal to <= Less than or equal to...
  • Page 100 Output Limit Input Limit Example #1.18 = LIMIT (inc%, 1000) ;if inc% > 1000 then limit to 1000 ;if inc% < –1000 then limit to –1000 This limits the output to ±1000. See also instruction and instruction. Syntax result = LN (expression) This mathematical function returns the natural logarithm of an expression.
  • Page 101 Syntax result% = MIN (expression A%, expression result = MIN (expression A, expression This mathematical function returns the smaller of two functions Example a% = 12 b% = MIN(a%, 100) The value returned in b% b% is 12 because a% a% is less than 100.
  • Page 102 Character Function ASCII Character Form feed Carriage return Vertical tab. Single back-slash \NNN (N is an octal number) Example “Hello\r\n Goodbye\r\n” PRINT This prints the following words: Hello Goodbye Note Do not over-use the instruction. It is better to use the PRINT Watch window in the Toolkit in order to monitor variables.
  • Page 103 REINIT Syntax REINIT Set up parameters are read by the only at the moment power is MD29 applied to the Drive or the is reset. If changes are made to the set-up MD29 parameters by a DPL program, the instruction can be used to force REINIT to re-read them so that changes can take effect.
  • Page 104 Syntax result = TAN (expression) This mathematical function returns the tangent of an angle expressed in radians. instruction and instruction. Example result = TAN (3.1416) TIME Syntax result% = TIME instruction returns the number of elapsed milliseconds since TIME power was applied or the was last reset.
  • Page 105: Features

    Features For Mentor only This chapter covers the following features of the MD29 • Single-axis position controller • Timer/counter unit • Digital I/O ports • Non-volatile memory storage Overview Built into the operating system is a basic single-axis position controller. This can be used with a DPL program to control a Drive in closed-loop modes for applications such as cranes, indexing, etc.
  • Page 106: Introduction

    Introduction An advanced position controller and profile generator is built into the operating system of the MD29. The function blocks are designed to provide position control and profile generation from one of the following: • position reference. • speed reference. •...
  • Page 107: Encoder Lines

    Encoder lines All position, speed and acceleration parameters within the position controller use the units of Encoder lines. The diagram below shows how to determine the number of encoder lines for a particular encoder. 1 encoder pulse Encoder lines Position Position values are absolute positions referenced from the power-up position.
  • Page 108 Mentor II tacho speed feedback If the Mentor II is using a tacho to provide the speed feedback, the speed reference conversion must be done in the DPL program. The Mentor II uses its own speed loop units, where 1000 units = maximum motor speed, while the position controller uses encoder lines per second to define the shaft speed of the feedback encoder.
  • Page 109: Enabling The Position Controller

    Enabling the position controller The position controller must be enabled by setting #14.12 = 1. The position controller is synchronised to the ENCODER task timebase, which is set using #14.14. The REINIT command does not read #14.12. To enable and disable the position controller while the drive is running, use Q20%.31.
  • Page 110: Default And Reset Values

    Default and Reset Values The default values listed are values that will be assigned to certain parameters if the current value is invalid when the position controller is reset. “-----“ indicates that there is no default value for that parameter. The position controller can be reset in 3 ways: MD29 HARD RESET MD29 SOFT RESET...
  • Page 111: Parameter Descriptions

    Parameter descriptions Final speed demand Units Encoder lines per second Range –2 to 2 Default ----- Reset H = CAL S = CAL P = CAL Q0% gives the speed reference output from the PID controller in units of encoder lines per second. Auxiliary encoder position Units Encoder lines...
  • Page 112 Internal speed reference Units Encoder lines per second Range –2 to 2 Default Reset H = 0 S = 0 P = 0 Q3% is the target speed for the slave, and is used as the input to the profile generation block. The actual speed profile is modified by the ramp rates ( Q12% and Q13%) and ramp type (linear or S-ramp).
  • Page 113 Derivative/feedforward gain Units 0.1% per second Range 0 to 2 Default 1000 Reset H = S/V S = N/A P = N/A Q7% defines the amount of derivative or feed-forward gain (depending on Q20%.0) for the PID loop. For a constant rate of change of error of 1 count per second and a gain of 1000, the output of the D term will be 1.
  • Page 114 Q11% Ratio for digital lock Units Ratio * 10 Range 0 to 800000000 Default 100000000 Reset H = S/V S = N/A P = N/A Q11% specifies the ratio applied to the digital lock function, multiplied by . This gives a maximum ratio of 8.00000000 (8 decimal places). Values Q11% are clamped to the maximum and minimum range.
  • Page 115 Q14% Maximum speed Units Encoder lines per second Range 0 to 2 Default 20480 Reset H = S/V S = N/A P = N/A Q14% defines the maximum rate of change of position (speed) used within the speed and position profile generators. The value set in Q14% should not be higher than the maximum speed setting for the drive.
  • Page 116 Q20% Bit mapped control word All bits of Q20% are read-write bits. They act as switches to select between the various functions available. (See logic diagrams.) The remaining bits without descriptions are reserved for future use. Q20%.0 Selects the mode of operation of the D term. feed-forward term.
  • Page 117 Q24% Auxiliary encoder speed feedback Units Encoder lines per second Range –2 to 2 Default Reset H = CAL S = CAL P = CAL Q24% shows the speed of the auxiliary (or reference) encoder. This value is calculated directly from the encoder lines and is not filtered. Q25% Main encoder speed feedback Units...
  • Page 118 Q31% Bit mapped indication parameter All bits of Q31% are read-only bits controlled by the operating system. The remaining bits without descriptions are reserved for future use. A value of 0 in any bit shows that each statement is false. Q31% is reset to 0 when Q32%.17 is set to 1.
  • Page 119 Q32%.8 Selects S-ramps for the position reference profile. The acceleration profile will be sinusoidal. When S-ramps are selected, the acceleration and deceleration rates are defined by Q13%. If the digital lock or cam table references are selected, Q32%.8 will be reset to disable the S-ramps.
  • Page 120 Q32%.27 Ramps can be applied to the slave reference to prevent excessive rates of acceleration and deceleration, particularly when digital lock is enabled. If ramps are not selected, the auxiliary encoder reference is simply multiplied by the ratio ( Q11%). rigid digital lock.
  • Page 121 Q34% Cam table index Units Integer Range 0 to tablesize% Default ----- Reset H = S/V S = N/A P = 0 Q34% shows the current cam table index. This indicates which section of the cam profile is currently in progress. Q35% Cam table master starting position Units...
  • Page 122 Q40% Return position Units Encoder lines Range –2 to 2 Default ----- Reset H = S/V S = N/A P = N/A When switching out of digital lock and into position control mode Q32%.2 from 1 to 0), Q40% is written to the main position reference Q2%.
  • Page 123: Logic Diagrams

    Logic diagrams Slave main position reference l i a i t i i t i i t i i t a i t i f i l i t i i t i i t a i t i MD29 Features 8-19 Issue code: 29nu4...
  • Page 124 Slave position offset MD29 8-20 Features Issue code: 29nu4...
  • Page 125 Digital lock control MD29 Features 8-21 Issue code: 29nu4...
  • Page 126 Feedback source and PID Loops l i m l l o l i a NOTE: Marker pulse functions are not supported by the MD29 on Mentor II. MD29 8-22 Features Issue code: 29nu4...
  • Page 127 Digital lock The digital lock function allows the slave axis position and speed to be locked rigidly or non-rigidly to the master encoder. A digital lock ratio Q11%) can also be introduced between the reference and feedback, accurate to 8 decimal places. Rigid digital lock Rigid digital lock is a position lock between the master reference and the slave axis.
  • Page 128: Using S-Ramps With Digital Lock

    Non-rigid digital lock Non-rigid digital lock is effectively a speed lock between the master reference and slave axis. It is selected by setting Q32%.27 = 1. When digital lock is enabled ( Q32%.2 = 1), the slave axis will accelerate up to the master speed, multiplied by the ratio, Q11%, using linear ramps.
  • Page 129: Cam Function

    8.11 Cam function The cam function provides a means of locking a slave axis to the continuous movement of a master encoder. The cam profile can be split into sections, for which the master and slave starting and finishing positions are known. The cam table is then built up by defining the change in position for each section, with respect to the section starting position, for both master and slave encoders.
  • Page 130 Defining the cam table Before the cam function can be used, an appropriate table must be initialised. This is best done at the start of the program in the INITIAL task. setup% CAMINIT(master%, slave%, tablesize%, reserved1%, reserved2%) where: setup% initialisation was not successful. initialisation successful.
  • Page 131 Building the cam table The cam positions at the beginning and end of each section can be determined from the profile. Section Master Slave Position Change Start Finish Start Finish master% slave% 20000 5000 20000 5000 20000 25000 5000 20000 5000 15000 25000...
  • Page 132: Reference Switching

    8.12 Reference switching The Position Controller provides the facility to switch between the various methods of control, without any discontinuities to the slave axis profile. Switching to Position Control When running in speed control, digital lock or cam table control, the axis stopping position is continuously re-calculated, and written to Q2%.
  • Page 133 Internal Control of Switches Certain switch configurations of the profile generator are invalid, and will be automatically reset by the position controller. Digital Lock When using digital lock, S-ramps cannot be used for position control, so Q32%.8 is always reset to zero. When starting the digital lock using the auxiliary marker pulse, Q32%.2 is set to 1 and Q32%.14 is reset to 0 when...
  • Page 134: Timer/Counter Unit

    8.13 Timer/Counter unit Timer 4MHz 500kHz Event 16-bit up/down counter & & DIGIN 0 Control Reload M[0.2] DIGIN 1 A hardware timer/counter is built into the , and gives the following MD29 features: • Count rate selectable between 500kHz and 4MHz •...
  • Page 135 Control Word (#85.01) Notes Timer EVENT enable 0 = Disable EVENT generation 1 = Enable EVENT generation When TE = 1 and TI = 1 (see below) the EVENT task will run. Enable timer 0 = Disable 1 = Enable timer Reload mode on timer wrap-around 0 = No re-load.
  • Page 136 Notes 5 ~ 7 Timer mode Mode 0 (000): Normal mode Mode 0 (000): Normal mode The internal clock source (4MHz or 500KHz) clocks the counter. The TI event flag is set when the counter wraps-around. Mode 1 (001): External mode Mode 1 (001): External mode The counter is clocked from an external source DIGIN0 (on the the –ve edge).
  • Page 137 Status Word (#85.02) Notes Timer event flag 0 = No event 1 = Event has occurred. Two events are defined: Mode 0, 1 and 4: Counter wrap-around (overflow or underflow) Mode 2 and 3: 1 to 0 transition on DIGIN0 Note : The TI bit is automatically cleared if the TE flag is set in #85.01,.otherwise it is cleared when this status word is read.
  • Page 138: Digital I/O Ports

    8.14 Digital I/O ports has two digital inputs and one digital output as standard. These MD29 inputs and output are logic (ie. 5V logic), and are made available on the 9-way port connector, as follows: RS485 Description RS485 isolated 0V RS485 /TX RS485 /RX DIGIN0 (TTL digital input 0)
  • Page 139: Non-Volatile Memory Storage

    8.15 Non-volatile memory storage has a feature which allows it to store the P and Q regions of the MD29 register-set into the non-volatile memory of the . The parameter MD29 used to initiate the save is as follows: Mentor Vector CDE750 CDE7500...
  • Page 140 Connections The connections required to be made to the connectors are as RS232 follows: Source unit Destination unit To enable the mode, set the following parameters at 1: RS232 • Disable Toolkit communications set-up parameter • Drive-to-Drive communications set-up parameter See MD29 set-up parameters in Chapter 10 Parameters Data-exchange parameters The data to be transmitted must be placed in the special internal parameters...
  • Page 141: Diagnostics

    Diagnostics This chapter covers the following: • Run-time errors and trip codes • Compiler errors and warnings • Advanced error-handling Run-time errors A run-time error is an error which occurs in a specific operation of the MD29 It could happen as a result of an error in the DPL program (such as trying to write to a parameter that doesn't exist, or trying to divide a value by zero), or in an automatic operation such as loss of communications with an I/O Box.
  • Page 142: Run-Time Trip Codes

    Run-time trip codes When the Drive is tripped, the display shows the following: Mentor II Vector trnn On the CDE Drive, the trip code is shown after tr tr. The cause (and location) of the run-time error can be determined by reading the following parameter: Type Mentor...
  • Page 143: Compiler Error Messages

    Compiler error messages This sections lists all the errors that can be generated when compiling a DPL program. ERROR: Argument x must be an integer The argument has been written as a floating-point number instead of as an integer. Example ANSIWRITE (11, “SP”, 50, 3.1) Where: 11 = Argument 1...
  • Page 144 ERROR: Expression too complex — break into parts ERROR: Invalid Drive type. Use one of the following: MENTOR, VECTOR, CDE750, CDE7500 ERROR: Label duplicated A label of the same name has been given more than once. Check other Tasks for duplication. ERROR: Label is in another task instruction is in a different Task to where the label is defined.
  • Page 145: Advanced Error-Handling

    Advanced error-handling Errors that occur when the program is running are usually due to programming errors, but can sometimes occur due to external influences. For example, an error signifying a serial communications loss could occur if incoming data from an I/O Box is lost due to the cable being broken. Normally, the halts all Tasks, and optionally trips the Drive.
  • Page 146 MD29 Diagnostics Issue code: 29nu4...
  • Page 147: Parameters

    Parameters 10.1 MD29 set-up parameters The set-up parameters take effect only after the has been reset. This MD29 occurs when any of the following actions is performed: supply is applied to the Drive instruction in a program is executed REINIT When Reset Target Reset Target is selected in the Run Run menu in the DPL Toolkit...
  • Page 148 Function Mentor II CDE750 CDE7500 Vector Trip if CT I/O box #14.08 #9.22 #15.13 link fails When set at 1, and global trip is enabled, the Drive will be tripped if there is a communication link failure between the MD29 and the CT I/O box. Enable watchdog #14.09 #9.23...
  • Page 149 Function Mentor II CDE750 CDE7500 Vector Flash store request #14.16 #9.29 #15.20 F-14 Set at 1 to save the PLC parameter registers (_Px% and _Qx%) into the non-volatile memory of the MD29. The parameter value immediately returns to zero. See Chapter 8 Features. Drive-to-Drive RS232 #14.17 #9.30...
  • Page 150: Virtual Parameters

    Synchronization of the I/O link When the task is specified as the synchronization source for the I/O CLOCK link, the link remains synchronized to a minimum task timing period of CLOCK 5ms. When the task timing period is less than 5ms, the I/O link will CLOCK run at a fixed 8ms, asynchronously to the task.
  • Page 151 Status word #90.11 Mentor Drive #90.11 contains a 16 bit number. The upper eight bits of #90.11 correspond with parameter #11.21 LED status in the Drive. The lower eight bits correspond with #10.25 Current trip number of the Drive. When the Drive is operating normally, the value of these bits is zero.
  • Page 152 Menu 91 Drive-specific virtual parameters Mentor II Drive parameters Parameter Description #91.01 Mentor II digital feedback mode. 0 = disable MD29 feedback 1 = enable MD29 feedback #91.02 Digital feedback (into #3.02) Range: ±16000 ±100% #91.03 High resolution # 1.18 Range: ±16000 ±100% #91.04 High resolution # 3.18...
  • Page 153 Vector Drive parameters Parameter Description Related virtual parameter #91.01 Set bit 0 at 1 to enable Pr1 #91.02 Set bit 1 at 1 to enable Pr8 #91.03 Set bit 2 at 1 to enable Pr16 Pr16 #91.02 #91.04 #91.02 Fast-access to Pr1 #91.03 Fast-access to Pr8 Pr8 (integer)
  • Page 154 Menu 85 Timer/counter parameters Refer to Timer/counter unit in Chapter 8 Features. Parameter Function #85.01 Control Word #85.02 Status Word #85.03 Timer/counter value #85.04 Timer/counter reload value #85.05 Mode 2 Timer/counter value Menu 86 Digital I/O parameters See Digital I/O ports in Chapter 8 Features for connection information. Parameter Function #86.01...
  • Page 155 Menu 88 Status parameters Parameter Function #88.01 READ Run-time error code. Only valid in ERROR task. WRITE Writing a value of 1070 resets the MD29. See Advanced error-handling in Chapter 9 Diagnostics. Menu 80 I/O Box parameters Parameter Menu 80 Menu 81 Menu 82 Menu 83...
  • Page 156: Rs485 Port Modes

    10.3 RS485 port modes These modes are set using the RS485 Mode parameter. Refer to MD29 set-up parameters at the beginning of this chapter for details of the source, destination and scaling parameters. Mode Description Standard 4-wire RS485, ANSI protocol. Master mode.
  • Page 157: General-Purpose Parameters

    10.4 General-purpose parameters In each Drive there are general-purpose parameters for use with MD29 programs. Parameters marked as can be altered by the but they cannot be MD29, altered using the keypad of the Drive. indicates that the parameter can R–W be altered using the keypad.
  • Page 158 CDE Drive (11kW to 75kW) and HPCDE Parameter Description Type Range number ±32767 16.01 R–W parameters R–W (automatically saved when AC power is removed from the Drive) ±32767 16.02 to 16.05 Variable parameters not R–W stored in EEPROM ±32767 16.06 to 16.20 Variable parameters R–W 16.21 to 16.36...

Table of Contents