A method for active power filter compensation based on DSP calculation

The optimized compensation current command generated by DSP calculation and synchronous sampling filtering solves the problem that the internal state of the device is not considered in the existing technology, realizes the collaborative management of the device and the power grid, and improves the safety and efficiency of active power filtering compensation.

CN122437009APending Publication Date: 2026-07-21NANJING XINRUI POWER TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
NANJING XINRUI POWER TECH CO LTD
Filing Date
2026-04-08
Publication Date
2026-07-21

AI Technical Summary

Technical Problem

Existing active power filtering compensation technologies fail to effectively combine the internal state of the device with the external power grid state, resulting in increased operational risks and reduced compensation effectiveness, making it difficult to adapt to complex and ever-changing power grid scenarios.

Method used

The DSP calculates and collects load signals and grid voltage signals from the grid side, performs synchronous sampling and filtering, generates fundamental reactive power compensation and harmonic compensation current commands, and combines them with internal state parameters of the device for dynamic collaborative processing to generate optimized compensation current commands. The inverter is then controlled by PWM modulation for compensation.

Benefits of technology

It enables coordinated management of the internal status of the device and the external power grid compensation, improves the rationality of compensation commands and the safety of device operation, avoids inverter switching losses and electromagnetic interference, and extends the service life of the device.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122437009A_ABST
    Figure CN122437009A_ABST
Patent Text Reader

Abstract

The present application relates to the technical fields of power quality treatment, disclose a kind of active power filter compensation method based on DSP calculation, the method includes: acquisition grid side load current signal and grid voltage signal and carries out filtering, obtains current sequence and voltage sequence;Subsequently, the harmonic and reactive characteristics of load current in power grid are analyzed, the fundamental reactive compensation current instruction and harmonic compensation current instruction are generated;According to real-time grid state parameters, the generated instruction is dynamically cooperated and handled, and the cooperative compensation current instruction is generated;The internal state parameters of power quality treatment device are collected, and based on the cooperative compensation current instruction, the optimized final compensation current instruction is generated by solving with constraint optimization;Based on the instruction, the corresponding compensation current is generated by PWM modulation control inverter and injected into the grid;The present application can improve the efficiency of a kind of active power filter compensation based on DSP calculation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of power quality management technology, and in particular to an active power filtering compensation method based on DSP calculation. Background Technology

[0002] Current active power filtering and compensation technologies in power systems mostly focus on the detection and compensation of harmonics and reactive power components on the grid side. They only aim to optimize the power quality of the external power grid and do not consider the internal operating status of the device itself during the compensation command generation stage. They cannot dynamically adjust the compensation strategy according to key parameters such as IGBT junction temperature and DC bus voltage, which can easily lead to the device output exceeding the safe operating boundary. This not only reduces the service life of power devices but may also cause device failure due to overcurrent and overheating, affecting the stable operation of the power system. At the same time, the compensation command generation of existing technologies lacks multi-objective optimization design and does not incorporate smoothing processing based on future time-domain command prediction. The compensation command is prone to sudden changes, which leads to increased inverter switching losses, aggravated electromagnetic interference, and difficulty in achieving dynamic adaptation in the resource allocation for harmonic filtering and reactive power compensation.

[0003] Traditional active power filtering compensation methods always revolve around "how to better compensate external loads," treating the device as a simple execution unit and neglecting the synergy between the device's own operating state and the external compensation effect. This results in a technical limitation of "emphasizing external compensation while neglecting internal management." From this perspective, the formulation of compensation strategies lacks consideration of the device's instantaneous safe output boundary, failing to meet the grid compensation requirements while ensuring the device's safe and efficient operation. When the grid state fluctuates or the device's internal parameters change, the dual problems of decreased compensation effect and increased device operating risk easily arise. This makes it difficult to adapt to complex and ever-changing grid operating scenarios, restricting the overall performance and practical application value of active power filtering compensation devices. Therefore, how to improve power filtering compensation methods to adapt to complex and ever-changing grid operating scenarios has become an urgent problem to be solved. Summary of the Invention

[0004] This invention provides an active power filtering compensation method based on DSP calculation to solve the problems mentioned in the background art.

[0005] To achieve the above objectives, the present invention provides an active power filtering compensation method based on DSP calculation, comprising: S1, synchronously sample and filter the load current signal and grid voltage signal collected by the sensor to obtain the synchronous sampling current sequence and synchronous sampling voltage sequence; S2, Based on the synchronous sampling current sequence and the synchronous sampling voltage sequence, analyze the harmonic and reactive characteristics of the load current in the power grid to generate the fundamental reactive compensation current command and the harmonic compensation current command. S3, Based on real-time grid status parameters, dynamically coordinate the fundamental reactive power compensation current command and the harmonic compensation current command to generate a coordinated compensation current command. S4. Collect the internal state parameters of the power quality management device. Based on the internal state parameters and the collaborative compensation current command, generate the optimized final compensation current command through constrained optimization solution. S5, based on the final compensation current command, the inverter is controlled by PWM modulation to generate the corresponding compensation current and inject it into the power grid.

[0006] In a preferred embodiment, the step of synchronously sampling and filtering the grid-side load current signal and grid voltage signal acquired by the sensor to obtain a synchronously sampled current sequence and a synchronously sampled voltage sequence includes: Collect simulated load current signals and simulated grid voltage signals from a three-phase power grid; The load current analog signal and the grid voltage analog signal are synchronously converted into digital signals to obtain the initial three-phase current discrete sequence and the initial three-phase voltage discrete sequence. The initial three-phase current discrete sequence and the initial three-phase voltage discrete sequence are subjected to low-pass filtering to obtain the synchronous sampling current sequence and the synchronous sampling voltage sequence.

