Power distribution network reconstruction optimization control system based on single-chip microcomputer and particle swarm optimization algorithm and use method thereof

The distribution network reconfiguration optimization control system based on a microcontroller and an improved particle swarm optimization algorithm solves the problems of power supply reliability, power loss and voltage quality in traditional distribution networks. It achieves efficient, economical and reliable real-time monitoring and fault handling, and is suitable for topology optimization of medium and low voltage distribution networks.

CN120934083APending Publication Date: 2025-11-11GUILIN UNIV OF ELECTRONIC TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511034251.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-25
Publication Date
2025-11-11

AI Technical Summary

Technical Problem

Traditional power distribution networks suffer from low power supply reliability, high power loss, and poor voltage quality. Existing optimization control systems have poor algorithm adaptability, low hardware integration, weak functional coordination, and complex human-machine interaction, making it difficult to meet the real-time monitoring, fault handling, and topology optimization needs of medium and low voltage power distribution networks.

Method used

A power distribution network reconfiguration optimization control system based on a microcontroller and an improved particle swarm optimization algorithm is proposed. The system includes modules for data acquisition, control, network reconfiguration, smart switches, human-machine interaction, and communication. It uses an STM32F103C8T6 microcontroller as the core, combined with high-precision sensors and an improved particle swarm optimization algorithm, to achieve real-time data processing and topology optimization.

Benefits of technology

It improves fault response speed, reduces network loss, stabilizes voltage quality, reduces hardware costs, simplifies human-machine interaction, and enhances the real-time performance and adaptability of the system, making it suitable for large-scale promotion in medium and low voltage distribution networks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120934083A_ABST
    Figure CN120934083A_ABST
Patent Text Reader

Abstract

The invention discloses a power distribution network reconstruction optimization control system based on a single-chip microcomputer and a particle swarm optimization algorithm and a use method thereof, and belongs to the field of power system automation. The system takes an STM32F103C8T6 single chip microcomputer as a core, integrates a data acquisition module, an intelligent control module, a man-machine interaction module, a communication module and a fault module, and realizes real-time monitoring and topology reconstruction of the power distribution network through an improved particle swarm optimization algorithm. A particle concentration probability screening mechanism and an active detection principle are introduced, the problem of local optimization of a traditional algorithm is solved, and the global search efficiency is improved. Tests show that the system can detect faults within 50ms, the network loss is reduced by 15%, the voltage deviation is controlled within + / -5%, the reliability and economy of the power distribution network are remarkably improved, and the method is suitable for a smart power grid distribution network optimization scene.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of power system automation technology, specifically to a distribution network reconfiguration optimization control system based on a microcontroller and particle swarm optimization algorithm, and its application method, which is applicable to real-time monitoring, fault handling, and topology optimization scenarios in medium and low voltage distribution networks. Background Technology

[0002] As a crucial link connecting users in the power system, the distribution network's operational efficiency and power supply quality directly impact social production and people's livelihoods. With the rapid development of smart grid technology, traditional distribution networks have gradually revealed numerous adaptability deficiencies, making it difficult to meet the demands of new power systems.

[0003] From the current operational status, traditional power distribution networks suffer from three core problems: First, insufficient power supply reliability. Traditional distribution networks mostly adopt a radial topology, and fault isolation relies on manual inspection and operation, resulting in fault response times of up to several hours. For example, in rural areas, due to weak infrastructure and an automation coverage rate of less than 30%, the average outage time for a single fault exceeds 4 hours, severely impacting electricity demand under the rural revitalization strategy. Second, excessively high energy losses. Distribution network line losses account for 40%-60% of the total power system losses. Due to uneven load distribution and a fixed topology, some lines are chronically overloaded, with line loss rates far exceeding the national limit of 8%. In one city, the line loss rate of the distribution network reached 12% during peak hours, resulting in an annual waste of over one million kilowatt-hours of electricity. Third, large voltage quality fluctuations. The intermittent access of distributed energy resources and the randomness of electric vehicle charging loads cause node voltage deviations to frequently exceed the national standard of ±7%, leading to problems such as decreased motor efficiency and damage to electronic equipment. In one industrial park, a sudden voltage drop caused production line shutdowns, resulting in direct economic losses exceeding one million yuan.

[0004] From a technical perspective, existing power distribution network optimization and control systems have significant limitations:

[0005] Poor algorithm adaptability: Traditional distribution network reconfiguration algorithms are prone to getting trapped in local optima when dealing with high-dimensional switch state optimization. For example, the standard particle swarm optimization algorithm takes more than 30 seconds to reconfigure in a 69-node system, and the network loss reduction rate is less than 10%, which cannot meet the requirements of real-time performance and optimization effect.

[0006] Low hardware integration: Existing systems mostly adopt a distributed architecture of "industrial computer + sensor", with hardware costs reaching tens of thousands of yuan. Moreover, the communication latency between modules is large, making it difficult to promote on a large scale in medium and low voltage distribution networks. For example, the cost of a single imported distribution network monitoring system exceeds 100,000 yuan, and it can only be used in urban core areas.

[0007] Weak functional synergy: The monitoring, control, and optimization modules operate independently, resulting in low data flow efficiency. When a fault occurs, the monitoring module must first upload data to the cloud before the control module receives the command, a process that takes more than 5 seconds and delays fault handling.

[0008] Complex human-computer interaction: Existing systems mostly rely on specialized software for parameter configuration, requiring maintenance personnel to undergo professional training before operation, resulting in low emergency response efficiency. Statistics from a power supply company show that the average operation time for maintenance personnel to handle simple faults is 15 minutes, far exceeding the ideal response time.

[0009] From the current research status, although scholars at home and abroad have carried out relevant explorations, there are still obvious shortcomings. The single-loop optimization strategy proposed by Yu Aiqing et al. ignores the randomness of distributed power sources, and the reconstruction results have poor adaptability in distribution networks with a high proportion of new energy sources; Rong Desheng et al. combined second-order cone programming with improved genetic algorithms, which improved the computational accuracy, but the algorithm has high complexity and cannot be embedded in low-cost microcontrollers; Taylor's team abroad simplified the solution process with a convex model, but did not involve engineering implementation; Abido's hybrid particle swarm-gravity search algorithm has significant optimization effects, but it does not solve the local optimum problem caused by particle concentration.

