基于单片机的SPWM控制系统设计研究及仿真武汉科技大学本科毕业论文

0 下载量 120 浏览量 更新于2024-04-09 收藏 1.48MB DOC 举报
摘 要 本文旨在建立基于单片机的SPWM调控系统,利用单片机产生SPWM波,其中脉冲的宽度按正弦规律变化,与正弦波等效的PWM波形称为SPWM波。根据SPWM法的原理,通过控制电路中开关器件的通断,使其输出的脉冲电压的面积与所希望输出的正弦波在相应区间内的面积相等,达到等效效果。利用MATLAB计算基波与载波的交点,计算交点间的持续时间,在单片机程序中建立数组,数组元素为定时器的初值,定时器溢出时输出电平自动翻转,查表赋予下一个电平的持续时间,得到SPWM波形。在protues中仿真,在示波器中观察SPWM波的波形。 关键词:单片机;MATLAB;查表;SPWM;仿真 Abstract The main purpose of this paper is to establish an SPWM control system based on a single-chip microcomputer, using the single-chip microcomputer to generate SPWM waves, where the width of the pulse varies sinusoidally, and the PWM waveform equivalent to the sine wave is called SPWM wave. According to the principle of SPWM method, by controlling the on-off of the switching devices in the circuit, the output pulse voltage area is equal to the area of the desired output sine wave in the corresponding interval, achieving equivalent effect. Using MATLAB to calculate the intersection points of the fundamental wave and the carrier wave, calculating the duration between intersection points, establishing an array in the single-chip program, where the elements are the initial values assigned to the timer, when the timer overflows, the output level automatically flips, then looking up the table to assign the duration of the next level, and so on, to obtain an SPWM waveform. Finally, simulate in protues, and observe the waveform of the SPWM wave in the oscilloscope. Keywords: Single-chip microcomputer; MATLAB; Look-up table; SPWM; Simulation