基于OPC UA 的运动控制读书笔记(1)

      最近一段时间集中研究OPCUA 在机器人控制应用中应用的可能性。这个话题自然离不开运动控制。

    笔者对运动控制不是十分了解。于是恶补EtherCAT 驱动,PLCopen 运动控制的知识,下面是自己的读书笔记和实现OPCUA /IEC61499 运动控制器的实现方案设想。

        为什么要研究OPCUA /IEC61499 的运动控制?PLCopen 对运动控制实现了标准化功能块库的工作,使PLC 能够实现运动控制器的功能。不过,IEC 61131 4 定义了一个集中式自动化系统。缺乏分布式控制的概念,每个控制都需要单独考虑。另一方面,每个厂商的PLC 运动控制功能块库或多或少地有些差别,使用的运动控制总线也不相同。OPCUA /IEC61499模型能够弥补这方面的不足。

PLCopen 功能块库

   早期的运动控制是使用运动控制器实现的,PLCopen 提供了运动控制的功能块库,从而使PLC 能够成为“运动控制器”。

        PLCopen 提供了运动控制功能块库。PLC 厂商提供符合PLCopen 规范的运动控制功能块库,用户可以使用标准的功能块实现运动控制应用。 

结构数据类型

AXIS_REF

        几乎所有的运动控制功能块都使用AXIS_REF 数据类型,用于描述轴的属性,不同的制造商规定了不同轴的属性,其包含的变量可多大数百个,主要包括:

  • 基本信息
  • 管理信息
  • 运动参数信息
  • 出错信息
  • 其它信息

        根据 PLCopen 的定义,AXIS_REF结构的内容特定于每个制造商。在 ISG 实现的版本中,AXIS_REF包含轴索引的变量hli_axis_idx,可以使用该变量对 HLI 上的轴特定区域进行寻址。 在OPCUA/IEC61499 平台上,可以使用OPCUA 构建轴模型,而AXIS 可以是轴的OPCUA 节点路径(Path String)。

 Acceleration Deceleration Jerk

 加速度 Acceleration

减速度 Deceleration

加加速度 Jerk

Jerk是加速度对时间的导数,单位是m/s3 ,即米/秒的3次方。Jerk可以看做是加速度的变化率。

一些例子:

PLCopen功能块

单轴运动功能块

MC_Power

MC_Power开关Axis 指定的驱动器的电源。

VAR_IN_OUT

Variable name

Data type

Description

Axis

AXIS_REF

Axis reference

VAR_INPUT

Variable name

Data type

Description

Enable

BOOL

Must have the value TRUE otherwise power cannot be switched on.

Enable_Positive

BOOL

Must have the value TRUE otherwise power cannot be switched on.

Enable only for positive motion direction is not supported.

Enable_Negative

BOOL

Must have the value TRUE otherwise power cannot be switched on.

Enable only for negative motion direction is not supported.

PowerDefaultState

MCV_DRIVE_
POWER_STATE

Function available for CANopen drives:

The function block sets the drive to this state as long as the “Status” output indicates FALSE, i.e. at least one of the Enable... inputs is assigned the value FALSE (see table below). The input is assigned mcvPowerStateDefault as default value

VAR_OUTPUT

Variable name

Data type

Description

Status

BOOL

TRUE indicates that the drive has torque applied and is in control mode.

Error

BOOL

Indicates whether an error occurred in the FB.

ErrorID

WORD

Error identifier

DriveEnabled

BOOL

TRUE indicates that the drive is ready for enabling power.

DriveReady

BOOL

TRUE indicates that the drive is being controlled.

PowerState

MCV_DRIVE_
POWER_STATE

State in which the drive is currently (see table below).

MC_Home

VAR_IN_OUT

Variable name

Data type

Description

axis

AXIS_REF

Axis reference

VAR_INPUT

Variable name

Data type

Description

Execute

BOOL

Homing is commanded on a rising edge at the input.

CamSignal

BOOL

Signal to command adoption of the homing position. For further application notes, see Section 2.8.1.

VAR_OUTPUT

Variable name

Data type

Description

Done

BOOL

When TRUE, homing is completed and the axis is in “Standstill” state.

CommandAborted

BOOL

