Current detection and overcurrent protection method and system based on AKF

Through the adaptive Kalman filtering algorithm and real-time overcurrent protection algorithm, the noise interference problem of current detection in the intelligent distribution box system is solved, and high-precision and fast response current detection and protection are achieved, improving the stability and reliability of the system.

CN120453969APending Publication Date: 2025-08-08HEFEI HEAN MACHINERY MFG
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510468666.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-15
Publication Date
2025-08-08

AI Technical Summary

Technical Problem

In the existing intelligent power distribution box system, current detection is susceptible to high-frequency noise, temperature drift and electromagnetic interference, resulting in a decrease in measurement accuracy. Traditional overcurrent protection systems are prone to false alarms or missed under dynamic load changes or noise interference, affecting the reliability and stability of the system.

Method used

The adaptive Kalman filtering algorithm (AKF) is used for current signal processing, combined with real-time overcurrent protection algorithm, and adaptively adjust the noise covariance matrix and dynamic current threshold, noise suppression and accurate estimation of the current signal are achieved, and classified alarms and protection are performed.

Benefits of technology

It improves the accuracy and anti-interference ability of current detection, ensures that the system responds quickly to current abnormalities in complex environments, reduces false alarms and missed alarms, and improves the stability and reliability of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120453969A_ABST
    Figure CN120453969A_ABST
Patent Text Reader

Abstract

The invention discloses a current detection and overcurrent protection method and system based on an AKF, and belongs to the field of intelligent current detection. The method comprises the following steps: collecting a current signal; processing the current signal based on an adaptive Kalman filter (AKF) algorithm; and performing overcurrent judgment on the current output by the AKF, and performing graded alarm and protection according to the overcurrent degree. According to the invention, noise suppression and accurate estimation of the current signal are realized through the adaptive Kalman filtering algorithm, and the stability and robustness of the system are improved; through a real-time over-current protection algorithm, current abnormity is rapidly responded and alarmed, and safe operation of the system is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of intelligent current detection, and in particular relates to a current detection and overcurrent protection method and system based on AKF. Background Art

[0002] With the rapid development of power electronics technology, intelligent distribution box systems have been widely used in modern power systems. These systems ensure the safe and stable operation of power systems by monitoring key parameters such as current and voltage in real time. However, current detection, as one of the core functions of intelligent distribution box systems, faces numerous challenges. First, current samplers are susceptible to high-frequency noise, temperature drift, and electromagnetic interference, resulting in reduced measurement accuracy. This error is particularly amplified under high currents or complex operating conditions. Second, traditional overcurrent protection systems typically use a fixed threshold comparison method, triggering protection when the current exceeds a set threshold. However, this method is prone to false alarms or missed alarms under dynamic load changes or noise interference, compromising system reliability. Therefore, effectively addressing noise interference during detection becomes crucial for improving system stability and reliability.

[0003] In current detection applications in complex power grid environments, traditional current detection algorithms such as sliding average filtering and fixed-parameter Kalman filtering still face the following key challenges: First, these algorithms have limited anti-interference capabilities and cannot automatically adjust filtering parameters based on dynamically changing noise characteristics, resulting in a significant decrease in detection accuracy in high-noise environments; second, their relatively slow convergence speed makes it difficult to meet the requirements of rapid overcurrent protection when current suddenly changes; finally, these fixed-parameter filtering algorithms experience significant performance degradation when faced with operating conditions such as drastic load changes or unstable noise characteristics, seriously affecting the reliability and stability of intelligent distribution systems.

[0004] To this end, the present invention proposes a current detection and overcurrent protection method and system based on AKF. Summary of the Invention

[0005] The present invention aims to overcome the shortcomings of the existing technology and proposes a current detection and overcurrent protection method and system based on AKF to achieve the following purposes: noise suppression and accurate estimation of current signals are achieved through an adaptive Kalman filter algorithm, thereby improving the stability and robustness of the system; and a real-time overcurrent protection algorithm is used to quickly respond to and alarm current anomalies, thereby ensuring the safe operation of the system.

[0006] In order to achieve the above object, the technical solution adopted by the present invention is: a current detection and overcurrent protection method based on AKF, the method comprising the following steps:

[0007] Step S1, collecting current signals;

