MC

Keep Open and Learning
Post Reply
jiataifeng
Posts: 178
Joined: 30 Apr 2009 06:31

MC

Post by jiataifeng » 08 Sep 2018 20:14

reference click here
AXIS_REF

axis:
MC_POWER //MC_Power activates software enable for an axis.
MC_Reset //MC_Reset initially resets the NC axis.
MC_SetPosition //MC_SetPosition sets the current axis position to a parameterizable value.

Status and parameter:
MC_ReadActualPosition //read the current axis position
MC_ReadActualVelocity // it reads the actual axis position/velocity
MC_ReadAxisComponents //read information relating to the subelements encoder, drive and controller of an axis.
MC_ReadAxisError //reads the axis error of an axis.
MC_ReadBoolParameter //read a boolean axis parameter.
MC_ReadParameter //read an axis parameter.
MC_ReadParameterSet //read The complete parameter set of an axis
MC_ReadStatus //determines the current operating state of an axis and signals it at the block outputs.
MC_WriteBoolParameter write Boolean parameters for the axis
MC_WriteParameter //Axis parameters
MC_WriteBoolParameterPersistent
MC_WriteParameterPersistent

Touch probe:
MC_TouchProbe //records an axis position at the point in time of a digital signal, and is thus very accurate and independent of cycle time.
MC_AbortTrigger interrupts a measuring probe cycle initiated by MC_TouchProbe.


P2P motion function block:
MC_Halt //In contrast to MC_Stop, the axis is not locked against further movement commands.
MC_MoveAbsolute //Movement of the axis to an absolute position
MC_MoveAdditive //Relative motion in addition to the commanded position
MC_MoveContinuousAbsolute //At the target position a constant end velocity is reached, which is maintained
MC_MoveContinuousRelative //At the target position a constant end velocity is reached, which is maintained
MC_MoveModulo //execute a positioning operation, which refers to the modulo position of an axis.Read note here
MC_MoveRelative //Relative motion in addition to the current
MC_MoveVelocity //Endless motion at the specified speed
MC_Stop //stops an axis with a defined braking ramp and locks it against other motion commands

Superposition:
MC_AbortSuperposition //
MC_MoveSuperImposed //Relative motion in addition to a motion already active, read note here

Homing:
MC_Home //An axis reference run is carried out with the function block MC_Home

Manual motion:
MC_JOG // enables an axis to be moved via manual keys

Axis coupling:
MC_GearIn //activates a linear master-slave coupling (gear coupling)
MC_GearInDyn //upgraded version of MC_GearIn which make it possible to adjust the ratio dynamically.
MC_GearOut //deactivates a master-slave coupling.
MC_GearInMultiMaster //activate linear master/slave coupling (gear coupling) for up to four different master axes


MC_Aborting
MC_Direction
MC_JOGMODE_CONTINOUS
MC_Negative_Direction
MC_Phasing //Phase offset of couplings
MC_Positive_Direction
Last edited by jiataifeng on 12 Sep 2018 02:24, edited 26 times in total.

jiataifeng
Posts: 178
Joined: 30 Apr 2009 06:31

Re: MC

Post by jiataifeng » 10 Sep 2018 22:36

SAI: Single Axis Interpolator
CAM: camming

jiataifeng
Posts: 178
Joined: 30 Apr 2009 06:31

TwinCAT的结构

Post by jiataifeng » 10 Sep 2018 22:56

TwinCAT包含三层结构:PLC轴、NC轴和物理轴。

1. PLC轴 PLC程序中定义的轴变量称之为PLC轴。
1.png
1.png (4.01 KiB) Viewed 2081 times
2. NC轴 NC配置界面定义的AXIS叫做NC轴。
3.png
3.png (11.24 KiB) Viewed 2081 times
3. 物理轴/drive,在IO配置中扫描到的drive硬件叫做物理轴。
4.png
4.png (15.18 KiB) Viewed 2081 times


这三个轴的联系如下图:
5.png
5.png (26.03 KiB) Viewed 2081 times
PLC程序对电机进行控制时必须经过两个环节:PLC轴到NC轴,NC轴到物理轴。