TRUE indicates that the command was aborted by another command.

Error

BOOL

Is TRUE when an error occurs in the FB.

ErrorID

WORD

Error code.

MC_MoveAbsolute

VAR_INPUT

Variable name

Data type

Description

Execute

BOOL

A rising edge at the input commands the motion to an absolute position.

Position

LREAL

Target position of the motion,
Value range [-2147483648.0, 2147483647.0]
Default unit [0.1µm or 10-4 °]

Velocity

LREAL

Maximum velocity of the motion. This value must be specified positive. The velocity is not necessarily reached.

Value range [1.0, 2147483647.0]
Default unit [1µm/s or 10-3 °/s]

Acceleration

LREAL

Acceleration value. This value must be specified positive.

Value range [0.0, 2147483647.0]
Default unit [1mm/s2 or 1°/s2]

Deceleration

LREAL

Deceleration value. This value must be always be specified positive.

Value range [0.0, 2147483647.0]
Default unit [1mm/s2 or 1°/s2]

Jerk

LREAL

Jerk value. This value must be always be specified positive.

Value range [0.0, 2147483647.0]
Default unit [1mm/s3 or 1°/s3]

Direction

INT

Direction in which the motion is started. One of the 4 values:

   1     positive direction

   2     shortest path

   3     negative direction

   4     current direction

Specifying the direction is effective only if a modulo coordinate system was defined for the axis in the axis-specific machine data using parameter kenngr.achs_mode (P-AXIS-00015) since the direction is always unambiguous with linear axes.

VAR_OUTPUT

Variable name

Data type

Description

Done

BOOL

The axis is within a range close to the target position. The range is specified by the parameter getriebe[...].window (P-AXIS-00236) of the axis-specific machine data.

CommandAborted

BOOL

TRUE indicates that the command was aborted by another command.

Error

BOOL

Is TRUE if an error occurs in the FB.

ErrorID

WORD

Error identifier

Position 

        以用户自定义单位表示的目标绝对位置。ISG Kernel 中为0.1 µm 。

MC_MoveAdditive

VAR_IN_OUT

Variable name

Data type

Description

Axis

AXIS_REF

Axis reference

VAR_INPUT

Variable name

Data type

Description

Execute

BOOL

The motion starts on the rising edge of this input signal.

Distance

LREAL

Target position of the motion,

Value range [-2147483648.0, 2147483647.0]
Default unit [0.1µm or 10-4 °]

Velocity

LREAL

Maximum velocity of the motion. This value must be specified positive. The velocity is not necessarily reached.

Value range [1.0, 2147483647.0]
Default unit [1µm/s or 10-3 °/s]

Acceleration

LREAL

Acceleration value. This value must be specified positive.

Value range [0.0, 2147483647.0]
Default unit [1mm/s2 or 1°/s2]

Deceleration

LREAL

Deceleration value. This value must be always be specified positive.

Value range [0.0, 2147483647.0]
Default unit [1mm/s2 or 1°/s2]

Jerk

LREAL

Jerk value. This value must be always be specified positive.

Value range [0.0, 2147483647.0]
Default unit [1mm/s3 or 1°/s3]

VAR_OUTPUT

Variable name

Data type

Description

Done

BOOL

The axis is within a range close to the target position. The range is specified by the parameter getriebe[...].window (P-AXIS-00236) of the axis-specific machine data.

CommandAborted

BOOL

TRUE indicates that the command was aborted by another command.

Error

BOOL

Is TRUE if an error occurs in the FB.

ErrorID

WORD

Error identifier

MC_MoveRelative

VAR_IN_OUT

Variable name

Data type

Description

Axis

AXIS_REF

Axis reference

VAR_INPUT

Variable name

Data type

Description

Execute

BOOL

The motion starts at the rising edge of this input signal.

Distance

LREAL

Relative distance for the motion.

Value range [-2147483648.0, 2147483647.0]
Default unit [0.1µm or 10-4 °]

Velocity

LREAL

Maximum velocity of the motion. This value must be specified positive. The velocity is not necessarily reached.

Value range [1.0, 2147483647.0]
Default unit [1µm/s or 10-3 °/s]

Acceleration

LREAL

Acceleration value. This value must be specified positive.

