IMAGE PROCESSING DEVICE AND MACHINE TOOL

An image processing device includes: an imaging execution unit that captures a first partial image including a part of a tool by a camera, a position specifying unit that specifies a next imaging position on the basis of a partial shape of the tool included in the first partial image, and a position control unit that changes the relative positions of the tool and the camera to the specified imaging position. The imaging execution unit captures a second partial image including a part of the tool at the next imaging position.

BACKGROUND OF INVENTION

The present invention relates to a technology for managing tool shapes in machine tools.

2. Description of Related Art

Examples of machine tools include devices for cutting a workpiece into a desired shape, and devices for depositing metal powder or the like to make a workpiece. Examples of machine tools for cutting include a turning center that machines a workpiece by applying a cutting tool to the workpiece that is being turned, a machining center that machines a workpiece by applying a turning tool to the workpiece, and a combined machine including these functions in combination.

The tool is fixed to a tool holding unit such as a spindle or a tool rest. The machine tool processes a workpiece while moving the tool rest and the like and selecting the tool to machine the workpiece according to a processing program prepared in advance.

When a tool rest or the like is moved three-dimensionally in a narrow machining chamber, it must be controlled so that the tool does not come into contact with the workpiece itself, tailstock supporting the workpiece, steady rest, and other equipment. Because tools vary in shape and size, contact with one tool might occur at a position where contact does not occur with another tool. For this reason, when registering a tool in a machine tool, the tool ID must be associated with the tool shape (e.g., see PTL 1).

RELATED ART LIST

In general, tool shape data is downloaded from a website of the tool manufacturer and input to a machine tool to register tool IDs and tool shapes in association with each other. However, such a registration method is burdensome in terms of the workload and the burden of checking to prevent input errors.

SUMMARY

An image processing device according to one aspect of the present invention includes: an imaging execution unit that captures a first partial image including a part of the tool by a camera; a position specifying unit that specifies a next imaging position on the basis of a partial shape of the tool included in the first partial image; and a position control unit that changes the relative positions of the tool and the camera to the specified imaging position.

The imaging execution unit captures a second partial image including a part of the tool at the next imaging position.

An image processing device according to another aspect of the present invention includes: receiving unit that receives (1) a first partial image including a part of a tool captured by a camera, and (2) a second partial image including a part of the tool captured by specifying the next imaging position and changing the relative positions of the tool and the camera to the specified imaging position on the basis of a partial shape of the tool included in the first partial image; and an image processing unit that extracts first contour data of a part of the tool from the first partial image and second contour data of a part of the tool from the second partial image, to generate tool shape data of the tool on the basis of the first and second contour data.

A machine tool according to a certain aspect of the present invention includes: a camera; a tool holding unit to which a tool is attachable; a machining control unit that machines a workpiece with a tool according to a machining program; an imaging execution unit that captures a first partial image including a part of the tool by the camera; a position specifying unit that specifies a next imaging position on the basis of a partial shape of the tool included in the first partial image; and a position control unit that changes the relative positions of the tool and the camera to the next imaging position.

The imaging execution unit captures a second partial image including a part of the tool at the next imaging position.

The present invention facilitates efficient image recognition of a tool shape.

DETAILED DESCRIPTION

FIG.1is an external view of a machine tool100.

The machine tool100in this embodiment is a multitasking machine for machining a workpiece placed in a machining area200. The workpiece is fixed to a holding unit104and cut by a tool102attached to a spindle, which is another holding unit. The holding unit104holding the workpiece is rotationally driven by a driving mechanism.

When the tool102is inserted into a tool recognition area210, a lighting device108provided at a lower position illuminates the tool102and a camera106provided at an upper position captures an image of the tool102. On the basis of the result of this image capturing, tool shape recognition, described later, is performed. The configuration of the tool recognition area210will be further described with reference toFIG.2below.

The machine tool100is provided with a cover202that shuts off the outside. The cover202includes a door204. A user opens the door204to install a workpiece in the machining area200and to remove the workpiece from the machining area200. An operation panel206accepts various operations on the machine tool100from the user.