[0007] In a preferred embodiment, the step of analyzing the harmonic and reactive power characteristics of the load current in the power grid based on the synchronously sampled current sequence and the synchronously sampled voltage sequence to generate a fundamental reactive power compensation current command and a harmonic compensation current command includes: Based on the synchronously sampled current sequence and the synchronously sampled voltage sequence, coordinate transformation is performed on the three-phase load current and grid voltage to obtain the current component, voltage component and grid voltage phase angle in the two-phase stationary coordinate system. A fundamental reactive power compensation analysis is performed on the phase angle of the grid voltage and the current components in the two-phase stationary coordinate system to obtain the fundamental reactive power compensation current command. Harmonic compensation analysis is performed on the phase angle between the synchronously sampled current sequence and the grid voltage to obtain the harmonic compensation current command.

[0008] In a preferred embodiment, the step of performing fundamental reactive power compensation analysis on the grid voltage phase angle and the current components in the two-phase stationary coordinate system to obtain the fundamental reactive power compensation current command includes: Based on the grid voltage phase angle and the current components in the two-phase stationary coordinate system, the current components in the rotating coordinate system are calculated through synchronous rotating coordinate transformation to obtain the active current components and reactive current components. The reactive current component is subjected to low-pass filtering to extract the fundamental reactive current component that represents the fundamental reactive characteristics of the load. Based on the fundamental reactive current component and the target reactive current setpoint, the fundamental reactive current compensation current command is generated through a control algorithm.

[0009] In a preferred embodiment, the step of performing harmonic compensation analysis on the phase angle between the synchronously sampled current sequence and the grid voltage to obtain a harmonic compensation current command includes: Based on the synchronously sampled current sequence and the phase angle of the grid voltage, a synchronous rotating coordinate transformation of the load current at a specific harmonic frequency is performed to obtain the DC component of each harmonic in the corresponding rotating coordinate system. The DC components of each harmonic are low-pass filtered to extract the harmonic current components that represent the characteristics of each harmonic of the load. Based on the harmonic current components, a time-domain waveform is synthesized through inverse coordinate transformation to generate the harmonic compensation current command.

[0010] In a preferred embodiment, the step of dynamically coordinating the fundamental reactive power compensation current command and the harmonic compensation current command based on real-time grid state parameters to generate a coordinated compensation current command includes: Based on the synchronously sampled voltage sequence, the real-time power factor and total harmonic distortion rate of the power grid are calculated. Based on the real-time power factor, the total harmonic distortion of the voltage, and the preset target parameters, the dynamic weighting coefficient is calculated through an adaptive weighting function. Based on the dynamic weighting coefficient, the fundamental reactive power compensation current command and the harmonic compensation current command are weighted and synthesized to generate the coordinated compensation current command.

[0011] In a preferred embodiment, the preset target parameters include a target power factor value and a target limit for voltage harmonic distortion rate.

[0012] In a preferred embodiment, the internal state parameters of the power quality management device are collected, and based on these internal state parameters and the collaborative compensation current command, an optimized final compensation current command is generated through constrained optimization, including: Collect the internal state parameters of the power quality management device to obtain the set of internal state parameters; Based on the set of internal state parameters, the instantaneous safe output boundary of power quality management in the current state is calculated, and then the constraint conditions are constructed and solved to obtain the optimized compensation current command sequence in the future finite time domain. The command value at the current moment is extracted from the optimized compensation current command sequence within the future finite time domain to serve as the optimized final compensation current command.

[0013] In a preferred embodiment, the step of calculating the instantaneous safe output boundary of power quality management in the current state based on the internal state parameter set, and then constructing and solving the constraint conditions to obtain the optimized compensation current command sequence in the future finite time domain includes: Based on the set of internal state parameters, the instantaneous safe output boundary of power quality management in the current state is calculated to obtain the maximum allowable output current amplitude boundary and the maximum allowable output current change rate boundary. Based on the aforementioned collaborative compensation current command, a command tracking error and smoothness cost function in the future finite time domain is constructed, and constraints are constructed by combining the maximum allowable output current amplitude boundary and the maximum allowable output current change rate boundary to form a constrained rolling time domain optimization problem. Solve the constrained rolling time-domain optimization problem to obtain the optimized compensation current command sequence in the future finite time domain.

[0014] In a preferred embodiment, the step of generating a corresponding compensation current and injecting it into the grid by controlling the inverter through PWM modulation based on the final compensation current command includes: Based on the final compensation current command, a corresponding PWM drive pulse signal is generated using a PWM modulation algorithm; The PWM drive pulse signal is applied to the power switching device of the inverter to control its switching action, so that the inverter generates a compensation current corresponding to the final compensation current command. The compensation current is injected into the power grid to counteract the reactive and harmonic components in the load current.

[0015] Compared with the prior art, the present invention has the following beneficial effects: 1. This invention achieves multi-objective command optimization and shaping based on device internal state and command prediction, significantly improving the rationality of compensation commands and the safety of device operation. By collecting core internal state parameters of the device, such as IGBT chip junction temperature, DC bus voltage, and heat sink temperature, the instantaneous safe output boundary under the current state is accurately calculated, and the maximum allowable output current amplitude and rate of change are clearly defined. At the same time, combined with the predicted value of the future finite-time domain collaborative compensation current command, a dual-objective cost function including command tracking error and smoothness is constructed. The optimized compensation current command sequence is generated by solving the constrained rolling time domain optimization. This method not only ensures the tracking accuracy of compensation commands to the grid compensation demand, but also achieves smooth shaping of commands, effectively avoiding problems such as increased inverter switching losses and aggravated electromagnetic interference caused by sudden changes in compensation commands. It can also strictly control the device output within the safety boundary, prevent overcurrent and overheating of power devices, and extend the service life of the core devices.

