advantech.com

PC-Based 运动控制技术及应用
研华(中国)公司客户技术部
技术应用工程师:易红燕
010-62984346-6702
内容:
1.
2.
3.
4.
5.
6.
7.
PC-Based 运动控制系统概述
PCI-1240技术特性
PCI-1240的硬件安装和使用
1240的驱动安装和测试
采用VB, VC 编写运动控制程序
PCI-1240在MA的应用案例
研华的其他运动控制产品
一、现代运动控制系统的基本构成
•高可靠性—稳定的开发平台
•高精度—采用闭环控制
•高速—高脉冲输出频率
•开放性—控制系统的软硬件
基于PC的运动控制器
连接组件
电源
驱动器
位置/速度/转矩
电机
编码器
激光干涉仪
视觉识别器
PLC 与PC-Based 比较
PLC 数控
PC + PLC + Motor
位置传输
PC-based 数控
PC + Motion Card + Motor
点对点运动
过程运动
实时性不高
实时性高
处理通讯问题
PC总线通讯
简单的运动控制算法
复杂运动控制算法
直线运动
生产线输送/包装
低速运动
小型切割
工艺加工
过程(曲线)运动
精密机床数控
机器人控制
钢板切割
PC-based 数控系统
PCI-1784
Motor Driver
PCI-1240
Encoder
内容:
1.
2.
3.
4.
5.
6.
7.
PC-Based 运动控制系统概述
PCI-1240技术特性
PCI-1240的硬件安装和使用
1240的驱动安装和测试
采用VB, VC 编写运动控制程序
PCI-1240在MA的应用案例
研华的其他运动控制产品
PCI-1240技术规格
Features
•
独立4轴步进/脉冲型伺服电机控制
•
支持手轮和JOG功能
•
2/3轴线性插补功能
•
2轴圆弧插补功能
•
•
连续插补功能
连续速度控制
Specifications
ƒ
每轴4MPPS脉冲输出,范围+/-8,388,608
ƒ
2MPPS连续插补输出,范围+/-8,388,608
ƒ
脉冲输出值0 – 268,435,455
两种输出脉冲类型:加/减(CW/CCW)或者脉冲/方向(PULSE/DIR)
ƒ
ƒ
每轴 1 MHz编码器输入
ƒ
两种编码器输入类型:A/B 相或者加/减(UP/DOWN(CW/CCW))
功能及規格介紹-脉冲计数过程
A/B Phase、CW/CCW、Pulse/Direction
A
B
CW
CCW
Pulse
Dir.
Count 1
2
3
4
5
6
5
4
3
2
1
功能及规格介绍--脉冲输出方式
脉冲输出方式
脉冲输出方式, 脉冲输出及方向
信号的电平有效状态 都可以设定
功能及规格介绍–编码器输入
脉冲输入方式
A/B pulse可以在做 x1,x2
及 x4 處理
A/B 正交脉冲
加/减脉冲方式(Up / Down)
功能及规格介绍–脉冲输出
脉冲输出命令
行进间
增加
定量输出
PTP
減少
连续输出
CMOVE
减速间
增加
功能及规格介绍-加减速控制
速度曲线
定速驱动
梯形加減速
S型加減速
功能及规格介绍
Linear Interpolation
Axis
Range
: Any 2/ 3 of 4 axes
: -8,388,608 and +8,388,607, (-223 ~ 223 -1 )
Linear error : +/- 0.5 LSB (Least Significant Bit)
Speed range : 1 PPS to 4 MPPS
Y
10
(20,9)
5
±0.5LSB
0
5
10
15
20
X
功能及规格介绍–插补
圆弧插补
Y
轴数
: 4轴中的任意2轴
范围
插补误差
: -8,388,608 ~ +8,388,607,
: +/- 1.0 LSB
(Least Significant Bit)
: 1 PPS to 4 MPPS.
速度
2
1
3
0
X
4
7
5
6
Solid line : radium
Dash line : radium±1
功能及规格介绍–插补
线性插补
定义在插补中有最长的移动距离的轴为长轴,另外一个为短轴。长轴输出
一个均匀脉冲序列,而短轴的驱动脉冲依赖于长轴和两轴之间的关系。
功能及规格介绍–插补
圆弧插补
Short Axes in
Circular
Interpolation
Calculation
功能及规格介绍
连续差补
A continuous uninterrupted motion can be maintained between
circular, linear, and simple command move profiles. The maximum
interpolation speed is 2 MHz.
4500
node5
Speed
node6
A Continuous Moving
A Non-continuous
Moving
node4
3000
node7
node3
1500
node8
node2
node1
(0,0)
node1
node2 Time
-1500 (0,0)
X
4500
6000
功能及规格介绍
恒定速度控制
The PCI-1240 can set a 1.414 times pulse cycle for 2-axis simultaneous
pulse output, and a 1.732-time pulse cycle for 3-axis simultaneous pulse
output.
Y
v
v
v
v
0.71v
v
v
0.71v
v
X
功能及规格介绍–外部驱动
连续脉冲驱动模式 (JOG)
定长脉冲驱动模式 (Hand Wheel)
功能及规格介绍
位置控制比较寄存器和软件限位设置
•包括邏輯位址計數與實
際位址計數兩種
•範圍(-2,147,483,648 ~ +
2,147,483,647.)
與Compare Regsister 搭
配使用成為軟體極限
(When D0 and D1bits of
register WR2 are
set to 1, it enables the
software limit.)
功能及規格介紹 – 中断信号
•Interrupt Signals
Start/End of consistent speed, End of driving, Trigger from compare
register,etc.
每個中斷可以各別致能(Enable)或失能(Disable).
電源重置(Reboot)後, 所有上列中斷將Disable.
功能及規格介紹 – HOME 功能
•IN3 默认为Home Sensor的输入
•INDEX信号为编码器的Z相信号
内容:
1.
2.
3.
4.
5.
6.
7.
PC-Based 运动控制系统概述
PCI-1240技术特性
PCI-1240的硬件安装和使用
1240的驱动安装和测试
采用VB, VC 编写运动控制程序
PCI-1240在MA的应用案例
研华的其他运动控制产品
卡片安装与信号连接—1
设备连接
LS
HOME
LS
卡片安装与信号连接 – 1
设备连接
PCI-1240
Command
Driver
IPC
Limit Sensors
Limit, Home
Encoder Feeder
Power
Motor
•DLL driver
•Motion Utility
卡片安装与信号连接 – 2
板卡功能分区
Indicator
Controller
Output Pulse
Type
Board ID
Opto-isolated
Location of Jumpers and DIP switch
Emergency
Stop
PCI-1240 功能图
OSC
OSC
CLK
X Axis Interface
16MHz
16MHz
Line drive
Reset
Buffer
A3~A15 Address
Address
PCI BUS
Photo
coupler
Decoder
Decoder
A0~A2
Write
Read
D0~D15
IRQ3~15
Data
Databus
bus
buffer
buffer
IRQ
IRQ
buffer
buffer
MCX314
MCX314
Hi-speed
Photo coupler
+/- output pulse
XOUT 7~4
+/- Limit
XIN 3~1
Servo motor
signals
Jog input
Encoder
feedback
YYAxis
AxisInterface
Interface
ZZAxis
AxisInterface
Interface
UUAxis
AxisInterface
Interface
MCX314 Axis Interface
Command
External signal
Command
Command
Operating
Operating
Section
Section
External
External
Operating
Operating
Section
Section
Accelerating
Accelerating
Decelerating
Decelerating
Generator
Generator
Action
Action
Managing
Managing
Section
Section
Pulse
Pulse
Generator
Generator
COMP+
COMP+
Register
Register
INT
selector
COMPCOMPRegister
Register
Speed
Speed
Generator
Generator
Interrupt
Interrupt
Generator
Generator
Pulse Output
Logical
Logical
Position
Position
counter
counter
Real
Real
Position
Position
counter
counter
Input
InputSignal
Signal
Managing
Managing
Section
Section
Encoder feedback
Servo motor signal
Limit input
Emergency input
OUT 0~3
Out
Out0~3
0~3
selector
Out
Out4~7
4~7
To interpolation
Section
OUT 4~7
卡片安装与信号连接 – 3
脉冲输出控制连线
DRIVER
HOST PC
PCI/ISA
BUS
XP+P
XP+N
XP-P
XP-N
Cable Shield
AGND
Ground
對絞線 CW-
CW+
對絞線 CCW-
LOAD/
SYSTEM
CCW+
FG
Pulse type
Server /
Stepping
MOTOR
GND
Groung
卡片安装与信号连接 – 3
脉冲输出控制连线
Output to Motor Drivers in Differential Circuit
卡片安装与信号连接 – 3
脉冲输出控制连线
Why differential(差分傳輸) ?
VCC
X
VCC1
隔離
X
X
X/
X/
Y
+
-
twist
接收端
发送端
发送端
传输线中之信号 接收端
™
发送端將输入信号X转换成X及X/輸出
X
X
X/
Y
™
接收端將输入之X及X/比较后得Y
0
0
1
0
™
真值表如左图
1
1
0
1
™
以DIFFERENTIAL 方式传送可有效消除共
模干扰
卡片安装与信号连接 – 3
脉冲输出控制连线
„為了消除共模雜訊
noise
input signal A
input signal A
input signal A
read signal A
read signal A
卡片安装与信号连接 – 3
脉冲输出控制连线
Open Collector TTL Output
卡片安装与信号连接 – 3
脉冲输出控制连线
Output Pulse Type Setting – JP1~8
卡片安装与信号连接 – 4
Board ID
Board ID Setting – SW1
卡片安装与信号连接 -- 5
EMG Setting – JP9
卡片安装与信号连接 -- 6
Signal Input ( nLMT+,nLMT-,nIN3~1)
Notes :
The response time of this circuit should take about 0.2 ~ 0.4 msec
because of the delay of photo coupled and RC filter.
卡片安装与信号连接 – 7
数字量输入
•This signal must be supplied from the external source DC12 ~ 24V.
•The response time of this circuit should take about 0.25 msec
because of the delay of photo coupled and RC filter.
•If PCI-1240 is driving pulses output, the output pulses will stop
immediately when nALARM active.
卡片安装与信号连接 – 8
数字量输出
1. each output signal is OFF status after system reset.
2. sink current of each input is 200mA max.
3. Adding a diode is required when the load is a relay.
卡片安装与信号连接 – 9
编码器的输入
To approach high speed(1MHz) application, the PCI-1240 use
high speed photo coupler for isolation.
卡片安装与信号连接 – 编码器的接
线方式
differential-output line driver
the connection for open collector output encoder
* 10 – 30DC input
卡片安装与信号连接 -1
2
3
4
5
6
7
8
9
10
CN2
KR-5M
CN1
Hand wheel
and Jog
1 2 3 45 6
2.2K
Y-Axis
Limit+
Home
Limit-
DB15M
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
+24V GND
DC
24V
Limit+
X-Axis Home
Limit-
2.2K
1
2
3
4
5
6
7
8
9
10
1 2 3 4 5 6
CN1
CN2
KR-5M
DB15F
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
1 Brown
/ +24V
2 Red
/ GND
3 Orange
/ Phase A
4 Pink
/ Phase B
5
6
7 Light Green
/ Axis 1
8 Blue
/ Axis 2
9
10
11
12
13
14
15
16 Orange_White / GND
17 Orange_Black / Emergency
18 Pink_Black
/ GND
19 Yellow_Black / SW1
20 Green_White / SW2
21 Green_Black /SW Com.
22
23
24
25
connected to MINAS A series AC servo
motor
•The servo drive must be set in pulsecontrol drive mode
•the type of pulse input is CW/CCW
mode.
Integrate a MA system
ƒ
How to make out motor driver type?
–
–
–
–
–
–
–
这可以由马达驱动器(Motor Driver)上的标示得知.
例如 AC Servo or AC Stepping. 以目前市场上占有
率较高的品牌及机型, 其归纳如下
For Servo Motor:
MITSUBISHI --- MELSERVO-J2-Super Series.
PANASONIC --- MINAS-A Series
YASKAWA --- ΣⅢ Series
For Stepping Motor:
ORIENTAL ---
Integrate a MA system
What is Pulse-type Servo Motor Driver?
–
–
–
–
–
许多伺服电机支持多种控制模式, 以三菱J2为
例, 它就有支持下列三种
位置控制(Position control mode)
速度控制(Speed control mode)
转矩控制(Torque control mode)
當设定成”位置模式(Position control mode)
时, 就可以用CW/CCW或Pulse/Direction的
脉冲信号控制其正/反转.
内容:
1.
2.
3.
4.
5.
6.
7.
PC-Based 运动控制系统概述
PCI-1240技术特性
PCI-1240的硬件安装和使用
1240的驱动安装和测试
采用VB, VC 编写运动控制程序
PCI-1240在MA的应用案例
研华的其他运动控制产品
驱动程序安装
驱动程序安装
•It has specific driver and is separated from the original
DA&C device manager.
•The latest version is V2.1.12.001
•It supports Win98/NT and Win2000 operation system.
•LabVIEW driver is available in our web site for free
download.
Utility之操作
Utility之操作-概览
按下 开始Æ程序ÆAdvantech AutomationÆMotionÆPCI-1240ÆPCI1240 Utility后可以启动这个Utility. 画面以及主要功能如下图所示:
Utility之操作-Board ID
操作步驟(Procedure):
Step 1: 选取卡片按下
键盘后会出现所有已经安装的运动控制卡
点选一张卡片操作(只能单选).
Utility之操作-Input Status
Step 2: 检查I/O的状态
按下
确认I/O无误, 才能进行马达的运动. 当极限开关或者紧急停止开
关有信号输入时, PCI-1240将无法输出脉冲
A5090m.lib
如果所连接的电机为伺服电机,必
须先Servo On.
可以OUT6连接Servo On, 再启动
OUT6
Utility之操作-test
STEP 3: 操作马达执行简单的运动测试.
按下
出現操作如下
Utility之操作-运动方式
运动方式包括单轴的回原点(Home),
连续运转(Continue Drive) 及
点对点运转(Point to Point Drive)
多轴间的线性差补(Line Profile Drive)
或圆弧差补( Arc Profile Drive).
Utility之操作-参数设定
Step 4: 参数设定(Parameter Setting--Speed)
按下
用以调整
运动参数
(Group 1)
Utility之操作-参数设定
参数设定(Parameter Setting—I/O)
Set up the Input/Output pin Operation Mode(Group 2)
How to use the utility?
参数设定(Parameter Setting — Home Function)
Set the the
Home type
Within 4
phase
How to use the utility?
Step 5: 数据图表(Profile Monitor)
Click
Button to
launch
This tools as
right
Diagram
How to use the utility?
数据图表(Profile Monitor)
Velocity
Monitor.
最好的助手 --- DLL Driver介紹
ƒ
Visual C++
Console mode, MFC
mode
ƒ
Visual Basic
ƒ
BC++ Builder
Console mode, VCL
mode
现场演示
内容:
1.
2.
3.
4.
5.
6.
7.
PC-Based 运动控制系统概述
PCI-1240技术特性
PCI-1240的硬件安装和使用
1240的驱动安装和测试
采用VB,VC 编写运动控制程序
PCI-1240在MA的应用案例
研华的其他运动控制产品
例子程序
ƒ
ƒ
ƒ
ƒ
ƒ
Visual C++
Console mode, MFC mode
Visual Basic
BC++ Builder
Console mode, VCL mode
LabView
组态王支持
例子程序- Console Mode
ƒ
ƒ
ƒ
ƒ
ƒ
ƒ
ƒ
ƒ
ƒ
ƒ
ƒ
P1240Arc - Demo program for X & Y-Axis arc interpolation function
with
center/end position parameter.
P1240ArcTheta - Demo program for X & Y-Axis arc interpolation
function
with center/angle parameter.
P1240Cmove - Demo program for X-Axis continuous moving function.
P1240ContiDrive - Demo program for X & Y-Axis continuous
interpolation
function.
P1240DI - Demo program for X-Axis digital input function.
P1240DO - Demo program for X-Axis digital output function.
P1240Ext - Demo program for X-Axis external mode (jog,handwheel).
P1240Home - Demo program for return home function.
P1240Irq - Demo program for checking event function.
P1240Line - Demo program for X & Y-Axis linear interpolation function.
P1240Ptp - Demo program for XYZU-Axis point to point function.
例子程序– Visual Basic / Visual C
MFC / BCB VCL
ƒ
BasicDrive - Demo program for PCI-1240 basic motion
control
functions including 2-Axis linear/arc
interpolation,
continuous moving and point to point function.
ƒ
ContiDrive - Demo program for PCI-1240 continuous
interpolation function combined with 2/3-Axis
linear interpolation and 2-Axis arc
interpolation.
例子程序– LabView
ƒ
ƒ
ƒ
ƒ
ƒ
ƒ
BoardSelect.vi – select the boards
PointToPoint.vi – test point to point function
LineInterpolation – 2/3 line interpolation
ArcInterpolation – 2-Axis arc interpolation
ContiDrv -- Demo program for PCI-1240
continuous interpolation function combined
with 2/3-Axis linear interpolation and 2-Axis
arc interpolation.
Home.vi – test the home function
Point to Point
P1240MotDevOpen
P1240MotDevOpen
Call
CallParameter
ParameterSetting
Setting
functions.
functions.
P1240MotPtp
P1240MotPtp
Or
Or
P1240MoveAbs
P1240MoveAbs
Or
Or
P1240MoveIns
P1240MoveIns
P1240MotDevClose
P1240MotDevClose
Linear Interpolation
P1240MotDevOpen
P1240MotDevOpen
Call
CallParameter
ParameterSetting
Setting
functions.
functions.
P1240MotLine
P1240MotLine
P1240MotDevClose
P1240MotDevClose
Circle/Arc Interpolation
P1240MotDevOpen
P1240MotDevOpen
Call
CallParameter
ParameterSetting
Setting
functions
functions. .
P1240MotArc
P1240MotArc
Or
Or
P1240MotArcTheta
P1240MotArcTheta
Or
Or
P1240MoveCircle
P1240MoveCircle
P1240MotDevClose
P1240MotDevClose
Continue Move
P1240MotDevOpen
P1240MotDevOpen
Call
CallParameter
ParameterSetting
Setting
functions.
functions.
P1240MoveLineContinuous
Or
P1240MoveArcContinuous
P1240MotDevClose
P1240MotDevClose
Example flow chart
P1240MotDevOpen
P1240MotDevOpen
Call
CallParameter
ParameterSetting
Setting
functions
functions. .
Run
Run 99time
time
P1240MotArcTheta
P1240MotArcTheta
P1240MotAxisBusy
P1240MotAxisBusy
Whether
Whetherdo
doagain?
again?
N
P1240MotDevClose
P1240MotDevClose
Y
相对坐标和绝对坐标
内容:
1.
2.
3.
4.
5.
6.
7.
PC-Based 运动控制系统概述
PCI-1240技术特性
PCI-1240的硬件安装和使用
1240的驱动安装和测试
采用VB, VC 编写运动控制程序
PCI-1240在MA的应用案例
研华的其他运动控制产品
应用案例-假肢制造
ƒ
ƒ
ƒ
假肢接受控计算机辅助制
造系统
民政部假肢研究所和某大
学联合开发了假肢接受控
计算机辅助设计和制造系
统
主要功能:实现主轴、Y
轴进给、Z轴进给的联
动,自动控制加工过程,
以及保证加工的精确定位
及系统的综合保护
假肢制造
ƒ
ƒ
ƒ
ƒ
ƒ
采用了国产的五相混合式步进机,并进行了动态及静态实验,在此基
础上合理地确定了电机的功率并选择了相应的驱动器
步进机的运动控制采用研华PLC-839/PCI-1240多功能运动控制卡,充
分利用了它的保护、定位功能及I/O接口,大大简化了系统的结构,提
高了系统的可靠性
控制系统以高性能的工控机AWS-8248为核心,通过控制研华PLC839/PCI-1240多功能运动控制卡,控制三个步进机的进给,采用软件
方式实现三轴联动
铣刀电机和风机由继电器直接控制,其故障信号通过光电隔离送到
PLC-839/PCI-1240的I/O口。
加工零点由高精度的光电传感器定位,其信号送到PLC-839的ORG端,
这样可以实现非计算机干预的精确定位。
内容:
1.
2.
3.
4.
5.
6.
7.
PC-Based 运动控制系统概述
PCI-1240技术特性
PCI-1240的硬件安装和使用
1240的驱动安装和测试
采用VB,VC 编写运动控制程序
PCI-1240在MA的应用案例
研华的其他运动控制产品
PCI-1240U 功能及規格介紹
Features
•
独立4轴电压型伺服电机控制
•
支持手轮和FOG功能
•
2/3轴线性插补功能
•
2/3轴圆弧插补功能
•
•
连续插补功能
连续速度控制
Specifications
ƒ
最大DDA指令:210-15脉冲
ƒ
DDA周期 :25us-3350ms可编程
ƒ
DA转换器:4通道16位
ƒ
三种输出脉冲类型:加/减、脉冲/方向、A/B相位
ƒ
三种编码器输入类型:加/减、脉冲/方向、A/B相位
PCI-1241功能及規格介紹
Features
•
独立4轴电压型伺服电机控制
•
支持手轮和FOG功能
•
2/3轴线性插补功能
•
2/3轴圆弧插补功能
•
•
连续插补功能
连续速度控制
Specifications
ƒ
最大DDA指令:210-15脉冲
ƒ
DDA周期 :25us-3350ms可编程
ƒ
DA转换器:4通道16位
ƒ
三种输出脉冲类型:加/减、脉冲/方向、A/B相位
ƒ
三种编码器输入类型:加/减、脉冲/方向、A/B相位
PCI-1242 功能及規格介紹
Features
•
4轴脉冲型步进电机控制卡
•
线性/螺旋插补功能
•
2/3轴圆弧插补功能
•
可编程T/S曲线加速/减速
•
异步/同步4轴电机控制
•
慢进功能
•
13个专用输入和5个专用输出
•
连续插补功能
Specifications
ƒ
每轴4MPPS脉冲输出
ƒ
3种输出脉冲类型:PULSE/DIR,CW/CCW,AB
ƒ
5通道/ 2MHz编码器输入
ƒ
3种编码器输入类型:A/B 相,PULSE/DIR, CW/CCW
PCI-1243U - 4轴步进电机控制卡
Features
•
独立4轴步进电机控制
•
400k脉冲输出速率
•
•
•
光隔离输出
T型,斜波加减速
1500Vrms系统隔离
Specifications
•
输入范围5V-30V
•
每轴5路用于行程开关的隔离数字量输入
•
最大16KPPS脉冲输出
PCI-1261 功能及規格介紹
Features
•
6轴脉冲型步进电机控制卡
•
线性/螺旋插补功能
•
2/3轴圆弧插补功能
•
可编程T/S曲线加速/减速
•
异步/同步6轴电机控制
•
慢进功能
•
19个专用输入和7个专用输出
•
连续插补功能
Specifications
ƒ
每轴1PPS-4MPPS脉冲输出
ƒ
3种输出脉冲类型:PULSE/DIR,CW/CCW,AB
ƒ
6通道/ 2MHz编码器输入
ƒ
3种编码器输入类型:A/B 相,PULSE/DIR, CW/CCW
PCL-839+-3轴步进电机控制卡
Features
•
独立3轴步进电机控制
•
线性或圆弧插补功能
•
•
光隔离输出
T型,斜波加减速
Specifications
•
可直接访问卡上控制器的寄存器
•
每轴5路用于行程开关的隔离数字量输入
•
最大16KPPS脉冲输出
PCI-1784-4轴正交编码器和计数器卡
Features
•
•
•
•
•
•
Specifications
ƒ
多中断源选择
ƒ
多锁存源选择
ƒ
隔离DI输入
ƒ
可选采样速率的4级数字滤波器
4个32位加/减计数器
单端或差分输入
卡上带宽范围时间选择器的8位定时器
每个编码器循环x1, x2, x4计数
脉冲/方向和加/减计数器
光隔离电压2,500 VDC
PCL-833-3轴正交编码器和计数器卡
Features
•
1.0MHz最大正交输入频率
•
2.4 MHz最大输入脉冲频率
•
24位计数器(可级联为48位)
•
4级数字滤波器
•
光隔离2500 VRMS
Specifications
ƒ
多中断源选择
ƒ
多锁存源选择
ƒ
隔离DI输入
ƒ
可选采样速率的4级数字滤波器
Your Lasting Partner for PC-based Motion
Applications