Processing equipment control method and device, equipment and storage medium
By extracting the coordinates of the feature point of the pattern to be processed and performing B-spline function calculations, the optimization path coordinate points are generated, and the problem of difficulty in generating smooth processing paths in the prior art is solved, and the processing efficiency and accuracy are improved.
Patent Information
- Application Number
- CN202510070349.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-16
- Publication Date
- 2025-05-27
AI Technical Summary
It is difficult to generate a smooth and reliable processing path based on the characteristic points of the pattern to be processed, resulting in low processing efficiency and low accuracy.
By obtaining the pattern information to be processed, extracting the coordinates of feature points, forming a global pattern path, filtering and controlling coordinate points, and performing B-spline function calculations on these points, the optimized path coordinate points are obtained, and finally sending these points for processing equipment control.
It realizes the generation of smooth and reliable processing paths based on the characteristic points of the pattern to be processed, and improves processing efficiency and accuracy.
Smart Images

Figure CN120038413A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of laser processing, and in particular to a method and device for controlling a processing device, a computer device, and a storage medium. Background Art
[0002] Laser processing is a non-contact processing method, which has many advantages such as high efficiency, good material adaptability, and easy automation. It is widely used in industrial production and manufacturing, and laser marking, cutting, and drilling are the most common applications.
[0003] In the fields of laser marking and cutting, earlier products installed lasers on the X / Y module, controlled the movement of the X / Y module, and performed marking processing on the objects fixed below. The control was simple, but the efficiency was low, and the marking accuracy of complex patterns was not high. Currently, most products use the galvanometer method, that is, the laser and the galvanometer are fixed above, and the objects below are marked. Because the galvanometer speed is extremely fast, the marking efficiency and accuracy are high. However, for large-format processing scenarios, because the galvanometer field of view is limited, it is impossible to achieve large-format pattern processing in a static state. For example, the galvanometer field of view is only 100*100mm, while the pattern is 150mm*150mm. Some methods expand the galvanometer field of view by replacing the field lens with a larger one, but this will cause edge distortion problems, and the field lens cannot be made as large as desired; some methods cut the large-format pattern into multiple small patterns that meet the galvanometer field of view, but this will bring splicing errors at the cutting points, greatly affecting the marking effect.
[0004] Currently, a more advanced method is to add an X / Y platform to form a four-axis linkage with the galvanometer, and realize large-format seamless dynamic processing through the movement of the X / Y platform in cooperation with the galvanometer movement. However, for complex patterns, which may contain various feature shapes such as short line segments and arcs, the transition curve connection needs to be considered at the "cusp" points, resulting in drastic changes in the platform path, frequent acceleration and deceleration, easy impact, and accuracy degradation, affecting the processing effect. Summary of the Invention
[0005] The purpose of the present application is to propose a method and device for controlling a processing device, a computer device, and a storage medium, so as to solve the problem that it is difficult to generate a smooth and reliable processing path according to the feature points of the pattern to be processed, and improve the processing efficiency of the pattern to be processed.
[0006] To solve the above technical problems, an embodiment of the present application provides a method for controlling a processing device, which adopts the following technical solutions:
[0007] Obtain the information of the pattern to be processed;
[0008] Extract the coordinate of the feature point from the information of the pattern to be processed, and form a global path of the pattern according to the coordinate of the feature point;
[0009] Screen the control coordinate points from the global pattern path according to the preset screening rules;
[0010] Perform B-spline function operations on the control coordinate points to obtain optimized path coordinate points;
[0011] Send the optimized path coordinate points to the device control module to control the processing device.
[0012] Further, the step of obtaining the information of the pattern to be processed specifically includes:
[0013] Obtain the pattern number to be processed, and extract the corresponding vector graphic file from the database according to the pattern number to be processed;
[0014] Parse the vector graphic file to obtain the pattern point information of the pattern to be processed;
[0015] Verify the integrity of the pattern point information, and use the pattern point information that passes the verification as the information of the pattern to be processed.
[0016] Further, the step of extracting the feature point coordinates from the information of the pattern to be processed and forming the global pattern path according to the feature point coordinates specifically includes:
[0017] Identify the feature points from the information of the pattern to be processed according to the preset feature point rules to obtain the feature point coordinates;
[0018] Sort the feature point coordinates to obtain the sorted feature point coordinates;
[0019] Connect the sorted feature point coordinates in sequence by straight lines or curves to form the global pattern path.
[0020] Further, the step of screening the control coordinate points from the global pattern path according to the preset screening rules specifically includes:
[0021] Calculate the first distance between the feature points that are first adjacent to the current feature point position in the global pattern path;
[0022] Judge whether the first distance is greater than or equal to the first preset distance threshold and less than or equal to the second preset distance threshold;
[0023] If the first distance is greater than or equal to the first preset distance threshold and less than or equal to the second preset distance threshold, calculate the second distance between the feature points that are second adjacent to the current feature point position in the global pattern path;
[0024] Judge whether the second distance is greater than the third preset distance threshold;
[0025] If the second distance is greater than the third preset distance threshold, select the second adjacent feature point as the control coordinate point;
[0026] If the second distance is less than or equal to the third preset distance threshold, delete the second adjacent feature point as a non-control coordinate point;
[0027] If the first distance is less than the first preset distance threshold, delete the first adjacent feature point as the non-control point;
[0028] If the first distance is greater than the second preset distance threshold, select the first adjacent feature point as the control coordinate point;
[0029] Take the control coordinate point as the current feature point, and repeat the above steps of calculating the first distance and the second distance and performing threshold judgment until all feature points in the global path of the pattern are traversed to obtain the control coordinate point.
[0030] Further, the step of performing B-spline function operation on the control coordinate point to obtain the optimized path coordinate point specifically includes:
[0031] Obtain the preset Clamped condition;
[0032] Calculate the coefficients of the quintic polynomial segment according to the control coordinate point and the preset Clamped condition;
[0033] Perform curve point calculation on the control coordinate point according to the coefficients of the quintic polynomial segment to obtain the optimized path coordinate point.
[0034] Further, before the step of sending the optimized path coordinate point to the device control module for processing device control, the following steps are further included:
[0035] Judge whether the optimized path coordinate point meets the preset processing constraint conditions;
[0036] If the optimized path coordinate point meets the preset processing constraint conditions, send the optimized path coordinate point to the device control module;
[0037] If the optimized path coordinate point does not meet the preset processing constraint conditions, adjust the preset Clamped condition and perform B-spline function operation again until the adjusted optimized path coordinate point meets the preset processing constraint conditions.
[0038] Further, the step of judging whether the optimized path coordinate point meets the preset processing constraint conditions specifically includes:
[0039] Determine whether the total length of the optimized path coordinate points is less than the maximum stroke of the processing equipment;
[0040] Determine whether the radius of curvature of the optimized path coordinate points is greater than the minimum turning radius of the processing equipment;
[0041] Determine whether the distance between the trajectory of the optimized path coordinate points and the boundary of the pattern to be processed is greater than the preset boundary distance threshold.
[0042] To solve the above technical problems, an embodiment of the present application further provides a processing equipment control device, which adopts the following technical solutions:
[0043] An information acquisition module, configured to acquire information of the pattern to be processed;
[0044] A path generation module, configured to extract feature point coordinates from the information of the pattern to be processed, and form a global pattern path according to the feature point coordinates;
[0045] A coordinate point screening module, configured to screen control coordinate points from the global pattern path according to a preset screening rule;
[0046] A coordinate point optimization module, configured to perform B-spline function operation on the control coordinate points to obtain optimized path coordinate points;
[0047] A processing control module, configured to send the optimized path coordinate points to the equipment control module for controlling the processing equipment.
[0048] To solve the above technical problems, an embodiment of the present application further provides a computer device, which adopts the following technical solutions:
[0049] A computer device includes a memory and a processor. A computer program is stored in the memory, and when the processor executes the computer program, the steps of the above-mentioned processing equipment control method are implemented.
[0050] To solve the above technical problems, an embodiment of the present application further provides a computer-readable storage medium, which adopts the following technical solutions:
[0051] A computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the above-mentioned processing equipment control method are implemented.
[0052] Compared with the prior art, the embodiments of the present application mainly have the following beneficial effects:
[0053] This application obtains the information of the pattern to be processed; extracts the feature point coordinates from the information of the pattern to be processed, and forms a global path of the pattern according to the feature point coordinates; screens the control coordinate points from the global path of the pattern according to a preset screening rule; performs B-spline function operation on the control coordinate points to obtain optimized path coordinate points; and sends the optimized path coordinate points to the device control module to control the processing device. Thus, it effectively realizes generating a smooth and reliable processing path according to the feature points of the pattern to be processed, so as to improve the processing efficiency of the pattern to be processed. Description of the Drawings
[0054] In order to more clearly illustrate the solutions in this application, the following will briefly introduce the drawings required for the description of the embodiments of this application. Obviously, the following-described drawings are some embodiments of this application. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained according to these drawings.
[0055] Figure 1 Flowchart of an embodiment of the processing device control method according to this application;
[0056] Figure 2 is Figure 1 Flowchart of a specific implementation manner of step S10 in
[0057] Figure 3 is Figure 1 Flowchart of a specific implementation manner of step S20 in
[0058] Figure 4 is Figure 1 Flowchart of a specific implementation manner of step S30 in
[0059] Figure 5 is Figure 1 Flowchart of a specific implementation manner of step S40 in
[0060] Figure 6 Structural schematic diagram of an embodiment of the processing device control device according to this application;
[0061] Figure 7 Structural schematic diagram of an embodiment of the computer device according to this application. Detailed Implementation Manner
[0062] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the technical field to which this application belongs; the terms used in the specification of this application are only for the purpose of describing specific embodiments and are not intended to limit this application; the terms "including" and "having" and any variations thereof in the specification and claims of this application and the above drawings are intended to cover non-exclusive inclusion. The terms "first", "second", etc. in the specification and claims of this application or the above drawings are used to distinguish different objects and not to describe a specific order.
[0063] Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of this application. The phrase appears in various places in the specification and does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment mutually exclusive with other embodiments. Those skilled in the art will explicitly and implicitly understand that the embodiments described herein can be combined with other embodiments.
[0064] In order to enable those skilled in the art of this technology to better understand the solution of this application, the technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings.
[0065] Reference Figure 1 , which shows a flowchart of an embodiment of a processing equipment control method according to this application. The processing equipment control method includes the following steps:
[0066] Step S10, obtaining pattern information to be processed;
[0067] In this embodiment, the pattern information to be processed is the pattern information of the pattern entity to be processed by the processing equipment. In this embodiment, the processing equipment refers to a laser processing equipment, specifically a four-axis linkage laser processing equipment with an X / Y platform, mainly including the X-axis and Y-axis of the platform, the X-axis and Y-axis of the galvanometer, and a laser. Its main principle is that the laser passes through the X and Y axes of the galvanometer and then projects onto the item to be processed installed on the X and Y axes of the platform. The equipment control module of the computer controls the X and Y axes of the platform and the X and Y axes of the galvanometer to move together. The platform is used to drive the product to be processed to move beyond the field of view of the galvanometer to meet the processing requirements of large-format patterns.
[0068] Step S20, extracting the coordinate of feature points from the pattern information to be processed and forming a global path of the pattern according to the coordinate of the feature points;
[0069] In this embodiment, the feature point coordinates refer to the coordinate data corresponding to the feature points in the pattern information to be processed, which include the coordinate values indicating the feature points relative to the plane of the pattern to be processed. This coordinate value is usually composed of two numerical values, representing the abscissa (X-axis) and ordinate (Y-axis) of the point on the plane respectively. These feature points are generally the points with significant features or unique properties in the pattern, such as corner points, edge intersection points, center points, etc. The global pattern path refers to the path indicating the movement of the laser during the laser processing, which is formed by connecting a series of feature points in sequence. In this embodiment, the global pattern path can be stored in the first storage area of the system for convenient subsequent calling.
[0070] Step S30: Screen control coordinate points from the global pattern path according to a preset screening rule;
[0071] In this embodiment, the preset screening rule includes a first screening rule and a second screening rule. The first screening rule is a rule method for determining whether two adjacent feature points in sequence are control coordinate points, and the second screening rule is a rule method for determining whether the feature points with one feature point spaced between them in sequence are control coordinate points. By performing the above first screening rule and second screening rule judgments on adjacent feature points and feature points with one feature point spaced between them, the feature point screening optimization of the global pattern path can be effectively carried out. In this embodiment, the control coordinate points can be stored in the second storage area of the system for convenient subsequent calling.
[0072] Step S40: Perform B-spline function operation on the control coordinate points to obtain optimized path coordinate points;
[0073] In this embodiment, the B-spline function, also known as B-spline or B-spline, is a tool widely used in the fields of mathematics, numerical analysis, computer graphics, and computer-aided design (CAD), etc. The B-spline function is a special spline function, which defines a smooth curve or surface through a set of control points and a specific order. Among them, the B-spline basis function has local support, that is, each basis function is only valid within its defined local interval. The B-spline curve is composed of a series of piecewise polynomials, and these polynomials are smoothly connected at the knots. The B-spline curve can be defined by a set of control points and a knot vector. The knot vector determines the segmentation points of the curve, and the control points determine the shape and trend of the curve. The calculation of the B-spline curve usually involves a recursive algorithm. First, the values of the B-spline basis functions need to be calculated, and then the coordinates of any point on the curve are calculated through these basis functions and the coordinates of the control points. By performing B-spline function operation on the control coordinate points, smooth and effective optimized path coordinate points can be obtained. In this embodiment, the optimized path coordinate points can be stored in the third storage area of the system for convenient subsequent calling.
[0074] Step S50: Send the optimized path coordinate points to the device control module to control the processing device.
[0075] In this embodiment, the device control module can be set on a computer or a control terminal. The computer or control terminal is connected to the processing device. After the optimized path coordinate points are calculated by the calculation module, they are sent to the device control module through a preset information sending path to control the processing path of the processing device according to the optimized path coordinate points, effectively improving the laser processing efficiency of the processing device.
[0076] This application obtains the information of the pattern to be processed; extracts the feature point coordinates from the information of the pattern to be processed, and forms a global pattern path according to the feature point coordinates; screens the control coordinate points from the global pattern path according to a preset screening rule; performs B-spline function operation on the control coordinate points to obtain optimized path coordinate points; sends the optimized path coordinate points to the device control module to control the processing device. Thus, it effectively realizes generating a smooth and reliable processing path according to the feature points of the pattern to be processed, so as to improve the processing efficiency of the pattern to be processed.
[0077] Continue to refer to Figure 2 , which shows the flowchart of a specific embodiment of step S10, including the following steps:
[0078] Step S101: Obtain the number of the pattern to be processed, and extract the corresponding vector graphic file from the database according to the number of the pattern to be processed;
[0079] In this embodiment, the number of the pattern to be processed is the number identifier corresponding to the vector image file. Traverse and match in the database according to the number of the pattern to be processed to extract the corresponding vector image file from the database. The vector image file is the image file data corresponding to the pattern to be processed. Before extracting the vector graphic file, the validity of the number can be verified to ensure that it exists in the database.
[0080] Step S102: Analyze the vector graphic file to obtain the pattern point information of the pattern to be processed;
[0081] In this embodiment, according to the format of the vector graphic file (such as SVG, DXF, etc.), select a suitable parser, then use the parser to open and read the vector graphic file, and extract the pattern point information therein. The pattern point information includes attributes such as coordinates, colors, and line thicknesses, and the extracted pattern point information can be converted into a data structure suitable for subsequent processing, such as a list, an array, or a custom object, etc.
[0082] Step S103: Verify the integrity of the pattern point information, and use the pattern point information that passes the verification as the information of the pattern to be processed.
[0083] In this embodiment, by defining the rules for integrity verification, such as checking whether the coordinates are valid, whether the color values are within the acceptable range, etc., and applying these rules to the extracted pattern point information for verification. When the verification fails, error information is recorded, and it is decided whether to continue processing or notify the user as needed. The pattern point information that passes the verification is stored as the pattern information to be processed in an appropriate location, such as memory, disk, or database, to effectively save the pattern information to be processed.
[0084] In this embodiment, by obtaining the pattern number to be processed, the corresponding vector graphic file is extracted from the database according to the pattern number to be processed; the vector graphic file is parsed to obtain the pattern point information of the pattern to be processed; the integrity of the pattern point information is verified, and the pattern point information that passes the verification is used as the pattern information to be processed. Thus, the acquisition of the pattern information to be processed is effectively realized to facilitate the subsequent extraction and processing of the feature point coordinates.
[0085] Continuing to refer to Figure 3 , a flowchart of a specific embodiment of step S20 is shown, including the following steps:
[0086] Step S201, identifying feature points from the pattern information to be processed according to the preset feature point rules to obtain the feature point coordinates;
[0087] In this embodiment, the preset feature point rule can be used to extract feature points based on the geometric characteristics of the pattern (such as corner points, intersection points, extreme points, etc.), color changes, texture features, etc. Among them, geometric characteristics include corner points: the intersection points of two or more edges, with local maximum or minimum curvature changes. In image processing, these feature points can be detected and recognized through corner point detection algorithms (such as Harris corner detection, Moravec corner detection, etc.). Intersection points: The intersection points of lines or curves in the pattern can be used as feature points. These intersection points may be the intersection points of two straight lines or the intersection points between curves. Extreme points: The extreme points in the pattern (such as the highest point, the lowest point, the widest point, etc.) can also be used as feature points. Color changes include color mutation points: The points where the color in the pattern changes significantly can be used as feature points, and these points are usually located at the junction of different color regions. Texture features include texture change points: In a pattern with texture, the points where the texture changes (such as texture direction, texture density, etc.) can be used as feature points, and these points help to identify the texture pattern and structure in the pattern. The feature point coordinates are obtained based on the plane coordinate system corresponding to the pattern plane. This plane coordinate system can be established with the center point of the pattern plane as the origin, or with the four corner points of the pattern plane as the origin. After determining the plane coordinate system, the feature points are marked with coordinates on the plane coordinate system to obtain the feature point coordinates. In this embodiment, the ratio of the size of the plane coordinate system to the size of the actual plane pattern is one to one, that is, 1 unit in the plane coordinate system corresponds to 1 mm of the actual plane pattern.
[0088] Step S202: Sort the feature point coordinates to obtain the sorted feature point coordinates.
[0089] In this embodiment, the identified feature point coordinates are an unordered set, and these coordinates need to be sorted. The sorting basis can be the relative position relationship between feature points, the geometric structure of the pattern, or according to a specific algorithm (such as nearest neighbor search, graph traversal algorithm, etc. In this embodiment, the nearest neighbor algorithm can be used). The sorted feature point coordinates will form an ordered sequence, and this sequence will guide the generation of the subsequent path.
[0090] Step S203: Connect the sorted feature point coordinates in sequence by straight lines or curves to form the global path of the pattern.
[0091] In this embodiment, the generation of the path can connect the feature points in sequence by means of a straight line or a curve. Whether to choose a straight line or a curve depends on the specific requirements of the pattern and the relative positions between the feature points. If the pattern requires high precision and details, more complex curves (such as Bezier curves, polynomial curves, etc.) can be used to smoothly connect the feature points. When connecting the feature points, the continuity and smoothness of the path also need to be considered to ensure that the generated global path of the pattern not only conforms to the geometric structure of the pattern but also has a good visual effect.
[0092] In this embodiment, the feature points are identified from the pattern information to be processed according to a preset feature point rule to obtain the coordinates of the feature points; the coordinates of the feature points are sorted to obtain the sorted coordinates of the feature points; and according to the sorted coordinates of the feature points, they are connected in sequence by means of a straight line or a curve to form the global path of the pattern. Thus, the global path of the pattern that effectively generalizes the pattern features is generated according to the feature points of the pattern information to be processed, so as to facilitate the subsequent screening process of the control point coordinates.
[0093] Continue to refer to Figure 4 , which shows a flowchart of a specific embodiment of step S30, including the following steps:
[0094] Step S301, calculate the first distance between the feature points that are first adjacent to the position of the current feature point in the global path of the pattern;
[0095] In this embodiment, the feature points that are first adjacent to the position of the current feature point refer to the feature points that are closest to the position of the current feature point in the global path of the pattern, and the first distance is calculated by the coordinates of the current feature point and the coordinates of the feature points that are first adjacent to the position.
[0096] Step S302, determine whether the first distance is greater than or equal to a first preset distance threshold and less than or equal to a second preset distance threshold;
[0097] In this embodiment, the first preset distance threshold and the second preset distance threshold are preset judgment thresholds, where the second preset distance threshold is greater than the first preset distance threshold, and they can be set according to actual experience or historical data. In this embodiment, the first preset distance threshold is 3 and the second preset distance threshold is 5, and the first preset distance threshold and the second preset distance threshold can be adjusted accordingly according to the actual situation.
[0098] Step S303, if the first distance is greater than or equal to the first preset distance threshold and less than or equal to the second preset distance threshold, then calculate the second distance between the feature points that are second adjacent to the position of the current feature point in the global path of the pattern;
[0099] In this embodiment, the feature points that are second adjacent in position refer to the feature points that are separated from the current feature point by one feature point in the global path of the pattern. The second distance is calculated based on the coordinates of the current feature point and the coordinates of the feature points that are second adjacent in position.
[0100] Step S304, determine whether the second distance is greater than a third preset distance threshold;
[0101] In this embodiment, the third preset distance threshold is a judgment threshold preset for judging the second distance, which can be set according to actual experience or historical data and adjusted according to actual situations. In this embodiment, the first preset distance threshold is 4.
[0102] Step S305, if the second distance is greater than the third preset distance threshold, select the feature points that are second adjacent as the control coordinate points;
[0103] In this embodiment, the feature points that are second adjacent refer to the feature points that are second adjacent in position to the current feature point as described above. The feature points that are second adjacent and meet the judgment conditions can be used as control coordinate points by adding marker information corresponding to the control coordinate points to the feature points that are second adjacent.
[0104] Step S306, if the second distance is less than or equal to the third preset distance threshold, delete the feature points that are second adjacent as non-control coordinate points;
[0105] In this embodiment, when the second distance is less than or equal to the third preset distance threshold, it means that the feature points that are second adjacent do not meet the preset distance requirements. At this time, the feature points that are second adjacent are deleted as non-control coordinate points to implement the screening process of the feature points.
[0106] Step S307, if the first distance is less than the first preset distance threshold, delete the feature points that are first adjacent as the non-control points;
[0107] In this embodiment, when the first distance is less than the first preset distance threshold, it means that the feature points that are first adjacent do not meet the preset distance requirements. At this time, the feature points that are first adjacent are deleted as non-control coordinate points to implement the screening process of the feature points.
[0108] Step S308, if the first distance is greater than the second preset distance threshold, select the feature points that are first adjacent as the control coordinate points;
[0109] In this embodiment, the first adjacent feature point refers to the feature point that is first adjacent to the current feature point's position described above. The first adjacent feature points that meet the judgment conditions can be used as control coordinate points by adding marker information corresponding to the control coordinate points to them.
[0110] Step S309: Use the control coordinate points as the current feature points, and repeat the above steps of calculating the first distance and the second distance and performing the threshold judgment until all feature points in the global pattern path are traversed to obtain the control coordinate points.
[0111] In this embodiment, when performing the initial calculation, the first feature point sorted in order in the global pattern path can be used as the current feature point. After the control coordinate points are confirmed, the confirmed control coordinate points are used as the second current feature points, and then the steps of threshold judgment and confirmation of the next control coordinate points are performed, and the repeated calculation is continuously performed until all feature points in the global pattern path are traversed. Among them, the current feature point selected during the initial calculation, that is, the first feature point in the global pattern path, also belongs to the control coordinate points.
[0112] The above judgment steps can be exemplified. For example, calculate the distance between every two adjacent feature points in the first storage area, that is, calculate the first distance d1 between i and i + 1. Then, calculate the second distance d2 between the feature points i and i + 2 with one feature point in between. If d1 is less than the set first preset distance threshold a1, regardless of the size of d2, then the (i + 1)-th point will be discarded; if d1 is greater than the set second preset distance threshold a2 (a2 > a1), regardless of the size of d2, then the (i + 1)-th point is selected; if a1 ≤ d1 ≤ a2, then judge whether d2 is greater than the set threshold a3. If it is greater, then it is selected, otherwise it is discarded; if the number of consecutive discards exceeds the preset quantity b, then select one of the intermediate feature points. The selected points are stored in the second storage area and saved to a file, and so on in a loop until all feature points in the global pattern path of the first storage area are traversed.
[0113] In this embodiment, the first distance between the feature points that are first adjacent to the position of the current feature point in the global path of the pattern is calculated; it is determined whether the first distance is greater than or equal to a first preset distance threshold and less than or equal to a second preset distance threshold; if the first distance is greater than or equal to the first preset distance threshold and less than or equal to the second preset distance threshold, then the second distance between the feature points that are second adjacent to the position of the current feature point in the global path of the pattern is calculated; it is determined whether the second distance is greater than a third preset distance threshold; if the second distance is greater than the third preset distance threshold, then the second adjacent feature point is selected as the control coordinate point; if the second distance is less than or equal to the third preset distance threshold, then the second adjacent feature point is deleted as a non-control coordinate point; if the first distance is less than the first preset distance threshold, then the first adjacent feature point is deleted as the non-control point; if the first distance is greater than the second preset distance threshold, then the first adjacent feature point is selected as the control coordinate point; the control coordinate point is used as the current feature point, and the above steps of calculating the first distance and the second distance and performing threshold judgment are repeated until all feature points in the global path of the pattern are traversed, and the control coordinate points are obtained. Thus, effective screening of control coordinate points is realized according to the threshold judgment in the preset screening rules, so as to facilitate the subsequent acquisition of optimized path coordinate points.
[0114] Continuing to refer Figure 5 , a flowchart of a specific embodiment of step S40 is shown, including the following steps:
[0115] S401, obtain the preset Clamped condition;
[0116] In this embodiment, the Clamped condition means that parameters such as the position, speed, and acceleration at the start and end points of the path are known or fixed. The Clamped condition includes: the positions (x 0 , y 0 and x f , y f ) of the start and end points, the speeds (v 0 , v f ) of the start and end points, and the accelerations (a 0 , a f ) of the start and end points. The above conditions will be used to determine the coefficients of the quintic polynomial.
[0117] S402, calculate the coefficients of the quintic polynomial segment according to the control coordinate points and the preset Clamped condition;
[0118] In this embodiment, the steps of calculating the coefficients of the quintic polynomial segment are as follows: The quintic polynomial P(t)=a 5 t5 +a 4 t 4 +a 3 t 3 +a 2 t 2 +a 1 t + a 0 , where t is the parameterized time, and a 0 to a 5 are the coefficients of the polynomial. According to the Clamped condition, we can list the following system of equations: P(0) = x 0 or y 0 (position); P'(0) = v 0 (velocity); P''(0) = a 0 (acceleration); P(1) = x f or y f (position); P'(1) = v f (velocity); P''(1) = a f (acceleration). The equations can be expressed as: a 0 = x 0 or y 0 , a 1 = v 0 , 2a 2 = a 0 , a 0 + a 1 + a 2 + a 3 + a 4 + a 5 = x f or y f , a 1 + 2a 2 + 3a 3 + 4a 4 + 5a 5 = v f , 2a 2 + 6a 3 + 12a 4 + 20a 5 = a f . By solving the above system of equations, the coefficients a 0 to a 5 of the fifth-degree polynomial are obtained.
[0119] S403. Calculate the curve points of the control coordinate points according to the coefficients of the fifth-degree polynomial segment to obtain the optimized path coordinate points.
[0120] In this embodiment, any point on the path can be calculated by changing the parameter t (usually between 0 and 1). For each value of t, we can calculate P(t) to obtain the corresponding x and y coordinates. For example, if we want to generate 100 points evenly distributed on the path, we can divide t into 100 equal parts from 0 to 1, and then calculate P(t) corresponding to each value of t, thus obtaining a smooth path composed of optimized path coordinate points, and these points can be visualized through interpolation or drawing software.
[0121] In this embodiment, by obtaining a preset Clamped condition; calculating the coefficients of the quintic polynomial segment according to the control coordinate points and the preset Clamped condition; calculating curve points for the control coordinate points according to the coefficients of the quintic polynomial segment, the optimized path coordinate points of the quintic polynomial segment can be effectively obtained, so as to facilitate the subsequent control of the processing equipment.
[0122] In an alternative implementation manner of this embodiment, before the step of sending the optimized path coordinate points to the device control module for controlling the processing equipment, the following steps are further included:
[0123] Judge whether the optimized path coordinate points meet the preset processing constraint conditions;
[0124] In this embodiment, the preset processing constraint conditions can be extracted from the database through a constraint condition extraction identifier, and the constraint condition extraction identifier is the unique information identifier corresponding to the preset processing constraint conditions. By traversing and querying in the database through the constraint condition extraction identifier, the corresponding preset processing constraint conditions can be obtained.
[0125] If the optimized path coordinate points meet the preset processing constraint conditions, send the optimized path coordinate points to the device control module;
[0126] In this embodiment, it is possible to judge whether the optimized path coordinate points meet the preset processing constraint conditions by setting a monitoring event, and trigger an information sending event when the optimized path coordinate points meet the preset processing constraint conditions, so as to send the optimized path coordinate points to the device control module.
[0127] If the optimized path coordinate points do not meet the preset processing constraint conditions, adjust the preset Clamped condition and perform B-spline function operation again until the adjusted optimized path coordinate points meet the preset processing constraint conditions.
[0128] In this embodiment, the preset processing constraint conditions can be set and adjusted according to the actual situation. When the above function operation reaches the preset number of iterations and the adjusted optimized path coordinate points still do not meet the preset processing constraint conditions, a prompt message can be generated and sent to the display interface corresponding to the device control module for display and reminder.
[0129] In this embodiment, it is determined whether the optimized path coordinate points meet the preset machining constraint conditions; if the optimized path coordinate points meet the preset machining constraint conditions, the optimized path coordinate points are sent to the equipment control module; if the optimized path coordinate points do not meet the preset machining constraint conditions, the preset Clamped condition is adjusted and the B-spline function operation is performed again until the adjusted optimized path coordinate points meet the preset machining constraint conditions. Thus, the optimized path coordinate points can be effectively constrained and optimized according to the preset machining constraint conditions to improve the reliability of the optimized path coordinate points.
[0130] In an alternative implementation manner of this embodiment, the determination of whether the optimized path coordinate points meet the preset machining constraint conditions includes the following steps:
[0131] Determine whether the total length of the optimized path coordinate points is less than the maximum stroke of the processing equipment;
[0132] In this embodiment, this condition ensures that the entire machining path does not exceed the physical limitations of the processing equipment. If the total length of the path exceeds the maximum stroke of the equipment, then the equipment will not be able to complete the entire machining task. Therefore, when optimizing the path, it is necessary to ensure that the total length of the path is within the maximum stroke range of the equipment.
[0133] Determine whether the curvature radius of the optimized path coordinate points is greater than the minimum turning radius of the processing equipment;
[0134] In this embodiment, the minimum turning radius of the equipment is the minimum radius at which it can turn smoothly and safely without excessive stress or damage. If the curvature radius in the path is less than the minimum turning radius of the equipment, then the equipment may encounter difficulties when turning, or even be damaged. Therefore, when planning the path, it is necessary to ensure that the curvature radius of all turning points is greater than or equal to the minimum turning radius of the equipment.
[0135] Determine whether the distance between the trajectory of the optimized path coordinate points and the boundary of the pattern to be machined is greater than the preset boundary distance threshold.
[0136] In this embodiment, this condition is to avoid collision between the equipment and the boundary of the pattern to be machined during the machining process. If the path is too close to the boundary, then during the machining process, collision may occur due to tiny errors or vibration of the equipment, thereby damaging the pattern to be machined or the equipment. Therefore, when planning the path, it is necessary to ensure that there is sufficient distance between the path and the boundary, and this distance is usually determined by a preset boundary distance threshold.
[0137] In this embodiment, the preset processing constraint conditions are set to include: the total length of the optimized path coordinate points is less than the maximum stroke of the processing device; and / or, the curvature radius of the optimized path coordinate points is greater than the minimum turning radius of the processing device; and / or, the distance between the trajectory of the optimized path coordinate points and the boundary of the pattern to be processed is greater than the preset boundary distance threshold. Thus, it is effectively possible to determine whether the optimized path coordinate points meet the processing requirements of the processing device, so as to ensure that the optimized path coordinate points can be effectively run by the processing device.
[0138] Those of ordinary skill in the art can understand that all or part of the processes of implementing the methods in the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above methods. Among them, the aforementioned storage medium can be a non-volatile storage medium such as a magnetic disk, an optical disk, a Read-Only Memory (ROM), etc., or a Random Access Memory (RAM), etc.
[0139] It should be understood that although the steps in the flowchart of the accompanying drawings are shown in sequence according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless there is a clear indication in this article, the execution of these steps does not have a strict order limit, and they can be executed in other orders. Moreover, at least some of the steps in the flowchart of the accompanying drawings may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. Their execution order is not necessarily sequential, but can be executed alternately or alternately with at least a part of other steps or sub-steps or stages of other steps.
[0140] Further referring to Figure 6 , as an implementation of the method shown above Figure 1 , the present application provides an embodiment of a processing device control device. This device embodiment corresponds to the method embodiment shown in Figure 1 , and this device can be specifically applied to various electronic devices.
[0141] As shown in Figure 6 , the processing device control device 600 described in this embodiment includes: an information acquisition module 601, a path generation module 602, a coordinate point screening module 603, a coordinate point optimization module 604, and a processing control module 605. Among them:
[0142] The information acquisition module 601 is used to acquire the information of the pattern to be processed;
[0143] A path generation module 602, configured to extract feature point coordinates from the to-be-processed pattern information, and form a global pattern path according to the feature point coordinates;
[0144] A coordinate point screening module 603, configured to screen control coordinate points from the global pattern path according to a preset screening rule;
[0145] A coordinate point optimization module 604, configured to perform B-spline function operations on the control coordinate points to obtain optimized path coordinate points;
[0146] A processing control module 605, configured to send the optimized path coordinate points to an equipment control module for controlling a processing device.
[0147] In this embodiment, by adopting the above-mentioned processing device control device, it is possible to obtain to-be-processed pattern information; extract feature point coordinates from the to-be-processed pattern information, and form a global pattern path according to the feature point coordinates; screen control coordinate points from the global pattern path according to a preset screening rule; perform B-spline function operations on the control coordinate points to obtain optimized path coordinate points; send the optimized path coordinate points to an equipment control module for controlling a processing device. Therefore, it can effectively generate a smooth and reliable processing path according to the feature points of the to-be-processed pattern, so as to improve the processing efficiency of the to-be-processed pattern.
[0148] To solve the above technical problems, an embodiment of the present application further provides a computer device. For details, please refer to Figure 7 , Figure 7 which is a basic structural block diagram of the computer device in this embodiment.
[0149] The computer device 7 includes a memory 71, a processor 72, and a network interface 73 that are communicatively connected to each other through a system bus. It should be noted that only the computer device 7 with components 71-73 is shown in the figure, but it should be understood that it is not required to implement all the shown components, and more or fewer components can be alternatively implemented. Among them, those skilled in the art of the present technology can understand that a computer device here is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to a microprocessor, an application specific integrated circuit (ASIC), a field-programmable gate array (FPGA), a digital signal processor (DSP), an embedded device, etc.
[0150] The computer device can be a computing device such as a desktop computer, a notebook, a palm computer, or a cloud server. The computer device can interact with the user through a keyboard, a mouse, a remote control, a touchpad, or a voice control device, etc.
[0151] The memory 71 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, a hard disk, a multimedia card, a card-type memory (such as an SD or DX memory, etc.), a random access memory (RAM), a static random access memory (SRAM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a programmable read-only memory (PROM), a magnetic memory, a magnetic disk, an optical disk, etc. In some embodiments, the memory 71 can be an internal storage unit of the computer device 7, such as the hard disk or memory of the computer device 7. In other embodiments, the memory 71 can also be an external storage device of the computer device 7, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) card, a FlashCard, etc., equipped on the computer device 7. Of course, the memory 71 can also include both the internal storage unit and the external storage device of the computer device 7. In this embodiment, the memory 71 is generally used to store the operating system and various application software installed on the computer device 7, such as the program code of the processing device control method. In addition, the memory 71 can also be used to temporarily store various data that have been output or will be output.
[0152] In some embodiments, the processor 72 can be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chips. The processor 72 is generally used to control the overall operation of the computer device 7. In this embodiment, the processor 72 is used to run the program code stored in the memory 71 or process data, such as running the program code of the processing device control method.
[0153] The network interface 73 can include a wireless network interface or a wired network interface, and the network interface 73 is generally used to establish a communication connection between the computer device 7 and other electronic devices.
[0154] In this embodiment, by using the above computer device, it is possible to obtain the information of the pattern to be processed; extract the feature point coordinates from the information of the pattern to be processed, and form a global path of the pattern according to the feature point coordinates; screen the control coordinate points from the global path of the pattern according to a preset screening rule; perform B-spline function operation on the control coordinate points to obtain optimized path coordinate points; and send the optimized path coordinate points to the device control module to control the processing device. Thus, it effectively realizes generating a smooth and reliable processing path according to the feature points of the pattern to be processed, so as to improve the processing efficiency of the pattern to be processed.
[0155] The present application also provides another implementation manner, that is, to provide a computer-readable storage medium storing a processing device control program, and the processing device control program can be executed by at least one processor, so that the at least one processor executes the steps of the processing device control method as described above.
[0156] In this embodiment, by using the above computer-readable storage medium, it is possible to obtain the information of the pattern to be processed; extract the feature point coordinates from the information of the pattern to be processed, and form a global path of the pattern according to the feature point coordinates; screen the control coordinate points from the global path of the pattern according to a preset screening rule; perform B-spline function operation on the control coordinate points to obtain optimized path coordinate points; and send the optimized path coordinate points to the device control module to control the processing device. Thus, it effectively realizes generating a smooth and reliable processing path according to the feature points of the pattern to be processed, so as to improve the processing efficiency of the pattern to be processed.
[0157] Through the description of the above embodiments, those skilled in the art can clearly understand that the above-described embodiment methods can be implemented by means of software plus a necessary general hardware platform. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation manner. Based on such an understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. The computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disc), and includes several instructions for causing a terminal device (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in the various embodiments of the present application.
[0158] Obviously, the embodiments described above are only a part of the embodiments of this application, rather than all of them. The preferred embodiments of this application are shown in the accompanying drawings, but they do not limit the patent scope of this application. This application can be implemented in many different forms. On the contrary, the purpose of providing these embodiments is to make the understanding of the disclosed content of this application more thorough and comprehensive. Although this application has been described in detail with reference to the foregoing embodiments, for those skilled in the art, they can still modify the technical solutions recorded in the foregoing specific embodiments, or perform equivalent replacements for some of the technical features. Any equivalent structures made by using the content of the specification and drawings of this application, directly or indirectly applied in other related technical fields, are similarly within the scope of patent protection of this application.
Claims
1. A processing equipment control method, characterized in that: The steps include: Obtain information of the pattern to be processed; Extracting feature point coordinates from the information of the pattern to be processed, and forming a pattern global path according to the feature point coordinates; Filtering control coordinate points from the pattern global path according to preset filtering rules; Performing B-spline function operation on the control coordinate points to obtain optimized path coordinate points; The optimized path coordinate points are sent to the equipment control module for processing equipment control.
2. The processing equipment control method according to claim 1, characterized in that: The step of obtaining the information of the pattern to be processed specifically includes: Obtaining the number of the pattern to be processed, and extracting the corresponding vector graphics file from the database according to the number of the pattern to be processed; Parsing the vector graphics file to obtain pattern point information of the pattern to be processed; The pattern point information is integrity verified, and the pattern point information that passes the verification is used as the pattern information to be processed.
3. The processing equipment control method according to claim 1, characterized in that: The step of extracting feature point coordinates from the information of the pattern to be processed and forming a pattern global path according to the feature point coordinates specifically includes: Identifying feature points from the pattern information to be processed according to preset feature point rules to obtain the coordinates of the feature points; Sorting the feature point coordinates to obtain sorted feature point coordinates; According to the sorted feature point coordinates, they are sequentially connected in a straight line or a curve to form the pattern global path.
4. The processing equipment control method according to claim 1, characterized in that: The step of filtering control coordinate points from the pattern global path according to a preset filtering rule specifically includes: Calculating a first distance between feature points first adjacent to the current feature point position in the pattern global path; Determine whether the first distance is greater than or equal to a first preset distance threshold and less than or equal to a second preset distance threshold; If the first distance is greater than or equal to the first preset distance threshold and less than or equal to the second preset distance threshold, calculating a second distance between the feature points second adjacent to the current feature point position in the pattern global path; Determining whether the second distance is greater than a third preset distance threshold; If the second distance is greater than the third preset distance threshold, selecting the second adjacent feature point as the control coordinate point; If the second distance is less than or equal to the third preset distance threshold, deleting the second adjacent feature point as a non-control coordinate point; If the first distance is less than the first preset distance threshold, deleting the first adjacent feature point as the non-control point; If the first distance is greater than the second preset distance threshold, selecting the first adjacent feature point as the control coordinate point; The control coordinate point is used as the current feature point, and the above steps of calculating the first distance and the second distance and performing threshold judgment are repeated until all feature points in the pattern global path are traversed to obtain the control coordinate point.
5. The processing equipment control method according to claim 1, characterized in that: The step of performing B-spline function operation on the control coordinate points to obtain the optimized path coordinate points specifically includes: Get the preset clamped condition; Calculate the quintic polynomial segment coefficients according to the control coordinate points and the preset clamped conditions; The control coordinate points are calculated according to the quintic polynomial segment coefficients to obtain the optimized path coordinate points.
6. The processing equipment control method according to claim 1, characterized in that: Before the step of sending the optimized path coordinate points to the equipment control module for processing equipment control, the following steps are also included: Determining whether the optimized path coordinate points meet preset processing constraints; If the optimized path coordinate point meets the preset processing constraint condition, the optimized path coordinate point is sent to the equipment control module; If the optimized path coordinate point does not satisfy the preset processing constraint condition, the preset clamped condition is adjusted to re-perform the B-spline function operation until the adjusted optimized path coordinate point satisfies the preset processing constraint condition.
7. The processing equipment control method according to claim 6, characterized in that: The step of judging whether the coordinate points of the optimization path meet the preset processing constraint conditions specifically includes: Determining whether the total length of the optimized path coordinate points is less than the maximum stroke of the processing equipment; Determining whether the curvature radius of the optimized path coordinate point is greater than the minimum turning radius of the processing equipment; It is determined whether the distance between the trajectory of the optimized path coordinate point and the boundary of the pattern to be processed is greater than a preset boundary distance threshold.
8. A processing equipment control device, characterized in that: include: An information acquisition module, used to acquire information of the pattern to be processed; A path generation module, used for extracting feature point coordinates from the information of the pattern to be processed, and forming a pattern global path according to the feature point coordinates; A coordinate point screening module, used for screening control coordinate points from the pattern global path according to preset screening rules; A coordinate point optimization module is used to perform B-spline function operation on the control coordinate points to obtain optimized path coordinate points; The processing control module is used to send the optimized path coordinate points to the equipment control module for processing equipment control.
9. A computer device, characterized in that: The method comprises a memory and a processor, wherein the memory stores computer-readable instructions, and the processor implements the steps of the processing equipment control method according to any one of claims 1 to 7 when executing the computer-readable instructions.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-readable instructions, and when the computer-readable instructions are executed by a processor, the steps of the processing equipment control method according to any one of claims 1 to 7 are implemented.