CN117161898A - Curved surface model polishing method - Google Patents

Curved surface model polishing method Download PDF

Info

Publication number
CN117161898A
CN117161898A CN202311245925.8A CN202311245925A CN117161898A CN 117161898 A CN117161898 A CN 117161898A CN 202311245925 A CN202311245925 A CN 202311245925A CN 117161898 A CN117161898 A CN 117161898A
Authority
CN
China
Prior art keywords
contour
point
target
contour point
track
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311245925.8A
Other languages
Chinese (zh)
Inventor
黄圣弼
杨元坤
杨家荣
张书绮
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fulian Yuzhan Technology Shenzhen Co Ltd
Original Assignee
Fulian Yuzhan Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fulian Yuzhan Technology Shenzhen Co Ltd filed Critical Fulian Yuzhan Technology Shenzhen Co Ltd
Priority to CN202311245925.8A priority Critical patent/CN117161898A/en
Publication of CN117161898A publication Critical patent/CN117161898A/en
Pending legal-status Critical Current

Links

Landscapes

  • Numerical Control (AREA)

Abstract

The application provides a curved surface model polishing method, which comprises the following steps: acquiring a first contour line and a second contour line of the curved surface model, wherein the first contour line is provided with a plurality of first contour points, the second contour line is provided with a plurality of second contour points, and a first angle and a second angle corresponding to each second contour point are calculated; generating a target motion track according to a preset function, a first angle corresponding to each second contour point, a first coordinate of each first contour point and a target contour point corresponding to each second contour point in the plurality of first contour points; calculating the gesture of each target track point in the target motion track according to the second coordinate of each second contour point, the second angle corresponding to each second contour point and the initial normal vector of the target contour point; and controlling the mechanical arm to polish the curved surface model according to the target motion track and the gesture of each target track point. By using the method, the accuracy and the continuity of a plurality of target track points are ensured, and the generation efficiency and the polishing effect of the motion track can be improved.

Description