[0008] Step S2, processing the current signal based on an adaptive Kalman filter algorithm AKF;

[0009] Step S3: determine if the current output by the AKF is overcurrent, and perform graded alarm and protection according to the degree of overcurrent.

[0010] Preferably, the step S2 includes:

[0011] (1) Based on the state estimate of the system at the previous moment, the state of the system at the current moment is predicted a priori through the state transfer matrix to obtain the a priori estimate of the state variable and its corresponding a priori covariance matrix:

[0012] The system state prediction is performed as follows:

[0013] X(k|k-1)=f[X(k-1|k-1),U(k-1)]+q(k-1);

[0014] f[X(k-1|k-1),U(k-1)]=A·X(k-1|k-1)+C·U(k-1);

[0015] Y(k)=g[X(k|k-1),U(k)]+r(k-1);

[0016] g[X(k|k-1),U(k)]=C·X(k|k-1);

[0017] Where X(k / k-1) represents the prior estimate of the state variable at time k based on the information at time k-1; X(k-1 / k-1) represents the state variable at time k-1; f(·) represents the state transfer function, A represents the state transfer matrix, and C represents the input matrix; U(k-1) represents the input at time k-1; q(k-1) represents the mean vector of the system process noise at time k-1; Y(k) represents the output; g(·) represents the measurement function; and r(k-1) represents the mean vector of the measurement noise.

[0018] Calculate the current covariance equation;

[0019] P(k|k-1)=A×P(k-1|k-1)×A T +Q(k-1);

[0020] Where P(k / k-1) represents the error covariance matrix of the prior estimate at time k based on the information at time k-1; P(k-1 / k-1) represents the actual error covariance matrix at time k-1; A represents the state transition matrix; Q(k-1) represents the system process noise covariance matrix;

[0021] (2) Calculate the dynamic Kalman gain, that is:

[0022] K g (k)=P(k|k-1)×C T / [C×P(k|k-1)×C T +R s (k-1)];

[0023] Among them, K g (k) represents the Kalman gain, which is used to balance the weights of the predicted value and the actual measured value; R s (k-1) represents the measurement noise covariance matrix;

[0024] (3) Measure the new information ε(k), that is:

[0025] ε(k)=Y(k)-g[X(k|k-1),U(k)]-r(k-1);

[0026] Where g(·) represents the measurement function, which is used to express the relationship between X(k / k-1) and U(k); Y(k) represents the output; r(k-1) represents the mean value of the measurement noise;

[0027] (4) Correct the state equation through new information:

[0028] X(k|k)=X(k|k-1)+θ(k)×K g (k)×ε(k);

[0029] Where X(k|k) represents the posterior estimate of the state variable X at time k; θ(k) represents the gain factor at time k, and is: θ(k) = h[ε(k),T], where h represents the relationship function between the innovation error ε(k) and the temperature T;

[0030] The modified covariance equation is:

[0031] P(k|k)=[1-K g (k) × C] × P(k|k-1);

[0032] Where P(k|k) is the posterior estimation error covariance matrix at time k;

[0033] (5) Perform noise characteristic iteration, and the noise parameters are dynamically estimated as follows:

[0034] q(k)=[1-d(k-1)]×q(k-1)+d(k-1)×{X(k|k-1)-fX(k-1|k-1),U(k-1)]};

[0035] Establish a measurement noise mean feedback compensation mechanism to update the measurement noise parameters in real time:

[0036] r(k)=[1-d(k-1)]×r(k-1)+d(k-1)×{Y(k)-g[X(k|k-1),U(k)]};

[0037] Adopt exponentially weighted recursive algorithm to adaptively adjust the covariance matrix:

[0038]

[0039] Among them, d(k-1) represents the weighting coefficient, which is:

[0040]

[0041] Where b represents the forgetting factor, which ranges from 0.9 to 1. By adjusting the forgetting factor, the weighting coefficient is adjusted to adaptively modify the covariance matrix.

[0042] Preferably, step S3 includes:

[0043] Set the current threshold to judge the overcurrent of the AKF output current;

[0044] Among them, the initial current threshold is first set according to the load type and historical current data;

[0045] Then, the current data is statistically analyzed by setting a sliding window. That is, a time window is constructed as a data buffer, and the instantaneous current values within the window are continuously stored from the data buffer, including the sliding mean, standard deviation, and peak-to-peak value.