Value range [0.0, 2147483647.0]
Default unit [1mm/s2 or 1°/s2]

Deceleration

LREAL

Deceleration value. This value must be always be specified positive.

Value range [0.0, 2147483647.0]
Default unit [1mm/s2 or 1°/s2]

Jerk

LREAL

Jerk value. This value must be always be specified positive.

Value range [0.0, 2147483647.0]
Default unit [1mm/s3 or 1°/s3]

VAR_OUTPUT

Variable name

Data type

Description

Done

BOOL

The axis is within a range close to the target position. The range is specified by the parameter getriebe[...].window (P-AXIS-00236) of the axis-specific machine data.

CommandAborted

BOOL

TRUE indicates that the command was aborted by another command.

Error

BOOL

Is TRUE if an error occurs in the FB.

ErrorID

WORD

Error identifier

MC_MoveVelocity

VAR_INPUT

Variable name

Data type

Description

Execute

BOOL

The motion starts at the rising edge of this input signal.

Velocity

LREAL

Velocity value of endless motion. This value must be specified positive.

Value range [1. 0, 2147483647.0]
Default unit [1µm/s or 10-3 °/s]

Acceleration

LREAL

Acceleration value. This value must be specified positive.

Value range [0. 0, 2147483647.0]
Default unit [1mm/s2 or 1°/s2]

Deceleration

LREAL

Deceleration value. This value must be always be specified positive.

Value range [0. 0, 2147483647.0]
Default unit [1mm/s2 or 1°/s2]

Jerk

LREAL

Jerk value. This value must be always be specified positive.

Value range [0. 0, 2147483647.0]
Default unit [1mm/s3 or 1°/s3]

Direction

INT

Direction in which the motion is started. One of the 3 values:

Positive direction

 3     negative direction

  4     current direction

VAR_OUTPUT

Variable name

Data type

Description

InVelocity

BOOL

The commanded velocity was reached (for the first time).

CommandAborted

BOOL

TRUE indicates that the command was aborted by another command.

Error

BOOL

Is TRUE if an error occurs in the FB.

ErrorID

WORD

Error identifier

MC_Stop

VAR_IN_OUT

Variable name

Data type

Description

Axis

AXIS_REF

Axis reference

VAR_INPUT

Variable name

Data type

Description

Execute

BOOL

Starts the command on the rising edge.

Deceleration

LREAL

Deceleration value. This value must be always be specified positive.

Value range [0.0, 2147483647.0]
Default unit [1mm/s2 or 1°/s2]

Jerk

LREAL

Jerk value. This value must be always be specified positive.

Value range [0.0, 2147483647.0]
Default unit [1mm/s3 or 1°/s3]

VAR_OUTPUT

Variable name

Data type

Description

Done

BOOL

0 velocity was reached.

Caution: The "Done“ output merely indicates that the axis is stationary. The automatic axis state indicator remains initially in the STOPPING state. Only when the "Execute” input is also FALSE does the automatic axis state indicator change to the “STANDSTILL” state.

Error

BOOL

Is TRUE if an error occurs in the FB.

ErrorID

WORD

Error identifier

多轴功能块

Function block

PLC systems

3S

TwinCAT

KW

MC_AddAxisToGrp

SIMU
-

SIMU
-

SIMU

KUKA

MC_GrpContinue

SIMU
-

SIMU
-

SIMU

KUKA

MC_GrpDisable

SIMU
-

SIMU
-

SIMU

KUKA

MC_GrpEnable

SIMU
-

SIMU
-

SIMU

KUKA

MC_GrpHalt

SIMU
-

SIMU
-

SIMU

KUKA

MC_GrpInterrupt

SIMU
-

SIMU
-

SIMU

KUKA

MC_GrpReadActPos

SIMU
-

SIMU
-

SIMU

KUKA

MC_GrpReadError

SIMU
-

SIMU
-

SIMU

KUKA

MC_GrpReadInfo

SIMU
-

SIMU
-

SIMU

KUKA

MC_GrpReadStatus

SIMU
-

SIMU
-

SIMU

KUKA

MC_GrpReset

SIMU
-

SIMU
-

SIMU

KUKA

MC_GrpSetOverride

