Harmonic signal generation method and device, electronic equipment and storage medium

By using independent signal fitting and amplification techniques, the fitting error problem caused by the shared output channel of fundamental and harmonic signals was solved, and high-resolution output and traceability of harmonic signals were achieved.

CN121541734APending Publication Date: 2026-02-17MEASUREMENT CENT OF GUANGDONG POWER GRID CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511814593.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-04
Publication Date
2026-02-17

AI Technical Summary

Technical Problem

In existing technologies, the fundamental and harmonic signals use the same output channel, which leads to large fitting errors in the harmonic waveform, especially when the harmonic content is low.

Method used

A fundamental and harmonic independent signal fitting method is adopted. The fundamental and harmonic signals are amplified separately through two independent isolation voltage power amplifiers and transconductance power amplifiers. Appropriate range values ​​are selected for each, and the output is synthesized through analog signals to ensure accurate output of harmonic signals at low ranges.

Benefits of technology

It greatly reduces the fitting error of harmonic waveforms, improves the fitting resolution of harmonic signals, and realizes independent traceability verification of fundamental and harmonic values.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121541734A_ABST
    Figure CN121541734A_ABST
Patent Text Reader

Abstract

The invention discloses a harmonic signal generation method and device, electronic equipment and a storage medium, and belongs to the technical field of multiple harmonics, and the method comprises the steps: selecting gear values corresponding to a target fundamental voltage, a target harmonic voltage, a target fundamental current and a target harmonic current; calculating the target fundamental voltage, the target harmonic voltage, the target fundamental current and a first fitting waveform, a second fitting waveform, a third fitting waveform and a fourth fitting waveform corresponding to the target harmonic current according to the gear value; the control signal generator performs fitting according to the first fitting waveform, the second fitting waveform, the third fitting waveform and the fourth fitting waveform to generate a target fundamental wave voltage, a target harmonic wave voltage, a target fundamental wave current and a target harmonic wave current, and outputs the target fundamental wave voltage, the target harmonic wave voltage, the target fundamental wave current and the target harmonic wave current to the corresponding power amplifier devices. The problem that the harmonic waveform fitting error is too large due to the fact that the measuring range values of output channels of fundamental wave signals and harmonic wave signals are large in the prior art can be solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of multi-harmonic technology, and in particular to a method, apparatus, electronic device, and storage medium for generating harmonic signals. Background Technology

[0002] Current harmonic power sources combine harmonic and fundamental signals in a signal generator to produce a 16-bit digital waveform, which is then output together via a D / A converter to a voltage power amplifier or transconductance power amplifier, and finally to the energy meter under test. In this case, the harmonic and fundamental signals share the same output channel to the voltage or transconductance power amplifier. The fundamental and harmonic signals do not have independent output channels; they share a single channel with generally large range values. When the ratio of harmonic content to fundamental content is small, this leads to excessively large harmonic waveform fitting errors. Summary of the Invention

[0003] This invention provides a method, apparatus, electronic device, and storage medium for generating harmonic signals, which can solve the problem in the prior art where the output channel range of the fundamental signal and harmonic signal is too large, resulting in too large harmonic waveform fitting error.

[0004] To address the aforementioned technical problems, embodiments of the present invention provide a method for generating harmonic signals, comprising: Obtain the target fundamental voltage, target harmonic voltage, target fundamental current, and target harmonic current to be output; Select the corresponding first gear value based on the target fundamental voltage, select the corresponding second gear value based on the target harmonic voltage, select the corresponding third gear value based on the target fundamental current, and select the corresponding fourth gear value based on the target harmonic current; Calculate the first fitted waveform corresponding to the target fundamental voltage based on the first gear value, calculate the second fitted waveform corresponding to the target harmonic voltage based on the second gear value, calculate the third fitted waveform corresponding to the target fundamental current based on the third gear value, and calculate the fourth fitted waveform corresponding to the target harmonic current based on the fourth gear value. The control signal generator, based on the first, second, third, and fourth fitted waveforms, respectively, generates the corresponding target fundamental voltage, target harmonic voltage, target fundamental current, and target harmonic current, and outputs them to the corresponding power amplifier devices, so that the four power amplifier devices respectively amplify the target fundamental voltage, target harmonic voltage, target fundamental current, and target harmonic current and output them to the corresponding tested equipment.

[0005] As a preferred embodiment, the step of selecting a corresponding first gear value based on the target fundamental voltage, selecting a corresponding second gear value based on the target harmonic voltage, selecting a corresponding third gear value based on the target fundamental current, and selecting a corresponding fourth gear value based on the target harmonic current includes: Based on the target fundamental voltage, select the smallest gear value that is greater than the target fundamental voltage from among the preset gear values ​​as the corresponding first gear value; Based on the target harmonic voltage, select the smallest gear value that is greater than the target harmonic voltage from each preset gear value as the corresponding second gear value; Based on the target fundamental current, select the smallest gear value that is greater than the target fundamental current from among the preset gear values ​​as the corresponding third gear value; Based on the target harmonic current, select the smallest gear value that is greater than the target harmonic current from among the preset gear values ​​as the corresponding fourth gear value.

[0006] As a preferred embodiment, the control signal generator, based on the first, second, third, and fourth fitted waveforms, respectively generates corresponding target fundamental voltage, target harmonic voltage, target fundamental current, and target harmonic current, and outputs them to the corresponding power amplifier devices. This allows the four power amplifier devices to amplify the target fundamental voltage, target harmonic voltage, target fundamental current, and target harmonic current, and then output them to the corresponding tested device, including: The control signal generator generates a first fitting signal based on the first fitting waveform, performs analog-to-digital conversion on the first fitting signal to obtain the target fundamental voltage, and outputs it to the corresponding fundamental isolation voltage power amplifier device, so that the fundamental isolation voltage power amplifier device amplifies the target fundamental voltage and outputs it to the corresponding device under test. The control signal generator generates a second fitting signal based on the second fitting waveform, performs analog-to-digital conversion on the second fitting signal to obtain the target harmonic voltage, and outputs it to the corresponding harmonic isolation voltage power amplifier device, so that the harmonic isolation voltage power amplifier device amplifies the target harmonic voltage and outputs it to the corresponding device under test. The control signal generator generates a third fitting signal based on the third fitting waveform, performs analog-to-digital conversion on the third fitting signal to obtain the target fundamental current, and outputs it to the corresponding fundamental isolation transconductance power amplifier device, so that the fundamental isolation transconductance power amplifier device amplifies the target fundamental current and outputs it to the corresponding device under test. The control signal generator generates a fourth fitting signal based on the fourth fitting waveform, performs analog-to-digital conversion on the fourth fitting signal to obtain the target fundamental voltage, and outputs it to the corresponding fundamental isolation voltage power amplifier device, so that the fundamental isolation voltage power amplifier device amplifies the target fundamental voltage and outputs it to the corresponding device under test.

[0007] As a preferred embodiment, after the four power amplifiers amplify the target fundamental voltage, target harmonic voltage, target fundamental current, and target harmonic current and output them to the corresponding tested equipment, the method further includes: The active power output by the signal generator is acquired and the active power is output to the corresponding device under test, so that the device under test can perform power error detection based on the active power and obtain the power detection error corresponding to the device under test.

[0008] Based on the above embodiments, another embodiment of the present invention provides a harmonic signal generation device, including: a target voltage and current acquisition module, a gear selection module, a fitting waveform calculation module, and a target signal output module; The target voltage and current acquisition module is used to acquire the target fundamental voltage, target harmonic voltage, target fundamental current, and target harmonic current to be output; The gear selection module is used to select a corresponding first gear value according to the target fundamental voltage, a corresponding second gear value according to the target harmonic voltage, a corresponding third gear value according to the target fundamental current, and a corresponding fourth gear value according to the target harmonic current. The fitting waveform calculation module is used to calculate a first fitting waveform corresponding to the target fundamental voltage based on the first gear value, calculate a second fitting waveform corresponding to the target harmonic voltage based on the second gear value, calculate a third fitting waveform corresponding to the target fundamental current based on the third gear value, and calculate a fourth fitting waveform corresponding to the target harmonic current based on the fourth gear value. The target signal output module is used to control the signal generator to fit and generate corresponding target fundamental voltage, target harmonic voltage, target fundamental current and target harmonic current according to the first fitted waveform, the second fitted waveform, the third fitted waveform and the fourth fitted waveform, and output them to the corresponding power amplifier devices, so that the four power amplifier devices amplify the target fundamental voltage, target harmonic voltage, target fundamental current and target harmonic current and output them to the corresponding tested equipment.

[0009] As a preferred embodiment, the step of selecting a corresponding first gear value based on the target fundamental voltage, selecting a corresponding second gear value based on the target harmonic voltage, selecting a corresponding third gear value based on the target fundamental current, and selecting a corresponding fourth gear value based on the target harmonic current includes: Based on the target fundamental voltage, select the smallest gear value that is greater than the target fundamental voltage from among the preset gear values ​​as the corresponding first gear value; Based on the target harmonic voltage, select the smallest gear value that is greater than the target harmonic voltage from each preset gear value as the corresponding second gear value; Based on the target fundamental current, select the smallest gear value that is greater than the target fundamental current from among the preset gear values ​​as the corresponding third gear value; Based on the target harmonic current, select the smallest gear value that is greater than the target harmonic current from among the preset gear values ​​as the corresponding fourth gear value.

[0010] As a preferred embodiment, the control signal generator, based on the first, second, third, and fourth fitted waveforms, respectively generates corresponding target fundamental voltage, target harmonic voltage, target fundamental current, and target harmonic current, and outputs them to the corresponding power amplifier devices. This allows the four power amplifier devices to amplify the target fundamental voltage, target harmonic voltage, target fundamental current, and target harmonic current, and then output them to the corresponding tested device, including: The control signal generator generates a first fitting signal based on the first fitting waveform, performs analog-to-digital conversion on the first fitting signal to obtain the target fundamental voltage, and outputs it to the corresponding fundamental isolation voltage power amplifier device, so that the fundamental isolation voltage power amplifier device amplifies the target fundamental voltage and outputs it to the corresponding device under test. The control signal generator generates a second fitting signal based on the second fitting waveform, performs analog-to-digital conversion on the second fitting signal to obtain the target harmonic voltage, and outputs it to the corresponding harmonic isolation voltage power amplifier device, so that the harmonic isolation voltage power amplifier device amplifies the target harmonic voltage and outputs it to the corresponding device under test. The control signal generator generates a third fitting signal based on the third fitting waveform, performs analog-to-digital conversion on the third fitting signal to obtain the target fundamental current, and outputs it to the corresponding fundamental isolation transconductance power amplifier device, so that the fundamental isolation transconductance power amplifier device amplifies the target fundamental current and outputs it to the corresponding device under test. The control signal generator generates a fourth fitting signal based on the fourth fitting waveform, performs analog-to-digital conversion on the fourth fitting signal to obtain the target fundamental voltage, and outputs it to the corresponding fundamental isolation voltage power amplifier device, so that the fundamental isolation voltage power amplifier device amplifies the target fundamental voltage and outputs it to the corresponding device under test.

[0011] As a preferred option, it also includes: an energy error detection module; The power error detection module is used to acquire the active power output by the signal generator and output the active power to the corresponding device under test, so that the device under test can perform power error detection based on the active power and obtain the power detection error corresponding to the device under test.

[0012] Based on the above embodiments, another embodiment of the present invention provides an electronic device, the device including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor executes the computer program to implement the harmonic signal generation method described in the above embodiments of the invention.

[0013] Based on the above embodiments, another embodiment of the present invention provides a storage medium, the storage medium including a stored computer program, wherein, when the computer program is running, it controls the device where the storage medium is located to execute the harmonic signal generation method described in the above embodiments of the invention.