The operation panel206is connected to an image processing device110. In this embodiment, the main part of the machine tool100and the image processing device110are connected via a wiring cable. The image processing device110may be incorporated into the machine tool100, e.g., as an internal device of the operation panel206.

A tool storage unit130stores a plurality of tools102. A tool102is selected from a plurality of tools102stored in the tool storage unit130by a tool changer (described later) and attached to the spindle. As shown inFIG.1, the X- and Y-axes are defined in the horizontal direction and the Z-axis is defined in the vertical direction. The Y-axis direction corresponds to the axial direction of the spindle and workpiece.

FIG.2is a schematic diagram illustrating a positional relation among the tool102, the camera106, and the lighting device108in the tool recognition area210.

The tool102includes a blade part112used for machining the workpiece and a shank part114which is a part to be fixed to a holder118of a spindle116. The spindle116is configured to be rotatable and movable while holding the tool102. The spindle116, which is also a holding unit, can also rotate the holding tool.

The camera106is equipped with an image sensor (image pickup element) such as complementary metal oxide semiconductor (CMOS) or charge-coupled device (CCD). The camera106images the tool102attached to the spindle116from above (in the Z-axis direction). The camera106is fixed in the tool recognition area210. The tool102can be imaged from multiple directions by rotating the tool102about the Y-axis with the spindle116. In addition, multiple locations of the tool102can be imaged by moving the tool102in the horizontal direction (XY direction) with the spindle116.

The lighting device108is fixed at a lower position to face the camera106. The lighting device108illuminates the tool102from below. Transmitted illumination by the lighting device108enables the camera106to obtain high-contrast captured images that make it easy to grasp the contour position of the tool102.

When the user newly registers a tool102, the user sets the tool registration mode in the operation panel206and attaches the tool102to the spindle116. Next, the user inputs a desired tool ID. The spindle116moves and rotates the tool102, and the fixed camera106automatically images the tool102from various positions and directions. From a number of captured images obtained by the camera106, the tool shape is recognized and the tool ID and the tool shape are registered in association with each other. With such a control method, the tool shape can be automatically registered. Details of how to recognize tool shapes will be described later.

The camera106in this embodiment has a resolution of about one million pixels (1224×1024). The imaging range is about 300 millimeters × 300 millimeters. The camera106can capture up to 80 images per second.

FIG.3illustrates a hardware configuration of the machine tool100and the image processing device110.

The machine tool100includes an operation control device120, a machining control unit122, a machining device124, a tool changing unit126, and the tool storage unit130. The machining control unit122, which functions as a numerical controller, transmits a control signal to the machining device124according to a machining program. The machining device124machines the workpiece by moving the spindle116according to instructions from the machining control unit122.

The operation control device120includes the operation panel206and controls the machining control unit122. The tool storage unit130stores tools. The tool changing unit126corresponds to the so-called automatic tool changer (ATC). The tool changing unit126takes out a tool from the tool storage unit130according to the change instruction from the machining control unit122, and exchanges the tool in the spindle116with the tool taken out.

The image processing device110mainly performs image processing such as tool shape recognition. As described above, the image processing device110may be configured as a part of the operation control device120.

FIG.4is a functional block diagram of the image processing device110.

Each component of the image processing device110is implemented by hardware including computing units such as central processing units (CPUs) and various computer processors, a storage device such as memories and storages, and wired or wireless communication lines that connects these units and devices, and software that is stored in the storage devices and supplies processing instructions to the computing units. Computer programs may be constituted by device drivers, operating systems, various application programs on upper layers thereof, and a library that provides common functions to these programs. Each of the blocks described below represents a functional block, not a hardware block.

It should be noted that the operation control device120and the machining control unit122may also be implemented in a form in which hardware including a computing unit such as a processor, storage units such as memory and storage, and wired or wireless communication lines connecting them, and software or programs stored in the storage units to supply processing instructions to the computing units on an operating system independent from the image processing device110.

The image processing device110includes a user interface processing unit140, a data processing unit142, and a data storage unit144.

