1、浙江科技学院毕业设计(论文)(外文翻译)Design of Digital Controlled Signal Generator Based on DDS and MCUYinjun Chena, Zehuai YuanFaculty of Electronic Information and Mechanical Electrical Engineering, Zhaoqing University, Zhaoqing 526061, ChinaKeywords: DDS; MCU; Signal generator; Phase Accumulator; DACAbstract. Its
2、 advantage to use DDS chip is output signal frequency bigger, and precision higher, But users cant change the output signal waveforms. The MCU can produce the required arbitrarywaveforms, but its program execution of the order limit the speed.So we use their Synergy to design the digital controlled
3、signal generator. The System has the advantage of output good quality waveform, frequency of precision and stability ,and high frequency, empty, amplitude and phase is to step into the need.IntroductionThe digitally synthesized sine waveform (Direct Digital Synthesis, DDS) is a well-known method and
4、 has been applied to many embedded applications 1. This technique can be used to create a positive digital sine waveform. Compared to other frequency composing method, Direct Digital Frequency Synthesis(DDS) has been the most popular trend in modern frequency synthetic technique for its excellent ch
5、aracteristics. The signal source that the DDS technology realizes can carry out accurate controlling on DDS frequency , extent , phase exporting wave forms etc. by numerical control circuit, the system making use of this method has many merits such as stability, reliably and accuracy. The commercial
6、 DDS chip can only export a sine wave for the data in the ROM form already has been solidified. If needing to come into being any wave form, it may come true by the way that FPGA adopts DDS IP core or hardware describe language etc, however,the cost of This way cost is high; on the other hand, any w
7、ave form can be achieved by making use of micro controller unit (MCU) to carry out figure frequency combining and DA converting. The experiment and applying testing have shown that the numerical control signal source composed of STM32 micro controller and DDS chip can work well.DDS and wave form pro
8、gramming patternThe core of DDS system is phase accumulator carriage, and it is composed of a ADR and one unit phase register. When any clock comes, the phase register increases by with the step length, phase register output and phase control word add together, and then the output is imported to sin
9、e inquiry form address. The sine inquiring form includes the numeral extent information of one-period sine wave, eachaddress corresponds to the phase dot of 0360 degrees of the sine wave. The mapping digital signal drives DAC and outputs analog value. The output sine circle and frequency are The pha
10、se register will return to the original state when the 2N/M fc clock is finished. Accordingly, the DDS system output a sine wave when the sine inquiring form finish a circle. The output sine circle and frequency is TO -output sine wave circle, unit: s; TC -external referenced clock circle, unit: s;
11、M -accumulated step length of phase register, constant; f out -output sine wave frequency, unit: Hz; f c -external referenced clock frequency, unit: Hz; N -phase accumulator digit, constant.The relationship among the frequency control word, and the output signal frequency and thereferenced clock fre
12、quency are: Frequency control word is directly proportional to the output signal frequency. In order to describe clearly, the sine wave form is as one vector turns around phase circle, the phase circle matches along with a cycle sine wave. Every sampling pots in wave form corresponds to a phase dot
13、of the phase circle. To synthesis the required frequency signal, it needs to accomplish the following steps1. Controlling every sampling increment of phase and accumulating them (frequency control word K), output 2 pi cumulated phase (using phase accumulator).2. Converting 2 pi accumulating phase in
14、to the corresponding sine amplitude, use ROM to store the corresponding phase-extent form of sine function in general.3. Use DAC to change extent code into the signal simulating voltage.4. The voltage signal that DAC exports is ladder wave form , the required simulation voltage out is achieved after
15、 LPF smoothing.Numerical control DDS signal source system designs analysisSystem uses the STM32 as control core and the AD9850 as generator. STM32 is 32-bit ARM-based micro controller with 128 K byte flash memory. The two signal output of STM32 can be achieved by controlling AD9850 and DAC0832 outpu
16、t simultaneously. The system designs block diagram is shown in Fig. 1. One signal output can generate 30 MHz sine wave and rectangular wave by controlling AD9850, the other output generate any wave form with its frequency less than 10 KHz by numerical frequency mixture of DAC0832.Fig. 1 System desig
17、ns block diagramHardware design AD9850 module AD9850 contains the DDS system and high-speed comparator. The AD9850 can realize the entire numerical frequency combining. The core of the programmable DDS is the phase accumulator, it is composed of a ADR and a N bit phase register, N is for 24 32. Afte
18、r connecting to the accurate clock source and writing the frequency phase control word,AD9850 can generate the frequency-programmable and phase-programmable output of analog sine wave, which can be used as the direct frequency signal source or be transferred into rectangular wave through high-speed
19、comparator. With the 125 MHz clock, 32-bit frequency control word can carry out the output frequencyresolution ratio of AD9850 with 0.0291 Hz4. DAC0832 module The circuit exports the phase data sheet to DAC0832 from STM32 and gets corresponding wave form by DA converting. The step-by-step adjusting
20、phase amounts can create arbitrary frequency, the PWM signal from the STM32 transfers into the corresponding voltage by low-pass filter, therefore, the referenced voltage of DAC0832 is controlled, furthermore, the output wave form extent is tuned appropriately. The digital to analog conversion circu
21、it is shown in Fig.2Fig. 2 DAC circuitPWM converting DA circuit The low-pass filtered PWM signal from STM32 is then stable using the voltage follower, which will yield a stable output voltage; the voltage can be adjusted by tuning the PWM dutyfactor. The system output three PWM signals, which contro
22、ls AD9850 output extent, dutyfactor and the output extent of DAC0832, respectively,. Fig. 3 shows the PWM controls DA transferring circuit.Fig. 3 PWM controlled DA converting circuitFig. 4 Export amplification and the wave filtering circuit. (a) amplification circuit; (b) filteringcircuitAmplificati
23、on and wave filtering circuitThe amplification circuit will export amplified wave form and modify the factor of amplification. An excellent smooth output waveform can be achieved by using the low-pass active power filtering. The amplification circuit and the filtering circuit is showed in Fig. 4. So
24、ftware design And the system software mainly include AD9850 driving module, DAC0832 driving module, the step-by-step automation module, PWM-converting-DA module and uC/GUI figure supportingsystem implanted in procedure. The operation interface is full of humanization for the multi-window pattern is
25、adopted. The design process of the system software is shown in Fig. 5. Implanted uC/GUI The numerical control signal source has used the uC/GUI software sufficiently to establish many windows and control buttons. By means of invoking the corresponding windows and control with the feedback informatio
26、n, the peripheral equipment operated under the control of the system. The external equipment is mainly separated into two drivers, the drive being an AD9850 module and DAC0832 module drive, respectively. The two modules can be controlled by means of the outside interruption and timing interruption.
27、AD9850 Drive AD9850 has 40 control words, among them, 32-bit is used for frequency control, 5-bit is used for the phase control, 1-bit is used for the power source dormancy control, 2-bit is used to choose operation pattern.Fig. 5 Systematic procedure flow chartThis 40 control words may arrive at AD
28、9850 by concurrence way or serial way, in the concurrence way, 8 data highway generals can transfer the data to a register. After repeating 5 times, the 40-bit data is loaded into the frequency / phase data register (for refreshing DDS output frequency and phase) at the FQ-UD rising edge, meanwhile,
29、 the address pointer is reset to the first input registerThen the 8-bit data is loaded at the W-CLK rising edge, and the pointer is set to the next input register. After repeating 5 times of W-CLK rising edge, the W-CLK rising edge will work no longer until the reset signal comes or the address poin
30、ter is reset to the first input register by the FQ-UD rising edge. The procedure operate AD9850 module through the bottom function, as void ad9850( double frequency, /frequency unsigned char phase, /phase unsigned char mode, /pattern unsigned char power /source ) The DAC0832 driven module In the des
31、ign of the numerical control signal source, DAC0832 is defined as single bufferedpattern, when the 8 bit Parallel data D0D7 is input, the DA will transfer data in the CS. The bottom function of void DA0832(u8 value)can invoke Out_To_DDS0832(doubleFrequency,u8 type) function and control the defined w
32、ave form and frequency. This function is based on figure frequency composes principle, it transfers the input frequency into corresponding control word, and then combing phase step-by-step expect, output wave form data sheet in memory. The extent and dutyfactor can be tuned through invoking Adjust_V
33、pp() and Adjust Duty() Step-by-step automation procedure A step-by-step automation procedure brick is added to the design to define the frequency range, step-by-step rate , step-by-step amounts , ascending or lapse, cycling pattern. The step-by-step automation function can be realized through invoki
34、ng Auto Step(AutoStepStr*AS) and passing memory structure type to a function.Test the experiment and data analysisThe DDS numerical control signal source can import the various changeable control words by a touching screen, and then accurately control the signal frequency, dutyfactor, extent and pha
35、se. Figure 6 shows the corresponding experimental wave forms.Fig. 6 The oscillograph exports experiment picture (a) 1 KHz wave form output; (b) 1 MHz wave form output; (c) 20 MHz wave form output.With the oscillograph testing, it shows that the circuit work stably and rightly. The various parametric
36、 index exhibit fine numerical control effect. a. Output frequency range: 1Hz30MHz,peak-to-peak value: 50mV10V;dutyfactor: 10%100%, difference1%。 b. Export the sine wave, sawtooth wave rectangular wave, triangle wave and arbitrarily wave form. c. Continuous Step-by-step adjustment of frequency, dutyf
37、actor, extent and phase.d. The operation of the touching screen includes suppositional keyboard, sliding strip and various suppositional control carry out entering operation, and the every parameters can be demonstrated visually.e. Step-by-step automation, definition of: maximum value , minimum valu
38、e , step-by-step rate , step-by-step amounts , ascending or lapse, cycling or not.Numerical control reform advantage of signal sourceThe designed numerical control signal source is applied to the lathe reform experiment. The main targets of the numerical control system are the coordinate axis displa
39、cement (including displacement speed , direction , location etc.) , the control message originates from numerical control treating or moving control procedure mainly. Therefore, systematic the most fundamental composition of the numerical control system should include three parts: The input/output p
40、rocedure device, numerical control equipment and the servo drives.ConclusionsMaking compound use of DDS and MCU controller, the system can exported the numerical control signal source as the consumer need, it has the merits such as good exporting wave form, frequency accuracy, reliable stability and
41、 high dutyfactor. Each parameter and be easily adjusted by touching a screen, the experiments show that the various parametric indexes have fine numerical control effect.AcknowledgementsThis work was financially supported by the National Natural Science Foundation of China (No:61006075) and Guided P
42、rojects on Integration of Production, Education and Research of Guangdong Province (No:2011B090400253).References1 Lygouras J. N., Tarchanidis K. N., Tsalides Ph. G., “Suspended Sediment and Dye Concentration Measurements Using a Digital Techniques”, Int. J. Electronics, 87, No.1, pp 107, (2000).2 W
43、ebster J. G. Ed., “Tactile Sensors for Robotics and Medicine”, Wiley, New York, (1988).3 Dally J. W., Rilley W. F., Mcconnel K.G., “Instrumentation for Engineering Measurements”, Wiley, New York, (1993).4 Tarchanidis K. N., Ioannidis I. N., Kakkalis I. K. And Lygouras J. N., “FLEXIMAT, an Integrated
44、 System Scanning the Bending of Any Matress.”, Int. Workshop on Virtual andIntelligent Measurement Systems, VIMS 2000, Annapolis, MD, USA, 29-30 April 2000, pp 115,(2000).5 Koukourlis C. S., Voulgaris N. C., “A Digital Method for Sinewave Generation.” Archiv furElectrotechnik, 72, pp 327, (1989).6 K
45、oukourlis Chr. S, Trigonidis V. K., Sahalos J. N., “Differential Synchronous Demodulation for Small Signal Amplitude Estimation.”, IEEE Instrumentation and Measurement, 42, No. 5, pp 926, (1993).基于DDS和单片机数字控制信号发生器的设计关键词: DDS; MCU;信号发生器;相位累加器;DAC摘要: 它的优点,使用DDS芯片输出信号的频率更大,精度更高,但用户不能改变输出信号的波形。MCU可以产生所需
46、的任意波形,但其程序执行的顺序限制速度。因此,我们利用它们之间的协同设计数字控制信号发生器。该系统的优点是输出质量好的精度和稳定性,波形,频率和高频率的,空的振幅和相位是步入需要。介绍数字合成的正弦波形(直接数字频率合成器DDS)是一种公知的方法已被应用到许多嵌入式应用1。这种技术可以用来创建一个积极的数字正弦波形。其它频率合成方法相比, 直接数字频率合成器(DDS)一直以其优良的特性在现代频率合成技术中最流行的趋势。DDS技术实现信号源,可以进行精确控制DDS的频率,程度,相输出波形的数值控制电路等,系统利用这种方法有许多优点,如安定,可靠和准确度。商业DDS芯片只能导出一个正弦波因为ROM
47、表中的数据形式已经被凝固。如果需要进入任何波形,它可能会真正的由FPGA采用DDS的IP核或硬件描述语言等方式来实现,然而, 这种方式成本费用高;另一方面,可以任意波形通过开展数字频率结合使用的微控制器单元(MCU)和DA转换实现。实验和应用测试表明,数控信号源所组成的STM32微控制器和DDS芯片可以很好地工作。DDS和波形编程模式DDS系统的核心是相位累加器的框架,它是由一个ADR和一单位相位寄存器组成的。当任何时钟到来时,相位寄存器增加步长,相寄存器的输出与相位控制字相加,然后输出导入到正弦查询形成地址。正弦查询表格包含一个周期正弦波,每个数字幅度信息地址对应于0360度的正弦波的相位点。测绘数字信号驱动DAC并模拟输出值。输出正弦波周期和频率是:相位寄存器将返回到原来的状态时,2N/ M fc时钟完成。因此,DDS系统输出一个正弦波的正弦查询表时,完成一个周期。输出正弦波的周期和频率为TO - 输出正弦波周期,单位:秒; TC - 外部参考时钟周期,单位:秒; M - 相位寄存器累计步长,恒定f输出 - 输出正