在使用时,先将伺服与PC相连,再Restart TwinCAT (Config Mode),再scan I/O口的Devices,然后Active Configuration。
在MOTION中的Axes里会显示NC轴(通过扫描得到的NC轴会自动与物理轴相连),然后在NC轴的Online界面使能后可通过F1~F4实现点动的功能。
6.png
6.png (17.24 KiB) Viewed 2081 times
当需要PLC编程控制电机时,须在PLC中定义轴变量再与NC连接,编写程序则可实现PLC控制。

jiataifeng
Posts: 178
Joined: 30 Apr 2009 06:31

General rules for MC function blocks

Post by jiataifeng » 13 Sep 2018 22:22

英文原版
1. 唯一的输出状态: "Busy", "Done", "Error" and "CommandAborted" 有且只能有一个为ture

2. 初始状态:
a).如果当前状态为 NOT active, the outputs "Done", "InGear", "InVelocity", "Error", "ErrorID" and "CommandAborted" are reset with a falling edge at input "Execute". 但不影响命令的执行。 在执行中重置 "Execute" 可以保证在一个PLC周期中输出结果再次更新。
b).命令执行过程中,Execute多次触发,MC命令并不会被执行而且也不会有反馈。

3. 输入参数
a).只有在上升沿时传入的参数才会有效。要想传入新参数,只有等命令结束后重新触发,或者在命令执行过程中,包含新参数的命令实例被触发。
b).如果一个参数并未传入,那最后一次传入该参数的值将保留。首次调用的时候,系统参数有默认值。

4.位置和距离
a).位置参数是坐标系中的度量,距离只是一段测量值。

5.动力学参数
速度velocity, 速率speed
速度(Velocity) mm/s
加速度(Acceleration) mm/s2
急动度(jerk) mm/s3

6. 错误处理
如果发生错误,命令输出并不会被设置。
错误类型:
a). 命令出错
b). 通讯出错
c). axis出错
d). drive出错

7. 命令输出
命令执行成功,命令输出才会被设置。
如果一系列命令被触发,正在执行的命令被中断,那么第一个命令的输出将不会被设置。

8. 命令取消CommandAborted
如果被其他命令所中止,那么CommandAborted 就会被设置。

9. Busy 输入参数
意味着当前命令正被执行。如果busy是false,那只有上升沿的execute命令才能触发。此时busy会立即被这只,直到命令成功执行或不成功中断。只要busy是true,就必须重复性地触发该命令。

10. Active 输入参数
如果有一系列命令得到触发,active表面当前命令正被执行。如果busy为true而active为false,表面该命令尚未执行或者已经执行。

11. Enable 输入参数,Valid 输出参数
与execute不同,如果为true,enable参数会保证命令被一直执行。 Valid输出参数为true,表面输出参数一直在更新。

12. BufferMode输入参数(缓冲模式)
BufferMode为false,新的命令会中断当前命令。
BufferMode为true,新的命令会等到当前命令执行完毕后才执行。
新的命令总是需要缓冲模式。若当前命令是active,仅改变参数是不能再次触发的。

非缓冲模式下,新的命令会中断当前命令,当前命令会被置为CommandAborted。注意连续的运动不支持新的缓冲命令。
在非缓冲的情形下,缓冲命令一旦中断,会导致上一个运行无限运行。

13. 缓冲命令类型
a). Aborting 默认不缓冲。
b). Buffered 缓冲
3). BlendingLow 如果axis没有其他命令,该命令被执行。与缓冲命令不同,不会等待命令执行结束,而是在与新的命令之间低速过度。
4). BlendingHigh 与BlendingLow类似,只是过度速度是高速,而非低速。
5). BlendingNext 与BlendingLow和BlendingHigh类似,但是以新的命令的速度进行过度。
6). BlendingPreviou 与BlendingNext类似,但过度的时候速度保持不变。

14. 可选的blending position

15. Option输入参数

16. Slave axes从轴

Post Reply