Curved surface model polishing method
Technical Field
The application relates to the field of intelligent manufacturing, in particular to a curved surface model polishing method.
Background
In the manufacturing industry, in order to remove machining traces (such as tool marks) on the surface of a curved surface model, a mechanical arm needs to be controlled to polish the curved surface model according to the motion trace of the mechanical arm. In the related art, it is often necessary to manually draw a motion trail of a mechanical arm, which is very complex and time-consuming, resulting in low generation efficiency of the motion trail.
In addition, since the motion trail drawn manually is difficult to ensure the consistency of intervals among a plurality of waveforms in the motion trail and the accuracy and the continuity of each trail point on the motion trail, the polishing density is uneven, and the polishing effect is affected.
Disclosure of Invention
In view of the foregoing, it is necessary to provide a polishing method for a curved surface model, which can improve the generation efficiency and polishing effect of a motion track.
In one aspect, the application provides a curved surface model polishing method, which comprises the following steps: obtaining a plurality of contour lines of a curved surface model, wherein the contour lines comprise a first contour line and a second contour line, the first contour line comprises a plurality of first contour points, the second contour line comprises a plurality of second contour points, each first contour point on the first contour line comprises a corresponding first coordinate and an initial normal vector, each second contour point on the second contour line comprises a corresponding second coordinate, a first angle and a second angle corresponding to each second contour point on the second contour line are calculated, a target contour point corresponding to each second contour point is determined in the first contour points according to the vertical coordinates of each second contour point and the vertical coordinates of each first contour point, a target contour point corresponding to each second contour point is generated according to a preset function, the first angle corresponding to each second contour point, the target contour point corresponding to each second contour point and the first coordinate of each first contour point, a motion profile of a mechanical arm is generated according to the first coordinate of each second contour point, the target contour point corresponding to each second contour point and the first contour point, the motion profile of each mechanical arm is calculated according to the first coordinate and the initial normal vector of each target contour point, and the motion profile of each mechanical arm is controlled according to the second contour point.
In some embodiments of the present application, the calculating the first angle corresponding to each second contour point on the second contour line includes: determining a first second contour point and a second contour point in the plurality of second contour points, calculating a first difference vector between second coordinates of the first second contour point and second coordinates of the second contour point, determining a second contour point behind each second contour point, calculating a second difference vector between second coordinates of each second contour point and second coordinates of a second contour point behind each second contour point, and calculating a first angle corresponding to each second contour point according to the first difference vector and the second difference vector.
In some embodiments of the present application, each target track point corresponds to one of the second contour points, and the calculating the gesture of the manipulator arm passing through each target track point includes: and calculating a tangential vector of a target track point corresponding to each second contour point according to the second angle corresponding to each second contour point and the second difference vector, calculating a target normal vector of the target track point corresponding to each second contour point according to the second angle corresponding to each second contour point and the initial normal vector of the target track point corresponding to each second contour point, calculating a target vector of the target track point corresponding to each second contour point according to the tangential vector and the target normal vector, and calculating a posture of the target track point corresponding to each second contour point according to the tangential vector, the target normal vector and the target vector.
In some embodiments of the present application, the generating the target motion profile of the robot arm includes: determining a first target vertical coordinate and a second target vertical coordinate from all first coordinates of a plurality of first contour points on the first contour line, calculating a first difference value between the first target vertical coordinate and the second target vertical coordinate, adjusting the second contour line according to the preset function, the preset wave number and the first difference value to obtain an initial motion track, wherein the initial motion track comprises initial track points corresponding to each second contour point, calculating a track difference value vector of each initial track point according to the vertical coordinates of the second contour points, the abscissa coordinates of the plurality of first contour points and the first angle corresponding to each second contour point, and adjusting the coordinates of the corresponding initial track point according to each track difference value vector to obtain the target motion track.
In some embodiments of the present application, the adjusting the second contour line according to the preset function, the preset wave number, and the first difference value, to obtain an initial motion trajectory includes: and determining the point number of each second contour point, carrying out function operation on the point number of each second contour point, the number of a plurality of second contour points on the second contour line and the preset wave number according to the preset function to obtain a function value of each second contour point, calculating a third target vertical coordinate corresponding to each second contour point according to the function value of each second contour point and the first difference value, and adjusting the vertical coordinate of the corresponding second contour point according to each third target vertical coordinate to obtain the initial motion track.
In some embodiments of the present application, the adjusting the vertical coordinates of the corresponding second contour point according to the vertical coordinates of each third target, to obtain the initial motion trajectory includes: and replacing the vertical coordinate of each second contour point with the third target vertical coordinate corresponding to the second contour point to obtain the first initial coordinate of each second contour point, determining the point on the first initial coordinate of each second contour point as the initial track point corresponding to the second contour point, determining a curve formed by arranging a plurality of initial track points as the initial motion track, or replacing the vertical coordinate of each second contour point with the third target vertical coordinate corresponding to the second contour point to obtain the second initial coordinate of each second contour point, performing smoothing processing on the second initial coordinate of each second contour point by using a spline interpolation algorithm to obtain the third initial coordinate of each second contour point, determining the point on the third initial coordinate of each second contour point as the initial track point corresponding to the second contour point, and determining the curve formed by arranging a plurality of initial track points as the initial motion track.
In some embodiments of the present application, the calculating the second angle corresponding to each second contour point on the second contour line includes: and calculating a second angle corresponding to each second contour point according to the point number of each second contour point and the preset value.
In some embodiments of the present application, the calculating the trajectory difference vector of each initial trajectory point according to the vertical coordinates of the second contour point, the horizontal coordinates of the plurality of first contour points, and the first angle corresponding to each second contour point includes: and determining a target abscissa from all abscissas of the plurality of first contour points, calculating a second difference value of each second contour point according to the target abscissa and the abscissas of the target contour point corresponding to each second contour point, and calculating a track difference vector of an initial track point corresponding to each second contour point according to the first angle and the second difference value corresponding to each second contour point.
In some embodiments of the present application, the acquiring the plurality of contours of the curved surface model includes: modeling the curved surface model to obtain a virtual model, and extracting the contour lines from the virtual model.
In some embodiments of the present application, the determining, in the plurality of first contour points, the target contour point corresponding to each second contour point according to the vertical coordinate of each second contour point and the vertical coordinate of each first contour point includes: and calculating a vertical coordinate difference value between the vertical coordinate of each second contour point and the vertical coordinate of each first contour point, and determining the first contour point corresponding to the smallest vertical coordinate difference value as the target contour point corresponding to each second contour point.
According to the embodiment, according to the preset function, the second contour line, the first angle corresponding to each second contour point, the target contour point corresponding to each second contour point and the first coordinate of each first contour point, the target motion trail of the mechanical arm can be automatically generated without manually outlining and drawing, so that time can be saved, and the generation efficiency of the motion trail is improved. Since the target motion trail can be automatically generated without manually drawing, the consistency of intervals among a plurality of waveforms in the target motion trail and the accuracy and the continuity of each point can be ensured. The target motion trail is calculated through a plurality of contour lines of the virtual model corresponding to the curved surface model, and the contour lines accurately reflect the contour characteristics of the curved surface model, so that the fit between the target motion trail and the curved surface model can be ensured. When the mechanical arm is controlled to polish the curved surface model according to the coordinates and self-discussion of a plurality of target track points in the target motion track, the polishing uniformity and accuracy can be ensured, and thus the polishing effect is improved.
Drawings
Fig. 1 is an application scenario diagram of a curved surface model polishing method provided by an embodiment of the present application.
Fig. 2 is a flowchart of a curved surface model polishing method according to an embodiment of the present application.
Fig. 3 is a schematic diagram of a curved surface model 30 according to an embodiment of the present application.
Fig. 4 is a schematic diagram of a first contour line and a second contour line according to an embodiment of the present application.
Fig. 5 is a schematic diagram showing a change of the first angle and the second angle according to an embodiment of the present application.
Fig. 6 is a schematic diagram of a target motion trajectory and a gesture of each target motion trajectory according to an embodiment of the present application.
Fig. 7 is a flowchart of calculating a first angle according to an embodiment of the present application.
Fig. 8 is a schematic diagram of calculating a first angle according to an embodiment of the present application.
Fig. 9 is a flowchart of generating a target motion trajectory according to an embodiment of the present application.
Fig. 10 is a schematic diagram of an initial motion trajectory provided by an embodiment of the present application.
Fig. 11 is a schematic diagram showing a comparison of peaks of an initial motion trajectory according to an embodiment of the present application.
Fig. 12 is a schematic diagram of each second contour point and a target contour point according to an embodiment of the present application.
Fig. 13 is a schematic diagram of a target motion trajectory according to an embodiment of the present application.
Fig. 14 is a schematic diagram showing comparison of target motion trajectories corresponding to different preset wave numbers according to an embodiment of the present application.
Fig. 15 is a schematic diagram illustrating comparison of target motion trajectories corresponding to third target vertical coordinates with different sizes according to an embodiment of the present application.
Fig. 16 is a schematic diagram showing comparison of target motion trajectories corresponding to different numbers of initial trajectory points according to an embodiment of the present application.
Fig. 17 is a schematic diagram illustrating comparison of target motion trajectories corresponding to second difference values with different magnitudes according to an embodiment of the present application.
Fig. 18 is a schematic diagram illustrating comparison of target motion trajectories corresponding to different preset functions according to an embodiment of the present application.
Fig. 19 is a flowchart of a method for calculating the pose of each target track point according to the embodiment of the present application.
Fig. 20 is a schematic diagram of tangential vectors according to an embodiment of the present application.
Fig. 21 is a schematic diagram of a target normal vector according to an embodiment of the present application.
Fig. 22 is a block diagram of the electronic device 10 according to the embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application will be described in detail with reference to the accompanying drawings and specific embodiments.
In the present application, "at least one" means one or more, and "a plurality" means two or more. "and/or", describes an association relationship of an association object, and the representation may have three relationships, for example, a and/or B may represent: a alone, a and B together, and B alone, wherein a, B may be singular or plural. The terms "first," "second," "third," "fourth" and the like in the description and in the claims and drawings, if any, are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order.
In embodiments of the application, the words "exemplary," "or," "such as," and the like are used to mean serving as an example, instance, or illustration. Any embodiment or design described herein as "exemplary" or "e.g." in an embodiment should not be taken as preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary" or "such as" is intended to present related concepts in a concrete fashion.
In the manufacturing industry, in order to remove machining traces (such as tool marks) on the surface of a curved surface model, a mechanical arm needs to be controlled to polish the curved surface model according to the motion trace of the mechanical arm. In the related art, it is often necessary to manually draw a motion trail of a mechanical arm, which is very complex and time-consuming, resulting in low generation efficiency of the motion trail.
In addition, since the motion trail drawn manually is difficult to ensure the consistency of intervals among a plurality of waveforms in the motion trail and the accuracy and the continuity of each trail point on the motion trail, the polishing density is uneven, and the polishing effect is affected.
In order to solve the technical problems, the application provides a curved surface model polishing method which can improve the generation efficiency and polishing effect of a motion track. The curved surface model polishing method provided by the embodiment of the application can be applied to one or more electronic devices.
Fig. 1 is an application scenario diagram of a curved surface model polishing method provided by an embodiment of the present application. In the embodiment of the present application, a plurality of contour lines of the curved surface model 30 may be calculated by the electronic device 10 to obtain a target motion track of the mechanical arm 20 for polishing the curved surface model 30 and a gesture of each target track point on the target motion track, and the mechanical arm 20 is controlled to polish the curved surface model 30 according to the target motion track and the gesture of each target track point. The calculation step of the target motion trajectory may refer to steps S11 to S15 hereinafter. The electronic device 10 and the robot arm 20 may be connected by a wired connection, or may be connected by wireless communication through wireless fidelity (Wi-Fi) or bluetooth. For example, the electronic device 10 may control the robotic arm 20 to polish the curved model 30 using a grinding wheel.
The electronic device 10 may be a computer device, a mobile phone, a tablet computer, an industrial personal computer (IndustrialPersonalComputer, IPC) or other electronic devices, and the application is not limited in particular type to the electronic device 10.
The robot arm 20 is a mechanical device for performing various tasks, and the robot arm 20 can move and manipulate objects, such as sanding objects, in a space. The mechanical arm 20 may be composed of a plurality of joints, and precise control of the mechanical arm 20 may be achieved through a computer device or an industrial personal computer.
The curved surface model 30 is a model having a fixed curvature (curvature continuously varying range is 0 to 0.51/mm). For example, the curved surface model 30 may be an external model of an object, such as a handset casing model with a length of 70-160 mm, a width of 70-160 mm, and a height of 5-10 mm, and the specific product and size are not limited in practical application.
Fig. 2 is a flowchart of a curved surface model polishing method according to an embodiment of the present application. The sequence of the steps in the flowchart may be adjusted according to actual requirements, and some steps may be omitted. The subject of execution of the method may be the electronic device 10 of fig. 1.
S11, acquiring a plurality of contour lines of the curved surface model 30, wherein the contour lines comprise a first contour line and a second contour line.
In some embodiments, the curved surface model 30 may be a model with a fixed curvature (curvature continuously varying from 0 to 0.51/mm), for example, fig. 3 is a schematic diagram of the curved surface model 30 according to an embodiment of the present application. The curved surface model 30 in fig. 3 is a handset casing model having a length of 70 to 160mm, a width of 70 to 160mm, and a height of 5 to 10mm, etc. The first contour line refers to a curve for describing the side radian of the curved surface model 30, and the second contour line refers to a curve for describing the overall shape of the curved surface model 30. The electronic device 10 acquiring the plurality of contours of the curved surface model 30 includes: the electronic device 10 may scan the curved surface model 30 using a scanning technique (such as a three-dimensional laser scanning technique) to obtain characteristics such as a shape and a size of the curved surface model 30, model according to the characteristics such as the shape and the size of the curved surface model 30, obtain a virtual model of the curved surface model 30, and extract a plurality of contour lines from the virtual model. The method for extracting the plurality of contour lines is not limited, and the number of the plurality of contour lines can be determined by the curved surface model 30. For example, the electronic device 10 may receive a profile extraction command of a user, extract the virtual model using an edge detection algorithm (such as Canny algorithm, sobel algorithm, and Laplace algorithm) to obtain a plurality of profile lines, or the electronic device 10 may extract the virtual model using a profile extraction function (such as find objects () function) to obtain a plurality of profile lines.
The first contour line comprises a plurality of first contour points, each first contour point has a first coordinate and an initial normal vector, and the second contour line comprises a plurality of second contour points, each second contour point has a second coordinate. The initial normal vector of each first contour point may be a unit normal vector, and the initial normal vector of each first contour point is used to indicate the normal direction of the surface model 30 at the first contour point. The number of all the first contour points on the first contour line, the point spacing between any two first contour points, the number of all the second contour points on the second contour line and the point spacing between any two second contour points can be set by themselves, which is not limited by the present application. The number of all the first contour points on the first contour line may be the same as or different from the number of all the second contour points on the second contour line. In the present embodiment, the number of first contour points that the first contour line has is different from the number of second contour points that the second contour line has.
In the embodiment of the present application, in order to ensure the accuracy of the first contour line, the number of first contour points may be set. For example, if the first contour line has m first contour points, where m is a positive integer greater than or equal to 4000, the first contour line formed by the first contour points can reflect the characteristics of the curved surface model 30 more accurately. Wherein m=preset wave number is 400×preset wave period is 2×400, the preset wave number is the number of waves, and the preset wave period is the length or width of each wave. The number of the preset waves and the preset wave period can be set by itself, and the application is not limited to this. In the present embodiment, the number of preset waves is 10 or more, and the preset wave period is 0.5 or more.
For example, if the curved surface model 30 is a mobile phone casing model, fig. 4 is a schematic diagram of a first contour line and a second contour line according to an embodiment of the present application. Fig. 4 (a) shows a first contour line, which is a side arc contour line of the mobile phone outer frame model, and the first contour line is formed by m first contour points, wherein m is 10000 (10000 is larger than 4000). Fig. 4 (b) shows a second contour line, which is a closed loop curve describing the overall contour of the handset casing model, and includes 4 corners, 2 long sides and 2 wide sides, and is formed by n second contour points, where n is 7400. If n=7400, each corner in the second contour line is defined by n 1 A second contour point, wherein n 1 The point spacing between any two second contour points in 1200 second contour points is less than or equal to 0.012mm. Each long side is formed by n 2 A second contour point, wherein n 2 The point spacing between any two second contour points in 1000 second contour points is less than or equal to 0.14mm. Each broadside is formed by n 3 A second contour point, wherein n 3 The point spacing between any two second contour points in 300 second contour points is less than or equal to 0.14mm.
In some embodiments of the present application, the electronic device 10 may construct one or three-dimensional coordinate systems, so that the virtual model of the curved surface model 30 is in one or more three-dimensional coordinate systems, where if the three-dimensional coordinate systems are multiple, the three-dimensional coordinate systems may be parallel to each other, and directions, units, positive axes, negative axes, etc. of an origin, an abscissa axis (x-axis), an ordinate axis (y-axis), and an ordinate axis (z-axis) in the three-dimensional coordinate systems may be set by themselves, which is not limited by the present application. The first coordinates of each first contour point and the second coordinates of each second contour point are coordinates in the three-dimensional coordinate system. For example, the first coordinates of each first contour point include an abscissa, an ordinate, and an ordinate, the abscissa of each first contour point is a coordinate of the first contour point perpendicular to the abscissa axis in the three-dimensional coordinate system, the ordinate of each first contour point is a coordinate of the first contour point perpendicular to the ordinate axis in the three-dimensional coordinate system, and the ordinate of each first contour point is a coordinate of the first contour point perpendicular to the ordinate axis in the three-dimensional coordinate system. The second coordinates of each second contour point comprise an abscissa, an ordinate and an ordinate, the abscissa of each second contour point is the coordinate of the second contour point perpendicular to the abscissa axis in the three-dimensional coordinate system, the ordinate of each second contour point is the coordinate of the second contour point perpendicular to the ordinate axis in the three-dimensional coordinate system, and the ordinate of each second contour point is the coordinate of the second contour point perpendicular to the ordinate axis in the three-dimensional coordinate system.
For example, in the above embodiment, if the curved surface model 30 is a mobile phone casing model, the first contour line is composed of 10000 first contour points, as shown in table 1, which is an example of the first coordinates and the initial normal vector of the first contour points according to an embodiment of the present application.
TABLE 1
For example, in the above embodiment, if the curved surface model 30 is a mobile phone casing model, and if the second contour line is made up of 7400 second contour points, as shown in table 2, the second coordinates of the second contour points are examples provided in an embodiment of the present application.
TABLE 2
S12, calculating a first angle and a second angle corresponding to each second contour point on the second contour line.
In some embodiments of the present application, the first angle is used to calculate a target motion trajectory of the robotic arm 20, and the second angle is used to calculate a pose of the robotic arm 20 passing each target trajectory point on the target motion trajectory. The electronic device 10 may number a plurality of first contour points such that each first contour point has a corresponding point number and a plurality of second contour points such that each second contour point has a corresponding point number. The first contour points and the second contour points are numbered in the same manner and can be set by themselves, which is not limited by the present application.
In some embodiments of the present application, the electronic device 10 calculating the second angle corresponding to each second contour point on the second contour line includes: the electronic device 10 calculates a second angle corresponding to each second contour point according to the point number of each second contour point and the preset value. The preset value comprises an angle value of one corner and a ratio of the angle value of one corner to the number of second contour points forming the corner. For example, with the above embodiment, the angle value of one corner is 90 degrees, and the number of second contour points constituting the corner is 1200.
For example, the calculation method of the second angle may refer to the following formula (1):
wherein i represents the point number of the ith second contour point, θ i Represents a second angle, θ, corresponding to the ith second contour point total An angle value representing one of the corners is shown,the ratio between the angular value representing one corner and the number of second contour points in that corner, K representing the number of second contour points constituting that corner. If theta is total =90, k=1200, then
For example, fig. 5 is a schematic diagram illustrating a change of the first angle and the second angle according to an embodiment of the present application. In fig. 5, the first angle varies following the first contour line, while the second angle varies linearly.
And S13, determining a target contour point corresponding to each second contour point in the plurality of first contour points according to the vertical coordinates of each second contour point and the vertical coordinates of each first contour point.
In some embodiments of the present application, the target contour point corresponding to each second contour point refers to the first contour point corresponding to the smallest difference in vertical coordinates, where the difference in vertical coordinates is the difference between the vertical coordinates of the second contour point and the vertical coordinates of each first contour point. The electronic device 10 traverses the vertical coordinates of all the first contour points on the first contour line according to the vertical coordinates of each second contour point, calculates a vertical coordinate difference value between the vertical coordinates of each second contour point and the vertical coordinates of each first contour point, and determines the first contour point corresponding to the smallest vertical coordinate difference value among the vertical coordinate differences between each second contour point and the first contour points as the target contour point corresponding to each second contour point.
S14, generating a target motion track of the mechanical arm 20 according to a preset function, the second contour lines, the first angles corresponding to the second contour points, the target contour points corresponding to the second contour points and the first coordinates of the first contour points.
In some embodiments of the present application, the preset function may be a waveform function. For example, the preset function is a sin function, a cos function, or the like. The target motion track is a motion track of the manipulator 20 polishing curved surface model 30, and comprises a plurality of target track points, wherein each target track point corresponds to one second contour point. The electronic device 10 determines a curve formed by arranging all the target trajectory points as a target motion trajectory.
S15, calculating the gesture of the mechanical arm 20 passing through each target track point according to the second coordinate of each second contour point, the second angle corresponding to each second contour point and the initial normal vector of the target contour point corresponding to each second contour point.
In some embodiments of the present application, the pose of the robotic arm 20 passing each target track point is the orientation or direction of the robotic arm 20 at each target track point, the pose of each target track point including a plurality of euler angles.
S16, controlling the mechanical arm 20 to polish the curved surface model 30 according to the target motion track and the gesture of each target track point.
In some embodiments of the present application, the mechanical arm 20 may hold a polishing tool such as a grinding wheel, and the electronic device 10 may analyze the coordinates of each target track point in the target motion track and the gesture of each target track point according to an inverse kinematics algorithm, so as to obtain an operation instruction, and send the operation instruction to the mechanical arm 20 to control the mechanical arm 20 to polish the curved surface model 30 by using the polishing tool, so as to remove a machining trace (such as a tool trace) on the curved surface model 30. The method for analyzing the coordinates of each target track point and the gesture of each target track point in the target motion track according to the algorithms such as inverse kinematics and the like can refer to the related technology. The number of operating instructions may be plural, and each operating instruction includes the position and posture of the grinding tool on the robot arm 20.
For example, fig. 6 is a schematic diagram of a target motion trajectory and a gesture of each target motion trajectory provided in an embodiment of the present application. In fig. 6, the target motion track is on the curved surface model 30, different depths on the target motion track represent different poses of the mechanical arm 20, and the electronic device 10 (such as an industrial personal computer) can control the mechanical arm 20 to uniformly polish the curved surface model 30 according to the target motion track and the pose of each target track point.
In this embodiment, since the related art needs to manually draw the target motion trail of the robot arm polishing curved surface model 30, it needs to go through the processes of loading the virtual model of the curved surface model 30, setting the coordinate system, manually drawing and outlining the target motion trail, mapping the target motion trail to the virtual model to determine whether the target motion trail is attached to the virtual model, and calculating the pose of each target track point, and the like, it needs to take at least 4 hours to execute the above process every time the target motion trail is generated. If the target motion trail and the number of target trail points need to be changed, more time is needed, the generation efficiency of the target motion trail is poor, and the interval of waves in each target motion trail is different due to the fact that the target motion trail is sketched manually, so that polishing density is uneven.
In order to solve the above technical problems, according to the preset function, the second contour line, the first angle corresponding to each second contour point, the target contour point corresponding to each second contour point, and the first coordinate of each first contour point, the present application can automatically generate the target motion track of the mechanical arm 20, without relying on manual sketching and drawing, and the time required for executing the steps in the embodiment of the present application is only +1/360 hours for modifying the program when the target motion track is generated once. According to comparison, the time spent for generating the target motion trail and the gesture of each target track point in the related technology is far less than that spent for generating the target motion trail and the gesture of each target track point, so that the time can be saved, and the generation efficiency of the motion trail is improved. Since the target motion trail can be automatically generated without manually drawing, the consistency of intervals among a plurality of waveforms in the target motion trail and the accuracy and the continuity of each point can be ensured. Since the target motion trajectory is calculated by a plurality of contour lines of the virtual model corresponding to the curved surface model 30, the plurality of contour lines accurately reflect the contour features of the curved surface model 30, so that the fit between the target motion trajectory and the curved surface model 30 can be ensured. When the mechanical arm 20 is controlled to polish the curved surface model 30 according to the coordinates and self-discussion of a plurality of target track points in the target motion track, the polishing uniformity and accuracy can be ensured, so that the polishing effect is improved.
In some embodiments of the present application, the first angle corresponding to each second contour point is calculated by the point numbers of the plurality of second contour points and the second coordinates. Fig. 7 is a flowchart of calculating a first angle according to an embodiment of the present application, including the following steps:
s121, determining a first second contour point and a second contour point in the plurality of second contour points.
In some embodiments of the present application, the first second contour point is a second contour point with a point number at the first position, and the second contour point is a second contour point with a point number at the second position. The first second contour point and the second contour point may be determined from among the plurality of second contour points according to the point number of each second contour point.
S122, calculating a first difference vector between the second coordinates of the first second contour point and the second coordinates of the second contour point.
In some embodiments of the present application, the electronic device 10 may subtract the second coordinate of the second contour point from the second coordinate of the first second contour point to obtain the first difference vector.
For example, the calculation method of the first difference vector may refer to the following formula (2):
V 12 =P 2 -P 1 ; (2)
Wherein V is 12 Representing a first difference vector, P 2 Second coordinates, P, representing a second contour point 1 Representing the second coordinates of the first second contour point. If P 1 =(-66.1584,1.998,-3.202),P 2 = (-66.0268,1.998, -3.202), then V 12 =(-66.0268,1.998,-3.202)-(-66.1584,1.998,-3.202)=(0.1316,0,0)=[0.1316 0 0]. If P 3 = (-65.89403,1.998, -3.202), then V 23 =(-65.89403,1.998,-3.202)-(-66.0268,1.998,-3.202)=(0.13277,0,0)=[0.13277 0 0]。
S123, determining a second contour point behind each second contour point.
In some embodiments of the application, the next second contour point of each second contour point may be the next second contour point of each second contour point. For example, the second contour point subsequent to the i-th second contour point is the i+1th second contour point.
S124, calculating a second difference vector between the second coordinate of each second contour point and the second coordinate of the next second contour point corresponding to each second contour point, and calculating a first angle corresponding to each second contour point according to the first difference vector and the second difference vector.
In some embodiments of the present application, the method for calculating the second difference vector is substantially the same as the method for calculating the first difference vector, so the description of the present application is not repeated here.
For example, in connection with the above embodiments, the calculation method of the first angle may refer to formulas (3) - (5):
V i(i+1) =P i+1 -P i ; (4)
wherein i represents the ith Point numbering, beta, of two contour points i Represents the first angle corresponding to the ith second contour point, n represents the number of all second contour points on the second contour line, V 12 Representing a first difference vector, P i Second coordinates representing the ith second contour point, P i+1 Representing the second coordinates of the second contour point subsequent to the ith second contour point, V i(i+1) Representing a second difference vector. If i=1:
P 1 =(-66.2911,1.998,-3.202),
P 2 = (-66.1584,1.998, -3.202), then
If i=2, p 2 =(-66.1584,1.998,-3.202),
P 3 = (-65.89403,1.998, -3.202), then V 23 =P 3 -P 2 =[0.13277 0 0],
For example, as shown in table 3, an example of the first angle corresponding to each second contour point is provided in an embodiment of the present application.
TABLE 3 Table 3
For example, in the above embodiment, if the number of all the second contour points on the second contour line is n, fig. 8 is a schematic diagram of calculating the first angle according to the embodiment of the present application. As can be seen from fig. 8, the first angles corresponding to the 1,2,3, … n-1 second contour points are the angles between the corresponding first and second difference vectors.
In some embodiments of the present application, the electronic device 10 generates the target motion trajectory of the mechanical arm 20 according to the preset function, the second contour line, the first angle corresponding to each second contour point, the target contour point corresponding to each second contour point, and the first coordinate of each first contour point. Fig. 9 is a flowchart of generating a target motion trajectory according to an embodiment of the present application, including the following steps:
S141, determining a first target vertical coordinate and a second target vertical coordinate from all first coordinates of a plurality of first contour points on the first contour line, and calculating a first difference value between the first target vertical coordinate and the second target vertical coordinate.
In some embodiments of the application, the first target vertical coordinate is the largest vertical coordinate of all vertical coordinates of the first plurality of contour points, and the second target vertical coordinate is the smallest vertical coordinate of all vertical coordinates of the first plurality of contour points. The electronic device 10 may traverse all of the vertical coordinates of the plurality of first contour points on the first contour line to determine the first target vertical coordinate and the second target vertical coordinate.
For example, the calculation method of the first difference may refer to the following formula (6):
wherein Z is Amp Representing a first difference, Z max Representing the first target vertical coordinate, Z min Representing the second target vertical coordinate.
And S142, adjusting the second contour lines according to a preset function, the preset wave number and the first difference value to obtain initial motion tracks, wherein the initial motion tracks comprise initial track points corresponding to each second contour point.
In some embodiments of the present application, the initial track points and the second contour points are in one-to-one correspondence, and the electronic device 10 adjusts the second contour line according to the preset function, the preset wave number and the first difference value, so as to obtain the initial motion track, where the obtaining includes: the electronic device 10 determines the point number of each second contour point, performs a function operation on the point number of each second contour point, the number of a plurality of second contour points on the second contour line and a preset wave number according to a preset function to obtain a function value of each second contour point, calculates a third target vertical coordinate corresponding to each second contour point according to the function value of each second contour point and the first difference value, and adjusts the vertical coordinate of the corresponding second contour point according to each third target vertical coordinate to obtain an initial motion track.
Wherein, the preset wave number can be set by oneself, and the application is not limited to this. For example, the preset wave number is 6, 8, 10, or the like.
For example, in the above embodiment, if the preset function is a sin function and a cos function, the calculation method of the third target vertical coordinate may refer to the following formula (7) or (8):
wherein i represents the point number of the ith second contour point, P i (0, Z) represents the third target vertical coordinate of the ith second contour point, Z Amp A first difference value is indicated and a second difference value is indicated,or->The function value representing the i-th second contour point, sin and cos representing a preset function, pi representing a circumference ratio, num representing a preset wave number, n 1 Representing the number of second contour points contained in each corner on the second contour line. For example, n 1 1200, pi of 3.14, num of any one of 4, 6, 8, 10, etc.
For example, if equation (7) is used to calculate the third target vertical coordinate, and n 1 =1200,num=6,Z Amp = 3.249488, when i=1,at iWhen the number of the codes is =2,if the third target vertical coordinate is calculated by adopting the formula (8), and n 1 =1200,num=6,Z Amp = 3.249488, ++1 when i=1> When i=2, _>
For example, in connection with the above embodiment, if the preset function is a sin function and a cos function, the calculation method of the third target vertical coordinate may also refer to the following formula (9) or (10):
Wherein i represents the point number of the ith second contour point, P i (0, Z) represents the third target vertical coordinate of the ith second contour point, Z Amp A first difference value is indicated and a second difference value is indicated,or->The function value representing the i-th second contour point, sin and cos representing a preset function, pi representing a circumference ratio, num representing a preset wave number, n 1 Representing the number of second contour points contained in each corner on the second contour line. For example, n 1 1200, pi of 3.14, num of any one of 4, 6, 8, 10, etc.
For example, if equation (9) is used to calculate the third target vertical coordinate, n 1 =1200,num=6,Z Amp = 3.249488, when i=1,at the time of i=2,
in some embodiments of the present application, the electronic device 10 adjusts the vertical coordinates of the corresponding second contour point according to each third target vertical coordinate, and obtaining the initial motion trajectory includes: the electronic device 10 adjusts the vertical coordinates of the corresponding second contour point according to the vertical coordinates of each third target, obtains the initial coordinates of each initial track point, and generates an initial motion track according to the initial coordinates of the plurality of initial track points. For example, fig. 10 is a schematic diagram of an initial motion trajectory provided by an embodiment of the present application.
Specifically, if the formula (7) or (8) is adopted to calculate the third target vertical coordinates, the electronic device 10 adjusts the vertical coordinates of the corresponding second contour point according to each third target vertical coordinate, and the obtaining the initial motion trajectory includes: the electronic device 10 replaces the vertical coordinate of each second contour point in the second contour line with the third target vertical coordinate corresponding to the second contour point, obtains the first initial coordinate of each second contour point, determines the point on the first initial coordinate of each second contour point as the initial track point corresponding to the second contour point, and determines the curve formed by arranging a plurality of initial track points as the initial motion track.
If the equation (9) or (10) is adopted to calculate the third target vertical coordinates, the electronic device 10 adjusts the vertical coordinates of the corresponding second contour point according to each third target vertical coordinate, and the obtaining the initial motion trail includes: the electronic device 10 replaces the vertical coordinate of each second contour point in the second contour line with the third target vertical coordinate corresponding to the second contour point to obtain the second initial coordinate of each second contour point, performs smoothing processing on the second initial coordinate of each second contour point by using a spline interpolation algorithm (spline), obtains the third initial coordinate of each second contour point, determines a point on the third initial coordinate of each second contour point as an initial track point corresponding to the second contour point, and determines a curve formed by arranging a plurality of initial track points as an initial motion track. For example, the method of smoothing the second initial coordinates of each second contour point to obtain the third initial coordinates of each second contour point may refer to the following formula (11):
First3P i (x,y,z)=spline(First2P i (x,y,z)); (11)
wherein, first3P i (x, y, z) represents the third initial coordinate of the ith second contour point, spline represents the function corresponding to the spline interpolation algorithm, first2P i (x, y, z) the second initial coordinates of the ith second contour point.
In some embodiments of the present application, since the third target coordinates obtained after the root mark is opened become larger, the difference between any two third target coordinates calculated by the formula (9) or (10) is larger than the difference between any two third target coordinates calculated by the formula (7) or (8), so that the peak of the initial motion trajectory generated by the third target coordinates calculated by the formula (9) or (10) is wider than the peak of the initial motion trajectory generated by the third target coordinates calculated by the formula (7) or (8). Fig. 11 is a schematic diagram showing a comparison of peaks of an initial motion trajectory according to an embodiment of the present application. Fig. 11 (a) is a peak of an initial motion trajectory generated using the third target vertical coordinate calculated by the equation (7) or (8), and fig. 11 (b) is a peak of an initial motion trajectory generated using the third target vertical coordinate calculated by the equation (9) or (10). It can be seen that the width of the peak of the graph (b) in fig. 11 is greater than the width of the peak of the graph (a) in fig. 11.
In this embodiment, if the peak of the initial motion trajectory is wider, the initial trajectory points in the initial motion trajectory may be discontinuous, so that the generated initial motion trajectory can be continuous by performing smoothing processing on the second initial coordinates of each second contour point.
S143, calculating the track difference vector of each initial track point according to the vertical coordinates of the second contour points, the horizontal coordinates of the first contour points and the first angle corresponding to each second contour point.
In some embodiments of the present application, the trajectory difference vector is a vector of differences between the coordinates of each initial trajectory point and the coordinates of the target contour point corresponding to the initial trajectory point.
In some embodiments of the present application, the electronic device 10 calculates a trajectory difference vector of each initial trajectory point according to the vertical coordinates of the second contour point, the horizontal coordinates of the plurality of first contour points, and the first angle corresponding to each second contour point, including: the electronic device 10 determines a target abscissa from all abscissas of the plurality of first contour points, calculates a second difference value of each second contour point according to the target abscissa and the abscissa of the target contour point corresponding to each second contour point, and further, the electronic device 10 calculates a trajectory difference vector of the initial trajectory point corresponding to each second contour point according to the first angle and the second difference value corresponding to each second contour point.
Wherein the target abscissa is the abscissa (length value) having the largest absolute value on the first contour line.
For example, fig. 12 is a schematic diagram of each second contour point and the target contour point according to an embodiment of the present application. P in FIG. 12 i Represents the ith second contour point, S j Represents the j-th second contour point on the second contour line, S j-1 ,S j-2 ,S j+1 ,S j+2 ,S j+3 ,S j+4 ,S j+5 ,S j+6 Are all the second contour lines except the target contour point S j Other second contour points. As can be seen from fig. 12, P i And S is equal to j The difference in vertical coordinates is the smallest, so S j And the target contour point corresponding to the ith second contour point.
For example, in connection with the above embodiment, the calculation method of the second difference may refer to the following formula (12):
d xi =|S(x max ,0,0)|-|S j (x,0,0)|; (12)
wherein d xi A second difference representing the ith second contour point, S representing the first contour line, |s (x max 0, 0) | represents the absolute value of the target abscissa, j represents the point number of the target contour point corresponding to the ith second contour point, |s j (x, 0) | represents the absolute value of the abscissa of the target contour point corresponding to the i-th second contour point. For example, if |S (x max ,0,0)|=2.0090,|S 1 (x, 0) |= 0.00099, then d x1 = 2.0090-0.00099 = 2.00801; if |S (x) max ,0,0)|=2.0090,|S 2 (x, 0) |= 0.00199, then d x2 =2.0090-0.00199=2.00701。
For example, in connection with the above embodiment, the calculation method of the trajectory difference vector may refer to the following formula (13):
wherein d vi (x, y) represents the trajectory difference vector of the initial trajectory point corresponding to the ith second contour point, beta i Represents a first angle, d, corresponding to the ith second contour point xi Representing the second difference of the ith second contour point. For example, if d x1 =2.00801,β 1 =0, thenIf d x2 =2.00701,β 2 =0, then->
In the present embodiment, since the second difference value of each second contour point represents the difference between the second contour point and the vertical coordinate of the corresponding target contour point, the trajectory difference vector of the second contour point is calculated by the second difference value of each second contour point, so that the trajectory difference vector can accurately reflect the difference between the initial coordinate of each second contour point and the contour feature of the virtual model.
S144, the coordinates of the corresponding initial track points are adjusted according to each track difference value vector, and the target motion track is obtained.
In some embodiments of the present application, as can be seen from the above formula (13), each track difference vector is a coordinate vector in a two-dimensional coordinate system (only including an abscissa and an ordinate), and an ordinate needs to be added to each track difference vector, so that each target track difference vector after adding the ordinate is a coordinate vector in a three-dimensional coordinate system. In this embodiment, the vertical coordinate added is zero. For example, if a trajectory difference vector is (-66.2911,1.998), the target trajectory difference vector obtained by adding the vertical coordinate with the value zero to (-66.2911,1.998) is [ -66.2911.998 ].
In some embodiments of the present application, the electronic device 10 performs a subtraction operation on the initial coordinates of each initial track point and the target track difference vector of each initial track point to obtain first target coordinates of each initial track point, and performs a smoothing process on the first target coordinates of each initial track point by using a spline interpolation algorithm to obtain second target coordinates of each initial track point, determines a point on each second target coordinates as a target track point, and determines a curve formed by arranging a plurality of target track points as a target motion track. Wherein the initial coordinates may be the first initial coordinates or the third initial coordinates above.
For example, fig. 13 is a schematic diagram of a target motion trajectory according to an embodiment of the present application. As can be seen from fig. 13, the target motion trail is relatively fit with the virtual model, and the target motion trail is in a sine or cosine wave form.
For example, the calculation method of the first target coordinates may refer to the following formula (14):
Target1P i (x,y,z)=First P i (x,y,z) -d vi (x,y,0); (14)
wherein Target1P i (x, y, z) First target coordinates representing the ith initial trajectory point, first P i (x, y, z) represents the initial coordinates of the ith initial trajectory point(first initial coordinate or third initial coordinate), d vi (x, y, 0) represents the target track difference vector for the i-th initial track point. If First P 1 (x,y,z)=(-66.1583,1.998,0),d v1 (x, y, 0) = (2.00801,0,0), target1P 1 (x, y, z) = (-66.1583,1.998,0) - (2.00801,0,0) = (-68.16631,1.998,0). If First P 2 (x,y,z)=(-66.0267,1.998,0),d v2 (x, y, 0) = (2.00701,0,0), target1P 2 (x,y,z)=(-66.0267,1.998,0)-(2.00701,0,0)=(-68.03371,1.998,0)。
For example, the method of smoothing the first target coordinates to obtain the second target coordinates may refer to the following formula (15):
Target2P i (x,y,z)=spline(Target1P i (x,y,z)); (15)
wherein Target2P i (x, y, z) represents the second Target coordinates of the ith initial trajectory point, spline is a function of spline interpolation algorithm, target1P i (x, y, z) represents the first target coordinates of the i-th initial trajectory point.
In this embodiment, the subtraction operation is performed on the initial coordinates of each initial track point and the target track difference vector of each initial track point, so that the first target coordinates of each initial track point can be close to the contour feature of the virtual model, and the generated target motion track is attached to the virtual model. Since the first spline interpolation algorithm is used for smoothing, discontinuous points generated by discrete operation can be reduced, and continuity of the target motion track can be ensured. Polishing is performed through continuous target motion tracks, so that polishing uniformity can be ensured.
In other embodiments of the present application, the number (density) of waves in the target motion trajectory may be adjusted by adjusting the value of the preset number (num) of waves. For example, fig. 14 is a schematic diagram showing comparison of target motion trajectories corresponding to different preset wave numbers according to an embodiment of the present application. The graph (a) in fig. 14 is a target motion trajectory corresponding to the preset wave number 8, the graph (b) in fig. 14 is a target motion trajectory corresponding to the preset wave number 6, and the graph (c) in fig. 14 is a target motion trajectory corresponding to the preset wave number 4, and it can be seen from the graphs (a), b and c) in fig. 14 that the larger the preset wave number is, the more (denser) the number of waves in the target motion trajectory is.
In other embodiments of the present application, the magnitude of the third target vertical coordinate may be directly adjusted by a preset baseline value, so as to adjust the wave height of the target motion trajectory. The preset baseline value can be set by itself, which is not limited by the present application. For example, with the above embodiments, the preset baseline value is-2, 0, or 2. The manner in which the magnitude of the third target vertical coordinate is adjusted using the preset baseline value may be referred to as formula (16) as shown below:
wherein i represents the point number of the ith second contour point, P i (0, Z) represents the third target vertical coordinate of the ith second contour point, Z Amp A first difference value is indicated and a second difference value is indicated,or->The function value representing the i-th second contour point, sin and cos representing a preset function, pi representing a circumference ratio, num representing a preset wave number, n 1 Representing the number of second contour points included in each corner on the second contour line, and BaseLine represents the preset BaseLine value. For example, n 1 1200, pi of 3.14, num of any one of 4, 6, 8, 10, etc., and BaseLine of-2,0,2.
For example, fig. 15 is a schematic diagram showing comparison of target motion trajectories corresponding to third target vertical coordinates with different sizes according to an embodiment of the present application. In the case where the first difference value is fixed to 2, the graph (a) in fig. 15 is a target motion trajectory corresponding to the preset baseline value-2, the graph (b) in fig. 15 is a target motion trajectory corresponding to the preset baseline value 0, and the graph (c) in fig. 15 is a target motion trajectory corresponding to the preset baseline value 2, and it can be seen from the graphs (a), (b) and (c) in fig. 15 that the greater the preset baseline value, the higher the wave height in the target motion trajectory.
In other embodiments of the present application, the number of initial track points may be adjusted by presetting the number of points, thereby adjusting the length of the target motion track. Wherein, the number of preset points can be set by oneself, and the application is not limited to this. For example, the preset number of points is 0, 10 or 20. The method of adjusting the number of initial trajectory points may refer to formulas (17) - (18) as shown below:
Wherein i represents the point number of the ith second contour point, P i (0, Z) represents the third target vertical coordinate of the ith second contour point, Z Amp Representing a first difference, sin and cos representing a predetermined function, pi representing a circumference ratio, num representing a predetermined number of waves, n 1 Represents the number of second contour points included in each corner on the second contour line, and the degree represents the preset number of points. For example, n 1 1200, pi of 3.14, num of 4, 6, 8 or 10, etc., and degree of 0, 10 or 20.
For example, fig. 16 is a schematic diagram illustrating comparison of target motion trajectories corresponding to different numbers of initial trajectory points according to an embodiment of the present application. The graph (a) in fig. 16 is a target motion trajectory corresponding to the preset number of points 0, the graph (b) in fig. 16 is a target motion trajectory corresponding to the preset number of points 10, and the graph (c) in fig. 16 is a target motion trajectory corresponding to the preset number of points 20, and it can be seen from the graphs (a), (b) and (c) in fig. 16 that the larger the preset number of points, the shorter the target motion trajectory, and the smaller the polishing area of the robot arm 20.
In other embodiments of the present application, the second difference may be adjusted by presetting a fit parameter value, so as to adjust the fit between the target motion trajectory and the virtual model. Wherein, the preset fitting parameter value can be set by oneself, and the application is not limited to this. For example, the preset fitting parameter value is-2, 0, or 2. The method for adjusting the second difference may refer to formula (19) as follows:
d xi =|S(x max ,0,0)|-|S j (x,0,0)|+thickness; (19)
Wherein d xi A second difference representing the ith second contour point, S representing the first contour line, |s (x max 0, 0) | represents the absolute value of the target abscissa, j represents the point number of the target contour point corresponding to the ith second contour point, |s j (x, 0) | represents the absolute value of the abscissa of the target contour point corresponding to the ith second contour point, and the thickness represents the preset fitting parameter value.
For example, fig. 17 is a schematic diagram illustrating comparison of target motion trajectories corresponding to second differences with different magnitudes according to an embodiment of the present application. The graph (a) in fig. 17 is a target motion trajectory corresponding to a preset fitting parameter value-2, the graph (b) in fig. 17 is a target motion trajectory corresponding to a preset base line value 0, and the graph (c) in fig. 17 is a target motion trajectory corresponding to a preset fitting parameter value 2, and it can be seen from the graphs (a), (b) and (c) in fig. 17 that, when the preset fitting parameter value is-2, the target motion trajectory permeates into the virtual model, when the preset fitting parameter value is 0, the target motion trajectory is relatively fitted with the virtual model, and when the preset fitting parameter value is 2, the target motion trajectory floats out of the virtual model.
In other embodiments of the present application, the morphology of the waves in the generated target motion trajectory may be adjusted by adjusting the type of the preset function used. Preset functions include, but are not limited to: cos functions, sin functions, etc.
For example, fig. 18 is a schematic diagram illustrating comparison of target motion trajectories corresponding to different preset functions according to an embodiment of the present application. The graph (a) in fig. 18 is a target motion trajectory generated when a cos function is used and a peak is not widened, the graph (b) in fig. 18 is a target motion trajectory generated when a cos function is used and a peak is widened, and the graph (c) in fig. 18 is a target motion trajectory generated when a sin function is used and a peak is widened, and it can be seen from the graphs (a), (b) and (c) in fig. 18 that the wave forms of the generated target motion trajectories are different using different preset functions and the width/narrowness of the peak.
In other embodiments of the present application, the generated target motion profile may also be adjusted by changing other parameter values, which is not limited herein.
Fig. 19 is a flowchart of a method for calculating the pose of each target track point according to an embodiment of the present application, including the following steps:
and S161, calculating a tangential vector of the target track point corresponding to each second contour point according to the second angle corresponding to each second contour point and the second difference vector.
For example, in connection with the above embodiment, the tangential vector calculation method may refer to the following formula (20):
Wherein, tangntV i A tangential vector representing the ith second contour point, i representing the point number of the ith second contour point, θ i Representing a second angle corresponding to the ith second contour point, V i(i+1) Representing a second difference vector. If i=1, v 12 =[0.1316 0 0],θ 1 =0, then If i=2, v 23 =[0.13277 0 0],θ 2 =0, then->
For example, fig. 20 is a schematic diagram of tangential vectors provided in an embodiment of the present application. As can be seen from fig. 20, the tangential vector at each corner varies.
S162, calculating the target normal vector of the target track point corresponding to each second contour point according to the second angle corresponding to each second contour point and the initial normal vector of the target contour point corresponding to each second contour point.
For example, in connection with the above embodiment, the calculation method of the target normal vector may refer to the following formula (21):
/>
wherein N is i A target normal vector theta representing a target locus point corresponding to the ith second contour point i Representing a second angle corresponding to the i-th second contour point,an initial normal vector representing a target contour point corresponding to the ith second contour point, j representing a point number of the target contour point corresponding to the ith second contour point, n xj Representing the horizontal axis component, n, in the initial normal vector of the target contour point yj Representing the vertical axis component, n, in the initial normal vector of the target contour point zj Representing the vertical axis component in the initial normal vector of the target contour point. If i=1, j=1, then +.> If i=2, j=2, +.>
S163, calculating the target vector of the target track point corresponding to each second contour point according to the tangential vector and the target normal vector.
For example, in connection with the above embodiment, the calculation method of the target vector may refer to the following formula (22):
ThirdV i =TangentV i ×N i ; (22)
wherein, thirdV i Target vector representing target track point corresponding to ith second contour point, tangentV i Tangent vector representing the ith second contour point, N i And the target normal vector of the target track point corresponding to the ith second contour point is represented. If i=1, n 1 =[0.431759 0 0.901989],TangentV 1 =[0.1316 0 0]Then ThirdV 1 =TangentV 1 ×N 1 =[0.1316 0 0]×[0.431759 0 0.901989]=[0 -0.1187 0]. If i=2, n 2 =[0.432101 0 0.901824],TangentV 2 =[0.13277 0 0]Then ThirdV 2 =TangentV 2 ×N 2 =[0.13277 0 0]×[0.432101 0 0.901824]=[0 -0.1197 0]。
S164, calculating the gesture of the target track point corresponding to each second contour point according to the tangential vector, the target normal vector and the target vector.
In some embodiments of the present application, a function may be used to calculate the tangent vector, the target normal vector, and the target vector, so as to obtain the pose of the target track point corresponding to each second contour point. The function may be a vectortoportant function.
For example, in connection with the above embodiment, the calculation method of the attitude may refer to the following formula (23):
Wherein,representing the gesture of the target track point corresponding to the ith second contour point, R xi Euler angle indicating rotation around X axis in gesture of target track point corresponding to ith second contour point, R yi Indicating Euler angle of rotation around Y axis in gesture of target track point corresponding to ith second contour point, R zi Euler angle, thirdV, indicating rotation around Z axis in gesture of target track point corresponding to ith second contour point i Target vector representing target track point corresponding to ith second contour point, tangentV i Tangent vector representing the ith second contour point, N i And the target normal vector of the target track point corresponding to the ith second contour point is represented. If i=1, then 1 =[0 -0.1187 0],N 1 =[0.431759 0 0.901989],TangentV 1 =[0.1316 0 0]Then-> If i=2, then 2 =[0 -0.1197 0],N 2 =[0.432101 0 0.901824],TangentV 2 =[0.13277 0 0]Then
For example, the above embodiment is taken as an example of the coordinates and the posture of the target track point provided by an embodiment of the present application, as shown in table 4.
TABLE 4 Table 4
For example, fig. 21 is a schematic diagram of a target normal vector according to an embodiment of the present application. Fig. 21 (a) is a posture of a plurality of target track points, and fig. 21 (b) is a posture of all target track points, wherein each euler angle in each posture points in a different direction.
Fig. 22 is a block diagram of the electronic device 10 according to the embodiment of the present application. As shown in fig. 22, the electronic device 10 may include a communication module 101, a memory 102, a processor 103, an Input/Output (I/O) interface 104, and a bus 105. The processor 103 is coupled to the communication module 101, the memory 102, and the input/output interface 104 via the bus 105, respectively.
The communication module 101 may include a wired communication module and/or a wireless communication module. The wired communication module may provide one or more of a Universal Serial Bus (USB), a controller area network bus (CAN, controllerAreaNetwork), etc. wired communication solution. The wireless communication module may provide one or more of wireless communication solutions such as wireless fidelity (Wi-Fi), bluetooth (BT), mobile communication networks, frequency Modulation (FM), near Field Communication (NFC), infrared (IR), and the like.
The memory 102 may include one or more Random Access Memories (RAMs) and one or more non-volatile memories (NVM). The random access memory may be directly readable and writable by the processor 103, may be used for storing or other executable programs (e.g. machine instructions) of the program in operation, may also be used for storing data of users and applications, etc. The random access memory may include a static random-access memory (SRAM), a Dynamic Random Access Memory (DRAM), a Synchronous Dynamic Random Access Memory (SDRAM), a double data rate synchronous dynamic random access memory (ddr SDRAM), and the like. The nonvolatile memory may include a disk storage device, a flash memory (flash memory).
The memory 102 is used to store one or more computer programs. One or more computer programs are configured to be executed by the processor 103. The one or more computer programs include a plurality of instructions that when executed by the processor 103, implement a surface model grinding method that is performed on the electronic device 10.
The processor 103 may include one or more processing units, such as: the processor 103 may include an Application Processor (AP), a modem processor, a Graphics Processor (GPU), an Image Signal Processor (ISP), a controller, a video codec, a Digital Signal Processor (DSP), and/or a neural-Network Processor (NPU), etc. Wherein the different processing units may be separate devices or may be integrated in one or more processors.
The processor 103 provides computing and control capabilities, for example, the processor 103 is configured to execute computer programs stored in the memory 102 to implement the surface model grinding method described above.
The input/output interface 104 is used to provide a channel for user input or output, for example, the input/output interface 104 may be used to connect various input/output devices, such as a mouse, keyboard, touch device, display screen, etc., so that a user may enter information, or visualize information.
The bus 105 is used at least to provide a channel for communication between the communication module 101, the memory 102, the processor 103, and the input/output interface 104 in the electronic device 10.
It should be understood that the illustrated construction of the embodiments of the present application does not constitute a particular limitation of the electronic device 10. In other embodiments of the application, the electronic device 10 may include more or fewer components than shown, or certain components may be combined, or certain components may be split, or different arrangements of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware. In the embodiments provided in the present application, it should be understood that the disclosed apparatus/electronic device and method may be implemented in other manners. For example, the apparatus/electronic device embodiments described above are merely illustrative, e.g., the division of the modules or units is merely a logical function division, and there may be additional divisions in actual implementation, e.g., multiple units or components may be combined or integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection via interfaces, devices or units, which may be in electrical, mechanical or other forms.
The above embodiments are only for illustrating the technical solution of the present application, and are not limiting; although the application has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present application, and are intended to be included in the scope of the present application.

