2.4.6 Set limit switch as normal close condition2-13
2.5 Connection2-14
2.5.1 Pin assignment of connector CN22-14
2.5.2 The internal circuit of CW_PULSE, CCW_DIR, HOLD2-15
2.5.3 The internal circuit of limit switch input2-15
2.5.4 Example of connection2-16
3. Software2-18
3.1 Functions2-18
3.1.1 Setting commands2-20
3.1.2 Stop commands2-24
3.1.3 Simple motion commands2-25
3.1.4 Interpolation commands2-30
3.1.5 Others2-35
3.2 Start up and end of program2-37
4. Example2-39
4.1 Detect I-8091 card2-39
4.2 Example: DEMO.cpp2-40
4.3 Example: DEMO1.cpp2-40
http://www.icpdas.comICPDAS
Page 4
I-8090 User ManualVersion 1.0 06/2001
I-8090
3-axis encoder card
User Manual
Version 1.0 06/2001 Edition
Warranty: All products manufactured by ICP DAS are warranted against
defective materials for one year from the date of delivery to the original
purchaser
Warning: ICP DAS assumes no liability for damage consequent to the
use of this product. ICP DAS reserves the right to change this manual at
any time without notice. The information furnished by ICP DAS is
believed to be accurate and reliable. However, no responsibility is
assumed by ICP DAS for it’s use, nor for any infringements of patents or
other rights of third parties resulting from it’s use.
Copyright
Copyright 2001 by ICP DAS. All right are reserved
Trademark
The names used for identification only maybe registered trademarks of
their respective companies.
http://www.icpdas.com1-1ICPDAS
Page 5
I-8090 User ManualVersion 1.0 06/2001
I-8090 3-axis encoder card
I-8090 is a 3-axis encoder counter board on I-8000 platform. I-8090
encoder card has internal digital filter, 16 bits counter and high counting rate
1Mpps. The application of I-8090 board is position/distance measurement,
velocity measurement, feedback for motor control, handwheel input and so on.
A system including I-8000 (main system), I-8091 (2-axis stepping/servo
control card), I-8090 (3-axis encoder card) can be implemented as a
standalone motion controller system for low cost automatical machine.
The ID register is read only and its value is fixed as 0x0D. User can check this
card’s registers table as following.
register to identify I-8090 card or not.
Register Add. R/W Bit 7Bit 6Bit 5Bit 4Bit 3Bit 2Bit 1Bit 0
XDATA 0x01RX-axis encoder value
XDATA: the X-axis encoder counter value can be read out from this register.
The low byte value of 16 bits encoder counter can be read out when set
/SEL=0 (XCTRL register), the high byte can be read out when set /SEL=1
(XCTRL register).
Register Add. R/W Bit 7Bit 6Bit 5Bit 4Bit 3Bit 2Bit 1Bit 0
YDATA 0x02RY-axis encoder value
YDATA : the Y-axis encoder counter value can be read out from this register.
The low byte value of 16 bits encoder counter can be read out when set
/SEL=0 (YCTRL register), the high byte can be read out when set /SEL=1
(YCTRL register).
Register Add. R/W Bit 7Bit 6Bit 5Bit 4Bit 3Bit 2Bit 1Bit 0
ZDATA0x03RZ-axis encoder value
ZDATA : the Z-axis encoder counter value can be read out from this register.
The low byte value of 16 bits encoder counter can be read out when set
http://www.icpdas.com1-5ICPDAS
Page 9
I-8090 User ManualVersion 1.0 06/2001
/SEL=0 (ZCTRL register), the high byte can be read out when set /SEL=1
(ZCTRL register).
The index input C+/C- can read out from this register. These bits are active
high.
XI : indicate the index of X-axis (C+/C- input).
YI : indicate the index of Y-axis (C+/C- input).
ZI : indicate the index of Z-axis (C+/C- input).
Fig (10) The connection between I-8090 and I-8091 for function testing or
pulse feedback by I-8090 encoder card.
http://www.icpdas.com1-12ICPDAS
Page 16
I-8090 User ManualVersion 1.0 06/2001
2. Software _
User’s applications could be compiled under DOS Turbo/Borland C/C++
environment. It should be include i8090.h and i8090.LIB to compile the target
execution file. The execution files can be downloaded under I-8000 main
system (execute 7188x.exe), and then run the target execution file as under
PC system. About the I-8000’s resource or environment, please refer to the
manual of I-8000 system or its software programming guide.
The following section will introduce the I-8090’s functions and examples.
2.1 constants and functions
Constants
#define YES 1
#define NO 0
#define ON 1
#define OFF 0
In order to distinguish more than one I-8090 card in I-8000 platform,
the I-8090 c ards should be re gistrated before using it. This command
will assign a card number=“cardNo” to I-8090 card address=”address” .
If there is not I-8090 at the given address, this command will return
“NO”.
cardNo: 0~19, assign the address as which card.
http://www.icpdas.com1-13ICPDAS
Page 17
I-8090 User ManualVersion 1.0 06/2001
address: hardware address which defined at chapter 1.1
Return: “YES” : registration successful
“NO” : registration failure.
Example: This example will assign I-8090 card address=0x080 as
CARD1 (1). Then initial the I-8090 card and reset X,Y,Z axis encoder
counter value to 0.
This command will reset all three axis’s counter value of “cardNo” card,
and assign its counting mode. The counting mode (S1,S0) has been
explained in registers XCTRL, YCTRL, ZCTRL.
cardNo: 0~19, select which card.
x_mode, y_mode, z_mode: select the counting mode.
0x00 : quadrant counting mode
0x10 : CW/CCW counting mode
0x20 : Pulse/Direction counting mode
(3) unsigned int i8090_GET_ENCODER(unsigned char cardNo,
unsigned char axis)
This command will return the coun ter valu e of the selected “axis” and
“cardNo”.
cardNo: 0~19, select which card.
axis : select which axis.
1 : X-axis
2 : Y-axis
3 : Z-axis
return : a 16 bits unsigned integer value.
This command will reset the counter value of the selected “axis” and
“cardNo”.
cardNo: 0~19, select which card.
axis : select which axis.
1 : X-axis
2 : Y-axis
3 : Z-axis
(8) long i8090_GET_ENCODER32(unsigned char cardNo, unsigned
char axis)
cardNo: 0~19, select which card.
axis : select which axis.
1 : X-axis
2 : Y-axis
3 : Z-axis
The above three commands provided a software method to get 32 bits
encoder counts.
The
i8090_ENCODER32_ISR(unsigned char cardNo)
command
calculates the difference pulse between present and last time, and then
add this difference into a
the
i8090_ENCODER32_ISR()
”long type”
variable. According to this idea, so,
command should be executed
periodically in 2~10ms by timer interrupt or manually call it.
Print("-------------- ---------------------------------------------------------\r\n");
Print(" i8090 DEMO1 program demo1.PRJ, demo1.cpp, i8090.lib
\r\n");
Print(" 32 bits encoder demostration \r\n");
Print("-------------- ---------------------------------------------------------\r\n");
Print("Press any key to stop...\r\n");
ClearSystemKey();
ShowAxis=0;
do
http://www.icpdas.com1-24ICPDAS
Page 28
I-8090 User ManualVersion 1.0 06/2001
{
Delay(5); //delay 5ms
//-------------------------------------------------- // i8090_ENCODER32_ISR(CARD1) should be called in 2~10ms
// or call it by a timer interrupt service routine by 2~10ms
//-------------------------------------------------- i8090_ENCODER32_ISR(CARD1);
key=GetSystemKey();
ClearSystemKey();
switch (key)
{
case SKEY_DOWN:
ShowAxis++;
if (ShowAxis>2) ShowAxis=0;
break;
case SKEY_UP:
ShowAxis--;
if (ShowAxis<0) ShowAxis=2;
break;
};
}
http://www.icpdas.com1-25ICPDAS
Page 29
I-8090 User ManualVersion 1.0 06/2001
switch (ShowAxis)
{
case 0: ShowLedValue(x_value,X_axis); break;
case 1: ShowLedValue(y_value,Y_axis); break;
case 2: ShowLedValue(z_value,Z_axis); break;
};
if (x_index) LedRunOff(); else LedRunOn();
if (y_index) LedCommOff(); else LedCommOn();
if (z_index) LedBattOff(); else LedBattOn();
} while (!Kbhit());
}
http://www.icpdas.com1-26ICPDAS
Page 30
I-8091 User ManualVersion 1.0 06/2001
I-8091
2-axis stepping/servo motor control card
User Manual
Version 1.0 06/2001 Edition
Warranty: All products manufactured by ICP DAS are warranted against
defective materials for one year from the date of delivery to the original
purchaser
Warning: ICP DAS assumes no liability for damage consequent to the
use of this product. ICP DAS reserves the right to change this manual at
any time without notice. The information furnished by ICP DAS is
believed to be accurate and reliable. However, no responsibility is
assumed by ICP DAS for it’s use, nor for any infringements of patents or
other rights of third parties resulting from it’s use.
Copyright
Copyright 2001 by ICP DAS. All right are reserved
Trademark
The names used for identification only maybe registered trademarks of
their respective companies.
http://www.icpdas.com2-1ICPDAS
Page 31
I-8091 User ManualVersion 1.0 06/2001
I-8091
The I-8091 card is a 2-axis command-type stepping motor control card
on I-8000 platform, it also can be used as servo motor control (pulse input
type). This card has an embedded CPU which performs motion commands
transfered from I-8000 main system to increase the system performance. A
2Kbytes-FIFO is introduced as command buffer. This buffer can provide over
700ms buffer time.
A system including I-8000(main system), I-8091(2-axis stepping/servo
control card), I-8090(3-axis encoder card) can be implemented as a stand
along motion controller system for low cost automatical machine.
2-axis Stepping/Servo Motor Control Card
Features
I-8000 series.
!
2-axis independent, simultaneous stepping motor control / servo motor
3 optical isolated digital inputs per axis for limit switches.
!
programmable limit switch initial condition as normal open(N.O.) or normal
!
close(N.C.).
−
steps.
http://www.icpdas.com2-2ICPDAS
Page 32
I-8091 User ManualVersion 1.0 06/2001
I-8091 Contents _
1. Introduction2-4
1.1 System Block Diagram2-4
1.2 DDA technology2-5
2. Hardware2-8
2.1 I-8000 hardware address2-8
2.2 Register of I-8091 board2-9
2.3 LED indicator2-10
2.4 Hardware configuration2-11
2.4.1 Limit switch configuration2-11
2.4.2 Output pulse mode configuration2-12
2.4.3 Direction configuration2-12
2.4.4 Turn Servo ON/OFF (Hold ON/OFF)2-12
2.4.5 Automatic protection2-12
2.4.6 Set limit switch as normal close condition2-13
2.5 Connection2-14
2.5.1 Pin assignment of connector CN22-14
2.5.2 The internal circuit of CW_PULSE, CCW_DIR, HOLD2-15
2.5.3 The internal circuit of limit switch input2-15
2.5.4 Example of connection2-16
3. Software2-18
3.1 Functions2-18
3.1.1 Setting commands2-20
3.1.2 Stop commands2-24
3.1.3 Simple motion commands2-25
3.1.4 Interpolation commands2-30
3.1.5 Others2-35
3.2 Start up and end of program2-37
4. Example2-39
4.1 Detect I-8091 card2-39
4.2 Example: DEMO.cpp2-40
4.3 Example: DEMO1.cpp2-40
http://www.icpdas.com2-3ICPDAS
Page 33
I-8091 User ManualVersion 1.0 06/2001
1. Introduction _
1.1 System Block Diagram
The I-8091 stepping motor control card is a micro-computer controlled, 2-axis
pulse generation card. It includes a 2Kbytes-FIFO to receive motion command
from host, a micro-computer for profile generation and protection, 2-axis DDA
chip to execute DDA function when interpolation command is used, 2500Vrms
optical isolation inserted for industrial application.
Bus
2K FIFO
Interface
Limit Switch
Input Port
CPU
Profil e G eneration
Protection
DDA Chip
X-axis
DDA Chip
Y-axis
Limit Switch
Input Port
Limit Switch Signal
Fig.(1) block diagram of I-8091 card
Optical
Isolation
Connector
http://www.icpdas.com2-4ICPDAS
Page 34
I-8091 User ManualVersion 1.0 06/2001
1.2 DDA Technology
The DDA chip is the heart of I-8091 card, it will generate equal-space
pulse train corresponding to specific pulse number during a DDA period.
This mechanism is very useful to execute pulse generation and
interpolation function. The DDA period can be determined by DDA cycle.
Table(1) shows the relation among DDA cycle, DDA period and output
pulse rate. When DDA cycle set to 1, the DDA period is equal to
(1+1)x1.024ms = 2.048ms. The output pulse number can be set to 0~2047,
therefore the maximum output pulse rate will be 1Mpps. The minimum
output pulse rate is 3.83pps when set DDA cycle=254 (DDA period =
(254+1)x1.024ms = 261.12ms).
DDA period
DDA cycle
X pulse = 3
Y pulse = 6
Z pulse = 4
Fig.(2) DDA mechanism
Table(1) The Relation among DDA cycle, DDA period and output pulse rate.
The DDA cycle can be set by i8091_SET_VAR() command which decribed
in charpter 3. The selection criterion of DDA cycle was described as
following.
http://www.icpdas.com2-5ICPDAS
Page 35
I-8091 User ManualVersion 1.0 06/2001
N
N
(1) The required max. output pulse rate.
PRmax = Vmax*N/60
2047
+
PRmax =
11 024()*.DDAcyclems
PRmax : max. output pulse rate.
Vmax : max. speed (rpm).
N : the pulse number of stepping motor per revolution.
(pulse/rev).
2. The required speed resolution.
The maximum output pulse number is Np(0~2047), therefore
the speed resolution is Vmax(max. speed)/Np. The DDA cycle
can be obtained by following equation.
p
PRmax =
DDAcyclems()*.
+
11 024
3. When choose large DDA cycle (DDA period), it will occur
vibration between different pulse input which generally can be
observed during acceleration or deceleration. So, the small
DDA cycle , the smooth acceleration/deceleration curve as long
as the speed resolution is acceptable.
Example: Stepping Motor
The specification of stepping motor is 500 pulse/rev, max. speed 500
rpm, speed resolution 2 rpm.
The required max. pulse rate
PRmax = 500 rpm*500/60 = 4166.67 pps
The maximum output pulse
Np = 500rpm/2rpm =250 pulse number
The DDA cycle can be calculated by follow equation
p
PRmax =
DDAcyclems()*.
+
11 024
250
+
4166.67 =
11 024()*.DDAcyclems
DDA cycle = 58
http://www.icpdas.com2-6ICPDAS
Page 36
I-8091 User ManualVersion 1.0 06/2001
N
High Speed = 247 pulse (4166.67*58*0.001024)
The above results means that maximum speed is 500rpm when send
command i8091_SET_VAR(0, 58, 2, 2, 247) to I-8091 card.
Example: Pulse type input Servo Motor
The specification of servo motor is 8000 pulse/rev, max. speed 3000 rpm,
speed resolution 2 rpm.
The required max. pulse rate
PRmax = 3000 rpm*8000/60 = 400,000 pps
The maximum output pulse
Np = 3000rpm/2rpm =1500 pulse number
The DDA cycle can be calculated by follow equation
p
PRmax =
DDAcyclems()*.
+
11 024
1500
+
400,000 =
11 024()*.DDAcyclems
DDA cycle = 3
High Speed = 1638 pulse (400,000*4*0.001024)
The above results means that maximum speed is 3000rpm when send
command i8091_SET_VAR(0, 3, 2, 2, 1638) to I-8091 card.
http://www.icpdas.com2-7ICPDAS
Page 37
I-8091 User ManualVersion 1.0 06/2001
2 Hardware _
2.1 I-8000 hardware address
The hardware address of I-8000 main system is fixed as following table.
There are 4 slots I-8000 and 8 slots I-8000.
The ID register is read only and its value is fixed as 0x0E. User can check
this register to identify I-8091 card or not.
Register Add. R/WBit 7Bit 6Bit 5Bit 4Bit 3 Bit 2 Bit 1Bit 0
LIMIT10x01R/EMG/FFFF/FFEF /LS14/LS11 /ORG1
/ORG1 : original point limit switch of X-axis.
/LS11, /LS14 : limit switches of X-axis, which must be configured as chapter
2.4.1.
/EMG : emergency switch.
/FFEF : active low, indicate FIFO is empty.
/FFFF : active low, indicate FIFO is full.
Register Add. R/WBit 7Bit 6Bit 5Bit 4Bit 3 Bit 2 Bit 1Bit 0
LIMIT20x02R/YSTOP /XSTOP/LS24/LS21 /ORG2
/ORG2 : original point switch of Y-axis.
/LS21, /LS24 : limit switches of Y-axis, which must be configured as chapter
2.4.1.
/XSTOP, /YSTOP : These signals indicate the operating situation of X, Y axis
in CPU.
1 : busy, 0 : stop
The commands i8091_WAIT_X( ) and i8091_WAIT_Y( ) just to waiting for
http://www.icpdas.com2-9ICPDAS
Page 39
I-8091 User ManualVersion 1.0 06/2001
'/XSTOP' or '/YSTOP' signal become to '0'.
Register Add. R/WBit 7Bit 6Bit 5Bit 4Bit 3 Bit 2 Bit 1Bit 0
WRFF0x01WCommand port
I-8091 driver will send motion command by way of this register. Please do not
use this register to write any thing, or I-8091 will not operate properly.
Register Add. R/WBit 7Bit 6Bit 5Bit 4Bit 3 Bit 2 Bit 1Bit 0
RSTFF0x02WReset FIFO
This register is used to reset FIFO for clear all of commands pending in the
FIFO buffer.
2.3 LED Indicator
power
/ORG1
/LS11
/LS14 /ORG2 /LS21 /LS24
Fig.(4) I-8091 LED indicator
Where
/ORG1: X-axis’s original limit switch for machine home position.
/EMG
/LS11, /LS14 : X-axis’s negative and positive limit switches.
/ORG2: Y-axis’s original limit switch for machine home position.
/LS21, /LS24 : Y-axis’s negative and positive limit switches.
/EMG : system’s emergency signal input.
http://www.icpdas.com2-10ICPDAS
Page 40
I-8091 User ManualVersion 1.0 06/2001
LS11
ORG1
LS14
CW/FW
CCW/BW
Motor
EXT_GND
/LS11
/LS14
/ORG1
/EMG
Emer gency
ccm
LS21
ORG2
LS24
CW/FW
CCW/BW
Motor
EXT_GND
/LS21
/LS24
/ORG2
ccm
2.4 Hardware Configuration
2.4.1 Limit switch configuration
Because the profile generation and protection is executed by the CPU
on I-8091 card, the limit switches must configure as following diagram.
The motion command just can work properly.
X axis
Fig.(5) Limit switch configuration of X axis
Y axis
Fig.(6) Limit switch configuration of Y axis
http://www.icpdas.com2-11ICPDAS
Page 41
I-8091 User ManualVersion 1.0 06/2001
2.4.2 Output pulse mode configuration
I-8091 card provide two kind output method.
(a) CW/CCW mode
(b) Pulse/Direction mode
The command i8091_SET_MODE(cardNo, modeX, modeY) provide
parameters CW_CCW (0) and PULSE_DIR (1) to define output pulse
mode.
CW
Mode = 0 (CW_CCW)
CCW
Pulse
Mode = 1 (PULSE_DIR)
Direction
Fig.(7) Output pulse mode
2.4.3 Direction configuration
Sometimes, the output direction of X-axis, Y-axis is not in the
desired direction due to the motor’s connection or gear train. It is
recommended to unify the output direction as shown in Figure(5)(6). The
CW/FW direction is defined as toward outside from motor and the
CCW/BW direction is defined as toward inside to motor. The
i8091_SET_DEFDIR(cardNo, defdirX, defdirY) command provides
parameters NORMAL_DIR (0) and REVERSE_DIR (1) to define the
rotating direction of motor.
2.4.4 Turn Servo ON/OFF (Hold ON/OFF)
To turn servo motor into servo ON(OFF) state, or turn stepping motor
into hold ON(OFF) state, the command i8091_SET_SERVO_ON(cardNo,
sonX, sonY) provide parameters ON (1) and OFF (0) to turn ON or OFF.
2.4.5 Automatic protection
The I-8091 card has a automatic protected system.
(a) If X-aixs command is executing and moving toward CW/FW direction,
http://www.icpdas.com2-12ICPDAS
Page 42
I-8091 User ManualVersion 1.0 06/2001
X-axis will immediately stop when LS14 is touched. To release this
protection as long as X-axis move toward CCW/BW direction.
(b) If X-aixs command is executing and moving toward CCW/BW
direction, X-axis will immediately stop when LS11 is touched. To
release this protection as long as X-axis move toward CW/FW
direction.
(c) If Y-aixs command is executing and moving toward CW/FW direction,
Y-axis will immediately stop when LS24 is touched. To release this
protection as long as Y-axis move toward CCW/BW direction.
(d) If Y-aixs command is executing and moving toward CCW/BW
direction, Y-axis will immediately stop when LS21 is touched. To
release this protection, as long as Y-axis move toward CW/FW
direction.
(e) If the signal of the emergency limit switch /EMG was found in CPU
firmware, all motion will be terminated and stop.
2.4.6 Set limit switch as normal close condition
The limit switches /EMG, /LS11, /LS14, /LS21, /LS24, /ORG1, /ORG2 is
initially normal open condition, that is, these signal is active when
connect it to ground. In industrial application, it might be recommended
normal close condition, that is, these signal is active when open from
ground.
The i8091_SET_NC(cardNo, sw) command can be set sw=0 (default), for
normal open condition. When set sw=1, for normal close condition.
http://www.icpdas.com2-13ICPDAS
Page 43
I-8091 User ManualVersion 1.0 06/2001
2.5 Connection
2.5.1 Pin assignment of connector CN2
CN2
DB25M-90
1
14
2
15
3
16
4
17
5
18
6
19
7
20
8
21
9
22
10
23
11
24
12
25
13
CW_PULSE2
CCW_DIR2
HOLD2
ORG2
LS21
LS24
+5V
CW_PULSE1
CCW_DIR1
HOLD1
GND
EXT_VCC (12~24V)
ORG1
LS11
LS14
EMG
EXT_GND
Fig.(8) CN2 connector
Table of CN2 connector’s pin assignment
pin namepin
Description
number
+5V1Internal +5V power, Max. output current: 50mA
CW_PULSE12X-axis CW (Pulse) output pin
CCW_DIR13X-axis CCW (Direction) output pin
HOLD14X-axis HOLD (servo on) output pin
GND5Signal ground of pin 2,3,4
EXT_VCC6External power(12~24V) for limit switches
/ORG17X-axis original (home) limit switch
/LS118X-axis limit switch
9,10No used
/LS1411X-axis limit switch
/EMG12Emergency input
EXT_VCC19External power(12~24V) for limit switches
/ORG220Y-axis original (home) limit switch
/LS2121Y-axis limit switch
22,23No used
/LS2424Y-axis limit switch
EXT_GND25External ground for limit switch
2.5.2 The internal circuit of CW_PULSE, CCW_DIR, HOLD
When output these signal as 1, it can source 15mA(max.).
When output these signal as 0, it ca n sink 50mA(max.)
+5V
330
CW_PULSE1
CCW_DIR1
HOLD1
CW_PULSE2
CCW_DIR2
HOLD2
i8091
Fig.(9) internal circuit of pulse output pin
2.5.3 The internal circuit of limit switch input
Initially, the limit switch inputs of I-8091 board are normal open (N.O.),
the I-8091 board will automatic protect when limit switch pin connect
to EXT_GND. The user can use the command i8091_SET_NC
(cardNo, YES) to let those limit switch input as normal close condition
at the beginning of the user’s program.
EXT_VCC (12V~24V)
4.7K
/ORG1, /LS11, /LS14
/ORG2, /LS21, /LS24
i8091
/EMG
Fig.(10) internal circuit of limit switch input pin
http://www.icpdas.com2-15ICPDAS
Page 45
I-8091 User ManualVersion 1.0 06/2001
2.5.4 Example of connection
+5V
1
3
1
3
1
3
6
5
4
6
5
4
6
5
4
DGND
+5V
+5V
CW_PULSE1
CCW_DIR1
HOLD1
GND
CW +
CW -
CCW +
CCW -
HOLD +
HOLD -
14
23
14
23
14
23
FAN-OUT TYPE (VEXTA) DRIVER
Fig.(11) fan-out type driver (VEXTA's motor driver)
Fig.(13) The connection between I-8090 and I-8091 for function testing or
pulse feedback by I-8090 encoder card.
http://www.icpdas.com2-17ICPDAS
Page 47
I-8091 User ManualVersion 1.0 06/2001
3. Software _
User’s applications could be compiled under DOS Turbo/borland C/C++
environment. It should be include i8091.h and i8091.LIB to compile the target
execution file. The execution files can be downloaded under I-8000 main
system (execute 7188x.exe), and then run the target execution file as under
PC system. About the I-8000’s resource or environment, please refer to the
manual of I-8000 system or its software programming guide.
The following section will introduce the I-8091’s functions and examples.
In order to distinguish more than one I-8091 card in I-8000 platform, the
I-8091 cards should be registrated before using it. This command will
assign a card number=“cardNo” to I-8091 card address=”address” . If
there is not I-8091 at the given address, this command will return “NO”.
cardNo : board number 0~19.
address : select the address as well as hardware selected in chapter 2.1.
return NO
: board not exist
: board exist
YES
Example:
i8091_REGISTRATION(1, 0x080);
(2) i8091_RESET_SYSTEM( unsigned char cardNo )
To reset I-8091 card, this command will terminate the running command in
I-8091 card. User can use this command as software emergency stop.
i8091_RESET_SYSTEM command also will clear all of setting, so, all I8091 card’s parameter should be set again.
cardNo : board number 0~19.
(3) i8091_SET_VAR(unsigned char cardNo,
unsigned char DDA_cycle,
unsigned char Acc_Dec,
unsigned int Low_Speed,
unsigned int High_Speed)
to set DDA cycle, accelerating/decelerating speed, low speed and high
speed value.
cardNo : board number 0~19.
Sometimes, the output direction of X-axis, Y-axis is undesired
direction due to the motor’s connection or gear train. In oder to unify the
output direction as shown in Fig.(5) and Fig.(6). Where CW/FW direction is
defined as toward outside from motor, CCW/BW direction is defined as
toward inside from motor. i8091_SET_DEFDIR( ) command provide
parameters to define the rotating direction of motor.
cardNo : board number 0~19.
defdirX : X axis direction definition
defdirY : Y axis direction definition
0 : NORMAL_DIR
http://www.icpdas.com2-21ICPDAS
Page 51
I-8091 User ManualVersion 1.0 06/2001
1 : REVERSE_DIR
(5) i8091_SET_MODE(unsigned char cardNo,
unsigned char modeX,
unsigned char modeY)
I-8091 card provide two kind output method.
cardNo : board number 0~19.
modeX : X axis output mode
modeY : Y axis output mode
cardNo : card numbe r 0~19.
sw: 0(NO) normal open (default).
1(YES) normal close.
http://www.icpdas.com2-23ICPDAS
Page 53
I-8091 User ManualVersion 1.0 06/2001
3.1.2 Stop Commands
(8) i8091_STOP_X(unsigned char cardNo)
to stop X axis.
cardNo : board number 0~19.
(9) i8091_STOP_Y(unsigned char cardNo)
to stop Y axis.
cardNo : board number 0~19.
(10) i8091_STOP_ALL(unsigned char cardNo)
to stop X, Y axis immediatly.
cardNo : board number 0~19.
This command will clear all of commands pending in the FIFO.
The i8091_RESET_SYSTEM can be used as software emergency stop.
The i8091_RESET_SYSTEM command will terminate the running
command and clear all of setting, so, all I-8091 card’s parameter should be
set again after call i8091_RESET_SYSTEM command.
(11) i8091_EMG_STOP(unsigned char cardNo);
This function is the same as i8091_STOP_ALL(), but i8091_ EMG_STOP()
only can be used in interrupt routine.
cardNo : card numbe r 0~19.
This command will clear all of commands pending in the FIFO.
The i8091_RESET_SYSTEM can be used as software emergency stop.
The i8091_RESET_SYSTEM command will terminate the running
command and clear all of setting, so, all I-8091 card’s parameter should be
set again after call i8091_RESET_SYSTEM command.
This command will accelerate/decelerate the selected axis’s mo tor to the
“move_speed”. This command can be continuously send to I-8091 to
dynamicly change speed. The rotating motor can be stop by the
http://www.icpdas.com2-27ICPDAS
Page 57
I-8091 User ManualVersion 1.0 06/2001
command i8091_STOP_X(), i8091_STOP_Y(), i8091_STOP_ALL(), or
i8091_SLOW_STOP().
cardNo : board number 0~19.
axis : selected axis.
(21) i8091_INTP_PULSE(unsigned char cardNo, int Xpulse, int Ypulse)
This command will move a short distan ce (interpolation short line) in X-Y
plane. This command provided a method for user to generate an arbitrary
curve in X-Y plane.
(22) i8091_INTP_LINE(unsigned char cardNo, long Xpulse, long Ypulse)
This command will move a long distance (interpolation line) in X-Y plane.
The CPU on I-8091 card will generate a trapezoidal speed profile of X-axis
and Y-axis, and execute interpolation by way of DDA chip.
(23) i8091_INTP_LINE02(unsigned char cardNo, long x, long y
, unsigned int speed
, unsigned char acc_mode)
This command will move a long interpolation line in X-Y plane. Host will
automaticly generate a trapezoidal speed profile of X-axis and Y-axis by
state-machine-type calculation method. The
parameters into the driver. User can directly call the
(i8091_INTP_STOP( ) !=READY)
to execute the computing entity.
i8091_INTP_LINE02()
do { } while
cardNo : board number 0~19.
speed : 0~2040
acc_mode: 0: enable acceleration and deceleration profile
1: disable acceleration and deceleration profile
Y
(X,Y)
(0,0)
X
Example:
i8091_INTP_LINE02(CARD1,1000,1000,100,0);
only set
do { } while( i8091_INTP_STOP()!=READY) ; //call state machine
(24) i8091_INTP_CIRCLE02(unsigned char cardNo, long x, long y,
unsigned char dir, unsigned int speed,
unsigned char acc_mode)
This command will generate an interpolation circle in X-Y plane. Host will
http://www.icpdas.com2-31ICPDAS
Page 61
I-8091 User ManualVersion 1.0 06/2001
automaticly generate a trapezoidal speed profile of X-axis and Y-axis by
state-machine-type calculation method. The
set parameters into the driver. User can directly call the
(i8091_INTP_STOP( ) !=READY)
to execute the computing entity.
i8091_INTP_CIRCLE02()
do { } while
cardNo : board number 0~19.
x, y : center point of circle relate to present position.
dir : moving direction.
0 : CW
1 : CCW
speed : 0~2040
acc_mode: 0: enable acceleration and deceleration profile
1: disable acceleration and deceleration profile
Y
CW
(X,Y)
only
X
CCW
where r adius = sqr t(X^2 + Y^2)
Example:
i8091_INTP_CIRCLE02(CARD1,2000,2000,100,0);
do { } while( i8091_INTP_STOP()!=READY) ; //call state machine
(25) i8091_INTP_ARC02(unsigned char cardNo, long x, long y, long R,
unsigned char dir, unsigned int speed,
unsigned char acc_mode)
This command will generate an interpolation arc in X-Y plane. Host will
automaticly generate a trapezoidal speed profile of X-axis and Y-axis by
state-machine-type calculation method. The
i8091_INTP_ARC02()
parameters into the driver. User can directly call the
do { } while
only set
(i8091_INTP_STOP( ) !=READY)
to execute the computing entity.
cardNo : board number 0~19.
http://www.icpdas.com2-32ICPDAS
Page 62
I-8091 User ManualVersion 1.0 06/2001
x, y : end point of arc relate to present position.
R : radius of arc.
if R>0 , the arc < 180degree
if R<0 , the arc > 180 degree
dir : moving direction.
0 : CW
1 : CCW
Rdirpath of curve
R>0CW'B'
R>0CCW'C'
R<0CW'A'
R<0CCW'D'
speed : 0~2040
acc_mode: 0: enable acceleration and deceleration profile
1: disable acceleration and deceleration profile
'A'
CW
Y
'B'
CW
CCW
(X,Y)
'C'
'D'
X
CCW
Restriction:
3232
−+≤≤−2121
3232
−+≤≤ −2121
3232
−+≤≤−
2121
≥
R
#x
# y
#R
22
+
xy
2
http://www.icpdas.com2-33ICPDAS
Page 63
I-8091 User ManualVersion 1.0 06/2001
Example:
i8091_INTP_ ARC02(1,2000,-2000,2000,CW,100,0);
do { } while( i8091_INTP_STOP()!=READY) ; //call state machine
(26) unsigned char i8091_INTP_STOP()
The above 3 state-machine-type interpolation commands
simultaneously. The
state-machine-type interpolation commands are only set parameters into
the driver. The computing entity is in
i8091_INTP_STOP().
This command will compute the interpolation profile. It will return
READY(0) for interpolation command completed. And retrun BUSY(1) for
not yet complete.
//--------------------------------------------------------------------------// demo.cpp for I-8091 card
//
// This program can test all of following command
// ----------------------I-8091 testing kit----------------------------------// (0)Exit (A)i8091_IS_X_STOP (K)i8091_CSP_MOVE
// (1)i8091_RESET_SYSTEM (B)i8091_IS_Y_STOP (L)i8091_SLOW_DOWN
// (2)i8091_SET_VAR (C)i8091_LIMIT_X (M)i8091_SLOW_STOP
// (3)i8091_SET_DEFDIR (D)i8091_LIMIT_Y (N)i8091_INTP_PULSE
// (4)i8091_SET_MODE (E)i8091_LSP_ORG (O)i8091_INTP_LINE
// (5)i8091_SET_SERVO_ON (F)i8091_HSP_ORG (P)i8091_INTP_LINE02
// (6)i8091_SET_NC (G)i8091_LSP_PULSE_MOVE (Q)i8091_CIRCLE02
// (7)i8091_STOP_X (H)i8091_HSP_PULSE_MOVE (R)i8091_ARC02
// (8)i8091_STOP_Y (I)i8091_LSP_MOVE (S)User Define Testing
// (9)i8091_STOP_ALL (J)i8091_HSP_MOVE
//
// The output pulse amount can be monitored from i8090 card. When directly
// connect the CW/PULSE, CCW/DIR of i8091 to i8090. The encoder value
// can be shown on the LED display. Its format as following.
// ex: 0.2 1 2 8 : X-axis encoder value
// 5 3.4 0 2 : Y-axis encoder value
// 1 0 0.1 0 : Z-axis encoder value
// the dot(.) stands for which axis.
//--------------------------------------------------------------------
4.3 Example:DEMO1.cpp
//-------------------------------------------------------------------// demo1.cpp for I-8091 card
//
// This a simple program to test I-8091 command
// i8091_INTP_LINE()
// i8091_INTP_LINE02()
//--------------------------------------------------------------------
http://www.icpdas.com2-40ICPDAS
Loading...
+ hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.