1、 题目:PWM 脉冲调宽程序设计 PWM 脉冲调宽程序设计 I 摘 要 根据冲量效果不变理论,本文提出了采用规则采样算法计算 PWM 波的方法。详细描 述了采用 AT89C2051 单片机定时加计数实现 PWM 波形的程序设计方法。该方法与传统的 硬件电路产生 PWM 波形相比,具有更大的灵活性和实用性。电路简单可靠,编程方便。 对软件实现 PWM 波形中实时输出的误差进行了分析,提出了改进意见。仿真结果表明用 该方法所产生的 PWM 波形精度高,并且输出波形的频率和幅值可变,是实现脉宽调制控 制技术的一种有效途径。 关键词关键词:PWM 波形;程序;逆变器 PWM 脉冲调宽程序设计 II A
2、BSTRACT According to the theory of effect of impulse is invariant,an algorithm of PWM waves is developed with the regular sampling methodIn this paper was described in detail the PWM waveform program design method by using the monolithic integrated circuit of AT89C2051s time and countThis method com
3、pare with the PWM waveform produced by traditional hardware circuit, has more flexibility and practicality This designed in simple circuit not only has stronger reliability,but also can be programmed more easilyThe real-time output to inaccuracy of PWM wave realized by software was analyzed,and the
4、promotion ideas were also put outThe result of simulation indicates that the PWM waves generated with this method is excellent,the frequency and the margin of the output waves is controllable,is an effective way of implement the pulse-duration modulation control technology Key words:PWM waves;proced
5、ure;Inversion PWM 脉冲调宽程序设计 III 目 录 摘 要 . I ABSTRACT II 第 1 章 概 述 1 1.1 PWM 技术的发展概况 1 1.2 PWM 技术的应用范畴 1 1.3 PWM 脉冲调宽程序设计的意义 2 1.4 PWM 控制的基本原理 2 第 2 章 方案论证 4 2.1 PWM 脉冲的生成方法 4 2.1.1 完全由模拟电路生成 5 2.1.2 由专用集成芯片生成 5 2.1.3 软硬件结合系统生成 6 2.2 设计方案选择 8 2.2.1 总体方案 . 8 2.2.2 软件算法 . 9 2.2.3 硬件平台 . 9 第 3 章 硬件设计 .10
6、 3.1 单片机 A T89C2051 简介10 3.1.1 主要性能参数 .10 3.1.2 总体结构 10 3.1.3 引脚功能说明 .12 3.1.4 定时器/计数器简介 .13 3.2 硬件电路 15 第 4 章 软件设计 .16 4.1 编程语言 16 4.2 软件算法实现 .16 4.3 系统主程序 20 4.4 定时中断 20 4.5 算例说明 22 第 5 章 调试结果及分析 .24 第 6 章 问题讨论 .28 第 7 章 总结 .29 参 考 文 献 .30 致 谢 .31 PWM 脉冲调宽程序设计 IV 附 录 .31 附录 A PWM 脉冲调宽 C51 程序代码32 附录 B WIN-TC 中 PWM 规则采样算法仿真 C 源程序代码 34 PWM 脉冲调宽程序设计) 第 1 页 共 36 页 第 1 章 概 述 PWM 技术是在电力电子领域有着广泛的应用,并对电力电子技术产生了十分深远影 响的一项技术。 PWM 技术在晶闸管时代就已经产生,但是为了使晶闸管通断要付出很大的代价,因 而难以得到广泛应用。以 IGBT、电力 MOSFET 等为代表的全