[0046] Finally, based on the statistical results of the sliding window, the current threshold is dynamically corrected.

[0047] Preferably, the dynamic correction of the threshold value includes:

[0048] When the detected standard deviation is greater than the preset maximum standard deviation, or the peak-to-peak value is greater than the preset maximum peak-to-peak value, the system determines that it is a noise interference or load transient state. At this time, the current threshold floating mechanism is triggered, and the initial current threshold is adjusted to the initial value multiplied by n, where n is greater than 1;

[0049] When it is detected that the standard deviation is less than the preset minimum standard deviation and the peak-to-peak value is less than the preset minimum peak-to-peak value, the system is determined to be in a steady-state operation state and maintains the initial current threshold.

[0050] Preferably, the dynamic correction of the threshold is achieved through a state machine.

[0051] Preferably, the current threshold includes a first current threshold and a second current threshold. When the real-time current value is ≤ the first current threshold, it is determined that there is no overcurrent risk; when the first current threshold is < the real-time current value < the second current threshold, it is determined to be a potential overcurrent risk, and a first-level alarm and response are initiated; when the real-time current value is ≥ the second current threshold, it is determined to be a serious overcurrent fault, and a second-level alarm and response are initiated.

[0052] Preferably, the first-level alarm and response includes driving the buzzer to emit intermittent alarm sounds and synchronously controlling the LED to flash, thereby forming a human-computer interaction alarm signal.

[0053] Preferably, the secondary alarm and response includes immediately cutting off the load power supply circuit, and recording and reporting fault information.

[0054] At the same time, the present application also proposes a current detection and overcurrent protection system based on AKF, which includes a current acquisition module, a temperature acquisition module, a control module, and an alarm response module, wherein the control module is connected to the current acquisition module, the alarm response module, and the temperature acquisition module respectively;

[0055] The current acquisition module includes a shunt resistor, a filter, and an amplifier connected in series. The current collected by the shunt resistor is filtered by the filter and amplified by the amplifier before being sent to the control module.

[0056] The alarm response module includes a buzzer, an LED, and a fixed relay, wherein the buzzer, the LED, and the fixed relay are respectively connected to the control module; the fixed relay is connected in series in the load power supply circuit, and its control end is connected to the control module;

[0057] The control module includes an ADC, multiple communication interfaces, a DMA controller, a control center, and a PWM drive unit, wherein the control center is connected to the ADC, the DMA controller, the PWM drive unit, and the multiple communication interfaces respectively. The control center is used to perform AKF-based current detection based on the collected current and temperature data, and send a control signal to the alarm response module when overcurrent protection is triggered;

[0058] The ADC is also connected to the amplifier, and is used to collect current data and send it to the control center. The control center stores the collected current data in the control center memory through the DMA controller; the PWM drive unit is also connected to the buzzer and LED respectively, and is used to generate PWM signals to drive the buzzer and LED to alarm; the multiple communication interfaces include a CAN interface, a GPIO interface, and an I2C interface, wherein the CAN interface, GPIO interface, and I2C interface are respectively connected to the control center, and the GPIO interface is connected to the control end of the fixed relay, and is used to forward the control signal of the control center to the fixed relay to control the on and off of the load power supply circuit; the CAN interface is used to communicate with external devices to upload fault information, and the external devices include the vehicle controller; the I2C interface is connected to the temperature acquisition module, collects temperature and sends it to the control center.

[0059] Preferably, the control module adopts an STM32F407IGT6 microcontroller.

[0060] The technical effects of the present invention are:

[0061] (1) An adaptive Kalman filter algorithm was designed to improve the current detection accuracy by dynamically adjusting the noise covariance matrix. Especially in complex power grid environments, it can effectively suppress the high-frequency noise in the current signal and enhance the system's anti-interference ability and robustness.

[0062] (2) A real-time overcurrent protection algorithm was designed. Combined with real-time current detection, the system can quickly respond to current anomalies and avoid system damage caused by excessive current. The algorithm has strong adaptability in load changes and noisy environments, can effectively reduce false alarms and missed alarms, and improve the reliability of overcurrent protection.

