A control method of diesel generator test system based on sliding average filter

By combining a moving average filter and a fast Fourier transform, the stability and safety issues caused by voltage frequency mutations in the energy-feeding test system of diesel generator sets are solved, achieving precise control of load simulation and accuracy of test results.

CN121995216BActive Publication Date: 2026-06-16SHANDONG HOTEAM ELECTRICAL +1

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SHANDONG HOTEAM ELECTRICAL
Filing Date
2026-04-10
Publication Date
2026-06-16

Smart Images

  • Figure CN121995216B_ABST
    Figure CN121995216B_ABST
Patent Text Reader

Abstract

The present application relates to the field of power electronics, in particular to a diesel generator test system control method based on a moving average filter, comprising real-time acquisition of output voltage instantaneous value of the diesel generator, to obtain a voltage sampling sequence; the voltage sampling sequence is input to a pre-constructed moving average filter; the input voltage sampling sequence is processed by the moving average filter to obtain an output signal; a current command signal is generated based on the output signal of the moving average filter; according to the current command signal, the diesel generator test system simulates a specific power factor load through current closed-loop control to simulate load testing of the diesel generator. The moving average filter is directly used to generate the current command of the test system, the linear phase frequency characteristic of the filter is adjusted, the lag angle of the current command is linearly adjusted, and the precise and convenient control of the simulated load power factor of the diesel generator test system is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of power electronics technology, specifically to a control method for a diesel generator test system based on a moving average filter. Background Technology

[0002] Diesel generator load testing is a crucial step in ensuring stable, safe, and reliable equipment performance. By verifying the generator's electrical parameters, mechanical performance, and safety protection functions under different load conditions, its actual output capacity can be verified, potential faults can be identified, maintenance strategies can be optimized, and equipment lifespan can be extended.

[0003] Traditional testing methods typically employ resistive load cells, which consume electrical energy. This not only results in significant energy waste but also generates substantial heat, increasing testing costs and environmental impact. To address this issue, a diesel generator set energy-feedback testing system has been proposed in the prior art. This system can simulate various load characteristics, accurately test the generator set's output power and load-carrying capacity, and efficiently feed the electrical energy generated during the test back to the power grid, thereby achieving energy conservation and emission reduction.

[0004] However, unlike the large-capacity, stable-voltage mains power grid, diesel generators have limited capacity and poor output voltage stability. Changes in load significantly affect their output voltage, even causing abrupt frequency fluctuations. For high-precision diesel generator set rechargeable testing systems, these frequency fluctuations can lead to decreased output stability, increased output current ripple, internal control loop imbalance, and increased stress on power components, ultimately resulting in test deviations. In extreme cases, frequency fluctuations can disrupt the control timing of the testing system, causing reverse current surges that could burn out internal windings or control modules, leading to serious safety accidents. Therefore, developing a simple, reliable, and effective control method for testing systems that can effectively address the impact of diesel generator output voltage frequency fluctuations is a crucial technical problem that needs to be solved by those skilled in the art. Summary of the Invention

[0005] To address the aforementioned problems, this invention provides a control method for a diesel generator test system based on a moving average filter, comprising:

[0006] S1. Real-time acquisition of the instantaneous output voltage value of the diesel generator to obtain the voltage sampling sequence;

[0007] S2. Input the voltage sampling sequence into a pre-constructed moving average filter; perform moving average processing on the input voltage sampling sequence through the moving average filter to obtain the output signal;

[0008] S3. Generate a current command signal based on the output signal of the moving average filter;

[0009] S4. Based on the current command signal, the diesel generator test system is driven by current closed-loop control to simulate a load with a specific power factor and perform load simulation test on the diesel generator.

[0010] The process described in S2, which involves performing a moving average process on the input voltage sampling sequence using a moving average filter, is as follows:

[0011] Maintain a first-in-first-out (FIFO) data queue of length N. Each time new voltage sampling data is acquired, insert the new voltage sampling data into the tail of the queue and remove the oldest data from the head of the queue. Calculate the arithmetic mean of all N data in the current queue and use it as the output value at the current moment.