The user interface processing unit140is responsible for processing related to the user interface, such as image display and audio output, in addition to accepting operations from the user. The data processing unit142performs various processes on the basis of the data acquired by the user interface processing unit140and the data stored in the data storage unit144. The data processing unit142also functions as an interface for the user interface processing unit140and the data storage unit144. The data storage unit144stores various programs and setting data.

The user interface processing unit140includes an input unit146and an output unit148.

The input unit146accepts input from a user via a touch panel or a hardware device such as a handle. The output unit148provides various kinds of information to the user via image display or audio output. The input unit146includes an ID accepting unit150that accepts input of a tool ID.

The data processing unit142includes an imaging execution unit152, a position specifying unit154, a position control unit156, a shape reproduction unit158, a first edge detection unit160, a second edge detection unit162, an image conversion unit164, a tool registration unit166, and a movable range adjusting unit168.

The imaging execution unit152instructs the camera106to capture an image. The position specifying unit154calculates the moving direction of the spindle116by a method described later when imaging the tool102. The position control unit156moves the spindle116when the tool102is imaged. The shape reproduction unit158generates “tool shape data” that indicates the three-dimensional shape of the tool102on the basis of the captured image. The first edge detection unit160detects “first edge-points” indicating a contour position of the tool102. The second edge detection unit162also detects “second edge-points” indicating a contour position of the tool102. The image conversion unit164changes the resolution of the captured image.

The tool registration unit166registers the tool ID and tool shape data in the data storage unit144in association with each other. The tool ID and tool shape data may be provided from the image processing device110to the operation control device120. The movable range adjusting unit168is a so-called interference check module and specifies the movable range of the spindle116(the range within which the spindle116can move) on the basis of the type of machine tool100, the shape of the workpiece, and the tool shape data of the tool102in use. The position at which the spindle116interferes with another object, such as a workpiece, varies depending on the shape and size of the tool102. The movable range adjusting unit168specifies the movable range of the spindle116according to the tool in use, on the basis of the tool shape data. The machine tool100moves the spindle116within the movable range of the spindle116.

FIG.5is a schematic diagram illustrating a positional relation between the tool102and an imaging area170.

The imaging area170is located just below the light-receiving surface of the camera106. The camera106images an object within the imaging area170. The position control unit156inserts the tool102into the imaging area170by moving the spindle116. Since the imaging area170is smaller than the tool102, it is not possible to image the entire tool102at one time.

Enlarging the lens of the camera106to enlarge the imaging area170will increase the cost of the camera106. In addition, installing a large camera106occupying large space in the tool recognition area210is undesirable since this will reduce the space of the machining area200. Therefore, in the present embodiment, a scheme is adopted in which the tool102is imaged by a relatively small camera106in multiple times, and the shape of the entire tool102is recognized on the basis of the plurality of the images captured in multiple times.

Tool shape recognition processing (hereafter referred to as “shape recognition processing”) will take longer time as the increase in the number of times of movement of the tool102and the number of images captured by imaging. In order to make the shape recognition processing efficient, it is necessary to move the tool102efficiently so as not to capture an image that is unnecessary for recognizing the tool shape, specifically, an image that does not show the outer shape of the tool102.

Hereafter, the captured image of a part of the tool102imaged by the camera106will be referred to as a “partial image”.

FIG.6is a schematic diagram illustrating a relation between the tool102and a partial image.

At the time of tool registration, the position control unit156moves the tool102(the spindle116) in the negative Y-axis direction, that is, in the direction where the imaging area170goes away from the tip side of the tool102, at a constant speed. The imaging execution unit152constantly monitors the imaging area170. The live view image in the imaging area170is transmitted from the camera106to the image processing device110. When the tip of the blade part112is detected in the imaging area170(live view image), the imaging execution unit152instructs the camera106to capture an image (partial image). When instructed, the camera106captures the first partial image and fixes it to the memory. InFIG.6, a partial image P1is captured first.