[0063] (3) The STM32F407 microcontroller is used for real-time data processing. The high-performance ADC module and DMA technology of the STM32F407 microcontroller ensure the rapid acquisition and real-time transmission of current signals. At the same time, through its efficient computing power, it supports the smooth implementation of the adaptive Kalman filter algorithm and the real-time overcurrent protection algorithm. BRIEF DESCRIPTION OF THE DRAWINGS

[0064] Figure 1 Flowchart of the adaptive Kalman filter algorithm provided by an embodiment of the present invention;

[0065] Figure 2 A comparison chart of filtering effects in a noisy environment provided by an embodiment of the present invention;

[0066] Figure 3 A flow chart of a real-time overcurrent protection algorithm provided by an embodiment of the present invention;

[0067] Figure 4A schematic diagram of the structure of a current detection and overcurrent protection system based on AKF provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0068] The following is a further detailed description of the specific embodiments of the present invention through the description of the embodiments with reference to the accompanying drawings. The purpose is to help those skilled in the art have a more complete, accurate and in-depth understanding of the inventive concept and technical solution of the present invention and to facilitate its implementation. It should be noted that the terms "first" and "second" described in this application are only used to facilitate the description of the technical solution to distinguish different components and are not intended to limit this application. To make the technical solution of the present invention clearer, the present invention is explained through the following embodiments.

[0069] This embodiment provides a current detection and overcurrent protection method based on AKF, the method comprising the following steps:

[0070] Step S1, collecting current signals;

[0071] Step S2, processing the current signal based on an adaptive Kalman filter algorithm AKF;

[0072] Step S3: determine if the current output by the AKF is overcurrent, and perform graded alarm and protection according to the degree of overcurrent.

[0073] Specifically, in step S2 of this embodiment, the core process of the adaptive Kalman filter algorithm AKF is as follows: Figure 1 Shown, including:

[0074] (1) Set the initial parameters required for the operation of the adaptive Kalman filter algorithm, including the initial estimated values of the state variables, the initial covariance matrix, etc. Then, based on the state estimated value of the system at the previous moment (including the state vector and covariance matrix), the state of the system at the current moment is predicted a priori through the state transfer matrix to obtain the a priori estimated value of the state variable and its corresponding a priori covariance matrix:

[0075] The system state prediction is performed as follows:

[0076] Equation of state:

[0077] X(k|k-1)=f[X(k-1|k-1),U(k-1)]+q(k-1);

[0078] f[X(k-1|k-1),U(k-1)]=A·X(k-1|k-1)+C·U(k-1);

[0079] Measurement equation:

[0080] Y(k)=g[X(k|k-1),U(k)]+r(k-1);

[0081] g[X(k|k-1),U(k)]=C·X(k|k-1);

[0082] Where X(k / k-1) represents the prior estimate of the state variable at time k based on the information at time k-1; X(k-1 / k-1) represents the state variable at time k-1; f(·) represents the state transfer function, A represents the state transfer matrix, and C represents the input matrix; U(k-1) represents the input quantity at time k-1; q(k-1) represents the mean vector of the system process noise at time k-1; Y(k) represents the output quantity; g(·) represents the measurement function; and r(k-1) represents the mean vector of the measurement noise.

