Workpiece detection method and device based on feature recognition and medium
By automatically generating detection points and trajectories through feature recognition technology, the inefficiency and insufficient accuracy caused by the reliance on manual intervention in existing CAM software are solved, achieving efficient and accurate in-machine detection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- WEICHAI POWER CO LTD
- Filing Date
- 2026-03-11
- Publication Date
- 2026-05-08
AI Technical Summary
Existing CAM software relies on manual intervention in in-machine inspection functions, resulting in low efficiency and insufficient accuracy in generating inspection programs, making it difficult to meet the high-efficiency and precision requirements of precision manufacturing.
By using a feature recognition-based method, the machining feature type of the workpiece is automatically determined, a detection template and detection information are generated, detection points and trajectories are automatically generated, and operation logic such as out-of-tolerance alarm and coordinate compensation is executed in combination with the detection results to achieve automated in-machine inspection.
It significantly improves the programming efficiency and detection effect of in-machine detection, ensures reasonable distribution of detection points, reduces errors, and enhances the reliability and consistency of detection results.
Smart Images

Figure CN121995860A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of workpiece detection, specifically to a workpiece detection method, equipment, and medium based on feature recognition. Background Technology
[0002] In the field of machining, Computer-Aided Manufacturing (CAM) software has become a core tool for achieving digitalization and efficiency in the machining process. Its core function focuses on the automated generation of toolpaths, accurately generating toolpaths that meet machining requirements based on part design models and machining process parameters. However, as precision manufacturing demands increasingly higher real-time and accurate quality inspection of machined parts, in-machine inspection (i.e., feature detection of parts during machining using detection equipment mounted on the machine tool) has become a crucial link in ensuring machining quality, but existing CAM software has significant shortcomings in supporting this function. like Figure 1 As shown, the in-machine inspection function of existing CAM software generally relies on manual intervention to generate the inspection program: operators need to manually select and specify the features to be inspected (such as holes, slots, planes, and other geometric features) from the part model one by one, and then manually plan the position of the inspection points, the inspection sequence, and the inspection motion parameters based on the selected features, finally generating the inspection trajectory. This manual operation mode has two major problems: On the one hand, manual point selection and trajectory planning require operators to have rich professional experience, which is not only tedious and time-consuming, but also the rationality of the distribution of inspection points and the degree of trajectory optimization depend entirely on personal experience and judgment, resulting in low efficiency in generating the inspection program; on the other hand, manual operation is prone to errors due to subjective judgment differences or operational negligence, resulting in problems such as redundant paths, missing inspection points, or insufficient inspection accuracy in the generated inspection trajectory, which in turn affects the reliability and consistency of the inspection results, resulting in poor usability of the inspection program and difficulty in meeting the needs of efficient and accurate in-machine inspection in precision manufacturing scenarios. Summary of the Invention To address the aforementioned problems, this application proposes a workpiece detection method, device, and medium based on feature recognition, wherein the method includes: In response to receiving a detection request, the system determines the machining features contained in the workpiece to be detected and acquires all machining feature information; based on the machining feature information, it determines the feature type of the machining feature, and based on the feature type, it determines a detection template and detection information, wherein the detection information includes at least one of the machining content of the current process, the detection focus dimension, and tolerance information; based on the detection information, it generates detection points corresponding to all surfaces of the workpiece to be detected; it assigns the detection points to the detection template to generate a detection trajectory, and detects the workpiece to be detected according to the detection trajectory.
[0003] In one example, before determining the detection template and detection information based on the feature type, the method further includes: defining detection templates for multiple detection processes according to the feature type and a general detection template; the detection template includes detection actions for detecting different types of features, the detection actions including moving to the position to be measured and the operation process of detecting the corresponding feature; the detection template type includes at least one of point detection template, hole detection template and surface detection template.
[0004] In one example, the detection template is also used to perform at least one of the following operational logics based on the detection result: out-of-tolerance alarm, coordinate compensation, or machining coordinate system compensation.
[0005] In one example, generating detection points corresponding to all surfaces of the workpiece to be detected based on the detection information specifically includes: determining the detection information of the planar machining feature in response to the machining feature being a planar machining feature; creating a detection coordinate system with the normal direction of the plane as the first coordinate axis direction and the direction of the longest side of the in-plane contour as the second coordinate axis direction; establishing a rectangle with the extreme points of the coordinates of the in-plane contour within the detection coordinate system as vertices; drawing straight lines along a preset direction within the rectangle according to tolerance requirements to form intersection points; if the intersection points are located on the current plane, then the intersection points are detection points; if the intersection points are not located on the current plane, then moving the intersection points along the direction of the longest side of the in-plane contour onto the current plane to serve as detection points.
[0006] In one example, if the intersection point is not on the current plane, then moving the intersection point to the current plane along the longest side of the in-plane contour to serve as a detection point specifically includes: if the distance between the moved first detection point and the second detection point is less than a preset distance; determining the midpoint between the first detection point and the second detection point; removing the first detection point and the second detection point, and using the midpoint as the detection point.
[0007] In one example, generating detection points corresponding to all surfaces of the workpiece to be detected specifically includes: in response to the machining feature being a cylindrical surface machining feature, determining the detection information of the cylindrical surface machining feature; if the cylindrical surface is a complete cylindrical surface, taking a preset point on the axis of the cylindrical surface as the starting point, and selecting a first number of detection points along a preset direction based on a preset distance; if the cylindrical surface is a non-complete cylindrical surface, obtaining the edge position of the non-complete cylindrical surface, and selecting a second number of detection points starting from the edge based on different preset angles.
[0008] In one example, assigning the detection points to the detection template to generate a detection trajectory specifically includes: loading the corresponding detection programming template according to the detection points and each feature information; generating the detection program for each detection point in sequence according to a preset movement order, and integrating them into a detection trajectory.
[0009] In one example, after the integration into the detection trajectory, the method further includes: The post-processor reads the tool position source file corresponding to the probe CAM trajectory, calls the corresponding event generator according to the marking information of the probe template, and generates a CNC program that includes probe action control and measurement result application. The measurement result application includes: triggering an alarm and terminating machining in response to the measurement result exceeding the tolerance requirement; maintaining the machining state in response to the measurement result being within the first interval of the tolerance requirement; and outputting coordinate compensation or machining coordinate system compensation prompts in response to the measurement result being within the second interval of the tolerance requirement.
[0010] This application also provides a workpiece detection device based on feature recognition, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the steps of the method as described in any of the above examples.
[0011] This application also provides a non-volatile computer storage medium storing computer-executable instructions, characterized in that the computer-executable instructions are configured to perform the steps of the method as described in any of the above examples.
[0012] The method proposed in this application can bring the following beneficial effects: by acquiring process information and comparing it with pre-stored feature process information, key detection features can be accurately screened, and detection points can be intelligently generated by combining the geometric characteristics of workpiece features and processing requirements, which significantly improves the programming efficiency and application effect of in-machine detection. Attached Figure Description
[0013] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings: Figure 1 This is a schematic diagram of the interface for generating a detection process trajectory in a prior art according to an embodiment of this application; Figure 2 This is a flowchart illustrating a workpiece detection method based on feature recognition in an embodiment of this application. Figure 3 This is a schematic diagram illustrating how to determine the starting point in a cylindrical surface according to an embodiment of this application; Figure 4 This is a schematic diagram illustrating the determination of a detection point within a complete cylindrical surface in an embodiment of this application; Figure 5 This is a schematic diagram illustrating the determination of a detection point within a non-complete cylindrical surface in an embodiment of this application. Detailed Implementation
[0014] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0015] The technical solutions provided by the various embodiments of this application are described in detail below with reference to the accompanying drawings.
[0016] Figure 1 This document presents a flowchart illustrating a feature-based workpiece detection method according to one or more embodiments of this specification. The process can be executed by a computer device, and certain input parameters or intermediate results can be manually adjusted to improve accuracy. The analysis method described in this application can be implemented using a terminal device or a server; this application does not impose any special limitations on this. For ease of understanding and description, the following embodiments are described in detail using a computer device as an example.
[0017] like Figure 2 As shown in the figure, this application provides a workpiece detection method based on feature recognition, including: S201: In response to receiving a probe request, determine the machining features contained in the workpiece to be probed, and acquire all machining feature information.
[0018] First, after receiving a detection request, the computer equipment acquires the machining features of the workpiece to be detected, such as holes and planes. After acquiring the machining features, it obtains the corresponding feature information for each machining feature, such as hole diameter, hole depth, and plane area.
[0019] S202: Based on the processing feature information, determine the feature type of the processing feature, and determine the detection template and detection information based on the feature type.
[0020] After obtaining the machining feature information, the feature type of each machining feature in the workpiece to be probed can be determined by comparing it with pre-stored machining feature information corresponding to different types of machining features. This means identifying the specific machining feature, such as the main shaft hole of an engine, pin holes, or planes. Once the feature type is determined, the corresponding probe template and probe information can be determined based on the feature type. The probe information includes the machining content of the current process, the key dimensions for probe, and tolerance information.
[0021] S203: Based on the detection information, generate detection points corresponding to all surfaces of the workpiece to be detected.
[0022] After obtaining the detection information, the detection points corresponding to each surface of the workpiece to be detected can be generated based on the detection information. The workpiece to be detected may include planes and cylindrical surfaces. The detection points refer to the measurement points that the probe will pass through during the detection process.
[0023] S204: Assign the detection points to the detection template to generate a detection trajectory, and detect the workpiece to be detected according to the detection trajectory.
[0024] After automatically generating the detection points, the detection trajectory can be generated by inputting the detection points into the detection template. After obtaining the detection trajectory, the post-processor can read the position information of each point on the trajectory, generate a CNC program, and control the probe to detect the workpiece.
[0025] In one embodiment, before determining the detection template, detection templates for various detection processes are first defined based on feature types and general detection templates. The detection templates include detection actions for detecting different types of features, and the detection actions include moving to the position to be measured and the operation process of detecting the corresponding feature. The detection template types include at least one of point detection templates, hole detection templates, and surface detection templates.
[0026] Specifically, before programming the in-machine probing, the computer equipment needs to define a variety of specialized probing process templates based on the common machining feature types of the workpiece to be probed (such as points, holes, planes, cylinders, etc.) and in conjunction with general probing templates (such as the probing modules built into the NX software). These templates are customized according to actual measurement needs to adapt to the probing action sequences of different geometric features.
[0027] When defining detection templates, the template types are first categorized based on feature type, including at least point detection templates, hole detection templates, planar detection templates, and cylindrical surface detection templates. Each template designs the detection path, contact strategy, and safe movement logic for a specific feature. When customizing detection actions, each detection template includes a complete detection action flow, such as: rapid movement to a safe plane; safe movement to the vicinity of the measurement location; performing feature measurements (e.g., single-point triggering, circumferential scanning, multi-point planar sampling); and returning to a safe position. These action sequences are optimized according to the feature type. For example, for hole features, the template includes sub-steps such as center positioning, hole diameter measurement, and roundness evaluation; for planar features, it includes multi-point sampling and flatness calculation.
[0028] In one embodiment, the template also integrates processing logic for the detection results, such as: out-of-tolerance alarm (processing logic that issues an alarm signal when the measured value exceeds the set tolerance), coordinate compensation (processing logic that automatically calculates the coordinate offset based on the measurement results for subsequent machining trajectory adjustment), machining coordinate system compensation (processing logic that corrects the origin or direction of the machining coordinate system), etc.
[0029] Once defined, the computer equipment stores these templates locally or in the process management system for use in subsequent feature matching and program generation. Through template-based design, the system can quickly invoke matching detection logic based on the identified feature types, significantly improving the degree of programming automation and the structural consistency of the measurement program.
[0030] Next, in step S202, the computer device will automatically match and load the corresponding template based on the identified feature type, without requiring manual intervention in template selection and parameter settings, thereby achieving efficient and standardized detection program generation. This embodiment, through template-based and structured detection action design, enables the computer device to flexibly respond to the detection needs of various processing features, improving the adaptability, reliability, and program reusability of in-machine detection.
[0031] In one embodiment, when generating a probe point, if the machining feature is a planar machining feature, the probe information of the planar machining feature is determined; a probe coordinate system is created with the normal direction of the plane as the first coordinate axis direction and the direction of the longest side of the in-plane contour as the second coordinate axis direction; a rectangle is established with the extreme points of the coordinates of the in-plane contour within the probe coordinate system as vertices; straight lines are drawn along a preset direction within the rectangle according to tolerance requirements to form an intersection point; if the intersection point is located on the current plane, the intersection point is a probe point; if the intersection point is not located on the current plane, the intersection point is moved to the current plane along the direction of the longest side of the in-plane contour to serve as a probe point.
[0032] Specifically, before the computer equipment performs in-machine probing, the probe's detection points can be automatically planned based on the 3D model of the workpiece to be probed and its process information. First, the geometry engine of the CAM system (such as NX) extracts all planar features in the workpiece model. Combining the current process processing content and key dimensions provided by the process management system, it is determined whether each plane is a critical processing feature (such as the engine block mating surface, positioning plane, etc.). Then, using the normal direction of the current plane as the Z-axis (first coordinate axis direction) and the direction of the longest side of the plane contour as the X-axis (second coordinate axis direction), a detection coordinate system is constructed by arbitrarily selecting a point on the plane as the origin. Under the detection coordinate system, the minimum and maximum values of the plane contour in the X and Y directions are obtained, and a rectangular frame is constructed with (X_min, Y_min) and (X_max, Y_max) as vertices, which completely encloses the plane contour. Based on the dimensional tolerance requirements of the plane (such as flatness tolerance), draw several equidistant lines (usually 2-4 lines) along the X and Y directions within the rectangular frame to form grid intersections. If the intersection point is located on the current plane, it is a detection point; if the intersection point does not fall on the plane, move the intersection point gradually along the X-axis until its projection point intersects the plane. Save the intersection points that meet the conditions as a sequence of detection points for subsequent detection trajectory generation.
[0033] In one embodiment, after moving the intersection point, if the distance between the moved first detection point and the second detection point is less than a preset distance, the midpoint between the first and second detection points is determined; the first and second detection points are discarded, and the midpoint is taken as the detection point. That is, if the distance between the two detection points is less than the detection tolerance requirement, the midpoint between the two detection points is taken as the new detection point, and the original detection point is set as invalid.
[0034] Using the above method, the computer equipment can automatically adapt to different planar geometries without manual point selection. The system intelligently generates probe points based on the planar contour and tolerances. Through a rectangular frame and projection adjustment mechanism, it ensures that the probe points are evenly distributed and all lie on the effective plane. This avoids the manual point-by-point selection required in traditional CAM software, significantly shortening the probe program development time. Generating probe points based on process tolerances makes the measurement results more reflective of the actual machining quality.
[0035] In one embodiment, when generating detection points, in response to the machining feature being a cylindrical surface machining feature, detection information of the cylindrical surface machining feature is determined; if the cylindrical surface is a complete cylindrical surface, a first number of detection points are selected along a preset direction based on a preset distance, starting from a preset point on the axis of the cylindrical surface; if the cylindrical surface is a non-complete cylindrical surface, the edge position of the non-complete cylindrical surface is obtained, and a second number of detection points are selected from the edge based on different preset angles.
[0036] Specifically, the computer equipment first analyzes the imported 3D model of the workpiece to be probed, traversing all cylindrical surfaces in the model. For each cylindrical surface, the system extracts its geometric attributes, including the diameter, length (depth), and axial direction, and analyzes its adjacent surface information (e.g., whether the cylindrical surface is an independent hole feature, whether it connects to other planes or curved surfaces, whether it is part of a stepped hole, whether it is a semi-cylindrical surface, etc.). Based on this dimensional and topological information, combined with the processing content of the current process obtained from the process management system, the system classifies the cylindrical surfaces and identifies them as specific cylindrical surface processing features.
[0037] The computer equipment employs different probe point generation strategies based on the geometric integrity of the cylindrical surface. If the cylindrical surface is intact, the system determines that the hole feature is accessible along the entire circumference. The system uses a preset point on the axis of the cylindrical surface as its starting point; for example, this starting point could be the intersection of the end point of the cylindrical surface's axis and the hole's plane (e.g., ...). Figure 3 (Detection position 1), or the center of a certain depth section set according to process requirements, such as 10mm downward from the top of the hole (e.g. Figure 3 Detection position 2). Starting from this point, along a preset direction (usually two mutually perpendicular directions selected in a plane perpendicular to the axis, such as horizontal (X) and vertical (Y) directions), offset based on a preset distance (usually the hole radius), thereby determining a first number of detection points. In a preferred embodiment, the preset direction is four directions: up, down, left, and right, and the preset distance is the hole radius, thereby generating 4 detection points. The selected detection points are as follows: Figure 4 As shown by the green cross.
[0038] If the cylindrical surface is not a complete cylindrical surface (e.g., a semi-cylindrical surface or a partial cylindrical surface), the system first acquires the position and boundary (edge) information of the incomplete cylindrical surface. Then, starting from the exposed edge, the system selects a second number of detection points at different preset angles. In a preferred embodiment, for a semi-cylindrical surface, starting from one side edge, three detection points are determined by extending a preset safety distance into the hole at angles of 45°, 90°, and 135° (relative to the edge normal or axis reference). The detection points are then as follows: Figure 5 The three green crosses are shown in the diagram. For other cylindrical surfaces at different angles, the system can determine the angular position of the detection point based on the equidistant points of the central angle of the exposed arc segment.
[0039] For identified cylindrical surface machining features with special structures (such as holes with steps), the system will appropriately increase the number of detection points at the step changes, based on the basic detection points mentioned above. For example, a set of detection points will be generated on the cylindrical segments near the upper and lower surfaces of the step to ensure accurate measurement of hole diameter, cylindricity, and coaxiality of the step at different cross-sections.
[0040] Through the above implementation methods, intelligent and adaptive detection point planning for cylindrical surface machining features, especially non-complete cylindrical surface features, is realized, which significantly improves the automation level and applicability of on-machine measurement programming and ensures the accuracy and efficiency of complex workpiece detection.
[0041] In one embodiment, when assigning the detection points to the detection template to generate a detection trajectory, it is necessary to load the corresponding detection programming template according to the detection points and each feature information; generate the detection program for each detection point in sequence according to the preset movement order, and integrate them into a detection trajectory.
[0042] Specifically, after generating probe points and loading the corresponding probe programming template, the computer equipment begins generating the probe trajectory. The computer equipment's control system (or its integrated CAM software) first loads a matching probe programming template from a pre-set probe template library based on the set of probe points generated for each selected key feature, and the feature information corresponding to each feature (such as feature type, tolerance requirements, compensation marks, etc.). For example, for the planar feature "front face," the "flatness measurement" module is loaded; for the cylindrical feature "spindle hole," the "hole measurement (with compensation)" module is loaded. After loading the template, the system sequentially fills the probe point sequence corresponding to each feature into the template's probe path planning according to the template's built-in, pre-set movement logic and order. The pre-set movement order typically follows a basic process of "quickly moving to a safe plane, safely moving to the measurement position, performing the probe action, and returning to a safe plane," which is customized during template definition. The system generates a micro-program segment for each probe point containing the aforementioned movement and probe instructions.
[0043] Finally, the computer equipment's control system integrates and sorts these program segments generated for all features and all probe points according to the process sequence (e.g., measuring the reference surface first, then the key hole), and connects them into a complete, continuous, and collision-free tool (probe) motion trajectory, which is the final probe CAM trajectory. This trajectory is displayed as a visual path in the software interface, and a corresponding toolpath source file (such as an APT file) is generated simultaneously. This file contains the coordinate data of all points, the movement type (rapid traverse, feed), the probe command, and the marking information carried by the template.
[0044] Furthermore, after being integrated into a detection trajectory, the computer device can read the tool position source file corresponding to the detection CAM trajectory through a post-processing program, and call the corresponding event generator according to the marking information of the detection template to generate a CNC program that includes detection action control and measurement result application.
[0045] Specifically, after the CAM trajectory is integrated and the toolpath source file is generated, the post-processing system of the computer equipment begins to operate. The post-processing program first reads the toolpath source file. During the reading process, the program specifically identifies and extracts the "marking information" attached to the probe template in the file. This marking information is predefined and used to identify the purpose and subsequent actions of this probe program segment, such as "measurement - plane - alarm only", "measurement - hole - diameter compensation", "measurement - shaft - center compensation", etc.
[0046] Based on the identified marking information, the post-processor calls the corresponding event generator. Different event generators are responsible for translating general trajectory instructions into G-codes or macro programs that can be recognized by specific CNC systems (such as Siemens and Fanuc) and contain specific functions. For example, for a probe segment marked "hole-center compensation", the corresponding event generator will not only generate code to move the probe to the specified point and trigger the measurement, but also generate logic code to store the measurement result (measured center coordinates) into specific system variables (such as R parameters and # variables) and compare it with the theoretical value.
[0047] Furthermore, the post-processing program also associates the acquired, feature-bound specific process information (such as tolerance values: ±0.02mm). It writes the specific tolerance values into the corresponding variables or comments of the generated CNC program, enabling the machine tool to make judgments based on specific standards during execution. Ultimately, the post-processing output is a CNC program file that can be directly loaded and executed on the machining center's CNC system. This program not only contains control instructions for the detection actions but, more importantly, embeds complete logic for "measurement result application," including judgment, alarms, and compensation based on the measurement results.
[0048] When the machining center executes the CNC probing program generated above, the measurement result application logic within its CNC system operates as follows: When the probe completes the measurement, if the actual size or positional error calculated by the system (e.g., the measured diameter of a hole, the measured position of a plane) exceeds the upper limit of the tolerance requirement set in the program, the CNC system determines it to be "out of tolerance". At this time, the system immediately triggers an alarm signal (such as pop-up alarm information, audible and visual prompts) and automatically interrupts the current machining cycle, pausing all actions to prevent continued machining from causing workpiece scrap or equipment damage.
[0049] When the measurement result falls within the inner quarter of the tolerance requirement range (e.g., tolerance ±0.1mm, measurement error within ±0.025mm), the system determines that the workpiece is in excellent condition and fully meets the requirements, requiring no adjustment. Therefore, the system does not generate any prompts or additional operations, and controls the machining program to continue executing subsequent cutting steps.
[0050] When the measurement result is within the tolerance requirement range, but falls within the outer three-quarters interval (i.e., the error is greater than 1 / 4 of the tolerance but not exceeding the tolerance, for example, the error is between ±0.026mm and ±0.1mm), the system determines that the workpiece has an acceptable deviation, but compensation can be performed to obtain higher machining accuracy. In this case, the system will output a "coordinate compensation" or "machining coordinate system compensation" prompt based on the preset detection template. For example: Furthermore, the machining center can automatically calculate the deviation value and fine-tune the tool center path in the subsequent machining trajectory of that feature (such as offsetting the tool center when milling a hole). The system assigns the deviation value to the offset register of the workpiece coordinate system (such as G54), causing all subsequent machining actions in that coordinate system to undergo overall translation or rotation correction. A prompt message will be displayed on the machine tool operation panel. The compensation operation can be executed automatically or after prompting the operator for confirmation. This achieves dynamic optimization of the machining process based on actual measurement results.
[0051] This application embodiment also provides a workpiece detection device based on feature recognition, including: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to: in response to receiving a detection request, determine the machining features contained in the workpiece to be detected, and acquire machining feature information; based on the machining feature information, determine the feature type of the machining feature, and based on the feature type, determine a detection template and detection information, the detection information including at least one of the machining content of the current process, the detection focus dimension, and tolerance information; based on the detection information, generate detection points corresponding to all surfaces of the workpiece to be detected; assign the detection points to the detection template to generate a detection trajectory, and detect the workpiece to be detected according to the detection trajectory.
[0052] This application embodiment also provides a non-volatile computer storage medium storing computer-executable instructions, the computer-executable instructions being configured to: in response to receiving a detection request, determine the machining features contained in the workpiece to be detected, and acquire machining feature information; based on the machining feature information, determine the feature type of the machining feature, and based on the feature type, determine a detection template and detection information, the detection information including at least one of the machining content of the current process, the detection focus dimension, and tolerance information; based on the detection information, generate detection points corresponding to all surfaces of the workpiece to be detected; assign the detection points to the detection template to generate a detection trajectory, and detect the workpiece to be detected according to the detection trajectory.
[0053] The various embodiments in this application are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the device and medium embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the description of the method embodiments.
[0054] The devices and media provided in this application are one-to-one with the methods. Therefore, the devices and media also have similar beneficial technical effects as their corresponding methods. Since the beneficial technical effects of the methods have been described in detail above, the beneficial technical effects of the devices and media will not be repeated here.
[0055] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0056] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0057] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0058] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0059] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0060] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0061] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0062] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0063] The above description is merely an embodiment of this application and is not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.
Claims
1. A workpiece detection method based on feature recognition, characterized in that, include: In response to receiving a detection request, the machined features contained in the workpiece to be detected are determined, and all machined feature information is acquired; Based on the processing feature information, the feature type of the processing feature is determined, and the detection template and detection information are determined based on the feature type. The detection information includes at least one of the processing content of the current process, the detection focus dimension, and tolerance information. Based on the detection information, detection points corresponding to all surfaces of the workpiece to be detected are generated; The detection points are assigned to the detection template to generate a detection trajectory, and the workpiece to be detected is detected according to the detection trajectory.
2. The method according to claim 1, characterized in that, Before determining the detection template and detection information based on the feature type, the method further includes: Based on feature types and general detection templates, define detection templates for various detection processes; The detection template includes detection actions for detecting different types of features. The detection actions include moving to the position to be measured and the operation process of detecting the corresponding feature. The detection template type includes at least one of point detection template, hole detection template, and surface detection template.
3. The method according to claim 2, characterized in that, The detection template is also used to execute at least one of the following operational logics based on the detection results: out-of-tolerance alarm, coordinate compensation, or machining coordinate system compensation.
4. The method according to claim 1, characterized in that, The step of generating detection points corresponding to all surfaces of the workpiece to be detected based on the detection information specifically includes: In response to the fact that the machining feature is a planar machining feature, the detection information of the planar machining feature is determined; A detection coordinate system is created with the normal direction of the plane as the first coordinate axis direction and the direction of the longest side of the in-plane contour as the second coordinate axis direction. A rectangular frame is established using the extreme points of the plane contour within the detection coordinate system as vertices; Within the rectangular frame, draw straight lines along a preset direction according to tolerance requirements to form an intersection point. If the intersection point is located on the current plane, then the intersection point is a detection point. If the intersection point is not on the current plane, then the intersection point is moved to the current plane along the longest side of the in-plane contour to serve as a detection point.
5. The method according to claim 4, characterized in that, If the intersection point is not on the current plane, then the intersection point is moved onto the current plane along the longest side of the in-plane contour to serve as a detection point, specifically including: If the distance between the first and second detection points after the movement is less than the preset distance; Determine the midpoint between the first detection point and the second detection point; The first and second detection points are eliminated, and the midpoint is taken as the detection point.
6. The method according to claim 1, characterized in that, The generation of detection points corresponding to all surfaces of the workpiece to be detected specifically includes: In response to the machining feature being a cylindrical surface machining feature, the detection information of the cylindrical surface machining feature is determined; If the cylindrical surface is a complete cylindrical surface, then starting from a preset point on the axis of the cylindrical surface, take a first number of detection points along a preset direction based on a preset distance; If the cylindrical surface is not a complete cylindrical surface, the position of the edge of the incomplete cylindrical surface is obtained, and a second number of detection points are selected from the edge based on different preset angles.
7. The method according to claim 1, characterized in that, The step of assigning the detection points to the detection template to generate a detection trajectory specifically includes: Load the corresponding detection programming template based on the detection points and each feature information; The detection program for each detection point is generated sequentially according to the preset movement order and then integrated into a detection trajectory.
8. The method according to claim 7, characterized in that, After integrating the data into a detection trajectory, the method further includes: The post-processor reads the tool position source file corresponding to the detection CAM trajectory, and calls the corresponding event generator according to the marking information of the detection template to generate a CNC program that includes detection action control and measurement result application. The application of the measurement results includes: triggering an alarm and terminating processing in response to the measurement result exceeding the tolerance requirements; maintaining the processing state in response to the measurement result being within the first range of the tolerance requirements; and outputting a coordinate compensation or processing coordinate system compensation prompt in response to the measurement result being within the second range of the tolerance requirements.
9. A workpiece detection device based on feature recognition, characterized in that, include: At least one processor; And, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, which, when executed by the at least one processor, enable the at least one processor to perform the steps of the method as claimed in any one of claims 1-8.
10. A non-volatile computer storage medium storing computer-executable instructions, characterized in that, The computer-executable instructions are configured to perform the steps of the method as claimed in any one of claims 1-8.