[0016] 2. This invention redefines the control problem of active power filter compensation devices, achieving a fundamental shift in control perspective and bringing about a qualitative change in technical solutions. It breaks through the limitations of traditional technologies that "emphasize external compensation while neglecting internal management." This invention upgrades the control logic from the traditional single focus on "how to better compensate external loads" to a dual-core logic of "optimally managing the device's own operating state while ensuring the effectiveness of external grid harmonic filtering and reactive power compensation." It incorporates the device's own operating state into the core consideration of compensation control, achieving a synergistic balance between external grid compensation needs and the device's internal safe operation. This perspective shift ensures that the formulation of compensation strategies is no longer divorced from the actual operating capabilities of the device. When the grid state fluctuates or the device's internal parameters change, it can dynamically allocate compensation resources based on the real-time power factor and harmonic distortion rate of the grid to ensure the effectiveness of power quality management. It can also dynamically adjust compensation commands based on the device's internal state to optimally plan the device's operating state, ensuring that the device remains in a safe and efficient operating state while achieving good compensation results. This significantly improves the comprehensive performance and practical engineering adaptability of the active power filter compensation system. Attached Figure Description

[0017] Figure 1 This is a flowchart illustrating an active power filtering compensation method based on DSP calculation, provided in an embodiment of the present invention. The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0018] It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.

[0019] This application provides an active power filtering compensation method based on DSP computing. The execution entity of this DSP-based active power filtering compensation method includes, but is not limited to, at least one of the following electronic devices that can be configured to execute the method provided in this application embodiment: a server, a terminal, etc. In other words, the DSP-based active power filtering compensation method can be executed by software or hardware installed on a terminal device or a server device. The server includes, but is not limited to, a single server, a server cluster, a cloud server, or a cloud server cluster. The server can be an independent server or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms.

[0020] Reference Figure 1 The diagram shown is a flowchart illustrating an active power filtering compensation method based on DSP calculation, according to an embodiment of the present invention.

[0021] In this embodiment, the active power filtering compensation method based on DSP calculation includes: S1, synchronously sample and filter the load current signal and grid voltage signal collected by the sensor to obtain the synchronous sampling current sequence and synchronous sampling voltage sequence; In this embodiment of the invention, the step of synchronously sampling and filtering the grid-side load current signal and grid voltage signal acquired by the sensor to obtain a synchronously sampled current sequence and a synchronously sampled voltage sequence includes: Collect simulated load current signals and simulated grid voltage signals from a three-phase power grid; The load current analog signal and the grid voltage analog signal are synchronously converted into digital signals to obtain the initial three-phase current discrete sequence and the initial three-phase voltage discrete sequence. The initial three-phase current discrete sequence and the initial three-phase voltage discrete sequence are subjected to low-pass filtering to obtain the synchronous sampling current sequence and the synchronous sampling voltage sequence.

[0022] It should be noted that the purpose of acquiring the load current analog signal and grid voltage analog signal of the three-phase power grid through current transformers and voltage transformers is to obtain the continuous-time analog quantities of the original current and system voltage generated by the electrical equipment in the power grid. These analog signals are the physical basis for all subsequent digital calculations and control.

[0023] It should be noted that synchronous analog-to-digital conversion of the load current analog signal and the grid voltage analog signal refers to using a common high-precision clock source to drive multiple analog-to-digital conversion channels to ensure that the sampling times of the three-phase current and three-phase voltage are strictly aligned, thereby accurately capturing the phase relationship between the current and voltage of each phase at the same instant.

[0024] It should be noted that low-pass filtering is used to suppress high-frequency noise components in the signal and prevent spectral aliasing. The cutoff frequency of the low-pass filtering is set to be higher than the highest harmonic frequency to be compensated, so as to filter out high-frequency noise introduced by switching device operation, radio frequency interference, etc. while retaining all target harmonic and fundamental information.

[0025] Furthermore, the mathematical expression of the difference equation used in the low-pass filtering process is as follows: ; In the formula, The initial discrete sequence input for the nth sampling point. The filtered discrete sequence output at the nth sampling point. and To determine the coefficients of the filter's frequency response, and , i and j are the orders of the input and output filters, respectively, i and j are the order indices of the input and output filters, and n is the sampling point index.

[0026] Furthermore, the coefficients that determine the frequency response of the filter are set as follows: the signal to be filtered out first is high-frequency noise, while the signal to be retained is all the harmonics that need to be analyzed, such as the highest harmonic up to the 50th harmonic, i.e., 2500Hz; therefore, a cutoff frequency needs to be set, which is slightly higher than the highest harmonic frequency, for example, 3000Hz. Selecting the filter type and calculating coefficients: Based on the above objectives, select a Butterworth filter. Then, using the filter design tool, input the sampling frequency, cutoff frequency, and desired filter order to automatically calculate the corresponding coefficients. and ; Choosing the order: The higher the order, the better the filtering effect, but the greater the computational load. In this invention, filters of the 2nd to 4th order are selected, which can meet the real-time computing requirements of the DSP while ensuring good filtering effect.

[0027] S2, Based on the synchronous sampling current sequence and the synchronous sampling voltage sequence, analyze the harmonic and reactive characteristics of the load current in the power grid to generate the fundamental reactive compensation current command and the harmonic compensation current command. In this embodiment of the invention, the step of analyzing the harmonic and reactive power characteristics of the load current in the power grid based on the synchronously sampled current sequence and the synchronously sampled voltage sequence to generate a fundamental reactive power compensation current command and a harmonic compensation current command includes: Based on the synchronously sampled current sequence and the synchronously sampled voltage sequence, coordinate transformation is performed on the three-phase load current and grid voltage to obtain the current component, voltage component and grid voltage phase angle in the two-phase stationary coordinate system. A fundamental reactive power compensation analysis is performed on the phase angle of the grid voltage and the current components in the two-phase stationary coordinate system to obtain the fundamental reactive power compensation current command. Harmonic compensation analysis is performed on the phase angle between the synchronously sampled current sequence and the grid voltage to obtain the harmonic compensation current command.

