Method for avoiding reverse motion after trajectory smoothing in numerical control system by using FIR filter
By using a combination of first and second FIR filters in the CNC system, the problem of motion reversal after trajectory smoothing by the FIR filter is solved, achieving stable machining after trajectory smoothing and preventing motion reversal and abnormal termination.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHANGHAI WEIHONG ELECTRONICS TECH
- Filing Date
- 2022-12-22
- Publication Date
- 2026-05-01
AI Technical Summary
In existing CNC systems, the FIR filter may cause motion reversal after trajectory smoothing, affecting the machining effect and potentially triggering soft limit switches, leading to abnormal termination.
A combination of a first FIR filter and a second FIR filter is used. If the first FIR filter contains negative coefficients, a second FIR filter without negative coefficients is reconstructed. A gradient filter is constructed through quadratic interpolation to prevent motion reversal.
It effectively prevents the occurrence of reverse motion, improves the machining effect and stability of the CNC system, and avoids abnormal termination caused by reverse motion.
Smart Images

Figure CN115882824B_ABST
Abstract
Description
A method for using FIR filters in CNC systems to prevent motion reversal after trajectory smoothing. Technical Field
[0001] This invention relates to the field of CNC system technology, and more particularly to the field of trajectory smoothing technology in CNC systems. Specifically, it refers to a method for avoiding motion reversal after trajectory smoothing in CNC systems by using an FIR filter. Background Technology
[0002] Currently, most CNC systems perform filtering after interpolation to smooth speed and trajectory. FIR filters can control trajectory errors before and after filtering to some extent, and are therefore frequently used. However, the coefficients of the constructed FIR filters can sometimes be negative, causing reverse motion in the filtered trajectory, especially at the beginning and end of the motion. This not only affects the machining effect at these points but may also trigger soft limits, leading to abnormal termination of machining. Therefore, to address the shortcomings of existing technologies, a solution is urgently needed that can effectively prevent reverse motion when the constructed FIR filter has negative coefficients. Summary of the Invention
[0003] The purpose of this invention is to overcome the shortcomings of the prior art and provide a method for effectively solving the problem of motion reversal in CNC systems by using an FIR filter to avoid motion reversal after trajectory smoothing.
[0004] To achieve the above objectives, the CNC system of the present invention utilizes an FIR filter to avoid motion reversal after trajectory smoothing, as follows:
[0005] This CNC system utilizes an FIR filter to prevent motion reversal after trajectory smoothing. Its main feature is that the method includes:
[0006] The first FIR filter determines the specific method of subsequent filtering by judging whether it contains negative coefficients; and
[0007] The second FIR filter is a filter without negative coefficients. The first FIR filter and the second FIR filter are subjected to a second interpolation process to achieve alternating filtering before the motion stops, thus preventing the motion from reversing.
[0008] Preferably, the first FIR filter is constructed by calculating the amplitude-frequency characteristics of the filter using curve error and damping coefficient.
[0009] Preferably, the first FIR filter specifically performs the following processing:
[0010] Determine whether the first FIR filter contains negative coefficients. If not, directly use the coefficients contained in the current first FIR filter for filtering; otherwise, reconstruct a second FIR filter without negative coefficients based on the existing coefficients for filtering.
[0011] Preferably, the second FIR filter specifically performs the following processing:
[0012] By performing a second interpolation process on the first and second FIR filters, a series of gradient filters are constructed.
[0013] When the system starts to move, it first uses the second FIR filter for filtering. After a preset time, it gradually transitions to using the first FIR filter for filtering.
[0014] When the motion is nearing its end, the first FIR filter is used for filtering. After a preset time, the process gradually transitions to using the second FIR filter until the motion stops.
[0015] The present invention employs a method in the CNC system that uses an FIR filter to avoid motion reversal after trajectory smoothing. By constructing a series of gradually changing filters, filtering can be performed after secondary interpolation. When the constructed FIR filter has negative coefficients, it can effectively prevent motion reversal. Compared with the prior art, it has outstanding practicality and convenience. Attached Figure Description
[0016] Figure 1 is a schematic diagram of the result after FIR filtering using the prior art of the present invention.
[0017] Figure 2 is a schematic diagram of the result after FIR filtering according to the present invention.
[0018] Figure 3 is a flowchart of the method for avoiding motion reversal after trajectory smoothing in the CNC system of the present invention by using an FIR filter.
[0019] Figure 4 is a schematic diagram illustrating how the present invention solves the problem of no motion reversal after trajectory smoothing. Detailed Implementation
[0020] To more clearly describe the technical content of the present invention, the following description is provided in conjunction with specific embodiments.
[0021] Before describing the embodiments of the present invention in detail, it should be noted that, in the following, the terms “comprising,” “including,” or any other variations are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed or inherent to such process, method, article, or apparatus.
[0022] Please refer to Figure 3. This CNC system utilizes an FIR filter to prevent motion reversal after trajectory smoothing. The method includes setting up:
[0023] The first FIR filter determines the specific method of subsequent filtering by judging whether it contains negative coefficients; and
[0024] The second FIR filter is a filter without negative coefficients. The first FIR filter and the second FIR filter are subjected to a second interpolation process to achieve alternating filtering before the motion stops, thus preventing the motion from reversing.
[0025] As a preferred embodiment of the present invention, the first FIR filter is constructed by calculating the amplitude-frequency characteristics of the filter using curve error and damping coefficient.
[0026] In a preferred embodiment of the present invention, the first FIR filter specifically undergoes the following processing:
[0027] Determine whether the first FIR filter contains negative coefficients. If not, directly use the coefficients contained in the current first FIR filter for filtering; otherwise, reconstruct a second FIR filter without negative coefficients based on the existing coefficients for filtering.
[0028] In a preferred embodiment of the present invention, the second FIR filter specifically undergoes the following processing:
[0029] By performing a second interpolation process on the first and second FIR filters, a series of gradient filters are constructed.
[0030] When the system starts to move, it first uses the second FIR filter for filtering. After a preset time, it gradually transitions to using the first FIR filter for filtering.
[0031] When the motion is nearing its end, the first FIR filter is used for filtering. After a preset time, the process gradually transitions to using the second FIR filter until the motion stops.
[0032] In practical applications, this technical solution is implemented through the following steps:
[0033] 1. Construct the first FIR filter using parameters such as trajectory allowable error.
[0034] 2. Determine if any coefficients in the filter are negative: If not, use these coefficients directly for filtering; otherwise, perform the following steps:
[0035] 3. Reconstruct a second FIR filter without negative coefficients using the existing coefficients. Interpolate these two filter sets twice to obtain N-2 different filters, where N is the order of the filter – a series of gradually varying filters.
[0036] 4. At the start of the motion, use the second FIR filter for filtering, then gradually transition to using the first FIR filter. As the motion nears its end, resume using the first FIR filter, then gradually transition to the second FIR filter, until the motion stops.
[0037] In a specific embodiment of the present invention, according to the flowchart in Figure 3, filter coefficient 1 containing negative coefficients is first obtained, then filter coefficient N without negative coefficients is obtained, and quadratic interpolation is used to obtain gradually changing filter coefficients 2, 3, ..., N-1. As shown in Figure 4, the trajectory before smoothing, for the starting position of the trajectory, coefficient N is used for filtering first, followed by coefficients N-1, N-2, ..., 2,1. Afterwards, filter coefficient 1 is used normally for filtering. This effectively prevents the reversal at the beginning of the motion.
[0038] In a specific embodiment of the present invention, as shown in FIG4, for the end position of the trajectory, filtering is initially performed using coefficient 1, followed by coefficients 2, 3, ..., N, until the endpoint is reached. This effectively prevents reverse movement at the end of the motion.
[0039] Any process or method description in the flowchart or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or more executable instructions for implementing a particular logical function or process, and the scope of the preferred embodiments of the invention includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the functions involved, as will be understood by those skilled in the art to which embodiments of the invention pertain.
[0040] It should be understood that various parts of the present invention can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented using software or firmware stored in memory and executed by a suitable instruction execution device.
[0041] Those skilled in the art will understand that all or part of the steps of the methods in the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, the program includes one or a combination of the steps of the method embodiments.
[0042] The storage media mentioned above can be read-only memory, disk, or optical disk, etc.
[0043] In the description of this specification, references to terms such as "an embodiment," "some embodiments," "example," "specific example," or "embodiment," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the invention. In this specification, illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.
[0044] Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of the present invention.
[0045] The present invention employs a method in the CNC system that uses an FIR filter to avoid motion reversal after trajectory smoothing. By constructing a series of gradually changing filters, filtering can be performed after secondary interpolation. When the constructed FIR filter has negative coefficients, it can effectively prevent motion reversal. Compared with the prior art, it has outstanding practicality and convenience.
[0046] In this specification, the invention has been described with reference to specific embodiments thereof. However, it will be apparent that various modifications and variations can be made without departing from the spirit and scope of the invention. Therefore, the specification and drawings should be considered illustrative rather than restrictive.
Claims
1. A method for preventing motion reversal after trajectory smoothing in a CNC system using an FIR filter, characterized in that, The method includes: a first FIR filter, wherein the specific method of subsequent filtering is determined by determining whether the first FIR filter contains negative coefficients; and a second FIR filter, wherein the second FIR filter is a filter without negative coefficients. The first FIR filter and the second FIR filter are subjected to a second interpolation process to achieve alternating filtering before the motion stops, preventing the motion from reversing. Specifically, the first FIR filter performs the following processing: determining whether the first FIR filter contains negative coefficients; if not, directly using the coefficients currently present in the first FIR filter for filtering; otherwise, based on the current... Some coefficients are reconstructed into a second FIR filter without negative coefficients for filtering. The second FIR filter specifically performs the following processing: the first FIR filter and the second FIR filter are interpolated twice to construct a series of gradually changing filters. When the system starts moving, the second FIR filter is used for filtering first. After a preset time, the system gradually transitions to using the first FIR filter for filtering. When the movement is nearing its end, the first FIR filter is used for filtering first. After a preset time, the system gradually transitions to using the second FIR filter for filtering until the movement stops.
2. The method for avoiding motion reversal after trajectory smoothing in a CNC system using an FIR filter according to claim 1, characterized in that, The first FIR filter is constructed by calculating the amplitude-frequency characteristics of the filter using curve error and damping coefficient.
Citation Information
Patent Citations
Digital filter with confidence input
CN108702143A