>> 自然科学版期刊 >> 2017年03期 >> 正文
基于正则表达式的串并联机床运动控制G代码解释器研究
供稿: 赵俊伟;李汉超;代军;陈国强;黄俊杰 时间: 2018-11-19 次数:

作者:赵俊伟;李汉超代军陈国强黄俊杰

作者单位:河南理工大学机械与动力工程学院

摘要:针对不同运动控制平台的运动控制指令复杂多样,在实际数控应用中难以进行统一有效操作的问题,提出了一种在VC++开发环境下基于正则表达式的G代码解析算法,根据现有的串并联机床的控制硬件与软件,针对其使用的运动控制卡进行设计开发,建立与数控G代码之间检查、解释、转换的解析机制。实现对所输入需执行G代码的编译,最终转化为控制卡能够识别的运动指令,并通过传输G代码中的运动参数,完成对机构的控制。通过在3-PRS-XY串并联机床上的电机控制试验,对电机运动所反馈的脉冲量进行记录与图表绘制,验证该G代码解释器算法的正确性与有效性,利用逐字符分析提高G代码检查的正确率,通过功能关键字搜索提高了代码转化效率,对串并联机床的数控系统开发具有借鉴意义。

基金:河南省科技厅科技攻关项目(132102210430);河南省高等学校重点科研项目(17A460015);

关键词:正则表达式;解析算法;运动控制卡;G代码;

DOI:10.16186/j.cnki.1673-9787.2017.03.014

分类号:TG659

Abstract:Aiming at problems that it's hard to control the movement in numerical control application uniformly and effectively result from movement control instructions are various in different movement control platforms, one algorithm of G-code analysis based on regular expression in VC++ is proposed. According to the control hardware and software of existing mechanism, cooperated with the motion control card, the analytical mechanism with ability of examination, translation and transform between motion control card and NC G-code is designed. The compile of G-code which is input and executed is realized and the G-code is transformed into the instruction can be recognized by motion control card. Meanwhile the motion parameters are transformed to control the mechanism for controlling machine. Through the experiment on the motor of 3-PRS-XY series-parallel mechanism, and records and diagrams of feedback pulses are used to verify the accuracy and effectiveness of the algorithm. The accuracy of G-code inspection is improved by analysis string by string. The efficiency of codes translate is improved by keywords searching. The research and development of G-code interpretation is meaningful to development of numerical control system of series-parallel mechanism.

最近更新