[0028] It should be noted that coordinate transformation refers to converting the time-synchronized three-phase current and voltage data from the natural three-phase coordinate system to the two-phase stationary coordinate system to simplify subsequent calculations and separate the phase-independent orthogonal components. The resulting current and voltage components in the two-phase stationary coordinate system are used to accurately calculate the real-time phase angle of the grid voltage from the voltage component. This angle is used to align the reference axes of all rotating coordinate systems.

[0029] Furthermore, the coordinate transformation employs the Clarke transformation, the mathematical expression of which is as follows: ; In the formula, , , These are the three-phase instantaneous values ​​of the synchronously sampled current sequence. , These are the current components in the two-phase stationary coordinate system obtained after the transformation. This expression projects the instantaneous values ​​of the three-phase currents onto two mutually perpendicular stationary coordinate axes according to a fixed proportional coefficient, thereby obtaining a two-dimensional vector representation that is completely equivalent to the instantaneous values ​​of the three phases. This vector contains all the information of the original three-phase currents and eliminates the zero-sequence component in the three-phase system. The phase angle of the grid voltage is obtained by calculating the arctangent of the two voltage components.

[0030] In this embodiment of the invention, the step of performing fundamental reactive power compensation analysis on the grid voltage phase angle and the current components in the two-phase stationary coordinate system to obtain the fundamental reactive power compensation current command includes: Based on the grid voltage phase angle and the current components in the two-phase stationary coordinate system, the current components in the rotating coordinate system are calculated through synchronous rotating coordinate transformation to obtain the active current components and reactive current components. The reactive current component is subjected to low-pass filtering to extract the fundamental reactive current component that represents the fundamental reactive characteristics of the load. Based on the fundamental reactive current component and the target reactive current setpoint, the fundamental reactive current compensation current command is generated through a control algorithm.

[0031] It should be noted that, based on the grid voltage phase angle and the current components in the two-phase stationary coordinate system, calculating the current components in the rotating coordinate system through synchronous rotating coordinate transformation means using the phase angle to construct a coordinate system that rotates synchronously with the fundamental positive sequence component of the grid voltage, and projecting the current vector in the stationary coordinate system onto the rotating coordinate system.

[0032] Furthermore, the mathematical expression for the synchronous rotational coordinate transformation is as follows: ; In the formula, , These are the current components in the two-phase stationary coordinate system obtained after the transformation. The phase angle of the grid voltage. , These are the active and reactive current components in the synchronous rotating coordinate system obtained after the transformation.

[0033] This transformation method uses a transformation matrix that rotates at an angular velocity to transform the current vector in a stationary coordinate system to a coordinate system that rotates synchronously with the fundamental frequency of the power grid. In this coordinate system, the fundamental positive sequence component of the load current is represented as a DC component, while the harmonic components are represented as AC components. The angular velocity is the derivative of the phase angle of the power grid voltage.

[0034] It should be noted that the low-pass filtering of the reactive current component is to separate its DC component from the reactive current component in the rotating coordinate system. Since it not only contains the fundamental reactive component, but may also contain high-frequency AC fluctuations caused by harmonics and noise, by setting a low-pass filter with a cutoff frequency much lower than the fundamental frequency of the power grid, these high-frequency AC components can be effectively filtered out, thereby extracting the pure fundamental reactive current component that represents the fundamental reactive characteristics of the load.

[0035] It should be noted that, based on the fundamental reactive current component and the target reactive current setpoint, the fundamental reactive current compensation current command is generated by the control algorithm. This means that the extracted fundamental reactive current component is compared with the desired reactive target, and the deviation is processed by a control algorithm. The output of the control algorithm is transformed back to the three-phase stationary coordinate system through inverse Park transform and inverse Clarke transform, and finally the three-phase fundamental reactive current compensation current command required to offset the fundamental reactive power of the load is generated. The reactive target is usually set to 0.

[0036] Furthermore, the control algorithm is proportional-integral control, which calculates control commands based on the "current error" and the "sum of errors over a past period of time"; The proportional part: directly multiply the current error by a coefficient, which is fast-acting and can quickly reduce the error; Integral part: By summing up the historical errors and multiplying them by a coefficient, the final steady-state error can be completely eliminated; The deviation between the fundamental reactive current component and the reactive target is fed into this PI controller; the signal output by the controller is transformed by coordinate inverse to generate the final three-phase fundamental reactive current compensation command, where the coefficients are set by the experimental debugging personnel to ensure that the system is both stable and responsive.

[0037] In this embodiment of the invention, the step of performing harmonic compensation analysis on the phase angle between the synchronously sampled current sequence and the grid voltage to obtain a harmonic compensation current command includes: Based on the synchronously sampled current sequence and the phase angle of the grid voltage, a synchronous rotating coordinate transformation of the load current at a specific harmonic frequency is performed to obtain the DC component of each harmonic in the corresponding rotating coordinate system. The DC components of each harmonic are low-pass filtered to extract the harmonic current components that represent the characteristics of each harmonic of the load. Based on the harmonic current components, a time-domain waveform is synthesized through inverse coordinate transformation to generate the harmonic compensation current command.

