Detailed Description
A numerical controller 1 as an example of an embodiment of the present invention will be described. The numerical controller 1 is housed in a control box provided in the machine tool 5, for example. The numerical controller 1 is a device that controls the operation of the machine tool 5. The numerical controller 1 reads an NC program (machining program) and outputs various control commands to the machine tool 5. Based on a control command output from the numerical controller 1, the machine tool 5 rotates a tool to perform cutting processing on a workpiece. As an example, the cutting process is a drilling process in which a tool is moved in the vertical direction.
As shown in fig. 1, the machine tool 5 includes an X-axis motor 51, an X-axis drive unit 61, a Y-axis motor 52, a Y-axis drive unit 62, a Z-axis motor 53, a spindle head, a Z-axis drive unit 63, a spindle motor 54, a spindle 64, a tool magazine motor 55, a tool magazine 65, and the like.
The X-axis motor 51 drives the X-axis driving unit 61. The Y-axis motor 52 drives a Y-axis drive section 62. The Z-axis motor 53 drives the Z-axis drive section 63. A spindle 64 is provided in the spindle head. Spindle 64 is used to mount a tool. The X-axis drive unit 61, the Y-axis drive unit 62, and the Z-axis drive unit 63 are ball screw shafts. The table on which the workpiece is set is moved in the X direction and the Y direction in accordance with the driving of the X-axis driving unit 61 and the Y-axis driving unit 62. The X direction and the Y direction are horizontal directions orthogonal to each other. Hereinafter, the X direction and the Y direction are collectively referred to as the XY direction. The Z-axis drive unit 63 drives the main spindle head to move in the Z direction integrally with the main spindle 64. The Z direction is the up-down direction. The X-axis motor 51, the Y-axis motor 52, and the Z-axis motor 53 are driven, and the tool moves relative to the workpiece in the X direction, the Y direction, and the Z direction integrally with the spindle 64 and the spindle head. Therefore, the machine tool 5 performs cutting processing on the workpiece.
The X-axis motor 51, the Y-axis motor 52, and the Z-axis motor 53 include encoders 51A to 53A. The encoders 51A to 53A detect the positions of the respective driving units in the X direction, the Y direction, and the Z direction. Hereinafter, the X-axis motor 51 and the Y-axis motor 52 are collectively referred to as an XY motor, the X-axis motor 51, the Y-axis motor 52, and the Z-axis motor 53 are collectively referred to as a motor 50, and the encoders 51A to 53A are collectively referred to as an encoder 50A.
The spindle motor 54 drives a spindle 64. When the spindle 64 is driven, the tool rotates. The spindle motor 54 includes an encoder 54A. The encoder 54A detects the rotational position of the spindle 64. The tool magazine motor 55 drives the tool magazine 65. The tool magazine motor 55 includes an encoder 55A. The encoder 55A detects the drive position of the tool magazine 65.
The configuration of the numerical controller 1 will be described. The numerical controller 1 includes a CPU 31. The CPU31 manages the operation of the numerical controller 1. The CPU31 is electrically connected to the ROM 32, the RAM 33, the storage device 34, the servo amplifiers 41 to 45, and the input/output interface 46. The ROM 32 stores various programs such as a program for executing main processing (see fig. 4 and 5) described later. Various programs may be stored in a nonvolatile storage device or the like as a computer-readable storage medium. The storage device 34 is nonvolatile and stores various information.
The RAM 33 temporarily stores various information in association with execution of various programs. The RAM 33 stores control commands and the like included in the machining program. The machining program describes the operation of the machine tool 5 as control commands in a predetermined program language in the order of operation. The control instructions of the machining program comprise a first positioning instruction and a second positioning instruction. The first positioning command is a command for retracting the tool after the drilling process is performed in the Z direction and positioning the tool at the return position. The return position is a position above the position where the hole forming process is performed. The second positioning command is a command for positioning the stage, which has performed the hole drilling process, to a commanded position. The commanded position may be an XY-direction position at which other drilling is performed, or an XY-direction position retracted from the position at which drilling is performed.
The servo amplifier 41 is electrically connected to the X-axis motor 51. The servo amplifier 42 is electrically connected to the Y-axis motor 52. The servo amplifier 43 is electrically connected to the Z-axis motor 53. Hereinafter, the servo amplifiers 41 to 43 will be collectively referred to as a servo amplifier 40. The servo amplifier 40 outputs the detection result of the encoder 50A to the CPU 31. The CPU31 outputs a current command based on the control command to the servo amplifier 40, and the servo amplifier 40 acquires the detection result of the encoder 50A to drive and control the motor 50. The servo amplifier 44 is electrically connected to the spindle motor 54. The servo amplifier 45 is electrically connected to the magazine motor 55. The CPU31 outputs a current command based on the control command to the servo amplifiers 44 and 45, and the servo amplifiers 44 and 45 acquire the detection results of the encoders 54A and 55A to drive and control the spindle motor 54 and the tool magazine motor 55.
The input/output interface 46 is electrically connected to the power switching unit 71, the operation unit 73, and the display unit 77. The power switching unit 71 and the operation unit 73 can be operated by an operator, and are provided on an outer wall of the machine tool 5. The power switching unit 71 detects an instruction for switching the power of the machine tool 5 between on and off, and the operation unit 73 detects various instructions. The CPU31 acquires the detection results of the power switching unit 71 and the operation unit 73 via the input/output interface 46. The display unit 77 displays various information. The CPU31 displays the information on the display section 77 via the input-output interface 46.
The positioning operation of the tool and the table will be described in brief with reference to fig. 2 and 3. After the boring process is performed, the CPU31 controls the driving of the motor 50 based on the first positioning command and the second positioning command, and the machine tool 5 performs the positioning operation of the tool and the table. After the positioning operation is completed, the machine tool 5 may execute the next drilling operation or may execute other operations such as an operation of returning to a standby state before the machining operation.
When the positioning operation is executed, the CPU31 executes a Z-axis elevation fast movement process, a Z-axis deceleration process, a Z-axis reverse movement process, and an XY-axis movement process. In fig. 2 and 3, an arrow (see fig. 2) and a line (see fig. 3) indicated by a symbol b correspond to the Z-axis fast-moving process and the Z-axis decelerating process, an arrow and a line indicated by a symbol d correspond to the Z-axis reverse-moving process, and an arrow and a line indicated by a symbol c correspond to the XY-direction axis moving process.
The Z-axis up fast movement process will be described. After the tool is driven by the Z-axis motor 53 to perform the cutting feed in the Z direction (arrow and line segment shown by symbol a in fig. 2 and 3), the CPU31 executes the Z-axis ascent fast movement process to drive and control the Z-axis motor 53. In the Z-axis raising fast movement process, the machine tool 5 moves the tool upward fast from the cutting feed completion position (point R in fig. 2). The speed of the tool at the time of the fast movement is based on the command speed of the first positioning command. Based on the first positioning command, the tool is raised at an increased speed up to t1 in fig. 3. the speed of the tool at t1 is a speed Vm. Velocity VmAccording to the distance from the completion position of the cutting feed to the return position. When the distance is sufficiently long, the speed VmFor commanding speed, the tool maintains speed VmAnd rises to ground (i.e., without slowing down). t1 represents the deceleration start timing when stopping at the return position without performing inertial movement (described later) based on the control command (the same applies to fig. 6 and 7).
The Z-axis deceleration processing will be described. Maintaining the speed V during the execution of the fast movement process of the tool along with the Z-axis elevationmAfter the ground rise, the CPU31 executes the Z-axis deceleration process to drive and control the Z-axis motor 53. In the Z-axis deceleration process, the tool starts decelerating at a predetermined deceleration (hereinafter, referred to as a predetermined acceleration a). When the tool is stopped after inertial movement beyond the return position, the deceleration start timing (t 2 in fig. 3) which is the start timing of deceleration of the tool changes depending on whether or not a predetermined condition described later is satisfied (see fig. 6 and 7). When the speed of the tool becomes 0, the Z-axis deceleration processing is ended. The stop position (point V in fig. 2) of the tool is located above the return position (P1). That is, the tool is stopped after inertial movement beyond the return position. The area of the hatched triangle indicated by reference Q in fig. 3 is the moving distance from the position where the tool starts decelerating at t1 to the return position. The area of the hatched parallelogram indicated by the mark S is the moving distance (inertial moving distance, L in fig. 2) from the return position to the position where the tool stops after passing the return position.
The Z-axis reverse movement process will be described. After the tool is stopped in association with the execution of the Z-axis deceleration process, the CPU31 executes the Z-axis backward movement process to drive and control the Z-axis motor 53. Specifically, the CPU31 controls the Z-axis motor 53 to move the tool downward in the reverse direction by the inertial movement distance. At the timing when the tool reaches the return position, the CPU31 stops driving the Z-axis motor 53. Thus, the machine tool 5 positions the tool in the return position (point q of fig. 2).
The XY axis movement process will be described. The CPU31 executes the XY-axis movement process based on the second positioning command and controls the driving of the XY motor in accordance with the execution of the Z-axis deceleration process. At the timing when the speed of the table becomes 0, the CPU31 stops driving the XY motor, and the table stops at the next processing position.
The arrow (see fig. 2) and the line (see fig. 3) indicated by the mark e indicate the positioning operation of the tool (the positioning command after the second positioning command) after the positioning operation of the tool and the table is completed. The arrow and the line segment indicated by the symbol f indicate the boring operation (cutting feed) by the cutter, and are the same as the arrow and the line segment indicated by the symbol a.
Various relational expressions established when the machine tool 5 performs the positioning operation of the tool and the table will be described with reference to fig. 3. The first time T shown in FIG. 31Is the time required from the start timing of the Z-axis deceleration process to the end timing of the Z-axis reverse movement process. First time T1Is obtained by the formula (A).
[ equation 1 ]
A in the formula (A) is a predetermined acceleration, PmIs the current position of the tool in the Z direction, and Ps is the return position of the tool in the Z direction. The predetermined acceleration a is stored in the storage device 34 in advance. VmThe speed at the start timing of deceleration is changed according to the distance from the completion position to the return position of the cutting feed.
A second time T2Is the time required from the start timing of the Z-axis deceleration process to the end timing of the XY-axis movement process. A second time T2Is obtained by the formula (B).
T2=TA+Txy… type (B)
T of formula (B)AIs the time required from the start timing of the Z-axis deceleration process to the start timing of the XY-axis movement process. T isxyThe time required for the XY-axis movement process (the time from the start of movement of the table to the stop thereof) is shown. T isAIs obtained by the formula (C).
[ equation 2 ]
I in formula (C) represents the seating width. The seating width of this example is a range that can be tolerated to be the same as the return position, which is the positioning target of the tool in the Z direction. The bit width indicates the precision required to position the tool in the return position. The seating width in this example is located on the lower side (i.e., the workpiece side) than the return position. W shown in fig. 2 corresponds to the seating width. Hereinafter, the Z-direction position that is the lower end of the seating width is referred to as a first position (point P2 in fig. 2). The first position can be considered to be the same as the return position. The seating width is a prescribed value and is stored in the storage device 34 in advance.
TxyIs obtained by the formula (D).
Txy=(Lxy/axy)1/2… type (D)
L of the formula (D)xyIs the moving distance of the table in the XY direction, axyRepresenting the acceleration of the table in the XY direction. L isxyIs determined based on the machining program, axyIs a predetermined value and is stored in the storage device 34 in advance.
Illustrating a first time T1Is a second time T2When the above condition (hereinafter referred to as a predetermined condition) is satisfied. At T1 of FIG. 3, a first time T1Less than the second time T2When the predetermined condition is not satisfied, the inertia movement distance becomes longer and the tool holding speed V is maintainedmFurther continues the amount of movement, thereby a first time T1Increase of。PmIncreasing the amount of tool further on, thus the time TAAnd (4) reducing. Thus, during the continued movement of the tool, a first time T1And a second time T2The magnitude relationship between them is reversed, and the predetermined condition is satisfied. In the present embodiment, the numerical controller 1 determines whether or not the predetermined condition is satisfied at a predetermined cycle, when the arrival of the timing (t 1 in fig. 3) at which the tool stops without exceeding the return position to start deceleration is triggered. For example, the predetermined period is a very short period of about 2ms once. Therefore, immediately following the first time T1And a second time T2After the magnitude relation between the two is reversed, the CPU31 determines that the predetermined condition is satisfied. I.e. at a first time T1And a second time T2At the same timing, the CPU31 determines that the predetermined condition is satisfied.
When the predetermined condition is satisfied, the timing of ending the Z-axis backward movement processing is after the timing of ending the XY-axis movement processing. That is, the timing of ending the positioning operation of the tool may be later than the timing of ending the positioning operation of the table. Therefore, in the main process described later, when the predetermined condition is satisfied in the quick movement process accompanied by the Z-axis elevation of the tool, the Z-axis deceleration process is started before the XY-direction axis movement process. Furthermore, if the first time T is1And a second time T2Similarly, the timing of ending the positioning operation of the tool is substantially the same as the timing of ending the positioning operation of the table.
The main processing is described with reference to fig. 4 to 7. The flow chart of fig. 4 is an illustration after the (n-1) th control command has been executed in accordance with the cut movement command. The CPU31 rewrites n, which is a count value other than the illustrated one, to 1 (S10). The CPU31 reads and interprets the nth control command, the (n + 1) th control command, and the (n + 2) th control command included in the machining program (S11). The CPU31 determines whether or not the nth control command is a control command indicating the end of the program (S13). When the nth control command is a control command indicating the end of the program (S13: YES), the CPU31 ends the main processing. When the nth control command is not a control command indicating the end of the program (S13: NO), the CPU31 determines whether the (n + 1) th control command is an XY-axis movement command and the (n + 2) th control command is a Z-axis positioning command (S15). When the determination result of S15 is NO (S15: NO), the CPU31 shifts the process to S19. If the determination result at S15 is yes (S15: yes), the CPU31 determines whether the nth control command (i.e., the present control command) indicates the Z-axis up fast movement command (S17). When the nth control command is not the Z-axis ascent fast movement command (S17: NO), the CPU31 executes the nth control command (S19). Specifically, the CPU31 controls the driving of any one of the motor 50, the spindle motor 54, and the tool magazine motor 55 based on the nth control command. The CPU31 increments n by 1(S21), and proceeds to S11.
When the nth control command is the Z-axis fast-movement-up command (S17: yes), the CPU31 starts the Z-axis fast-movement-up process (S31). The CPU31 controls the driving of the Z-axis motor 53, and moves the tool upward at an increased speed from the cutting feed completion position.
The CPU31 determines whether the deceleration start timing based on the first positioning instruction has come based on the detection result of the encoder 53A (S33). The deceleration start timing is a timing for starting deceleration in order to stop the tool without exceeding the return position, and is determined by the CPU31 based on the moving distance of the first positioning command and the detection result of the encoder 53A. When determining that the deceleration start timing has not come (S33: "NO"), the CPU31 shifts the process to S35.
When determining that the deceleration start time has come (S33: yes), the CPU31 calculates the first time T based on the predetermined value stored in the storage device 34, the formula (a), and the detection result of the encoder 53A1(S36), and calculates the second time T based on the predetermined value stored in the storage device 34, the expressions (B) to (D), and the detection result of the encoder 50A2(S37). The CPU31 determines whether the prescribed condition is satisfied based on the first time calculated by S36 and the second time calculated by S37 (S38). When the predetermined condition is not satisfied (S38: "NO"), the CPU31 controls the driving of the Z-axis motor 53 to maintain the speed VmThe cutter is rapidly moved upward (S39).
The CPU31 determines whether the tool has entered the seating width based on the detection result of the encoder 53A (S41). The CPU31 determines whether the current position of the tool is between the first position and the return position based on the detection result of the encoder 53A. When the tool has not entered the seating width (S41: NO), the CPU31 shifts the process to S36. In this example, when the predetermined condition is not satisfied (NO in S38), the CPU31 repeats S36 to S41 at a very short cycle (cycle of once every 2 ms). At the moment when the tool reaches the first position, the encoder 53A outputs the arrival information to the servo amplifier 43, and the CPU31 receives the arrival information. The arrival information is information indicating that the tool has reached the first position. The first position can be regarded as the same as the return position, and therefore the arrival information is also information indicating that the tool has arrived at the return position. At the moment when the tool reaches the first position, the CPU31 judges that the tool has reached the return position (S41: YES). The CPU31 shifts the process to S43.
The CPU31 ends the Z-axis ascent fast movement process to start the Z-axis deceleration process, and starts the XY-axis movement process corresponding to the n +1 th control command (S43). The CPU31 controls the driving of the Z-axis motor 53 to decelerate the tool at a predetermined acceleration a, and controls the driving of the XY motor to move the table toward the commanded position. The movement start timing of the table is the same as the deceleration start timing of the tool (see fig. 6). Namely, T defined by the formula (B)AIs 0.
The CPU31 determines whether to end the Z-axis deceleration process based on the detection result of the encoder 53A (S51). The CPU31 waits until the speed of the tool becomes 0 based on the detection result of the encoder 53A (S51: NO). When the speed of the tool is 0, the CPU31 judges that the Z-axis deceleration processing is ended (S51: YES). The CPU31 acquires the inertial movement distance based on the detection result of the encoder 53A (S53). The CPU31 controls the driving of the Z-axis motor 53 to execute the Z-axis reverse movement process (S55). The CPU31 moves the tool in the reverse direction by the inertial movement distance acquired in S53 (S55). Therefore, the tool is positioned at the return position before the XY-axis movement process is ended.
The CPU31 determines whether to end the XY-axis movement processing based on the detection results of the encoders 51A, 52A (S57). Before the timing to end the XY-axis movement process (S57: no), the CPU31 waits. When the speed of the table is 0 based on the detection results of the encoders 51A, 52A, the CPU31 determines that the XY-axis movement processing is ended (S57: yes). The CPU31 increments n by 2(S61), and proceeds to S11.
The main process when the predetermined condition is satisfied will be described with reference to fig. 4, 5, and 7. Further, with regard to processing overlapping with the above description, the description will be omitted or simplified.
When the predetermined condition is satisfied (yes in S38), the CPU31 starts the Z-axis deceleration process and controls the driving of the Z-axis motor 53 (S45). The deceleration start timing of the tool (time t2 in fig. 7) is earlier than the movement start timing of the table. The CPU31 determines whether the tool has entered the seating width (S47). S47 is the same process as S41, and the CPU31 stands by until it receives arrival information from the encoder 53A (S47: NO). When the tool reaches the first position (S47: YES), the CPU31 starts the XY-axis movement process corresponding to the (n + 1) th control command (S49).
The CPU31 executes S51 to S55, and the tool is positioned at the return position by the Z-axis reverse movement process (S55). After that, the CPU31 determines whether the XY axis movement processing has ended (S57). As described above, at a first time T1Is a second time T2In the above (S38: YES), the CPU31 executes S45, and when the tool reaches the first position (S47: YES), the XY-axis moving process is executed (S49). Therefore, at S57 immediately after execution of S55, the speed of the table is 0, and the CPU31 determines that the XY-axis moving process is ended (S57: YES). Therefore, the positioning completion timing of the return position of the tool is substantially the same as the positioning completion timing of the commanded position of the table (see fig. 7). The CPU31 shifts the process to S61.
As described above, the numerical controller 1 instructs the Z-axis motor 53, the X-axis motor 51, and the Y-axis motor 52 based on the machining program including the first positioning command and the second positioning command, and machines the workpiece with the tool. The tool is inertially moved beyond the return position and then stopped regardless of whether or not a predetermined condition is satisfied (S53). When the predetermined condition is satisfied (yes in S38), the CPU31 starts the Z-axis deceleration process (S45) before the XY-axis movement process (S49) is started. The timing (S51: yes) at which the speed of the tool becomes 0 with the execution of S45 is not likely to be later than the timing (S59) at which the speed of the table becomes 0 and stops with the execution of the XY-axis movement process (S43) based on the second positioning command. Therefore, the numerical controller 1 can suppress an increase in the cycle time of workpiece machining.
When the predetermined condition is not satisfied, the CPU31 controls the Z-axis motor 53 not to be decelerated, and maintains the speed VmThe tool is rapidly moved (S37), so that the moving distance, i.e., the inertial moving distance, of the tool in S55 becomes long, and the first time T1The number of the predetermined conditions is likely to increase, and the timing of establishment of the predetermined condition is advanced. Therefore, the numerical controller 1 can suppress an increase in the cycle time of workpiece machining.
When the deceleration start timing of the tool comes (S33: "YES"), the CPU31 judges whether or not a predetermined condition is satisfied (S38). If the predetermined condition is not satisfied (S38: "NO"), the CPU31 repeats S36 to S41 at a cycle of once every 2 ms. Thus, at a first time T1And a second time T2At the same timing (S38: YES), the CPU31 shifts the process to S45. Therefore, the timing of completion of the Z-axis reverse movement process (S55) is substantially the same as the timing of completion of the XY-axis movement process (S59). That is, the CPU31 determines whether or not the predetermined condition is satisfied in a very short cycle when the deceleration start timing of the tool arrives, and starts the XY-axis movement process so that the table stops at the commanded position at the completion timing of the Z-axis deceleration process (S49). The timing of ending the Z-axis deceleration process and the timing of ending the XY-axis movement process do not appear to be later on the one hand than the other. Therefore, the numerical controller 1 can further suppress an increase in the cycle time of workpiece machining.
Since the first position is closer to the workpiece than the return position and can be regarded as the same as the return position, the timing at which the CPU31 receives the arrival information (S41: YES) is advanced. Therefore, the timing at which the CPU31 starts the next process is advanced. Therefore, the execution of S43, S45 is advanced. Also, the following problems do not exist: the workpiece moved by the XY motor by the XY axis movement processing strikes a component of the machine tool 5 or the like.
In the above description, the Z-axis motor 53 is an example of the first feed motor of the present invention. The X-axis motor 51 and the Y-axis motor 52 are examples of the second feed motor of the present invention. The encoder 50A is an example of the position information output unit of the present invention. The CPU31 executing S31 and S39 is an example of the first movement control unit of the present invention. The CPU31 executing S43 is an example of the second movement control unit of the present invention. The CPU31 executing S55 is an example of the reverse movement control section of the present invention. The CPU31 executing S36 exemplifies the first time calculating unit of the present invention. The CPU31 executing S37 exemplifies the second time calculating unit of the present invention. The CPU31 executing S38 exemplifies the determination unit of the present invention. The CPU31 executing S45 is an example of the third movement control unit of the present invention. The CPU31 executing S39 is an example of the fourth movement control unit of the present invention.
S31 and S39 exemplify a first movement control step of the present invention. S43 is an example of the second movement control step of the present invention. S55 is an example of the reverse movement control procedure of the present invention. S36 exemplifies the first time calculation step of the present invention. S37 exemplifies the second time calculation step of the present invention. S38 exemplifies the determination step of the present invention. S45 is an example of the third movement control step of the present invention.
The present invention is not limited to the above-described embodiments. The table may be fixed to the base, and the XY motor may move the spindle head in the XY direction. Instead of determining whether the tool has entered the seating width, the CPU31 may determine whether the tool has reached the return position (S41, S47). That is, the seating width may also be 0.