Fuzzy logic-based residual current automatic compensation method and system

By employing a fuzzy logic-based automatic residual current compensation method, which utilizes a fuzzy logic controller and a compensation current closed-loop controller, combined with a digital twin model and a Smith predictor, the problems of low accuracy and poor dynamic adaptability in existing technologies are solved, achieving efficient residual current compensation and cable insulation degradation detection.

CN121035997APending Publication Date: 2025-11-28STATE GRID FUJIAN ELECTRIC POWER CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511162244.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-19
Publication Date
2025-11-28

AI Technical Summary

Technical Problem

Existing residual current compensation methods suffer from problems such as low accuracy, poor dynamic adaptability, and high hardware costs in reducing the background value of the main station and improving the sensitivity of cable insulation degradation detection.

Method used

An automatic residual current compensation method based on fuzzy logic is adopted. By using a fuzzy logic controller and a compensation current closed-loop controller, iterative correction is performed through a fuzzy rule table and a digital twin model to output a precise compensation current to offset the residual current. Combined with a Smith predictor and a PID controller, accurate closed-loop regulation is achieved.

Benefits of technology

It achieves precise residual current cancellation, improves compensation accuracy and dynamic response speed, enhances system adaptability and reliability, and reduces hardware costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121035997A_ABST
    Figure CN121035997A_ABST
Patent Text Reader

Abstract

The invention relates to a residual current automatic compensation method and system based on fuzzy logic. The method comprises the following steps: acquiring residual current of a master station; inputting the residual current of the master station into a fuzzy logic controller, and outputting a reference compensation current; inputting the reference compensation current into a compensation current closed-loop controller to generate an initial compensation current and a compensation current instruction; correcting the initial compensation current based on the compensation current instruction to obtain a corrected compensation current; and a correction process is iterated, the residual current of the master station is offset based on the corrected compensation current until the current residual current of the master station is smaller than a preset residual threshold value, and the final residual current of the master station is obtained.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of residual current compensation, and mainly relates to a residual current automatic compensation method and system based on fuzzy logic. BACKGROUND

[0002] Monitoring residual current has great significance for substation fire prevention and management. In the case of large residual current background value in the whole station, the detection sensitivity of cable insulation deterioration of the whole station single-point residual current monitoring device is not high, and there is a risk of cable fire hazard and missed monitoring and alarm. By compensating the residual current, the background value is reduced, the monitoring sensitivity of cable insulation deterioration is improved, and the occurrence of low-voltage electrical fire accidents is effectively prevented.

[0003] The existing residual current compensation schemes are as follows: 1. Capacitor balance compensation scheme: for the residual current formed by the unbalance of three-phase cable capacitance to ground, a compensation capacitor is connected in parallel to the phase with smaller capacitance to make the three-phase capacitance to ground tend to balance and offset the residual current; this method has low compensation accuracy, relies on manual adjustment and has poor dynamic adaptability, and has the risk of over-compensation, so it is not suitable for complex systems; 2. Zero sequence reactor compensation scheme: a zero sequence reactor is connected in series to the neutral line, and the inductive current generated by the reactor is used to offset the capacitive residual current in the opposite direction to realize "capacitive and inductive balance" and reduce the residual current; this scheme is prone to resonance and has high loss and poor dynamic adaptability; 3. Sensor magnetic flux compensation type: a Hall sensor is used to detect the magnetic field of the leakage current, and a compensation coil is used to generate a reverse magnetic field to offset it; the compensation accuracy of this method depends on the linearity of the sensor, the compensation current is small, and the manufacturing cost of the magnetic flux gate sensor and the precision magnetic core is high; 4. Dynamic compensation method for mutual inductor accuracy error: a BP neural network is used to identify the fault type of the mutual inductor, an LSTM neural network is used to predict the residual current, and the compensation value is dynamically adjusted; this method relies on a large amount of historical data to train the model and has poor real-time performance.

[0004] Therefore, there is an urgent need for a residual current compensation method that can effectively reduce the total station residual current background value, improve the detection sensitivity of cable insulation deterioration, and has strong dynamic adaptability and controllable hardware cost. SUMMARY