[0010] In summary, existing technologies are insufficient to meet the operational requirements of power distribution networks for "efficiency, economy, and reliability." There is an urgent need to develop a low-cost, highly integrated, and real-time reconfiguration optimization control system and its corresponding usage methods to fill the gaps in existing technologies.

[0011] The above background information is provided only to aid in understanding the inventive concept and technical solution of this invention. It does not necessarily belong to the prior art of this patent application. In the absence of clear evidence that the above information was disclosed on the filing date of this patent application, the above background information should not be used to evaluate the novelty and inventiveness of this application. Summary of the Invention

[0012] The purpose of this invention is to propose a power distribution network reconfiguration optimization control system and its application method based on a microcontroller and particle swarm optimization algorithm, in order to solve the technical problems of low power supply reliability, large power loss, and poor voltage quality in traditional power distribution networks, as well as the poor algorithm adaptability, low hardware integration, weak functional coordination, and complex human-computer interaction of existing optimization control systems.

[0013] To achieve the above technical objectives, the present invention adopts the following technical solution:

[0014] A power distribution network reconfiguration optimization control system based on a microcontroller and particle swarm optimization algorithm includes: a data acquisition module; a control module; a network reconfiguration module; an intelligent switch module; a human-machine interaction module; a communication module; and a fault module. The output terminal of the data acquisition module is connected to the input terminal of the control module and the input terminal of the fault module. The output terminal of the fault module is connected to the input terminal of the control module. The output terminal of the control module is connected to the network reconfiguration module, the intelligent switch module, the human-machine interaction module, and the communication module, respectively. The output terminal of the network reconfiguration module is connected to the input terminal of the control module. The communication module is also connected to a computer.

[0015] Preferably, the present invention may have the following technical features:

[0016] Preferably, the data acquisition module includes a high-precision voltage sensor, an ACS712 Hall effect current sensor, and a 12-bit ADC conversion circuit. The ACS712 Hall effect current sensor has a measurement range of ±20A and a linear error of less than 1.5%. The 12-bit ADC conversion circuit has a conversion accuracy of 0.7-0.9mV. The output terminals of the voltage sensor and the current sensor are connected to the input terminals of the ADC conversion circuit. The output terminal of the ADC conversion circuit is connected to the GPIO port and ADC channel of the STM32F103C8T6 microcontroller of the control module through signal lines.

[0017] Preferably, the control module is based on an STM32F103C8T6 microcontroller with a main frequency of 64MHz-72MHz. It connects to the data acquisition module via GPIO ports, uses a 40ms-60ms periodic interrupt to sample data, and supports hardware multiplication and division operations as well as bit-band operations. The microcontroller interacts with the network reconstruction module via an internal data bus and outputs control signals to the intelligent switch module via GPIO ports.

[0018] Preferably, the network reconstruction module is based on an improved particle swarm optimization algorithm, which includes a particle concentration probability screening mechanism. Specifically, in each iteration, the spatial distribution concentration of particles is calculated, and the selection probability of particles in regions with concentrations exceeding a preset threshold is reduced to guide particles to search for low-concentration regions.

[0019] Preferably, the improved particle swarm optimization algorithm includes an active detection principle, which guides the movement of the optimal particle to an effective region by exploring spatial reference points; the effective region is the topological range of the distribution network where the load is balanced and the voltage is stable.

[0020] Preferably, the intelligent switch module includes a relay and a drive circuit, supports remote control and timed control, has a remote control response time of less than 1 second, and a switch status feedback error of 0; the input terminal of the drive circuit is connected to the output terminal of the control module, and the status feedback terminal of the relay is connected to the GPIO input port of the control module through an optocoupler.

[0021] Preferably, the human-computer interaction module includes a 0.96-inch OLED debugging screen, a 4.3-inch serial port display screen, and a 4.3-inch resistive touch serial port screen. The touch serial port screen implements parameter setting and fault alarm based on the Taojingchi self-developed programming language. The 0.96-inch OLED is connected to the control module through an I2C interface, and the 4.3-inch serial port screen and the touch serial port screen are connected to the STM32F103C8T6 microcontroller of the control module through a USART interface.

[0022] Preferably, the communication module includes a CH340 USB-UART converter chip and a USART interface. The CH340 chip supports 3.3V / 5V level adaptation and a maximum baud rate of 2Mbps. The USART interface is used for bidirectional communication between the control module and the serial port screen. One end of the CH340 USB-UART converter chip is connected to the computer via a USB interface, and the other end is connected to the USART interface of the STM32F103C8T6 microcontroller of the control module via a UART interface. The USART interface connects the control module and the serial port screen.

[0023] Preferably, the fault module presets fault judgment thresholds for parameters such as current and voltage. When the collected data exceeds the threshold, an alarm mechanism is triggered, and a fault signal is sent to the control module.

[0024] This invention also provides a method for using a power distribution network reconfiguration optimization control system based on a microcontroller and particle swarm optimization algorithm, comprising the following steps:

[0025] (1) System Initialization: After power-on, the STM32 microcontroller automatically completes peripheral initialization. The 0.96-inch OLED displays "System Starting" and the 4.3-inch serial port screen displays the initial topology diagram. After 3 seconds, the system enters normal monitoring mode.

[0026] (2) Routine monitoring: Data acquisition: Voltage and current data are collected every 50ms, and active power is calculated after filtering. The results are displayed synchronously on the OLED and serial port screen; Status judgment: The data is compared with the threshold in real time. If it is normal, monitoring continues; if a fault is triggered, step 3 is executed.

[0027] (3) Fault handling: Alarm trigger: The buzzer sounds, the red LED flashes, and the fault type and location pop up on the serial port screen; Algorithm start: The 69-node system parameters are automatically loaded, the particle swarm is initialized and iterative optimization begins, and the serial port screen displays "Reconstruction in progress";

[0028] (4) Topology Adjustment: Solution Output: After iteration, the optimal solution is displayed on the serial port screen, and the topology adjustment diagram is generated on the computer; Execution Control: The microcontroller sends instructions to the intelligent switch module, and the relays feedback the status after action to confirm that the adjustment is complete;

[0029] (5) Recovery Feedback: Status Update: The serial port screen displays "Reconstruction Completed" and the voltage curve is updated to the adjusted data; Log Storage: The computer automatically saves the fault time, processing process and optimization results, which can be queried later.

