Abstract:
A wire electric discharge machine performs electric discharge machining on a workpiece by relatively moving a workpiece placed on a workpiece table and a wire electrode supported by upper and lower wire guides according to a machining program. The wire electric discharge machine comprises an interference determination unit configured to determine whether or not the top or bottom surface of the workpiece table interferes with the wire electrode at the height of the surface during the execution of the machining program.

Description:
BACKGROUND OF THE INVENTION 
       [0001]    1. Field of the Invention 
         [0002]    The present invention relates to a wire electric discharge machine, and more particularly, to a wire electric discharge machine having an erroneous machining preventing function. 
         [0003]    2. Description of the Related Art 
         [0004]    In a wire electric discharge machine, a wire electrode is stretched and driven between upper and lower wire guides, and electric discharge machining is performed by applying voltage between the wire electrode and a workpiece disposed between the upper and lower wire guides (see Japanese Patent Application Laid-Open No. 2003-71636). 
         [0005]      FIG. 11  is a diagram showing how stroke limits are set so that upper and lower nozzles do not interfere (or collide) with a workpiece table, jig, or wall surfaces of a machining tank, in a wire electric discharge machine. A workpiece  5  is placed on a workpiece table  7  and secured to the table  7  by a jig  6 . The workpiece table  7  is moved within a plane defined by X- and Y-axes by driving means (not shown). 
         [0006]    An upper nozzle  30  and a lower nozzle  31  are disposed apart from each other above and below the workpiece table  7 . An upper guide (not shown) supporting a wire electrode  32  is mounted in the upper nozzle  30 . A lower guide (not shown) supporting the wire electrode is mounted in the lower nozzle  31 . U-axis extends in the same direction as the X-axis, while V-axis extends in the same direction as the Y-axis. The upper nozzle  30  moves within a plane (upper guide plane) defined by the U- and V-axes and extending parallel to the plane defined by the X- and Y-axes. The upper nozzle  30  (upper guide) can move in the direction of Z-axis perpendicular to the plane defined by the X- and Y-axes (plane defined by the U- and V-axes). If the lower nozzle  31  moves, it moves within a lower guide plane parallel to the plane defined by the X- and Y-axes. 
         [0007]    In the wire electric discharge machine, the wire electrode  32  performs electric discharge machining in such a manner that it is run between the upper guide in the upper nozzle  30  and the lower guide in the lower nozzle  31 , or the workpiece table  7  and the upper nozzle  30  are moved relative to the wire electrode  32 , or the upper nozzle  30  is moved in the U- and V-axis directions. The wire electric discharge machine can perform workpiece tapering with the use of driving means for the X- and Y-axis directions and driving means for the U- and V-axis directions. 
         [0008]    In the wire electric discharge machine, the stroke limits are set so that the upper and lower nozzles  30  and  31  do not interfere (or collide) with the workpiece table  7 , the jig  6 , or machining tank wall surfaces  9 . The stroke limits individually set for the X-, Y-, U-, and V-axis directions will be referred to as an X-axis stroke limit  33 , Y-axis stroke limit  34 , U-axis stroke limit  35 , and V-axis stroke limit  36 , respectively. 
         [0009]      FIGS. 12A and 12B  are diagrams illustrating problems of the conventional stroke limit setting method shown in  FIG. 11 . 
         [0010]    The U-axis stroke limit  35  and the V-axis stroke limit  36  are named generically as a UV-axis stroke limit  40 . Likewise, the X-axis stroke limit  33  and the Y-axis stroke limit  34  are named generically as an XY-axis stroke limit  41 . The distance between an upper guide plane  37  and a lower guide plane  38  is referred to as a guide-to-guide distance  42 . A program surface  39  and a sub-program surface  47  are used as a reference for the creation of machining programs. 
         [0011]    The stroke limits designate movable regions of the upper and lower guide planes  37  and  38 . 
         [0012]    Specifically, the lower guide plane  38  is the maximum movable range of the lower nozzle  31  or the workpiece table  7  that is allowed in view of the machine configuration. On the other hand, the upper guide plane  37  is the maximum movable range of the upper nozzle  30  that is allowed in view of the machine configuration. 
         [0013]    In taper machining, the operating range of the wire electrode  32  varies depending on the program surface height, workpiece thickness, guide-to-guide distance, and taper angle. Possibly, therefore, the workpiece table  7  and/or the jig  6  may be erroneously machined during electric discharge machining in spite of care (see  FIG. 12A ). In the case of machining with the upper nozzle  30  inclined to the left of  FIG. 12A  with respect to the lower nozzle  31 , the wire electrode  32  interferes with neither the jig  6  nor the workpiece table  7 . In the case of machining with the upper nozzle  30  inclined to the right of  FIG. 12A  with respect to the lower nozzle  31 , in contrast, the wire electrode  32  and the jig  6  may possibly interfere with each other although the upper and lower nozzles  30  and  31  are located within the UV-axis and XY-axis stroke limits  40  and  41 , respectively. 
         [0014]    In some cases, moreover, a prohibited area may be established even in a range in which there is no interference during taper machining within the stroke limits, so that the operating range of the machine that is originally available for machining may fail to be used effectively (see  FIG. 12B ). Even when the lower nozzle  31  is moved further to the left of the XY-axis stroke limit  41 , the wire electrode  32  interferes with neither the jig  6  nor the workpiece table  7 . Thus, there is a problem that the operating range of the machine cannot be used effectively if the interference of the wire electrode  32  with the jig  6  or the workpiece table  7  within the stroke limits is checked based only on comparison with the stroke limits. 
       SUMMARY OF THE INVENTION 
       [0015]    Accordingly, in view of the above-described problems of the prior art, the present invention has an object to provide a wire electric discharge machine capable of checking, during electric discharge machining, to see if there is interference (or collision) between a wire electrode and a workpiece table or a jig for securing a workpiece to the workpiece table, thereby preventing erroneous machining and effectively using its operating range. 
         [0016]    Another object of the present invention is to provide an arithmetic device capable of virtually executing a machining program for a wire electric discharge machine and checking to see if there is interference (or collision) between a wire electrode and a workpiece table or a jig for securing a workpiece to the workpiece table, thereby effectively using the operating range of the wire electric discharge machine. 
         [0017]    A wire electric discharge machine according to the present invention performs electric discharge machining on a workpiece by relatively moving the workpiece placed on a workpiece table and a wire electrode supported by upper and lower wire guides according to a machining program. The wire electric discharge machine comprises an interference determination unit configured to determine whether or not the top or bottom surface of the workpiece table interferes with the wire electrode at the height of the surface during the execution of the machining program. 
         [0018]    The interference determination unit may comprise a wire electrode position calculation section configured to calculate a position of the wire electrode on a plane at the height of the surface to be checked for interference with the wire electrode. 
         [0019]    The wire electric discharge machine may further comprise a jig configured to secure the workpiece to the workpiece table, and the interference determination unit may be configured to determine whether or not the top or bottom surface of the jig, in addition to the top or bottom surface of the workpiece table, interferes with the wire electrode at the height of the surface during the execution of the machining program. 
         [0020]    The interference determination unit may comprise a selection section configured to select one of the surfaces to be checked for interference with the wire electrode. 
         [0021]    The wire electric discharge machine may further comprise a setting unit configured to set a region and a thickness of the workpiece table. 
         [0022]    The wire electric discharge machine may further comprise a distance output unit configured to output minimums of distances between the wire electrode and the workpiece table in four directions including positive and negative first directions and positive and negative second directions perpendicular to the first directions. 
         [0023]    The wire electric discharge machine may further comprise a setting unit configured to set a region and a thickness of the jig for securing the workpiece to the workpiece table. 
         [0024]    The wire electric discharge machine may further comprise a distance output unit configured to output minimums of distances from the wire electrode to the workpiece table and the jig in four directions including positive and negative first directions and positive and negative second directions perpendicular to the first directions. 
         [0025]    An arithmetic device according to the present invention virtually executes a machining program for a wire electric discharge machine, which performs electric discharge machining on a workpiece by relatively moving the workpiece placed on a workpiece table and a wire electrode supported by upper and lower wire guides. The arithmetic device comprises an interference determination unit configured to determine whether or not the top or bottom surface of the workpiece table interferes with the wire electrode at the height of the surface during the virtual execution of the machining program. 
         [0026]    The interference determination unit may comprise a wire electrode position calculation section configured to calculate a position of the wire electrode on a plane at the height of the surface to be checked for interference with the wire electrode. 
         [0027]    The arithmetic device may further comprise a jig configured to secure the workpiece to the workpiece table, and the interference determination unit may be configured to determine whether or not the top or bottom surface of the jig, in addition to the top or bottom surface of the workpiece table, interferes with the wire electrode at the height of the surface during the virtual execution of the machining program. 
         [0028]    The interference determination unit may comprise a selection section configured to select one of the surfaces to be checked for interference with the wire electrode. 
         [0029]    The arithmetic device may further comprise a setting unit configured to set a region and a thickness of the workpiece table. 
         [0030]    The arithmetic device may further comprise a distance output unit configured to output minimums of distances between the wire electrode and the workpiece table in four directions including positive and negative first directions and positive and negative second directions perpendicular to the first directions. 
         [0031]    The arithmetic device may further comprise a setting unit configured to set a region and a thickness of the jig for securing the workpiece to the workpiece table. 
         [0032]    The arithmetic device may further comprise a distance output unit configured to output minimums of distances from the wire electrode to the workpiece table and the jig in four directions including positive and negative first directions and positive and negative second directions perpendicular to the first directions. 
         [0033]    According to the present invention, there can be provided a wire electric discharge machine capable of checking, during electric discharge machining, to see if there is interference (or collision) between a wire electrode and a workpiece table or a jig for securing a workpiece to the workpiece table, thereby preventing erroneous machining and effectively using its operating range. 
         [0034]    According to the present invention, moreover, there can be provided an arithmetic device capable of virtually executing a machining program for a wire electric discharge machine and checking to see if there is interference (or collision) between a wire electrode and a workpiece table or a jig for securing a workpiece to the workpiece table, thereby effectively using the operating range of the machine. 
     
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
         [0035]    The above and other objects and features of the present invention will be obvious from the ensuing description of embodiments with reference to the accompanying drawings, in which: 
           [0036]      FIG. 1  is a diagram showing planes on which a limit check is made to prevent erroneous machining of a workpiece table and/or a jig during electric discharge machining; 
           [0037]      FIG. 2  is a diagram showing distances from a wire electrode to objects to be checked for interference (or collision) on individual surfaces to be checked; 
           [0038]      FIG. 3  is a diagram showing distances between the wire electrode and the jig or the workpiece table in individual directions as viewed from above; 
           [0039]      FIG. 4  is a diagram illustrating a case where the surfaces to be checked for interference (or collision) can be reduced; 
           [0040]      FIG. 5  is a diagram illustrating how to calculate wire electrode positions at the heights of the surfaces to be checked for interference (or collision); 
           [0041]      FIG. 6  is a diagram showing how to compensate the wire electrode diameter based on a discharge gap amount; 
           [0042]      FIG. 7  is a schematic block diagram of a wire electric discharge machine controlled by a controller; 
           [0043]      FIGS. 8A and 8B  are flowcharts showing processing for making an interference (or collision) check during actual machining; 
           [0044]      FIG. 9  is a flowchart showing processing for selecting the surfaces to be checked; 
           [0045]      FIGS. 10A to 10C  are flowcharts showing processing for making an interference (or collision) check during check drawing; 
           [0046]      FIG. 11  is a diagram showing how stroke limits are set so that upper and lower nozzles do not interfere (or collide) with a workpiece table, jig, or wall surfaces of a machining tank, in a wire electric discharge machine; and 
           [0047]      FIGS. 12A and 12B  are diagram illustrating problems of the conventional stroke limit setting method shown in  FIG. 11 . 
       
    
    
     DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS 
       [0048]    An embodiment of the present invention will now be described with reference to the accompanying drawings. Like reference numerals are used to designate the same or similar configurations of the prior art and this embodiment. 
         [0049]    First, a method for checking interference of a wire electrode with a jig or a workpiece table in a wire electric discharge machine according to the present invention will be described with reference to  FIGS. 1 ,  2  and  3 . 
         [0050]      FIG. 1  is a diagram showing planes on which a limit check is made to prevent erroneous machining of the workpiece table and/or the jig during electric discharge machining. 
         [0051]    A workpiece  5  may be secured to a workpiece table  7  by using a jig configured to hold the workpiece  5  sideways, as well as by using the jig  6  shown in  FIG. 11 . Further, the workpiece  5  may be provided with a hole to which a bolt for fixing the workpiece table is attached. If the head portion of the bolt projects from the surface of the workpiece  5 , its projecting part may be handled as the jig  6 . 
         [0052]    In the electric discharge machine according to the present invention, as shown in  FIG. 1 , interference with a wire electrode  32  is checked in each of regions including a jig top surface  1 , jig bottom surface (workpiece top surface)  2 , workpiece table top surface (workpiece bottom surface)  3 , and workpiece table bottom surface  4 , in addition to upper and lower guide planes  37  and  38 . Specifically, erroneous machining of the workpiece table  7  and/or the jig  6  during the electric discharge machining is prevented by checking the interference of the wire electrode  32  with the jig  6  or the workpiece table  7 , which may be caused as upper and lower nozzles  30  and  31  are moved relatively for taper machining. 
         [0053]    According to the interference checking method described above, the interference check need not always be made for all the four surfaces, including the jig top surface  1 , jig bottom surface  2 , workpiece table top surface  3 , and workpiece table bottom surface  4 , depending on the machining conditions. In this case, the calculation load can be reduced by reducing the number of surfaces to be checked for interference. The case where the surfaces to be checked for interference (or collision) can be reduced will now be described with reference to  FIG. 4 . 
         [0054]    Depending on the relative positions of the lower nozzle  31  and the workpiece table  7  in the height direction, the workpiece table top surface  3  and the workpiece table bottom surface  4  can be excluded from the group of surfaces to be checked for interference. In the case of  FIG. 4 , the height-direction position of the lower nozzle  31  is located above the bottom surface of the workpiece table  7  (workpiece table bottom surface  4 ), so that there is no possibility of the wire electrode  32  and the workpiece table bottom surface  4  interfering with each other. In this case, therefore, the workpiece table bottom surface  4  may be excluded from the group of surfaces to be checked for interference. If a distance  46  of a top height  31   a  of the lower nozzle  31  from the workpiece table top surface  3  is within a predetermined distance (e.g., 1 mm), moreover, the workpiece table top surface  3  may be excluded from the group of surfaces to be checked for interference. This is because the wire electrode  32  never interferes with the workpiece table top surface  3  due to the size of the lower nozzle  31 . If the jig  6  is not used to secure the workpiece  5  to the workpiece table  7 , furthermore, the jig  6  and the wire electrode  32  need not be checked for mutual interference. 
         [0055]      FIG. 2  is a diagram showing distances from the wire electrode to the objects to be checked for interference (or collision) on the individual surfaces to be checked. 
         [0056]    The distances from the wire electrode  32  to the jig  6  and the workpiece table  7  are calculated for the individual regions including the jig top surface  1 , jig bottom surface  2 , workpiece table top surface (workpiece bottom surface)  3 , and workpiece table bottom surface  4 . The distances (“distance” will be defined later) from the wire electrode  32  to the jig top surface  1 , jig bottom surface  2 , workpiece table top surface  3 , and workpiece table bottom surface  4  are calculated individually for four directions, +X direction, −X direction, +Y direction, and −Y direction. The +X direction and the −X direction orthogonally intersect the +Y direction and the −Y direction, respectively, on the workpiece table top surface  3 . 
         [0057]    The distances from the wire electrode  32  to the jig top surface  1 , jig bottom surface  2 , workpiece table top surface  3 , and workpiece table bottom surface  4  in the +X direction are designated by L +x(1) , L +x(2) , L +x(3)  and L +x(4) , respectively. 
         [0058]    The distances from the wire electrode  32  to the jig top surface  1 , jig bottom surface  2 , workpiece table top surface  3 , and workpiece table bottom surface  4  in the −X direction are designated by L −x(1) , L −x(2) , L −x(3)  and L −x(4) , respectively. 
         [0059]    The distances from the wire electrode  32  to the jig top surface  1 , jig bottom surface  2 , workpiece table top surface  3 , and workpiece table bottom surface  4  in the +Y direction are designated by L +y(1) , L +y(2) , L +y(3)  and L +y(4) , respectively. 
         [0060]    The distances from the wire electrode  32  to the jig top surface  1 , jig bottom surface  2 , workpiece table top surface  3 , and workpiece table bottom surface  4  in the −Y direction are designated by L −y(1) , L −y(2) , L −y(3)  and L −y(4) , respectively. 
         [0061]      FIG. 3  is a diagram showing distances between the wire electrode and the jig or the workpiece table in the individual directions as viewed from above. 
         [0062]    The minimum of the distances L +x(1) , L +x(2) , L +x(3)  and L +x(4)  from the wire electrode  32  to the jig top surface  1 , jig bottom surface  2 , workpiece table top surface  3 , and workpiece table bottom surface  4  in the +X direction is designated by L +x . 
         [0063]    The minimum of the distances L −x(1) , L −x(2) , L −x(3)  and L −x(4)  from the wire electrode  32  to the jig top surface  1 , jig bottom surface  2 , workpiece table top surface  3 , and workpiece table bottom surface  4  in the −X direction is designated by L −x . 
         [0064]    The minimum of the distances L +y(1) , L +y(2) , L +y(3)  and L +y(4)  from the wire electrode  32  to the jig top surface  1 , jig bottom surface  2 , workpiece table top surface  3 , and workpiece table bottom surface  4  in the +Y direction is designated by L +y . 
         [0065]    The minimum of the distances L −y(1) , L −y(2) , L −y(3)  and L −y(4)  from the wire electrode  32  to the jig top surface  1 , jig bottom surface  2 , workpiece table top surface  3 , and workpiece table bottom surface  4  in the −Y direction is designated by L −y . 
         [0066]    The position of a machining path  45  of the wire electrode  32  can be reviewed by obtaining the distances L +x , L −x , L +y  and L −y  in the four directions (+X direction, −X direction, +Y direction, and −Y direction). Thereupon, the operating range of the machine can be used effectively. 
         [0067]    The distances from the wire electrode  32  to the jig top surface  1 , jig bottom surface  2 , workpiece table top surface  3 , and workpiece table bottom surface  4  in each of the four directions (+X direction, −X direction, +Y direction, and −Y direction) are the minimums of the distances from the wire electrode  32  to the respective end portions of the individual regions including the jig top surface  1 , jig bottom surface  2 , workpiece table top surface (workpiece bottom surface)  3 , and workpiece table bottom surface  4 . Normally, the jig  6  and the workpiece table  7  are rectangular, so that the distances from the wire electrode  32  to each individual surface (the jig top surface  1 , jig bottom surface  2 , workpiece table top surface  3 , and workpiece table bottom surface  4 ) can be easily calculated as a length of one of the lines connecting the wire electrode  32  and each of two corner portions of a side of the each individual surface opposite the wire electrode  32 , which is the shorter. 
         [0068]      FIG. 5  is a diagram illustrating how to calculate wire electrode positions at the heights of the surfaces to be checked for interference (or collision). 
         [0069]    The positions of the wire electrode  32  on each individual surface are calculated based on a position UV of the upper nozzle  30 , position XY of the lower nozzle  31 , height HL of the lower nozzle  31 , and heights H 1 , H 2 , H 3  and H 4  of the jig top surface  1 , jig bottom surface  2 , workpiece table top surface  3 , and workpiece table bottom surface  4 . The position of the upper nozzle  30  on the upper guide plane  37  is represented by (U, V). The height above the origin of Z is represented by HU. 
         [0070]    The position and height of the wire electrode  32  on a plane at the same height as the jig top surface  1  are represented by (X 1 , Y 1 ) and H 1 , respectively. The position and height of the wire electrode  32  on a plane at the same height as the jig bottom surface  2  are represented by (X 2 , Y 2 ) and H 2 , respectively. The position and height of the wire electrode  32  on a plane at the same height as the workpiece table top surface  3  are represented by (X 3 , Y 3 ) and H 3 , respectively. The position and height of the wire electrode  32  on a plane at the same height as the workpiece table bottom surface  4  are represented by (X 4 , Y 4 ) and H 4 , respectively. The position and height of the lower nozzle  31  on the lower guide plane  38  are represented by (XL, YL) and HL, respectively. 
         [0071]    The positions (X 1 , Y 1 ), (X 2 , Y 2 ), (X 3 , Y 3 ), and (X 4 , Y 4 ) of the wire electrode  32  on the individual surfaces are calculated based on the position (U, V) of the upper nozzle  30  on the upper guide plane  37 , position (XL, YL) of the lower nozzle  31  on the lower guide plane  38 , height HU of the upper nozzle  30 , and heights H 1 , H 2 , H 3  and H 4  of the jig top surface  1 , jig bottom surface  2 , workpiece table top surface  3 , and workpiece table bottom surface  4 . 
         [0072]    In performing wire electric discharge machining on the workpiece  5 , a discharge gap is formed between the wire electrode  32  and the workpiece  5 . A machining error occurs if the discharge gap overlaps the regions in individual surfaces of the jig  6  or the workpiece table  7 . Therefore, it is advisable to check the interference after compensating the diameter of the wire electrode  32 . 
         [0073]      FIG. 6  is a diagram showing how to compensate the wire electrode diameter based on a discharge gap amount. 
         [0074]    The sum total of the diameter of the wire electrode  32  and the discharge gap amount is set to be a wire diameter compensation value. For the interference check on the jig top surface  1 , for example, the positions of points R 1  (XR 1 , YR 1 ) and L 1  (XL 1 , YL 1 ) at the right and left ends of a machining region on the jig top surface  1  can be calculated based on the position (X 1 , Y 1 ) of the wire electrode  32 , a wire diameter compensation amount D, and the inclination of the wire electrode  32 . If the calculated points R 1  and L 1  are within the region of the jig  6 , it can be determined that there is interference. 
         [0075]      FIG. 7  is a schematic block diagram of the wire electric discharge machine controlled by a controller. 
         [0076]    A controller  10  for the wire electric discharge machine comprises a processor (CPU)  11 , and memory  12  formed of a ROM, RAM, etc., display device  13  such as a liquid crystal display, input means  14  formed of a keyboard or a control panel, and axis control means  16  for controlling X-, Y-, Z-, U-, and V-axes, which are connected to the processor  11  through an interface  18 . Each axis control means  16  outputs a command for driving a servomotor  21  for each corresponding axis to a servo amplifier  20  for each corresponding axis. Further, the controller  10  comprises an input-output circuit  17  for commanding a power supply circuit  22 , automatic wire connection device  23 , and wire electrode supply device  24 . 
         [0077]      FIGS. 8A and 8B  are flowcharts showing processing for making an interference (or collision) check during actual machining. The following is a sequential description of steps in this flowchart. 
         [0078]    [Step SA 01 ] It is determined whether or not the present function is effective. If the function is effective (YES), the processing proceeds to Step SA 02 . If not (NO), the processing proceeds to Step SA 03 . 
         [0079]    [Step SA 02 ] The region and thickness of the workpiece table are set, whereupon the processing proceeds to Step SA 03 . Data on the region and thickness of the workpiece table can be previously stored in the memory  12  by using the input means  14 . 
         [0080]    [Step SA 03 ] Instruction to place the workpiece on the workpiece table is given. 
         [0081]    [Step SA 04 ] Instruction to secure the workpiece by the jig is given. 
         [0082]    [Step SA 05 ] It is determined whether or not the present function is effective. If the function is effective (YES), the processing proceeds to Step SA 06 . If not (NO), the processing proceeds to Step SA 07 . 
         [0083]    [Step SA 06 ] The region and thickness of the jig are set, whereupon the processing proceeds to Step SA 07 . Data on the region and thickness of the jig can be previously stored in the memory  12  by using the input means  14 . 
         [0084]    [Step SA 07 ] A wire diameter compensation amount is set. 
         [0085]    [Step SA 08 ] A program surface height and a workpiece thickness are set. These values may be set by using parameters previously stored in the controller or set in a program. 
         [0086]    [Step SA 09 ] Execution of a machining program is started. 
         [0087]    [Step SA 10 ] One block of the program is read and executed. 
         [0088]    [Step SA 11 ] It is determined whether or not the present function is effective. If the function is effective (YES), the processing proceeds to Step SA 12 . If not (NO), the processing proceeds to Step SA 20 . 
         [0089]    [Step SA 12 ] Selection of a surface to be checked is executed. 
         [0090]    [Step SA 13 ] The height of the surface to be checked is calculated. 
         [0091]    [Step SA 14 ] The position of the wire electrode at the height of the surface to be checked is calculated. 
         [0092]    [Step SA 15 ] Interference between the wire electrode and the surface to be checked is checked. 
         [0093]    [Step SA 16 ] It is determined whether or not there is interference between the wire electrode and the surface to be checked. If there is the interference (YES), the processing proceeds to Step SA 17 . If not (NO), the processing proceeds to Step SA 18 . 
         [0094]    [Step SA 17 ] An alarm indicative of the occurrence of erroneous machining is output, whereupon the processing proceeds to Step SA 21 . 
         [0095]    [Step SA 18 ] Safe distances and directions are calculated. In this case, the distances between the wire electrode and the objects to be checked are obtained. 
         [0096]    [Step SA 19 ] Minimum movable distances in the four directions (+X, −X, +Y, and −Y directions) are output. In this case, the minimum distances for the four directions, out of the distances from the objects of interference obtained for the individual blocks of the machining program in Step SA 18 , and their directions are obtained. The position of the machining path can be reviewed based on these data. 
         [0097]    [Step SA 20 ] It is determined whether or not the execution of the program is finished. If the execution is not finished (NO), the processing proceeds to Step SA 10 . If the execution is finished (YES), the processing proceeds to Step SA 21 . 
         [0098]    [Step SA 21 ] Program termination processing is performed, whereupon the electric discharge machining ends. The program termination processing includes power shutdown and the like. 
         [0099]      FIG. 9  is a flowchart showing processing for selecting the surfaces to be checked in the processing of Step SA 12  of  FIG. 8B . The following is a sequential description of steps in this flowchart. 
         [0100]    [Step sa 121 ] The jig top surface  1 , jig bottom surface  2 , workpiece table top surface  3 , and workpiece table bottom surface  4  are set as surfaces to be checked. 
         [0101]    [Step sa 122 ] If the jig has a plurality of installation surfaces, the surfaces are increased. If the jig does not have a plurality of installation surfaces, processing of this step is not performed. 
         [0102]    [Step sa 123 ] It is determined whether or not the top height of the lower nozzle is above the bottom surface of the workpiece table. If the top height is above the bottom surface of the workpiece table (YES), the processing proceeds to Step sa 124 . If not (NO), the processing proceeds to Step sa 125 . 
         [0103]    [Step sa 124 ] The bottom surface of the workpiece table is excluded from the group of surfaces to be checked, whereupon the processing proceeds to Step sa 125 . 
         [0104]    [Step sa 125 ] It is determined whether or not the top height of the lower nozzle is within 1 mm above the top surface of the workpiece table. If the top height is within 1 mm (YES), the processing proceeds to Step sa 126 . If not (NO), the processing proceeds to Step sa 127 . 
         [0105]    [Step sa 126 ] The top surface of the workpiece table is excluded from the group of surfaces to be checked, whereupon the processing proceeds to Step sa 127 . 
         [0106]    [Step sa 127 ] It is determined whether or not the machining is vertical machining. If the machining is vertical machining (YES), the processing proceeds to Step sa 128 . If not (NO), the processing for selecting the surface to be checked ends. 
         [0107]    [Step sa 128 ] The surface on which the regions of the workpiece table and the jig are closest to the wire electrode is selected as the surface to be checked, and the other surfaces are excluded from the group of surfaces to be checked. Thereupon, the processing for selecting the surface to be checked ends. 
         [0108]    The following is a description of processing performed by a personal computer having the function of virtually performing electric discharge machining by the wire electric discharge machine or a controller having the function of virtually executing the machining program of the wire electric discharge machine. 
         [0109]      FIGS. 10A ,  10 B and  10 C are flowcharts showing processing for making an interference (or collision) check during check drawing. 
         [0110]    [Step SB 01 ] It is determined whether or not the present function is effective. If the function is effective (YES), the processing proceeds to Step SB 02 . If not (NO), the processing proceeds to Step SB 04 . 
         [0111]    [Step SB 02 ] The region and thickness of the workpiece table are set, whereupon the processing proceeds to Step SB 03 . Data on the region and thickness of the workpiece table can be previously stored in the memory  12  by using the input means  14 . 
         [0112]    [Step SB 03 ] The region and thickness of the jig are set, whereupon the processing proceeds to Step SB 04 . Data on the jig can be previously stored in the memory  12  by using the input means  14 . 
         [0113]    [Step SB 04 ] A wire diameter compensation amount is set. 
         [0114]    [Step SB 05 ] A program surface height and a workpiece thickness are set. These values may be set by using parameters previously stored in the controller or set in a program. 
         [0115]    [Step SB 06 ] Check drawing is started. 
         [0116]    [Step SB 07 ] Virtual execution of the machining program is started. 
         [0117]    [Step SB 08 ] One block of the program is read and its execution is started. 
         [0118]    [Step SB 09 ] It is determined whether or not the present function is effective. If the function is effective (YES), the processing proceeds to Step SB 10 . If not (NO), the processing proceeds to Step SB 18 . 
         [0119]    [Step SB 10 ] Selection of a surface to be checked is executed. 
         [0120]    [Step SB 11 ] The height of the surface to be checked is calculated. 
         [0121]    [Step SB 12 ] The position of the wire electrode at the height of the surface to be checked is calculated. 
         [0122]    [Step SB 13 ] Interference between the wire electrode and the surface to be checked is checked. 
         [0123]    [Step SB 14 ] It is determined whether or not there is interference between the wire electrode and the surface to be checked. If there is the interference (YES), the processing proceeds to Step SB 15 . If not (NO), the processing proceeds to Step SB 16 . 
         [0124]    [Step SB 15 ] An alarm indicative of the occurrence of erroneous machining is output, whereupon this processing ends. 
         [0125]    [Step SB 16 ] Safe distances and directions are calculated. 
         [0126]    [Step SB 17 ] Minimum movable distances in the four directions are updated. In Step SB 17 , the minimum distances for the four directions (+X, −X, +Y, and −Y directions), out of the distances from the objects of interference obtained for the individual blocks of the machining program in Step SB 16 , and their directions are updated. 
         [0127]    [Step SB 18 ] It is determined whether or not the execution of the program is finished. If the execution is not finished (NO), the processing proceeds to Step SB 08 . If the execution is finished (YES), the processing proceeds to Step SB 19 . 
         [0128]    [Step SB 19 ] It is determined whether or not the present function is effective. If the function is effective (YES), the processing proceeds to Step SB 20 . If not (NO), the processing proceeds to Step SB 21 . 
         [0129]    [Step SB 20 ] The data obtained in Step SB 17 , that is, the safe distances in the four directions, are output. 
         [0130]    [Step SB 21 ] The check drawing is finished. 
         [0131]    [Step SB 22 ] It is determined whether or not an erroneous machining alarm is issued. If the erroneous machining alarm is issued (YES), the processing proceeds to Step SB 23 . If not (NO), the processing proceeds to Step SB 24 . 
         [0132]    [Step SB 23 ] Instruction to review the machining position is given. 
         [0133]    [Step SB 24 ] The safe distances in the four directions are confirmed and instruction to review the machining position is given, whereupon the processing ends. 
         [0134]    According to the embodiment of the present invention described above, erroneous machining of the workpiece table and/or the jig can be prevented during machining. The wire electrode positions on the surfaces to be checked are calculated and it is checked to see if the wire electrode is within the regions of the jig and the workpiece table. Therefore, the check can be made in real time with a smaller calculation load than in a three-dimensional interference check. Thus, new solid data on the wire electrode need not be defined for the interference check. The occurrence of erroneous machining can be ascertained during the check drawing in virtually executing the machining program. Thus, interruptions during machining are reduced, so that the machining time can be reduced. According to the present invention, moreover, machining can be performed in a wider range than in the prior art, so that the operating range of the machine can be used effectively.