SIMU
-

SIMU
-

SIMU

KUKA

MC_GrpStop

SIMU
-

SIMU
-

SIMU

KUKA

MC_MoveCircAbs

SIMU
-

SIMU
-

SIMU

KUKA

MC_MoveCircRel

SIMU
-

SIMU
-

SIMU

KUKA

MC_MoveDirAbs

SIMU
-

SIMU
-

SIMU

KUKA

MC_MoveLinAbs

SIMU
-

SIMU
-

SIMU

KUKA

MC_MoveLinRel

SIMU
-

SIMU
-

SIMU

KUKA

MC_MovePath

SIMU
-

SIMU
-

SIMU

KUKA

MC_RemAxisFromGrp

SIMU
-

SIMU
-

SIMU

KUKA

MC_SetCartTrans

SIMU
-

SIMU
-

SIMU

KUKA

MC_SetKinTrans

SIMU
-

SIMU
-

SIMU

KUKA

MC_UngroupAllAxes

SIMU
-

SIMU
-

SIMU

KUKA

 主要的轴组功能块

        在运动控制应用中,往往是多个轴协同运动,并且在2D/3D坐标系中运动。PLCopen Part4 是2D/3D 的坐标运动,它将多个轴构成轴组。机械臂,机器人等应用应该是多轴应用。下面是一些轴组的运动控制功能块。

     这些轴组运动控制功能块看上去与单轴类似,其实内部实现要复杂的多。

MC_AddAxisToGrp

添加轴到轴组。

VAR_IN_OUT

Variable name

Data type

Description

AxesGroup

AXES_GROUP_REF

Axis group reference

axis

AXIS_REF

Axis reference

VAR_INPUT

Variable name

Data type

Description

Execute

BOOL

The axis is added to the axis group on a rising edge.

IdentInGroup

IDENT_IN_GROUP_REF

Identification of the axis in the axis group.

VAR_OUTPUT

Variable name

Data type

Description

Done

BOOL

TRUE indicates that axis was added to the axis group.

Busy

BOOL

TRUE indicates that the function block is executing a job.

Error

BOOL

TRUE indicates that an error occurred.

ErrorID

WORD

Error code.

 MC_MoveCircAbs

MC_MoveCircRel 

MC_MoveLinAbs 

 

MC_MoveLinRel 

MC_MovePath 

坐标系

机械坐标系(MCS)

相对于机械装置的坐标系统,通常是笛卡尔直角坐标系。

 产品坐标系(PCS)

也称为工件坐标系。它基于MCS ,经过坐标变换而成。

轴坐标系(ACS)

它基于物理轴,它们可以是笛卡尔坐标系,也可以是极坐标或者其它坐标系。

      坐标系转换应该是运动控制功能块内部实现。

实现平台架构 

        本文探讨基于OPCUA/IEC61499 平台实现PLCopen 运动控制信息模型和功能块的软件架构。最终目的是使用OPCUA 和IEC61499 平台实现机器人控制。

实验平台的功能

  • 使用OPCUA 构建轴模型
  • 使用IEC61499 构建运动控制功能块
  • 使用IEC61499 功能块网络实现运动控制应用

OPCUA 信息模型

参照笔者的博文:OPCUA 配套协议:机器人

IEC61499 功能块

        IEC61499 没有支持PLCopen 运动控制功能块。需要自行定义和开发类似于PLCopen 的运动控制FB。

        IEC61131-3 功能块是不分事件和数据的。当转换为IEC61499 功能块时,需要区分一下。如下图所示。

测试实例:

    在上面的网络图中,我们只是测试了MC_Home,MC_moveVelocity ,MC_Stop 三个功能块。 具体参数的设置参考松下A6 伺服驱动器。

系统架构

EtherCAT 伺服驱动器

        在这里,我们先以基于EtherCAT和CANopen 总线的伺服驱动器作为底层驱动,OPCUA/IEC61499 平台作为运动控制器。运动控制器是EtherCAT Master,伺服驱动器是Ether CAT的从设备。

实验中使用松下公司的A6 Ethercat伺服。

Ether CAT master

        使用开源项目 IgH EtherCAT Master。