Then, the position control unit156further moves the tool102(the spindle116) in the negative Y-axis direction. At this time, the position control unit156slightly moves the spindle116in the negative X-axis direction as well so that the contour of the tool102does not deviate from the imaging area170(details will be described later). After the movement, the imaging execution unit152instructs the camera106to capture a partial image, and the camera106stores the second partial image P2in the memory. In this way, the position control unit156moves the spindle116appropriately to the left and right (X-axis direction) while gradually moving the spindle116in the negative Y-axis direction.

The imaging execution unit152instructs the camera106to perform imaging (capturing of a partial image) in accordance with the movement of the spindle116so that the partial images P1to P8are captured. On the basis of the plurality of partial images P1to P8, the shape reproduction unit158generates the contour of the tool102, i.e., the tool shape data of the tool102. By appropriately moving the spindle116, the contour of the tool102can be appropriately image-recognized while reducing the number of times of partial image capturing.

FIG.7is a flowchart illustrating tool registration processing.

Tool registration is performed after a user inputs a tool ID. When the tool102to be registered is attached to the spindle116and the user inputs the tool ID, the position control unit156sets the rotation angle (e.g., 0 degrees) of the spindle116(S10). Hereafter, the rotation angle of the spindle116is referred to as “spindle rotation angle”. In this embodiment, by rotating the tool102by every 12 degrees, shape recognition processing is performed for a total of 30 (=360/12) angles.

After setting the spindle rotation angle, the position control unit156moves the spindle116in the XY direction, and the imaging execution unit152performs shape recognition processing by capturing a plurality of partial images (S12). Details of the shape recognition processing will be described later with reference toFIG.8below. In the shape recognition processing, the contour of the tool102is specified as point sequence data at the set spindle rotation angle. If there remains an unset spindle rotation angle (S14: N), the process returns to S10to set the next rotation angle (e.g., 12 degree). When shape recognition processing is performed for all 30 spindle rotation angles (S14: Y), the shape reproduction unit158generates tool shape data indicating the three-dimensional shape of the tool102from the point sequence data obtained for the multiple spindle rotation angles (S16). The tool registration unit166registers the tool ID and the tool shape data in the data storage unit144in association with each other (S18).

FIG.8is a flowchart illustrating the shape recognition processing in S12ofFIG.7.

After setting the spindle rotation angle, the position control unit156moves the spindle116in the negative Y-axis direction, and the imaging execution unit152captures a partial image (S20). The first edge detection unit160recognizes the outer shape position of the tool102in the partial image by detecting the first edge-points indicating the contour of the tool102from the partial image (described later in relation toFIG.9) (S22). Next, the position specifying unit154specifies the next imaging position, in other words, the moving direction of the spindle116, on the basis of the partial image of the tool102(S24). The method of specifying the direction of movement will be described later with reference toFIG.11.

When it is necessary to capture the next partial image (S26: N), the position control unit156moves the tool102(the spindle116) in the moving direction specified in S24(S28). Image capturing is completed when the spindle116is moved in the negative Y-axis direction by a predetermined distance (S26: Y), and processing proceeds to S14inFIG.7.

As described above, the shape recognition processing includes the processing of S22to image-recognize the contour of the tool102(hereafter referred to as “outer shape recognition processing”) and the processing of S24to determine the next moving direction of the tool102(hereafter referred to as “direction specifying processing”). Next, outer shape recognition processing and direction specifying processing will be described.

FIG.9illustrates a partial image290when external shape recognition processing is performed.FIG.10illustrates a first edge-point image190.

The partial image290shows a silhouette of the tool102projected from below by the lighting device108. The first edge detection unit160sets scanning lines180ain the positive X-axis direction, and detects points located at the boundary between a dark area182(silhouette region where the tool102exists) and a light area184(region where the tool102does not exist) as the first edge-points192. The first edge detection unit160detects a plurality of first edge-points192while shifting the scanning lines180aat a constant pitch.

Similarly, the first edge detection unit160sets scanning lines180bin the negative Y-axis direction and detects the first edge-points192located at the boundary between the dark area182and the light area184. The first edge detection unit160detects a plurality of first edge-points192while shifting the scanning lines180bat a constant pitch.

