PCI-8136M 6-Axis Motion Controller Card User’s Guide
©Copyright 2000 ADLink Technology Inc. All Rights Reserved. Manual Rev. 1.00: Oct 20, 2000 The information in this document is subject to change without prior notice in order to improve reliability, design and function and does not represent a commitment on the part of the manufacturer.
Getting service from ADLINK Customer Satisfaction is always the most important thing for ADLink Tech Inc. If you need any help or service, please contact us and get it. ADLINK Technology Inc. Web Site Sales & Service Technical Support TEL Address http://www.adlink.com.tw service@adlink.com.tw NuDAQ nudaq@adlink.com.tw NuDAM nudam@adlink.com.tw NuIPC nuipc@adlink.com.tw NuPRO nupro@adlink.com.tw Software sw@adlink.com.tw +886-2-82265877 FAX +886-2-82265717 9F, No.
Table of Contents Chapter 1 Introduction.........................................................1 1.1 1.2 1.3 Functionality of PCI-8136M .................................................3 Features ............................................................................4 Specifications .....................................................................5 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.4 Applicable Motors: ........................................................................5 Motion .............
Chapter 4 Operation Theorem .........................................33 4.1 AD Conversion and Preloaded Trigger ............................... 35 4.1.1 4.1.2 ADC.............................................................................................. 35 Voltage Compare ....................................................................... 35 4.2 DA Conversion ................................................................. 36 4.3 Local DIO ......................................................
5.10 5.11 5.12 5.13 5.14 5.15 5.16 5.17 5.18 Close Loop Initialization .................................................... 84 Motion Parameters ........................................................... 85 Motion Status ................................................................... 88 PTP Movement ................................................................. 90 2D Interpolation ................................................................ 92 3D Interpolation ..................................
How to Use This Guide This manual is designed to help you use the PCI-8136M. The manual describes how to modify various settings on the PCI-8136M card to meet your requirements. It is divided into five chapters: • Chapter 1, "Introduction", gives an overview of the product features, applications, and specifications. • Chapter 2, "Installation", describes how to install the PCI-8136M.
1 Introduction The PCI-8136M is a 6 axes motion control card with PCI interface. It supports two kinds of motor driver, Pulse type and voltage type. It can generate pulse trains or voltage commands for servo motors or stepping motors. The PCI-8136M is composed of 6 sets of motion control module. Each control set has its own pulse generator, encoder counter, analog output, dedicated I/O and analog input.
Servo,Stepping Motors & Drivers Sensor System Bus PCI-8136M 1 2 3 4 ADC x 6 Pulse Command B U S DDA x 6 I F Encoder Counter x 6 LR Local Digital I/O 26 IF PLC x 6 LD V Command DAC x 6 Remote IO Master #1 64In/64Out T M Remote IO Master #2 64In/64Out Pulse Signals Serial IO Slave #1 64In/64Out DR Serial IO DR Slave #2 64In/64Out Figure 1.
1.1 Functionality of PCI-8136M The PCI-8136M is composed of 6 sets of motion control module. Each control set has its own pulse generator, encoder counter, analog output, dedicated I/O and analog input. When one axis is not for motion control, all of the components in the motion set can be used individually. The following table regards the number of motion axes and remaining available functions. No.
1.
1.3 Specifications 1.3.1 Applicable Motors: • Stepping motors • AC or DC servomotors with pulse train input servo drivers • AC or DC servomotors with velocity command (analog) input servo drivers 1.3.2 Motion • Number of controllable axes: selectable 1~6 Axes • Motion command output type: selectable Voltage or Pulse command • Max NO. of cards in one system: 4 • Pulse command output up to 1024KHz • Control loop cycle time up to 1.
1.3.4 ♦ General I/Os Analog Input • 6 differential input channels • Input range: Voltage: ±10V Current: ±20 mA (manually soldering 124ohms resistor) • 12-bit ADC with 1-bit non-linearity • Input impedance : 10 Ohms || 100pF (voltage mode) 12 124Ohms (current mode) • ♦ Sampling rate: 133 KHz multiplexing Analog Output • 6 output channels • Output range: bipolar, ±10V • 16-bit DAC resolution, 14-bit accuracy guaranteed • Settling time: 2 µ second • Voltage output drive: 5mA max.
0mA/Ch (max.) 500mA/total • Isolated voltage 2500V RMS • Throughput 10KHz(0.
♦ Power Consumption: • Slot power supply(input): +5V DC ±5%, 900mA max • External power supply(input): +24V DC ±5%, 500mA max • External power supply(output): +5V DC ±5%, 500mA, max ♦ 1.4 Dimension: 164mm(L) X 98.4mm(H) Software Supporting 1.4.1 Programming Library The Programming Library enables motion control functionality of PCI-8136M. It provides versatile function calls for customers who are writing their own motion control programs.
2 Installation This chapter describes how to install the PCI-8136M hardware and software correctly. Please follow the follow steps. Section 2.1 Check what you have Section 2.2 PCB Outline Drawing Section 2.3 Install the hardware Section 2.4 Install the software driver Section 2.5 CN1 Pin Assignments Section 2.6 CN2 Pin Assignments Section 2.7 DB25 Connector Section 2.
2.1 What You Have In addition to this User's Guide, the package includes the following items: • PCI-8136M 6-axis Motion Controller Card • DB9 and DB25 Bracket • External Power cable for CN2 • 124O, DIP type resistance * 6 • ADLINK All-in-one Compact Disc • PCI-8136M User’s Manual If any of these items are missing or damaged, contact the dealer from whom you purchased the product. Save the shipping materials and carton in case you want to ship or store the product in the future.
2.2 Outline Drawing 1 CN2 CN3 6 DAC Offset VR CN4 ADC Offset VR CN1 Figure 2.2.
2.3 Hardware Installation 2.3.1 Hardware configuration PCI-8136M has plug and play PCI controller on board. The memory usage (I/O port locations) of the PCI card is assigned by system BIOS. The address assignment is done on a board-by-board basis for all PCI cards in the system. 2.3.2 PCI slot selection Your computer will probably have both PCI and ISA slots. Do not force the PCI card into a PC/AT slot. The PCI-8136M can be used in any PCI slot. 2.3.3 Installation Procedures 1.
2.4 Software Installation Please refer to the ADLINK All-in-one Compact Disc Manual to install it.
2.5 CN1 PIN ASSIGNMENTS: MAIN CONNECTOR The CN1 is the major connector for the Motion related I/O, including pulse output, encoder feedback input, Analog output and interface IO signals. No.
2.6 CN2 PIN ASSIGNMENTS: EXTERNAL POWER INPUT CN2 Pin No 1 2 Name EXGND EX+24V Description Grounds of the external power. External power supply of +24V DC ± 5% Cable Color Black Red Notes: 1. CN2 is a plug-in terminal connector with no screw. 2. Be sure to use the external power supply. The +24V DC is used by external input/output signal circuit. 3. Wires for connection to CN2. Solid wire: ϕ 0.32mm to ϕ 0.65mm (AWG28 to AWG22) Twisted wire:0.08mm2 to 0.
2.7 CN3 PIN ASSIGNMENTS: DB25 CONNECTOR The signals on CN3 are for Analog input and remote serial IO. Remote serial IO #2 G2SIOCLK/ (1) G2SCS0/ (2) G2S2MD/ (3) G2M2SD/ (4) AGND (5) DAC3 (6) Analog output ADC1- (7) ADC2- (8) Analog input ADC3- (9) ADC4- (10) ADC5- (11) ADC6- (12) AGND (13) (14) G2SIOCLK (15) S2SCS0 (16) G2S2MD (17) G2M2SD (18) DAC1 (19) DAC2 (20) ADC1+ (21) ADC2+ (22) ADC3+ (23) ADC4+ (24) ADC5+ (25) ADC6+ NC Note: 1. The DAC1~3 pins are the same with those on CN1 2.
3 Signal Connection The signal connections of all the I/O signals are described in this chapter. Please refer the contents of this chapter before wiring the cable between the PCI-8136M and the motor drivers. This chapter contains the following sections: Section 3.1 Pulse output signals OUT and DIR Section 3.2 Voltage output signals DAC Section 3.3 Encoder feedback signals EA, EB and EZ Section 3.4 Voltage input signals ADC Section 3.5 Origin signal ORG Section 3.
3.1 Pulse output signals OUT and DIR There are 6-axis pulse output signals on PCI-8136M. For every axis, two pairs of OUT and DIR signals are used to send the pulse train and to indicate the direction. The OUT and DIR signals can also be programmed as CW/CCW or AB phase signals pair. In this section, the electronic characteristics of the OUT and DIR signals are shown. Each signal consists of a pair of differential signals. For example, the OUT2 is consisted of OUT2+ and OUT2- signals.
Figure 3.1.1 Pulse output (pulse generator) circuit If the driver side is open collector mode, please use any one of positive and negative pins to be a control signal and EXGND as its output ground. Please take care that the current sink to these pins must not exceed 20mA.
3.2 Voltage output signals DAC There are 6 DAC output channels on PCI-8136M. If the closed loop control mode is set for any one of the 6 axes, its corresponding DAC channel will be treated as voltage command output. If not, the DAC channel will be treated as a general purposed analog output channel. The resolution of DAC is 16-bit, and the output voltage ranged from -10 V to +10V. To make correct connection, please refer to following figure: Figure 3.2.
Notice that the DAC Channel 1~ 3 in CN1 and CN3 are connected inside the PCI-8136M.
3.3 Encoder feedback signals EA, EB and EZ The PCI-8136M provides 6 differential pulse inputs with 2500V rms isolation, and each pair of EA, EB, and EZ is related to one motion axis. The pulse mode is software programmable to be AB-phase, CW/CCW, or Pulse/Direction, and the counter speed goes up to 2 MHz. The following table is the pin assignments for encoder counters. CN1 Pin No.
The input circuits of the EA, EB, EZ signals are shown as follows. Figure 3.3.1 Pulse input (encoder counter) circuit Note: The voltage across every differential pair of encoder input signals (EA+, EA-), (EB+, EB-) and (EZ+, EZ-) should be at least 3.5V or higher. Therefore, you have to take care of the driving capability when connecting with the encoder feedback or motor driver feedback. Here are two examples of connecting the input signals with the external circuits.
Connection to Open Collector Output To connect with open collector output, an external power supply is necessary. Some motor drivers also provide the power source. The connection between PCI-8136M, encoder, and the power supply is shown in the following diagram. Please note that the external current limit resistor R is necessary to protect the PCI-8136M input circuit. The following table lists the suggested resistor value according to the encoder power supply.
3.4 Analog Input The PCI-8136M provides 6 12-bit A/D channels. The analog source is selectable for each channel to be ±10V DC (Default) or 0~20 mA by soldering a 124O DIP resistance which is shipped with PCI-8136M. Figure 3.4.1: Current input mode – location of 124O DIP resistance To avoid ground loops and get more accuracy measurement of A/D conversion, it is quite important to understand the signal source type. The PCI-8136M provides differential input mode that consists of two inputs each channel.
CN3 Pin No. 20 7 21 8 22 9 23 10 24 11 25 12 Signal Name ADC1+ ADC1ADC2+ ADC2ADC3+ ADC3ADC4+ ADC4ADC5+ ADC5ADC6+ ADC6- Description ADC channel 1 (+) ADC channel 1 (-) ADC channel 2 (+) ADC channel 2 (-) ADC channel 3 (+) ADC channel 3 (-) ADC channel 4 (+) ADC channel 4 (-) ADC channel 5 (+) ADC channel 5 (-) ADC channel 6 (+) ADC channel 6 (-) A differential source means the ends of the signal are not grounded.
3.5 Origin signal ORG The origin signals (ORG1~ORG6) are used as input signals for origin of the mechanism. The following table is the pin assignment for ORG. CN1 Pin No.
3.6 End-Limit signals PEL and MEL There are two end-limit signals PEL and MEL for each axis. PEL indicates end limit signal in plus direction and MEL indicates end limit signal in minus direction. The following table is the pin assignment for EL signal. CN1 Pin No.
3.7 Emergency stop signal ESTOP The emergency stop signal ESTOP is used to stop pulse output from all OUT and DIR channels. The following is the ping assignment information for ESTOP. Signal Name CN 1 Pin No.
3.8 Servo on signal SVON The SVON signals can be used as servo-on control at servo drivers or general-purpose output signals. The following is the pin assignment information for SVON. Signal Name COM+ COM+ COM+ SVON1 SVON2 SVON3 SVON4 SVON5 SVON6 COMCOM- CN1 Pin No.
3.9 General purpose output P-RDY There is one general purpose output pin on PCI-8136M. The pin assinment is shown as following table: Signal Name COM+ COM+ COM+ PRDY COMCOM- CN1 Pin No. Description Alternative Name 6 7 8 58 55 56 Ext +24V Ext +24V Ext +24V General Purpose output Ext Common Ground Ext Common Ground COM+ COM+ COM+ DO7 COMCOM- The spec. and wiring are the same with SVON pin. Please refer to 3.8 3.10 VCC Pin There is one pin named VCC+5V on Pin5 of CN1.
3.11 Open Loop and Closed Loop Connection All axes in PCI-8136M are free to set as open loop pulse output control or closed loop voltage output control. Users must realize what is the different between these two settings. There are 6 motion control sets for every axis in PCI-8136M card. Each set has its own pulse output, encoder input, analog output, analog input and dedicated I/O channels .
4 Operation Theorem This chapter describes the detail operation theorem of the PCI-8136M card. Contents of the following sections are shown as following. Section 4.1 : AD conversion and preloaded Trigger Section 4.2 : DA Conversion Section 4.3 : Local DIO Section 4.4 : Pulse Input and position compare Section 4.5 : Pulse Output Section 4.6 : Remote serial IO Section 4.7 : Introduction to DDA Section 4.8 : Open loop and closed loop control Section 4.9 : Constant velocity motion Section 4.
Please refer to the following architecture diagram of PCI-8136M VB / VC Programming DDA Motion ASIC I/O Map Register Device Driver Windows OS PCL DAC PCI Bus Function Library ENC PCI Bus ASIC PCI9050 PCI Bus LIO ADC RIO ADC : Please refer to section 4.1: AD Conversion and Preloaded Trigger DAC : Please refer to section 4.2: DA Conversion LIO : Please refer to section 4.3: DIO ENC : Please refer to section 4.4: Pulse Input and Position Compare RIO : Please refer to section 4.
4.1 AD Conversion and Preloaded Trigger 4.1.1 ADC The PCI-8136M provides 6 Differential ADC channels. Each channel consists of two inputs. One is for (+) signal and the other is for (-) signal. The input signal may be voltage ranged from –10 ~ +10V or current ranged from –20mA ~ 20mA. The ADC resolution is 12-bit. The following figure shows the A (voltage or current) to D (value read) converting table. The zero voltage or current is at value 2000.
Relative functions: _8136_A_Set_Compare_Value(), _8136_A_Set_Compare_Volt (), _8136_S_Set_Int_Factor() : please refer to section 5,9 4.2 DA Conversion The PCI-8136M provides 6 channel 16-bit, bipolar (±10V DC) digital to analog converter. The D (value assigned) to A (voltage output) converting table is showed bellow. 4.2.1 DA Output by Trigger Source PCI-8136 allows users to set a pre-load value for each DAC channel. The value will be sent once any trigger condition for this channel is happened.
4.3 Local DIO 4.3.1 Digital Input The PCI-8136M provides 19 digital input channels with 2500rms isolation. The DI channel is logically “HIGH” when no current goes from COM+ to DIf , and, Logically “LOW” when current goes from COM+ to DIf. The max current passing trough DIf must b e less than 20mA.. Related functions: _8136_D_Input(), _8136_D_InputA() : please refer to section 5.5 4.3.2 Digital Output The PCI-8136M provides 7 open collector output channels with 2500rms isolation.
4.4 Pulse Input and Position Compare 4.4.1 Pulse Input The PCI-8136M has 6 32-bit pulse input channels for encoder counter. It can accept 3 kinds of pulse input: 1. Plus and minus pulses input (CW/CCW mode). 2. 90°phase difference signals(AB phase mode). 3. Pulse and direction input(Pulse/DIR). 90°phase difference signals may be selected to be multiplied by a factor of 1,2 or 4x AB phase mode is the most commonly used for incremental encoder input.
90° phase difference signals Input Mode(AB phase Mode) In this mode, the EA signal is 90° phase leading or lagging in comparison with EB signal. Where “lead” or “lag' of phase difference between two signals is caused by the turning direction of motors. The up/down counter counts up when the phase of EA signal leads the phase of EB signal. The following diagram shows the waveform.
4.4.3 Position Compare The PCI-8136M provides position compare function for all six pulse input channels. Once the counter value is reached the pre-set compare value, an interrupt signal will be generated immediately. This function can effectively reduce the overhead of CPU's polling for current position. Related functions: _8136_S_Set_Int_Factor() : please refer to section 5,9 _8136_P_Set_Compare_Value(): please refer to section 5.
4.5 Pulse Output The PCI-8136M provides 6 pulse output channels. They are used to send out constant-frequency pulse trains. When changing the output frequency of any channel, there is at most 265ms time delay. There are also 3 kinds of pulse output: (1). plus and minus pulses input(CW/CCW mode); (2) pulse and direction input(Pulse/DIR); (3).
OUT DIR OUT DIR Negative Direction Related functions: _8136_P_Initial() : please refer to section 5.2 _8136_P_Set_Output_Type(), _8136_P_Send(), _8136_P_Stop(), _8136_P_Change_Speed(), please refer to section 5.
4.6 Remote Serial IO The PCI-8136M support 2 set of remote serial IO, each set may consist at most 64DI and 64DO. To use remote serial IO function, a slave module is needed. Note: The remote I/O functions are reserved on current version. Related functions: _8136_R_Initial() : please refer to section 5.2 _8136_R_Status(), _8136_R_Write(), _8136_R_Read() : please refer to section 5.
4.7 Introduction to DDA This section will introduce the DDA operating theorem that creates all those various motion function. The DDA is for Digital Differential Analyze. It is a method to accomplish motion control under non-realtime OS. Software Hardware Encoder Feedback Motion Library FIFO (64) 6 5 4 3 2 1 DDA 12 3456 Refer to above figure, the software (Motion Library) solve motion command and generate a string of displacement data. Each data indicates quantity of puls e in 4ms(default).
4.8 Open-loop and close-loop control This section explains the motion control algorithms provided by PCI-8136M. There are two possible ways of control command output. One is via DAC channel à analog voltage, and the other is via OUT & DIRà Pulse command. 4.8.1 Open-loop control When the OUT & DIR channel is used as motion command output, the block diagram is as the following figure. The pulse generated by DDA engine is directed into pulse output device.
4.9 Constant Velocity Motion This mode is used to operate one axis motor at constant velocity motion. The output pulse accelerates from a starting velocity (str_vel) to the specified constant velocity (max_vel). The _8136_v_move() function is used to accelerate constantly while the _8136_sv_move() function is to accelerate according to S-curve (constant jerk). The pulse output rate will keep at maximum velocity until stop function is issued.
4.10 Trapezoidal Motion This mode is used to move one or more axes to a specified position (or distance) with a trapezoidal velocity profile. Single axis and multi-axes are controlled from point to point or follow a specific path like ARC. An absolute or relative motion can be performed. In absolute mode, the target position is assigned. In relative mode, the target displacement is assigned. In both absolute and relative mode, the acceleration and the deceleration time in seconds can be different.
max_vel Velocity (pps) str_vel Tacc Tdec Relative Functions: _8136_P_Initial() refer to section 5.2 _8136_Motion_Stop() refer to section 5.18 _8136_Motion_Status() refer to section 5.12 _8136_Start_TR_Move(),_8136_Start_TA_Move() refer to section 5.
4.11 S-Curve Profile Motion This mode is used to move one axis motor to a specified position (or distance) with a S-curve velocity profile. S-curve acceleration profiles are useful for both steppers and servo motors. The smooth transitions between the start of the acceleration ramp and the transition to the constant velocity produce less wear and tear than a trapezoidal profile motion. The smoother performance increases the life of the motors and mechanics of a system.
The S-curve profile motion functions are designed to always produce smooth motion. If the time for S-Curve acceleration parameters combined with the final position don’t allow an axis to reach the maximum velocity( i.e.: the moving distance is too small to reach maximum velocity), the maximum velocity is automatically lowered and recalculated the deceleration time. The trapezoidal motion also has these characteristics but its shape is like a triangle.
4.12 2D Interpolation “Interpolation between two axes” means the two axes start simultaneously and reach their ending points at the same time. For example, in the figure below, we want to move the axes from P0 to P1, and hope the two axes start and stop simultaneously at a period of time ?t. Then the moving speed along X-axis and Y-axis will be?X/?t., ?Y/?t, respectively. Y-Axis P1 ?Y P0 X-Axis The interpolation function of PCI-8136M has similar format.
The composite speed profile could be trapezoidal or s-curve velocity profile during one interpolation motion. The following graph is the result of trapezoidal circular interpolation. The command for this result is: int16 AxisArray[2]={2,3} Start_Arc_XY(CARD0, AxisArray, 0, -10000, 360.0, 100, 10000, 1.0, 2.0) The third and fourth parameters represent the arc center. The fifth parameter means total arc angle. 0.0 0 -400 0.0 0 -800 0.0 0 -1200 0.0 0 -1600 0.0 0 -2000 0.0 0 -1 0000 .00 -500 0.0 0 0.
Relative Functions: _8136_P_Initial() refer to section 5.2 _8136_Motion_Stop() refer to section 5.18 _8136_Motion_Status() refer to section 5.12 _8136_Start_Move_XY(),_8136_Start_S_Move_XY(), _8136_Start_Arc_XY(),_8136_Start_S_Arc_XY() : Refer to section 5.
4.13 3D Interpolation The PCI-8136M supports three axes linear interpolation. Users can choose any three axes from 6 axes to fulfill it. The composite speed calculation is the same with 2D interpolation. Also, Trapezoidal and S-curve speed profile are selectable. The following graph is the result of 3 axes linear interpolation. The command line of the result is: int16 AxisArray[3]={2,3,4} Start_Move_XYZ(CARD0,AxisArray,20000,10000,5000 0,100,30000,0.01,0.
4.14 Home Return Mode In most applications, home point is a very important reference to the coordinate of space. The PCI-8136M has a simple way to search a home point which is connected to the ORG pin of CN1. After giving a home moving command, the axis will start to move toward one direction until the ORG signal is reached. Once the ORG is triggered, the axis will stop immediately and clear the encoder counter.
4.15 Motion Parameters Setting The default setting of output pulse width for PCI-8136M is 2 micro seconds and the control loop cycle time is 4.096ms. The setting could be changed by M_Set_Sytem_Param() function according to the following table. MAX Speed Pulse Width Control Loop Cycle Time 32K 64K 128K 256K 512K 1024K 32µs 16µs 8µs 4µs 2µs 1µs 2.048ms 1.024ms 32.768ms 16.384ms 8.192ms 4.096ms 4.096ms 2.048ms (default) 4.
4.16 The Motion IO Interface There are 19 general purpose digital input and 7 digital output channels on PCI-8136M. If users use M_Set_IO_Active() to enable 19 input digital I/Os for motion purpose, the axis will stop when it reach these signals. If not, these input channels are just the general purpose input points. 4.16.1 SERVO ON Most servo drivers receive one signal for activating themselves to control motors. The SVON signal of PCI-8136M is designed for this purpose.
Relative Functions: _8136_M_Set_IO_Active(), refer to section 5.11 _8136_M_ORG_Status(), _8136_M_PEL_Status(), _8136_M_MEL_Status(), _8136_M_ALM_Status(), refer to section 5.
4.17 Interrupt Control The PCI-8136M can generate INT signal to host PC according to 8 types of interrupt factors, refer to _8136_S_Set_Int_factor() function for more details. The following table represents the interrupt setting for all factors. _8136_S_Set_Int_factor( Cardno, AxisNo, Int_Factor) AxisNo Int.
Use Thread to deal with Interrupt under Windows NT/95 In order to detect the interrupt signal from PCI-8136M under Windows NT/95, user must create a thread routine first. Then use APIs provided by PCI-8136M to get the interrupt signal. Each card has 7 events for these interrupts. Event 0 ~ 5 stands for axis 0~5 and event 6 stands for timer interrupt and alarm interrupt. The sample program is as follows: Situatuins: Assume that we have one card and want to receive Timer interrupt. Steps: 1.
4. Start the thread( Use a boolean value to control the thread’s life ) ThreadOn=TRUE; AfxBeginThread(IntThreadProc,GetSafeHwnd(),THREAD_PRIORIT Y_NORMAL); 5. Before exit the program, remember to let the thread go to end naturally. ThreadOn=FALSE; We suggest user to create a thread and use WaitForSingleObject() for each events in order to guarantee the performance.
5 Motion Library This chapter describes the supporting software for PCI-8136M cards. User can use these functions to develop application program in C or Visual Basic or C++ language. The function prototypes and some common data types are decelerated in PCI-8136M.H. These data types are used by PCI-8136M library. We suggest you to use these data types in your application programs. The following table shows the data type names and their range.
5.1 List of Functions Initialization _8136_Initial(*cardno) _8136_S_Close(cardno) _8136_A_Initial(cardno) _8136_P_Initial(cardno) Interface card initialization Interface card close Analog I/O initialization Pulse I/O initialization Section 5.
_8136_INT_Disable(cardno) _8136_S_Set_Int_Factor(cardno, ax,factor,op) _8136_S_INT_Control(cardno, ctrl) _8136_S_Get_Int_Status(cardno, ch, *status) _8136_Callback_Function(cardno, *callbkfn) Remove int. event handler Set interrupt factor Enable/disable interrupt Get Int. status Set a call back function for int.
5.2 Initialization @ Name _8136_Initial – Software Initialize for PCI-8136 _8136_S_Close – Software release for PCI-8136 _8136_A_Initial – Initialize ADC/DAC functions for PCI-8136 _8136_P_Initial – Initialize pulse output engine and encoder counter @ Description _8136_Initial: This function is used to initialize PCI-8136M card. User must use this function before any operation in the program. This function will return a number to notice user how many cards is found.
B_8136_R_Initial (ByVal CardNo As Integer, ByVal SlaveControl As Integer) As Integer @ Arguments CardNo: card number designated to set (Range 0 ~ 3) AxisNo: axis number designated to set (Range 0 ~ 5) *existCards: a return value to indicate how many cards are found SlaveNo: assign slave number (Range 0~1) SlaveControl: Enable/Disable Slave Module( 1 for enable, 0 for disable ) @ Return Code ERR_RangeError ERR_PCIBiosNotExist ERR_NoError 66 • Motion Library
5.3 System Parameters @ Name _8136_R_Set_RIO_Clk -Set Rio clock divider _8136_A_Set_DAC_Clk - Set DAC clock divider _8136_A_Set_ADC_Clk - Set ADC clock divider _8136_S_Set_Timer_Value - Set Timer click count _8136_P_Set_Enc_Filter - Set encoder filter clock @ Description _8136_R_Set_RIO_Clk : PCI-8136M can connect two remote I/O slave module. This function is for setting module's transmission clock. Assign a clock divider number to change its transmission rate. The maximum transmission clock is about 16.
@ Syntax C/C++ (DOS, Windows 95/98/NT/2000) I16 _8136_R_Set_RIO_Clk(I16 CardNo, I16 SlaveNo, I16 Clk_Divider) I16 _8136_A_Set_DAC_Clk(I16 CardNo, I16 Clk_Divider) I16 _8136_A_Set_ADC_Clk(I16 CardNo, I16 Clk_Divider) I16 _8136_S_Set_Timer_Value(I16 CardNo,U32 TimerValue) I16 _8136_P_Set_Enc_Filter(I16 CardNo,I16 Filter) Visual Basic 5.
5.4 Card Information @ Name _8136_S_Get_IRQ_Channel - Get I/O card's IRQ _8136_S_Get_Base_Addr - Get I/O card's base address @ Description _8136_S_Get_IRQ_Channel: Although PCI-8136M is a PCI interface card, user can use this function to get the IRQ channel which is assigned by PCI BIOS. This value is no meaning when operating this card.
5.5 Digital I/O @ Name _8136_D_Output - Digital output for one bit _8136_D_Input - Digital input for one bit _8136_D_OutputA - Digital Output for all bits once _8136_D_InputA - Digital Input for all bits once @ Description _8136_D_Output: There are 7 open collector output channels in PCI-8136. This function is for controlling these output bits by setting them on or off. This function can set each channel individually. Please refer to the pin assignment for bit numbers.
Visual Basic 5.
5.6 Remote I/O @ Name _8136_R_Status - Check Remote I/O Status _8136_R_Write - Write a word to remote _8136_R_Read - Read a word from remote @ Description _8136_R_Status: This function is for checking remote I/O stopped status. If the remote I/O is not running, user can use this function to check to status of remote I/O. It contains the following information: Remote I/O enable/disable, master/slave receive data status, and module fail. _8136_R_Write This function is for writing a word to one set.
SetNo: I/O range in slave module 0: bit 0~15 1: bit 16~31 2: bit 32~47 3: bit 48~63 SetValue: 16-bit value to write *SetValue: 16-bit value to read @ Return Code ERR_RangeError ERR_NoError Motion Libra • 73
5.
_8136_A_Output_Control Once user wants to stop outputting any voltage from DA channel, he can use this function to close DA channel immediately. It can be open again by this function too. _8136_A_Set_Trigger This function is for enable/disable DA channel output by trigger source. The trigger source would be ADC comparator interrupt or encoder counter comparator interrupt. _8136_A_Set_Trigger_Map This function is for assigning each channel's trigger source. The trigger source is selected by one parameter.
I16 _8136_A_Set_Trigger_Map(I16 CardNo, I16 Channel, I16 Source) I16 _8136_A_Set_Trigger(I16 CardNo, I16 Channel, I16 Control) I16 _8136_A_Set_Preload_Volt(I16 CardNo, I16 Channel, F64 Volt) Visual Basic 5.
5.
_8136_P_Clear This function is for clearing the encoder counter value to zero immediately. _8136_P_Send This function is for sending a fixed frequency pulse train of each channel. It will output a pre-configured pulse format which is set by P_Set_Output_Type(). _8136_P_Stop This function is for stopping the output pulse for each channel. _8136_P_Change_Speed This function is for changing the output pulse frequency on line. _8136_P_Read_Index There are 6 index signal input in one PCI-8136.
I16 _8136_P_Read_Latch_Value(I16 CardNo, I16 EncNo, I32 *Value) I16 _8136_P_Set_Index_Latch(I16 CardNo, I16 WhichIndex, I16 Type); I16 _8136_P_Read_Index(I16 CardNo, I16 AxisNo, I16 *Index); I16 _8136_P_Change_Speed(I16 CardNo,I16 AxisNo,F32 Frq); Visual Basic 5.
Mul: for A_B type's mutiplier 0 = 0X A_B Phase 1 = 1X A_B Phase 2 = 2X A_B Phase 3 = 4X A_B Phase EncData: read back encoder data FrqL: Pulse output frequency (Range 0~500k Hz) CompValue: Encoder Compare Value *Index: Index Status (0 or 1) Type: two trigger latch mode: 0 for first trigger, 1 for last trigger WhichIndex: select index no.
5.9 Interrupt Control @ Name _8136_INT_Enable - Set interrupt event handler _8136_INT_Disable - Remove int. event handler _8136_S_Set_Int_Factor - Set interrupt factor _8136_S_INT_Control - Enable/disable interrupt _8136_S_Get_Int_Status - Get Int. status _8136_Callback_Function - Set a call back function for int @ Description _8136_INT_Enable This function is only for Windows system. It allocates interrupt events in Windows system for passing message to application from kernel.
@ Syntax C/C++ (DOS, Windows 95/98/NT/2000) U16_8136_INT_Enable(I16 CardNo, HANDLE *phEvent); (Windows Only) U16 _8136_INT_Disable(I16 CardNo); (Windows Only) void _8136_S_INT_Control(I16 CardNo, U16 intFlag ) U16 _8136_S_Set_Int_Factor(I16 CardNo, I16 ChannelNo, U16 IntFactor) U16 _S_Get_Int_Status(I16 CardNo,I16 AxisNo,U16 *IntStatus) void _8136_Callback_Function(I16 CardNo,void *callbackAddr(I16 AxisNo, U16 IntSts)) Visual Basic 5.
bit3: Home switch on bit4: Index signal on bit5: Encoder value compared bit6: Timer interrupt bit7: ADC pre-load value reached OptionType: Set ADC compare direction 1 = Rising Direction 2 = Falling Driection 3 = Both Direction *callbackAddr(I16 AxisNo, U16 IntSts) : function pointer type @ Return Code ERR_RangeError ERR_NoError Motion Libra • 83
5.10 Close Loop Initialization @Name _8136_C_Initial – Closed loop motion control initialize @Description _8136_C_Initial: There are 6 motion axes in one PCI-8136M. User can choose some or all of them to run in closed loop control mode by this function. In closed loop control mode, the specific DA channel and encoder counter channel are used for closed loop control. That means two different control modes, pulse and V command, can be used in one card at the same time.
5.11 Motion Parameters @Name _8136_M_Set_System_Param – Set motion cycle time and speed _8136_M_Set_IO_Active – Enable/disable motion I/O _8136_M_Switch_Logic – Set motion I/O's logic _8136_A_Set_Source – Switch DAC source _8136_M_Set_Feedback – Set axis0~2 encoder feedback on/off @Description _8136_M_Set_System_Param: This function is for users to choose motion system's maximum speed and motion loop's cycle time. The following table shows the choices in PCI-8136.
_8136_M_Set_Feedback When users are using absolute position control motion functions, PCI-8136M will read current position counter value for calculating next position. If users don't connect any feedback device, they can use this function to disable external feedback. Then the absolute function will be valid. There are only first three axes supports these functions. The other three axes must connect feedback device if they are using absolute position motion functions.
2 = 128k 3 = 256k 4 = 512k 5 = 1024k CycleTime: select motion cycle time 0 = 1.024ms (for 1024k only) 1 = 2.048ms (for 512k and 1024k only) 3 = 4.
5.12 Motion Status @Name _8136_M_ORG_Status – Check origin point’s high/low _8136_M_PEL_Status – Check positive point’s high/low _8136_M_MEL_Status – Check minus point’s high/low _8136_M_ALM_Status – Check alarm point’s high/low _8136_Motion_Status – Check current axis’ motion status _8136_M_Get_Speed – Get one axis' current speed @Description _8136_M_ORG_Status: There are 6 ORG digital input pins in PCI-8136M. Every axis has one ORG pin for homing. This function is for checking the ORG pin's status.
I16 _8136_M_MEL_Status(I16 CardNo,I16 Channel) I16 _8136_M_ALM_Status(I16 CardNo) I16 _8136_Motion_Status(I16 CardNo,I16 AxisNo) I16 _8136_M_Get_Speed(I16 CardNo,I16 AxisNo,F64 *Speed) Visual Basic 5.
5.13 PTP Movement @Name _8136_Start_TR_Move – Start a trapezoidal relative PTP move _8136_Start_SR_Move – Start a S-curve relative PTP move _8136_Start_TA_Move – Start a trapezoidal absolute PTP move _8136_Start_SA_Move – Start a S-curve absolute PTP move @Description _8136_Start_TR_Move: This function is for users to start a trapezoidal velocity profile relative PTP motion. It wont' occupy user's program after it starts.
ByVal MaxVel As Double, ByVal Tacc As Double, ByVal Tdec As Double) B_8136_Start_TA_Move (ByVal CardNo As Integer, ByVal AxisNo As Integer,ByVal Pos As Long,ByVal StrVel As Double, ByVal MaxVel As Double, ByVal Tacc As Double, ByVal Tdec As Double) B_8136_Start_SA_Move (ByVal CardNo As Integer, ByVal AxisNo As Integer,ByVal Pos As Long,ByVal StrVel As Double, ByVal MaxVel As Double, ByVal Tacc As Double, ByVal Tdec As Double) @ Argument CardNo: card number designated to set (Range 0 ~ 3) AxisNo: axis number
5.14 2D Interpolation @Name _8136_Start_Move_XY – Start a trapezoidal 2 axes linear interpolation motion _8136_Start_Arc_XY – Start a trapezoidal 2 axes circular interpolation motion _8136_Start_S_Move_XY –Start a trapezoidal 2 axes linear interpolation motion _8136_Start_S_Arc_XY – Start a trapezoidal 2 axes circular interpolation motion @Description _8136_Start_Move_XY: This function is for 2D linear interpolation of trapezoidal velocity profile motion with absolute position for any two axes in one Card.
Visual Basic 5.
5.15 3D Interpolation @Name _8136_Start_Move_XYZ – start a 3 axis linear interpolation with trapezoidal velocity profile _8136_Start_S_Move_XYZ – start a 3 axis linear interpolation with S-Curve velocity profile @Description _8136_Start_Move_XYZ: This function is for 3D linear interpolation of trapezoidal velocity profile motion with absolute position for any three axes in one Card.
@ Argument CardNo: card number designated to set (Range 0 ~ 3) AxisNo: axis number designated to set (Range 0~5) PX: line x position PY: line y position PZ: line z position StrVel: starting velocity MaxVel: maximum velocity Tacc: acceleration time in seconds Tdec: deceleration time in seconds @ Return Code ERR_RangeError ERR_NoError Motion Libra • 95
5.16 Continuous Motion @Name _8136_V_Move – Trapezoidal continuous move for one axis _8136_SV_Move – S-curve continuous move for one axis @Description _8136_V_Move: This function is for continuous move. Continuous move means it has no destination but it has acceleration stage when it starts. This function is for trapezoidal acceleration move of one axis _8136_SV_Move: This function is for continuous move. Continuous move means it has no destination but it has acceleration stage when it starts.
5.17 Homing @Name _8136_Home_Move – Start to search ORG pin for homing @Description _8136_Home_Move: By giving home search direction, PCI-8136M will auto searching the ORG signal for homing. After it reach the ORG pin. The encoder counter will reset to zero at the same time. @ Syntax C/C++ (DOS, Windows 95/98/NT/2000) I16 _8136_Home_Move(I16 CardNo,I16 AxisNo,F64 StrVel,F64 MaxVel,F64 Tacc) Visual Basic 5.
5.18 Motion Function @Name _8136_Motion_Stop – Stop motion for one axis _8136_C_Set_Gain – Tuning closed loop gain for one axis @Description _8136_Motion_Stop: This function is for stopping motion command immediately. The pulse generator will stop sending any command to driver. _8136_C_Set_Gain: This function is for tuning two closed loop parameters for V-command control mode. One parameter is Multiplicand gain (Kp1) and the other is shift gain (Kp2). The total compensation gain is Kp1*(2^(Kp2))/16.
Product Warranty/Service ADLINK warrants that equipment furnished will be free from defects in material and workmanship for a period of one year from the date of shipment. During the warranty period, we shall, at our option, either repair or replace any product that proves to be defective under normal operation. This warranty shall not apply to equipment that has been previously repaired or altered outside our plant in any way as to, in the judgment of the manufacturer, affect its reliability.