Advertisement
Advertisement
4-axis Motion Control Module User Manual (I-8094 and I-8094F) (Version 2.3) Macro Function Library in C++ for WinCon and I-8000 series PAC controllers ICPDAS 1 I-8094 Software User Manual Warranty All products manufactured by ICPDAS Inc. are warranted against defective materials for a period of one year from the date of delivery to the original purchaser. Warning ICPDAS Inc. assumes no liability for damages consequent to the use of this product. ICPDAS Inc. reserves the right to change this manual at any time without notice. The information furnished by ICPDAS Inc. is believed to be accurate and reliable. However, no responsibility is assumed by ICPDAS Inc. for its use, or for any infringements of patents or other rights of third parties resulting from its use. Copyright Copyright 1997-2005 by ICPDAS Inc., LTD. All rights reserved worldwide. Trademark The names used for identification only maybe registered trademarks of their respective companies. License The user can use, modify and backup this software on a single machine. The user may not reproduce, transfer or distribute this software, or any copy, in whole or in part. ICPDAS 2 I-8094 Software User Manual INDEX 1 PREFACE ............................................................................ 7 1.1 Introduction................................................................................................ 7 1.2 Basic and Macro functions........................................................................ 7 1.3 Funciton description .................................................................................. 8 2 BASIC SETTINGS............................................................ 10 2.1 Code numbers for axes ............................................................................ 10 2.2 Registration of Modules and getting the LIB version .......................... 10 2.3 Resetting Module ..................................................................................... 13 2.4 Pulse Output Mode Setting ..................................................................... 13 2.5 Setting the Maximum Speed ................................................................... 15 2.6 Setting the Active Level of the Hardware Limit Switches ................... 15 2.7 Setting the Motion Stop Method When Limit Switch Is Sensed ......... 17 2.8 Setting the Trigger Level of the NHOME Sensor ................................. 17 2.9 Setting Trigger Level of the Home sensor ............................................. 18 2.10 Setting and Clearing the Software Limits ........................................... 18 2.11 Setting the Encoder Related Parameters ............................................. 20 2.12 Setting the Servo Driver (ON/OFF) ..................................................... 20 2.13 Setting the SERVO ALARM Function ................................................ 22 2.14 Setting the Active Level of the In-Position Signals ............................. 22 2.15 Setting the Time Constant of the Digital Filter................................... 24 2.16 Position Counter Variable Ring............................................................ 25 2.17 Triangle prevention of fixed pulse driving .......................................... 27 2.18 External Pulse Input.............................................................................. 28 2.18.1 Handwheel (Manual Pulsar) Driving ..............................................................28 2.18.2 Fixed Pulse Driving Mode ..............................................................................30 2.18.3 Continuous Pulse Driving Mode....................................................................31 2.18.4 Disabling the External Signal Input Functions.............................................32 2.19 Configure hardware with pre-defined configuration file................... 33 3 READING AND SETTING THE REGISTERS............. 34 3.1 Setting and Reading the Command Position (LP)................................ 34 3.2 Setting and Reading the Encoder Counter............................................ 35 3.3 Reading the Current Velocity ................................................................. 36 3.4 Reading the Current Acceleration.......................................................... 36 3.5 Reading the DI Status .............................................................................. 37 3.6 Reading and Clearing the ERROR Status ............................................ 39 4 FRNET FUNCTIONS (FOR I8094F ONLY).................. 41 ICPDAS 3 I-8094 Software User Manual 4.1 Read FRnet DI Signals ............................................................................ 41 4.2 Write data to FRnet DO .......................................................................... 42 5 AUTO HOMING ............................................................... 43 5.1 Setting the Homing Speed ....................................................................... 43 5.2 Using an Limit Switch as the HOME sensor......................................... 44 5.3 Setting the Homing Mode........................................................................ 44 5.4 Starting the Homing Sequence ............................................................... 46 5.5 Waiting for the Homing sequence to be Completed ............................. 46 6 GENERAL MOTION CONTROL.................................. 47 6.1 Independent Axis Motion Control.......................................................... 47 6.1.1 Setting the Acceleration/Deceleration Mode ..................................................47 6.1.2 Setting the Start Speed.....................................................................................50 6.1.3 Setting the Desired Speed................................................................................51 6.1.4 Setting the Acceleration ...................................................................................51 6.1.5 Setting the Deceleration ...................................................................................53 6.1.6 Setting the Acceleration Rate ..........................................................................54 6.1.7 Setting the Deceleration Rate ..........................................................................55 6.1.8 Setting the Value of the Remaining Offset Pulses .........................................56 6.1.9 Fixed Pulse Output ...........................................................................................57 6.1.10 Continuous Pulse Output...............................................................................58 6.2 Interpolation Commands ........................................................................ 59 6.2.1 Assigning the Axes for Interpolation...............................................................59 6.2.2 Setting the Speed and Acc/Dec Mode for Interpolation ................................60 6.2.3 Setting the Vector Starting Speed ...................................................................66 6.2.4 Setting the Vector Speed..................................................................................66 6.2.5 Setting the Vector Acceleration .......................................................................67 6.2.6 Setting the Vector Deceleration Value.............................................................68 6.2.7 Setting the Vector Acceleration Rate ..............................................................69 6.2.8 Setting the Vector Deceleration Rate ..............................................................70 6.2.9 Setting the Number of the Remaining Offset Pulses .....................................71 6.2.10 2-Axis Linear Interpolation Motion ................................................................72 6.2.11 3-axis Linear Interpolation Motion.................................................................73 6.2.12 2-Axis Circular Interpolation Motion (an Arc)...............................................74 6.2.13 2-Axis Circular Interpolation Motion (a Complete Circle) ...........................76 6.3 Synchronous Actions................................................................................ 78 6.3.1 Setting the Synchronous Action......................................................................78 6.3.2 Setting the COMPARE value ............................................................................82 6.3.3 Get the LATCH value.........................................................................................83 6.3.4 Set the PRESET data for synchronous action................................................83 6.4 Continuous Interpolation ........................................................................ 84 6.4.1 2-Axis Rectangular Motion ...............................................................................84 6.4.2 2-Axis Continuous Linear Interpolation..........................................................86 6.4.3 3-Axis Continuous Linear Interpolation..........................................................88 ICPDAS 4 I-8094 Software User Manual 6.4.4 Mixed Linear and Circular 2-axis motions in Continuous Interpolation ......90 6.4.5 Multi-Segment Continuous Interpolation (Using Array) ................................93 6.4.6 3-Axis Helical Motion ........................................................................................95 6.4.7 2-Axis Ratio Motion...........................................................................................97 6.5 Set the Interrupt Factors......................................................................... 99 6.5.1 Set the Interrupt Factors ..................................................................................99 6.5.2 Interrupt Disabled ...........................................................................................102 6.5.3 Read the Interrupt Occurrence ......................................................................103 6.6 Other functions....................................................................................... 104 6.6.1 Holding the Driving Command ......................................................................104 6.6.2 Release the Holding Status, and Start the Driving.......................................105 6.6.3 Waiting until the Motion Is Completed ..........................................................106 6.6.4 Stopping the Axes...........................................................................................107 6.6.5 Clear the Stop Status ...................................................................................... 111 6.6.6 End of Interpolation ........................................................................................ 111 APPENDIX A (I-8094 BASIC FUNCTIONS) ................. 112 A.1 i8094 Command Set .............................................................................. 112 A.2 Pulse Output Command ....................................................................... 113 A.2.1 Signal Types....................................................................................................113 A.2.2 Fixed Pulse Driving ........................................................................................115 A.2.3 Changing Output Pulse Numbers in Driving ...............................................115 A.2.4 Offset Setting for Acceleration/Deceleration Driving.................................. 115 A.2.5 Continuous Drive Pulse Output ....................................................................117 A.2.6 Constant Speed Driving .................................................................................118 A.3 Profile Acceleration/Deceleration Planning........................................ 119 A.3.1 Trapezoidal Driving [Symmetric]................................................................... 119 A.3.2 Trapezoidal Driving [Asymmetric] ................................................................121 A.3.3 Triangle Prevention ........................................................................................123 A.3.4 S-curve Acceleration / Deceleration [Symmetry].........................................124 A.3.5 S-curve Acceleration / Deceleration [Asymmetry] ......................................128 A.4 Pulse Output Commands ..................................................................... 129 A.4.1 2/3 Axes Interpolation ....................................................................................129 A.4.2 Circular Interpolation .....................................................................................130 A.4.3 Bit Pattern Interpolation.................................................................................133 A.4.4 Continuous Interpolation...............................................................................135 A.5 Automatic Home Search....................................................................... 137 A.5.1 Step 1: High-Speed Near Home Search........................................................139 A.5.2 Step 2: Low-Speed Home Search..................................................................140 A.5.3 Step 3: Low-Speed Z-phase Search..............................................................141 A.5.4 Step 4: High-Speed Offset Drive ...................................................................142 A.6 Synchronous Action .............................................................................. 143 A.7 I-8094 Function Library....................................................................... 147 A.7.1 Register management functions...................................................................147 A.7.2 Functions for Initial Setting ...........................................................................154 A.7.3 Motion Status Management Functions.........................................................160 ICPDAS 5 I-8094 Software User Manual A.7.4 Basic Motion Command Functions ..............................................................167 A.7.5 Interpolation Functions..................................................................................179 A.7.6 Automatic Home Search ................................................................................196 A.7.7 Synchronous Action.......................................................................................208 A.7.8 I/O Signal Managements ................................................................................215 A.7.9 FRnet Related Functions ...............................................................................224 A.8 i8094 Command Lists ........................................................................... 226 A.8.1 Data Setting Commands ................................................................................226 A.8.2 Data Reading Commands ..............................................................................226 A.8.3 Driving Commands.........................................................................................227 A.8.4 Interpolation Commands ...............................................................................227 A.8.5 Other commands ............................................................................................227 APPENDIX B: MCX314AS REGISTERS....................... 228 B.1 Command Register: WR0 .................................................................... 228 B.2 Mode Register1: WR1........................................................................... 229 B.3 Mode Register2: WR2........................................................................... 230 B.4 Mode Register3: WR3........................................................................... 232 B.5 Output Register: WR4 .......................................................................... 234 B.6 Interpolation Mode Register: WR5..................................................... 234 B.7 WR6/WR7 Register............................................................................... 236 B.8 Main Status Register: RR0................................................................... 236 B.9 Status Register 1: RR1 .......................................................................... 238 B.10 Status Register 2: RR2 ........................................................................ 240 B.11 Status Register 3: RR3 ........................................................................ 241 B.12 Input Register: RR4 / RR5 ................................................................. 242 B.13 Data-Read Register: RR6 / RR7 ........................................................ 242 ICPDAS 6 I-8094 Software User Manual 1 Preface 1.1 Introduction This manual provides complete and detailed description of i8094 functions for users to develop programs for their control of automatic equipments. Many examples are included in this manual for reference to write efficient application programs. This manual includes six chapters and two appendices. This chapter gives a brief description of this manual. Chapter 2 to 6 is the explanations of macro functions (MF). Appendices A and B are the descriptions of basic functions (BF) and the registers of MCX314As, respectively. The functions defined in DLL file are explained here. This DLL can be used on different developing software platforms, such as eVC++, VB.net, and C#.net, and different OS systems ( MiniOS7 / WinCE / Linux). 1.2 Basic and Macro functions Basic functions are suitable for those who are familiar with the MCX314As motion chip. These functions can directly read/write the registers of motion chip. However, users need to know more details about this motion chip. Macro functions provide a set of much easy-to-use functions that simplify the programming for users. Some necessary settings, such as speed range and deceleration point, are calculated inside those functions to ease the loading of users on having to understand the motion chip. Some useful costumed functions are provided for users to develop applications efficiently. If possible, do not mix these two groups of functions together. Some internal parameters may be changed beyond users'consideration. ICPDAS 7 I-8094 Software User Manual 1.3 Funciton description All functions are listed in following form: Function_name (parameter1, parameter2, …) Description: Explanation of this function. Parameters: Definitions of the parameters and how to use them. Return: The return value of this function. Example: Simple example program in C++. Remark: Comments. ICPDAS 8 I-8094 Software User Manual ICPDAS 9 I-8094 Software User Manual 2 Basic Settings 2.1 Code numbers for axes The axis assignments follow the definitions listed below: X=1, Y=2, Z=4, and U=8. If X and Y axes are assigned simultaneously, then the code number is 3. In a similar way, AXIS_YZ = 2+4 =0x6; and AXIS_XYZU = 1+2+4+8 = 0xf. An assignment for either single axis or multiple axes at the same time is possible. Available axis code numbers are listed below. The type of the axis argument used in the functions is defined as WORD. Table 2-1 Axis assignments and their corresponding codes Axis X Y Z U XY XZ XU YZ Code 0x1 0x2 0x4 0x8 0x3 0x5 0x9 0x6 Name AXIS_X AXIS_Y AXIS_Z AXIS_U AXIS_XY AXIS_XZ AXIS_XU AXIS_YZ Axis YU ZU XYZ XYU XZU YZU XYZU Code 0xa 0xc 0x7 0xb 0xd 0xe 0xf Name AXIS_YU AXIS_ZU AXIS_XYZ AXIS_XYU AXIS_XZU AXIS_YZU AXIS_XYZU 2.2 Registration of Modules and getting the LIB version BYTE i8094MF_REGISTRATION(BYTE cardNo, BYTE slot) Description: This function registers a module that is installed in slot number, slot, by assigning a card number. Registration must be performed for each I-8094 motion control module before other functions are called. After registration, each module can be identified by its corresponding module number. Parameters: cardNo: slot: Module number Slot number for I-8000: 0~7 for WinCon-8000: 1~7 Return: YES NO ICPDAS Normal Abnormal 10 I-8094 Software User Manual Example: //================= for WinCon-8000 ================== //set each module number the same as the slot number, respectively. //(slot1 ~ slot7) BYTE cardNo; BYTE slot; int Found = 0; for (slot = 1; slot < 8; slot++) { cardNo = slot; if (i8094MF_REGISTRATION(cardNo, slot) == YES) { //slot number begins from 1. //if a module is found, then it is registered as its slot number. i8094MF_RESET_CARD(cardNo); Found++; } } if (Found == 0) { //if Wincon cannot find any I-8094 module, //please add codes to handle the exception here. return; } //=================== for I-8000 =================== //set the module number the same as the slot number, respectively. //(slot1 ~ slot7) BYTE cardNo; BYTE slot; int Found = 0; for (slot = 0; slot < 8; slot++) { cardNo = slot + 1; //slot number begins from 0, but module number begin from 1. if (i8094MF_REGISTRATION(cardNo, slot) == YES) { //if a module is found, then it is registered by giving a number. i8094MF_RESET_CARD(cardNo); Found++; } } if (Found == 0) { //if Wincon cannot find any I-8094 module, //please add codes to handle the exception here. return; ICPDAS 11 I-8094 Software User Manual } WORD i8094MF_GET_VERSION(void) Description: Read the version of current i8094 library. Parameters: cardNo: Module number Return: Version code: including information of the year and the month: 0x0000 ~ 0x9999 Example: WORD VER_No; VER_No = i8094MF_GET_VERSION(); //Read the version code of i8094.dll Remark: If the return value is 0x0607 06 : the year is 2006 07: the month is July. ICPDAS 12 I-8094 Software User Manual 2.3 Resetting Module void i8094MF_RESET_CARD(BYTE cardNo) Description: This function resets module using a software command. Parameters: cardNo: Module number Return: None Example: i8094MF_RESET_CARD(1); //Reset module 1. 2.4 Pulse Output Mode Setting void i8094MF_SET_PULSE_MODE(BYTE cardNo, WORD axis, BYTE nMode) Description: This function sets the pulse output mode as either CW/CCW or PULSE/DIR for the assigned axes and their direction definition. Parameters: cardNo: axis: nMode: Module number Axis or axes (Please refer to Table 2-1) Assigned mode (Please refer to Table 2-2) Return: None ICPDAS 13 I-8094 Software User Manual Example: i8094_SET_PULSE_MODE(1, AXIS_XYZ, 2); //set the pulse mode of X, Y, and Z axes as mode 2 i8094_SET_PULSE_MODE(1, AXIS_U, 3); //set the pulse mode of U axis as mode 3 Table 2-2 A List of pulse output modes mode CW / CCW PULSE / DIR ICPDAS Pulse output signals nPP nPM 0 CW (rising edge) CCW (rising edge) 1 CW (falling edge) CCW (falling edge) 2 PULSE (rising edge) 3 PULSE (falling edge) 4 PULSE (rising edge) 5 PULSE (falling edge) 14 DIR (LOW:+dir/ HIGH:-dir) DIR (LOW:+dir/ HIGH:-dir) DIR (HIGH:+dir/ LOW:-dir) DIR (HIGH:+dir/ LOW:-dir) I-8094 Software User Manual 2.5 Setting the Maximum Speed void i8094MF_SET_MAX_V(BYTE cardNo, WORD axis, DWORD data) Description: This function sets the maximum rate for the output pulses (speed). A larger value will cause a rougher resolution. For example, when the maximum speed is set as 8000 PPS, the resolution is 1 PPS; when the maximum speed is set as 16000 PPS, the resolution is 2 PPS; when maximum speed is set as 80000 PPS, the resolution is 10 PPS, etc. The maximum value is 4,000,000 PPS, which means the resolution of speed will be 500 PPS. This function change the resolution of speed to reach the desired maximum speed. Since the scale in hardware is changed, other parameters will be influenced too, such as the starting speed, the acceleration, and the jerk. It is recommended to set the maximum speed value as a integral multiplier of 8000. Parameters: cardNo: axis: data: Module number Axis or axes (Please refer to Table 2-1) The assigned maximum speed of each axis when the controller performs an interpolation motion. However, setting the value of axis 1 is enough. For axis 1, the maximum value is 4,000,000 PPS. Return: None Example: i8094MF_SET_MAX_V(1, AXIS_XY, 200000L); //The maximum speed for the X and Y axes of module 1 is 200KPPS. //The resolution of the speed will be 200000/8000 = 25 PPS. 2.6 Setting the Active Level of the Hardware Limit Switches void i8094MF_SET_HLMT(BYTE cardNo, WORD axis, BYTE nFLEdge, BYTE nRLEdge) Description: This function sets the active logic level of the hardware limit switch inputs. Parameters: cardNo: axis: ICPDAS Module number Axis or axes (Please refer to Table 2-1) 15 I-8094 Software User Manual nFLEdge: nRLEdge: Active level setting for the forward limit switch. 0 = low active; 1 = high active Active level setting for the reverse limit switch. 0 = low active; 1 = high active Return: None Example: i8094MF_SET_HLMT(1, AXIS_XYZU, 0, 0); //set all the trigger levels as low-active for all limit switches //on module 1. ICPDAS 16 I-8094 Software User Manual 2.7 Setting the Motion Stop Method When Limit Switch Is Sensed void i8094MF_LIMITSTOP_MODE (BYTE cardNo, WORD axis, BYTE nMode) Description: This function sets the motion stop mode of the axes when the corresponding limit switches are detected. Parameters: cardNo: axis: nMode: Module number Axis or axes (Please refer to Table 2-1) 0: stop immediately; 1: decelerating to stop Return: None Example: i8094MF_LIMITSTOP_MODE(1, AXIS_X, 0); //set X axis to stop immediately if any limit switch on X axis is triggered. 2.8 Setting the Trigger Level of the NHOME Sensor void i8094MF_SET_NHOME(BYTE cardNo, WORD axis, BYTE nNHEdge) Description: This function sets the trigger level of the near home sensor (NHOME). Parameters: cardNo: axis: nNHEdge: Module number Axis or axes (Please refer to Table 2-1) Active level setting for the near home sensor. 0 = low active; 1 = high active Return: None Example: i8094MF_SET_NHOME(1, AXIS_XY, 0); //set the trigger level of NHOME of X and Y axes on module 1 to be active low. ICPDAS 17 I-8094 Software User Manual 2.9 Setting Trigger Level of the Home sensor void i8094MF_SET_HOME_EDGE(BYTE cardNo, WORD axis, BYTE nHEdge) Description: This function sets the trigger level of the home sensor (HOME). Parameters: cardNo: axis: nHEdge: Module number Axis or axes (Please refer to Table 2-1) Active level setting for the home sensor. 0 = low active; 1 = high active Return: None Example: i8094MF_SET_HOME_EDGE(1, AXIS_XYZU, 1); //set the trigger level as high active for all home sensors on module 1. 2.10 Setting and Clearing the Software Limits void i8094MF_SET_SLMT(BYTE cardNo, WORD axis, long dwFL, long dwRL, BYTE nType) Description: This function sets the software limits. Parameters: cardNo: axis: dwFL: dwRL: nType: Module number Axis or axes (Please refer to Table 2-1) Value of the forward software limit (-2,147,483,648 ~ +2,147,483,647) Value of the reverse software limit (-2,147,483,648 ~ +2,147,483,647) Position counter to be compared: 0 = logical position counter (LP), i.e., the command position 1 = encoder position counter (EP), i.e., the real position Return: None ICPDAS 18 I-8094 Software User Manual Example: i8094MF_SET_SLMT(1, AXIS_XYZU, 20000, -3000, 0); //set the forward software limit as 20000 and the reverse //software limit as -3000 for all axes on module 1. void i8094MF_CLEAR_SLMT(BYTE cardNo, WORD axis) Description: This function clears the software limits. Parameters: cardNo: axis: Module number Axis or axes (Please refer to Table 2-1) Return: None Example: i8094MF_CLEAR_SLMT(1, AXIS_XYZU); //clear the software limits for all axes on module 1. ICPDAS 19 I-8094 Software User Manual 2.11 Setting the Encoder Related Parameters void i8094MF_SET_ENCODER(BYTE cardNo, WORD axis, BYTE nMode, BYTE nDivision, BYTE nZEdge) Description: This function sets the encoder input related parameters. Parameters: cardNo: axis: nMode: nDivision: nZEdge: Module number Axis or axes (Please refer to Table 2-1) Encoder input type: 0 = A quad B; 1 = up/down Division setting for A quad B input signals: 0 = 1/1 1 = 1/2 2 = 1/4 Sets the trigger level for the Z phase 0 = low active; 1 = high active Return: None Example: i8094MF_SET_ENCODER(1, AXIS_XYZU, 0, 0, 0); //set the encoder input type as A quad B; the division is 1; //and the Z phase is low active. 2.12 Setting the Servo Driver (ON/OFF) void i8094_SERVO_ON(BYTE cardNo, WORD axis) Description: This function outputs a DO signal (ENABLE) to enable the motor driver. Parameters: cardNo: axis: Module number Axis or axes (Please refer to Table 2-1) Return: None Example: i8094_SERVO_ON(1, AXIS_XYZU); ICPDAS 20 I-8094 Software User Manual //enables all drivers on module 1. void i8094_SERVO_OFF(BYTE cardNo, WORD axis) Description: This function outputs a DO signal (ENABLE) to disable the motor driver. Parameters: cardNo: axis: Module number Axis or axes (Please refer to Table 2-1) Return: None Example: i8094_SERVO_OFF(1, AXIS_XYZU); //disables all drivers on module 1. ICPDAS 21 I-8094 Software User Manual 2.13 Setting the SERVO ALARM Function void i8094MF_SET_ALARM(BYTE cardNo, WORD axis, BYTE nMode, BYTE nAEdge) Description: This function sets the ALARM input signal related parameters. Parameters: cardNo: axis: nMode: nAEdge: Module number Axis or axes (Please refer to Table 2-1) Mode: 0 = disable ALARM function; 1 = enable ALARM function Sets the trigger level 0 = low active; 1 = high active Return: None Example: i8094MF_SET_ALARM(1, AXIS_ZU, 1, 0); //enable the ALARM for the Z and U axes on module 1 and set them //as low-active. 2.14 Setting the Active Level of the In-Position Signals void i8094MF_SET_INPOS(BYTE cardNo, WORD axis, BYTE nMode, BYTE nIEdge) Description: This function sets the INPOS input signal related parameters. Note: Sometimes, this signal is used to connect the SERVO READY input signal. Users should take care of what signal the daughter board is wired. Parameters: cardNo: ICPDAS Module number 22 I-8094 Software User Manual axis: nMode: nlEdge: Axis or axes (Please refer to Table 2-1) Mode: 0 = disable INPOS input; 1 = enable INPOS input Set the trigger level 0 = low active; 1 = high active Return: None Example: i8094MF_SET_INPOS(1, AXIS_X, 1, 0); //enable the INPOS function of the X axis on module 1 and set it to be low-active. Note: ICPDAS Please refer to the example shown in Fig. 2.12 for wiring of the general DI input. 23 I-8094 Software User Manual 2.15 Setting the Time Constant of the Digital Filter void i8094MF_SET_FILTER(BYTE cardNo, WORD axis, WORD FEn, WORD FLn) Description: This function selects the axes and sets the time constant for digital filters of the input signals. Parameters: cardNo: axis: FEn: Module number Axis or axes (Please refer to Table 2-1) Enabled filters. The sum of the code numbers (0~31) are used to select input signals. Please refer to the following table. Code number 1 2 4 8 16 FLn: Enabling filters EMG, nLMTP, nLMTM, nIN0, nIN1 nIN2 nINPOS, nALARM nEXPP, nEXPM, EXPLSN nIN3 Sets the filter time constant (0~7) as follows. Code Removable max. noise width Input signal delay time 0 1.75 μ SEC 2 μ SEC 1 224 μ SEC 256 μ SEC 2 448 μ SEC 512 μ SEC 3 896 μ SEC 1.024mSEC 4 1.792mSEC 2.048mSEC 5 3.584mSEC 4.096mSEC 6 7.168mSEC 8.192mSEC 7 14.336mSEC 16.384mSEC Return: None Example: i8094MF_SET_FILTER(1, AXIS_XYZU, 21, 3); //set the filter time constants of X, Y, Z, and U axes as 1.024mSEC. //These filters include EMG, nLMTP, nLMTM, nIN0, nIN1, nINPOS, nALARM, //and nIN3. //(21 = 1+4+16) 1: EMG + nLMP + nLMPM + nIN0 + nIN1; // 4: nINPOS + nALARM; // 16: nIN3. Note: ICPDAS The default wiring design is: nIN0 is connected to the NEAR HOME (NHOME) sensors; nIN1 is connected to the HOME sensors; and nIN2 is connected to the index of Encoder input (Z phase). 24 I-8094 Software User Manual 2.16 Position Counter Variable Ring void i8094MF_VRING_ENABLE(BYTE cardNo, WORD axis, DWORD nVRing) Description: This function enables the linear counter of the assigned axes as variable ring counters. Parameters: cardNo: axis: nVRing: Module number Axis or axes (Please refer to Table 2-1) Maximum value of the ring counter (-2,147,483,648 ~ +2,147,483,647) Return: None Example: i8094MF_ VRING_ENABLE(1, AXIS_X, 9999); //set the X axis of module 1 to be a ring counter. The encoder //values will be 0 to 9999. The encoder value is 0 to 9999. When the counter value reach 9999, an adding pulse will cause the counter to reset to 0. When the counter value is 0, a lessening pulse will let the counter set to 9999. Max. ring encoder value = 9999 Note: ICPDAS 1. This function will set the LP and EP simultaneously. 2. If this function is enabled, the software limit function cannot be used. 25 I-8094 Software User Manual void i8094MF_VRING_DISABLE(BYTE cardNo, WORD axis) Description: This function disables the variable ring counter function. Parameters: cardNo: axis: Module number Axis or axes (Please refer to Table 2-1) Return: None Example: i8094MF_ VRING_DISABLE(1, AXIS_X); //disable the ring counter function for the X axis //on module 1. ICPDAS 26 I-8094 Software User Manual 2.17 Triangle prevention of fixed pulse driving void i8094MF_AVTRI_ENABLE (BYTE cardNo, WORD axis) Description: This function prevents a triangle form in linear acceleration (T-curve) fixed pulse driving even if the number of output pulses is low. Parameters: cardNo: axis: Module number Axis or axes (Please refer to Table 2-1) Return: None Example: i8094MF_ AVTRI_ENABLE(1, AXIS_X); //set the X axis of module 1 not to generate a triangle form in its speed profile. void i8094MF_AVTRI_DISABLE (BYTE cardNo, WORD axis) Description: This function disable the function that prevents a triangle form in linear acceleration fixed pulse driving. Parameters: cardNo: axis: Module number Axis or axes (Please refer to Table 2-1) Return: None Example: i8094MF_ AVTRI_DISABLE(1, AXIS_X); //enable the X axis of module 1 to generate a triangle form in its //speed profile if the pulse number for output is too low. ICPDAS 27 I-8094 Software User Manual 2.18 External Pulse Input 2.18.1 Handwheel (Manual Pulsar) Driving void i8094MF_EXD_MP(BYTE cardNo, WORD axis, long data) Description: This function outputs pulses according to the input pulses from a handwheel. Parameters: cardNo: axis: data: Module number Axis or axes (Please refer to Table 2-1.) The axis can be either X, Y, Z, or U. Gain (a multiplier) Return: None Example: i8094MF_EXD_MP(1, AXIS_X, 1); //Each time the handwheel inputs a pulse to the X axis //on module 1, the controller will output 1 pulses to the motor driver. ICPDAS 28 I-8094 Software User Manual i8094MF_EXD_MP(1, AXIS_X, 2); //Each time the handwheel inputs a pulse to the X axis //on module 1, the controller will output 2 pulses to the motor driver. ICPDAS 29 I-8094 Software User Manual 2.18.2 Fixed Pulse Driving Mode void i8094MF_EXD_FP(BYTE cardNo, WORD axis, long data) Description: This function outputs fixed pulses according to the trigger input (the falling edge of the nEXP+ signal) from a handwheel. Parameters: cardNo: axis: data: Module number Axis or axes (Please refer to Table 2-1.) The axis can be either X, Y, Z, or U. Number of fixed pulses. Return: None Example: i8094MF_EXD_FP(1, AXIS_X, 5); //Each time the controller detects a falling edge of an XEXP+ //signal, it will output 5 pulses to the X axis. Example of fixed pulse driving using an external signal ICPDAS 30 I-8094 Software User Manual 2.18.3 Continuous Pulse Driving Mode void i8094MF_EXD_CP(BYTE cardNo, WORD axis, long data) Description: The controller will continuously output pulses in positive direction if the falling edge of nEXP+ signal from a handwheel is detected. Conversely, it will continuously output pulses in negative direction if the falling edge of nEXP- signal is detected. Parameters: cardNo: axis: data: Module number Axis or axes (Please refer to Table 2-1.) The axis can be either X, Y, Z, or U. Pulse output speed in PPS Return: None Example: i8094MF_EXD_CP(1, AXIS_X, 20); //Each time the controller detects a falling edge of an XEXP+ //signal, it will continuously drive X axis at the speed of 20 PPS. Continuous driving using an external signal ICPDAS 31 I-8094 Software User Manual 2.18.4 Disabling the External Signal Input Functions void i8094MF_EXD_DISABLE(BYTE cardNo, WORD axis) Description: This function turns off the external input driving control functions. Parameters: cardNo: axis: Module number Axis or axes (Please refer to Table 2-1.) The axis can be either X, Y, Z, or U. Return: None Example: i8094MF_EXD_DISABLE(1, AXIS_X); //disable the external input driving control function //of X axis on module 1 ICPDAS 32 I-8094 Software User Manual 2.19 Configure hardware with pre-defined configuration file short i8094MF_ LOAD_CONFIG (BYTE cardNo) Description: This function loads the pre-defined configuration file and set the target I8094 module automatically. The configuration file is generated by the PACEzGo. Parameters: cardNo: Module number Return: 0: successfully -1: cannot open the pre-defined configuration file. Example: i8094MF_ LOAD_CONFIG (1); //load the configuration file and configure the module 1. ICPDAS 33 I-8094 Software User Manual 3 Reading and Setting the Registers 3.1 Setting and Reading the Command Position (LP) void i8094MF_SET_LP(BYTE cardNo, WORD axis, long wdata) Description: This function sets the command position counter value (logical position counter, LP). Parameters: cardNo: axis: wdata: Module number Axis or axes (Please refer to Table 2-1) Position command (-2,147,483,648 ~ +2,147,483,647) Return: None Example: i8094MF_SET_LP(1, AXIS_XYZU, 0); //Set the LP for the X, Y, Z, and U axes of module 1 as 0, //which means that all LP counters on module 1 will be cleared. long i8094MF_GET_LP(BYTE cardNo, WORD axis) Description: This function reads the command position counter value (logical position counter, LP). Parameters: cardNo: axis: Module number Axis (Please refer to Table 2-1) The axis can be either X, Y, Z, or U. Return: The current LP value (-2,147,483,648 ~ +2,147,483,647) Example: long X_LP; X_LP = i8094MF_GET_LP(1, AXIS_X); //Reads the LP value of the X axis on module 1. ICPDAS 34 I-8094 Software User Manual 3.2 Setting and Reading the Encoder Counter void i8094MF_SET_EP(BYTE cardNo, WORD axis, long wdata) Description: This function sets the encoder position counter value (real position counter, or EP). Parameters: cardNo: axis: wdata: Module number Axis or axes (Please refer to Table 2-1) Position command (-2,147,483,648 ~ +2,147,483,647) Return: None Example: i8094MF_SET_EP(1, AXIS_XYZU, 0); //Set the EP for the X, Y, Z, and U axes of module 1 as 0. //This command clears all EP counters on module 1. long i8094MF_GET_EP(BYTE cardNo, WORD axis) Description: This function reads the encoder position counter value (EP). Parameters: cardNo: axis: Module number Axis (Please refer to Table 2-1) The axis can be either X, Y, Z, or U. Return: Current EP value (-2,147,483,648 ~ +2,147,483,647) Example: long X_EP; X_EP = i8094MF_GET_EP(1, AXIS_X); //reads the encoder value (EP) of the X axis on module 1. ICPDAS 35 I-8094 Software User Manual 3.3 Reading the Current Velocity DWORD i8094MF_GET_CV(BYTE cardNo, WORD axis) Description: This function reads the current velocity value. Parameters: cardNo: axis: Module number Axis (Please refer to Table 2-1) The axis can be either X, Y, Z, or U. Return: Current speed (in PPS) Example: DWORD dwdata; dwdata = i8094MF_GET_CV(1, AXIS_X); //reads the current velocity of the X axis on module 1. 3.4 Reading the Current Acceleration DWORD i8094MF_GET_CA(BYTE cardNo, WORD axis) Description: This function reads the current acceleration value. Parameters: cardNo: axis: Module number Axis (Please refer to Table 2-1) The axis can be either X, Y, Z, or U. Return: Current acceleration (in PPS/Sec) Example: DWORD dwdata; dwdata = i8094MF_GET_CA(1, AXIS_X); //reads the current acceleration value of the X axis on module 1. ICPDAS 36 I-8094 Software User Manual 3.5 Reading the DI Status BYTE i8094MF_GET_DI(BYTE cardNo, WORD axis, WORD nType) Description: This function reads the digital input (DI) status. Parameters: cardNo: axis: nType: 0 1 2 3 4 5 6 7 8 9 Module number Axis (Please refer to Table 2-1) The axis can be either X, Y, Z, or U. DRIVING LIMIT+ LIMITEMERGENCY ALARM HOME NHOME IN3 INPOS INDEX (Check whether the axis is driving or not.) (Check whether the limit+ is engaged or not.) (Check whether the limit- is engaged or not.) (Check whether EMG signal is on or not.) (Check the ALARM input signal.) (Check the HOME input signal) (Check the Near HOME input signal) (Check the IN3 input signal) (Check the INPOS input signal) (Check the encoder Z-phase input signal) Return: YES: NO: on off Example: if (i8094MF_GET_DI(1, AXIS_X, 1) == YES) { //get the status of limit+ sensor of X axis on module 1 } ICPDAS 37 I-8094 Software User Manual BYTE i8094MF_GET_DI_ALL(BYTE cardNo, WORD axis) Description: This function reads the digital input (DI) status. Parameters: cardNo: axis: Module number Axis (Please refer to Table 2-1) The axis can be either X, Y, Z, or U. Return: 0x0001 0x0002 0x0004 0x0008 0x0010 0x0020 0x0040 0x0080 0x0100 0x0200 DRIVING LIMIT+ LIMITEMERGENCY ALARM HOME NHOME IN3 INPOS INDEX (Check whether the axis is driving or not.) (Check whether the limit+ is engaged or not.) (Check whether the limit- is engaged or not.) (Check whether EMG signal is on or not.) (Check the ALARM input signal.) (Check the HOME input signal) (Check the Near HOME input signal) (Check the IN3 input signal) (Check the INPOS input signal) (Check the encoder Z-phase input signal) Example: WORD wStatus; i8094MF_GET_DI_ALL(1, AXIS_X & wStatus); if ( (wStatus & 0x002) == 0x002 ) { //get the status of limit+ sensor of X axis on module 1 } ICPDAS 38 I-8094 Software User Manual 3.6 Reading and Clearing the ERROR Status BYTE i8094MF_GET_ERROR(BYTE cardNo) Description: This function checks whether an error occurs or not. Parameters: cardNo: Module number Return: YES: NO: Some errors happened. Please use i8094MF_GET_ERROR_CODE () to get more information. If GET_ERROR_CODE =256, it means that the motion stop was due to the “STOP” command, not because an error happened. Please refer to 6.5.5 and following example to clear ERROR. No error. EXAMPLE: If (i8094MF_GET_ERROR(1) == YES) { //read module 1 and ERROR is found WORD ErrorCode_X = i8094MF_GET_ERROR_CODE(1, AXIS_X); WORD ErrorCode_Y = i8094MF_GET_ERROR_CODE(1, AXIS_Y); WORD ErrorCode_Z = i8094MF_GET_ERROR_CODE(1, AXIS_Z); WORD ErrorCode_U = i8094MF_GET_ERROR_CODE(1, AXIS_U); if ((ErrorCode_X || ErrorCode_Y || ErrorCode_Z || ErrorCode_U) == 256) { //It means that motion was stopped due to the stop command was issued, not because any error happened. Please take some actions to clear the malfunction; then clear the STOP status. i8094MF_CLEAR_STOP(1); } } ICPDAS 39 I-8094 Software User Manual WORD i8094MF_GET_ERROR_CODE(BYTE cardNo, WORD axis) Description: This function reads the ERROR status. Parameters: cardNo: axis: Module number Axis (Please refer to Table 2-1) The axis can be either X, Y, Z, or U. Return: 0 no error For non-zero return values, please refer to the following table. If there are not only one errors, the return value becomes the sum of these error code values. For example, a return code 48 means that ALARM and EMGERENCY occurs at the same time. Error Code Cause of stop 1 SOFT LIMIT+ 2 SOFT LIMIT4 LIMIT+ 8 LIMIT16 ALARM Explanation Occurs when the forward software limit is asserted Occurs when the reverse software limit is asserted Occurs when the forward hardware limit is asserted Occurs when the reverse hardware limit is asserted Occurs when the ALARM is asserted 32 EMERGENCY Occurs when the EMG is asserted 64 Reserved Reserved 128 HOME Occurs when both Z phase and HOME are asserted 256 refer to 6.5.4 Occurs when the EMG(software) is asserted Example: if (i8094MF_GET_ ERROR_CODE(1, AXIS_X) & 10 ) { //Check if either the software limit or hardware limit (2+8) //in the reverse direction is asserted. } ICPDAS 40 I-8094 Software User Manual 4 FRnet Functions (for i8094F only) 4.1 Read FRnet DI Signals WORD i8094MF_FRNET_IN(BYTE cardNo, WORD wRA) Description: This function reads the FRnet digital input signals. RA means the Receiving Address which can be one of the legal group number of FRnet. One group comprises 16 bits data. Therefore, total 128 DI can be defined for one FRnet interface. Parameters: cardNo: wRA: Module number Group number, range 8~15 Note: 0~7 are used for digital outputs Return: WORD 16-bit DI data. Example: WORD IN_Data; IN_Data = i8094MF_FRNET_IN(1, 8); //Read the 16-bit DI which is on module 1 and the group number is 8. ICPDAS 41 I-8094 Software User Manual 4.2 Write data to FRnet DO void i8094MF_FRNET_OUT(BYTE cardNo, WORD wSA, WORD data) Description: This function write data to the FRnet digital output. SA means the Sending Address which can be one of the legal group number of FRnet. One group comprises 16 bits data. Therefore, total 128 DO can be defined for one FRnet interface. Parameters: cardNo: wSA: data: Module number Group number, range 0~7 Note: 8~15 are used by digital inputs 16-bit data Return: None Example: i8094MF_FRNET_OUT(1, 0,0xffff); //Write 0xffff to the 16-bit DO which is on module 1 and the group number is 0. ICPDAS 42 I-8094 Software User Manual 5 Auto Homing The I-8094 module provides an automatic homing function. After setting the appropriate parameters, the assigned axes are able to perform automatic homing. Settings are required to be made in four steps for performing the automatic HOME search: Search for the near home sensor (NHOME) at a normal speed (V). Search for the HOME sensor at low speed (HV). Search for the Encoder Z-phase (index) at low speed (HV). Move a specified number of offset pulses to the predefined origin point at normal speed (V). Some steps can be omitted. A detailed description of the related functions is provided in the following sections. Fully automated homing can reduce both programming time and CPU processing time. 5.1 Setting the Homing Speed void i8094MF_SET_HV(BYTE cardNo, WORD axis, DWORD data) Description: This function sets the homing speed. Parameters: cardNo: axis: data: Module number Axis or axes (Please refer to Table 2-1) Homing speed (in PPS) Return: None EXAMPLE: i8094MF_ SET_HV(1, AXIS_X, 500); //set the homing speed of the X axis on module 1 to 500 PPS. ICPDAS 43 I-8094 Software User Manual 5.2 Using an Limit Switch as the HOME sensor void i8094MF_HOME _LIMIT(BYTE cardNo, WORD axis, WORD nType) Description: This function sets the Limit Switch to be used as the HOME sensor. Parameters: cardNo: axis: nType: Module number Axis axes (Please refer to Table 2-1) 0: Does not use the LIMIT SWITCH as the HOME sensor; 1: Use the LIMIT SWITCH as the HOME sensor Return: None EXAMPLE: i8094MF_ HOME_LIMIT(1, AXIS_X, 0); //Do not use the Limit Switch as the HOME sensor. 5.3 Setting the Homing Mode void i8094MF_SET_HOME_MODE(BYTE cardNo, WORD axis, WORD nStep1, WORD nStep2, WORD nStep3, WORD nStep4 , long data) Description: This function sets the homing method and other related parameters. Parameters: cardNo: axis: nStep1: Module number Axis or axes (Please refer to Table 2-1) 0: Step 1 is not executed 1: Moves in a positive direction 2: Moves in a negative direction nStep2: 0: Step 2 is not executed 1: Moves in a positive direction 2: Moves in a negative direction nStep3: 0: Step 3 is not executed 1: Moves in a positive direction ICPDAS 44 I-8094 Software User Manual 2: Moves in a negative direction nStep4: 0: Step 4 is not executed 1: Moves in a positive direction 2: Moves in a negative direction data: Offset value (0 ~ 2,147,483,647) The Four Steps Required for Automatic Homing Step 1 2 3 4 Action Searching for the Near Home sensor Searching for the HOME sensor Searching for the encoder Z-phase signal Moves to the specified position Speed V HV Sensor NHOME (IN0) HOME (IN1) HV Z-phase (IN2) V Return: None Example: //Use the following functions to set the homing mode of the X axis. i8094MF_SET_V(1, 0x1, 20000); i8094MF_SET_HV(1, 0x1, 500); i8094MF_SET_HOME_MODE(1, 0x1, 2, 2, 1, 1, 3500); i8094MF_HOME_START(1, 0x1); //start auto-homing. i8094MF_WAIT_HOME(1, 0x1); //wait until homing is completed. Step 1 2 3 4 ICPDAS Input Signal Near HOME (IN0) is active HOME (IN1) is active Z-phase (IN2) is active No sensor is required. Move 3500 pulses along the X axis. 45 Direction + + Speed 20000 PPS (V) 500 PPS (HV) 500 PPS (HV) 20000 PPS (V) I-8094 Software User Manual 5.4 Starting the Homing Sequence void i8094MF_HOME _START(BYTE cardNo, WORD axis) Description: This function starts the home search of assigned axes. Parameters: cardNo: axis: Module number Axis or axes (Please refer to Table 2-1) Return: None Example: i8094MF_ HOME_START(1, AXIS_X); //start the automatic homing sequence for the X axis on module 1. 5.5 Waiting for the Homing sequence to be Completed BYTE i8094MF _HOME_WAIT(BYTE cardNo, WORD axis) Description: This function assigns commands to be performed while waiting for the automatic home search of all assigned axes to be completed. Parameters: cardNo: axis: Module number Axis axes (Please refer to Table 2-1) Return: YES NO The Homing sequence has been completed. The Homing sequence is not complete. Example: if (i8094MF_HOME_WAIT(1, AXIS_X) == NO) { //perform some actions here if the X axis on module 1 has not completed //its homing sequence. } ICPDAS 46 I-8094 Software User Manual 6 General Motion Control 6.1 Independent Axis Motion Control The motion of each axis can be started independently. Multiple axes are moving at the same time. Each axis is moving independently. Each axis can be commanded to change motion, such as changing the number of pulses or the speed. Each axis can be commanded to stop slowly or suddenly to meet the individual requirements. Independent axis motion can work with interpolation or synchrous action to do more complicated and versatile motion. 6.1.1 Setting the Acceleration/Deceleration Mode void i8094MF_NORMAL_SPEED(BYTE cardNo, WORD axis , WORD nMode) Description: The function sets the speed mode. Parameters: cardNo: Module number axis: Axis (Please refer to Table 2-1) nMode: 0 Symmetric T-curve (Please set SV, V, A, and AO) 1 Symmetric S-curve (Please set SV, V, K, and AO) 2 Asymmetric T-curve (Please set SV, V, A, D, and AO) 3 Asymmetric S-curve (Please set SV, V, K, L, and AO) Return: None Example: BYTE cardNo=1; //select module 1. i8094MF_SET_MAX_V(cardNo, AXIS_XYZU, 20000); //set the max. speed of XYZU axes to 20K PPS. //======================================================== i8094MF_NORMAL_SPEED(cardNo, AXIS_XYZU, 0); //use a symmetric T-curve for all axes on module 1. ICPDAS 47 I-8094 Software User Manual i8094MF_SET_V(cardNo, AXIS_XYZU, 2000); //set the speed of all axes on module 1 to 2000 PPS. i8094MF_SET_A(cardNo, AXIS_XYZU,1000); //set the acceleration of all axes on module 1 to 1000 PPS/Sec. i8094MF_SET_SV(cardNo, AXIS_XYZU, 2000); //set the start speed of all axes on module 1 to 2000 PPS. i8094MF_SET_AO(cardNo, AXIS_XYZU, 9); //set the number of remaining offset pulses for all axes to 9 pulses. i8094MF_FIXED_MOVE(cardNo, AXIS_XYZU, 10000); //move all axes on module 1 for 10000 pulses. //======================================================== i8094MF_NORMAL_SPEED(cardNo, AXIS_XYZU,1); //use a symmetric S-curve for all axes on module 1. i8094MF_SET_V(cardNo, AXIS_XYZU, 2000); //set the speed of all axes on module 1 to 2000 PPS. i8094MF_SET_K(cardNo, AXIS_XYZU, 50); //set the acceleration rate of all axes on module 1 to 500 PPS/Sec^2. i8094MF_SET_SV(cardNo, AXIS_XYZU, 200); //set the start speed of all axes on module 1 to 200 PPS. i8094MF_SET_AO(cardNo, AXIS_XYZU, 9); //set the number of remaining offset pulses to 9 pulses for all axes. i8094MF_FIXED_MOVE(cardNo, AXIS_XYZU, -10000); //move all axes on module 1 for 10000 pulses in reverse direction. //======================================================== i8094MF_NORMAL_SPEED(cardNo, AXIS_XYZU,2); //use an asymmetric T-curve for all axes on module 1. i8094MF_SET_V(cardNo, AXIS_XYZU, 2000); //set the speed of all axes on module 1 to 2000 PPS. i8094MF_SET_A(cardNo, AXIS_XYZU,1000 ); //set the acceleration of all axes on module 1 to 1000 PPS/Sec. i8094MF_SET_D(cardNo, AXIS_XYZU, 500); //set the deceleration of all axes on module 1 to 500 PPS. i8094MF_SET_SV(cardNo, AXIS_XYZU, 200); //set the start speed of all axes on module 1 to 200 PPS. i8094MF_SET_AO(cardNo, AXIS_XYZU, 9); //set the number of remaining offset pulses to 9 pulses for all axes. i8094MF_FIXED_MOVE(cardNo, axis, 10000); //move all axes on module 1 for 10000 pulses. //======================================================== i8094MF_NORMAL_SPEED(cardNo, AXIS_XYZU,3); //use an asymmetric S-curve for all axes on module 1. i8094MF_SET_V(cardNo, AXIS_XYZU, 2000); //set the speed of all axes on module 1 to 2000 PPS. i8094MF_SET_K(cardNo, AXIS_XYZU, 50); //set the acceleration rate of all axes on module 1 to 500 PPS/Sec^2. i8094MF_SET_L(cardNo, AXIS_XYZU, 30); ICPDAS 48 I-8094 Software User Manual //set the deceleration rate of all axes on module 1 to 300 PPS/Sec^2. i8094MF_SET_SV(cardNo, AXIS_XYZU, 200); //set the start speed of all axes on module 1 to 200 PPS. i8094MF_SET_AO(cardNo, AXIS_XYZU, 9); //set the number of remaining offset pulses to 9 pulses for all axes. i8094MF_FIXED_MOVE(cardNo, AXIS_XYZU, 10000); //move all axes on module 1 for 10000 pulses. Note: ICPDAS Relevant parameters must be set to achieve the desired motion. 49 I-8094 Software User Manual 6.1.2 Setting the Start Speed void i8094MF_SET_SV(BYTE cardNo, WORD axis, DWORD data) Description: This function sets the start speed for the assigned axes. Parameters: cardNo: axis: data: Module number Axis or axes (Please refer to Table 2-1) The range is the same as for speed, and must not be zero or larger than the maximum speed. The maximum value is 4,000,000 PPS. For interpolation, set the speed value for axis1 is enough. Return: None Example: i8094MF_SET_SV(1, AXIS_X, 1000); //set the starting speed for the X axis on module 1 to 1000 PPS. ICPDAS 50 I-8094 Software User Manual 6.1.3 Setting the Desired Speed void i8094MF_SET_V(BYTE cardNo, WORD axis, DWORD data) Description: This function sets the desired speed for the assigned axes. Parameters: cardNo: axis: data: Module number Axis or axes (Please refer to Table 2-1) The range is the same as for speed, and must not be zero or larger than the maximum speed. The maximum value is 4,000,000 PPS. For interpolation, set the speed value for axis1 is enough. Return: None Example: i8094MF_SET_V(1, AXIS_X, 120000L); //set the speed for the X axis on module 1 to 120000 PPS. 6.1.4 Setting the Acceleration void i8094MF_SET_A(BYTE cardNo, WORD axis, DWORD data) Description: This function sets the acceleration value for the assigned axes. Parameters: cardNo: axis: data: ICPDAS Module number Axis or axes (Please refer to Table 2-1) The acceleration value. The units are PPS/Sec. This value is related to the maximum speed value defined by i8094MF_SET_MAX_V() function. The maximum available acceleration value is MAX_V * 125. The minimum acceleration value is MAX_V ÷ 64, and all other acceleration values are the integral multipliers of this value. The practical value for application depends on the capability of the motor drive and motor. 51 I-8094 Software User Manual Return: None Example: i8094MF_SET_MAX_V(1, AXIS_X, 20000); //set the maximum speed value of the X axis as 20,000 PPS. //therefore, do not set any acceleration value that is larger than //20,000*125 PPS/sec. And 20,000 *125 = 2,500,000. i8094MF_SET_A(1, AXIS_X, 100000L); //set the acceleration value of the X axis on module 1 to 100K PPS/Sec. ICPDAS 52 I-8094 Software User Manual 6.1.5 Setting the Deceleration void i8094MF_SET_D(BYTE cardNo, WORD axis, DWORD data) Description: This function sets the deceleration value for the assigned axes. Parameters: cardNo: axis: data: Module number Axis or axes (Please refer to Table 2-1) The deceleration value. The units are PPS/Sec. This value is related to the maximum speed value defined by i8094MF_SET_MAX_V() function. The maximum available deceleration value is MAX_V * 125. The minimum deceleration value is MAX_V ÷ 64, and all other deceleration values are the integral multipliers of this value. The practical value for application depends on the capability of the motor drive and motor. Return: None Example: i8094MF_SET_MAX_V(1, AXIS_X, 20000); //set the maximum speed value of the X axis as 20,000 PPS. //therefore, do not set any deceleration value that is larger than //20,000*125 PPS/sec. And 20,000 *125 = 2,500,000. i8094MF_SET_D(1, AXIS_X, 100000L); //set the deceleration value of the X axis on module 1 to 100K PPS/Sec. ICPDAS 53 I-8094 Software User Manual 6.1.6 Setting the Acceleration Rate void i8094MF_SET_K(BYTE cardNo, WORD axis, DWORD data) Description: The function sets the acceleration rate (i.e., Jerk) value for the assigned axes. Parameters: cardNo: axis: data: Module number Axis or axes (Please refer to Table 2-1) The acceleration rate (jerk) value. The units are PPS/Sec 2 . This value is related to the maximum speed value defined by i8094MF_SET_MAX_V() function. The maximum available acceleration rate value is MAX_V * 781.25. The minimum acceleration value is MAX_V * 0.0119211, and all other acceleration values are the integral multipliers of this value. The practical value for application depends on the capability of the motor drive and motor. Note: since the DWORD can not represent the maximum value; therefore, this value is given by dividing the desired value by 10. Return: None Example: i8094MF_SET_MAX_V(1, AXIS_X, 20000); //set the maximum speed value of the X axis as 20,000 PPS. //therefore, do not set any jerk value that is larger than //20,000*781.25 PPS/sec^2. And 20,000 *781.25 = 15,625,000. i8094MF_SET_K(1, AXIS_X, 1000); //set the acceleration rate value of the X axis on module 1 to //1,000*10 (= 10,000) PPS/Sec^2. ICPDAS 54 I-8094 Software User Manual 6.1.7 Setting the Deceleration Rate void i8094MF_SET_L(BYTE cardNo, WORD axis, DWORD data) Description: This function sets the deceleration rate (i.e., Jerk) value for the assigned axes. Parameters: cardNo: axis: data: Module number Axis or axes (Please refer to Table 2-1) The deceleration rate value. The units are PPS/Sec 2 . This value is related to the maximum speed value defined by i8094MF_SET_MAX_V() function. The maximum available deceleration rate value is MAX_V * 781.25. The minimum deceleration value is MAX_V * 0.0119211, and all other deceleration values are the integral multipliers of this value. The practical value for application depends on the capability of the motor drive and motor. Note: since the DWORD can not represent the maximum value; therefore, this value is given by dividing the desired value by 10. Return: None Example: i8094MF_SET_MAX_V(1, AXIS_X, 20000); //set the maximum speed value of the X axis as 20,000 PPS. //therefore, do not set any deceleration rate value that is larger //than 20,000*781.25 PPS/sec^2. And 20,000 *781.25 = 15,625,000. i8094MF_SET_L(1, AXIS_X, 1000); //set the acceleration rate value of the X axis on module 1 to //1,000*10 (= 10,000) PPS/Sec^2. ICPDAS 55 I-8094 Software User Manual 6.1.8 Setting the Value of the Remaining Offset Pulses void i8094MF_SET_AO(BYTE cardNo, WORD axis, short int data) Description: This function sets the number of remaining offset pulses for the assigned axes. Please refer to the figure below for a definition of the remaining offset pulse value. Parameters: cardNo: axis: data: Module number Axis or axes (Please refer to Table 2-1) The number of remaining offset pulses. (-32,768 ~ +32,767) Return: None Example: i8094MF_SET_AO(1, AXIS_X, 200); //set the number of remaining offset pulses for the X axis on //module 1 to 200 pulses. ICPDAS 56 I-8094 Software User Manual 6.1.9 Fixed Pulse Output BYTE i8094MF_FIXED_MOVE(BYTE cardNo, WORD axis, long data) Description: Command a point-to-point motion for several independent axes. Parameters: cardNo: axis: data: Module number Axis (Please refer to Table 2-1.) The axis can be either X, Y, Z, or U. Pulses (-2,147,483,648 ~ +2,147,483,647) Return: YES NO Some errors happen. Use i8094MF_GET_ERROR_CODE () to identify the errors. No error. Example: BYTE cardNo=1; //select module 1 i8094MF_SET_MAX_V(cardNo, AXIS_XYZU, 20000); //set the max. velocity of all axes on module 1 to be 20K PPS i8094MF_NORMAL_SPEED(cardNo, AXIS_XYZU, 0); //set the speed profile of all axes on module 1 to be symmetric T-curve i8094MF_SET_V(cardNo, AXIS_XYZU, 2000); //set the speed of all axes on module 1 to be 2000 PPS i8094MF_SET_A(cardNo, AXIS_XYZU,1000); //set the acceleration value of all axes on module 1 to be 1000 PPS/S i8094MF_SET_SV(cardNo, AXIS_XYZU, 2000); //set the start velocity of all axes on module 1 to be 2000 PPS i8094MF_SET_AO(cardNo, AXIS_XYZU, 9); //set the remaining offset pulses to be 9 PPS i8094MF_FIXED_MOVE(cardNo, AXIS_XYZU, 10000); // move 10000 Pulses for each axis on module 1 ICPDAS 57 I-8094 Software User Manual 6.1.10 Continuous Pulse Output BYTE i8094MF_CONTINUE_MOVE(BYTE cardNo, WORD axis, long data) Description: This function issues a continuous motion command for several independent axes. Parameters: cardNo: axis: data: Module number Axis or axes (Please refer to Table 2-1) The axis can be either X, Y, Z, or U. The specified speed (positive value for CW motion; negative value for CCW motion) Return: YES NO An error has occurred. Use the i8094MF_GET_ERROR_CODE() function to identify the errors. No error. Example: BYTE cardNo=1; //select module 1 i8094MF_SET_MAX_V(cardNo, AXIS_XYZU, 20000); //set the maximum speed of all axes on module 1 to 20K PPS. i8094MF_NORMAL_SPEED(cardNo, AXIS_XYZU, 0); //set the speed profile for all axes as a symmetric T-curve. i8094MF_SET_V(cardNo, AXIS_XYZU, 2000); //set the speed of all axes on module 1 to 2000 PPS. i8094MF_SET_A(cardNo, AXIS_XYZU, 1000); //set the acceleration value of all axes to 1000 PPS/S. i8094MF_SET_SV(cardNo, AXIS_XYZU, 2000); //set the start velocity of all axes to 2000 PPS i8094MF_CONTINUE_MOVE(cardNo, AXIS_XYZU, 1000); //move all axes on module 1 at a speed of 1000 PPS. ICPDAS 58 I-8094 Software User Manual 6.2 Interpolation Commands 6.2.1 Assigning the Axes for Interpolation void i8094MF_AXIS_ASSIGN(BYTE cardNo, WORD axis1, WORD axis2, WORD axis3) Description: This function assigns the axes to be used for interpolation. Either two or three axes can be assigned using this function. Interpolation commands will refer to the assigned axes to construct a working coordinate system. The X axis does not necessarily have to be the first axis. However, it is easier to use the X axis as the first axis, the Y axis as the second axis, and the Z axis as the third axis. Parameters: cardNo: axis1: axis2: axis3: Module number The first axis and It can be either X, Y, Z, or U. Please refer to Table 2-1 for the axis definition. The second axis and can be either X, Y, Z, or U. The third axis and can be either X, Y, Z, or U. Return: None EXAMPLE: i8094MF_AXIS_ASSIGN(1, AXIS_X, AXIS_Y, 0); //set the X axis of module 1 as the first axis and the Y axis as the second axis. ICPDAS 59 I-8094 Software User Manual 6.2.2 Setting the Speed and Acc/Dec Mode for Interpolation void i8094MF_VECTOR_SPEED(BYTE cardNo, WORD nMode) Description: This function assigns the mode of interpolation. Either two or three axes will join this interpolation. Each interpolation mode will refer to some assigned axes that construct a working coordinate system. The assigned axes are defined by i8094MF_AXIS_ASSIGN() funciton. The X axis does not necessarily have to be the first axis. However, it is easier to let the X axis as the first axis, the Y axis as the second axis, and the Z axis as the third axis in applications. Different modes need different settings. Please refer to the mode definitions. Parameters: cardNo: nMode: Module number 0 2-axis linear or circular motion at a constant vector speed (Set VV and VSV; and VV=VSV) 1 2-axis linear motion using a symmetric T-curve velocity profile (set VSV, VV, VA, and VAO) 2 2-axis linear motion using a symmetric S-curve velocity profile (set VSV, VV, VK, and VAO) 3 2-axis linear motion using an asymmetric T-curve velocity profile (set VSV, VV, VA, VD, and VAO) 4 2-axis linear motion using an asymmetric S-curve velocity profile (set VSV, VV, VK, VL, and VAO) 5 2-axis circular motion using a symmetric T-curve velocity profile (set VSV, VV, VA, and VAO) 6 2-axis circular motion using an asymmetric T-curve velocity profile (set VSV, VV, VA, VD, and VAO) 7 3-axis linear motion at a constant vector speed (set VV and VSV; and VV=VSV) 8 3-axis linear motion at using a symmetric T-curve velocity profile (set VSV, VV, VA, and VAO) 9 3-axis linear motion using a symmetric S-curve velocity profile (set VSV, VV, VK, and VAO) 10 3-axis linear motion using an asymmetric T-curve velocity profile (set VSV, VV, VA, VD, and VAO) 11 3-axis linear motion using an asymmetric S-curve velocity profile (set VSV, VV, VK, VL, and VAO) Return: None ICPDAS 60 I-8094 Software User Manual Example: BYTE cardNo=1; //select module 1. i8094MF_SET_MAX_V(cardNo, AXIS_XYZU, 20000); //set the maximum speed of all axes to 20K PPS. //=============================================== i8094MF_AXIS_ASSIGN(cardNo, AXIS_X, AXIS_Y, 0); //set the X axis as the first axis and the Y axis as the second axis. i8094MF_VECTOR_SPEED(cardNo, 0); //set module 1 to perform 2-axis linear or circular motion //at a constant vector speed. i8094MF_SET_VSV(cardNo, 1000); //set the starting vector speed to 1000 PPS. i8094MF_SET_VV(cardNo, 1000); //set the vector speed to 1000 PPS. i8094MF_LINE_2D(1, 12000, 10000); //execute the 2-axis linear interpolation motion. //=============================================== i8094MF_DEC_ENABLE(cardNo); //enable the deceleration function. i8094MF_AXIS_ASSIGN(cardNo, AXIS_X, AXIS_Y, 0); //set the X axis as the first axis and the Y axis as the second axis. i8094MF_VECTOR_SPEED(cardNo, 1); //set module 1 to perform 2-axis linear motion using a symmetric //S-curve velocity profile. i8094MF_SET_VSV(cardNo, 500); //set the starting vector speed to 500 PPS. i8094MF_SET_VV(cardNo, 2000); //set the vector speed to 2000 PPS. i8094MF_SET_VA(cardNo, 1000); //set the vector acceleration to 1000 PPS/Sec. i8094MF_LINE_2D(cardNo, 20000, 10000); //execute the 2-axis linear interpolation motion. //=============================================== i8094MF_AXIS_ASSIGN(cardNo, AXIS_X, AXIS_Y, 0); //set the X axis as the first axis and the Y axis as the second axis. i8094MF_VECTOR_SPEED(cardNo, 2); //2-axis linear motion using a symmetric S-curve velocity profile. i8094MF_SET_VSV(cardNo, 200); //set the starting vector speed to 200 PPS. i8094MF_SET_VV(cardNo, 2000); //set the vector speed to 2000 PPS. i8094MF_SET_VK(cardNo, 50); //set the acceleration rate to 500 PPS/Sec. i8094MF_SET_VAO(cardNo, 20); ICPDAS 61 I-8094 Software User Manual //set the value of remaining offset pulses to 20. i8094MF_LINE_2D(cardNo, 10000, 10000); //execute the 2-axis linear interpolation motion. //=============================================== i8094MF_DEC_ENABLE(cardNo); //enable the deceleration function. i8094MF_AXIS_ASSIGN(cardNo, AXIS_X, AXIS_Y, 0); //set the X axis as the first axis and the Y axis as the second axis. i8094MF_VECTOR_SPEED(cardNo, 3); //2-axis linear motion using an asymmetric T-curve velocity profile. i8094MF_SET_VSV(cardNo, 100); //set the start vector speed to 100 PPS. i8094MF_SET_VV(cardNo, 2000); //set the vector speed to 2000 PPS. i8094MF_SET_VA(cardNo, 1000); //set the vector acceleration to 1000 PPS/Sec. i8094MF_SET_VD(cardNo, 500); //set the vector deceleration to 500 PPS/Sec. i8094MF_SET_VAO(cardNo, 20); //set the value of remaining offset pulses to 20. i8094MF_LINE_2D(cardNo, 10000, 5000); //execute the 2-axis linear interpolation motion. //=============================================== long fp1=4000; long fp2=10000; int sv=200; int v=2000; i8094MF_SET_MAX_V(cardNo, AXIS_XYZU, 8000); i8094MF_AXIS_ASSIGN(cardNo, AXIS_X, AXIS_Y, 0); //set the X axis as the first axis and the Y axis as the second axis. i8094MF_VECTOR_SPEED(cardNo, 4); //2-axis linear motion using an asymmetric S-curve velocity profile. i8094MF_SET_VSV(cardNo, sv); //set the starting velocity to sv PPS. i8094MF_SET_VV(cardNo, v); //set the vector speed to v PPS. i8094MF_SET_VK(cardNo, 50); //set the acceleration rate to 500 PPS/Sec^2. i8094MF_SET_VL(cardNo, 30); //set the deceleration rate to 300 PPS/Sec^2. i8094MF_SET_VAO(cardNo, 20); //set the value of remaining offset pulses to 20. i8094MF_LINE_2D(cardNo, fp1, fp2); //execute the 2-axis linear motion. ICPDAS 62 I-8094 Software User Manual //=============================================== long fp1=11000; long fp2=9000; long c1=10000; long c2=0; int sv=100; int v=3000; int a=5000; int d=5000; i8094MF_SET_MAX_V(cardNo, AXIS_XYZU, 8000); i8094MF_AXIS_ASSIGN(cardNo, AXIS_X, AXIS_Y, 0); //set the X axis as the first axis and the Y axis as the second axis. i8094MF_VECTOR_SPEED(cardNo, 5); //2-axis circular motion using a symmetric T-curve velocity profile i8094MF_SET_VSV(cardNo, sv); //set the starting vector speed to sv PPS. i8094MF_SET_VV(cardNo, v); //set vector speed to v PPS. i8094MF_SET_VA(cardNo, a); //set the vector acceleration to a PPS/Sec. i8094MF_SET_VAO(cardNo, 0); //set the value of remaining offset pulses to 0 Pulse. i8094MF_ARC_CW(cardNo, c1,c2, fp1, fp2); //execute the 2-axis CW circular motion. //=============================================== long c1=300; long c2=0; int sv=100; int v=3000; int a=125; int d=12; i8094MF_SET_MAX_V(cardNo, AXIS_XYZU, 8000); i8094MF_AXIS_ASSIGN(cardNo, AXIS_X, AXIS_Y, 0); //set the X axis as the first axis and the Y axis as the second axis. i8094MF_VECTOR_SPEED(cardNo, 6); //2-axis circular motion using an asymmetric T-curve velocity //profile. i8094MF_SET_VSV(cardNo, sv); //set the starting vector speed to sv PPS. i8094MF_SET_VV(cardNo, v); //set vector speed to v PPS. i8094MF_SET_VA(cardNo, a); //set acceleration to a PPS/Sec. i8094MF_SET_VD(cardNo, d); //set the deceleration to d PPS/Sec. i8094MF_SET_VAO(cardNo, 0); ICPDAS 63 I-8094 Software User Manual //set the value of remaining offset pulses to 0. i8094MF_CIRCLE_CW(cardNo, c1, c2); //execute the 2-axis CW circular motion. //=============================================== i8094MF_AXIS_ASSIGN(cardNo, AXIS_X, AXIS_Y, AXIS_Z); //set axis1 as the X axis, axis2 as the Y axis, and axis3 as the Z axis. i8094MF_VECTOR_SPEED(cardNo, 7); //3-axis linear motion at a constant vector speed (VSV=VV). i8094MF_SET_VSV(cardNo, 1000); //set the start speed to 1000 PPS. i8094MF_SET_VV(cardNo, 1000); //set the constant speed to 1000 PPS. i8094MF_LINE_3D(cardNo, 10000, 10000,10000); //execute the 3-axis linear motion. //=============================================== i8094MF_AXIS_ASSIGN(cardNo, AXIS_X, AXIS_Y, AXIS_Z); //set axis1 as the X axis, axis2 as the Y axis, and axis3 as the Z-axis. i8094MF_VECTOR_SPEED(cardNo, 8); //3-axis linear motion using a symmetric T-curve velocity profile. i8094MF_SET_VSV(cardNo, 100); //set the starting speed to 1000 PPS. i8094MF_SET_VV(cardNo, 3000); //set the vector speed to 3000 PPS. i8094MF_SET_VA(cardNo, 500); //set the vector acceleration to 500 PPS/Sec. i8094MF_SET_VAO(cardNo, 20); //set the value of remaining offset pulses to 20. i8094MF_LINE_3D(cardNo, 10000, 1000,20000); //execute the 3-axis linear motion //=============================================== i8094MF_AXIS_ASSIGN(cardNo, AXIS_X, AXIS_Y, AXIS_Z); //set the axis1 as the X axis, axis2 as the Y axis, and axis3 as the Z axis. i8094MF_VECTOR_SPEED(cardNo, 9); //3-axis linear motion using a symmetric S-curve velocity profile. i8094MF_SET_VSV(cardNo, 100); //set the starting speed to 1000 PPS. i8094MF_SET_VV(cardNo, 3000); //set the vector speed to 3000 PPS. i8094MF_SET_VK(cardNo, 50); //set the vector acceleration rate to 500 PPS/Sec^2. i8094MF_SET_VAO(cardNo, 20); //set the value of remaining offset pulses to 20. i8094MF_LINE_3D(cardNo, 10000, 1000,1000); //execute the 3-axis linear motion. ICPDAS 64 I-8094 Software User Manual //=============================================== i8094MF_AXIS_ASSIGN(cardNo, AXIS_X, AXIS_Y, AXIS_Z); //set the axis1 as the X axis, axis2 as the Y axis, and axis3 as the Z axis. i8094MF_VECTOR_SPEED(cardNo, 10); //set the module 1 to perform 3-axis linear motion //using an asymmetric T-curve speed profile. i8094MF_SET_VSV(cardNo, 100); //set the starting speed to 1000 PPS. i8094MF_SET_VV(cardNo, 2000); //set the vector speed as 3000 PPS. i8094MF_SET_VA(cardNo, 1000); //set the vector acceleration to 1000 PPS/Sec. i8094MF_SET_VD(cardNo, 500); //set the vector deceleration to 500 PPS/Sec. i8094MF_SET_VAO(cardNo, 20); //set the value of remaining offset pulses to 20. i8094MF_LINE_3D(cardNo, 10000, 1000,1000); //execute the 3-axis linear motion. //=============================================== long fp1=4000; long fp2=10000; long fp3=20000; int sv=200; int v=2000; i8094MF_SET_MAX_V(cardNo, AXIS_XYZU, 8000); i8094MF_AXIS_ASSIGN(cardNo, AXIS_X, AXIS_Y, AXIS_Z); //set axis1 as the X axis, axis2 as the Y axis, and axis3 as the Z axis. i8094MF_VECTOR_SPEED(cardNo, 11); //3-axis linear motion using an asymmetric S-curve velocity profile. i8094MF_SET_VSV(cardNo, sv); //set the starting speed to sv PPS. i8094MF_SET_VV(cardNo, v); //set the vector speed to v PPS. i8094MF_SET_VK(cardNo, 50); //set the vector acceleration rate to 500 PPS/Sec^2. i8094MF_SET_VL(cardNo, 30); //set the vector deceleration rate to 300 PPS/Sec^2. i8094MF_SET_VAO(cardNo, 20); //set the value of remaining offset pulses to 20. i8094MF_LINE_3D(cardNo, fp1, fp2,fp3); //execute the 3-axis linear motion. Note: ICPDAS Relevant parameters should be set before issuing the motion command. 65 I-8094 Software User Manual 6.2.3 Setting the Vector Starting Speed void i8094MF_SET_VSV(BYTE cardNo, DWORD data) Description: This function sets the starting speed of the principle axis (axis 1) for the interpolation motion. Parameters: cardNo: data: Module number The vector starting speed value (in PPS) Return: None Example: i8094MF_SET_VSV(1, 1000); //set the starting speed of the axis 1 for the interpolation motion //on module 1 to 1000 PPS. 6.2.4 Setting the Vector Speed void i8094MF_SET_VV(BYTE cardNo, DWORD data) Description: This function sets the vector speed of the interpolation motion. Users do not need to assign any axes on this function. The speed setting will take effect on the current working coordinate system which is defined by the i8094MF_AXIS_ASSIGN() function. Parameters: cardNo: data: Module number The vector speed value (in PPS) Return: None Example: i8094MF_SET_VV(1, 120000L); //set the vector speed of the interpolation on module 1 //to 120000 PPS. ICPDAS 66 I-8094 Software User Manual 6.2.5 Setting the Vector Acceleration void i8094MF_SET_VA(BYTE cardNo, DWORD data) Description: This function sets the vector acceleration for interpolation motion. Users do not have to assign any axes on this funciton. This speed setting will take effect on the current working coordinate system which is defined by the i8094MF_AXIS_ASSIGN() function. Parameters: cardNo: data: Module number The vector acceleration value (in PPS/Sec). The units are PPS/Sec. This value is related to the maximum speed value defined by i8094MF_SET_MAX_V() function. The maximum available acceleration value is MAX_V * 125. The minimum acceleration value is MAX_V ÷ 64, and all other acceleration values are the integral multipliers of this value. The practical value for application depends on the capability of the motor drive and motor. Return: None Example: i8094MF_SET_MAX_V(1, AXIS_X, 20000); //set the maximum speed value of the X axis as 20,000 PPS. //therefore, do not set any acceleration value that is larger than //20,000*125 PPS/sec. And 20,000 *125 = 2,500,000. i8094MF_SET_VA(1, 100000L); //set the vector acceleration of the interpolation motion //on module 1 to 100K PPS/Sec. ICPDAS 67 I-8094 Software User Manual 6.2.6 Setting the Vector Deceleration Value void i8094MF_SET_VD(BYTE cardNo, DWORD data) Description: This function sets the deceleration value for the interpolation motion. Parameters: cardNo: data: Module number The vector deceleration value (in PPS/Sec). This value is related to the maximum speed value defined by i8094MF_SET_MAX_V() function. The maximum available deceleration value is MAX_V * 125. The minimum deceleration value is MAX_V ÷ 64, and all other deceleration values are the integral multipliers of this value. The practical value for application depends on the capability of the motor drive and motor. Return: None Example: i8094MF_SET_MAX_V(1, AXIS_X, 20000); //set the maximum speed value of the X axis as 20,000 PPS. //therefore, do not set any deceleration value that is larger than //20,000*125 PPS/sec. And 20,000 *125 = 2,500,000. i8094MF_SET_VD(1, 100000L); //set the vector deceleration value of interpolation motion //on module 1 to 100K PPS/Sec. ICPDAS 68 I-8094 Software User Manual 6.2.7 Setting the Vector Acceleration Rate void i8094MF_SET_VK(BYTE cardNo, DWORD data) Description: Set the acceleration rate (jerk) value for interpolation motion. Parameters: cardNo: data: Module number The acceleration rate (jerk) value. The units are PPS/Sec 2 . This value is related to the maximum speed value defined by i8094MF_SET_MAX_V() function. The maximum available acceleration rate value is MAX_V * 781.25. The minimum acceleration value is MAX_V * 0.0119211, and all other acceleration values are the integral multipliers of this value. The practical value for application depends on the capability of the motor drive and motor. Note: since the DWORD can not represent the maximum value; therefore, this value is given by dividing the desired value by 10. Return: None Example: i8094MF_SET_MAX_V(1, AXIS_X, 20000); //set the maximum speed value of the X axis as 20,000 PPS. //therefore, do not set any jerk value that is larger than //20,000*781.25 PPS/sec^2. And 20,000 *781.25 = 15,625,000. i8094MF_SET_VK(1, 10000); //set the acceleration rate of the interpolation motion on module // 1 to 10,000 PPS/ Sec^2. ICPDAS 69 I-8094 Software User Manual 6.2.8 Setting the Vector Deceleration Rate void i8094MF_SET_VL(BYTE cardNo, DWORD data) Description: This function sets the deceleration rate of the interpolation motion. Parameters: cardNo: data: Module number The deceleration rate (Jerk) value. The units are PPS/Sec 2 . This value is related to the maximum speed value defined by i8094MF_SET_MAX_V() function. The maximum available deceleration rate value is MAX_V * 781.25. The minimum deceleration value is MAX_V * 0.0119211, and all other deceleration values are the integral multipliers of this value. The practical value for application depends on the capability of the motor drive and motor. Note: since the DWORD can not represent the maximum value; therefore, this value is given by dividing the desired value by 10. Return: None Example: i8094MF_SET_MAX_V(1, AXIS_X, 20000); //set the maximum speed value of the X axis as 20,000 PPS. //therefore, do not set any deceleration rate value that is larger //than 20,000*781.25 PPS/sec^2. And 20,000 *781.25 = 15,625,000. i8094MF_SET_VL(1, 10000); //set the deceleration rate of the interpolation on module 1 to 10,000 PPS/Sec^2. ICPDAS 70 I-8094 Software User Manual 6.2.9 Setting the Number of the Remaining Offset Pulses void i8094MF_SET_VAO(BYTE cardNo, short int data) Description: Setting this value will cause the motion control chip to start deceleration earlier. The remaining offset pulses will be completed at low speed to allow the controller to stop immediately when the offset pulse value has been reached. Please refer to the figure below for more information. Parameters: cardNo: data: Module number The number of remaining offset pulses (-32,768 ~ +32,767) Return: None Example: i8094MF_SET_VAO(1, 200); //set the number of remaining offset pulse value on module 1 to 200. ICPDAS 71 I-8094 Software User Manual 6.2.10 2-Axis Linear Interpolation Motion BYTE i8094MF_LINE_2D(BYTE cardNo, long fp1, long fp2) Description: This function executes a 2-axis linear interpolation motion. Parameters: cardNo: fp1: fp2: Module number The displacement of the axis 1 in Pulses (-2,147,483,648 ~ +2,147,483,647) The displacement of the axis 2 in Pulses (-2,147,483,648 ~ +2,147,483,647) Return: YES NO An error has occurred. Use the i8094MF_GET_ERROR_CODE() function to identify the error. No errors. Example: i8094MF_LINE_2D(1, 12000, 10000); //execute the 2-axis linear interpolation motion on module 1. 2-axis linear interpolation motion ICPDAS 72 I-8094 Software User Manual 6.2.11 3-axis Linear Interpolation Motion BYTE i8094MF_LINE_3D(BYTE cardNo, long fp1, long fp2, long fp3) Description: This function executes a 3-axis linear interpolation motion. Parameters: cardNo: fp1: fp2: fp3: Module number The displacement of the first axis (axis 1) in Pulses (-2,147,483,648 ~ +2,147,483,647) The displacement of the second axis (axis 2) in Pulses (-2,147,483,648 ~ +2,147,483,647) The displacement of the third axis (axis 3) in Pulses (-2,147,483,648 ~ +2,147,483,647) Return: YES NO An error has occurred. Use the i8094MF_GET_ERROR_CODE() function to identify the error. No errors. Example: i8094MF_LINE_3D(1, 10000, 10000, 10000); //execute the 3-axis linear interpolation motion on module 1. 3-axis linear interpolation motion ICPDAS 73 I-8094 Software User Manual 6.2.12 2-Axis Circular Interpolation Motion (an Arc) BYTE i8094MF_ARC_CW(BYTE cardNo, long cp1, long cp2, long fp1, long fp2) Description: This function executes a 2-axis circular interpolation motion in a clockwise (CW) direction. Parameters: cardNo: cp1: cp2: fp1: fp2: Module number The relative position of the center to the current position of axis 1 in pulses. (-2,147,483,648 ~ +2,147,483,647) The relative position of the center to the current position of axis 2 in pulses. (-2,147,483,648 ~ +2,147,483,647) The displacement of the axis 1 in pulses. (-2,147,483,648 ~ +2,147,483,647) Displacement of the axis 2 in pulses. (-2,147,483,648 ~ +2,147,483,647) Return: YES NO An error has occurred. Use the i8094MF_GET_ERROR_CODE () function to identify the error. No errors. Example: i8094MF_ARC_CW(1, -5000, -5000, -10000, -10000); //Issues a command to perform a circular motion (an arc) //in a CW direction. Please refer to the following figure. 2-axis circular motion in a CW direction ICPDAS 74 I-8094 Software User Manual BYTE i8094MF_ARC_CCW(BYTE cardNo, long cp1, long cp2, long fp1, long fp2) Description: This function execute a 2-axis circular interpolation motion in a counter-clockwise (CCW) direction. Parameters: cardNo: cp1: cp2: fp1: fp2: Module number The relative position of the center to the current position of axis 1 in pulses. (-2,147,483,648 ~ +2,147,483,647) The relative position of the center to the current position of axis 2 in pulses. (-2,147,483,648 ~ +2,147,483,647) The displacement of the axis 1 in pulses. (-2,147,483,648 ~ +2,147,483,647) Displacement of the axis 2 in pulses. (-2,147,483,648 ~ +2,147,483,647) Return: YES NO An error has occurred. Use the i8094MF_GET_ERROR_CODE() function to identify the errors. No errors. Example: i8094MF_ARC_CCW(1, -5000, -5000, -10000, -10000); //Issues a command to perform a circular motion (an arc) //in a CCW direction. Refer to the following figure. 2-axis circular motion in a CCW direction ICPDAS 75 I-8094 Software User Manual 6.2.13 2-Axis Circular Interpolation Motion (a Complete Circle) BYTE i8094MF_CIRCLE_CW(BYTE cardNo, long cp1, long cp2) Description: This function executes a 2-axis circular interpolation motion in a clockwise (CW) direction. Parameters: cardNo: cp1: cp2: Module number The relative position of the center to the current position of axis 1 in pulses. (-2,147,483,648 ~ +2,147,483,647) The relative position of the center to the current position of axis 2 in pulses. (-2,147,483,648 ~ +2,147,483,647) Return: YES NO An error has occurred. Use the i8094MF_GET_ERROR_CODE() function to identify the errors. No errors. Example: i8094MF_CIRCLE_CW(1, 0, 10000); //execute a circular motion (a complete circle) in a CW direction on module 1. BYTE i8094MF_CIRCLE_CCW(BYTE cardNo, long cp1, long cp2) Description: This function executes a 2-axis circular interpolation motion in a counter-clockwise (CCW) direction. Parameters: cardNo: cp1: cp2: ICPDAS Module number The relative position of the center to the current position of axis 1 in pulses. (-2,147,483,648 ~ +2,147,483,647) The relative position of the center to the current position of axis 2 in pulses. (-2,147,483,648 ~ +2,147,483,647) 76 I-8094 Software User Manual Return: YES NO An error has occurred. Use the i8094MF_GET_ERROR_CODE () function to identify the error. No errors Example: i8094MF_CIRCLE_CCW(1, 0, 10000); //execute a circular motion (a circle) in CCW direction //on module 1 ICPDAS 77 I-8094 Software User Manual 6.3 Synchronous Actions 6.3.1 Setting the Synchronous Action void i8094MF_SYNC_ACTION(BYTE cardNo, WORD axis1, WORD axis2, WORD nSYNC, WORD nDRV, WORD nLATCH, WORD nPRESET) Description: This function sets the activation factors (provocatives) and the specified action when a specified activation factor occurs. Parameters: cardNo: axis1: axis2: Module number This is the monitored axis. It will be checked by hardware. The axis can be either X, Y, Z, or U. (Please refer to Table 2-1.) This defined the other axes (or axis) that will take action when one of the activation factors occurs. The axes are defined in the following table. axis1 X Y Z U none Y Z YZ U YU ZU YZU none Z U ZU X ZX UX ZUX none U X UX Y UY XY UXY none X Y XY Z XZ YZ XYZ axis2 0 1 2 3 4 5 6 7 nSYNC: It defines the activation factors. Multiple activation factors can be defined at the same time. Available active factors are listed in the following table. Value Event 0x0000 ICPDAS 0x0001 P ≥ C+ 0x0002 P<C+ Explanation Disable the synchronous action The logical/real position counter value exceeded the COMP+ register value. Use the i8094MF_SET_COMPARE() function for selection of a logical/real position. The logical/real position counter value became less than the COMP+ register value. Use the i8094MF_SET_COMPARE() function for selection of a logical/real position. 78 I-8094 Software User Manual 0x0004 P<C- 0x0008 P ≥ C- 0x0010 0x0020 0x0040 0x0080 D-STA D-END IN3 ↑ IN3 ↓ The logical/real position counter value became less than the COMP- register value. Use the i8094MF_SET_COMPARE() function for selection of a logical/real position. The logical/real position counter value exceeded the COMP- register value. Use the i8094MF_SET_COMPARE() function for selection of a logical/real position. Driving started. Driving terminated. The nIN3 signal rose from the Low to the High level. The nIN3 signal fell from the High to the Low level. For example, if the factors P ≥ C+ and IN3 ↑ are set, the nSYNC value is 0x0041 (0x0001 + 0x0040 = 0x0041). nDRV: It defines the actions that are related with axial driving. Available actions are listed in the following table. Only one driving action can be chosen. Value Symbol 0 ICPDAS 1 FDRV+ 2 FDRV- 3 CDRV+ 4 CDRV- 5 6 SSTOP ISTOP Explanation Disable driving action. Activates fixed pulse driving in the + direction. It must set the nPRESET value to be “OPSET” which indicates that i8094MF_SET_PRESET() function will set the offset value for this FDRV. Therefore, the companion function, i8094MF_SET_PRESET(), is necessary. However, this command does not take effect if the assigned axes, axis2, are moving. Activates fixed pulse driving in the - direction. It must set the nPRESET value to be “OPSET” which indicates that i8094MF_SET_PRESET() function will set the offset value for this FDRV. Therefore, the companion function, i8094MF_SET_PRESET(), is necessary. However, this command does not take effect if the assigned axes, axis2, are moving. Activates continuous pulse driving in the + direction. However, this command does not take effect if the assigned axes, axis2, are moving. Activates continuous pulse driving in the - direction. However, this command does not take effect if the assigned axes, axis2, are moving. Stop driving in deceleration. Stop driving immediately. 79 I-8094 Software User Manual It defines the actions that is related of latching position. Available nLATCH: actions are listed in the following table. Only one of these actions can be chosen. Value Symbol Explanation 0 Disable position latch function. Saves the current logical position counter value (LP) 1 LPSAV in the synchronous buffer register (BR). [LP → LATCH] Saves the current real position counter value (EP) in 2 EPSAV the synchronous buffer register (BR). [EP → LATCH] After the event is occoured, the i8094MF_GET_LATCH() function can be use to get the latched value. nPRESET: It defines the actions that is related of latching position. Available actions are listed in the following table. Only one of these actions can be chosen. Value Symbol 0 1 LPSET 2 EPSET 3 OPSET 4 VLSET Explanation Disable setting function. Indicates that a new value for the logical position (LP) will be set. The new value will be set by i8094MF_SET_PRESET() function. [LP ← PRESET] Indicates that a new value for the real position (EP) will be set. The new value will be set by i8094MF_SET_PRESET() function. [EP ← PRESET] Indicates that a new offset value (P) for the fixed pulse driving will be set. The new value will be set by i8094MF_SET_PRESET() function. [P ← PRESET] Indicates that a new speed value (V) will be set. The new value will be set by i8094MF_SET_PRESET() function. [V ← PRESET] Return: None Example: //Ex1. When the rising edge event of IN3 signal of U-axis occurred, // the real position (EP) is latched and the driving speed of U-axis is changed, too. ICPDAS 80 I-8094 Software User Manual i8094MF_SYNC_ACTION(cardNo, AXIS_U, 0, 0X0040, 0, 2, 4); i8094MF_SET_MAX_V(cardNo, AXIS_U, 5000); //Set the maximum speed of U-axis to 5K PPS. i8094MF_NORMAL_SPEED(cardNo, AXIS_U, 0); //Set the Acc/Dec mode to be symmetric T-curve. i8094MF_SET_V(cardNo, AXIS_U, 2000); //Set the speed of U-axis to 2000 PPS. i8094MF_SET_A(cardNo, AXIS_U, 100000); //Set the acceleration of U-axis to 100K PPS/S. i8094MF_SET_SV(cardNo, AXIS_U, 100); //Set the start speed of U-axis to 100 PPS. i8094MF_FIXED_MOVE(cardNo, AXIS_U, 10000); //Set the fixed pulse moving command to 10000 Pulses. i8094MF_SET_PRESET(cardNo, AXIS_U, 100); //Set the new speed of U-axis after even activation to 100 PPS. while (i8094MF_STOP_WAIT(cardNo, AXIS_U) == NO) { //If the U-axis of the assigned card is not stop, keep looping DoEvents(); Sleep(1); //Release the control for a moment }; //After the event occurred, following line can get latched position. long Vsb = i8094MF_GET_LATCH(cardNo, AXIS_U); //Ex2. When the EP value of U-axis exceeds COMP+ (5,000), //controller will move the Y-axis by 2,000 PPS. i8094MF_SYNC_ACTION(cardNo, AXIS_U, 2, 0X0001, 1, 0, 3); i8094MF_SET_COMPARE(cardNo, AXIS_U, 0, 1, 5000); //Set the COMP+ of U-axis 5,000 and te compared source is real position (EP). i8094MF_SET_MAX_V(cardNo, AXIS_YU, 9000); //Set the maximum speed of axesY and U to 9K PPS. i8094MF_NORMAL_SPEED(cardNo, AXIS_YU, 0); //Set the Acc/Dec mode to be symmetric T-curve. i8094MF_SET_V(cardNo, AXIS_YU, 3000); //Set the speed of axes Y and U to 3,000 PPS. i8094MF_SET_A(cardNo, AXIS_YU, 200000); //Set the acceleration of axes Y and U to 200K PPS/S. i8094MF_SET_SV(cardNo, AXIS_YU, 200); //Set the start speed of axes Y and U to 200 PPS. i8094MF_SET_PRESET(cardNo, AXIS_Y, 2000); //Set the fixed pulse drive of Y-axis to be 2,000 PPS when the activating //event occurs. i8094MF_FIXED_MOVE(cardNo, AXIS_U, 10000); //Command the U-axis to move 10,000 Pulses and the synchronous action //will happen after a while. ICPDAS 81 I-8094 Software User Manual 6.3.2 Setting the COMPARE value void i8094MF_SET_COMPARE(BYTE cardNo, WORD axis, WORD nSELECT, WORD nTYPE, long data) Description: This function sets the values of COMPARE registers. Howerer, it will disable the functions of software limits. Parameters: cardNo: axis: nSELECT: nTYPE: data: Module number Axis or axes (Please refer to Table 2-1) Select the COMPARE register 0 COMP+ 1 COPMSelect the souece for comparison 0 Position(P) = LP 1 Position(P) = EP Set the COMPARE value: -2,147,483,648 ~ +2,147,483,647 Return: None Example: i8094MF_SET_COMPARE(cardNo, AXIS_U, 0, 1, 5000); //Set the comparison function for U-Axis. //Set the compared source to be EP; and the COMP+ value to 5000. ICPDAS 82 I-8094 Software User Manual 6.3.3 Get the LATCH value long i8094MF_GET_LATCH(BYTE cardNo, WORD axis) Description: This function gets the values from the LATCH register. Parameters: cardNo: axis: Module number The axis can be either X, Y, Z, or U. Please refer to Table 2-1. Return: Value of the LATCH register: -2,147,483,648 ~ +2,147,483,647 Example: long data = i8094MF_GET_LATCH(1, AXIS_Y); //Get the latched value which is from Y-axis of card 1. 6.3.4 Set the PRESET data for synchronous action void i8094MF_SET_PRESET(BYTE cardNo, WORD axis, long data) Description: This function sets the PRESET value for synchronous action. Parameters: cardNo: Module number axis: The axis can be either X, Y, Z, or U. Please refer to Table 2-1. data: LP: -2,147,483,648 ~ +2,147,483,647 EP: -2,147,483,648 ~ +2,147,483,647 P : -2,147,483,648 ~ +2,147,483,647 V : Please refer to section 2.5. Return: None Example: Please refer to the examples in section 6.3.1. ICPDAS 83 I-8094 Software User Manual 6.4 Continuous Interpolation If it is broken and stopped,please solve it refer in section 6.5.5 ! 6.4.1 2-Axis Rectangular Motion BYTE i8094MF_RECTANGLE( BYTE cardNo, WORD axis1, WORD axis2, WORD nAcc, WORD Sp, WORD nDir, long Lp, long Wp, long Rp, DWORD RSV,DWORD RV, DWORD RA, DWORD RD) Description: Continuous interpolation will be performed to create a rectangular motion, which is formed by 4 lines and 4 arcs. The length of each side can be changed. The radius of each arc is the same and it can also be changed. The deceleration point will be calculated automatically. This is a command macro command that appears in various motion applications. However, it is a software macro-function; therefore, it requires CPU resource to run this function. Parameters: cardNo: axis1: axs2: nAcc: Sp: nDir: Lp: Wp: Rp: RSV: RV: RA: RD: Module number The first axis (axis 1). Please refer to Table 2-1. The first axis and It can be either X, Y, Z, or U. The second (axis 2). Please refer to Table 2-1. The first axis and It can be either X, Y, Z, or U. 0 constant vector speed interpolation mode 1 symmetric T-curve Acc/Dec interpolation mode Start point 0 ~ 7. (Sp0 ~ Sp7 are defined in the following figure) Direction of movement 0: CCW; 1: CW Length in Pulses (1 ~ 2,147,483,647) Width in Pulses (1 ~ 2,147,483,647) Radius of each in pulses (1 ~ 2,147,483,647) Starting speed (in PPS) Vector speed (in PPS) Acceleration (PPS/Sec) Deceleration of the last segment (in PPS/Sec) Return: YES NO ICPDAS An error has occurred. Use the i8094MF_GET_ERROR_CODE() function to identify the error. No errors. 84 I-8094 Software User Manual Example: BYTE cardNo=1; //select module 1. int sv=1000; //starting speed: 1000 PPS. int v=10000; //vector speed: 10000 PPS. int a=5000; //acceleration: 5000 PPS/Sec. int d=5000; //deceleration: 5000 PPS/Sec. i8094MF_SET_MAX_V(cardNo, AXIS_XYZU, 16000); //set the maximum speed to 16000 PPS. i8094MF_RECTANGLE(cardNo, AXIS_X, AXIS_Y, 1, 0, 0, 20000, 10000, 1000, sv, v, a, d); //execute a rectangular motion on the XY plane ICPDAS 85 I-8094 Software User Manual 6.4.2 2-Axis Continuous Linear Interpolation BYTE i8094MF_LINE_2D_INITIAL(BYTE cardNo, WORD axis1, WORD axis2, DWORD VSV,DWORD VV, DWORD VA) Description: This function sets the necessary parameters for a 2-axis continuous linear interpolation using symmetric T-curve speed profile. Parameters: cardNo: axis1: axis2: VSV: VV: VA: Module number The first axis (axis 1). Please refer to Table 2-1. The first axis and It can be either X, Y, Z, or U. The second axis (axis 2). Please refer to Table 2-1. The second axis and It can be either X, Y, Z, or U. Starting speed (in PPS) Vector speed (in PPS) Vector acceleration (PPS/Sec) Return: None Example: i8094MF_LINE_2D_INITIAL(…); //This function should be defined before the i8094MF_LINE_2D_CONTINUE() //function is used. Please refer to the example of this function. BYTE i8094MF_LINE_2D_CONTINUE(BYTE cardNo, WORD nType, long fp1, long fp2) Description: This function executes a 2-axis continuous linear interpolation. However, it is a software macro-function; therefore, it requires CPU resource to run this function. Parameters: cardNo: nType: fp1: fp2: Module number 0: 2-axis linear continuous interpolation 1: end of 2-axis linear continuous interpolation The assigned number of pulses for the axis 1 (in Pulses) (-2,147,483,648 ~ +2,147,483,647) The assigned number of pulses for the axis 2 (in Pulses) (-2,147,483,648 ~ +2,147,483,647) Return: YES ICPDAS An error has occurred. 86 I-8094 Software User Manual NO Use the i8094MF_GET_ERROR_CODE () function to identify the error. No errors. Example: BYTE cardNo=1; //select module 1. int sv=300; //starting speed: 300 PPS. int v=18000; //vector speed: 18000 PPS. long a=500000L; //acceleration: 500000 PPS/Sec. int loop1; i8094MF_SET_MAX_V(cardNo, AXIS_XYZU,160000L); i8094MF_LINE_2D_INITIAL(cardNo, AXIS_X, AXIS_Y, sv, v, a); for (loop1=0; loop1<10000; loop1++) { i8094MF_LINE_2D_CONTINUE(cardNo, 0, 100, 100); i8094MF_LINE_2D_CONTINUE(cardNo, 0, -100, -100); } i8094MF_LINE_2D_CONTINUE(cardNo, 1, 100, 100); ICPDAS 87 I-8094 Software User Manual 6.4.3 3-Axis Continuous Linear Interpolation BYTE i8094MF_LINE_3D_INITIAL(BYTE cardNo, WORD axis1, WORD axis2, WORD axis3, DWORD VSV, DWORD VV, DWORD VA) Description: This function sets the necessary parameters for a 3-axis continuous linear interpolation using symmetric T-curve speed profile. Parameters: cardNo: axis1: axis2: axis3: VSV: VV: VA: Module number The first axis (axis 1). Please refer to Table 2-1. The first axis and It can be either X, Y, Z, or U. The second axis (axis 2). Please refer to Table 2-1. The second axis and It can be either X, Y, Z, or U. The third axis (axis 3). Please refer to Table 2-1. The third axis and It can be either X, Y, Z, or U. Starting speed (in PPS) Vector speed (in PPS) Vector acceleration (PPS/Sec) Return: None Example: i8094MF_LINE_3D_INITIAL(…); //This function should be defined before the i8094MF_LINE_3D_CONTINUE() //function is used. Please refer to the example of this function. ICPDAS 88 I-8094 Software User Manual BYTE i8094MF_LINE_3D_CONTINUE(BYTE cardNo, WORD nType, long fp1, long fp2, long fp3) Description: This function execute a 3-axis continuous linear interpolation. However, it is a software macro-function; therefore, it requires CPU resource to run this function. Parameters: cardNo: nType: fp1: fp2: fp3: Module number 0: 3-axis linear continuous interpolation 1: end of 2-axis linear continuous interpolation The assigned number of pulses for axis 1 (-2,147,483,648 ~ +2,147,483,647) The assigned number of pulses for axis 2 (-2,147,483,648 ~ +2,147,483,647) The assigned number of pulses for axis 3 (-2,147,483,648 ~ +2,147,483,647) Return: YES NO An error has occurred. Use the i8094MF_GET_ERROR_CODE () function to identify the error. No errors. Example: BYTE cardNo=1; //select module 1. int sv=300; //starting speed: 300 PPS int v=18000; //vector speed: 18000 PPS long a=500000L; //acceleration: 500000 PPS/Sec int loop1; i8094MF_SET_MAX_V(cardNo, AXIS_XYZU,160000L); i8094MF_LINE_3D_INITIAL(cardNo, AXIS_X, AXIS_Y, sv, v, a); for (loop1=0; loop1<10000; loop1++) { i8094MF_LINE_3D_CONTINUE(cardNo, 0, 100, 100, 100); i8094MF_LINE_3D_CONTINUE(cardNo, 0, -100, -100, -100); } i8094MF_LINE_3D_CONTINUE(cardNo, 1, 100, 100, 100); ICPDAS 89 I-8094 Software User Manual 6.4.4 Mixed Linear and Circular 2-axis motions in Continuous Interpolation void i8094MF_MIX_2D_INITIAL(BYTE cardNo, WORD axis1, WORD axis2, WORD nAcc, DWORD VSV , DWORD VV , DWORD VA) Description: This function does the initial settings for mixed linear and circular 2-axis motions in continuous interpolation. Parameters: cardNo: axis1: axis2: nAcc: VSV: VV: VA: Module number The first axis (axis 1). Please refer to Table 2-1. The first axis and It can be either X, Y, Z, or U. The second axis (axis 2). Please refer to Table 2-1. 0 constant speed (VV) 1 symmetric T-curve Acc/Dec (VSV、VV、VA) Starting speed (in PPS) Vector speed (in PPS) Vector acceleration (PPS/Sec) Return: None Example: i8094MF_MIX_2D_INITIAL(…); //This function should be defined before the i8094MF_MIX_2D_CONTINUE() //function is used. Please refer to the example of this function. ICPDAS 90 I-8094 Software User Manual BYTE i8094MF_MIX_2D_CONTINUE(BYTE cardNo, WORD nAcc, WORD nType, long cp1, long cp2, long fp1, long fp2) Description: This function executes mixed linear and circular 2-axis motion in continuous interpolation. However, it is a software macro-function; therefore, it requires CPU resource to run this function. Parameters: cardNo: nAcc: Module number 0 continuous interpolation. 1 it is the last command of this continuous interpolation. In Acc/Dec mode, it will perform a deceleration stop. In constant speed mode, it will directly stop rather than decelerate. nType: 1 2 3 4 5 cp1: cp2: fp1: fp2: fp1: i8094MF_LINE_2D(BYTE cardNo, long fp1, long fp2); i8094MF_ARC_CW(BYTE cardNo, long cp1, long cp2, long fp1, long fp2); i8094MF_ARC_CCW(BYTE cardNo, long cp1, long cp2, long fp1, long fp2); i8094MF_CIRCLE_CW(BYTE cardNo, long cp1, long cp2); i8094MF_CIRCLE_CCW(BYTE cardNo, long cp1, long cp2); It assigns the center point data at axis 1. (-2,147,483,648 ~ +2,147,483,647) It assigns the center point data at axis 2. (-2,147,483,648 ~ +2,147,483,647) It assigns the end point data at axis 1. (-2,147,483,648 ~ +2,147,483,647) It assigns the end point data at axis 2. (-2,147,483,648 ~ +2,147,483,647) The assigned number of pulses for axis 1 (-2,147,483,648 ~ +2,147,483,647) Return: YES NO ICPDAS An error has occurred. Use the i8094MF_GET_ERROR_CODE () function to identify the error. No errors. 91 I-8094 Software User Manual Example: BYTE cardNo=1; int sv=300; int v=18000; long a=500000L; //select module 1. //starting speed: 300 PPS //vector speed: 18000 PPS //acceleration: 500000 PPS/Sec unsigned short loop1; i8094MF_SET_MAX_V(cardNo, AXIS_XYZU, 160000L); i8094MF_MIX_2D_INITIAL(cardNo, AXIS_X, AXIS_Y, 1, sv, v, a); for (loop1 = 0; loop1 < 10000; loop1++) { i8094MF_MIX_2D_CONTINUE (cardNo, 0, 1, 0, 0, 100, 100); i8094MF_MIX_2D_CONTINUE (cardNo, 0, 2, 100, 0, 100, 100); } i8094MF_MIX_2D_CONTINUE (cardNo, 1, 4, 100, 100, 0, 0); ICPDAS 92 I-8094 Software User Manual 6.4.5 Multi-Segment Continuous Interpolation (Using Array) BYTE i8094MF_CONTINUE_INTP( BYTE cardNo, WORD axis1, WORD axis2, WORD axis3, WORD nAcc, DWORD VSV, DWORD VV, DWORD VA, DWORD VD, BYTE nType[ ], long cp1[ ], long cp2[ ], long fp1[ ], long fp2[ ], long fp3[ ]) Description: This function executes a multi-segment continuous interpolation. Those segments are stored in arrays declared in the arguments . The speed profile can be either a constant speed or a symmetric T-curve. The deceleration point will be calculated automatically. However, it is a software macro-function; therefore, it requires CPU resource to run this function. Parameters: cardNo: axis1: axis2: axis3: nAcc: VSV: VV: VA: VD: nType[ ]: 1 2 3 4 5 6 7 cp2[ ]: fp2[ ]: ICPDAS Maximum segment: 1024 (0 ~ 1023). It contains the interpolation commands defined as follows. i8094MF_LINE_2D(BYTE cardNo, long fp1, long fp2); i8094MF_ARC_CW(BYTE cardNo, long cp1, long cp2, long fp1, long fp2); i8094MF_ARC_CCW(BYTE cardNo, long cp1, long cp2, long fp1, long fp2); i8094MF_CIRCLE_CW(BYTE cardNo, long cp1, long cp2); i8094MF_CIRCLE_CCW(BYTE cardNo, long cp1, long cp2); i8094MF_LINE_3D(BYTE cardNo, long fp1, long fp2, long fp3); It indicates the end of continuous interpolation. cp1[ ]: fp1[ ]: Module number The first axis (axis 1). Can be either X, Y, Z, or U axis. Please refer to Table 2-1 for the axis definition. The second axis (axis 2). Can be either X, Y, Z, or U axis. The third axis (axis 3). Can be either X, Y, Z, or U axis. 0 a constant speed interpolation. Please set VV. 1 a symmetric T-curve interpolation. Please set VSV, VV, VA, and VD. The starting speed (in PPS) Interpolation vector speed (in PPS) Acceleration (in PPS/Sec) Deceleration (in PPS/Sec) It contains a list of segment center point data at axis 1. (-2,147,483,648 ~ +2,147,483,647) It contains a list of segment center point data at axis 2. (-2,147,483,648 ~ +2,147,483,647) This array contains a list of segment end point data at axis 1. (-2,147,483,648 ~ +2,147,483,647) This array contains a list of segment end point data at axis 2. (-2,147,483,648 ~ +2,147,483,647) 93 I-8094 Software User Manual fp3[ ]: This array contains a list of segment end point data at axis 3. (-2,147,483,648 ~ +2,147,483,647) (Note: The 2-axis and 3-axis motion commands can not be mixed together when applying commands. Please fill 0 for the cell values in the array if these cells are not used.) YES An error has occurred. Use the i8094MF_GET_ERROR_CODE () function to identify the error. No errors. Return: NO Example: BYTE cardNo=1; //select module 1. int sv=100; //set the starting speed to 100 PPS. int v=3000; //set the speed to 3000 PPS. int a=2000; //set the acceleration to 2000 PPS/Sec. int d=2000; //set the deceleration to 2000 PPS/Sec. i8094MF_SET_MAX_V(cardNo, AXIS_XYZU, 20000); //set the maximum speed to 20K PPS. BYTE nType[10]= { 1, 2, 1, 2, 1,7,0,0,0,0}; long cp1[10]= { 0, 10000, 0, 0, 0,0,0,0,0,0}; long cp2[10]= { 0, 0, 0,-10000, 0,0,0,0,0,0}; long fp1[10]= { 10000, 10000, 1000, 10000,-31000,0,0,0,0,0}; long fp2[10]= { 10000, 10000, 0,-10000,-10000,0,0,0,0,0}; long fp3[10]= { 0, 0, 0, 0, 0,0,0,0,0,0}; //put data of the required segments in arrays. i8094MF_CONTIUNE_INTP( cardNo, AXIS_X, AXIS_Y, 0, 1, sv, v, a, d, nType, cp1, cp2, fp1, fp2, fp3); //execute the 2-axis continuous interpolation. //The deceleration point will be calculated automatically. //For this example, the final position of this motion will return to the starting point. ICPDAS 94 I-8094 Software User Manual 6.4.6 3-Axis Helical Motion BYTE i8094MF_HELIX_3D( BYTE cardNo, WORD axis1, WORD axis2, WORD axis3, WORD nDir, DWORD VV , long cp1, long cp2, long cycle, long pitch) Description: This function performs a 3-axis helical motion. However, it is a software macro-function; therefore, it requires CPU resource to run this function. Parameters: cardNo: axis1: Axis2: Axis3: nDir: VV: cp1: cp2: cycle: pitch: Module number The first axis (axis 1). Can be X, Y, Z, or U axis. Please refer to Table 2-1 for the axis definition. The second axis (axis 2). Can be either X, Y, Z, or U axis. The third axis (axis 3). Can be either X, Y, Z, or U axis. 0 Move in a CW direction. 1 Move in a CCW direction. Vector speed (in PPS) The value of center at axis 1 (-2,147,483,648 ~ +2,147,483,647) The value of center at axis 2 (-2,147,483,648 ~ +2,147,483,647) Number of cycles Pitch per revolution (the advanced distance for each revolution) (-2,147,483,648 ~ +2,147,483,647) Return: YES NO An error has occurred. Use the i8094MF_GET_ERROR_CODE () function to identify the error. No errors. Example: BYTE cardNo=1; //select module 1. //=============================================== i8094MF_SET_MAX_V(cardNo, AXIS_XYZU,160000L); //set maximum speed for all axes to 16K PPS. long v=50000; //set vector speed to 50K PPS. i8094MF_HELIX_3D(cardNo, AXIS_Y, AXIS_Z, AXIS_X, 1, v, 0, 1000, 5, -2000); //the circular motion is on YZ plane, and the linear motion is ICPDAS 95 I-8094 Software User Manual //along the X axis. //=============================================== i8094MF_SET_MAX_V(cardNo, AXIS_XYZU, 160000L); //set the maximum speed for all axes to 160K PPS. long v=100000L; //set vector speed to 100K PPS. i8094MF_HELIX_3D(cardNo, AXIS_Y, AXIS_Z, AXIS_U, 1, v, 0, 25000, 50, 3600); //the circular motion is on YZ plane, and the linear motion is along. //the U axis. ICPDAS 96 I-8094 Software User Manual 6.4.7 2-Axis Ratio Motion BYTE i8094MF_RATIO_INITIAL(BYTE cardNo, WORD axis1, WORD axis2, DWORD SV , DWORD V , DWORD A, float ratio) Description: This function sets the Initial values for ratio motion (motion in ratio) using a symmetric T-curve speed profile. However, it is a software macro-function; therefore, it requires CPU resource to run this function. Parameters: cardNo: axis1: Axis2: SV: V: A: ratio: Module number The first axis (axis 1). Can be either X, Y, Z, or U axis. Please refer to Table 2-1 for the axis definition. The second axis (axis 2). Can be either X, Y, Z, or U axis. Set the value for the starting speed ( in PPS). Set the value for the vector speed (in PPS). Set the acceleration value (in PPS/Sec). Set the ratio value between the two assigned axes. Return: None Example: i8094MF_RATIO_INITIAL(…); //Initial setting for i8094MF_RATIO_2D(…) function. //Please refer to the example of i8094MF_RATIO_2D() function. BYTE i8094MF_RATIO_2D(BYTE cardNo, WORD nType, long data, WORD nDir) Description: This function performs a two-axis ratio motion. Parameters: cardNo: nType: data: nDir: Module number 0 Perform the ratio motion. 1 Declare the end of ratio motion. The pulse number of axis1 (-2,147,483,648 ~ +2,147,483,647) Direction of the second axis. 0: CW; 1: CCW Return: ICPDAS 97 I-8094 Software User Manual YES NO An error has occurred. Use the i8094MF_GET_ERROR_CODE () function to identify the error. No errors. Example: BYTE cardNo=1; //select module 1. int sv=300; //set starting speed to 300 PPS. int v=18000; //set vector speed to 18000 PPS. long a=500000L; //set acceleration value to 500K PPS/Sec. int loop1, loop2; i8094MF_SET_MAX_V(cardNo, 0Xf,160000L); //set maximum speed value to 18000 PPS. i8094MF_RATIO_INITIAL(cardNo,AXIS_U, AXIS_X, sv, v, a, 0.36f); //assign U axis as the axis 1 and X axis as the axis 2. //The ratio is 0.36. for (loop2 = 0; loop2 < 5; loop2++) { for (loop1 = 0; loop1 < 5; loop1++) { i8094MF_RATIO_2D(cardNo, 0, 3600, 0); //perform the ratio motion in the CW direction. i8094MF_RATIO_2D(cardNo, 0, 3600, 1); //perform the ratio motion in the CCW direction. } i8094MF_RATIO_2D(cardNo, 0, 7200, 0); i8094MF_RATIO_2D(cardNo, 0, 3600, 1); } i8094MF_RATIO_2D(cardNo, 1, 7200, 0); //End the ratio motion. ICPDAS 98 I-8094 Software User Manual 6.5 Set the Interrupt Factors 6.5.1 Set the Interrupt Factors void i8094MF_INTFACTOR_ENABLE(BYTE cardNo, WORD axis, WORD nINT) Description: This function sets the interrupt factors Parameters: cardNo: axis: nINT Module number Axis or axes (Please refer to Table 2-1) Interrupt factors Value 0 Symbol PULSE 1 P>=C- 2 P<C- 3 P>=C+ 4 P<C+ 5 C-END 6 C-STA 7 D-END Statement Interupt occurs when pulse is up Interrupt occurs when the value of logical / real position counter is larger than or equal to that of COMP- register. The COMP- must be pre-configired with i8094MF_SET_COMPARE( ) (please refer to Section 6.3.2) Interrupt occurs when the value of logical / real position counter is smaller than that of COMPregister. The COMP- must be pre-configired with i8094MF_SET_COMPARE( ) (please refer to Section 6.3.2) Interrupt occurs when the value of logical / real position counter is smaller than that of COMP+ register. The COMP+ must be pre-configired with i8094MF_SET_COMPARE( ) (please refer to Section 6.3.2) Interrupt occurs when the value of logical / real position counter is larger than or equal to that of COMP+ register. The COMP+ must be pre-configired with i8094MF_SET_COMPARE( ) (please refer to Section 6.3.2) Interrupt occurs at the end of the constant speed drive or completion of Acceleration Offset Pulse output. Interrupt occurs at the start of the constant speed drive or begin of Acceleration Offset Pulse output. Interrupt occurs when the driving is finished Return: None ICPDAS 99 I-8094 Software User Manual Example: HANDLE hINT; //Interrupt event handle HANDLE i8094_hThread; //IST handle DWORD WINAPI i8094_ThreadFunction(LPVOID lParam); //IST function BYTE CardNo=1; BYTE Slot1=1; //MFC button event: Create the thread and set the interrupt factor void CI8094QCDlg::OnTestint() { DWORD dwThreadID = 0; HWND hWnd = NULL; //Create thread: i8094_ThreadFunction i8094_hThread = CreateThread(NULL, 0, i8094_ThreadFunction, hWnd, 0, &dwThreadID); BYTE axis=AXIS_XYZU; i8094MF_SET_MAX_V(CardNo, axis, 20000); i8094MF_NORMAL_SPEED(CardNo, axis, 0); i8094MF_SET_V(CardNo, axis, 20000); i8094MF_SET_A(CardNo, axis, 100000); i8094MF_SET_SV(CardNo, axis, 20000); i8094MF_SET_AO(CardNo, axis, 0); //Initialize the interrupt hINTP=Slot_Register_Interrupt(Slot1); //Set the interrupt factor: D-END i8094MF_INTFACTOR_ENABLE(CardNo, AXIS_X, 7); // 4-Axis fixed pulse drive i8094MF_FIXED_MOVE(CardNo, AXIS_XYZU, 10000); while (i8094MF_STOP_WAIT(CardNo, 0xf) == NO) { //Wait for motion done DoEvents(); Sleep(1); } } //IST function DWORD WINAPI i8094KW_ThreadFunction(LPVOID lParam) { DWORD dwEvent; WORD RR3_X; if(hINTP != NULL) { //Wait the event object dwEvent = WaitForSingleObject(hINTP, INFINITE); switch(dwEvent) ICPDAS 100 I-8094 Software User Manual { case WAIT_OBJECT_0: //Get the interrupt event object successfully //While the driving stop, clear the position counter i8094MF_SET_LP(CardNo, AXIS_X, 0) // … //Other user codes in the IST // … //End of the interrupt Slot_Interrupt_Done(Slot1); //Get the interrupt status RR3_X = i8094_GET_RR3(CardNo, AXIS_X); //Disable the interrupt factor i8094MF_INTFACTOR_DISABLE(CardNo, AXIS_X); //Close the interrupt Slot_Interrupt_Close(Slot1); break; case WAIT_TIMEOUT: break; case WAIT_FAILED: break; } } return 1; } Note: Please refer the three functions: Slot_Register_Interrupt(BYTE Slot), Slot_Interrupt_Done(BYTE Slot), Slot_Interrupt_Close(BYTE Slot) in the WinConSDK of Wincon GM1(w-8331-GM1/w-8731-GM1). ICPDAS 101 I-8094 Software User Manual 6.5.2 Interrupt Disabled void i8094MF_INTFACTOR_DISABLE(BYTE cardNo, WORD axis) Description: This function disables the interrupt factors Parameters: cardNo: axis: Module number Axis or axes (Please refer to Table 2-1) Return: None Example: Please refer to 6.5.1 ICPDAS 102 I-8094 Software User Manual 6.5.3 Read the Interrupt Occurrence WORD i8094MF_GET_RR3(BYTE cardNo, WORD axis) Description: Read the RR3 register that reflects the occurrence of Interrupt. Parameters: cardNo: axis: Module number Axis or axes (Please refer to Table 2-1) Return: The content of RR3 register. RR3 Value 0x001 PULSE 0x002 P>=C- 0x004 P<C- 0x008 P<C+ 0x010 P>=C+ 0x020 C-END 0x040 C-STA 0x080 D-END 說明 When the drive pulse is up (drive pulseis set on the positive logical level) Once the value o flogic / real position counter is larger than that of COMP- register Once the value o flogic / real position counter is smaller than that of COMP- register Once the value o flogic / real position counter is smaller than that of COMP+ register Once the value o flogic / real position counter is larger than that of COMP+ register Interrupt occurs at the end of the constant speed drive or completion of Acceleration Offset Pulse output. Interrupt occurs at the start of the constant speed drive or begin of Acceleration Offset Pulse output. Interrupt occurs when the driving is finished Example: i8094MF_GET_RR3 (cardNo, AXIS_X); //read the Interrupt status of AXIS_X ICPDAS 103 I-8094 Software User Manual 6.6 Other functions 6.6.1 Holding the Driving Command void i8094MF_DRV_HOLD(BYTE cardNo, WORD axis) Description: This command is usually used when users desire to starti multi-axis driving simultaneously. When this command is issued, users may write other driving commands to the control card. All the driving commands will be held after i8094MF_DRV_HOLD() is issued, and these commands will be started once the i8094MF_DRV_START() is issued. However, if in driving, this command will not cause the driving to be stopped. But the next command will be held. Parameters: cardNo: axis: Module number Axis or Axes (Please refer to Table 2-1 for the axis definition.) Return: None Example: Please refer to the example in section 6.5.2. ICPDAS 104 I-8094 Software User Manual 6.6.2 Release the Holding Status, and Start the Driving void i8094MF_DRV_START(BYTE cardNo, WORD axis) Description: This command releases the holding status, and start the driving of the assigned axes immediately. Parameters: cardNo: axis: Module number Axis or Axes (Please refer to Table 2-1 for the axis definition.) Return: None Example: BYTE cardNo=1; //select card 1. i8094MF_DRV_HOLD(cardNo, AXIS_XYU); //hold the driving command to XYU i8094MF_SET_MAX_V(cardNo, AXIS_U, 10000); //set the maximum speed of U-axis to be 10K PPS. i8094MF_NORMAL_SPEED(cardNo, AXIS_U, 0); //set the driving mode to be symmetric T-curve. i8094MF_SET_V(cardNo, AXIS_U, 2000); //set the speed of U-axis to 2,000 PPS. i8094MF_SET_A(cardNo, AXIS_U, 1000); //set the acceleration of U-axis to 1,000 PPS/S. i8094MF_SET_SV(cardNo, AXIS_U, 2000); //set the starting speed to 2,000 PPS. i8094MF_SET_AO(cardNo, AXIS_U, 9); // set the AO to 9 Pulses. i8094MF_SET_MAX_V(cardNo, AXIS_XY, 20000); //set the maximum speed of X and Y axes to 20K PPS. i8094MF_AXIS_ASSIGN(cardNo, AXIS_X, AXIS_Y, 0); //set the X-axis as the axis 1 and Y-axis as the axis 2 for a 2-axis interpolation. i8094MF_VECTOR_SPEED(cardNo, 0); //set constant speed motion. Therefore, VSV=VV. Only VV is required. i8094MF_SET_VV(cardNo, 5000); //set the vector speed for card 1 to 5,000 PPS. i8094MF_FIXED_MOVE(cardNo, AXIS_U, 5000); //command U-axis to move 5,000 Pulse. This command is be held. i8094MF_LINE_2D(cardNo, 12000, 10000); //command a linear interpolation motion on the XY planes. It is held, too. i8094MF_DRV_START(cardNo, AXIS_XYU); //release the holding status. X,Y , and U axes will start to move simultaneously. ICPDAS 105 I-8094 Software User Manual 6.6.3 Waiting until the Motion Is Completed BYTE i8094MF_STOP_WAIT(BYTE cardNo, WORD axis) Description: This function can be used to assign commands to be performed while waiting for all motion to be completed (stopped). Parameters: cardNo: axis: Module number Axis or axes (Please refer to Table 2-1) Return: YES NO Motion is complete Motion is not complete EXAMPLE: BYTE cardNo=1; //select module 1 i8094MF_SET_MAX_V(cardNo, AXIS_XYZU, 20000); //set the maximum speed of all axes on module 1 to 20K PPS. i8094MF_NORMAL_SPEED(cardNo, AXIS_XYZU, 0); //set the speed profile of all axes on module 1 to be symmetric T-curve i8094MF_SET_V(cardNo, AXIS_XYZU, 2000); //set the speed of all axes on module 1 to 2000 PPS. i8094MF_SET_A(cardNo, AXIS_XYZU,1000); //set the acceleration value of all axes on module 1 to 1000 PPS/S. i8094MF_SET_SV(cardNo, AXIS_XYZU, 2000); //set the start velocity of all axes on module 1 to 2000 PPS. i8094MF_SET_AO(cardNo, AXIS_XYZU, 9); //set the value of remaining offset pulses to 9 pulses. i8094MF_FIXED_MOVE(cardNo, AXIS_XYZU, 10000); // move all axes on module 1 for 10000 pulses. if (i8094MF_STOP_WAIT(cardNo, AXIS_X) == NO) { //perform some actions here if the X axis has not finished its //motion. } ICPDAS 106 I-8094 Software User Manual 6.6.4 Stopping the Axes void i8094MF_STOP_SLOWLY(BYTE cardNo, WORD axis) Description: This function decelerates and finally stops the assigned axes slowly. Parameters: cardNo: axis: Module number Axis or axes (Please refer to Table 2-1) Return: None Example: i8094MF_STOP_SLOWLY(1, AXIS_XY); //decelerate and stop the X and Y axes void i8094MF_STOP_SUDDENLY(BYTE cardNo, WORD axis) Description: This function immediately stops the assigned axes. Parameters: cardNo: axis: Module number Axis or axes (Please refer to Table 2-1) Return: None Example: i8094MF_STOP_SUDDENLY(1, AXIS_ZU); //immediately stop the Z and U axes. ICPDAS 107 I-8094 Software User Manual void i8094MF_VSTOP_SLOWLY(BYTE cardNo) Description: This function stops interpolation motion of the assigned module in a decelerating way. Parameters: cardNo: Module number Return: None Example: i8094MF_VSTOP_SLOWLY(1); //stop the interpolation of card 1 in a decelerating way. void i8094MF_VSTOP_SUDDENLY(BYTE cardNo) Description: This function stops interpolation motion of the assigned module immediately. Parameters: cardNo: Module number Return: None Example: i8094MF_VSTOP_SUDDENLY(1); // stop the interpolation of card 1 immediately. void i8094MF_SSTOP_SLOWLY(BYTE cardNo, WORD axis) Description: Except for State-Control, This function provides the similar feature with i8094MF_STOP_SLOWLY(). Stop pulse output simply (no ERROR_CODE 256 returned). ICPDAS 108 I-8094 Software User Manual Parameters: cardNo: axis: Module number Axis or axes (Please refer to Table 2-1) Return: None Example: i8094MF_SSTOP_SLOWLY(1, AXIS_XY); //decelerate and stop the X and Y axes void i8094MF_SSTOP_SUDDENLY(BYTE cardNo, WORD axis) Description: Except for State-Control, This function provides the similar feature with i8094MF_STOP_ SUDDENLY (). Stop pulse output simply (no ERROR_CODE 256 returned). Parameters: cardNo: axis: Module number Axis or axes (Please refer to Table 2-1) Return: None Example: i8094MF_SSTOP_SUDDENLY(1, AXIS_ZU); //immediately stop the Z and U axes. void i8094MF_SVSTOP_SLOWLY(BYTE cardNo) Description: Except for State-Control, This function provides the similar feature with i8094MF_ VSTOP_SLOWLY (). Stop pulse output simply (no ERROR_CODE 256 returned). Parameters: cardNo: Module number Return: None Example: i8094MF_SVSTOP_SLOWLY(1); ICPDAS 109 I-8094 Software User Manual //stop the interpolation of card 1 in a decelerating way. void i8094MF_SVSTOP_SUDDENLY(BYTE cardNo) Description: Except for State-Control, This function provides the similar feature with i8094MF_ VSTOP_ SUDDENLY (). Stop pulse output simply (no ERROR_CODE 256 returned). Parameters: cardNo: Module number Return: None Example: i8094MF_SVSTOP_SUDDENLY(1); // stop the interpolation of card 1 immediately. ICPDAS 110 I-8094 Software User Manual 6.6.5 Clear the Stop Status void i8094MF_CLEAR_STOP(BYTE cardNo) Description: After using anyone of the stop functions mentioned in section 6.5.4, please solve the malfunction, then issue this function to clear the stop status. Paramters: cardNo: Module number Return: None Example: i8094MF_VSTOP_SUDDENLY(1); //command the card 1 to stop motion immediately. i8094MF_CLEAR_STOP(1); //clear the error status of card 1. 6.6.6 End of Interpolation void i8094MF_INTP_END(BYTE cardNo, WORD type) Description: 1. If the current motion status is running a interpolation motion and you would like to issue a single axis motion or change the coordinate definition, you should call this function before the new command is issued. 2. You can redefine the MAX_V for each axis. In this way, you do not have to execute i8094MF_INTP_END() function. Parameters: cardNo: type: Module number 0 2-axis interpolation 1 3-axis interpolation Return: None Example: i8094MF_INTP_END(1, 0); //declear the end of a 2-axis interpolation on card 1. ICPDAS 111 I-8094 Software User Manual Appendix A (i-8094 Basic Functions) A.1 i8094 Command Set Table A-1 I-8094 motion command classification Function Classification Registers Management Functions Initial Functions Basic Motion Command Functions Interpolation Functions Automatic Home Search Application Functions Interrupt Control Functions Statement Set the command register (WR0), mode registers (WR1~WR3), output register (WR4), and interpolation mode register (WR5). Get the status registers (RR0~RR7) Set the initial status of the system. There are about the registration, the card name, the slot number, the output pulse mode and hardware limit signal and software limit signal. Provides the (T/S)-Curve acceleration/ deceleration (symmetric / asymmetric) for 4-axes. Provides the (2/3) axes linear interpolation, circular interpolation, and (2/3) axes bit pattern interpolation Provides the automatic home search function, the hardware signals setting, and the extension mode function setting. Provides the synchronous action conditions, and the digital filter settings. Uses the MCX314As’s interrupt factors and the interrupt service routine (ISR) to design the path planning or command the continuous motion. Axis I/O Signal Functions Include the alarm, In-position, external signal settings and the servo input status settings. Register Management Functions Include the set/get of the logic position counters and the encoder position counters, and get the current velocity and acceleration. ICPDAS 112 I-8094 Software User Manual A.2 Pulse Output Command A.2.1 Signal Types I-8094 has two modes for pulse output command: One is fixed-pulse command output mode; the other is continuous pulse command output mode. User can choose the modes by setting the specific registers. There are two ways to choose the desired pulse mode: a) adjusting hardware jumper, and b) setting registers by software programming. The output pulse command modes are showing in Table 2-2. Moreover, the detail illustration for the pulse modes are shown in Fig. A-1~ Fig. A-6. Fig. A-1 CW/CCW Input mode 1 Fig. A-2 CW/CCW Input mode 2 ICPDAS 113 I-8094 Software User Manual Fig. A-3 Pulse / Direction input mode 1 Fig. A-4 Pulse / Direction input mode 2 Fig. A-5 Pulse / Direction input mode 3 Fig. A-6 Pulse / Direction input mode 4 ICPDAS 114 I-8094 Software User Manual A.2.2 Fixed Pulse Driving When host CPU writes a pulse numbers into I-8094 for fixed pulse driving, and configures the performance such as acceleration / deceleration and speed. I-8094 will generate the pulses and output them automatically. When output pulse numbers are equal to the command pulse numbers, I-8094 stops the output. The profile is showing in Fig. A-7. Concerning the execution of fixed pulse driving in acceleration / deceleration, it is necessary to set the following parameters: Range: R Initial Speed: SV (PPS) Driving Speed: V (PPS) Acceleration: A (PPS/Sec) Deceleration: D (PPS/Sec) Output Pulse Numbers: P A.2.3 Changing Output Pulse Numbers in Driving The output pulse numbers can be changed in the fixed pulse driving. If the command is for increasing the output pulse, the pulse output profile is shown as Fig. A-8 or A-9. If the command is for decreasing the output pulses, the output pulse will be stopped immediately as shown in Fig. A-10. Furthermore, when in the S-curve acceleration /deceleration driving mode, the output pulse number change will occur to an incomplete deceleration S-curve. A.2.4 Offset Setting for Acceleration/Deceleration Driving The offset function can be used for compensating the pulses when the decelerating speed doesn’t’ reach the setting initial speed during the S-curve fixed pulse driving. It will calculate the acceleration / deceleration point automatically, and will arrange the pulse numbers in acceleration equal to that in deceleration. The method is calculating the output acceleration pulses and comparing them with the remaining pulses. When the remaining pulses are equal to or less the pulses in acceleration, it starts the deceleration. When setting the offset for deceleration, it will start deceleration early for the offset. The remaining pulses of offset will be driving output at the initial speed (see Fig. A-11). The default value for offset is 8 when motion card power-on reset. It is not necessary to change the shift pulse value in the case of acceleration/deceleration fixed pulse driving. ICPDAS 115 I-8094 Software User Manual Fig. A-7 Fixed pulse driving Fig. A-8 Changing the output pulse numbers in driving Fig. A-9 Changing command during deceleration Fig. A-10 Changing the lesser pulse numbers than output pulse stop Fig. A-11 Offset pulse in fixed-pulse driving ICPDAS 116 I-8094 Software User Manual A.2.5 Continuous Drive Pulse Output When the continuous driving is performed, it will drive pulse output in a specific speed until stop command or external stop signal is happened. The main application of continuous driving is: home searching, teaching or speed control. Two stop commands are for stopping the continuous driving. One is “decelerating stop”, and the other is “sudden stop”. Four input pins, IN3~IN0, of each axis can be connected for external decelerating and sudden stop signals. Enable / disable, active levels and mode setting are possible.And it is necessary to set the following parameters: Range: R Initial Speed: SV (PPS) Driving Speed: V (PPS) Acceleration: A (PPS/Sec) Deceleration: D (PPS/Sec) Output Pulse Numbers: P Fig. A-12 Continuous driving ICPDAS 117 I-8094 Software User Manual A.2.6 Constant Speed Driving When the driving speed command set in I-8094 is lower than the initial speed, the acceleration /deceleration will not be performed, instead, a constant speed driving starts. If the user wants to perform the sudden stop when the home sensor or encoder Z-phase signal is active, it is better not to perform the acceleration / deceleration driving, but the low-speed constant driving from the beginning. For processing constant speed driving, the following parameters will be preset accordingly. Range: R Initial Speed: SV Drive Speed: V (Just set one of SV and V can be attained the effect) Output Pulse Numbers: P (Only applicable for the fixed pulse driving) Fig. A-13 Constant speed driving ICPDAS 118 I-8094 Software User Manual A.3 Profile Acceleration/Deceleration Planning According to the motion control, we should used acceleration / deceleration planning for improving the capability of path planning and reducing the position error. The speed driving profile in I-8094 can be configured as T-curve and S-curve acceleration / deceleration. A.3.1 Trapezoidal Driving [Symmetric] T-curve Description The linear acceleration / deceleration driving is also called the trapezoidal driving. About the correlation parameters are: total displacement S, start speed SV, driving speed V, acceleration A. By above the parameters we can plan the trapezoidal driving: Acceleration equation: V = SV + A × TA (1-1) The time for the end of constant speed: TM = S V (1-2) The time for the start of constant speed: A= V − SV TA (1-3) The T-Curve acceleration / deceleration planning are shown in Fig. A-14. Fig. A -14 Symmetric T-curve acc./dec. planning Trapezoidal driving is starting from the initial speed to the designated drive speed. The accelerating pulses will be counted, and the deceleration (automatic deceleration) starts from the ICPDAS 119 I-8094 Software User Manual drive speed to initial speed once the remaining pulse numbers are less than the accelerating pulse numbers. Usually, the user should set the same acceleration and deceleration rates. For some cases, the acceleration and deceleration can be set individually by setting the D1 of WR3 to 1. When the deceleration is set individually in fixed pulse driving, the automatic deceleration will not be performed, but the manual deceleration is required. The user should set the bit D1 of Register WR3 as 1, and then use decelerating command (03h) to set the deceleration. When performing the symmetric trapezoidal driving, the following parameters should be preset. Range: R Initial Speed: SV (PPS) Driving Speed: V (PPS) Acceleration: A (PPS/Sec) Output Pulse Number P ICPDAS 120 I-8094 Software User Manual A.3.2 Trapezoidal Driving [Asymmetric] When an object is to be moved using stacking equipment, the acceleration and the deceleration of vertical transfer need to be changed since gravity acceleration is applied to the object. I-8094 performs automatic deceleration in fixed pulse driving in the non-symmetric linear acceleration where the acceleration where the acceleration and the deceleration are different. It is not necessary to set a manual deceleration point by calculation in advance. Fig. A-15 shows the case where the deceleration is greater than the acceleration and Fig. A-16 shows the case where the acceleration is greater than the deceleration. In such asymmetric linear acceleration also, the deceleration start point is calculated within the IC based on the number of output pulse P and each rate parameter. Fig. A-15 Asymmetric T-curve acc./dec. driving (A<D) ICPDAS 121 I-8094 Software User Manual Fig. A-16 Asymmetric T-curve acc./dec. driving (A>D) When performing the asymmetric trapezoidal driving, the following parameters should be set. Range: R Acceleration: A (PPS/Sec) Deceleration: D (PPS/Sec) Initial Speed : SV: (PPS) Driving Speed: V: (PPS) Output Pulse Number: P Note: In the case of A>D, the following condition is applied to the ratio of the acceleration and the deceleration. D > A × ICPDAS 122 V , where CLK=16 MHz 4 × 10 6 I-8094 Software User Manual A.3.3 Triangle Prevention The triangle prevention function prevents a triangle form in linear acceleration fixed pulse driving even if the number of output plses is low. When the number of pulses that were utilized at acceleration and deceleration exceeds 1/2 of the total number of output pulses during acceleration, the IC (MCX314As) stops acceleration and enters a constant speed mode. The triangle prevention function is disabled at resetting. And set the WR6/D3 (AVTRI) bit of the extension mode by setting command (60h) to 1 can enable the Function. Fig. A-17 Triangle prevention of fixed pulse driving P=2×(Pa+Pd) P: Output pulse number Pa: Number of pulses utilized at acceleration Pd: Number of pulses utilized at deceleration ICPDAS 123 I-8094 Software User Manual A.3.4 S-curve Acceleration / Deceleration [Symmetry] Complete S-curve Description The complete S-Curve is composed of two two-degree velocity curves; if we set the time of the acceleration is TA: Velocity equation of segment (1): V (t ) = Ct 2 , t < TA / 2 (1-4) Velocity equation of segment (2): V (t ) = V − C (TA − t ) 2 , t > TA / 2 (1-5) Boundary condition: V (0) = 0, V (TA / 2) = V / 2, V ' (0) = 0 (1-6) By the BCs and then we can find that C= 2V (TA) 2 (1-7) Fig. A-18 Complete S-curve acc. planning ICPDAS 124 I-8094 Software User Manual Partial S-curve Description Partial S-curve is composed of three segments (1, 2, 3): one straight line and two S-curve lines. S-curve is the (1), (3) segments for S-curve acceleration, the straight line is (2) segment for linear acceleration; the total motion time is defined TA , and the time of the linear acceleration is TA − (2 × TS ) . However there is the same acceleration value in the join of the three segments. Velocity equation of segment (1): V (t ) = C1t 2 , t < TS (1-8) Velocity equation of segment (2): V (t ) = C 2 t , TS < t < TA − TS (1-9) Velocity equation of segment (3): V (t ) = V − C1 (TA − t ) 2 , TA − TS < t < TA (1-10) The constant value C 2 is the slope of the line: C2 = V − 2VS (1-11) TA − 2TS Boundary condition of the connection for (1), (2): V ' (TS ) = C 2 We can find that C1 = (1-12) V 2 2[TS + (TS × (TA − 2TS ))] (1-13) Fig. A-19 Partial S-curve planning In case of S-curve acceleration / deceleration driving, the acceleration profile is not linear. The ICPDAS 125 I-8094 Software User Manual value of acceleration / deceleration is shaped as the trapezoid; see Fig. A-20. In acceleration, there are three regions with different acceleration values. At the beginning, the acceleration increase linearly from 0 to the specific value A with a specific rate of acceleration K, this shows the driving speed increase parabolically in this region. Then, the driving speed increases in a constant acceleration in region b. And, in section c, the acceleration decelerates linearly to 0 with the rate of deceleration K. So the acceleration of S-curve includes regions a, b and c. In deceleration, as same as acceleration, the driving speed decelerate parabolically in three regions d, e and f. Fig. A-20 S-Curve acceleration / deceleration driving ICPDAS 126 I-8094 Software User Manual When the fixed pulse trapezoidal driving is performed, and also when the deceleration is performed before the acceleration stops, the triangle driving profile is coming out. The prevention of triangle driving profile in S-curve acceleration / deceleration driving will be discussed as follows. If the initial speed is 0, and if the rate of acceleration is a, then the speed at time t in acceleration region can be described as following. V (t ) = Kt 2 (1-14) Therefore, the total output pulse number p(t) from time 0 to t is the integrated of speed. 1 p (t ) = ∫ V (t ) dt = Kt 3 3 (1-15) (1 / 3 + 2 / 3 + 1 + 2 / 3 + 1 + 1 / 3) × at 3 = 4at 3 (1-16) The total output pulse is From (1-15), (1-16), when the output pulse in acceleration of S-curve is more than 1/12 of total output pulse; it will stop increasing acceleration and start to decrease the acceleration value. Fig. A-21 The rule of 1/12 of parabolic acceleration/deceleration. ICPDAS 127 I-8094 Software User Manual A.3.5 S-curve Acceleration / Deceleration [Asymmetry] As shown in Fig. A-22, set a jerk and a deceleration-increasing rate individually in S-curve acc/dec driving can create a non-symmetric S-curve. However, for fixed pulse driving, a deceleration point must be specified manually, since automatic deceleration is prohibited. Since a triangle form prevention function (1/12 rule) is not supported either, a drive speed must be set according to the acc./dec. increasing rate and the number of output pulse. Fig. A-22 Non-symmetric S-curve acceleration/deceleration drive Note: To perform non-symmetrical S-curve acc./dec. driving. Set the D0, D1, D2 bits of the nWR3 register as follows. Mode setting bit WR3/D0 Symbol MANLD Setting Value 1 WR3/D1 DSNDE 1 WR3/D2 SACC 1 ICPDAS 128 Comment Manual deceleration The deceleration increasing rate setting value is used at deceleration. S-curve acceleration/ deceleration I-8094 Software User Manual A.4 Pulse Output Commands A.4.1 2/3 Axes Interpolation Any 2 or 3 axes of the 4 axes can be set for linear interpolation. To execute the linear interpolation, the user can, according to the present point coordinates, set the finish point coordinates and the interpolation command(s) for 2 or 3 axes, as shows in Fig. A-23, A-24. For individual axis control, the command pulse number is unsigned, and it is controlled by + direction command or - direction command. For interpolation control, the command pulse number is signed. The resolution of linear interpolation is within ±0.5 LSB. We define the longest distance movement in interpolation is the “long axis”. And the other is “short axis”. The long axis outputs an average pulse train. The driving pulse of the short axis depends on the long axis and the relationship of the two axes. The range for each axis is a 24-bit signed counter, from -223 ~ +223. When performing the linear interpolation, the following parameters should be preset. Range: R Initial Speed: SV (PPS) Driving Speed: V (PPS) Acceleration: A (PPS/Sec) Finish Position FP Fig. A-23 2/3axes linear interpolation ICPDAS 129 I-8094 Software User Manual A.4.2 Circular Interpolation Any 2 axes of the 4 axes can be selected for circular interpolation. The circular interpolation is starting from the current position (start point). After setting the center point of circular, the finish position and the CW or CCW direction, the user can start the circular interpolation. Note: The coordinates setting value is the relative value of the start point coordinates. In Fig. A-25, it explains the definition of CW and CCW circular interpolations. The CW circular interpolation is starting from the start point to the finish position with a clockwise direction; the CCW circular interpolation is with a counter-clockwise direction. When the finish point is set to (0, 0), a circle will come out. When performing the circular linear interpolation, the following parameters should be preset. Range: R Initial Speed: SV (PPS) Driving Speed: V (PPS) Acceleration: A (PPS/Sec) Finish Position FP Circular Center Position C Fig. A-24 Circular interpolation In Fig. A.26, it explains the long axis and the short axis. First, we define 8 quadrants in the X-Y plane and put the numbers 0~7 to each quadrant. We find the absolute value of ax1 is always larger than that of ax2 in quadrants 0, 3, 4 and 7, so we call ax1 is the long axis (ax2 is the short axis) in these quadrants; in quadrants 1, 2, 5 and 6,ax2 is the long axis (ax1 is the short axis). The short axis will output pulses regularly, and the long axis will output pulses depending on the interpolation calculation. ICPDAS 130 I-8094 Software User Manual Fig. A-25 The 0~7Quadrants in circular interpolation calculation Note: The calculation steps for the manual deceleration length of circular interpolation 1. First judge the start point and finish point located on which quadrant 2. from the center coordinate to decide the motion radius. 3. Calculate the pulse number of the start point and finish point on the quadrant. (Take notice of the different motion direction (CW/CCW)). 4. Calculate the whole quadrant numbers that passed through in the path planning. 5. The result of step3+step4 is the total pulse number. 6. Users can get the suitable multiple from the setting maximum speed, if the multiple = M, and then the real start speed: RSV=SV×M, real driving speed: RV=V×M, real acceleration: RA=A×125×M By the equation: RSV=RV+RA×TA, and you can get the time and displacement for the acceleration area. 7. If the pulse numbers of deceleration segment are same as the acceleration segment, it can figure easily: manual decelerating point=total output pulse-output pulse during acceleration ICPDAS 131 I-8094 Software User Manual Fig. A-27 shows the circular interpolation of a real circle with radius 10000 in a trapezoidal driving. The user should calculate the decelerating point before driving because the automatic deceleration will not be active. In the figure, the circle tracks through all the 8 quadrants: 0~7. In quadrant 0, Y axis is the short axis and it’s displace is about 10000 / 2=7071 The total output pulses numbers of the short axis are 7010x8=56568. Furthermore, if the initial speed is 500PPS, and will be accelerated to 20KPPS after 0.3 SEC, the acceleration will be (20000-500) /0.3 = 65000PPS/SEC. And the output pulses during acceleration will be (500+20000) x 0.3/2=3075. Thus, if we set the deceleration as same as the acceleration, the manual decelerating point will be 56568-3075=53493. Note: 1. This formula cannot be used in the constant vector speed driving. 2. In circular interpolation only manual deceleration in trapezoidal driving is available; the automatic deceleration in S-curve driving is not available. Fig. A-26 Calculation of manual deceleration point for circular interpolation ICPDAS 132 I-8094 Software User Manual A.4.3 Bit Pattern Interpolation This interpolation driving receives interpolation data that is created by upper-level CPU and transformed to bit patterns in a block of a predetermined size, and outputs interpolation pulses consecutively at the specified drive speed. Every axis has 2 bit-data buffers for host CPU: one for + direction and the other for - direction. When performing the bit pattern interpolation, the host CPU will write the designated interpolation data, for 2 or 3 axes, into I-8094. If a bit in the bit pattern data from CPU is “1”, I-8094 will output a pulse at the time unit; if it is “0”, I-8094 will not output any pulse at the time unit. For example, if the user want to generate the X-Y profile (see Fig. A-28), the host CPU must write a set of pattern into those specific registers ---- XPP: the + direction register for X axis, XPM: the − direction register for X axis, YPP and YPM: the + and − directions registers. With in the time unit, I-8094 will check the registers once and decide to output a pulse or not depending on the bit pattern. Fig. A-27 Bit pattern data for X-Y profile Stacking counter (SC) is a 2-bit counter. Its value is between 0 and 3, which can be read from D14, 13 of register RR0. SC will decide which register for the data from the host CPU. The initial value of SC is 0. So, when host CPU writes bit pattern data into BP1P or BP1M, the data will be stored in SREG, and then, SC will count up to 1, and the next data from the host CPU will be written into REG1. By this way, the REG2 becomes the register when SC=2. The host CPU is not able to write any bit pattern data into MCX314As when SC=3. When the bit pattern interpolation pulse is outputting, D0 in SREG (Stack Register) will be shifted output first, and then in the order of D1, D….When all of SREGs (Stack Registers) have been shifted output, the data in REG1 will be shifted to SREG, the data in REG2 will be shifted to REG1, and the SC will count down to 2. Then, the host CPU is able to write a new data into MCX314As again. In order to make MCX314As output the bit pattern data continuously, the host CPU should write the data into MCX314As before SC counts down to 0. MCX314As will output an interrupt requirement signal to host CPU when SC counts down from 2 to 1. ICPDAS 133 I-8094 Software User Manual Fig. A-28 Bit pattern data stack The limitation for the speed of bit pattern interpolation driving The maximum pulse output speed is 4MHz in bit pattern interpolation mode. However, the maximum speed will depend on the data update rate of host CPU if the bit pattern data are more than 48bits. For example of the X and Y axes bit pattern interpolation, if the host CPU needs 100µsec to update new 16-bit data for X and Y axes. The maximum speed is 16/100µSEC=160KPPS. The ending of bit pattern interpolation There are 2 ways can terminate the bit pattern interpolation. (1) Write an ending code into buffer register of ax1. The bit pattern interpolation mode will be finished, and stopped if the host CPU write “1” into both + and - directions buffer registers. When the ending code is executed, the SC will become 0 automatically. (2)The host CPU stops writing any command into I-8094. When SC=0, and when no other data is updated, I-8094 will stop outputting pulse. Then, the bit pattern interpolation is finished. Utilizing the stop command to pause the interpolation The interpolation driving will be paused if a sudden stop or decelerating stop command is written into the master axis (ax1) which is executing the bit pattern interpolation. I-8094 will continue the bit pattern interpolation if the host CPU enables the bit pattern interpolation again. If the host CPU wants to finish the interpolation after writing stop command, all of the interpolation bit data in the buffer must be cleared in using BP register ICPDAS 134 I-8094 Software User Manual A.4.4 Continuous Interpolation The continuous interpolation is executing a series of interpolation processes such as linear interpolation+circular interpolation+linear interpolation … During the continuous interpolation, the driving will not stop contrarily, The pulses are output continuously. When executing the continuous interpolation, the host CPU has to write the next interpolation command into MCX314 before the previous interpolation command is finished. Polling If D9 (CNEXT) of register RR0 is 1, MCX314 is ready to accept the next interpolation command. If D9 is 0, the host CPU is not able to write the next interpolation command into MCX314. The D9 will become 1 only when the present command is executed. MCX314 will not accept the next command, and the D9 is 0 if the present command has not been executed. So, the standard procedure of continuous interpolation is first to write, and enable the interpolation data and command, then check if D9 of RR0 is 1 or 0. And then, repeat writing commands and checking D9. The flow chart is shown at the right side. Fig. A-29 Continuous Interpolation by Polling Method ICPDAS 135 I-8094 Software User Manual Interrupt D14 of register WR5 is used for enable or disable the interrupt during the continuous interpolation. After setting D14 of register WR5 to 1, the interrupt occurs. Pin INTN of MCX314As will be on the Low level to interrupt the host CPU when D9 of register RR0 become 1. The INTN will be on the Hi level if the host CPU writes the next interpolation command to I-8094. If the interrupt clear command (3Dh) is written to command register, the INTN signal will return to high-Z level from the Low level. ICPDAS 136 I-8094 Software User Manual A.5 Automatic Home Search Home search is often used when the machine was first opened or the system was occurred the alarm or error signal. Both of two above situations, user can take the home search motion to let the machine return the operation origin. I-8094 provide the functions that automatically executes a home search sequence such as high-speed near home search → low-speed home search → encoder Z-phase search → offset driving without CPU intervention. Users should dispose the hardware signals as the same as the below figure. The figure shown below illustrates the example of 1-axis driving system. 4 axes can be assigned in the same way. Fig. A-30 X-axis hardware signal disposition The automatic home search function sequentially executes the steps from step1 to step 4 that are listed below. Table A-2 Home search steps Step number Step 1 Step 2 Step 3 Step 4 Operation High-speed near home search Low-speed home search Low-speed Z-phase search High-speed offset drive Search speed Detection signal Drive speed (V) nIN0 Home search speed (HV) nIN1 Home search speed (HV) nIN2 Drive speed (V) Note: If your hardware signal doesn’t have the near home signal ( the slow-down signal), you can connect the near home and home signal in the same pin, and set the step1 disabled. ICPDAS 137 I-8094 Software User Manual Fig. A-31 Prototype of automatic home search Note: By inputting a home signal in nIN0 and nIN1, high-speed search is enabled by using only one home signal. ICPDAS 138 I-8094 Software User Manual A.5.1 Step 1: High-Speed Near Home Search Drive pulses are output in the specified direction at the speed that is set in the drive speed (V) until the near home signal (nIN0) becomes active. To perform high-speed search operation, set a higher value for the Acceleration/deceleration driving is performed and when the near home signal (nIN0) becomes active, the operation stops by decelerating. Fig. A-32 Home search for step1 Irregular operation (1) The near home signal (nIN0) is already active before Step 1 starts. → Proceeds with Step 2. (2) The limit signal in the detection direction is already active before Step 1 starts. → Proceeds with Step 2. (3) The limit signal in the detection direction is activated during execution. → Stops driving and proceeds with Step 2. ICPDAS 139 I-8094 Software User Manual A.5.2 Step 2: Low-Speed Home Search Drive pulses are output in the specified direction at the speed that is set as the home detection speed (HV) until the home signal (nIN1) becomes active. To perform low-search operation, set a lower value for the home search speed (HV) than the initial speed (SV). A constant speed-driving mode is applied and the operation stops instantly when the home signal (nIN1) becomes active. Fig. A-33 Home search for step2 Irregular operation (1) The home signal (nIN1) is already active before Step 2 starts. → The motor drives the axis in the direction opposite to the specified search direction at the home search speed (HV) until the home signal (nIN1) becomes inactive. When the home signal (nIN1) becomes inactive, the function executes Step2 from the beginning. (2) The limit signal in the search direction is active before Step 2 starts. → The motor drives the axis in the direction opposite to the specified search direction at the home search speed (HV) until the home signal (nIN1) becomes active. When the home signal (nIN1) becomes actives, the motor drivers in the direction opposite to the specified search direction at the home search speed (HV) until the home signal (nIN1) becomes inactive, the function executes Step2 from the beginning. (3) The limit signal in the search direction becomes active during execution. → Driving stops and the same operation as for (2) → is performed. ICPDAS 140 I-8094 Software User Manual A.5.3 Step 3: Low-Speed Z-phase Search Drive pulses are output in the specified direction at the speed that is set as the home search speed (HV) until the encoder Z-phase signal (nIN2) becomes active. To perform low-speed search operation, set a lower value for the home search speed (HV than the initial speed (SV)). A fixed speed-driving mode is applied and driving stops instantly when the encoder Z-phase signal (nIN2) becomes active. As the search condition for stopping driving, the AND condition of the encoder Z-phase signal (nIN2) and the home signal (nIN1) can be applied. Fig. A-34 Home search for step3 Note: (1) If the encoder Z-phase signal (nIN2) is already active at the start of Step 3, an error occurs and 1 is set in bit D7 of the nRR2 register. Automatic home search ends. Adjust the mechanical system so that Step 3 always starts from an inactive state with a stable encoder Z-phase signal (nIN2). (2) If the limit signal in the search direction is already active before the start of Step 3, an error occurs and 1 is set in the search direction limit error bit (D2 or D3) of the nRR2 register. Automatic home search ends. (3) If the limit signal in the search direction becomes active during execution, search operation is interrupted and 1 is set in the search direction limit error bit (D2 or D3) of the nRR2 register. Automatic home search ends. ICPDAS 141 I-8094 Software User Manual A.5.4 Step 4: High-Speed Offset Drive The function outputs as many driving pulses as the pulse count (P) that is set, in the specified direction at the speed that is set in the drive speed (V). Use this step to move the axis from the mechanical home position to the operation home position. Through mode setting, the logical position counter and real position counter can be cleared after moving. If the drive direction limit signal becomes active before the start or during execution of Step 4, the operation stops due to an error and 1 is set in the search direction limit error bit (D2 or D3) of the nRR2 register. ICPDAS 142 I-8094 Software User Manual A.6 Synchronous Action Synchronous action of this IC performs actions such as starting and stopping of driving within each axis and between axes in IC and between IC and external device. For instance, the following actions can be performed. Example 1: Starts driving of the Z-axis after the Y-axis passed the position 15000. Fig. A-35 Synchronous action example1 Example 2: Stops driving of Y and Z axes after the X-axis passes the position -320000. Fig. A-36 Synchronous action exapmle2 Normally, coding a program on the CPU side can perform such synchronous actions. However, this function is useful when no delay by CPU software execution time is needed. The synchronous action of this IC is a function that executes an intervention, achieving high-precision synchronization. To perform a synchronous action, set a specified activation factor and a specified action in the synchronous mode registers in the IC. Specify an activation factor (Provocative) register and other axis activation in the WR6 register specify an action in the WR7 register, and write a synchronous action mode setting command 64h in the following WR6 register together with axis specification. There are ten activation factors are available as options for the WR6 register and fourteen actions are available as options for the WR7 register. ICPDAS 143 I-8094 Software User Manual WR6 Register D15 D14 D13 D12 D11 D10 D9 D8 AXIS3 AXIS2 AXIS1 0 0 0 CMD LPRD D7 D6 D5 D4 D3 D2 D1 D0 IN3↓ IN3↑ D-END D-STA P>=C- P<C- P<C+ P>=C+ Set them to 1 and disabled by setting them to 0 can enable the active factor and other axis activation bits D0 P ≥ C+ The logical/real position counter value exceeded the value of COMP+ register value. (Use the WR2/D5(CMPSL) bit for selection of a logical position real/real position counter.) D1 P<C+ The logical/real position counter value became less than the COMP+ register value. D2 P<C- The logical/real position counter value became less than the COMPregister value. D3 P ≥ C- The logical/real position counter value exceeded the COMP- register value. D4 D-STA Driving started. D5 D-END Driving terminated. D6 IN3 ↑ The nIN3 signal rose from the Low to the High level. D7 IN3 ↓ The nIN3 signal fell from the High to Low level. D8 LPRD A logic position read command (10h) was written. (Simultaneous read processing is enabled by setting LP save or EP save in the action of the own/another axis) D9 CMD A synchronous action activation factor of the own axis. 1: Enable. Own axis X Y Z U ICPDAS D15 (Axis3) U axis activation X axis activation Y axis activation Z axis activation D14 (Axis2) Z axis activation U axis activation X axis activation Y axis activation 144 D13 (Axis1) Y axis activation Z axis activation U axis activation X axis activation I-8094 Software User Manual WR7 Register D15 D14 D13 D12 D11 D10 D9 D8 INT OUT 0 0 VLSET OPSET EPSET LPSET D7 D6 D5 D4 D3 D2 D1 D0 EPSAVE LPSAVE ISTOP SSTOP CDRV-I CDRV- FDRV- FDRV+ D0 FDRV+ Activates fixed pulse driving in the + direction. D1 FDRV- Activates fixed pulse driving in the - direction. D2 CDRV+ Activates continuous pulse driving in the + direction. D3 CDRV- D4 SSTOP Stops driving in deceleration. D5 ISTOP Stops driving immediately. D6 LPSAV Saves the current logical position counter (LP) in the synchronous buffer register (BR). [LP → BR] D7 EPSAV Saves the current real position counter (EP) in the synchronous buffer register (BR). [EP → BR] D8 LPSET Sets the values of the WR6 and WR7 registers in the real position counter (LP). [LP ← WR6,7] D9 EPSET Sets the values of the WR6 and WR7 registers in the real position counter (EP). [EP ← WR6,7] D10 OPSET Sets the values of the WR6 and WR7 registers in the pulse count (P). [P ← WR6,7] D11 VLSET Sets the value of the WR6 register in the drive speed (V). [V ← WR6] D14 OUT Outputs synchronous pulses as external signals. D15 INT Generates an interrupt signal (INTN). The interrupt signal (INTN) becomes Low Active and the RR3/D9 (SYNC) bit of the axis to which the interrupt occurred indicates 1. When CPU reads the RR3 register of the axis to which the interrupt occurred, the bit of the RR3 register is cleared to 0 and the interrupt output signal is reset to Hi Level. ICPDAS Activates continuous pulse driving in the - direction. 145 I-8094 Software User Manual Fig. A-37 Flow chart of synchronous action ICPDAS 146 I-8094 Software User Manual A.7 I-8094 Function Library We develop the simple but powerful high-level functions set application programming interface (API) by using the specific command and data registers of MCX314As. These libraries are composed of motion and interpolation commands, status display, and I/O signal management make programming your controller easy. Finally, all setup and motion control functions are easily executed by calling into either a static or dynamic link library (DLL). The development procedure of the software library is written by eVC (eMbedded Visual C++). After that, we use eVC to recompile the library become DLL (Dynamic Link Library), and use MFC (Microsoft Foundation Class) to develop the HMI (Human Machine Interface) for motion control. With inclusion of DLL and HMI, our package has the advantage that users do not need to design complicated path planning and code function driver to control the multi-axes motor. Finally, the capability and validity of the functions are tested by experiment in a 4-axis machine. Each function will be displayed in following format: i8094_FUNCTION_NAME(cardNo, axis, parameter1, parameter2) where cardNo is the module number of i8094; axis can be one axis or several axes. Users can refer to Table 2-1 for more information. A.7.1 Register management functions The definition of the WRn, RRn registers are detail shown in appendix B. Table A-3 Register management functions Function Name i8094_SET_COMMAND i8094_SET_WR1 i8094_SET_WR2 i8094_SET_WR3 i8094_GET_WR4 i8094_SET_WR5 i8094_GET_RR0 i8094_GET_RR1 i8094_GET_RR2 i8094_GET_RR3 i8094_GET_RR4 i8094_GET_RR5 i8094_GET_RR6 i8094_GET_RR7 ICPDAS Description The command register (WR0) for 4-axes setting The mode register (WR1) for 4-axes setting The mode register (WR2) for 4-axes setting The mode register (WR3) for 4-axes setting The output register (WR4) setting The interpolation register (WR5) setting The main status register (RR0) getting The status register 1 (RR1) getting The status register 2 (RR2) getting The status register 3 (RR3) getting The input register (RR4) getting The input register (RR5) getting The input register (RR6) getting The input register (RR7) getting 147 I-8094 Software User Manual i8094_COMMAND Format: void i8094_COMMAND(unsigned char cardNo, WORD axis, WORD cmd) Function: Setting the command register (WR0) for 4-axes. Parameters: cardNo is the board number. axis is the motion axes, as shown in Table2-1. cmd is the command code setting in the WR0 register. Available command codes are shown in section A.8. Example: //Set all axes for axis switching. i8094_COMMAND(1, 0xf, 0xf); i8094_SET_WR1 Format: void i8094_SET_WR1(unsigned char cardNo, WORD axis, WORD data) Function: Set the mode register (WR1) for 4-axes. Parameters: cardNo is the board number. axis is the motion axes, as shows in Table2-1. data is the 32-bit hexadecimal value setting in the WR1 register. Example: //Set the X axis’s IN0 signal enabled and Hi active. i8094_SET_WR1(1, 0x1, 0x0003); ICPDAS 148 I-8094 Software User Manual i8094_SET_WR2 Format: void i8094_SET_WR2(unsigned char cardNo, WORD axis, WORD data) Function: Set the mode register (WR2) for 4-axes. Parameters: cardNo is the board number. data is the 32-bit hexadecimal value setting in the WR3 register. Example: //Set the all axes software limit enabled as comparing with the real position counter. i8094_SET_WR2(1, 0xf, 0x0023); i8094_SET_WR3 Format: void i8094_SET_WR3(unsigned char cardNo, WORD axis, WORD data) Function: Set the mode register (WR1) for 4-axes. Parameters: cardNo is the board number. axis is the motion axes, as shows in Table 2-1. data is the 32-bit hexadecimal value setting in the WR3 register. Example: //Set the non-symmetry S-curve mode for x, y, z axes. i8094_SET_WR3(1, 0x7, 0x0007); ICPDAS 149 I-8094 Software User Manual i8094_SET_WR4 Format: void i8094_SET_WR4(unsigned char cardNo, WORD data) Function: Setting the mode register (WR1) for 4-axes. Parameters: cardNo is the board number. axis is the motion axes, as shows in Table 2-1. data is the 32-bit hexadecimal value setting in the WR4 register. Example: //Set the 4-axes OUT1 signals of Hi active level. i8094_SET_WR4(1, 0xf, 0x2222); i8094_SET_WR5 Format: void i8094_SET_WR5(unsigned char cardNo, WORD data) Function: Set the interpolation register (WR5). Parameters: cardNo is the board number. axis is the motion axes, as shows in Table 2-1. data is the 32-bit hexadecimal value setting in the WR5 register. Example: //Set the x, y axes of constant vector speed mode. i8094_SET_WR5(1, 0xf, 0x0104); ICPDAS 150 I-8094 Software User Manual i8094_GET_RR0 Format: void i8094_GET_RR0(unsigned char cardNo, WORD axis) Function: Get the main status register (RR0). Parameters: cardNo is the board number. axis is the motion axes, as shows in Table 2-1. Example: //Get the x axis main status register. i8094_GET_RR0(1, 0x1); i8094_GET_RR1 Format: void i8094_GET_RR1(unsigned char cardNo, WORD axis) Function: Get the main status register (RR1). Parameters: cardNo is the board number. axis is the motion axes, as shows in Table 2-1. Example: //Get the x axis status register 1. i8094_GET_RR1(1, 0x1); ICPDAS 151 I-8094 Software User Manual i8094_GET_RR2 Format: void i8094_GET_RR2(unsigned char cardNo, WORD axis) Function: Get the main status register (RR2). Parameters: cardNo is the board number. axis is the motion axes, as shows in Table 2-1. Example: //Get the x axis status register 2. i8094_GET_RR2(1, 0x1); i8094_GET_RR3 Format: void i8094_GET_RR3(unsigned char cardNo, WORD axis) Function: Get the main status register (RR3). Parameters: cardNo is the board number. axis is the motion axes, as shows in Table 2-1. Example: //Get the x axis main status register. i8094_GET_RR0(1, 0x1); ICPDAS 152 I-8094 Software User Manual i8094_GET_RR4 Format: void i8094_GET_RR4(unsigned char cardNo) Function: Get the input register (RR4). Parameters: cardNo is the board number. Example: //Get the input register 4. i8094_GET_RR4(1); i8094_GET_RR5 Format: void i8094_GET_RR5(unsigned char cardNo, WORD data) Function: Get the input register (RR5). Parameters: cardNo is the board number. Example: //Get the input register 5. i8094_GET_RR5(1); ICPDAS 153 I-8094 Software User Manual A.7.2 Functions for Initial Setting i8094_REGISTRATION Format: unsigned char i8094_REGISTRATION(unsigned char cardNo, WORD slot) Function: Register the I-8094 motion card. Parameters: cardNo is the board number. slot is the slot number. Example: //It indicates that the first card insert in the second slot. i8094_REGISTRATION(1, 2); i8094_GET_VERSION Format: void i8094_GET_VERSION(BYTE cardNo) Function: Get the version of i8094 software library. Parameters: cardNo is the board number. Example: i8094_GET_VERSION(0); ICPDAS 154 I-8094 Software User Manual SET_PULSE_MODE Format: void SET_PULSE_MODE(unsigned char cardNo, WORD axis, WORD nMode) Function: The function can set the output pulse modes and explain in Sec 1.1. Parameters: cardNo is the board number. axis is the motion axis code/name, as shows in Table 2-1. nMode is the value 0~3, as shows in the following table. Mode Value Direction CW / CCW 0 1 2 3 4 5 + + + - PULSE / DIR Waveform of input pulse nPP / PULSE nPM / DIR PULSE LOW LOW PULSE PULSE+ LOW PULSE+ HIGH PULSELOW PULSE HIGH Example: //It sets that choosing all axes with CW/CCW (Dir.+) mode. i8094_SET_PULSE_MODE(1, 0xf, 2); i8094_SET_R Format: void i8094_SET_R(unsigned char cardNo, WORD axis, DWORD data) Function: ”R” means “Range”, is the parameter determining the multiple of drive speed, acceleration / deceleration and jerk. The calculation of the multiple is shown in the following formula: Parameters: cardNo is the board number. axis is the motion axis code/name, as shows in Table 2-1. Example: i8094_SET_R(1, 0xf, 8000000); Note: If the maximum value of parameter for setting the drive speed (V) is 8000, and the drive speed is set 40KPPS. The user can set V=8000 and R=1600000. Because 40K is 5 times of 8000, we set the R=8000000/5=1600000. ICPDAS 155 I-8094 Software User Manual i8094_GET_R Format: DWORD i8094_GET_R(unsigned char cardNo, WORD axis) Function: Get the range value from the global variable. Parameters: cardNo is the board number. axis is the motion axis code/name, as shows in Table 2-1. Example: //Get the range value. i8094_GET_R(1, 0x1); i8094_AXIS_ASSIGN Format: void i8094_AXIS_ASSIGN(unsigned char cardNo, WORD axis1, WORD axis2, WORD axis3) Function: Set the axis assignment for interpolation. Parameters: cardNo is the board number. axis1 is the master axis assignment for interpolation. axis2 is the 2nd axis assignment for interpolation. axis3 is the 3rd axis assignment for interpolation About the code/name of the axis1~3, please refer to Table 2-1. Example: //Set the master axis to be the x axis, and the 2nd axis to be the y axis. i8094_AXIS_ASSIGN(1, 0x1, 0x2, 0); ICPDAS 156 I-8094 Software User Manual I8094_INnSTOP_ENABLE i8094_INnSTOP_DISABLE Format: void i8094_INnSTOP_ENABLE(unsigned char cardNo, WORD axis, WORD INn) void i8094_INnSTOP_DISABLE(unsigned char cardNo, WORD axis, WORD INn) Function: Enable/disable the IN0~3 stop signals. Parameters: cardNo is the board number. axis is the motion axis code, as shows in Table 2-1. Example: //Set the IN0, IN1 signal enabled for 4-axes. i8094_INnSTOP_ENABLE(1, 0xf, 0); i8094_INnSTOP_ENABLE(1, 0xf, 1); //Set the IN2, IN3 disabled for 4-axes. i8094_i8094_INnSTOP_DISABLE(1, 0xf, 2); i8094_i8094_INnSTOP_DISABLE(1, 0xf, 3); i8094_HLMTP_LEVEL i8094_HLMTM_LEVEL Format: void i8094_HLMTP_LEVEL(unsigned char cardNo, WORD axis, WORD nLevel) void i8094_HLMTM_LEVEL(unsigned char cardNo, WORD axis, WORD nLevel) Function: Set the logical level of +/- direction hardware limit input signal. Parameters: cardNo is the board number. axis is the motion axis code, as shows in Table 2-1. nLevel is the active level, nLevel=0: Low active, nLevel =1: Hi active. Other values are invalid. Example: //Set the positive direction hardware limit as Low active for 4-axes. i8094_HLMTP(1, 0xf, 0); ICPDAS 157 I-8094 Software User Manual i8094_SLMTP_MODE i8094_SLMTM_MODE Format: void i8094_SLMTP_MODE(unsigned char cardNo, WORD axis, WORD nMode) void i8094_SLMTM_MODE(unsigned char cardNo, WORD axis, WORD nMode) Function: Set the +/- direction software limit. Parameters: cardNo is the board number. axis is the motion axis code/name, as shows in Table 2-1. nMode n=0: Enable; n=1: Disable Example: //Enable the positive direction software limit for 4 axes. i8094_SLMTP_LEVEL(1, 0xf, 0); i8094_COMPARE_LP Format: void i8094_COMPARE_LP (unsigned char cardNo, WORD axis) Function: The function selects the logical position counter (LP) as the comparing target of COMP+/- registers. Parameters: cardNo is the board number. axis is the motion axis code, as shows in Table 2-1, Example: //Set the comparing target to LP for all axes. i8094_COMPARE_LP(1, 0xf); ICPDAS 158 I-8094 Software User Manual i8094_COMPARE_EP Format: void i8094_COMPARE_EP (unsigned char cardNo, WORD axis) Function: The function selects the real position counter (EP) as the comparing target of COMP+/- registers. Parameters: cardNo is the board number. axis is the motion axis code, as shows in Table 2-1, Example: //Set the comparing target to EP for all axes. i8094_COMPARE_EP(1, 0xf); i8094_RESET_CARD Format: void i8094_RESET_CARD(void) Function: Command for resetting the motion card. Parameter: None. Example: //Set the reset command. i8094_RESET_CARD(); Note: When the bit (WR0/D15) is set to 1, but others are 0, the IC will be reset after command writing. ICPDAS 159 I-8094 Software User Manual A.7.3 Motion Status Management Functions The logic position counter is counting the driving pulses in MCX314As. When one + direction plus is outputting, the counter will count up 1; When one - direction pulse is outputting, the counter will count-down 1. The real position counter will count input pulse numbers from external encoder. The type of input pulse can be either A/B quadrature pulse type or Up / Down pulse(CW/CCW) type (See Chapter 2.6.3). Host CPU can read or write these two counters any time. The counters are signed 32 bits, and the counting range is between -231 ~ +231. Table A-4 Motion Status Management Functions Function Name i8094_SET_LP i8094_SET_EP i8094_GET_LP i8094_GET_EP i8094_GET_CV i8094_GET_CA i8094_SET_CP i8094_SET_CM I8094_POSITION_RING i8094_RESET_CARD ICPDAS Description The logic position counter setting The Real position counter setting The logic position counter setting Read the Real position counter Read the current driving speed Read the current acceleration / deceleration Setting the positive direction software limit Setting the negative direction software limit Setting the position counter variable ring Clear the command and data registers 160 I-8094 Software User Manual Fig. A-38 Management for Position Register and Software Limit i8094_SET_LP Format: void i8094_SET_LP(unsigned char CardNo, WORD axis, long dwdata) Function: Set the logic position counter, it can be set zero to reset the counter values. Parameters: cardNo is the board number. axis is the motion axis code, as shows in Table 2-1, only set for single axis. dwdata: input value for logic position counter. Data range: -231~+231. Example: //Clear the logic position counter value. i8094_SET_LP(1, 0x1, 0); i8094_SET_LP(1, 0x2, 0) ICPDAS 161 I-8094 Software User Manual i8094_SET_EP Format: void i8094_SET_EP(unsigned char CardNo, WORD axis, long dwdata) Function: Set the logic position counter, it can be set zero to reset the counter values. Parameters: cardNo is the board number. axis is the motion axis code, as shows in Table 2-1, only set for single axis. dwdata: input value for real position counter, Data range: -231~+231. Example: //Clear the logic position counter value. i8094_SET_EP(1, 0x1, 0); i8094_SET_EP(1, 0x2, 0); long i8094_GET_LP Format: long i8094_GET_LP(unsigned char CardNo, WORD axis) Function: The function can read he current value of logic position counter, and it will be set in read registers RR6 and RR7. Parameters: cardNo is the board number. axis is the motion axis code, as shows in Table 2-1, only set for single axis. Example: //Read the logic position counter for the X, Y axes. i8094_GET_LP(1, 0x1); i8094_GET_LP(1, 0x2); ICPDAS 162 I-8094 Software User Manual i8094_GET_EP Format: long i8094_GET_EP(unsigned char CardNo, WORD axis) Function: The function can read the current value of real position counter and it will be set in read registers RR6 and RR7. Parameters: cardNo is the board number. axis is the motion axis code, as shows in Table 2-1, only set for single axis. Example: //Read the real position counter for the X, Y axes. i8094_GET_EP(1, 0x1); i8094_GET_EP(1, 0x2); i8094_GET_CV Format: WORD i8094_GET_CV(unsigned char CardNo, WORD axis) Function: The function can read the current drive speed, and it will be set in read registers RR6 and RR7. When the driving stops, the value becomes 0. The date value will increase from the setting value of start speed (SV) to the setting value of drive speed (V). Parameters: cardNo is the board number. axis is the motion axis code, as shows in Table 2-1, only set for single axis. Example: //Read the current velocity for the X, Y axes. i8094_GET_CV(1, 0x1); i8094_GET_CV(1, 0x2); ICPDAS 163 I-8094 Software User Manual i8094_GET_CA Format: WORD i8094_GET_CA(unsigned char CardNo, WORD axis) Function: The function can read the current drive acceleration will be set in read registers RR6 and RR7. When the driving stops, the value becomes 0. The data value will increase from zero to the setting value of drive acceleration (A). Parameters: cardNo is the board number. axis is the motion axis code, as shows in Table 2-1, only set for single axis. Example: //Read the current acceleration for the X, Y axes. i8094_READ_CA(1, 0x1); i8094_READ_CA(1, 0x2); i8094_SET_CP i8094_SET_CM Format: void i8094_SET_CP(unsigned char CardNo, WORD axis, long dwdata) void i8094_SET_CM(unsigned char CardNo, WORD axis, long dwdata) Function: Set the COMP+/- registers value to be the positive direction software limit. Parameters: cardNo is the board number. axis is the motion axis code/name, as shows in Table 2-1, dwdata is the COMP+ register value. Data range: -231~+231. Example: //Set the positive direction software limit to be 100000 for the X, Y axes. i8094_SET_COMPP(1, 0x3, 100000); //Set the positive direction software limit to be 100000 for the X, Y axes. i8094_SET_COMPM(1, 0x3, 100000); ICPDAS 164 I-8094 Software User Manual i8094_VRING_ENABLE i8094_VRING_DISABLE Format: void i8094_VRING_ENABLE(unsigned char cardNo, WORD axis, DWORD nVRing) void i8094_VRING_DISABLE(unsigned char cardNo, WORD axis) Function: Enable/disable the setting of any value as the maximum value. This function is useful for managing the position of the axis in circular motions that return to the home position after one rotation, rather than linear motions. Parameter: cardNo is the board number. axis is the motion axis code/name, as shows in Table 2-1, nVRing is the value of the COMP+/COMP- registers. Data range: -231~+231. Example: //For instance, set as follows for a rotation axis that rotates one cycle with //10000 pulses. To enable the position variable ring function, And set 9999 in //the COMP+/- registers as the maximum value of the logical position counter. i8094_VRING_ENABLE(1, 0xf, 1, 9999); Fig. A-39 Operation of position counter ring maximum value 9999 Note: 1. The variable ring function enable/disable is set for each axis, however, a logical position counter and a real position counter cannot be enabled/disables individually. 2. If a variable ring function is enabled, a software limit function cannot be used. ICPDAS 165 I-8094 Software User Manual i8094_RESET_CARD Format: void i8094_RESET_CARD(void) Function: Command for resetting the motion card. Parameter: None. Example: //Set the reset command. i8094_RESET_CARD(); Note: When the bit (WR0/D15) is set to 1, but others are 0, the IC will be reset after command writing. After writing, the BUSYN signal will be on the Low level within 875 nSec (When CLK=16 MHz) maximum. ICPDAS 166 I-8094 Software User Manual A.7.4 Basic Motion Command Functions The basic motion commands of I-8094 are listed in Table A-5. They are including the setting for range (R), multiple (M), start speed (SV), driving speed (V), acceleration (A), deceleration (D), acceleration rate (K), output pulse (P), T-Curve acceleration / deceleration, and S-Curve acceleration / deceleration. The whole command procedures should be set with the initial command registers. After setting correlation parameters, the CPU sends command or data through MCX314As; finally, command enters in the logic-position-counter, and then sends to the driver to control the motor. Table A-5 Basic Motion Command Functions Function Name i8094_SET_SV i8094_SET_V i8094_SET_A i8094_SET_D i8094_SET_K i8094_SET_L i8094_SET_PULSE i8094_SET_AO i8094_SET_TCURVE i8094_SET_SCURVE i8094_SET_AUTODEC i8094_SET_MANDEC i8094_DRV_FDRIVE i8094_DRV_CDRIVE i8094_SET_SYMMETRY i8094_SET_ASYMMETRY i8094_STOP_WAIT i8094_STOP_SLOWLY i8094_STOP_SUDDENLY i8094_DRV_HOLD i8094_DRV_START ICPDAS Description Initial speed setting Drive speed setting Acceleration setting Deceleration setting Acceleration rate setting Deceleration rate setting Set output pulse number Acceleration Counter Offsetting T-Curve acc./dec. mode enabled S-Curve acc./dec. mode enabled Auto deceleration setting Manual deceleration setting Fixed pulse drive mode setting Continuous drive mode setting Symmetric T/S-curve Acc/Dec setting Asymmetric T/S-curve Acc/Dec setting Drive and wait for stopping Slow-down stop Emergent stop Holding for later driving Drive holding release (starting motion) 167 I-8094 Software User Manual i8094_SET_SV Format: void i8094_SET_SV(unsigned cardNo, WORD axis, WORD data) Function: This function can set the start speed. If the stop type is slow-down stop, the motion curve will be decelerating to the start speed and then stop. Set the start speed is SV, the multiple is M, and then the driving start is: Driving start speed(PPS)=SV×M Parameters: cardNo is the board number. axis is the motion axis code/name, as shows in Table 2-1. data is the value of SV, data range is 1~8000, other values are invalid. Example: //Set the start velocity 500 (PPS) for X axis. i8094_SET_SV(1, 0x1, 500); i8094_SET_V Format: void i8094_SET_V(unsigned char cardNo, WORD axis, WORD data) Function: The function is setting the speed of constant speed period in trapezoidal driving. In constant speed driving, the drive speed is the initial speed. The drive speed calculation is shown in the following formula: Driving Speed(PPS)=V×M Parameters: cardNo is the board number. axis is the motion axis code, as shows in Table 2-1. data is value of acceleration, the range is 1~8000, other values are invalid. Example: //Set the driving velocity 1000 (PPS) for X axis. i8094_SET_V(1, 0x1, 1000); Note: 1. If the setting drive speed is lower than the initial speed, the acceleration / deceleration will not be performed, and the driving is constant speed. During the encoder Z-phase searching (at a low-peed driving), the user want to perform the sudden stop once the Z-phase is detected, the drive speed should be set lower than the initial speed. Drive speed can be altered during the driving. When the drive speed of next constant speed period is set, the acceleration / deceleration will be performed to reach the new setting drive speed, then a constant speed driving starts. ICPDAS 168 I-8094 Software User Manual Note: 2. In fixed pulse S-curve acceleration / deceleration driving, there is no way to change the drive speed during the driving. In continuous S-curve acceleration / deceleration driving, the S-curve profile cannot be exactly tracked if the speed alterations during the acceleration/deceleration. It is better to change the drive speed in the constant speed period. i8094_SET_A Format: void i8094_SET_A(unsigned char cardNo, WORD axis, WORD data) Function: The function is setting the acceleration or deceleration of the trapezoidal driving. For S-curve acceleration / deceleration, it shows the linear acceleration until a specific value (A) driving. The acceleration calculation is shown in the following formula: Driving Acceleration(PPS/Sec)=A×125×M Parameters: cardNo is the board number. axis is the motion axes code/name, as shows in Table 2-1. data is value of acceleration, it’s range is 1~8000, other values are invalid. Example: //Set the acceleration 80 (PPS/Sec) for X axis. i8094_SET_A(1, 0x1, 80); ICPDAS 169 I-8094 Software User Manual i8094_SET_D Format: void i8094_SET_D(unsigned char cardNo, WORD axis, WORD data) Function: The function use when acceleration/deceleration is set individually, “D” is the parameter determining the deceleration of the trapezoidal driving. For S-curve acceleration / deceleration, the designated deceleration can be set until a specific value (D) is driving. The deceleration calculation is shown in the following formula: Driving Deceleration(PPS/Sec)=D×125×M Parameters: cardNo is the board number. axis is the motion axis code/name, as shows in Table 2-1. data is the value of deceleration, it’s range is 1~8000, other values are invalid. Example: //Set the deceleration 80 (PPS/Sec) for X axis. i8094_SET_D(1, 0x1, 80); i8094_SET_K Format: void i8094_SET_K(int cardNo, WORD axis, WORD data) Function: The function is setting the value of acceleraton rate (jerk), in a time unit, of S-curve Acc/Dec motion. The jerk calculation is shown in the following formula: Jerk (PPS/Sec2)=(62.5×106 / K)×M Parameters: cardNo is the board number. axis is the motion axis code/name, as shows in Table 2-1. data is the value of the acceleration rate, it’s range is 1~65535. Example: //Set the jerk 625 (PPS/Sec2) for the X axis. i8094_SET_K(1, 0x1, 625); Note: For K=65535 to 1 When Multiple = 1, 954 PPS/SEC2 ~ 62.5 x 106 PPS/SEC2 When Multiple = 500, 477 x 103 PPS/SEC2 ~ 31.25 109 PPS/SEC2 *In this manual, jerk is defined the increasing / decreasing rate of acceleration / deceleration in a time unit. However, jerk should cover the decreasing rate of acceleration and increasing rate of acceleration. ICPDAS 170 I-8094 Software User Manual i8094_SET_L Format: void i8094_SET_L(int cardNo, WORD axis, WORD data) Function: The function is setting the deceleration rate (jerk), in a time unit, of S-curve Acc/Dec motion. The jerk calculation is shown in the following formula: Jerk (PPS/Sec2)=(62.5×106 / K)×M Parameters: cardNo is the board number. axis is the motion axis code/name, as shows in Table 2-1. data is the value of the acceleration rate, it’s range is 1~65535. Example: //Set the jerk 625 (PPS/Sec2) for the X axis. i8094_SET_K(1, 0x1, 625); Note: For K=65535 to 1 When Multiple = 1, 954 PPS/SEC2 ~ 62.5 x 106 PPS/SEC2 When Multiple = 500, 477 x 103 PPS/SEC2 ~ 31.25 109 PPS/SEC2 i8094_SET_PULSE Format: void i8094_SET_PULSE(unsigned char cardNo, WORD axis, DWORD data) Function: The function is setting total output pulse numbers in fixed pulse driving. The value is absolute, unsigned number. The output pulse numbers can be changed during the driving. Parameters: cardNo is the board number. axis is the motion axis code/name, as shows in Table 2-1. data is the value of the pulse, it’s range is 0~268435455, other values are invalid. Example: //Set the driving pulse number (final point) 10000 for the X axis. i8094_SET_PULSE(1, 0x1, 10000); ICPDAS 171 I-8094 Software User Manual i8094_SET_AO Format: void i8094_SET_AO(unsigned char cardNo, WORD axis, WORD data) Function: The function is executing the acceleration counter offset. It is often used while the machine is using stepping motor. It can avoid the overshoot for high speed deceleration. Parameters: cardNo is the board number. axis is the motion axis code/name, as shows in Table 2-1. data is the value of the deceleration, it’s range is 0~65535. Other values are invalid. Example: i8094_SET_AO(1, 0x1, 200); i8094_SET_AUTODEC Format: void i8094_SET_AUTODEC(unsigned char cardNo, WORD axis) Function: Automatic deceleration setting. Parameters: cardNo is the board number. axis is the motion axis code/name, as shows in Table 2-1. Example://Enable the automatic deceleration for 4-axes. i8094_SET_AUTODEC(1, 0xf); Note: The function is useless in circular interpolation for T-curve deceleration. ICPDAS 172 I-8094 Software User Manual i8094_SET_MANDEC Format: void i8094_SET_MANDEC(unsigned char cardNo, WORD axis, WORD dp) Function: Set the manual deceleration point in fixed pulse acceleration/deceleration driving or interpolation motion when the manual deceleration mode is engaged. In manual deceleration mode, the user can set the bit D0 of WR3 register to 1. The decelerating point calculates as : Manual Decelerating Point = Output Pulse Numbers - Pulse Number for Deceleration Parameters: cardNo is the board number. axis is the motion axis code/name, as shows in Table 2-1. Example: //Set the manual deceleration point 8000 for the XY axes motion. i8094_SET_MANDEC(1, 0x3, 8000); Note: The suitable time for setting manual deceleration point 1. Asymmetry S-curve acceleration/deceleration 2. Circular interpolation i8094_DRV_FDRIVE Format: void i8094_DRV_FDRIVE(unsigned char cardNo, WORD axis, WORD nDir) Function: Set fixed-pulse drive. Parameters: cardNo is the board number. axis is the motion axis code/name, as shows in Table 2-1. nDir is the direction of the motion. nDir = 0, positive; nDir = 1, negative Example: //Set the negative fixed pulse drive. i8094_DRV_FDRIVE(1, 0x3, 1); ICPDAS 173 I-8094 Software User Manual i8094_DRV_CDRIVE Format: void i8094_DRV_CDRIVE(unsigned char cardNo, WORD axis, WORD nDir) Function: Set continuous drive. Parameters: cardNo is the board number. axis is the motion axis code/name, as shows in Table 2-1. nDir is the direction of the motion. nDir = 0, positive; nDir = 1, negative Example: //Set the positive continuous drive. i8094_DRV_CDRIVE(1, 0x3, 0 ); i8094_SET_SYMMETRY Format: void i8094_SET_SYMMETRY(unsigned char cardNo, WORD axis) Function: Set symmetry acceleration/deceleration. Parameters: cardNo is the board number. axis is the motion axis code/name, as shows in Table 2-1. Example: //Set the symmetry acc./dec. motion for 4-axes. i8094_SET_SYMMETRY(1, 0xf); i8094_SET_ASYMMETRY Format: void i8094_SET_ASYMMETRY(unsigned char cardNo, WORD axis) Function: Set asymmetry acceleration/deceleration Parameters: cardNo is the board number. axis is the motion axis code/name, as shows in Table 2-1. Example: //Set the asymmetry acc./dec. motion for 4-axes. i8094_SET_ASYMMETRY(1, 0xf); ICPDAS 174 I-8094 Software User Manual i8094_STOP_SLOWLY Format: void i8094_STOP_SLOWLY(unsigned char cardNo, WORD axis) Function: Motion command for stopping slowly. Parameters: cardNo is the board number. axis is the motion axis code/name, as shows in Table 2-1. Example: //Stop slowly command for 4-axes. i8094_STOP_SLOWLY(1, 0xf); i8094_STOP_SUDDENLY Format: void i8094_STOP_SUDDENLY(unsigned char cardNo, WORD axis) Function: Motion command for stopping suddenly. Parameters: cardNo is the board number. axis is the motion axis code/name, as shows in Table 2-1. Example: //Stop suddenly command for 4-axes. i8094_STOP_SUDDENLY(1, 0xf); i8094_DRV_HOLD Format: void i8094_DRV_HOLD(unsigned char cardNo, WORD axis) Function: Set holding for drive starting. Parameters: cardNo is the board number. axis is the motion axis code/name, as shows in Table 2-1. Example: i8094_DRV_HOLD(1, 0xf); ICPDAS 175 I-8094 Software User Manual i8094_DRV_START Format: void i8094_DRV_START(unsigned char cardNo, WORD axis) Function: Drive status holding release/finishing status clearing setting. Parameters: cardNo is the board number. axis is the motion axis code/name, as shows in Table 2-1. Example: i8094_DRV_SATRT(1, 0xf); ICPDAS 176 I-8094 Software User Manual Demo Program: T/S-curve acc/dec motion [Symmetry] Parameters: cardNo=1, motion axes=0x3 (AXIS_XY) i8094_SET_R(cardNo, 0x3, 800000); // R=800000, Multiple=10 i8094_SET_TCURVE(cardNo, 0x3); // Set T-Curve Mode i8094_SET_SYMMETRY(cardNo, 0x3); // Set symmetry mode for X, Y axes i8094_SET_SV(cardNo, 0x3, 100); // SV=100,Iinitial Speed=1000 (PPS) i8094_SET_V(cardNo, 0x3, 1000); // V=1000, Drive Speed=10000 (PPS) i8094_SET_A(cardNo, 0x3, 80); // A=80, Acceleration=100K (PPS/Sec) i8094_SET_PULSE(cardNo, 0x3, 25000); // Driving Pulse=25000 i8094_DRV_HOLD(card, 0x3); // Holding for driving starting i8094_DRV_FDRIVE(cardNo, 0x3, 0); // X-Axis Positive Fixed Pulse Drive i8094_DRV_START(card, 0x3); // Holding Release Fig. A-40 Symmetry T-curve acc/dec ICPDAS 177 I-8094 Software User Manual Demo Program: T/S-curve acc/dec motion [Asymmetry] Parameters: cardNo=1, motion axes=0x3 (AXIS_XY) i8094_SET_R(cardNo, 0x3, 8000000); // R=800000, Multiple=10 i8094_SET_SCURVE(cardNo, 0x3); // Set S-Curve Mode i8094_SET_ASYMMETRY(cardNo, 0x3); // Set Non-Symmetry Mode i8094_SET_SV(cardNo, 0x3, 100); // SV=100,Iinitial Speed=1000 (PPS) i8094_SET_V(cardNo, 0x3, 1000); // V=1000, Drive Speed=10000 (PPS) i8094_SET_A(cardNo, 0x3, 800); // A=800, Acceleration=1000K (PPS/Sec) i8094_SET_D(cardNo, 0x3, 80) // D=80, Deceleration=100K (PPS/Sec) i8094_SET_K(cardNo, 0x3, 1250); // K=1250, Jerk=500K (PPS/Sec2) i8094_SET_L(cardNo, 0x3, 125); // L=125, Decelerating Rate=50K (PPS/Sec2) i8094_SET_PULSE(cardNo, 0x3, 50000); // X-Axis Driving Pulse=50000 i8094_DRV_HOLD(card, 0x3); // Holding for driving starting i8094_DRV_FDRIVE(cardNo, 0x1, 1); // X-Axis Negative Fixed Pulse Drive i8094_DRV_FDRIVE(cardNo, 0x2, 0); // Y-Axis Positive Fixed Pulse Drive i8094_DRV_START(card, 0x3); // Holding Release Fig. A-41 Asymmetric S-curve acc/dec ICPDAS 178 I-8094 Software User Manual A.7.5 Interpolation Functions The below figure is the MCX314As Interpolation functional diagram. It consists of same functioned X, Y, Z, and U axes control sections and interpolation counting sections. Fig. A-41 MCX314As Functional Block Diagram ICPDAS 179 I-8094 Software User Manual Table A-6 Interpolation Functions Function Name i8094_MOTION_TYPE i8094_SET_FINISH i8094_LINE2D i8094_LINE3D i8094_SET_CENTER i8094_ARC_CW i8094_ARC_CCW i8094_CIRCLE_CW i8094_CIRCLE_CCW i8094_NEXT_WAIT i8094_BP_ENABLE i8094_BP_DISABLE i8094_BP_CLEAR i8094_BP_STACK i8094_BP_WAIT Description 2 or 3-axes constant vector speed setting Interpolation’s finish point setting 2 axes linear interpolation mode 3 axes linear interpolation mode Circular interpolation’s center setting CW direction arc interpolation mode CCW direction arc interpolation mode CW direction circle interpolation mode CCW direction circle interpolation mode Wait for next interpolation command Bit pattern interpolation enabled Bit pattern interpolation disabled Bit pattern interpolation cleared Bit pattern data stack Wait for bit pattern data write i8094_MOTION_TYPE Format: void i8094_MOTION_TYPE(unsigned char CardNo, WORD type) Function: Set 2 or 3-axes constant vector speed mode Parameter: cardNo is the board number. type is the parameter setting the constant vector speed modes. type=0, constant vector speed mode is invalid; type=1, 2-axes constant vector speed mode. type=2, 3-axes constant vector speed mode. Example: //Set the 2-axes constant vector mode. i8094_MOTION_TYPE(1, 1); ICPDAS 180 I-8094 Software User Manual i8094_SET_FINISH Format: void i8094_SET_FINISH(BYTE cardNo, WORD axis, long data) Function: Set the value of the finish point for motion (in Pulses). Parameter: cardNo Module number. axis axis or axes. Please refer to Table 2-1. data Pulse number. Range : -2,147,483,648 ~ +2,147,483,648 Example: //set the value of finish point. i8094_SET_FINISH(1, 1, 1000); Linear interpolation functions About the linear interpolation functions, users can choose any two or three axes in the four axes (X, Y, Z, U). The functions are designed in three modes: constant (tangential) speed, T-curve (tangential) acceleration / deceleration, S-curve (tangential) acceleration / deceleration. Users need to set the following parameters: Range: R Initial Speed: SV (PPS) Driving Speed: V (PPS) Acceleration: A (PPS/Sec) Finish Point: FP (Pulses) ICPDAS 181 I-8094 Software User Manual i8094_LINE_2D Format: void i8094_LINE_2D(umsigned char CardNo, long fp1, long fp2) Function: Two axes linear interpolation. Parameter: cardNo is the board number. fp1: finish point for axis1, data range is -8388608~8388607. fp2: finish point for axis2, data range is -8388608~8388607. Example: i8094_LINE2D(1, 12000, 10000); Fig. A-42 2-axes linear interpolation ICPDAS 182 I-8094 Software User Manual i8094_LINE_3D Format: void i8094_LINE_3D(unsigned char CardNo, long fp1, long fp2, long fp3) Function: Three axes linear interpolation. Parameter: cardNo is the board number. fp1: finish point for axis1, data range is -8388608~8388607. fp2: finish point for axis2, data range is -8388608~8388607. fp3: finish point for axis2, data range is -8388608~8388607. Example: i8094_LINE_3D(1, 0, 10000, 10000, 10000); Fig. A-43 3-axes linear interpolation ICPDAS 183 I-8094 Software User Manual Demo Program: 2/3 axes linear interpolation Parameters: cardNo=1, master axis=0x1 (AXIS_X), 2nd axis=0x2 (AXIS_Y), 3rd axis=0x4 (AXIS_Z) // 2-Axis Linear Interpolation i8094_Axis_ASSIGN(cardNo, 0x1, 0x2, 0); // Assign the Axes i8094_MOTION_TYPE(cardNo, CONST2); // Set 2-Axes Constant Vector Speed Mode i8094_SET_R(CardNo, Card[cardNo].ax1, 8000000); i8094_SET_R(cardNo,Card[cardNo].ax2, 8000000*1414L/1000L); i8094_SET_V(cardNo, Card[cardNo].ax1, 1000); i8094_LINE_2D(cardNo,3000,4000); // 2-Axes Interpolation // 3-Axis Linear Interpolation i8094_Axis_ASSIGN(cardNo, 0x1, 0x2, 0x4); // Assign the Axes i8094_MOTION_TYPE(cardNo, CONST2); // Set 3-Axes Constant Vector Speed Mode i8094_SET_R(cardNo, Card[cardNo].ax1, 8000000); i8094_SET_R(cardNo,Card[cardNo].ax2, 8000000*1414L/1000L); i8094_SET_R(cardNo, Card[cardNo].ax3, 8000000*1732L/1000L); i8094_SET_V(cardNo, Card[cardNo].ax1, 1000); i8094_LINE_3D(cardNo,5000,5000, 5000); // 3-Axes Interpolation Fig. A-44 2/3 axes linear interpolation ICPDAS 184 I-8094 Software User Manual Circular Interpolation Functions i8094_ARC_CW Format: void i8094_ARC_CW(unsigned char cardNo, long cp1, long cp2, long fp1, long fp2) Function: CW direction circular interpolation. Parameters: cardNo is the board number. cp1 is the center for axis1. cp2 is the center for axis2. fp1 is the finish point for axis1. fp2 is the finish point for axis2. Example: i8094_ARC_CW(1, -5000, -5000, -10000, -10000); Fig. A-45 CW circular interpolation ICPDAS 185 I-8094 Software User Manual i8094_ARC_CCW Format: void i8094_ARC_CCW(unsigned char cardNo, long cp1, long cp2, long fp1,long fp2) Function: CW direction circular interpolation. Parameters: cardNo is the board number. cp1 is the center for axis1. cp2 is the center for axis2. fp1 is the finish point for axis1. fp2 is the finish point for axis2. Example: i8094_ARC_CCW(1, -5000, -5000, -10000, -10000); Fig. A-46 CCW circular interpolation ICPDAS 186 I-8094 Software User Manual i8094_CIRCLE_CW Format: void i8094_CIRCLE_CW(unsigned char cardNo, long cp1, long cp2) Function: CW direction circular interpolation. Parameters: cardNo is the board number. cp1 is the center for axis1. cp2 is the center for axis2. fp1 is the finish point for axis1. fp2 is the finish point for axis2. Example: i8094_CIRCLE_CW(1, 0, 10000); Note: The function is convenient to profile for a total circle, it is accounting to the i8094_ARC_CW function. i8094_CIRCLE_CCW Format: void i8094_CIRCLE_CCW(unsigned char cardNo, long cp1, long cp2) Function: CW direction circular interpolation for constant speed. Parameters: cardNo is the board number. cp1 is the center for axis1. cp2 is the center for axis2. fp1 is the finish point for axis1. fp2 is the finish point for axis2. Example: i8094_CIRCLE_CCW(1, 0, 10000); Note: The function is convenient to profile for a total circle, it is accounting to the i8094_ARC_CCW function. ICPDAS 187 I-8094 Software User Manual i8094_NEXT_WAIT Format: void i8094_NEXT_WAIT(unsigned char cardNo) Function: Using to waiting for the command of the next segment. Parameters: cardNo is the board number. Example: i8094_NEXT_WAIT(1); ICPDAS 188 I-8094 Software User Manual Continuous interpolation User can use the linear and circular interpolation to implement a specific curve motion. There are two ways to implement: polling and interrupt. Fig. A-48 shows an example of executing continuous beginning at point (0,0) form segment 1, 2, 3… to the segment 8. In segment 1, 3, 5, and 7, the linear interpolation will be executed; in segment 2, 4, 6, and 8, the circular interpolation will be executed, and the track is a quadrant circle with radius 1500. The interpolation driving is at a constant vector speed: 1500 PPS. Fig. A-47 Continuous interpolation ICPDAS 189 I-8094 Software User Manual Demo Program: Constant Speed Continuous Interpolation Parameters: CradNo=1, Master axis=0x1 (Axis_X), 2nd axis=0x2 (AXIS_Y) i8094_AXIS_ASSIGN(cardNo, 0x1, 0x2, 0); i8094_SET_R(cardNo, Card[cardNo].ax1, 800000); i8094_SET_R(cardNo, Card[cardNo].ax2, 800000* 1414L/1000L); i8094_MOTION_TYPE(cardNo, 0x3, 1); // 2-axes constant vector speed i8094_SET_V(cardNo, Card[cardNo].ax1, 1500); // Set V = SV i8094_LINE_2D(cardNo, 4500, 0); i8094_NEXT_WAIT(cardNo); // Segment 1 // Wait next command i8094_ARC_CCW(cardNo, 0, 1500, 1500, 1500); i8094_NEXT_WAIT(cardNo); // Segment 2 // Wait next command i8094_LINE_2D(cardNo, 0, 1500); i8094_NEXT_WAIT(cardNo); // Segment 3 // Wait next command i8094_ARC_CCW(cardNo, -1500, 0, -1500, 1500); i8094_NEXT_WAIT(cardNo); // Segment 4 // Wait next command i8094_LINE_2D(cardNo, -4500, 0); i8094_NEXT_WAIT(cardNo); // Segment 5 // Wait next command i8094_ARC_CCW(cardNo, 0, -1500, -1500, -1500); i8094_NEXT_WAIT(cardNo); // Segment 6 // Wait next command i8094_LINE_2D(cardNo, 0, -1500); i8094_NEXT_WAIT(cardNo); // Segment 7 // Wait next command i8094_ARC_CCW(cardNo, 1500, 0, 1500, -1500); i8094_STOP_WAIT(cardNo, Card[cardNo].plane); // Segment 8 Delay(500); ICPDAS // Because of the servo lag, In eVC use Sleep(500) 190 I-8094 Software User Manual Bit Pattern Interpolation Functions i8094_BP_ENABLE i8094_BP_DISABLE Format: void i8094_BP_ENABLE(unsigned char cardNo) void i8094_BP_DISABLE(unsigned char cardNo) Function: Enable/disable the bit pattern data stack. Parameters: cardNo is the board number. Example: i8094_BP_ENABLE(1); i8094_BP_DISABLE(1); i8094_BP_STACK i8094_BP_CLEAR Format: void i8094_BP_STACK(unsigned char cardNo) void i8094_BP_CLEAR(unsigned char cardNo) Function: Stack/clear the bit pattern data. Parameters: cardNo is the board number. Example: i8094_BP_STACK(1); i8094_BP_CLEAR(1); ICPDAS 191 I-8094 Software User Manual i8094_BP_WAIT Format: void i8094_BP_WAIT(unsigned char cardNo) Function: Wait for bit pattern data outputting. Parameters: cardNo is the board number. Example: i8094_BP_WAIT(1); i8094_BP_LINE2D_DEMO Format: void i8094_BP_LINE2D_DEMO(unsigned char cardNo, long p1, long p2) Function: The linear DDA method for the bit pattern interpolation. Parameters: cardNo is the board number. Example: i8094_BP_LINE2D_DEMO(1, 30, 40); According to the below flow chart, user can use linear interpolation DDA algorithm to produce the BP data. However L = ICPDAS P12 + P2 2 , P1, P2 are the pulse number of each axis. 192 I-8094 Software User Manual Fig. A-48 Bit pattern interpolation by using the linear DDA method Note: The following bit pattern demo program is only valid in I-8000. User use the polling method to implement the bit pattern by calling the i8094_BP_LINE2_DEMO function and use interrupt method to implement by calling the i8094_BP_LINE_DEMO_INT function. ICPDAS 193 I-8094 Software User Manual Demo Program: Bit pattern interpolation by using the linear DDA data Parameters: cardNo=1, master axis=0x1 (AXIS_X), 2nd axis=0x2 (AXIS_Y), P1=30, P2=40 i8094_AXIS_ASSIGN(cardNo, 0x1, 0x2, 0); i8094_MOTION_TYPE(cardNo, ACCMODE ); i8094_SET_AUTODEC(cardNo, Card[cardNo].plane); // Auto Deceleration Enabled i8094_SET_TCURVE(cardNo, Card[cardNo].plane); // Set T-Curve Mode i8094_SET_R(cardNo, Card[cardNo].plane, 8000000); // Multiple=1 i8094_SET_SV(cardNo, Card[cardNo].plane, 50); i8094_SET_V(cardNo, Card[cardNo].plane, 500); i8094_SET_A(cardNo, Card[cardNo].plane, 80); i8094_BP_ENABLE(cardNo); // BP Interpolation Enabled i8094_BP_LINE2_DEMO(cardNo, 30, 40); // Linear DDA Data Stack i8094_BP_DISABLE(cardNo); // BP Interpolation disabled Fig. A-49 Use linear DDA method for bit pattern interpolation ICPDAS 194 I-8094 Software User Manual Use the linear DDA method, set P1(X-axis) = 30, P2(Y-axis) = 40, and the linear DDA data are calculated as bellows: Table A-7 DDA data for the bit pattern interpolation Index Z1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1 0 1 1 0 1 0 1 1 0 1 0 1 1 0 1 0 1 1 0 1 0 1 1 Hex1 0x6b5a 0xb5ad Z2 0 1 1 1 1 0 1 1 1 1 0 1 1 1 1 0 1 1 1 1 0 1 1 1 1 Hex2 0x7bde 0xbdf7 X Y Index Z1 0 1 1 2 3 3 4 4 5 6 6 7 7 8 9 9 10 10 11 12 12 13 13 14 15 0 1 2 3 4 4 5 6 7 8 8 9 10 11 12 12 13 14 15 16 16 17 18 19 20 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 0 1 0 1 1 0 1 0 1 1 0 1 0 1 1 0 1 0 1 1 0 1 0 1 1 Hex1 0x5ad6 0x3 Z2 0 1 1 1 1 0 1 1 1 1 0 1 1 1 1 0 1 1 1 1 0 1 1 1 1 Hex2 0xdef7 0x3 X Y 15 16 16 17 18 18 19 19 20 21 21 22 22 23 24 24 25 25 26 27 27 28 28 29 30 20 21 22 23 24 25 25 26 27 28 29 29 30 31 32 32 33 34 35 36 36 37 38 39 40 Note: Z1, Z2 are the output pulse on the each interval, X is the sum of Z1, Y is the sum of Z2, Hex1 is the 16 bits character made of 16 ones or zeros (Z1), and Hex2 is the 16 bits character made of 16 ones or zeros (Z2) ICPDAS 195 I-8094 Software User Manual A.7.6 Automatic Home Search Table A-8 Home Search Function Function Name Description Write data into the WR6, WR7 registers and use 60h command i8094_EXTENSION_MODE to set the conditions for automatic search mode. i8094_GET_EM6 i8094_GET_EM6 i8094_GET_EM7 i8094_GET_EM7 Setting the active level of the near home signal (IN0). i8094_IN0_LEVEL Setting the active level of the home signal (IN1). i8094_IN1_LEVEL Setting active level of the encoder Z-phase signal (IN2). i8094_IN2_LEVEL The home search speed (HV) setting. i8094_SET_HV Home search step 1 mode setting. i8094_HOME_STEP1 Home search step 1 mode setting. i8094_HOME_STEP2 Home search step 1 mode setting. i8094_HOME_STEP3 Home search step 1 mode setting. i8094_HOME_STEP4 Home and Encoder Z-phase signal condition setting. i8094_HOME_SAND The home search uses an overrun limit signal setting. I8094_HOME_LIMIT Clear the logic position and real position counter at termination i8094_HOME_PCLR home search. Start execution of automatic home search. i8094_HOME_START Set the home search mode. i8094_HOME_MODE i8094_EXTENSION_MODE Format: void i8094_EXTENSION_MODE(unsigned char cardNo, WORD axis, WORD em6data, WORD em7data) Function: Write data to the WR6, WR7 registers and uses 64h command to set the conditions for synchronous action mode. Parameters: cardNo is the board number. axis is the motion axis code/name, as shows in Table 2-1. em6data is the 32-bit data for writing in the WR6 register. em7data is the 32-bit data for writing in the WR7 register. Example: //Use the function to set the home search type of negative direction, and hardware //signal: home, near home, limit-. i8094_EXTENSION_MODE(1, 0xf, 0x5f00, 0x054f); ICPDAS 196 I-8094 Software User Manual i8094_GET_EM6 Format: WORD i8094_GET_EM6(BYTE cardNo, WORD axis) Function: Get the data of EM6. Parameters: cardNo board number. axis axis or axes. Please refer to Table 2-1. Example: //get the EM6 value of the X-axis on card 1 WORD em6Data; em6Data = i8094_GET_EM6(1, 0x1); i8094_GET_EM7 Format: WORD i8094_GET_EM7(BYTE cardNo, WORD axis) Function: Get the data of EM7. Parameters: cardNo board number. axis axis or axes. Please refer to Table 2-1. Example: ICPDAS //get the EM7 value of the X-axis on card 1 WORD em7Data; em7Data = i8094_GET_EM7(1, 0x1); 197 I-8094 Software User Manual i8094_IN0_LEVEL Format: void i8094_IN0_LEVEL(unsigned char cardNo, WORD axis, WORD nLevel ) Function: Set the logic level of the IN0 signal. Parameters: cardNo is the board number. axis is the motion axis code/name, as shows in ㎜ 2-1. nLevel is the setting the active level of home signal (IN1). nLevel=0, Low active; nLevel=1, Hi active. Example: i8094_IN0_LEVEL(1, 0xf, 0); 8094_IN1_LEVEL Format: void i8094_IN1_LEVEL(unsigned char cardNo, WORD axis, WORD nLevel) Function: Set the logic level of the IN1 signal. Parameters: cardNo is the board number. axis is the motion axis code/name, as shows in Table 2-1. nLevel is setting the active level of the near home signal (IN0). nLevel=0, Low active; nLevel=1, Hi active. Example: i8094_IN1_LEVEL(1, 0xf, 0); ICPDAS 198 I-8094 Software User Manual i8094_IN2_LEVEL Format: void i8094_IN2_LEVEL(unsigned char cardNo, WORD axis, WORD nLevel) Function: Set the logic level of the IN2 signal. Parameters: cardNo is the board number. axis is the motion axis code/name, as shows in Table 2-1. nLevel is the setting the active level of the encoder Z-phase signal (IN2). nLevel=0, Low active; nLevel=1, Hi active. Example: i8094_IN2_LEVEL(1, 0xf, 0); i8094_SET_HV Format: void i8094_SET_HV(unsigned char cardNo, WORD axis, WORD data) Function: Set he home search speed (HV). Parameters: cardNo is the board number. axis is the motion axis code/name, as shows in Table 2-1. data is the home search speed value. Data range:1~8000 Example: //Set home search speed 1000 (PPS) i8094_SET_HV(1, 0xf, 1000); ICPDAS 199 I-8094 Software User Manual i8094_HOME_STEP1 Format: void i8094_HOME_STEP1(unsigned char cardNo, WORD axis, WORD nType, WORD nDir) Function: Use the near home signal (IN0) to operate the home search. Parameters: cardNo is the board number. axis is the motion axis code/name. nType is the specified the near home signal (IN0) executed or not. nType= 0, non-execution; nType=1, execution. nDir is the operation direction of the step. nDir=0, positive; nDir=1, negative Example: //Set the step 1 enabled and – negative direction of the home search i8094_HOME_STEP1(1, 0xf, 1, 1); i8094_HOME_STEP2 Format: void i8094_HOME_STEP2(unsigned char cardNo, WORD axis, WORD nType, WORD nDir) Function: Use the home signal (IN1) to operate the home search. Parameters: cardNo is the board number. axis is the motion axis code/name. nType is the specified the home signal (IN1) executed or not. nType= 0, non-execution; nType=1, execution. nDir is the operation direction of the step. nDir=0, positive; nDir=1, negative Example: //Set the step 2 enabled and – negative direction of the home search i8094_HOME_STEP2(1, 0xf, 1, 1); ICPDAS 200 I-8094 Software User Manual i8094_HOME_STEP3 Format: void i8094_HOME_STEP3(unsigned char cardNo, WORD axis, WORD nType, WORD nDir) Function: Use the signal (IN2) to operate the home search. Parameter: cardNo is the board number. axis is the motion axis code/name. nType is the specified the encoder z-phase signal (IN2) executed or not. nType= 0, non-execution; nType=1, execution. nDir is the operation direction of the step. nDir=0, positive; nDir=1, negative Example: //Set the step 3 enabled and negative direction of the home search i8094_HOME_STEP3(1, 0xf, 1, 1); i8094_HOME_STEP4 Format: void i8094_HOME_STEP4(unsigned char cardNo, WORD axis, WORD nType, WORD nDir) Function: Set the offset drive in the last step. Parameter: cardNo is the board number. axis is the motion axis code/name. nType is the specified the near home signal (IN0) executed or not. nType= 0, non-execution; nType=1, execution. nDir is the operation direction of the step. nDir=0, positive; nDir=1, negative Example: //Set the step 4 enabled and – negative direction of the home search i8094_HOME_STEP4(1, 0xf, 1, 1); ICPDAS 201 I-8094 Software User Manual i8094_HOME _SAND Format: void i8094_HOME_SAND(unsigned char cardNo,WORD axis, WORD nType) Function: Set the operation of step 3 when the home signal and the encoder z-phase signal become active. Parameters: cardNo is the board number. axis is the motion axis code/name, as shows in Table 2-1. nType=0, disable; nType=1, enable. Example: //Disable the SAND (WR7/D9) condition. i8094_HOME_SAND(1, 0xf, 0); i8094_HOME _LIMIT Format: void i8094_HOME_LIMIT(unsigned char cardNo, WORD axis, WORD nType) Function: Set the home search using an overrun limit signal. Parameters: cardNo is the board number. axis is the motion axis code/name, as shows in Table 2-1. nType=0, disable; nType=1, enable. Example: //Disable the LIMIT (WR7/D10) condition. i8094_HOME_LIMIT(1, 0xf, 0); ICPDAS 202 I-8094 Software User Manual i8094_HOME _PCLR Format: void i8094_HOME_PCLR(unsigned char cardNo, WORD axis, WORD nType) Function: Clear the logic position and real position counter at termination home search. Parameters: cardNo is the board number. axis is the motion axis code/name, as shows in Table 2-1. nType=0, disable; nType=1, enable. Example: //Enable the PCLR (WR7/D8) condition. i8094_HOME_PCLR(1, 0xf, 0); i8094_HOME _START Format: void i8094_HOME_START(unsigned char cardNo, WORD axis) Function: Start execution of automatic home search. Parameters: cardNo is the board number. axis is the motion axis code/name, as shows in Table 2-1. Example: //Start home search operation. i8094_HOME_START(1, 0xf); ICPDAS 203 I-8094 Software User Manual i8094_HOME _MODE Format: void i8094_HOME_MODE(unsigned char cardNo,WORD axis, WORD Hometype) Function: Home search demo function. Parameters: cardNo is the board number. axis is the motion axis code, as shows in Table 2-1. HomeType is one of the 8 combination cases of various homing steps. 8 cases are defined in the following table. Table A-9 Signals for home search types Home Type 0 Comment Dir-, hardware signal used: home, near home, limit- 1 Dir+, hardware signal used: home, near home, limit+ 2 Dir-, hardware signal used: home, limit- (step1 disabled) 3 Dir+, hardware signal used: home, limit+ (step1 disabled) 4 Dir-, hardware signal used: home, near home, limit-, encoder-Z 5 Dir+, hardware signal used: home, near home, limit+, encoder-Z 6 Dir-, hardware signal used: home, limit-, encoder-Z 7 Dir+, hardware used: home, limit+, encoder-Z Example: //Set the type 0 of the home search for all axes. i8094_HOME_DEMO(1, 0xf, 0); //Start the home search motion. i8094_HOME_START(1, 0xf); ICPDAS 204 I-8094 Software User Manual Example of home search using a near home (IN0), home signal (IN1) and Z-phase signal. Operation Step 1 Step 2 Step 3 Step 4 Input signal and logical level Near home signal (IN0) is active (low) Home signal (IN1) is active (low) Z-phase signal (IN2) is active (high) 35000 pulse offset Search direction + + Search speed 20000 (PPS) 500 (PPS) 500 (PPS) 20000 (PPS) Fig. A-50 Hardware disposition for home operation example 1 Note: In this example, the user should connect the IN0~IN2 signals as shown in the diagram on the left-hand side. Demo Program: Example of home search using a near home (IN0), home signal (IN1) and the Z-phase signal. Parameters: cardNo=1, motion axis=0xf (AXIS_ALL) i8094_SET_R(1, 0xf, 800000) // Set Multiple=10 8094_HLMTM_LEVEL(cardNo, 0xf, 0); // Set negative limit signal of low active i8094_LMTSTOP_MODE(cardNo, 0xf, 0) // Set Limit stop mode of decelerating stop i8094_HOME_STEP1(cardNo, 0xf, 1, 1); // Set Step1 is executed and negative direction for 4-axes i8094_HOME_STEP2(cardNo, 0xf, 1, 1); // Set Step2 is executed and negative direction for 4-axes i8094_HOME_STEP3(cardNo, 0xf, 1, 0); // Set Step3 is executed and positive direction for 4-axes i8094_HOME_STEP4(cardNo, 0xf, 1, 0); // Set Step4 is executed and positive direction for 4-axes i8094_SET_SV(cardNo, 0xf, 500); // Set start velocity=500 (PPS) i8094_SET_V(cardNo, 0xf, 2000); // Set drive velocity=2000 (PPS) i8094_SET_A(cardNo, 0xf, 80); // Set acceleration=80 (PPS/Sec) i8094_SET_HV(cardNo, 0xf, 500); // Set home speed=500 (PPS) i8094_SET_PULSE(cardNo, 0xf, 20000); // Set offset pulse=20000 i8094_HOME_START(cardNo , 0xf); // Starts execution of automatic home search i8094_STOP_WAIT(cardNo, 0xf); // Wait drive stop Sleep(500); // In BC use Delay(500); i8094_SET_LP(cardNo, axis, 0); // Clear LP counter i8094_SET_EP(cardNo, axis, 0); // Clear EP counter ICPDAS 205 I-8094 Software User Manual Example of home search using a home signal (IN1) only. Operation Step 1 Step 2 Step 3 Step 4 Input signal and logical level Near home signal (IN0) is active (low) Home signal (IN1) signal active (low) Not executed 35000 pulse offset Search direction - Search speed 20000 (PPS) 500 (PPS) + 20000 (PPS) Fig. A-51 Hardware disposition for home operation example 2 Demo Program: Example of home search using a home signal (IN1) only. Parameters: cardNo=1, motion axis=0xf (AXIS_ALL) i8094_SET_R(cardNo, 0xf, 800000) // Set Multiple=10 i8094_HOME_STEP1(cardNo, 0xf, 1, 1); // Set Step1 is executed and negative direction for 4-axes i8094_HOME_STEP2(cardNo, 0xf, 1, 1); // Set Step2 is executed and negative direction for 4-axes i8094_HOME_STEP3(cardNo, 0xf, 0, 0); // Set Step3 is non-executed i8094_HOME_STEP4(cardNo, 0xf, 1, 0); // Set Step4 is executed and positive direction for 4-axes i8094_SET_SV(cardNo, 0xf, 500); // Set start velocity=500 (PPS) i8094_SET_V(cardNo, 0xf, 2000); // Set drive velocity=2000 (PPS) i8094_SET_A(cardNo, 0xf, 80); // Set acceleration=80 (PPS/Sec) i8094_SET_HV(cardNo, 0xf, 500); // Set home speed=500 (PPS) i8094_SET_PULSE(cardNo, 0xf, 20000); // Set offset pulse=20000 i8094_HOME_START(cardNo, 0xf); // Starts execution of automatic home search i8094_STOP_WAIT(cardNo, axis); // Wait drive stop Sleep(500); // Delay 500ms, In BC use Delay(500); i8094_SET_LP(cardNo, axis, 0); // Clear LP counter i8094_SET_EP(cardNo, axis, 0); // Clear EP counter ICPDAS 206 I-8094 Software User Manual Example of home search using a limit signal only. Operation Step 1 Step 2 Step 3 Step 4 Input signal and logical level Near home signal (IN0) is active (low) Home signal (IN1) signal is active (low) Not executed 35000 pulse offset Search direction - Search speed 20000 (PPS) 500 (PPS) + 20000 (PPS) Fig. A-52 Hardware disposition for home operation example 3 Demo Program: Example of home search using a limit signal only. Parameters: cardNo=1, motion axis=0xf i8094_SET_R(cardNo, 0xf, 800000) // Set Multiple=10 8094_HLMTM_LEVEL(1, 0xf, 0); // Set negative limit signal of low active i8094_LMTSTOP_MODE(cardNo, 0xf, 0) // Set Limit stop mode of decelerating stop i8094_HOME_SAND(cardNo, 0xf, 0); // Set Z-phase and home signal disabled i8094_HOME_STEP1(cardNo, 0xf, 1, 1); // Set Step1 is executed and negative direction for 4-axes i8094_HOME_STEP2(cardNo, 0xf, 1, 1); // Set Step2 is executed and negative direction for 4-axes i8094_HOME_STEP3(cardNo, 0xf, 1, 0); // Set Step3 is executed and positive direction for 4-axes i8094_HOME_STEP4(cardNo, 0xf, 1, 0); // Set Step4 is executed and positive direction for 4-axes i8094_SET_SV(cardNo, 0xf, 500); // SV=500, Start Speed=5000 (PPS) i8094_SET_V(cardNo, 0xf, 2000); // V=2000, Drive Speed=20000 (PPS) i8094_SET_A(cardNo, 0xf, 80); // A=80, Acceleration=10K (PPS/Sec) i8094_SET_HV(cardNo, 0xf, 500); // HV=500 Home Speed=5000 (PPS) i8094_SET_PULSE(cardNo, 0xf, 3500); // Set offset pulse=3500 i8094_HOME_START(cardNo, 0xf); // Starts execution of automatic home search i8094_STOP_WAIT(cardNo, axis); // Wait drive stop Delay(500); // Delay 500ms, In eVC use Sleep(500); i8094_SET_LP(cardNo, axis, 0); // Clear LP counter i8094_SET_EP(cardNo, axis, 0); // Clear EP counter ICPDAS 207 I-8094 Software User Manual A.7.7 Synchronous Action Table A-10 Synchronous Action functions Function Name Description i8094_SYNC_MODE Writes data to the WR6, WR7 registers and uses 64h command to set the conditions for synchronous action mode. i8094_GET_SB Synchronous action buffer register reading. i8094_SYNC_MODE Format: void i8094_SYNC_MODE(unsigned char cardNo, WORD axis, WORD sm6data, WORD sm7data) Function: Writes data to the WR6, WR7 registers and uses 64h command to set the conditions for synchronous action mode. Parameters: cardNo is the board number. axis is the motion axis code, as shows in Table 2-1. sm6data is the data for the WR6 register. sm7data is the data for the WR6 register. Example: //Set the X axis (0x1) as the Provocative axis, Y axis (0x2) as the Active //axis. However the activation factor is the logic position counter value //exceeded the value of COMP+ register (P ≥ C+), and the action is the positive //fixed pulse driving. i8094_SET_SYNCMODE(1, 0x1, 0x2001 , 0x0); i8094_SET_SYNCMODE(1, 0x2, 0x0, 0x0010); ICPDAS 208 I-8094 Software User Manual i8094_GET_SB Format: void i8094_GET_SB(unsigned char cardNo, WORD axis) Function: Read the synchronous action buffer register. Parameters: cardNo is the board number. axis is the motion axis code/name, as shows in Table 2-1. Example: //Get the data from the x-axis’s buffer register. i8094_GET_SB(1, 0x1); i8094_GET_SM6 Format: WORD i8094_GET_SM6(BYTE cardNo, WORD axis) Function: Get the value of SM6 register. Parameters: cardNo board number axis axis or axes. Please refer to Table A2-1. Example: //Get the value of SM6 of X-axis on board 1. WORD sm6Data; sm6Data = i8094_GET_SM6(1, 0x1); i8094_GET_SM7 Format: WORD i8094_GET_SM7(BYTE cardNo, WORD axis) Function: Get the value of SM7 register. Parameters: cardNo board number axis axis or axes. Please refer to Table A2-1. Example: //Get the value of SM7 of X-axis on board 1. WORD sm7Data ; sm7Data = i8094_GET_SM7(1, 0x1); ICPDAS 209 I-8094 Software User Manual Demo Program: When the X axis is passing through the position 10000, the Y axis starts +direction fixed-pulse drive. Parameters: cardNo=1, ProvocativePulse=15000, ActivePulse=30000; TotalAxis=0x3 (AXIS_XY), ProvocativeAxis=0x1 (AXIS_X), ActiveAxis=0x2 (AXIS_Y) CompValue=10000 // Set parameters s for total axes or you can also set for individual axis i8094_SET_SV(cardNo, TotalAxis, 100); i8094_SET_V(cardNo, TotalAxis, 3000); i8094_SET_A(cardNo, TotalAxis, 160); // Set output pulse for the provocative axis i8094_SET_PULSE(cardNo, ProvocativeAxis, ProvocativePulse); // Set output pulse for active axis i8094_SET_PULSE(cardNo, ActiveAxis, ActivePulse); // Set a boundary condition COMP+ in the provocative axis i8094_SET_CP(cardNo, ProvocativeAxis, CompValue); // Disable the software limit for(i=0;i<4;i++) { i8094_SET_WR2(cardNo, 1<<i, Reg[cardNo].WR2[i]&~0x0003); } // Provocative factor: P>=C+ i8094_SYNC_MODE(cardNo, ProvocativeAxis, 0x2001, 0x0); i8094_COMMAND(cardNo, ProvocativeAxis, 0x20); // Action of the active axis +direction fixed-pulse drive i8094_SYNC_MODE(cardNo, ActiveAxis, 0x0, 0x0001); i8094_COMMAND(cardNo, ActiveAxis, 0x20); ICPDAS 210 I-8094 Software User Manual Fig. A-53 Synchronous action example 1 Demo Program: At first the X,Y axes continuous drive, when the X axis is passing through the position -10000, the Y axis stops. Parameters: cardNo=1, ProvocativePulse=15000, ActivePulse=30000; TotalAxis=0x3 (AXIS_XY), ProvocativeAxis=0x1 (AXIS_X), ActiveAxis=0x2 (AXIS_Y) CompValue=10000 // Set parameters s for total axes or you can also set for individual axis i8094_SET_SV(cardNo, AXIS_X, 100); i8094_SET_V(cardNo, AXIS_X, 3000); i8094_SET_A(cardNo, AXIS_X, 160); i8094_SET_SV(cardNo, AXIS_Y, 100); i8094_SET_V(cardNo, AXIS_Y, 2000); i8094_SET_A(cardNo, AXIS_Y, 80); // Set output pulse for the provocative axis i8094_SET_PULSE(cardNo, ProvocativeAxis, ProvocativePulse); // Set output pulse for active axis i8094_SET_PULSE(cardNo, ActiveAxis, ActivePulse); // Set a boundary condition COMP- in provocative axis i8094_SET_CM(cardNo, ProvocativeAxis, CompValue); // Disable the software limit for(i=0;i<4;i++) { i8094_SET_WR2(cardNo, 1<<i, Reg[cardNo].WR2[i]&~0x0003); } // -Direction continuous drive for the provocative axis i8094_COMMAND(cardNo, ProvocativeAxis, 0x21); // Action of the active axis ---> Stop i8094_SYNC_MODE(cardNo, ActiveAxis, 0x0, 0x0010); // +Direction continuous drive for the active axis i8094_COMMAND(cardNo, ActiveAxis, 0x21); ICPDAS 211 I-8094 Software User Manual Fig. A-54 Synchronous action example 2 ICPDAS 212 I-8094 Software User Manual Demo Program: Advanced application for synchronous motion: X,Y axes circular interpolation + Z axis fixed-pulse drive Parameters: cardNo=1, tempSV=100 (initial speed for XY circular interpolation), tempV=2000 (Drive speed for XY circular interpolation), tempA=80 (The acceleration for XY interpolation), tempVZ=687 (The constant speed for Z axis), tempDP=13963 (Deceleration point for XY circular interpolation) Description: Set the inclined plane is X,Y-axes and the vertical plane is Z-axis And the radius of the circle is 5000 and the angle of inclination is 30. // Set parameters s for total axes or you can also set for individual axis i8094_SET_SV(cardNo, TotalAxis, tempSV); i8094_SET_V(cardNo, TotalAxis, tempV); i8094_SET_A(cardNo, TotalAxis, tempA); // Select the master axis i8094_AXIS_ASSIGN(cardNo, AXIS_X, AXIS_Y, 0); // Acc mode setting i8094_MOTION_TYPE(cardNo, ACCMODE); // T-curve acc mode setting i8094_SET_TCURVE(cardNo, Card[cardNo].plane); // Deceleration enabled i8094_DEC_ENABLE(cardNo); // 2-axes circular interplation mode setting i8094_SET_R(cardNo, Card[cardNo].ax1, 8000000L); i8094_SET_R(cardNo, Card[cardNo].ax2, 8000000L *1414L/1000L); // Set parameters for X,Y axes i8094_SET_SV(cardNo, AXIS_X, tempSV); i8094_SET_V(cardNo, AXIS_X, tempV); i8094_SET_A(cardNo, AXIS_X, tempA); // Set parameters for Z axis i8094_SET_R(cardNo, AXIS_Z, templong); i8094_SET_SV(cardNo, AXIS_Z, tempVZ); i8094_SET_V(cardNo, AXIS_Z, tempVZ); // Synchronous action provocative factor: D-STA // 1st seg i8094_SYNC_MODE(cardNo, AXIS_X, 0x4010, 0x0000); i8094_SYNC_MODE(cardNo, AXIS_Z, 0x0000, 0x0002); i8094_SET_MANDEC(cardNo, AXIS_X, tempDP); i8094_ARC_CW(cardNo, 0, -5000, 0, -10000); i8094_SET_PULSE(cardNo, AXIS_Z, 5000); i8094_DRV_FDRIVE(cardNo, AXIS_Z, 1); // Wait for drive stop i8094_STOP_WAIT(cardNo, AXIS_XYZ); ICPDAS 213 I-8094 Software User Manual i8094_STOP_WAIT(cardNo, AXIS_XYZ); // 2nd seg i8094_SYNC_MODE(cardNo, AXIS_X, 0x4010, 0x0000); i8094_SYNC_MODE(cardNo, AXIS_Z, 0x0000, 0x0001); i8094_SET_MANDEC(cardNo, AXIS_X, tempDP); i8094_ARC_CW(cardNo, 0, 5000, 0, 10000); i8094_SET_PULSE(cardNo, AXIS_Z, 5000); i8094_DRV_FDRIVE(cardNo, AXIS_Z, 0); // Wait for drive stop Delay(500); // Because of the servo lag Fig. A-55 Synchronous action example 3 ICPDAS 214 I-8094 Software User Manual A.7.8 I/O Signal Managements Table A-11 I/O Signal Management Functions Function Name i8094_LMT_STOPMODE i8094_ENCODER_MODE i8094_ENCODER_DIVISION i8094_ALARM_ENABLE i8094_ALARM_DISABLE i8094_ALARM_LEVEL i8094_INPOS_LEVEL i8094_INnSTOP_ENABLE i8094_INnSTOP_DISABLE i8094_IN3_LEVEL i8094_EXTDRV_DISABLE i8094_EXTDRV_CDRV i8094_EXTDRV_FDRV i8094_EXTDRV_MANUAL i8094_SET_OUT1 i8094_DIGITAL_FILTER i8094_SERVO_ON i8094_SERVO_OFF Description Hardware signal stop type setting Encoder signal mode setting (PULSE/DIR or CW/CCW) Quadrature encoder input division setting Enable alarm signal Disable alarm signal Setting alarm signal logic active level Inpos signal active mode setting Drive stop signal enabled setting (IN0~IN3) Drive stop signal disabled setting (IN0~IN3) Setting the IN3 signal logic active level External signal disabled setting External signal for continuous driving mode setting External signal for fixed pulse driving mode setting External signal for manual pulse driving mode setting Set external as status output1 Digital filter setting SERVO ON setting SERVO OFF setting i8094_LMT_STOPMODE Format: void i8094_LMT_STOPMODE (unsigned char cardNo, WORD axis, WORD nType) Function: The function is used for controlling motion stop type when the hardware limits are active. Parameters: cardNo is the board number. axis is the motion axis code, as shows in Table 2-1. nType is setting for controlling stop type when the hardware limits are active. nType=0: sudden stop; nType=1: slow-down stop. Example: //Set the hardware limit signal for slow-down stop. i8094_SET_HLMTSIG(1, 0xf, 1); ICPDAS 215 I-8094 Software User Manual i8094_ENCODER_MODE Format: void i8094_ENCODER_MODE (unsigned char CardNo, WORD axis, WORD nMode) Function: Set the type of encoder input signals (nECA/PPIN and nECB/PMIN) Parameters: cardNo is the board number. axis is the motion axis, as shows in Table 2-1. nMode=0, means the input signal is CW/CCW. nMode=1, means the input signal is Pulse/Direction. Example: //Set the encoder mode as CW/CCW for all axes. i8094_ENCODER_MODE(1, 0xf, 0); i8094_ENCODER_DIVISION Format: void i8094_ENCODER_DEVISION(unsigned char CardNo, WORD axis, WORD nMode) Function: The division setting for quadrature encoder input. Up / down pulse input is not available. Parameters: cardNo is the board number. axis is the motion axis code, as shows in Table 2-1. nMode is the division which set for quadrature encoder input. nMode=0, division is 1/1; nMode=1, division is1/2; nMode=2, division is1/4; nMode=3, division is invalid. Example: //Set the encoder input signal division of 1/1 for all axes. i8094_ENCODER_DEVISION(1, 0xf, 0); ICPDAS 216 I-8094 Software User Manual i8094_ALARM_ENABLE i8094_ALARM_DISABLE Format: void i8094_ALARM_ENABLE (unsigned char cardNo, WORD axis) void i8094_ALARM_DISABLE (unsigned char cardNo, WORD axis) Function: Enable/disable the servo alarm input signal. Parameters: cardNo is the board number. axis is the motion axis code, as shows in Table 2-1. Example: //Set the alarm signal enabled for all axes. i8094_ALM_ENABLE(1, 0xf); i8094_INPOS_ENABLE i8094_INPOS_DISABLE Format: void i8094_INPOS_ENABLE (unsigned char CardNo, WORD axis) void i8094_INPOS_DISABLE (unsigned char CardNo, WORD axis) Function: Enable/disable of servo in-position input signal. Parameters: cardNo is the board number. axis is the motion axis code, as shows in Table 2-1 Example: //Set the in-position signal enabled for all axes. i8094_INPOS_ENABLE(1, 0xf, 1); ICPDAS 217 I-8094 Software User Manual i8094_ALARM_LEVEL Format: void i8094_ALARM_LEVEL (unsigned char CardNo, WORD axis, WORD nLevel) Function: Set the active level for input alarm signal Parameters: cardNo is the board number. axis is the motion axis code, as shows in Table 2-1. nLevel: set the logical of alarm signal (INP-L). nLevel=0, Low active; nLevel=1, Hi active. Example: //Set the alarm signal as Hi active for all axes. i8094_ALARM_LEVEL(1, 0xf, 1); i8094_INPOS_LEVEL Format: void i8094_INPOS_LEVEL (unsigned char CardNo, WORD axis, WORD nLevel) Function: Set the logical level of INPOS input signal. Parameters: cardNo is the board number. axis is the motion axis code, as shows in Table 2-1 nLevel: set the logical of in-position signal (INP-L). nLevel=0, Low active; nLevel=1, Hi active. Example: //Set the in-position signal as Hi active for all axes. i8094_INPOS_LEVEL(1, 0xf, 1); ICPDAS 218 I-8094 Software User Manual i8094_INnSTOP_ENABLE i8094_INnSTOP_DISABLE Format: void i8094_INnSTOP_ENABLE(unsigned char CardNo, WORD axis, WORD nINE) void i8094_INnSTOP_DISABLE(unsigned char CardNo, WORD axis, WORD nINE) Function: Set the input drive stop signal enabled or disable. Parameters: cardNo is the board number. axis is the motion axis code, as shows in Table 2-1. nINE is the symbol of the (nIN-E), (WR1/D1,D3, D5, D7). For IN0~IN3: IN0=0, IN1=1, IN2=2, IN3=3. nType is the command for setting enable/disable of driving stop signal. nType=0, disable; nType=1, enable. Example: i8094_INnSTOP_ENABLE(1, 0xf, 1); i8094_IN3_LEVEL Format: void i8094_IN3_LEVEL(unsigned char CardNo, WORD axis, WORD nLevel) Function: Set the input drive stop signal (Hi/Low) active. Parameters: cardNo is the board number. axis is the motion axis code, as shows in Table 2-1. nLevel is the command for setting driving stop signal (Hi/Low) active. nLevel=0, Low active; nLevel=1, Hi active. Example: i8094_INSTOP_LEVEL(1, 0xf, 1); ICPDAS 219 I-8094 Software User Manual i8094_EXTDRV_DISABLE Format: void i8094_EXTDRV_DISABLE(unsigned char CardNo, WORD axis) Function: Set the external driving signal disabled. Parameters: cardNo is the board number. axis is the motion axis code, as shows in Table 2-1 Example: //Disable the external driving signal for all axes. i8094_EXTDRV_DISABLE(1, 0xf); i8094_EXTDRV_CDRIVE Format: void i8094_EXTDRV_CDRIVE(unsigned char CardNo, WORD axis) Function: Set the external driving signal for continuous driving mode. Parameters: axis is the motion axis code, as shows in Table 2-1 Example: //Set the external driving signal as continuous driving for X, Y axes. i8094_EXTDRV_CDRIVE(1, 0x3) i8094_EXTDRV_FDRIVE Format: void i8094_EXTDRV_FDRIVE(unsigned char CardNo, WORD axis) Function: Set the external driving signal for fixed pulse driving mode. Parameters: cardNo is the board number. axis is the motion axis code, as shows in Table 2-1. Example: //Set the external driving signal as fixed pulse driving for X, Y axes. i8094_EXTDRV_FDRV(1, 0x3) ICPDAS 220 I-8094 Software User Manual i8094_EXDRV_MANUAL Format: void i8094_EXDRIVING_MANUAL(unsigned char CardNo, WORD axis) Function: Set the external driving signal for manual pulse driving mode. Parameters: cardNo is the board number. axis is the motion axis code, as shows in Table 2-1 Example: //Set the external driving signal as manual pulse driving for all axes. i8094_EXTDRV_MANUAL(1, 0xf) Note: When using the i8094_EXDRV_MANUAL function, the manual pulsar mode becomes effective. Users can use hand wheel to receive phase-A/B signals of the encoder, the manual pulsar outputs +/- direction drive pulses. It is simple function. i8094_SET_OUT1 Format: void i8094_SET_OUT1(unsigned char CardNo, WORD axis, WORD nLevel) Function: Set the output 1 signals for assigned axes. Parameters: cardNo is the board number. axis is the motion axis code/name, as shows in Table 2-1 Example: //Set the OUTPUT1 signal of Hi active for x axis. i8094_SET_OUTPUT1(1, 0x1, 1); Note: After setting the active level of the function, users can use the output signal of the 4-axes to be the testing DO pins. ICPDAS 221 I-8094 Software User Manual i8094_DIGITAL_FILTER Format: void i8094_DIGITAL_FILTER(unsigned char cardNo, WORD axis, WORD FEn, WORD FLn) Function: Set the input signal filter. This IC is equipped with an integral type in the input stage of each input signal. Parameters: cardNo is the board number. axis is the motion axis code/name, as shows in Table 2-1 FEn is code of the filter enable signal register. Refer to WR6/D8~D12 in the following table. Table A-12 Filter enable signal register Specification Bit WR6/D8 (FE0) WR6/D9 (FE1) WR6/D10 (FE2) WR6/D11 (FE3) WR6/D12 (FE4) Filter Enable Signal EMGN, nLMTP, nLMTM, nINO, nIN1 nIN2 nINPOS, nALARM nEXPP, nEXPM, EXPLSN nIN3 FLn is the code of the selection for filter time constant. Refer to WR6/D13~D15 in the following table. Table A-13 The code of the selection for filter time constant WR6/D15~13 (FL2~0) Removable maximum noise width Input signal delay time 0 1.75 μ SEC 2 μ SEC 1 224 μ SEC 256 μ SEC 2 448 μ SEC 512 μ SEC 3 896 μ SEC 1.024mSEC 4 1.792mSEC 2.048mSEC 5 3.584mSEC 4.096mSEC 6 7.168mSEC 8.192mSEC 7 14.336mSEC 16.384mSEC Example: //Set the IN2 to be the filter enable signal and input signal delay time=256μSec i8094_DIGITAL_FILTER(1, 0xf, 0x0200, 0x4000); ICPDAS 222 I-8094 Software User Manual i8094_SERVO_ON Format: void i8094_SERVO_ON(unsigned char CardNo, WORD axis) Function: Using the i8094_SET_OUTPUT1 function to set servo on status Parameters: cardNo is the board number. axis is the motion axis code/name, as shows in Table 2-1 Example: i8094_SERVO_ON(1, 0xf) i8094_SERVO_OFF Format: void i8094_SERVO_OFF(unsigned char CardNo, WORD axis) Function: Using the i8094_SET_OUTPUT1 function to set servo off status Parameters: cardNo is the board number. axis is the motion axis code, as shows in Table 2-1 Example: i8094_SERVO_OFF(1, 0xf) ICPDAS 223 I-8094 Software User Manual A.7.9 FRnet Related Functions Table A-14 FRnet related functions Function Name i8094_FRNET_SA i8094_FRNET_RA Description Write data to digital output of FRnet interface. Read digital input from FRnet interface. i8094_FRNET_SA Format: void i8094_FRNET_SA(BYTE cardNo, WORD wSA, WORD data) Function: This function write data to the FRnet digital output. SA means the Sending Address which can be one of the legal group number of FRnet. One group comprises 16 bits data. Therefore, total 128 DO can be defined for one FRnet interface. Parameters: cardNo is the board number. wSA: data: Group number, range 0~7 8~15 are used for digital inputs 16-bit data Return: WORD 16-bit DI data Example: WORD IN_Data; IN_Data = i8094_FRNET_RA(1, 8); //Read the 16-bit DI which is on module 1 and the group number is 8. ICPDAS 224 I-8094 Software User Manual i8094_FRNET_RA Format: void i8094_FRNET_RA(BYTE cardNo, WORD wRA) Function: This function reads the FRnet digital input signals. RA means the Receiving Address which can be one of the legal group number of FRnet. One group comprises 16 bits data. Therefore, total 128 DI can be defined for one FRnet interface. Parameters: cardNo is the board number. wRA: Group number, range 8~15 0~7 are used for digital outputs data: 16-bit data Return: None Example: i8094MF_FRNET_SA(1, 0,0xffff); //Write 0xffff to the 16-bit DO which is on module 1 and the group number is 0. ICPDAS 225 I-8094 Software User Manual A.8 i8094 Command Lists For the advanced users who can develop their applications by using the basic function, several lists of command codes and their corresponding ranges are listed below. For more information, users can refer to the manual of MCX314As motion chip. A.8.1 Data Setting Commands Symbol Code Command Data Range Data length (Byte) R K A D SV V P FP 00h 01h 02h 03h 04h 05h 06h 06h 8,000,000~16,000 0 ~ 65,535 1 ~ 8,000 1 ~ 8,000 1 ~ 8,000 1 ~ 8,000 0~+228 -231~+231 4 2 2 2 2 2 4 4 DP 07h Range setting Acc rate (Jerk) setting Acceleration (Acc) setting Deceleraton (Dec) setting Initial speed setting Driving speed setting Output pulse numbers Finish point setting Manual deceleration point setting Circular center point setting Logical position counter setting Real position counter setting COMP+ register setting COMP- register setting Acceleration counter offset setting Deceleration rate setting Extension mode setting Home detecting speed setting Synchronous action mode setting 0 ~ 65,535 2 C LP EP CP CM 08h 09h 0Ah 0Bh 0Ch AO 0Dh L EM HV 0Eh 60h 61h SM 64h 31 31 -2 ~+2 -231~+231 -231~+231 -231~+231 -231~+231 4 4 4 4 4 0~65535 2 1~65535 (Bit data) 1~8000 2 4 2 (Bit data) 4 Command Data Range Data Length (Byte) Logic position counter reading Real position counter reading Current driving speed reading Current Acc/Dec value reading Synchronous buffer register reading -231~+231 4 A.8.2 Data Reading Commands Symbol Code LP 10h EP CV CA 11h 12h 13h SB 14h ICPDAS 226 31 31 -2 ~+2 1 ~ 8,000 1 ~ 8,000 4 2 2 -231~+231 4 I-8094 Software User Manual A.8.3 Driving Commands Code 20h 21h 22h 23h 24h 25h 26h 27h Command + direction fixed pulse driving - direction fixed pulse driving + direction continuous driving - direction continuous driving Drive start holding Drive start holding release / stop status clear Decelerating stop Sudden stop A.8.4 Interpolation Commands Code 30h 31h 32h 33h 34h 35h 36h 37h 38h 39h 3Ah 3Bh 3Ch 3Dh Command 2-axis linear interpolation 3-axis linear interpolation CW circular interpolation CCW circular interpolation 2-axis bit pattern interpolation 3-axis bit pattern interpolation BP register writing enable BP register writing disable BP data stack BP data clear 1-step interpolation Deceleration valid Deceleraiton invalid Interpolation interrupt clear A.8.5 Other commands Code Command 62h Automatic home search execution 65h Synchronous action activation 0Fh NOP (for axis switching) ICPDAS 227 I-8094 Software User Manual Appendix B: MCX314As Registers This part gives the users some refereces about how to access the registers in the MCX314As chip. For more details, users still have to refer to this chip’s manual provided by NOVA electronics Inc.. B.1 Command Register: WR0 Command register is used for the axis assignment and command registration for each axis in MCX314As. The register consists of the bits for axis assignment, bits for setting command code, and bits for command resetting. After the axis assignment and command code have been written to the register, this command will be executed immediately. The data such as drive speed setting and data writing command must be written to registers WR6 and WR7 first. Otherwise, when the reading command is engaged, the data will be written and set, through IC internal circuit, to registers RR6 and RR7. WR0 Register D15 RESET D14 0 D13 0 D12 0 D11 U D10 Z D9 Y D8 X D7 0 D6 D5 D4 D3 D2 D1 D0 D6 ~ 0 Command code setting Please refer to Appendix A for further description of command codes. D11 ~ 8 Axis assignment When the bits of the axis are set to 1, the axis is assigned. The signment is not limited only for one axis, but for multi-axes simultaneously. It is possible to write the same parameters also. However, the data reading is only for one assigned axis. Whenever the Interpolation is commanded, the bits of the assigned axis (axes) should be set 0. D15 RESET IC command resetting When this bit is set to 1, but others are 0, the IC will be reset after command writing. RESET bit should be set to 0 when the other commands are written. ICPDAS 228 I-8094 Software User Manual B.2 Mode Register1: WR1 Each axis is with mode register WR1. The axis specified by NOP command or the condition before decides which axis’s register will be written. The register consists of the bits for setting enable / disable and enable logical levels of input signal IN3~IN0 (decelerating stop / sudden stop during the driving) and bits for occurring the interrupt enable / disable. Once IN3~IN1 are active, when the fixed pulse / continuous pulse driving starts, and also when IN signal becomes the setting logical level, the decelerating stop will be performed during the acceleration /deceleration driving and the sudden stop will be performed during the constant speed driving. WR1 Register Interrupt Enable/Disable D15 D14 D13 D-END C-STA C-END D12 D11 D10 D9 D8 P>=C+ P<C+ P<C- P>=C- PULSE Driving Stop Input Signal Enable/Disable D7 D6 D5 D4 D3 D2 D1 D0 IN3-E IN3-L IN2-E IN2-L IN1-E IN1-L IN0-E IN0-L D7,5,3,1 INm-E The bits for setting enable / disable of driving stop input signal INm 0:disable, 1:enable D6,4,2,0 INm-L The bits for setting enable logical levels for input signal INm 0: stop on the Low level, 1:stop on the Hi level For the following bits, the interrupt is set: 1: enable, 0: disable D8 PULSE Interrupt occurs when the pulse is up (drive pulse is set on the positive logical level) D9 P≥C- Interrupt occurs when the value of logical / real position counter is larger than or equal to that of COMP- register. D10 P<C- Interrupt occurs when the value of logical / real position counter is smaller than that of COMP- register. D11 P<C+ Interrupt occurs when the value of logical / real position counter is smaller than that of COMP+ register. D12 P≥C+ Interrupt occurs when the value of logical / real position counter is larger than or equal to that of COMP+ register. D13 C-END D14 C-STA Interrupt occurs at the start of the constant speed drive during an acceleration / deceleration driving. Interrupt occurs at the end of the constant speed drive during an acceleration / deceleration driving. D15 D-END ICPDAS Interrupt occurs when the driving is finished D15~D0 will be set to 0 while resetting. 229 I-8094 Software User Manual B.3 Mode Register2: WR2 WR2 can be used for setting: (1) external limit inputs, (2) driving pulse types, (3) encoder signal types, and (4) the feedback signals from servo drivers. WR2 Register D15 D14 INP-E INP-L D13 D12 D11 D10 D9 D8 ALM-E ALM-L PIND1 PIND0 PINMD DIR-L D7 D6 D5 D4 D3 D2 D1 D0 PLSMD CMPSL HLMT+ HLMT- LMTMD LMTMD SLMT- SLMT+ D0 SLMT+ Enable / disable setting for COMP+ register which is used as the + direction software limit. 1: enable, 0: disable Once it is enabled during the + direction driving, if the value of logical / real position counter is larger than that of COMP+, the decelerating stop will be performed. The D0 (SLMT+) bit of register RR2 will become 1. Under this situation, further written + direction driving commends will not be executed. D1 SLMT- Enable / disable setting for COMP- register which is used as the - direction software limit 1: enable, 0: disable Once it is enabled during the - direction driving, if the value of logical / real position counter is smaller than that of COMP+, the decelerating stop will be performed. The D1 (SLMT-) bit of register RR2 will become 1. Under this situation, further written - direction driving commends will not be executed. D2 LMTMD The bit for controlling stop type when the hardware limits (nLMTP and nLMTM input signals) are active. 0: sudden stop, 1: decelerating stop D3 HLMT+ Setting the logical level of + direction limit input signal (nLMTM) 0: active on the Low level, 1: active on the Hi level D4 HLMT- Setting the logical level of - direction limit input signal (nLMTM) 0:active on the Low level, 1: active on the Hi level D5 COMPSL Setting if real position counter or logical position counter is going to be compared with COMP +/- register 0: logical position counter, 1 : real position counter D6 PLSMD Setting output pulse type. 0: independent 2-pulse type, 1: 1-pulse 1-direction type When independent 2-pulse type is engaged, + direction pulses are output through the output signal nPP/PLS, and - direction pulses through nPM/DIR. When 1-pulse 1-direction type is engaged, + and - directions pulses are output through the output signal nPP/PLS, and nPM/DIR is for direction signals. D7 Setting logical level of driving pulses 0: positive logical level, 1: negative logical level. PLS-L ICPDAS 230 I-8094 Software User Manual D8 DIR-L Setting logical level of the direction (nPM/DIR) output signal for 1-pulse mode. DIR-L 0 1 D9 + Direction Hi Low - Direction Hi Low PINMD Setting the type of encoder input signals (nECA/PPIN and nECB/PMIN) 0: quadrature pulse input type 1: Up / Down pulse input type Real position counter will count up or down when encoder input signal is triggered. When quadrature pulse input type is engaged, the “ count up” will happen if the positive logical level pulses are input to phase A; the “count down” will happen if the positive logical level pulses are input to phase B. So, it will count up and down when these 2 signals go up and down. When Up / Down pulse input type is engaged, nECA/PPIN is for “ count up” input, and nECB/PMIN is for “count down” input. So, it will count up when the positive pulses go up. D11,10 PIND1,0 The division setting for quadrature encoder input. D11 D10 Division 0 0 1/1 0 1 1/2 1 0 1/4 1 0 Invalid [Note] Up / down pulse input is not available. D12 ALM-L Setting active level of input signal nALARM 0: active on the Low level, 1: active on the Hi level. D13 ALM-E Setting enable / disable of servo alarm input signal nALARM 0: disable, 1: enable When it is enabled, MCX314 will check the input signal. If it is active, D14 (ALARM) bit of RR2 register will become 1. The driving stops. D14 INP-L Setting logical level of nINPOS input signal 0: active on the Low level, 1:active on the Hi level D15 INP-E Setting enable/disable of in-position input signal nINPOS from servo driver 0: disable, 1: enable When it is enabled, bit n-DRV of RR0 (main status) register does not return to 0 until nINPOS signal is active after the driving is finished. D15~D0 will be set to 0 while resetting. ICPDAS 231 I-8094 Software User Manual B.4 Mode Register3: WR3 Each axis is with mode register WR3. The axis specified by NOP command or the condition before decides which axis’ s register will be written. WR3 can be used for manual deceleration, individual deceleration, S-curve acceleration /deceleration, the setting of external operation mode, and the setting of general purpose output OUT7~4. WR3 Register D15 D14 D13 D12 D11 D10 D9 D8 0 0 0 0 OUT7 OUT6 OUT5 OUT4 D7 D6 D5 D4 D3 D2 D1 D0 OUTSL 0 0 EXOP1 EXOP0 SACC DSNDE MANLD D0 MANLD Setting manual / automatic deceleration for the fixed pulse acceleration / deceleration driving. 0: automatic deceleration, 1: manual deceleration The decelerating point should be set if the manual deceleration mode is engaged. D1 DSNDE Setting decelerating rate which is in accordance with the rate of the acceleration or an individual decelerating rate 0: in accordance with the rate of the acceleration (Symmetric Acc/Dec) 1: individual decelerating rate setting (Asymmetric Acc/Dec) When 0 is set, the deceleration will follow the acceleration setting. Therefore, 0 must be set for automatic deceleration. When 1 is set, the rates of acceleration and deceleration should be different. Therefore, 1 must be set for manual deceleration. D2 SACC Setting trapezoidal driving / S-curve acceleration / deceleration driving 0: trapezoidal driving, 1: S-curve acceleration / deceleration driving Before S-curve acceleration / deceleration driving is engaged, jerk (K) should be set. D4,3 EXOP1,0 Setting the external input signals (nEXPP, nEXPM) for driving D4 0 0 1 1 D3 0 1 0 1 external signals disabled continuous driving mode fixed pulse driving mode external signals disabled When the continuous driving mode is engaged, the + direction drive pulses will be output continuously once the nEXPP signal is on the Low level; the - direction pulses will be output continuously once the nEXPM signal is on the Low level. When the fixed pulse driving mode is engaged, the + direction fixed pulse driving starts once the nEXPP signal is falling to the Low level from the Hi level; the - direction fixed pulse driving starts once the nEXPM signal is ICPDAS 232 I-8094 Software User Manual falling to the Low level from the Hi level. D7 OUTSL Driving status outputting or used as general purpose output signals (nOUT7~4) 0: nOUT7~4: general purpose output The levles of D11~8 will be output through nOUT7~4. 1: nOUT4~7: driving status output (see the table below) Signal Name Output Description Hi: if logical / real position counter≧COMP+ register OUT4/CMPP Low : if logical / real position counter<COMP+ register Hi: if logical / real position counter<COMP- register OUT5/CMPM Low: if logical / real position counter≧COMP- register When the driving command is engaged, the level becomes Hi once the driving OUT6/ASND status is in acceleration When the driving command is engaged, the level becomes Hi once the driving OUIT7/DSND status is in deceleration. [Note] Not every output signal is used in the motion control module. Some are cancelled because of the shortage of connector pins. D11~8 OUTm Level setting for output signals OUT7~4 as general purpose output signals. 0: Low level output, 1: Hi level output D15~D0 will be set to 0 while resetting. D15~12, D5 and D6 should be always set 0. ICPDAS 233 I-8094 Software User Manual B.5 Output Register: WR4 This register is used for setting the general purpose output signals nOUT3~0. This 16-bit register locates 4 output signals of each axis. It can be also used as a 16-bit general purpose output. It is Low level output when the bit is set 0, and Hi level output when the bit is set 1. WR4 Register D15 D14 D13 D12 D11 D10 D9 D8 UOUT3 UOUT2 UOUT1 UOUT0 ZOUT3 ZOUT2 ZOUT1 ZOUT0 D7 D6 D5 D4 D3 D2 D1 D0 YOUT3 YOUT2 YOUT1 YOUT0 XOUT3 XOUT2 XOUT1 XOUT0 [Note] Not every output signal is used in the motion control module. Some are cancelled because of the shortage of connector pins. D15~D0 will be set to 0 while resetting, and nOUT3~0 signals become Low level. B.6 Interpolation Mode Register: WR5 This register is used for setting axis assignment, constant vector speed mode, 1-step interpolation mode and interrupt during the interpolation. WR5 Register D15 D14 D13 D12 D11 D10 D9 D8 0 CMPLS EXPLS 0 SPD1 SPD0 BPINT CINT D7 D6 D5 D4 D3 D2 D1 D0 0 0 AX31 AX30 AX21 AX20 AX11 AX10 MCX314As can do 3-axis linear interpolation. To define 3 axes from 4 different axes, 2-bit code is necessary. Therefore, AX11 and AX10 define the first axis; AX21 and AX20 define the second axis; and AX31 and AX30 define the third axis. D1, 0 AX11, 10 ax1 (master axis) assignment for interpolation Axis codes are shown as follows. Axis Code (Binary) X 0 0 Y 0 1 Z 1 0 U 1 1 Example: If the setting we wish is as follws: 1st axis: X, 2nd axis: Y, 3rd axis: Z Then we should set the values as follows D5 D4 D3 D2 D1 D0 1 0 0 1 0 0 ICPDAS 234 I-8094 Software User Manual For ax1 (master axis) will have the basic pulses of starting interpolation calculation, the speed parameter which is for constant / acceleration / deceleration driving should be set before the driving. D3, 2 AX21, 20 ax2 assignment according to the codes shown in the table above D5,4 AX31, 30 ax3 assignment for 3-axis interpolation, according to the codes shown in the table above. Setting any value if it is only 2-axis interpolation. D9,8 LSPD1,0 Constant vector speed mode setting of interpolation driving D9 D8 Code (Binary) 0 0 constant vector speed invalid 0 1 2-axis constant vector speed 1 0 (setting not available) 1 1 3-axis constant vector speed When 2-axis constant vector speed mode is engaged, the user should set the range (R) of ax2 to be 1.414 times of the range (R) of master axis (ax1). When 3-axis constant vector speed mode is engaged, the user should set the range (R) of ax2 to be 1.414 times and the range (R) of ax3 to be 1.732 times of the range (R) of master axis (ax1). D11 EXPLS When it is 1, the external (EXPLSN) controlled single step interpolation mode is engaged. D12 CMPLS When it is 1, the command controlled single step interpolation mode Is engaged. D14 CIINT Interrupt enable / disable setting during interpolation 0: Disable, 1: Enable. D15 BPINT interrupt enable / disable setting during bit-pattern interpolation 0: Disable, 1: Enable D15~D0 ICPDAS will be set to 0 while resetting. 235 I-8094 Software User Manual B.7 WR6/WR7 Register Use an extension mode setting command (60h) to set an automatic search mode. Set each bit of the WR7 register as shown below. To generate an interrupt at termination of automatic home search, set D5 (HMINT) of the WR6 register to 1. Since bit data of the WR6 and WR7 of an extension mode setting command (60h) is written to the internal registers simultaneously, the appropriate values must be set for other bits of the WR6 register. WR6 Register D15 D14 D13 D12 D11 D10 D9 D8 FL0 FE4 FE3 FE2 FE1 FE0 FL2 FL1 D7 D6 D5 D4 D3 D2 D1 D0 SMODE 0 HMINT VRING AVTRI POINV EPINV EPCLR WR7 Register D15 D14 DCCW2 DCCW1 D13 D12 D11 D10 D9 D8 DCCW0 DCC-L DCC-E LIMIT SAND PCLR D7 D6 D5 D4 D3 ST4-D ST4-E ST3-D ST3-E ST2-D D2 D1 D0 The user can write command data with a designated data length into the write register. It does not matter to write WR6 or WR7 first. The written data is binary formatted; 2’ complement is for negatives. For command data, the user should use designated data length. The contents of WR6 and WR7 are unknown while resetting. B.8 Main Status Register: RR0 This register is used for displaying the driving and error status of each axis. It also displays interpolation driving, ready signal for continuous interpolation, quadrant of circular interpolation and stack counter of bit pattern interpolation. RR0 Register D15 D14 BPSC1 D13 D12 D11 D10 D9 D8 BPSC0 ZONE2 ZONE1 ZONE0 CNEXT I-DRV D7 D6 D5 D4 D3 D2 D1 D0 U-ERR Z-ERR Y-ERR X-ERR U-DRV Z-DRV Y-DRV X-DRV D3~0 n-DRV Displaying driving status of each axis When the bit is 1, the axis is outputting drive pules; when the bit is 0, the driving of the axis is finished. Once the in-position input signal nINPOS for servo motor is active, nINPOS will return to 0 after the drive pulse output is finished. D7~4 n-ERR Displaying error status of each axis If any of the error bits (D5~D0) of each axis’ s RR2 register and any of the ICPDAS 236 I-8094 Software User Manual error-finish bits (D15~D12) of each axis’ s RR1 register becomes 1, this bit will become 1. D8 I-DRV D9 CNEXT Displaying the possibility of continuous interpolation data writing When the bit is 1, it is ready for inputting parameters for next node and also ready for writing interpolation command data. D12~10 ZONE0 ZONE1 ZONE2 D14, 13 Displaying interpolation driving status While the interpolation drive pulses are outputting, the bit is 1. Displaying the quadrant of the current position in circular interpolation D12 D11 0 0 0 0 1 1 1 1 0 0 1 1 0 0 1 1 BPSC1, 0 D10 Quadrant 0 1 0 1 0 1 0 1 0 1 2 3 4 5 6 7 In bit pattern interpolation driving, it displays the value of the stack counter (SC). D14 D13 Stack Counter (SC) Value 0 0 0 0 1 1 1 0 2 1 1 3 In bit pattern interpolation driving, when SC = 3, it shows the stack is full. When SC = 2, there is one word (16-bit) space for each axis. When SC = 1, there is a 2-word (16-bit × 2) for each axis. When SC=0, it shows all the stacks are empty, and the bit-pattern interpolation is finished. ICPDAS 237 I-8094 Software User Manual B.9 Status Register 1: RR1 Each axis is with status register 1. The axis specified by NOP command or the condition before decide which axis’ s register will be read. The register can display the comparison result between logical / real position counter and COMP + / - , the acceleration status of acceleration / deceleration driving, jerk of S-curve acceleration / deceleration and the status of driving finishing. RR1 Register D15 D14 EMG ALARM D13 D12 D11 D10 D9 D8 LMT- LMT+ IN3 IN2 IN1 IN0 D7 D6 D5 D4 D3 D2 D1 D0 ADSND ACNST AASND DSND CNST ASND CMP- CMP+ D0 CMP+ Displaying the comparison result between logical / real position counter and COMP+ register 1: logical / real position counter ≥ COMP+ register 0: logical / real position counter<COMP+ register D1 CMP- Displaying the comparison result between logical / real position counter and COMP- register 1: logical / real position counter ≤ COMP- register 0: logical / real position counter>COMP- register D2 ASND It becomes 1 when in acceleration. D3 CNST It becomes 1 when in constant speed driving. D4 DSND It becomes 1 when in deceleration. D5 AASND In S-curve, it becomes 1 when acceleration / deceleration increases. D6 ACNST In S-curve, it becomes 1 when acceleration / deceleration keeps constant. D7 ADSND In S-curve, it becomes 1 when acceleration / deceleration decreases. D11~8 IN3~0 If the driving is stopped by one of external decelerating stop signals (nIN3 ~ 0), it will become 1. D12 LMT+ If the driving is stopped by + direction limit signal (nLMTP), it will become 1. D13 LMT- If the driving is stopped by - direction limit signal (nLMTP), it will become 1. D14 ALARM If the driving is stopped by nALARM from servo drivers, it will become 1. D15 EMG If the driving is stopped by external emergency signal (EMGN), it will become 1. ICPDAS 238 I-8094 Software User Manual The Status Bits of Driving Finishing These bits are keeping the factor information of driving finishing. The factors for driving finishing in fixed pulse driving and continuous driving are shown as follows: 1. when all the drive pulses are output in fixed-pulse driving, 2. when deceleration stop or sudden stop command is written, 3. when software limit is enabled, and is active, 4. when external deceleration signal is enabled, and active, 5. when external limit switch signals (nLMTP, nLMTM) become active, 6. when nALARM signal is enabled, and active, and 7. when EMGN signal is on the Low level. ICPDAS 239 I-8094 Software User Manual B.10 Status Register 2: RR2 Each axis is with status register 2. The axis specified by NOP command or the condition before decides which axis’ s register will be read. This register is for reflecting the error information. Once the bit becomes 1, it reflects an error occurs. When one or more of D5~D0 bits of RR2 register are 1, n-ERR bits of main status register RR0 become 1. RR2 Register D15 D14 - - D13 D12 D11 D10 D9 D8 - HMST2 HMST3 HMST2 HMST1 HMSTO D7 D6 D5 D4 D3 D2 D1 D0 HOME - EMG ALARM HLMT- HLMT+ SLMT- SLMT+ D0 SLMT+ During the + direction driving, when logical / real position counter ≥ COMP+ (COMP+ enabled, and used as software limit) D1 SLMT- During the - direction driving, when logical / real position counter ≤ COMP- (COMP- enabled, and used as software limit) D2 HLMT+ When external + direction limit signal (nLMTP) is on its active level D3 HLMT- When external - direction limit signal (nLMTM) is on its active level D4 ALARM When the alarm signal (nALARM) for servo motor is on its active level D5 EMG When emergency stop signal (EMGN) becomes Low level. D7 HOME Error occurred at execution of automatic home search. When the encoder Z-phase signal (nIN2) is already active at the start of Step 3, this bit is set to 1. D8~12 HMST0~4 The home search execution state indicating stop or sudden stop will executed. In driving, when hardware / software limit is active, the decelerating stop or sudden stop will be executed. Bit SLMT+/- will not become 1 during the reverse direction driving. ICPDAS 240 I-8094 Software User Manual B.11 Status Register 3: RR3 Each axis is with status register 3. The axis specified by NOP command or the condition before decides which axis’ s register will be read. This register is for reflecting the interrupt factor. When interrupt happens, the bit which is with the interrupt factor becomes 1. The user should set the interrupt factor through register WR1 to perform the interrupt. RR3 Register D15 D14 - - D7 D-END D6 C-STA D13 D12 D11 D10 D9 D8 - - - - SYNC HMEND D5 C-END D4 P ≥ C+ D3 P<C+ D2 P<C- D1 P ≥ C- D0 PULSE D0 PULSE When the drive pulse is up (drive pulse is set on the positive logical level) D1 P ≥ C- Once the value of logical / real position counter is larger than that of COMP- register. D2 P<C- Once the value of logical / real position counter is smaller than that of COMP- register D3 P<C+ Once the value of logical / real position counter is smaller than that of COMP+ register D4 P ≥ C+ Once the value of logical / real position counter is larger than that of COMP+ register D5 C-END When the pulse output is finished in the constant speed drive during an acceleration / deceleration driving. D6 C-STA When the pulse output is started in the constant speed drive during an acceleration / deceleration driving D7 D-END When the driving is finished D8 HMEND Automatic home search terminated. D9 SYNC Synchronous action was activated. When one of the interrupt factors occurs an interrupt, the bit of the register becomes 1, and the interrupt output signal (INTN) will become the Low level. The host CPU will read register RR3 of the interrupted axis, the bit of RR3 will be cleared to 0, and the interrupt signal will return to the non-active level. When 8-bit data bus is used, the reading data of RR3L register is cleared. ICPDAS 241 I-8094 Software User Manual B.12 Input Register: RR4 / RR5 RR4 and RR5 are used for displaying the input signal status. The bit is 0 if the input is on the Low level; the bit is 1 if the input is on the Hi level. RR4 Register D15 D14 D13 D12 D11 D10 D9 D8 Y-ALM Y-INP Y-EX- Y-EX+ Y-IN3 Y-IN2 Y-IN1 Y-IN0 D7 D6 D5 D4 D3 D2 D1 D0 X-ALM X-INP X-EX- X-EX+ X-IN3 X-IN2 X-IN1 X-IN0 RR5 Register D15 D14 D13 D12 D11 D10 D9 D8 U-ALM U-INP U-EX- U-EX+ U-IN3 U-IN2 U-IN1 U-IN0 D7 D6 D5 D4 D3 D2 D1 D0 Z-ALM Z-INP Z-EX- Z-EX+ Z-IN3 Z-IN2 Z-IN1 Z-IN0 B.13 Data-Read Register: RR6 / RR7 According to the data-read command, the data of internal registers will be set into registers RR6 and RR7. The low word 16 bits (D15 ~ D0) is set in RR6 register, and the high word 16 bits (D31 ~ D16) is set in RR7 register for data reading. The data is binary formatted; 2’ s complement is for negatives. RR6 Register D15 D14 D13 D12 D11 D10 D9 D8 D7 D6 D5 D4 D3 D2 D1 D0 RD15 RD14 RD13 RD12 RD11 RD10 RD9 RD8 RD7 RD6 RD5 RD4 RD3 RD2 RD1 RD0 RR7 Register D15 D14 D13 D12 D11 D10 D9 D8 D7 D6 D5 D4 D3 D2 D1 D0 RD31 RD30 RD29 RD28 RD27 RD26 RD25 RD24 RD23 RD22 RD21 RD20 RD19 RD18 RD17 RD16 ICPDAS 242 I-8094 Software User Manual ">
Advertisement