Furthermore, the first edge detection unit160sets scanning lines180cin the positive Y-axis direction and detects the first edge-points192located at the boundary between the dark area182and the light area184. The first edge detection unit160detects a plurality of first edge-points192while shifting the scanning lines180cat a constant pitch.

In this way, by setting the scanning lines180a,180b,and180cin the three directions, a plurality of first edge-points192are detected, and the first edge-point image190shown inFIG.10is acquired. The plurality of first edge-points192included in the first edge-point image190provide point sequence data indicating the outer shape of the tool102. In this embodiment, the processing time required for the outer shape recognition processing per partial image is about 200 to 250 milliseconds.

FIG.11illustrates a partial image290when performing the direction specifying processing.FIG.12illustrates a second edge-point image260.

The image conversion unit164sets the resolution of the partial image290to a low resolution of 1/8  in the direction specifying processing. The resolution is reduced in order to suppress the number of pixels to be processed to reduce the load and speed up the direction specifying processing. It is desirable for the shape recognition process to use a high-resolution partial image290to recognize the shape of the tool102; on the other hand, it is more appropriate for the direction specifying processing to use a low-resolution partial image290because this processing is conducted only for specifying the next imaging position.

A reference point250is set at a predetermined position in the partial image290. In this embodiment, the reference point250is set at the center of the partial image. An arbitrary reference line252passing through the reference point250is also set. The reference line252in this embodiment is set in the first quadrant in the XY plane when the reference point250is taken as the origin.

The second edge detection unit162sets scanning lines254ain the positive X-axis direction, and detects points located at the boundary between the dark area182and the light area184as second edge-points194. The second edge detection unit162detects a plurality of second edge-points194while shifting the scanning lines254aat a constant pitch. Similarly, the second edge detection unit162sets scanning lines254bin the negative X-axis direction and detects points located at the boundary between the dark area182and the light area184as the second edge-points194. The second edge detection unit162detects a plurality of second edge-points194while shifting the scanning lines254bat a constant pitch.

The second edge detection unit162sets scanning lines254cin the negative Y-axis direction and detects a plurality of second edge-points194in the same manner while shifting the scanning lines254cat a constant pitch. The second edge detection unit162sets scanning lines254din the positive Y-axis direction and detects a plurality of second edge-points194while shifting the scanning lines254dat a constant pitch.

In this way, by setting the scanning lines254a,254b,254c, and254din the four directions, a plurality of second edge-points194are detected, and the second edge-point image260shown inFIG.12is acquired. The second edge-points194are fewer than the first edge-points192since the resolution of the partial image is reduced.

Next, the position specifying unit154sets a verification line262connecting the reference point250and a second edge-point194. The position specifying unit154calculates the angle formed by the verification line262and the reference line252(hereafter referred to as “edge angle”), and specifies the second edge-point194A with the smallest edge angle as the “selected second edge-point”. In the second edge-point image260, the edge angle is minimum when the second edge-point194A is selected. The position specifying unit154determines the next imaging position on the basis of the verification line262A at this time.

As shown inFIG.12, the second edge-point194A (selected second edge-point) selected by the position specifying unit154on the basis of the edge angle is set on the far side from the tip of the tool102, in other words, the root side of the tool102as viewed from the reference point250set in the second edge-point image260. Then, the position specifying unit154determines the next imaging position so that the second edge-point194A moves to the position of the lower half (tip side of the tool102) in the tool length direction (Y-axis direction inFIG.12) of the tool102(“upper” means root side of the tool102and “lower” means tip side of the tool102). The position specifying unit154also determines the next imaging position so that the second edge-point194A moves to the center side in the tool radial direction (X-axis direction inFIG.12) of the tool102. InFIG.12, since the second edge-point194A (selected second edge-point) is located on the positive Y-axis direction side (upper side) and the negative X-axis direction side (left side) of the second edge-point image260, the position specifying unit154moves the tool102along a movement vector264(negative Y-axis direction and positive X-axis direction) to change the relative positions of the imaging area170and the tool102so that the second edge-point194A (selected second edge-point) moves to the lower side and to the center side.

