Method and device for speed filtering based on position smoothing, storage medium and equipment

The problem of sudden change in direction and vibration during the tool removal process of CAM CNC machine tools is solved through a speed filtering method based on position smoothing. The filtered speed is calculated through a ring queue filter, which optimizes the processing effect and maintains real-time performance.

CN114139339BActive Publication Date: 2025-10-10SUZHOU MOU XUN INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111198182.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-10-14
Publication Date
2025-10-10
Estimated Expiration
2041-10-14

AI Technical Summary

Technical Problem

During the tool-out process of CNC machine tools, CAM has poor machining effects due to sudden changes in direction and vibration caused by the connection points of small line segments.

Method used

A speed filtering method based on position smoothing is adopted. By accumulating the difference between the current speed input and the historical input position, the filtered speed is calculated and the output position is updated. The ring queue is used for filtering operation to reduce sudden changes in direction and vibration.

Benefits of technology

The interpolator output position is obtained after 6 addition and subtraction operations, 1 multiplication and 7 assignment operations, which avoids position accumulation error, optimizes the processing effect and maintains the real-time performance of interpolation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114139339B_ABST
    Figure CN114139339B_ABST
Patent Text Reader

Abstract

The application discloses a position smoothing-based speed filtering method and device, a storage medium and equipment, and is used for solving the problem that the machining effect is poor when a CAM cuts. The position smoothing-based speed filtering method comprises the following steps: in the i-th filtering, accumulating a current speed input to obtain a current input position, and storing the current input position into a first circular queue, wherein i>1; calculating a difference value between the current input position and a historical input position in the i-n-th filtering, and storing the difference value into a second circular queue, wherein N=2n-1, and N is the width of the filter; accumulating the second circular queue to obtain a current filtered speed; and updating a current output position based on the current filtered speed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of computer technology, and in particular relates to a velocity filtering method and device based on position smoothing, a storage medium and an electronic device. Background Art

[0002] CAM (Computer Aided Manufacturing) mainly refers to the use of computers to assist in the entire process from production preparation to product manufacturing, that is, by directly or indirectly connecting computers with manufacturing processes and production equipment, using computer systems to plan and manage the manufacturing process, control and operate production equipment, process data required in the product manufacturing process, control and process the flow of materials (blanks and parts, etc.), test and inspect products, etc.

[0003] In the application of CAM in CNC machine tools, CAM often breaks up the tool path into small line segments when outputting the tool path. A sudden connection point will be formed between the small line segments. When the machine tool passes through this connection point, a large directional sudden change will occur, resulting in a large angular acceleration, causing vibration and affecting the processing effect.

[0004] The information disclosed in this background technology section is only intended to enhance understanding of the overall background of the invention and should not be regarded as an admission or any form of suggestion that the information constitutes the prior art already known to a person skilled in the art. Summary of the Invention

[0005] The purpose of the present invention is to provide a velocity filtering method based on position smoothing, which is used to solve the problem that the existing CAM has poor processing effect when the tool is released.

[0006] To achieve the above object, the present invention provides a velocity filtering method based on position smoothing, comprising:

[0007] During the i-th filtering, the current velocity input is accumulated to obtain the current input position and stored in the first circular queue, where i>1;

[0008] Calculate the difference between the current input position and the historical input position at the inth filtering, and store it in the second circular queue, where N = 2n-1, where N is the width of the filter;

[0009] Accumulating the second circular queue to obtain the current filtered speed;

[0010] Based on the current filtered velocity, the current output position is updated.

[0011] In one embodiment, during the i-th filtering, the current velocity input is accumulated to obtain the current input position, specifically including:

[0012] During the i-th filtering, the historical input position during the i-1-th filtering is summed with the current speed input to obtain the current input position; where,

[0013] The historical input position during the (i-1)th filtering is equal to the sum of the historical speed inputs during the 1st to (i-1)th filtering.

[0014] In one embodiment, accumulating the second circular queue to obtain the current filtered speed specifically includes:

[0015] Sum the second ring queue at the i-th filtering and the historical first accumulated value at the i-1-th filtering to obtain the current first accumulated value;

