基于STM32F103C8T6的SPWM单相可调频220V逆变电源设计(论文)
伴随着科学技术的飞速发展新能源发电技术得到了更多的开发为有效的使用这些能源改善电力的输出品质本设计采用了基于 STM32F103C8T6 单片机的单相可调频 220V 逆变电源方案这种设计具有可调节频率和输出电压的特点。数字控制的控制方式为本次设计所采用的控制技术数字控制方式的优势主要体现在结构简单 控制精度高调试方便等这对于本次设计能否实现具有重要意义。本设计从社会实践角度出发对 STM32F103C8T6 单片机 SPWM 单相逆变电源进行了研究设计。首先 本论文提出了该设计的研究背景与研究意义并对目前国内外逆变电源研究现状进行了解和阐述。并且本文对 SPWM 调频技术做了简单描述在此基础上本文对单相逆变电源进行了充分研究和设计并且对硬件系统和软件编写部分进行了详细的分析 最终确定了 SPWM 可调频 220V 逆变电源的设计方案本次设计选择 STM32F103C8T6 单片机作为系统的控制模块。并且介绍了一个集成开发环境即 keil V5分别对 SPWM 产生的过程和其他过程进行了详细的分析。关键词逆变电源SPWMSTM32 单片机控制DESIGN DESCRIPTIONWith the rapid development of science and technology, new energy generation technology has been further developed. In order to effectively use these energy sources and improve the output quality of electricity, this design adopts a single-phase adjustable frequency 220V inverter power supply scheme based on STM32F103C8T6 microcontroller. This design has the characteristics of adjustable frequency and output voltage. The control method of digital control is the control technology adopted in this design. The advantages of digital control mainly lie in its simple structure, high control accuracy, and convenient debugging, which are of great significance for the implementation of this design. This design starts from the perspective of social practice and conducts research and design on the STM32F103C8T6 microcontroller SPWM single-phase inverter power supply. Firstly, this paper presents the research background and significance of this design, and provides an understanding and explanation of the current research status of inverter power sources both domestically and internationally. And this article provides a brief description of SPWM frequency modulation technology. Based on this, this article conducts sufficient research and design on single-phase inverter power supply, and analyzes the hardware system and software writing in detail. Finally, the design scheme of SPWM frequency modulation 220V inverter power supply is determined. In this design, STM32F103C8T6 microcontroller is selected as the control module of the system. And an integrated development environment, keil V5, was introduced, which provided a detailed analysis of the process of SPWM generation and other processes.Keywords:Inverter power supplySPWMSTM32 MCU control1绪论 11.1研究背景和意义 11.2国内外研究现状和发展趋势 12总体设计 22.1设计内容 22.2硬件电路组成及功能描述 33逆变电源原理 43.1逆变的概念 43.2SPWM 原理介绍 43.3SPWM 与 PWM 的区别 53.4SPWM 信号生成方法 54逆变电路拓扑选择 74.1H 桥逆变器和全桥逆变器的比较 74.2拓扑选择的依据 84.3逆变器开关器件选型和特性分析 95硬件电路设计 105.1 STM32F103C8T6 介绍 105.2输出滤波电路设计 115.3输入电路设计 115.4降压电路 125.5 24V 转 12V 电路 135.6 310V 输入电路 145.7液晶显示电路 145.8按键和驱动电路 155.9输出电路 166软件设计 176.1Keil uVision5 集成开发软件的使用 176.2程序流程图 197 调试 207.1电压幅值 207.2频率调制 228 结 论 24参考文献 25致 谢 26附录一 27附录二 42//----------------------------------------------unsignedintT_SinTable[500];unsignedintPWM_Index0;//SPWM 查表索引uint16_tCurrent0;uint16_tIN_Voltage0;uint16_tOUT_Current0;uint16_tOUT_Voltage0;uint16_tOUT_Voltage_Buf[200];uint16_tOUT_Current_Buf[200];uint16_tOUT_VoltageStaticTemp0;uint16_tOUT_CurrentStaticTemp0;uint8_tTimeCount3Flag0;uint8_tTimeCount4Flag0;uint8_tTimeCount5Flag0;uint16_t_voltage0;//暂存值uint8_tPara0;//幅值系数uint8_tVolTemp0;//默认最大值uint16_t PlvTemp50; //默认值uint8_t _voltemp50; //暂存值uint16_t _plvtemp0; //暂存值uint16_t TimeCount0; //用于计时uint16_tTimeCount10;//用于显示计时uint16_t TimeCount30; //用于测量交流电压uint16_t TimeCount410; //用于测量交流电流uint16_t TimeCount550; //用于测量直流电流uint16_t TimeCount20; //用于更新频率和幅值uint8_t ShortFlag0; //过流标志 1 过流//标识uint8_tzf0;//半个周期切换标识uint8_t Value0; //正弦波幅值uint8_t Freq4;// 频率 默认 50hz//----------------------------------------------