[0038] It should be noted that, based on the synchronous sampling current sequence and the phase angle of the grid voltage, the synchronous rotating coordinate transformation of the load current at a specific harmonic frequency refers to constructing a coordinate system rotating at h times the fundamental angular velocity for the h-th harmonic that needs to be compensated, and performing a Park transformation on the two-phase stationary current components using h times the grid voltage phase angle. Under this synchronous rotating coordinate system of the specific harmonic, the component of that harmonic in the load current will be represented as a DC quantity, while the fundamental and other harmonics will be represented as AC quantities.

[0039] Furthermore, the mathematical expression for the transformation of the h-th harmonic is as follows: ; In the formula, , These are the current components in the two-phase stationary coordinate system obtained after the transformation. Let be the rotational phase angle of the h-th harmonic. , Let represent the current component in the rotating coordinate system of the h-th harmonic after transformation, where h is the harmonic order that needs to be compensated.

[0040] Furthermore, the value of h is a pre-defined list containing the data [5,7,11,13].

[0041] It should be noted that the DC component of each harmonic is subjected to low-pass filtering in order to extract the DC component representing the characteristics of that harmonic from the current component in the rotating coordinate system of each harmonic; the high-frequency fluctuations caused by imperfect transformation or coupling of other frequency components are filtered out by the low-pass filter to obtain a stable h-th harmonic current component.

[0042] It should be noted that, based on the harmonic current components, synthesizing the time-domain waveform through inverse coordinate transformation to generate the harmonic compensation current command means that the extracted DC components of each harmonic are subjected to inverse Park transformation using the corresponding harmonic phase angle to obtain the time-domain component of that harmonic in the two-phase stationary coordinate system; the time-domain components of all harmonics that need to be compensated are superimposed in the stationary coordinate system, and then an inverse Clarke transformation is performed to synthesize the final three-phase harmonic compensation current command.

[0043] S3, Based on real-time grid status parameters, dynamically coordinate the fundamental reactive power compensation current command and the harmonic compensation current command to generate a coordinated compensation current command. In this embodiment of the invention, the step of dynamically coordinating the fundamental reactive power compensation current command and the harmonic compensation current command based on real-time grid state parameters to generate a coordinated compensation current command includes: Based on the synchronously sampled voltage sequence, the real-time power factor and total harmonic distortion rate of the power grid are calculated. Based on the real-time power factor, the total harmonic distortion of the voltage, and the preset target parameters, the dynamic weighting coefficient is calculated through an adaptive weighting function. Based on the dynamic weighting coefficient, the fundamental reactive power compensation current command and the harmonic compensation current command are weighted and synthesized to generate the coordinated compensation current command.

[0044] It should be noted that, based on the aforementioned synchronously sampled voltage sequence, calculating the real-time power factor and total harmonic distortion (THD) of the power grid refers to analyzing the instantaneous operating state of the power grid within one power frequency cycle using high-quality voltage data that has undergone synchronous sampling and filtering. The calculated real-time power factor reflects the ratio of active power to apparent power in the power grid, directly characterizing the supply and demand balance of reactive power. The calculated THD reflects the degree to which the power grid voltage waveform deviates from a sine wave, directly characterizing the level of harmonic pollution. These two parameters together constitute the quantitative basis for assessing the core issues of current power quality and determining the priority of compensation strategies.

[0045] Furthermore, the real-time power factor is calculated based on the voltage and current sampling sequence within one power frequency cycle, and is obtained by calculating the average value of instantaneous active power and apparent power. Total harmonic distortion of voltage The calculation formula is: In the formula, The root mean square value of the synchronously sampled voltage sequence within one period. This is the effective value of the fundamental component in the synchronously sampled voltage sequence; the larger this value, the more severe the voltage waveform distortion and the higher the harmonic content.

[0046] It should be noted that, based on the real-time power factor, the total harmonic distortion rate of the voltage, and the preset target parameters, the dynamic weight coefficients are calculated by an adaptive weight function. This means that the actual value representing the current problem is compared with the target value to be achieved, and the deviation is used as input. Two weight coefficients α and β are then dynamically and smoothly calculated through a specific mathematical function. In this process, the weighting coefficient α represents the proportion or priority of the fundamental reactive power compensation command in the final synthesized command, and the weighting coefficient β represents the proportion or priority of the harmonic compensation command, satisfying α+β=1. This step is the core decision-making process of the dynamic coordination strategy, ensuring that compensation resources can be intelligently allocated according to real-time changes in the power grid status.

[0047] Furthermore, the mathematical expression of the adaptive weighting function is as follows: ; In the formula, For real-time power factor, The total harmonic distortion of voltage. Preset power factor target value for users This refers to the allowable limit for voltage harmonic distortion rate. This represents the typical deviation of the power factor. This represents a typical deviation in harmonic distortion rate. and A sensitivity coefficient greater than zero is used to adjust the strength of the influence of power factor deviation and harmonic distortion rate deviation on the weight, respectively. The typical deviation of power factor is 0.15, and the typical deviation of harmonic distortion rate is 2%. The mathematical characteristics of this function ensure that the weighting coefficient changes continuously and smoothly with the grid status, avoiding abrupt changes in compensation commands due to weight jumps, thus ensuring the stability of control. When the power factor is low (i.e., the user-preset power factor target value minus the real-time power factor is positive) and the harmonics are not severe, α approaches 1, and the system focuses on reactive power compensation. When the harmonics are severely excessive (i.e., the total voltage harmonic distortion rate minus the allowable limit of voltage harmonic distortion rate is positive), α decreases and β increases, and the system focuses on harmonic filtering.

[0048] It should be noted that, based on the dynamic weighting coefficients, the weighted synthesis of the fundamental reactive power compensation current command and the harmonic compensation current command to generate the coordinated compensation current command means that, in each control cycle, the dynamic weighting coefficients α and β are multiplied by the instantaneous values ​​of the corresponding fundamental reactive power compensation current command and harmonic compensation current command, respectively, and then the two products are added together to obtain the coordinated compensation current command at the current moment; that is, the target waveform of the total compensation current expected to be output in this cycle is determined after comprehensively considering the urgency of the current power grid reactive power and harmonic problems.