Claims (10)

1. A method of grinding a curved surface model, the method comprising:
acquiring a plurality of contour lines of a curved surface model, wherein the contour lines comprise a first contour line and a second contour line, the first contour line is provided with a plurality of first contour points, the second contour line is provided with a plurality of second contour points, each first contour point on the first contour line is provided with a corresponding first coordinate and an initial normal vector, and each second contour point on the second contour line is provided with a corresponding second coordinate;
calculating a first angle and a second angle corresponding to each second contour point on the second contour line;
Determining a target contour point corresponding to each second contour point in the plurality of first contour points according to the vertical coordinate of each second contour point and the vertical coordinate of each first contour point;
generating a target motion track of the mechanical arm according to a preset function, the second contour line, a first angle corresponding to each second contour point, a target contour point corresponding to each second contour point and a first coordinate of each first contour point, wherein the target motion track comprises a plurality of target track points;
calculating the gesture of the mechanical arm passing through each target track point according to the second coordinates of each second contour point, the second angle corresponding to each second contour point and the initial normal vector of the target contour point corresponding to each second contour point;
and controlling the mechanical arm to polish the curved surface model according to the target motion track and the gesture of each target track point.
2. The method of claim 1, wherein calculating the first angle corresponding to each second contour point on the second contour line comprises:
determining a first second contour point and a second contour point in the plurality of second contour points, and calculating a first difference vector between second coordinates of the first second contour point and second coordinates of the second contour point;
And determining a second contour point behind each second contour point, calculating a second difference vector between the second coordinate of each second contour point and the second coordinate of the second contour point behind each second contour point, and calculating a first angle corresponding to each second contour point according to the first difference vector and the second difference vector.
3. The method of claim 2, wherein each target track point corresponds to one of the second contour points, and wherein calculating the gesture of the manipulator passing through each target track point comprises:
calculating a tangential vector of the target track point corresponding to each second contour point according to the second angle corresponding to each second contour point and the second difference vector;
calculating a target normal vector of a target track point corresponding to each second contour point according to the second angle corresponding to each second contour point and the initial normal vector of the target contour point corresponding to each second contour point;
calculating a target vector of a target track point corresponding to each second contour point according to the tangent vector and the target normal vector;
And calculating the gesture of the target track point corresponding to each second contour point according to the tangent vector, the target normal vector and the target vector.
4. The method of claim 1, wherein generating the target motion profile of the manipulator comprises:
determining a first target vertical coordinate and a second target vertical coordinate from all first coordinates of a plurality of first contour points on the first contour line, and calculating a first difference value between the first target vertical coordinate and the second target vertical coordinate;
according to the preset function, the preset wave number and the first difference value, the second contour lines are adjusted to obtain initial motion tracks, wherein the initial motion tracks comprise initial track points corresponding to each second contour point;
calculating a track difference vector of each initial track point according to the vertical coordinates of the second contour points, the horizontal coordinates of the plurality of first contour points and the first angle corresponding to each second contour point;
and adjusting the coordinates of the corresponding initial track points according to each track difference value vector to obtain the target motion track.
5. The method of polishing a curved surface model as set forth in claim 4, wherein said adjusting the second contour line according to the preset function, the preset number of waves and the first difference value to obtain an initial motion trajectory includes:
Determining the point number of each second contour point, and performing function operation on the point number of each second contour point, the number of a plurality of second contour points on the second contour line and the number of the preset waves according to the preset function to obtain a function value of each second contour point;
calculating a third target vertical coordinate corresponding to each second contour point according to the function value of each second contour point and the first difference value;
and adjusting the vertical coordinates of the corresponding second contour points according to the vertical coordinates of each third target to obtain the initial motion trail.
6. The method of claim 5, wherein adjusting the vertical coordinates of the corresponding second contour point according to the vertical coordinates of each third target to obtain the initial motion trajectory comprises:
replacing the vertical coordinate of each second contour point with a third target vertical coordinate corresponding to the second contour point to obtain a first initial coordinate of each second contour point, determining a point on the first initial coordinate of each second contour point as an initial track point corresponding to the second contour point, and determining a curve formed by arranging a plurality of initial track points as the initial motion track; or alternatively
And replacing the vertical coordinate of each second contour point with a third target vertical coordinate corresponding to the second contour point to obtain a second initial coordinate of each second contour point, performing smoothing on the second initial coordinate of each second contour point by using a spline interpolation algorithm to obtain a third initial coordinate of each second contour point, determining a point on the third initial coordinate of each second contour point as an initial track point corresponding to the second contour point, and determining a curve formed by arranging a plurality of initial track points as the initial motion track.
7. The method of claim 5, wherein calculating a second angle for each second contour point on the second contour line comprises:
and calculating a second angle corresponding to each second contour point according to the point number of each second contour point and the preset value.
8. The method of claim 4, wherein calculating the trajectory difference vector for each initial trajectory point based on the vertical coordinates of the second contour point, the horizontal coordinates of the plurality of first contour points, and the first angle corresponding to each second contour point comprises:
Determining a target abscissa from all abscissas of the plurality of first contour points, and calculating a second difference value of each second contour point according to the target abscissa and the abscissas of the target contour point corresponding to each second contour point;
and calculating a track difference vector of the initial track point corresponding to each second contour point according to the first angle and the second difference value corresponding to each second contour point.
9. The method of claim 1, wherein the obtaining the plurality of contours of the surface model comprises:
modeling the curved surface model to obtain a virtual model, and extracting the contour lines from the virtual model.
10. The method for grinding a curved surface model according to claim 1, wherein determining the target contour point corresponding to each second contour point among the plurality of first contour points according to the vertical coordinates of each second contour point and the vertical coordinates of each first contour point comprises:
calculating a vertical coordinate difference value between the vertical coordinate of each second contour point and the vertical coordinate of each first contour point;
and determining the first contour point corresponding to the smallest vertical coordinate difference value as the target contour point corresponding to each second contour point.
CN202311245925.8A 2023-09-22 2023-09-22 Curved surface model polishing method Pending CN117161898A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311245925.8A CN117161898A (en) 2023-09-22 2023-09-22 Curved surface model polishing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311245925.8A CN117161898A (en) 2023-09-22 2023-09-22 Curved surface model polishing method