[0005] In order to solve the problems existing in the prior art, the present application provides a residual current automatic compensation method and system based on fuzzy logic.

[0006] The technical scheme of the present application is as follows: On the one hand, the present application provides a residual current automatic compensation method based on fuzzy logic, which comprises the following steps: acquiring the total station residual current; inputting the total station residual current into a fuzzy logic controller to output a reference compensation current; The reference compensation current is input into a compensation current closed-loop controller to generate an initial compensation current and a compensation current instruction; the initial compensation current is corrected based on the compensation current instruction to obtain a corrected compensation current; An iterative correction process is performed to offset the total station residual current based on the corrected compensation current until the current total station residual current is less than a preset residual threshold to obtain a final total station residual current.

[0007] Preferably, the method further comprises selecting a compensation phase based on the phase angle of the total station residual current, and controlling the opening and closing of the option relay through three different I / O input option relays.

[0008] Preferably, the fuzzy logic controller comprises fuzzification processing, fuzzy reasoning based on a fuzzy rule table, and defuzzification, wherein the fuzzy rule table is updated using a digital twin model of the station power distribution system, and the specific updating steps are as follows: The amplitude, frequency and phase angle of the simulated residual current are calculated using the digital twin model of the station power distribution system; The amplitude, frequency and phase angle of the simulated residual current are input into the simulation fuzzy controller to generate an initial fuzzy rule table; The compensation current generated based on the initial fuzzy rule table is input into a residual current compensation hardware simulation model to obtain a compensated simulated residual current; It is judged whether the compensated simulated residual current reaches a preset simulated residual threshold, if yes, the initial fuzzy rule table is updated, and the updated fuzzy rule table is used as the fuzzy rule table of the fuzzy logic controller; if not, the initial fuzzy rule table is adjusted; until the preset simulated residual threshold is reached.

[0009] Preferably, the amplitude and phase angle of the total station residual current are input into the fuzzy logic controller, and the specific steps are as follows: The current compensated total station residual current and a preset total station residual current reference value are input into a subtractor to obtain an error current; The error current is subjected to differential calculation to obtain an error change rate; The error current and the error change rate are input into the fuzzy logic controller to output an amplitude increment and a phase angle increment of the reference compensation current; The amplitude increment of the reference compensation current and the amplitude of the current reference compensation current are input into a first adder to obtain a reference compensation current amplitude; The phase angle increment of the reference compensation current and the phase angle of the current reference compensation current are input into a second adder to obtain a reference compensation current phase angle; The reference compensation current is obtained based on the reference compensation current amplitude and the phase angle.

[0010] Preferably, the compensation current closed-loop controller is composed of a Smith predictor and a PID controller, and the reference compensation current is input into the compensation current closed-loop controller, and the specific steps are as follows: An error signal is generated based on the reference compensation current. The PID controller generates a compensation current command based on the error signal. The compensation current command is input into a digital-to-analog converter and a Smith predictor respectively, and a compensation current and a correction signal are output. The compensation current and the correction signal are added to obtain a corrected compensation current. A new error signal is obtained based on the corrected compensation current and the reference compensation current.

[0011] Preferably, the method further comprises collecting an actual compensation current and adjusting the compensation current closed-loop controller based on the actual compensation current.

[0012] Preferably, the method further comprises outputting a compensation current signal reference curve by a digital-to-analog converter port from the initial compensation current, and injecting the initial compensation current into the PE line through a voltage-controlled current source according to the compensation current signal reference curve.

[0013] In another aspect, the present application also provides a residual current automatic compensation system based on fuzzy logic, which comprises: A data acquisition module is configured to acquire a total station residual current and transmit the total station residual current to a fuzzy control module. The fuzzy control module is configured to input the total station residual current into a fuzzy logic controller and output a reference compensation current. A correction module is configured to input the reference compensation current into a compensation current closed-loop controller, generate an initial compensation current and a compensation current command, and correct the initial compensation current based on the compensation current command to obtain a corrected compensation current. A result output module is configured to perform an iterative correction process, offset the total station residual current based on the corrected compensation current, and obtain a final total station residual current until the current total station residual current is less than a preset residual threshold.