[0016] Summing the current first accumulated value and the historical second accumulated value at the time of the (i-1)th filtering to obtain a current second accumulated value;

[0017] Calculating a current filtered position based on a product of the current second accumulated value and a preset weight;

[0018] The current filtered speed is calculated based on the difference between the current filtered position and the historical output position during the (i-1)th filtering.

[0019] In one embodiment, the preset weight is expressed as:

[0020]

[0021] Wherein, N=2n-1, and N is the width of the filter.

[0022] In one embodiment, updating the current output position based on the current filtered velocity specifically includes:

[0023] The current filtered velocity is summed with the historical output position at the time of the (i-1)th filtering to obtain the current output position.

[0024] In one embodiment, it further includes:

[0025] When the current speed input is zero, the speed filtering method is repeatedly executed until the current output position is equal to the current input position;

[0026] Exit the speed filtering method and set a Boolean variable to a first value, wherein the Boolean variable is used to mark the filtering working state. When the Boolean variable is the first value, no filtering operation is performed on the current speed input.

[0027] In one embodiment, the lengths of the first circular queue and the second circular queue are equal to the width of the filter.

[0028] The present invention also provides a velocity filtering device based on position smoothing, comprising:

[0029] A first calculation module is used to accumulate the current speed input to obtain the current input position during the i-th filtering, and store it in a first circular queue, where i>1;

[0030] A second calculation module is used to calculate the difference between the current input position and the historical input position during the in-th filtering, and store it in a second circular queue;

[0031] A third calculation module is used to accumulate the second circular queue to obtain a current filtered speed;

[0032] The fourth calculation module is used to update the current output position based on the current filtered speed.

[0033] The present invention also provides a computing device, comprising:

[0034] at least one processor; and

[0035] A memory stores instructions, and when the instructions are executed by the at least one processor, the at least one processor is caused to perform the method described above.

[0036] The present invention also provides a machine-readable storage medium storing executable instructions, which, when executed, enable the machine to perform the method described above.

[0037] Compared with the prior art, the velocity filtering method based on position smoothing according to the present invention can obtain the interpolation output position of the interpolator through 6 addition and subtraction operations, 1 multiplication operation, and 7 assignment operations without going through N=2-1 cycles. The processing effect is good and the time consumption is short, and the real-time performance of the interpolation is not affected. Moreover, in this filtering method, although the velocity is filtered, the smoothing is based on the spatial position, which makes it convenient to introduce adaptive control of the bow height error. That is, after the velocity is forward-looking planned, the width of the sliding filter can be calculated in advance through the curvature value and velocity of each motion segment, so that the smoothing intensity is large enough but does not exceed the set bow height error. In addition, based on position smoothing, the exit timing of the filter can be more rigorous to avoid the hidden danger of position accumulation error. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] Figure 1 is a flow chart of an embodiment of a velocity filtering method based on position smoothing according to the present invention;

[0039] Figure 2 and Figure 3 The figures are respectively the trajectory diagrams of the CAM tool when the speed filtering method of the present invention is not enabled and when the speed filtering method of the present invention is enabled;

[0040] Figure 4 is a module diagram of an embodiment of a velocity filtering device based on position smoothing according to the present invention;

[0041] Figure 5 4 is a hardware structure diagram of an embodiment of a velocity filtering calculation device based on position smoothing according to the present invention. DETAILED DESCRIPTION

[0042] The specific embodiments of the present invention are described in detail below with reference to the accompanying drawings, but it should be understood that the protection scope of the present invention is not limited by the specific embodiments.

[0043] Unless expressly stated otherwise, throughout the specification and claims, the term "comprise" or variations such as "include" or "comprising", etc., will be understood to include the stated elements or components but not to exclude other elements or other components.

[0044] In the sliding weighted average filter, the principle formula is:

[0045]

[0046] Where F(i) is the filter output, X(i-k+1) is the filter input, H(k) is the filter weight, i represents the i-th filter, i and k are positive integers; the filter weight H(k) is defined as:

[0047]