[0012] The output value is an AC signal that is at the same frequency as the diesel generator output voltage and has a target phase angle lag.

[0013] The control method for the diesel generator test system, after S1, also includes performing a fast Fourier transform on the voltage sampling sequence acquired in S1 to determine the actual power of the current diesel generator output voltage.

[0014] The specific operation of performing a Fast Fourier Transform on the voltage sampling sequence acquired by S1 is as follows:

[0015] Data sampling and buffering: at a fixed sampling frequency f s The instantaneous output voltage value of the diesel generator is continuously collected, and the data points of a complete time period are stored in the cache array.

[0016] Windowing: Apply a window function to the data points in the cache array to obtain the windowed discrete sequence x(n);

[0017] Fast Fourier Transform: Performing an FFT on the windowed discrete sequence x(n) yields the spectral sequence X(n). k ),in k=0,1,…,M-1,M The number of FFT points;

[0018] Fundamental frequency identification: Within a preset fundamental frequency search range, determine the spectral line index corresponding to the spectral component with the largest amplitude. k max ;

[0019] Frequency calculation: Calculate the fundamental frequency of the current voltage signal based on the spectral line index and the actual frequency. f act for:

[0020]

[0021] In the formula, fs is the sampling rate; M is the number of FFT points.

[0022] S2 also includes adjusting the parameters of the moving average filter and calculating the amplitude compensation coefficient based on the actual power of the determined diesel generator output voltage.

[0023] The parameter adjustment and amplitude compensation coefficient calculation for the moving average filter specifically include:

[0024] The target power factor required by the preset diesel generator test system is determined based on the target power factor. P F Calculate the required phase lag degree. φ target =arccos(P F ) ;

[0025] Based on the actual frequency of the determined diesel generator output voltage f act With the required phase lag degree φ target The required number of moving average filter points N can be calculated by reverse calculation using the phase frequency response formula. new and / or adjust the sampling rate f s ;

[0026] Based on the determined actual frequency f act 、 Sampling rate f s With the required number of moving average filter points N new The amplitude gain H of the current moving average filter is calculated according to the amplitude-frequency response formula, and its reciprocal K = 1 / H is calculated as the amplitude compensation coefficient.

[0027] The phase frequency response formula is:

[0028]

[0029] In the formula, This represents the phase lag in degrees, in degrees (°). Sampling rate, in Hz; This represents the actual signal frequency, measured in Hz.

[0030] The amplitude-frequency response formula is:

[0031]

[0032] In the formula, H is the amplitude-frequency response; N is the number of points in the moving average filter. Sampling rate, in Hz; This represents the actual signal frequency, measured in Hz.

[0033] Beneficial effects: This invention provides a control method for a diesel generator test system based on a moving average filter. By utilizing the inherent characteristics of the moving average filter, it directly generates the current command for the test system, rather than merely using it as a signal denoising tool. Through the linear phase frequency characteristics of the filter, the lag angle of the current command is linearly adjusted by changing the number of filter points, thereby achieving accurate and convenient control of the simulated load power factor of the diesel generator test system. This significantly simplifies the control architecture of the test system, eliminating the need for complex phase-locked loops and vector control algorithms, reducing the computational load on the controller, and improving the real-time performance and reliability of the control.

[0034] This invention utilizes the same-frequency following characteristic of the moving average filter. When the output voltage frequency of the diesel generator changes abruptly, the output signal of the moving average filter can quickly follow the input signal to achieve the same frequency change. The frequency following delay does not exceed the time length of the sliding window, which completely avoids the phase-locked loop loss problem during frequency changes and eliminates the risk of active power backfeed from the root, ensuring the equipment safety of the tested diesel generator.

[0035] This invention addresses the phase angle shift and amplitude attenuation issues caused by frequency abrupt changes by adjusting the parameters of the moving average filter and calculating the amplitude compensation coefficient. It can automatically adjust the filter parameters according to the real-time detected frequency to ensure the stability of the target phase angle lag degree. At the same time, it corrects the signal amplitude changes caused by the filter through amplitude compensation to ensure the amplitude accuracy of the current command. This achieves consistency in load simulation effects under all frequency conditions, significantly improves the adaptability of the test system to diesel generator frequency fluctuation conditions, and ensures the accuracy of the test results.

