Phase sequence automatic identification and correction distribution box system
By combining Clarke transform and sequential probability ratio test, an adaptive optimal stopping algorithm is developed to achieve fast, reliable and automatic identification and correction of phase sequence detection. This solves the contradiction between detection speed and decision reliability in existing technologies, provides a quantifiable guarantee of false positive rate, expands fault detection capabilities, and reduces hardware costs.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- ZHEJIANG LUGAO ELECTRIC POWER TECH CO LTD
- Filing Date
- 2026-03-27
- Publication Date
- 2026-06-16
AI Technical Summary
Existing phase sequence detection methods have a trade-off between detection speed and decision reliability, lack adaptive capabilities, cannot quantify the false judgment rate, and lack the ability to detect abnormal power supply states, making it difficult to meet the safety requirements of critical load scenarios.
The system employs a three-phase voltage synchronous sampling module, a Clarke transform calculation unit, a sequential probability ratio test and decision unit, a cross-validation unit, and a safety interlock unit, combined with a correction execution unit, to achieve rapid and automatic phase sequence identification and correction. It calculates the cross product of space vectors through Clarke transform, utilizes an adaptive optimal stopping algorithm based on sequential probability ratio test and cross-validation, and combines a three-phase imbalance factor feedback adjustment noise model to provide a quantifiable guarantee of the false judgment rate.
It achieves improved speed and reliability of phase sequence detection, reduces detection time to 3.33 milliseconds, reduces false positive rate to less than one in a thousand, has signal quality adaptive capability, expands fault detection dimensions, reduces hardware costs and improves system versatility.
Smart Images