[0048] It can be seen that:

[0049]

[0050] Satisfies the definition of weighted average.

[0051] It can be seen that each sliding weighted average filtering needs to go through N = 2n-1 cycles, and each cycle requires one multiplication and one accumulation. When N is relatively large, the calculation will be more time-consuming. In order not to affect the real-time performance of interpolation, a lower filter width upper limit needs to be set.

[0052] Ginseng Figure 1 Based on the above definition, a specific embodiment of the velocity filtering method based on position smoothing of the present invention is introduced. In this embodiment, the method includes:

[0053] S11 . During the i-th filtering, the current speed input is accumulated to obtain the current input position, and the current input position is stored in the first circular queue.

[0054] At the beginning of velocity filtering, the filter initialization step can be performed first, including setting the filter width to N, which can be corrected downward to an odd number N = 2n-1; initializing the input position P in and output position P out is 0; a Boolean variable bWorking is set to mark the working state of the filter and initialized to the first value false.

[0055] Here, when the Boolean variable bWorking is the first value false, the filtering operation on the current speed input is not performed, and the filter directly outputs the speed input value without any change; when the Boolean variable bWorking is the second value true, the filter performs the filtering operation on the current speed input.

[0056] Furthermore, at the start of velocity filtering, it is necessary to check whether the filter can be started to perform the filtering operation. Here, the filter can be started only when the velocity input is set to 0 and the filter is not currently working, and the Boolean variable bWorking is set to the second value true.

[0057] In the specific filtering operation, take the i-th filtering as an example (i>1):

[0058] First, the historical input position at the time of the i-1th filtering is compared with the current speed input V in (i) Sum to get the current input position. Here, the historical input position P at the time of the i-1th filtering is in (i-1) is equal to the sum of the historical speed inputs from the 1st to the i-1st time. The current input position is specifically expressed as follows:

[0059] P in (i) = P in (i-1)+V in (i)

[0060] The current input position is stored in the first circular queue X[i], expressed as X[i]=P in Here, the subscript of the first circular queue X[i] is expressed as (i mod N), where mod represents the congruence operation.

[0061] In one embodiment, the length of the first circular queue X[i] may be equal to the width N of the filter.

[0062] S12: Calculate the difference between the current input position and the historical input position during the in-th filtering, and store it in the second circular queue.

[0063] The second ring queue Y[i] is expressed as:

[0064] Y[i]=Y[i]-Y[in]

[0065] Where N=2n-1, N is the width of the filter. Similarly, the subscript of the second circular queue Y[i] is represented as (imod N), where mod represents the congruence operation.

[0066] In this step, the current input position and the historical input position during the in-th filtering can both be retrieved from the first circular queue; or, at least the historical input position during the in-th filtering can be retrieved from the first circular queue.

[0067] In one embodiment, the length of the second circular queue Y[i] may be equal to the width N of the filter.

[0068] S13: Accumulate the second circular queue to obtain the current filtered speed.

[0069] Specifically, first, the second ring queue at the i-th filtering time and the historical first accumulated value at the (i-1)-th filtering time are summed to obtain the current first accumulated value.

[0070] The first accumulated value here can be stored in the first accumulator D(i), and the first accumulator D(i) can be set to 0 when the filter is initialized. Specifically expressed as:

[0071] D(i)=D(i-1)+Y[i]

[0072] Secondly, the current first accumulated value is summed with the historical second accumulated value at the time of the (i-1)th filtering to obtain the current second accumulated value.

[0073] Similarly, the second accumulated value here can be stored in the second accumulator S(i), and the second accumulator S(i) can be set to 0 when the filter is initialized. Specifically expressed as:

[0074] S(i)=S(i-1)+D(i)

[0075] Then, the current filtered position is calculated based on the product of the current second accumulated value and the preset weight. The current filtered position is expressed as k*S(i), where k is the preset weight, and

[0076]

[0077] Wherein, N=2n-1, and N is the width of the filter.

[0078] Finally, based on the current filtered position and the historical output position P at the time of the i-1th filtering out The difference between (i-1) and the current filtered speed is calculated. The specific expression is:

[0079] V out(i)=k*S(i)-P out (i-1)

[0080] S14. Update the current output position based on the current filtered speed.

[0081] Specifically, the current filtered velocity is summed with the historical output position at the time of the i-1th filtering to obtain the current output position P out (i). Specifically expressed as:

[0082] P out (i) = P out (i-1)+V out (i)

[0083] In one embodiment, the input position and the output position may be set to 0 when the filter is initialized.

[0084] In the above filter speed filtering method, the step of exiting the filtering method is also included. Specifically, at the current speed input V in When (i) = 0, the above speed filtering method is repeated until the current output position P out (i) and the current input position P in (i) If they are equal, exit the velocity filtering method and set the Boolean variable bWorking to the first value false.

[0085] It can be proved that the number of times the above speed filtering method is repeatedly called is no greater than the width N of the filter, which can make the Boolean variable bWorking have the first value false.

[0086] In the above implementation methods and examples, the interpolation output position of the interpolator can be obtained through 6 addition and subtraction operations, 1 multiplication operation, and 7 assignment operations without going through N=2n-1 cycles. The processing effect is good and the time consumption is short, and the real-time performance of the interpolation will not be affected.

[0087] Moreover, in the above-mentioned filtering method, although the speed is filtered, the smoothing is based on the spatial position, which makes it convenient to introduce adaptive control of the bow height error. That is, after the speed is planned in advance, the width of the sliding filter can be calculated in advance by the curvature value and speed of each motion segment, so that the smoothing intensity is large enough but does not exceed the set bow height error.

[0088] In addition, based on position smoothing, the exit timing of the filter can be more rigorous to avoid the hidden danger of position accumulation error.

[0089] Ginseng Figure 2 and Figure 3, respectively, are the CAM tooling trajectory graphs when the speed filtering method of the present application is not turned on and when the speed filtering method of the present application is turned on. It can be seen that after the speed filtering method of the present application is turned on, the direction mutation of the joint is effectively smoothed, the vibration is reduced, and thus the machining effect is optimized.

[0090] The feasibility of the speed filtering method in the above embodiment of the present application is deduced from a mathematical point of view as follows.

[0091] The filtering formula of the sliding weighted average filter is expanded as follows:

[0092]

[0093] Let:

[0094] S(i) = X(i) + 2 * X(i-1) + … + n * X(i-n+1) + … + 2 * X(i-2n+3) + X(i-2n+2)

[0095] Then:

[0096] S(i-1) = X(i-1) + 2 * X(i-2) + … + n * X(i-n) + … + 2 * X(i-2n+2) + X(i-2n+1)

[0097] S(i) - S(i-1) = X(i) + X(i-1) + … + X(i-n+1) - X(i-n) - X(i-n-1) - … - X(i-2n+1)

[0098] That is:

[0099] S(i) - S(i-1) = [X(i) - X(i-n)] + [X(i-1) - X(i-n-1)] + … + [X(i-n+1) - X(i-2n+1)]

[0100] Let: Y(i) = X(i) - X(i-n), D(i) = S(i) - S(i-1)

[0101] Then: D(i) = Y(i) + Y(i-1) + … + Y(i-n+1); D(i) - D(i-1) = Y(i) - Y(i-n)

[0102] Let: Z(i) = Y(i) - Y(i-n)

[0103] Then: D(i) - D(i-1) = Z(i)

[0104] From the above arrangement, we have:

[0105] Y(i) = X(i) - X(i-n)

[0106] Z(i) = Y(i) - Y(i-n)

[0107] D(i)=D(i-1)+Z(i)

[0108] S(i)=S(i-1)+D(i)

[0109]

[0110] Here X(i) is the current input position P in (i), F(i) is the current output position P out (i), F(i)-F(i-1) is the current filtered velocity V of the interpolator out (i).

[0111] Ginseng Figure 4 The present invention also provides a specific embodiment of a speed filtering device based on position smoothing. The S-shaped speed curve forward planning device includes a first calculation module, a second calculation module, a third calculation module, and a fourth calculation module.