[0083] After the system state prediction is completed, the predicted value is usually calculated based on the current information (and the dynamic model of the system. However, due to measurement noise, these predicted values will not be completely accurate. In order to quantify this uncertainty and correct the predicted value, it is necessary to calculate the error covariance, that is;

[0084] P(k|k-1)=A×P(k-1|k-1)×A T +Q(k-1);

[0085] Among them, P(k / k-1) represents the error covariance matrix of the prior estimate at time k based on the information at time k-1; P(k-1 / k-1) represents the actual error covariance matrix at time k-1; A represents the state transition matrix; Q(k-1) represents the system process noise covariance matrix.

[0086] (2) Calculate the dynamic Kalman gain, that is:

[0087] K g (k)=P(k|k-1)×C T / [C×P(k|k-1)×C T +R s (k-1)];

[0088] Among them, K g (k) represents the Kalman gain, which is used to balance the weights of the predicted value and the actual measured value; R s (k-1) represents the measurement noise covariance matrix, which supports dynamic changes to achieve gain adaptation.

[0089] (3) Measure the new information ε(k), that is:

[0090] ε(k)=Y(k)-g[X(k|k-1),U(k)]-r(k-1);

[0091] Where g(·) represents the measurement function, which is used to express the relationship between X(k / k-1) and U(k); Y(k) represents the output; r(k-1) represents the mean value of the measurement noise;

[0092] (4) Correct the state equation through new information:

[0093] X(k|k)=X(k|k-1)+θ(k)×K g (k)×ε(k);

[0094] Where X(k|k) represents the posterior estimate of the state variable X at time k; θ(k) represents the gain factor at time k, and θ(k) = h[ε(k),T], where h represents the relationship function between the innovation error ε(k) and the temperature T.

[0095] The modified covariance equation is:

[0096] P(k|k)=[1-K g (k) × C] × P(k|k-1);

[0097] Where P(k|k) is the posterior estimation error covariance matrix at time k.

[0098] (5) Perform noise characteristic iteration, and the noise parameters are dynamically estimated as follows:

[0099] q(k)=[1-d(k-1)]×q(k-1)+d(k-1)×{X(k|k-1)-fX(k-1|k-1),U(k-1)]};

[0100] Establish a measurement noise mean feedback compensation mechanism to update the measurement noise parameters in real time:

[0101] r(k)=[1-d(k-1)]×r(k-1)+d(k-1)×{Y(k)-g[X(k|k-1),U(k)]};

[0102] An exponentially weighted recursive algorithm is used to ensure the positive definiteness of the covariance, thereby adaptively adjusting the covariance matrix:

[0103]

[0104] Among them, d(k-1) represents the weighting coefficient, which is:

[0105]

[0106] Among them, b represents the forgetting factor, which ranges from 0.9 to 1. By adjusting the forgetting factor, the weighting coefficient is adjusted to balance the weights of new and old data, and then the covariance matrix is adaptively modified.

[0107] Finally, the above prediction and update steps are iterated until all data are processed. Each iteration modifies the state equation and coequation based on the new observation data, thereby improving the accuracy of the estimate. Figure 2 The figure shows a comparison of filtering effects in a noisy environment. Clearly, the filtering method of the present invention effectively suppresses high-frequency noise in the current signal, enhancing the system's anti-interference capability and robustness. The adaptive Kalman filter continuously determines whether the system's dynamics have changed during the filtering process and automatically adjusts model parameters and noise statistics to improve filter design and reduce actual errors.

[0108] In step S3 of this embodiment, an overcurrent judgment is performed based on the current estimation value output by the adaptive Kalman filter, so as to timely discover the overcurrent risk and take protective measures in time to ensure circuit safety. Figure 3 As shown, step S3 includes:

[0109] Set the current threshold to judge the overcurrent of the AKF output current;

[0110] Among them, the initial current threshold is first set according to the load type and historical current data;

[0111] Then, the current data is statistically analyzed by setting a sliding window. That is, a time window is constructed as a data buffer, and the instantaneous current values within the window are continuously stored from the data buffer, including the sliding mean, standard deviation, and peak-to-peak value.

[0112] Finally, based on the statistical results of the sliding window, the current threshold is dynamically corrected.

[0113] The threshold dynamic correction includes:

[0114] When the detected standard deviation is greater than the preset maximum standard deviation, or the peak-to-peak value is greater than the preset maximum peak-to-peak value, the system determines that it is a noise interference or load transient state. At this time, the current threshold floating mechanism is triggered, and the initial current threshold is adjusted to the initial value multiplied by n, where n is greater than 1;

[0115] When the standard deviation is less than the preset minimum standard deviation and the peak-to-peak value is less than the preset minimum peak-to-peak value, the system determines that the system is in steady-state operation and maintains the initial current threshold. The preset maximum / minimum standard deviation and the preset maximum / minimum peak-to-peak value can be flexibly selected according to actual conditions during implementation.

[0116] Furthermore, in order to achieve smooth transition of the threshold during dynamic changes and avoid protection logic oscillation caused by sudden changes in the threshold, the dynamic correction of the threshold in this embodiment is achieved through a state machine, which can be converted to a new state according to pre-set rules based on the input and current state.