[0014] In still another aspect, the present application also provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the method of the present application.

[0015] In still another aspect, the present application also provides a computer readable storage medium having a computer program stored thereon, wherein the program is executable on a processor to implement the method of the present application.

[0016] The present application has the following advantages: 1. The application provides a residual current automatic compensation method and system based on fuzzy logic, which takes the error current and error change rate of the residual current after compensation and the reference value as input, outputs the amplitude increment and phase angle increment of the compensation current through the fuzzy logic controller, and realizes the accurate compensation of the residual current by gradually adjusting the compensation current based on the principle of "current vector cancellation", solves the problem of relying on manual adjustment and poor dynamic response of traditional passive compensation, improves the compensation accuracy, and can quickly respond to the dynamic changes of the residual current; 2. The application provides a residual current automatic compensation method and system based on fuzzy logic, which combines the digital twin model of the station power distribution system, simulates the residual current under the conditions of three-phase imbalance and insulation deterioration through the digital twin model, iteratively generates and updates the fuzzy rule table, ensures the consistency, continuity and completeness of the rule table, avoids the defects of relying on experience and insufficient adaptability of traditional control rules, improves the adaptability of the fuzzy rule table to the actual system, reduces the compensation deviation, and enhances the reliability of the compensation system; 3. The application provides a residual current automatic compensation method and system based on fuzzy logic, which uses Smith predictor to offset the inherent delay of the system, and combines the PID controller to realize accurate closed-loop adjustment of the compensation current, and ensures that the actual injected compensation current follows the reference value; solves the phase deviation problem caused by delay in high-frequency residual current compensation, improves the compensation accuracy of high-frequency residual current components, reduces the phase deviation, and enhances the dynamic response speed. BRIEF DESCRIPTION OF DRAWINGS

[0017] Figure 1 is the specific flowchart of the embodiment of the application; Figure 2 is the schematic diagram of the fuzzy logic controller of the embodiment of the application; Figure 3 is the schematic diagram of the compensation current closed-loop controller of the embodiment of the application. DETAILED DESCRIPTION

[0018] The technical solutions in the embodiments of the application will be described clearly and completely below with reference to the drawings in the embodiments of the application. Obviously, the described embodiments are only part of the embodiments of the application, not all the embodiments. Based on the embodiments in the application, all other embodiments obtained by those skilled in the art without creative labor are within the scope of protection of the application.

[0019] It should be understood that the step numbers used herein are only for the convenience of description, and are not limited to the execution sequence of the steps.

[0020] It is to be understood that the terminology used in the description of the application herein is for the purpose of describing particular embodiments only and is not intended to be limiting thereof. As used in the description of the application and the appended claims, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.

[0021] The terms "including" and "comprising" as used herein specify the presence of stated features, integers, steps, operations, elements, and / or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof.

[0022] The term "and / or" means any combination of one or more of the associated listed items and all possible combinations thereof.

[0023] Embodiment One: Referring to Figure 1 The present application provides a fuzzy logic-based residual current automatic compensation method, which comprises: S1, acquiring the total station residual current through an ADC channel 1 by using a first high-precision residual current transformer, and calculating the amplitude, frequency and phase angle of the total station residual current by using fast Fourier transform; The total station refers to the entire low-voltage power distribution system or the entire site of the substation, and is the overall object of residual current monitoring and compensation; The method further comprises selecting a compensation phase based on the phase angle of the total station residual current, and controlling the opening and closing of switches K1, K2 and K3 of the option relay through the option relay on three different I / O input PE lines; The PE line includes a first high-precision residual current transformer, an option relay, a rectifier filter circuit, a current limiting resistor, a voltage-controlled current source and a second high-precision residual current transformer; S2, inputting the total station residual current into a fuzzy logic controller, and outputting a reference compensation current; S21, the fuzzy logic controller comprises fuzzification processing, fuzzy reasoning based on a fuzzy rule table and defuzzification; In this embodiment, the fuzzy logic rule table is shown in Table 1; Table 1 Fuzzy logic rule table