Publications (1)

Publication Number Publication Date
CN117161898A true CN117161898A (en) 2023-12-05

Family

ID=88935444

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311245925.8A Pending CN117161898A (en) 2023-09-22 2023-09-22 Curved surface model polishing method

Country Status (1)

Country Link
CN (1) CN117161898A (en)

Similar Documents

Publication Publication Date Title
Kallem et al. Kernel-based visual servoing
KR101257207B1 (en) Method, apparatus and computer-readable recording medium for head tracking
TWI677413B (en) Calibration method and device for robotic arm system
Farouki et al. Inverse kinematics for optimal tool orientation control in 5-axis CNC machining
CN110693618B (en) Method and device for determining cutting direction of shell-shaped tooth appliance and electronic equipment
Chang et al. Image feature command generation of contour following tasks for SCARA robots employing Image-Based Visual Servoing—A PH-spline approach
TW201610730A (en) System and method for simplifying grids of point cloud
CN103942836A (en) Three-dimensional mesh model tetrahedralization method
CN117182713A (en) Curved surface model polishing method
CN112197676B (en) Object surface information acquisition method, device, computer equipment and storage medium
Cheng et al. Trajectory planning method with grinding compensation strategy for robotic propeller blade sharpening application
CN117161898A (en) Curved surface model polishing method
CN110060295A (en) Object localization method and device, control device follow equipment and storage medium
US11607806B2 (en) Techniques for generating controllers for robots
WO2023202312A1 (en) Double-point incremental forming manufacturing method and apparatus based on deep reinforcement learning
CN110060287B (en) Face image nose shaping method and device
CN115284298B (en) Robot singular avoidance method, device, terminal and medium
Chen et al. Toolpath Generation for Robotic Flank Milling via Smoothness and Stiffness Optimization
Keenan et al. Vision-based robotic traversal of textureless smooth surfaces
CN112847340B (en) Control method, control device and robot
Kästner et al. A markerless deep learning-based 6 degrees of freedom pose estimation for mobile robots using rgb data
CN114675600A (en) Circular arc interpolation method based on circular arc tangent vector
Liu et al. Automatic calibration algorithm of robot TCP based on binocular vision
WO2020133882A1 (en) Method for applying robot to reproduction machining
US20180088569A1 (en) Off-line-programming jog assist device, jog assist method, and recording medium storing jog assist program

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination