A method, device and equipment for detecting and repairing outliers of a measurement signal
By using limit parameters and fitted values in an electromechanical servo system to detect and repair outliers in the measurement signal, the problem of poor detection performance in the prior art is solved, and a measurement signal repair effect with low missed detection rate and low false detection rate is achieved.
Patent Information
- Application Number
- CN202310077380.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-01
- Publication Date
- 2025-12-12
- Estimated Expiration
- 2043-02-01
AI Technical Summary
In electromechanical servo systems, existing technologies struggle to accurately identify and effectively repair outliers in measurement signals, leading to problems such as motor malfunctions and rapid acceleration/deceleration, which affect the system's normal lifespan and pose safety hazards.
The outlier detection function based on the limit parameter is used to detect the measurement signal, and the fitted value is used for repair. Combined with the false negative threshold and multiple auxiliary judgment methods, the false negative rate and false negative rate are reduced.
It enables accurate detection and effective repair of measurement signals, reduces the rate of missed detection and false detection, and ensures system stability and security.
Smart Images

Figure CN116127284B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of computer control of electromechanical systems. BACKGROUND
[0002] In electromechanical servo systems, various measuring elements, also known as encoders, are generally used to detect the output signal of the current system and transmit it back to the industrial computer to achieve closed-loop control of the entire system. For example, in a common flight simulation turntable, the measuring element generally includes a code disc or a steel scale. Its function is to measure the rotation angle and convert it into a pulse or digital output signal. Measuring elements can be further divided into absolute and incremental encoders. The absolute encoder has many lines, and at each position of the encoder, a unique binary code from 2 to 2n-1 is obtained by reading each line. The incremental rotary encoder converts the timing and phase relationship of the angle code disc through two photosensitive receiving tubes to obtain the increase or decrease of the angle displacement of the angle code disc. However, during the detection and transmission of the measurement signal, the signal needs to pass through the measuring element, an amplifier, and a signal processor through a cable. Due to the sensor itself and various electromagnetic interferences or contact failures during transmission, the binary measurement signal often has wild values due to the inversion of several bits. The amplitude of these wild values can even exceed the amplitude of the normal signal. If not handled, it will cause the motor to malfunction, rapidly accelerate or decelerate, and affect the tracking of the command signal. It can also produce a large impact, which will affect the normal service life of the entire mechanical system and even cause potential safety hazards. Therefore, it is necessary to detect and repair the wild values in the servo motor system.
[0003] In the detection of wild values, the most common method is fixed threshold detection. However, improper selection of the threshold value can seriously affect the detection effect. The common methods for processing detected measurement signal wild values are as follows: 1. Directly maintain the value at the previous time; 2. Use various filters to filter the signal. The repair effect of directly maintaining the value at the previous time is often unsatisfactory because it only solves the problem of wild values in the measurement signal itself but does not effectively repair the wild values in the difference signal of the measurement signal. The latter adds a filter to the system, which will affect the dynamic characteristics of the system to some extent and cannot completely repair the wild values.
[0004] Therefore, how to provide a method that can accurately judge the wild values of the measurement signal in the electromechanical servo system and better repair the wild values has become a technical problem to be solved in the field. SUMMARY
[0005] In order to solve the technical problems of easy missed judgment and misjudgment in the detection and repair of outliers in the prior art, the present application provides a kind of detection and repair method, device and equipment of measurement signal outlier, and the detection method is based on the outlier determination function of limit parameter to detect outlier, and the repair method adopts the outlier result obtained by detection and is repaired based on fitting value, effectively reduces the missed judgment rate and misjudgment rate, so as to achieve better repair effect.
[0006] A kind of detection method of measurement signal outlier, applied to electromechanical servo system, the method comprises:
[0007] S1, current measurement signal and historical measurement signal are collected;
[0008] S2, limit parameter of the electromechanical servo system is obtained;
[0009] S3, the historical measurement signal and current measurement signal are input to the outlier determination function based on limit parameter, whether the current measurement signal is outlier based on the limit parameter determination.
[0010] Further, step S3 includes:
[0011] S31, the speed at last sampling period is calculated;
[0012] S32, speed threshold is calculated based on the limit parameter and the speed at last sampling period;
[0013] S33, current measurement signal is judged based on the limit parameter and speed threshold, to determine whether it is outlier, if it is determined to be non-outlier, then step S34 is executed for further determination, otherwise it is directly confirmed as outlier;
[0014] S34, current measurement signal is judged based on the limit parameter and speed threshold, to determine whether it is outlier.
[0015] Further, in step S33, when current measurement signal is judged based on the limit parameter and speed threshold, Δv size of margin is supplemented to speed judgment condition, wherein, Δv=2·a max ·Δt, Δt represents time interval, a max represents maximum acceleration;
[0016] In step S34, when current measurement signal is judged based on the limit parameter and speed threshold, Δx size of margin is supplemented to position judgment condition, wherein, Δx=a max ·Δt 2 .
[0017] Further, for non-outlier judged in step S3, further judge as follows:
[0018] S4, inputting the current measurement signal and the historical measurement signal into a fitting function to obtain a current fitting value and a historical fitting value;
[0019] S5, calculating a missed judgment rate for the current measurement signal determined as a non-outlier in step S3;
[0020] S6, comparing the missed judgment rate with a preset missed judgment rate threshold, and if the missed judgment rate is greater than the preset missed judgment rate threshold, inputting the current measurement signal into an outlier judgment function based on the fitting value to perform outlier judgment based on the current fitting value and the historical fitting value.
[0021] Further, step S4 comprises:
[0022] calculating a historical fitting value based on the historical measurement signal;
[0023] calculating a sum of error squares of each historical fitting value and the historical measurement signal;
[0024] decomposing the sum of error squares into a sum of error square matrix;
[0025] calculating the current fitting value based on an optimal function condition.
[0026] Further, performing outlier judgment based on the current fitting value and the historical fitting value, and the judgment condition is:
[0027]
[0028] wherein y_cal represents a fitting obtained current time displacement value, yreal[0] represents a current time measurement signal, percent represents a missed judgment rate, and k and b represent a fitting obtained first order coefficient and constant term coefficient;
[0029] When the above three conditions are met at the same time, it is determined as an outlier.
[0030] A measurement signal outlier repair method applied to a mechatronic servo system, the method comprising:
[0031] collecting a current measurement signal and a historical measurement signal;
[0032] inputting the current measurement signal and the historical measurement signal into a fitting function to obtain a current fitting value and a historical fitting value;
[0033] determining whether the current measurement signal is an outlier by using the above detection method;
[0034] if the current measurement signal is an outlier, performing outlier repair based on the current fitting value and the historical fitting value, otherwise not performing repair.
[0035] A measurement signal outlier repair device, comprising:
[0036] a signal acquisition module, configured to acquire a current measurement signal and a historical measurement signal;
[0037] a preprocessing module, configured to preprocess the current measurement signal and the historical measurement signal;
[0038] a parameter acquisition module, configured to acquire a limit parameter of the electromechanical servo system;
[0039] a determination module, configured to input the preprocessed historical measurement signal and the current measurement signal into a first outlier determination function, and determine whether the current measurement signal is an outlier based on the limit parameter.
[0040] A detection device for measuring signal outliers, comprising:
[0041] a signal acquisition module, configured to acquire a current measurement signal and a historical measurement signal;
[0042] a fitting module, configured to input the current measurement signal and the historical measurement signal into a fitting function to obtain a current fitting value and a historical fitting value;
[0043] a judgment module, configured to determine whether the current measurement signal is an outlier by using the above detection method;
[0044] a repair module, configured to perform outlier repair based on the current fitting value and the historical fitting value if the current measurement signal is an outlier, or not to perform repair.
[0045] An electronic device comprising a processor and a storage device, wherein the storage device stores a plurality of instructions, and the processor is configured to read the plurality of instructions in the storage device and execute the above-mentioned outlier detection method for measuring signals or the above-mentioned outlier repair method for measuring signals.
[0046] The detection and repair method, device and equipment for measuring signal outliers provided by the present application at least have the following beneficial effects:
[0047] (1) The outlier detection method provided by the present application uses the limit parameter of the motor as the main detection method, and simultaneously has an auxiliary detection method based on the fitting value which can be added freely, and comprehensively considers various factors from multiple angles for outlier judgment, and the maximum difference between two points of the measuring signal after detection and repair by using the method is close to 150, and the maximum difference between two points after repair is not more than 0.0008, so that all outliers can be repaired, and the method has excellent effects of low false negative rate and low false positive rate.
[0048] (2) When the wild value detection is performed by using the wild value judgment function based on the limit parameter, a margin size is supplemented in the speed judgment and position judgment processes. By this method, the restriction conditions of the position judgment and the speed judgment are relaxed, the obtained judgment result is more accurate, and the wild value detection misjudgment rate is reduced.
[0049] (3) The signal preliminarily judged as a non-wild value is subjected to a misjudgment rate calculation, and compared with a preset misjudgment rate threshold value. When the misjudgment rate is higher than the preset threshold value, further wild value judgment is performed, so that the wild value is avoided from being misjudged as a non-wild value. Meanwhile, a threshold value judgment is set before the further judgment is performed, so that the calculation resource is saved.
[0050] (4) The wild value repair method provided by the application uses the information of the first five time measurement points to extrapolate the measurement value at the current time based on the fitting value obtained by the fitting function in the wild value detection process. The fitting value calculation is used in the detection and repair processes, so that the calculation amount is saved and a good repair effect is achieved. BRIEF DESCRIPTION OF DRAWINGS
[0051] Figure 1 The flow chart of one embodiment of the measurement signal wild value detection and repair method provided by the application;
[0052] Figure 2 The schematic diagram of one embodiment of the theoretical range of the current speed of the turntable in the measurement signal wild value detection and repair method provided by the application;
[0053] Figure 3 The schematic diagram of one embodiment of the limit acceleration range that can be reached by the turntable in the measurement signal wild value detection and repair method provided by the application;
[0054] Figure 4 The schematic diagram of one embodiment of the error caused by fitting in the measurement signal wild value detection and repair method provided by the application;
[0055] Figure 5 The flow chart of another embodiment of the measurement signal wild value detection and repair method provided by the application;
[0056] Figure 6 The schematic diagram of one embodiment of the original measurement data of the turntable in the measurement signal wild value detection and repair method provided by the application;
[0057] Figure 7 The enlarged schematic diagram of one embodiment of the original measurement data of the turntable in the measurement signal wild value detection and repair method provided by the application;
[0058] Figure 8 The schematic diagram of one embodiment of the comparison of the measurement signals before and after the repair in the measurement signal wild value detection and repair method provided by the application;
[0059] Figure 9 An amplification schematic diagram of a comparison between a measurement signal before repair and a measurement signal after repair in the measurement signal outlier detection and repair method provided by the present application;
[0060] Figure 10 A schematic diagram of a difference between a measurement signal before repair and a measurement signal after repair in an embodiment of the measurement signal outlier detection and repair method provided by the present application.
[0061] The figure mark: 1- feasible area. DETAILED DESCRIPTION
[0062] In order to better understand the above technical solutions, the above technical solutions will be described in detail below in combination with the drawings in the specification and specific embodiments.
[0063] Referring to Figure 1 In some embodiments, a measurement signal outlier detection method is provided, which is applied to an electromechanical servo system, and the method comprises:
[0064] S1, collecting a current measurement signal and a historical measurement signal;
[0065] S2, obtaining a limit parameter of the electromechanical servo system;
[0066] S3, inputting the historical measurement signal and the current measurement signal into an outlier judgment function based on the limit parameter, and judging whether the current measurement signal is an outlier based on the limit parameter.
[0067] As a more preferred embodiment, the electromechanical servo system is a turntable, and the limit parameter includes a maximum speed of the turntable ±v max , a maximum acceleration of the turntable ±a max , and a maximum limit of the turntable ±x max .
[0068] Specifically, in step S3, judging whether the current measurement signal is an outlier based on the limit parameter comprises:
[0069] S31, calculating a speed at a previous sampling period;
[0070] S32, calculating a speed threshold based on the limit parameter and the speed at the previous sampling period;
[0071] S33, performing a speed judgment on the current measurement signal based on the limit parameter and the speed threshold to determine whether it is an outlier, and if it is determined to be a non-outlier, performing step S34 for further determination, otherwise directly confirming it as an outlier;
[0072] S34, judging the current measurement signal based on the limit parameter and the speed threshold to determine whether it is a wild value.
[0073] In a specific application scenario, the electromechanical servo system is a turntable. The wild value judgment function based on the limit parameter is denoted as OutCheckl, which is used to judge the wild value according to the limit parameter of the turntable. Assuming that the maximum speed of the turntable is ±v max , the maximum acceleration is ±a max , and the maximum limit is ±x max .
[0074] Specifically, the judgment function is composed of two layers of if statements. The outer if statement is used to judge the speed, which mainly judges whether the current speed exceeds the limit speed obtained theoretically. For the convenience of the following discussion, we assume that the speed obtained at the last sampling period is real:
[0075]
[0076] where v0 represents the speed value at the last sampling period, yreal[1] represents the position value of the measurement signal at the last sampling period, yreal[2] represents the position value of the measurement signal at the last sampling period, and Δt represents the time interval.
[0077] The current speed of the turntable should not exceed the limit parameter set. However, the current speed of the turntable should not exceed the speed limit that can be reached by accelerating at the maximum acceleration from the speed at the last sampling period. Referring to Figure 2 , the theoretical range of the current speed of the turntable, i.e. the feasible region 1, is the intersection of the above two ranges.
[0078] In step S33, the current measurement signal is judged based on the limit parameter and the speed threshold to determine whether it is a wild value, including the following judgment conditions:
[0079]
[0080] When at least one of the above three conditions is met, it is determined to be a wild value.
[0081] where yreal[0] represents the position value of the measurement signal at the current time, yreal[1] represents the position value of the measurement signal at the last sampling period, and x max represents the maximum limit value.
[0082] If the current measurement signal is determined as non-outlier in step S33, the further outlier detection is continued with the method of step S34. In step S34, the position of the current measurement signal is determined by judging whether the current position signal of the turntable can reach the position limit within one sampling period, i.e. whether the current position signal is within the position limit that the turntable can reach.
[0083] Here, we first discuss two simplest cases, i.e. the velocity at the last sampling period will not exceed the maximum velocity even if it is accelerated or decelerated with the maximum acceleration for one sampling period, and it is easy to know that the current signal is an outlier when the following conditions are met:
[0084]
[0085] However, if the current velocity can reach the maximum velocity within no more than one period, as shown in Figure 3 , the position limit that can be reached will also be reduced because the turntable cannot maintain the maximum acceleration to accelerate for one sampling period.
[0086] After analysis, considering the above two cases, if the current measurement signal meets the following conditions, it can be determined that the current measurement signal is an outlier. In step S34, the position of the current measurement signal is determined based on the limit parameter and the velocity threshold to determine whether it is an outlier, and the determination conditions include:
[0087]
[0088] When at least one of the above two conditions is met, it is determined to be an outlier.
[0089] In fact, the velocity v0 used by us may not be accurate because the value at the last sampling period is likely to be an outlier point, and the position value at the last sampling period is obtained by fitting repair or extrapolation repair. We consider the limit case as shown in Figure 4 . Among them, v -1 is the velocity at the last sampling period, v -1 +a max Δt is the actual velocity at the last sampling period, v -1 -a max Δt is the fitted velocity at the last sampling period, v -1 +2a max Δt is the actual current velocity, v -1 -2a max Δt is the fitted current velocity.
[0090] It can be seen that the velocity at the last sampling period used by us and the actual velocity at the last sampling period can have a maximum difference of Δv = 2 · amax • At, while the actual difference between the current position we use and the position at the last sampling period, and the real difference between the current time and the position at the last sampling period, can differ at most by Ax = a max • At 2 . The actual difference between the current position we use and the fitted current position can differ at most by Ax * = 4-a max • At 2 . To this end, in the above judgment logic, a margin of size Av needs to be added to the velocity judgment, and a margin of size Ax needs to be added to the position judgment.
[0091] Therefore, as a preferred embodiment, in step S33, when judging the current measurement signal by velocity, a margin of size Av = 2-a max • At is added to the velocity judgment condition; in step S34, when judging the current measurement signal by position, a margin of size Ax = a max • At is added to the position judgment condition. 2 .
[0092] Specifically, for the velocity judgment condition of the outer if statement, a margin of size Av is added or subtracted from the right side of the inequality; for the position judgment condition of the inner if statement, a margin of size Ax is added or subtracted from the right side of the inequality. The sign of addition or subtraction depends on the inequality, subtract if it is a greater than sign, and add if it is a less than sign. In this way, the restriction conditions of position judgment and velocity judgment are relaxed, and the resulting judgment result is more accurate, reducing the false detection rate of wild values.
[0093] Referring to Figure 5 , as a preferred embodiment, for the current measurement signal judged as a non-wild value in step S3, further judgment is made as follows:
[0094] S4, input the current measurement signal and the historical measurement signal into a fitting function to obtain a current fitting value and a historical fitting value;
[0095] S5, calculate a missed judgment rate for the current measurement signal judged as a non-wild value in step S3;
[0096] S6, compare the missed judgment rate with a preset missed judgment rate threshold value, if greater than the preset missed judgment rate threshold value, input the current measurement signal into a wild value judgment function based on fitting values, and judge the wild value based on the current fitting value and the historical fitting value.
[0097] Specifically, step S4 includes:
[0098] S41, calculate a historical fitting value based on the historical measurement signal;
[0099] S42, calculate the error sum of squares of each historical fitting value and historical measured signal;
[0100] S43, decompose the error sum of squares into error sum of squares matrix;
[0101] S44, based on the optimal function condition, calculate the current fitting value.
[0102] In step S41, the program uses the measured values of the first five time points: y[] = {yreal[5], yreal[4], yreal[3], yreal[2], r_real[1]} and x[] = {1, 2, 3, 4, 5} to perform a polynomial fitting based on the least squares method. Assume the fitting polynomial is:
[0103]
[0104] In step S42, calculate the error sum of squares between the historical fitting value obtained by fitting and the real historical measured signal, which is represented by the following formula:
[0105]
[0106] Where f(x i ) is the i-th historical fitting value obtained by fitting, y i is the i-th real historical measured signal value.
[0107] In step S43, decompose the error sum of squares into matrix form, which is:
[0108]
[0109] S = (X v θ - Y r ) T (X v θ - Y r )
[0110] In step S43, at this time, for the optimal function, it should satisfy:
[0111]
[0112] Finally, the polynomial coefficient can be obtained as:
[0113]
[0114] The polynomial coefficients obtained by fitting are stored in the result array, k stores the coefficient of the linear term, and b stores the constant term coefficient. The fitting order in the program is set to 1, considering that the actual turntable cannot produce too complex motion in a short time, and the user can also change the fitting order as needed. The current fitting value obtained by calculation represents the theoretical current measurement signal value, so if the difference between the actual current measurement signal value and the theoretical current measurement signal value is too large, it means that the current measurement point is likely to be an outlier point.
[0115] In step S5, the missed judgment rate of the current measurement signal is calculated by the following formula:
[0116]
[0117]
[0118]
[0119]
[0120] wherein percent represents the missed judgment rate of the current measurement signal, v0 represents the speed value at the previous sampling period, yreal[1] represents the position value of the measurement signal at the previous sampling period, yreal[0] represents the position value of the measurement signal at the current time, x max represents the maximum limit value, a max represents the maximum acceleration value, v max represents the maximum speed value, and Δt represents the time interval.
[0121] As can be seen from step S5, in a specific application scenario, in OutCheck1, if the current measurement signal is determined to be an outlier, 1 is returned, but when it is not determined to be an outlier, the program not only returns 0, but also returns a missed judgment rate percent. The significance of the missed judgment rate is to measure the degree to which the measurement value at the current time approaches the limit value. For a measurement value, obviously the higher the missed judgment rate, the more likely it is to be an outlier and be missed by us. Therefore, when using other judgment logic for auxiliary judgment, percent>50% is limited to take effect, that is, the missed judgment rate threshold is set to 50%, which is set from the perspective of reducing the false positive rate. Because if the current difference is far from the limit value, it is most likely a point of sudden change in normal signals, rather than an abnormal point.
[0122] In step S6, outlier judgment is performed based on the current fitting value and the historical fitting value, and the judgment condition is:
[0123]
[0124] wherein y cal represents the fitted displacement value at the current time, y real [0] represents the measured signal at the current time, a max represents the maximum acceleration, percent represents the false rejection rate, k and b represent the fitted first-order coefficient and constant coefficient;
[0125] When the above three conditions are met simultaneously, it is determined as a wild value.
[0126] In some embodiments, when further wild value judgment is performed, two wild value judgment methods are additionally provided to assist in judgment, and a variety of methods are combined to judge and repair the wild value of the sensor measurement signal of the electromechanical servo system. Taking a turntable as an example, four wild value judgment methods are designed. First, a wild value judgment method based on the limit parameters of the turntable is used. By analyzing the relationship between the current speed of the turntable and the limit parameters of the turntable, the judgment result is given, and the false rejection rate is also given to facilitate the use of other methods. This judgment method is closely related to the limit capability of the turntable, which can minimize the false rejection rate and ensure that the selected measurement points are wild value points. The remaining three wild value judgment methods are as follows: (1) using the system dynamic error coefficient, a judgment method by analyzing the difference between the current error and the theoretical error of the system; (2) using the nominal model of the system, a judgment method by analyzing the difference between the current output of the system and the theoretical output calculated by the nominal model; (3) using the measurement values of the system at previous times to fit the current time, and then analyzing the difference between the fitted value at the current time and the real measurement value of the system. By combining the use of multiple judgment methods, the results obtained are logically operated, which can maximize the strengths and weaknesses and make the best use of various available information.
[0127] As a more preferred embodiment, the method further comprises: comparing the false rejection rate with a preset false rejection rate threshold value, if greater than the preset false rejection rate threshold value, obtaining a measurement instruction signal, and inputting the current measurement signal into a wild value judgment function based on a system nominal model and a wild value judgment function based on a system dynamic error, and logically operating the judgment results with the results obtained in step S6 to obtain a final wild value judgment result.
[0128] The wild value judgment function based on the system dynamic error is OutCheck2, which requires the dynamic error coefficient of the system and the measurement instruction signal. The steady-state error when the measurement instruction signal is a step signal, a ramp signal and an acceleration signal can be used to determine the dynamic error coefficient. Assuming that the dynamic error coefficient of the system is known, which is c0, c1 and c2, according to the classical control theory, the steady-state error of the system under the action of any instruction signal is:
[0129] esscal=c0·x0+c1·v0+c2·a0;
[0130] Wherein, x0, v0, a0 are instruction signal, first order derivative signal of instruction and second order derivative signal of instruction respectively at current time of system, in specific implementation, the application uses difference to replace. The recent ten times of theoretical error values are stored in esscal[], and the maximum value is stored in essjudge. If the actual error value at current time is more than twice of the maximum value in the ten times of theoretical error values, the measurement value at current time is considered as wild value. The wild value is determined when the following conditions are met simultaneously:
[0131]
[0132] Wherein, esscal is theoretical steady-state error value, essjudge is maximum value of theoretical steady-state error, and ess represents actual error value at current time.
[0133] The wild value determination function based on nominal model of system is OutCheck3, using the method needs to know the nominal model of system, and the nominal model is discretized to obtain difference equation, and then the function relationship between current measurement signal and past measurement and instruction signal is obtained, so that the theoretical measurement signal can be obtained by calculation. The difference between current and previous 9 times of actual measurement signal and theoretical calculation measurement signal is saved in deltaout[], and maxdeltaout is the maximum value in the previous 9 times of difference. We think that if the difference between the measurement value at current time and the theoretical measurement value is more than twice of the maximum value in the previous nine times of difference. The wild value is determined when the following conditions are met simultaneously:
[0134]
[0135] In some embodiments, a measurement signal wild value repairing method is also provided, applied to an electromechanical servo system, the method comprising:
[0136] Acquiring current measurement signal and historical measurement signal;
[0137] Inputting the current measurement signal and the historical measurement signal into a fitting function to obtain current fitting value and historical fitting value;
[0138] Determining whether the current measurement signal is a wild value by using the detection method described above;
[0139] If the current measurement signal is a wild value, repairing the wild value based on the current fitting value and the historical fitting value, otherwise, no repairing is performed.
[0140] Specifically, the measurement signal wild value repairing method provided by the embodiment uses the fitting value obtained by the fitting function to repair the wild value, which can achieve better repairing effect.
[0141] As a preferred embodiment, the repair method uses the information of the first five time measurement points to extrapolate the current time measurement value, the first order coefficient and constant term coefficient obtained by fitting the measurement values of the first five time are k and b respectively, if the current measurement value is an outlier, the following repair value is used for repair:
[0142] y corrected = 6 k + b
[0143] wherein y corrected represents the measurement value of the current time obtained after repair.
[0144] In a specific application scenario, to verify the effectiveness of the outlier detection method provided in this embodiment, the detection program is used to repair the actual measurement signal of ET3130A turntable, the turntable command signal is maintained in the original position after power-on, such as Figure 6 and 7 The actual measured turntable measurement signal is shown, it can be seen that due to interference and poor contact, the measurement signal is loaded with many outliers, which can reach about twice the original signal. The limit parameter of the turntable is v max = 300 ° / s, a max = 2000 ° / s, x max = 360 °. The sampling period is 0.5 ms, the sampling point number is 90299, and the method introduced in the present application is used to repair the data.
[0145] In this example, the turntable limit parameter judgment method OutCheck1 and the judgment method OutCheck4 based on the fitting value are used for outlier detection, and the detected outliers are repaired. h is used as the sampling period, and its value is set to 0.0005. At each sampling time, the currently collected measurement signal is input into the program, and the measurement signal is input into the compute function as the parameter y_cur. Since we do not use the command signal, the second parameter r_cur of compute can be ignored, and the default value 0 is automatically maintained. The data returned after repair, i.e. the return value of the compute function, is saved and plotted to observe the results.
[0146] The comparison results of the signals before and after repair are shown in Figure 8 and 9 It can be seen that all obvious outliers are repaired without omission and misjudgment, and there is no divergence, and the repair effect is very excellent. The enlarged view of Figure 9 is shown in Figure 8 In order to more intuitively show the repair effect, Figure 10The difference value of the original signal and the repaired signal, i.e. the displacement difference value between two points, can be seen that the difference value between two points before repair reaches nearly 150, while the difference value between two points after repair does not exceed 0.0008. It can be said that all outliers are repaired, because the difference value with a magnitude below 0.001 is within the system limit capability, and it is completely possible to be a normal measurement signal, and at this time, it should not be repaired. Figures 8-10 From the all-around performance, it can be seen that the method provided by the application has low missed judgment rate and low misjudgment rate.
[0147] In some embodiments, a device for repairing outliers of a measurement signal is provided, comprising:
[0148] a signal acquisition module, configured to acquire a current measurement signal and a historical measurement signal;
[0149] a preprocessing module, configured to preprocess the current measurement signal and the historical measurement signal;
[0150] a parameter acquisition module, configured to acquire a limit parameter of the electromechanical servo system;
[0151] a determination module, configured to input the preprocessed historical measurement signal and the current measurement signal into a first outlier determination function, and determine whether the current measurement signal is an outlier based on the limit parameter.
[0152] In some embodiments, a device for detecting outliers of a measurement signal is provided, comprising:
[0153] a signal acquisition module, configured to acquire a current measurement signal and a historical measurement signal;
[0154] a fitting module, configured to input the current measurement signal and the historical measurement signal into a fitting function to obtain a current fitting value and a historical fitting value;
[0155] a judgment module, configured to determine whether the current measurement signal is an outlier by using the above-mentioned detection method;
[0156] a repair module, configured to perform outlier repair based on the current fitting value and the historical fitting value if the current measurement signal is an outlier, and not to perform repair otherwise.
[0157] In some embodiments, an electronic device is provided, comprising a processor and a storage device, wherein the storage device has a plurality of instructions stored therein, and the processor is configured to read the plurality of instructions in the storage device and execute the above-mentioned outlier detection method of a measurement signal or the above-mentioned outlier repair method of a measurement signal.
[0158] While the preferred embodiments of the application have been described, additional variations and modifications can be made to these embodiments by those skilled in the art once they have the benefit of the present disclosure without departing from the spirit and scope of the application. Accordingly, it is intended that the appended claims include all such variations and modifications as fall within the scope of the present application. It is apparent that those skilled in the art can modify and adapt the present application in various ways without departing from the spirit and scope of the present application. It is therefore intended that the present application encompass all such modifications and variations as fall within the scope of the claims and their equivalents.
Claims
1. A method for detecting outliers of a measurement signal, applied to an electromechanical servo system, characterized in that The method comprises: S1, collecting current measurement signals and historical measurement signals; S2, obtaining limit parameters of the electromechanical servo system; S3, inputting the historical measurement signals and the current measurement signals into a wild value judgment function based on the limit parameters, and judging whether the current measurement signals are wild values based on the limit parameters; Step S3 comprises: S31, calculating the speed at the last sampling period; S32, calculating a speed threshold based on the limit parameters and the speed at the last sampling period; S33, performing speed judgment on the current measurement signals based on the limit parameters and the speed threshold to determine whether it is a wild value, if it is determined to be a non-wild value, performing further judgment in step S34, otherwise directly confirming it as a wild value; S34, performing position judgment on the current measurement signals based on the limit parameters and the speed threshold to determine whether it is a wild value; In step S33, when speed determination is performed on the current measurement signal, the speed determination condition is supplemented a margin of size, wherein , denotes the time interval, a max denotes the maximum acceleration; In step S34, when the position is determined from the current measurement signal, the position determination condition is supplemented of the size of the margin, wherein .
2. The method of claim 1, wherein, For the non-wild value determined in step S3, further judgment is made as follows: S4, inputting the current measurement signals and the historical measurement signals into a fitting function to obtain current fitting values and historical fitting values; S5, calculating a missed judgment rate for the current measurement signals determined as non-wild values in step S3; S6, comparing the missed judgment rate with a preset missed judgment rate threshold, if it is greater than the preset missed judgment rate threshold, inputting the current measurement signals into a wild value judgment function based on the fitting values, and performing wild value judgment based on the current fitting values and the historical fitting values.
3. The method of claim 2, wherein, Step S4 comprises: calculating historical fitting values based on the historical measurement signals; calculating error sum of squares of each historical fitting value and the historical measurement signals; decomposing the error sum of squares into an error sum of squares matrix; obtaining the current fitting value based on the optimal function condition.
4. The method of claim 3, wherein, Perform wild value judgment based on the current fitting values and the historical fitting values, and the judgment condition is: ; Wherein, y_cal represents the fitting obtained current time displacement value, yreal[0] represents the measurement signal at the current time, percent represents the missed judgment rate, k and b represent the fitting obtained first term coefficient and constant term coefficient; When the above three conditions are met at the same time, it is determined to be a wild value.
5. A method for repairing outliers of a measurement signal, applied to an electromechanical servo system, characterized in that, The method comprises: collecting current measurement signals and historical measurement signals; inputting the current measurement signals and the historical measurement signals into a fitting function to obtain current fitting values and historical fitting values; using the detection method of any one of claims 1-4 to determine whether the current measurement signals are wild values; if the current measurement signals are wild values, performing wild value repair based on the current fitting values and the historical fitting values, otherwise not performing repair.
6. An apparatus for repairing outliers of a measurement signal, characterized by It comprises: a signal collection module for collecting current measurement signals and historical measurement signals; a preprocessing module for preprocessing the current measurement signals and the historical measurement signals; a parameter acquisition module for obtaining limit parameters of an electromechanical servo system; a judgment module for inputting the preprocessed historical measurement signals and the current measurement signals into a first wild value judgment function, and judging whether the current measurement signals are wild values based on the limit parameters; Specifically comprising: S31, calculating the speed at the last sampling period; S32, calculating a speed threshold based on the limit parameter and the speed at the last sampling period; S33, judging the current measurement signal based on the limit parameter and the speed threshold to determine whether it is a wild value, if it is determined to be a non-wild value, performing step S34 for further determination, otherwise directly confirming it as a wild value; S34, judging the current measurement signal based on the limit parameter and the speed threshold to determine whether it is a wild value; In step S33, when the speed determination is made on the current measurement signal, the speed determination condition is supplemented with a margin of size, wherein , denotes the time interval, a max denotes the maximum acceleration; In step S34, when the position is determined from the current measurement signal, the position determination condition is supplemented of the size of the margin, wherein .
7. An apparatus for detecting outliers in a measurement signal, characterized by The method comprises the steps of: a signal acquisition module for acquiring a current measurement signal and a historical measurement signal; a fitting module for inputting the current measurement signal and the historical measurement signal into a fitting function to obtain a current fitting value and a historical fitting value; a judging module for judging whether the current measurement signal is a wild value by using the detection method of any one of claims 1-4; a repairing module for repairing the wild value based on the current fitting value and the historical fitting value if the current measurement signal is a wild value, otherwise not repairing.
8. An electronic device comprising a processor and a storage device, characterized in that, The storage device has a plurality of instructions, and the processor is used for reading the plurality of instructions in the storage device and executing the wild value detection method of the measurement signal according to any one of claims 1-4 or the wild value repairing method of the measurement signal according to claim 5.
Citation Information
Patent Citations
Data cleaning method based on regression model
CN112817955A
Outlier elimination method and system based on fuzzy prediction system, and computer related product
CN112965965A