[0036] This invention utilizes the low-pass characteristics of a moving average filter to effectively filter out high-frequency glitches and harmonic interference on the generator output voltage, thereby improving the signal-to-noise ratio of the current command and reducing the ripple of the output current of the test system. Attached Figure Description

[0037] The solutions and advantages of this application will become clear to those skilled in the art upon reading the following detailed description of preferred embodiments. The accompanying drawings are for illustrative purposes only and are not intended to limit the scope of the invention.

[0038] In the attached diagram:

[0039] Figure 1 This is a schematic diagram of the simulation circuit for the moving average filter of this invention;

[0040] Figure 2This is a comparison diagram of the input and output waveforms of the 9-point moving average filter in an embodiment of the present invention;

[0041] Figure 3 This is a comparison diagram of the input and output waveforms of the 65-point moving average filter in an embodiment of the present invention;

[0042] Figure 4 This is a comparison diagram of the input and output waveforms of the 65-point moving average filter in this embodiment of the invention when the input signal frequency changes to 48Hz;

[0043] Figure 5 This is a comparison diagram of the input and output waveforms of the 65-point moving average filter in this embodiment of the invention when the input signal frequency abruptly changes from 50Hz to 48Hz.

[0044] Figure 6 This is a flowchart of the control method for the diesel generator testing system of the present invention. Detailed Implementation

[0045] Exemplary embodiments of this disclosure will now be described in more detail with reference to the accompanying drawings.

[0046] Example 1

[0047] This embodiment provides a control method for a diesel generator test system based on a moving average filter, applied to a diesel generator set energy-feed test system. The hardware architecture of the test system includes a diesel generator under test, a sampling unit, a controller, a power conversion unit, and a power grid. The sampling unit includes a voltage transformer and an analog-to-digital converter for acquiring the output voltage of the diesel generator. The controller uses a DSP digital signal processor to execute the control method of this invention and generate a current command signal. The power conversion unit receives the current command signal and outputs a simulated load with a specific power factor.

[0048] First, the characteristics of the moving average filter are analyzed. An N-point moving average filter is a special type of FIR (Finite Impulse Response) low-pass filter, whose output y(n) is the arithmetic mean of the current and the past N-1 inputs u(n). Its amplitude-frequency response formula is:

[0049]

[0050] In the formula, H is the amplitude-frequency response; N is the number of points in the moving average filter. Sampling rate, in Hz; This represents the signal frequency, measured in Hz.

[0051] Its phase frequency response formula is:

[0052]

[0053]

[0054] In the formula, Phase lag time, in seconds; This represents the phase lag in degrees, expressed in degrees (°).

[0055] Based on the phase frequency response, its phase response is determined to be the frequency. f It is a linear function, meaning it has linear phase frequency characteristics. For a fixed frequency... f For the input signal, the lag time τ of the filter output is constant, which is (N-1) / (2π / N). f s ).

[0056] Building such Figure 1 The simulation circuit shown verifies the above characteristics. The sampling rate is set. f s The frequency is 6.4 kHz, meaning 128 points are sampled per cycle at the power frequency. When the number of points in the moving average filter N=9, according to the phase frequency response formula, the lag angle of its output relative to the input is... =-11.25°, which means a lag of 0.625ms. The simulated waveform is as follows. Figure 2 As shown in the figure, the red line represents the input and the blue line represents the output. It can be seen that the output lags behind the input by 11.25°.

[0057] When N=65, the phase lag degree =-90°, which means a lag of 5ms, such as Figure 3 As shown.

[0058] When the input signal frequency changes from 50Hz to 48Hz, for a moving average filter with N=65, the lag time τ=5ms remains unchanged, but due to the increased signal period, the lag angle becomes 86.4°. Figure 4 As shown.

[0059] like Figure 5 As shown, when the input frequency changes abruptly at 0.36 seconds, the frequency of the output signal also changes synchronously to 48Hz after a delay of up to 10ms, maintaining the same frequency characteristic as the input.

