Abstract:
A machining-error of a non-circular shape machining apparatus is corrected by controlling a movement of a tool which is synchronous with a rotation of a workpiece. A position of the tool is detected when the tool is according to a command position which is coincident with or close to a target position of the tool. At least an amplitude ratio and a phase difference of an amplitude ratio, a phase difference, and an offset difference between the target position and the detected position; is obtained. At least a process of increases and/or reducing the command position and a process of phase shift of the process for increasing and/or reducing the command position on the basis of the amplitude ratio, a process for shifting a phase on the basis of the phase difference, and a process for changing an offset of the command position on the basis of the offset difference are performed, whereby a first corrected command position is obtained. The detected position of the tool can be made to coincide with the target position quickly since the target position and the detected position are determined as a waveform, which is divided into an amplitude, a phase, an offset and a distorsion.

Description:
BACKGROUND OF THE INVENTION 
     1. Field of the Invention 
     The present invention relates to a machining-error correcting method used for a non-circular shape machining apparatus such as a numerical control lathe or a numerical control grinding machine which machines a product having a non-circular-shaped section by turning or grinding a rotating workpiece. 
     2. Description of the Prior Art 
     In recent years, machining apparatuses for machining a non-circular shape such as a cam have become popular. FIG. 1 is a block diagram showing an example a numerical control lathe for machining a non-circular shape workpiece, in which a workpiece 3 is rotated at a fixed relation speed by a spindle motor 5, which rotation is detected by a pulse generator 6. On the basis of a value detected by the pulse generator 6, an X-axis servo mechanism 2 which is synchronous with the rotation of the workpiece 3, is controlled by a control apparatus 1. A drive of an X-axis driving motor 7 enables a tool rest 9 to be moved forward/backward and the workpiece 3 is machined by a tool 10 mounted on the tool rest 9. A drive of a Z-axis motor 12 is controlled by a Z-axis servo mechanism 11 to move the tool rest 9 sideways. In such a numerical control lathe for machining the non-circular shape workpiece, in order to form an intended shape by moving the cutting tool forward/backward, synchronously with the rotation of the workpiece 3, the cutting tool moves at a very high speed in comparison with usual turning, and the servo device therefore can not follow-up the command value and further a machining error occurs. As a method of correcting the machining error, a method of learning which repeats an operation of correcting a command value on the basis of an occurred error is utilized. 
     FIG. 2 is a block diagram showing a detailed example of a drive controlling section in the X-axis servo mechanism 2 of the control apparatus 1, which attains a method of correcting the machining errors in the noncircular shape machining apparatus after a conventional method of learning, and FIG. 3 is a flow chart showing an example of the operation thereof. The workpiece 3 is rotated at a desired rotation speed by the spindle motor 5 which is driven by a spindle driving apparatus 4. When the pulse generator 6 detects the rotation of the workpiece 3 as a pulse PS and supplies it to a counter 21, the counter 21 counts the pulse PS and sets it as a rotation angle θ. A target position f(θ) of the tool 10 or a value close to the target position f(θ) is prestored in a command position data memory 25 as a command position c(θ), and a command position data reading section 22 reads the command position c(θ) which corresponds to the rotation angle θ of the workpiece 3 from the counter 21, out of the command position data memory 25, and controls the X-axis servo mechanism 2 in accordance with the command position c(θ). A detected-position data writing section 23 writes the position a(θ) of the tool 10 detected from an X-axis position detecting device 8 on an amount of one revolution of the workpiece 3, that is, on an extent of θ=0° to 360 °, into a detected-position data memory 26 (Step S10). The target position f(θ) of the tool 10 is prestored in a target position data memory 27, and a command position data correcting section 40 writes a corrected command position cc(θ) of which the command position c(θ) has been corrected by an equation (1) into the command position data memory 25, on the basis of a difference between the target position f(θ) read from the target position data memory 27 and the detected position a(θ) read from the detected position data memory 26 (Step S11). 
     
         cc(θ)=c(θ)+{f(θ+Δθ)-a(θ+Δθ)}(1) 
    
     where 
     cc(θ): corrected command position 
     c(θ): command position 
     f(θ): target position 
     a(θ): detected position 
     Δθ: amount of phase shift (constant) 
     The command position data reading section 22 reads the corrected command position cc(θ) corresponding to the rotation angle θ of the workpiece 3 which is read from the counter 21, from the command position data memory 25, and controls the X-axis servo mechanism 2 by the corrected command position cc(θ). Then, the detected-position data writing section 23 writes the position a(θ) detected by the X-axis position detecting device 8 on an amount of one revolution of the workpiece 3, that is, on an extent of θ=0° to 360°, into the detected-position data memory 26 (Step S12). At the next step, the command position data correcting section 40 judges whether the difference between the detected position a(θ) read from the detected position data memory 26 and the target position f(θ) read from the target position data memory 27, is larger than a fixed value or not (Step S13), and all operations are complete if the difference is not larger than a predetermined value. Alternatively, if the difference is larger than the predetermined value, the command position data correcting section 40 replaces the command position c(θ) with the corrected command position cc(θ) (Step S14), then returns to the above Step S11 and repeats the operation described above. 
     The above-mentioned machining-error correcting method used for the non-circular shape machining apparatus based on a process of learning, has a disadvantage in that it is essentially incapable of correcting errors since such a difference correcting method adds the errors resulting from the fact that an amplification factor of the servo mechanism is not `1`, to the command value, thereby correcting them. Moreover, a relationship between a phase which produces errors and a phase of which command position is corrected on the basis of the errors, is fixed. However, these relationship between these phases may vary with a frequency at which a tool moves forward/backward and some mechanical conditions such as temperature and due to the linearity of the servo mechanism, thus such an error relating to the phase is also a factor which obstructs the divergence of the learning and is a troublesome problem. 
     On the other hand, another machining-error correcting method used for the non-circular shape machining apparatus, which identifies a characteristic of the servo and corrects a command position by an inverse transfer function, has come into in practical use. However, even the machining-error correcting method correcting by the inverse transfer function needs to effect correction by adding the errors to a command position to perform the machining at a higher speed and with higher accuracy, because of a difference between control models of servo mechanisms and identification errors of control parameters. 
     SUMMARY OF THE INVENTION 
     The present invention has been accomplished in the light of the above-mentioned problems, and the object of the present invention is to provide a machining-error correcting method used for a non-circular shape machining apparatus in which a detected position of a workpiece may be quickly controlled to be coincident with a target position. 
     According to the present invention, the method which corrects an error produced as a result of a servo mechanism being unable to fully follow the command position, can make the detected position of a tool coincide with the target position quickly since the method determines the target position and the detected position as a waveform, to thereby correct each error of the waveform divided into an amplitude, a phase, an offset and a distortion. 
     As described above, according to the present invention, the machining-error correcting method used for the non-circular shape machining apparatus allows the non-circular shape machining to be operated without paying any attention on the transfer characteristic of the servo system since the correction on the time-axis which has not been adopted in the prior art, that is, the correction of phase particularly can be automatically operated, and thus highly accurate machining to be quickly performed. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     In the accompanying drawings: 
     FIG. 1 is a block diagram showing an example of an ordinary type of a numerical control lathe for a non-circular shape machining; 
     FIG. 2 is a block diagram showing an example of a control device which conducts the machining-error correcting method for a conventional non-circular shape machining apparatus; 
     FIG. 3 is a flow chart showing an example of the operation of a conventional method in FIG. 2; 
     FIG. 4 is a view showing an example of a non-circular shape; 
     FIG. 5 is a first waveform chart illustrating the principle of the method according to the present invention; 
     FIG. 6 is Bode diagram showing a second waveform chart illustrating the principle of the method according to the present invention; 
     FIG. 7 is a block diagram showing an example of the control apparatus which conducts the machining-error correcting method for the non-circular shape machining apparatus according to the present invention; 
     FIG. 8 is a flow chart showing an example of the operation of the method according to the present invention; 
     FIG. 9 is a first waveform diagram illustrating an example of the method according to the present invention; 
     FIG. 10 is a second waveform diagram illustrating an example of the method according to the present invention; 
     FIG. 11 is a third waveform diagram illustrating an example of the method according to the present invention; 
     FIG. 12 is a fourth waveform diagram illustrating an example of the method according to the present invention; 
     FIG. 13 is a fifth waveform diagram illustrating an example of the method according to the present invention; 
     FIG. 14 is a block diagram showing another example of the control apparatus which conducts the machining-error correcting method for the non-circular shape machining apparatus according to the present invention; 
     FIG. 15 is a flow chart showing an example of the operation of the method according to the present invention; 
     FIG. 16 is a first waveform diagram illustrating another example of the method according to the present invention; 
     FIG. 17 is a second waveform diagram illustrating another example of the method according to the present invention; and 
     FIG. 18 is a third waveform diagram illustrating another example of the method according to the present invention. 
    
    
     DESCRIPTION OF THE PREFERRED EMBODIMENTS 
     FIG. 4 shows an example of an ellipses as a non-circular shape intended to be machined (the illustrated fine line is a circle tangent to the ellipses). FIG. 5 is a chart showing the relationships between a rotation angle θ of a workpiece and a target position f(θ) at which the shape is to be machined as well as a detected position a(θ) which has been obtained by driving a tool on the basis of the target position f(θ). As seen from the chart, there are differences between the target position f(θ) and the detected position a(θ) in amplitude and phase. In addition, an offset and a distortion which can not be discriminated because they are smaller than the waveform amplitude, exist as a factor producing an error. There is usually born a relationship of a transmission characteristic shown in the Bode diagram of FIG. 6 between the target position f(θ) and the detected position a(θ), whereby the differences of the amplitude and the phase significantly increase with increasing rotation speed of the workpiece, that is, with increasing frequency of the forward/backward moving tool. Accordingly, it is possible to correspond the detected position to the target position instantly by applying the target position f(θ) and the detected position a(θ) as a cyclic waveform which is repeated every revolution of the workpiece, by obtaining the errors of the amplitude, the offset, the phase, and the distortion of the waveform respectively, and by correcting the command position on the basis of those errors. 
     FIG. 7 is a block diagram illustrating, in relation to FIG. 2, a detailed example of a driving control section of the X-axis servo mechanism 2 which is included in the control apparatus 1 for performing a machining-error correcting method applied to a non-circular shape machining apparatus according to the present invention, and FIG. 8 is a flow chart showing an example of its operation. The workpiece 3 is rotated at a desired rotation speed with the spindle motor 5 driven by the spindle driving apparatus 4. The pulse generator 6 detects the rotation of the workpiece 3 as the pulse PS and sends it to the counter 21, which counts the supplied pulse PS and adopts it as the rotation angle θ of the workpiece 3. The target position f(θ) of the tool 10 or a value close to the target position f(θ) is stored in advance as the command position c(θ) in the command position data memory 25, the command position data reading section 22 reads the command position c(θ) corresponding to the rotation angle θ of the workpiece 3 which angle has been read out of the counter 21, from the command position data memory 25 and controls the X-axis servo mechanism 2. Then, the detected position data writing section 23 stores the position a(θ) of the tool 10 which is detected by the X-axis position detecting device 8 into the detected-position data memory 26 on an amount of one revolution of the workpiece 3, that is, on an extent of θ=0° to 360° (Step S1). The target position f(θ) is stored in advance in the target position data memory 27, and a first amplitude-ratio detecting section 32, a first phase-difference detecting section 33 and an offset-difference detecting section 31 detect the first amplitude-ratio Afa, the first phase-difference Pfa and the offset-difference Ofa, from the target position f(θ) which is read out of the target position data memory 27 and from the detected position a(θ) which is read out of the detected-position data memory 26, respectively (Step S2). That is, the amplitude-ratio Afa can be obtained by substituting the amplitude Mf of the target position f(θ) and the amplitude Ma of the detected position a(θ) with the below equation (2) as shown in FIG. 9. 
     
         Afa=Mf/Ma                                                  (2) 
    
     The phase-difference Pfa can be obtained by an equation (3) as a difference between an angle θf when the waveform of the target position f(θ) first crosses the offset value Of of the target position f(θ) and an angle θa when the waveform of the detected position a(θ) first crosses the offset value Oa of the detected position a(θ). 
     
         Pfa=θf-θa                                      (3) 
    
     The offset-difference Ofa can be obtained by an equation (4) as a difference between the offset value Of of the target position f(θ) and the offset value Oa of the detected position a(θ). 
     
         Ofa=Of-Oa                                                  (4) 
    
     However, the offset-difference Ofa needs not necessarily to be corrected because the offset-difference Ofa is negligibly small when the waveform of the target position f(θ) is a symmetrical waveform, whereby the offset-difference need not be obtained when not corrected. The offset value is generally obtained as a mean value of the waveform values over 0° to 360°, however, it is preferably obtained as a mean value between the maximum and minimum values of the waveform. This is because the maximum and minimum values of the waveform, that is, the maximum and minimum diameters of the workpiece are corrected so as coincide with each other at the next step. 
     At the following step, the command-position data amplitude/phase/offset correcting section 28 corrects the command position c(θ) which is read out of the command position data memory 25, on the basis of the first amplitude-ratio Afa, the first phase difference Pfa and the offset-difference Ofa which are transmitted from the first amplitude-ratio detecting section 32, the first phase-difference detecting section 33 and the offset-difference detecting section 31 respectively as shown in FIG. 10, and the command-position data amplitude/phase/offset correcting section 28 stores again the corrected command position c(θ) as the first corrected command position c&#39;(θ) in the command position data memory 25 (Step S3). That is, the first corrected command position c&#39;(θ) is expressed as the following equation (5). 
     
         c&#39;(θ)=KA×Afa×{c(θ-KP×Pfa)-Oc }+Oc+KO×Ofa(5) 
    
     where 
     KA: correction rate of the amplitude-ratio 0&lt;KA≦1 
     KP: correction rate of the phase-difference 0&lt;KP≦1 
     KO: correction rate of the offset-difference 0≦KO≦1 
     Oc: offset of the command position c(θ) 
     θ: rotation angle of the workpiece 
     Afa: amplitude-ratio of the target position f(θ) to the detected position a(θ) 
     Ofa: offset-difference between the target position f(θ) and the detected position a(θ) 
     Pfa: phase-difference between the target position f(θ) and the detected position a(θ) 
     c&#39;(θ): first corrected command position 
     c(θ): command position 
     The correction rate KA of the amplitude-ratio, the correction rate KP of the phase-difference and the correction rate KO of the offset-difference are respectively constants, and those values are corrected by an amount of occurred error when those values are `1`. A graph of the relationship between the command position c(θ) and the first corrected command position c&#39;(θ) is shown in FIG. 10. However, when the above correction is repeated, those values is preferably set at a smaller value than `1` because an effect of an error occurred from non-repetition is eliminated. By the correction mentioned above, the errors occurred based on the amplitude, the phase and the offset of the waveform can be eliminated. Alternatively, since most of the errors are removed by the above correction, an accuracy of the machining can be achieved to some extent even by controlling the X-axis servo mechanism on the basis of the first corrected command position c&#39;(θ) to machine the workpiece, whereby this step may be brought to an end. 
     Next, a predicted detection position data computing section 34 calculates a predicted detection position a&#39;(θ) on the basis of the detected position a(θ), the first amplitude-ratio Afa, the phase-difference Pfa and the offset-difference Ofa which are respectively transmitted from the first amplitude-ratio detecting section 32, the first phase-difference detecting section 33 and the offset-difference detecting section 31, as expressed in the below equation (6) (Step S4). 
     
         a&#39;(θ)=KA×Afa×{a(θ-KP×Pfa)-Oa}+Oa+KO×Ofa(6) 
    
     where 
     KA: correction rate of the amplitude-ratio 0&lt;KA≦1 
     KP: correction rate of the phase-difference 0&lt;KP≦1 
     KO: correction rate of the offset-difference 0≦KO≦1 
     Oa: offset value of the detected position a(θ) 
     θ: rotation angle of the workpiece 
     Afa: amplitude-ratio of the target position f(θ) to the detected position a(θ) 
     Ofa: offset-difference between the target position f(θ) and the detected position a(θ) 
     Pfa: phase-difference between the target position f(θ) and the detected position a(θ) 
     a(θ): detected position 
     a&#39;(θ): predicted detection position 
     In FIG. 11, there is shown a graph of relations between the detected position a(θ) when the correction rate KA of the amplitude-ratio, the correction rate KP of the phase-difference and the correction rate KO of the offset-difference are respectively `1`, and the predicted detection position a&#39;(θ). The predicted detection position a&#39;(θ) is formed in a waveform close to the target position f(θ), and is perfectly coincided with that of the target position f(θ) if no distortion of the waveform has occurred in the servo mechanism. 
     In the next step, the predicted error position data computing section 35 calculates a difference between the target position f(θ) being read out of the target position data memory 27 and the predicted detection position a&#39;(θ) being supplied from the predicted detection position data computing section 34, as a predicted error d(θ), as expressed below in equation (7) (Step S5). 
     
         d(θ)=f(θ)-a&#39;(θ)                          (7) 
    
     where 
     f(θ): target position 
     a&#39;(θ): predicted detection position 
     θ: rotation angle of the workpiece 
     d(θ): predicted error 
     A second amplitude-ratio detecting section 30 and a second phase-difference detecting section 29 respectively detect the second amplitude-ratio Ac&#39; f and the phase-difference Pc&#39; f on the first correction command position c&#39;(θ) and the detected position a(θ) which are respectively read from the command position data memory 25 and the detected-position data memory 26. A command position data distortion-correcting section 24 then corrects the first correction command position c&#39;(θ) which is read from the command position data memory 25, on the basis of the second amplitude-ratio Ac&#39; f, the second phase-difference Pc&#39; f and the predicted error d(θ) which are respectively transmitted from the second amplitude-ratio detecting section 30, the second phase-difference detecting section 29 and the predicted error-position data computing section 35, as expressed below in equation (8), then again stores the first correction command position c&#39;(θ) as the second correction command position c&#34;(θ) in the command position data memory 25 (Step S6). 
     
         c&#34;(θ)=c&#39;(θ)+Kd×Ac&#39; f×d(θ-Pc&#39; f)(8) 
    
     where 
     Ac &#39; f: amplitude ratio of first correction command position c&#39;(θ) to detected position a(θ) 
     Pc &#39; f: phase difference between first correction command position c&#39;(θ) and detected position a(θ) 
     c&#34;(θ): second command position 
     c&#39;(θ): first command position 
     θ: rotation angle of workpiece 
     Kd: predicted error correction coefficient of O&lt;Kd≦1 
     d(θ): predicted error 
     A relation between the second term on right side, which is expressed in `d&#39;(θ)`, and the predicted error d(θ) is shown in a graph of FIG. 12. In addition, a relation between the first correction command position c&#39;(θ) and the second correction command position c&#34;(θ) is shown in a graph of FIG. 13. 
     It is preferred that the predicted error correction coefficient Kd is set at `1` or a value close to `1` and that the predicted error correction coefficient Kd is reduced at every Step S5 being repeated until it becomes an appropriately smaller value. This is because an error is significantly corrected since the error first is large and hereafter the effect of error caused from non-repetition decreases by reducing the correction rate of the predicted error correction coefficient Kd. The command position data reading section 22 reads the second correction command position c&#34;(θ) corresponding to the rotation angle θ of the workpiece 3 which is read from the counter 21, out of the command position data memory 25 to control the X-axis servo mechanism 2. Then, the detected-position data writing section 23 writes the position a(θ) detected from the X-axis position detector 8 on an amount of one revolution of the workpiece 3, that is, on an extent of θ=0° to 360° into the detected-position data memory 26 (Step S7). The predicted detection position data computing section 34 judges whether the difference between the detected position a(θ) and the target position f(θ) which are read out of the detected-position data memory 26 and the target position data memory 27 respectively, is larger than a predetermined value or not (Step S8), and finishes all of the operation if the difference is not larger than the predetermined value. Alternatively, when the difference is larger than the fixed value, the predicted detection position data computing section 34 replaces the command position c(θ) with the second correction command position c&#34;(θ) (Step S9), then returns to the Step S2 and repeats the operation described above. 
     FIG. 14 is a block diagram showing, in relation to FIG. 2, another detailed example of a driving control section of the X-axis servo mechanism 2 which is included in a control apparatus 1 for performing a machining-error correcting method applied to the non-circular shape machining apparatus according to the present invention, and FIG. 15 is a flow chart showing a mode of its operation. The workpiece 3 is rotated at a desired rotation speed with the spindle motor 5 driven by the spindle driving apparatus 4. The pulse generator 6 detects the rotation of the workpiece 3 as the pulse PS and sends it to the counter 21, which counts the supplied pulse PS and adopts it as the rotation angle θ of the workpiece 3. 
     On the other hand, an accumulated phase-difference PFA, a repeatedly-multiplied amplitude-ratio AFA, an accumulated offset-difference OFA and an accumulated predicted-error (dθ) which are the outputs of a phase-difference accumulating section 46, an amplitude-ratio repeatedly-multiplying section 45, an offset-difference accumulating section 44 and a predicted-error accumulating section 51 respectively, are initialized to `0`, `1`, `0`, and `0` respectively (Step S21). 
     The target position f(θ) of the tool 10 is stored in advance in a target position memory 60, and the X-axis servo mechanism 2 is controlled according to the target position f(θ) (Step S22). An amplitude-ratio detecting section 42, a phase-difference detecting section 43 and an offset-difference detecting section 41 respectively detect an amplitude-ratio Afa&#39;, a phase-difference Pfa&#39; and an offset-difference Ofa&#39; relating to the position a(θ) of the tool 10 which is detected by the X-axis position detecting device 8 and the target position f(θ) of the tool 10 which is read out of the target position memory 40 from them (Step S23). That is, the amplitude-ratio Afa&#39; can be obtained by substituting the amplitude Mf of the target position f(θ) and the amplitude Ma of the detected position a(θ) into an equation (9). 
     
         Afa&#39;=Mf/Ma                                                 (9) 
    
     The phase-difference Pfa&#39; is obtained by an equation (10) as a difference between the angle θf when the wave of the target position f(θ) first crosses the offset value Of of the target position f(θ) and the angle θa when the wave the detected position a(θ) first crosses the offset value Oa of the detected position a(θ). 
     
         Pfa&#39;=θf-θa                                     (10) 
    
     The offset-difference Ofa&#39; is obtained by the equation (11) as a difference between the offset value Of of the target position f(θ) and the offset value Oa of the detected position a(θ). 
     
         Ofa&#39;=Of-Oa                                                 (11) 
    
     The offset value of the waveform is generally obtained as a mean value of the waveform value over 0° to 360°, however, it is preferably obtained as a mean value between the maximum and minimum values of the waveform. This is because the maximum and minimum values of the waveform, that is, the maximum and minimum diameters of the workpiece are corrected so as to be coincided with each other at the next step. 
     The amplitude-ratio repeatedly-multiplying section 45, the phase-difference accumulating section 46 and the offset-difference accumulating section 44 repeatedly multiply the amplitude-ratio Afa&#39; supplied from the amplitude-ratio detecting section 42, accumulate the phase-difference, Pfa&#39; supplied from the phase-difference Ofa&#39; supplied from the offset-difference detecting section 41 every revolution of the spindle motor 5 respectively, and thereby hold the repeatedly-multiplied amplitude-ratio AFA, the accumulated phase-difference PFA and the accumulated offset-difference OFA respectively (Step S24). 
     A detected-position phase correcting section 47 corrects the position a(θ) of the tool 10 detected by the X-axis position detecting device 8, on the basis of the phase-difference Pfa&#39; supplied from the phase-difference detecting section 43, and sends it to a detected-position amplitude correcting section 48. The detected-position amplitude correcting section 48 multiplies the corrected position of the tool 10 by the amplitude-ratio Afa&#39; supplied from the amplitude-ratio detecting section 42, and sends the product to an adder 49. The adder 49 adds the offset-difference Ofa&#39; supplied from the offset-difference detecting section 41 to the position of the tool 10 to which the amplitude-ratio Afa&#39; is added, to obtain a predicted detected-position a&#34;(θ). The predicted detected-position a&#34;(θ) can be obtained by equation (12). 
     
         a&#34;(θ)={a(θ-Pfa&#39;)-Oa}×Afa&#39;+Oa+Ofa         (12) 
    
     where 
     a&#34;(θ): predicted detected-position 
     a(θ): detected position 
     Oa: offset value of the detected position a(θ) 
     Afa&#39;: amplitude ratio of a target position f(θ) to the detected position a(θ) 
     Ofa&#39;: offset difference between the target position f(θ) and the detected position a(θ) 
     FIG. 17 shows a graph of relations among the target position f(θ), the detected position a(θ) and the predicted detected-position a&#34;(θ), and the predicted detected-position a&#34;(θ) has a waveform similar to the target position f(θ), however, a little error still remains. A subtracter 50 then subtracts the predicted detected-position a&#34;(θ) supplied from the adder 49, from the target position f(θ) read out of the target position memory 40 every revolution of the spindle motor 5, and a predicted error d(θ) is obtained as shown in a below equation (13). 
     
         Δd(θ)=f(θ)-a&#34;(θ)                   (13) 
    
     where 
     f(θ): target position 
     a&#34;(θ): predicted detected-position 
     Δd(θ): predicted error 
     The predicted error accumulating section 51 then accumulates the predicted error Δd(θ) supplied from the subtracter 50 and holds an accumulated predicted-error d(θ) which is obtained by an equation (14) as shown in FIG. 18 (Step S25). 
     
         d(θ)=ΣΔd(θ)                        (14) 
    
     where 
     Δd(θ): predicted error 
     d(θ): accumulated predicted-error 
     At the next step, an adder 52 adds the accumulated predicted-error d(θ) supplied from the predicted-error accumulating section 51 to the target position f(θ) read out of the target position memory 40, and the product to a target-position phase correcting section 53. The target-position phase correcting section 53 corrects the accumulated phase-difference PFA supplied from the phase-difference repeatedly-multiplying section 46 on the basis of the added value, and its corrected value to a target-position amplitude correcting section 54. The target-position amplitude correcting section 54 corrects the repeatedly-multiplied amplitude-ratio AFA supplied from the amplitude-ratio repeatedly-multiplying section 45 on the basis of the above corrected accumulated-phase-difference, and sends its corrected amplitude-ratio to an adder 55. The adder 55 adds the corrected repeatedly-multiplying amplitude-ratio to the accumulated offset-difference OFA supplied from the offset-difference accumulating section 44 to obtain a corrected target-position f&#39;(θ), the X-axis servo mechanism 2 can be controlled (Steps S26 and S27). This corrected target-position f&#39;(θ) is given by a below equation (15). 
     
         f&#39;(θ)={f(θ-PFA)-Of}×AFA+Of+OFA           (15) 
    
     where 
     f&#39;(θ): corrected target-position 
     f(θ): target-position 
     PFA: accumulated phase-difference 
     Of: offset-difference of the target-position f(θ) 
     AFA: repeatedly multiplied amplitude-ratio 
     OFA: accumulated offset-difference 
     According to the present invention, the method of the invention which corrects an error that has occurred as a result of a servo mechanism being unable to fully follow the command position, can make the detected position of a tool coincide with the target position quickly since the method determines the target position and the detected position as a waveform, and thereby corrects each error of the waveform divided into an amplitude, a phase, an offset and a distorsion.