[0049] In this embodiment of the invention, the preset target parameters include a target value for power factor and a target limit for voltage harmonic distortion rate.

[0050] It should be noted that the target power factor value is the power factor level that the power grid is expected to achieve after compensation. It is a core indicator for measuring the effectiveness of reactive power compensation. The closer its value is to 1, the more balanced the reactive power supply and demand of the system is and the lower the line loss is. Typical values: Based on relevant national power quality standards and actual engineering requirements, the value is usually set between 0.95 and 1.0. For example, it is often set to 0.98 to achieve a good balance between compensation effect and device capacity utilization, and set to 1.0 in cases where unity power factor is required.

[0051] It should be noted that the target limit for voltage harmonic distortion rate is the threshold value that the total harmonic distortion rate of the grid voltage is not allowed to exceed. It is a requirement for the harmonic filtering effect. The smaller the value, the higher the requirement for power quality. Typical values: According to national standards for different voltage levels and occasions, it is usually set between 3% and 5%. For example, for general industrial and commercial power use, it is usually set at 5%; for occasions sensitive to power quality (such as data centers and precision laboratories), it can be set to a more stringent 3% or lower.

[0052] Furthermore, the values ​​of these preset target parameters are not fixed, but can be configured in the device parameter setting interface according to specific application scenarios, user contract requirements, or local standards of the power grid company.

[0053] Furthermore, the coordinated compensation current command is an ideal target that only considers what the power grid needs. The internal optimization takes this ideal target as a reference and calculates a safe and feasible final command to execute while ensuring that the device itself does not overheat or overload. Therefore, its positioning evolution is clear and necessary: ​​as the result of step S3, it is then used as the input or reference for step S4, and finally step S4 outputs another final command.

[0054] S4. Collect the internal state parameters of the power quality management device. Based on the internal state parameters and the collaborative compensation current command, generate the optimized final compensation current command through constrained optimization solution. In this embodiment of the invention, the internal state parameters of the power quality management device are collected. Based on the internal state parameters and the collaborative compensation current command, an optimized final compensation current command is generated through constrained optimization, including: Collect the internal state parameters of the power quality management device to obtain the set of internal state parameters; Based on the set of internal state parameters, the instantaneous safe output boundary of power quality management in the current state is calculated, and then the constraint conditions are constructed and solved to obtain the optimized compensation current command sequence in the future finite time domain. The command value at the current moment is extracted from the optimized compensation current command sequence within the future finite time domain to serve as the optimized final compensation current command.

[0055] It should be noted that collecting the internal state parameters of the power quality management device refers to acquiring the physical operating status data of the key power devices and DC bus in real time. The set of internal state parameters includes at least the real-time junction temperature estimate of the IGBT chip, the instantaneous sampled value of the DC bus voltage, and the heat sink temperature.

[0056] It should be noted that extracting the instruction value at the current moment from the optimized compensation current instruction sequence within the future finite time domain means taking the first element of the optimized compensation current instruction sequence within the future finite time domain as the optimized final compensation current instruction that should be actually output in the current control cycle. Here, the value of the future finite time domain is generally 3.

[0057] In this embodiment of the invention, the step of calculating the instantaneous safe output boundary of power quality management in the current state based on the internal state parameter set, and then constructing and solving the constraint conditions to obtain the optimized compensation current command sequence in the future finite time domain includes: Based on the set of internal state parameters, the instantaneous safe output boundary of power quality management in the current state is calculated to obtain the maximum allowable output current amplitude boundary and the maximum allowable output current change rate boundary. Based on the aforementioned collaborative compensation current command, a command tracking error and smoothness cost function in the future finite time domain is constructed, and constraints are constructed by combining the maximum allowable output current amplitude boundary and the maximum allowable output current change rate boundary to form a constrained rolling time domain optimization problem. Solve the constrained rolling time-domain optimization problem to obtain the optimized compensation current command sequence in the future finite time domain.

[0058] It should be noted that, based on the aforementioned set of internal state parameters, the instantaneous safe output boundary of the computing device in the current state refers to the maximum allowable output current amplitude and maximum output current change rate under the current thermal and electrical conditions, calculated dynamically through a preset mathematical model based on the real-time estimated junction temperature of the IGBT chip, the instantaneous sampled value of the DC bus voltage, and the heat sink temperature. The maximum output current amplitude ensures that the IGBT does not overheat and does not exceed the maximum allowable effective value of the safe operating area under the current junction temperature and DC voltage.

[0059] Furthermore, the mathematical expression for the preset mathematical model for calculating the maximum permissible output current amplitude boundary is as follows: ; In the formula, The maximum allowable output current amplitude boundary, The rated output current of the device, This refers to the maximum allowable junction temperature of the IGBT. The temperature range from which the de-rating begins. The rated DC bus voltage, This is the instantaneous sampled value of the DC bus voltage; Similarly, the maximum allowable output current change rate boundary is calculated.

[0060] It should be noted that, based on the collaborative compensation current command, constructing the command tracking error and smoothness cost function in the future finite time domain, and constructing the constraint conditions in combination with the maximum allowable output current amplitude boundary and the maximum allowable output current change rate boundary, refers to formalizing the optimization problem within a period of three future control cycles. The instruction tracking error cost function is used to measure the degree of similarity between the optimized compensation current instruction sequence and the cooperative compensation current instruction. Its goal is to minimize the tracking error. The smoothness cost function is used to penalize drastic changes or high-frequency components in the instruction sequence. Its goal is to smooth the output instruction, thereby indirectly reducing switching losses, reducing electromagnetic interference, and improving system stability. Meanwhile, the maximum allowable output current amplitude boundary and the maximum allowable output current change rate boundary are used as constraints, requiring that the amplitude of each point in the optimization sequence must not exceed the maximum allowable output current amplitude boundary, and the change rate between adjacent points must not exceed the maximum allowable output current change rate boundary.