[0117] In addition, to quantify overcurrent risks and implement a multi-level alarm mechanism, thereby achieving rapid and accurate overcurrent protection, this embodiment also provides multiple current thresholds, all of which support dynamic correction. The current thresholds of this embodiment include a first current threshold and a second current threshold.

[0118] When the real-time current value is less than or equal to the first current threshold, it is determined that there is no overcurrent risk.

[0119] When the first current threshold is less than the real-time current value and less than the second current threshold, it is determined to be a potential overcurrent risk, and a first-level alarm and response is initiated, including driving the buzzer to emit intermittent alarm sounds and synchronously controlling the LED to flash, forming a human-computer interactive alarm signal.

[0120] When the real-time current value is ≥ the second current threshold, it is determined to be a serious overcurrent fault, and the secondary alarm and response are activated, including immediately cutting off the load power supply circuit, and recording and reporting the fault information, which includes the fault code and instantaneous current value.

[0121] This embodiment incorporates a real-time overcurrent protection algorithm. Combined with real-time current detection, the system can quickly respond to current anomalies, preventing system damage caused by excessive current. This algorithm is highly adaptable to varying loads and noisy environments, effectively reducing false alarms and missed alarms, and improving the reliability of overcurrent protection.

[0122] At the same time, according to the above-mentioned current detection and overcurrent protection method based on AKF, this embodiment also proposes a current detection and overcurrent protection system based on AKF, such as Figure 4 As shown, the system includes a current acquisition module, a control module, an alarm response module, and a temperature acquisition module, wherein the control module is connected to the current acquisition module, the alarm response module, and the temperature acquisition module respectively.

[0123] The current acquisition module includes a shunt resistor, a filter, and an amplifier connected in series. The current collected by the shunt resistor is filtered by the filter, amplified by the amplifier, and then sent to the control module. In this embodiment, a 0.1mΩ high-precision shunt resistor is used for current acquisition. The current is then passed through a three-stage filtering network and an AD8421 instrumentation amplifier, where the current signal is linearly amplified to a range of 0-15V, ensuring a measurement accuracy of ±0.5%.

[0124] The alarm response module includes a buzzer, an LED, and a fixed relay, wherein the buzzer, the LED, and the fixed relay are respectively connected to the control module; the fixed relay is connected in series in the load power supply circuit, and its control end is connected to the control module.

[0125] The control module includes an ADC (analog-to-digital converter), multiple communication interfaces, a DMA controller, a control center, and a PWM drive unit, wherein the control center is connected to the ADC, DMA controller, PWM drive unit, and multiple communication interfaces respectively. The control center is used to perform AKF-based current detection based on the collected current and temperature data, and send a control signal to the alarm response module when overcurrent protection is triggered.

[0126] The ADC is also connected to the amplifier to collect current data and transmit it to the control center. The control center then stores the collected current data in the control center's memory via a DMA controller. In this embodiment, the ADC collects data at a 10kHz sampling rate and, in conjunction with the DMA controller, enables zero-overhead data transfer to the memory buffer, improving sampling efficiency.

[0127] The PWM drive unit is also connected to the buzzer and LED to generate PWM signals to drive the buzzer and LED to generate alarms. The PWM drive unit uses a 2N3904 NPN transistor. The timer TIM3 generates a 1-10kHz adjustable PWM signal to control the alarm frequency. It also supports generating a programmable 0.5-2Hz PWM signal to control the LED flashing.

[0128] The multiple communication interfaces include a CAN interface, a GPIO interface, and an I2C interface, wherein the CAN interface, the GPIO interface, and the I2C interface are respectively connected to the control center. The GPIO interface is connected to the control end of the fixed relay, and is used to forward the control signal of the control center to the fixed relay to control the on and off of the load power supply circuit. The CAN interface is used to communicate with external devices to upload fault information, and the external devices include vehicle controllers. The I2C interface is connected to the temperature acquisition module to collect temperature and send it to the control center. When the secondary alarm and response is activated, the control center controls the solid-state relay through the GPIO to cut off the load power supply circuit within 2 milliseconds, and sends fault information to the main control system through the CAN bus, including the fault code and instantaneous current value.

