提出一个数据流反馈调度框架(Feedback scheduling framework for data flow,FSF-DF),该调度框架可以预防因数据流中断而导致全软件数控系统加工时间延长与加工质量降低的现象。FSF-DF在数据流上的缓存中设置溢出警戒线,并实时地监测缓存中的数据量是否超出溢出警戒线,以此判断数据流是否有发生数据中断的危险。在数据流将要中断时,调整相关任务的执行频率和优先级,以维持数控系统的稳定性。利用马尔可夫链等统计方法降低执行频率的调整次数,使得FSF-DF具有较低的系统开销。通过建立包括监视器、控制器与基本调度器在内的动态反馈调度框架,使得任务执行频率与优先级的调整规则能够有效地集成在实时操作系统中。在实时操作系统RTAI中实现了FSF-DF,并验证它的有效性。试验结果表明,数据流反馈调度框架可以有效地预防数控系统中的数据流中断现象,能够提高数控系统的整体性能与加工速度。
The interrupt of data flow in the full software computer numerical control(CNC) system will extend the machining time and degrade the machining accuracy.To prevent the interrupt from happening,a new feedback real-time scheduling scheme FSF-DF is proposed.FSF-DF can adjust the period of tasks in CNC system according to the system state.FSF-DF sets an overflow warning line in the buffer on the data flow,and carries out real time monitoring of the data quantity so as to determine whether it goes beyond the overflow warning line,thereby identifying whether there is a hazard of data interrupt.When the data flow is about to interrupt,FSF-DF adjusts the execution frequency and priority of related tasks,so as to maintain the stability of CNC system.Statistical methods such as Markov chain are used to reduce the adjustment times of execution frequency,so that FSF-DF may have a low system overhead.The scheduling scheme,including monitor,controller and basic scheduler,is used to integrate the adjusting rules into real-time operating system.The FSF-DF is implemented in RTAI real-time operating system,and is verified for its effectiveness.Test result shows that the FSF-DF can efficiently prevent the data flow interrupt and improve the whole performance and machining speed of CNC system.