That is, the position specifying unit154moves the tool102(the spindle116) along the verification line262A in the direction indicated by the movement vector264shown inFIG.12. At this time, the Y component (insertion direction) of the movement vector264of the tool102may be constant. That is, according to the magnitude of the minimum edge angle, the position control unit156adjusts the magnitude of the X component of the movement vector264for the tool102. When the tool102moves in the direction of the movement vector264, the second edge-point194A (the point indicating the contour line) moves toward the center in the next partial image290. With such a control method, it is possible to control so that the contour line of the tool102does not come off in the imaging area170, in other words, so as not to capture a partial image that does not include the contour line. In the present embodiment, the processing time required for direction specifying processing per partial image is about 10 to 20 milliseconds.

FIG.13illustrates the tool shape data of the tool102.

The position control unit156sets the spindle rotation angle of the tool102about the Y-axis center, and then moves the tool102in the X-axis direction on the basis of the edge angle while also moving the tool102in the negative Y-axis direction. The outer shape of the tool102is specified by capturing the partial image290in the imaging area170and detecting the first edge-points192from the partial image290. After detecting the first edge-points192, the next imaging position is adjusted by detecting the second edge-points194. A plurality of partial images are captured per spindle rotation angle. Then, the position control unit156rotates the tool102by 12 degrees and performs the same process for the next spindle rotation angle.

If ten partial images290are captured per one spindle rotation angle, a total of300partial images290can be captured by30spindle rotation angle settings. The point sequence series data shown in the first edge-point image190are obtained from these partial images290. The shape reproduction unit158synthesizes the point sequence data of each partial image290to generate the tool shape data shown inFIG.13, i.e., the point sequence data indicating the three-dimensional shape of the tool102.

Summary of Embodiment

The image processing device110and the machine tool100have been described on the basis of the above described embodiment.

According to this embodiment, after a user attaches the tool102to the spindle116and inputs the tool ID, the tool shape data is automatically generated, and the tool ID and the tool shape data are registered in association with each other. The number of tools102registered in the tool storage unit130may be several dozen. Therefore, automating the registration of tool shape data has a great effect on improving the work efficiency of the machine tool100.

In this embodiment, a small camera106is used to image only a part of the tool102. The use of a small camera106reduces the cost of the camera106and also contributes to the space saving of the machining area200. By performing direction specifying processing on the second edge-point image260, the outer shape of the tool102can be appropriately recognized while reducing the number of times of capturing the partial image290. A partial image290not including the contour of the tool102is unnecessary for the shape recognition of the tool102. The position specifying unit154adjusts the amount of movement of the camera106in the X-axis direction on the basis of the edge angle so that the partial image always captures the outer shape of the tool102.

In addition, the resolution of the partial image used in the direction specifying processing is set lower than that of the partial image used in the shape recognition process to speed up the direction specifying processing. Recognizing the outer shape of the tool102with a high-resolution partial image and specifying the moving direction of the tool102with a low-resolution partial image will improve both image recognition accuracy and processing speed.

The present invention is not limited to the embodiment described above and modifications thereof, and any component thereof can be modified and embodied without departing from the scope of the invention. Components described in the embodiment and modifications can be combined as appropriate to form various embodiments. Some components may be omitted from the components presented in the embodiment and modifications.

Modifications

In the above description, the shape reproduction unit158generates tool shape data as point sequence data (seeFIG.13). However, the shape reproduction unit158may generate tool shape data as a polygon by applying a texture to the point sequence data.

In the above embodiment, the camera106is fixed while moving the tool102(the spindle116). As a modification, the tool102(the spindle116) may be fixed while moving the camera106. Alternatively, both the camera106and the tool102(the spindle116) may be moved. In any case, a partial image may be captured while changing the relative positions of the camera106and the tool102.

In the above embodiment, the shape recognition processing is followed by the direction specifying processing. As a modification, the shape recognition processing and the direction specifying processing may be executed in parallel.