[0030] Technical principle:

[0031] (I) Hardware Collaborative Working Principle

[0032] The system uses the STM32F103C8T6 as its core, and the modules coordinate through a "acquisition-processing-execution" chain:

[0033] Data Acquisition: The voltage / current sensor converts high voltage / high current into a 0-3.3V analog signal, which is then filtered and input to the ADC channel. The STM32's 12-bit ADC performs analog-to-digital conversion using the successive approximation principle, achieving a conversion accuracy of 0.7-0.9mV, ensuring accurate parameter acquisition.

[0034] Data processing: The microcontroller reads ADC data in 40-60ms cycles, removes noise through mean filtering, and calculates the effective values ​​of voltage and current as well as active power.

[0035] Fault diagnosis: Compare real-time data with preset thresholds. If the data exceeds the threshold, an alarm is triggered and a reconstruction algorithm is started.

[0036] Reconfiguration control: After the algorithm outputs the optimal switching state, the microcontroller outputs high and low levels through the GPIO port to control the relay to engage / disengage and adjust the power distribution network structure.

[0037] Information interaction: The microcontroller communicates with the serial port screen and computer through the USART interface, uploads real-time data and reconstruction results, and receives user control commands.

[0038] (II) Principles of Improved Particle Swarm Optimization Algorithm

[0039] The improved particle swarm optimization algorithm includes a particle concentration probability screening mechanism, which involves calculating the particle concentration in each iteration, reducing the selection probability of particles in regions with excessively high concentrations, and guiding particles to search for regions with low concentrations.

[0040] The improved particle swarm optimization algorithm includes an active detection principle, which guides the optimal particle movement to an effective region by exploring spatial reference points. The effective region is the topological range of the distribution network where the load is balanced and the voltage is stable.

[0041] Particle encoding and fitness function: The 54 switch states are encoded into a 54-dimensional binary vector (0 / 1). The fitness function integrates network loss and voltage deviation to ensure that the optimization objective takes into account both economy and power quality.

[0042] Particle concentration probability screening: Calculate the positional similarity of each particle with other particles (the proportion of particles in the same on / off state). The higher the similarity, the higher the concentration. Assign low selection probability to particles with high concentration to reduce their impact on population evolution and guide particles to search for unexplored areas.

[0043] Active detection guidance: Using a voltage stability node deviation of <3% as a reference point, the effective search area is marked; a reference point weighting term is added to the particle velocity update to make particles move towards the effective area and improve search efficiency.

[0044] Iterative optimization mechanism: Through 50 iterations, the particle swarm gradually converges to the global optimal solution, outputting the switch state combination to achieve distribution network topology optimization.

[0045] (III) Network Reconstruction Model

[0046] The goal of distribution network reconfiguration is to adjust the network topology by changing switch states under various operational constraints to achieve optimization objectives such as reducing network losses, balancing loads, and improving voltage quality. To achieve these objectives, the following mathematical model is constructed, with minimizing network losses as the primary optimization objective, while also considering minimizing voltage deviation. Taking both factors into account, the objective function is constructed as follows:

[0047] The objective function is constructed as follows:

[0048]

[0049] Where F is the value of the comprehensive objective function; ω loss and ω voltage These are the weighting coefficients for network loss and voltage deviation, respectively, and their values ​​are determined based on actual needs to balance the importance of the two optimization objectives; n is the total number of lines in the distribution network; P loss,i V represents the active power loss of the i-th line; N is the total number of nodes in the distribution network; V j V represents the actual voltage at the j-th node. rated This is the node's rated voltage.

[0050] Constraints:

[0051] (1) Power balance constraint: The power at each point in the distribution network should satisfy the power balance equation, that is:

[0052] P Gi -P Di =∑ j∈i P ij

[0053] Q Gi -Q Di =∑ j∈i Q ij

[0054] Among them, P Gi Q Gi These represent the active and reactive power generated by the node, respectively; P Di Q Di The active and reactive power of the load at each node are not specified; P ij Q ij These represent the active power and reactive power flowing from node i to node j, respectively; j∈i represents all nodes connected to node i.

[0055] (2) Voltage constraints: The voltage at each node should be within the allowable voltage range, i.e.:

[0056] V j,min ≤V j ≤V j,max

[0057] Among them, V j,min and V j,max These represent the minimum and maximum voltages allowed for the node, respectively.

[0058] (3) Current constraint: The line current cannot exceed its rated current, that is:

[0059] I ij ≤I ij,max

[0060] Among them, I ij I is the current in the circuit. ij,max Let be the rated current of line ij.

[0061] (4) Switch state constraints: Switches in the distribution network have only two states: open and closed, represented by binary variables:

[0062] S ij ∈{0,1}

[0063] Among them, S ij This indicates the state of the switch on line ij, where 0 indicates the switch is open and 1 indicates the switch is closed.

[0064] The mathematical model described above transforms the distribution network reconfiguration problem into an optimization problem of finding the minimum comprehensive objective function under various constraints. This model comprehensively considers the key factors in distribution network operation, providing an accurate problem description for subsequent algorithmic solutions.

[0065] Technical solution:

[0066] I. System Overall Architecture

[0067] "Three-tier, two-domain" architecture:

[0068] Data acquisition layer: Composed of voltage sensors, current sensors and signal conditioning circuits, it is responsible for real-time acquisition of electrical parameters of the power distribution network.

[0069] Control and decision-making layer: Using the STM32F103C8T6 microcontroller as the core, it runs an improved particle swarm optimization algorithm to process data and make reconstruction decisions.

[0070] The execution interaction layer includes the intelligent switch module, the human-machine interaction module, and the communication module, which are used to execute control commands and provide feedback on status.

[0071] The system consists of two domains: the local control domain enables real-time interaction between the microcontroller and sensors and switches; and the remote management domain displays the topology and stores data on the computer, achieving cross-domain collaboration through the communication module.

[0072] II. Hardware Design

[0073] Data acquisition module: Utilizing a high-precision voltage sensor and an ACS712 Hall effect current sensor, this current sensor has a measurement range of ±20A and a linear error of less than 1.5%. Paired with a 12-bit STM32F103C8T6 ADC, the conversion accuracy reaches 0.8mV, effectively ensuring the accuracy of parameter acquisition. The sensor output signal is filtered for noise by an RC filter circuit before being input to the ADC channel.