[0129] In this embodiment, the control module uses an STM32F407IGT6 microcontroller. The STM32F407 microcontroller performs real-time data processing. Its high-performance ADC module and DMA technology ensure rapid acquisition and real-time transmission of current signals. The STM32F407 microcontroller also integrates multiple communication interfaces, supporting efficient data or control signal transmission. Its efficient computing power also supports the smooth implementation of adaptive Kalman filtering algorithms and real-time overcurrent protection algorithms.

[0130] The present invention has been described above with reference to the accompanying drawings. Obviously, the specific implementation of the present invention is not limited to the above-described method. Any non-substantial improvements made using the method concepts and technical solutions of the present invention, or any direct application of the above-described concepts and technical solutions to other situations without modification, fall within the scope of protection of the present invention.

Claims

1. A current detection and overcurrent protection method based on AKF, characterized by: The method comprises the following steps: Step S1, collecting current signals; Step S2, processing the current signal based on an adaptive Kalman filter algorithm AKF; Step S3: determine if the current output by the AKF is overcurrent, and perform graded alarm and protection according to the degree of overcurrent.

2. The current detection and overcurrent protection method based on AKF according to claim 1, characterized in that: The step S2 comprises: (1) Based on the state estimate of the system at the previous moment, the state of the system at the current moment is predicted a priori through the state transfer matrix to obtain the a priori estimate of the state variable and its corresponding a priori covariance matrix: The system state prediction is performed as follows: X(k|k-1)=f[X(k-1|k-1),U(k-1)]+q(k-1); f[X(k-1|k-1),U(k-1)]=A·X(k-1|k-1)+C·U(k-1); Y(k)=g[X(k|k-1),U(k)]+r(k-1); g[X(k|k-1),U(k)]=C·X(k|k-1); Where X(k / k-1) represents the prior estimate of the state variable at time k based on the information at time k-1; X(k-1 / k-1) represents the state variable at time k-1; f(·) represents the state transfer function, A represents the state transfer matrix, and C represents the input matrix; U(k-1) represents the input at time k-1; q(k-1) represents the mean vector of the system process noise at time k-1; Y(k) represents the output; g(·) represents the measurement function; and r(k-1) represents the mean vector of the measurement noise. Calculate the current covariance equation; P(k|k-1)=A×P(k-1|k-1)×A T +Q(k-1); Where P(k / k-1) represents the error covariance matrix of the prior estimate at time k based on the information at time k-1; P(k-1 / k-1) represents the actual error covariance matrix at time k-1; A represents the state transition matrix; Q(k-1) represents the system process noise covariance matrix; (2) Calculate the dynamic Kalman gain, that is: K g (k)=P(k|k-1)×C T / [C×P(k|k-1)×C T +R s (k-1)]; Among them, K g (k) represents the Kalman gain, which is used to balance the weights of the predicted value and the actual measured value; R s (k-1) represents the measurement noise covariance matrix; (3) Measure the new information ε(k), that is: ε(k)=Y(k)-g[X(k|k-1),U(k)]-r(k-1); Where g(·) represents the measurement function, which is used to express the relationship between X(k / k-1) and U(k); Y(k) represents the output; r(k-1) represents the mean value of the measurement noise; (4) Correct the state equation through new information: X(k|k)=X(k|k-1)+θ(k)×K g (k)×ε(k); Where X(k|k) represents the posterior estimate of the state variable X at time k; θ(k) represents the gain factor at time k, and is: θ(k) = h[ε(k),T], where h represents the relationship function between the innovation error ε(k) and the temperature T; The modified covariance equation is: P(k|k)=[1-K g (k)×C]×P(k|k-1); Where P(k|k) is the posterior estimation error covariance matrix at time k; (5) Perform noise characteristic iteration, and the noise parameters are dynamically estimated as follows: q(k)=[1-d(k-1)]×q(k-1)+d(k-1)×{X(k|k-1)-fX(k-1|k-1),U(k-1)]}; Establish a measurement noise mean feedback compensation mechanism to update the measurement noise parameters in real time: r(k)=[1-d(k-1)]×r(k-1)+d(k-1)×{Y(k)-gX(k|k-1),U(k)]}; Adopt exponentially weighted recursive algorithm to adaptively adjust the covariance matrix: Among them, d(k-1) represents the weighting coefficient, which is: Where b represents the forgetting factor, which ranges from 0.9 to 1. By adjusting the forgetting factor, the weighting coefficient is adjusted to adaptively modify the covariance matrix.

