In response to the above problems, there are currently two main solutions. a. Using the multimedia system of the Windows system MM SYT EM. LIB provides a multimedia timing function. This method is actually implemented by hooking the timing clock interrupt callback function. The callback function must be placed in a specified section. Most Windows APIs cannot be used except for simple APIs. In the function description of the Windows system itself, the timer set by Time SetEvent can reach an accuracy of 1 ms, but in the book published by Microsoft, the accuracy of this function for Intel chips is 16 ms. The accuracy for the M IPS chip is 10 ms. In general, this method is much more accurate than the Windows timer, but still can not meet the real-time control requirements of the CNC system. b. Direct programming of the hardware. Reprogram the 8253 before the computer system enters Windows, and modify 18.2 times/s to the desired period. Modify the INT 8 interrupt service routine, call another new interrupt number every time the time is up, and accumulate the timing. If it is 55 ms, it will be transferred to the old INT8 interrupt service program entry. After entering Windows, the new clock interrupt can be connected. The desired timing clock. Using this method can meet the high precision requirements, but it is very clear to the Windows kernel. It is quite difficult to use this method when the Windows kernel data is very small, and this method is easy to bring hidden dangers to the system, resulting in The Win dows system itself is unstable. 2 new CNC system real-time solution In order to complete real-time control on the Windows platform, it is solved from two aspects of hardware and software. In terms of hardware, match the clock circuit. On the interface card, a CPLD chip model XC95108 is used to program the transmit pulse to obtain the time signal, and the interrupt is used to process various tasks in the real-time system. It guarantees nanosecond timing accuracy and can be programmed to modify its timing cycle as the task changes. On the software side, the device driver is written to respond to the interrupt signal. Device drivers are written using the Windows DDK and Windows Platform SDK development kits. Since the device driver runs on the ring0 layer, it has many capabilities that are not available in ring3 layer applications, so it can solve real-time control problems well. The real-time hardware abstraction layer (HAL) was developed using the driver development kit to develop the real-time control engine subsystem. This abstraction layer implements the insulation of the interrupt between the real-time control engine subsystem and Windows. Windows cannot mask interrupts managed by the real-time control engine subsystem. 3 handling solutions for interrupts in Windows When developing a program in the DOS environment, the user can directly modify the interrupt vector and attach its own interrupt service routine (ISR) to respond to the interrupt request generated by the hardware I/O interface board. However, in the Windows environment, the operating system isolates the system kernel from the application and no longer allows the user layer program to modify the device's ISR. Based on this, the driver uses a unique approach to provide an interrupt handling mechanism that contacts the user program and the device ISR. For the event synchronization mechanism. The event synchronization mechanism is suitable for the processing of event interrupts and time interrupts. The principle of the event synchronization mechanism is that the device ISR can share an event with the upper user program to synchronize the user program and the device ISR, so that the user program senses the interrupt request of the hardware device. The specific implementation method is such that a synchronization event is created in the user program, and a synchronization event is set to the device ISR by using the API function GT_Se tIntSyncEvent (HEVEN T hIntEvent) provided by the driver. Thereafter, the user program and the device ISR are two ordinary processes that share synchronization events. In general, the user program starts a new thread in order not to block itself, and calls WaitForSingleObject( ) in the new thread to wait for the event to be valid. Once the device generates an interrupt, the device ISR activates the interrupt synchronization event. At this point the user thread is activated from the WaitForSingleObject and begins executing the subsequent portion of the thread. (Finish) Hot Sell Mark Marking Machine Hot Sell Mark Marking Machine Dongguan Pailade Machinery Equipment Co.,Ltd , https://www.pailades.com
Research on real-time solution design of numerical control system
1 existing solution for CNC system real-time