[0074] Control Module: The STM32F103C8T6 microcontroller is based on the ARM Cortex-M3 core, with a main frequency of 72MHz. It integrates 64KB Flash and 20KB RAM, supports hardware multiplication and division operations and DMA data transfer, and can meet the requirements of complex algorithms. Its minimum system includes a 32MHz external crystal oscillator, a reset circuit, and a BOOT configuration circuit.

[0075] Intelligent switch module: Utilizing a 5V relay as the actuator, driven by a transistor via the STM32's GPIO port, it supports remote and timed control. The switch status is fed back to the microcontroller via an optocoupler, ensuring accurate status monitoring.

[0076] Human-Computer Interaction Module: This module is equipped with three types of display devices: a 0.96-inch OLED screen, a 4.3-inch non-touch serial port screen, and a 4.3-inch resistive touch serial port screen. The touch serial port screen is developed based on Taojingchi's self-developed programming language, and its interface includes function pages for real-time data, fault identification, and power grid reconfiguration.

[0077] Communication module: The CH340 chip is used to realize USB-UART conversion for communication between the microcontroller and the computer; the USART interface is used to realize bidirectional communication between the microcontroller and the serial port screen, and the "command + data" format is used to ensure the accuracy of data parsing.

[0078] III. Software Design

[0079] Data acquisition module: ADC conversion is triggered by a 50ms timer interrupt. After five consecutive data acquisitions, mean filtering is performed to remove random noise. Acquired data is stored in SRAM in the format of "timestamp + voltage + current + power," automatically overwriting the oldest data when the SRAM is full.

[0080] Fault diagnosis module: Fault diagnosis criteria are set for parameters such as current and voltage. Once a fault is triggered, the buzzer alarm will be activated and the red LED will be lit immediately.

[0081] Network Reconstruction Module: Implements an improved particle swarm optimization algorithm, including sub-modules for particle initialization, fitness calculation, and velocity / position update. During the algorithm's iterative process, particle concentration probability screening is used to avoid getting trapped in local optima, and active detection principles are combined to guide particles towards voltage-stable regions.

[0082] Human-Computer Interaction Module: Based on the Taojingchi serial port screen instruction set, it realizes parameter setting, status display, and log query functions. Touch operation response time is <200ms, and it supports single-point / multi-point touch.

[0083] Communication module: Serial port data is processed using interrupt mode. The computer receives real-time data and reconstruction results through the CH340 module and supports exporting historical records in Excel format. The serial port screen and the microcontroller use question-and-answer communication to ensure that the execution of instructions is confirmed.

[0084] The beneficial effects of this invention compared to the prior art include:

[0085] 1. Fast fault response speed and significantly improved power supply reliability

[0086] This system utilizes the high-speed interrupt mechanism and 50ms periodic sampling strategy of the STM32F103C8T6 microcontroller, combined with hardware-level fault detection logic, to complete short-circuit fault identification and trigger alarms within 50ms. An improved particle swarm optimization algorithm, employing particle concentration screening and active detection principles, enables the reconfiguration calculation of a 69-bus system. In tests conducted by PG&E in the United States on a 69-bus system, the system demonstrated high power restoration rates in non-faulty areas after a fault occurred, achieving fault isolation and load transfer within a short time. For example, when a three-phase short circuit occurs at node 20, the system disconnects the node switch within 50ms and quickly transfers the load to adjacent feeders through reconfiguration, minimizing the impact on users.

[0087] 2. Significant reduction in network losses and improved energy utilization efficiency.

[0088] This invention achieves dynamic optimization of distribution network topology by improving the global optimization capability of the particle swarm optimization algorithm and combining it with real-time load monitoring. The algorithm prioritizes minimizing network losses and avoids local optima through particle concentration probability screening, ensuring the discovery of the globally optimal topology. Test data shows that under rated operating conditions, the system can reduce active power losses in the distribution network. After application in a 10kV distribution network, significant annual electricity savings were observed, with substantial effects on standard coal consumption and carbon dioxide emission reduction. In load fluctuation scenarios, the algorithm can dynamically adjust the topology to ensure that the line loss rate remains below the national standard of 8%.

[0089] 3. Stable voltage quality improves equipment operating safety.

[0090] The system incorporates voltage deviation into the optimization objective function and prioritizes topology structures in voltage-stable regions through active detection. During the iteration process, the improved algorithm uses nodes with voltage deviations <3% as reference points to guide particles to search in these regions, ensuring optimal voltage quality after reconstruction. Tests show that the voltage deviation of the distribution network after reconstruction can be controlled within ±5%, which is better than the national standard of ±7%. In scenarios with fluctuating output from distributed power sources, the system maintains voltage deviations within ±3% through rapid topology adjustments, avoiding problems such as motor overheating and electronic equipment malfunctions. After application in an industrial park, the equipment failure rate caused by voltage fluctuations has decreased, resulting in a significant reduction in annual maintenance costs.

[0091] 4. Low hardware cost, strong compatibility, and easy to promote on a large scale.

[0092] This system uses the STM32F103C8T6 microcontroller as its core, resulting in low overall hardware cost and suitability for large-scale deployment in rural power distribution networks. The system employs a modular design; the data acquisition module supports various sensor connections, such as temperature and power sensors; the intelligent switch module is compatible with circuit breakers below 10kV; and the communication module has reserved RS485 and LoRa interfaces for expansion to wireless communication. In existing power distribution network upgrades, there is no need to replace the original switchgear; simply adding this system achieves intelligent upgrades with a short upgrade cycle for a single distribution area. A pilot project at a county-level power supply company shows that upgrading multiple distribution areas is cost-effective and significantly saves money compared to traditional solutions.

[0093] 5. User-friendly human-computer interaction, improving operation and maintenance efficiency

[0094] The system is equipped with a 4.3-inch resistive touch serial port screen and a graphical interface designed based on Taojingchi's self-developed language. It includes function pages such as "Real-time Data," "Smart Switches," and "Grid Reconfiguration," supporting touch operation and parameter settings, such as voltage thresholds and sampling periods. The interface response time is less than 200ms, allowing maintenance personnel to complete operations without specialized programming knowledge, significantly reducing operation time compared to traditional software. The system also supports data export, automatically generating daily reports and fault analysis reports to assist in maintenance decision-making. After implementation at a power supply company, the number of maintenance personnel decreased, and satisfaction with fault handling improved. Attached Figure Description