[0060] Based on the above characteristic analysis of the moving average filter, the control method described in this embodiment is as follows: Figure 6 As shown, it includes the following steps:

[0061] S1. Real-time acquisition of the instantaneous output voltage value of the diesel generator to obtain the voltage sampling sequence;

[0062] The controller in the diesel generator testing system collects the instantaneous output voltage value of the diesel generator in real time through its sampling unit according to the preset sampling frequency, and obtains a discrete voltage sampling sequence u(n), u(n-1), ...

[0063] S2. Input the voltage sampling sequence into a pre-constructed moving average filter; perform moving average processing on the input voltage sampling sequence through the moving average filter to obtain the output signal;

[0064] An N-point moving average filter is pre-built in the controller of the diesel generator test system. The moving average filter maintains a data queue of length N.

[0065] When the moving average filter acquires new voltage sampling data, it inserts the new voltage sampling data into the tail of the queue and removes the oldest data from the head of the queue; it calculates the arithmetic mean of all N data in the current queue as the output value at the current moment, and the calculation formula is as follows:

[0066]

[0067] The output value is an AC signal that is at the same frequency as the output voltage of the diesel generator, but lags behind the output voltage in phase.

[0068] S3: Generate a current command signal based on the output signal of the moving average filter;

[0069] S4: Based on the current command signal, the diesel generator test system is driven by current closed-loop control to simulate a load with a specific power factor and perform load simulation test on the diesel generator.

[0070] Example 2

[0071] This embodiment, based on embodiment 1, further adds frequency adaptation and amplitude compensation to cope with large frequency fluctuations in the output voltage of the diesel generator and to simulate operating conditions with higher requirements for current amplitude accuracy.

[0072] The control method for the diesel generator test system, after step S1 in Example 1, further includes:

[0073] The voltage sampling sequence acquired by S1 is subjected to a Fast Fourier Transform (FFT) to determine the actual power of the current diesel generator output voltage. The specific operation is as follows:

[0074] Data sampling and buffering: at a fixed sampling frequency f s The instantaneous output voltage value of the diesel generator is continuously collected, and the data points of a complete time period are stored in the cache array.

[0075] Windowing: Apply a window function to the data points in the cache array to obtain the windowed discrete sequence x(n);

[0076] Fast Fourier Transform: Performing an FFT on the windowed discrete sequence x(n) yields the spectral sequence X(n). k ),in k=0,1,…,M-1,M The number of FFT points;

[0077] Fundamental frequency identification: Within a preset fundamental frequency search range, determine the spectral line index corresponding to the spectral component with the largest amplitude. k max ;

[0078] Frequency calculation: Calculate the fundamental frequency of the current voltage signal based on the spectral line index and the actual frequency. f act for:

[0079]

[0080] In the formula, f s is the sampling rate; M is the number of FFT points.

[0081] Simultaneously, S2 also includes parameter adjustment and amplitude compensation coefficient calculation for the moving average filter based on the actual power of the determined diesel generator output voltage, specifically including:

[0082] The target power factor required by the preset diesel generator test system is determined based on the target power factor. P F Calculate the required phase lag degree. φ target =arccos(P F ) ;

[0083] Based on the actual frequency of the determined diesel generator output voltage f act With the required phase lag degree φ target The required number of moving average filter points N can be calculated by reverse calculation using the phase frequency response formula. new and / or adjust the sampling rate f s This makes the actual frequency f act 、 Sampling rate f s With the required number of moving average filter points N new The determined phase lag degree should be as close as possible to φ target ;

[0084] Based on the determined actual frequency f act 、 Sampling rate f s With the required number of moving average filter points N new The amplitude gain H of the current moving average filter is calculated according to the amplitude-frequency response formula, and its reciprocal K = 1 / H is calculated as the amplitude compensation coefficient.

[0085] Based on the determined number of moving average filter points N new The voltage sampling sequence is subjected to moving average filtering to obtain the output signal y(n); y(n) is multiplied by the calculated amplitude compensation coefficient K to obtain the final current command signal i. ref =K×y(n).

