The Computer Numerical Control(CNC) system is composed of multiple types of tasks and is a complex real-time control system. CNC processability depends not only on hard realtime task performance, also depends on soft realtime and non-realtime task response time and requires the systematic coordination of various tasks. If there is abnormal behavior CNC system task, such as procedural bug causing task to miss the deadline, the task will cause the other tasks to miss deadlines and affect the processing performance of CNC system.Realtime system must not only satisfy the hard realtime task time requirement on CNC system, but also improve the response time of soft realtime tasks and provide temporal protection between tasks. However, the existing realtime systems only have single scheduling algorithms, such as RTLinux and RTAI only with RM and EDF scheduling algorithm, can't be good for hybrid task scheduling problem. Therefore, this dissertation analyses the underlying implementation and task scheduling process of RTAI, implements a task scheduler, and designs a CNC system task scheduling model according to CNC system characteristics.Firstly, the dissertation introduces the basic terminology and research status of scheduling theory, points out the limitations of existing scheduling algorithms. Secondly, the dissertation analyzes and discusses in detail the underlying implementation of RTAI task scheduling mechanism and LXRT implementation principle, implementes the CBS hybrid task scheduler with resource reservation using LXRT mechanism, and does some experimental comparisons. Experiments show that the hybrid scheduler not only guarantee the normal operation of hard realtime tasks, but also improve the response time of soft realtime tasks, isolate hard realtime and soft realtime tasks. Finally, the dissertation divides CNC tasks from task function perspective, discusses the CNC multi-task concurrent and realtime processing features and designs CNC task scheduling model with RTAI hybrid task scheduler. |