[0095] Figure 1 To create and debug flowcharts;

[0096] Figure 2 For the board manufacturing process flowchart;

[0097] Figure 3 Main control board PCB layout;

[0098] Figure 4 3D diagram of the main control board;

[0099] Figure 5 Prototype debugging flowchart;

[0100] Figure 6 This is a prototype simulating a physical power grid.

[0101] Figure 7 This is a picture of the actual prototype.

[0102] Figure 8 Diagram of the prototype control unit;

[0103] Figure 9 This is a demonstration image of real-time data from the prototype.

[0104] Figure 10 This is a demonstration diagram of real-time monitoring of the prototype.

[0105] Figure 11This is a demonstration image of the prototype's intelligent switch;

[0106] Figure 12 This is a topology diagram of the prototype system;

[0107] Figure 13 Demonstration diagram of power grid optimization for prototype;

[0108] Figure 14 This is a demonstration diagram of the power grid reconfiguration for the prototype.

[0109] Figure 15 A statistical chart of voltage deviation;

[0110] Figure 16 To reconstruct the time statistics chart;

[0111] Figure 17 A statistical chart of the response time of smart switches;

[0112] Figure 18 A statistical chart showing the reduction in active power consumption;

[0113] Figure 19 This is a topology diagram of a 69-node system. Detailed Implementation

[0114] A power distribution network reconfiguration optimization control system based on a microcontroller and particle swarm optimization algorithm includes: a data acquisition module; a control module; a network reconfiguration module; an intelligent switch module; a human-machine interaction module; a communication module; and a fault module. The output terminal of the data acquisition module is connected to the input terminal of the control module and the input terminal of the fault module. The output terminal of the fault module is connected to the input terminal of the control module. The output terminal of the control module is connected to the network reconfiguration module, the intelligent switch module, the human-machine interaction module, and the communication module, respectively. The output terminal of the network reconfiguration module is connected to the input terminal of the control module. The communication module is also connected to a computer.

[0115] (I) Hardware Implementation

[0116] 1. Data Acquisition Module

[0117] Voltage sensor: A DC 0-300V voltage sensor, model: ACS712-05B, is selected. The input voltage range is 0-300V and the output signal is 0-3.3V. It is connected to the PA0 pin of ADC1_IN0 of STM32F103C8T6 through an RC filter circuit.

[0118] Current sensor: ACS712ELCTR-20A module, input current ±20A, output voltage 2.5V±0.185V / A, connected to PA1 pin of ADC1_IN1.

[0119] ADC configuration: Enable ADC1 clock, sampling time 239.5 cycles, conversion accuracy 12 bits, continuous conversion mode, data is transferred to memory via DMA.

[0120] 2. Control Module

[0121] STM32F103C8T6 minimum system: includes a 32MHz external crystal oscillator with an accuracy of ±10ppm, a reset circuit, BOOT0=0, BOOT1=0.

[0122] Power Management: The 12V lithium battery is powered by the LM2596S-ADJ module, and the 3.3V pin of the microcontroller is regulated by an LDO to ensure stable power supply.

[0123] 3. Intelligent switch module

[0124] Relay drive: The STM32 outputs a control signal from the PB0 pin, which is amplified by the SS8050 transistor to drive the relay. The normally closed contacts of the relay are connected in series to the power distribution network line.

[0125] Status feedback: The relay auxiliary contact is connected to the PB1 pin of the STM32 via the optocoupler PC817, which is a GPIO input, to monitor the switch on / off status in real time.

[0126] 4. Human-computer interaction module

[0127] 0.96-inch OLED: I2C interface, 128×64 resolution, used to display sampled data, such as U=220.5V, I=10.2A.

[0128] 4.3-inch serial port screen: USART1 interface, resolution 480×272, displays topology diagram, network loss value and other information.

[0129] 4.3-inch touch serial port screen: USART2 interface, supports touch operation, output command format is "CMD, function code, parameter", such as "CMD,RESET,1" to start reconstruction.

[0130] 5. Communication module

[0131] CH340 module: USB interface for connecting to a computer, UART interface for communicating with USART1, baud rate 9600bps, data format 8N1.

[0132] 6. Fault Module

[0133] Hardware components include a buzzer, a red LED, and a driver circuit. The buzzer is connected to the PB2 pin of the STM32 microcontroller via an S8050 transistor, and the red LED is connected to the PB3 pin via a 1kΩ current-limiting resistor. Both are controlled by GPIO output signals.

[0134] Signal connection: The input terminal of the fault module receives ADC conversion data from the data acquisition module, and the output terminal is connected to the external interrupt input port of the control module through the PB4 pin to trigger a fault response.

[0135] (II) Software Implementation

[0136] Based on the Keil 5 development environment and programmed in C language, the core process is as follows:

[0137] 1. System Initialization

[0138] Peripheral configuration: Initialize GPIO, ADC, DMA transfer, USART, timer and interrupt controller.

[0139] Threshold preset: Define fault judgment thresholds in the program, such as current > 20A, voltage < 198V or > 242V, power > preset value.

[0140] Device initialization: The OLED displays "System startup in progress", the serial port screen loads the initial topology diagram, and the buzzer and LED are initialized to the off state.

[0141] 2. Data Acquisition and Processing

[0142] Timed sampling: The ADC conversion is triggered by a 50ms timer interrupt, and the DMA transfers the voltage and current data to the memory buffer.

[0143] Filtering calculation: Perform mean filtering on 5 consecutive sampled data to remove noise; calculate active power according to the formula P=UI and store it in the data register.

[0144] 3. Fault diagnosis and response

[0145] Real-time monitoring: In the main loop, the collected data is compared with the preset threshold. If the threshold is exceeded, the fault module triggers the PB4 pin to go high, and notifies the control module through an external interrupt.

[0146] Alarm control: After receiving a fault signal, the control module sets the PB2 and PB3 pins, driving the buzzer to sound and the red LED to flash; at the same time, it sends the fault information to the serial port screen through USART2.

[0147] 4. Implementation of Network Reconstruction Algorithm