[0061] Furthermore, the mathematical description of the constrained rolling time-domain optimization problem is as follows: Objective function: ; Amplitude constraints: ; Rate of change constraint: ; In the formula, It is the predicted value of the collaborative compensation current command for the kth control cycle in the future. This is the optimized compensation current command for the k-th future control cycle, where λ1 is the tracking accuracy weighting coefficient, λ2 is the smoothness weighting coefficient, and ΔT is the control cycle time. Let be the objective function. The maximum allowable output current amplitude boundary, The maximum allowable rate of change of output current is the boundary. To control the periodic index, For prediction in the time domain; When k=1 and The actual output instructions for the first two known cycles; Under the premise of satisfying the amplitude and rate of change constraints, find the sequence that minimizes the total cost J.

[0062] Furthermore, the predicted value of the collaborative compensation current command for the kth control cycle can be obtained from historical data using the linear extrapolation method, which is to assume that the future changes at the recent rate. Instructions based on the current moment and the instructions from the previous moment ; First, calculate the most recent change: ; Then it is assumed that the same amount will be added to each future control cycle. ; Therefore, the predicted value for the kth period is: .

[0063] It should be noted that solving the constrained rolling time-domain optimization problem refers to using mathematical optimization algorithms to numerically solve optimization problems with quadratic objective functions and linear inequality constraints. Since the prediction time domain is usually short, 3 or 4, this problem is classified as a small-scale convex optimization problem that can be directly solved. The result of the solution is a length of The sequence, namely the optimized compensation current command sequence within the future finite time domain; this sequence is based on strictly ensuring the instantaneous safety boundary of the device, and is for the future... The optimal planning of step compensation commands balances the requirements of tracking accuracy of external power grid commands and the friendliness of internal device operation.

[0064] S5, based on the final compensation current command, the inverter is controlled by PWM modulation to generate the corresponding compensation current and inject it into the power grid.

[0065] In this embodiment of the invention, the step of generating a corresponding compensation current and injecting it into the grid by controlling the inverter through PWM modulation based on the final compensation current command includes: Based on the final compensation current command, a corresponding PWM drive pulse signal is generated using a PWM modulation algorithm; The PWM drive pulse signal is applied to the power switching device of the inverter to control its switching action, so that the inverter generates a compensation current corresponding to the final compensation current command. The compensation current is injected into the power grid to counteract the reactive and harmonic components in the load current.

[0066] It should be noted that, based on the final compensation current command, generating the corresponding PWM drive pulse signal through the PWM modulation algorithm means taking the digitized final compensation current command as the control target, using modulation algorithms such as space vector pulse width modulation or sinusoidal pulse width modulation to calculate the duty cycle signal of the turn-on and turn-off time of each insulated gate bipolar transistor in the three-phase inverter bridge, and generating six complementary PWM drive pulse logic signals with dead time.

[0067] It should be noted that applying the PWM drive pulse signal to the power switching devices of the inverter to control their switching action, so that the inverter generates a compensation current corresponding to the final compensation current command, means that the PWM logic signal generated by the DSP or dedicated PWM generator module is applied to the gate of each IGBT in the three-phase full-bridge inverter circuit after level conversion and power amplification by the isolation drive circuit; each IGBT switches at high speed according to the timing of the PWM signal, inverting the DC bus voltage into a PWM voltage waveform with specific amplitude, frequency and phase. After being filtered by the output reactor, the voltage waveform forms an AC compensation current at the inverter output that is consistent with the final compensation current command waveform but opposite in phase.

[0068] It should be noted that injecting the compensation current into the grid to offset the reactive and harmonic components in the load current means injecting the AC compensation current output by the inverter directly into the grid's point of common coupling (PCC) through a connecting reactor. According to Kirchhoff's current law, the injected compensation current and the load current are superimposed at the PCC point to form the grid-side current. When the compensation current is precisely controlled to be the negative value of the harmonic component and the fundamental reactive component in the load current, the grid-side current will mainly contain the fundamental active component of the load, thereby achieving harmonic filtering and reactive power compensation, and improving the power quality of the grid.

[0069] In the several embodiments provided by this invention, it should be understood that the disclosed method can be implemented in other ways.

[0070] It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the present invention.

[0071] The embodiments of this application can acquire and process relevant data based on artificial intelligence technology. Artificial intelligence is the theory, method, and technology that uses digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to obtain optimal results.

[0072] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.

Claims

1. An active power filtering compensation method based on DSP calculation, characterized in that, The method includes: S1, synchronously sample and filter the load current signal and grid voltage signal collected by the sensor to obtain the synchronous sampling current sequence and synchronous sampling voltage sequence; S2, Based on the synchronous sampling current sequence and the synchronous sampling voltage sequence, analyze the harmonic and reactive characteristics of the load current in the power grid to generate the fundamental reactive compensation current command and the harmonic compensation current command. S3, Based on real-time grid status parameters, dynamically coordinate the fundamental reactive power compensation current command and the harmonic compensation current command to generate a coordinated compensation current command. S4. Collect the internal state parameters of the power quality management device. Based on the internal state parameters and the collaborative compensation current command, generate the optimized final compensation current command through constrained optimization solution. S5, based on the final compensation current command, the inverter is controlled by PWM modulation to generate the corresponding compensation current and inject it into the power grid.

