针对复杂算法在PLC运动控制系统中难以工程实现的问题,该文提出了一种基于MBD(model based design)的系统设计和应用方法.首先,利用MATLAB/Simulink建立控制模型并仿真验证,预留变量接口,正确匹配参数定义和数据类型;然后,基于Simulink PLC Coder将模型转换为符合IEEC 61131-3标准的结构化文本ST(structure text)代码,根据集成开发环境CoDeSys定制文件格式;最后,将生成代码以功能块FB(function block)的形式导入CoDeSys,实现算法与应用程序的集成.某型起重机回转控制系统的应用证明了MBD方法可有效解决复杂算法工程实现难的问题.
Design and Application of PLC Motion Control System Based on MBD
Model based design(MBD)method is proposed to solve the difficulty on engineering realization of complex algorithm in PLC motion control system.Firstly,control model is established and verified based on MATLAB/Simulink,variable interface is reserved,parameter definition and data type are correctly matched.Then,the model is converted into structure text(ST)code conforming to IEC 61131-3 standard by Simulink PLC coder,file format is customized according to integrated development environment CoDeSys.Finally,the code is imported into CoDeSys in the form of function block(FB)to integrate algorithm and application program.Application of crane slew control sys-tem shows that MBD method can effectively solve the problem on engineering implementation of complex algorithm.
model based design(MBD)PLCmotion controlcode generation