PRICE: $50.00 ® SLO-SYN MODEL MX2000 PROGRAMMABLE MULTI-AXIS MOTION CONTROLLER (with VERSION 4.
ENGINEERING CHANGES Warner Electric reserves the right to make engineering refinements on all its products. Such refinements may affect information given in instructions, Therefore, USE ONLY THE INSTRUCTIONS THAT ARE PACKED WITH THE PRODUCT. RECORD OF REVISION Revision Date A 4/30/99 Description Initial Release The MX2000-2 and MX2000-6 are UL recognized components, File No. E146240.
Table of Contents SECTION & TITLE PAGE 1 – Important Safety Information 1.1 – Cautions and Warnings 1 2 2 – Introduction 5 2.1 – How To Use This Manual 2.2 – What you need to know first 2.3 – Conventions Used In This Manual 2.4 – Applications Assistance 3 – Quick Start Installation Guide 3.1 – Switch and Jumper Settings 3.1.1 Serial Communications Baud Rate switches 3.1.2 HOST RS232/485 3.1.3 Auxiliary RS232/RS485 3.1.4 Unit ID switches 3.1.5 32 bit DSP board Inputs 3.1.6 Dual Axis Inputs settings 3.
SECTION & TITLE 5.6 – 32 bit DSP Controller Card 5.6.1 Auxiliary Serial Port 5.6.2 Host Serial Port 5.6.3 DSP Card Inputs 5.7 – Expansion I/O Board 5.7.1 EXIN/EXOUT assignments 5.7.2 BCD assignments 5.8 – Digital I/O Board 5.8.1 Input Connector 5.8.2 Output Connector 5.8.3 Internal Power Supply 5.9 – MX2 and MX6 Power Supply Board 5.9.1 AC Input 5.9.2 EXIN/EXOUT assignments 5.9.3 BCD assignments 5.10 – MX2A and MX6A Power Supply Board 5.10.1 AC Input 5.10.2 Input Connector 5.10.3 Output Connector 5.10.
SECTION & TITLE 6.3.7 Configuration & Setup Folders 6.3.7.1 Controller type Folder 6.3.7.2 System Folder 6.3.7.3 Profile Folder 6.3.7.4 Analog Inputs Folder 6.3.7.5 Encoder Folder 6.3.7.6 Open Loop Stepper Folder 6.3.7.7 Closed Loop Stepper Folder 6.3.7.8 Servo Drive Folder 6.3.7.9 Travel Limit Folder 6.3.7.10 Mechanical Home & Mark Registration Folder 6.3.7.11 I/O Folder 6.3.8 Preparing User Project for Execution 6.3.8.1 Project Source Code 6.3.8.2 Compiling a Project 6.3.8.3 Downloading a Project 6.3.8.
Alphabetical List of Programming Commands with Syntax and Examples CONTINUED SECTION & TITLE ATN2 BCD BOOST BUSY CAPPOS CAPTURE CHR$ COMMON COS DATA DECEL #DEFINE DELTACAPPOS DIM DIST DO … LOOP DONE DRVREADY ENCBAND ENCERR ENCFOL ENCMODE ENCPOS ENCSPD END ERR ERRAXIS ERRTRAP EVENT1 EVENT2 EXIN EXOUT FEEDRATE FOLACCDIST FOLDCCDIST FOLERR FOLINPUT FOLJOG FOLMAXRATIO FOLMINRATIO FOLMOVE FOLMOVEREG FOLOFFSET FOLOFFSETDIST FOLRATIO FOLRATIOINC FOLSTARTDIST FOLSYNC FOLSYNCDIST FOLTRIG FORMAT FOR … NEXT … STEP GE
Alphabetical List of Programming Commands with Syntax and Examples CONTINUED SECTION & TITLE GOSUB … RETURN GOTO HARDLIMIT HARDLIMNEG HARDLIMPOS HEX$ HVAL IF … THEN … ELSE IF … ELSE … END IF IN INCHAR #INCLUDE INPUT INSTR INTLIM JOG JOGSTART JOYSTICK KAFF KD KI KP KVFF LCASE$ LEFT$ LEN LINE LOF LOG LOWSPD MAXSPD MID$ MOD MOTIONSTATE MOVE MOVEHOME MOVEREG NOT NVR NVRBIT NVRBYTE OPTION DECLARE OR OUT OUTLIMIT PATH … PATH CLOSE … PATH END POINT POSERR POSMODE PRINT PRINT USING PROFILE RADIUS READ Table of Co
Alphabetical List of Programming Commands with Syntax and Examples CONTINUED SECTION & TITLE REDUCE REGLIMIT REM ‘ RESET RESTORE RIGHT$ SETCOM SHIFT SIGN SIN SOFTLIMIT SOFTLIMNEG SOFTLIMPOS SPEED SQRT STOP STOPERR STR$ STRING$ TAN TIMER TIMER2 TOLERANCE UCASE$ VAL VELOCITY WAIT WAITDONE WARNING WNDGS 7.5 Host Commands Grouped by Functions 7.6 Host Commands Summary (alphabetical list) 7.
Host Commands – Alphabetical Listing CONTINUED SECTION & TITLE ENCERR ENCFOL ENCMODE ENCPOS ENCRES ENCSPD ERASE ERR ERRAXIS ERRM ESC EVENT1 EVENT2 EXIN EXOUT FILTER FOLERR FREE FREEMEM HARDLIMNEG HARDLIMPOS IN INTLIM JOG JOGSTART KAFF KD KI KP KVFF LINE LOAD LOWSPD MAXSPD MOVE MOVEHOME MOVE REG NVR NVRBIT NVRBYTE OUT OUTLIMIT POSERR POSMODE PROFILE REGLIMIT RESET REVISION RUN SNVR SOFTLIMNEG SOFTLIMPOS SPEED Table of Contents PAGE 180 181 181 182 182 182 183 183 184 185 186 186 187 187 188 188 189 189 19
Host Commands – Alphabetical Listing CONTINUED SECTION & TITLE STOP STOPERR UNIT VELOCITY WARNING WNDGS XON XOFF 8 – FOLLOWING 8.1 – Following Description 8.1.1 Follower Definition 8.1.1.1 Analog Following 8.1.1.2. Encoder Following 8.1.1.3 Command & Variable Following 8.1.2 Following Ratio 8.1.3 Follower Motions 8.1.4 Basic Following States 8.1.4.1 Following Trigger 8.1.4.2 Follower Start Delay Distance 8.1.4.3 Follower Acceleration 8.1.4.4 Follower Synchronization 8.1.4.5 Follower Deceleration 8.1.
Following CONTINUED SECTION & TITLE FOLOFFSET FOLOFFSETDIST FOLSYNCDIST 8.1.11 Follower Exercise 9 – Servo Drive 9.1 – Servo Control 9.1.1 Servo Tuning 9.1.1.1 System Folder 9.1.1.2 Encoder Folder 9.1.1.3 Servo Drive Folder 9.1.1.4 Servo Tuning Environment 9.1.1.5 Auto Tuning 9.1.1.6 Manual Tuning Adjustment 9.1.1.6.1 Adjustment based on auto tuning calculation 9.1.1.6.2 Fully Manual Adjustment 9.
SECTION & TITLE 12 – Debug Environment 12.1 – Setting Project Debugging 12.2 – Task Debugging 12.2.1 Debug Program Execution 12.2.2 Breakpoint Setting/Clearing 12.2.3 Terminal Window 12.2.4 Watch Variables 12.2.5 Exit Debug Environment PAGE 279 280 280 281 281 281 281 281 13 – Application Examples 283 13.1 – Using Joystick to Teach an Arbitrary Shape Program 13.1.1 MX2000 Joystick Connection 13.1.2 Example Description 13.1.3 Main Section 13.1.4 Teach Section 13.1.5 Print Program Section 13.1.
List of Illustrations Illustration or Chart Section PC receiver Baud Rate Chart 3 General Application Overview 4 MX 2000 System Block Diagram 5 Dual Axis Board Dual Axis Interface board selection chart 5 Stepper Drive Connection Diagram 5 Servo Drive Connection Diagram 5 Encoder Connector signal description & electrical specification chart 5 Encoder Equivalent Circuit Diagram 5 Encoder Pulse and Direction connection Diagram 5 Axis I/O Connector signal description & electrical specification chart 5 Axis I/
Illustration or Chart MX2 & MX6 Power Supply Board MX2 & MX6 panel AC input Description and Lead color chart EXIN & EXOUT assignments chart BCD assignment chart MX2 outline MX6 outline MX2A & MX6A Power Supply Board MX2A & MX6A panel AC input Description and Lead color chart Input connector description and electrical specification chart Output connector description and electrical specification chart Internal Power Supply description chart MX2 outline MX6 outline MX8 Power Supply Board MX8 panel AC input Des
Software Reference Guide Continued Illustration or Chart ANALOG input chart AND operator truth table chart CAPTURE trigger chart JOG Cycle diagram LINE Cycle diagram MOVE Cycle diagram MOVEHOME Cycle diagram MOVEREG Cycle diagram NOT operator truth table chart OR operator truth table chart PROFILE velocity response diagram SPEED change during motion diagram Following Basic Following States diagram Basic Advance/Recede Velocity Profile diagram Following Program Template chart Cut to Length Cycle Velocity Pr
Illustration or Chart Data Logging Environment Data Logging entry screen Parameter & Trigger Setup screen Data Transfer screen View Data screen Debug Environment Debug setup screen Debug Environment screen Watch Variable screens Application Examples Joystick connection diagram Arbitrary Continuous Motion machine diagram Arbitrary path Positional Profile diagram Changing Velocity during Motion diagram Glue Application diagram Glossary ASCII Table chart xiv Section Page 11 11 11 11 280 280 281 281 12 12
Section 1 Important Safety Information Cautions & Warnings 1
1.1 – Cautions and Warnings Before installing and operating your MX2000 motion control product, it is extremely important both to you and us here at Warner Electric that you read this section very thoroughly and carefully. Your Slo-Syn product will deliver years of reliable, trouble-free, and most importantly, safe operation if you heed the cautions and warnings outlined in this section, and follow the subsequent instructions in the remainder of this manual.
Section 2 Introduction Introduction 3
2.1 - How To Use This Manual Congratulations on the purchase of your new Warner Electric MX2000 motion control product! Your programmable motion controller is a full-featured and flexible product, yet it is fairly simple to apply it to your machine control application. This manual is designed to guide and assist you through the installation, programming, and operation of the controller.
Section 3 Quick Start Installation Guide Quick Start Installation Guide 5
3.1 – Switch and Jumper Settings Before mounting and installing the MX controller, it is best to set the switches and internal jumpers that govern various operating features. 3.1.1 – Serial Communication Baud Rate switches The "BAUD" DIP switch located on the 32 bit DSP controller panel needs to be set to match the baud rate of the host computer or terminal to which it is connected.
The digital I/O board inputs and outputs can either be sinking or sourcing. Two jumpers on the card controls the selection, located in the lower left corner of the board. The factory setting is sinking; if sourcing is desired, the Digital I/O card must be removed and the jumpers setting changed to the Source position. HINT: The Drive type for each axis must be selected in the System folder. Now the axes must be assigned to a specific task.
default). When finished click the Done button. Now make the motor move by clicking the Move Response button. The motor should complete the programmed profile and the position error plot should appear on the screen. You may have to adjust the display time in order to see the whole move. 6) Repeat step 5 for all servo axes. Then click on the Exit command button and OK when save parameter screen appears.
3.3 - Installation Ÿ Ÿ Ÿ Ÿ Ÿ Ÿ Ÿ Ÿ Ÿ Ÿ Ÿ It is important to select a mounting location for you controller that will meet the environmental specifications listed in Section 5.2. Avoid locations that expose the unit to extremes of temperature, humidity, dirt/dust, or vibration. Also, it is best to avoid areas with high "electrical noise." This will help to prevent misoperation due to electromagnetic interference. Please refer to Section 3.4.
(This page intentionally left blank) 10 Setup & Installation
SECTION 4 OVERVIEW OF SYSTEM OPERATION Overview 11
4.1 – Features and Functions The controller is based on the Texas Instruments TMS320C31 32 bit, 33MHZ Digital Signal Processor (DSP). It can control from 2 to 8 stepper or servo drives, plus 350 I/O points. Each pair of axes is supervised by a powerful Application Specific Integrated Circuit (ASIC) that is custom programmed for the controller.
4.2 - General Overview The Programmable Motion Controller is a powerful, DSPbased machine controller that is capable of far more than simply moving motors. This section is intended to give the user an overview of the controller's many capabilities including all the functions and features users expect for controlling motion. There are a wide variety of inputs and outputs and software features that, in many cases, allow the controller to operate an entire sophisticated machine. Figure 4.
4.3 - Use of the Serial Ports, "HOST" and "AUXILIARY" The controller has two serial ports, which are identified as "HOST" and "AUXILIARY". The "HOST" port, as its name implies, is typically connected to a host computer such as an IBM PC or compatible. The "AUXILIARY" port is intended for use with an operator interface panel such as Warner Electric's IWS series product line. The "HOST" port is used for downloading the user's application program and for direct control of the controller.
Figure 4.
This page left intentionally blank 16 Overview
Section 5 Specifications And Equivalent Circuits Specifications 17
5.1 – Mechanical Specification 5.4 – MX2000 System MX2000-2 Size: When ordering an MX2000 system a number of factors must be taken into account. The number of axes, number of I/O points and whether the I/O requires optical isolation. The MX-2 and MX-6 power supplies have 24 expansion I/O points that are not optically isolated but can be interfaced to an OPTO-22 rack module. The MX-2A and MX-6A power supply has 16 optically isolated inputs and 8 optically isolated outputs.
MX 2000 System MX2000-8 Expansion MX2000-2(A), -6(A), -8 Base System MX2000-6(A) Expansion SLOT 8C SLOT 8A 8B SLOT 7A 7B SLOT 6A 6B SLOT 5A 5B SLOT 4A 4B SLOT 3A 3B SLOT 2 SLOT 1 Contains: 1 of the following Contains: 1 of the following Contains: 1 of the following Contains: 1 of the following Contains: 1 of the following Contains: 1 of the following Contains: Contains: Dual-Axis Interface Board Dual-Axis Interface Board Dual-Axis Interface Board Dual-Axis Interface Board MX-2 and MX
5.5 -Dual Axis Interface Card This card contains the interfaces necessary to connect 2 motor drives to the MX2000 controller. A stepper drive or servo drive can be interfaced to the controller. In addition 4 dedicated inputs and up to 2 analog inputs can be interfaced to each axis. Up to four Axis cards can be plugged into an MX2000-8 back plane. Each axis card must be assigned a different id (1-4) and id 1 must always be assigned to one of the boards. The factory setting is board Id 1.
5.5.3 –Encoder Connectors The Encoder connector provides a means to interface an encoder or pulse and direction input to the controller. There are two identical connectors provided, one for each axis. The encoder 5 volt output is restricted to 100 milli-amps of current per axis. We highly recommend the use of twisted-pair (approximately 6 twists per foot) shielded cable for all encoder wiring to minimize interference problems.
5.5.4 – Axis I/O Connectors The Axis I/O connectors provides a means of interfacing 4 dedicated digital signals and an analog input for each axis. The dedicated inputs are opto-isolated and can be selected as sinking or sourcing on the axis card. The dedicated inputs are labeled +LIM, -LIM, EVNT1 and EVNT2. The two limit inputs can be configured as hard limits or general purpose inputs. The two event inputs are used for mechanical home and mark registration triggers.
5.5.5 – Stepper Drive Connectors The stepper drive connector provides a means of connecting the controller to a stepper drive. There are two Signal Name OPTO PULSE DIR RDCE BOOST AWO READY Description 5 volt source for opto-isolators. 0 to 1.99 Mhz square wave when motion is commanded. Motor direction control. Reduce motor current by 50% at standstill. A Low level output reduces the motor current. Increase motor current by 50% when running. A low level output increases motor current during motion.
5.5.6 – Analog Drive Connector identical connectors provided for this means, one for 1st axis (Side “A”) and one for the 2nd axis (Side “B”). The Analog drive connector provides a means of connecting a servo drive to the controller. There are two Signal Name OUT AGND EN+ EN- RDY+ RDY- Description Analog output voltage that can be used as a torque command for a servo drive or an analog output if axis is not a servo drive. Analog Ground. Collector output of an optically isolated device.
5.5.
5.6 – 32 bit DSP Controller Card 5.6.1 – Auxiliary Serial Port This card contains the interfaces to serially communicate with a host port and auxiliary port, and controls the entire set of cards plugged into the MX2000 system. This port can communicate serially with an external port as an RS232 or RS485 serial device. The type of device is jumper selectable (J10) on the board and the factory setting is RS485. The serial protocol for this port can be modified by the SETCOM command.
5.6.2 – Host Serial Port This serial port is used to program the unit or communicate with the host device. There are two serial interfaces for the host port, RS232 and RS485. The RS232 interface uses a 9-pin D female connector. The RS485 interface connection is provided on a 6-position removable terminal strip. The device that communicates with the host computer can be either RS232 or RS485. This selection is made with the 232/485 dip switch on the front panel.
Daisy Chaining MX2000 Controllers HO ST C O NTRO LL ER R S232 M X C O N TR O LLER S (ID 1 R S 232) ( ID 'S 2-9 R S 485) H O ST C O N T R O L L ER R S 232 MX H O ST R S232 ID 1 9 P in 'D " MX H O ST R S485 ID 3 MX H O ST R S485 ID 2 MX H O ST R S485 ID 1 MX H O ST R S485 ID 9 GND GND GND RX+ RX+ RX+ RX+ RX- RX- RX- RX- TX+ TX+ TX+ TX+ TX- TX- TX- 1 20 GND 1 20 TX- HO ST C O NTRO LL ER R S485 M X C O N TR O LLER S ID 1-9 R S485 H O ST C O N T R O L L ER R S 485 MX H O ST R S485 I
5.6.3 – DSP Card Inputs There are four optically isolated inputs to the DSP card. These inputs can either be sinking or sourcing and the selection are controlled by a jumper (J11) on the DSP board. The factory setting is sinking. The CLR terminal is a fail safe input that will terminate program execution and or motion if open circuited. This input must be active to allow auto-execution to occur on power turn-on or if a RESET command is issued.
SL O -S YN 20 00 32 b it D SP co n tro lle r FA U L T DS P C ard Ju m p er in SO U R C E Positio n 1 CLR GND A U XIL IA R Y R X+ R X- 2 T X+ 3 T XSH L D U N IT ID 4 1 0 9 2 3 8 7 4 5 6 5 6 23 2 9.6 19 .2 38 .4 48 5 H O ST B A UD R A TE SE L 2 SE L 1 +24 COM DS P C ard Ju m p er in SIN K P osition 1 2 GND H O ST R S4 85 SE L 4 3 R X+ R X- 4 T X+ CLR SE L 4 SE L 2 SE L 1 T X- 5 SH L D H O ST R S2 32 6 +24 COM D S P Inp u t E qu ivalent C ircu it 3.
5.7 – Expansion I/O Board 5.7.1 – EXIN/EXOUT assignments The Expansion I/O-BCD board has been designed to interface to BCD switches and/or to an OPTO 22 module rack. There are two ports on each board and each port has 24 bi-direction I/O points. The odd pins 1-47 on the 50-pin header are signal pins. The even pins 2-50 are signal grounds. The EXIN and EXOUT commands can be used to access the expansion board I/O. Up to 48 I/O pins can be accessed with these commands.
P IN 1 32 I/O E X P A N S IO N 25 - 4 8 B C D IN T E R F A C E 5 - 8 P IN 1 I/O E X P A N S IO N 1 - 24 B C D IN T E R F A C E 1 - 4 S L O -S Y N 2000 I/O E X P A N S IO N BANK Specifications
Expansion I/O-BCD Port Connection to OPTO-22 Module Rack Controller OPTO-22 OPTO-22 Expansion I/O-BCD Board Manufacturer Crydom Gordos Grayhill Potter & Brumfield OPTO-22 Module Rack 50 conductor ribbon cable I/O modules are available for use with Logic supply voltages 5, 15, and 24V. The logic supply (-) terminal is connected to even pins 2-50 which are ground. + Part Number PB-24 PB-24 7ORCK24, 7OMRCQ24 series ZIO24, ZIOM24 series PB-24, PB-24Q, PB-24HQ - Logic Supply 5.7.
34 Specifications
Pins 41,43,45,47 33,35,37,39 25,27,29,31 17,19,21,23 1,3,5,7,9,11,13,15 I/O Expansion Board Description Specification Input: On state 0 to +1.5 volts, 1 ma @ 0v, BCD 4 or BCD 8 strobes Off state +2.9 to +30 volts. EXIN/EXOUT B03/27 to B00/24 Output: open circuit +30 volt maximum, saturation voltage +0.5 volts @ 15 ma. Input: On state 0 to +1.5 volts, 1 ma @ 0v, BCD 3 or BCD 7 strobes Off state +2.9 to +30 volts. EXIN/EXOUT B07/31 to B04/28 Output: open circuit +30 volt maximum, saturation voltage +0.
5.8 – Digital I/O Board The Digital I/O-BCD board has been designed to interface to switches and/or relays. There are 24 optically isolated inputs and 16 optically isolated outputs per board. If the MX2000 controller is an MX2A or MX6A the first digital I/O board is the Power supply board and there are 16 inputs and 8 outputs available (101-116). Up to 4 boards can be interfaced to an MX2000-8 controller. The ID for each board is selected via 2 dip switches located on the board. 5.8.
5.8.2 – Output Connector J7 J7 H eader Pins This connector has 16 optically isolated outputs that can be configured for current sinking or sourcing. The sinking/sourcing selection is done on the digital I/O card using a jumper. The factory setting is sinking. Jum pers Note: The movement of both jumpers is required for proper operation. If only one jumper is moved the digital inputs and outputs modes will be different.
5.8.3 – Internal Power Supply This connector has 4 terminals for +24V @ .75 amps and 4 terminals for COM. These terminals are used as signal returns for inputs and signal common for outputs. Internal Power Supply Description The COM terminals are used as the return source for the inputs and the signal common for the outputs. The +24 terminals are used as the return source for the inputs and the signal common for the outputs. Mode Sink Source D ig ital I/O E q u ivale n t C ircu it 1K 3 .
S L O -S Y N 2000 D igital I/O N IN P U T SSL O -SY 2 00 0 1 D u al A x is In te rfac e 2 3 4 5 7 6 A B BUSY 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 2 4V 2 4V 2 4V 2 4V COM COM COM COM O U T P U TS 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 User Label Specifications 39
5.9 – MX2 and MX6 Power Supply Board W a rn e r E lec tric S L O -S Y N P o w e r S u p p ly This board contains the AC input terminals and interface for 24 non-isolated bi-directional I/O. This board is assigned Expansion I/O board #1, EXIN(100-123) and EXOUT(100,123) . The range for the AC input is 90 to 265 VAC at 50/60 hz. 5.9.1 – AC Input PO W ER A C IN P U T The AC input is connected to a terminal strip.
5.10 – MX2A and MX6A Power Supply Board Warner Electric SLO-SYN POWER SUPPLY This board contains the AC input terminals, interface for 16 optically isolated input and 8 optically isolated outputs. This board is assigned digital I/O board #1, IN(101-116) and OUT(101,108) . The range for the AC input is 90 to 265 VAC at 50/60 hz. 5.10.1 – AC Input POWER The AC input is connected to a terminal strip.
5.11 – MX8 Power Supply Board W A R N ER ELEC TR IC S L O -S Y N M X8 Pow er Supply This board contains the AC input terminals with no I/O connections. The input voltage range is 90 to 132 VAC or 175 to 264 VAC 50/60 hz. The MX8 will not operate correctly if the input voltage is not within the two ranges. No operator action is required, the MX8 automatically senses the input voltage and configures itself to operate at either AC input voltage range. A C IN PU T 5.11.
5.12 – MX2 Outline 9.84 250.03 O V ER C O N N E C T O R S 5.14 [130.58] 0.93 [23.74] 3.250 [82.55] S L O -S Y N 20 00 S L O -S Y N D u a l A x is In te rfa ce 2 00 0 D u a l A x is In terfa ce A 7.48 189.88 0.219 [5.56] T YP S L O -S Y N S L O -S Y N 2 00 0 2 0 00 M X 2 P o w eMr2 P o w e r S u p p ly S u p p ly S L O -S Y N 20 00 3 2 b it D S P co n tro ller 0.37 9.35 0.50 [12.
5.13 – MX6 Outline 9.14 [232.18] 3.250 [82.55] 0.219 [5.56] TY P SL O-SYN B A B A A B U SY 2000 SL O-S YN D ual A xis In terface 2000 D ual A xis In terface B GN D +5 +5 GN D GN D GN D SH L D SH L D SH L D A+ A+ A+ B+ B- I+ I+ I+ I- I- I- C OM R X- TX SH L D 24V 1 0 9 2 3 8 7 L1 N N 485 H OS T BAUD R A TE 232 9.6 19.2 38.
5.
This page left intentionally blank 46 Specifications
SECTION 6 Motion Controller Programming Interface Motion Controller Programming Interface 47
6.1 - Programming 6.1.1 - General Description of Programming This section provides an overview to the process of programming a Controller. Once the "logic" behind the various commands are understood, programming your Controller will be seen as a straightforward process. Programming of any sort requires planning and forethought. Programming your Controller is no exception. This section will provide aids to facilitate your planning process.
ble Read-Only Memory), or a BBRAM (Battery Backed RAM). The electrical codes stored in this type of memory are not lost when external power is removed from the Controller. The Controller uses a battery backed RAM for storing NVR variables (1-2048). The controller stores the operating system as well as user programs in Flash memory. This memory is located on the DSP Controller card. A program in your Controller can have hundreds, or even thousands of program lines.
6.2.1 – Multi-Tasking timing 6.3.2.1 – The MCPI opening screen The Tasks are switched by the interrupt routine every 256 micro-seconds. The number of tasks being switched is dependent on the number of tasks that are loaded for the user project and on project execution. If program execution is not taking place only Task 0, Host command execution is taking place. If program execution is taking place the active user project tasks and Task 0 will be switched by the interrupt every 256 micro-seconds.
Note 3: The Terminal Emulation Mode should be set to TTY on the Configure Com Port screen. The controller type folder screen is now accessed. This screen allows access to the project folders by clicking on the desired folder tab. Axis Configuration Selecting the Terminal item under the Utility menu allows testing of the serial communications to the Controller.
Items and Actions for the Edit menu are listed below. Edit Menu E dit 6.3.5.1 – Document settings Clicking on the System Menu and then selecting the Document setting item can modify the document settings for the task editor.
6.3.5.2 - Editor Tool Box The Editor Tool Box can be used to modify the text on the Editor Screen. The Font, Type, line spacing and text color can be modified using the Editor Tool Box. Font Size Select Font Size Font Name Select Font Name Strike through Underline Italic Bold Left Center Right Justified Superscript Subscript 1 Line Spacing 1.5 Line Spacing 2 Line Spacing Color Palette 6.3.
6.3.7.1 – Controller Type Folder nal settings item. Click on the Fonts and colors item. Select the desired Font, Style, Font size, Background color and Foreground color for the Terminal Emulation environment. When finished, click on the O.K. button. This folder allows the controller type to be defined for the user program.
6.3.7.3 – Profile Folder This folder selects the motion profile, maximum acceleration rate, maximum speed and Delay after motion. The Speed, Acceleration and Deceleration item are program execution default values that can be altered with basic commands during program execution. Profile Motionprofile Speed (units/sec) Acceleration Deceleration Max. accel Max. speed Delay after (units/sec2) (units/sec2) (units/sec2) (units/sec) motion(sec) Axis1 trapezoidal 20.0 100.0 100.0 200.0 124.0 0.
6.3.7.9 - Travel Limit Folder The hardware limits and software limits are controlled from this folder. The trigger combination for mechanical home and Mark registration are: event 1 active, event 1 inactive, event 1 active & encoder marker, event 1 inactive & encoder marker, encoder marker active, encoder marker inactive, event 2 active and event 2 inactive.
D ownload 6.3.8.2 – Compiling a Project Download Project Upload S ource ... Whether the project is new, or changes have been made to the task or configuration, it MUST be compiled BEFORE DOWNLOADING for it to be stored and implemented in the controller. Compiling converts the users task and configuration to machine code that the controller can understand. A project can be compiled by clicking on the Compile Command button or on the Compile menu and then the Compile project item. 6.3.8.
Add task is used to add a file to a current project. Up to seven tasks may be added to one project. 6.3.10.4 – Help Menu Configuration & setup is used to edit the Configuration & setup folders. This menu provides help on program commands, technical assistance and displays the MCPI software version. Print project is used to print a current project’s information. Export project is used to export a current project to another drive or directory.
Section 7.
7.1 SEBASIC Conventions 7.1.3 Relationship Operators A basic-like language conforms to most of the rules and conventions of modern implementations of the BASIC programming Language, such as “QuickBasic”, etc. Following is a summary of the considerations to be used in writing your programs. Relationship operators are used to compare two values. The result of the comparison is either “true” (one) or “false” (zero). This result can then be used to make a decision regarding program flow. 7.1.
7.1.6 Program Limits When writing an MX program please observe the following maximum values; otherwise the project will not compile. Item Line labels Local Variables Common Variables Literal’ s DATA Elements Nested FOR loops Nester DO loops Maximum Allowed 100 total per task 100 total per task 100 total per project 100 total per project 100 total per task 100 total per task 100 total per task 7.1.7 Numeric Formats and Range Numeric data may be represented in standard format or in scientific notion format.
stants any expression regardless of complexity can be used. The following are all valid expression lists: 5.3 no comma, since a comma does not follow the last expression in the list (axis1 value is 5.3) ,,,5.2,,6 1st comma - skip axis 1, 2nd comma – skip axis 2, 3rd comma - skip axis 3, 4th comma follows expression for axis 4, 5th comma - skip axis 5 (axis 4 value is 5.
7.2 Programming Commands Grouped By Functions Bitwise Operator & | ^ >> << Page Returns the bitwise AND of the expression. Returns the bitwise inclusive OR of the expression. Returns the bitwise exclusive OR of the expression. Returns the bitwise shift right of the argument. Returns the bitwise shift left of the argument. 78 78 78 79 79 The logical AND operator is used in Boolean expressions. The logical NOT operator is used in Boolean expressions.
Mathematical Function ABS ATN ATN2 COS LOG MOD SIGN SIN SQRT TAN Page Returns the absolute value of an expression. Returns the angle (in radians) whose tangent is x. Returns the angle (in radians) whose tangent is y/x. Returns the cosine of the angle x, where x is in radians. Returns the natural logarithm of a numeric expression. Returns the remainder of a number divided by the base. Returns the sign of the expression. Returns the sine of the angle x, where x is in radians.
Motion Parameter continued Sets or returns the maximum position error allowed when motion is stopped. ENCFOL Sets or returns the maximum position error allowed during motion. ENCMODE Sets or returns the operating mode of a closed loop stepper axis. EVENT1 Returns the state of the trigger input labeled EVNT1 or sets the trigger polarity and enable , which are used in a MOVEHOME, MOVEREG or FOLMOVREG cycle.
Servo Parameter INTLIM IXT KAFF KD KI KP KVFF OUTLIMIT Page Sets the integral limit for a servo axis. Sets or returns the Excessive Duty Cycle Shutdown time in seconds Sets or returns the acceleration feed forward gain of a servo axis. Sets or returns the derivative gain of a servo axis. Sets or returns the integral gain of a servo axis. Sets or returns the proportional gain of a servo axis. Sets or returns the velocity feed forward gain of a servo axis.
7.3 Programming Command Summary (alphabetical list) Page & | ^ >> << Returns the bitwise AND of the expression. Returns the bitwise inclusive OR of the expression. Returns the bitwise exclusive OR of the expression. Returns the bitwise shift right of the argument. Returns the bitwise shift left of the argument. 78 78 78 79 79 Returns the absolute value of an expression. Sets or returns the commanded absolute position of an axis. Sets or returns the acceleration value of the motor.
Page E ENCBAND ENCERR ENCFOL ENCMODE ENCPOS ENCSPD END ERR ERRAXIS ERRTRAP EVENT1 EVENT2 EXIN EXOUT Sets or returns the maximum position error allowed when motion is stopped. Same as STOPERR command. Returns the positional error of the designated axis. Sets or returns the maximum position error allowed during Motion. Same as FOLERR command. Sets or returns the operating mode of a closed loop stepper axis. Returns the encoder position of an axis. Returns the current encoder speed in Units/second.
Page G GETCHAR GOSUB ... RETURN GOTO Waits for a character on the selected serial port and returns the ASCII code of the character. Branches to, and returns from, a subroutine. Branches unconditionally to the specified label. 115 115 116 Enable or disables Hard Limit switches or reads the current Hard Limit enable/disable state of an axis. Returns the - Limit hardware state of an axis. Returns the + Limit hardware state of an axis. Returns the hex string equivalent of an argument.
Page M MAXSPD MID$ MOD MOTIONSTATE MOVE MOVEHOME MOVEREG Sets or returns the maximum allowed speed of an axis. Returns the designated middle number of character of a string. Returns the remainder of a number divided by the base. Returns the motion state of an axis. Initiates a non-coordinated move. Runs the motor until the home input is activated, captures and records the position of the switch activation as home.
Page S SETCOM SHIFT SIGN SIN SOFTLIMIT SOFTLIMNEG SOFTLIMPOS SPEED SQRT STOP STOPERR STR$ STRING$ Sets the baud rate and data format for the Auxiliary serial port. Shifts the elements of a single-dimension numeric array up or down. Returns the sign of the expression. Returns the sine of the angle x, where x is in radians. Enables/disables or returns the SOFTLIMIT enable state of an axis. Sets or return the - direction software travel limit. Sets or return the + direction software travel limit.
7.4 Alphabetical List of Programming Commands with Syntax and Examples & Bitwise Operator ACTION: Returns the bitwise AND of the expressions PROGRAM SYNTAX: result=expression1 & expression2 REMARK: A 24 bit binary AND is performed on the two arguments. EXAMPLES: X=10 & 2 0000 0000 0000 0000 0000 1010 0000 0000 0000 0000 0000 0010 0000 0000 0000 0000 0000 0010 returns a 2 to X. | (10) (2) (result= 2) Bitwise Operator ACTION: Returns the bitwise inclusive OR of the expressions.
>> Bitwise Operator ACTION: Returns the bitwise shift right of the argument. PROGRAM SYNTAX: result= expression >> expression1 REMARK: expression is shifted right by the value in expression1 and the resulting value is returned. A 24 bit binary shift right is performed on the argument. 0’s are shifted in starting at the MSB bit. EXAMPLES: X=10 X=X>>1 0000 0000 0000 0000 0000 1010 (10) 0000 0000 0000 0000 0000 0101 (result= 5) returns a 5 to X.
ABSPOS Trajectory Parameter ACTION: Sets or returns the commanded absolute position of an axis. PROGRAM SYNTAX: ABSPOS(axis)=expression ABSPOS=expression1, ... , expression8 ABSPOS(axis, ... , axis)=expression, ... , expression ABSPOS(axis) - used in an expression REMARK: The axis specifies the number of the axis (1-8). The expression specifies the absolute position in units. ABSPOS represents the commanded motor position, and can only be set while no motion is occurring.
ACCEL Trajectory Parameter ACTION: Sets or returns the acceleration value of the motor. PROGRAM SYNTAX: ACCEL(axis)=expression ACCEL=expression1, ... , expression8 ACCEL(axis, ... , axis)=expression, ... , expression ACCEL(axis) - used in an expression REMARK: The axis specifies the number of the axis (1-8). The expression is the acceleration rate in units/sec2. The rate at which the motor speed is increased.
ANALOG I/O Function ACTION: Sets or returns a numeric value representation of the voltage on the selected analog port. PROGRAM SYNTAX: ANALOG(b0n) - used in an expression ANALOG(b0n)=expression REMARK: The b specifies the axis board number (1-4). The n specifies the analog input (1-4) or output(1-2). ANALOG(b0n) Returns the present value of the specified analog input. The range is +10.0 volts to -10.0 volts. ANALOG(b0n)=expression Sets the analog output voltage equal to the expression.
AND Boolean Operator ACTION: The logical AND operator is used in Boolean expressions. PROGRAM SYNTAX: expression1 AND expression 2 REMARK: The AND operator uses this “truth table”. expression1 True True False False expression2 True False True False Condition Result True False False False The result is true if both expressions are true. EXAMPLE: Programming Commands IF (x>2) AND (y<3) THEN GOTO INDEX The controller checks to see if x>2 and y<3.
ARC Motion Parameter ACTION: Initiates a coordinated motion to move in an arc. PROGRAM SYNTAX: ARC=x, y, xcenter, ycenter, ±angle ARC=xcenter, ycenter, ±angle REMARK: The x specifies the axis number for one of the coordinated axes, and the y specifies the axis number for the other axis. The lower numbered axis is considered the master and its parameters SPEED, ACCEL, DECEL and PROFILE are used. The SPEED of the master axis can be used to control the speed of the ARC during motion.
ASC String Manipulation ACTION: Returns the ASCII code for the first character in a string. PROGRAM SYNTAX: ASC(n$) REMARK: The ASCII code returned is for the first character in the string variable n$. If the string is a null then a 0 will be returned. EXAMPLE: a$=“part#” X=ASC(a$) ‘ sets x=112 ‘p’ ATN Mathematics Function ACTION: Returns the angle (in radians) whose tangent is x.
BCD I/O Function ACTION: Returns the value of the BCD switches connected to an Expansion I/O port. PROGRAM SYNTAX: BCD(b0n) - used in an expression REMARK: The b specifies the Expansion I/O board number (1-4). The n specifies the BCD switch bank number (1-8). BCD(b0n) Evaluates and returns the number set on the BCD board switch bank “n”, connected to Expansion I/O board “b”. EXAMPLE: X=BCD(101) Sets X equal to the value read on board 1, BCD switch bank 1.
CAPPOS Miscellaneous Command ACTION: Returns the last captured absolute position of an axis from a MOVEHOME, MOVEREG or CAPTURE cycle. PROGRAM SYNTAX: CAPPOS(axis) - used in an expression REMARK: The axis specifies the number of the axis (1-8). This command can be used in conjunction with a MOVEHOME, MOVEREG or CAPTURE command to specify the last captured absolute position in Units. The captured position is the position where the trigger occurred during a MOVEHOME, MOVEREG or CAPTURE cycle.
CAPTURE Miscellaneous Command ACTION: Sets the position capture trigger condition or returns the position capture status. PROGRAM SYNTAX: CAPTURE(axis)=expression CAPTURE=expression1, … , expression8 CAPTURE(axis, … , axis)=expression, … , expression CAPTURE(axis) – used in an expression REMARK: The axis specifies the number of the axis (1-8). The expression selects the trigger condition (0-7). Setting the capture condition arms the position capture function.
CHR$ String Manipulation ACTION: Returns a one character string whose ASCII code is the argument. PROGRAM SYNTAX: CHR$(code) REMARK: CHR$ is commonly used to send a special character to the serial port. EXAMPLE: PRINT#1,”Input Accel”,CHR$(27) Transmits “Input Accel “ to the host serial port. COMMON Miscellaneous Command ACTION: Allows variables to be shared by other tasks.
DATA Miscellaneous Command ACTION: Stores the numeric constants used by the READ statement. PROGRAM SYNTAX: DATA constant, constant, etc REMARK: The constant is a numeric constant. EXAMPLE: DATA 1,2,3,4,5,6 Also see the example for the READ command. DECEL Trajectory Parameter ACTION: Sets or returns the deceleration value of an axis. PROGRAM SYNTAX: DECEL(axis)=expression DECEL=expression1, ... ,expression8 DECEL(axis, ... ,axis)=expression, ...
#DEFINE Miscellaneous Command ACTION: Defines a symbolic name to be a particular string of characters. PROGRAM SYNTAX: #DEFINE name@1, ... , @10 replacement text #DEFINE replacement text REMARK: The name has the same form as a variable name: a sequence of letters and digits that begins with a letter. The name is case sensitive. Typically upper case is used for the name. The @1, ... , @10 are the program command substitution arguments for the replacement text.
DELTACAPPOS Miscellaneous Command ACTION: Returns the difference between the current captured position and the previously captured position. PROGRAM SYNTAX: DELTACAPPOS(axis) – used in an expression REMARK: The axis specifies the number of the axis (1-8). The current captured position can be read with the CAPPOS function. The value returned by DELTACAPPOS is not valid until at least two captures have occurred.
DIM Miscellaneous Command ACTION: Declares an array variable and allocates storage space. PROGRAM SYNTAX: DIM variable(dimension,dimension,etc) DIM variable$(dimension,dimension,etc) REMARK: The “option base zero” for array notation is used, in which the first element of each array dimension is annotated as element “0”. Therefore, the total number of elements in the array is: (dimension1 + 1)*(dimension2 + 1) * ... *(dimension n +1).
DIST Trajectory Parameter ACTION: Returns the distance moved from the start of the last commanded motion. PROGRAM SYNTAX: DIST(axis) - used in an expression REMARK: The axis specifies the number of the axis (1-8). Returns a positive number, regardless of the move direction. EXAMPLE: x=DIST(2) Returns the last incremental distance moved in axis 2. DO ... LOOP Program Flow Command ACTION: Repeats a block of statement while a condition is true or until a condition becomes true.
DONE Motion Parameter ACTION: Returns the motion status of the designated axis. DONE means motion is completed. PROGRAM SYNTAX: DONE(axis) - used in an expression REMARK: The axis specifies the number of the axis (1-8). If the commanded motion of an axis is complete a True (1) is returned otherwise a False(0) is returned. DONE is the complement of BUSY. EXAMPLE: X=DONE(1) The motion status of axis 1 is returned to variable X.
DRVREADY Motion Parameter ACTION: Enables or disables the checking of the drive (READY) signal on the axis card. PROGRAM SYNTAX: DRVREADY(axis)=expression DRVREADY=expression1, … , expression8 DRVREADY(axis, … ,axis)=expression, … , expression DRVREADY(axis) - used in an expression REMARK: Axis specifies the number of the axis (1-8). The expression sets the enable/disable checking of the Drive READY signal. A 0 enables checking of the axis Drive Ready signal and a 1 disables the signal checking.
ENCBAND Motion Parameter ACTION: Sets or returns the maximum position error allowed when motion is stopped, referred to herein as "position error band." COMMAND SYNTAX: ENCBAND(axis) =expression ENCBAND=expression1, … , expression8 ENCBAND(axis, … , axis)=expression, … , expression ENCBAND(axis) - Used in an expression Note: STOPERR can be substituted for ENCBAND. REMARKS: STOPERR is a stepper drive and servo drive parameter.
ENCMODE Motion Parameter ACTION: Sets or returns the operating mode of a closed loop stepper axis. PROGRAM SYNTAX: ENCMODE(axis)=expression ENCMODE=expression1, ... , expression8 ENCMODE(axis, ... ,axis)=expression, expression ENCMODE(axis) - used in an expression REMARK: ENCMODE is defined in detail in the Stepper Drive Section of this manual. ENCPOS Trajectory Parameter ACTION: Returns the encoder position of an axis.
END Miscellaneous Command ACTION: Signifies the end of a program. PROGRAM SYNTAX: END REMARK: If motion is occurring when this command is encountered the controller will set a WARNING number and stop motion on the applicable axis. EXAMPLE: statements ...
ERR Miscellaneous Command ACTION: Returns the MX controller error/warning number for this task. PROGRAM SYNTAX: ERR=error number,severity ERR - used in an expression REMARKS: If an error occurs while the program is running, the program jumps to label ERROR_HANDLER if it is present, otherwise it ends. The fault LED blinks the ERROR code or WARNING code. If an error or warning has occurred, the axis which caused the error can be obtained by issuing an ERRAXIS command.
ERR continued If an error or warning occurs during program execution the fault LED will blink the error code. If the error code is >= 10 the fault LED blinks on 0.25 seconds and off 0.5 seconds for each ten's digit. The LED goes off for 1.25 seconds. If the LSB digit is 0 the LED stays on for 1 second and then goes off for 2.5 seconds. Otherwise, the fault LED blinks on 0.25 seconds and off 0.5 seconds for each unit digit then goes off for 2.5 seconds.
ERRAXIS Miscellaneous Command ACTION: Returns the controller axis number which created the error/warning for the task. PROGRAM SYNTAX: ERRAXIS - used in an expression REMARKS: If a zero is returned then the error was not axis related or there is no actual error. To determine the error/warning use the ERR command. EXAMPLE: ERRTRAP ERROR_HANDLER: Axis = ERRAXIS ‘ returns the axis number which created the error trap.
EVENT1 Motion Parameter ACTION: Returns the state of the trigger input labeled EVNT1 for the selected axis or sets the trigger polarity and enable, which are used in MOVEHOME, MOVEREG and FOLMOVEREG cycles. PROGRAM SYNTAX: EVENT1(axis)=expression EVENT1=expression1, ... , expression 8 EVENT1(axis, ... , axis)=expression, expression EVENT1(axis) - used in an expression REMARKS: Axis specifies the number of the axis (1-8).
EVENT2 Motion Parameter ACTION: Returns the state of the trigger input labeled EVNT2 for the selected axis or sets the trigger polarity and enable, which are used in MOVEHOME, MOVEREG and FOLMOVEREG cycles. PROGRAM SYNTAX: EVENT2(axis)=expression EVENT2=expression1, ... , expression 8 EVENT2(axis, ... , axis)=expression, expression EVENT2(axis) - used in an expression REMARKS: Axis specifies the number of the axis (1-8).
EXIN I/O Function ACTION: Returns the state of the specified expansion I/O inputs. PROGRAM SYNTAX: EXIN(nnn) - used in expression EXIN(nnn,len) - used in expression REMARKS: The nnn is the I/O terminal point. board1 board2 board3 board4 nnn= (100-147) or (200-247) or (300-347) or (400-447) len is the number of I/O points. len range is 1-24. SINGLE INPUT SYNTAX: EXIN(nnn) returns the state (1 or 0) of the designated input.
EXOUT I/O Function ACTION: Sets or returns the state of the specified expansion I/O outputs. PROGRAM SYNTAX: EXOUT(nnn) - used in expression EXOUT(nnn,len) - used in expression EXOUT(nnn)=expression EXOUT(nnn,len)=expression REMARKS: The nnn is the I/O terminal point. board1 board2 board3 board4 nnn= (100-147) or (200-247) or (300-347) or (400-447) len is the number of I/O points. len range is 1-24.
FEEDRATE Trajectory Parameter ACTION: Sets a feed rate override during Path execution. PROGRAM SYNTAX: FEEDRATE = expression REMARKS: The expression range is .01 to 10.0 (1% to 1000%). This value scales the commanded velocity to obtain a target velocity. This command is only honored during PATH or ARC execution. EXAMPLE: FOLACCDIST PATH 1,2 FEEDRATE=.
FOLERR Motion Parameter ACTION: Sets or returns the maximum position error allowed during motion, herein referred to as "following error." COMMAND SYNTAX: FOLERR(axis)=expression FOLERR=expression1, number2, . . . , number8 FOLERR(axis, … , axis)=expression, … , expression FOLERR (axis) - Used in an expression Note: ENCFOL can be substituted for FOLERR. REMARKS: This command is defined in more detail in Section 9 Servo Drive and Section 10 Stepper Drive.
FOLMAXRATIO Following Parameter ACTION: Sets or returns the maximum allowable following axis speed during an offset advance cycle. PROGRAM SYNTAX: FOLMAXRATIO(axis)=expression FOLMAXRATIO=expression1 , ... , expression8 FOLMAXRATIO(axis, ... ,axis)=expression, ... , expression FOLMAXRATIO(axis) - used in an expression REMARKS: This command is defined in more detail in Section 8 Following.
FOLMOVEREG Following Parameter ACTION: Request a Following axis move registration cycle. PROGRAM SYNTAX: FOLMOVEREG(axis)=expression FOLMOVEREG=expression1 , ... , expression8 FOLMOVEREG(axis, ... , axis)=expression, ... , expression REMARKS: This command is defined in more detail in Section 8 Following. FOLOFFSET Following Parameter ACTION: Defines a following incremental offset distance to advance or recede from the master . PROGRAM SYNTAX: FOLOFFSET(axis)=expression FOLOFFSET=expression1, ..
FOLRATIO Following Parameter ACTION: Sets the ratio of the following axis to the master. A value of 1 represents 100% of the master. PROGRAM SYNTAX: FOLRATIO(axis)=expression FOLRATIO=expression1, ... , expression8 FOLRATIO(axis, ... ,axis)=expression, ... , expression FOLRATIO(axis) - used in an expression REMARKS: This command is defined in more detail in Section 8 Following.
FOLSYNC Following Parameter ACTION: Returns the following sync status of the specified axis. PROGRAM SYNTAX: FOLSYNC(axis) - used in an expression REMARKS: This command is defined in more detail in Section 8 Following. FOLSYNCDIST Following Parameter ACTION: Specifies a master distance to travel when a FOLOFFSET command is issued. This distance will be traveled before execution of the FOLOFFSET command . PROGRAM SYNTAX: FOLSYNCDIST(axis)=expression FOLSYNCDIST(axis)=expression1, ...
FORMAT Miscellaneous Command ACTION: Enables or disables the formatting of the STR$ returned string. PROGRAM SYNTAX: FORMAT=m,n,d REMARKS: This command is used in conjunction with the STR$ command to set the format of the returned string. The m specifies the format mode. 0 disable format 1 leading and trailing 0=s will be returned in the string. 2 sign followed by leading spaces and trailing 0's will be returned in the string. The n specifies the number of whole digits to be returned in the string.
FOR ... NEXT ... STEP Program Flow Control ACTION: Repeats a block of statements a specified number of times. PROGRAM SYNTAX: FOR counter=start# TO end# [STEP increment] statements [EXIT FOR] statements NEXT [counter] REMARKS: Counter is a variable used as the loop counter. Start# is the initial value of the counter. End# is the end value of the counter. Increment is the amount the counter is changed each time through the loop. If STEP is not specified, increment defaults to one.
GETCHAR I/O Command ACTION: Waits for a character on the selected serial port and returns the ASCII code of the character. PROGRAM SYNTAX: GETCHAR(n) - used in an expression REMARKS: The n specifies the serial port number (1 or 2). Port 1 is the Host Port and Port 2 is the Auxiliary Port. Program execution is suspended while GETCHAR waits for a character to be received by the designated port. If a character is already in the receiver buffer the ASCII code of the character is returned immediately.
GOTO Program Flow Control ACTION: Branches Unconditionally to the specified label. PROGRAM SYNTAX: GOTO label REMARKS: The GOTO statement provides a mean for branching unconditionally to another label. It is good programming practice to use subroutines or structured control statements ( DO ... UNTIL, FOR ... NEXT, IF ... THEN ... ELSE IF ... ELSE) instead of GOTO statements, because a program with many GOTO statements can be difficult to read and debug.
HARDLIMIT Over Travel Limit ACTION: Enables or Disables Hard Limit Switches or returns the current Hard limit Enable/disable state of an axis. PROGRAM SYNTAX: HARDLIMIT(axis)=expression HARDLIMIT=expression1, ... , expression8 HARDLIMIT(axis, ... ,axis)=expression, ... , expression HARDLIMIT(axis) - used in an expression REMARKS: The axis specifies the axis (1-8) Hard limit inputs are used to stop the motor before it runs into a physical end of travel, thus avoiding damage to the mechanical system.
HARDLIMNEG Over Travel Limit ACTION: Returns the - Limit hardware state for the selected axis. PROGRAM SYNTAX: HARDLIMNEG(axis) - used in an expression REMARKS: The axis is the specified axis (1-8). A false(0) is returned if the designated axis - limit input is inactive. Otherwise, a true(1) will be returned which indicates that the - Limit input is active.
HVAL String Manipulation ACTION: Returns the decimal value of a hexadecimal string. PROGRAM SYNTAX: HVAL(A$) - used in an expression REMARKS: A$ is the designated string variable or string literal. The string variable format is: “0XHH” or “HH”. Where H is an ASCII 0-9 or a-f. The converted value is returned as a decimal value. EXAMPLES: Programming Commands x=HVAL(“0XFF”) ‘ x is set to 255.
IF...THEN...ELSE IF... ELSE...END IF Program Flow Command ACTION: Allows conditional execution based on the evaluation of a Boolean condition.
IN I/O Function ACTION: Returns the state’s of the specified digital I/O inputs. PROGRAM SYNTAX: IN(bnn) - used in an expression IN(bnn,len) - used in an expression REMARKS: bnn specifies the I/O point terminal. board 1 board 2 board 3 board 4 101-124 201-224 302-324 401-424 len is the number of I/O points to return (1-24). A true (1) is returned if the state of the input is active. Otherwise, a false (0) is returned. IN(bnn) - used in an expression Returns a single input state.
#INCLUDE Miscellaneous Command ACTION: Includes a file name with define statements in a user task. PROGRAM SYNTAX: #INCLUDE drive:\subdir\...\subdir\filename.inc REMARKS: Drive is the root directory of the drive. Subdir is the path required to find the file. Filename is the include filename with extension .inc. The include file must be a series of #DEFINE statements only and can be used in any project task file. The iws.inc file is included in the MCPI software.
INSTR String Manipulation ACTION: Returns the character position of the first occurrence of a specified string in another string. PROGRAM SYNTAX: INSTR(string1$,string2$) - used in an expression REMARKS: Returns the starting position that string2$ matches in string1$. The comparison is case sensitive and returns a 0 if no match is found. EXAMPLES: a$=“WE part#215629” x=INSTR(a$,”part#”) INTLIM ‘ x is set to 4 which is the starting position of part#.
JOG Motion Parameter ACTION: Runs the motor continuously in a specified direction. PROGRAM SYNTAX: JOG(axis)=expression JOG=expression1, ... ,expression8 JOG(axis, ... ,axis)=expression, ... , expression note: JOGSTART can be substituted for JOG. REMARKS: The axis specifies the number of the axis (1-8). The expressions sign determines the motion direction . If the expression is positive or 0, jogging will be in the positive direction.
JOYSTICK Motion Parameter ACTION: Enables Joystick motion. PROGRAM SYNTAX: JOYSTICK=ax1, ... ,ax8 JOYSTICK(ax1, ... , ax8) REMARKS: The JOYSTICK command sets up to eight axes, ax1 to ax8, to move in response to the voltage applied to their respective analog inputs. Each axis will run at a speed proportional to the input voltage and in the direction determined by the polarity of the input voltage. There is a ±0./25 dead band.
KAFF Servo Parameter ACTION: Sets or returns the acceleration feed forward gain for a servo axis. PROGRAM SYNTAX: KAFF(axis)=expression KAFF=expression1, ... , expression8 KAFF(axis, ... ,axis)=expression, ... ,expression KAFF(axis) - used in an expression REMARKS: This command is defined in more detail in Section 9 Servo Drive. KD Servo Parameter ACTION: Sets or returns the derivative gain for the servo axis. PROGRAM SYNTAX: KD(axis)=expression KD=expression1, ... , expression8 KD(axis, ...
KVFF Servo Parameter ACTION: Sets or returns the velocity feed forward gain for the servo axis. PROGRAM SYNTAX: KVFF(axis)=expression KVFF=expression1, ... , expression8 KVFF(axis, ... ,axis)=expression, ... ,expression KVFF(axis) - used in an expression REMARKS: This command is defined in more detail in Section 9 Servo Drive. LCASE$ String Manipulation ACTION: Converts and returns a string with lower case letters.
LINE Motion Parameter ACTION: Initiates a coordinated linear move involving up to 8 axes. PROGRAM SYNTAX: LINE=expression1, ... , expression8 LINE(axis, ... , axis)=expression, ... ,expression LINE=expression1,expression2 (syntax for PATH command) REMARKS: The axis specifies the number of the axis (1-8). The expression represents the move distance. All defined axes will start and end at the same time. The lower numbered axis is considered the master and its parameters: SPEED, ACCEL,.
LOF Miscellaneous Command ACTION: Returns the number of character in the designated RS232 port. PROGRAM SYNTAX: LOF(port) - used in an expression. REMARKS: Port is the designated serial port (1 or 2). Port 1 is the Host port and port 2 is the Auxiliary port.
MAXSPD Trajectory Parameter ACTION: Sets or returns the maximum allowed speed of the specified axis. PROGRAM SYNTAX: MAXSPD(axis)=expression MAXSPD=expression1, ... , expression 8 MAXSPD(axis, ... ,axis)=expression, ... , expression MAXSPD(axis) - used in an expression REMARKS: The axis specifies the number of the axis (1-8). The expression specifies the maximum speed allowed for an axis.
MOD Mathematics Function ACTION: Returns the remainder of a number divided by the base. PROGRAM SYNTAX: y=x MOD base REMARKS: The y is the returned remainder. The x is the number that is divided by the base. The base is the divisor. EXAMPLES: MOTIONSTATE ACTION: y=31 MOD 16 ‘ y is set to 15 which is the remainder. Trajectory Parameter Returns the follower motion state for an axis. PROGRAM SYNTAX: MOTIONSTATE(axis) - used in an expression.
MOVE Motion Parameter ACTION: Initiates a non-coordinated move. PROGRAM SYNTAX: MOVE(axis)=expression MOVE=expression1, ... , expression 8 MOVE(axis, ... ,axis)=expression, ... , expression REMARKS: The axis specifies the number of the axis (1-8). The expression represents the incremental distance or absolute position to be moved to. The POSMODE command setting of an axis determines whether an incremental distance or absolute position is commanded.
MOVEHOME Motion Parameter ACTION: Runs the motor until the home input is activated, captures and records the position of the switch activation as home (electrical zero), then decele rates the motor to a stop. PROGRAM SYNTAX: MOVEHOME(axis)=expression MOVEHOME=expression1, ... , expression 8 MOVEHOME(axis, ... ,axis)=expression, ... , expression REMARKS: The axis specifies the number of the axis (1-8).
MOVEHOME continued EXAMPLES: MOVEHOME(3)=1 WAITDONE(3) POSMODE(3)=1 MOVE(3)=0 WAITDONE(3) MOVEHOME=-2,,3 WAITDONE(1,3) POSMODE(1,3)=1,1 MOVE(1,3)=0,0 WAITDONE(1,3) ‘Axis 3 executes a home cycle in the positive direction. ‘Wait for motion to stop. ‘Activates Absolute Mode for axis 3. ‘ move axis 3 to the captured home position ‘Axis 1 executes a home cycle in the negative direction and axis 3 executes a home cycle in the positive direction.
MOVEREG Motion Parameter ACTION: Runs the motor until the mark registration input is activated; then moves the motor the desired registration distance. PROGRAM SYNTAX: MOVEREG(axis)=expression MOVEREG=expression1, ... , expression 8 MOVEREG(axis, ... ,axis)=expression, ... , expression REMARKS: The axis specifies the number of the axis (1-8). The expression represents the incremental distance to move after a registration trigger has occurred.
MOVEREG Continued MOVEREG CYCLE Trigger switch SPEED Note 1 ACCEL DECEL MOVEREG BUSY=0 Note 2 BUSY=1 BUSY=0 REGLIMIT Note 1: The registration input triggers. The distance specified by the command begins to be counted down. Note 2: Motion is completed. The distance traveled from the registration trigger is the command distance. Note: The underlined text is the command required to generate the velocity profile. The remaining text are related commands.
NOT Boolean Operator ACTION: The logical NOT operator is used in Boolean expressions. PROGRAM SYNTAX: NOT expression REMARKS: The NOT operator uses the truth table: The result is TRUE if the expression is FALSE. expression TRUE FALSE EXAMPLES: condition result FALSE TRUE DO statements WHILE NOT(DONE(axis)) The controller will continue to execute the loop until the axis is done with the motion. NVR Miscellaneous Command ACTION: The NVR array is used for non-volatile variable storage.
NVRBIT Miscellaneous Command ACTION: Store or return the bit value in NVR memory. PROGRAM SYNTAX: NVRBIT(bit)= expression NVRBIT(bit) - used in an expression REMARKS: The bit value range is 1 - 65536. The expression must be a value of 0 or 1. When using this command care must be taken not to alter elements used by the NVR and NVRBYTE commands. The NVR array is used for non-volatile storage. The array consist of 2048 elements, 8192 Bytes or 65536 Bits. Thus, there are 32 bits in each word.
NVRBYTE Miscellaneous Command ACTION: Stores or returns the byte value in NVR memory. PROGRAM SYNTAX: NVRBYTE(byte)= expression NVRBYTE(byte) - used in an expression REMARKS: The byte value range is 1 - 8192. The expression must be a value between 0 and 255. When using this command care must be taken not to alter elements used by the NVR and NVRBIT commands. The NVR array is used for non-volatile storage. The array consist of 2048 elements, 8192 Bytes or 65536 Bits.
OR Boolean Operator ACTION: The logical OR operator is used in Boolean expressions. PROGRAM SYNTAX: expression1 OR expression2 REMARKS: The OR operator uses this truth Table: The result is TRUE, if either expression is TRUE.
OUT I/O Function ACTION: Sets or returns the condition of a specified digital output. PROGRAM SYNTAX: OUT(bnn)=expression OUT(bnn,len)=expression OUT(bnn) - used in an expression OUT(bnn,len) - used in an expression REMARKS: bnn is the board and Output number. board 1 101-124 board 2 board 3 board 4 201-224 301-324 401-424 The expression specifies the output state’s. The len specifies the number of Output points (1-24) involved in the instruction.
OUTLIMIT Servo Parameter ACTION: Sets or returns the servo command voltage limit. PROGRAM SYNTAX: OUTLIMIT(axis)=expression OUTLIMIT=expression1, ... , expression8 OUTLIMIT(axis, ... , axis)=expression, ... , expression OUTLIMIT(axis) - used in an expression REMARKS: This command is defined in more detail in Section 9 Servo Drive.
PATH ...PATH CLOSE ... PATH END Motion Parameter ACTION: Specifies a continuous motion path. PROGRAM SYNTAX: PATH=axis1,axis2 EXOUT(bnn)=expression EXOUT(bnn,len)=expression OUT(bnn)=expression OUT(bnn,len)=expression LINE=axis distance,axis2 distance FEEDRATE=expression ARC=axis1 center, axis2 center, ±angle POINT=axis1 distance, axis2 distance RADIUS=expression PATH CLOSE PATH END REMARKS: Axis1 and axis2 are the axes used in the path.
POINT Motion Parameter ACTION: Specifies coordinates, which the motors will move through in a path. PROGRAM SYNTAX: POINT=expression1, expression2 REMARKS: This command is only valid between a PATH and a PATHEND statement. Expression1 is the first axis coordinate, expression2 is the second axis coordinate. The path connecting points is smooth. EXAMPLES: POSMODE=1,1 PATH=1,2 POINT=1.5,3 POINT=4,5 POINT=6,7 PATH END The above example will move the axes from the present position, through points(1.
POSMODE Motion Parameter ACTION: Sets or returns the positioning mode for the specified axis. PROGRAM SYNTAX: POSMODE(axis)=expression POSMODE=expression1, ... , expression8 POSMODE(axis, ... , axis)=expression, ... , expression POSMODE(axis) - used in an expression REMARKS: The axis specifies the number of the axis (1-8). If the expression is TRUE (non-zero) then the absolute positioning mode is enabled. If the expression is FALSE (zero) then the incremental mode is enabled.
PRINT String Manipulating ACTION: Transmits designated data via the designated serial port. PROGRAM SYNTAX: PRINT#1,[expression][, or ;][expression][, or ;] PRINT#2,[expression][, or ;][expression][, or ;] REMARKS: Port 1 is the Host port and Port 2 is the Auxiliary Port. expression can be an variable, parameter, string variable or Literal string. Literal strings must be enclosed in quotation marks. If a comma "," is used between expressions five spaces will separate expressions.
PRINT USING String Manipulation ACTION: Prints strings character or formatted numbers. PROGRAM SYNTAX: PRINT USING #1,"literal string",[exp][, or;][exp][;] PRINT USING #1,Format$,[exp][, or;][exp][;] PRINT USING #2,"literal string",[exp][, or;][exp][;] PRINT USING #2,Format$,[exp][, or;][exp][;] REMARKS : Port 1 is the Host Port and Port 2 is the Auxiliary Port. The numeric values are formatted only using the literal string or a designated Format$ variable string.
PRINT USING continued The following special characters are used to format the numeric field: + The sign of the number will always be printed. Only the negative sign will be printed. If the data is positive a space will be printed in place of the sign. # represents each digit position. If no data exist at the digit position substitute a space. The Digit field will always be filled. . A decimal point may be inserted at any position in the field. 0 represents a digit position.
PRINT USING continued The following example illustrates how the format string is processed. Example: PRINT USING#1,"Numbers are +###.## 999,"cnts" ,54," is limit" ### 0##",100.54,"mv", The "Numbers are " is extracted from the string and sent via serial port. The "+###.##" is extracted from the string as the data format, which results in "+100.54" being sent via serial port. The string "mv" is sent via serial port. The " " is extracted from the string and sent via serial port.
PROFILE Trajectory Parameter ACTION: Determines how the motor’s speed changes. PROGRAM SYNTAX: PROFILE(axis)=expression PROFILE=expression1, ... , expression8 PROFILE(axis, ... , axis)=expression, ... ,expression PROFILE(axis) - used in an expression REMARKS: The axis specifies the axis number (1-8). The expression specifies the profile setting (1-32). Speed changes require a period of accel/decel to increase/decrease the motor’s speed. The Profile value determines how the accel/decel is applied.
RADIUS Motion Parameter ACTION: Sets or returns the ARC radius for Path blending. PROGRAM SYNTAX: RADIUS = expression RADIUS - used in an expression REMARKS: Blending only occurs between lines in a path. The first syntax type sets the ARC radius for Path blending equal to the expression. The second syntax type (expression = RADIUS) returns the current value of Radius. EXAMPLES: X=RADIUS 'sets X equal to the current RADIUS value RADIUS=.25 'sets the RADIUS for Path blending to .
REDUCE Motion Parameter ACTION: Enables, disables the Reduce current or returns the enable status. PROGRAM SYNTAX: REDUCE(axis)=expression REDUCE=expression1, ... , expression8 REDUCE(axis, ... , axis)=expression, ... , expression REDUCE(axis) - used in an expression REMARKS: This command is defined in more detail in the Stepper Section of the Manual. REGLIMIT Over Travel Limit ACTION: Sets or returns the distance to be moved during a MOVEREG cycle, while awaiting a trigger.
REM or ‘ Miscellaneous Command ACTION: Allows source code comments to be inserted in the program. PROGRAM SYNTAX: REM or ' REMARKS: All text to the right of REM or ' to the end of the line is not considered part of the command during execution. EXAMPLES: ACCEL(1)=10.2 DECEL(1)=5.4 REM axis 1 acceleration=10.2 units ' axis 1 deceleration=5.4 units RESET Miscellaneous Command ACTION: Resets the controller system.
RIGHT$ String Manipulation ACTION: Returns the rightmost characters of a string. PROGRAM SYNTAX: string1$=RIGHT$(string2$,n) REMARKS: The n is the number of rightmost characters to return. If n is greater than the length of the string2$ then the entire string is returned to string1$. EXAMPLES: b$=“Hello World” a$=RIGHT$(b$,4) 'sets a$=“orld”. SETCOM Miscellaneous Command ACTION: Sets the baud rate and data format for Auxiliary serial port.
SHIFT Miscellaneous Command ACTION: Shifts the elements of a single-dimension numeric array up or down. PROGRAM SYNTAX: SHIFT (array, n) REMARKS: n is the number of shifts to perform on the array. If n is a positive number, the array is shifted up and the top elements are discarded. If n is a negative number the array is shifted down and the bottom elements are discarded. Zeroes are shifted into the array. EXAMPLES: This example illustrates the effect of shift commands on a 4-element array "x".
SOFTLIMIT Over Travel Limit ACTION: Enables/disables or returns the SOFTLIMIT enable state for the selected axis. PROGRAM SYNTAX: SOFTLIMIT(axis)=expression SOFTLIMIT=expression1, ... , expression8 SOFTLIMIT(axis, ... , axis)=expression, ... ,expression SOFTLIMIT(axis) - used in an expression REMARKS: axis selects the designated axis (1-8). The expression sets the SOFTLIMIT state of the designated axes. A "0" disables the SOFTLIMPOS and SOFTLIMNEG soft limits of the designated axis.
SOFTLIMNEG Over Travel Limit ACTION: Programmable software limit switch for motion in the negative direction. Sets or returns the absolute negative travel position value for the specified axis. PROGRAM SYNTAX: SOFTLIMNEG(axis)=expression SOFTLIMNEG=expression1, ... ,expression8 SOFTLIMNEG(axis, ... , axis)=expression, ... , expression SOFTLIMNEG(axis) - used in an expression REMARKS: The "axis" specifies the number of the axis (1-8).
SOFTLIMPOS Over Travel Limit ACTION: Programmable software limit switch for motion in the positive direction. Sets or returns the absolute positive travel position value for the specified axis. PROGRAM SYNTAX: SOFTLIMPOS(axis)=expression SOFTLIMPOS=expression1, ... ,expression8 SOFTLIMPOS(axis, ... , axis)=expression, ... , expression SOFTLIMPOS(axis) - used in an expression REMARKS: The "axis" specifies the number of the axis (1-8).
SPEED Trajectory Parameter ACTION: Sets and returns the target velocity of the motor. PROGRAM SYNTAX: SPEED(AXIS)=expression SPEED=expression1, ... , expression8 SPEED(axis, ... ,axis)=expression, ... , expression SPEED(axis) - used in an expression REMARKS: The axis specifies the number of the axis (1-8). The expression sets the speed of the designated axis in units/second and must be a positive value. The velocity of an axis can be changed during motion by issuing a new value for the SPEED command.
SQRT Mathematics Function ACTION: Returns the square root of the expression. PROGRAM SYNTAX: SQRT(expression) - used in an expression REMARKS: The expression must greater than or equal to zero, or an warning will occur. EXAMPLES: x = SQRT(16) Sets variable x equal to a value of 4. STOP Motion Parameter ACTION: Stops any motion with a control stop, uses the DECEL value for decele rating to a stop. PROGRAM SYNTAX: STOP(axis) STOP=expression1 , ... , expression8 STOP(axis, ...
STR$ String Manipulation ACTION: Returns a string representation of a numeric expression. PROGRAM SYNTAX: String1$=STR$(numeric expression) REMARKS: The STR$ command is the complement of a VAL command. EXAMPLES: ACCEL(2)=100 x=50 y=2.1 a$=STR$(ACCEL(2)) b$=STR$(x) c$=STR$(y) ‘sets a$=“100” ‘sets b$=“50” ‘sets c$=“2.1” STRING$ String Manipulation ACTION: Returns a string of characters.
TIMER Time Function ACTION: Sets or read the Timer value in seconds. PROGRAM SYNTAX: TIMER - used in an expression TIMER=expression TIMER1 - used in an expression TIMER1=expression REMARKS: The Timer should be set to a value at the beginning of the task in which it is used. The Timer is incremented every millisecond. EXAMPLES: TIMER=0 DO statements WHILE TIMER < 1.0 ‘set the timer to zero ‘ do the loop for 1 second TIMER2 Time Function ACTION: Sets or read the Timer2 value in seconds.
TOLERANCE Miscellaneous Command ACTION: Sets a tolerance on a numeric comparison. SYNTAX: TOLERANCE = expression TOLERANCE - used in an expression REMARKS: Sets a numeric tolerance for all comparison operators (<, <=, = >=, >, <>). If the comparison is within the bounds of a ± tolerance the comparison is true. EXAMPLES: TOLERANCE=.001 IF x <= 2 THEN ‘ if x <= +1.999 then comparison is true statements ELSE IF x >= 4 THEN ‘ if x >= +3.
VAL String Manipulation ACTION: Returns the floating point value of the designated string variable. PROGRAM SYNTAX: VAL(n$) - used in an expression REMARKS: n$ is the designated string variable. The string variable format for conversion is: [sign]digits[.digits[e or E[sign]integer] The sign and scientific notions are optional. Only numeric values are returned. The first character that cannot be part of the number terminates the string. If no digits have been processed, a value of zero is returned.
WAITDONE Motion Parameter ACTION: Waits for motion to be done for the specified axes. "Done" means motion is complete. PROGRAM SYNTAX: WAITDONE(axis) WAITDONE=expession1, ... , expression8 WAITDONE(axis, .... ,axis) REMARKS: The "axis" specifies the number of the axis (1-8). The expression specifies the axis to wait for motion complete. An alternate way to accomplish the WAITDONE function is as follows: DO: LOOP WHILE BUSY(1) ‘ Waits until axis 1 motion is completed.
WARNING Miscellaneous Command ACTION: Returns the warning number of the task. PROGRAM SYNTAX: WARNING - used in expression REMARKS: A non-zero indicates no warnings have been encountered in the task. The predefined Warning codes are 11 Command axis is not in task group. 12 Analog I/O selected is out of range. 13 BCD selected is out of range. 14 Expansion Input selected is out of range. 15 Expansion Output selected is out of range. 16 Digital Input selected is out of range.
7.5 Host Commands Grouped By Functions I/O Function ANALOG BCD EXIN EXOUT IN OUT Page Sets or returns a numeric value representation on the analog port. Returns the BCD switches value connected to an Expansion I/O port. Returns the state of the specified expansion I/O inputs. Sets or returns the state of the specified expansion I/O outputs. Returns the state’s of the specified digital I/O inputs. Sets or returns the condition of a specified digital output.
Motion Parameter continued Page ENCFOL ENCMODE ENCRES EVENT1 Sets or returns the maximum position error allowed during motion. Sets or returns the operating mode of a closed loop stepper axis. Returns the encoder line count of an axis. Returns the state of the trigger input labeled EVNT1 or sets the trigger polarity and enable , which are used in a MOVEHOME, MOVEREG or FOLMOVREG cycle.
7.6 Host Command Summary (alphabetical list) Page “
Page EVENT2 EXIN EXOUT Returns the state of the trigger input labeled EVNT2 or sets the trigger polarity and enable , which are used in a MOVEHOME, MOVEREG or FOLMOVREG cycle. 187 Returns the state of the specified expansion I/O inputs. 187 Sets or returns the state of the specified expansion I/O outputs. 188 F FILTER FOLERR FREE FREEMEM Sets or returns the filter value for the defined analog input. Sets or returns the maximum position error allowed during motion.
P POSERR POSMODE PROFILE Page Returns the positional error of the designated axis. Sets or returns the position mode of an axis. Determines how the motor speed changes. 199 200 200 Sets or returns the distance to be moved during a MOVEREG cycle, while awaiting a trigger. 201 Resets the system. Returns the current revision level of the controller’s operating system. Runs the loaded project. 201 201 202 Sets the default value for the designated NVR elements.
7.7 Host Commands - Alphabetical Listing "
ABSPOS ACTION : COMMAND SYNTAX: REMARKS: EXAMPLES: Trajectory Parameter Sets or returns the commanded absolute position of an axis. ABSPOS(axis)=number cr ABSPOS=number1, . . . , number8 cr ABSPOS cr ABSPOS(axis) cr See Programming Command ABSPOS. ABSPOS(3)=2 Sets the absolute position of axis 3 to 2 units. ABSPOS=1,,3 sets the absolute position of axis 1 to 1 unit, axis 2 no change and axis 3 to 3 units. ABSPOS(3) Returns the current absolute position of axis 3.
ANALOG I/O Function ACTION: Sets or returns a numeric value representing the voltage on the analog port. PROGRAM SYNTAX: ANALOG(b0n) cr ANALOG(b0n)=number cr REMARKS: See Programming Command ANALOG EXAMPLES : ANALOG(102)=2.5 Sets the voltage on board 1 output 2 to 2.5 volts ANALOG(102) Return the current voltage on board 1 input 2. ARC Motion Parameter ACTION : Initiates a coordinated motion to move in an arc.
AXSTAT Miscellaneous Command ACTION: Returns the Axis Drive type, Units/Rev, Drive resolution and Task assigned to an axis .
BUSY Motion Parameter ACTION: Returns the motion status of the selected axis. An axis is "busy" if motion is occurring. COMMAND SYNTAX: BUSY(axis) cr BUSY cr REMARKS: EXAMPLES: See Programming Command BUSY BUSY(1) Returns the motion status of axis 1. BUSY Return the motion status for all assigned axes. CAPPOS Miscellaneous Command ACTION : Returns the last captured position of an axis from a MOVEHOME, MOVEREG or CAPTURE cycle.
CAPTURE Miscellaneous Command ACTION: Sets the position capture trigger condition or returns the position capture status. COMMAND SYNTAX: CAPTURE(axis)= number cr CAPTURE=number1, … , number8 cr CAPTURE(axis) cr CAPTURE cr REMARKS: See Programming Command CAPTURE. EXAMPLES: CAPTURE(1) = 0 cr Arms the trigger to capture the position of axis 1 when EVNT 1 becomes active.
DECEL Trajectory Parameter ACTION: Sets or returns the deceleration value of the selected axis. COMMAND SYNTAX: DECEL(axis)=number cr DECEL=number1, number2, . . . , number8 cr DECEL(axis) cr DECEL cr REMARKS: EXAMPLE: See Programming Command DECEL. DECEL(2)=50 Sets the deceleration rate for axis 2 to 50 units/sec2. DECEL=50,,75 Sets the deceleration rate for axis 1 to 50 units/sec2 , axis 2 is unchanged and axis 3 to 75 units/sec2. DECEL(2) Returns the deceleration rate for axis 2.
DIR Miscellaneous Command ACTION: List the names of projects and tasks stored in non-volatile memory. COMMAND SYNTAX: DIR cr REMARKS : The transfer format is: n*s Project name checksum Task name Task name etc n*s Project name checksum Task name Task name etc free space = nnnn n is the project number (0 to 6).
ENCBAND Motion Parameter ACTION: Sets or returns the maximum position error allowed when motion is stopped. PROGRAM SYNTAX: ENCBAND(axis)=number cr ENCBAND=number1, …, number 8 cr ENCBAND(axis) cr ENCBAND cr REMARK: See Programming Command ENCBAND. EXAMPLE: ENCBAND(3)=.1 Sets the maximum position error of axis 3 to .1 unit. ENCBAND=.1 ,,1.5 Sets the maximum position error of axis 1 to .1 unit, and axis 3 to .15 unit. ENCBAND(3) Returns the maximum position error of axis 3.
ENCFOL Motion Parameter ACTION: Sets or returns the maximum position error allowed during motion. PROGRAM SYNTAX: ENCFOL(axis)= number cr ENCFOL=number1, … , number8 cr ENCFOL(axis) cr ENCFOL cr REMARK: See Programming Command ENCFOL. Note: FOLERR can be used in place of ENCFOL. EXAMPLE: ENCFOL(2)=.4 Sets the following error of axis 2 to .4 units. ENCFOL=.4 ,, .3 Sets the following error of axis 1 to .4 units, and axis 3 is set to .3 units.
ENCPOS Trajectory Parameter ACTION: Returns the encoder position of an axis. PROGRAM SYNTAX: ENCPOS(axis) cr ENCPOS cr REMARK: See Programming Command ENCPOS. EXAMPLE: ENCPOS(1) Returns the encoder value of axis 1. ENCPOS Returns the encoder value for all assigned axes. ENCRES Motion Parameter ACTION: Returns the encoder line count of the selected axis. COMMAND SYNTAX: ENCRES(axis) cr ENCRES cr REMARKS : The axis specifies the number of the axis (1-8).
ERASE Miscellaneous Command ACTION: Erases a specific project or all projects stored in non-volatile memory. COMMAND SYNTAX: ERASE DIR cr ERASE project name cr REMARKS: The project erased is not recoverable. ERASE DIR Erases all projects stored in non-volatile memory. ERASE project name Erases the defined project name in non-volatile memory. EXAMPLES: ERASE DIR Erases all projects stored in non-volatile memory. ERASE CONVEYER Erases project CONVEYER if it exists.
ERRAXIS Miscellaneous Command ACTION: Returns the controller axis number which created the error/warning for the task. PROGRAM SYNTAX: ERRAXIS cr REMARKS : If a zero is returned for the task then the error/warning was not axis related or there is no error/warning. To determine the error/warning use the ERR or ERRM command.
ERRM Miscellaneous Command ACTION: Returns the error/warning message’s for the task’s (0-7). PROGRAM SYNTAX: ERRM cr REMARKS: This command returns the error/warning message’s for all task and clears the errors and axis which created the error.
"ESC" Miscellaneous Commands ACTION: The ESC key (or ESC character code sent via a serial port) is used during program execution to force execution of a command in the host buffer. COMMAND SYNTAX: ESC (ASCII 27) command REMARKS: When the controller is executing a BASIC program, any host commands received are queued for execution after the BASIC program finishes. The execution of a host command can be forced to happen immediately by preceding it with the ESC character (ASCII 27).
EVENT2 Motion Parameter ACTION: Returns the state of the trigger input labeled EVNT2 or sets the trigger polarity and enable for a Movehome and Movereg cycle. PROGRAM SYNTAX: EVENT2(axis)=number cr EVENT2=number1, ... , number8 cr EVENT2(axis) cr EVENT2 cr REMARKS: See Programming Command EVENT2 . EXAMPLES: EVENT2(2)=0 disables Event2 as a MOVEREG trigger on axis 2. EVENT2(2)=1 enables Event2 to trigger when activated on axis 2. EVENT2(2)=-1 enables Event2 to trigger when open circuited on axis 2.
EXOUT I/O Function ACTION: Sets or returns the state of the specified expansion I/O outputs. PROGRAM SYNTAX: EXOUT(nnn) cr EXOUT(nnn,len) cr EXOUT(nnn)=number cr EXOUT(nnn,len)=number cr REMARKS : EXAMPLES: See Programming Command EXOUT. EXOUT(207)=-3 turns output 7 on board 2 on EXOUT(207)=0 turns output 7 on board 2 off EXOUT(207) Returns the last commanded output for 207. EXOUT(207,3)=6.
FOLERR Motion Parameter ACTION: Sets or returns the maximum position error allowed during motion, herein referred to as "following error." COMMAND SYNTAX: FOLERR(axis)=number cr FOLERR=number1, number2, . . . , number8 cr FOLERR(axis) cr FOLERR cr REMARKS : See Programming Command FOLERR. Note: ENCFOL can be substituted for FOLERR. EXAMPLES: FOLERR(2)=.4 Sets the following error of axis 2 to .4 units. FOLERR=.4,, .3 Sets the following error of axis 1 to .
FREEMEM Miscellaneous Command ACTION: Returns the amount of free memory for program execution allocation. COMMAND SYNTAX: FREEMEM cr REMARKS: The value returned is the number of 32 bit word free for allocation. The DIM command uses free memory for allocating an area for arrays. A new variable string uses free memory for storing the string characters. The maximum free memory size is 45055 words.
IN ACTION : I/O Function Returns the state of the specified digital I/O inputs. PROGRAM SYNTAX: IN(bnn) cr IN(bnn,len) cr REMARKS: See Programming command IN. EXAMPLES: IN(207) Returns the state of board 2 input 7. IN(207,3) Returns the sum of input states 7-9 on board 2. The value returned will be: IN(207) + (2*IN(208) + (4*IN(209). INTLIM Servo Parameter ACTION: Sets the Integral limit for the controller.
JOG Motion Parameter ACTION: Runs the motor continuously in a specified direction. PROGRAM SYNTAX: JOGSTART(axis)=number cr JOGSTART=number1, ... ,number8 cr Note: JOGSTART can be substituted for JOG REMARKS: See Programming Command JOG. EXAMPLES: JOGSTART(2)=1 Runs axis 2 continuously in the +direction. JOGSTART=1,,-1 Runs axis 1 continuously in the +direction, axis 2 is unchanged and axis 3 runs continuously in the -direction.
KD Servo Parameter ACTION: Sets or returns the derivative gain for the servo axis. PROGRAM SYNTAX: KD(axis)=number cr KD=number1, ... , number8 cr KD(axis) cr KD cr REMARKS: See Programming Command KD. EXAMPLES: KD(2)=4 Sets the derivative gain of axis 2 to 4 milliseconds. KD=10,,8 Sets the derivative gain of axis 1 to 10 milliseconds, axis 2 is unchanged and axis 3 is set to 8 milliseconds. KD(2) Returns the derivative gain of axis 2. KD Returns the derivative gain of all assigned axes.
KP Servo Parameter ACTION: Sets or returns the proportional gain of the servo axis. PROGRAM SYNTAX: KP(axis)=number cr KP=number1, ... , number8 cr KP(axis) cr KP cr REMARKS: See Programming Command KP. EXAMPLES: KP(2)=20 Sets the Proportional gain of axis 2 to 20 millivolts/encoder count. KP=18,,20 Sets the Proportional gain of axis 1 to 18 millivolts/encoder count, axis 2 is unchanged and axis 3 is set to 20 millivolts/encoder count. KP(2) Returns the Proportional gain of axis 2.
LINE Motion Parameter ACTION: Initiates a coordinated linear move involving up to 8 axes. PROGRAM SYNTAX: LINE=number1, ... , number8 cr REMARKS : EXAMPLES: LOAD ACTION: COMMAND SYNTAX: See Programming Command LINE. LINE=1.0,,-2.0 Linear interpolated axis 1 and 3. Axis 1 moves +1.0 units , and axis 3 moves -2.0 units. Miscellaneous Command Loads the designated project from non-volatile memory into operating memory. LOAD project name cr REMARKS: The name is limited to eight characters.
MAXSPD Trajectory Parameter ACTION: Sets or returns the maximum allowed speed of the specified axis. PROGRAM SYNTAX: MAXSPD(axis)=number cr MAXSPD=number1, ... , number 8 cr MAXSPD(axis) cr MAXSPD cr REMARKS: See Programming Command MAXSPD. EXAMPLES: MAXSPD(3)=50 Sets the maximum speed for axis 3 to 50 units/second. MAXSPD=50,,60 Sets the maximum speed for axis 1 to 50 units/second, axis 2 is unchanged and axis 3 to 60 units/second. MAXSPD(2) Returns the maximum speed for axis 2.
MOVEHOME Motion Parameter ACTION: Runs the motor until the home input is activated, captures and records the position of the switch activation as home (electrical zero), then decele rates the motor to a stop. PROGRAM SYNTAX: MOVEHOME(axis)=number MOVEHOME=number1, ... , number8 REMARKS: See Programming Command MOVEHOME. EXAMPLES: MOVEHOME(3)=1 Axis 3 executes a home cycle in the positive direction.
NVRBIT Miscellaneous Command ACTION: Store or return the bit value in NVR memory. PROGRAM SYNTAX: NVRBIT(bit)= number cr NVRBIT(bit) cr REMARKS: See Programming Command NVRBIT. EXAMPLES : NVRBIT(65505)=1 sets Bit 1 of element 2048 = 1 NVRBIT(65536)=0 sets Bit 32 of element 2048 = 0 NVRBYTE Miscellaneous Command ACTION: Stores or returns the byte value in NVR memory. PROGRAM SYNTAX: NVRBYTE(byte)=number cr NVRBYTE(byte) cr REMARKS: See Programming Command NVRBYTE.
OUTLIMIT Servo Parameter ACTION: Sets or returns the servo command voltage limit. PROGRAM SYNTAX: OUTLIMIT(axis)=number cr OUTLIMIT=number1, ... , number8 cr OUTLIMIT(axis) cr OUTLIMIT cr REMARKS: See Programming Command OUTLIMIT. EXAMPLES: OUTLIMIT(2)=5 Limits the magnitude of the servo output voltage for axis 2 to ± 5 volts. OUTLIMIT=5,,10 Limits the magnitude of the servo output for axis 1 to ± 5 volts, axis 2 is unchanged and axis 3 to ± 10 volts.
POSMODE Motion Parameter ACTION: Sets or returns the positioning mode for the specified axis. PROGRAM SYNTAX: POSMODE(axis)=number cr POSMODE=number1, ... , number8 cr POSMODE(axis) cr POSMODE cr REMARKS: EXAMPLES: See Programming Command POSMODE. POSMODE(2)=1 Sets the positioning mode for axis 2 to absolute. POSMODE=1,,0 Sets the positioning mode for axis 1 to absolute, axis 2 is unchanged and axis 3 is set to incremental positioning mode. POSMODE(2) Returns the positioning mode for axis 2.
REGLIMIT Over Travel Limit ACTION : Sets or returns the distance to be moved during a MOVEREG cycle, while awaiting a trigger. PROGRAM SYNTAX: REGLIMIT(axis)=number cr REGLIMIT=number1, ... , number8 cr REGLIMIT(axis) cr REGLIMIT cr REMARKS: See Programming Command REGLIMIT. EXAMPLES: REGLIMIT(2)= 10 set the MOVEREG travel distance limit on axis 2 to 10 units REGLIMIT=0,,10 disables the REGLIMIT for axis 1, axis 2 is unchanged and axis 3 has MOVEREG travel distance limit of 10 units.
RUN Miscellaneous Command ACTION: Runs the loaded project or specified task number. COMMAND SYNTAX: RUN cr REMARKS : RUN starts execution of all loaded tasks from their respective beginnings. SNVR Miscellaneous Command ACTION : Sets the default value for the designated NVR elements. COMMAND SYNTAX: SNVR(start, end)=value cr lf REMARKS: start is the starting element number in NVR. The range is 1-2048. end is the ending element in NVR. The range start-2048.
SOFTLIMNEG Over Travel Limit ACTION: Programmable "software limit switch" for motion in the negative direction. Sets or returns the absolute negative travel position value for the specified axis. PROGRAM SYNTAX: SOFTLIMNEG(axis)=number cr SOFTLIMNEG=number1, ... ,number8 cr SOFTLIMNEG(axis) cr SOFTLIMNEG cr REMARKS: See Programming Command SOFTLIMNEG. EXAMPLES: SOFTLIMNEG(2) =-4 Sets the negative direction soft limit of axis 2 at -4 units.
SPEED Trajectory Parameter ACTION: Sets and returns the target velocity of the motor. PROGRAM SYNTAX: SPEED(axis)=number cr SPEED=number1, ... , number8 cr SPEED(axis) cr SPEED cr REMARKS: EXAMPLES: See Programming Command SPEED. SPEED(2)=10 Sets the speed of axis 2 to 10 units/second. SPEED=0,,5 Sets the speed of axis 1 to 0 units/second, axis 2 is unchanged and axis 3 to 5 units/second. SPEED(2) Returns the speed value for axis 2. SPEED Returns the speed value for all assigned axes.
STOPERR Motion Parameter ACTION: Sets or returns the maximum position error allowed when motion is stopped, referred to herein as "position error band." COMMAND SYNTAX: STOPERR(axis)=number cr STOPERR=number1, … , number8 cr STOPERR(axis) cr STOPERR cr REMARKS : See Programming Command STOPERR. Note: ENCBAND can be substituted for STOPERR. EXAMPLES: STOPERR(3)=.1 Sets the maximum position error for axis 3 to .1 units. STOPERR=.1,,,.15 Sets the maximum position error for axis 1 to .
VELOCITY Trajectory Parameter ACTION: Sets or returns the path speed to be used for coordinated motion. COMMAND SYNTAX: VELOCITY = number cr VELOCITY cr REMARKS: This velocity is only used as the path speed for the Host commands LINE and ARC. EXAMPLES : VELOCITY=1.0 Sets the coordinated for linear motion to 1 unit/second. VELOCITY Returns the current velocity for host mode. WARNING Miscellaneous Command ACTION: Returns the warning number of each task.
WNDGS Motion Parameter ACTION: Enables or disable a motor drive. PROGRAM SYNTAX: WNDGS(axis)=number cr WNDGS=number1, ... ,number8 cr WNDGS(axis) cr WNDGS cr REMARKS: See Programming Command WNDGS. EXAMPLES: WNDGS(2)=1 Sets the WNDGS state to 1 on axis 2. WNDGS=0,,1 Sets the WNDGS state on axis 1 to a 0, axis 2 is unchanged and axis 3 WNDGS state is 1. WNDGS(2) Returns the winding state for axis 2. WNDGS Returns the winding state for all assigned axes.
This page left intentionally blank 202 Programming Commands
Section 8 Following Following for MX2000 version 4.
8.1 - Following Description 8.1.1.1 - Analog Following The controller has the ability to position follow numerous axes from a single master device. The following features are listed below. An analog input with a center frequency and a deviation frequency for a 10 volt input can be defined as the master source for following. Command Syntax: FOLINPUT(axis, ... ,axis) = (ANALOG (b0n) * .1 * DevFreq) + CenterFreq • • • • • • • • Flexible Follower definition. Programmable follower ratio.
can be used in conjunction with this variable as well. This expression specifies the velocity of the master source in units/seconds. 8.1.2 - Following Ratio The ratio of the follower axis to the master is specified by the FOLRATIO command. A value of 1.0 represents 100% of master. Any REAL value can be used and a negative value will be converted to its absolute value.
axis specifies the number of the following axis. 8.1.4 - Basic Following States The basic following states for all motion commands consist of a wait for trigger state, wait for distance state, Acceleration state, Constant state, Deceleration state and Done state. These states are depicted in the figure below. Basic Following States FOLACCDIST MOTIONSTATE(4) FOLSYNC MOTIONSTATE(8) FOLDCCDIST MOTIONSTATE(16) STOP FOLSTARTDIST MOTIONSTATE(2) FOLTRIG MOTIONSTATE(1) DONE MOTIONSTATE(0) 8.1.4.
Command Syntax: FOLDCCDIST(axis) = exp FOLDCCDIST = exp, … , exp FOLDCCDIST(axis, … , axis) = exp, … , exp Command Syntax: FOLSYNCDIST(axis) = exp FOLSYNCDIST = exp, … , exp FOLSYNCDIST (axis, … , axis) = exp, … , exp axis specifies the number of the following axis. axis specifies the number of the following axis. exp specifies the master travel distance in units. exp specifies the master device travel distance in units. The follower velocity starts at master velocity and ramps linearly to 0.
Command Syntax: FOLOFFSETDIST(axis) = exp FOLOFFSETDIST = exp, … , exp FOLOFFSETDIST(axis,…, axis)=exp, … , exp Command Syntax: FOLOFFSET(axis) = exp FOLOFFSET = exp1, … , exp8 FOLOFFSET(axis, … , axis) = exp, … , exp axis specifies the number of the following axis. axis specifies the number of the following axis. exp specifies the follower travel distance in units during an offset cycle. exp specifies the master device travel distance in units during an offset cycle.
8.1.6 - Following program Template 8.1.7 – Distance Measurements The following template can be used as a guideline for writing a follower program. The distance between items can be measured by using the combination of the CAPTURE, CAPPOS and DELTACAPPOS commands. These commands can be helpful when uniform spacing between items is required.
8.1.8 - Cut to length Example The cutting cycle requires that the material and cutter be in synchronization when the material is being cut and that the cutter be returned to the next cutting position. (FOLOFFSET and FOLOFFSETDIST). The FOLSYNCDIST command is used to define the material cutting distance and the FOLOFFSET, FOLOFFSETDIST for defining the next cutting position. Example: The material is to be cut in 11 units lengths.
8.1.8.1 - Cut to Length Program Example #DEFINE #DEFINE #DEFINE #DEFINE #DEFINE MASTER FOLLOWER SYNC_DIST_FLAG CUT_LENGTH IN_SYNC_DIST 1 2 32 11 1 ‘master axis number ‘follower axis number ‘wait for Sync distance ‘material cutting length ‘distance master travels in sync with follower ‘********* initialize follower parameters ************************ ABSPOS(MASTER,FOLLOWER)=0,0 ‘ set starting position to 0 PROFILE(FOLLOWER)=16 ‘ profile set to S Curve with setting of 16 FOLRATIO(FOLLOWER)=1.
8.1.9 - Rotating Knife Examples A knife located on the follower axis is synchronized with the material controlled by the master axis. The knife is located at 12 o’clock initially and its cutting area is located 36° on each side of 6 o’clock. Thus the Knife must be in synchronization with the master in the material cutting area. This system is set up such that one revolution of the master and follower axes is equivalent to 1 unit. The rotating knife axis is not allowed to reverse for safety purposes.
Rotary Knife Cycle Start of Program After Initial FOLACCDIST (1) After FOLOFFSETDIST & FOLOFFSET (3) After FOLSYNCDIST (2) After FOLDCCDIST & End of Program (4) STOP 200% FOLMAXRATIO 1 2 Advance 2 Advance 2 Advance 2 4 Master Velocity 100% Recede Recede Recede 3 3 3 0% Program Start Following for MX2000 version 4.
Example 1: Material is cut in .7 units lengths and the knife cutting area is 72° (.2 units). FOLRATIO 1 FOLSYNCDIST (72/360) = .2 FOLOFFSET .3 (1 – cut length) FOLOFFSETDIST .5 (cut length – FOLSYNCDIST) Instantaneous rate = ((.3 / .5) + 1) * 1 = 1.6 (160%) Triangular rate = (((.3 / .5) * 2)) + 1 = 2.2 (220%) FOLMAXRATIO 2 (1.6 to 2.
8.1.9.2 - Rotating Knife Program Example 1 (advance cycle) #DEFINE #DEFINE #DEFINE #DEFINE #DEFINE MASTER FOLLOWER IN_SYNC SYNC_DIST_FLAG CUT_LENGTH 1 2 8 32 .
8.1.9.3 - Rotating Knife Program Example 2 (recede cycle) #DEFINE #DEFINE #DEFINE #DEFINE #DEFINE MASTER FOLLOWER IN_SYNC SYNC_DIST_FLAG CUT_LENGTH 1 2 8 32 2.
8.1.10 - Gear Box Following Example This type of application only requires a ratio between 2 axes that must be synchronized. Program Example This example simulates a gearbox with a 5:1 reduction.
8.1.11 – Following Command Listing ACTSPD Trajectory Parameter ACTION: Returns the current commanded velocity of an axis in Units/second. PROGRAM SYNTAX: ACTSPD(axis) - used in an expression REMARK: This command can be used in conjunction with a FOLINPUT command to specify the master source. It can also be used to monitor the current commanded velocity of an axis. EXAMPLES: FOLINPUT(1,3)=ACTSPD(2) ‘Sets the current commanded velocity of axis 2 as the master velocity.
FOLINPUT Following Parameter ACTION: This command specifies the follower axes and the master velocity source. PROGRAM SYNTAX: FOLINPUT(axis, ... ,axis)= expression The axis specifies the follower axes (1-8). These axes must be assigned to the task the FOLINPUT command is used. The expression specifies the master velocity source for the follower. The expression may be an equation, variable, command or a constant.
FOLTRIG Following Parameter ACTION: Defines the follower starting trigger for motion. PROGRAM SYNTAX: FOLTRIG(axis)=expression FOLTRIG=expression1, ... , expression8 FOLTRIG(axis, ... ,axis)=expression, ... , expression FOLTRIG(axis) - used in an expression REMARKS: The axis specifies the number of the following axis (1-8). The expression specifies the starting trigger.
FOLSTARTDIST Following Parameter ACTION: Specifies a master distance that is used as a delay distance for starting motion. The distance delay starts when the specified starting trigger of FOLTRIG command occurs. PROGRAM SYNTAX: FOLSTARTDIST(axis)=expression FOLSTARTDIST=expression1, ... , expression8 FOLSTARTDIST(axis) - used in an expression FOLSTARTDIST(axis, ... .axis)=expression, ... , expression REMARKS: The axis specifies the number of the following axis (1-8).
FOLACCDIST Following Parameter ACTION: Specifies the master distance traveled for the follower to catch the master velocity after follower motion begins. PROGRAM SYNTAX: FOLACCDIST(axis)=expression FOLACCDIST=expression1, ... , expression8 FOLACCDIST(axis, ... ,axis)=expression, ... , expression FOLACCDIST(axis) - used in an expression REMARKS: The axis specifies the number of the following axis (1-8). The expression specifies the master distance to travel in Units.
FOLDCCDIST Following Parameter ACTION: Specifies the master distance traveled for the follower to attain a velocity of zero from the current velocity. PROGRAM SYNTAX: FOLDCCDIST(axis)=expression FOLDCCDIST=expression1, ... , expression8 FOLACCDIST(axis, ... ,axis)=expression, ... , expression FOLDCCDIST(axis) - used in an expression REMARKS: The axis specifies the number of the following axis (1-8). The expression specifies the master distance of travel in Units.
FOLRATIO Following Parameter ACTION: Sets the ratio of the following axis to the master. A value of 1 represents 100% of the master. PROGRAM SYNTAX: FOLRATIO(axis)=expression FOLRATIO=expression1, ... , expression8 FOLRATIO(axis, ... ,axis)=expression, ... , expression FOLRATIO(axis) - used in an expression REMARKS: The axis specifies the number of the following axis (1-8). The expression specifies the following axis ratio to the master.
FOLRATIOINC Following Parameter ACTION: Specifies the acceleration rate for a folratio change during motion in ratio increment per second. PROGRAM SYNTAX: FOLRATIOINC(axis)=expression FOLRATIOINC=expression1, ... , expression8 FOLRATIOINC(axis, ... , axis)=expression, ... , expression FOLRATIOINC(axis) - used in an expression REMARKS: The axis specifies the number of the following axis (1-8). The expression specifies the ratio acceleration rate in ratio increment per second.
FOLJOG Following Motion ACTION: Requests a Following axis jog cycle. PROGRAM SYNTAX: FOLJOG(axis)=expression FOLJOG=expression1 , ... , expression8 FOLJOG(axis, ... , axis)= expression, ... , expression REMARKS: The axis specifies the number of the following axis (1-8). The expression specifies the following axis to jog. If the expression is negative the motion will take place in the opposite direction of the master. The value of the expression is irrelevant.
FOLMOVE Following Motion ACTION: Request a Following axis move. PROGRAM SYNTAX: FOLMOVE(axis)=expression FOLMOVE=expression1 , ... , expression8 FOLMOVE(axis, ... , axis)=expression, ... ,expression REMARKS: The axis specifies the number of the following axis (1-8). The expression specifies the incremental move distance in units. If the expression is negative the motion will take place in the opposite direction of the master.
FOLMOVEREG Following Motion ACTION: Request a Following axis move registration cycle. PROGRAM SYNTAX: FOLMOVEREG(axis)=expression FOLMOVEREG=expression1 , ... , expression8 FOLMOVEREG(axis, ... , axis)=expression, ... , expression REMARKS: The expression specifies the follower distance to move after the registration trigger occurs. If the expression is negative the motion will take place in the opposite direction of the master. The axis specifies the number of the following axis (1-8).
STOP Motion Parameter ACTION: Stops any motion with a control stop. PROGRAM SYNTAX: STOP(axis) STOP=expression1 , ... , expression8 STOP(axis, ... ,axis) note: JOGSTOP can be substituted for STOP. REMARKS: The axis specifies the number of the following axis (1-8). This command will stop any motion using the DECEL value for normal motion and FOLDCCDIST for following motion. Any value for the expression will stop the designated axis. The WAITDONE, DONE or BUSY commands are related to the STOP command.
MOTIONSTATE Trajectory Parameter ACTION: Returns the motion state for an axis. PROGRAM SYNTAX: MOTIONSTATE(axis) - used in an expression. REMARKS: The motion states for a following cycle are: 0 Following cycle Done. 1 Waiting for Following Trigger. 2 Waiting for master to move FOLSTARTDIST distance. 4 Acceleration to Master Velocity in FOLACCDIST distance. 8 In Synchronization with master Velocity. 16 Decelerating to Stop in FOLDCCDIST master distance.
MOTIONSTATE continued Motion state 0 (Done) No following motion is taking place or being commanded. Motion state 1 (Wait for Trigger) A following motion has been commanded and is waiting for the specified trigger to occur. The trigger is specified by the FOLTRIG command. Motion state 2 (Waiting for Distance) Waiting for the master delay distance to be completed. This master distance traveled is specified by the FOLSTARTDIST command.
FOLMAXRATIO Following Parameter ACTION: Sets or returns the maximum allowable following axis speed during an offset advance cycle. PROGRAM SYNTAX: FOLMAXRATIO(axis)=expression FOLMAXRATIO=expression1 , ... , expression8 FOLMAXRATIO(axis, ... ,axis)=expression, ... , expression FOLMAXRATIO(axis) - used in an expression REMARKS: The expression sets the maximum speed ratio to the master. This value must be larger than the FOLRATIO of the axis. The value must be a positive number.
FOLMINRATIO Following Parameter ACTION: Sets or returns the minimum allowable following axis speed during a recede offset cycle. PROGRAM SYNTAX: FOLMINRATIO(axis)=expression FOLMINRATIO=expression1 , ... , expression8 FOLMINRATIO(axis, ... ,axis)=expression, ... , expression FOLMINRATIO(axis) - used in an expression REMARKS: The expression sets the minimum speed ratio to the master. This value must be less than the FOLRATIO of the axis and can be a negative value.
FOLOFFSET Following Parameter ACTION: Defines a following incremental offset distance from the current position. PROGRAM SYNTAX: FOLOFFSET(axis)=expression FOLOFFSET=expression1, ... , expression8 REMARKS: The expression specifies the following axis offset in units. The axis specifies the number of the following axis (1-8). Used in conjunction with FOLSYNCDIST, FOLOFFSETDIST, FOLMAXRATIO and FOLMINRATIO to advance or recede the follower axis.
FOLOFFSET continued 250% FOLSYNCDIST(axis) = 1 FOLOFFSET(axis) = 3 FOLOFFSETDIST(axis) = 4 ADVANCE CYCLE Master Velocity 100% FOLOFFSET(axis) = -3 FOLOFFSETDIST(axis) = 4 RECEDE CYCLE 0% -50% EXAMPLES: FOLOFFSET(1,3)=1,-1 advance axis 1 one unit and recede axis 3 one unit. FOLOFFSET(2)=1 advance axis 2 one unit. FOLOFFSET=1,,-1 advance axis 1 one unit and recede axis 3 one unit. Following for MX2000 version 4.
FOLOFFSETDIST Following Parameter ACTION: Sets or returns the master distance traveled for a FOLOFFSET command. PROGRAM SYNTAX: FOLOFFSETDIST(axis)=expression FOLOFFSETDIST=expression1, ... , expression8 FOLOFFSETDIST(axis, ... , axis)=expression, ... , expression FOLOFFSETDIST(axis) - used in an expression REMARKS: The axis specifies the number of the following axis (1-8). The expression specifies the master distance traveled in Units.
FOLSYNCDIST Following Parameter ACTION: Specifies the master distance to travel when a FOLOFFSET command is issued. This distance will be traveled before the FOLOFFSET command is executed. PROGRAM SYNTAX: FOLSYNCDIST(axis)=expression FOLSYNCDIST(axis)=expression1, ... , expression8 FOLSYNCDIST(axis) - used in an expression FOLSYNCDIST(axis, ... ,axis)=expression, ... ,expression REMARKS: The axis specifies the number of the following axis (1-8). The expression specifies the master distance traveled.
8.1.11 - Follower Exercise 1) Fill in the Motion states and Following Commands on the following sheet. Put the Following command letter inside the Parenthesis and the motion state number in between brackets. All of the Following commands and Motion states are used at least once. 2) Write a user program that will generate the velocity profile on the following sheet. The master axis should be stable before the follower axis is allowed to move.
t t l e t s s 8 6s 2c e l i i c 6c 2 i 4f f2 5f 1e 0o 1a 2a 4c 8n 1e 3a 6f 1f 2f 5h (C) [ ( ) ( F W W A I D W O O O C ] ) ( [ ) ] ( [ ) ] ( [ ) ] [ ] [ a) b) c) d) e) f) g) h) i) j) k) l) ( [ ] ] [ ] ( [ ) ] [ [ ] follower distance ( ) [ ] master distance ( ) enter following command letter enter Motion State Number Following Commands FOLACCDIST FOLDCCDIST FOLJOG FOLMAXRATIO FOLMINRATIO FOLOFFSET FOLOFFSETDIST FOLSTARTDIST FOLSYNC FOLSYNCDIST FOLTRIG STOP ) ] [ master di
Program answer: ‘********************* Follower will follow the Master axis speed at 100% *************************** ‘********************* Follower triggers when EVENT 1 is active ********************************** #DEFINE MASTER 2 #DEFINE FOLLOWER 1 SPEED(MASTER)=5 ‘ Master velocity is 5 units/sec ACCEL(MASTER)=50 ‘ Master acceleration is 50 units/sec2 DECEL(MASTER)=50 ‘ Master deceleration is 50 units/sec2 DRVREADY(FOLLOWER,MASTER)=1,1 ‘ drives not required to run program JOG(MASTER)=1 ‘START MASTER AXI
l l 0o t i 1 a t i 2 a l e c 4 c 8n 6 c 1e 2i 3a 4 f 6 f 2 f 1 f 5f 2f 1e 5h e t s 8 s 6s 2c (C) F W W A I D W O O O C (K) (D) [1] (H ) [2] (A ) [4] (J) [ 32 ] [ 64 ] A) B) C) D) E) F) G) H) I) J) K) L) ( [ [ 128 ] Following Commands FOLACCDIST FOLDCCDIST FOLJOG FOLMAXRATIO FOLMINRATIO FOLOFFSET FOLOFFSETDIST FOLSTARTDIST FOLSYNC FOLSYNCDIST FOLTRIG STOP [ 128 ] follower distance (F) [ 256 ] [ 64 ] master distance (G) ) enter following command letter ] enter Motion State Number (J) [ 32 ]
This page left intentionally blank 242 Following for MX2000 version 4.
Section 9 Servo Drive Servo Drive 243
9.1 - Servo Control A servo is a closed loop system. The loop is closed by taking a measurement of the actual output (usually a position or velocity) and comparing it to the desired command or reference input. Subtracting the output signal from the reference generates an error signal. The error signal tells the controller how far away the output is from the desired position. Then, a control law (algorithm) modifies this error signal to provide an output to drive a servo amplifier.
9.1.1.2 - Encoder Folder This folder defines the Servo Encoder direction and Encoder resolution. Encoder En c od er typ e En c od er d ire c tio n L ine c ou nt (line s / rev ) p uls e c ou nt (p ulse s/re v) A x is 1 q ua dra tu re n orm a l d ire c tio n 5 00 2 00 0 A x is 2 q ua dra tu re n orm a l d ire c tio n 5 00 2 00 0 Encoder type must be set to quadrature. Encoder direction determines how the encoder rotation direction is interpreted.
Velocity feed forward This term is multiplied by the commanded velocity to contribute to the output torque command. It has no effect on general stability, and may be set to as high as 100% to reduce position error during motion. Too high a Kvff causes undue motor heating. Generally, Kvff should be set between 50 and 100. Integral limit Limits the contribution of the integral term to the servo loop’s output.
Step 1: Measure Servo axis selects the servo axis. Output – volts selects the stimulus voltage for measuring system gain. The default is 2 volts. Speed – units/sec selects the target speed for measuring system gain. The default is 10 units/sec. Distance Limit – units limits the bump travel distance allowed when measuring system gain. The default is 5 units. Measure system gain commands a system gain measurement when clicked. The System Gain will be updated when the cycle is completed.
Step 1: Measure The system gain is a measure of the overall responsiveness of the system. Higher inertia and/or lower torque yields lower system gain. Lower inertia and/or higher torque yields higher system gain. The system gain number is used when the software calculates the servo gains. A lower system gain requires higher calculated controller gains in order for the motor to track a given profile response. Clicking Measure System Gain instructs the controller to provide a “bump” of torque to the motor.
_ V ie w L o g g ed D a ta Step 4A: Response Fine Tuning Integrate During Motion This feature allows you to select whether the integration gain is used during the profile motion. Enabling the integrator during motion will reduce your position error at speed, but may cause some unacceptable overshoot in the response. Some controllers allows this parameter to be set in the servo tuning screen, while others require that the change be completed in the Servo folder in the program configuration.
9.1.1.6 - Manual Tuning Adjustment _ V ie w L o g g e d D a ta L eft curso r 0.000 m s X R ig h t cu rso r 768.000 m s A xis 1 P ositio n error (un its) .09525 Most applications work acceptably using the results of the auto tuning procedure. However, if the results of the auto tuning sequence do not yield a satisfactory move response, the servo gains may be adjusted manually to achieve the required performance. Manual tuning of the servo can be quite involved.
Ki: Integral gain. The reciprocal (1/Ki) of this term is multiplied by the sum of the position error over time. The effect of Ki is thus time related, and affects the steady state error. The higher Ki, the longer it will take for the controller to “integrate out” any steady state error. The effect of Ki is seen mostly at constant speed (including standstill). Ki is NOT required for stability, and generally has a de-stabilizing effect on the system, especially if it is too low.
11) Continue lowering Kp until the overshoot is close to acceptable. 12) Now we can try to reduce the error during the motion. 13) Set Kvff to 50 and check the response. 14) If the error is not acceptable increase Kvff by 10 and check the response, repeat until the response is acceptable. 15) Now let’s try to use Ki to reduce the error at rest. 16) Set Ki to a high number, say 75 and check the move response. 17) If the response smooth out takes a long time to settle at the end, then decrease Ki by 10.
_ V iew L o g g ed D ata L eft cu rso r 0.000 m s X _ Vie w L og ged Da ta R ig h t curso r 1536.000 m s A xis 1 Po sitio n erro r (un its) L eft cu rso r 0.000 m s .0485 .1 31 Z o om Zoom S ave g rap h S ave g rap h F reez e sca le F re ez e sca le 0.0 0.0 G rap h setu p G ra p h se tu p P rin t P rin t Q uit Q u it -.0485 0.0 m s S tep 1: M ea sure S ervo axis 1 1536.00 m s S tep 2: C alcu latio n S ystem G ain 2 0.0 revs/sec /v 2.
_ V iew L o g g ed D ata L eft cu rso r 0.000 m s _ V iew L o g g ed D ata X L eft cu rso r 512.000 m s R ig h t cu rso r 768.000 m s A xis 1 Po sitio n erro r (u nits) 10.0 .318 Z o om Z o om Sa ve g rap h Sa ve g rap h F reez e scale F reez e scale 0.0 0.0 G rap h setu p G rap h setu p Prin t Prin t Q uit Q uit -10.0 -.318 0.0 m s Step 1: M easu re Se rvo axis 768.00 m s Step 3: U pd ate Step 2: C alcu lation Sy stem G ain 1 2 0.0 revs/sec /v O utp ut - vo lts 2.
9.1.2 Excessive Duty Cycle Shutdown As the servo system responds to shaft displacement due to move commands or reaction torque’s, the servo amplifier produces current to drive the motor. A feature has been added that prevents the unit from generating too much current and/or motor heating due to an excessive duty cycle situation. Here, duty cycle refers to the percentage of time that the system is required to generate a current (and therefore resultant torque) above its continuous rating.
9.2 – Servo Drive Command Listing FOLERR Motion Parameter ACTION: Sets or returns the maximum position error allowed during motion, herein referred to as "following error." COMMAND SYNTAX: FOLERR(axis)=expression FOLERR=expression1, number2, . . . , number8 FOLERR(axis, … , axis)=expression, … , expression FOLERR (axis) - Used in an expression Note: ENCFOL can be substituted for FOLERR. REMARKS: The axis specifies the number of the axis (1-8).
INTLIM Servo Parameter ACTION: Sets the Integral limit for the servo output. This is the limit of the contribution to the servo output from the integral of the position error. PROGRAM SYNTAX: INTLIM (axis)=expression INTLIM=expression1, ... , expression8 INTLIM (axis,...,axis)=expression, ... ,expression INTLIM (axis) - used in an expression REMARKS: The axis specifies the number of the axis (1-8). The setting limits the contribution of the integral term to the servo loop's output.
IXT Servo Parameter ACTION: Sets or returns the Excessive Duty Cycle Shutdown time in seconds. PROGRAM SYNTAX: IXT(axis) = expression IXT(axis, … , axis) =expression, … , expression IXT = expression, … , expression IXT(axis) - used in an expression REMARKS: The axis specifies the number of the axis (1-8). The expression specifies the time the servo peak current can be maintained. The time value is in seconds and the default value for each axis is 3 seconds.
KAFF Servo Parameter ACTION: Sets or returns the acceleration feed forward gain for a servo axis. PROGRAM SYNTAX: KAFF(axis)=expression KAFF=expression1,..., expression8 KAFF(axis,…,axis)=expression,...,expression KAFF(axis) - used in an expression REMARKS: The axis specifies the number of the axis (1-8). The expression is the acceleration feed forward gain of the servo axis. The expression value must be positive. The KAFF units are in volts/encoder count/msec2. EXAMPLES: KAFF(2)=.
KI Servo Parameter ACTION: Sets or returns the integral gain of a servo axis. PROGRAM SYNTAX: KI(axis)=expression KI=expression1, ... , expression8 KI(axis, ... ,axis)=expression, ... ,expression KI(axis) - used in an expression REMARKS: The axis specifies the number of the axis (1-8). The expression is the Integral gain value of the servo axis. The expression value must be positive. The KI units are milliseconds. KI determines how fast the integral term grows with a non-zero position error.
KP Servo Parameter ACTION: Sets or returns the proportional gain of the servo axis. PROGRAM SYNTAX: KP(axis)=expression KP=expression1, ... , expression8 KP(axis, ... ,axis)=expression, ... ,expression KP(axis) - used in an expression REMARKS: The axis specifies the number of the axis (1-8). The expression is the proportional gain value of the servo axis. The expression value must be positive. The KP units are millivolts/encoder count.
KVFF Servo Parameter ACTION: Sets or returns the velocity feed forward gain for the servo axis. PROGRAM SYNTAX: KVFF(axis)=expression KVFF=expression1, ... , expression8 KVFF(axis, ... ,axis)=expression, ... ,expression KVFF(axis) - used in an expression REMARKS: The axis specifies the number of the axis (1-8). The expression is the velocity feed forward gain value of the servo axis. The expression value must be positive. The KVFF units are percent.
STOPERR Motion Parameter ACTION: Sets or returns the maximum position error allowed when motion is stopped, referred to herein as "position error band." COMMAND SYNTAX: STOPERR(axis) =expression STOPERR=expression1, … , expression8 STOPERR(axis, … , axis)=expression, … , expression STOPERR(axis) - Used in an expression REMARKS: The axis specifies the number of the axis (1-8). The expression specifies the maximum position error allowed.
WNDGS Motion Parameter ACTION: Enables or disable a servo drive. PROGRAM SYNTAX: WNDGS(axis)=expression WNDGS=expression1, ... ,expression8 WNDGS(axis, ... , axis)=expression, ... , expression WNDGS(axis) - used in an expression REMARKS: The axis specifies the number of the axis (1-8). The expression enables or disables the specified servo drive, a zero disables the servo drive and a non-zero enables the servo drive. The WNDGS command is set to zero on power up.
Section 10 Stepper Drive Stepper Drive 265
10.1 – Stepper Features The MX2000 provides some additional stepper drive controls features. • Allows a starting speed for the stepper to be programmed. • Reducing motor heating at standstill. • Ability to increase motor current during motion. • • Configurable as an open loop or closed loop stepper drive. Position Verification and Correction capability on a closed loop stepper. The starting speed of the stepper can be controlled using the LOWSPD command. A good starting point is 1.5 revolution/second.
10.3 – Closed Loop Stepper Folder This folder sets the Steps per motor revolution, Starting speed, Motor standstill current, Motor boost current, Motor current delay, Error Action, Following error, Position error, Correction attempts and Time between attempts for a closed loop stepper drive. C lo s e d L o o p S te p p e r S tep s p er m o to r rev o lu tio n L o w s p ee d (u n its /s ec ) A x is 1 20 00 1.5 n o rm al 10 0% n o rm al 10 0% 0.0 5 A x is 2 20 00 1.
10.5 - Special Programming Notes for Closed-Loop Stepper Operation The parameters for closed loop are set in the project configuration of the user’s program. These parameters are: Encoder resolution Number of lines the encoder has. The line count times four is the equivalent of encoder pulses/ revolution. The direction for this parameter controls the quadrature detection direction value. Encoder position error (units) Allowable error at standstill before a correction is required.
10.6 - Stepper Command Listing BOOST Stepper Parameter ACTION: Enables or disables the Boost Current feature or returns the boost enable status for the specified stepper axis. When enabled the stepper drive BOOST output turns on during motion. This causes the stepper drive to boost the motor current by 50% during motion. PROGRAM SYNTAX: BOOST(axis)=expression BOOST=expression1, ... , expression8 BOOST(axis, ... , axis)=expression, ...
ENCMODE Closed Loop Stepper Parameter ACTION: Sets or returns the operating mode of a closed loop stepper axis. PROGRAM SYNTAX: ENCMODE(axis)=expression ENCMODE=expression1, ... , expression8 ENCMODE(axis, ... ,axis)=expression, expression ENCMODE(axis) - used in an expression REMARK: The axis specifies the number of the axis (1-8). The operating mode are: 0 closed loop disabled - operates open loop. 1 halt execution on excessive following error. 2 correct position on excessive following error.
FOLERR Closed Loop Stepper Parameter ACTION: Sets or returns the maximum position error allowed during motion, herein referred to as "following error." COMMAND SYNTAX: FOLERR(axis)=expression FOLERR=expression1, number2, . . . , number8 FOLERR(axis, … , axis)=expression, … , expression FOLERR (axis) - Used in an expression Note: ENCFOL can be substituted for FOLERR. REMARKS: The axis specifies the number of the axis (1-8).
REDUCE Stepper Parameter ACTION: Enables, disables the Reduce current or returns the enable status. PROGRAM SYNTAX: REDUCE(axis)=expression REDUCE=expression1, ... , expression8 REDUCE(axis, ... , axis)=expression, ... , expression REDUCE(axis) - used in an expression REMARKS: The "axis" specifies the number of the axis (1-8). When enabled, the stepper drive REDUCE output turns on when there is no motion. This causes the drive to reduce the motor current to 50%.
STOPERR Closed Loop Stepper Parameter ACTION: Sets or returns the maximum position error allowed when motion is stopped, referred to herein as "position error band." COMMAND SYNTAX: STOPERR(axis) =expression STOPERR=expression1, … , expression8 STOPERR(axis, … , axis)=expression, … , expression STOPERR(axis) - Used in an expression Note: ENCBAND can be substituted for STOPERR. REMARKS: The axis specifies the number of the axis (1-8). The expression specifies the maximum position error allowed.
WNDGS Stepper Parameter ACTION: Enables or disables a stepper motor drive, winding current controlled. PROGRAM SYNTAX: WNDGS(axis)=expression WNDGS=expression1, ... ,expression8 WNDGS(axis, ... , axis)=expression, ... , expression WNDGS(axis) - used in an expression REMARKS: The axis specifies the number of the axis (1-8). The expression specifies the state of the windings for the specified axis.
Section 11 Data Logging Data Logging for Mx2000 revision 275
11.1 - Data Logging The controller has the capability to perform data logging of eight items when the selected trigger occurs. Each logged item has 200 points. The Data Logging is accessible from the Utility menu. An MX2000 project in the PC needs to be open to perform data logging. Data logging can be triggered by either Host or program execution commanded motion. U tility T e rm in a l ... Trigger Delay selects the delay, in millisecs, after the trigger occurs and data logging begins.
Command Velocity is the commanded velocity of the axis. This waveform is in units/sec. 11.1.3 - View Data 11.1.2 - Data Transfer The individual logged parameter can be viewed by clicking on the Utility menu, Logging item and then the View Data item. After the selected motion trigger has occurred the individual logged parameter data transfer can be enabled, disabled and scaled. To select Data Transfer click on the Utility menu, Logging item and then Data Transfer item.
This page left intentionally blank 278 Data Logging for MX2000 version 4.
Section 12 DEBUG Environment Debug Environment 279
12.1 - Setting Project Debugging 12.2 - Task Debugging To set the debug mode click on the Compile menu and then on the Debug mode item. The project must be compiled and downloaded before task debugging can begin. To cancel the debugging mode selection click on the Compile menu and then the Release mode item. To complete this cancellation the project must now be compiled and downloaded.
12.2.1 - Debug program execution 12.2.4 - Watch variables A program can be executed in different ways from the Debug Environment. Single line execution of the current line can be initiated by clicking on the Step command button. The >>>>>> symbol preceding the line number indicates the line to be executed. The program can be executed to the next breakpoint encountered or end of program by clicking on the Run command button. Clicking on the Halt command button will stop a Running program.
This page left intensionally blank 282 Debug Environment
Section 13 Application Examples Application Examples 283
13.1 – Using a Joystick to teach an Arbitrary shape program 13.1.1 - MX2000 Joystick connection A joystick is easily interfaced to the MX2000 analog inputs to control two motors. This allows positioning of a device for setup, or capturing positions for an arbitrary shape prior to machining, etc. The following diagram shows the method of connecting a two axis joystick to the MX2000 controller. The analog inputs of the joystick axes must be configured as differential inputs in the user projects.
13.1.2 - Example Description The example program allows an arbitrary shape to be taught, printed or executed. Four inputs on the axis card are used to accomplish this. Axis 1 (A side) Event 1 input is assigned as the Teach input. Axis 1 (A side) Event 2 input is assigned as the Print input. Axis 2 (B side) Event 1 is assigned as the Register input. Axis 2 (B side) Event 2 input is assigned as the Execute input.
************************* EXAMPLE PROGRAM ******************************** ‘***** This example program allows a two axis arbitrary path Pattern to be taught, executed or printed. ‘***** Event 1 input, toggle switch, on axis 1 selects the Teach mode. ‘***** Event 2 input, momentary switch, on axis 1 prints the resulting program. ‘***** Event 1 input, momentary switch, on axis 2 registers the pattern points. ‘***** Event 2 input, toggle switch, executes the taught pattern.
prt_program: PRINT#2,”#DEFINE AX1 1” PRINT#2,”#DEFINE AX2 2” PRINT#2, PRINT#2,”POSMODE(AX1,AX2) = 1,1” PRINT#2,”MOVEHOME(AX1,AX2) = -1,-1” PRINT#2,”WAITDONE(AX1,AX2)” PRINT#2,”MOVE(AX1,AX2)=”;NVR(1);”,”;NVR(2) PRINT#2,”WAITDONE(AX1,AX2)” PRINT#2,”PATH=AX1,AX2” FOR X=4 TO NVR(3) STEP 2 PRINT#2,” POINT=”;NVR(X);”,”;NVR(X+1) NEXT X PRINT#2,”PATH END” PRINT#2,”END” state=1 DO GOSUB debounce_E2_1 ‘test Print switch LOOP UNTIL E2_1=0 ‘wait for Print switch to open RETURN ‘****** debounce Teach Input debounce_E1_
‘****** debounce Register Input debounce_E1_2: cnt = DCNT ‘debounce delay in msec DO IF EVENT1(AX2) = state THEN RETURN ‘return if same state ELSE cnt = cnt – 1 wait=.
teach: JOYSTICK(AX1,AX2) NVR(1)=0 NVR(2)=0 NVR(3)=4 ‘ enable 2 axis joystick ‘ default starting position ‘ default starting position ‘ default element PRINT#1,”Move to pattern starting position” PRINT#1,” and press Register button” PRINT#1,” or” PRINT#1,” open Teach Switch to exit” DO DO state=0 GOSUB debounce_E1_2 state=1 GOSUB debounce_E1_1 IF E1_1=0 THEN STOP(AX1,AX2) RETURN END IF LOOP UNTIL E1_2=1 ‘test Register button ‘test Teach input ‘disable 2 axis joystick ‘teach complete ‘wait for register swi
13.2 - Arbitrary Continuous Motion This program illustrates the simplicity of using an arbitrary continuous motion path in any application. In this application, the operator places a sheet of sponge material on a sponge cutting machine and 290 then activates a cycle start switch (IN101). The cutting blade moves to a starting position, lowers, and then cuts a predetermined shape sponge. After a sponge is cut, the blade is raised and returned to a home position.
13.2.
13.3 - Changing Velocity during motion This program illustrates changing velocity of an axis during a path motion and the velocity change is based on position. 13.3.1 – Example Program POSMODE(1,2)=1,1 SPEED(1)=10000 ACCEL(1,2)=20000,20000 MOVEHOME(1,2)=1,1 WAITDONE (1,2) PATH=1,2 FEEDRATE=0.5 LINE=10000,0 FEEDRATE=1.
13.4 -Glue application on a Gasket this point). Next the glue head is lowered (EXOUT102) and waits for .25 seconds. Then glue is applied along the pattern, which is described by the x-y coordinates of the lines, arcs, and paths in the Gluing Subroutine section of the program. Finally, the glue is turned off and the glue head is raised (EXOUT101 and 102). This program generates a complex continuous motion path for applying glue on a gasket.
‘********* Main Program *************************************** BEGIN: DO 'wait for cycle start input DO : LOOP WHILE EXIN(111)=0 GOSUB HOME 'go to home position LINE= 5,5 'offset each axis to starting position (5" from home) WAITDONE=1,1 'wait until axes 1 and 2 are in position ABSPOS = 0,0 'reset absolute position to zero GOSUB GLUE_PATH 'go to subroutine GLUE_PATH LOOP UNTIL 1=2 ‘loop indefinitely ‘******** Gluing Routine *************************************** GLUE_PATH: EXOUT(101)=1 'head down EXOUT(1
13.5 - Spring Winding Machine In this application two motors must be moved simultaneously to wind a spring. An expansion I/O board is used to provide the required inputs to the controller. The sequence of events for this application is as follows: 1) A cam will actuate a switch (EXIN(101)) to start the machine cycle 2) The wire will be fed (EXOUT(112)) 3) Delay 0.1 seconds to feed enough wire out before a clamp (EXOUT(111)), used to hold the wire in place, is turned on.
13.5.1 – Example Program ‘******************** PARAMETER SETUP **************************** WIND=145 'number of steps to wind wire AUX=20 '# of steps for auxiliary wind RECOIL=50 '# of steps to recoil BOOST=1,1 'enable boost current function ABSPOS=0,0 'set absolute position to zero ‘******************* START OF MAIN PROGRAM ********************** BEGIN: DO : LOOP UNTIL EXIN(101)=1 'wait for switch to be activated by cam WAIT=.1 'wait .
SECTION 14 TROUBLESHOOTING GUIDE Troubleshooting Guide 297
High voltages are present inside the unit. Always disconnect the power before performing any work on the unit. An electrical shock hazard exists that may cause serious injury or death if this unit is operated without its protective covers in place. 14.1 – Status Indicator Lights The status indicator lights (red LED's) on the front panel of the Controller provide an invaluable troubleshooting aid. 14.1.1 - Power Led The POWER indicator light is located on the Power Supply Card on the Controller.
SECTION 15 GLOSSARY Glossary 299
ABSOLUTE MODE - Motion mode in which all motor movements are specified in reference to an electrical home position. ABSOLUTE POSITION - A data register in the Controller which keeps track of the commanded motor position. When the value in this register is zero, the position is designated "Electrical Home". ACCELERATION - The rate at which the motor speed is increased from its present speed to a higher speed (specified in units/second/second).
DEVICE ADDRESS - A unique number used to assign which Motion Controller in a multi-drive stepper system is to respond to commands sent by a host computer or terminal. Device addresses from 1 - 9 are set by means of the ID # select switch. "0" is reserved to address all Motion Controllers in a system. Factory default is 1. DWELL - See "WAIT". ELECTRICAL HOME - The motor commanded position is zero (the Absolute Position register is zero).
NESTING - The ability of an active subroutine to call another subroutine. The Motion Controller can nest up to 16 levels. NONVOLATILE MEMORY - Data storage device that retains its contents even if power is removed. Examples are EEPROM, flash memory, and battery-backed RAM. OPTO-ISOLATION - The electrical separation of the logic section from the input/output section to achieve signal separation and to limit electrical noise.
ASCII Table Glossary ASCII Char Dec Code ASCII Char Dec Code ASCII Char Dec Code ASCII Char Dec Code Null 0 Space 32 @ 64 ` 96 SOH 1 33 A 65 a 97 STX 2 ! A 34 B 66 b 98 ETX 3 # 35 C 67 c 99 EOT 4 $ 36 D 68 d 100 ENQ 5 % 37 E 69 e 101 ACK 6 38 F 70 f 102 BELL 7 & > 39 G 71 g 103 BS 8 ( 40 H 72 h 104 HT 9 ) 41 I 73 i 105 LF 10 * 42 J 74 j 106 VT 11 + 43 K 75 k 107 FF 12 , 44 L 76 l 108 CR 13 - 45
This page left intentionally blank 304 Glossary
WARRANTY AND LIMITATION OF LIABILITY Superior Electric (the "Company"), Bristol, Connecticut, warrants to the first end user purchaser (the "purchaser") of equipment manufactured by the Company that such equipment, if new, unused and in original unopened cartons at the time of purchase, will be free from defects in material and workmanship under normal use and service for a period of one year from date of shipment from the Company's factory or a warehouse of the Company in the event that the equipment is pu
Distribution Coast-To-Coast and International Superior SLO-SYN products are available worldwide through an extensive authorized distributor network. These distributors offer literature, technical assistance and a wide range of models off the shelf for fastest possible delivery and service. In addition, Superior Electric sales engineers are conveniently located to provide prompt attention to customers' needs.