[0014] Compared with the prior art, the embodiments of the present invention have the following beneficial effects: This invention provides a method, apparatus, electronic device, and storage medium for generating harmonic signals. The method includes: acquiring a target fundamental voltage, a target harmonic voltage, a target fundamental current, and a target harmonic current to be output; selecting a corresponding first threshold value based on the target fundamental voltage, a corresponding second threshold value based on the target harmonic voltage, a corresponding third threshold value based on the target fundamental current, and a corresponding fourth threshold value based on the target harmonic current; calculating a first fitted waveform corresponding to the target fundamental voltage based on the first threshold value, and calculating a first fitted waveform corresponding to the target harmonic voltage based on the second threshold value. The system uses two fitting waveforms: a third fitting waveform corresponding to the target fundamental current is calculated based on the third range value, and a fourth fitting waveform corresponding to the target harmonic current is calculated based on the fourth range value. A control signal generator uses the first, second, third, and fourth fitting waveforms to respectively fit and generate the corresponding target fundamental voltage, target harmonic voltage, target fundamental current, and target harmonic current, and outputs them to the corresponding power amplifier devices. This allows the four power amplifier devices to amplify the target fundamental voltage, target harmonic voltage, target fundamental current, and target harmonic current and output them to the corresponding tested equipment. In this invention, the target fundamental voltage, target harmonic voltage, target fundamental current, and target harmonic current have independent output channels and are output to the corresponding power amplifier devices. Before signal fitting, different ranges are selected based on the target fundamental voltage, target harmonic voltage, target fundamental current, and target harmonic current. When the harmonic signal is small, a low-range power amplifier is used and outputs separately, which solves the problem of large harmonic waveform fitting errors and greatly reduces the harmonic waveform fitting error. Attached Figure Description

[0015] Figure 1 This is a schematic flowchart of a method for generating harmonic signals according to an embodiment of the present invention; Figure 2 This is a schematic diagram of the structure of the harmonic power source of the present invention; Figure 3 This is the signal schematic diagram of a signal generator; Figure 4 This is a schematic diagram of the voltage power amplification principle of an isolation voltage power amplifier device; Figure 5 This is a schematic diagram of the transconductance power amplification principle of an isolated transconductance power amplifier device; Figure 6 This is a schematic diagram of a harmonic signal generation device provided in an embodiment of the present invention. Detailed Implementation

[0016] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below with reference to the accompanying drawings of the embodiments. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0017] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains; the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the application; the terms “comprising” and “having”, and any variations thereof, in the specification, claims, and foregoing description of the drawings are intended to cover non-exclusive inclusion.

[0018] In the description of the embodiments of this application, technical terms such as "first" and "second" are used only to distinguish different objects and should not be construed as indicating or implying relative importance or implicitly specifying the number, specific order, or primary and secondary relationship of the indicated technical features. In the description of the embodiments of this application, "multiple" means two or more, unless otherwise explicitly defined.

[0019] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.

[0020] In the description of the embodiments in this application, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Additionally, the character " / " in this document generally indicates that the preceding and following related objects have an "or" relationship.

[0021] In the description of the embodiments of this application, the terms "multiple" and "several" refer to two or more (including two), similarly, "multiple groups" refer to two or more (including two groups), and "multiple pieces" refer to two or more (including two pieces).

[0022] In the description of the embodiments of this application, unless otherwise expressly specified and limited, technical terms such as "installation," "connection," "joining," and "fixing" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral part; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; they can refer to the internal communication of two components or the interaction between two components. For those skilled in the art, the specific meaning of the above terms in the embodiments of this application can be understood according to the specific circumstances.

[0023] Example 1 Please refer to Figure 1 To address the problem of excessively large harmonic waveform fitting errors caused by the large range values ​​of the output channels for fundamental and harmonic signals in existing technologies, this invention provides a flowchart of a harmonic signal generation method. This invention employs a method of separately fitting the fundamental and harmonic signals, which significantly improves the harmonic signal fitting resolution. Two independent, isolated voltage amplifiers and a transconductance amplifier amplify the fundamental and harmonic signals separately. Each of the two independent fundamental and harmonic voltage amplifiers and the transconductance amplifier has multiple ranges; when the harmonic signal is small, a lower range amplifier is used, and the signals are output separately using analog signal synthesis. When testing an energy meter, the fundamental and harmonic voltages are output in series to the input terminal of the energy meter, while the fundamental and harmonic currents are output in parallel to the input terminal. For traceability testing, the fundamental signal can be tested using a power frequency AC standard device, while the harmonics can be tested using a broadband power standard, thus achieving traceability of values ​​under fundamental and mixed harmonic conditions.

[0024] Please refer to Figure 2 This is a schematic diagram of the structure of the harmonic power source of the present invention, which is based on... Figure 2 The harmonic power source shown generates the required harmonic signal. For example... Figure 2 As shown, the harmonic power source consists of a computer U1, a signal generator U2, isolation voltage power amplifiers U3 and U4, and isolation transconductance power amplifiers U5 and U6.

[0025] The computer U1 and signal generator U2 are connected via RS232; the range control lines of signal generator U2 and D / A converters U21, U22, U23, and U24 are connected via a 16-range control line. The signal output V1 of signal generator U2 is connected to the input of isolation voltage amplifier U3; the signal output V2 of signal generator U2 is connected to the input of isolation voltage amplifier U4; the signal output V3 of signal generator U2 is connected to the input of isolation transconductance amplifier U5; the signal output V4 of signal generator U2 is connected to the input of isolation transconductance amplifier U6; the outputs of isolation transconductance amplifier U5 and U6 are connected in parallel; the outputs of isolation voltage amplifier U2 and U3 are connected in series.

[0026] Computer U1 is used to input the fundamental voltage, harmonic voltage, fundamental current, and harmonic current of the harmonic power source. The computer sends commands to the signal generator, which selects the most suitable power amplifier range via the range control lines. Signal generator U2 performs digital-to-analog conversion based on the fundamental voltage, harmonic voltage, fundamental current, and harmonic current sent by computer U1. Isolated voltage power amplifiers U3 and U4 convert the small voltage signal output from the digital-to-analog converter into the large voltage required for testing. Isolated transconductance power amplifiers U5 and U6 convert the small voltage signal output from the digital-to-analog converter into the large current required for testing.

[0027] In the U1 computer, the calculator uses a CPU with 4 cores and 8 threads or more, 16GB of RAM and DDR4 or higher memory, which are used to control the output of the signal generator and read the power, and are connected to the signal generator via RS232.

[0028] Please refer to Figure 3 This is the signal schematic diagram of a signal generator. Signal generator U3 consists of a DSP and its peripherals U20, and D / A converters U21, U22, U23, and U24. The signal generator U20 and its peripherals are connected to the D / A converters U21, U22, U23, and U24 via an SPI interface; the signal generator U20 and its peripherals are also connected to the serial computer U1. The signal generator U20 is used for waveform fitting and SPI output; the D / A converters U21, U22, U23, and U24 are used to convert the digital signals from the SPI interface into analog signals.