[0112] The first calculation module is used to accumulate the current speed input during the i-th filtering to obtain the current input position and store it in the first circular queue, where i>1; the second calculation module is used to calculate the difference between the current input position and the historical input position during the in-th filtering, and store it in the second circular queue; the third calculation module is used to accumulate the second circular queue to obtain the current filtered speed; the fourth calculation module is used to update the current output position based on the current filtered speed.

[0113] In one embodiment, the first calculation module is specifically configured to:

[0114] During the i-th filtering, the historical input position during the i-1-th filtering is summed with the current speed input to obtain the current input position; wherein the historical input position during the i-1-th filtering is equal to the sum of the historical speed inputs during the 1st to i-1-th filtering.

[0115] In one embodiment, the third calculation module is specifically configured to:

[0116] The second circular queue at the i-th filtering time is summed with the historical first accumulated value at the i-1-th filtering time to obtain the current first accumulated value; the current first accumulated value is summed with the historical second accumulated value at the i-1-th filtering time to obtain the current second accumulated value; the current filtered position is calculated based on the product of the current second accumulated value and the preset weight; the current filtered speed is calculated based on the difference between the current filtered position and the historical output position at the i-1-th filtering time.

[0117] In one embodiment, the fourth calculation module is specifically configured to:

[0118] The filtered velocity is summed with the historical output position at the time of the (i-1)th filtering to obtain the current output position.

[0119] Figure 5 FIG. 3 shows a hardware structure diagram of a computing device 30 for velocity filtering based on position smoothing according to an embodiment of the present specification. Figure 5 As shown, the computing device 30 may include at least one processor 301, a memory 302 (e.g., a non-volatile memory), a storage 303, and a communication interface 304, and the at least one processor 301, the storage 302, the storage 303, and the communication interface 304 are connected together via a bus 305. The at least one processor 301 executes at least one computer-readable instruction stored or encoded in the storage 302.

[0120] It should be understood that the computer executable instructions stored in the memory 302, when executed, cause the at least one processor 301 to perform the above combined operations in the various embodiments of this specification. Figure 1-3 Describes the various operations and functions.

[0121] In the embodiments of the present specification, the computing device 30 may include, but is not limited to, a personal computer, a server computer, a workstation, a desktop computer, a laptop computer, a notebook computer, a mobile computing device, a smart phone, a tablet computer, a cellular phone, a personal digital assistant (PDA), a handheld device, a messaging device, a wearable computing device, a consumer electronic device, and the like.

[0122] According to one embodiment, a program product such as a machine-readable medium is provided. The machine-readable medium may have instructions (i.e., the above-mentioned elements implemented in software form), which, when executed by a machine, causes the machine to perform the above-mentioned combined embodiments of the present specification. Figure 1-3 Specifically, a system or device equipped with a readable storage medium can be provided, on which software program codes for implementing the functions of any of the above-mentioned embodiments are stored, and a computer or processor of the system or device can be enabled to read and execute the instructions stored in the readable storage medium.

[0123] In this case, the program code itself read from the machine-readable medium can implement the functions of any one of the above embodiments, and thus the machine-readable code and the machine-readable storage medium storing the machine-readable code constitute part of this specification.

[0124] Examples of readable storage media include floppy disks, hard disks, magneto-optical disks, optical disks (e.g., CD-ROMs, CD-Rs, CD-RWs, DVD-ROMs, DVD-RAMs, DVD-RWs, DVD-RWs), magnetic tapes, non-volatile memory cards, and ROMs. Alternatively, the program code may be downloaded from a server computer or a cloud via a communication network.

[0125] Those skilled in the art will appreciate that the various embodiments disclosed above may be modified and altered in various ways without departing from the essence of the invention. Therefore, the scope of protection of this specification shall be defined by the appended claims.

[0126] It should be noted that not all steps and units in the above processes and system structure diagrams are required, and certain steps or units can be omitted according to actual needs. The execution order of each step is not fixed and can be determined as needed. The device structure described in the above embodiments can be a physical structure or a logical structure, that is, some units may be implemented by the same physical client, or some units may be implemented by multiple physical clients, or may be implemented by certain components in multiple independent devices.

