TwinCAT NC PTP 实用教程
- 2 -
3.8 飞锯 ......................................................................................................................................54
4 编写 NC 单轴控制的 PLC 程序 ............................................................................................55
4.1 准备工作 ..............................................................................................................................55
4.1.1 引用引用 TcMc.lib............................................................................................................55
4.1.2 声明 PLC_TO_NC 及 NC_TO_PLC 类型的变量...........................................................55
4.1.3 PLC 程序说明...................................................................................................................56
4.2 轴的管理 ..............................................................................................................................57
4.2.1 使能 MC_Power...............................................................................................................57
4.2.2 复位 MC_Reset................................................................................................................58
4.2.3 读取当前位置 MC_ReadActualPosition.........................................................................58
4.2.4 设置当前位置 MC_SetActualPosition............................................................................58
4.3 轴的动作 ..............................................................................................................................59
4.3.1 匀速运动 MC_MoveVelocity ...........................................................................................59
4.3.2 绝对定位 MC_MoveAbsolute..........................................................................................60
4.3.3 相对定位 MC_MoveRelative ...........................................................................................60
4.3.4 点动 MC_Jog....................................................................................................................61
4.3.5 停止 MC_Stop ..................................................................................................................62
4.3.6 模长内定位 MC_MoveModulo........................................................................................62
4.3.7 重置目标位置和速度 MC_NewPosAndVelo ..................................................................64
4.3.8 重置目标位置 MC_NewPos.............................................................................................65
4.4 寻参 MC_Home ..................................................................................................................65
4.4.1 可选的寻参方式...............................................................................................................65
4.4.2 寻参过程...........................................................................................................................66
4.4.3 几种寻参方式的比较 .......................................................................................................67
4.4.4 寻参功能块 MC_Home....................................................................................................69
4.4.5 寻参的速度.......................................................................................................................70
4.4.6 参考点的位置...................................................................................................................70
4.5 位置外部设定值发生器(External set value generation) ................................................71
4.5.1 MC_ExtSetPointGenEnable..............................................................................................71
4.5.2 MC_ExtSetPointGenDisable.............................................................................................72
4.5.3 MC_ExtSetPointGenFeed .................................................................................................72
4.6 位置补偿 ..............................................................................................................................7
4
4.6.1 MC_MoveSuperImposedExt.............................................................................................74
4.6.2 适用位置补偿的场合 .......................................................................................................75
4.7 TwinCAT NC 全闭环控制. ..................................................................................................79
4.8 从 PLC 程序修改 NC 轴的参数设置..................................................................................83
4.9 轴的状态函数 ......................................................................................................................85
5 编写 NC 多轴联动程序 .........................................................................................................87
5.1 电子齿轮 ..............................................................................................................................87
5.1.1 齿轮耦合...........................................................................................................................87
5.1.2 齿轮解耦...........................................................................................................................88
5.2 电子凸轮 ..............................................................................................................................90
5.2.1 凸轮表 Cam Table............................................................................................................90
5.2.2 凸轮表的耦合与解耦 .......................................................................................................90