[0029] The DSP and its peripheral U20 require at least one serial port, four SPI interfaces, and 16 gear control lines. The chip integrates a large number of peripherals, including one RSR232 serial port, one SPI interface, three SPORTs (supporting dual-channel SPI), 16 general-purpose I / O ports (supporting 16-channel gear control), and 256MBYTE DRAM, etc., to complete the waveform fitting of the fundamental and harmonic waves of this invention, as well as communication and gear control.

[0030] This is a 16-bit D / A converter DAC module that supports AC output. The resolution across the full-scale range is 1 / (32768 / 1.4142) = 0.0043%, and the maximum effective AC output is 7.071V. The output error is 0.005% from 10% to 100%. Please refer to Figure 4 This is a schematic diagram of the voltage power amplification principle of the isolated voltage power amplifier device. The isolated voltage power amplifiers U3 and U4 are composed of resistors R1, R2, R3, voltage transformer T2, transformer T1, power amplifier A1, switches K1-1 and K1-2, and RC low-pass filter U30.

[0031] Resistors R1 and R2 form an AC proportional inverting amplifier circuit together with power amplifier A1. Voltage transformer T2 is used to reduce the output voltage Vout proportionally. The accuracy of voltage transformer T2 and the accuracy of resistors R1 and R2 determine the accuracy of the voltage amplifier. The RC low-pass filter is connected to the output of power amplifier A1, and the other end of the RC low-pass filter is connected to the negative input terminal of power amplifier A1, forming a DC 1:1 negative feedback.

[0032] Figure 4 The circuit constitutes a voltage power amplifier that proportionally amplifies AC and suppresses DC by 1:1. K1-1 and K1-2 are interlocking switches used to switch between different output voltage levels, connected to the taps at the output of transformer T1 and the input of current transformer T2. K1-1 and K1-2 are controlled by a signal generator via a level control line. Resistors R1, R2, and R3 are 10kΩ metal foil resistors with 0.005% accuracy. The current transformer T2 has an accuracy of 0.005%, a frequency range of 50Hz to 5kHz, and turns ratios of 300V:5V, 60V:5V, and 10V:5V. Transformer T1 has a power rating of 50W, with step-up turns ratios of 5V:300V, 5V:60V, and 5V:10V, and a frequency range of 50Hz to 5kHz.

[0033] Power amplifier A1 requires a power output of at least 50W, a bandwidth of at least 100kHz, a gain bandwidth of 3MHz, and a maximum output power of 400W. The RC low-pass filter U30 has a cutoff frequency of 0.1Hz, designed to prevent feedback of AC signals and only provide feedback of DC signals, thus suppressing DC zero-point offset voltage.

[0034] The output Vout of power amplifier A1 is: (Formula 1) Since R1 = R2, we have: (Formula 2) In the formula: Kv is the voltage gain factor of power amplifier A1, with ratios of 300V / 5V, 60V / 5V, and 10V / 5V at different positions of switch K1; Vi is the input voltage of power amplifier A1.

[0035] Please refer to Figure 5 This is a schematic diagram of the transconductance power amplification principle of the isolated transconductance power amplifier device. The isolated transconductance power amplifiers U5 and U6 are composed of resistors R4, R5, R7, R6, current transformer T3, transformer T4, power amplifier A2, switches K2-1 and K2-2, and RC low-pass filter U50.

[0036] In this circuit, current transformer T3, resistor R6, and amplifier A2 constitute an I / V (current and voltage) converter. Resistors R4 and R5 form an AC proportional inverting amplifier circuit together with power amplifier A3. Current transformer T3 is used to reduce the current output Iout proportionally before inputting it to the input of the I / V converter. The accuracy of current transformer T3 and the accuracy of resistors R4 and R56 determine the accuracy of the transconductance power amplifier. An RC low-pass filter is connected to the output of power amplifier A3, and the other end of the RC low-pass filter is connected to the negative input terminal of power amplifier A3, forming a DC 1:1 negative feedback.

[0037] Figure 5The circuit constitutes a transconductance power amplifier that performs transconductance amplification on AC signals and 1:1 suppression on DC signals. K2-1 and K2-2 are interlocking switches used to switch between different output current levels, connected to the taps at the output of transformer T4 and the input of current transformer T3. K2-1 and K2-2 are controlled by a signal generator via a gear control line. Resistors R4, R5, and R7 are 10kΩ metal foil resistors with 0.005% accuracy, and resistor R6 is a 1kΩ metal foil resistor with 0.005% accuracy. The current transformer T3 has an accuracy of 0.005%, a frequency range of 50Hz to 5kHz, and a turns ratio of 0.1A:5mA, 1A:5mA, 10A:5mA, and 100A:5mA. The transformer T4 has a power rating of 120W, a boost ratio of 10A:0.1A, 10A:1A, 10A:10A, and 10A:100A, and a frequency range of 50Hz to 5kHz. Power amplifier A2 requires a power rating of at least 120W, a bandwidth of at least 100kHz, a gain bandwidth of 3MHz, and a maximum output power of 400W. The RC low-pass filter U30 has a cutoff frequency of 0.1Hz, which is intended to prevent feedback of AC signals and only provide feedback of DC signals, thereby suppressing the zero-point offset voltage of DC.

[0038] Output of power amplifier A2 for; (Formula 3) Where Ki is the current gain factor of power amplifier A2. Since R4=R5 and R6=1kΩ, the ratio of Ki varies in different ranges, therefore: (Formula 4) The ratio of Ki at different positions of switch K1 is 0.1A:5mA, 1A:5mA, 10A:5mA, and 100A:5mA. GKi= (Formula 5) In the formula, GKi is the basic transconductance gain, and GKi is 0.1A / 5V, 1A / 5V, 5V / 5V, and 5V / 5V at different ranges.

[0039] Based on the above-mentioned harmonic generator, the method for generating the harmonic signal includes the following specific steps: S1. Obtain the target fundamental voltage, target harmonic voltage, target fundamental current, and target harmonic current to be output; In a specific embodiment, for step S1, the formula for the fundamental and harmonic signals to be fitted is as shown in Formula 6: (Formula 6) In the formula, n is the nth harmonic. The fundamental frequency, The amplitude of the nth harmonic. The fundamental amplitude, Let t be the phase of the nth harmonic, and t be time.