2. The active power filtering compensation method based on DSP calculation as described in claim 1, characterized in that, The process of synchronously sampling and filtering the grid-side load current signal and grid voltage signal acquired by the sensor to obtain a synchronously sampled current sequence and a synchronously sampled voltage sequence includes: Collect simulated load current signals and simulated grid voltage signals from a three-phase power grid; The load current analog signal and the grid voltage analog signal are synchronously converted into digital signals to obtain the initial three-phase current discrete sequence and the initial three-phase voltage discrete sequence. The initial three-phase current discrete sequence and the initial three-phase voltage discrete sequence are subjected to low-pass filtering to obtain the synchronous sampling current sequence and the synchronous sampling voltage sequence.

3. The active power filtering compensation method based on DSP calculation as described in claim 1, characterized in that, The step of analyzing the harmonic and reactive power characteristics of the load current in the power grid based on the synchronously sampled current sequence and the synchronously sampled voltage sequence to generate fundamental reactive power compensation current command and harmonic compensation current command includes: Based on the synchronously sampled current sequence and the synchronously sampled voltage sequence, coordinate transformation is performed on the three-phase load current and grid voltage to obtain the current component, voltage component and grid voltage phase angle in the two-phase stationary coordinate system. A fundamental reactive power compensation analysis is performed on the phase angle of the grid voltage and the current components in the two-phase stationary coordinate system to obtain the fundamental reactive power compensation current command. Harmonic compensation analysis is performed on the phase angle between the synchronously sampled current sequence and the grid voltage to obtain the harmonic compensation current command.

4. The active power filtering compensation method based on DSP calculation as described in claim 3, characterized in that, The step of performing fundamental reactive power compensation analysis on the grid voltage phase angle and the current components in the two-phase stationary coordinate system to obtain the fundamental reactive power compensation current command includes: Based on the grid voltage phase angle and the current components in the two-phase stationary coordinate system, the current components in the rotating coordinate system are calculated through synchronous rotating coordinate transformation to obtain the active current components and reactive current components. The reactive current component is subjected to low-pass filtering to extract the fundamental reactive current component that represents the fundamental reactive characteristics of the load. Based on the fundamental reactive current component and the target reactive current setpoint, the fundamental reactive current compensation current command is generated through a control algorithm.

5. The active power filtering compensation method based on DSP calculation as described in claim 3, characterized in that, The step of performing harmonic compensation analysis on the phase angle between the synchronously sampled current sequence and the grid voltage to obtain a harmonic compensation current command includes: Based on the synchronously sampled current sequence and the phase angle of the grid voltage, a synchronous rotating coordinate transformation of the load current at a specific harmonic frequency is performed to obtain the DC component of each harmonic in the corresponding rotating coordinate system. The DC components of each harmonic are low-pass filtered to extract the harmonic current components that represent the characteristics of each harmonic of the load. Based on the harmonic current components, a time-domain waveform is synthesized through inverse coordinate transformation to generate the harmonic compensation current command.

6. The active power filtering compensation method based on DSP calculation as described in claim 1, characterized in that, The step of dynamically coordinating the fundamental reactive power compensation current command and the harmonic compensation current command based on real-time grid state parameters to generate a coordinated compensation current command includes: Based on the synchronously sampled voltage sequence, the real-time power factor and total harmonic distortion rate of the power grid are calculated. Based on the real-time power factor, the total harmonic distortion of the voltage, and the preset target parameters, the dynamic weighting coefficient is calculated through an adaptive weighting function. Based on the dynamic weighting coefficient, the fundamental reactive power compensation current command and the harmonic compensation current command are weighted and synthesized to generate the coordinated compensation current command.

7. The active power filtering compensation method based on DSP calculation as described in claim 6, characterized in that, The preset target parameters include the target value of power factor and the target limit of voltage harmonic distortion rate.

8. The active power filtering compensation method based on DSP calculation as described in claim 1, characterized in that, The internal state parameters of the power quality management device are collected. Based on these internal state parameters and the collaborative compensation current command, an optimized final compensation current command is generated through constrained optimization, including: Collect the internal state parameters of the power quality management device to obtain the set of internal state parameters; Based on the set of internal state parameters, the instantaneous safe output boundary of power quality management in the current state is calculated, and then the constraint conditions are constructed and solved to obtain the optimized compensation current command sequence in the future finite time domain. The command value at the current moment is extracted from the optimized compensation current command sequence within the future finite time domain to serve as the optimized final compensation current command.

9. The active power filtering compensation method based on DSP calculation as described in claim 8, characterized in that, Based on the set of internal state parameters, the instantaneous safe output boundary of power quality management in the current state is calculated. Then, the constraint conditions are constructed and solved to obtain the optimized compensation current command sequence in the future finite time domain, including: Based on the set of internal state parameters, the instantaneous safe output boundary of power quality management in the current state is calculated to obtain the maximum allowable output current amplitude boundary and the maximum allowable output current change rate boundary. Based on the aforementioned collaborative compensation current command, a command tracking error and smoothness cost function in the future finite time domain is constructed, and constraints are constructed by combining the maximum allowable output current amplitude boundary and the maximum allowable output current change rate boundary to form a constrained rolling time domain optimization problem. Solve the constrained rolling time-domain optimization problem to obtain the optimized compensation current command sequence in the future finite time domain.

10. The active power filtering compensation method based on DSP calculation as described in claim 1, characterized in that, The step of generating a corresponding compensation current and injecting it into the grid by controlling the inverter through PWM modulation based on the final compensation current command includes: Based on the final compensation current command, a corresponding PWM drive pulse signal is generated using a PWM modulation algorithm; The PWM drive pulse signal is applied to the power switching device of the inverter to control its switching action, so that the inverter generates a compensation current corresponding to the final compensation current command. The compensation current is injected into the power grid to counteract the reactive and harmonic components in the load current.