架构

         在运动控制系统中最基本的控制对象是轴。轴同时对应于底层的伺服驱动器(我们假设一个伺服驱动器控制一个物理的轴)。多个轴的参数,控制命令和状态是通过EtherCAT PDO 级联方式传递的。所以轴具有承上启下功效的对象。

     在OPCUA /IEC61499 平台上,可以使用OPCUA 信息模型描述轴的模型,类似于AXIS_REF包含的属性。OPCUA /IEC61499平台运行时根据轴模型构建内部的AXIS 对象(AXIS Class)实例。AXIS 对象实现运动控制块到EtherCAT 网络的映射(Mapping)。使用IEC61499 功能块实现类似PLCopen的功能块。

    使用OPCUA 构建轴模型,运行时内部有对应的AXIS 对象。61499功能块修改AXIS 对象的参数,EtherCAT master 周期性地AXIS 与物理伺服驱动器交换数据。 

结束语

        运动控制是十分复杂的系统,涉及机械,电子控制的知识非常多。实现一个真正实用的运动控制功能块及其运行时是不容易的。需要时间与经验的积累。唯有前行,方得收获。

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mfbz.cn/a/191770.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

【Web】攻防世界Web_php_wrong_nginx_config

这题考察了绕过登录、目录浏览、后门利用 进来先是一个登录框,随便怎么输前端都直接弹窗 禁用js后再输入后登录 查看源码,好家伙,不管输什么都进不去 直接扫目录 访问/robots.txt 访问/hint.php 访问/Hack.php 抓包看一下 cookie里isLogin0…

kafka2.x常用命令:创建topic,查看topic列表、分区、副本详情,删除topic,测试topic发送与消费

原创/朱季谦 接触kafka开发已经两年多,也看过关于kafka的一些书,但一直没有怎么对它做总结,借着最近正好在看《Apache Kafka实战》一书,同时自己又搭建了三台kafka服务器,正好可以做一些总结记录。 本文主要是记录如…

【matlab程序】matlab画台风符号和实例应用

【matlab程序】matlab画台风符号和实例应用 没有看文献,不知道文献中的符号什么样子,据我理解为这样子的: 因此,按照自己的理解做了这期。 结果浏览: 台风符号一切可改,可细细改。可是我不发论文&#xf…

【Amazon】安装Cloudwatch代理监控EC2

文章目录 一、实验概要二、实验操作步骤2.1 创建 CloudWatch 代理运行角色2.2 安装 CloudWatch 代理软件包2.3 使用 CloudWatch代理收集指标2.4 CloudWatch指标收集确认 三、参考链接 一、实验概要 使用 CloudWatch 代理从 Amazon EC2 实例和本地服务器中收集指标、日志和跟踪信…

树套树 (线段树+splay)

树套树,就是线段树、平衡树、树状数组等数据结构的嵌套。 最简单的是线段树套set,可以解决一些比较简单的问题,而且代码根线段树是一样的只是一些细节不太一样。 本题中用的是线段树套splay,代码较长。 树套树中的splay和单一的…

jenkins流水线(pipline)实例

1、pipline 语法介绍 声明式的pipeline语法格式 1. 所有的声明都必须包含在pipeline{}中 2. 块只能有节段,指令,步骤或者赋值语句组成 3. 阶段:agent,stages,post,steps 4. 指令:environment&a…

2017年五一杯数学建模B题自媒体时代的消息传播问题解题全过程文档及程序

2017年五一杯数学建模 B题 自媒体时代的消息传播问题 原题再现 电视剧《人民的名义》中人物侯亮平说:“现在是自媒体时代,任何突发性事件几分钟就传播到全世界。”相对于传统媒体,以互联网技术为基础的自媒体以其信息传播的即时性、交往方式…

C#,数值计算——插值和外推,RBF_fn 与 RBF_gauss 的计算方法与源程序

