A current software filtering method and system
By employing a multi-step current software filtering method, combining weighted filtering and average filtering, the fluctuation problem caused by the single motor current filtering algorithm is solved, and efficient current filtering is achieved.
Patent Information
- Application Number
- CN202410327881.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-21
- Publication Date
- 2025-11-21
- Estimated Expiration
- 2044-03-21
AI Technical Summary
Existing motor current filtering algorithms are limited and cannot effectively suppress harmonics and random interference, resulting in large current fluctuations and low filtering efficiency.
A multi-step current software filtering method is adopted, which includes calculating the current amplitude deviation, constructing the maximum deviation threshold, sampling the target current sequence, calculating the average current value and difference, performing the first current filtering and the second current filtering, and combining weighted filtering and average filtering methods to achieve multi-level filtering of the current.
It effectively suppresses periodic and occasional interference in motor current, reduces current fluctuations, and improves filtering efficiency.
Smart Images

Figure CN118889940B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of motor control, and in particular to a current software filtering method and system. BACKGROUND
[0002] Due to the high speed characteristics of the motor and the nonlinear characteristics of the electronic components in the motor, the current sampled from the motor has harmonics and random interference, so it is very important to filter the current.
[0003] At present, most of the current filtering algorithms for the motor are single filtering algorithms, that is, they cannot fuse multiple current filtering algorithms, and these algorithms have certain defects, such as the amplitude limiting filtering algorithm cannot suppress periodic interference, the arithmetic average filtering algorithm is time-consuming in data processing, and is easily affected by a single data to produce large fluctuations, and the first-order low-pass filtering algorithm has phase lag and low sensitivity. Therefore, a solution is urgently needed to make up for the shortcomings of single algorithm, thereby reducing current fluctuations and improving filtering efficiency. SUMMARY
[0004] In order to solve the above problems, the present application provides a current software filtering method and system, which can make up for the shortcomings of single algorithm, thereby reducing current fluctuations and improving filtering efficiency.
[0005] In a first aspect, the present application provides a current software filtering method, comprising:
[0006] sampling the current of the motor at the current time, obtaining a historical current sequence of the motor, and calculating the current amplitude deviation between the current and the current in the historical current sequence;
[0007] constructing a maximum deviation threshold of the motor, and determining whether the current amplitude deviation is greater than the maximum deviation threshold;
[0008] when the current amplitude deviation is greater than the maximum deviation threshold, sampling a target current sequence from the historical current sequence, calculating the current average value of the target current sequence, and calculating the current-average value difference between each target current in the target current sequence and the current average value;
[0009] selecting the maximum difference value from the current-average value difference, using the current average value and the maximum difference value to perform current first filtering on the current to obtain a first filtered current;
[0010] when the current amplitude deviation is not greater than the maximum deviation threshold, performing current second filtering on the current to obtain a second filtered current.
[0011] In a possible implementation manner of the first aspect, the sampling of the current of the motor at the current time comprises:
[0012] After clamping the phase line of the motor by the digital multimeter, the current of the motor at the current time is sampled from the digital multimeter.
[0013] In a possible implementation manner of the first aspect, the calculating the current amplitude deviation between the current and the currents in the historical current sequence comprises:
[0014] obtaining a current time of the current and a historical time of the historical current sequence;
[0015] selecting a historical current at a previous time of the current from the historical current sequence based on the current time and the historical time;
[0016] calculating the current amplitude deviation between the current and the currents in the historical current sequence based on the historical current at the previous time by using the following formula:
[0017] I dif = I n - I m
[0018] wherein I dif denotes the current amplitude deviation, I n denotes the current, and I m denotes the historical current at the previous time.
[0019] In a possible implementation manner of the first aspect, the constructing the maximum deviation threshold of the motor comprises:
[0020] collecting historical fault data of the motor;
[0021] identifying fault current data from the historical fault data;
[0022] calculating a current data difference between two adjacent fault current data in the fault current data;
[0023] selecting a maximum current data difference from the current data difference;
[0024] taking the maximum current data difference as the maximum deviation threshold.
[0025] In a possible implementation manner of the first aspect, the sampling the target current sequence from the historical current sequence comprises:
[0026] calculating a sequence number of the target current sequence by using the following formula:
[0027]
[0028] wherein (s1, s2, …, s9, s 10 ) represents the sequence number, and r represents the sequence number of the current of the motor at the current time;
[0029] corresponding historical current of the sequence number in the historical current sequence as the target current sequence.
[0030] In a possible implementation manner of the first aspect, the current average value of the target current sequence is calculated, including:
[0031] The current average value of the target current sequence is calculated by using the following formula:
[0032] I avr =(I1+I2+…+I 10 ) / 10
[0033] wherein I avr represents the current average value, (I1, I2, …, I 10 ) represents the target current sequence, and 10 represents the total number of the target current sequence.
[0034] In a possible implementation manner of the first aspect, the current-average value difference between each target current of the target current sequence and the current average value is calculated, including:
[0035] The current-average value difference between each target current of the target current sequence and the current average value is calculated by using the following formula:
[0036] ΔI=I i -I avr (i=1, 2, …, 10)
[0037] wherein ΔI represents the current-average value difference, I i represents the target current sequence, I avr represents the current average value, and i represents the sequence number of the target current in the target current sequence.
[0038] In a possible implementation manner of the first aspect, the current is first filtered based on the current average value and the maximum difference value to obtain a first filtered current, including:
[0039] The first filtered current value of the current is calculated based on the current average value and the maximum difference value by using the following formula:
[0040] I fil =(I avr *10-I max ) / 9
[0041] wherein Ifil represents the first filtered current value, I avr represents the current average value, I max represents the maximum difference value;
[0042] After the current value of the current is replaced by the first filtered current value, the current whose current value is replaced by the first filtered current value is taken as the first filtered current.
[0043] In a possible implementation manner of the first aspect, the current second filtering of the current to obtain a second filtered current comprises:
[0044] The second filtered current value of the current is calculated by using the following formula:
[0045] I' fil = b * I cur + (1-b) * I fil_last
[0046] wherein I' fil represents the second filtered current value, b is between 0 and 1, b represents filtering sensitivity, I cur represents the current value of the current, I fil_last represents the last current filtering result;
[0047] After the current value of the current is replaced by the second filtered current value, the current whose current value is replaced by the second filtered current value is taken as the second filtered current.
[0048] In a second aspect, the present application provides a current software filtering system, the system comprises:
[0049] A deviation calculation module is configured to sample a current of a motor at a current time, obtain a historical current sequence of the motor, and calculate a current amplitude deviation between the current and currents in the historical current sequence.
[0050] A deviation discrimination module is configured to construct a maximum deviation threshold of the motor, and discriminate whether the current amplitude deviation is greater than the maximum deviation threshold.
[0051] A difference value calculation module is configured to, when the current amplitude deviation is greater than the maximum deviation threshold, sample a target current sequence from the historical current sequence, calculate a current average value of the target current sequence, and calculate a current-average value difference between each target current in the target current sequence and the current average value.
[0052] A first filtering module is configured to select a maximum difference value from the current-average value difference, perform current first filtering on the current by using the current average value and the maximum difference value, and obtain a first filtered current.
[0053] The second filtering module is used to perform a second current filtering on the current when the current amplitude deviation is not greater than the maximum deviation threshold, so as to obtain a second filtered current.
[0054] Compared with existing technologies, the technical principles and beneficial effects of this solution are as follows:
[0055] This invention, through sampling the motor current at the current time, compares the current with historical currents to determine if the difference between the current and historical currents is too large. It also samples a target current sequence from the historical current sequence, using the historical current as a basis for filtering the current. Furthermore, it performs a first current filter using the average current value and the maximum difference between the two values, employing an averaging method to suppress periodic and random interference. A second current filter, a weighted filter, further suppresses periodic current interference and improves data processing efficiency. This weighted filter can be combined with the aforementioned averaging filter to overcome the limitations of a single algorithm, thereby reducing current fluctuations and improving filtering efficiency. Therefore, the current software filtering method and system proposed in this invention overcome the shortcomings of a single algorithm, reducing current fluctuations and improving filtering efficiency. Attached Figure Description
[0056] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0057] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0058] Figure 1 This is a flowchart illustrating a current software filtering method according to an embodiment of the present invention.
[0059] Figure 2 As shown in one embodiment of the present invention Figure 1 A schematic diagram of one step in a current software filtering method is provided;
[0060] Figure 3 As shown in one embodiment of the present invention Figure 1 A schematic diagram of another step in a current software filtering method is provided;
[0061] Figure 4 A module schematic diagram of a current software filtering system provided by an embodiment of the present application is shown in the figure. DETAILED DESCRIPTION
[0062] It should be understood that the detailed description herein is merely intended to explain the present application, and is not intended to limit the present application.
[0063] The current software filtering method provided by the embodiment of the present application can be executed by software or hardware installed in a terminal device or a server device. The software can be a blockchain platform. The server includes but is not limited to a single server, a server cluster, a cloud server, or a cloud server cluster, etc. The server can be a stand-alone server, or a cloud server providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content distribution networks (CDN), and big data and artificial intelligence platforms, etc. basic cloud computing services.
[0064] Referring to Figure 1 , a flowchart of the current software filtering method provided by an embodiment of the present application is shown. Among them, Figure 1 The current software filtering method described in the detailed description includes:
[0065] S1, sampling the current of the motor at the current time, obtaining the historical current sequence of the motor, and calculating the current amplitude deviation between the current and the current in the historical current sequence.
[0066] The embodiment of the present application samples the current of the motor at the current time, which is used to compare the current with the historical current in the subsequent, so as to determine whether the current is too different from the historical current.
[0067] In an embodiment of the present application, the current of the motor at the current time includes: clamping the phase line of the motor by using a clamp multimeter, and sampling the current of the motor at the current time from the clamp multimeter.
[0068] Among them, the clamp multimeter refers to a multifunctional measuring instrument used for measuring voltage, resistance and current.
[0069] In an embodiment of the present application, referring to Figure 2 , the calculation of the current amplitude deviation between the current and the current in the historical current sequence includes:
[0070] S201, acquire a current time of the current and a history time of the history current sequence;
[0071] S202, select a history current at a previous time of the current from the history current sequence based on the current time and the history time;
[0072] S203, calculate a current amplitude deviation between the current and currents in the history current sequence based on the history current at the previous time by using the following formula:
[0073] I dif =I n -I m
[0074] wherein, I dif represents the current amplitude deviation, I n represents the current, I m represents the history current at the previous time.
[0075] It should be noted that the history current refers to a history current closest to the current in time.
[0076] S2, construct a maximum deviation threshold of the motor, and determine whether the current amplitude deviation is greater than the maximum deviation threshold.
[0077] In an embodiment of the present application, referring to FIG. 1, Figure 3 the construction of the maximum deviation threshold of the motor comprises:
[0078] S301, collect history fault data of the motor;
[0079] S302, identify fault current data from the history fault data;
[0080] S303, calculate a current data difference value between two adjacent fault current data in the fault current data;
[0081] S304, select a maximum current data difference value from the current data difference value;
[0082] S305, take the maximum current data difference value as the maximum deviation threshold.
[0083] S3, when the current amplitude deviation is greater than the maximum deviation threshold, sample a target current sequence from the history current sequence, calculate a current average value of the target current sequence, and calculate a current-average value difference between each target current in the target current sequence and the current average value.
[0084] The embodiment of the present application samples a target current sequence from the historical current sequence for filtering the historical current of the current.
[0085] In an embodiment of the present application, the sampling of the target current sequence from the historical current sequence comprises calculating the sequence number of the target current sequence by using the following formula:
[0086]
[0087] wherein (s1, s2, …, s9, s 10 ) represents the sequence number, r represents the sequence number of the current of the motor at the current time;
[0088] The corresponding historical current of the sequence number in the historical current sequence is taken as the target current sequence.
[0089] In an embodiment of the present application, the calculation of the current average value of the target current sequence comprises calculating the current average value of the target current sequence by using the following formula:
[0090] I avr =(I1+I2+…+I 10 ) / 10
[0091] wherein I avr represents the current average value, (I1, I2, …, I 10 ) represents the target current sequence, and 10 represents the total number of the target current sequence.
[0092] In an embodiment of the present application, the calculation of the current-average value difference between each target current of the target current sequence and the current average value comprises calculating the current-average value difference between each target current of the target current sequence and the current average value by using the following formula:
[0093] ΔI=I i -I avr (i=1, 2, …, 10)
[0094] wherein ΔI represents the current-average value difference, I i represents the target current sequence, I avr represents the current average value, and i represents the sequence number of the target current of the target current sequence.
[0095] S4, selecting the maximum difference value from the current-average value difference, performing current first filtering on the current by using the current average value and the maximum difference value, and obtaining a first filtered current.
[0096] The embodiment of the present application filters the current by using the current average value and the maximum difference value, so as to realize the filtering of the current by using the average method, thereby suppressing the periodic interference and accidental interference.
[0097] In an embodiment of the present application, the filtering of the current by using the current average value and the maximum difference value to obtain the first filtered current comprises: calculating the first filtered current value of the current by using the following formula based on the current average value and the maximum difference value:
[0098] I fil =(I avr *10-I max ) / 9
[0099] wherein, I fil represents the first filtered current value, I avr represents the current average value, and I max represents the maximum difference value.
[0100] After replacing the current value of the current with the first filtered current value, the current with the current value replaced with the first filtered current value is taken as the first filtered current.
[0101] S5, when the current amplitude deviation is not greater than the maximum deviation threshold, filtering the current to obtain a second filtered current.
[0102] The embodiment of the present application filters the current to realize the weighted filtering of the current, so as to suppress the periodic current interference and improve the data processing efficiency, and the weighted filtering can be combined with the aforementioned average filtering method to make up for the shortcomings of a single algorithm, thereby reducing the current fluctuation and improving the filtering efficiency.
[0103] In an embodiment of the present application, the filtering of the current to obtain the second filtered current comprises: calculating the second filtered current value of the current by using the following formula:
[0104] I′ fil =b*I cur +(1-b)*I fil_last
[0105] wherein, I′ fil represents the second filtered current value, b is a value between 0 and 1, b represents the filtering sensitivity, I cur represents the current value of the current, and I fil_last represents the last current filtering result.
[0106] After the current value of the current is replaced by the second filtered current value, the current whose current value is replaced by the second filtered current value is taken as the second filtered current.
[0107] It can be seen that, by sampling the current of the motor at the current time, the current is compared with the historical current in the subsequent, so that whether the current is too different from the historical current can be determined, by sampling the target current sequence from the historical current sequence, the historical current of the current is taken as the basis for filtering the current, by using the current average value and the maximum difference to perform current first filtering on the current, the average method is used to realize the filtering of the current, so that the periodic interference and accidental interference are suppressed, by performing current second filtering on the current, the current is weighted filtered, so that the periodic current interference is suppressed and the data processing efficiency is improved, and the weighted filtering can be combined with the average filtering method, the shortcomings of a single algorithm are made up, so that the current fluctuation is reduced and the filtering efficiency is improved. Therefore, the current software filtering method provided by the embodiment of the application can make up the shortcomings of a single algorithm, so that the current fluctuation is reduced and the filtering efficiency is improved.
[0108] As Figure 4 shown in the figure is a functional module diagram of the current software filtering system of the application.
[0109] The current software filtering system 400 can be installed in an electronic device. According to the functions to be realized, the current software filtering system can include a deviation calculation module 401, a deviation discrimination module 402, a difference calculation module 403, a first filtering module 404 and a second filtering module 405. The modules of the application can also be referred to as units, which refer to a series of computer program segments that can be executed by an electronic device processor and can complete fixed functions, and are stored in the memory of the electronic device.
[0110] In the embodiment of the application, the functions of each module / unit are as follows:
[0111] The deviation calculation module 401 is used to sample the current of the motor at the current time, obtain the historical current sequence of the motor, and calculate the current amplitude deviation between the current and the current in the historical current sequence.
[0112] The deviation discrimination module 402 is used to construct the maximum deviation threshold of the motor, and discriminate whether the current amplitude deviation is greater than the maximum deviation threshold.
[0113] The difference calculation module 403 is configured to, when the current amplitude deviation is greater than the maximum deviation threshold, sample a target current sequence from the historical current sequence, calculate a current average value of the target current sequence, and calculate a current-average value difference between each target current in the target current sequence and the current average value.
[0114] The first filtering module 404 is configured to select a maximum difference value from the current-average value differences, perform current first filtering on the current by using the current average value and the maximum difference value, and obtain a first filtered current.
[0115] The second filtering module 405 is configured to, when the current amplitude deviation is not greater than the maximum deviation threshold, perform current second filtering on the current, and obtain a second filtered current.
[0116] In detail, the modules in the current software filtering system 400 in the embodiments of the present application use the same technical means as the current software filtering method in the above Figures 1 to 3 and can produce the same technical effects, which will not be described here.
[0117] In addition, the functional modules in the embodiments of the present application can be integrated in one processing unit, or each unit can exist physically, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware, or in the form of hardware plus software function modules.
[0118] It is apparent for those skilled in the art that the present application is not limited to the details of the above exemplary embodiments, and the present application can be implemented in other concrete forms without departing from the spirit or essential characteristics of the present application.
[0119] Therefore, no matter from which point of view, the embodiments should be regarded as exemplary and non-limiting, and the scope of the present application is defined by the appended claims rather than the above description, and all changes falling within the meaning and scope of the equivalent elements of the claims are intended to be included in the present application. Any reference signs in the claims should not be regarded as limiting the claims to which they relate.
[0120] It has to be noted that, in the present document, the terms "first", "second", etc. merely serve the purpose of distinguishing between two entities or operations, without necessarily requiring or implying any actual relationship or order between these entities or operations. Moreover, the terms "comprising", "containing" or any other transitional term, do not exclude other elements or steps, but merely specify the presence of the stated elements or steps. The term "comprising" does not exclude that other elements can be added. Further, the term "comprising" or "including" shall not exclude any possibility of including other elements, steps or actions, whether or not these elements, steps or actions are listed in the claims.
[0121] The foregoing is merely illustrative of the principles of this application and various modifications can be made by those skilled in the art without departing from the spirit and scope of the application. The above embodiments are merely illustrative of the principles of this application and various modifications can be made by those skilled in the art without departing from the spirit and scope of the application. The disclosure resides in the claims hereinafter appended.
Claims
1. A current software filtering method, characterized by, The method comprises: sampling the current of the motor at the current time, and obtaining a historical current sequence of the motor, calculating a current amplitude deviation between the current and the current in the historical current sequence; constructing a maximum deviation threshold of the motor, and determining whether the current amplitude deviation is greater than the maximum deviation threshold; when the current amplitude deviation is greater than the maximum deviation threshold, sampling a target current sequence from the historical current sequence, calculating a current average value of the target current sequence, and calculating a current-average value difference between each target current in the target current sequence and the current average value; selecting a maximum difference value from the current-average value difference, and performing current first filtering on the current by using the current average value and the maximum difference value to obtain a first filtered current, comprising: calculating a first filtered current value of the current based on the current average value and the maximum difference value by using the following formula: I fil = (I avr * 10 - I max ) / 9 wherein I fil represents the first filtered current value, I avr represents the current average value, I max represents the maximum difference value; after replacing the current value of the current with the first filtered current value, the current with the current value replaced with the first filtered current value is taken as the first filtered current; when the current amplitude deviation is not greater than the maximum deviation threshold, performing current second filtering on the current to obtain a second filtered current, comprising: calculating a second filtered current value of the current by using the following formula: I' fil = b * I cur + (1 - b) * I fil_last Wherein, I fil represents the second filtered current value, b is valued between 0-1, b represents filtering sensitivity, I cur represents the current value of the current, I fil_last represents the last current filtering result; after replacing the current value of the current with the second filtered current value, the current with the current value replaced with the second filtered current value is taken as the second filtered current.
2. The method of claim 1, wherein, The sampling of the current of the motor at the current time comprises: after clamping the phase line of the motor by using a clamp multimeter, sampling the current of the motor at the current time from the clamp multimeter.
3. The method of claim 1, wherein, The calculation of the current amplitude deviation between the current and the current in the historical current sequence comprises: obtaining the current time of the current and the historical time of the historical current sequence; based on the current time and the historical time, selecting a historical current at a previous time of the current from the historical current sequence; based on the historical current at the previous time, calculating the current amplitude deviation between the current and the current in the historical current sequence by using the following formula: I dif = I n - I m where I dif represents the current amplitude deviation, I n represents the current, I m represents the historical current at the previous time.
4. The method of claim 1, wherein, The construction of the maximum deviation threshold of the motor comprises: collecting historical fault data of the motor; identifying fault current data from the historical fault data; calculating a current data difference value between two adjacent fault current data in the fault current data; selecting a maximum current data difference value from the current data difference value; taking the maximum current data difference value as the maximum deviation threshold.
5. The method of claim 1, wherein, The sampling of the target current sequence from the historical current sequence comprises: calculating a sequence number of the target current sequence by using the following formula: wherein (s1, s2,..., s9, s 10 ) represents the sequence number, and r represents the sequence number of the current of the motor at the current time. taking the historical current corresponding to the sequence number in the historical current sequence as the target current sequence.
6. The method of claim 1, wherein, The calculation of the current average value of the target current sequence comprises: calculating the current average value of the target current sequence by using the following formula: I avr =(I1+I2+…+I 10 ) / 10 Among them, I avr The average current is represented by (I1, I2, ..., I...). 10 ) represents the target current sequence, and 10 represents the total number of the target current sequences.
7. The method of claim 1, wherein, The calculation of the current-average value difference between each target current in the target current sequence and the current average value comprises: A current-average difference value between each target current in the target current sequence and the current average value is calculated using the following formula: ΔI = I i - I avr (i = 1, 2,..., 10) where ΔI denotes the current-average value difference, I i denotes the target current sequence, I avr denotes the current average value, i denotes the sequence number of the target current in the target current sequence.
8. A current software filtering system, characterized by The system comprises: A bias calculation module configured to sample a current of the motor at a current time, obtain a historical current sequence of the motor, and calculate a current amplitude bias between the current and currents in the historical current sequence; A bias discrimination module configured to construct a maximum bias threshold of the motor, and discriminate whether the current amplitude bias is greater than the maximum bias threshold; A difference calculation module configured to, when the current amplitude bias is greater than the maximum bias threshold, sample a target current sequence from the historical current sequence, calculate a current average value of the target current sequence, and calculate a current-average difference value between each target current in the target current sequence and the current average value; A first filtering module configured to select a maximum difference value from the current-average difference values, perform current first filtering on the current using the current average value and the maximum difference value, and obtain a first filtered current, including: A first filtered current value of the current is calculated using the following formula based on the current average value and the maximum difference value: I fil = (I avr * 10 - I max ) / 9 wherein I fil represents the first filtered current value, I avr represents the current average value, I max represents the maximum difference value; After replacing the current value of the current with the first filtered current value, the current with the current value replaced with the first filtered current value is taken as the first filtered current; A second filtering module configured to, when the current amplitude bias is not greater than the maximum bias threshold, perform current second filtering on the current, and obtain a second filtered current, including: A second filtered current value of the current is calculated using the following formula: I' fil = b * I cur + (1 - b) * I fil_last wherein I fil represents the second filtered current value, b is valued between 0 and 1, b represents the filtering sensitivity, I cur represents the current value of the current, I fil_last represents the last current filtering result; After replacing the current value of the current with the second filtered current value, the current with the current value replaced with the second filtered current value is taken as the second filtered current.
Citation Information
Patent Citations
IMAGE PROCESSING APPARATUs and IMAGE PROCESSING METHOD
CN107528995A
Multi-strain-gauge combined measurement method and system
CN111426288A