The invention relates generally to simulation of machining, and more particularly to determining a defect on a surface of a model of an object.
Simulation of numerically controlled (NC) machining is of fundamental importance in computer aided design (CAD) and computer aided manufacturing (CAM). During the simulation, a computer model of an object is edited with a computer representation of an NC machining tool and a set of NC machining tool motions to simulate the machining. The object model and tool representation can be visualized during the simulation to detect potential collisions between parts, such as the object and the tool holder, and to verify the final shape of the object after the simulation. The simulation of the machining of the object creates a virtual surface corresponding to the actual surface of the object to be machined.
The final shape of the object is affected by the selection of the tool and the tool motions. Instructions for controlling these motions are typically generated using the CAM system from a graphical representation of the desired final shape of the object. The motions are typically implemented using numerical control programming language, also known as preparatory code or G-Code, see the following standards RS274D and DIN 66025/ISO 6983.
The G-Code generated by the CAM system may not produce an exact replication of the desired shape. In addition, the movement of the NC tool is governed by motors of the NC machining system, which have limited speeds, ranges of motion, and abilities to accelerate and decelerate, so that the actual tool motions may not exactly follow the NC machining instructions.
Moreover, the CAD model may be erroneous, due to artifacts. If the defects are introduced during the CAD process, then the comparison of the actual object with simulated object does not locate the differences. If the detects are introduced during the simulation, then the comparison between the actual and simulated objects might also be ineffective. For example, the actual and the simulated objects can have differences in scale and accuracy requirements.
Discrepancies between the actual final shape of the object and the desired final shape of the object can be very small, and difficult to see. In some cases, these discrepancies result in undesirable gouges or nicks in the surface of the final shape of the object with sizes on the order of a few micrometers in depth and width, and tens of micrometers in length. These surface defects of the simulated object can lead to non-smooth and non-flat finish of the manufactured object and visually appear as scratches or tiny bumps, barely observable by the eye. Such defects are undesirable and often unacceptable.
The conventional methods for determining defects of a surface of an object fall into two classes. According to the first class of methods, the surface is displayed to an operator for visual inspection. Typically, a set of NC machining instructions is tested by machining a test object made of a softer, less expensive material prior to machining the actual object. The operator finds the surface defects and marks their locations. If the visual inspection of the test object locates undesirable discrepancies in the test object, then the NC machining instructions are modified accordingly. However, such manual testing is time consuming, expensive, and the defects are difficult to see, if at all.
The time required to machine a single test object may be on the order of hours. In addition, several iterations may be required before an acceptable set of NC machining instructions is attained. Thus, it is desirable to test for these discrepancies using computer-based simulation and rendering. Because the NC machining simulator is capable of producing very small defects, e.g., 10s to 100s of microns, in very large simulated parts, e.g., 1000s of millimeters, the problem of locating these small defects is challenging.
The second class of methods determines defects on the surface of the object by analyzing the path of the machining tool during the NC simulation. For example, normal vectors along the path of the tool are analyzed and the defect can be determined based on orientations or rate of change of orientations of the normal vectors, see US patent application 2011/0320023.
However, that method uses the information about the surface only in a small neighborhood around the defect, which may not be optimal for some applications.
Various embodiments of the invention are based on a realization that symmetry of an object differs from the symmetry of defects of a surface of the object. Thus, the symmetry, which is global information about the object, can be utilized to detect and remove the defects of the surface of the object.
If the object includes a defect, the comparison between the surfaces of the object and the surface of a symmetric representation of the object determines a pair of unmatched areas of the surfaces, which include the defect. Accordingly, using only global information about symmetry of the object, the defects of the surface of the object can be identified.
Some embodiments of the invention generate multiple symmetric representations of the object to specifically identify the area of the defect. If there is a defect on the surface of this object, then the defect is detected by comparing the area of the surface with its two symmetric representations having the same defect in different, symmetric locations. One embodiment, after detecting the defect, fixes the model of the object to generate a model of the object without the defect on the surface.
Accordingly, one embodiment of the invention discloses a method for determining a defect on a surface of an object. The method includes steps of generating a symmetric representation of at least part of the object; determining a pair of unmatched areas between the surface of the object and a surface of the symmetric representation; and determining the defect on the surface of the object based on the pair of unmatched areas. The steps of the method are performed by a processor.
Another embodiment discloses a method for determining a defect of a surface of an object due to machining the object, wherein the surface is generated from a model of the object by a simulation of the machining. The method includes steps of generating a first symmetric representation of a part of the surface; generating a second symmetric representation of the part of the surface, wherein the first and the second symmetric representations are mutually symmetric; and determining the defect as a common difference between the surface of the object with the first symmetric representation and the second symmetric representation. The steps of the method are performed by a processor.
Yet another embodiment discloses a system for determining a defect of a surface of an object due to machining the object, wherein the surface is generated from a model of the object by a simulation of the machining process. The system includes a processor for determining the defect based on a comparison of the surface of the object with a surface of a symmetric representation of the object.
The embodiments of the invention are based on a realization that symmetry of an object generally differs from the symmetry of defects of a surface of the object. Thus, the symmetry, which is global information about the object, can be utilized to detect and remove the defects of the surface of the object.
Thus, if the object includes a defect, comparison between the surfaces of the object and the surface of the symmetric representation of the object determines a pair of unmatched areas 135 and 137 of the surfaces. Accordingly, using only global information about symmetry of the object, the defects of the surface of the object can be identified.
However, such comparison can only identify potential areas of the defect. It is unclear whether the defect is in the area 135 or in area 137, because no knowledge is available regarding which of the two areas is defective. For some applications such detection is sufficient and over-inclusivity of the detection of the defect may be preferred.
Some embodiments of the invention generate multiple symmetric representations of the object to uniquely identify the area of the defect. If there is a defect on the surface of this object, then the defect is detected by comparing the area of the surface with its two symmetric representations having the same defect in different, symmetric locations. One embodiment, after detecting the defect, fixes the model of the object to generate a model of the object without the defect on the surface.
For example as shown in
Various embodiments of the invention acquire information of the symmetry of the objects. Such information may be available from CAD software as a high-level description of the CAD object. Alternatively, the information can be provided, e.g., by an external process or by an operator. In another embodiment, the symmetry is determined from the CAD data by specialized software for symmetry recognition.
At least ideally or by design, the symmetry of the object or part of the object means that the object is identical to its symmetric representation. The symmetric representation is constructed by a geometrical transformation corresponding to the symmetry of the object. Such transformations can include reflections, rotations, translations, or combinations of these basic operations.
For example, the reflection or mirror symmetry of an object in three dimensions is symmetry with respect to reflection of the object using a plane or mirror of symmetry. The reflected image of the object is identical (apart from defects) to the object. Various embodiments of the invention compare a reflective symmetric part of the object to its reflection. Comparing just reflections can be advantageous for fast detection of the defects, e.g., when the requirement is only to highlight two potential defect areas rendered on a display device. However, the comparison is done only to a single symmetric representation, which determines the location on the defect only up to the reflection, so both mutually reflective locations need to be marked.
The front and the back surfaces of the object 320 are mutually symmetric, i.e., the surfaces are symmetric representation of each other. Thus, by comparing the front and the back surfaces of the object, any difference of the surfaces indicates a defect. Accordingly, one embodiment segments a model of the object into a set of mutually symmetric parts including a first mutually symmetric part and a second mutually symmetric part, and compares the mutually symmetric parts to determine the defect. For example, in the embodiments of
In the example of
In some embodiments, the information about the symmetric patterns of the object is provided. In alternative embodiments, the symmetry of the object is determined automatically, or with operator assistance. For example, one embodiment segments the object as a union of the symmetric shapes with known symmetries. Examples of such shapes are basic shapes, such as spheres, cubes, etc.
Some embodiments segment the object into a plurality of parts including the symmetric part. In this case, the embodiment makes a virtual center circular cut out 830 in order to segment the symmetric part 835 of the object. The segmented part 835 has a cylindrical symmetry. Cylindrical symmetry, compared to reflective symmetry, generates an infinite number of symmetric representations, i.e., the part 835 can be symmetrically rotated around the axis 820 by any angle. Accordingly, the segmenting allows analyze symmetric parts of the object separately to determine the defects 840. Thus, some embodiments can detect the defect on the surface of the object even if the entire object is not symmetric.
A surface 925 of the model of the object is simulated by a rendering module 920 based on underlying representation 910 of the surface of the object. The surface symmetry generation module 930 generates symmetric representations 935 of the simulated surface 925 at each pixel of the surface, using the symmetry 915 of the object.
The symmetry comparison module 940 determines difference between the simulated surface 925 and its symmetric representations 935 and compares the difference with one or more thresholds 945 to determine the symmetry violations, i.e., the defects of the surface 946. One embodiment compares the symmetry violations to a minimal threshold, i.e., portions of the surface corresponding to the symmetry violations of the surface with values above the minimum threshold are identified. Additionally or alternatively, another embodiment compares the symmetry violations to a maximal threshold, i.e., portions of the surface corresponding to the symmetry violations of the surface with the values below the maximal threshold are identified.
In various embodiments, the minimal and/or maximal thresholds are determined based on a shape of the original surface, a size of the tool, the machining instructions, and/or a desired accuracy.
The machining includes, but is not limited to, turning, milling, and drilling operations. Depending on the operation, the machining further includes selecting a tool, e.g., a type of the tool such as a single point tool or a multiple-cutting-edge tool, shape, materials, and dimensions of the tools, determining directions of the motion of the tools, the step over distance of the tools, and determining machining instructions for the operation. In turn, the machining instructions include an order of operations and a path for the tool.
The machining controls a desired accuracy of the surface. For example, the step over distance for roughing cuts can be greater than the step over distance for finishing cuts. However, a value of the step over distance is just a one example of controlling the smoothness of the surface by the machining process. Accordingly, several embodiments of the invention determine the minimal and/or the maximal threshold based on the machining process that generates the surface of the object. Similarly, some embodiments determine the thresholds based on the simulation of the machining process that generates the surface of the model of the object.
An output 955 of the method is processed by an output module 950. For example, the output module stores indentified portions of the surface with defects in a memory (not shown). Additionally or alternatively, the output module displays the model of the object on a display device highlighting the portions 840 of the surface with defects, as shown in
In some embodiments, the simulated surface 925 and its symmetric representations 935 are produced or compared using the normal vectors, as described below.
Some embodiments of the invention determine the orientations of the surface based on the normal vectors. As referred herein, a normal vector at a pixel has a length of one and is perpendicular to the surface at a location corresponding to the pixel. For example, referring to the
Embodiments of the invention are also based on the realization that the dependency of cusp angle on cut depth is reflected in an orientation of a surface of the object and/or a model of the object rendered during the simulation. Thus, the orientation of the surface, determined by the normal vectors, and, in particularly, a rate of changes in the orientation, can be used to locate defects of the model of the object. For example, regions of the simulated surface that are less smooth can be identified and highlighted. The difficulty in this approach is that one cannot always be sure whether or not the less smooth region is necessarily a surface defect, or a design feature. This difficulty is removed by embodiments of the invention, which determine defects of a surface of an object by comparing the symmetric patterns of orientations and rate of change in the orientation. The use of normal vectors to characterize the rate of changes in the surface orientation increases the sensitivity of locating the surface defects using the surface symmetric patterns.
For example, one embodiment discloses a method for determining a defect of a surface of an object due to a machining process applied to the object, wherein the surface is generated from a model of the object by a simulation of the machining process, comprising the steps of: determining, at each pixel of the model of the surface, orientations of the surface; determining, for each pixel of the model of the surface, a rate of change in the orientations of the surface; and comparing the rate of change to at least one rate of change in a symmetric counterpart of the pixel.
In one embodiment, the surface is rendered by a ray casting method where virtual rays associated with each pixel are projected onto the simulated surface from a viewing direction. The color and brightness of each ray that intersects the surface is determined by a surface color and the normal vector at a point of intersection.
Another example of a representation of the surface 1201 is a mesh of geometric primitives such as polygons. In one embodiment, a triangle mesh is rendered using a graphics application programming interface (API) such as OpenGL. Usually the color and the normal vector are defined at each vertex of a triangle interpolated by the graphics implementation across the pixels spanned by the triangle according to viewing conditions.
The normal vectors are used to compute the brightness of the pixel as though the surface was lit by a light arranged above the surface. As an example, one computer lighting technique determines the brightness of the pixel as a sum of an ambient component independent of the normal vectors, a diffuse component proportional to the vector dot product between the normal vector and a vector from the surface to the light position, and a specular component proportional to the dot product between the surface normal vector and a vector halfway between the viewing direction and the light direction, raised to a power determined by a reflection of the surface.
Usually, the normal vector for each pixel in the image of the surface is used to compute the brightness of the pixel, and then discarded. The resultant pixel values are stored in a memory called a color frame buffer, and can be displayed, stored, or transmitted.
One embodiment of the invention reuses the normal vectors for representing the surface, instead of discarding the normal vectors determined to compute the brightness of the pixels. In this embodiment, instead of immediately computing the pixel brightness using the normal vectors, the normal vectors 1203 for every pixel in the image of the surface are stored into a normal frame buffer 1204. After all of the normal vectors have been stored, the normal vectors are processed to identify and/or highlight defects, using the information about the surface symmetry patterns, which the normal vectors must follow.
In one embodiment, the symmetry violations R are detected based on differences 1205 between the actual normal vector at the given pixel and the normal vector(s) at the pixel symmetric representation. The regions of the surface with the symmetry violation values below the minimal threshold RL 1207 are free of defects. Some embodiments change 1209 colors of pixels, e.g., in a red color, in the detect range, while colors of other pixels are computed normally 1206 using the values stored in the normal framebuffer. After the pixels corresponding to the defect regions are determined, the pixels can he stored in the memory 1211 and the colors of those pixels can be stored in the color frame buffer 1210.
Another embodiment generates a list of possible defect areas on the simulated surface, and outputs this list to the user. For example, the list can be presented as rectangular boxes superimposed on the low resolution image and enclosing the possible defect regions. The operator can then view these regions more closely to make a final determination as to the existence of an actual defect. Additionally or alternatively, the defect list is presented in a text format describing location and character of the possible defect. It is advantageous to use a user interface such that the user can selects an entry in the defect list to have the simulated image reorient, center and zoom into the defect region.
Although the invention has been described by way of examples of preferred embodiments, it is to be understood that various other adaptations and modifications may be made within the spirit and scope of the invention. Therefore, it is the object of the appended claims to cover all such variations and modifications as come within the true spirit and scope of the invention.