[0086] The subsequent steps S3 and S4 are the same as in Example 1.

[0087] With the solution in this embodiment, even if the output voltage frequency of the diesel generator fluctuates within a large range, the test system can automatically adjust the control parameters, accurately simulate the load with the target power factor, and ensure the accuracy of the current command amplitude, thereby obtaining higher precision test results and further improving the robustness and adaptability of the system.

Claims

1. A control method for a diesel generator test system based on a moving average filter, characterized in that, include: S1. Real-time acquisition of the instantaneous output voltage value of the diesel generator to obtain the voltage sampling sequence; Following S1, the process also includes performing a fast Fourier transform on the voltage sampling sequence acquired in S1 to determine the actual power of the current diesel generator output voltage. S2. Input the voltage sampling sequence into a pre-constructed moving average filter; perform moving average processing on the input voltage sampling sequence through the moving average filter to obtain the output signal; S2 also includes adjusting the parameters of the moving average filter and calculating the amplitude compensation coefficient based on the actual power of the determined diesel generator output voltage, specifically including: The target power factor required by the preset diesel generator test system is determined based on the target power factor. P F Calculate the required phase lag degree. φ target =arccos(P F ) ; Based on the actual frequency of the determined diesel generator output voltage f act With the required phase lag degree φ target The required number of moving average filter points N can be calculated by reverse calculation using the phase frequency response formula. new and adjusting the sampling rate f s ; Based on the determined actual frequency f act 、 Sampling rate f s With the required number of moving average filter points N new The amplitude gain H of the current moving average filter is calculated according to the amplitude-frequency response formula, and its reciprocal K = 1 / H is calculated as the amplitude compensation coefficient. S3. Generate a current command signal based on the output signal of the moving average filter; S4. Based on the current command signal, the diesel generator test system is driven by current closed-loop control to simulate a load with a specific power factor and perform load simulation test on the diesel generator.

2. The control method for the diesel generator testing system according to claim 1, characterized in that, The process described in S2, which involves performing a moving average process on the input voltage sampling sequence using a moving average filter, is as follows: Maintain a first-in-first-out (FIFO) data queue of length N. Each time new voltage sampling data is acquired, insert the new voltage sampling data into the tail of the queue and remove the oldest data from the head of the queue. Calculate the arithmetic mean of all N data in the current queue and use it as the output value at the current moment.

3. The control method for the diesel generator testing system according to claim 2, characterized in that, The output value is an AC signal that is at the same frequency as the diesel generator output voltage and has a target phase angle lag.

4. The control method for the diesel generator testing system according to claim 1, characterized in that, The specific operation of performing a Fast Fourier Transform on the voltage sampling sequence acquired by S1 is as follows: Data sampling and buffering: at a fixed sampling frequency f s The instantaneous output voltage value of the diesel generator is continuously collected, and the data points of a complete time period are stored in the cache array. Windowing: Apply a window function to the data points in the cache array to obtain the windowed discrete sequence x(n); Fast Fourier Transform: Performing an FFT on the windowed discrete sequence x(n) yields the spectral sequence X(n). k ),in k= 0,1,…,M-1,M The number of FFT points; Fundamental frequency identification: Within a preset fundamental frequency search range, determine the spectral line index corresponding to the spectral component with the largest amplitude. k max ; Frequency calculation: Calculate the fundamental frequency of the current voltage signal based on the spectral line index and the actual frequency. f act for: In the formula, f s is the sampling rate; M is the number of FFT points.

5. The control method for the diesel generator testing system according to claim 1, characterized in that, The phase frequency response formula is: In the formula, This represents the phase lag in degrees, in degrees (°). Sampling rate, in Hz; N is the number of points in the moving average filter; This represents the actual signal frequency, measured in Hz.

6. The control method for the diesel generator testing system according to claim 1, characterized in that, The amplitude-frequency response formula is: In the formula, H is the amplitude-frequency response; N is the number of points in the moving average filter. Sampling rate, in Hz; This represents the actual signal frequency, measured in Hz.