Open numeric control system with real time kernel and a real-time control method of a tool path

09709974 ยท 2017-07-18

    Inventors

    Cpc classification

    International classification

    Abstract

    The present invention discloses a real-time kernel of open CNC systems and a real-time control method of tool-paths. The real-time kernel translates a real-time control of the tool-paths into sending synchronous pulses into the servo drivers in accordance with the control rhythms t.sub.i (i=1, . . . , n) in the follow-table and achieves the openness of real-time control method and real-time control process. The real-time kernel has the most simple and reliable multi-axis synchronization capability with high-speed and high-precision, and leads to major changes in the field of digital control method. The real-time kernel no need to configure a real-time operating system and a fieldbus, its core function is only to write the control rhythm into the T-division timer, and to send linkage commands into the servo drivers designated by the state-word, therefore its function and architecture are extremely simple and high reliability.

    Claims

    1. A computer numerical control system with real-time kernel, comprising: a read follow-table file module, a linkage axes set module, a linkage command set module, a rhythm control module, and an end-point control module; the read follow-table file module reads control information from a follow-table, the control information comprising: sequence-codes, segment-codes, state-words and control rhythms t.sub.i (i=1, . . . , n); the linkage axes set module reads an address from the follow-table and writes the address into a T-pointer, reads the state-word from the follow-table and writes the state-word into a state-word register, the address and the state-word is designated by the sequence-code and the segment-code of a path-instruction; the linkage command set module reads one control rhythm from the follow-table and to writes the control rhythm into a T-timer according to the T-pointer; the rhythm control module starts a pulse generator and then outputs a pulse, the pulse sends a linkage command into the servo drivers designated by the state-word if time of the T-timer is up; and the end-point control module controls an end-point of the micro-segment of the tool-path, wherein the system further comprises: an independent microprocessor with an interrupt control module; the interrupt control module is used to handle real-time feedback information from the servo drivers.

    2. A real-time control method of tool-paths, which is used to control servo drivers to feed axes in order to produce resultant displacements, comprising the steps of: receiving the control (1), which is configured to set a run flag for the real-time kernel, and the real-time kernel receives the control when a personal computer system executes a path-instruction; setting linkage axes (2), which is configured to read an address from a follow-table and to write the address into a T-pointer, and to read a state-word from the follow-table and to write the state-word into a state-word register, the address and the state-word is designated by a sequence-code and a segment-code of a path-instruction, so as to set the linkage axes in a micro-segment of the tool-path; setting linkage command (3), which is configured to read one control rhythm from the follow-table and to write the control rhythm into a T-timer according to the T-pointer; controlling rhythm (4), which is configured to start a pulse generator and to output a pulse, the pulse send a linkage command into servo drivers designated by the state-word register if time of the T-timer is up; feeding axes (5), which is configured to read a increment from an axis linkage-table and to write the increment into the position loop according to a L-pointer after servo drivers received the linkage command, in order to produce a resultant displacement; controlling endpoint (6), which is configured to control the endpoint of the micro-segment of the tool-path; if the T-pointer is equal to the end address of the follow-table of the micro-segment and is to reach the end of the micro-segment, then to repeat (2) to (6); otherwise, to repeat (3) to (5); if the T-pointer is equal to the end of the end address of the follow-table, and is to reach the end of the tool-path, then to turn off the run flag; and transferring of the control (7), which is configured to transfer the control from the real-time kernel to the PC system while the PC system queries the running state of the real-time kernel, if the run flag is turned off.

    Description

    BRIEF DESCRIPTION OF THE DRAWINGS

    (1) FIG. 1 is a functional block diagram of a real-time kernel of open CNC systems.

    DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENT

    (2) When a workpiece is being machined, there are three processes: an auxiliary process, a tool replacement process and a cutting process.

    (3) The auxiliary process is to control auxiliary functions controlled by I/O device and state sets.

    (4) The tool replacement process is to control of tool magazine. For the tool replacement process, it is used generally conventional PLC or soft PLC to control tool magazine. The present invention is no related to PLC and control of I/O devices.

    (5) Therefore, a CNC system has only three states: operation of auxiliary functions, switching control, real-time control of tool-paths.

    (6) The data flow related control is used three types of motion instruction to describe the above three processes: the state-instructions, the switch-instructions, and the path-instructions.

    (7) The state-instructions are used to control auxiliary functions.

    (8) The state-instructions are used to control I/O devices.

    (9) The path-instructions are used to control servo drivers, and to describe the cutting process of tool-paths.

    (10) The state-instructions, the switch-instructions, and the path-instructions are used to describe the machining process of the workpiece.

    (11) Unlike the existing G-code NC program, the NC program that uses the motion instructions is called the DRC NC program in the present invention.

    (12) The path-instruction is a single byte instruction, its instruction code is:

    (13) B7: ID-code of path-instruction, for example, B7=0;

    (14) B6B0: 7 bit sequence-code, which is used to identify sequence of the path-instructions.

    (15) The sequences-code establishes one-to-one correspondence between the path-instruction and its linkage-table and follow-table.

    (16) In the present invention, the path-instructions have only one format, regardless of type of tool-paths.

    (17) A tool-path is often composed of multiple curves, for example, lines and circles. The present invention uses one path-instruction to describe the cutting process of the tool-path.

    (18) In the present invention, according to the linkage axes, the linkage-table of the tool-path is divided some axis linkage-tables. For example, the axis linkage-table X.sub.i (i=1, . . . , n) of the X axis linkage-table, the y axis linkage-table y.sub.i (i=1, . . . , n) of the y-axis, and so on.

    (19) For a tool-path composed of multiple curves, therein the geometrical structure of each curve may be the same or different, the linkage axes of each curve may be also the same or different. This means that, for the different t.sub.i, the linkage axes are often different. Therefore, according to the linkage axes, the follow-table is divided into some sections that are identified by segment-codes.

    (20) In the follow-table, a state-word is set, which is used to identify the linkage axes in a section. The state-word is one byte, its bits can be 32, 16, 8. For example, the state-word with eight bits linked to eight axes. From low to high, every bit of the state-word controls a servo-on state of a servo driver and its data channel. For example, the state-word 11100000 designates the servo drivers of axes X, y, Z, the state-word 00011000 designates the servo drivers of axes A, B.

    (21) Bits and bytes of the state-word are the user parameters. Users can set the bits and bytes of the state-word by the state-instructions.

    (22) For some cutting processes, there have some path-instructions in the DRC NC program.

    (23) The sequence-code of each path-instruction identifies position of the path-instruction in the DRC NC program. The axis linkage-table of a path-instruction is a subfile, in its directory there is the sequence-code of the path-instruction; the follow-table of each path-instruction is also a subfile, in its directory there is also the sequence-code of the path-instruction. Thus, for all path-instructions, the sequence-code establishes one-to-one correspondence between each path-instruction and its axis linkage-table and follow-table.

    (24) According to different linkage axes, the follow-table of a path-instruction is divided into some sections that are identified by segment-codes; linkage axes in one section are the same. A state table in the follow-table is used to store the state-words of the sections, one state-word is used to designate linkage axes in one section. The axis linkage-table is also divided into some sections that are also identified by the segment-codes, the number of the sections is equal with the number of the sections in the follow-table. Thus, for each path-instruction, the segment-code establishes one-to-one correspondence between the axis and its axis linkage-table and follow-table of the path-instruction.

    (25) The axis linkage-tables were distributed to the relevant servo drivers in the auxiliary process. If an axis in a micro-segment does not feed, its axis linkage-table is marked as an empty file. During executing, for the section marked as an empty file, the servo driver skips when the linkage command received. In linkage of X, y, Z, for example, in the m-th section from L.sub.i to t.sub.k, only X and Z linkage, the state-word of the m-th section is 10100000. Accordingly, the m-th section of the y-axis linkage-table is empty, i.e. during t.sub.i to t.sub.k, the y-axis stops.

    (26) Thus, real-time control process of tool-paths is simplified as follows. According to the control rhythms in the follow-table, under control of the state-words, linkage commands are sent into the servo drivers through a linkage interface; following the linkage commands, the servo drivers write increments in their axis linkage-tables into their position loops, and feed their axes to produce resultant displacements.

    (27) The linkage command is a plurality of parallel synchronous pulses. The linkage interface is similar to a parallel interface controlled by the state word.

    (28) Based on the above description for the real-time control process of tool-paths, the present invention provides a real-time kernel of open CNC systems.

    (29) A real-time kernel of open CNC systems shown in FIG. 1, comprising: a linkage axes set module (1), a linkage command set module (2), a rhythm control module (3), an end-point control module (4).

    (30) The linkage axes set module (1) is used to read an address from a follow-table and to write the address into a T-pointer, and to read a state-word from a follow-table and to write the state-word into a state-word register, the address and the state-word is designated by a sequence-code and a segment-code of a path-instruction, in order to set the linkage axes in a micro-segment of a tool-path;

    (31) The linkage command set module (2) is used to read a control rhythm from the follow-table and to write the control rhythm into a T-timer according to the T-pointer;

    (32) The rhythm control module (3) is used to start a pulse generator and to output a pulse, the pulse send a linkage command into the servo drivers (400) designated by the state-word through the linkage interface (300) if time of the T-timer is up; and

    (33) The end-point control module (4) is used to control the end-point of the micro-segment and the end-point of the path-instruction.

    (34) The PC system (100) generates the follow-table it is used standard file format, such as FAT16, FAT32. In order to read the sequence-codes, the segment-codes, the state-words, the control rhythms t.sub.i (i=1, . . . , n), and other control information in the follow-table, the real-time kernel configures a read follow-table file module (5) it is used to read the above information. Thus, the real-time kernel does not need to configure a real-time operating system, and is independent on hardware and software platform of the PC system (100).

    (35) Further, the real-time kernel comprising: an independent microprocessor (7) with an interrupt control module (6); the interrupt control module is used to handle real-time feedback information from the servo drivers.

    (36) In this technical solution, the PC system (100) is used to run a DRC NC program. When a path-instruction is executed, the PC system (100) send a command to the real-time kernel, the command is used to set a run flag, the control is transferred to the real-time kernel.

    (37) According to the control rhythms, the real-time kernel controls the executing process of a path-instruction, the real-time control process of the tool-path is as follows.

    (38) Setting Linkage Axes

    (39) The linkage axes set module (1) reads an address from a follow-table and writes the address into a T-pointer, and reads a state-word from the follow-table and writes the state-word into a state-word register, the address and the state-word is designated by a sequence-code and a segment-code of a path-instruction. So, the linkage axes in a micro-segment of the tool-path are set.

    (40) Setting Linkage Command

    (41) The linkage command set module (2) reads one control rhythm from the follow-table and writes the control rhythm into a T-timer according to the T-pointer.

    (42) Controlling Rhythm

    (43) The rhythm control module (3) starts a pulse generator and outputs a pulse, the pulse sends a linkage command into servo drivers designated by the state-word register if time of the T-timer is up.

    (44) Feeding Axis

    (45) After the servo drivers received the linkage command, they read increments from their axis linkage-tables and write the increments into their position loops according to a L-pointer in order to produce a resultant displacement.

    (46) Controlling Endpoint

    (47) (1) To Control the Endpoint of the Micro-Segment

    (48) In order to control the endpoint of the follow-table of a section that corresponds to a micro-segment, the T-pointer of the real-time kernel is compared with the end addresses of the follow-table of the section. If the T-pointer is equal to the end addresses of the follow-table of the section, then the first address of the follow-table of the next section is written into the T-pointer; the state-word of the next section is read from the state-table of the follow-table and is written into the state-word register; the real-time control of the next micro-segment continues.

    (49) In order to control the endpoint of the axis linkage-table of a section that corresponds to a micro-segment, the L-pointer of the servo driver is compared with the end addresses of the axis linkage-table of the section. If the L-pointer is greater than the end address of the axis linkage-table of the section, then the first address of the next non-empty section of the axis linkage-table is written into the L-pointer.

    (50) (2) To Control the Endpoint of the Path-Instruction

    (51) In order to control the endpoint of an axis, the L-pointer in the servo driver of the axis is compared with the end addresses of its axis linkage-table. If the L-pointer is greater than the end address of the axis linkage-table, then the run flag of the axis is set 0, and the axis linkage-table of the next path-instruction is executed.

    (52) In order to control the endpoint of the path-instruction, the T-pointer of the real-time kernel is compared with the end addresses of the follow-table. If the T-pointer is equal to the end address of the follow-table, i.e. the endpoint of the path-instruction is reached, then the run flag of the real-time kernel is closed, and the next path-instruction is executed.

    (53) After the DRC NC program in the PC system (100) transferred the control to the real-time kernel, the DRC NC program is in a query state, and check the operating state of the real-time kernel, once the run flag of the real-time kernel is shut, then the DRC NC program takes back the control, and handles the next motion instruction.

    (54) Thus, the real-time control process of tool-paths is simplified as follows. According to the control rhythms in the follow-table, the servo drivers designated by the state-word read the increments from their axis linkage-tables and write the increments into their position loops. The real-time kernel sends linkage commands into servo drivers through the linkage interface; following the linkage commands, the servo drivers feed their axes to produce resultant displacements. Again and again, until the T-pointer reaches the end address of the follow-table, i.e. reaches the end of the path-instruction.

    (55) For five axes X, y, Z, A, B, the state-word is 11111000, the real-time control process is as follows. The real-time kernel writes a control rhythm into the T-timer, and a plurality of linkage commands are sent to a plurality of servo drivers through the linkage interface; the plurality of servo drivers follow the plurality of linkage commands, and synchronously read X.sub.i, y.sub.i, Z.sub.i, A.sub.i, B.sub.i from the respective axis linkage-tables and write them into the respective position loops, and feed the respective axes to produce resultant displacement L.sub.i. Again and again, until the path-instruction is ended.

    (56) One skilled in the art will understand that the embodiment of the present invention as shown in the drawings and described above is exemplary only and not intended to be limiting.

    (57) It will thus be seen that the objects of the present invention have been fully and effectively accomplished. It embodiments have been shown and described for the purposes of illustrating the functional and structural principles of the present invention and is subject to change without departure from such principles. Therefore, this invention includes all modifications encompassed within the spirit and scope of the following claims.