In the above embodiment, the first edge-points192are detected for the outer shape recognition of the tool102and the second edge-points194are detected for the directional control of the tool102(the spindle116). As a modification, the position specifying unit154may specify the moving direction of the tool102by calculating the verification line262and the edge angle on the basis of the first edge-points192.

The image processing device110may include a receiving unit and an image processing unit. The receiving unit of the image processing device110receives a first partial image including a part of the tool102from the camera106. Similarly, the receiving unit receives a second partial image including another part of the tool102from the camera106. That is, the camera106or an image capturing device equipped with the camera106may have the functions of the imaging execution unit152, the position specifying unit154, the position control unit156, the second edge detection unit162, and the image conversion unit164. The image processing unit of the image processing device110has the functions of the shape reproduction unit158and the first edge detection unit160.

The image processing unit of the image processing device110receives the first partial image (e.g., partial image P1inFIG.6) and the second partial image (e.g., partial image P2inFIG.6) corresponding to the next imaging position with the camera106or the like. The same applies to the subsequent partial image (partial image P3). The image processing unit extracts first contour data indicating the contour of the tool102from the first partial image and second contour data indicating the contour of the tool102from the second partial image. The method for extracting the contour data is the same as the method described in relation toFIGS.11and12. Then, the image processing unit may reproduce the tool contour data of the tool102on the basis of the contour data (point group) obtained from a plurality of partial images.

In the above embodiment, the tool102is imaged sequentially from the tip to the root after the spindle rotation angle is set to a predetermined angle, and the spindle rotation angle is changed after the imaging is completed. The present invention is not limited to this and the tool102may be continuously imaged by the camera106while rotating the tool102. For example, the camera106may capture images in multiple angles while rotating the camera106by synchronizing the rotation timing of the spindle116with the imaging timing of the camera106so that the camera106captures images of the tool102every t seconds while rotating the tool102by a predetermined angle every t seconds. After one rotation of the camera106at a predetermined position, the camera106may be moved horizontally in the XY direction and the camera106may perform image capturing again from multiple angles at another position.

The camera106may image the tool102at regular time intervals. At this time, the camera106may send a synchronization signal to the image processing device110in accordance with the imaging timing. The image processing device110may control the timing of the movement or rotation of the tool102in accordance with this synchronization signal.

It is also possible that the imaging timing of the camera106and the rotation timing of the spindle rotation angle do not perfectly match. The camera106may transmit a synchronization signal to the machining control unit122and the image processing device110at the imaging timing, and the image processing device110may measure the rotation angle of the spindle116when the synchronization signal is received. For example, it is assumed that the tool102is imaged by the camera106at a timing when the spindle rotation angle is set to 36 degrees. However, imaging might be performed when the rotation of the spindle116is not fully completed, e.g., when the spindle rotation angle is 35.99 degrees. Therefore, the machining control unit122may measure the actual spindle rotation angle at the imaging timing, and the imaging execution unit152may store the partial image and the actual spindle rotation angle in association with each other. With such a control method, the actual spindle rotation angle in the partial image (captured image) can be accurately recorded, which makes it easier to reproduce tool contour data more accurately.

The image processing device110may perform: a step of capturing a partial image including a part of the tool102by the camera106; a step of specifying a next imaging position on the basis of the partial shape of the tool102included in the partial image; a step of changing the relative positions of the tool102and the camera106to the specified imaging positions; and a step of capturing a partial image including a part of the tool102at the next imaging position.

The various computers exemplified by the image processing device110may execute a computer program that implement: a function of capturing a partial image including a part of the tool102by the camera106; a function of specifying the next imaging position on the basis of the partial shape of the tool102included in the partial image; a function of changing the relative positions of the tool102and the camera106to the specified imaging positions; and a function of capturing a partial image including a part of the tool102at the next imaging position.

FIG.14is a schematic view illustrating a partial image at the time of tool tip detection in Modification 1.