Figure CN121923071B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of power distribution system protection and control technology, and in particular to a distribution box system for automatic phase sequence identification and correction. Background Technology
[0002] In a three-phase AC power supply system, the phase sequence of the three-phase power supply is a fundamental prerequisite for determining the direction of rotation of rotating motors and the normal operation of three-phase loads. A standard three-phase power supply consists of three sinusoidal AC voltages with the same frequency, equal amplitude, and phases differing by 120 degrees sequentially. The correct phase sequence (ABC sequence) requires phase A to lead phase B by 120 degrees, and phase B to lead phase C by 120 degrees. If the actual wiring disrupts this phase relationship, a reverse sequence will occur, directly leading to serious safety accidents such as reverse rotation of the three-phase asynchronous motor, compressor damage, and the fall of lifting equipment. In scenarios such as temporary power distribution at construction sites and frequent connection and disconnection of rented equipment, the probability of three-phase wiring errors increases significantly, necessitating a distribution box system capable of automatically detecting the phase sequence and automatically correcting errors upon detection.
[0003] Existing phase sequence detection methods suffer from a fundamental contradiction between detection speed and decision reliability, and lack adaptability to changes in field power quality. Traditional phase sequence determination methods rely on manual qualitative judgment using phase sequence tables or indicator lights, which suffers from drawbacks such as non-quantifiable results, inability to automatically correct errors, long operation time, and susceptibility to errors. Existing automated detection schemes typically use dedicated phase angle sensors to acquire three-phase phase information, then average it through a fixed window and compare it with a preset threshold to determine the correctness of the phase sequence. This multi-step serial processing flow of "first estimating the phase angle, then calculating the inter-phase angle, and finally comparing the threshold" has the following shortcomings.
[0004] First, the detection speed is limited by the fixed window length. Phase angle estimation requires observing the waveform for at least one complete power frequency cycle (20 milliseconds at 50Hz). In practice, to improve noise immunity, the average of multiple cycles is usually taken, resulting in a detection time of 40 to 100 milliseconds. The window length is selected through compromise based on engineering experience. If it is too short, the signal-to-noise ratio is insufficient, leading to an increased false positive rate. If it is too long, time is wasted, making the correction time budget tight. The contradiction between these two factors cannot be fundamentally resolved under the fixed window system.
[0005] Second, the decision parameters lack adaptability. The selection of key parameters such as decision tolerance and decision margin relies on engineering experience and remains unchanged throughout the operation once set. However, power quality conditions at construction sites are highly variable. Switching between different generator sets and power supply lines can lead to significant fluctuations in three-phase imbalance and harmonic content. Fixed parameters cannot cover all operating conditions. They may be too conservative under favorable conditions, increasing unnecessary detection delays, or too aggressive under adverse conditions, leading to misjudgments.
[0006] Third, the multi-step serial processing leads to error accumulation. From waveform acquisition to phase angle estimation, then to phase angle calculation, and finally to threshold comparison, the error introduced at each step is propagated and amplified downstream. In particular, the phase angle estimation stage may produce significant deviations under harmonic pollution or weak signal conditions, directly affecting the accuracy of the final decision.
[0007] Fourth, the existing system's safety interlocking mechanism is based only on traditional conditions such as load current, circuit breaker status, and arc detection, lacking the ability to detect abnormal power supply conditions such as phase loss and severe three-phase imbalance. Performing a phase commutation operation under phase loss conditions not only fails to restore normal power supply but may also exacerbate the fault.
[0008] Fifth, the existing false positive rate can only be approximated through simulation or experimentation, and cannot provide a mathematically provable upper bound guarantee for the false positive rate, making it difficult to meet the safety audit requirements of critical load scenarios such as power supply for mine hoisting equipment and power distribution in hospital operating rooms. Summary of the Invention
[0009] The technical problem this invention aims to solve is: how to achieve rapid automatic phase sequence identification and reliable correction in a distribution box system, while simultaneously achieving optimal synergy in three dimensions: detection speed, decision reliability, and field adaptability, and providing a quantifiable and auditable guarantee of the false judgment rate. Therefore, this invention provides an intelligent phase sequence automatic identification and correction distribution box system that overcomes the contradiction between detection speed and decision reliability, possesses signal quality adaptive capability, and provides a quantifiable guarantee of the false judgment rate.
[0010] To address the aforementioned technical problems, this invention provides an automatic phase sequence identification and correction distribution box system, comprising a three-phase voltage synchronous sampling module, a Clarke transform calculation unit, a sequential probability ratio test and decision unit, a cross-validation unit, a safety interlock unit, and a correction execution unit, wherein:
[0011] The three-phase voltage synchronous sampling module is used to synchronously acquire the instantaneous values of three-phase voltage through three analog-to-digital conversion channels;
[0012] The Clarke transform calculation unit is used to transform the instantaneous values of three-phase voltage into orthogonal two-phase stationary coordinate system components, and calculate the cross product value and magnitude of the space vector accordingly. The algorithm it executes is a sub-period phase sequence feature extraction algorithm based on the spatial vector rotation direction discrimination.
[0013] The sequential probability ratio test decision unit is used to perform adaptive optimal stopping sequential hypothesis testing using the cross product value of the space vector as the observation, and outputs the phase sequence decision result. The algorithm it executes is the adaptive optimal stopping phase sequence decision algorithm based on Wald sequential analysis theory.
[0014] The cross-validation unit is used to reconstruct the spatial vector rotation angle from the two-phase stationary coordinate system components, convert it into an equivalent interphase angle, input it into the cost function for independent scoring, and compare the result with the result of the sequential probability ratio test decision unit.
[0015] The safety interlock unit is used to comprehensively determine whether a commutation operation is allowed based on the load current, circuit breaker status, arc detection signal, spatial vector amplitude, and three-phase imbalance factor.
[0016] The corrective execution unit is used to drive the commutation execution mechanism to achieve three-phase physical commutation based on the judgment result;
[0017] The three-phase imbalance factor output by the Clarke transform calculation unit is fed back to the sequential probability ratio test decision unit in real time, dynamically adjusting its noise model parameters to form a closed-loop decision mechanism that adapts to signal quality.
[0018] The constant-amplitude Clarke transform expression performed by the Clarke transform calculation unit is as follows:
[0019] u α =(2 / 3)×u A -(1 / 3)×u B -(1 / 3)×u C ;u β =(√3 / 3)×(u B -u C ); where u A u B u C These are instantaneous sampled values of the three-phase voltage, in units of V and u. α For the first axis component, u β This is the second axis component, and the unit is V.
[0020] After calculating the spatial vectors at two adjacent sampling times, the expression for calculating the cross product is:
[0021] C j =u α1 ×u β2 -u β1 ×u α2 ;where u α1 and u β1 For the first and second axis components at the previous time step, u α2 and u β2 For the first and second axis components at the next time step, C j This is the cross product value, in units of V. 2 .
[0022] The theoretical value of the cross product under ideal ascending order is: C pos =U2 ms ×sin(ω×Δt); The theoretical value of the cross product under ideal inversion is: C neg =-U 2 ms ×sin(ω×Δt); where U ms The peak voltage at the output of the sampling circuit is in volts (V). ω = 2π × 50 = 314.16 rad / s is the angular frequency, and Δt is the time interval between two samplings in seconds.
[0023] The sequential probability ratio test decision unit models phase sequence recognition as a binary hypothesis test, with the positive sequence hypothesis H0 corresponding to a cross product mean of +μ. C The reverse hypothesis H1 corresponds to a cross product mean of -μ C The single-sample log-likelihood ratio is defined as the natural logarithm of the ratio of the probability density under the inversion hypothesis to the probability density under the forward hypothesis. In the case of an equal-variance Gaussian noise model, the simplified expression is:
[0024] λ j =-2×μ C ×C j / σ 2 C ;where μ C =U 2 ms ×sin(ω×Δt) is the nominal mean of the cross product, in units of V. 2 C j This is the current cross product observation, in V units. 2 , σ C This is the noise standard deviation parameter, in V. 2 , λ j is the dimensionless log-likelihood ratio.
[0025] The update expression for the cumulative log-likelihood ratio is:
[0026] S n =S n-1 +λ n ;where S n Let Sn be the cumulative log-likelihood ratio at step n, which is dimensionless and has an initial value of S0 = 0.
[0027] The decision threshold expression for the sequential probability ratio test is:
[0028] A = ln((1-β) / α); B = ln(β / (1-α)); where α is the upper bound of the false alarm rate, β is the upper bound of the false negative rate, both are dimensionless probability values, A is the upper threshold, and B is the lower threshold, both are dimensionless. When S n When S ≥ A, it is considered an inversion (accept H1); when S n When B ≤ B, it is considered as positive order (accepting H0); when B <Sn Continue sampling when .
[0029] The calculation expression for the magnitude of the space vector is:
[0030] Rk = √(u 2 α + u 2 β ); where u α and u β are the Clarke transformation components of the current sampling point, with the unit of V, and Rk is the magnitude of the space vector, with the unit of V.
[0031] The calculation expression for the three-phase unbalance factor is:
[0032] U BF =(R max - R min ) / (R max + R min ); where R max and R min are respectively the maximum and minimum values of the magnitudes of the space vectors at multiple sampling points, with the unit of V, and U BF is a dimensionless quantity, and its value range is [0, 1).
[0033] The adaptive adjustment expression for the noise standard deviation parameter is:
[0034] σ C = σ C,base × (1 + γ × U BF ); where σ C,base is the reference noise standard deviation, with the unit of V 2 , γ is the feedback coefficient, preferably taking values from 2 to 5, dimensionless, U BF is the three-phase unbalance factor, dimensionless, and σ C is the noise standard deviation after adaptive adjustment, with the unit of V 2 .
[0035] The calculation expression for the instantaneous angle of the space vector in the cross-validation unit is:
[0036] θ V = atan2(u β , u α ); The angle change amount between adjacent sampling points is: Δθ V = wrap(θ V,k+1 - θ V,k ); The conversion expression for the equivalent phase-to-phase included angle is: x equiv = Δθ V × K equiv ; where K equiv=120 / (ω×Δt in degrees) is a dimensionless proportionality constant, x equiv The equivalent alternating angle is expressed in deg.
[0037] The expressions for calculating the forward order cost and the reverse order cost are as follows:
[0038] J pos =[wrap(x equiv -120)] 2 J neg =[wrap(x equiv +120)] 2 ; where wrap() is the angle normalization operator, mapping the angle to the interval (-180°, +180°], J pos and J neg The units are all deg 2 .
[0039] The formula for calculating the fusion confidence score is:
[0040] ρ SPRT =|S n | / A;ρ cost =|J pos -J neg | / J ref ;ρ fused =min(ρ SPRT ,ρ cost ); where J ref =14400 deg 2 ρ represents the nominal cost difference under ideal equilibrium conditions. SPRT ρ cost and ρ fused All are dimensionless.
[0041] The expression for the enhanced safety interlock condition is:
[0042] Enable=(I load ≤I th )∧(S breaker =OPEN)∧(NoArc=TRUE)∧(R min >R loss )∧(U BF BFcrit ); where I load For load current, I th These are safety thresholds, all in A and R. min R is the minimum magnitude of the spatial vector. loss The threshold values for phase loss detection are in V and U. BFcrit The threshold for severe imbalance is dimensionless, and ∧ represents the logical AND operation.
[0043] Commutation execution time t switch The time required for the commutation actuator to complete contact switching and confirm the position after receiving the control signal is expressed in seconds.
[0044] The total time constraint for the correction process is:
[0045] t correct =t detect +t interlock +t switch <5s; where t detect For the detection time, t interlock For the interlock action time, t switch The time for physical commutation is in seconds.
[0046] Furthermore, the Clarke transform calculation unit projects the instantaneous sampled values of the three-phase voltage onto an orthogonal two-phase stationary coordinate system through an equal-amplitude Clarke transform. After calculating the spatial vector at two adjacent sampling times, it takes the cross product value. The sign of the cross product value indicates the rotation direction of the spatial vector, with a positive value corresponding to forward rotation and a negative value corresponding to reverse rotation. The time interval between two sampling times is selected as one-sixth of the power frequency period, so that the spatial vector rotates by 60 degrees between the two sampling times, and the cross product amplitude reaches a level close to the maximum value.
[0047] Furthermore, the sequential probability ratio test decision unit models phase sequence identification as a binary hypothesis testing problem. Each time a new cross product observation value is obtained, the single-sample log-likelihood ratio is calculated and accumulated successively. When the accumulated value exceeds the upper threshold, it is judged as reverse order; when it is below the lower threshold, it is judged as forward order; when it is between the two, sampling continues. When the number of samplings reaches the maximum number of samples, if the accumulated amount still does not exceed any threshold, an uncertain state is output.
[0048] Furthermore, the Clarke transform calculation unit simultaneously calculates the spatial vector amplitude at each sampling point, and calculates the three-phase imbalance factor through the maximum and minimum values of multiple sampling points. The noise standard deviation parameter of the sequential probability ratio test decision unit is determined by multiplying the reference noise standard deviation by a feedback coefficient and the three-phase imbalance factor, thereby realizing the adaptive adjustment of the decision sensitivity with the signal quality.
[0049] Furthermore, the cross-validation unit calculates the instantaneous angle of the spatial vector using the arctangent function, transforms the angle change at adjacent sampling times into an equivalent interphase angle through proportional transformation, and then calculates the forward and reverse order substitution values. When the decision direction of the sequential probability ratio test decision unit is consistent with the direction indicated by the smaller substitution value, the decision is confirmed to be valid; otherwise, an uncertain state is output.
[0050] Furthermore, the system also includes a fusion confidence assessment module, which normalizes the decision confidence of the sequential probability ratio test path and the cross-validation path respectively and takes the smaller value as the minimum guaranteed confidence level of the system as a whole.
[0051] Furthermore, the safety interlocking unit adds two conditions to the original three conditions: load current, circuit breaker status, and arc detection: the minimum amplitude of the space vector is greater than the phase loss detection threshold and the three-phase imbalance factor is lower than the severe imbalance threshold. The phase commutation operation is allowed only when all five conditions are met simultaneously.
[0052] Furthermore, the correction execution unit adopts a permutation matrix control framework. In the positive sequence, it is an identity mapping. When a reverse sequence is detected, it selects to exchange the mapping relationship between the corresponding two phase positions. After the phase exchange is completed, the complete detection process is re-executed for verification detection.
[0053] Furthermore, the sampling time interval of the system is simultaneously constrained by both Clarke transform cross product sensitivity and sequential test time budget constraints, with the engineering equilibrium point being one-sixth of the power frequency period.
[0054] Furthermore, the system adopts a three-layer fusion processing architecture. The front-end feature extraction layer calculates four types of signals—cross product, spatial vector magnitude, three-phase imbalance factor, and reconstructed phase angle—from a single Clarke transform output to achieve four-way multiplexing in one transform. The intermediate adaptive inference layer operates collaboratively through the main path, feedback path, and cross-validation path. The back-end control execution layer outputs commutation control commands in conjunction with enhanced safety interlock conditions.
[0055] In summary, the present invention has the following beneficial effects:
[0056] 1. The detection speed has been improved by orders of magnitude. The sub-periodic feature extraction of Clarke transform eliminates the limitation of traditional methods that must wait for a complete power frequency cycle, and the optimal stopping property of sequential probability ratio test eliminates the redundancy of accumulating a fixed number of samples. The combination of the two results in an optimal detection time of only 3.33 milliseconds, which is 12 to 30 times faster than the 40 to 100 milliseconds of traditional methods.
[0057] 2. The reliability of the decision is mathematically guaranteed and quantifiable. The false positive rate of the main path in the sequential probability ratio test is defined by Wald's inequality. When α=β=0.001, the false alarm rate and false negative rate of the SPRT single path do not exceed one in a thousand. The cross-validation path uses a completely different mathematical transformation path from the main path for heterogeneous redundancy checking, which can effectively detect single-path false positives caused by numerical calculation anomalies or noise model deviations. The dual-path consistency check further reduces the actual false positive rate of the system to below the theoretical upper limit of the SPRT single path. The specific reduction depends on the correlation between the error sources of the two paths, but the Wald inequality guarantee of SPRT always serves as a safe upper limit for the overall false positive rate. This quantifiable auditable security guarantee is something that traditional methods cannot provide.
[0058] 3. The system possesses signal quality self-adaptation capability. The three-phase imbalance factor adjusts the noise parameters of the sequential test in real time through the feedback path, adapting to continuous changes in power quality from ideal to severely unbalanced without manual intervention. This eliminates the maintenance burden of manually adjusting decision parameters according to field conditions, a requirement of traditional methods.
[0059] 4. It expands the dimensions of fault detection without adding any hardware. While performing the core cross product calculation, the Clarke transform's byproducts can be directly used for phase loss detection and three-phase imbalance quantification. This information is organically integrated into the enhanced safety interlock conditions, providing more comprehensive safety protection than the traditional three-condition interlock.
[0060] 5. Reduced hardware costs and enhanced versatility. The integrated solution replaces a dedicated phase angle sensor with a general-purpose microcontroller's built-in ADC and resistor divider network, resulting in lower hardware costs. The ADC sampling scheme simultaneously meets the data requirements of four functions: Clarke transform, sequential testing, imbalance estimation, and cross-validation, achieving efficient reuse of hardware resources.
[0061] 6. Extremely low computational resource requirements. Each sampling step of the entire fusion algorithm requires only about 15 multiplications and divisions, 10 additions and subtractions, and a few special operations, taking approximately 20 to 50 microseconds on a 72MHz microcontroller, which accounts for only 0.3% to 1.5% of the sampling interval and does not constitute a computational bottleneck. The storage requirement is approximately 68 bytes of RAM, which is negligible.
[0062] In summary, the key point of this invention is that while the Clarke transform, as a coordinate transformation tool, is widely used in frequency converters and servo drives in the field of power electronics, its application is limited to simplifying control law design rather than phase sequence determination. The Sequential Probability Ratio Test (SPRT), proposed by Wald in 1945, has primarily been developed in radar and communication signal detection, and its application in power distribution systems is not observed. Existing technologies have not yet seen a phase sequence detection and automatic correction system scheme that deeply integrates the spatial vector rotation direction determination of the Clarke transform with the adaptive optimal stopping decision of the SPRT, and forms a closed-loop adaptive decision mechanism through an imbalance factor feedback path. Therefore, the inventiveness of this invention lies in not simply using the two known tools, the Clarke transform and the SPRT, in series, but rather through a unique closed-loop feedback path—that is, utilizing the three-phase imbalance factor (U) defined by the extreme value ratio of the Clarke transform spatial vector amplitude. BF Real-time adjustment of SPRT noise model parameters σ C — By coupling the front-end feature extraction and the intermediate decision engine into an adaptive organic whole, the system automatically accelerates decision-making when the power quality is good and automatically becomes more conservative when the power quality deteriorates. This fundamentally resolves the irreconcilable contradiction between detection speed and decision reliability in the traditional fixed window method under the Wald optimal stopping theorem. At the same time, with the help of the "one Clarke transform, four-way multiplexing" architecture, the system simultaneously realizes the four functions of main path decision, parameter feedback, cross-validation and enhanced interlocking without any additional hardware cost. It has a synergistic effect that surpasses the simple superposition of the individual component technologies. Attached Figure Description
[0063] Figure 1 This is a schematic diagram of the overall architecture of the system of the present invention;
[0064] Figure 2 This is a schematic diagram illustrating the principle of determining the rotation direction of a space vector using the Clarke transform.
[0065] Figure 3 This is a schematic diagram illustrating the decision-making process of the cumulative log-likelihood ratio as a function of the number of samplings in the sequential probability ratio test.
[0066] Figure 4 A schematic diagram of a three-layer converged processing architecture and four data paths;
[0067] Figure 5 This is a schematic diagram illustrating the data flow during the implementation of multi-algorithm cross-integration.
[0068] Figure 6 A state machine diagram illustrating the complete processing flow of the fusion system;
[0069] Figure 7This is a schematic diagram of the electrical wiring principle of the commutation actuator. Detailed Implementation
[0070] The present invention will be further described below with reference to the accompanying drawings and specific embodiments.
[0071] Example 1: System Overall Architecture and Hardware Configuration
[0072] like Figure 1 As shown, this embodiment provides an automatic phase sequence identification and correction distribution box system. The system's hardware platform uses a 32-bit microcontroller (typically an STM32F103 series, 72MHz, with three built-in 12-bit ADCs), along with a resistor divider network and a DC bias circuit, to condition the three-phase voltage from the line voltage level (220V RMS, corresponding to a peak of approximately 311V) to the range that the microcontroller's ADC can acquire (0 to 3.3V). The voltage division ratio k... v For dimensionless parameters, the peak voltage U at the sampling terminal ms =k v ×U m,line The unit is V.
[0073] The specific circuit topology and parameters of the resistor voltage divider network are as follows. Each phase's voltage divider network adopts a series-parallel resistor voltage divider structure. The series arm consists of two 150kΩ metal film resistors connected in series, with a power rating of 0.5W and an accuracy of 1%. The purpose of connecting the two resistors in series is to limit the voltage across each resistor to less than half of the peak voltage, meeting the rated operating voltage requirements of the resistors. The parallel arm uses a 1.6kΩ metal film resistor with a power rating of 0.25W and an accuracy of 1%. The actual voltage division ratio is k... v =1600 / (300000+1600)=1600 / 301600≈0.005305. Therefore, the peak voltage at the sampling terminal is calculated as U. ms =0.005305×311≈1.65V. A 100pF / 50V ceramic capacitor is connected in parallel across the parallel arm resistor to form a first-order low-pass filter with a -3dB cutoff frequency of f. c =1 / (2π×Rp×Cf), where Rp is the parallel equivalent resistance of the series arm and the parallel arm, Rp=300000×1600 / (300000+1600)≈1591Ω, then f c=1 / (2×3.14159×1591×100×10^(-12))≈1.0MHz. This cutoff frequency is much higher than the fundamental power frequency of 50Hz and its common harmonic components (at least up to the 50th harmonic), so its impact on phase measurement accuracy is negligible, and it can effectively suppress radio frequency interference above 1MHz. The three channels of the three-phase voltage divider network must use resistors from the same batch to ensure that the gain consistency deviation between the three phases is less than 0.5%. The output of the voltage divider network is connected to the ADC input pin through a 1kΩ current-limiting resistor to prevent the ADC pin from being damaged by overvoltage due to a fault in the voltage divider network. In addition, a pair of reverse-series 3.3V Zener diodes are connected in parallel between the ADC pin and ground for clamping protection.
[0074] Since the STM32F103's ADC input range is 0 to 3.3V, it cannot directly measure the negative half-cycle waveform of the three-phase voltage. Therefore, a DC bias needs to be superimposed on the output of the voltage divider network to map the entire AC waveform above 0V. Specifically, a voltage divider bias circuit consisting of two equal resistors (both 10kΩ, 1% accuracy) is connected in series between the lower end of the parallel arm resistor of each phase (the originally grounded end) and the circuit ground. This bias circuit draws power from the microcontroller's 3.3V reference power supply. The upper resistor is connected to 3.3V, the lower resistor is connected to ground, and the intermediate node generates a 1.65V DC bias voltage. The lower end of the parallel arm resistor is connected to this 1.65V bias node. To ensure that the bias node presents low impedance to AC signals, a 10μF / 10V aluminum electrolytic capacitor is connected in parallel between this 1.65V bias node and ground as a bypass capacitor. The bypass capacitor has an impedance of less than 320Ω at power frequencies of 50Hz and above, which is much smaller than the Thevenin equivalent impedance of the bias resistor network (5kΩ). Therefore, the bias node is approximately AC ground for AC signals and will not change the AC voltage division ratio of the voltage divider network. After biasing, the peak value of the AC signal is approximately 1.65V. After adding a 1.65V DC bias, the waveform oscillates between approximately 0V and 3.3V, fully covering both positive and negative half-cycles and making full use of the ADC's range. The microcontroller can recover the true instantaneous AC voltage value (both positive and negative) by subtracting the 1.65V bias from the ADC reading in the software. The selection of the parallel arm resistor value needs to consider two constraints: first, the voltage division ratio k... v The peak voltage U at the sampling terminal should be ms First, the bias voltage should not exceed 1.65V to avoid ADC input clipping; second, the parallel arm resistance should not be too small to avoid increasing the power consumption of the series arm resistor. In this embodiment, a parallel arm resistance of 1.6kΩ is selected to make U ms ≈1.65V just covers the maximum allowable swing of the bias voltage. In engineering implementation, if a margin needs to be left for component tolerance and mains overvoltage, the parallel arm resistance can be adjusted to 1.5kΩ (at this time, U ms≈1.55V, with a signal swing margin of approximately 100mV on each side of the bias. In the subsequent mathematical expressions and numerical values of this application, u A u B u C All refer to the actual instantaneous values of the communication after software bias removal, which can be positive or negative.
[0075] The three-phase voltage synchronous sampling module consists of three ADC channels, and uses a timer synchronous triggering method to ensure that the time deviation of the three sampling channels is less than 1 microsecond. The sampling time interval Δt is set to 3.33 milliseconds (i.e., 1 / 6 of the power frequency period T = 20 milliseconds), and the corresponding ADC trigger frequency is 300Hz.
[0076] The Clarke transform calculation unit, sequential probability ratio test decision unit, cross-validation unit, and fusion confidence assessment module all run within the microcontroller as software algorithms. The safety interlock unit is implemented through a combination of software logic and hardware circuitry. Load current detection is achieved via a current transformer and ADC sampling, while the circuit breaker status is detected via digital input from auxiliary contacts. Arc detection employs an arc fault detection module based on high-frequency current characteristic analysis. This module identifies series arc faults by monitoring the high-frequency components in the line current. Its output is a normally closed dry contact signal; the contacts are closed during normal operation and open when an arc is detected. The dry contact output is optically isolated to the microcontroller's digital input port, achieving electrical isolation between the arc detection signal and the control circuit. The correction execution unit consists of a commutation actuator and a drive control circuit; the specific structure of the commutation actuator is detailed in Example 8.
[0077] Example 2: Clarke Transform Sub-periodic Phase Sequence Feature Extraction Algorithm
[0078] This embodiment corresponds to the following: "The sub-periodic phase sequence feature extraction algorithm based on spatial vector rotation direction discrimination is to project the instantaneous sampled values of three-phase voltages onto an orthogonal two-phase stationary coordinate system through an equal-amplitude Clarke transform to obtain the first axis component and the second axis component. The first axis component is determined by subtracting 1 / 3 of the phase B voltage from 2 / 3 of the phase A voltage and then subtracting 1 / 3 of the phase C voltage. The second axis component is determined by multiplying the difference between the phase B voltage and the phase C voltage by 1 / 3 of the square root of 3. After calculating the spatial vector at two adjacent sampling times, the product of the first axis component at the previous time and the second axis component at the next time is subtracted from the product of the second axis component at the previous time and the first axis component at the next time to obtain the cross product value. The sign of the cross product value indicates the rotation direction of the spatial vector, with a positive value corresponding to forward rotation and a negative value corresponding to reverse rotation. The time interval between two sampling times is selected as 1 / 6 of the power frequency period, so that the spatial vector rotates 60 degrees between the two sampling times, and the cross product amplitude reaches a level close to the maximum value."
[0079] The Clarke transform calculation unit performs an equal-amplitude Clarke transform, projecting the instantaneous sampled values of the three-phase voltage onto an orthogonal two-phase stationary coordinate system.
[0080] This system uses the equal-amplitude Clarke transform form instead of the equal-power form for the following reasons: The pre-factor K in the equal-amplitude form is 2 / 3, while the pre-factor K in the equal-power form is √(2 / 3). Without the pre-factor, the Clarke transform matrices in both forms result in each component's amplitude being equal to the peak value U of the original three-phase voltage when applied to the balanced three-phase positive-sequence voltage. m 3 / 2 times. The output amplitude after multiplying the constant amplitude form by the pre-coefficient is (2 / 3) × (3 / 2) × U. m =U m This is equal to the original three-phase voltage peak value. The output amplitude after multiplying the equal power form by a pre-factor is √(2 / 3)×(3 / 2)×U. m =√(3 / 2)×U m ≈1.2247×U m This is approximately 1.2247 times the original peak value, which is √(3 / 2) ≈ 1.2247. In this system, the cross product value C... j and nominal mean μ C All are calculated using the same Clarke coefficients, and their ratio (i.e., the core quantity of the log-likelihood ratio) is independent of the chosen Clarke transform form—choosing the isopower form only makes C... j and μ C Scaling proportionally, log-likelihood ratio λ j =-2×μ C ×C j / σ 2 C The value remains unchanged (because σ) 2 C (It will also be scaled accordingly during calibration). Therefore, both forms can be used in this system without affecting the applicability of subsequent algorithms. The engineering advantage of choosing the equal amplitude form is that its output amplitude is directly equal to the peak voltage U at the sampling terminal. ms This allows engineers to intuitively interpret signal amplitude using an oscilloscope or debugging interface.
[0081] At each sampling moment, the microcontroller synchronously reads the conversion results of the three ADCs to obtain the instantaneous three-phase voltage value u. A u B u C (Unit: V, representing the instantaneous low-voltage AC value after voltage division and bias removal). The Clarke transform calculation process is as follows: First axis component u α The value of u is determined by subtracting one-third of the phase B voltage from two-thirds of the phase A voltage, and then subtracting one-third of the phase C voltage. α =(2 / 3)×uA -(1 / 3)×u B -(1 / 3)×u C Second axis component u β The value is determined by multiplying the difference between phase B voltage and phase C voltage by one-third of the square root of three, i.e., u. β =(√3 / 3)×(u B -u C The transformation coefficients a1=2 / 3≈0.6667, a2=1 / 3≈0.3333, and b1=√3 / 3≈0.5774 are all dimensionless constants, and the units of the physical quantities before and after the transformation are both V.
[0082] At two adjacent sampling times t1 and t2 = t1 + Δt, Clarke transforms are performed respectively to obtain two spatial vectors V1 = (u α1 ,u β1 ) and V2=(u α2 ,u β2 Calculate the determinant value C for these two two-dimensional vectors. j =u α1 ×u β2 -u β1 ×u α2 The unit is V 2 This operation is equivalent to a three-dimensional cross product in two dimensions. c The z-axis component of t) is referred to as the "cross product" in this application for the sake of simplicity, following the engineering conventions of the power electronics field. Its geometric meaning is the signed area of the directed parallelogram formed by two spatial vectors: when V 二相 The area is positive when V1 is in the counterclockwise direction (i.e., the positive rotation direction) and negative when it is in the clockwise direction.
[0083] For a three-phase sinusoidal voltage signal, in the positive sequence (ABC sequence) case, the space vector rotates counterclockwise in the α-β plane with an angular velocity ω. At this time, C j >0; In the case of reverse order (ACB order), the space vector is rotated clockwise, and C j <0.
[0084] like Figure 2 As shown, the derivation is performed by substituting the analytical expression of the three-phase voltage under ideal positive sequence, u A (t)=U m ×sin(ωt), u B (t)=U m ×sin(ωt-120°), u C (t)=U m ×sin(ωt-240°), after Clarke transform, yields u α (t)=U ms×sin(ωt), u β (t)=-U ms ×cos(ωt). Substituting this into the cross product formula, we obtain the theoretical value of the orthogonal cross product as C. pos =U 2 ms ×sin(ω×Δt). A similar derivation yields the theoretical value of the inverse cross product as C. neg =-U 2 ms ×sin(ω×Δt).
[0085] The time interval Δt between the two sampling moments is 3.33 milliseconds (one-sixth of the power frequency cycle). The corresponding spatial vector rotation angle is ω×Δt=2π×50×0.00333=π / 3 radians=60 degrees. At this time, sin(60°)=√3 / 2≈0.866. (U...) ms Taking 1.65V as an example, the nominal value of the cross product μ C =1.65 2 ×0.866=2.72×0.866=2.36V 2 By selecting one-sixth of the power frequency cycle as the sampling interval, the cross product amplitude reaches 86.6% of the nominal maximum value. While maintaining high sensitivity, the time span of a single cross product is controlled to be much smaller than a complete power frequency cycle, thus achieving sub-cycle detection capability.
[0086] Example 3: Adaptive Optimal Stopping Decision Algorithm Based on Sequential Probability Ratio Test
[0087] This embodiment corresponds to the following: "The adaptive optimal stopping phase sequence decision algorithm based on Wald sequential analysis theory models phase sequence identification as a binary hypothesis testing problem. The positive sequence hypothesis corresponds to a nominal cross product amplitude with a positive mean, and the reverse sequence hypothesis corresponds to a nominal cross product amplitude with a negative mean. For each new cross product observation obtained, the natural logarithm of the ratio of the probability density of the observation under the two hypotheses is calculated as the single-sample log-likelihood ratio. The single-sample log-likelihood ratio is calculated by multiplying the nominal cross product amplitude by the current..." The product of the cross-product observations is divided by the square of the noise standard deviation parameter to determine the cumulative log-likelihood ratio. The cumulative log-likelihood ratio is obtained by successively summing the log-likelihood ratios of each sample. When the cumulative log-likelihood ratio exceeds an upper threshold determined by preset false alarm rates and false negative rates, it is judged as reverse order; when it is below a lower threshold determined by preset false alarm rates and false negative rates, it is judged as forward order; when it falls between the two, sampling continues. When the number of samples reaches the maximum number of samples determined by dividing the detection time budget by the sampling interval, if the cumulative amount still has not exceeded any threshold, an uncertain state is output.
[0088] Among them, the sequential probability ratio test decision unit models phase sequence recognition as a binary hypothesis testing problem: the positive sequence hypothesis H0 corresponds to the nominal cross product amplitude +μ with a positive mean cross product value.C The reverse hypothesis H1 corresponds to the nominal cross product amplitude -μ with a negative mean. C .
[0089] Each time a new cross product observation C is obtained j That is, the natural logarithm of the ratio of the probability density of the observation under the reverse order hypothesis H1 to the probability density under the forward order hypothesis H0 is used as the single-sample log-likelihood ratio: λ j =ln[f(C j |H1) / f(C j |H0)]. Under the Gaussian noise model, H0 assumes C j Follows the mean + μ C σ 2 C The normal distribution, H1 hypothesis C j Follows the mean - μ C σ 2 C The probability density function follows a normal distribution. Substituting the Gaussian probability density function and simplifying: λ j =[(C j -μ C ) 2 -(C j +μ C ) 2 ] / (2σ 2 C )=(-4μ C ×C j ) / (2σ 2 C )=-2×μ C ×C j / σ 2 C Where μ C The nominal mean of the cross product (unit: V) 2 ), C j The current cross product observation (unit V) 2 ), σ C Noise standard deviation parameter (unit: V) 2 Log-likelihood ratio λ j The dimension is (V) 2 ×V 2 ) / V 4 =Dimensionless, which meets the requirements of statistical theory.
[0090] The physical meaning of this formula has a clear correspondence with the direction of its sign: when the actual sequence is positive, C j ≈+μ C (Positive value), substituting into the formula, we get λ. j ≈-2μ 2 C / σ 2C (negative value, indicating that the observed value supports H0 (the positive order hypothesis), and the cumulative quantity S n will rapidly decrease and cross the lower threshold B; when it is actually in reverse order C j ≈ -μ C (negative value), substituting into the formula gives λ j ≈ +2μ 2 C / σ 2 C , indicating that the observed value supports H1 (the reverse order hypothesis), and the cumulative quantity S n will rapidly increase and cross the upper threshold A.
[0091] The log-likelihood ratios of each sample are successively accumulated to obtain the cumulative log-likelihood ratio: S n = S n-1 + λ n , with the initial value S0 = 0. The cumulative log-likelihood ratio S n is a dimensionless quantity.
[0092] As Figure 3 shown, the decision thresholds are determined according to the preset false alarm rate α and the miss detection rate β: the upper threshold A = ln((1 - β) / α), the lower threshold B = ln(β / (1 - α)), both are dimensionless. It is recommended to take α = β = 0.001, at this time A = ln(999) ≈ 6.907, B = ln(1 / 999) ≈ -6.907.
[0093] The decision rule is: when S n ≥ A (about 6.907), it is judged as reverse order (accept H1); when S n ≤ B (about -6.907), it is judged as positive order (accept H0); when B < S n < A, the evidence is insufficient, and continue to sample to obtain the next cross product value.
[0094] To prevent the algorithm from infinite sampling in extreme abnormal situations, a maximum sample number truncation is introduced: N max = t budget / Δt, where t budget is the time budget for the detection stage (recommended 200 milliseconds), Δt is the sampling interval (3.33 milliseconds), then N max = 60. When the sampling number n reaches N max and the cumulative quantity S n still has not crossed any threshold, output an uncertain state and enter the protection logic.
[0095] According to the Wald-Wolfowitz optimality theorem, under the given α and β constraints, the sequential probability ratio test is the method with the least expected number of samples required among all test methods that satisfy the same constraints. Under normal working conditions, the cross product signal-to-noise ratio is extremely high (μ C / σ C,baseThe typical value is 50), and the absolute value of the log-likelihood ratio of the first sample is |λ1| = 2μ. 2 C / σ 2 C,base =2×50 2 =5000, far exceeding the absolute value of the decision threshold |A|=|B|≈6.907. Therefore, regardless of whether the actual phase sequence is forward or reverse, SPRT can make a decision after one sample, with a corresponding detection time of only 3.33 milliseconds.
[0096] Example 4: Imbalance Factor Feedback Adjustment Noise Model
[0097] This embodiment corresponds to the following: "The Clarke transform calculation unit simultaneously calculates the spatial vector amplitude at each sampling point. The spatial vector amplitude is the square root of the sum of the squares of the first axis component and the squares of the second axis component. The maximum and minimum values of the spatial vector amplitude are taken from multiple sampling points, and the difference between the maximum and minimum values is divided by the sum of the maximum and minimum values to obtain the three-phase imbalance factor. The three-phase imbalance factor is a dimensionless quantity between 0 and 1, where 0 represents complete balance, and the closer to 1, the more severe the imbalance. The noise standard deviation parameter of the sequential probability ratio test decision unit is determined by multiplying the baseline noise standard deviation by 1, adding the feedback coefficient, and the three-phase imbalance factor. When the three-phase imbalance factor increases, the noise standard deviation parameter automatically increases, reducing the decision increment for each sample in the sequential test, thus requiring more samples to accumulate evidence, achieving adaptive adjustment of the decision sensitivity according to signal quality."
[0098] Among them, the Clarke transform calculation unit simultaneously calculates the spatial vector magnitude at each sampling point: Rk=√(u 2 α,k +u 2 β,k (), the unit is V.
[0099] The maximum value R of the spatial vector magnitude is taken from multiple sampling points. max and minimum value R min (Both are V), the three-phase imbalance factor is obtained by dividing the difference between the maximum and minimum values by the sum of the maximum and minimum values: U BF =(R max -R min ) / (R max +R min ), is a dimensionless quantity with a value range of [0,1). BF =0 indicates that the three phases are in perfect equilibrium (the spatial vector trajectory is circular), U BF The closer it is to 1, the more severe the imbalance (the more the spatial vector trajectory tends to be elliptical or even degenerate).
[0100] The noise standard deviation parameter of the decision unit in the sequential probability ratio test is given by the benchmark value σ.C,base According to U BF Real-time adjustment: σ C =σ C,base ×(1+γ×U BF ). Where σ C,base The unit is V 2 (with the same dimension as the cross product value), γ is a dimensionless feedback coefficient (preferably 3).
[0101] The physical mechanism of this adaptive adjustment is as follows: three-phase imbalance causes the spatial vector trajectory to change from a circle to an ellipse, resulting in systematic fluctuations in the cross product value at different rotation positions. From the perspective of sequential testing, this fluctuation is equivalent to increased noise. When U BF When σ increases C Automatically increases to make the log-likelihood ratio λ for each sample equal to... j =-2×μ C ×C j / σ 2 C As the absolute value of U decreases, sequential testing requires more samples to accumulate evidence, thus avoiding decisions based on poor signal quality. BF When σ approaches 0 C When the value is close to the benchmark, the sequential test completes the decision as quickly as possible.
[0102] σ C,base The method for determining σ is as follows: During the system installation and commissioning phase, connect the system with a known positive-sequence power supply, continuously collect at least 100 cross product values, and calculate their standard deviation as σ. C,base The initial value is σ. If no debugging conditions are available, then based on the theoretical analysis of ADC quantization noise and voltage fluctuations, σ is taken as... C,base =0.02×μ C As a conservative default value.
[0103] Example 5: Cross-validation mechanism
[0104] This embodiment corresponds to the following: "The cross-validation unit uses the first and second axis components output by Clarke transform to calculate the instantaneous angle of the space vector in the two-phase stationary coordinate plane using the arctangent function; the difference between the instantaneous angles at two adjacent sampling times is normalized to obtain the angle change; the angle change is multiplied by a dimensionless proportionality coefficient determined by the ratio of the ideal forward-sequence interphase angle to the single-step ideal rotation angle to convert it into an equivalent interphase angle; the equivalent interphase angle is squared after differing from the forward-sequence ideal value and the reverse-sequence ideal value, respectively, to obtain the forward-sequence cost value and the reverse-sequence cost value; when the decision direction of the sequential probability ratio test decision unit is consistent with the direction indicated by the smaller cost value, the decision is confirmed to be valid; when the two indicated directions are inconsistent, an uncertain state is output and the protection logic is entered."
[0105] The cross-validation unit utilizes the first axis component u output by the Clarke transform. α Second axis component u β The instantaneous angle θ of the space vector in the two-phase stationary coordinate plane is calculated using the arctangent function. V =atan2(u β ,u α (), the unit is degrees.
[0106] The angle change Δθ is obtained by normalizing the instantaneous angle difference between two adjacent sampling times (mapping to the range of -180° to +180°). V . Δθ V Multiply by the dimensionless proportionality coefficient K equiv =120 / (ω×Δt in degrees) is converted to the equivalent interphase angle x. equiv For Δt = 3.33 milliseconds, ω × Δt = 60 degrees, K equiv =120 / 60=2.
[0107] x under positive order condition equiv =60°×2=120°, under the reverse order condition x equiv =-60°×2=-120°, which corresponds exactly to the forward and reverse values of the ideal alternating angle.
[0108] The equivalent alternating angle is subtracted from the positive-sequence ideal value of 120° and the negative-sequence ideal value of -120°, respectively. After angle normalization and squaring, the positive-sequence cost J is obtained. pos =[wrap(x equiv -120)] 2 and reverse generation value J neg =[wrap(x equiv +120)] 2 All units are deg 2 .
[0109] The consistency criterion is that when the sequential probability ratio test determines the order as positive and J... pos <J neg When the sequential probability ratio test indicates a reverse order and J... neg <J pos When the two indicate different directions, the decision is confirmed to be valid; when the two indicate different directions, an uncertain state is output and the protection logic is entered.
[0110] The signal processing paths of the cross-validation pathway (arctangent operation, angle difference, scaling transformation, cost function) are completely different from those of the main pathway (cross product, sequential accumulation). They use the same raw data but undergo different mathematical transformations. Therefore, numerical anomalies unique to one path will not affect the other path at the same time, thus achieving redundant verification.
[0111] Example 6: Fusion Confidence Assessment
[0112] This embodiment corresponds to the following: "The system also includes a fusion confidence assessment module, used to comprehensively evaluate the decision confidence of the sequential probability ratio test path and the cross-validation path after normalization; the normalized confidence of the sequential probability ratio test path is determined by dividing the absolute value of the cumulative log-likelihood ratio by the decision threshold; the normalized confidence of the cross-validation path is determined by dividing the absolute value of the difference between the positive and negative generation values by the nominal cost difference under ideal equilibrium conditions; both are dimensionless quantities, and after normalization, their dimensions are consistent, thus allowing for comparison; the fusion confidence is the smaller value among the normalized confidence of the two paths, representing the minimum guaranteed confidence level of the system as a whole."
[0113] The integrated confidence assessment module normalizes and comprehensively evaluates the decision confidence of the sequential probability ratio test and cross-validation pathways.
[0114] The normalized confidence level of the sequential probability ratio test path is: ρ SPRT =|S n | / A. Where |S n | represents the absolute value of the cumulative log-likelihood ratio (dimensionless), A is the decision threshold (dimensionless), and ρ SPRT ρ is dimensionless. ρ is the value when the sequential test just crosses the threshold. SPRT =1, the value increases the further away it is.
[0115] The normalized confidence level of the cross-validation pathway is: ρ cost =|J pos -J neg | / J ref J pos and J neg The value of forward and reverse order (unit: deg) 2 ), J ref =14400 deg 2 The nominal cost difference under ideal equilibrium conditions (corresponding to 120 when inputting in standard forward or reverse order). 2 =14400 deg 2 (as a normalization reference value), ρ cost ρ is dimensionless. Under ideal equilibrium conditions... cost =1, ρ under non-ideal conditions cost It can be greater than or less than 1.
[0116] After normalization, the two can be directly compared. The fusion confidence score is the smaller value between the two pathways: ρ fused =min(ρ SPRT ,ρ cost The design considerations for adopting the minimum value strategy are as follows:
[0117] The two paths use the same raw ADC sampled data as input, but undergo completely different mathematical transformation paths—the main path calculates the output S through cross product and sequential accumulation. n The cross-validation path outputs J via arctangent, angle difference, and cost function. pos and J neg Since the two pathways are not based on statistically independent information sources, the joint misclassification rate cannot be reduced by several orders of magnitude simply by multiplying their respective misclassification rates using the probability multiplication rule. The strategy of minimizing the value reflects a conservative design principle, meaning the overall confidence level of the system is determined by the minimum value of the two pathways. The engineering value of this strategy lies in the fact that if one pathway gives an excessively high confidence level due to numerical anomalies or model bias, the other pathway can act as a counterbalance, preventing the system from making erroneous high-confidence decisions when a single pathway fails. When ρ fused A value ≥1 indicates that both pathways have sufficient evidence to support the decision, and the system executes subsequent operations with high confidence; when ρ fused A value <1 indicates insufficient evidence for at least one pathway and should be treated with caution.
[0118] It should be noted that the primary security objective of this dual-path structure is heterogeneous redundancy verification: the mathematical transformation paths of the two paths are different, and numerical anomalies specific to one path (such as the decrease in accuracy of the arctangent function under a specific input or the sensitivity degradation of the cross product in the near-zero amplitude range) will not simultaneously affect the other path. Therefore, the dual-path consistency check can effectively detect abnormal decisions in a single path. The single-path misclassification rate of the SPRT main path is defined by α and β given by the Wald inequality. The cross-validation path, as a heterogeneous redundancy check, further reduces the possibility of overall misclassification. However, the precise quantification of the overall misclassification rate depends on the correlation structure of the error sources of the two paths. Using the Wald inequality guarantee of the SPRT single path as the upper bound of the overall misclassification rate is the optimal evaluation method.
[0119] Example 7: Enhanced Safety Interlock
[0120] This embodiment corresponds to the following: "The enhanced enable judgment executed by the safety interlock unit adds two conditions to the original three conditions: the load current is lower than the safety threshold, the circuit breaker is in the open state, and there is no arc detection signal. The minimum amplitude of the space vector is greater than the phase loss detection threshold, and the three-phase imbalance factor is lower than the severe imbalance threshold. The phase loss detection threshold is determined by multiplying the nominal amplitude of the space vector under rated conditions by a preset proportional coefficient. The severe imbalance threshold is a preset dimensionless constant. The commutation operation is allowed only when all five conditions are met simultaneously. If any condition is not met, commutation is prohibited and an alarm is issued."
[0121] The enhanced enable judgment performed by the safety interlock unit includes five conditions, and commutation operation is allowed only when all conditions are met simultaneously.
[0122] The first condition is the load current I. load Below the safety threshold I th Both are in units of A and I. th It is usually set at 1% to 5% of the rated current. The second condition is that the circuit breaker is in the open state (S). breaker =OPEN. The third condition is NoArc=TRUE (no arc detection signal). The above three conditions are the original safety interlock conditions.
[0123] Based on this, two additional conditions are added, based on the Clarke transform output information. The fourth condition is the minimum magnitude R of the spatial vector. min Greater than the phase loss detection threshold R loss Both are measured in units of V. R loss =0.3×U ms This is 30% of the nominal amplitude of the space vector under rated conditions. When a phase voltage is lost, the minimum amplitude of the space vector drops significantly and falls below this threshold. The fifth condition is the three-phase imbalance factor U. BF Below the severe imbalance threshold U BFcrit Both are dimensionless quantities, U BFcrit The preferred value is 0.45.
[0124] The expression for the enhanced interlock condition is: Enable=(I load ≤I th )∧(S breaker =OPEN)∧(NoArc=TRUE)∧(R min >R loss )∧(U BF BFcrit ).
[0125] The information for the fourth and fifth conditions comes from the byproduct calculations of the Clarke transform, requiring no additional sensors or sampling channels, thus achieving zero-hardware-cost safety enhancement. Its physical meaning is: even if the load is disconnected and the circuit breaker is open, if a suspected phase loss or severe imbalance is detected, the system will not perform commutation but will issue an alarm awaiting manual investigation.
[0126] Example 8: Correction Implementation and Verification
[0127] This embodiment corresponds to the following: "The correction execution unit adopts a permutation matrix control framework, mapping the three-phase input lines to three-phase output lines via a permutation matrix. In the positive sequence, the mapping relationship is an identical mapping, meaning each phase remains in its original position. When a reverse sequence is detected, the mapping relationship of the corresponding two phase positions is swapped. The commutation execution mechanism uses two single-pole double-throw power relays to physically switch the two phases to be switched. One phase is directly connected without going through the commutation execution mechanism. The common terminal of the first relay is connected to the input terminal of the first phase to be switched, and the common terminal of the second relay is connected to the input terminal of the second phase to be switched. The two relays, in their default unpowered state, achieve the physical switching through their normally closed contacts." The current direct mapping achieves two-phase switching mapping through their normally open contacts under synchronous energization. The relay contacts have a break-before-make characteristic; the moving contact has a transition gap where neither end makes contact before reaching the normally open contact after disengaging from the normally closed contact, ensuring no two-phase short circuit occurs during commutation. Each relay is equipped with an auxiliary contact to provide feedback on the contact switching status to the microcontroller. After issuing a commutation enable signal, the microcontroller checks whether the auxiliary contact has reached the target state to confirm the completion of the commutation mechanical action. After commutation, the system re-executes the complete detection process from sampling to decision for verification testing. Only after confirming that the output phase sequence has returned to the positive sequence is the circuit breaker closed to restore power supply.
[0128] The correction execution unit consists of two parts: a commutation execution mechanism and a drive control circuit.
[0129] like Figure 7 As shown, the commutation actuator uses a dual-path single-pole double-throw (SPDT) power relay to physically switch between phases B and C. Phase A bypasses the commutation actuator and is directly connected from the input to the output of the distribution box via a separate copper busbar. The common terminal (COM) of the first relay K1 is connected to the input of phase B, its normally closed contact (NC) is connected to the output of phase B, and its normally open contact (NO) is connected to the output of phase C. The common terminal (COM) of the second relay K2 is connected to the input of phase C, its normally closed contact (NC) is connected to the output of phase C, and its normally open contact (NO) is connected to the output of phase B. The coils of both relays are synchronously controlled by a microcontroller through optocoupler isolation and a MOSFET drive circuit.
[0130] In the default state (both relays are not energized), the common terminal of K1 is connected to the B-phase output through a normally closed contact, and the common terminal of K2 is connected to the C-phase output through a normally closed contact, achieving a positive-sequence direct-through mapping, corresponding to the identity permutation matrix. When the microcontroller outputs a commutation enable signal, both relays are simultaneously energized. The common terminal of K1 switches to its normally open contact to connect to the C-phase output, and the common terminal of K2 switches to its normally open contact to connect to the B-phase output, achieving the interchange of B and C phases, corresponding to the permutation matrix P. BC .
[0131] Relay contact switching inherently possesses a break-before-make characteristic. After the moving contact disengages from the normally closed contact and before reaching the normally open contact, there is a transition gap (typically 1 to 3 milliseconds) during which neither end makes contact, ensuring that phase B and phase C are not short-circuited during commutation. Since the commutation operation is performed under the condition that the circuit breaker is open and the load current is zero (guaranteed by safety interlocking conditions), the brief open circuit during the transition gap will not affect any equipment.
[0132] The selection requirements for relays are as follows: rated contact current not less than 63A, rated voltage not less than 400V AC, and contact material is AgS. n O2 silver-tin oxide alloy (contact resistance less than 1mΩ), SPDT (single-pole double-throw) contact type, 12V DC or 24V DC coil voltage (matching the control power supply of the distribution box), mechanical life not less than 100,000 cycles, electrical life (under rated load) not less than 10,000 cycles. The relay's pull-in time (from coil energization to stable contact switching) is typically 10 to 20 milliseconds, and the release time (from coil de-energization to contact return) is typically 5 to 10 milliseconds. Therefore, the commutation execution time t switch It takes approximately 20 to 30 milliseconds.
[0133] To achieve closed-loop confirmation of commutation status, each relay is equipped with a set of auxiliary contacts (micro-switches linked to the main contacts). The status of the auxiliary contacts is connected to the digital input port of the microcontroller via pull-up resistors. After the microcontroller sends a commutation enable signal, it checks within 100 milliseconds whether the auxiliary contacts of both relays have switched to the target state: if the switching is confirmed to be complete, the commutation mechanical action is considered successful; if the target state is not detected within the time limit, a mechanical fault is identified and an alarm is issued, maintaining the circuit breaker in the open state.
[0134] The relays are installed on an insulating base plate inside the distribution box. The creepage distance between two relays is not less than 8 mm, meeting the insulation requirements of IEC 60947 for low-voltage switchgear. The electrical life of the relays is not less than 10,000 commutation cycles (one cycle each from pass-through to switching and from switching to pass-through). This lifespan is sufficient for typical distribution box usage scenarios (tested after each rewiring, with wiring adjustments typically not exceeding several hundred times throughout the entire lifespan of each device).
[0135] The control logic of the correction execution unit adopts a permutation matrix framework. The three-phase input lines are represented as column vectors v. in =[A,B,C]^T, the output line is represented as v out =[A',B',C']^T, where the commutation operation is represented as v out =P×v inWhere P is a 3×3 permutation matrix. In the forward sequence, the mapping relationship is an identity mapping, meaning P is the identity matrix, and each phase remains in its original position. When a reverse sequence is detected, the permutation matrices P of phases B and C are swapped. BC This makes the first line [1,0,0], the second line [0,0,1], and the third line [0,1,0].
[0136] The coverage of the BC interchange strategy for all reverse arrangements is explained below. There are three possible reverse arrangements in a three-phase system: ACB, CBA, and BAC. This system detects the rotation direction of the space vector (counterclockwise or clockwise) rather than the absolute phase distribution of the three phases. All three reverse arrangements produce a clockwise rotation (i.e., C...). j <0). Swapping any two phases in a three-phase system will reverse the rotation direction. Therefore, after swapping BC in any of the above reverse-sequence arrangements, the rotation direction changes from clockwise to counterclockwise (positive-sequence rotation direction). Specifically, ACB becomes ABC (standard positive sequence) after BC swapping, CBA becomes CAB after BC swapping, and BAC becomes BCA after BC swapping. Although CAB and BCA are not standard ABC arrangements, their rotation direction is counterclockwise, which is equivalent to positive-sequence power supply for a three-phase load. The verification test after phase swapping checks the rotation direction rather than the absolute phase sequence, thus correctly confirming it as positive sequence and closing the circuit breaker to restore power supply.
[0137] After the phase commutation is completed, the system re-executes the complete detection process from sampling to decision for verification testing. If the verification result is positive, the correction is confirmed to be successful, and the circuit breaker is closed to restore power supply. If the verification result is still not positive, the circuit breaker remains open and a fault alarm is issued.
[0138] Example 9: Dual Constraints on Sampling Interval
[0139] This embodiment corresponds to the following: "The sampling time interval of the system is simultaneously constrained by both Clarke transform cross product sensitivity and sequential test time budget constraints; from the perspective of cross product sensitivity, the spatial vector rotation angle between two samples is required to be within the range of 30 to 90 degrees, so that the cross product amplitude maintains a sufficiently high signal-to-noise ratio; from the perspective of time budget, the maximum number of samples obtained by dividing the maximum allowable time of the detection phase by the sampling interval is sufficient to provide sufficient accumulation margin for sequential test under abnormal conditions; the engineering balance point of the two constraints is 1 / 6 of the power frequency period, corresponding to a rotation angle of 60 degrees."
[0140] The sampling time interval Δt is subject to both the Clarke transform cross product sensitivity constraint and the sequential test time budget constraint.
[0141] From the perspective of cross product sensitivity, the nominal amplitude of the cross product is |C|. nom =U2 ms ×|sin(ω×Δt)|. To achieve sufficiently high sensitivity, |sin(ω×Δt)| needs to be non-zero, requiring the spatial vector rotation angle ω×Δt between two samples to be within the range of 30 to 90 degrees, corresponding to Δt between 1.67 milliseconds and 5.0 milliseconds.
[0142] From a time budgeting perspective, the maximum allowable time t for the testing phase budget Divide by Δt to get the maximum number of samples N max The smaller Δt is, the more N max The larger the value of Δt, the more samples can be accumulated in the sequential test under abnormal conditions; however, if Δt is too small, it will reduce the sensitivity of the cross product.
[0143] The engineering equilibrium point for the two constraints is one-sixth of the power frequency cycle, i.e., Δt = T / 6 ≈ 3.33 milliseconds, corresponding to a rotation angle of 60 degrees. At this interval, the cross-product sensitivity reaches 86.6% of the nominal maximum value (sin60° ≈ 0.866), while N... max =200 / 3.33≈60, providing ample margin for exceptional circumstances.
[0144] Example 10: Three-Layer Fusion Processing Architecture
[0145] This embodiment corresponds to the following: "The system adopts a three-layer fusion processing architecture. The front-end feature extraction layer uses Clarke transform as its core, outputting four types of signals from the two-phase stationary coordinate system of a single transform, simultaneously calculating the cross product value, spatial vector magnitude, three-phase imbalance factor, and reconstructed phase angle, achieving four-way multiplexing in a single transform. The intermediate adaptive inference layer uses sequential probability ratio testing as its core. The main path receives the cross product value sequence and performs sequential decision-making, the feedback path receives the three-phase imbalance factor and dynamically adjusts the noise model parameters, and the cross-validation path receives the reconstructed phase angle and performs independent cost function scoring. The back-end control execution layer receives the decision results from the intermediate layer and outputs commutation control commands in conjunction with enhanced safety interlock conditions. The three layers achieve deep interleaving and collaborative operation through four data paths: the cross product forward path, the imbalance factor feedback path, the phase angle cross-validation path, and the enhanced interlock path."
[0146] Among them, such as Figure 4 As shown, the system adopts a three-layer fusion processing architecture.
[0147] The front-end feature extraction layer uses Clarke transform as its core, outputting (u) from two phases of stationary coordinate system after a single transform. α ,u β Simultaneously calculate four types of signals: cross product C j (By cross-multiplying and subtracting the components at two different times), spatial vector magnitude Rk (by taking the square root of the sum of the squares of the two components), three-phase imbalance factor U. BF(Through the ratio of extreme values of multiple amplitudes) and the reconstructed phase angle θ V (Through the arctangent function). A single Clarke transform requires only 3 to 4 multiplications and 3 additions / subtractions, with minimal additional computational cost for the four signal types, achieving four-way multiplexing with a single transform.
[0148] The intermediate adaptive inference layer, centered on the sequential probability ratio test, comprises three cooperative pathways. The main pathway receives the cross product sequence and performs sequential decision-making; the feedback pathway receives the three-phase imbalance factor and dynamically adjusts the noise model parameters σ. C The cross-validation path receives the reconstructed phase angle and performs independent cost function scoring. The three paths share the front-end output but perform different mathematical transformations, providing multiple verifications for the decision result.
[0149] The backend control execution layer receives the decision result from the intermediate layer, and combines it with the enhanced security interlock conditions (including R from the frontend). min and U BF The system determines whether to perform commutation based on information and outputs commutation control commands through the commutation actuator.
[0150] The three layers achieve deep interleaving and coordinated operation through four data paths: cross-product forward path, unbalanced factor feedback path, phase angle cross-validation path, and enhanced interlocking path.
[0151] Multi-algorithm cross-fusion implementation process
[0152] like Figure 5 As shown, this application details the cross-fusion implementation process of the Clarke transform space vector rotation direction discrimination algorithm and the sequential probability ratio test adaptive optimal stopping decision algorithm in a practical engineering scenario of phase sequence detection in a three-phase distribution box. This fusion process achieves interleaved calculations at the data level and bidirectional adjustment at the parameter level within each sampling step.
[0153] Step 1: The Clarke converter front end generates the intermediate results required for fusion under three-phase voltage sampling conditions.
[0154] After the distribution box is powered on or a detection command is received, the three-phase voltage synchronous sampling module triggers the three ADCs at 3.33 millisecond intervals. Taking a 380V three-phase power supply at a construction site as an example: the three-phase line voltage is stepped down by a resistor divider network and then fed into the ADC after being superimposed with a DC bias. The microcontroller reads the ADC value and subtracts the 1.65V bias in the software to recover the true AC instantaneous value. Taking the phase point ωt=60° in the power frequency cycle as an example (i.e., the A-phase sine wave is 60 degrees after its zero-crossing point), the instantaneous sampling value of phase A is u. A =1.65×sin(60°)=1.43V, phase B is u B=1.65×sin(60°-120°)=1.65×sin(-60°)=-1.43V, C phase is u C =1.65×sin(60°-240°)=1.65×sin(-180°)=0V. This can be verified. A +u B +u C =1.43-1.43+0=0V, which meets the fundamental constraint that the sum of the instantaneous values of the three-phase voltages in a three-phase three-wire system is always zero. The Clarke transformation calculation unit performs an equal-amplitude Clarke transformation on the above three-phase voltages: u α =(2 / 3)×1.43-(1 / 3)×(-1.43)-(1 / 3)×0=0.953+0.477+0=1.43V; u β =(√3 / 3)×(-1.43-0)=0.577×(-1.43)=-0.825V. Therefore, the spatial vector V=(1.43,-0.825). Simultaneously, the magnitude of the spatial vector R=√(1.43 / 3) is calculated. 2 +0.825 2 The amplitude is √(2.045 + 0.681) = √2.726 = 1.65V. This amplitude is exactly equal to the peak voltage U at the sampling terminal. ms =1.65V, verifying the fundamental property that the amplitude of the spatial vector output by the equal amplitude Clarke transform under balanced three-phase conditions is equal to the original peak value.
[0155] This step produces three intermediate results: two-phase stationary coordinate system components (u α ,u β The spatial vector magnitude R is calculated. At the next sampling time 3.33 milliseconds later, the system acquires a new set of sampled values in the exact same way and calculates the second spatial vector and magnitude. At this point, the cross product C can be further calculated. j =u α,1 ×u β,2 -u β,1 ×u α,2 And calculate or update the three-phase imbalance factor U BF .
[0156] Step 2: The cross product of the Clarke transform is directly passed to the decision unit of the sequential probability ratio test as the core observation.
[0157] The above cross product value C j (Unit V) 2 The cross product of the Clarke transform is passed to the sequential probability ratio test decision unit as an observation in its hypothesis testing model. The passing process requires no dimension transformation; the theoretical mean of the cross product under the positive-order hypothesis H0 is +μ. C =U2 ms ×sin(ω×Δt) (unit V) 2 The theoretical mean under the inversion hypothesis H1 is -μ C (Unit V) 2 The measured value of the cross product C j (Unit V) 2 It naturally satisfies the known mean and additive Gaussian noise model conditions required for the sequential probability ratio test. The sequential probability ratio test decision unit will receive C j Substituting into the log-likelihood ratio formula λ j =-2×μ C ×C j / σ 2 C Perform the calculation.
[0158] The point of convergence here is: λ j molecule-2μ C ×C j It also includes the structural parameters of the Clarke transform (via μ). C The sin(ω×Δt) term in the equation and the real-time output of the Clarke transform (C j (itself), while σ in the denominator 2 C This is due to feedback adjustment from the imbalance factor in step three. C under forward input... j For a positive value, λ j For negative values (H0 supported), input C in reverse order. j The negative value of λ makes j If the value is positive (supports H1), it aligns with decision rule S. n ≥A is judged as reverse order, S n ≤B is considered to be positive order and consistent.
[0159] Step 3: The imbalance factor of the Clarke transform is fed back in real time, and the sequential probability ratio test decision unit adjusts the noise model parameters accordingly.
[0160] During the calculation of the spatial vector magnitude Rk in step one, the system simultaneously maintains the maximum value R of the magnitudes at multiple sampling points. max and minimum value R min Based on this, the three-phase imbalance factor U is calculated. BF =(R max -R min ) / (R max +R min The U BF The value is transmitted in real time to the sequential probability ratio test decision unit to adjust the noise standard deviation parameter: σ. C =σ C,base ×(1+γ×U BFTaking an actual construction site as an example, when a sudden change in the generator load causes the B-phase voltage to drop by approximately 25%, the spatial vector amplitude will exhibit periodic fluctuations during rotation. max It may reach 1.65V while R min Dropped to 1.38V, U BF =(1.65-1.38) / (1.65+1.38)=0.27 / 3.03≈0.089. At this time, σ C =σ C,base ×(1+3×0.089)=1.267×σ C,base The noise parameter increases by approximately 26.7%. This reduces the decision increment λ at each step of the sequential test. j The absolute value decreases to 1 / (1.267) of its original value. 2 ≈62.3%. Although the increment per step has decreased, the absolute value of the cumulative amount of a sample is still sufficient to exceed the absolute value of the decision threshold |A|=|B|=6.907, provided that the signal is still identifiable.
[0161] In more extreme cases, such as U BF =0.45 (close to the edge of phase loss), σ C Increased to 2.35 × σ C,base Each step further reduces the increment. If the signal itself also deviates from the nominal value due to imbalance, sequential testing may require 2 to 3 samples to accumulate sufficient evidence. This adaptive behavior is entirely determined by U. BF It is driven by a feedback path and requires no manual parameter adjustment.
[0162] Step 4: The cross-validation pathway runs synchronously, and the decision result of the sequential probability ratio test is compared with the cost function score to form an iterative coupled validation.
[0163] In step two, while the sequential probability ratio test makes a decision, the cross-validation unit uses the (u) generated in step one. α ,u β Calculate the instantaneous angle θ of a spatial vector using the arctangent function. V =atan2(u β ,u α The angle difference between adjacent sampling points is normalized and scaled to convert it into an equivalent interphase angle x. equiv =Δθ V ×K equiv Substituting into the cost function, we get J pos and J neg This pathway uses the same set of Clarke transform outputs as the main pathway (cross product → sequential probability ratio test) but undergoes a completely different mathematical transformation path, providing an independent decision reference.
[0164] The consistency comparison rule is: if the sequential probability ratio test determines it to be positive and J pos <J neg (The cost function also points to the positive order), or the sequential probability ratio test determines it to be in reverse order and J neg <J pos (If the cost function also points to the reverse order), then the two paths are consistent, confirming the validity of the decision. If the two paths are inconsistent, then an uncertain state is output.
[0165] In subsequent confirmatory tests (the system retests after the phase commutation operation), the results of the cross-validation pathway can be used to back-verify whether the calibration parameters of the sequential probability ratio test are still accurate. If the cost function difference of the cross-validation pathway remains consistently small (i.e., ρ) in multiple validation tests... cost Persistently below ρ SPRT ), which may indicate σ C,base The calibration value needs to be updated, and the system can record this information in the background for reference during maintenance.
[0166] Step 5: In actual operation of the distribution box, the triggering condition for the above cross-fusion cycle is the power-on initialization of the distribution box or the receipt of an external detection command.
[0167] The termination condition for the fusion loop is: the cumulative log-likelihood ratio S of the sequential probability ratio test. n If the upper threshold A or lower threshold B is exceeded (normal termination), or the number of sampling times n reaches the maximum number of samples N. max =60 (Timeout Termination). In the case of normal termination, the consistency check result of the cross-validation path further determines whether the final decision is a valid decision or an uncertain state. In the case of timeout termination, the system directly outputs an uncertain state.
[0168] The convergence criterion is the fusion confidence ρ fused =min(ρ SPRT ,ρ cost )≥1.0. When this value is greater than or equal to 1.0, it indicates that both paths support the same decision direction with sufficient evidence, and the system executes subsequent operations with high confidence (directly closing the circuit breaker to supply power in the forward sequence, and entering the enhanced safety interlock and commutation execution process in the reverse sequence). When ρ fused A value less than 1.0 indicates insufficient evidence for at least one path, requiring additional sampling or the system to enter a protected state.
[0169] In practical engineering, the above five steps are executed synchronously within each sampling step (3.33 milliseconds). The Clarke transform calculation unit generates U while generating the cross product value. BF And the reconstructed phase angle, the sequential probability ratio test decision unit simultaneously accepts U when calculating the log-likelihood ratio. BF For σ CAfter the cost function is scored, the cross-validation unit compares its results with the sequential verification results. The entire fusion process can be completed within a single timer interrupt service routine.
[0170] This application provides a specific implementation method of the fusion algorithm on an STM32F103 microcontroller (72MHz main frequency, no floating-point arithmetic unit), including pseudocode, complexity analysis and feasibility demonstration.
[0171] The core computation loop pseudocode for the fusion algorithm is as follows (triggered by a timer interrupt every 3.33 milliseconds):
[0172] FUNCTION TimerISR_FusedDetection():
[0173] / / Step 1: ADC sampling and DC bias removal
[0174] u_A = ReadADC(CH_A) - V_BIAS / / Read the A-phase ADC value and subtract 1.65V bias.
[0175] u_B = ReadADC(CH_B) - V_BIAS / / Read the B-phase ADC value and subtract 1.65V bias.
[0176] u_C = ReadADC(CH_C) - V_BIAS / / Read the C-phase ADC value and subtract 1.65V bias.
[0177] / / Step 2: Clarke Transform
[0178] u_alpha = a1 * u_A - a2 * u_B - a2 * u_C
[0179] u_beta = b1 * (u_B - u_C)
[0180] / / Step 3: Spatial vector magnitude and instantaneous angle (calculated in each iteration)
[0181] R_curr = FastSqrt(u_alpha * u_alpha + u_beta * u_beta)
[0182] IF R_curr>R_max THEN R_max = R_curr
[0183] IF R_curr <R_min THEN R_min = R_curr
[0184] theta_V_curr = FastAtan2(u_beta, u_alpha)
[0185] / / Step 4: If this is not the first sampling, calculate the cross product and UBF.
[0186] IF n>0 THEN
[0187] / / Cross product calculation (2 multiplications, 1 subtraction)
[0188] C_n = u_alpha_prev * u_beta - u_beta_prev * u_alpha
[0189] / / UBF calculation (1 subtraction, 1 addition, 1 division)
[0190] UBF = (R_max - R_min) / (R_max + R_min)
[0191] / / Sigma_C adaptive update (1 multiplication, 1 addition)
[0192] sigma_C = sigma_C_base * (1 + gamma * UBF)
[0193] / / Log-likelihood ratio (2 multiplications, 1 division, including negative signs)
[0194] lambda_n = -2 * mu_C * C_n / (sigma_C * sigma_C)
[0195] / / Cumulative update (1 addition)
[0196] S = S + lambda_n
[0197] / / Step 5: Cross-validation pathway
[0198] delta_theta = WrapDeg(theta_V_curr - theta_V_prev)
[0199] x_equiv = delta_theta * K_equiv
[0200] e_pos = WrapDeg(x_equiv - 120)
[0201] e_neg = WrapDeg(x_equiv + 120)
[0202] J_pos = e_pos * e_pos
[0203] J_neg = e_neg * e_neg
[0204] / / Step 6: SPRT Decision
[0205] IF S>= A THEN
[0206] sprt_result = NEGATIVE_SEQ
[0207] GOTO CrossCheck
[0208] ELSEIF S<= B THEN
[0209] sprt_result = POSITIVE_SEQ
[0210] GOTO CrossCheck
[0211] ELSEIF n>= N_max THEN
[0212] final_result = UNDETERMINED
[0213] GOTO Output
[0214] ELSE
[0215] / / Continue sampling and save the current value
[0216] GOTO SaveAndReturn
[0217] ENDIF
[0218] CrossCheck:
[0219] / / Cross-validation consistency check
[0220] IF sprt_result == POSITIVE_SEQ AND J_pos <J_neg THEN
[0221] final_result = POSITIVE_SEQ
[0222] ELSEIF sprt_result == NEGATIVE_SEQ AND J_neg <J_pos THEN
[0223] final_result = NEGATIVE_SEQ
[0224] ELSE
[0225] final_result = UNDETERMINED
[0226] ENDIF
[0227] / / Fusion confidence
[0228] rho_SPRT = Abs(S) / A
[0229] rho_cost = Abs(J_pos - J_neg) / J_ref
[0230] rho_fused = Min(rho_SPRT, rho_cost)
[0231] Output:
[0232] SetDetectionResult(final_result, rho_fused)
[0233] RETURN
[0234] SaveAndReturn:
[0235] ENDIF
[0236] / / Save the current value for the next iteration
[0237] u_alpha_prev = u_alpha
[0238] u_beta_prev = u_beta
[0239] theta_V_prev = theta_V_curr
[0240] n = n + 1
[0241] RETURN
[0242] END FUNCTION
[0243] Where VBIAS is a 1.65V DC bias constant, FastSqrt() is a fast square root approximation function based on Newton's iteration method (achieving 0.1% accuracy in 2 to 3 iterations), FastAtan2() is a fast arctangent function based on the CORDIC algorithm or lookup table interpolation, and WrapDeg() is the angle normalization function. Note that the calculation of thetaVcurr occurs before the IF n>0 check (step 3), ensuring that the instantaneous angle is calculated and saved during the first sampling (n=0), so that thetaVprev has the correct initial value when entering the cross-validation path during the second sampling (n=1), and that θ is stored in state S1" of the state machine. V,1 "meaning Figure 1 To.
[0244] In the pseudocode, the log-likelihood ratio is calculated as lambdan = -2 * mu. C * C n The negative sign of / (sigmaC * sigmaC) comes from the derivation of the standard SPRT. Let's verify this using a forward input as an example: Cn is positive (forward cross product), lambdan is negative, and S accumulates to a negative value and eventually falls below the lower threshold B (approximately -6.907), thus it's classified as POSITIVESEQ (forward), consistent with physical intuition. Similarly, let's verify this using a reverse input as an example: Cn is negative (reverse cross product), lambdan is positive, and S accumulates to a positive value and eventually exceeds the upper threshold A (approximately 6.907), thus it's classified as NEGATIVESEQ (reverse), also consistent with physical intuition.
[0245] Time Complexity Analysis: The core computation of each sampling step is in O(1) constant time, without involving loops or recursion. Specifically, the number of operations is approximately 15 multiplications / divisions, 10 additions / subtractions, 1 square root, and 1 arctangent. During the cumulative process of the sequential probability ratio test, the update of the S value is also O(1). The total complexity of the entire detection process is O(N), where N is the actual number of samples, with N=1 in the best case and N=N in the worst case. max =60.
[0246] Space complexity analysis: The state variables that the algorithm needs to store include the Clarke output u from the previous sampling point. α,prev u β,prev θ V,prev (3 floating-point numbers), cumulative amount S (1 floating-point number), R max and R min There are 7 variables in total: two floating-point numbers and a counter n (one integer), occupying 28 bytes of RAM. There are approximately 10 parameter constants, occupying 40 bytes of Flash. The total storage requirement is approximately 68 bytes, which is negligible.
[0247] Hardware computing resource requirements assessment: On an STM32F103 (72MHz, no FPU), the execution time for a fixed-point multiplication instruction is approximately 1 to 2 clock cycles (using a hardware multiplier), while floating-point multiplication, simulated via a software library, requires approximately 20 to 40 clock cycles. 15 floating-point multiplications and divisions require approximately 600 clock cycles, 10 floating-point additions and subtractions require approximately 200 clock cycles, one FastSqrt operation requires approximately 150 clock cycles (3 Newton iterations), and one FastAtan2 operation requires approximately 300 to 500 clock cycles (CORDIC algorithm or lookup table interpolation). The total execution time is approximately 1450 to 1950 clock cycles, consuming approximately 20 to 27 microseconds at 72MHz. If fixed-point integer arithmetic is used (directly incorporating voltage values into calculations using 12-bit ADC codes), the total execution time can be further reduced to approximately 10 microseconds.
[0248] Feasibility Study: The sampling interval Δt = 3.33 milliseconds = 3330 microseconds. The algorithm computation time is approximately 20 to 27 microseconds (floating-point) or approximately 10 microseconds (fixed-point), accounting for only 0.3% to 0.8% of the sampling interval, leaving ample margin for ADC conversion (approximately 2 microseconds), interrupt management, and other system tasks. Even in the worst-case scenario (N... max With 60 samples taken (each lasting 27 microseconds), the total computation time is only 1620 microseconds ≈ 1.6 milliseconds, far less than the detection time budget of 200 milliseconds. Therefore, the fusion algorithm is entirely feasible on the STM32F103 platform.
[0249] If an STM32F4 series with a floating-point unit (168MHz clock speed, single-precision FPU) is used, each floating-point operation only requires 1 to 2 clock cycles, and the total algorithm time can be reduced to less than 5 microseconds.
[0250] like Figure 6 As shown, the collaborative control of the fusion system adopts a finite state machine architecture, which includes the following five states and their transition logic.
[0251] State S0 is the "Idle / Initialization" state. The system enters this state after power-on and performs parameter initialization (setting Clarke coefficients, SPRT thresholds, U...). BF Feedback coefficients, safety interlock parameters, etc.), initialize all state variables (S=0, n=0, R... max =0, R min =positive infinity). After initialization, transition to state S1.
[0252] State S1 is the "first sampling" state. Triggering the first synchronous sampling of the three ADCs, performing Clarke transform to calculate the first spatial vector and magnitude, and simultaneously calculating the instantaneous angle θ. V,1 =atan2(u β,1 ,u α,1), initialize R max and R min Save (u α,1 ,u β,1 ,θ V,1 Once completed, start the timer and transition to state S2.
[0253] State S2 is the "fusion detection loop" state. It is driven by a timer interrupt (triggered every 3.33 milliseconds). Each time this state is entered, the following sub-operation sequence is executed: ADC sampling, Clarke transform, spatial vector magnitude and instantaneous angle calculation, cross product calculation, and U... BF Update and σ C The process involves adaptive adjustment (feedback path), log-likelihood ratio and cumulant updates (main path), and angle difference and cost function computation (cross-validation path). The scheduling strategy for sub-operations is sequential execution, as the output of each step is the input of the next step, and there is neither an opportunity nor a need for parallelization (total execution time is only about 20 microseconds).
[0254] In state S2, the priority mechanism for decision checks is as follows: first check S... n Whether the SPRT threshold A or B has been exceeded (highest priority, determining whether to terminate sampling); if the threshold has been exceeded, cross-validation consistency check is performed; if consistent, proceed to state S3 (decision complete); if inconsistent, the final result is set to uncertain and proceed to state S3. If S... n The threshold was not exceeded and n <N max If n ≥ N, then remain in state S2 and wait for the next timer interrupt. max If the result is uncertain, then the final result will be set to uncertain and the process will proceed to state S3.
[0255] State S3 is the "Decision Completed and Interlock Check" state. The subsequent actions are determined based on the decision result and enhanced safety interlock conditions. If the final decision is a positive sequence, the circuit breaker is directly closed to restore power supply, and the system transitions to state S0. If the final decision is a negative sequence and Enable is enabled... enhanced =TRUE, transition to state S4 to perform a phase commutation. If the final decision is reversed but Enable is enabled... enhanced =FALSE (any interlock condition is not met), issue an alarm and transition to state S0. If the final decision is uncertain, issue an alarm and transition to state S0.
[0256] State S4 is the "Perform Commencing and Verification" state. The microcontroller sends a commutation enable signal to the relay drive circuit of the commutation actuator, and the two SPDT power relays are synchronously energized to complete the physical switching of phase B and phase C. After sending the enable signal, the microcontroller checks the status signals of the auxiliary contacts of the two relays, confirms that the commutation action is completed, reinitializes the detection parameters (S=0, n=0, etc.), and enters state S1 to perform verification detection. If the auxiliary contacts do not reach the target state within 100 milliseconds, a mechanical fault is determined and an alarm is issued, the circuit breaker is kept open, and the system enters state S0. If the verification detection is determined to be a positive sequence, the circuit breaker is closed, and the system enters state S0. If the verification detection is determined to be a non-positive sequence, the circuit breaker is kept open, a fault alarm is issued, and the system enters state S0.
[0257] The fault-tolerant handling and degraded operation logic under abnormal conditions includes the following mechanisms: First, ADC sampling timeout protection: If the ADC conversion is not completed within a preset time, the current sample is discarded and the abnormality count is recorded. If more than 3 consecutive abnormalities occur, a hardware fault is determined and an alarm is issued. Second, numerical overflow protection: A saturation limit of ±10000 is set for the cumulative quantity S to prevent floating-point overflow in extreme cases. Third, degraded operation mode: If the arctangent calculation of the cross-validation path is abnormal (e.g., the denominator is zero), the system can rely solely on the main path (cross product → sequential probability ratio test) for decision-making. This is equivalent to a single-path mode, and the false positive rate is guaranteed to be defined separately by α and β of SPRT through Wald's inequality. Fourth, watchdog protection: The microcontroller's independent watchdog timer is set to a 500-millisecond feeding cycle. If the algorithm enters an infinite loop for any reason, watchdog overflow will trigger a system reset.
[0258] The interface definition of the collaborative module is: the data passed from the Clarke transform calculation unit to the sequential probability ratio test decision unit includes the cross product value C. j (V) 2 (floating-point number) and imbalance factor U BF (Dimensionless floating-point numbers), implemented through globally shared variables, eliminating the need for message queues. The data passed from the Clarke transform calculation unit to the cross-validation unit is the reconstructed phase angle θ. V (Floating-point numbers in degrees). The data passed by the sequential probability ratio test decision unit and the cross-validation unit to the fusion confidence assessment module are S, respectively. n and (J) pos J neg The fusion confidence assessment module transmits the final decision result (enumerated type: ascending / descending / uncertain) and fusion confidence ρ to the safety interlock unit. fused (Dimensionless floating-point number). The safety interlock unit transmits the enable signal "Enable" to the correction execution unit. enhanced (Boolean).
[0259] The system parameters are calibrated and trained as follows:
[0260] 1. The initial system calibration process is as follows.
[0261] The first step is hardware calibration. Connect a known, accurate three-phase standard power supply (such as a Fluke 6100A series power quality standard source) to the input terminal of the distribution box, set the positive sequence ABC phase sequence, rated voltage 220V / 380V, and frequency 50Hz. Use a digital multimeter to measure the actual voltage division ratio k of the resistor voltage divider network. v The recorded values are accurate to four decimal places. The code values of the three ADCs are read at zero input and full-scale input to determine the ADC bias and gain coefficients.
[0262] The second step is to calculate the nominal value of the cross product μ. C Calibration. Under standard power supply positive sequence conditions, the system continuously collects 500 sets of cross product values (taking approximately 500 × 3.33 milliseconds ≈ 1.67 seconds), and calculates their mean as μ. C The measured calibration value. Simultaneously, this mean value is compared with the theoretical value U. 2 ms If the deviation exceeds 5%, the voltage divider network and ADC calibration need to be checked.
[0263] Step 3: Standard deviation of baseline noise σ C,base Calibration. Under standard power supply positive sequence conditions, the standard deviation is calculated using the above 500 sets of cross product values as σ. C,base Typical values should be in μ. C The interference rate should be between 1% and 3%. If it exceeds this range, it indicates the presence of an abnormal interference source that needs to be investigated.
[0264] The fourth step is to determine the SPRT threshold and error rate parameters. The values of α and β are determined based on the security level of the application scenario: for general construction power distribution, α=β=0.001 is recommended; for critical loads such as mine hoisting equipment, α=β=0.0001 is recommended. The thresholds A and B are directly calculated using the formulas A=ln((1-β) / α) and B=ln(β / (1-α)), without calibration.
[0265] The fifth step is to determine the feedback coefficient γ. The preferred value range for γ is 2 to 5. The method for determining γ is as follows: artificially introduce different degrees of three-phase imbalance into a standard power supply (sequentially setting the B-phase voltage to 95%, 90%, 85%, and 80% of its rated value), and record the U value under each condition. BF Standard deviation of the value and cross product. (U) BF The horizontal axis represents the standard deviation of the measured cross product / σ. C,basePlot a scatter plot on the vertical axis and fit a straight line y = 1 + γ × x to determine γ. If there are few data points, the least squares method can be used for fitting; if there are enough data points, a grid search can be used to search for the value of γ that minimizes the sum of squared residuals in the range γ ∈ [1, 10] with a step size of 0.5.
[0266] Step 6: Determine the interlocking parameters. Phase loss detection threshold R loss =0.3×U ms U obtained directly from hardware calibration ms Calculate the severe imbalance threshold U. BFcrit The recommended value is 0.45, and the engineering basis for this value is: when U BF When the value is >0.45, the voltage deviation of at least one phase in the three phases exceeds 25% of the rated value. Under this condition, the reliability of phase sequence determination has significantly decreased, and automatic phase commutation is not advisable. This threshold can be adjusted to the range of 0.35 to 0.55 depending on the specific application scenario.
[0267] 2. The online update of the adaptive parameters is explained below. σ C,base For semi-adaptive parameters: After each successful phase sequence detection and confirmation of a positive sequence (i.e., normal system power supply state), the background records the cross product value during this detection process and compares it with the historical σ. C,base Perform an exponentially weighted average update: σ C,base,new =0.95×σ C,base,old +0.05×σ C,measured The weight is updated to 0.05 to ensure that the parameters slowly track long-term environmental changes without being affected by single anomalies. BF The Clarke transform is used to automatically calculate σ at each sampling step, eliminating the need for offline training. C Through formula σ C =σ C,base ×(1+γ×U BF It updates automatically at each sampling step, eliminating the need for offline training.
[0268] 3. The parameter sensitivity analysis and linkage adjustment strategy are as follows: μ C Sensitive to hardware parameters: if k v If the deviation is 1%, then μ C The deviation is approximately 2% (due to μ). C Proportional to k v 2 ). σ C,base With μ C Proportional: when μ C Because k v When the deviation changes, σ C,base The absolute value of also changes approximately proportionally, but its relationship with μ is different. C The ratio σ C,base / μ CThe performance remains essentially unchanged, therefore the decision performance of SPRT is related to k. v The absolute value of γ is not sensitive. The effect of γ on detection performance is in U BF It can be ignored when it is small (normal equilibrium): because (1+γ×U BF )≈1. γ only in U BF When the value is large (severe imbalance), it significantly affects σ. C This affects the number of samples required for sequential testing. Too small a value for γ (e.g., 1) can lead to underestimating noise under imbalanced conditions, resulting in misjudgments; too large a value for γ (e.g., 10) can lead to excessively increasing sample requirements under slightly imbalanced conditions, thus slowing down the testing process. A recommended value of γ=3 provides a reasonable trade-off across the entire range from normal to severely imbalanced.
[0269] The beneficial effects of the present invention include the following aspects.
[0270] First, the detection speed has been improved by orders of magnitude. The sub-periodic feature extraction of Clarke transform eliminates the limitation of traditional methods that must wait for a complete power frequency cycle, and the optimal stopping property of sequential probability ratio test eliminates the redundancy of accumulating a fixed number of samples. The combination of the two results in an optimal detection time of only 3.33 milliseconds, which is 12 to 30 times faster than the 40 to 100 milliseconds of traditional methods.
[0271] Second, the reliability of the decision is mathematically guaranteed and quantifiable. The false positive rate of the main path in the sequential probability ratio test is defined by Wald's inequality. When α=β=0.001, the false alarm rate and false negative rate of the SPRT single path do not exceed one in a thousand. The cross-validation path uses a completely different mathematical transformation path from the main path for heterogeneous redundancy checking, which can effectively detect single-path false positives caused by numerical calculation anomalies or noise model deviations. The dual-path consistency check further reduces the actual false positive rate of the system to below the theoretical upper limit of the SPRT single path. The specific reduction depends on the correlation between the error sources of the two paths, but the Wald inequality guarantee of SPRT always serves as a safe upper limit for the overall false positive rate. This quantifiable auditable security guarantee is something that traditional methods cannot provide.
[0272] Third, the system possesses signal quality self-adaptation capability. The three-phase imbalance factor adjusts the noise parameters of the sequential test in real time through the feedback path, adapting to continuous changes in power quality from ideal to severely unbalanced without manual intervention. This eliminates the maintenance burden of manually adjusting decision parameters according to field conditions, a requirement of traditional methods.
[0273] Fourth, it expands the dimensions of fault detection without adding any hardware. While performing the core cross product calculation, the Clarke transform's byproducts can be directly used for phase loss detection and three-phase imbalance quantification. This information is organically integrated into the enhanced safety interlock conditions, providing more comprehensive safety protection than the traditional three-condition interlock.
[0274] Fifth, hardware costs are reduced and versatility is enhanced. The integrated solution replaces the dedicated phase angle sensor with a general-purpose microcontroller's built-in ADC and resistor divider network, resulting in lower hardware costs. The ADC sampling scheme simultaneously meets the data requirements of four functions: Clarke transform, sequential testing, imbalance estimation, and cross-validation, achieving efficient reuse of hardware resources.
[0275] Sixth, the computational resource requirements are extremely low. Each sampling step of the entire fusion algorithm requires only about 15 multiplications and divisions, 10 additions and subtractions, and a few special operations, taking approximately 20 to 50 microseconds on a 72MHz microcontroller, which accounts for only 0.3% to 1.5% of the sampling interval and does not constitute a computational bottleneck. The storage requirement is approximately 68 bytes of RAM, which is negligible.
Claims
1. A phase sequence automatic identification and correction distribution box system, characterized in that, include: The three-phase voltage synchronous sampling module is used to synchronously acquire the instantaneous values of the three-phase voltage through three analog-to-digital conversion channels; the Clarke transform calculation unit is used to transform the instantaneous values of the three-phase voltage into orthogonal two-phase stationary coordinate system components, and calculate the cross product value and amplitude of the spatial vector accordingly, and output the three-phase imbalance factor; the sequential probability ratio test decision unit is used to perform the sequential hypothesis test of adaptive optimal stopping with the cross product value of the spatial vector as the observation, and output the phase sequence decision result. The cross-validation unit is used to reconstruct the spatial vector rotation angle from the two-phase stationary coordinate system components, convert it into an equivalent interphase angle, input it into the cost function for independent scoring, and compare the result with the result of the sequential probability ratio test decision unit. The safety interlock unit is used to comprehensively determine whether to allow the commutation operation based on the load current, circuit breaker status, arc detection signal, spatial vector amplitude, and three-phase imbalance factor. The correction execution unit is used to drive the commutation execution mechanism to realize three-phase physical commutation according to the decision result. The algorithm executed by the Clarke transform calculation unit is a sub-periodic phase sequence feature extraction algorithm based on spatial vector rotation direction discrimination. The algorithm executed by the sequential probability ratio test decision unit is an adaptive optimal stopping phase sequence decision algorithm based on Wald sequential analysis theory. The three-phase imbalance factor output by the Clarke transform calculation unit is fed back to the sequential probability ratio test decision unit in real time, dynamically adjusting its noise model parameters to form a closed-loop decision mechanism that is adaptive to signal quality. The cross-validation unit uses the first and second axis components output by the Clarke transform to calculate the instantaneous angle of the space vector in the two-phase stationary coordinate plane using the arctangent function; the difference between the instantaneous angles at two adjacent sampling times is normalized to obtain the angle change; the angle change is multiplied by a dimensionless proportionality coefficient determined by the ratio of the ideal forward-sequence interphase angle to the single-step ideal rotation angle to convert it into an equivalent interphase angle; the equivalent interphase angle is subtracted from the forward-sequence ideal value and the reverse-sequence ideal value respectively, and then squared to obtain the forward-sequence cost value and the reverse-sequence cost value respectively; when the decision direction of the sequential probability ratio test decision unit is consistent with the direction indicated by the smaller cost value, the decision is confirmed to be valid; When the two directions are inconsistent, an uncertain state is output and the protection logic is entered. The enhanced enable judgment executed by the safety interlock unit adds two conditions to the original three conditions: load current below the safety threshold, circuit breaker in the open state, and no arc detection signal. These conditions are: minimum amplitude of space vector greater than phase loss detection threshold and three-phase imbalance factor below severe imbalance threshold. The phase loss detection threshold is determined by multiplying the nominal amplitude of space vector under rated conditions by a preset proportional coefficient. The severe imbalance threshold is a preset dimensionless constant. Phase switching is allowed only when all five conditions are met simultaneously. If any condition is not met, phase switching is prohibited and an alarm is issued.
2. The automatic phase sequence identification and correction distribution box system according to claim 1, characterized in that: The sub-periodic phase sequence feature extraction algorithm based on spatial vector rotation direction discrimination involves projecting the instantaneous sampled values of three-phase voltages onto an orthogonal two-phase stationary coordinate system using an equal-amplitude Clarke transform to obtain a first axis component and a second axis component. The first axis component is determined by subtracting 1 / 3 of the phase B voltage from 2 / 3 of the phase A voltage and then subtracting 1 / 3 of the phase C voltage. The second axis component is determined by multiplying the difference between the phase B voltage and the phase C voltage by 1 / 3 of the square root of 3. After calculating the spatial vector at two adjacent sampling times, the product of the first axis component at the previous time and the second axis component at the next time is subtracted from the product of the second axis component at the previous time and the first axis component at the next time to obtain the cross product value. The sign of the cross product value indicates the rotation direction of the spatial vector, with a positive value corresponding to forward rotation and a negative value corresponding to reverse rotation. The time interval between two sampling times is selected as 1 / 6 of the power frequency period, so that the spatial vector rotates 60 degrees between the two sampling times, and the cross product amplitude reaches a level close to the maximum value.
3. The automatic phase sequence identification and correction distribution box system according to claim 1, characterized in that: The adaptive optimal stopping phase sequence decision algorithm based on Wald sequential analysis theory models phase sequence identification as a binary hypothesis testing problem. The positive sequence hypothesis corresponds to a nominal cross product amplitude with a positive mean, and the reverse sequence hypothesis corresponds to a nominal cross product amplitude with a negative mean. For each new cross product observation, the natural logarithm of the ratio of the probability density of the observation under the two hypotheses is calculated as the single-sample log-likelihood ratio. The single-sample log-likelihood ratio is determined by multiplying twice the negative nominal cross product amplitude by the current cross product observation and dividing by the square of the noise standard deviation parameter. The log-likelihood ratios of each sample are successively accumulated to obtain the cumulative log-likelihood ratio. When the cumulative log-likelihood ratio exceeds the upper threshold determined by the preset false alarm rate and false negative rate, it is judged as reverse sequence; when it is lower than the lower threshold determined by the preset false alarm rate and false negative rate, it is judged as positive sequence; when it is between the two, sampling continues. When the number of samplings reaches the maximum number of samples determined by dividing the detection time budget by the sampling interval, if the cumulative amount still does not exceed either threshold, an uncertain state is output.
4. The automatic phase sequence identification and correction distribution box system according to claim 1, characterized in that: The Clarke transform calculation unit simultaneously calculates the spatial vector amplitude at each sampling point. The spatial vector amplitude is the square root of the sum of the squares of the first axis component and the squares of the second axis component. The maximum and minimum values of the spatial vector amplitude are taken from multiple sampling points, and the difference between the maximum and minimum values is divided by the sum of the maximum and minimum values to obtain the three-phase imbalance factor. The three-phase imbalance factor is a dimensionless quantity between 0 and 1, where 0 represents perfect balance and the closer to 1, the more severe the imbalance. The noise standard deviation parameter of the sequential probability ratio test decision unit is determined by multiplying the baseline noise standard deviation by 1, adding the feedback coefficient, and the three-phase imbalance factor. When the three-phase imbalance factor increases, the noise standard deviation parameter automatically increases, reducing the decision increment for each sample in the sequential test, thus requiring more samples to accumulate evidence, achieving adaptive adjustment of the decision sensitivity according to signal quality.
5. The automatic phase sequence identification and correction distribution box system according to claim 1, characterized in that: The system also includes a fusion confidence assessment module, which is used to normalize and comprehensively evaluate the decision confidence of the sequential probability ratio test path and the cross-validation path. The normalized confidence level of the sequential probability ratio test pathway is determined by dividing the absolute value of the cumulative log-likelihood ratio by the decision threshold; the normalized confidence level of the cross-validation pathway is determined by dividing the absolute value of the difference between the positive and negative generation values by the nominal cost difference under ideal equilibrium conditions; both are dimensionless quantities, and after normalization, their dimensions are consistent, thus allowing for comparison; the fusion confidence level is the smaller value of the normalized confidence levels of the two pathways, representing the minimum guaranteed confidence level of the system as a whole.
6. The automatic phase sequence identification and correction distribution box system according to claim 1, characterized in that: The correction execution unit adopts a permutation matrix control framework, mapping the three-phase input lines to three-phase output lines via a permutation matrix. In the positive sequence, the mapping is constant, meaning each phase remains in its original position. When a reverse sequence is detected, the mapping relationship of the corresponding two phases is swapped. The commutation execution mechanism uses two single-pole double-throw power relays to physically switch the two phases to be switched. One phase is directly connected without going through the commutation execution mechanism. The common terminal of the first relay is connected to the input terminal of the first phase to be switched, and the common terminal of the second relay is connected to the input terminal of the second phase to be switched. In the default unenergized state, the two relays achieve direct-through mapping through their normally closed contacts. Under synchronous energization, the relays achieve two-phase switching mapping through their respective normally open contacts. The contact switching of the relays has a break-before-make characteristic. There is a transition gap where neither end of the moving contact makes contact after it leaves the normally closed contact and before it reaches the normally open contact, ensuring that no two-phase short circuit occurs during the commutation process. Each relay is equipped with an auxiliary contact to provide feedback on the contact switching status to the microcontroller. After the microcontroller sends a commutation enable signal, it checks whether the auxiliary contact has reached the target state to confirm that the commutation mechanical action has been completed. After the commutation is completed, the system re-executes the complete detection process from sampling to decision for verification detection. Only after confirming that the phase sequence at the output terminal has returned to the positive sequence will the circuit breaker be closed to restore power supply.
7. The automatic phase sequence identification and correction distribution box system according to claim 1, characterized in that: The sampling time interval of the system is subject to both Clarke transform cross product sensitivity constraints and sequential test time budget constraints. From the perspective of cross product sensitivity, the spatial vector rotation angle between two samples must be within the range of 30 to 90 degrees to maintain a sufficiently high signal-to-noise ratio for the cross product amplitude. From the perspective of time budget, the maximum number of samples obtained by dividing the maximum allowable time of the detection phase by the sampling interval must be sufficient to provide ample accumulation margin for sequential test under abnormal conditions. The engineering balance point of the two constraints is 1 / 6 of the power frequency period, corresponding to a rotation angle of 60 degrees.
8. The automatic phase sequence identification and correction distribution box system according to claim 1, characterized in that: The system adopts a three-layer fusion processing architecture. The front-end feature extraction layer uses Clarke transform as its core, simultaneously calculating four types of signals from the two-phase stationary coordinate system output of a single transform: cross product value, spatial vector magnitude, three-phase imbalance factor, and reconstructed phase angle, achieving four-way multiplexing of a single transform. The intermediate adaptive inference layer uses sequential probability ratio testing as its core. The main path receives the cross product value sequence and performs sequential decision-making, the feedback path receives the three-phase imbalance factor and dynamically adjusts the noise model parameters, and the cross-validation path receives the reconstructed phase angle and performs independent cost function scoring. The back-end control execution layer receives the decision results from the intermediate layer and outputs commutation control commands in combination with enhanced safety interlock conditions. The three layers achieve deep interleaving and coordinated operation through four data paths: cross product forward path, imbalance factor feedback path, phase angle cross-validation path, and enhanced interlock path.