[0148] Particle swarm initialization: Load 69-node system parameters, randomly generate particles, and initialize velocity and position.

[0149] Iterative optimization: Calculate particle fitness, and update particle velocity and position through particle concentration probability screening and active detection.

[0150] Solution output: After iterative convergence, the optimal switching state is converted into a control command and stored in the output buffer.

[0151] 5. Intelligent switch control

[0152] Command transmission: The control module outputs high and low levels through the PB0 pin to drive the relay to open and close, thereby realizing topology adjustment.

[0153] Status feedback: Read the optocoupler signal through the PB1 pin to confirm the switching action result and upload it to the control module.

[0154] 6. Human-computer interaction and communication

[0155] Data shows that the OLED displays real-time voltage, current, and power data; the serial port screen dynamically displays the topology diagram, network loss value, and fault status.

[0156] Command parsing: Receive commands from the touch serial port screen via USART2 to trigger the corresponding function.

[0157] Data upload: The CH340 module sends data such as fault time and optimization results to the computer in the format of "timestamp + parameters", and supports log storage.

[0158] (III) Usage Method and Procedure

[0159] 1. System Initialization

[0160] After power-on, the STM32 microcontroller automatically completes peripheral initialization. The 0.96-inch OLED displays "System startup in progress," and the 4.3-inch serial port screen displays the initial topology diagram. After 3 seconds, the system enters normal monitoring mode.

[0161] 2. Routine monitoring

[0162] Data Acquisition: Voltage and current data are collected every 50ms. After filtering, active power is calculated, and the results are simultaneously displayed on the OLED and serial port screen. Status Judgment: Data is compared with thresholds in real time. If normal, monitoring continues; if a fault is triggered, step 3 is executed.

[0163] 3. Troubleshooting

[0164] Alarm Trigger: The buzzer sounds, the red LED flashes, and the serial port screen displays the fault type and location. Algorithm Startup: The 69-node system parameters are automatically loaded, the particle swarm optimization is initialized, and iterative optimization begins. The serial port screen displays "Reconstruction in progress."

[0165] 4. Topology Adjustment

[0166] Solution Output: After iteration, the optimal solution is displayed on the serial port screen, and a topology adjustment diagram is generated on the computer. Execution Control: The microcontroller sends commands to the intelligent switch module, and the relay actuates and provides feedback on its status, confirming the adjustment is complete.

[0167] 5. Restore Feedback

[0168] Status Update: The serial port screen displays "Reconstruction Complete," and the voltage curve is updated to the adjusted data. Log Storage: The computer automatically saves the fault time, processing procedure, and optimization results, supporting later retrieval.

[0169] (iv) Testing and Verification

[0170] Test environment: A simulation platform was built based on the US PG&E 69 node system, with a node voltage of 12.66kV, a total load of 3.8MW+2.6Mvar, and 54 sectionalizing switches and 19 tie switches.

[0171] 1. Prototype fabrication and debugging

[0172] (1) Prototype manufacturing process

[0173] Based on the system hardware design scheme, a prototype was built. First, development software such as Keil 5, JLCPCB, and USARTHMI were downloaded. The necessary electronic components were prepared, including an STM32F103C8T6 microcontroller, voltage sensors, relays, resistors, capacitors, switches, a 0.96-inch OLED display, and two Taojingchi T1 series 4.3-inch serial port IPS full-view TFT LCD screens (one non-touch and one touch-enabled). Driver code was written, and the components were debugged and tested to check if each module functioned correctly. Finally, joint debugging was performed to ensure the entire system operated normally. The production and debugging flowchart is shown below. Figure 1 As shown

[0174] During the manufacturing process, the circuit board is designed and drawn according to the hardware circuit diagram, and the board manufacturing flowchart is as follows: Figure 2 As shown. Using the professional circuit design software JLCPCB EDA, a reasonable circuit board layout was designed to ensure clear and logical circuit wiring and reduce signal interference. After the design was completed, the PCB board was ordered and manufactured by JLCPCB. Finally, soldering and debugging were performed. During the soldering process, the soldering temperature was strictly controlled at 380 degrees Celsius to ensure soldering quality and avoid problems such as cold solder joints and short circuits. After soldering, a multimeter was used to check for short circuits in each branch and eliminated them in time. Finally, the power was turned on for testing. The main control board PCB is shown below. Figure 3 As shown, the main control board 3D is as follows Figure 4 As shown.

[0175] (2) Prototype debugging methods and procedures

[0176] Prototype debugging mainly includes two parts: hardware debugging and software debugging. The debugging process is as follows: Figure 5 As shown.

[0177] For hardware debugging, the data acquisition module was debugged first. Two 18650 batteries were used to simulate the voltage and current of the power distribution system, and the data was input to the voltage and current sensors to check the accuracy of the collected data. A diagram of the prototype simulating the power grid is shown below. Figure 6 As shown, the accuracy and stability of the acquired data are ensured through the selection of the regulated power supply output, the selection of the multiplexer, and the parameters of the ADC conversion circuit.

[0178] Debug the microcontroller control module to check if the microcontroller functions properly and if the program runs correctly. Download the written program to the microcontroller using the ST-Link debugger and observe its operating status. Use an oscilloscope to monitor the microcontroller's output signals to check if it can control the intelligent switch and process data as designed.

[0179] For software debugging, the data acquisition and processing programs were debugged. The acquired data was sent to the computer via CH340 serial communication, and tools such as serial port debugging assistants were used to check the accuracy and completeness of the data. The data filtering and storage functions were also checked to ensure they were functioning correctly.

[0180] Debug the network reconstruction algorithm by setting different fault scenarios and initial conditions, running the algorithm, and observing its convergence and optimization results. Check whether the algorithm can correctly identify faults and calculate the optimal topology adjustment scheme.

[0181] The human-machine interface program was debugged to check whether it could correctly display the operating information of the power distribution network, whether the touch screen was sensitive, and whether the parameter setting and control command input functions were normal. The response speed and stability of the interface were tested through simulated actual operation. A prototype image is shown below. Figure 7 As shown.

[0182] (3) Main functions implemented by the prototype

[0183] The prototype was built to realize seven main functions: real-time data processing, real-time monitoring, intelligent switching, fault identification, system topology optimization, voltage optimization, monitoring thresholds, and grid reconfiguration. The prototype control terminal diagram is shown below. Figure 8 As shown.