3. The current detection and overcurrent protection method based on AKF according to claim 1, characterized in that: The step S3 comprises: Set the current threshold to judge the overcurrent of the AKF output current; Among them, the initial current threshold is first set according to the load type and historical current data; Then, the current data is statistically analyzed by setting a sliding window. That is, a time window is constructed as a data buffer, and the instantaneous current values within the window are continuously stored from the data buffer, including the sliding mean, standard deviation, and peak-to-peak value. Finally, based on the statistical results of the sliding window, the current threshold is dynamically corrected.

4. The current detection and overcurrent protection method based on AKF according to claim 3, characterized in that: The threshold dynamic correction includes: When the detected standard deviation is greater than the preset maximum standard deviation, or the peak-to-peak value is greater than the preset maximum peak-to-peak value, the system determines that it is a noise interference or load transient state. At this time, the current threshold floating mechanism is triggered, and the initial current threshold is adjusted to the initial value multiplied by n, where n is greater than 1; When it is detected that the standard deviation is less than the preset minimum standard deviation and the peak-to-peak value is less than the preset minimum peak-to-peak value, the system is determined to be in a steady-state operation state and maintains the initial current threshold.

5. The current detection and overcurrent protection method based on AKF according to claim 4, characterized in that: The dynamic correction of the threshold is achieved through a state machine.

6. The current detection and overcurrent protection method based on AKF according to any one of claims 3 to 5, characterized in that: The current threshold includes a first current threshold and a second current threshold. When the real-time current value is ≤ the first current threshold, it is determined that there is no overcurrent risk; when the first current threshold is < the real-time current value < the second current threshold, it is determined to be a potential overcurrent risk, and a first-level alarm and response are initiated; when the real-time current value is ≥ the second current threshold, it is determined to be a serious overcurrent fault, and a second-level alarm and response are initiated.

7. The current detection and overcurrent protection method based on AKF according to claim 6, characterized in that: The first-level alarm and response includes driving the buzzer to emit intermittent alarm sounds and synchronously controlling the LED to flash, forming a human-computer interactive alarm signal.

8. The current detection and overcurrent protection method based on AKF according to claim 6, characterized in that: The secondary alarm and response includes immediately cutting off the load power supply circuit, and recording and reporting the fault information.

9. A current detection and overcurrent protection system based on AKF according to the method of any one of claims 1 to 8, characterized in that: The system includes a current acquisition module, a temperature acquisition module, a control module, and an alarm response module, wherein the control module is connected to the current acquisition module, the alarm response module, and the temperature acquisition module respectively; The current acquisition module includes a shunt resistor, a filter, and an amplifier connected in series. The current collected by the shunt resistor is filtered by the filter and amplified by the amplifier before being sent to the control module. The alarm response module includes a buzzer, an LED, and a fixed relay, wherein the buzzer, the LED, and the fixed relay are respectively connected to the control module; the fixed relay is connected in series in the load power supply circuit, and its control end is connected to the control module; The control module includes an ADC, multiple communication interfaces, a DMA controller, a control center, and a PWM drive unit, wherein the control center is connected to the ADC, the DMA controller, the PWM drive unit, and the multiple communication interfaces respectively. The control center is used to perform AKF-based current detection based on the collected current and temperature data, and send a control signal to the alarm response module when overcurrent protection is triggered; The ADC is also connected to the amplifier, and is used to collect current data and send it to the control center. The control center stores the collected current data in the control center memory through the DMA controller; the PWM drive unit is also connected to the buzzer and LED respectively, and is used to generate PWM signals to drive the buzzer and LED to alarm; the multiple communication interfaces include a CAN interface, a GPIO interface, and an I2C interface, wherein the CAN interface, GPIO interface, and I2C interface are respectively connected to the control center, and the GPIO interface is connected to the control end of the fixed relay, and is used to forward the control signal of the control center to the fixed relay to control the on and off of the load power supply circuit; the CAN interface is used to communicate with external devices to upload fault information, and the external devices include the vehicle controller; the I2C interface is connected to the temperature acquisition module, collects temperature and sends it to the control center.

10. The AKF-based current detection and overcurrent protection system according to claim 9, characterized in that: The control module adopts STM32F407IGT6 microcontroller.