[0127] In the above embodiments, hardware unit or module can be realized by mechanical means or electrical means. For example, a hardware unit, module or processor can include permanent dedicated circuit or logic (such as special processor, FPGA or ASIC) to complete the corresponding operation. Hardware unit or processor can also include programmable logic or circuit (such as general purpose processor or other programmable processor), can be temporarily set up to complete the corresponding operation by software. Concrete implementation (mechanical means or dedicated permanent circuit or temporary circuit) can be determined based on cost and time consideration.

[0128] The specific embodiments described above in conjunction with the accompanying drawings describe exemplary embodiments, but do not represent all embodiments that can be implemented or fall within the scope of protection of the claims. The term "exemplary" used throughout this specification means "used as an example, instance or illustration" and does not mean "preferred" or "having advantages" over other embodiments. For the purpose of providing an understanding of the described technology, the specific embodiments include specific details. However, these technologies can be implemented without these specific details. In some instances, in order to avoid obscuring the concepts of the described embodiments, well-known structures and devices are shown in block diagram form.

[0129] The foregoing description of the present disclosure has been presented for the purposes of conduction and enabling those of ordinary skill in the art to make and use the present disclosure. Modifications to embodiments of the present disclosure implementing the principles of the present disclosure can occur to those skilled in the art with the benefit of the present disclosure. Therefore, what has been described above is merely illustrative of the principles of the present disclosure, and the present disclosure is to be given a broad interpretation.

Claims

1. A velocity filtering method based on position smoothing, characterized in that: include: The input position, output position, first accumulated value and second accumulated value are set to 0 when the filter is initialized. During the i-th filtering, the current velocity input is accumulated to obtain the current input position and stored in the first circular queue, where i>1; Calculate the difference between the current input position and the historical input position at the time of the in-th filtering, and store it in a second circular queue, where N=2n-1, where N is the width of the filter; Sum the second ring queue at the i-th filtering and the historical first accumulated value at the i-1-th filtering to obtain the current first accumulated value; Summing the current first accumulated value and the historical second accumulated value at the time of the (i-1)th filtering to obtain a current second accumulated value; Calculating a current filtered position based on a product of the current second accumulated value and a preset weight; Calculating the current filtered velocity based on the difference between the current filtered position and the historical output position during the (i-1)th filtering; The current filtered velocity is summed with the historical output position at the time of the (i-1)th filtering to obtain the current output position.

2. The velocity filtering method based on position smoothing according to claim 1, characterized in that: During the i-th filtering, the current velocity input is accumulated to obtain the current input position, specifically including: During the i-th filtering, the historical input position during the i-1-th filtering is summed with the current speed input to obtain the current input position; where, The historical input position during the (i-1)th filtering is equal to the sum of the historical speed inputs during the 1st to (i-1)th filtering.

3. The velocity filtering method based on position smoothing according to claim 2, characterized in that: The preset weight is expressed as: Wherein, N=2n-1, and N is the width of the filter.

4. The velocity filtering method based on position smoothing according to any one of claims 1 to 3, characterized in that: Also includes: When the current speed input is zero, the speed filtering method is repeatedly executed until the current output position is equal to the current input position; Exit the speed filtering method and set a Boolean variable to a first value, wherein the Boolean variable is used to mark the filtering working state. When the Boolean variable is the first value, no filtering operation is performed on the current speed input.

5. The velocity filtering method based on position smoothing according to claim 1, characterized in that: The lengths of the first circular queue and the second circular queue are equal to the width of the filter.

6. A computing device comprising: at least one processor; as well as A memory storing instructions, which, when executed by the at least one processor, causes the at least one processor to perform the method according to any one of claims 1 to 5.

7. A machine-readable storage medium storing executable instructions, wherein when the instructions are executed, the machine is caused to perform the method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Machining method for controlling fixed length cutting of workpiece by tool, cutting device and machine tool

    CN109164755A

  • Numerical control speed filtering method and system

    CN109254563A