[0184] (4) Partial Function Demonstration

[0185] In the demonstration of some functions, Figure 9 The system displays real-time data, showing key electrical parameters of the power distribution network such as voltage, current, and power, allowing users to intuitively understand the current operating status. Figure 10To demonstrate the real-time monitoring function, it can continuously monitor voltage, current, power, and the status of equipment such as fans and lighting, and promptly detect potential anomalies; Figure 11 It features intelligent switch functionality, supporting remote on / off control of devices such as fans and lighting, with the interface displaying the operation status; Figure 12 The system topology is displayed graphically, showing the topology of the distribution network and the node connection relationships. Figure 13 The power grid optimization function indicates that the system has reached its optimal operating state; Figure 14 The system displays the power grid reconfiguration function and indicates that the distribution network reconfiguration operation has been completed. These functions are presented intuitively through the human-machine interface, facilitating user operation and monitoring.

[0186] (5) Test Results and Analysis

[0187] After comprehensive debugging of the prototype, the system entered the testing phase. This test, based on the US PG&E69 node system, carefully set up various fault scenarios to comprehensively examine the system's performance under different operating conditions.

[0188] In the data acquisition accuracy test, voltage and current signals of different amplitudes and frequencies were simulated and input to the data acquisition module. Comparison with a standard signal source revealed that the acquired data error was within the allowable range. For example, under rated voltage and current conditions, the voltage measurement error was less than 5%, and the current measurement error was less than 5%.

[0189] (6) Calculation of data acquisition error

[0190] The data acquisition error calculation meets the accuracy requirements for distribution network operation monitoring. This is thanks to the high-precision conversion of the sensors and the stable performance of the ADC conversion circuit, ensuring that the system can acquire reliable real-time data from the distribution network. The error formula is shown in Formula 1.

[0191]

[0192] For the network reconfiguration function, typical fault scenarios such as line short circuits, overloads, and voltage deviations were simulated. When a short circuit fault occurs, the system can quickly detect the current surge within 50ms, triggering the fault alarm mechanism. Simultaneously, the network reconfiguration algorithm is activated; the improved particle swarm optimization algorithm completes the calculation within an average of 20 seconds, deriving the optimal topology adjustment scheme. After adjustment, the faulty line is successfully isolated, normal power supply is restored to non-faulty areas, and the active power loss of the distribution network is reduced by approximately 15%.

[0193] (7) Calculation of line loss reduction

[0194] The calculation of line loss reduction requires voltage deviation to be controlled within ±5%, which improves the operational stability and power supply quality of the distribution network, as shown in Formula 2.

[0195]

[0196] This demonstrates that the improved algorithm can find effective reconfiguration schemes and reduce the impact of faults on power supply when dealing with complex faults.

[0197] (8) Voltage deviation calculation

[0198] In the intelligent switch control function test, the intelligent switches responded accurately to remote control commands. During remote control, the response time from issuing the command to the switch action was less than 1 second, meeting the requirements of real-time control. The timed control function also accurately executed the switch operation according to the preset time, and the switch status feedback information was accurate, ensuring precise control of the distribution network nodes and providing a reliable execution means for optimizing the operation of the distribution network, as shown in Formula 3.

[0199]

[0200] This invention mainly describes the entire process of prototype manufacturing and debugging. During prototype manufacturing, development software and electronic components are prepared, PCB boards are designed using JLCPCB EDA, and after production and soldering, debugging and testing are performed to ensure the normal operation of each module. Finally, joint debugging is completed to ensure the entire system can work stably. Prototype debugging includes two key parts: hardware debugging and software debugging. Hardware debugging targets the data acquisition module and the microcontroller control module, checking the accuracy of the acquired data and the operating status of the microcontroller. Software debugging debugs the data acquisition and processing program, the network reconstruction algorithm program, and the human-machine interface program, checking the correctness of data processing, algorithm operation, and interface interaction. Through debugging, the prototype successfully implemented seven main functions: real-time data, real-time monitoring, intelligent switching, fault identification, system topology, voltage optimization, monitoring thresholds, and grid reconstruction. Test results show that the system performs excellently in terms of data acquisition accuracy, network reconstruction, and intelligent switch control, effectively addressing common faults in the distribution network, improving the operating efficiency and power supply reliability of the distribution network, achieving the expected design goals, and providing strong support for the practical application of the system.

[0201] (9) Summary of the Invention

[0202] This invention describes the entire process of prototype fabrication and debugging. During fabrication, development software and components were prepared, and the PCB board was designed using JLCPCB EDA. Production, soldering, and debugging were then carried out, culminating in stable system operation through joint debugging. Debugging included both hardware and software components. Hardware debugging tested the data acquisition module and the microcontroller control module, while software debugging checked data acquisition and processing, network reconstruction algorithms, and the human-machine interface program. The prototype implemented seven main functions, including real-time data processing and real-time monitoring. Test results show that the system performs excellently in data acquisition, network reconstruction, and intelligent switch control, achieving the expected design goals and providing support for practical system applications.

[0203] Those skilled in the art will recognize that numerous variations are possible with respect to the above description, and therefore the embodiments are merely illustrative of one or more specific implementations.

[0204] Although exemplary embodiments of the invention have been described and illustrated, those skilled in the art will understand that various changes and substitutions can be made thereto without departing from the spirit of the invention. Furthermore, many modifications can be made to adapt specific situations to the doctrine of the invention without departing from the central concepts of the invention described herein. Therefore, the invention is not limited to the specific embodiments disclosed herein, but may include all embodiments and equivalents that fall within the scope of the invention.

[0205] The above description, in conjunction with specific embodiments, provides a further detailed explanation of the present invention. It should not be construed that the specific implementation of the present invention is limited to these descriptions. For those skilled in the art, various substitutions or modifications can be made to these described embodiments without departing from the inventive concept, and all such substitutions or modifications should be considered within the scope of protection of the present invention.

[0206] Although the invention and its advantages have been described in detail, it should be understood that various changes, substitutions, and modifications can be made without departing from the spirit and scope of the invention. Furthermore, the scope of the invention is not limited to the specific embodiments of the processes, machines, manufactures, compositions of matter, methods, and steps described in the specification. From the disclosure of this invention, those skilled in the art will readily utilize existing or future processes, machines, manufactures, compositions of matter, methods, or steps that substantially perform the same function or achieve the same results as the corresponding embodiments described herein. Therefore, the appended claims are intended to encompass such processes, machines, manufactures, compositions of matter, methods, or steps.

