freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內容

基于pid控制的電熱恒溫水壺(編輯修改稿)

2025-07-15 17:19 本頁面
 

【文章內容簡介】 DS18B20模塊如下,采用4X4矩陣鍵盤接單片機P1口,DS18B20模塊對水溫進行采樣,并與單片機通訊來實現(xiàn)對水溫的控制。 本系統(tǒng)采用的是循環(huán)查詢方式,來顯示和控制溫度的。: (1)主函數(shù)如下:include include includeincludeincludeincludevoid PIDBEGIN(void)。 // PID參數(shù)初始化// void main(){ unsigned char key1=0,i,k。 unsigned int tmp。 unsigned char shu[3]={13,13,0}。 unsigned char counter=0。 PIDBEGIN()。 while(1){ if(counter == 0) { tmp = ReadTemperature()。 counter = 20。 } view(tmp)。 //溫度顯示; pare_temper()。 } }(2) PID算法溫度控制程序ifndef _PID_H__define _PID_H__include include include struct PID { unsigned int SetPoint。 // 設定目標 Desired Value unsigned int Proportion。 // 比例常數(shù) Proportional Const unsigned int Integral。 // 積分常數(shù) Integral Const unsigned int Derivative。 // 微分常數(shù) Derivative Const unsigned int LastError。 // Error[1] unsigned int PrevError。 // Error[2] unsigned int SumError。 // Sums of Errors } struct PID spid。 // PID Control Structure unsigned int rout。 // PID Response (Output) unsigned int rin。 // PID Feedback (Input) sbit output=P3^4。 unsigned char high_time,low_time,count=0。//占空比調節(jié)參數(shù) unsigned char set_temper=33。 void PIDInit (struct PID *pp) { memset ( pp,0,sizeof(struct PID))。 } unsigned int PIDCalc( struct PID *pp, unsigned int NextPoint ) { unsigned int dError,Error。 Error = ppSetPoint NextPoint。 // 偏差 ppSumError += Error。 // 積分 dError = ppLastError ppPrevError。 // 當前微分 ppPrevError = ppLastError。 ppLastError = Error。 return (ppProportion * Error//比例 + ppIntegral * ppSumError //積分項 + ppDerivative * dError)。 // 微分項 } /*********************************************************** 溫度比較處理子程序 ***********************************************************/ pare_temper() { unsigned char i。 //EA=0。if(set_tempertemper) { if(set_tempertemper1) { high_time=100。 low_time=0。 } else { for(i=0。i10。i++) { get_temper()。 rin = s。 // Read Input rout = PIDCalc ( amp。spid,rin )。 // Perform PID Interat
點擊復制文檔內容
公司管理相關推薦
文庫吧 www.dybbs8.com
備案圖片鄂ICP備17016276號-1