[0040] S2. Select the corresponding first gear value according to the target fundamental voltage, select the corresponding second gear value according to the target harmonic voltage, select the corresponding third gear value according to the target fundamental current, and select the corresponding fourth gear value according to the target harmonic current. Preferably, the step of selecting a corresponding first gear value based on the target fundamental voltage, a corresponding second gear value based on the target harmonic voltage, a corresponding third gear value based on the target fundamental current, and a corresponding fourth gear value based on the target harmonic current includes: selecting the smallest gear value greater than the target fundamental voltage from among the preset gear values ​​as the corresponding first gear value based on the target fundamental voltage; selecting the smallest gear value greater than the target harmonic voltage from among the preset gear values ​​as the corresponding second gear value based on the target harmonic voltage; selecting the smallest gear value greater than the target fundamental current from among the preset gear values ​​as the corresponding third gear value based on the target fundamental current; and selecting the smallest gear value greater than the target harmonic current from among the preset gear values ​​as the corresponding fourth gear value based on the target harmonic current.

[0041] In a specific embodiment, for step S2, based on the fundamental voltage, harmonic voltage, fundamental current, and harmonic current to be output, the computer sends a command to the signal generator to select the most suitable power amplifier gear through the gear control line.

[0042] The principle for selecting amplifier ranges is that the output voltage or current value must be higher than the smaller range and lower than or equal to the selected range value. For example, if the current output is 5A, the 1A range must be higher, but lower than or equal to the 10A range, so the 10A range is selected.

[0043] S3. Calculate the first fitted waveform corresponding to the target fundamental voltage based on the first gear value, calculate the second fitted waveform corresponding to the target harmonic voltage based on the second gear value, calculate the third fitted waveform corresponding to the target fundamental current based on the third gear value, and calculate the fourth fitted waveform corresponding to the target harmonic current based on the fourth gear value. Specifically, since the input of the D / A digital-to-analog converter is a digital quantity, the analog signal f(t) needs to be digitized (quantized). Therefore, for the aforementioned f(t), its single cycle is divided into N equal intervals and fitted to obtain its discrete sequence as follows: (Formula 7) If Formula 7 is applied to the same channel, the maximum value of the waveform cannot exceed [a certain value]. =32768, when the harmonics only account for 1% of the fundamental frequency, its maximum quantization (AC) error is 1 / 327.68 = 0.3%.

[0044] The core of this invention is to fit Equation 7 separately using D / A converters in two channels. For a voltage power amplifier, the fundamental component of Equation 7 is output using D / A converter U21, while the first component of Equation 7 is fitted using Equation 8. The harmonic components of Equation 7 are output using D / A converter U22, while the second component of Equation 7 is fitted using Equation 9. For a transconductance power amplifier, the fundamental component of Equation 7 is output using D / A converter U23, while the first component of Equation 7 is fitted using Equation 8. The harmonic components of Equation 7 are output using D / A converter U3, while the second component of Equation 7 is fitted using Equation 9. Finally, the formula is rewritten as: (Formula 8) (Formula 9) Where n is the nth harmonic, The fundamental frequency, The amplitude of the nth harmonic. The fundamental amplitude, The nth harmonic phase, The fundamental phase, The fitted sample value represents the fundamental frequency. The fitted sample value represents the harmonic.

[0045] The fundamental and harmonic waves are output through two DAC channels, as shown in Equations 8 and 9. The waveform fitting is limited by a maximum limit of 1 / 32768 = 0.003% for both the fundamental and harmonic waves. When the actual output value of the harmonic wave is relatively small, the output is switched to a lower value by adjusting the voltage level, so that the resolution of the digital fitting of the waveform does not decrease. Considering the voltage level change, voltage equations 7 and 8 are rewritten as equations 10 and 11: (Formula 10) (Formula 11) in, The DAC output voltage is the fundamental frequency. Kv1 represents the range ratio of the fundamental frequency, where Kv is the DAC output voltage of the nth harmonic. n The range ratio representing the nth harmonic; D 1i The fitted sample value representing the fundamental frequency; Dni The fitted sample value represents the harmonic.

[0046] From Equations 10 and 11, it can be seen that as long as the range values ​​are reasonably arranged, the quantization error of waveform fitting can be controlled to the optimal state. For example, to output a 1% amplitude of the 10th harmonic from a 300V fundamental signal, selecting the 300V range for the fundamental signal and outputting a 5V signal results in a quantization value of 1 / 32768 = 0.003% (full scale). Selecting the 10V range for the harmonic signal results in an output of 3 / 10 of the maximum range value, resulting in a quantization value of 1 / (32768*3 / 10) = 0.01%. It is evident that a 0.01% quantization error can be obtained even at the 1% harmonic range. Considering range changes, Equations 7 and 8 for current, combined with Equation 5, can be rewritten as Equations 12 and 13: (Formula 12) (Formula 13) in, The DAC output current is the fundamental frequency. GKI represents the DAC output current of the nth harmonic, and GKI1 represents the transconductance range of the fundamental frequency; GKI n The range of transconductance representing harmonics; D 1i The fitted sample value representing the fundamental frequency; D ni The fitted sample value represents the harmonic. As can be seen from Equations 12 and 13, as long as the range values ​​are arranged reasonably, the quantization error of the waveform fitting can be controlled within the optimal range.

[0047] In a specific embodiment, for step S3, the fitted waveforms of the fundamental voltage and harmonic voltage are calculated according to formulas 10 and 11, and the fitted waveforms of the fundamental current and harmonic current are calculated according to formulas 12 and 13. In formulas 10, 11, 12 and 13, the range value selected in step S2 is substituted into the corresponding range ratio value.

[0048] S4. The control signal generator, based on the first fitted waveform, the second fitted waveform, the third fitted waveform, and the fourth fitted waveform, respectively, generates the corresponding target fundamental voltage, target harmonic voltage, target fundamental current, and target harmonic current, and outputs them to the corresponding power amplifier devices, so that the four power amplifier devices respectively amplify the target fundamental voltage, target harmonic voltage, target fundamental current, and target harmonic current and output them to the corresponding tested equipment.