1 文本格式 using System; namespace Legalsoft.Truffer { public interface RBF_fn { double rbf(double r); } } ---------------------------------------------- using System; namespace Legalsoft.Truffer { public class RBF_gauss : RBF…

如何通过nginx进行服务的负载均衡

简单介绍 随着互联网的发展,业务流量越来越大并且业务逻辑也越来越复杂,单台服务器的性能及单点故障问题就凸显出来了,因此需要多台服务器组成应用集群,进行性能的水平扩展以及避免单点故障的出现。应用集群是将同一应用部署到多台…

上海亚商投顾:北证50指数大涨 逾百只北交所个股涨超10%

上海亚商投顾前言:无惧大盘涨跌,解密龙虎榜资金,跟踪一线游资和机构资金动向,识别短期热点和强势个股。 一.市场情绪 沪指11月24日震荡调整,深成指、创业板指盘中跌超1%。北证50指数大涨超6%,北交所个股持…

虚拟化逻辑架构: LBR 网桥基础管理

目录 一、理论 1.Linux Bridge 二、实验 1.LBR 网桥管理 三、问题 1.Linux虚拟交换机如何增删 一、理论 1.Linux Bridge Linux Bridge(网桥)是用纯软件实现的虚拟交换机,有着和物理交换机相同的功能,例如二层交换&#…

redis key

不管是:规则,还是其他规则,定义好就可以了。其实没有太多要求的。 1)冒号分割类似那种yaml在客户端显示树结构 2)其他分割类似那种properties在客户端显示列表结构

数组栈的实现

1.栈的概念及结构 栈:一种特殊的线性表,其只允许在固定的一端进行插入和删除元素操作 进行数据插入和删除操作的一端称为栈顶,另一端称为栈底 栈中的数据元素遵守后进先出LIFO,(Last In First Out)的原则 压栈&…

【赠书第8期】工程效能十日谈

文章目录 前言 1 工程效能十日谈 1.1 制定清晰的目标和计划 1.2 引入先进的技术和工具 1.3 建立有效的沟通机制 1.4 灵活应对变化 1.5 确保资源充足 1.6 进行有效的风险管理 1.7 进行持续的监控和评估 1.8 优化团队合作 1.9 注重质量管理 1.10 进行项目总结和反思 …

PyEcharts-Faker的介绍

1 PyEcharts-Faker from pyecharts.faker import Faker方法属性说明对应内容Faker.clothes[“衬衫”, “毛衣”, “领带”, “裤子”, “风衣”, “高跟鞋”, “袜子”]Faker.values()[106, 111, 145, 33, 20, 138, 141]Faker.drinks[“可乐”, “雪碧”, “橙汁”, “绿茶”,…

【管理运筹学】背诵手册(六)| 图与网络分析(基本概念、最小支撑树问题、最短路问题)

六、图与网络分析 基本概念、术语 某个边的两个端点相同,称为环;两点之间有多于一条的边,成为多重边。一个无环、无多重边的图称为简单图,无环但允许有多重边的图称为多重图。 次:以 v i v_i vi​ 为端点的边的数目…

Redis序列化操作

目录 1.protostuff 的 Maven 依赖 2.定义实体类 3.序列化工具类 ProtostuffSerializer 提供了序列化和反序列化方法 4.测试 利用 Jedis 提供的字节数组参数方法,如: public String set(String key, String value) public String set(byte[] key…

IDEA DeBug

文章目录 01_Debug简介和意义02_IDEA中的Debug步骤03_跳转到当前代码执行的行04_步过调试的使用05_步入调试的使用06_强制步入调试的使用07_步出调试的使用08_回退断点调试的使用09_运行到光标处10_计算表达式11_条件断点12_多线程调试 01_Debug简介和意义 什么是程序DeBug&am…

人力资源管理后台 === 主页模块

目录 1.获取用户资料在Vuex中共享 2.显示用户头像和用户名 3.处理头像为空的场景 4.处理token失效的问题 5.调整下拉菜单,实现退出登录 6.修改密码功能实现 6.1-修改密码-弹出层 6.2-修改密码-表单结构 6.3-修改密码-表单校验 6.4-修改密码-确定和取消 7.…

设计模式精讲:掌握单例模式的实现与优化

掌握单例模式的实现与优化 一、引言:如何学习设计模式?二、前置知识:对象的创建的销毁2.1、拷贝构造2.2、拷贝赋值构造2.3、移动构造2.4、移动赋值构造 三、单例模式的定义四、单例模式的实现与优化4.1、版本一4.2、版本二4.3、版本三4.4、版…