Detailed Description
Embodiments of the present invention will be described. A numerical controller 29 shown in fig. 1 controls the operation of the machine tool 1, and performs cutting on a cutting target (not shown) held on the upper surface of a table (not shown). The left-right direction, the front-back direction, and the up-down direction of the machine tool 1 are the X-axis direction, the Y-axis direction, and the Z-axis direction, respectively.
Referring to fig. 1, the structure of a machine tool 1 is explained. The machine tool 1 is a vertical machine tool that moves a tool attached to a spindle extending in a Z-axis direction relative to a cutting object held on an upper surface of a table or the like in an X-axis direction, a Y-axis direction, and a Z-axis direction to machine the cutting object (drilling, tapping, side surface machining, etc.). The machine tool 1 includes a spindle mechanism, a spindle moving mechanism, a tool changer, and the like, which are not shown. The spindle mechanism includes a spindle motor 54 for rotating a spindle to which a tool is attached. The spindle moving mechanism further includes a Z-axis motor 53, an X-axis motor 51, and a Y-axis motor 52, and moves the spindle in directions of feed axes XYZ with respect to a cutting target supported on the upper surface of a table (not shown). The tool changer includes a magazine motor 55 for driving a magazine (not shown) for storing a plurality of tools to exchange a tool attached to the spindle for another tool.
Referring to fig. 1, an electrical structure of a machine tool 1 is explained. The machine tool 1 includes an operation panel 13, a numerical controller 29, drive circuits 201 to 205, an X-axis motor 51, a Y-axis motor 52, a Z-axis motor 53, a spindle motor 54, a tool magazine motor 55, and the like. The operation panel 13 is provided on a cover (not shown). The operation panel 13 includes a display unit 15 and an operation unit 24. The display unit 15 displays various setting screens for selecting a machining program, setting machining conditions of the machining program, and the like. The operation unit 24 is used by an operator to input settings of various operations to the machine tool 1. The operator confirms the display unit 15 and operates the operation unit 24 to set various operations of the machine tool 1, machining conditions of a cutting target, and the like. The numerical controller 29 includes a CPU 31, a ROM32, a RAM 33, a storage device 39, and interfaces 34 and 35. The CPU 31 is responsible for the control of the machine tool 1. The ROM32 stores a program for performing main processing described later. The RAM 33 temporarily stores various data and the like. The storage device 39 stores a machining program for machining a cutting target. The display unit 15 and the operation unit 24 are connected to the CPU 31 via an interface 34. The CPU 31 is connected to the driving circuits 201 to 205 via an interface 35. The drive circuits 201 to 205 are connected to an X-axis motor 51, a Y-axis motor 52, a Z-axis motor 53, a spindle motor 54, and a tool magazine motor 55, which are controlled objects. The X-axis motor 51, the Y-axis motor 52, the Z-axis motor 53, the spindle motor 54, and the tool changer motor 55 include encoders 51a to 55 a. The encoders 51a to 55a detect the rotational positions of the drive shafts of the X-axis motor 51, the Y-axis motor 52, the Z-axis motor 53, the spindle motor 54, and the tool magazine motor 55, and output the detection results to the drive circuits 201 to 205. The CPU 31 can detect the coordinate values of the X-axis motor 51, the Y-axis motor 52, and the Z-axis motor 53 on the X, Y, Z axis based on the detection results of the rotational positions of the encoders 51a to 53a obtained by the drive circuits 201 to 203. The coordinate value on the axis X, Y, Z is the position information of the main axis. The CPU 31 can detect the rotational position of the spindle motor 54 based on the detection result of the rotational position of the encoder 54a and the like obtained by the drive circuit 204. The CPU 31 controls the drive circuits 201 to 204 based on the position information and the like to process the cutting object. The CPU 31 can detect the position of the magazine motor 55 based on the detection result of the rotational position of the encoder 55a or the like by the drive circuit 205. The CPU 31 controls each drive circuit 205 based on the position information and the like to perform tool exchange.
The involute interpolation will be described with reference to fig. 2 to 5. The numerical controller 29 can perform curve processing based on the involute interpolation. The involute interpolation is to connect the start point Ps and the end point Pe with an involute curve IC based on the instruction information. The command information is information set by a control command of the machining program. The instruction information of the involute interpolation specifies a plane on which the involute interpolation is performed, the rotation direction of the involute curve IC, the coordinates of the end point Pe, the radius of the base circle C, the moving speed of the main shaft, and the like, as "G17G03.2X-Y-I-J-R-F; "etc. The rotation direction of the involute curve IC means that the main shaft is on the involute curve ICAnd a rotation direction when moving Clockwise (CW) or counterclockwise (CCW) with respect to the center of the base circle C. G17 is an instruction specifying the X-Y plane. The instruction specifying the Z-X plane is G18 and the instruction specifying the Y-Z plane is G19. G03.2 is a command for setting the rotation direction of the involute curve IC to the counterclockwise direction (CCW). The command for setting the rotation direction to the clockwise direction (CW) is G02.2. X-Y-is the coordinate of the end point Pe of the involute curve IC, and I-J-is the coordinate of the center position O of the base circle C when viewed from the start point Ps (hereinafter referred to as "base circle center coordinate (X))0,Y0)". ) R-is the radius of the base circle C (hereinafter referred to as "base circle radius R". ) And F-a moving speed of the main shaft (hereinafter referred to as "command speed F"). ). The coordinates of the start point Ps are set as start point coordinates (Xs, Ys), and the coordinates of the end point Pe are set as end point coordinates (Xe, Ye). The start point Ps is generally the coordinates of the position where the current tool or workpiece is located (current position coordinates).
In the involute curve IC of fig. 2, the principal axis moves counterclockwise in the movement from the start point Ps to the end point Pe. That is, the direction of rotation of the involute curve IC is counterclockwise. The involute curve IC is different from a normal involute curve. It is desirable to draw an involute curve passing through the starting point Ps and the end point Pe, but the first involute curve IC1 passing through the starting point Ps does not pass through the end point Pe, and the second involute curve IC2 passing through the end point Pe does not pass through the starting point Ps. At this time, an involute curve IC always generates an involute error D described later. Therefore, the involute curve of the allowable involute error D is an involute curve IC.
Referring to fig. 2, parameters of the involute curve IC are explained. The parameters of the involute curve IC are used to calculate interpolation points on the involute curve IC in main processing (see fig. 6) described later. The parameters are derived from the command information of the machining program, and are the coordinates of the center position O of the base circle C, the reference start point P1, the reference end point P2, the start point angle θ s, the end point angle θ e, the start point reference angle θ 1, the end point reference angle θ 2, and the like. The coordinate of the center position O of the base circle C is the base circle center coordinate (X)0,Y0). The starting point angle θ s is an angle formed between the starting point straight line ls and the X axis. The starting point line ls is a curve that will be drawn from the starting point Ps to the involute curve IAnd a straight line connecting a tangent point Psc of a tangent line drawn from the base circle C of C and the center position O of the base circle C. The end angle θ e is an angle formed between the end line le and the X-axis. The end point line le is a straight line connecting a tangent point Pec of a tangent line drawn from the end point Pe to the base circle C of the involute curve IC and the center position O of the base circle C. The starting point reference angle θ 1 is an angle formed between the starting point straight line l1 and the X axis. The starting point straight line l1 is a straight line connecting the reference starting point P1 and the center position O of the base circle C. The reference starting point P1 is an intersection point of the first involute curve IC1 and the base circle C. The coordinates of the reference start point P1 are reference start point coordinates (X1, Y1). The end point reference angle θ 2 is an angle formed between the end point straight line l2 and the X axis. The end point straight line l2 is a straight line connecting the reference end point P2 and the center position O of the base circle C. The reference end point P2 is an intersection point of the second involute curve IC2 and the base circle C. The coordinate of the reference end point P2 is a reference end point coordinate (X2, Y2). The coordinates of the current position Pn of the main axis are defined by coordinate values (Xn, Yn). The angular dispensing movement amount θ n represents the dispensing amount of the current position Pn of the nth dispensing cycle. The angular distribution shift θ n is the angle between the line ln and the X-axis. The straight line ln is a straight line connecting a tangent point Pnc of the tangent line from the current position Pn to the base circle C and the center position O.
The shape direction of the involute curve IC will be described with reference to fig. 3 and 4. The direction of the shape of the involute curve IC in fig. 3 is clockwise when starting from the reference starting point P1 of the base circle C and separating from the line. In this case, the rotation direction when the line is released is referred to as "the shape direction of the involute curve IC is clockwise". The direction of rotation of the involute curve IC in fig. 4 is counterclockwise when starting from the reference starting point P1 of the base circle C and separating from the line. In this case, the rotation direction when the line is released is referred to as "the shape direction of the involute curve IC is the counterclockwise direction". In fig. 3, the shape direction of the involute curve IC is clockwise. The first involute curve IC1 passing through the start point Ps is located inward of the second involute curve IC2 passing through the end point Pe. At this time, the main axis moves from the starting point Ps to the end point Pe in the involute curve IC in the clockwise direction and in the separating direction from the base circle C. In fig. 4, the shape direction of the involute curve IC is counterclockwise. The first involute curve IC1 passing through the start point Ps is located inward of the second involute curve IC2 passing through the end point Pe. At this time, the principal axis moves from the starting point Ps to the end point Pe in the counterclockwise direction on the involute curve IC and in the separating direction from the base circle C.
Although not shown, the positional relationship between the start point Ps and the end point Pe in fig. 3 may be reversed. At this time, the first involute curve IC1 having a clockwise shape direction and passing through the starting point Ps is located on the outer side of the second involute curve IC2 passing through the end point Pe with respect to the base circle C. The main axis moves from the starting point Ps to the end point Pe in the direction of approaching the base circle C in the counterclockwise direction on the involute curve IC (the form of fig. 3) whose shape direction is the clockwise direction. Although not shown, the positional relationship between the start point Ps and the end point Pe in fig. 4 may be reversed. At this time, the first involute curve IC1 having a shape oriented in the counterclockwise direction (in the manner of fig. 4) and passing through the starting point Ps exists outside the second involute curve IC2 passing through the end point Pe. The main axis moves from the start point Ps to the end point Pe in the direction clockwise on the involute curve IC and in the direction approaching the base circle C.
The numerical controller 29 determines the shape direction of the involute curve IC based on the relationship between the starting point reference angle θ 1 and the starting point angle θ s with reference to the table of fig. 5. The numerical controller 29 determines which direction the main shaft moves in the approaching direction or the separating direction with respect to the base circle C based on the relationship between the start point angle θ s and the end point angle θ e. When comparing the starting point angle θ s and the ending point angle θ e, which are described below, the numerical controller 29 compares the angles when moving clockwise with respect to the X axis. As shown in fig. 5, when the starting point angle θ s is equal to or smaller than the starting point reference angle θ 1 and the end point angle θ e is equal to or smaller than the end point reference angle θ 2, the shape direction of the involute curve IC is clockwise. When the starting point angle θ s is equal to or greater than the starting point reference angle θ 1 and the end point angle θ e is equal to or greater than the end point reference angle θ 2, the shape direction of the involute curve IC is counterclockwise. When the starting point angle θ s is equal to or smaller than the starting point reference angle θ 1 and the end point angle θ e is larger than the starting point angle θ s, the main shaft moves in the approaching direction approaching the base circle C on the involute curve IC whose shape direction is the clockwise direction. When the starting point angle θ s is equal to or smaller than the starting point reference angle θ 1 and the end point angle θ e is equal to or smaller than the starting point angle θ s, the main shaft moves in a separating direction from the base circle C on the involute curve IC whose shape direction is the clockwise direction (see fig. 3). When the starting point angle θ s is equal to or greater than the starting point reference angle θ 1 and the end point angle θ e is greater than the starting point angle θ s, the main shaft moves in a separating direction from the base circle C on the involute curve IC whose shape direction is the counterclockwise direction (see fig. 4). When the starting point angle θ s is equal to or greater than the starting point reference angle θ 1 and the end point angle θ e is equal to or less than the starting point angle θ s, the main shaft moves in the approaching direction to approach the base circle C on the involute curve IC whose shape direction is the counterclockwise direction.
The main process is described with reference to fig. 6 to 8. When the machine tool 1 is powered on, the CPU 31 reads the program stored in the ROM32 and executes the main process (see fig. 6). When the main process is executed, the CPU 31 determines whether or not the machining program selected by the operator among the machining programs stored in the storage device 39 is accepted (S1). The operator operates the operation unit 24 to input the machining program, and presses a decision button (not shown), and the CPU 31 determines that the machining program is accepted. When determining that no machining program has been accepted (S1: NO), the CPU 31 returns the process to S1. When it is determined that the machining program has been accepted (S1: YES), the CPU 31 interprets one line in the accepted machining program (S3). The CPU 31 determines whether or not the control command of the interpreted machining program is a control command specifying involute interpolation (S5). When the interpreted control command is a tool change command, the control command is not involute interpolation (S5: NO), and therefore the CPU 31 executes the interpreted control command (S7). The CPU 31 determines whether the interpreted line is an end instruction (S9). When instructed to end (S9: YES), the CPU 31 ends the main processing. When it is determined that the instruction is not an end instruction (S9: NO), the CPU 31 returns the process to S3 to interpret the next line in the machining program. When determining that the control command is the involute interpolation (S5: "YES"), the CPU 31 derives the parameters of the involute curve IC based on the command information indicating the involute interpolation (S11). The CPU 31 derives the basic circle center coordinates (X)0,Y0) A starting point baseA reference angle θ 1, an end point reference angle θ 2, a start point angle θ s, an end point angle θ e, and the like. The CPU 31 executes the moving direction determination process (S13). In the movement direction determination process, the CPU 31 refers to the start point angle θ S, the end point angle θ e, the start point reference angle θ 1, the end point reference angle θ 2, and the like among the parameters derived in the process of S11.
As shown in fig. 7, the CPU 31 determines whether the start point angle θ S is equal to the start point reference angle θ 1 and the end point angle θ e is equal to the end point reference angle θ 2 (S101). When it is determined that the starting point angle θ S is equal to the starting point reference angle θ 1 and the end point angle θ e is equal to the end point reference angle θ 2 (yes in S101), the CPU 31 makes an erroneous determination (S119) and shifts the process to S14 because the involute curve does not hold.
When determining that the starting point angle θ S matches the starting point reference angle θ 1 and the end point angle θ e does not match the end point reference angle θ 2 (S101: "NO"), the CPU 31 determines whether or not the starting point reference angle θ 1 is equal to or greater than the starting point angle θ S and the end point reference angle θ 2 is equal to or greater than the end point angle θ e (S102). When determining that the starting point reference angle θ 1 is equal to or greater than the starting point angle θ S and the end point reference angle θ 2 is equal to or greater than the end point angle θ e (S102: yes), the CPU 31 determines the shape direction of the involute curve IC to be clockwise (S103).
The CPU 31 compares the magnitudes of the start point angle θ S and the end point angle θ e (S105). When determining that the starting point angle θ S is smaller than the end point angle θ e (yes in S105), the CPU 31 determines the moving direction of the main shaft moving on the involute curve IC to be the approaching direction approaching the base circle C (S107), and the CPU 31 determines to move the main shaft in the approaching direction on the involute curve IC having a clockwise shape (see fig. 5). The CPU 31 shifts the process to S14. When determining that the starting point angle θ S is equal to or greater than the end point angle θ e (no in S105), the CPU 31 determines the moving direction of the main axis moving on the involute curve IC as the separating direction from the base circle C (S109), and shifts the process to S14. At this time, the CPU 31 determines to move the main shaft in the separating direction on the involute curve IC whose shape direction is the clockwise direction (see fig. 5).
When determining that the starting point reference angle θ 1 is not equal to or greater than the starting point angle θ S and the end point reference angle θ 2 is not equal to or greater than the end point angle θ e (S102: NO), the CPU 31 determines whether the starting point angle θ S is equal to or greater than the starting point reference angle θ 1 and the end point angle θ e is equal to or greater than the end point reference angle θ 2 (S110). When determining that the starting point angle θ S is equal to or greater than the starting point reference angle θ 1 and the end point angle θ e is equal to or greater than the end point reference angle θ 2 (S110: "yes"), the CPU 31 determines the shape direction of the involute curve IC to be counterclockwise with respect to the base circle C (S111). The CPU 31 compares the magnitudes of the start point angle θ S and the end point angle θ e (S113). When determining that the starting point angle θ S is smaller than the end point angle θ e (yes in S113), the CPU 31 determines the moving direction of the main axis moving on the involute curve IC as the separating direction from the base circle C (S115), and shifts the process to S14. At this time, the CPU 31 determines to move the main shaft in the separating direction on the involute curve IC whose shape direction is the counterclockwise direction (see fig. 5). When determining that the starting point angle θ S is equal to or greater than the end point angle θ e (no in S113), the CPU 31 determines the moving direction of the main axis moving on the involute curve IC as the approaching direction to the base circle C (S117), and the process proceeds to S14. The CPU 31 determines to move the spindle in the approaching direction on the involute curve IC whose shape direction is counterclockwise (see fig. 5). When it is determined that the start point angle θ S is equal to or greater than the start point reference angle θ 1 and the end point angle θ e is equal to or greater than the end point reference angle θ 2 (no in S110), the CPU 31 makes an erroneous determination (S119) and shifts the process to S14.
The CPU 31 determines whether there is an error determination (S14). When it is determined that there is an erroneous determination (S14: "YES"), the involute curve does not hold, and the CPU 31 ends the processing.
When it is determined that there is no error determination (S14: "NO"), the CPU 31 calculates an involute error D based on the derived parameter (S15) because the involute curve is established. The involute error D is the distance between a first involute curve IC1 passing through the starting point Ps and a second involute curve IC2 passing through the ending point Pe. The CPU 31 calculates an involute error D by substituting the values of the base circle radius R, the starting point reference angle θ 1, and the end point reference angle θ 2 into the following expression (1).
[ numerical formula 1]
D=R·(θ1-θ2) … type (1)
For convenience of explanation, the following description will be given assuming a case where the main axis moves in the counterclockwise direction and in the separating direction from the base circle C on the involute curve IC whose shape direction is the counterclockwise direction. The involute curve IC in fig. 8 is an example of an involute curve, and can be applied to interpolation of another involute curve to be assumed. The CPU 31 calculates a correction value lrat for correcting the involute error D (S17). The CPU 31 uses the following expressions (2-1) to (2-4). The CPU 31 calculates the correction value lrat by substituting the values of the involute error D and the arc length L by equation (2-1). The CPU 31 calculates the arc length L1 of the first involute curve IC1 passing through the starting point Ps using equation (2-2). The CPU 31 calculates the arc length L2 of the second involute curve IC2 passing through the end point Pe using equation (2-3). The CPU 31 selects the shorter one of the arc length L1 and the arc length L2 as the arc length L using equation (2-4). The arc length L selected by the formula (2-4) is substituted into the formula (2-1). Thus, the correction value lra is a value of the arc length L of the involute curve IC based on the calculated involute error D and the shorter of the arc lengths of the first and second involute curves IC1 and IC 2.
The expressions (2-1) to (2-4) are approximate calculations, and calculation errors occur in the calculated correction value lrat. When the longer arc length L is used, the error of the operation result is larger than the true value. When the shorter arc length L is used, the error of the operation result is larger than the true value or smaller than the true value. Therefore, the CPU 31 selects a short arc length L that reduces the error of the calculation result in order to operate the movement operation of the spindle when the calculation error occurs on the safe side. The safe side means that the speed command value does not become excessively large when the error is large. That is, the error of the calculation result can be estimated to be small using a small arc length L in the calculation of the correction value lra based on the equation (2-1). At this time, since the error of the correction value lrat is a small value, the speed is smaller than that when the correction value lrat is calculated with the longer one set as the arc length L. The CPU 31 is arranged in a counterclockwise direction in the shape direction of the involute curve IC and the end point angle theta e is smaller than the starting point reference angleOr when the shape direction of the involute rotation is clockwise and the end point angle theta e is larger than the starting point reference angle theta 1, substituting theta 1 for theta e of the formula (2-2). Therefore, in the operation of the formula (2-2), (θ e- θ 1)2The result of the calculation of (2) is 0, and the numerical controller 29 can minimize the calculation error. The CPU 31 substitutes θ 2 for θ e of expression (2-3) when the shape direction of the involute curve IC is counterclockwise and the starting point angle θ s is smaller than the end point reference angle θ 2, or when the shape direction of the involute curve IC is clockwise and the starting point angle θ s is larger than the end point reference angle θ 2. Therefore, in the operation of the formula (2-3), (θ e- θ 2)2The result of the calculation of (2) is 0, and the numerical controller 29 can minimize the calculation error.
[ numerical formula 2]
L=min(L1,L2) … type (2-4)
The CPU 31 calculates the first dispensing movement amount Δ l (refer to fig. 8) (S19). The first allocated shift amount Δ l is a shift amount when the main axis is shifted by the processing cycle time at the command speed F on the involute curve IC from the current position Pn. The processing cycle time is the moving time from the current position Pn to the next interpolation point Pn + 1. Therefore, the first dispensing movement amount Δ l is constant.
The CPU 31 corrects the calculated first dispensing movement amount Δ l by the correction value lrat based on the involute error D to calculate the second dispensing movement amount Δ l' (S21). At this time, the CPU 31 calculates the second dispensing movement amount Δ l' using the correction value lrat using the following equation (3). The second allocated shift amount Δ l' (refer to fig. 8) is a shift amount when a processing cycle time is shifted on the third involute curve IC3 passing through the current position Pn. Therefore, the CPU 31 can reduce the influence of the involute error D. The third involute curve IC3 is a curve existing between the first involute curve IC1 and the second involute curve IC 2.
[ numerical formula 3]
Δl′=lratΔ l … formula (3)
The CPU 31 calculates an angle dispensing amount Δ θ n by which the arc length on the third involute curve IC3 (see fig. 8) from the current position Pn is the second dispensing movement amount Δ l' (S23). The CPU 31 calculates the angle dispensing amount Δ θ n using the following equations (4-1) to (4-4). The third involute curve IC3 is the same curve as the first involute curve IC1 when the principal axis is at the starting point Ps. When the main axis moves in the separating direction away from the base circle C, the calculation result obtained based on the equation (4-1) is used (see fig. 5). When the main axis moves in the approaching direction to approach the base circle C, the calculation result obtained based on the equation (4-2) is used (see fig. 5). The CPU 31 calculates the angle θ orat, the angle distribution shift amount θ n, the start point angle θ s, and the start point reference angle θ 1 by substituting the formula (4-3)0(θ n). The CPU 31 calculates the angle θ orat by substituting the starting point angle θ s, the end point angle θ e, the starting point reference angle θ 1, and the end point reference angle θ 2 into the formula (4-4).
[ numerical formula 4]
θ0(θn)=θorat·(θn-θs)+θ1… type (4-3)
The CPU 31 calculates an angular dispensing movement amount θ n +1 (refer to fig. 8) regarding the interpolation point Pn +1 based on the calculated angular dispensing amount Δ θ n (S25). The CPU 31 calculates an angular distribution shift amount [ theta ] n +1 of the interpolation point Pn +1 by using the following equations (5-1) and (5-2). When the start point angle θ s is larger than the end point angle θ e, the CPU 31 uses the calculation result obtained based on equation (5-1) as the value of the angular dispensing movement amount θ n + 1. When the start point angle θ s is smaller than the end point angle θ e, the CPU 31 uses the calculation result obtained based on equation (5-2) as the value of the angular dispensing movement amount θ n + 1.
As shown in fig. 8, the interpolation point Pn +1 is a point on the involute curve IC, and indicates the next position to which the principal axis is to be moved from the current position Pn. The angular dispensing movement θ n +1 represents the dispensing amount of the (n +1) th dispensing cycle. The angular allocated movement amount θ n +1 is an angle formed between the straight line ln +1 and the X axis. The straight line ln +1 is a straight line connecting the tangent point Pnc +1 of the tangent line drawn from the tangent point Pn +1' to the base circle C and the center position O. The tangent point Pn +1 'is at a position shifted by Δ l' from the current position Pn on the third involute curve IC 3.
[ numerical formula 5]
The CPU 31 calculates an interpolation point Pn +1 that moves on the involute curve IC by the processing cycle time based on the calculated angle distribution shift amount θ n +1 (S27). Interpolation point coordinates (X) of interpolation point Pn +1n+1,Yn+1) Calculated by the following formulae (6-1) to (6-3). The CPU 31 distributes the radius R of the base circle, the angle distribution shift amount theta n +1 and the angle theta0(θ n +1) is substituted for the formula (6-1) or the formula (6-2) to calculate the coordinates (X) of the interpolation pointsn+1,Yn+1). The CPU 31 calculates the angle θ n +1 by substituting the starting point reference angle θ 1, the end point reference angle θ 2, the starting point angle θ s, the end point angle θ e, and the angle distribution shift amount θ n +1 into equation (6-3)0(θ n + 1). Angular dispensing movement θ n +1 at θ s<The range of theta n +1 is less than or equal to theta e.
[ numerical formula 6]
Xn+1=R[cosθn+1+{θn+1-θ0(θn+1)}sinθn+1]+X0… type (6-1)
Yn+1=R[sinθn+1-{θn+1-θ0(θn+1)}cosθn+1]+Y0… type (6-2)
The CPU 31 moves the spindle in accordance with the calculated interpolation point Pn +1 (S29). At this time, the third involute curve IC3 is a curve passing through the interpolation point Pn + 1. The CPU 31 determines whether the spindle is at the end point Pe (S31).
When determining that the spindle is not at the end point Pe (S31: NO), the CPU 31 returns the process to S23. The CPU 31 repeats the processing from S23 to S29 until the spindle moves to the end point Pe. That is, the CPU 31 calculates the angle dispensing amount Δ θ n for each interpolation point in each processing cycle until the angle dispensing movement amount θ n +1 reaches the end point angle θ e. The CPU 31 calculates an interpolation point Pn +1 on the involute curve IC based on the angle distribution amount Δ θ n calculated at each processing cycle to perform involute interpolation. Therefore, the CPU 31 performs the involute interpolation in a manner that allows the involute error D between the first involute curve IC1 passing through the start point Ps and the second involute curve IC2 passing through the end point Pe. When determining that the spindle is at the end point Pe (S31: YES), the CPU 31 advances the process to S9. At this time, the third involute curve IC3 has the same track as the second involute curve IC 2.
As described above, the CPU 31 derives the parameters of the involute curve IC based on the command information indicating the involute interpolation (S11). The CPU 31 calculates an involute error D, which is a distance between the first involute curve IC1 passing through the start point Ps and the second involute curve IC2 passing through the end point Pe, based on the derived parameters (S15). The CPU 31 calculates a first allocated movement amount Δ l which is a movement amount when moving the processing cycle time on the involute curve IC at the command speed F from the current position Pn (S19). The CPU 31 corrects the calculated first allocated movement amount Δ l by the correction value lrat based on the calculated involute error D, and calculates a second allocated movement amount Δ l' which is a movement amount when the processing cycle time is moved on the third involute curve IC3 at the current position Pn (S21). The CPU 31 calculates an angle dispensing amount Δ θ n that causes the arc length on the third involute curve IC3 from the current position Pn to be the second dispensing movement amount Δ l' (S23). The CPU 31 calculates an interpolation point Pn +1 that moves on the involute curve IC by the processing cycle time based on the calculated angle distribution amount Δ θ n (S27). The CPU 31 moves the spindle in accordance with the calculated interpolation point Pn +1 (S29). Therefore, the CPU 31 can reduce the speed error on the interpolation path in the involute interpolation. The CPU 31 can reduce the speed error, and the processing accuracy improves.
The present invention is not limited to the above-described embodiments. The machine tool 1 of the above embodiment is a vertical machine tool in which the main spindle extends in the Z-axis direction, but the present invention can also be applied to a horizontal machine tool in which the main spindle extends in the horizontal direction. In the above embodiment, the involute interpolation processing is executed on the X-Y plane, but the present invention is not limited to this, and the involute interpolation may be executed on the Y-Z plane or the Z-X plane. The correction value lrat is calculated using the arc length L of the shorter one of the arc lengths L1, L2, but the correction value lrat may be calculated using the arc length L of the longer one of the arc lengths L1, L2. In this case, the numerical controller 29 can reduce the speed error on the interpolation path in the involute interpolation. The numerical controller 29 repeats the calculation of the interpolation point Pn +1 and the movement of the main axis to perform the involute interpolation, but is not limited to this. The numerical controller 29 may calculate all the interpolation points and then move the spindle from the start point Ps to the end point Pe.
The Z-axis direction is an example of the extending direction of the present invention. The X-axis direction is an example of the reference line of the present invention. The CPU 31 when executing the processing of S11 in fig. 6 is an example of the deriving unit of the present invention. The CPU 31 when executing the process of S15 is an example of the error calculation unit of the present invention. The CPU 31 when executing the process of S19 is an example of the first distributed movement amount calculating unit of the present invention. The CPU 31 when executing the process of S21 is an example of the second allocation movement amount calculation unit of the present invention. The CPU 31 when executing the processing of S23 is an example of the angular distribution amount calculation unit of the present invention. The CPU 31 when executing the processing of S27 is an example of the interpolation point calculation unit of the present invention. The CPU 31 when executing the process of S29 is an example of the movement control unit of the present invention.
The CPU 31 for executing the processing of S102 and S110 is an example of the shape direction determining unit of the present invention. The CPU 31 when executing the processing of S107, S109, S115, and S117 in fig. 7 is an example of the movement direction determination unit of the present invention. The CPU 31 for executing the processing of S105 and S113 is an example of the comparison unit of the present invention. The CPU 31 when executing the processing of S103 is an example of the first shape determining unit of the present invention. The CPU 31 executing the processing of S111 is an example of the second form determining unit of the present invention. The CPU 31 when executing the processing of S107 is an example of the first determination unit of the present invention. The CPU 31 when executing the processing of S109 is an example of the second determination unit of the present invention. The CPU 31 executing the processing of S115 is an example of the third determination unit of the present invention. The CPU 31 when executing the processing of S117 is an example of the fourth determination unit of the present invention.