[0049] Preferably, the control signal generator, based on the first, second, third, and fourth fitted waveforms, respectively generates corresponding target fundamental voltage, target harmonic voltage, target fundamental current, and target harmonic current, and outputs them to corresponding power amplifier devices, so that the four power amplifier devices respectively amplify the target fundamental voltage, target harmonic voltage, target fundamental current, and target harmonic current and output them to the corresponding device under test. This includes: the control signal generator generating a first fitted signal based on the first fitted waveform, performing analog-to-digital conversion on the first fitted signal to obtain the target fundamental voltage, and outputting it to the corresponding fundamental isolation voltage power amplifier device, so that the fundamental isolation voltage power amplifier device amplifies the target fundamental voltage and outputs it to the corresponding device under test; the control signal generator generating a second fitted signal based on the second fitted waveform, and performing analog-to-digital conversion on the first fitted signal to obtain the target fundamental voltage, and outputting it to the corresponding fundamental isolation voltage power amplifier device, so that the fundamental isolation voltage power amplifier device amplifies the target fundamental voltage and outputs it to the corresponding device under test; the control signal generator generating a second fitted signal based on the second fitted waveform, and performing analog-to-digital conversion on the first fitted waveform... The second fitted signal is subjected to analog-to-digital conversion to obtain the target harmonic voltage, which is then output to the corresponding harmonic isolation voltage power amplifier device. This allows the harmonic isolation voltage power amplifier device to amplify the target harmonic voltage and output it to the corresponding device under test. A control signal generator generates a third fitted signal based on the third fitted waveform, and performs analog-to-digital conversion on the third fitted signal to obtain the target fundamental current. This is then output to the corresponding fundamental isolation transconductance power amplifier device, which amplifies the target fundamental current and outputs it to the corresponding device under test. Finally, the control signal generator generates a fourth fitted signal based on the fourth fitted waveform, and performs analog-to-digital conversion on the fourth fitted signal to obtain the target fundamental voltage. This is then output to the corresponding fundamental isolation voltage power amplifier device, which amplifies the target fundamental voltage and outputs it to the corresponding device under test.

[0050] Preferably, after the four power amplifiers amplify the target fundamental voltage, target harmonic voltage, target fundamental current, and target harmonic current and output them to the corresponding devices under test, the method further includes: acquiring the active power output by the signal generator and outputting the active power to the corresponding devices under test, so that the devices under test can perform power error detection based on the active power to obtain the power detection error corresponding to the devices under test.

[0051] In a preferred embodiment, for step S4, the computer controls the signal generator to output a signal waveform via a serial port. The signal generator generates the corresponding target fundamental voltage, target harmonic voltage, target fundamental current, and target harmonic current based on the fitting and outputs them to the corresponding power amplifier device. The isolation voltage power amplifier device and the isolation transconductance power amplifier device amplify the target fundamental voltage, target harmonic voltage, target fundamental current, and target harmonic current and output them to the corresponding device under test.

[0052] In another specific embodiment, the signal generator also continuously calculates the output active energy E and sends it to a computer for real-time display via a serial port for other devices to monitor. The calculation of active energy E is as follows: (Formula 14) In the formula, Ts: time interval of waveform output, V1(i): fundamental voltage output sampling point; Vn(i): harmonic voltage output sampling point; I1(i): fundamental current output sampling point; In(i): harmonic current output sampling point; i: 0,...m; m: number of m sampling points of current output.

[0053] The active power display shows the real-time output on a computer and provides it to the device under test as a basis for power error detection. Specifically, the clock accuracy of this invention can reach 1×10⁻⁶. ⁻6 The errors of the signal generator (0.005%), the fundamental voltage amplifier (0.01%), and the fundamental current amplifier (0.01%) are negligible. Therefore, the accuracy of the fundamental frequency power meter is 0.015%. Since harmonics and the fundamental frequency have the same accuracy, the accuracy of the harmonic power meter is also 0.015% when the power factor is 1.0. When the power factor is 0.5L or 0.5C, because harmonics are more sensitive to the delay between channels, the harmonic power can reach 0.2% even up to the 50th order.

[0054] Therefore, the present invention provides a method for generating harmonic signals, and the following beneficial effects can be achieved through the present invention: (1) High accuracy of harmonic power: Since the harmonics are modulated by completely independent signals, the accuracy at 1.0L can be the same as that of the fundamental wave, reaching 0.01%, and is also higher than the traditional scheme at 0.5L and 0.5C.

[0055] (2) Traceability: The harmonic voltage and electromagnetic current of this invention have independent output channels. The fundamental frequency can be verified using a power frequency AC standard device, and the harmonics can be verified using a broadband power standard. This achieves traceability of the values ​​under fundamental frequency mixed harmonics.

[0056] Example 2 Please refer to Figure 6 This is a schematic diagram of a harmonic signal generation device according to an embodiment of the present invention. The device includes: a target voltage and current acquisition module, a gear selection module, a fitting waveform calculation module, and a target signal output module. The target voltage and current acquisition module is used to acquire the target fundamental voltage, target harmonic voltage, target fundamental current, and target harmonic current to be output; The gear selection module is used to select a corresponding first gear value according to the target fundamental voltage, a corresponding second gear value according to the target harmonic voltage, a corresponding third gear value according to the target fundamental current, and a corresponding fourth gear value according to the target harmonic current. The fitting waveform calculation module is used to calculate a first fitting waveform corresponding to the target fundamental voltage based on the first gear value, calculate a second fitting waveform corresponding to the target harmonic voltage based on the second gear value, calculate a third fitting waveform corresponding to the target fundamental current based on the third gear value, and calculate a fourth fitting waveform corresponding to the target harmonic current based on the fourth gear value. The target signal output module is used to control the signal generator to fit and generate corresponding target fundamental voltage, target harmonic voltage, target fundamental current and target harmonic current according to the first fitted waveform, the second fitted waveform, the third fitted waveform and the fourth fitted waveform, and output them to the corresponding power amplifier devices, so that the four power amplifier devices amplify the target fundamental voltage, target harmonic voltage, target fundamental current and target harmonic current and output them to the corresponding tested equipment.

[0057] Preferably, the step of selecting a corresponding first gear value based on the target fundamental voltage, a corresponding second gear value based on the target harmonic voltage, a corresponding third gear value based on the target fundamental current, and a corresponding fourth gear value based on the target harmonic current includes: Based on the target fundamental voltage, select the smallest gear value that is greater than the target fundamental voltage from among the preset gear values ​​as the corresponding first gear value; Based on the target harmonic voltage, select the smallest gear value that is greater than the target harmonic voltage from each preset gear value as the corresponding second gear value; Based on the target fundamental current, select the smallest gear value that is greater than the target fundamental current from among the preset gear values ​​as the corresponding third gear value; Based on the target harmonic current, select the smallest gear value that is greater than the target harmonic current from among the preset gear values ​​as the corresponding fourth gear value.

