基于STM32的PID和PWM温度控制系统研究
- 格式:pdf
- 大小:262.59 KB
- 文档页数:3
基于STM32单片机的温度控制系统设计一、本文概述本文旨在探讨基于STM32单片机的温度控制系统的设计。
我们将从系统需求分析、硬件设计、软件编程以及系统测试等多个方面进行全面而详细的介绍。
STM32单片机作为一款高性能、低功耗的微控制器,广泛应用于各类嵌入式系统中。
通过STM32单片机实现温度控制,不仅可以精确控制目标温度,而且能够实现系统的智能化和自动化。
本文将介绍如何通过STM32单片机,结合传感器、执行器等硬件设备,构建一套高效、稳定的温度控制系统,以满足不同应用场景的需求。
在本文中,我们将首先分析温度控制系统的基本需求,包括温度范围、精度、稳定性等关键指标。
随后,我们将详细介绍系统的硬件设计,包括STM32单片机的选型、传感器和执行器的选择、电路设计等。
在软件编程方面,我们将介绍如何使用STM32的开发环境进行程序编写,包括温度数据的采集、处理、显示以及控制策略的实现等。
我们将对系统进行测试,以验证其性能和稳定性。
通过本文的阐述,读者可以深入了解基于STM32单片机的温度控制系统的设计过程,掌握相关硬件和软件技术,为实际应用提供有力支持。
本文也为从事嵌入式系统设计和开发的工程师提供了一定的参考和借鉴。
二、系统总体设计基于STM32单片机的温度控制系统设计,主要围绕实现精确的温度监测与控制展开。
系统的总体设计目标是构建一个稳定、可靠且高效的环境温度控制平台,能够实时采集环境温度,并根据预设的温度阈值进行智能调节,以实现对环境温度的精确控制。
在系统总体设计中,我们采用了模块化设计的思想,将整个系统划分为多个功能模块,包括温度采集模块、控制算法模块、执行机构模块以及人机交互模块等。
这样的设计方式不仅提高了系统的可维护性和可扩展性,同时也便于后续的调试与优化。
温度采集模块是系统的感知层,负责实时采集环境温度数据。
我们选用高精度温度传感器作为采集元件,将其与STM32单片机相连,通过ADC(模数转换器)将模拟信号转换为数字信号,供后续处理使用。
5th International Conference on Advanced Materials and Computer Science (ICAMCS 2016)The constant temperature control system design based on STM32 andPID algorithmZhao Xuyang1,a and Yang Hao2,b1School of Zhao Xuyang,,China Jiliang University,Hangzhou 310000,China2School of Yang Hao,China Jiliang University,Hangzhou 310000,Chinaa ,b****************.cnKeywords: PID Algorithm;STM32;semiconductor temperature regulator;constant temperatureAbstract. Time—varying, nonlinear and multivariable coupling are characteristics of temperature. In the temperature control process, the detected temperature is often lags behind the regulation of temperature, which will cause the phenomenon such as the temperature of the controlling system overshoot and temperature oscillation. Temperature control is proposed based on incremental PID algorithm model in this paper, the system uses low-power STM32 as the main chip, DS18B20 digital temperature sensor and semiconductor temperature regulator. Experimental results show that the system can effectively maintain the temperature of the system constant.IntroductionIn natural environment, the system will generate a heat exchange which is difficult to control with the outside world, and produce unpredictable interference.During this situation it will be difficult to achieve in precise temperature controlling. When performing high-precision temperature control, temperature tends to produce overshoot phenomenon [1].Temperature control system with a lag, nonlinear and time-varying characteristics, can not establish a precise mathematical model, therefore, the use of conventional linear control theory can not achieve satisfactory control effect. semiconductor temperature controller working condition have a relationship with heat conditions and the environment factors. its work process is a non-steady state process, it needs to be addressed precisely controlled .PID control theory has a characteristic of convenient parameter setting, flexible structural change, robust and easy to implement [1,2]. the system design using incremental PID algorithm can not only solve the above problems, but also in the unsupervised, for a long time temperature will be automatically collected, automatic controlling of the semiconductor temperature controller achieves heating or cooling function, the system temperature will always be maintained constantly.Using a master chip STM32 and digital temperature sensor DS18B20 design a constant temperature system, the advantages consist of anti-interference digital signal, high sensitivity, fast response, and reasonable controlling of semiconductor temperature regulator,through the whole system design can effectively realize a special case temperature stable. within the setting temperature model of a small area in the design of a system with the column a special case. the result shows that the temperature controlling system of constant small area with very good results after analysis.System hardware designHardware System features modular designDS18B20 digital temperature sensor is placed on both sides of a special case, the datas are directly send to the master chip STM32 so that microchip could obtain temperature value, According to the requirements of the system setting temperature judgment mainly adopts the cooling method in the operation of the semiconductor temperature regulator in regulating or adjust temperature with heating methods . adjusting the way through the PID control algorithm of thetemperature read by the line processing, while the master semiconductor chip STM32 control thermostat-off, so that a special case temperature maintained at a stetted temperature. this system without manual monitoring, and data can be collected via the RS232 serial port and then the observed system temperature curve plotted, by autonomous control system effectively maintained aThe hardware system module functional designSystem functional hardware modules include temperature acquisition module, data display and export module, fan power switch module, semiconductor temperature controller module five modules.Temperature acquisition moduleTemperature acquisition module uses a digital temperature sensor DS18B20, the sensor has high measurement accuracy, the output signal is digital with anti-jamming performance, no front-end data processing module, direct access to the STM32's I / O port , the master chip can directly read data.Data display and export moduleTaking the versatility of the system into account, used in the design is one of the communication interfaces RS232 computer data communication channel, data communication is actually using a USB data format. In this communication stepper can get higher data transfer speeds, true plug and play, it can also make it easy to connect the communication between different devices.When data is displayed using USB to serial cable to the PC, using serial debugging assistant can easily read the temperature data acquisition, and also can import the data into a computer terminal for data storage. Therefore, the use of a standard interface technology can effectively solve the problem of inconsistent communication protocols [4].Fan power switch moduleWhen the semiconductor thermostat is in the cooling operation state, it is important to timely dissipate the heat, otherwise it will make semiconductor refrigeration unnormal. According to the determination of the fan work condition, by the cathode of high and low level control fan switch, the anode is normal power supply connection.This module is controlled by the master chip I / O port output level to control the fan switch purposes.Semiconductor temperature regulator moduleThe core of the temperature control system is semiconductor temperature regulator. The semiconductor temperature regulator reliability is relatively high, while the power supply terminal through the access of different polarity power supply, it can absorb heat and release heat so as to achieve the effect of refrigeration and heating. using this module is characterized by the use of a device can replace separate heating and cooling systems. precise temperature control thermostat semiconductor characteristics to facilitate the composition of automated control systems [1,2]. Figure 2 is a semiconductor temperature control circuit diagram of a switching regulator.Figure 2 Diagram of semiconductor thermostat switch control circuitSoftware system and algorithm designThe system software design process includes temperature digital signal acquisition, temperature display、PID algorithm temperature control 、temperature feedback components. The main part of the PID control algorithm is changing the value of the ambient temperature and after the feedback the temperature regulation value, it ultimately achieve the effect of Steady-State accuracy.PID algorithm designPID algorithm has a simple structure, the robust performance is good, high reliability, easy parameter setting features .P, I, D control law have their own separate areas, performing linear combination constitutes control amount, then the control amount will control objects [5,6].In the control system, a system based on real-time temperature and the set threshold value increment controls semiconductor temperature regulator operation. Therefore, the output portion of the controller is required to control the amount of incremental, in the design of the system is used incremental PID algorithm [7,8]. equation for the incremental PID algorithm is as follows.△u = A • e (k) + B •e (k-1) + C • e (k-2) (1) Where: △u increment control quantity; ratio of A, B, C as PID control, differentiation, integration coefficients; e (k), e (k-1), e (k-2) before and after the three measurements the temperature difference .Precision of the digital temperature sensor DS18B20 can reach ± 0.5 ℃, when setting the thermostat system temperature threshold, typically the change of temperature thermostat system is set within ± 0.5 ℃, partly because the system itself and the temperature sensor error performance limits; on the other hand with a time-varying temperature, constant temperature control need to constantly switch control semiconductor thermostat and fan control to a large extent, this will reduce the life of the instrument, and even burn the instrument.The main process of PID algorithm controller is parameter tuning, tuning in essence is through changing the regulator parameters to match the characteristics of properties and processes in order to improve the dynamic and static index system, so as to achieve the best control effect parameters. in tuning process, the first controller is as a pure proportional controller, form a closed loop, changing the coefficients, so that the coefficient corresponding to the input reaches a critical state (oscillation amplitude). Last in turn introduced differential and integral parameters according to attenuation 1 / 4 obtained, this attenuation can take into account the stability and rapidity.The result of the experiment and analysisReal entire test system shown in Figure 3, including the serial communication section, column oven, control panel and temperature control systems DS18B20, fans, and other semiconductor temperature regulator.Figure 3 System schematic diagramFirst obtaining room temperature, setting the thermostat system defined temperature less than room temperature, then connecting to the PC serial display interface, running the system, it will be observed that the fan is running, the positive power semiconductor thermostat is in cooling state, when the temperature is close to the serial display system the lower limit set temperature, the fan and the temperature of the semiconductor regulators are turned off, followed by heat exchange with the outside of the system will cause the temperature to rise, when the temperature rises to the set temperature limit, the fan is turning and positive power semiconductor in the temperature regulator cooling state, repeating the cooling state maintains the temperature at the set range. Column Compartment closed box is a small area, gathering room temperature is 25.4 ℃, the set temperature for the system is 20 ℃, when the permissible error set upper and lower threshold values were 20.5 ℃ and 19.5 ℃, the temperature control results shown in Figure 4Figure 4 Diagram of temperature controlling effectThe collected data of constant temperature system threshold below room temperature is as table 1. Table 1 Thermostatic system threshold below room temperature data collection formTime Left of box Middle of box Right of box0min 25.2℃ 25.4℃ 25.4℃5min 21.3℃ 20.6℃ 20.9℃10min 19.8℃ 20.1℃ 19.6℃ 20.3℃ 19.8℃ 20.1℃column oven PowersupplyDS18B20theoretical temperature, the blue curve represents the set temperature threshold. The data of Table 1 is collected at the different parts of the column oven temperature on a fixed time interval ,by this set of data can provide data support for the precise control of various parts of the column oven . variation tendency from the red curve show the actual temperature drop is divided into stages and temperature stabilization phase, after 225 seconds the system enter into the temperature stabilization phase. under the control of the incremental PID algorithm, the value of a small area of the temperature and the temperature of the theory has a good agreement, because of the exchange principle of the temperature of the nature result that the actual temperature are some errors in the data, but in the end the system could be stabilized, error is within a controllable range .by the ratio of the critical ratio method tuning PID proportion P, the integral I, differential D parameters, ideal set of data is debugged within surplus overshoot, it will be saw that the overshoot of the actual temperature curve is reduced to 17.5 % .this control process reduces the overshoot and maintain a constant temperature system efficiently and quickly.SummarySmall regional integrated climate control system is made up of a dual data collection, synchronous dual refrigeration heating control systems and incremental PID control algorithm. The algorithm combined with semiconductor temperature controller provides a set of high-precision temperature control system. solutions can effectively reduce outside interference, maintaining the temperature of the entire area of constant temperature changes in real-time monitoring system. this system temperature control effect is obvious, the structure has small size, and is suitable for most stringent temperature requirements systems, as well as the instrument cooling system, can effectively improve the instrument of practical life.AcknowledgmentsThanks to the teacher's guidance and let me join the related projects include science and technology plan projects in Zhejiang province (2015C33009), science and technology plan projects in Jiaxing (2015 AY11008)References[1] Wang Hongjie,Du Jialian,Chen Jincan,Optimization on the Performa-nce Characteristics of a Semiconductor Refrigeration System, J. R-efrigeration,1999,18(4):54-58.[2]Fan Hanbai,Xie hanhua,Semiconductor Refrigerator Temperature Con-trol System with High-precision Based on Thyristor Phase-shifted Control, J. Instrument Technique and Sensor,2012,5:103-105.[3] Cai Jinping,Li Li,The Small Area Temperature Control Model Based on Improved PID Algorithm Simulat, J. Computer Simulation,2015,32(6) :237-240.[4] Ge Leijiao,Mao Yizhi,Li Qi et al,RS232 Serial Interface Communic-ation with the C Language, J. Journal of Hebei University of Tech-nology,2008,37(6):11-16.[5] Xiao Wenjian,Li yongke,Design of Intelligent Vehicle Based on In-cremental PID Control Algorithm, J. Information technology,2012, 10:125-127.[6] Yan Xiaozhao,Zhang Xingguo,Application of Increasing PID Contro-lling Method in Temperature Controlling System, J. Journal of Nan-tong University,2006,5(4):48-51.[7] Wang Shuyan,Shi Yu,Feng Zhongxu et al ,A Method for Controlling a Loading System Based on a Fuzzy PID Controller, J. Mechanical S-cience and Technology for Aerospace Engineering,2011,30(1):166-169.[8] LI Fengman.,The Research of Controlling Arithmetic for Figure PID, J. Journal of Liaoning University,2005,32(4):367-370.。
摘要当前快速成形(RP)技术领域,基于喷射技术的“新一代RP技术”已经取代基于激光技术的“传统的RP技术”成为了主流;快速制造的概念已经提出并得到了广泛地使用。
熔融沉积成型(FDM)就是当前使用最广泛的一种基于喷射技术的RP 技术。
本文主要对FDM温度控制系统进行了深入的分析和研究。
温度测控在食品卫生、医疗化工等工业领域具有广泛的应用。
随着传感器技术、微电子技术、单片机技术的不断发展,为智能温度测控系统测控功能的完善、测控精度的提高和抗干扰能力的增强等提供了条件。
本系统采用的STM32F103C8T6单片机是一高性能的32位机,具有丰富的硬件资源和非常强的抗干扰能力,特别适合构成智能测控仪表和工业测控系统。
本系统对STM32F103C8T6单片机硬件资源进行了开发,采用K型热敏电阻实现对温度信号的检测,充分利用单片机的硬件资源,以非常小的硬件投入,实现了对温度信号的精确检测与控制。
文中首先阐述了温度控制的必要性,温度是工业对象中的主要被控参数之一,在冶金、化工、机械、食品等各类工业中,广泛使用各种加热炉、烘箱、恒温箱等,它们均需对温度进行控制,成型室及喷头温度对成型件精度都有很大影响。
然后详细讲解了所设计的可控硅调功温度控制系统,系统采用STM32F103C8T6单片机作微控制器构建数字温度控制器,调节双向可控硅的导通角,控制电压波形,实现负载两端有效电压可变,以控制加热棒的加热功率,使温度保持在设定值。
系统主要包括:数据的采集,处理,输出,系统和上位机的通讯,人机交互部分。
该系统成本低,精度高,实现方便。
该系统加热器温度控制采用模糊PID控制。
模糊PID控制的采用能够在控制过程中根据预先设定好的控制规律不停地自动调整控制量以使被控系统朝着设定的平衡状态过渡。
关键词:熔融沉积成型(FDM);STM32;温度控制;TCA785AbstractIn the present field of Rapid Prototyping,the "New RP Technology" based on jetting technology is replacing the "Conventional RP Technology" based on laser technology as the mainstream of the Rapid Prototyping Technology.Fused Deposition Modeling(FDM) is the most popular Rapid Prototyping technology based on jetting technology.This paper mainly does research deeply on the temperature control system of FDM system.Temperature controlling is widely to food,sanitation,medical treatment,chemistry and industry.Along with the development of sensor technology,micro-electronics technology and singlechip technolog,brainpower temperature controlling system is perfected,precision of measurement and controlling is enhanced and the ability of anti-jamming is swelled.Singlechip STM32F103C8T6 in this paper is a high-powered 32-bit chip.It has plenty of hardware resource and strong ability foranti-jamming.It is specially suitable for making brainpower measurement instrumentand industry controlling system.The hardware resource of singlechip STM32F103C8T6 is fully exploited in this paper.The tool of temperature test is thermocouple of K style.This system realizes precise measurement and controlling of temperature signal with a little hardware resource.First,the need of temperature control is expounded.Temperature is a main controlparameter in industrial object.Various calefaction stoves,ovens and constant temperature boxes which all need control temperature are widely used in many industry such as metallurgy,chemistry,mechanism and foodstuff.Moulding room and spout temperatureawfully affect the precision of moulding pieces.Then the temperature control systemusing controllable silicon is explain in detail.This system adopts singlechip STM32F103C8T6 which acts as microcontroller.It can regulate the angle of double-direction controllable silicon and control voltage wave shape.So the virtual voltage of load can be changed and the calefaction power of calefaction stick can be controlled.Therefore the temperature canretain the enactment value.This system mainly consists of collection of data,disposal,output,communication of system and computer and communication of human and machine.This system has some advantages such as low cost,high precision andconvenience realization.This system adopts blury PID control.The adoption of blury PID control canceaselessly autoregulates basing initialized control rule,thus the controlled system willmove to the initialized balance state.Key words:Fused Deposition Modeling, STM32, temperature control, TCA785目录摘要.................................................................................................................................. Abstract (I)1 绪论 01.1 FDM工艺原理及应用 01.2 FDM国内外基本研究概况 (1)1.3 课题目的及意义 (2)2 温度控制系统方案分析 (4)2.1 温度控制的必要性 (4)2.2 温度控制系统的理论构成 (4)2.3 STM32和ADC (6)2.4温度控制系统的实现 (8)3 温度控制电路各部分的实现 (10)3.1温度检测电路 (10)3.2加热部分 (16)3.3键盘显示部分 (20)3.4软件部分 (20)3.5通讯总线的研究 (21)4 总结与展望 (23)4.1全文总结 (23)4.2研究展望 (23)致谢 (26)参考文献 (27)1 绪论1.1 FDM工艺原理及应用1.1.1 熔丝沉积技术原理早在十九世纪80年代末,美国学者Scott Crump博士第一次提出一种新的思想,该思想就是熔丝沉积技术的原型。
PID控制应该算是非常古老而且应用非常广泛的控制算法了,小到热水壶温度控制,大到控制无人机的飞行姿态和飞行速度等等。
在电机控制中,PID算法用得尤为常见。
一、位置式PID1.计算公式在电机控制中,我们给电机输出的是一个PWM占空比的数值。
话不多说,直接上位置式PID基本公式:控制流程图如下:上图中的目标位置一般我们可以通过按键或者开关等方式编程实现改变目标值,测量位置就是通过stm32 去采集编码器的数据。
目标位置和测量位置之间作差就是目前系统的偏差。
送入PID 控制器进行计算输出,然后再经过电机驱动的功率放大控制电机的转动去减小偏差,最终达到目标位置的过程。
2.C语言实现如何把我们以上的理论分析和控制原理图使用C 语言写出来呢,这是一个有趣且实用的过程。
位置式PID 具体通过C 语言实现的代码如下:int Position_PID (int Encoder,int Target){static float Bias,Pwm,Integral_bias,Last_Bias;Bias=Target- Encoder; //计算偏差Integral_bias+=Bias; //求出偏差的积分//PID基本公式Pwm=Position_KP*Bias+Position_KI*Integral_bias+Position_KD*(Bias-Last_Bias);Last_Bias=Bias; //保存上一次偏差return Pwm; //输出}入口参数为编码器的位置测量值和位置控制的目标值,返回值为电机控制PWM(现在再看一下上面的控制框图是不是更加容易明白了)。
第一行是相关内部变量的定义。
第二行是求出位置偏差,由测量值减去目标值。
第三行通过累加求出偏差的积分。
第四行使用位置式PID 控制器求出电机PWM。
第五行保存上一次偏差,便于下次调用。
最后一行是返回。
二、增量式PID1.计算公式速度闭环控制就是根据单位时间获取的脉冲数(这里使用了M 法测速)测量电机的速度信息,并与目标值进行比较,得到控制偏差,然后通过对偏差的比例、积分、微分进行控制,使偏差趋向于零的过程。
基于STM32半导体制冷片温控系统的设计【摘要】激光器的工作温度至关重要,该设计用于激光器工作温度调节模块,以提高激光器的稳定性能。
本文以STM32F303为控制芯片,采用TEC为制冷元件,通过采集温度并模数转换传给上位机,上位机程序控制STM32的数模输出控制TEC的加热或制冷,同时以PID算法为基础构建了一套半导体温度调节系统。
实验结果表明,通过PID算法调节,半导体制冷温度控制系统能够为激光器提供所需的工作温度,精度可达到±0.1℃。
【关键词】温度控制;STM32;A/D D/A;PID算法;LabVIEW1.前言温控系统受环境温度影响较大,因为温度调节过程中惯性大,对于温度上升或下降的有效快速调节是难题,目前我们熟知的温控系统都存在成本高或精度低及灵活性差的缺点。
针对这些问题本系统在工作过程中可以随时切换极性,从而完成对设定温度值的精确控制。
2.硬件系统设计本设计通过HX-RS-HSW1204C高精度微型温度变送器连接pt100将采集到的温度传给STM32单片机,STM32将采集到的温度值模数转换后传给上位机显示,并将采集温度值记为sp,将当前温度值sp减去设定值ap后给PID控制器,STM32根据PID的输出信号m(t)进行数模转换并输出给TTC-DS驱动模块,TTC-DS驱动模块控制TEC工作.2.1 测量部分:采用Pt100和HX-RS-HSW1204C高精度微型温度变送器,输出信号是电压信号,其工作电压是±24V,输出是0-5V,对应的温度范围是-40-100℃,温度与电压呈线性关系,,其采集精度可达到0.05℃。
pt100是一种稳定性高和性能良好的温度传感器,工作范围-200℃至650℃。
pt100是电阻式温度检测器,具有正电阻系数,其电阻和温度变化的关系如下:,其中=0.00392,为100(在0℃的电阻值),为摄氏温度[1]。
传感器型变送器通常包含信号转换器与传感器两部分。
基于STM32智能温控箱控制系统的设计智能温控箱控制系统是一种常见的应用于工业控制领域的智能化控制系统。
本文基于STM32单片机,对智能温控箱控制系统进行设计和实现。
一、系统需求分析智能温控箱控制系统需要实现以下功能:1.对温度进行精确测量和控制;2.实时监测温度,并显示在控制面板上;3.能够根据设定的温度进行自动控制,实现温度稳定在设定值附近;4.通过人机界面(HMI)使用者可以对温度设定值、报警温度等进行设置和调整;5.当温度超过设定的报警温度时,能够及时报警;6.提供通讯接口,与上位机或其他设备进行通信,实现远程监控和控制。
二、系统硬件设计1.采用STM32单片机作为主控芯片,具有强大的计算和处理能力;2.温度传感器使用DS18B20数字温度传感器,可以实现对温度的高精度测量;3.控制面板采用LCD显示屏,用于显示温度和参数设置,并提供操作按键;4.报警部分使用蜂鸣器进行报警,并可以通过控制面板上的开关进行开启或关闭。
三、系统软件设计1.硬件初始化:初始化STM32芯片、温度传感器和控制面板;2.温度测量:通过DS18B20传感器读取温度值,并进行数字转换,得到实际温度值;3.温度控制:根据设定的温度值进行控制,通过PID算法控制温度稳定在设定范围内;4.参数设置:通过控制面板上的键盘输入,可以设置温度设定值、报警温度等参数;5.报警检测:检测当前温度是否超过设定的报警温度,若超过则触发报警;6.通讯接口:通过串口或其他通讯方式,实现与上位机或其他设备的数据传输和控制。
四、系统测试和验证搭建好硬件系统后,使用示波器等设备对系统进行测试和验证。
首先测试温度测量功能,将温度传感器放置在不同温度环境下,通过控制面板上的显示屏观察温度值是否准确。
然后测试温度控制功能,设定不同的温度值,观察系统是否能够控制温度稳定在设定范围内。
接着测试参数设置功能,通过控制面板上的键盘输入不同的参数值,并观察系统是否能够正确设置参数。
使用stm32实现电机的pid控制的编程思路实验报告概述及范文模板1. 引言1.1 概述本实验报告旨在介绍使用STM32实现电机的PID控制的编程思路与实验结果。
在工业控制和自动化领域中,PID控制是一种常用且有效的调节方法,它通过测量系统输出与期望输出之间的差异,并根据这个差异来调整系统输入,使系统能够快速、稳定地响应并达到期望的控制效果。
1.2 文章结构本文分为五个部分:引言、PID控制原理、STM32电机控制模块介绍、实验步骤和编程思路以及结论与讨论。
首先,在引言部分将介绍文章背景和目的。
接着,PID控制原理部分将详细解释什么是PID控制以及其作用和优势。
然后,STM32电机控制模块介绍部分将介绍该模块的特点、应用场景,以及硬件配置和接口说明。
紧接着,实验步骤和编程思路部分将详细描述准备工作、硬件连接设置以及PID控制算法的代码实现思路和具体步骤解析。
最后,在结论与讨论部分将对实验结果进行分析与总结,并提出改进建议和未来的展望。
1.3 目的本实验旨在通过对STM32电机控制模块进行编程,实现电机的PID控制。
通过本次实验,我们将学会如何利用STM32进行硬件连接设置、PID控制算法的代码实现以及调试测试过程描述与结果分析等操作。
最终,我们将得到一个稳定、高效且符合预期效果的电机控制系统,并能够对实验过程中遇到的问题提出解决方法和改进建议,为未来进一步改进方向提供指导。
2. PID控制原理:2.1 什么是PID控制:PID控制是一种用于控制系统的常见反馈机制。
其中,PID代表比例(Proportional)、积分(Integral)和微分(Derivative),分别代表了系统对误差的比例响应、累积误差的积分响应和误差变化率的微分响应。
在PID控制中,控制器输出值与设定值之间的误差被计算并用于调整输入信号,以达到减小误差的目标。
通过对比实际输出与期望输出,利用比例、积分和微分三个参数来调整输入信号,实现对系统的稳定性、精度和快速响应的优化。
摘要当前快速成形(RP)技术领域,基于喷射技术的“新一代RP技术”已经取代基于激光技术的“传统的RP技术”成为了主流;快速制造的概念已经提出并得到了广泛地使用。
熔融沉积成型(FDM)就是当前使用最广泛的一种基于喷射技术的RP 技术。
本文主要对FDM温度控制系统进行了深入的分析和研究。
温度测控在食品卫生、医疗化工等工业领域具有广泛的应用。
随着传感器技术、微电子技术、单片机技术的不断发展,为智能温度测控系统测控功能的完善、测控精度的提高和抗干扰能力的增强等提供了条件。
本系统采用的STM32F103C8T6单片机是一高性能的32位机,具有丰富的硬件资源和非常强的抗干扰能力,特别适合构成智能测控仪表和工业测控系统。
本系统对STM32F103C8T6单片机硬件资源进行了开发,采用K型热敏电阻实现对温度信号的检测,充分利用单片机的硬件资源,以非常小的硬件投入,实现了对温度信号的精确检测与控制。
文中首先阐述了温度控制的必要性,温度是工业对象中的主要被控参数之一,在冶金、化工、机械、食品等各类工业中,广泛使用各种加热炉、烘箱、恒温箱等,它们均需对温度进行控制,成型室及喷头温度对成型件精度都有很大影响。
然后详细讲解了所设计的可控硅调功温度控制系统,系统采用STM32F103C8T6单片机作微控制器构建数字温度控制器,调节双向可控硅的导通角,控制电压波形,实现负载两端有效电压可变,以控制加热棒的加热功率,使温度保持在设定值。
系统主要包括:数据的采集,处理,输出,系统和上位机的通讯,人机交互部分。
该系统成本低,精度高,实现方便。
该系统加热器温度控制采用模糊PID控制。
模糊PID控制的采用能够在控制过程中根据预先设定好的控制规律不停地自动调整控制量以使被控系统朝着设定的平衡状态过渡。
关键词:熔融沉积成型(FDM);STM32;温度控制;TCA785AbstractIn the present field of Rapid Prototyping,the "New RP Technology" based on jetting technology is replacing the "Conventional RP Technology" based on laser technology as the mainstream of the Rapid Prototyping Technology.Fused Deposition Modeling(FDM) is the most popular Rapid Prototyping technology based on jetting technology.This paper mainly does research deeply on the temperature control system of FDM system.Temperature controlling is widely to food,sanitation,medical treatment,chemistry and industry.Along with the development of sensor technology,micro-electronics technology and singlechip technolog,brainpower temperature controlling system is perfected,precision of measurement and controlling is enhanced and the ability of anti-jamming is swelled.Singlechip STM32F103C8T6 in this paper is a high-powered 32-bit chip.It has plenty of hardware resource and strong ability foranti-jamming.It is specially suitable for making brainpower measurement instrumentand industry controlling system.The hardware resource of singlechip STM32F103C8T6 is fully exploited in this paper.The tool of temperature test is thermocouple of K style.This system realizes precise measurement and controlling of temperature signal with a little hardware resource.First,the need of temperature control is expounded.Temperature is a main controlparameter in industrial object.Various calefaction stoves,ovens and constant temperature boxes which all need control temperature are widely used in many industry such as metallurgy,chemistry,mechanism and foodstuff.Moulding room and spout temperatureawfully affect the precision of moulding pieces.Then the temperature control systemusing controllable silicon is explain in detail.This system adopts singlechip STM32F103C8T6 which acts as microcontroller.It can regulate the angle of double-direction controllable silicon and control voltage wave shape.So the virtual voltage of load can be changed and the calefaction power of calefaction stick can be controlled.Therefore the temperature canretain the enactment value.This system mainly consists of collection of data,disposal,output,communication of system and computer and communication of human and machine.This system has some advantages such as low cost,high precision andconvenience realization.This system adopts blury PID control.The adoption of blury PID control canceaselessly autoregulates basing initialized control rule,thus the controlled system willmove to the initialized balance state.Key words:Fused Deposition Modeling, STM32, temperature control, TCA785目录摘要.................................................................................................................................. Abstract (I)1 绪论 01.1 FDM工艺原理及应用 01.2 FDM国内外基本研究概况 (1)1.3 课题目的及意义 (2)2 温度控制系统方案分析 (4)2.1 温度控制的必要性 (4)2.2 温度控制系统的理论构成 (4)2.3 STM32和ADC (6)2.4温度控制系统的实现 (8)3 温度控制电路各部分的实现 (10)3.1温度检测电路 (10)3.2加热部分 (16)3.3键盘显示部分 (20)3.4软件部分 (20)3.5通讯总线的研究 (21)4 总结与展望 (23)4.1全文总结 (23)4.2研究展望 (23)致谢 (26)参考文献 (27)1 绪论1.1 FDM工艺原理及应用1.1.1 熔丝沉积技术原理早在十九世纪80年代末,美国学者Scott Crump博士第一次提出一种新的思想,该思想就是熔丝沉积技术的原型。
• 155•本设计采用STM32F103单片机为主控芯片,采用数字型温度传感器DS18B20为温度检测器,采用3.5寸触摸液晶屏显示温度变化曲线以及PID相关参数设置,采用半导体制冷片对散热片加热,散热风扇对散热片散热,系统会根据所设参数控制半导体制冷片和散热风扇的运作。
前言:在工程实际中,应用最为广泛的调节器控制规律为比例、积分、微分控制,简称PID 控制,又称PID 调节。
它以其结构简单、稳定性好、工作可靠、调整方便而成为工业控制的主要技术之一。
温度控制在生活以及工业制造中都发挥着必不可少的作用,工业需要温度测控系统来监控温度,生活中也离不开温度测控系统为我们及时提供温度信息。
虽然只是一个简单的温度控制,却包含了许多知识的运用。
PID 实指“比例proportional ”、“积分integral ”、“微分derivative ”,这三项构成PID 基本要素。
P 代表控制系统的响应速度,越大,响应越快;I 用来积累过去时间内的误差,修正P 无法达到的期望姿态值(静差);D 加强对机体变化的快速响应。
对P 有抑制作用。
PID 各参数的整定需要综合考虑控制系统的各个方面,才能达到最佳效果。
1.总体方案设计图1 系统总体功能框图系统主要功能:(1)触摸液晶屏一方面用于温度恒定值、散热系数、PID 相关参数、温度曲线显示精度的输入;另一方面用于显示所设置的参数、被加热元件散热片的温度随时间变化曲线、当前时间等。
(2)单片机根据设置的参数通过12V 驱动模块控制半导体制冷片实际功率,达到控制半导体制冷片散热片的加热快慢。
(3)单片机根据设置的散热系数通过12V 驱动模块控制散热风扇转速,从而模拟不同情形的降温速度。
(4)单片机通过串口实时发送温度、半导体制冷片加热系数、散热风扇转速。
便于上位机对数据保存和处理。
2.硬件部分2.1 主控芯片单片机作为整个系统的核心部件,决定整个系统的性能。
单片机需要完成的主要功能有:(1)读取温度传感器所采集的温度值。