[0024] Wherein, represents the error change rate of the first compensation, represents the error current of the first compensation; represents the amplitude of the reference compensation current; Phase angle of the reference compensation current; The language value set of the phase angle of the reference compensation current is {P, Z, N}, i.e., {[-90° ~ +90°] / increase, [0°] / same phase, [90° ~ -90°] / decrease}; The language value set of the phase angle of the reference compensation current is {P, Z, N}, i.e., {[-90° ~ +90°] / increase, [0°] / same phase, [90° ~ -90°] / decrease}; The language value set of the phase angle of the reference compensation current is {P, Z, N}, i.e., {[-90° ~ +90°] / increase, [0°] / same phase, [90° ~ -90°] / decrease}; The language value set of the phase angle of the reference compensation current is {P, Z, N}, i.e., {[-90° ~ +90°] / increase, [0°] / same phase, [90° ~ -90°] / decrease}; For example: the error change rate is PL, corresponding to positive large, and the error change rate is PF, corresponding to positive fast; this indicates that the total station residual current is greater than the preset residual threshold and is rising rapidly; according to this fuzzy rule table, the output is =VL and =N compensation current; S211, wherein the fuzzy rule table is updated using the station power distribution system digital twin model; The amplitude, frequency and phase angle of the simulated residual current are calculated using the station power distribution system digital twin model; the station power distribution system digital twin model is used to simulate the residual current under conditions of three-phase imbalance, cable insulation degradation, etc.; The amplitude, frequency and phase angle of the simulated residual current are input into the simulated fuzzy controller to generate an initial fuzzy rule table; The compensation current generated based on the initial fuzzy rule table is input into the residual current compensation hardware simulation model to obtain the compensated simulated residual current; It is judged whether the compensated simulated residual current reaches the preset simulated residual threshold, if so, the initial fuzzy rule table is updated, and the updated fuzzy rule table is used as the fuzzy rule table of the fuzzy logic controller; if not, the initial fuzzy rule table is adjusted; until the preset simulated residual threshold is reached; S22, the current compensated total station residual current effective value and the preset total station residual current reference value are input into a subtractor to obtain an error current; S221, the error current is subjected to differential calculation to obtain an error change rate; S222, the error current and the error change rate are input into a fuzzy logic controller to output the amplitude increment and the phase angle increment of the reference compensation current, specifically: S2221, a membership function is designed to calculate the membership degree of the error current under the current fuzzy set; the membership degrees of the error current in all fuzzy sets form a fuzzy input vector; S2222: Perform logical operations on fuzzy input vectors based on the inference rule base; In this embodiment, the reasoning rule base is specifically: ,in , , and Represents a fuzzy set. This indicates the magnitude increment of the reference compensation current; This represents the phase angle increment of the reference compensation current; The activation strength of each rule is calculated using the following formula: ,in Representing fuzzy sets Membership degree; Based on each rule, the membership degree corresponding to the amplitude and phase angle of the error current is clipped or scaled, expressed by the formula, to obtain the fuzzy set; S2223. Solve the fuzzy set to obtain the amplitude increment and phase angle increment of the reference compensation current, expressed by the formula: ; ; In the formula, This indicates the magnitude increment of the output reference compensation current; This represents the phase angle increment of the output reference compensation current; Indicates the first value within the candidate interval of amplitude increment. One possible value; Represents the first phase angle increment candidate interval. One possible value; S23. Input the amplitude increment of the reference compensation current and the amplitude of the current reference compensation current into the first adder to obtain the amplitude of the reference compensation current; The phase angle increment of the reference compensation current and the phase angle of the current reference compensation current are input into the second adder to obtain the phase angle of the reference compensation current; The reference compensation current is obtained based on the magnitude and phase angle of the reference compensation current. S3. Input the reference compensation current into the compensation current closed-loop controller to generate the initial compensation current and compensation current command. The compensation current closed-loop controller is based on a Smith predictor and a PID controller. The Smith predictor includes a controlled object model to offset the effect of the controlled object's delay on the closed loop and a predicted delay compensation model for the controlled object. In this embodiment, the controlled object model is ,in Represents the time-delay-free model of the controlled object. Indicates output delay. Indicates the delay time; The estimated delay compensation model for the controlled object is as follows: ,in Represents the estimation model of the controlled object. This indicates the estimated delay compensation, where Indicates the estimated delay; S4. Correct the initial compensation current based on the compensation current command to obtain the corrected compensation current. The error signal is generated based on the reference compensation current, expressed by the formula: ; In the formula, In the complex field The error signal below; In the complex field The reference compensation current is below; In the complex field The corrected compensation current; The PID controller generates a compensation current command based on the error signal, expressed by the formula: ; In the formula, In the complex field The compensation current command is issued; This indicates the preset scaling factor; Indicates the preset integral coefficient; Indicates the preset differential coefficient; The compensation current command is input to the digital-to-analog converter and the Smith predictor, respectively, and the outputs are the initial compensation current and the correction signal, expressed by the formula: ; ; In the formula, In the complex field The compensation current below; In the complex field The following correction signal; The corrected compensation current is obtained by adding the initial compensation current and the correction signal, which can be expressed by the formula: ; A new error signal is obtained based on the corrected compensation current and the reference compensation current; The iterative correction process involves offsetting the residual current of the main station based on the corrected compensation current until the current residual current of the main station is less than a preset residual threshold, thus obtaining the final residual current of the main station, expressed by the formula: ; In the formula, Indicates the first The remaining current of the main station after the second compensation; Indicates the first The remaining current of the main station after the second compensation; Indicates the first The corrected compensation current; S5. The method further includes acquiring the actual compensation current and adjusting the compensation current closed-loop controller based on the actual compensation current, expressed by the formula: ; ; S6. The method further includes outputting a compensation current signal reference curve through the digital-to-analog converter port, and injecting the initial compensation current into the PE line through a voltage-controlled current source according to the compensation current signal reference curve.

