The present invention relates generally to control systems for performing operations based on a signal. More particularly, the present invention relates to real-time control systems for performing time sensitive operations based on a clock signal.
Personal computer (PC) technology is becoming popular in systems with real-time requirements, such as control systems. One example is in control systems for drives (e.g., electrical drives, hydraulic drives, etc.). Manufacturers and users of machine tools are making increasingly exacting demands on the functionality of CNC (Computer Numeric Control) systems, demands that are mainly machine or application-specific and are not easily integrated in a standard control. Thus, it is desirable to have a control system which is open so that various applications can be implemented with the control system. PC technology provides such an open architecture.
However, PC technology does not generally have an operating system with adequate real-time capability. Hardware and software interrupts, interrupt closes, direct memory accesses (DMAs), and a myriad of other interrupts occupy the processor of the PC for long periods of time, preventing the processor from processing and sending data according to a real-time clock.
A control system running a PC operating system on one processor and a real-time operating system on another processor is costly. Accordingly, a single processor running first and second operating systems has been implemented. The first operating system is a PC operating system, such as MICROSOFT WINDOWS NT or other DOS-based system, and the second operating system is a real-time operating system. As a rule, such real-time operating systems operate according to a fixed clock signal generated by a timer circuit or a signal needed at an exact time in the future (e.g., a cam control signal). The fluctuation of this clock rate, called xe2x80x9cjitterxe2x80x9d, is a measure of the quality of the real-time system.
The timing diagram in FIG. 1 illustrates one problem with this system. Timing diagram 8 has an x-axis representing time and a y-axis representing processor operation. During time period 10, the processor is running the PC operating system. At time 12, a clock signal is received from the timer circuit, indicating the need to run the real-time operating system, as shown at time period 14. However, an interrupt has been received by PC system 10 prior to time 12. Therefore, the clock signal is not received by the processor until time 18 since the processor is busy servicing the interrupt. A time period 16 between time 12 and time 18 is called xe2x80x9clatency time.xe2x80x9d A difference between the latency time among several ticks is the jitter, which negatively impacts the quality of the real time system.
Another problem with the system of FIG. 1 is that a long latency time reduces the amount of processing time allocated to the real-time operating system, meaning fewer operations can be performed during this time. This is especially critical if the real-time program must end at a fixed time 19. In the case of a control system for a drive, fewer drives can be operated in time period 14 with a long latency time.
Prior methods of reducing jitter have been unsatisfactory. One method is to limit the openness of the system, such that certain routines and interrupts may not be used during the PC operating system time period 10. However, this limits the configurability and adaptability of the system. Another method is to verify the capability of the overall system based on each different application and, more specifically, based on the interrupt delays of each different application. However, this method is costly and requires a great deal more programming time and expertise. Another method is to use a non-maskable interrupt instead of a maskable interrupt. One drawback of this method is that some software routines (e.g., hardware programming routines) may need to disable interrupts (e.g., to access hardware registers within a fixed time period) and such routines will fail if interrupted by a non-maskable interrupt.
Accordingly, there is a need for a system and method for reducing jitter in a signal. There is further a need for an improved real-time numeric control system for a drive having reduced jitter and improved quality. Further still, there is a need for an improved method of reducing jitter in a control system operating a PC operating system and a real-time operating system. There is also a need for a control system having both PC capability and real-time capability without requiring two separate and distinct microprocessors.
According to one exemplary embodiment, a control system having reduced jitter includes a processor and a timer. The processor is configured to operate a first program and a second program. The timer is configured to generate a first interrupt a predetermined time before a second interrupt and to provide the interrupts to the processor. The processor is further configured to switch operation from the first program to the second program in response to the first interrupt and to perform time sensitive tasks upon receipt of the second interrupt.
According to an alternative embodiment, a method of reducing jitter in a control system is disclosed. The control system operates a first program and a second program. The method includes operating the first program, generating a clock signal, generating an interrupt a predetermined time before generating the clock signal, and switching operation from the first program to the second program in response to the interrupt.
According to another alternative embodiment, a numeric control system for a drive includes an input/output circuit coupleable to the drive, a processor, and a timer. The processor is configured to operate a first operating system and a second operating system, wherein the second operating system is configured to provide drive data in real time to the input/output circuit. The timer is configured to generate a clock signal and an interrupt, wherein the interrupt is generated a predetermined time before generating the clock signal, and to provide the clock signal and the interrupt to the processor. The processor is further configured to provide the drive data in response to the clock signal and to switch operation from the first operating system to the second operating system in response to interrupt.
According to yet another exemplary embodiment, a system for reducing jitter in a control system is disclosed. The control system operates a first program and a second program. The system includes means for operating the first program; means for generating a clock signal; means for generating an interrupt a predetermined time before generating the clock signal; and means for switching operation from the first program to the second program in response to the interrupt.