CN112583240B - Variable frequency table look-up algorithm suitable for digital control - Google Patents

Variable frequency table look-up algorithm suitable for digital control Download PDF

Info

Publication number
CN112583240B
CN112583240B CN202011413602.1A CN202011413602A CN112583240B CN 112583240 B CN112583240 B CN 112583240B CN 202011413602 A CN202011413602 A CN 202011413602A CN 112583240 B CN112583240 B CN 112583240B
Authority
CN
China
Prior art keywords
sine
frequency
sintableindex
sine table
countindex
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202011413602.1A
Other languages
Chinese (zh)
Other versions
CN112583240A (en
Inventor
徐应年
李卓
闫旭
夏华东
蔡厚军
赵勇兵
曾天龙
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wuhan Hyderabad Technology Co ltd
Original Assignee
Wuhan Hyderabad Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Wuhan Hyderabad Technology Co ltd filed Critical Wuhan Hyderabad Technology Co ltd
Priority to CN202011413602.1A priority Critical patent/CN112583240B/en
Publication of CN112583240A publication Critical patent/CN112583240A/en
Application granted granted Critical
Publication of CN112583240B publication Critical patent/CN112583240B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H02GENERATION; CONVERSION OR DISTRIBUTION OF ELECTRIC POWER
    • H02MAPPARATUS FOR CONVERSION BETWEEN AC AND AC, BETWEEN AC AND DC, OR BETWEEN DC AND DC, AND FOR USE WITH MAINS OR SIMILAR POWER SUPPLY SYSTEMS; CONVERSION OF DC OR AC INPUT POWER INTO SURGE OUTPUT POWER; CONTROL OR REGULATION THEREOF
    • H02M1/00Details of apparatus for conversion
    • H02M1/08Circuits specially adapted for the generation of control voltages for semiconductor devices incorporated in static converters
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06CDIGITAL COMPUTERS IN WHICH ALL THE COMPUTATION IS EFFECTED MECHANICALLY
    • G06C3/00Arrangements for table look-up, e.g. menstruation table
    • HELECTRICITY
    • H02GENERATION; CONVERSION OR DISTRIBUTION OF ELECTRIC POWER
    • H02MAPPARATUS FOR CONVERSION BETWEEN AC AND AC, BETWEEN AC AND DC, OR BETWEEN DC AND DC, AND FOR USE WITH MAINS OR SIMILAR POWER SUPPLY SYSTEMS; CONVERSION OF DC OR AC INPUT POWER INTO SURGE OUTPUT POWER; CONTROL OR REGULATION THEREOF
    • H02M7/00Conversion of ac power input into dc power output; Conversion of dc power input into ac power output
    • H02M7/42Conversion of dc power input into ac power output without possibility of reversal
    • H02M7/44Conversion of dc power input into ac power output without possibility of reversal by static converters
    • H02M7/48Conversion of dc power input into ac power output without possibility of reversal by static converters using discharge tubes with control electrode or semiconductor devices with control electrode

Landscapes

  • Engineering & Computer Science (AREA)
  • Power Engineering (AREA)
  • Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Computing Systems (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Inverter Devices (AREA)
  • Digital Transmission Methods That Use Modulated Carrier Waves (AREA)
  • Amplitude Modulation (AREA)

Abstract

The invention discloses a frequency conversion table look-up algorithm suitable for digital control, belongs to the field of asynchronous modulation, and is suitable for a frequency conversion signal source of digital control. For convenience and clarity of description of algorithm principles and flows, the invention takes sinusoidal pulse width modulation of regular sampling as an example. The specific implementation method comprises the following steps: an array SinTable [257] of sine tables of size 2 8 +1 is created, and a discrete quarter-period sine table of the modulated wave is stored in the array in place of the full-period sine table. A 32-bit phase pointer CountIndex and a 10-bit phase pointer SinTableIndex are defined to control frequency accuracy and look up the sine values in the sine table, respectively, and to establish a mapping of the two phase pointers. The Step variable Step is calculated from the unused modulation wave frequency, and at each sample instant CountIndex is calculated from the Step variable and its corresponding SinTableIndex value. And searching the sine value according to the judging and transferring program, so as to generate the modulation wave with any frequency. The invention greatly reduces the memory space occupied by the sine table, reduces the requirement on storage hardware, improves the accuracy of output frequency, ensures the stability of frequency, has the characteristics of simplicity, convenience and practicability, and has great practical value.

Description

Variable frequency table look-up algorithm suitable for digital control
Technical Field
The invention belongs to the field of asynchronous modulation, and more particularly relates to a method and a device for controlling variable frequency signal sources in various digital control.
Background
The frequency conversion signal source is actually an inverter, and the input direct current voltage is inverted into alternating current output voltages with different frequencies mainly by controlling the on and off of a switching tube. The control method of the switching tube is divided into analog control and digital control. Compared with analog control, digital control can greatly simplify a hardware circuit, remarkably improve control precision, realize various complex and advanced control algorithms, reduce power supply cost and facilitate mass production of products, so that digital control is mostly adopted.
In digital control, the microprocessor adopts a SPWM algorithm of regular sampling, namely, high-frequency sampling is carried out on the modulated wave according to a preset sampling time interval, the amplitude of the modulated wave is considered to be unchanged between two samplings, and the switching time of each switching tube can be controlled by comparing the amplitude of the modulated wave with the amplitude of a carrier wave.
At present, most of the methods of sine table lookup are adopted to obtain the amplitude of the modulated wave, that is, discrete modulated waves are stored in a memory in the form of a data table in advance, then corresponding sine values are found at each sampling point according to the current phase of the modulated wave by inquiring corresponding storage positions in the sine table, and then the corresponding sine values enter a PWM module in a microprocessor through a control algorithm to calculate and update pulse width, so that the switching on and switching off of a switching tube are controlled.
Because the traditional table look-up method cannot generate modulation waves with any frequency according to a single sine table, the prior scholars improve the algorithm and realize frequency conversion through addition and shift operation, but the problems that the algorithm flow is not clear enough, the implementation mode is not clear, the sine table occupies large memory and the like still exist.
Disclosure of Invention
Aiming at the defects or improvement demands of the prior art, the invention provides a frequency conversion table look-up algorithm suitable for digital control. The method not only can generate modulation waves with any frequency, but also greatly reduces the memory space occupied by the sine table, reduces the requirement on storage hardware, improves the precision of output frequency, ensures the stability of the frequency, and has the characteristics of simplicity, convenience and practicability.
To achieve the above object, the technology of the present invention comprises: an array SinTable [257] of sine tables of size 2 8 +1 is created, and a discrete quarter-period sine table of the modulated wave is stored in the array in place of the full-period sine table. A 32-bit phase pointer CountIndex and a 10-bit phase pointer SinTableIndex are defined to control frequency accuracy and look up the sine values in the sine table, respectively, and to establish a mapping of the two phase pointers. The Step variable Step is calculated from the unused modulation wave frequency, and at each sample instant, countIndex is calculated from the Step variable, along with its corresponding SinTableIndex value. And searching the sine value according to the judging and transferring program, so as to generate the modulation wave with any frequency. Specifically, the method comprises the following steps:
Establishing a sine table array SinTable [257] with the size of 2 8 +1, defining that a phase pointer of the sine table is SinTableIndex, the size is 2 10, and the phase resolution of the sine table is 2 pi/2 10, and replacing the full-period sine table by a formula of a quarter period is as follows:
A 32-bit phase pointer CountIndex with a sinusoidal phase resolution of 2 pi/2 32 is introduced, a mapping between the two phase pointers is established, a 32-bit phase pointer CountIndex is used to control the frequency accuracy, and a 10-bit phase pointer SinTableIndex is used to look up the sinusoidal values in the sine table. Defining a Step variable Step, and obtaining different Step variables according to different modulation wave frequencies under a sine table with a fixed size and a fixed sampling frequency, wherein the formula is as follows:
Each time sampled CountIndex is accumulated in Step steps and each time CountIndex is increased by 2 22, sinTableIndex is increased by 1. When Step <2 22, sinTableIndex is increased by less than 1 each time, the sine table is automatically and selectively read repeatedly; when Step >2 22, sinTableIndex is increased by more than 1 each time, the sine table is automatically and selectively read in a jump manner to sequentially read the values in the sine table SinTable [257], and a modulation wave formula is generated as follows:
Drawings
FIG. 1 is a schematic diagram of a single-stage frequency-doubling SPWM modulation
FIG. 2 is a diagram of a 32-bit to 10-bit pointer
FIG. 3 is a block diagram of a flow chart of an implementation of a frequency conversion lookup algorithm
SinTableIndex (k) in the figure is a 10-bit phase pointer value at the kth sample, and CountIndex (k) is a 32-bit phase pointer value at the kth sample. fr is the modulation wave frequency, fc is the sampling frequency, step is the Step variable of the phase pointer CountIndex.
Detailed Description
The present invention will be described in detail below with reference to the drawings and examples, in order to make the objects, technical solutions and advantages of the present invention more apparent. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
The algorithm principle of the invention is described as follows:
Taking a single-stage frequency-doubling SPWM as an example, asymmetric regular sampling is used to increase the sampling frequency, so the sampling frequency is twice the carrier frequency. As shown in fig. 1, u r is a modulated wave, u tri and-u tri are positive and negative carriers, respectively, the carrier frequency is f k, and the sampling frequency is f c. Assuming that the effective value of the modulated wave u r is u m and the frequency is fr, there are:
In digital control, the modulated wave u r (t) is discretized at the sampling frequency fc, that is, the modulated wave is to be sampled Tr/tc=fc/fr times in one period, and the corresponding is to divide 2pi into fc/fr points, and then the sine phase of the modulated wave ur (k) at the kth sampling is:
In order to acquire the modulated wave by adopting the table look-up method, firstly, a sine table array SinTable [ n ] with the size of n is established, a phase pointer of the sine table is defined as SinTableIndex, the phase resolution is 2 pi/n, the sine value stored in the sine table is acquired through the position of the phase pointer SinTableIndex at each sampling moment, and the sine table is incremented SinTableIndex after each sampling until the last bit of the sine table is restarted.
Thus, at the time of the kth sampling, in order to acquire numerical information in the sine table, the corresponding pointer value is:
Since the pointer value must be an integer, let n×fr/fc=1, it can be seen that the minimum frequency of the modulated wave obtained by the table look-up method is determined by the size of the sine table:
Assuming that a sine table with the size of 2 32 is established, the minimum frequency of the modulated wave is f rmin =9.3 mu Hz, and then the modulated wave with the frequency of f rmin which is an integer multiple can be obtained by a jump reading mode, so that the requirements that the output voltage frequency of a variable-frequency voltage-regulating signal source is adjustable between 10Hz and 400Hz and the frequency error is smaller than 1Hz can be completely met. However, such a large memory table cannot be built up in memory due to microprocessor memory limitations.
Therefore, the frequency precision is controlled by using the 32-bit high-resolution phase pointer, the sine table is queried by using the 10-bit low-resolution phase pointer, and the mapping of the two phase pointers is established, as shown in fig. 2, so that the frequency precision can be improved and the memory can be reduced.
More specifically, the algorithm flow of the invention is described as follows:
Step one: program initialization, defining Step variable Step, 32-bit pointer variable CountIndex, 10-bit pointer variable SinTableIndex and sine table SinTable [257];
step two: the microprocessor receives an output voltage frequency (namely a modulation wave frequency) instruction sent by the upper computer;
step three: calculating step variable according to modulation wave frequency and sampling frequency
Step four: every time a sampling time passes, the 32-bit phase pointer CountIndex accumulates a Step variable Step, so as to control the frequency of the modulated wave;
Step five: map CountIndex to the 10-bit phase pointer SinTableIndex;
step six: acquiring a sine value of the modulated wave from a sine table SinTable [257] through a phase pointer SinTableIndex and a judgment and transfer algorithm;
Step seven: after the sine value of the modulation wave is obtained, the modulation wave can enter a PWM module of the microprocessor through a related control algorithm, and the pulse width is calculated and updated, so that the on and off of the switching tube are controlled. During this period the sine value of the modulated wave will remain unchanged until the arrival of the next sampling instant.
Further explanation will be made by taking the generation of 1HZ modulated wave and 100HZ modulated wave as examples, and the sine values of the modulated waves at different sampling moments are shown in the following table. The carrier frequency is selected to be 20kHZ, and asymmetric sampling is used, so that the sampling frequency is 40kHZ.
Calculated is that Step is 107374.1824 when the modulation wave frequency is 1HZ, countIndex (2) = 214748.3648 < 2 22 when the sampling time is 2, so SinTableIndex repeatedly reads the sine table. And CountIndex (40) =4294967.296 >2 22, sinTableIndex plus one when the sampling time is 40. When the modulation wave frequency is 100HZ, step is 10737418.24>2 22, sinTableIndex is increased by more than 1 each time, and the sine table is automatically and selectively read in a jumping manner to sequentially read the numerical values in the sine table SinTable [257 ].

Claims (5)

1. The frequency conversion table look-up algorithm suitable for digital control is characterized in that: a sine table array SinTable [257] with the size of 2 8 +1 is established, a sine table with a quarter cycle of discrete modulation waves is stored in the array and used for replacing a sine table with a complete cycle, a 32-bit phase pointer CountIndex and a 10-bit phase pointer SinTableIndex are defined and used for controlling frequency precision and inquiring sine values in the sine table respectively, mapping of the two phase pointers is established, step variable Step is calculated according to different modulation wave frequencies, step variable CountIndex and SinTableIndex values corresponding to the Step variable Step are calculated according to the Step variable Step when each sampling time comes, and sine values are searched according to judging and transferring procedures, so that modulation waves with any frequency are generated.
2. The variable frequency lookup algorithm as claimed in claim 1 wherein: the phase pointer SinTableIndex is used to look up the sine value in the sine table array SinTable [257] and is 2 10, i.e. the phase resolution of the sine table is 2 pi/2 10, then the formula for replacing the full period sine table with a quarter period is as follows:
3. The variable frequency lookup algorithm as claimed in claim 1 wherein: the increasing step size at each sampling CountIndex determines the frequency of the modulated wave, so that different step size variables can be obtained according to different modulated wave frequencies under a sine table with fixed size and fixed sampling frequency:
4. A variable frequency lookup algorithm as claimed in claim 2 wherein: the following judgment and transfer algorithm is added to generate a modulation wave, and u m is the effective value of the modulation wave:
5. A variable frequency look-up table algorithm as claimed in any one of claims 1,2, 3, 4, wherein: a mapping between two phase pointers is established, a 32-bit phase pointer CountIndex is used for controlling frequency precision, a 10-bit phase pointer SinTableIndex is used for inquiring sine values in a sine table, countIndex is accumulated in Step length Step each time of sampling, and each time CountIndex is increased by 2 22, sinTableIndex by 1, sinTableIndex is increased by less than 1 each time when Step <2 22, and the sine table is automatically and selectively read repeatedly; when Step >2 22, sinTableIndex is increased by more than 1 each time, the sine table is automatically selectively skip-read.
CN202011413602.1A 2020-12-04 2020-12-04 Variable frequency table look-up algorithm suitable for digital control Active CN112583240B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011413602.1A CN112583240B (en) 2020-12-04 2020-12-04 Variable frequency table look-up algorithm suitable for digital control

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011413602.1A CN112583240B (en) 2020-12-04 2020-12-04 Variable frequency table look-up algorithm suitable for digital control

Publications (2)

Publication Number Publication Date
CN112583240A CN112583240A (en) 2021-03-30
CN112583240B true CN112583240B (en) 2024-04-26

Family

ID=75127457

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011413602.1A Active CN112583240B (en) 2020-12-04 2020-12-04 Variable frequency table look-up algorithm suitable for digital control

Country Status (1)

Country Link
CN (1) CN112583240B (en)

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5425055A (en) * 1991-11-30 1995-06-13 Nokia Mobile Phones (Uk) Limited Digital radio modulator
JP2001007874A (en) * 1999-06-22 2001-01-12 Furuno Electric Co Ltd Msk demodulator and signal frequency controller
WO2004092935A1 (en) * 2003-04-16 2004-10-28 Sony Ericsson Mobile Communications Ab Direct digital frequency synthesizer for cellular wireless communication systems based on fast frequency-hopped spread spectrum technology
CN102195559A (en) * 2010-07-16 2011-09-21 刘希臣 Simple asynchronous modulation implementation method
WO2017107327A1 (en) * 2015-12-25 2017-06-29 北京遥测技术研究所 Cpm modulation digitization implementation method based on table lookup method, and digital cpm modulation module
CN109753107A (en) * 2018-11-30 2019-05-14 科华恒盛股份有限公司 A kind of digital sinusoidal signal calculation method, system, device and readable storage medium storing program for executing
CN109856454A (en) * 2019-02-26 2019-06-07 西南交通大学 A kind of specific secondary frequencies digital signal extracting method based on fourier series
CN111144014A (en) * 2019-12-30 2020-05-12 西安电子工程研究所 FPGA-based two-dimensional planar phased array antenna phase matching algorithm implementation method
CN111740635A (en) * 2020-07-24 2020-10-02 武汉海德博创科技有限公司 Double-loop control method of single-phase LC inverter

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5425055A (en) * 1991-11-30 1995-06-13 Nokia Mobile Phones (Uk) Limited Digital radio modulator
JP2001007874A (en) * 1999-06-22 2001-01-12 Furuno Electric Co Ltd Msk demodulator and signal frequency controller
WO2004092935A1 (en) * 2003-04-16 2004-10-28 Sony Ericsson Mobile Communications Ab Direct digital frequency synthesizer for cellular wireless communication systems based on fast frequency-hopped spread spectrum technology
CN102195559A (en) * 2010-07-16 2011-09-21 刘希臣 Simple asynchronous modulation implementation method
WO2017107327A1 (en) * 2015-12-25 2017-06-29 北京遥测技术研究所 Cpm modulation digitization implementation method based on table lookup method, and digital cpm modulation module
CN109753107A (en) * 2018-11-30 2019-05-14 科华恒盛股份有限公司 A kind of digital sinusoidal signal calculation method, system, device and readable storage medium storing program for executing
CN109856454A (en) * 2019-02-26 2019-06-07 西南交通大学 A kind of specific secondary frequencies digital signal extracting method based on fourier series
CN111144014A (en) * 2019-12-30 2020-05-12 西安电子工程研究所 FPGA-based two-dimensional planar phased array antenna phase matching algorithm implementation method
CN111740635A (en) * 2020-07-24 2020-10-02 武汉海德博创科技有限公司 Double-loop control method of single-phase LC inverter

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于DDS的SPWM自然采样法硬件实现;周根荣;姜平;李俊红;;电力电子技术(第06期);第83-85页 *

Also Published As

Publication number Publication date
CN112583240A (en) 2021-03-30

Similar Documents

Publication Publication Date Title
JPH08510109A (en) Programmable PWM inverter controller
CN103684031A (en) Current hysteresis control digital implementation system for PWM rectifier
CN103701462B (en) The self-tuning signal generator of high-precision phase position based on FPGA
CN106100481A (en) Three-phase current reconstructing method based on single current sensor and device
CN112583240B (en) Variable frequency table look-up algorithm suitable for digital control
CN116545292A (en) LC filtering inverter prediction control method and system
CN114400910B (en) Multi-step prediction control method of current source type converter based on vector advance screening
CN117013594B (en) Parameter setting method for current controller of micro-grid-connected inverter
JP6898882B2 (en) Power converter control device
CN112858802B (en) Method, device and system for determining effective value of output electric parameter of switching power converter
CN109901382B (en) Regular sampling PWM (pulse-Width modulation) optimization method of digital control system
CN104765402A (en) Pendulum type MPPT (Maximum Power Point Tracking) algorithm of single-stage photovoltaic grid-connected inverter
CN103697874B (en) A kind of quartz digital tuning fork gyroscope drives loop control circuit
CN116207874A (en) Bilateral decoupling self-adaptive tuning control strategy and implementation device for LCC/S compensation wireless power transmission system
CN113437915B (en) Construction method and application of inverter dead zone voltage compensation model
Ito et al. 3MHz multi sampling deadbeat control of single phase PWM inverter using FPGA based hardware controller
CN112994110B (en) LC filtering type grid-connected inverter parameter-free prediction capacitor voltage control method
CN111987920B (en) Three-level space vector modulation method
CN113067492A (en) Parallel inverter switching frequency circulation restraining method based on carrier phase compensation
CN108919154B (en) Dynamic data correction method for alternating current constant current source current feedback signal
CN112054696A (en) Multilevel converter optimization control method and device based on minimum backflow power
CN109500816A (en) Robot actuating system and its control method
CN109753107A (en) A kind of digital sinusoidal signal calculation method, system, device and readable storage medium storing program for executing
CN111431512A (en) Tangential approximation method asymmetric rule sampling SPWM (sinusoidal pulse Width modulation) method, equipment and storage equipment
CN214480320U (en) Linear three-phase sine inverter

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant