Polygonal workpiece polishing method and device, electronic equipment and storage medium
By obtaining the dimensional parameters of polygonal workpieces, determining the grinding strategy, and using automatic grinding machines and SCARA robots for automated grinding, the problem of time-consuming and labor-intensive manual grinding of polygonal workpieces is solved, achieving efficient and precise grinding results.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHENZHEN SHANLONG ZHIKONG CO LTD
- Filing Date
- 2021-11-22
- Publication Date
- 2026-08-04
AI Technical Summary
In the existing technology, manual grinding of polygonal workpieces is time-consuming and labor-intensive, and cannot achieve fast, accurate and efficient grinding.
By obtaining the dimensional parameters of the polygonal workpiece, a grinding strategy is determined, and an automated grinding machine and gripping device such as a SCARA robot are used to automatically grind the polygonal workpiece according to the set grinding strategy.
It enables efficient and precise grinding of polygonal workpieces, saving labor costs and improving grinding efficiency.
Smart Images

Figure CN115495805B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of polygonal workpiece grinding technology, and specifically to a polygonal workpiece grinding method, apparatus, electronic device and storage medium. Background Technology
[0002] As society progresses and industrial equipment becomes increasingly sophisticated, the shapes of workpieces vary greatly due to different usage requirements. They are not necessarily regular shapes like squares or circles, but often various polygons. These workpieces require grinding before use or when repair is needed. Currently, grinding is generally done manually, which is time-consuming and labor-intensive. Therefore, with the advent of the era of intelligent and automated processes, how to quickly, accurately, and efficiently grind polygonal workpieces of varying shapes is a problem that needs to be solved. Summary of the Invention
[0003] In view of this, it is necessary to provide a method, apparatus, electronic device and storage medium for grinding polygonal workpieces, so as to solve the technical problem that manual grinding of polygonal workpieces is time-consuming, labor-intensive and inefficient in the prior art.
[0004] To address the aforementioned technical problems, this invention provides a method for grinding polygonal workpieces, comprising:
[0005] Obtain the dimensional parameters of the polygonal workpiece;
[0006] Determine the polishing strategy based on the aforementioned dimensional parameters;
[0007] The polygonal workpiece is polished according to the polishing strategy.
[0008] Preferably, the dimensional parameters include the vertices, side lengths, and angles between the sides of the polygonal workpiece; obtaining the dimensional parameters of the polygonal workpiece includes:
[0009] Establish a rectangular coordinate system, and determine the vertex coordinates of the polygonal workpiece based on the rectangular coordinate system;
[0010] The side lengths and angles between the sides of the polygonal workpiece are determined based on the coordinates of the adjacent vertices of the polygonal workpiece.
[0011] Preferably, the dimensional parameters further include the center of gravity of the polygonal workpiece, and obtaining the dimensional parameters of the polygonal workpiece includes:
[0012] The centroid of the polygonal workpiece is determined based on the coordinates of all its vertices.
[0013] Preferably, the polygon includes triangles and non-triangular shapes, and determining the centroid of the polygonal workpiece based on the coordinates of all its vertices includes:
[0014] When the polygon is a triangle, the centroid of the polygonal workpiece is determined according to the formula for calculating the centroid of a triangle.
[0015] When the polygon is not a triangle, the polygon is cut into multiple triangles, the centroid and area of each triangle are calculated, and the centroid of the non-triangle is determined based on the centroid and area of each triangle and using a weighted average algorithm.
[0016] Preferably, determining the polishing strategy based on the dimensional parameters includes:
[0017] Determine the initial grinding point coordinates based on the vertex coordinates;
[0018] The initial grinding length is determined based on the side length of the polygonal workpiece;
[0019] The initial rotation angle is determined based on the angle between the side lengths of the polygonal workpiece.
[0020] Preferably, the step of polishing the polygonal workpiece according to the polishing strategy includes:
[0021] Step 1: Based on the initial grinding point coordinates, take the current vertex of the polygonal workpiece as the initial grinding point, and grind the workpiece along the current side length of the polygonal workpiece according to the initial grinding length, wherein the initial grinding length is equal to the current side length.
[0022] The second step is to use the current vertex of the polygonal workpiece as the rotation point, and rotate the workpiece according to the initial rotation angle.
[0023] Repeat steps one and two in a loop until all sides of all polygonal workpieces have been polished.
[0024] Preferably, determining the initial rotation angle based on the angle between the side lengths of the polygonal workpiece includes:
[0025] Taking the initial grinding point coordinates as the endpoint, and the current side length as one of the side lengths, the acute angle formed by the current side length and the other side lengths is the angle between the side lengths;
[0026] The initial rotation angle is obtained by subtracting the angle between the side lengths from 180 degrees.
[0027] The present invention also provides a polygonal workpiece grinding device, the polygonal workpiece grinding device comprising:
[0028] The parameter acquisition module acquires the dimensional parameters of the polygonal workpiece;
[0029] The strategy determination module determines the polishing strategy based on the size parameters.
[0030] The grinding control module grinds the polygonal workpiece according to the grinding strategy.
[0031] The present invention also provides an electronic device, including a memory and a processor, wherein,
[0032] The memory is used to store programs;
[0033] The processor, coupled to the memory, is used to execute the program stored in the memory to implement the steps in the polygonal workpiece grinding method in any of the above implementations.
[0034] The present invention also provides a computer-readable storage medium for storing a computer-readable program or instructions, which, when executed by a processor, can implement the steps of the polygonal workpiece grinding method described in any of the above implementations.
[0035] The beneficial effects of the above embodiments are: the polygonal workpiece grinding method provided by the present invention obtains the size parameters of the polygonal workpiece and determines the grinding sequence and grinding points according to the size parameters, so that the grinding tool can perform grinding under the set strategy, saving labor costs and greatly improving grinding efficiency. Attached Figure Description
[0036] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0037] Figure 1 A schematic flowchart of an embodiment of the polygonal workpiece grinding method provided by the present invention;
[0038] Figure 2 A schematic diagram of an embodiment of the present invention where the polygon is not a triangle and is the centroid.
[0039] Figure 3 This is a schematic flowchart of another embodiment of the polygonal workpiece grinding method provided by the present invention;
[0040] Figure 4 This is a schematic diagram of an embodiment of polygon grinding along the edge length provided by the present invention;
[0041] Figure 5A schematic diagram of an embodiment of polygon grinding along an initial rotation angle provided by the present invention;
[0042] Figure 6 A schematic diagram of one embodiment of the polygonal workpiece grinding apparatus provided in this invention; Figure 7 A schematic diagram of an embodiment of the electronic device provided in this invention. Detailed Implementation
[0043] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.
[0044] Hereinafter, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of embodiments of this application, unless otherwise stated, "a plurality of" means two or more.
[0045] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of the invention. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0046] This invention provides a method, apparatus, electronic device, and storage medium for grinding polygonal workpieces, which are described below.
[0047] like Figure 1 The diagram shown is a flowchart of an embodiment of the polygonal workpiece grinding method provided by the present invention. The method includes:
[0048] S101. Obtain the dimensional parameters of the polygonal workpiece;
[0049] As a specific example, a polygonal workpiece can be a regular shape such as a triangle or quadrilateral, or an irregular shape such as a star or ellipse. Obviously, the dimensional parameters of a polygonal workpiece generally include basic dimensional parameters such as the workpiece's side length, angle, center of gravity, and centroid.
[0050] S102. Determine the polishing strategy based on the dimensional parameters;
[0051] As a specific implementation, the grinding strategy can be an integration of conventional grinding operation methods such as grinding sequence, grinding force, and angle. Grinding based on size parameters refers to designing which parameters to use as reference values for fine grinding based on parameters such as the length, side length, and angle of the polygonal workpiece. For example, grinding along the side length and then rotating according to the angle of the workpiece before subsequent grinding.
[0052] S103. Grind the polygonal workpiece according to the grinding strategy.
[0053] In a specific embodiment, a grinding tool is required for grinding. The grinding tool can be an automatic grinding machine, which is equipped with a processor with software processing function to grind the polygonal workpiece according to a pre-set grinding program (built-in grinding strategy).
[0054] In a preferred embodiment, the polygonal workpiece can be gripped and moved by a gripping device (such as a robotic arm) while the grinding machine remains stationary. The grinding of the polygonal workpiece is achieved by the movement of the polygonal workpiece (according to the motion trajectory defined by the grinding strategy). In a specific embodiment, a SCARA robotic arm can be selected as the gripping device.
[0055] In one specific embodiment, the instructions used by the SCARA robot arm to perform the polishing action are as follows:
[0056] (1)G1_XY_R(X,Y,Z)--Relative linear motion
[0057] This command moves the user in a straight line relative to the current position, based on the input X, Y, Z values, to the specified offset position.
[0058] (2)G2_XY_R(X,Y,I,J,Θ)-- Performs clockwise circular motion.
[0059] (3)G3_XY_R(X,Y,I,J,Θ)-- Performs counterclockwise circular motion.
[0060] Both of the above instructions perform circular motion. X and Y refer to the endpoint coordinates relative to the current point, I and J are the center coordinates relative to the current point, and Θ is the angle of rotation of the current point around the center I and J.
[0061] The specific process of the polishing algorithm is as follows: the polishing action is to first polish G1_XY_R(length,0,0) in a straight line, and then use the instruction G3_XY_R(X,Y,I,J,180-degree) to rotate around the vertex by 180-degree angle, and then repeat this action.
[0062] In a preferred embodiment, the dimensional parameters include the vertices, side lengths, and angles between the sides of the polygonal workpiece; obtaining the dimensional parameters of the polygonal workpiece includes:
[0063] Establish a rectangular coordinate system, and determine the vertex coordinates of the polygonal workpiece based on the rectangular coordinate system;
[0064] The side lengths and angles between the sides of the polygonal workpiece are determined based on the coordinates of the adjacent vertices of the polygonal workpiece.
[0065] Specifically, a Cartesian coordinate system can be established in CAD software, and the obtained polygonal workpiece size parameters are all represented by coordinates in the CAD Cartesian coordinate system. As a specific embodiment, the corresponding coordinates of the polygonal workpiece size parameters can be integrated into a data packet and sent to the built-in memory of the gripping device (such as a SCARA robot).
[0066] Taking a triangle as an example, assuming the coordinates of the three vertices of the polygonal workpiece are (x1, y1), (x2, y2), and (x3, y3), then the distance between any two vertices is:
[0067] length[i]=math.sqrt((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1)).
[0068] Thus, assuming the three side lengths of the polygonal workpiece are a, b, and c, the three side lengths are as follows:
[0069] a=math.sqrt((x2-x3)*(x2-x3)+(y2-y3)*(y2-y3))
[0070] b=math.sqrt((x3-x1)*(x3-x1)+(y3-y1)*(y3-y1))
[0071] c=math.sqrt((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1))
[0072] If we want to calculate the included angle between the side lengths, one of the included angles is:
[0073] degree[i]=math.acos(a*a+c*cb*b) / (2*a*c).
[0074] In a preferred embodiment, the dimensional parameters further include the centroid of the polygonal workpiece, and obtaining the dimensional parameters of the polygonal workpiece includes:
[0075] The centroid of the polygonal workpiece is determined based on the coordinates of all its vertices.
[0076] In a preferred embodiment, the polygon includes triangles and non-triangular shapes, and determining the centroid of the polygonal workpiece based on the coordinates of all its vertices includes:
[0077] When the polygon is a triangle, the centroid of the polygonal workpiece is determined according to the formula for calculating the centroid of a triangle.
[0078] Specifically, taking a triangle as an example, with the coordinates of its three vertices being (x1, y1), (x2, y2), and (x3, y3), the centroid coordinates G(xc, yc) of the polygonal workpiece are:
[0079] xc = (x1 + x2 + x3) / 3
[0080] yc = (y1 + y2 + y3) / 3.
[0081] When the polygon is not a triangle, the polygon is cut into multiple triangles, the centroid and area of each triangle are calculated, and the centroid of the non-triangle is determined based on the centroid and area of each triangle and using a weighted average algorithm.
[0082] Please see Figure 2 , Figure 2 This is a schematic diagram of an embodiment of the centroid of a polygon that is not a triangle, provided by the present invention. The specific calculation process for determining the centroid of a non-triangular polygon is as follows:
[0083] (1) Using a vertex A1 of the polygon as the origin (you can choose the first point input as the origin), draw a line segment connecting A1 with all other non-adjacent vertices to divide the polygon (n sides) into n-2 triangles.
[0084] (2) Find the area and centroid of each triangle.
[0085] Let the centroid of one of the triangles be G(cx, cy), and the coordinates of its vertices be A1(x1, y1), A2(x2, y2), and A3(x3, y3). Then we have:
[0086] cx = (x1 + x2 + x3) / 3
[0087] cy = (y1 + y2 + y3) / 3
[0088] The area is: s=((x2-x1)*(y3-y1)-(x3-x1)*(y2-y1)) / 2.
[0089] The formula for the centroid coordinates is:
[0090] cx = (∑cx[i]*s[i]) / ∑s[i]
[0091] cy = (∑cy[i]*s[i]) / ∑s[i]
[0092] Where (cx[i], cy[i]) and s[i] are the centroid coordinates and area of the i-th triangle, respectively. It should be noted that when calculating the centroid coordinates in (2), it is necessary to divide by 3. In fact, it is not necessary to divide by 3 when calculating the coordinates of each triangle. It is only necessary to calculate ∑cx[i]*s[i] and then divide by 3 once.
[0093] In a preferred embodiment, determining the polishing strategy based on the dimensional parameters includes:
[0094] Determine the initial grinding point coordinates based on the vertex coordinates;
[0095] The initial grinding length is determined based on the side length of the polygonal workpiece;
[0096] The initial rotation angle is determined based on the angle between the side lengths of the polygonal workpiece.
[0097] As a specific embodiment, the grinding of the polygonal workpiece according to the grinding strategy includes:
[0098] Step 1: Based on the initial grinding point coordinates, take the current vertex of the polygonal workpiece as the initial grinding point, and grind the workpiece along the current side length of the polygonal workpiece according to the initial grinding length, wherein the initial grinding length is equal to the current side length.
[0099] The second step is to use the current vertex of the polygonal workpiece as the rotation point, and rotate the workpiece according to the initial rotation angle.
[0100] Repeat steps one and two in a loop until all sides of all polygonal workpieces have been polished.
[0101] Preferably, determining the initial rotation angle based on the angle between the side lengths of the polygonal workpiece includes:
[0102] Taking the initial grinding point coordinates as the endpoint, and the current side length as one of the side lengths, the acute angle formed by the current side length and the other side lengths is the angle between the side lengths;
[0103] The initial rotation angle is obtained by subtracting the angle between the side lengths from 180 degrees.
[0104] For a further explanation of the sanding process, please refer to [link / reference]. Figure 3 , Figure 3This is a schematic flowchart of another embodiment of the polygonal workpiece grinding method provided by the present invention. In this embodiment, the gripping device is a SCARA robot, and the gripping point of the SCARA robot is the center of gravity of the polygonal workpiece. The center of gravity needs to be calculated and obtained in real time.
[0105] In step S201, the coordinates Point and Pointy are obtained from the CAD file. These coordinates are the coordinates of any vertex of the polygon.
[0106] In step S202, the side length and angle are obtained through Pointx and Pointy;
[0107] In step S203, the centroid G of the polygonal workpiece is obtained through Pointx and Pointy;
[0108] In step S204, the rotation parameters are solved using the angle and the center of gravity, wherein the rotation parameters are the initial rotation angles;
[0109] In step S205, a grinding command is obtained based on the rotation parameters and side length. After the SCARA robot receives the grinding command, it operates the polygonal workpiece to perform grinding according to the set strategy.
[0110] Now, taking a non-triangular workpiece as an example, we will further explain the grinding process of polygonal workpieces using a SCARA robot, as follows:
[0111] Based on the centroid coordinates and area (i.e. [i], cy[i]), s[i]) obtained in the aforementioned embodiment, given the centroid G0(x1, y1) before rotation, and the fixed grinding point A(x2, y2), and the rotation angle b of point G0 around point A as the center of the circle, the centroid G1(x, y) after rotation can be calculated.
[0112] Having determined the centroid G0(x1,y1) of the polygon before rotation, and fixing the grinding points A(x2,y2) and G1(x,y), we can calculate the relative coordinates (X,Y) of the target point after rotation, and the relative coordinates (I,J) of the rotation point.
[0113] X = x - x1
[0114] Y = y - y1
[0115] I = x2 - x1 -- Rotate around A(x2, y2)
[0116] J = y2 - y1
[0117] The rotation command is: G3_XY_R(X,Y,I,J,degree[i]*180 / PI), where radians are converted to degrees.
[0118] Now, let's take a triangular workpiece as an example again. Please refer to [link / reference]. Figure 4-5 , Figure 4 This is a schematic diagram of an embodiment of polygon grinding provided by the present invention, which involves grinding along the edge length. Figure 5 This is a schematic diagram of an embodiment of the polygon grinding process provided by the present invention, which involves rotating along an initial rotation angle.
[0119] First, assuming the robotic arm's gripping position is the centroid G0 of the triangular workpiece, then one side of the triangular workpiece to be ground is first taught to a fixed grinding point, and then the workpiece moves along the x-direction ( Figure 4 Grinding (from left to right) at a distance equal to the side length of the triangular workpiece.
[0120] Then, when the triangular workpiece moves to the top Figure 4 After the indicated location, then look Figure 5 (The graphic changes from blurry to solid), requiring rotation around a fixed polishing point (see...). Figure 5 ), and move from position G0 around the fixed grinding point to G1.
[0121] Finally, repeat the above. Figure 4 and Figure 5 The grinding process continues until all edges are ground, at which point the workpiece is considered finished.
[0122] To better implement the polygonal workpiece grinding method in this embodiment of the invention, based on the polygonal workpiece grinding method, correspondingly, as follows: Figure 6 As shown, this embodiment of the invention also provides a polygonal workpiece grinding device 600, comprising:
[0123] Parameter acquisition module 601 acquires the dimensional parameters of the polygonal workpiece;
[0124] The strategy determination module 602 determines the polishing strategy based on the size parameters.
[0125] The grinding control module 603 grinds the polygonal workpiece according to the grinding strategy.
[0126] It should be noted that the polygonal workpiece grinding device 600 provided in the above embodiments can realize the technical solutions described in the above method embodiments. The specific implementation principles of each module or unit can be found in the corresponding content in the above method embodiments, and will not be repeated here.
[0127] like Figure 7 As shown, based on the above-described method for grinding polygonal workpieces, the present invention also provides an electronic device 700. The electronic device 700 includes a processor 701, a memory 702, and a display 703. Figure 7Only some components of the electronic device 700 are shown, but it should be understood that it is not required to implement all the components shown, and more or fewer components may be implemented instead.
[0128] In some embodiments, the memory 702 may be an internal storage unit of the electronic device 700, such as a hard disk or memory of the electronic device 700. In other embodiments, the memory 702 may also be an external storage device of the electronic device 700, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc. equipped on the electronic device 700.
[0129] Furthermore, the memory 702 may include both internal storage units of the electronic device 700 and external storage devices. The memory 702 is used to store application software and various types of data installed on the electronic device 700.
[0130] In some embodiments, the processor 701 may be a central processing unit (CPU), a microprocessor, or other data processing chip, used to run program code stored in the memory 702 or process data, such as the polygonal workpiece grinding method of the present invention.
[0131] In some embodiments, the display 703 may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, or an OLED (Organic Light-Emitting Diode) touchscreen. The display 703 is used to display information on the electronic device 700 and to display a visual user interface. Components 701-703 of the electronic device 700 communicate with each other via a system bus.
[0132] In one embodiment, when the processor 701 executes the polygonal workpiece grinding program 704 in the memory 702, the following steps can be implemented:
[0133] Obtain the dimensional parameters of the polygonal workpiece;
[0134] Determine the polishing strategy based on the aforementioned dimensional parameters;
[0135] The polygonal workpiece is polished according to the polishing strategy.
[0136] It should be understood that when the processor 701 executes the polygonal workpiece grinding program 704 in the memory 702, in addition to the functions mentioned above, it can also perform other functions, as can be found in the description of the corresponding method embodiments above.
[0137] Furthermore, the embodiments of the present invention do not specifically limit the type of electronic device 700 mentioned. Electronic device 700 can be a mobile phone, tablet computer, personal digital assistant (PDA), wearable device, laptop computer, or other portable electronic device. Exemplary embodiments of portable electronic devices include, but are not limited to, portable electronic devices running iOS, Android, Microsoft, or other operating systems. The aforementioned portable electronic device can also be other portable electronic devices, such as a laptop computer with a touch-sensitive surface (e.g., a touch panel). It should also be understood that in some other embodiments of the present invention, electronic device 700 may not be a portable electronic device, but rather a desktop computer with a touch-sensitive surface (e.g., a touch panel).
[0138] Accordingly, this application also provides a computer-readable storage medium for storing a computer-readable program or instruction, which, when executed by a processor, can implement the method steps or functions provided in the above-described method embodiments.
[0139] Those skilled in the art will understand that all or part of the processes of the methods described in the above embodiments can be implemented by a computer program instructing related hardware, and the program can be stored in a computer-readable storage medium. The computer-readable storage medium may be a disk, optical disk, read-only memory, or random access memory, etc. The polygonal workpiece grinding method, apparatus, electronic device, and storage medium provided by the present invention have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of the present invention; at the same time, those skilled in the art will recognize that, based on the ideas of the present invention, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of the present invention.
Claims
1. A method for grinding polygonal workpieces, characterized in that, include: Establish a rectangular coordinate system, determine the vertex coordinates of the polygonal workpiece based on the rectangular coordinate system, determine the side length and angle between the sides of the polygonal workpiece based on the coordinates of the adjacent vertices of the polygonal workpiece, and determine the centroid of the polygonal workpiece based on the coordinates of all vertices of the polygonal workpiece. The grinding strategy is determined based on the dimensional parameters, including: determining the initial grinding point coordinates based on the vertex coordinates; determining the initial grinding length based on the side length of the polygonal workpiece; and determining the initial rotation angle based on the angle between the sides of the polygonal workpiece. Determining the initial rotation angle based on the angle between the side lengths of the polygonal workpiece includes: taking the initial grinding point coordinates as the endpoint, taking the current side length as one of the side lengths, and the acute angle formed by the current side length and the other side lengths is the angle between the side lengths; 180 degrees minus the angle between the side lengths is the initial rotation angle. Polishing the polygonal workpiece according to the polishing strategy includes: Step 1: Based on the initial grinding point coordinates, take the current vertex of the polygonal workpiece as the initial grinding point, and grind the workpiece along the current side length of the polygonal workpiece according to the initial grinding length, wherein the initial grinding length is equal to the current side length. The second step is to use the current vertex of the polygonal workpiece as the rotation point, and rotate the workpiece according to the initial rotation angle. Repeat steps one and two in a loop until all sides of all polygonal workpieces have been polished.
2. The method for grinding polygonal workpieces according to claim 1, characterized in that, The polygon includes triangles and non-triangular shapes, and determining the centroid of the polygonal workpiece based on the coordinates of all its vertices includes: When the polygon is a triangle, the centroid of the polygonal workpiece is determined according to the formula for calculating the centroid of a triangle. When the polygon is not a triangle, the polygon is cut into multiple triangles, the centroid and area of each triangle are calculated, and the centroid of the non-triangle is determined based on the centroid and area of each triangle and using a weighted average algorithm.
3. A grinding device for polygonal workpieces, characterized in that, include: The parameter acquisition module establishes a rectangular coordinate system, determines the vertex coordinates of the polygonal workpiece based on the rectangular coordinate system, determines the side length and angle between the sides of the polygonal workpiece based on the coordinates of the adjacent vertices of the polygonal workpiece, and determines the centroid of the polygonal workpiece based on the coordinates of all vertices of the polygonal workpiece. The strategy determination module determines the grinding strategy based on the size parameters, including: determining the initial grinding point coordinates based on the vertex coordinates; determining the initial grinding length based on the side length of the polygonal workpiece; and determining the initial rotation angle based on the angle between the side lengths of the polygonal workpiece. Determining the initial rotation angle based on the angle between the side lengths of the polygonal workpiece includes: taking the initial grinding point coordinates as the endpoint, taking the current side length as one of the side lengths, and the acute angle formed by the current side length and the other side lengths is the angle between the side lengths; 180 degrees minus the angle between the side lengths is the initial rotation angle. The grinding control module grinds the polygonal workpiece according to the grinding strategy, including: Step 1: Based on the initial grinding point coordinates, take the current vertex of the polygonal workpiece as the initial grinding point, and grind the workpiece along the current side length of the polygonal workpiece according to the initial grinding length, wherein the initial grinding length is equal to the current side length. The second step is to use the current vertex of the polygonal workpiece as the rotation point, and rotate the workpiece according to the initial rotation angle. Repeat steps one and two in a loop until all sides of all polygonal workpieces have been polished.
4. An electronic device, characterized in that, The method includes a memory and a processor, wherein the memory is used to store a program; and the processor is coupled to the memory and is used to execute the program stored in the memory to implement the steps in the polygonal workpiece grinding method according to any one of claims 1 to 2.
5. A computer-readable storage medium, characterized in that, Used to store computer-readable programs or instructions, which, when executed by a processor, are capable of implementing the steps in the polygonal workpiece grinding method according to any one of claims 1 to 2.