[0025] Example 2: This embodiment provides an automatic residual current compensation system based on fuzzy logic, the system comprising: The data acquisition module is used to acquire the remaining current of the main station; and transmit the remaining current of the main station to the fuzzy control module; The fuzzy control module is used to input the residual current of the main station into the fuzzy logic controller and output the reference compensation current; The correction module is used to input the reference compensation current into the compensation current closed-loop controller, generate the initial compensation current and the compensation current command; and correct the initial compensation current based on the compensation current command to obtain the corrected compensation current. The result output module is used for the iterative correction process. Based on the corrected compensation current, the residual current of the main station is offset until the current residual current of the main station is less than the preset residual threshold, and the final residual current of the main station is obtained.

[0026] Example 3: This embodiment provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, it implements the automatic residual current compensation method based on fuzzy logic as described in any one of Embodiment 1.

[0027] Example 4: This embodiment provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the automatic residual current compensation method based on fuzzy logic as described in any one of Embodiment 1.

[0028] In this application embodiment, "at least one" refers to one or more, and "more than one" refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent the existence of A alone, A and B simultaneously, or B alone. A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one of the following" and similar expressions refer to any combination of these items, including any combination of singular or plural items. For example, at least one of a, b, and c can represent: a, b, c, a and b, a and c, b and c, or a and b and c, where a, b, and c can be single or multiple.

[0029] Those skilled in the art will recognize that the units and algorithm steps described in the embodiments disclosed herein can be implemented using electronic hardware, computer software, or a combination of electronic hardware and software. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0030] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0031] In the several embodiments provided in this application, any function, if implemented as a software functional unit and sold or used as an independent product, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0032] The above description is merely an embodiment of the present invention and does not limit the patent scope of the present invention. Any equivalent structural or procedural transformations made based on the content of the present invention's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of the present invention.

Claims

1. A residual current automatic compensation method based on fuzzy logic, characterized in that, The method includes: Obtain the remaining current at the main station; The remaining current of the main station is input into the fuzzy logic controller, which outputs the reference compensation current. The reference compensation current is input into the compensation current closed-loop controller to generate the initial compensation current and the compensation current command; the initial compensation current is corrected based on the compensation current command to obtain the corrected compensation current. The iterative correction process involves offsetting the residual current of the main station based on the corrected compensation current until the current residual current of the main station is less than the preset residual threshold, thus obtaining the final residual current of the main station.

