A vortex line interpolation method and related equipment in a motion control card
Through the interpolation method of generating and densifying vortex lines on the motion control card, the problem of not supporting vortex lines interpolation in the prior art is solved, efficient interpolation of vortex lines is achieved, and application coverage is improved.
Patent Information
- Application Number
- CN202211475353.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-23
- Publication Date
- 2025-06-27
- Estimated Expiration
- 2042-11-23
AI Technical Summary
The existing motion control cards do not support the trajectory interpolation type of vortex lines, and cannot meet the special needs of industries such as dispensing and winding.
By obtaining the position of the target starting point and center point, calculating the initial radius and angle, obtaining the angle coefficient and direction of the vortex line, generating the target vortex line, and densifying it to obtain the densification point, and finally transmitting the densification point to the motion control card to realize interpolation of the vortex line.
The interpolation of the vortex lines on the motion control card is realized, which improves the application coverage and can meet the needs of more special processes.
Smart Images

Figure CN115981243B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of control cards, and particularly to a method for interpolating a scroll line in a motion control card and related devices. Background Art
[0002] In the prior art, the CPU processing capacity of a motion control card is limited, and the underlying layer of an ordinary control card only supports trajectory interpolation types such as linear interpolation and circular interpolation. However, in actual application processes, such as in industries like dispensing and wire winding, there are often trajectory requirements for the end to follow a scroll line. However, many current controllers do not support such curves.
[0003] Therefore, the prior art still needs to be improved and enhanced. Summary of the Invention
[0004] In view of the above-mentioned defects in the prior art, the present invention provides a method for interpolating a scroll line in a motion control card and related devices, aiming to solve the problem that many current controllers do not support the trajectory interpolation type of scroll lines.
[0005] To solve the above technical problems, the technical solutions adopted by the present invention are as follows:
[0006] In a first aspect of the present invention, a method for interpolating a scroll line in a motion control card is provided, and the method includes:
[0007] Obtain the positions of a target starting point and a target center point, and obtain an initial radius and an initial angle according to the positions of the target starting point and the target center point;
[0008] Obtain a rotation angle coefficient and a direction of a target scroll line, and obtain the target scroll line according to the rotation angle coefficient, the direction, the initial radius, and the initial angle;
[0009] Perform densification processing on the target scroll line to obtain target densified points, where the target densified points include first densified points and second densified points;
[0010] Transmit the target densified points to a target motion control card.
[0011] In the method for interpolating a scroll line in a motion control card, where obtaining the initial radius and the initial angle according to the positions of the target starting point and the target center point includes:
[0012] Calculate the initial radius according to a first formula, and the first formula is:
[0013]
[0014] where x p , y pThey are the abscissa and ordinate values of the target starting point respectively, and x0 and y0 are the abscissa and ordinate values of the target center point respectively;
[0015] Calculate the initial angle according to the second formula, and the second formula is:
[0016] θ0 = atan2((y p - y0), (x p - x0)).
[0017] In the method for interpolating a scroll line in the motion control card, wherein calculating the initial angle according to the second formula further includes:
[0018] If the calculated initial angle is less than 0, update the initial angle to the target initial angle, and the target initial angle is equal to the angle value after adding 2π to the initial angle.
[0019] In the method for interpolating a scroll line in the motion control card, wherein the densification process of the initial scroll line includes:
[0020] Obtain the target error and densify the initial scroll line according to the target error.
[0021] In the method for interpolating a scroll line in the motion control card, wherein densifying the initial scroll line according to the target error includes:
[0022] Obtain the first angle according to the target error;
[0023] Take the first angle as the initial value of the target angle;
[0024] Obtain the first segmentation point according to the target angle;
[0025] Obtain the target radius according to the distance between the first segmentation point and the target center point;
[0026] Update the target angle according to the target radius and the rotation angle coefficient of the target scroll line;
[0027] Repeat the step of obtaining the first segmentation point according to the target angle until reaching the end of the target scroll line.
[0028] In the method for interpolating a scroll line in the motion control card, wherein the calculation formula for obtaining the first angle according to the target error is:
[0029] 2 * a cos(1 - δ / r0);
[0030] Wherein, δ is all the target errors, and r0 is the initial radius.
[0031] The vortex line interpolation method in the motion control card described above, wherein the step of densifying the initial vortex line according to the target error further includes:
[0032] Perform a sliding mean filtering process on the obtained first segmentation point to obtain the first densified point;
[0033] Obtain the minimum distance between the first densified points;
[0034] Obtain a second segmentation point according to the minimum distance between the first densified points;
[0035] Perform a position sliding mean filtering on the second segmentation point to obtain the second densified point.
[0036] In a second aspect of the present invention, there is provided a vortex line interpolation device in a motion control card, including:
[0037] An initial value acquisition module, which is used to acquire the positions of the target starting point and the target center point, and according to the positions of the target starting point and the target center point, acquire the initial radius and the initial angle;
[0038] A vortex line acquisition module, which is used to acquire the rotation angle coefficient and direction of the target vortex line, and according to the rotation angle coefficient of the target vortex line, the target vortex line direction, the initial radius and the initial angle, acquire the target vortex line;
[0039] A densified point acquisition module, which is used to perform densification processing on the target vortex line to obtain target densified points, and the target densified points include first densified points and second densified points;
[0040] A transmission module, which is used to transmit the target densified points to the target motion control card.
[0041] In a third aspect of the present invention, there is provided a terminal, the terminal includes a processor and a computer-readable storage medium communicatively connected to the processor, the computer-readable storage medium is adapted to store a plurality of instructions, and the processor is adapted to call the instructions in the computer-readable storage medium to execute the steps of implementing the vortex line interpolation method in the motion control card described in any one of the above.
[0042] In a fourth aspect of the present invention, there is provided a computer-readable storage medium, the computer-readable storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the steps of the vortex line interpolation method in the motion control card described in any one of the above.
[0043] Compared with the prior art, the present invention provides a method for interpolating a scroll line in a motion control card and related devices. In the method for interpolating a scroll line in a motion control card provided by the present invention, by obtaining the positions of a target starting point and a target center point, according to the positions of the target starting point and the target center point, an initial radius and an initial angle are obtained, then the rotation angle coefficient and direction of the target scroll line are obtained, and the target scroll line is obtained according to the rotation angle coefficient, the direction, the initial radius and the initial angle. After obtaining the target scroll line, the target scroll line is densified to obtain target densified points, where the target densified points include first densified points and second densified points; finally, the target densified points are transmitted to a target motion control card to implement interpolation of the scroll line. The method for interpolating a scroll line in a motion control card provided by the present invention realizes interpolation of the scroll line on the motion control card by densifying the scroll line, improves the application coverage of the motion control card, and enables the motion control card to meet the requirements of more special processes. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] Figure 1 It is a flowchart of an embodiment of the method for interpolating a scroll line in a motion control card provided by the present invention;
[0045] Figure 2 It is a clockwise scroll line of an application example of an embodiment of the method for interpolating a scroll line in a motion control card provided by the present invention;
[0046] Figure 3 It is a counterclockwise scroll line of an application example of an embodiment of the method for interpolating a scroll line in a motion control card provided by the present invention;
[0047] Figure 4 It is a graphical expression of a scroll line of an embodiment of the method for interpolating a scroll line in a motion control card provided by the present invention;
[0048] Figure 5 It is a densification schematic diagram of an embodiment of the device for interpolating a scroll line in a motion control card provided by the present invention;
[0049] Figure 6 It is a structural schematic diagram of an embodiment of the device for interpolating a scroll line in a motion control card provided by the present invention;
[0050] Figure 7 It is a schematic diagram of the principle of an embodiment of the terminal provided by the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0051] In order to make the objectives, technical solutions and effects of the present invention clearer and more definite, the following further describes the present invention in detail with reference to the accompanying drawings and by way of examples. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0052] The scroll line interpolation method in the motion control card provided by the present invention can be applied to a terminal with computing capabilities. The terminal can execute the scroll line interpolation method in the motion control card provided by the present invention to obtain target densification points and transmit the target densification points to the target motion control card. The terminal can be but is not limited to various computers, mobile terminals, smart home appliances, wearable devices, etc.
[0053] Embodiment 1
[0054] As Figure 1 shown, in an embodiment of the scroll line interpolation method in the motion control card, the method includes the steps:
[0055] S100. Obtain the positions of the target starting point and the target center point, and obtain the initial radius and the initial angle according to the positions of the target starting point and the target center point.
[0056] The obtaining of the initial radius and the initial angle according to the positions of the target starting point and the target center point includes:
[0057] S110. Calculate the initial radius according to the first formula, and the first formula is:
[0058]
[0059] where x p , y p are respectively the abscissa and ordinate values of the target starting point, and x0, y0 are respectively the abscissa and ordinate values of the target center point.
[0060] S120. Calculate the initial angle according to the second formula, and the second formula is:
[0061] θ0 = atan2((y p - y0), (x p - x0)).
[0062] Specifically, in combination with the usage characteristics of the motion control card, a description method of the target scroll line is given. First, obtain the position (x p , y p ) of the target starting point of the target scroll line and the target center point, that is, the position (x0, y0) of the rotation center of the target scroll line.
[0063] Obtain the initial radius and the initial angle according to the positions of the target starting point and the target center point.
[0064] Specifically, calculate the initial radius according to the first formula, and the first formula is:
[0065]
[0066] Calculate the initial angle according to the second formula, where the second formula is:
[0067] θ0 = atan2((y p - y0), (x p - x0)).
[0068] In this embodiment, calculating the initial angle according to the second formula further includes:
[0069] If the calculated initial angle is less than 0, update the initial angle to the target initial angle, where the target initial angle is equal to the angle value after adding 2π to the initial angle. That is to say, when θ0 calculated by the second formula is < 0, 2π should be added to the current value of θ0 and used as the new θ0.
[0070] S200. Obtain the turning coefficient and direction of the target vortex line, and obtain the target vortex line according to the turning coefficient, the direction, the initial radius, and the initial angle.
[0071] Specifically, the expression of the target vortex line is:
[0072] r = α + β * (θ - θ0);
[0073] Where r represents the radius, θ represents the rotation angle, α represents the initial minimum radius of the target vortex line, and in this embodiment, α = r0, and β represents the turning coefficient of the target vortex line.
[0074] As the spiral angle θ changes, the radius r will gradually increase with the product of the turning angle θ and the turning coefficient.
[0075] The expression in Cartesian coordinates is:
[0076] x = r * cosθ + x0;
[0077] y = r * sinθ + y0;
[0078] Where (x0, y0) are the coordinates of the rotation center of the target vortex line.
[0079] Therefore, after obtaining the initial radius and the initial angle, it is also necessary to obtain the turning coefficient and direction of the target vortex line, and obtain the target vortex line according to the turning coefficient of the target vortex line, the direction of the target vortex line, the initial radius, and the initial angle.
[0080] Under different direction selections, vortex lines in different directions will be obtained. Referring to Figure 2 , when choosing to depict the vortex line in the clockwise direction, a vortex line in the shape of Figure 2 will be obtained; Referring toFigure 3 When the vortex line is depicted in the counterclockwise direction, a vortex line in the form of Figure 3 will be obtained.
[0081] In an application example, referring to Figure 4 , Figure 4 is a description of a counterclockwise vortex line with an initial radius α = 2, a turning angle coefficient β = 2, an initial angle θ0 = 0.5 rad, x0 = 2, and y0 = 2.
[0082] It can be seen that Figure 2 as the curve in
[0083] changes with the turning angle, the curvature also changes dynamically, and at the same time, the chord length of this curve is also difficult to calculate using a mathematical expression formula. Therefore, the interpolation target of the vortex line provided in this embodiment is to improve the interpolation efficiency of the vortex line as much as possible while keeping the accuracy controllable, and at the same time make the impact on the machine platform smaller.
[0084] S300. Perform densification processing on the target vortex line to obtain target densification points, where the target densification points include first densification points and second densification points.
[0085] Among them, the densification processing of the initial vortex line includes:
[0086] S310. Obtain a target error, and densify the initial vortex line according to the target error.
[0087] Obtain the error δ specified by the user, and densify the initial vortex line according to the target error δ.
[0088] Among them, the densification of the initial vortex line according to the target error includes:
[0089] S311. Obtain a first angle according to the target error;
[0090] The calculation formula for obtaining the first angle according to the target error is:
[0091] 2 * a cos(1 - δ / r0);
[0092] Among them, δ is all the target errors, and r0 is the initial radius.
[0093] Since the target error is δ, within the accuracy range, the angular value between the initial densification point and the initial point will be less than or equal to 2 * acos(1 - δ / r0).
[0094] Refer to Figure 5, in this embodiment, approximate δ0 to δ, such that δ0 = δ, then the first angle θ is 2*acos(1 - δ / r0).
[0095] S312. Use the first angle as the initial value of the target angle.
[0096] Specifically, the initial value of the target angle is 2*acos(1 - δ / r0).
[0097] S313. Obtain the first segmentation point according to the target angle.
[0098] Refer to Figure 5 , P i is the first segmentation point. Assume that the target vortex line can be divided into n + 1 such first segmentation points, where i = 1,.., n. Specifically, P0 is the first of the first segmentation points, and P i is the subsequent first segmentation point obtained. Among them, the angle between the line connecting P0 and the target center point and the line connecting the target starting point and the target center point is equal to the first angle θ.
[0099] S314. Obtain the target radius according to the distance between the first segmentation point and the target center point.
[0100] The line connecting the first segmentation point and the target center point is the target radius. Refer to Figure 5 , it can be seen that Figure 5 the first target radius in
[0101] S315. Update the target angle according to the target radius and the turning coefficient of the target vortex line.
[0102] According to the formula r i = r i-1 + coefTheta*(θ i - θ i-1 ), obtain the i-th target angle, where r i is the i-th target radius, θ i is the i-th target angle, θ0 = θ is the target first angle, that is, the initial value of the target angle, and coefTheta is the turning coefficient of the target vortex line.
[0103] S316. Repeat the step of obtaining the first segmentation point according to the target angle until reaching the end of the target vortex line.
[0104] Specifically, after obtaining the i-th target angle θ i , according to the target angle θ i obtain the next target segmentation point P i, when obtaining P i The distance r to the target center point i+1 is the (i + 1)-th target radius. Based on r i+1 and r i obtain the (i + 1)-th target angle θ i+1 , continuously repeat the above steps until reaching the end of the target vortex line. At this time, n + 1 first segmentation points (P0, P1,..., P n ) are obtained.
[0105] The densifying the initial vortex line according to the target error further includes:
[0106] S317. Perform a moving average filtering process on the obtained first segmentation points to obtain the first densified points.
[0107] Specifically, perform a moving average filtering with a 3-window on all the obtained first segmentation points to perform position smoothing on the first segmentation points, and obtain the first densified points.
[0108] S318. Obtain the minimum distance between the first densified points.
[0109] After obtaining all the first densified points, record the distances between the first densified points, and obtain the minimum distance L0 between the first densified points.
[0110] S319. Obtain the second segmentation points according to the minimum distance between the first densified points.
[0111] In this embodiment, to ensure the filtering accuracy, according to the minimum distance L0 between the first segmentation points, perform a secondary densification process on the line segments between other points. Specifically, if the distance between two first segmentation points is greater than L0, obtain the distance L between the two first segmentation points. Calculate and round up to get m. When m > 1, equally spaced insert m - 1 second segmentation points P ’ between the two first segmentation points. Obtain all the second segmentation points.
[0112] S320. Perform a position moving average filtering on the second segmentation points to obtain the second densified points.
[0113] Specifically, perform a position moving average filtering on all the second segmentation points to obtain the second densified points with smooth connection.
[0114] The first densified points and the second densified points together form the target densified points.
[0115] Refer to again Figure 1, the method for interpolating a scroll line in the motion control card further includes the steps of:
[0116] S400, transmitting the target densification points to the target motion control card.
[0117] Specifically, the output smooth target densification points are transmitted to the underlying execution of the motion control card, and the control card plans the speed according to the speed preview algorithm, and finally realizes the interpolation of the scroll line.
[0118] In summary, this embodiment provides a method for interpolating a scroll line in a motion control card. The method obtains the positions of the target starting point and the target center point, obtains the initial radius and the initial angle according to the positions of the target starting point and the target center point, then obtains the rotation angle coefficient and the direction of the target scroll line, and obtains the target scroll line according to the rotation angle coefficient, the direction, the initial radius and the initial angle. After obtaining the target scroll line, the target scroll line is densified to obtain target densification points, where the target densification points include first densification points and second densification points; finally, the target densification points are transmitted to the target motion control card to realize the interpolation of the scroll line. The method for interpolating a scroll line in the motion control card provided by the present invention realizes the interpolation of the scroll line on the motion control card by densifying the scroll line, improves the application coverage of the motion control card, and enables the motion control card to meet the requirements of more special processes.
[0119] It should be understood that although the steps in the flowchart given in the accompanying drawings of the present invention are shown in sequence according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise clearly stated in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowchart may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed alternately or alternately with at least a part of other steps or sub-steps or stages of other steps.
[0120] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to a memory, storage, database, or other medium used in the various embodiments provided by the present invention can include non-volatile and / or volatile memories. Non-volatile memories can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memories can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and Rambus dynamic RAM (RDRAM), etc.
[0121] Embodiment 2
[0122] Based on the above embodiments, the present invention also correspondingly provides a scroll line interpolation device in a motion control card, as Figure 6 shown. The scroll line interpolation device in the motion control card includes:
[0123] An initial value acquisition module, which is used to acquire the positions of the target starting point and the target center point, and acquire the initial radius and the initial angle according to the positions of the target starting point and the target center point;
[0124] A scroll line acquisition module, which is used to acquire the rotation angle coefficient and direction of the target scroll line, and acquire the target scroll line according to the rotation angle coefficient, the direction, the initial radius, and the initial angle;
[0125] A densification point acquisition module, which is used to perform densification processing on the target scroll line to obtain target densification points, and the target densification points include first densification points and second densification points;
[0126] A transmission module, which is used to transmit the target densification points to the target motion control card.
[0127] Embodiment 3
[0128] Based on the above embodiments, the present invention also correspondingly provides a terminal, such as Figure 7 shown, the terminal includes a processor 10 and a memory 20. Figure 7 Only some components of the terminal are shown, but it should be understood that it is not required to implement all the shown components, and more or fewer components can be alternatively implemented.
[0129] In some embodiments, the memory 20 may be an internal storage unit of the terminal, such as the hard disk or memory of the terminal. In other embodiments, the memory 20 may also be an external storage device of the terminal, such as a plug-in hard disk equipped on the terminal, a Smart Media Card (SMC), a Secure Digital (SD) card, a Flash Card, etc. Further, the memory 20 may also include both the internal storage unit and the external storage device of the terminal. The memory 20 is used to store application software installed on the terminal and various types of data. The memory 20 may also be used to temporarily store data that has been output or will be output. In one embodiment, a scroll line interpolation program 30 in a motion control card is stored on the memory 20, and the scroll line interpolation program 30 in the motion control card can be executed by the processor 10, so as to implement the scroll line interpolation method in the motion control card in the present application.
[0130] In some embodiments, the processor 10 may be a central processing unit (CPU), a microprocessor or other chips, and is used to run the program code stored in the memory 20 or process data, such as executing the super-resolution image quality evaluation method, etc.
[0131] In one embodiment, referring to Figure 7 the flowchart, when the processor 10 executes the scroll line interpolation program 30 in the memory 20, the following steps are implemented:
[0132] Obtain the positions of the target starting point and the target center point, and obtain the initial radius and the initial angle according to the positions of the target starting point and the target center point;
[0133] Obtain the rotation angle coefficient and direction of the target scroll line, and obtain the target scroll line according to the rotation angle coefficient, the direction, the initial radius and the initial angle;
[0134] Perform densification processing on the target scroll line to obtain target densification points, and the target densification points include first densification points and second densification points;
[0135] Transmit the target densification points to the target motion control card.
[0136] Among them, obtaining the initial radius and the initial angle according to the positions of the target starting point and the target center point includes:
[0137] Calculating the initial radius according to a first formula, and the first formula is:
[0138]
[0139] where x p , y p are respectively the abscissa and ordinate values of the target starting point, and x0, y0 are respectively the abscissa and ordinate values of the target center point.
[0140] Calculating the initial angle according to a second formula, and the second formula is:
[0141] θ0 = atan2((y p - y0), (x p - x0)).
[0142] Among them, calculating the initial angle according to the second formula further includes:
[0143] If the calculated initial angle is less than 0, then update the initial angle to the target initial angle, and the target initial angle is equal to the angle value after adding 2π to the initial angle.
[0144] Among them, the densification processing of the initial vortex line includes:
[0145] Obtaining a target error and densifying the initial vortex line according to the target error.
[0146] Among them, densifying the initial vortex line according to the target error includes:
[0147] Obtaining a first angle according to the target error;
[0148] Taking the first angle as the initial value of the target angle;
[0149] Obtaining a first segmentation point according to the target angle;
[0150] Obtaining a target radius according to the distance between the first segmentation point and the target center point;
[0151] Updating the target angle according to the target radius and the rotation angle coefficient of the target vortex line;
[0152] Repeating the step of obtaining the first segmentation point according to the target angle until reaching the end of the target vortex line.
[0153] Among them, the calculation formula for obtaining the first angle according to the target error is:
[0154] 2*acos(1 - δ / r0);
[0155] Wherein, δ is all the target errors, and r0 is the initial radius.
[0156] Wherein, the step of densifying the initial vortex line according to the target error further includes:
[0157] Performing a moving average filtering process on the obtained first segmentation point to obtain the first densification point;
[0158] Obtaining the minimum distance between the first densification points;
[0159] Obtaining a second segmentation point according to the minimum distance between the first densification points;
[0160] Performing a position moving average filtering on the second segmentation point to obtain the second densification point.
[0161] Embodiment 4
[0162] The present invention further provides a computer-readable storage medium, wherein one or more programs are stored, and the one or more programs can be executed by one or more processors to implement the steps of the vortex line interpolation method in the motion control card as described above.
[0163] Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements on some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A vortex line interpolation method in a motion control card, characterized in that, The method includes: Obtain the positions of the target starting point and the target center point, and based on the positions of the target starting point and the target center point, obtain the initial radius and the initial angle; Obtain the turning angle coefficient and direction of the target vortex line, and obtain the target vortex line based on the turning angle coefficient, the direction, the initial radius, and the initial angle; Perform densification processing on the target vortex line to obtain target densification points, where the target densification points include first densification points and second densification points; Transmit the target densification points to the target motion control card; The obtaining of the initial radius and the initial angle based on the positions of the target starting point and the target center point includes: Calculate the initial radius according to the first formula, and the first formula is: where x p and y p are respectively the abscissa and ordinate values of the target starting point, and x0 and y0 are respectively the abscissa and ordinate values of the target center point; Calculate the initial angle according to the second formula, and the second formula is: θ0 = atan2((y p - y0), (x p - x0)); The calculating of the initial angle according to the second formula further includes: If the calculated initial angle is less than 0, update the initial angle to the target initial angle, where the target initial angle is equal to the angle value after adding 2π to the initial angle; The densification processing of the target vortex line includes: Obtain the target error, and densify the target vortex line according to the target error; The densifying of the target vortex line according to the target error includes: Obtain the first angle according to the target error; Take the first angle as the initial value of the target angle; Obtain the first segmentation point according to the target angle; Obtain the target radius according to the distance between the first segmentation point and the target center point; Update the target angle according to the target radius and the turning angle coefficient of the target vortex line; Repeat the step of obtaining the first segmentation point according to the target angle until reaching the end of the target vortex line.
2. The vortex line interpolation method in the motion control card according to claim 1, characterized in that, The calculation formula for obtaining the first angle according to the target error is: 2*αcos(1 - δ / r0); where δ is all the target errors, and r0 is the initial radius.
3. The vortex line interpolation method in the motion control card according to claim 1, characterized in that, The densifying of the target vortex line according to the target error further includes: Perform sliding mean filtering on the obtained first segmentation points to obtain the first densification points; Obtain the minimum distance between the first densification points; Obtain the second segmentation point according to the minimum distance between the first densification points; Perform position sliding mean filtering on the second segmentation point to obtain the second densification points.
4. A scroll line interpolation device in a motion control card, the scroll line interpolation device in the motion control card being applied to the scroll line interpolation method of the motion control card according to any one of claims 1-3, characterized in that, It includes: An initial value acquisition module, which is used to obtain the positions of the target starting point and the target center point, and based on the positions of the target starting point and the target center point, obtain the initial radius and the initial angle; A vortex line acquisition module, which is used to obtain the turning angle coefficient and direction of the target vortex line, and obtain the target vortex line based on the turning angle coefficient, the direction, the initial radius, and the initial angle; A densification point acquisition module, which is used to perform densification processing on the target vortex line to obtain target densification points, where the target densification points include first densification points and second densification points; A transmission module, which is used to transmit the target densification points to the target motion control card.
5. A terminal, characterized in that, The terminal includes: a processor, and a computer-readable storage medium communicatively connected to the processor. The computer-readable storage medium is adapted to store a plurality of instructions, and the processor is adapted to call the instructions in the computer-readable storage medium to perform the steps of the scroll line interpolation method in the motion control card according to any one of claims 1-3 above.
6. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the steps of the scroll line interpolation method in the motion control card according to any one of claims 1-3.
Citation Information
Patent Citations
Robot spiral trajectory control method and device, storage medium and electronic equipment
CN114474075A