ABB MFE190驱动器与博途V15的故事


ABB MFE190伺服驱动器与西门子博途V15.1之间那些不得不说的小秘密。

先列一下硬件和环境:

名称品牌型号
1伺服驱动器ABBMFE190-04UP-06A0-2+N8020
2伺服电机中安佰特BTS070-04R2A2-EXD
3PLCSiemens6ES7 215-1AG40-0XB0
4HMISiemens6AV2124-0GC01-0AX0
5接近开关SICK1M30-10B-N-ZWO
6隔离栅LANBAOKN01M-DSJ
7交换机TP-LINKTL-WR742N(其实是随手捡来的路由器)
8工控机Lenovo懒得查(反正也无所谓)
9开关电源明纬S-100-24(压箱底老旧电源一块)
10电缆未知控制电缆(柜顶上长期吃灰的黑线)
11网络电缆AMPCAT5E(没现成的,只好自己掐)

名称型号版本
1系统Windows10 20H219042.867
2调试软件ABB Mint WorkBenchBuild 5864 PreReq
3组态软件Siemens TIA PortalSTEP 7 Pro WINCC Adv V15.1
4GDI程序Mint2.30
5GSDMicroFlex e1905900.4-20190326

现在开始嗨起来!

初期配置

硬件连接

把调试电脑、伺服驱动器、PLC、HMI 等需要用到的设备都连到同一个交换机上,驱动器接E3 口。驱动器X1A 接口:L1 接L;L2 接N。X1B 接口接电机UVW。X8 接口接电机编码器。X3 接数字量输入输出(输入电源24V),DI3 接零位接近开关,DI2 接正限位,DI1 接负限位(接法不固定)。接线如图:

驱动器设置

安装ABB Mint WorkBench Build 5864 PreReq 软件。把电脑IP 设置为192.168.0.X/24,(伺服驱动器默认192.168.0.1 所以别用)。运行Mint Sidebar,软件会自动搜索到e190驱动器。如果没搜到,点击设置按钮,在网络适配器处勾选电脑使用的网卡,如图:

在设置页面继续下拉,找到“显示打开按钮于”,勾选“网页”和“调试日志”,如图:

返回控制器列表界面,点击控制器右下角齿轮右侧的浏览器按钮,进行驱动器的名称与 IP 设置:

在打开的浏览器页面依次点击 Menu 、 PROFINET:

在 PROFINET 设置界面分别为改驱动器分配名称和 IP (有多个驱动器时名称要唯一):

Mint配置

返回控制器列表界面,点击控制器右下角齿轮按钮,会打开 Workbench 的界面。在 Help菜单中可将语言修改为中文。
点击左侧菜单中的“编辑 & 调试”,点击左上角“打开”,选择“ Generic Drive ControlInterface 2.30.mnt ”文件。点击右上角 STOP 按钮右侧的“控制参考源”,将其修改为“ Direct ”:

修改 M int 程序:

可能需要修改的参数:

参数名描述
_bRemoteEnable0=不能通过 PLC 使能; 1= 可以通过 PLC 使能
_fScale标定因数,影响位置、速度、加速度的标定。例如位置:4096 表示每单位 4096 个脉冲(1圈); 131072 =32 圈单位
_nHomeType回零方式。见帮助(F1)的 DS 402 homing 页面或附表
_nHomeInput零位接近开关输入。-1为禁用,1~3对应数字量输入DI1~DI3
_nFwdLimit正限位接近开关输入。-1为禁用,1~3对应数字量输入DI1~DI3
_nRevLimit负限位接近开关输入。-1为禁用,1~3对应数字量输入DI1~DI3
_nMotorDirection电机方向。0=正转,1=反转

赠品:回零方式:

描述参数
0Do nothing.
1Home on negative limit switch and index pulse._htDS402_METHOD_1
2Home on positive limit switch and index pulse._htDS402_METHOD_2
3Home on positive home switch (inactive) and index pulse._htDS402_METHOD_3
4Home on positive home switch (active) and index pulse._htDS402_METHOD_4
5Home on negative home switch (inactive) and index pulse._htDS402_METHOD_5
6Home on negative home switch (active) and index pulse._htDS402_METHOD_6
7Home on home switch (inactive) and index pulse with positive initial direction. Reverse if positive limit switch hit._htDS402_METHOD_7
8Home on home switch (active) and index pulse with positive initial direction. Reverse if positive limit switch hit._htDS402_METHOD_8
9Home on opposite home switch (active) and index pulse with positive initial direction. Reverse if positive limit switch hit._htDS402_METHOD_9
10Home on opposite home switch (inactive) and index pulse with positive initial direction. Reverse if positive limit switch hit._htDS402_METHOD_10
11Home on home switch (inactive) and index pulse with negative initial direction. Reverse if negative limit switch hit._htDS402_METHOD_11
12Home on home switch (active) and index pulse with negative initial direction. Reverse if negative limit switch hit._htDS402_METHOD_12
13Home on opposite home switch (active) and index pulse with negative initial direction. Reverse if negative limit switch hit._htDS402_METHOD_13
14Home on opposite home switch (inactive) and index pulse with negative initial direction. Reverse if negative limit switch hit._htDS402_METHOD_14
17Home on negative limit switch._htDS402_METHOD_17
18Home on positive limit switch._htDS402_METHOD_18
19Home on positive home switch (inactive)._htDS402_METHOD_19
20Home on positive home switch (active)._htDS402_METHOD_20
21Home on negative home switch (inactive)._htDS402_METHOD_21
22Home on negative home switch (active)._htDS402_METHOD_22
23Home on home switch (inactive) with positive initial direction. Reverse if positive limit switch hit._htDS402_METHOD_23
24Home on home switch (active) with positive initial direction. Reverse if positive limit switch hit._htDS402_METHOD_24
25Home on opposite home switch (active) with positive initial direction. Reverse if positive limit switch hit._htDS402_METHOD_25
26Home on opposite home switch (inactive) with positive initial direction. Reverse if positive limit switch hit._htDS402_METHOD_26
27Home on home switch (inactive) with negative initial direction. Reverse if negative limit switch hit._htDS402_METHOD_27
28Home on home switch (active) with negative initial direction. Reverse if negative limit switch hit._htDS402_METHOD_28
29Home on opposite home switch (active) with negative initial direction. Reverse if negative limit switch hit._htDS402_METHOD_29
30Home on opposite home switch (inactive) with negative initial direction. Reverse if negative limit switch hit._htDS402_METHOD_30
33Home on index pulse with negative initial direction._htDS402_METHOD_33
34Home on index pulse with positive initial direction._htDS402_METHOD_34
35Home on current position (obsolete)._htDS402_METHOD_35
36Home with touch probes._htDS402_METHOD_36
37Home on current position and set as home position._htDS402_METHOD_37

修改完成后点击编译、下载并运行。运行成功后右侧显示“运行中”。然后点击右上角的“存储驱动器参数”按钮 (重要!)

博途配置

组态配置

运行博途软件,新建项目,添加 PLC 与触摸屏,并为其添加子网并分配 IP 。点击“选项管理通用站描述文件( GSD )”,导入与驱动器固件版本相符的 GSD 文件:

打开设备与网络界面,在右侧硬件目录找到 MicroFlex e190 ,在信息中选中与驱动器固件一致的版本号,将其拖入组态界面,拖拽 e190 绿色网络接口将其接入网络:

双击 e190 打开设备视图。右侧模块列表应出现分配好的 GDI 变量(右侧有自动分配的地址)。打开 e190 属性 以太网地址。 在 IP 地址处填写前面步骤设置的 IP 。取消勾选下方“自动生成 PROFINET 设备名称”,并将设备名称修改为前面步骤设置的设备名:

如果上一步模块中没有 GDI 变量,则需要按下图手动添加变量( 记下起始地址):

PLC 数据准备

打开右侧“库”界面,点击“打开全局库”按钮,导入“ABB Motion GDI Library”库文件。将模板副本中的“Entire GDI Program Blocks Library”拖拽到左侧 PLC 的程序块中:

添加成功后程序块中出现Library 分组,其中包含一些函数块和一个数据块“GDI _Global_Varibles”。在右侧库中展开 ”Data Types”,将下面的5个项目依次拖拽到左侧PLC下的“PLC数据类型”中:

在“PLC变量”中新建变量表,添加两个变量。两个变量对应前面步骤中 e190 的 GDI 变量。数据类型分别为“AxisInputs”与“AxisOutputs”:

以上两个变量地址为 GDI 变量的起始地址。如之前步骤中变量是手动添加的,地址则为手动设置的起始地址:

将用到的变量表与数据块编译一次。

PLC编程

打开数据块主循环(OB1)。将 Library 组中的 “GDI_DATAINTERFACE_PNET “拖至程序中,Ptr _In 与 Ptr_Out 分别为上一步创建的变量。Axis 参数为导入的数据块“GDI _Global_Varibles”中的变量 Axis1 。此功能块的作用为存储轴变量:

将 Library 组中的 “GDI_ POWER“拖入程序中, Enable 参数为驱动器使能:

将程序下载至 PLC ,监控数据块“ GDI_Global_Varibles” 中 的 Axis1 变量,出现电流数据表示通讯成功:

操作电机

函数块使用

控制伺服电机的所有功能均通过函数块实现。函数块结构如图,左侧为输入参数,右侧为输出状态:

左下角的 Axis 参数用于选择轴,存在多个轴时可在“GDI_Global_Variables”数据块中建立多个轴变量,数据类型为 ”TGDIAxisRef“。
函数块的第一个输入参数为使能,类型为布尔值,上升沿触发。部分状态函数块,如电源 Power 或点动 Jog 为高电平触发。
输入参数说明:

参数名类型说明
PositionReal位置。绝对定位或回零设置的位置值
VelocityReal最高运动速度
AccelReal加速度
DecelReal减速度
AccelJerkReal加加速度
DecelJerkReal加加速度
DistanceReal相对定位增量
ExecuteBool功能使能

输出状态中“Done”为状态,为 1 表示函数块已执行。“Busy”为忙碌状态,1 为忙碌。“Error”为错误状态,1 为错误,“ErrorID”为错误状态码,”ErrorDesc”为错误信息描述。

函数块功能

各函数块功能如下表:

名称描述
GDI_DATAINTERFACE_PNET将轴变量与IO变量连接起来,需周期调用
GDI_POWER使能轴
GDI_CLEAR轴紧急停止并停止所有在进行的运动,轴保持使能
GDI_RESET复位轴错误
GDI_STOP轴以设定的减速度停止
GDI_HOME按照设定的回零方式回零,结束后将位置设为给定值
GDI_SETPOSITION设定位置
GDI_FIND_END_STOP硬碰限位回零
GDI_JOG点动
GDI_MOVEABSOLUTE绝对定位
GDI_MOVERELATIVE相对定位
GDI_INCA绝对增量定位(定位中途可修改目标位置、速度等)
GDI_INCR相对增量定位(定位中途可修改目标位置、速度等)
GDI_SPEEDREF切换为速度控制
GDI_TORQUEREF切换为转矩控制
GDI_FOLLOW跟随主编码器

Powered by WordPress. Theme by Alx.