As the core technology of modern power electronics, frequency conversion technology integrates modern electronics, information and intelligent technology. In view of the fact that the power frequency (50 Hz in China) is not the best working frequency of all electrical equipment, which leads to the long-term low efficiency and low power factor operation of many equipment, frequency conversion control provides a mature and widely used high-efficiency energy-saving new technology. The generation and control of SPWM (sine wave pulse width modulation) is one of the core of frequency conversion technology. The first SPWM generation technology is to use analog circuit to form triangle wave and sine wave generation circuit, and use comparator to determine their intersection point. The circuit of this method is complex and the precision is poor, so it has been eliminated for a long time. Later, single chip microcomputer and microcomputer were used to generate SPWM wave, but due to the influence of hardware calculation speed and algorithm calculation amount, the accuracy and speed of calculation can not be considered. Later, with the emergence of powerful DSP and some new algorithms, this problem has been well solved.

The principle of 1 algorithm

There are several methods to generate SPWM waveform: natural sampling method, regular sampling method, low order harmonic elimination method, direct area equivalent method and so on. Among them, the natural sampling method has a high accuracy, but it needs to solve a transcendental equation to solve the breakpoint of conduction, so it has a large amount of calculation and is generally not used. The calculation of low order harmonic elimination method is complex, so only look-up table method can be used, and the frequency and amplitude of this method can not be changed continuously. Therefore, the principle of regular sampling method and direct area equivalent method will be analyzed.

The regular sampling method is evolved from the natural sampling method. The pulse width is obtained by the intersection of the sampled sine wave (actually step wave) and triangular wave. This method only samples the sine wave at the top or bottom of the triangle wave to form a step wave. The principle is shown in Fig. 1 (a).

Among them:

TZ: triangle carrier period

M: Modulation depth (amplitude ratio of sine wave to triangular wave)

t: A sampling time?

The basic principle of direct area equivalent method is shown in Figure 1 (b).

Take a small interval 〔 T, t 〕 from the sine half wave in the graph+ Δ T], its area is S1, then the area of the rectangular pulse equal to its area is S2, and its width is 1 δ i。 The amplitude of sine wave is usin, the modulation is m, and the amplitude of rectangular pulse is us. yes

Where k is the kth sampling and N is the sampling point of sine wave in half period. The switching time of IGBT can be calculated as follows:

Analysis and implementation of dsp-2 algorithm

(1) Analysis of the algorithm

When generating SPWM waveform, there are usually two methods: look-up table and real-time calculation. In actual use, they are often combined, that is, the necessary calculation is stored in the memory offline, and then the simple online calculation is carried out at runtime, which can ensure the rapidity and will not occupy a lot of memory.

The regular sampling method usually stores the sine function table and the TZ / 2 of different carrier frequencies in advance, and runs according to the required TZ, m and Z ω Then the on time of the switching device can be calculated (see Formula 1 for details). The calculation of this method is very small, and the amplitude and frequency of the waveform can be changed continuously.?

The direct area equivalent method is usually stored in the cosine function table of different frequencies in advance, and only simple multiplication and subtraction operations are needed in operation (see formula 2 for details). The calculation of this method is moderate, and the amplitude and frequency of the waveform are continuously variable.

According to the principle of regular sampling method, it can be seen that it uses an approximate step wave to replace sine wave and compare with triangular wave, so its accuracy is low. But because of its simple calculation, it has been widely used in the era of SPWM wave generated by single chip microcomputer and microcomputer. But with the emergence of DSP with powerful computing power, it is possible to solve the problem of both computing accuracy and speed. Therefore, the direct area equivalent method with high accuracy and moderate amount of calculation is combined with DSP to solve this problem.

(2) Characteristics of DSP

There are many DSP manufacturers, most of which are TI company. The TMS320 series of TI company is used here. Ti’s tms320c2000 DSP is based on 320c2xlp core. In order to realize the arithmetic operation of decimals and verify the product of decimals, the output of the product register of c2xlp passes through the product shifter to suppress the extra bits generated in the operation. The product scaling shifter allows 128 multiplications without overflow. The basic product accumulation (MAC) cycle consists of multiplying a data memory value by a program memory value and adding the result to the accumulator. When C2000 circulates Mac, the program counter will automatically increment and release the program bus to the second operand, so as to achieve single cycle execution of MAC.

C24x series chip in C2000 series has event manager. The event manager has three add / subtract timers and nine comparators, which can cooperate with waveform generation logic to generate 12pwm output. Support synchronous and asynchronous PWM generation. He also supports a space vector PWM state machine, which is implemented by switching power transistors to extend the lifetime of transistors and reduce power consumption. A shutdown section generating unit also helps to protect the power transistor. The principle is shown in Figure 2.

It can be seen that in order to realize real-time voltage transformation and frequency conversion, a lot of operations need to be done according to the current carrier time t, and these operations are required to be completed in a carrier cycle. Taking the carrier frequency of 15625HZ as an example, the period is 64 μ s. If three-phase output is required, all these operations are required to be within 32 μ It should be finished within seconds. This is totally impossible for single chip microcomputer. For DSP, the instruction cycle is 50ns, and most of them are single cycle instructions, and there are single cycle multiplication instructions. Therefore, the real-time completion of the above calculation is realized by making full use of the powerful computing power of DSP.

(3) Realization of direct area equivalent method

According to the formula of direct area equivalent method, a cosx / 2 is saved in flash π In this way, unnecessary operations can be simplified as much as possible. In the actual calculation, only one subtraction, one multiplication and one division are needed.

The program flow chart is shown in Figure 3.

3 the final realization of frequency conversion system

According to the above design, a frequency conversion experimental system is built by using IPM (intelligent power module) and corresponding rectifier and filter circuit. In order to expand the requirements, the use of single-chip microcomputer to expand its input and output interface, so that it has better versatility. The hardware structure is shown in Figure 4.

As shown in Figure 4, the SPWM control system based on DSP includes three modules: IPM intelligent power module, DSP processor and MCU. DSP processor is used to generate PWM pulse signal in real time to control IPM to generate output signal. Single chip microcomputer system is used to receive external control signals, load terminal voltage and current sampling signals, various circuit protection signals and other input signals. On the one hand, it can display the working status in real time. On the other hand, it can process the real-time sampling voltage and current signals and send the corresponding signals to DSP system, so that DSP can adjust SPWM signals online to meet the technical requirements of closed-loop work. This system structure mode makes the system function modular, can maximize the computing power of DSP, easy to debug, easy to expand the function of the system, and provides a more convenient condition for the future system upgrading.

Through the experimental system, the SPWM waveform whose output frequency can vary from 1 Hz to 1000 Hz is generated. The main waveform is shown in Figure 5.

4 Conclusion

The research shows that the frequency conversion experiment system based on DSP and direct area equivalent method is successful. Its wide frequency conversion range and expanded input and output interface make it widely used in frequency conversion power supply, frequency converter and other aspects.

Editor in charge: GT