[0058] Preferably, the control signal generator, based on the first, second, third, and fourth fitted waveforms, respectively generates corresponding target fundamental voltage, target harmonic voltage, target fundamental current, and target harmonic current, and outputs them to the corresponding power amplifier devices, so that the four power amplifier devices respectively amplify the target fundamental voltage, target harmonic voltage, target fundamental current, and target harmonic current and output them to the corresponding tested device, including: The control signal generator generates a first fitting signal based on the first fitting waveform, performs analog-to-digital conversion on the first fitting signal to obtain the target fundamental voltage, and outputs it to the corresponding fundamental isolation voltage power amplifier device, so that the fundamental isolation voltage power amplifier device amplifies the target fundamental voltage and outputs it to the corresponding device under test. The control signal generator generates a second fitting signal based on the second fitting waveform, performs analog-to-digital conversion on the second fitting signal to obtain the target harmonic voltage, and outputs it to the corresponding harmonic isolation voltage power amplifier device, so that the harmonic isolation voltage power amplifier device amplifies the target harmonic voltage and outputs it to the corresponding device under test. The control signal generator generates a third fitting signal based on the third fitting waveform, performs analog-to-digital conversion on the third fitting signal to obtain the target fundamental current, and outputs it to the corresponding fundamental isolation transconductance power amplifier device, so that the fundamental isolation transconductance power amplifier device amplifies the target fundamental current and outputs it to the corresponding device under test. The control signal generator generates a fourth fitting signal based on the fourth fitting waveform, performs analog-to-digital conversion on the fourth fitting signal to obtain the target fundamental voltage, and outputs it to the corresponding fundamental isolation voltage power amplifier device, so that the fundamental isolation voltage power amplifier device amplifies the target fundamental voltage and outputs it to the corresponding device under test.

[0059] Preferably, it also includes: an energy error detection module; The power error detection module is used to acquire the active power output by the signal generator and output the active power to the corresponding device under test, so that the device under test can perform power error detection based on the active power and obtain the power detection error corresponding to the device under test.

[0060] It should be noted that the device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Furthermore, in the accompanying drawings of the device embodiments provided by this invention, the connection relationships between modules indicate that they have communication connections, which can be specifically implemented as one or more communication buses or signal lines. Those skilled in the art can understand and implement this without any creative effort.

[0061] Those skilled in the art will clearly understand that, for convenience and brevity, the specific working process of the device described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0062] Example 3 Accordingly, embodiments of the present invention provide an electronic device, the device including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor executes the computer program to implement the harmonic signal generation method described in the above embodiments of the invention.

[0063] The electronic device may be a desktop computer, laptop, handheld computer, or cloud server, etc. The device may include, but is not limited to, a processor and a memory.

[0064] The processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor. The processor is the control center of the device, connecting various parts of the device via various interfaces and lines.

[0065] Example 4 Accordingly, embodiments of the present invention provide a storage medium, the storage medium including a stored computer program, wherein, when the computer program is executed, it controls the device where the storage medium is located to execute the harmonic signal generation method described in the above embodiments of the invention.

[0066] The memory can be used to store the computer program. The processor implements various functions of the device by running or executing the computer program stored in the memory and calling data stored in the memory. The memory may mainly include a program storage area and a data storage area. The program storage area may store the operating system, applications required for at least one function, etc.; the data storage area may store data created based on the use of the mobile phone, etc. In addition, the memory may include high-speed random access memory, and may also include non-volatile memory, such as hard disk, RAM, plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, at least one disk storage device, flash memory device, or other volatile solid-state storage device.

[0067] The storage medium is a computer-readable storage medium, and the computer program is stored in the computer-readable storage medium. When executed by a processor, the computer program can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable file, or some intermediate form. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording media, USB flash drive, portable hard drive, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content included in the computer-readable medium can be appropriately added or removed according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, the computer-readable medium does not include electrical carrier signals and telecommunication signals.

[0068] The above description represents the preferred embodiments of the present invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of the present invention, and these improvements and modifications are also considered to be within the scope of protection of the present invention.

Claims

1. A method of generating a harmonic signal, characterized by, The method comprises the following steps: acquiring target fundamental voltage, target harmonic voltage, target fundamental current and target harmonic current to be output; selecting a corresponding first gear value according to the target fundamental voltage, a corresponding second gear value according to the target harmonic voltage, a corresponding third gear value according to the target fundamental current, and a corresponding fourth gear value according to the target harmonic current; calculating a first fitting waveform corresponding to the target fundamental voltage according to the first gear value, a second fitting waveform corresponding to the target harmonic voltage according to the second gear value, a third fitting waveform corresponding to the target fundamental current according to the third gear value, and a fourth fitting waveform corresponding to the target harmonic current according to the fourth gear value; a control signal generator generates the target fundamental voltage, the target harmonic voltage, the target fundamental current and the target harmonic current according to the first fitting waveform, the second fitting waveform, the third fitting waveform and the fourth fitting waveform respectively, and outputs them to corresponding power amplifier devices, so that the four power amplifier devices amplify and output the target fundamental voltage, the target harmonic voltage, the target fundamental current and the target harmonic current to corresponding devices under test.

2. The method of claim 1, wherein the harmonic signal is generated by a method comprising: The selecting a corresponding first gear value according to the target fundamental voltage, a corresponding second gear value according to the target harmonic voltage, a corresponding third gear value according to the target fundamental current, and a corresponding fourth gear value according to the target harmonic current comprises: selecting the minimum gear value greater than the target fundamental voltage as the corresponding first gear value from each preset gear value according to the target fundamental voltage; selecting the minimum gear value greater than the target harmonic voltage as the corresponding second gear value from each preset gear value according to the target harmonic voltage; selecting the minimum gear value greater than the target fundamental current as the corresponding third gear value from each preset gear value according to the target fundamental current; selecting the minimum gear value greater than the target harmonic current as the corresponding fourth gear value from each preset gear value according to the target harmonic current.