2. The automatic residual current compensation method based on fuzzy logic according to claim 1, characterized in that, The method also includes selecting the compensation phase based on the phase angle of the residual current of the main station, and controlling the opening and closing of the option relays through three different I / O input option relays.

3. The automatic residual current compensation method based on fuzzy logic according to claim 1, characterized in that, The fuzzy logic controller includes fuzzification processing, fuzzy inference based on the fuzzy rule table, and defuzzification. The fuzzy rule table is updated using a digital twin model of the station power distribution system. The specific update steps are as follows: The amplitude, frequency, and phase angle of the residual current were calculated and simulated using a digital twin model of the station power distribution system. The amplitude, frequency, and phase angle of the simulated residual current are input into the simulation fuzzy controller to generate an initial fuzzy rule table; The compensation current generated based on the initial fuzzy rule table is input into the residual current compensation hardware simulation model to obtain the compensated simulated residual current. Determine whether the compensated simulated residual current reaches the preset simulated residual threshold. If it does, update the initial fuzzy rule table and use the updated fuzzy rule table as the fuzzy rule table for the fuzzy logic controller. If it does not reach the threshold, adjust the initial fuzzy rule table until the preset simulated residual threshold is reached.

4. The automatic residual current compensation method based on fuzzy logic according to claim 3, characterized in that, The remaining current of the main station is input into the fuzzy logic controller. The specific steps are as follows: Input the current compensated residual current of the main station and the preset reference value of the residual current of the main station into the subtractor to obtain the error current; The error rate of change is obtained by differential calculation of the error current; The error current and error rate of change are input into the fuzzy logic controller, which outputs the amplitude increment and phase angle increment of the reference compensation current. The amplitude increment of the reference compensation current and the amplitude of the current reference compensation current are input into the first adder to obtain the amplitude of the reference compensation current. The phase angle increment of the reference compensation current and the phase angle of the current reference compensation current are input into the second adder to obtain the phase angle of the reference compensation current; The reference compensation current is obtained based on the magnitude and phase angle of the reference compensation current.

5. The automatic residual current compensation method based on fuzzy logic according to claim 1, characterized in that, The compensation current closed-loop controller is based on a Smith predictor and a PID controller. The reference compensation current is input into the compensation current closed-loop controller, and the specific steps are as follows: Error signals are generated based on the reference compensation current; The PID controller generates a compensation current command based on the error signal; The compensation current command is input to the digital-to-analog converter and the Smith predictor respectively, and the compensation current and correction signal are output. The compensation current and the correction signal are added together to obtain the corrected compensation current; A new error signal is obtained based on the corrected compensation current and the reference compensation current.

6. The automatic residual current compensation method based on fuzzy logic according to claim 1, characterized in that, The method also includes acquiring the actual compensation current and adjusting the compensation current closed-loop controller based on the actual compensation current.

7. The automatic residual current compensation method based on fuzzy logic according to claim 1, characterized in that, The method further includes outputting a compensation current signal reference curve through the port of the digital-to-analog converter, and injecting the initial compensation current into the PE line through a voltage-controlled current source according to the compensation current signal reference curve.

8. A residual current automatic compensation system based on fuzzy logic, characterized in that, The system includes: The data acquisition module is used to acquire the remaining current of the main station; and transmit the remaining current of the main station to the fuzzy control module; The fuzzy control module is used to input the residual current of the main station into the fuzzy logic controller and output the reference compensation current; The correction module is used to input the reference compensation current into the compensation current closed-loop controller, generate the initial compensation current and the compensation current command; and correct the initial compensation current based on the compensation current command to obtain the corrected compensation current. The result output module is used for the iterative correction process. Based on the corrected compensation current, the residual current of the main station is offset until the current residual current of the main station is less than the preset residual threshold, and the final residual current of the main station is obtained.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the method as described in any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method as described in any one of claims 1 to 7.