Claims

1. A power distribution network reconfiguration optimization control system based on a microcontroller and particle swarm optimization algorithm, characterized in that, include: Data acquisition module; control module; Network reconstruction module; Intelligent switch module; Human-computer interaction module; Communication module; The fault module; the output of the data acquisition module is connected to the input of the control module and the input of the fault module, the output of the fault module is connected to the input of the control module, the output of the control module is connected to the network reconstruction module, the intelligent switch module, the human-machine interaction module and the communication module respectively, the output of the network reconstruction module is connected to the input of the control module, and the communication module is also connected to the computer.

2. The power distribution network reconfiguration optimization control system based on a microcontroller and particle swarm optimization algorithm according to claim 1, characterized in that, The data acquisition module includes a high-precision voltage sensor, an ACS712 Hall effect current sensor, and a 12-bit ADC conversion circuit. The ACS712 Hall effect current sensor has a measurement range of ±20A and a linear error of less than 1.5%. The 12-bit ADC conversion circuit has a conversion accuracy of 0.7-0.9mV. The output terminals of the voltage sensor and the current sensor are connected to the input terminals of the ADC conversion circuit. The output terminal of the ADC conversion circuit is connected to the GPIO port and ADC channel of the STM32F103C8T6 microcontroller of the control module through signal lines.

3. The power distribution network reconfiguration optimization control system based on a microcontroller and particle swarm optimization algorithm according to claim 1, characterized in that, The control module is based on an STM32F103C8T6 microcontroller with a main frequency of 64MHz-72MHz. It is connected to the data acquisition module through GPIO ports and uses a 40ms-60ms periodic interrupt to sample data. It supports hardware multiplication and division operations and bit-band operations. The microcontroller interacts with the network reconstruction module through its internal data bus and outputs control signals to the intelligent switch module through GPIO ports.

4. The power distribution network reconfiguration optimization control system based on a microcontroller and particle swarm optimization algorithm according to claim 1, characterized in that, The network reconstruction module is based on an improved particle swarm optimization algorithm, which includes a particle concentration probability screening mechanism. Specifically, in each iteration, the spatial distribution concentration of particles is calculated, and the selection probability of particles in regions with concentrations exceeding a preset threshold is reduced to guide particles to search for low-concentration regions.

5. The power distribution network reconfiguration optimization control system based on a microcontroller and particle swarm optimization algorithm according to claim 4, characterized in that, The improved particle swarm optimization algorithm includes an active detection principle, which guides the movement of the optimal particle to an effective region by exploring spatial reference points; the effective region is the topological range of the distribution network where the load is balanced and the voltage is stable.

6. The power distribution network reconfiguration optimization control system based on a microcontroller and particle swarm optimization algorithm according to claim 1, characterized in that, The intelligent switch module includes a relay and a drive circuit, supports remote control and timed control, has a remote control response time of less than 1 second, and a switch status feedback error of 0. The input terminal of the drive circuit is connected to the output terminal of the control module, and the status feedback terminal of the relay is connected to the GPIO input port of the control module through an optocoupler.

7. The power distribution network reconfiguration optimization control system based on a microcontroller and particle swarm optimization algorithm according to claim 1, characterized in that, The human-computer interaction module includes a 0.96-inch OLED debugging screen, a 4.3-inch serial port display screen, and a 4.3-inch resistive touch serial port screen. The touch serial port screen implements parameter setting and fault alarm based on the Taojingchi self-developed programming language. The 0.96-inch OLED is connected to the control module through an I2C interface, and the 4.3-inch serial port screen and the touch serial port screen are connected to the STM32F103C8T6 microcontroller of the control module through a USART interface.

8. The power distribution network reconfiguration optimization control system based on a microcontroller and particle swarm optimization algorithm according to claim 1, characterized in that, The communication module includes a CH340 USB-UART converter chip and a USART interface. The CH340 chip supports 3.3V / 5V level adaptation and a maximum baud rate of 2Mbps. The USART interface is used for bidirectional communication between the control module and the serial port screen. One end of the CH340 USB-UART converter chip is connected to the computer via a USB interface, and the other end is connected to the USART interface of the STM32F103C8T6 microcontroller of the control module via a UART interface. The USART interface connects the control module and the serial port screen.

9. The power distribution network reconfiguration optimization control system based on a microcontroller and particle swarm optimization algorithm according to claim 1, characterized in that, The fault module presets fault judgment thresholds for parameters such as current and voltage. When the collected data exceeds the threshold, an alarm mechanism is triggered, and a fault signal is sent to the control module.

10. A method of using the power distribution network reconfiguration optimization control system based on a single-chip microcomputer and particle swarm optimization algorithm as described in any one of claims 1-9, characterized in that, Includes the following steps: (1) System initialization: After power-on, the STM32 microcontroller automatically completes peripheral initialization, the 0.96-inch OLED displays "System startup", and the 4.3-inch serial port screen displays the initial topology diagram; after waiting for 3 seconds, the system enters the normal monitoring state; (2) Routine monitoring: Data acquisition: Voltage and current data are collected every 50ms, and active power is calculated after filtering. The results are displayed synchronously on the OLED and serial port screen; Status judgment: Data is compared with threshold in real time. If it is normal, monitoring continues. If a fault is triggered, proceed to step 3; (3) Fault handling: Alarm trigger: The buzzer sounds, the red LED flashes, and the serial port screen displays the fault type and location; Algorithm start: The 69-node system parameters are automatically loaded, the particle swarm is initialized and iterative optimization begins, and the serial port screen displays "Reconstruction in progress"; (4) Topology Adjustment: Solution Output: After iteration, the optimal solution is displayed on the serial port screen, and the topology adjustment diagram is generated on the computer; Execution Control: The microcontroller sends instructions to the intelligent switch module, and the relays feedback the status after action to confirm that the adjustment is complete; (5) Recovery feedback: Status update: The serial port screen displays "Reconstruction complete", and the voltage curve is updated to the adjusted data; Log storage: The computer automatically saves the fault time, processing process and optimization results, which can be queried later.