3. The method of claim 1, wherein the harmonic signal is generated by a method comprising: The control signal generator generates the target fundamental voltage, the target harmonic voltage, the target fundamental current and the target harmonic current according to the first fitting waveform, the second fitting waveform, the third fitting waveform and the fourth fitting waveform respectively, and outputs them to corresponding power amplifier devices, so that the four power amplifier devices amplify and output the target fundamental voltage, the target harmonic voltage, the target fundamental current and the target harmonic current to corresponding devices under test, comprising: the control signal generator generates a first fitting signal according to the first fitting waveform, and performs analog-digital conversion on the first fitting signal to obtain the target fundamental voltage and output it to a corresponding fundamental voltage isolation power amplifier device, so that the fundamental voltage isolation power amplifier device amplifies and outputs the target fundamental voltage to a corresponding device under test; The control signal generator generates a second fitting signal according to the second fitting waveform, and performs analog-digital conversion on the second fitting signal to obtain a target harmonic voltage and output to a corresponding harmonic isolation voltage power amplifier device, so that the harmonic isolation voltage power amplifier device amplifies and outputs the target harmonic voltage to a corresponding device under test; The control signal generator generates a third fitting signal according to the third fitting waveform, and performs analog-digital conversion on the third fitting signal to obtain a target fundamental current and output to a corresponding fundamental isolation transconductance power amplifier device, so that the fundamental isolation transconductance power amplifier device amplifies and outputs the target fundamental current to a corresponding device under test; The control signal generator generates a fourth fitting signal according to the fourth fitting waveform, and performs analog-digital conversion on the fourth fitting signal to obtain a target fundamental voltage and output to a corresponding fundamental isolation voltage power amplifier device, so that the fundamental isolation voltage power amplifier device amplifies and outputs the target fundamental voltage to a corresponding device under test.

4. The method of claim 1, wherein the harmonic signal is generated by a method comprising: After the four power amplifier devices amplify and output the target fundamental voltage, the target harmonic voltage, the target fundamental current and the target harmonic current to the corresponding device under test, further comprising: The active electric energy output by the signal generator is obtained, and the active electric energy is output to the corresponding device under test, so that the device under test detects the electric energy error according to the active electric energy to obtain the electric energy detection error corresponding to the device under test.

5. A harmonic signal generating apparatus characterized by comprising: Comprise: A target voltage and current acquisition module, a gear selection module, a fitting waveform calculation module and a target signal output module; The target voltage and current acquisition module is used to acquire the target fundamental voltage, the target harmonic voltage, the target fundamental current and the target harmonic current to be output; The gear selection module is used to select a corresponding first gear value according to the target fundamental voltage, a corresponding second gear value according to the target harmonic voltage, a corresponding third gear value according to the target fundamental current, and a corresponding fourth gear value according to the target harmonic current; The fitting waveform calculation module is used to calculate a first fitting waveform corresponding to the target fundamental voltage according to the first gear value, calculate a second fitting waveform corresponding to the target harmonic voltage according to the second gear value, calculate a third fitting waveform corresponding to the target fundamental current according to the third gear value, and calculate a fourth fitting waveform corresponding to the target harmonic current according to the fourth gear value; The target signal output module is used to control the signal generator to generate corresponding target fundamental voltage, target harmonic voltage, target fundamental current and target harmonic current according to the first fitting waveform, the second fitting waveform, the third fitting waveform and the fourth fitting waveform, and output to the corresponding power amplifier device, so that the four power amplifier devices amplify and output the target fundamental voltage, the target harmonic voltage, the target fundamental current and the target harmonic current to the corresponding device under test.

6. The apparatus of claim 5, wherein the harmonic signal is generated by the means for generating a harmonic signal. The step of selecting a first gear value based on the target fundamental voltage, a second gear value based on the target harmonic voltage, a third gear value based on the target fundamental current, and a fourth gear value based on the target harmonic current includes: Based on the target fundamental voltage, select the smallest gear value that is greater than the target fundamental voltage from among the preset gear values ​​as the corresponding first gear value; Based on the target harmonic voltage, select the smallest gear value that is greater than the target harmonic voltage from each preset gear value as the corresponding second gear value; Based on the target fundamental current, select the smallest gear value that is greater than the target fundamental current from among the preset gear values ​​as the corresponding third gear value; Based on the target harmonic current, select the smallest gear value that is greater than the target harmonic current from among the preset gear values ​​as the corresponding fourth gear value.

7. The harmonic signal generation apparatus as described in claim 5, characterized in that, The control signal generator, based on the first, second, third, and fourth fitted waveforms, respectively generates corresponding target fundamental voltage, target harmonic voltage, target fundamental current, and target harmonic current, and outputs them to the corresponding power amplifier devices. This allows the four power amplifier devices to amplify the target fundamental voltage, target harmonic voltage, target fundamental current, and target harmonic current, and then output them to the corresponding tested device, including: The control signal generator generates a first fitting signal based on the first fitting waveform, performs analog-to-digital conversion on the first fitting signal to obtain the target fundamental voltage, and outputs it to the corresponding fundamental isolation voltage power amplifier device, so that the fundamental isolation voltage power amplifier device amplifies the target fundamental voltage and outputs it to the corresponding device under test. The control signal generator generates a second fitting signal based on the second fitting waveform, performs analog-to-digital conversion on the second fitting signal to obtain the target harmonic voltage, and outputs it to the corresponding harmonic isolation voltage power amplifier device, so that the harmonic isolation voltage power amplifier device amplifies the target harmonic voltage and outputs it to the corresponding device under test. The control signal generator generates a third fitting signal based on the third fitting waveform, performs analog-to-digital conversion on the third fitting signal to obtain the target fundamental current, and outputs it to the corresponding fundamental isolation transconductance power amplifier device, so that the fundamental isolation transconductance power amplifier device amplifies the target fundamental current and outputs it to the corresponding device under test. The control signal generator generates a fourth fitting signal based on the fourth fitting waveform, performs analog-to-digital conversion on the fourth fitting signal to obtain the target fundamental voltage, and outputs it to the corresponding fundamental isolation voltage power amplifier device, so that the fundamental isolation voltage power amplifier device amplifies the target fundamental voltage and outputs it to the corresponding device under test.

8. The apparatus of claim 5, wherein the harmonic signal is generated by a voltage source. Also includes: Power error detection module; The power error detection module is used to acquire the active power output by the signal generator and output the active power to the corresponding device under test, so that the device under test can perform power error detection based on the active power and obtain the power detection error corresponding to the device under test.

9. An electronic device, comprising: The system includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor, when executing the computer program, implements the method for generating harmonic signals as described in any one of claims 1 to 4.

10. A storage medium, characterized by The storage medium includes a stored computer program, wherein, when the computer program is executed, it controls the device where the storage medium is located to perform the harmonic signal generation method as described in any one of claims 1 to 4.