In the partial image290(imaging area170), the position specifying unit154specifies the tip of the tool102(hereafter referred to as “tool tip”). The center of the partial image290is the reference point250. With regard to the partial image290inFIG.14, the lower side of the drawing (the negative Y-axis side) is referred to as the “lower side” and the upper side of the drawing (the positive Y-axis side) is referred to as the “upper side”.

The extending direction of the tool102is referred to as the “tool length direction” and the radial direction (transverse direction) of the tool102is referred to as the “tool radial direction”. The line in the Y-axis direction passing through the reference point250is called the “center line292”. In the tool radial direction, the direction toward the center line292is called the “center side” and the direction away from the center line292is called the “end side”.

The partial image290is equally divided into four regions with the reference point250as the center, the upper right region is referred to as the first area C1, the upper left region is referred to as the second area C2, the lower left region is referred to as the third area C3, and the lower right region is referred to as the fourth area C4.

By a method similar to that described in relation toFIGS.11and12, the position specifying unit154specifies a plurality of second edge-points194. In Modification 1, the position specifying unit154selects the second edge-points194farthest from the reference point250. InFIG.14, the second edge-points194farthest from the reference point250are a second edge-point194B and a second edge-point194C. The position specifying unit154selects a second edge-point194located on the first area C1or on the center line292from the second edge-point194B and the second edge-point194C. InFIG.14, the second edge-point194B in the first area C1is selected. The position control unit156instructs the moving direction of the tool102to the machining control unit122so that the selected second edge-point194B (selected second edge-point) overlaps with the reference point250.

FIG.15is a schematic view illustrating a partial image after tool movement in Modification 1.

By the movement of the tool102, the second edge-point194B coincides with the reference point250. The position control unit156again selects a second edge-point194E farthest from the reference point250. However, the second edge-point194E does not satisfy the condition “on the first area C1or on the center line292”. Then, the position control unit156selects the second edge-point194D which is next farthest as compared with the second edge-point194E. The second edge-point194D lies on the center line292, thereby satisfying the above condition. At this time, the position control unit156instructs the moving direction to the machining control unit122so that the second edge-point194D (selected second edge-point) overlaps with the reference point250. In Modification 1, a plurality of partial images290are acquired from the tool102by repeating such control.

FIG.16is a first schematic diagram illustrating a position control method when a second edge-point is detected in the third area in Modification 2.

In Modification 2, the partial image290is divided into six regions from the first area D1to the sixth area D6as shown inFIG.16. Here, it is assumed that a second edge-point194F (the farthest second edge-point194from the reference point250) is detected in the upper left third area D3.

FIG.17is a second schematic diagram illustrating a position control method when a second edge-point is detected in the third area in Modification 2.

In Modification 2, the position control unit156instructs the moving direction of the tool102to the machining control unit122so that the second edge-point194F is included in the fifth area D5. As shown inFIG.17, when the second edge-point194E is detected in the third area D3, the tool102will move in both the Y direction (tool length direction) and the X direction (tool radial direction).

FIG.18is a first schematic diagram illustrating a position control method when a second edge-point is detected in the sixth area in Modification .

Here, it is assumed that a second edge-point194G (the farthest second edge-points194from the reference point250) is detected in the lower right sixth area D6.

FIG.19is a second schematic diagram illustrating a position control method when a second edge-point is detected in the sixth area in Modification 2.

As inFIG.16andFIG.17, the position control unit156instructs the moving direction of the tool102to the machining control unit122so that the second edge-point194G is included in the fifth area D5. As shown inFIG.19, when the second edge-point194G is detected in the sixth area D6, the tool102will move in the X direction (tool radial direction).

In this way, the position specifying unit154detects multiple second edge-points194and selects a second edge-point194in the upper half (first area D1to third area D3) of the partial image290(imaging area170). Although the second edge-point194farthest from the reference point250is selected inFIGS.17to19in the above example, any second edge-point194in the upper half may be selected. The position control unit156instructs the moving direction of the tool102to the machining control unit122so that the selected second edge-point194is positioned in the middle region (the fifth area D5) in the lower half that is divided into three regions.