江渝川 何國斌
摘 要: 過去的基于單片機的大棚溫度控制系統,通過單片機控制溫度模塊、繼電器模塊實現對大棚內溫度的檢測,由于其未采用溫度控制設備,造成溫度控制的振蕩頻率大、響應速率慢的弊端。設計基于物聯網的大棚溫度聯合智能控制系統。其基于物聯網感知層、應用層和網絡層的基礎框架,采用分布式模塊化設計方式設計系統總體架構,總體結構包括溫度采集模塊、網絡傳輸模塊以及遠程控制模塊,三個模塊協同運行實現溫度信號的采集、變換、存儲以及監控。通過聯合智能模糊PID控制器在遠程控制模塊中聯合處理大棚內的溫度信息,聯合智能模糊PID控制器對系統靜態誤差進行實時調整減弱靜態誤差和振蕩頻率,再采用模糊PID算法調整回路輸出結果,控制系統穩定性和響應速率。系統軟件部分采用C5409A XDS510 Emulator仿真器對大棚室內溫度控制的程序進行編寫、接口控制以及編譯連接等操作,共同對程序的編譯進行加載,實現大棚內溫度的自主控制。實驗結果表明,所設系統可顯著提升降低溫度控制時的振蕩頻率和響應用時。
關鍵詞: 物聯網; 聯合智能控制; 大棚溫度控制; 模糊PID控制器; 振蕩頻率降低; 響應用時縮短
中圖分類號: TN915?34; TP277 文獻標識碼: A 文章編號: 1004?373X(2018)18?0084?04
Design of joint intelligent control system based on IoT
JIANG Yuchuan1, HE Guobin2
(1. School of Computer Engineering, Chongqing College of Humanities, Science & Technology, Chongqing 401524, China;
2. School of Computer and Information Science, Southwest University, Chongqing 400715, China)
Abstract: Since the past greenhouse temperature control system based on the single chip microcomputer (SCM) realizes the indoor temperature detection of greenhouse by using the SCM to control the temperature module and relay module, large oscillation frequency and slow response rate of temperature control are caused due to lack of temperature control equipment. Therefore, a greenhouse temperature joint intelligent control system based on Internet of Things (IoT) is designed. On the basis of the IoT foundation framework of the perception layer, application layer and network layer, the overall architecture of the system is designed by adopting the distributed modularized design pattern. The overall structure is composed of the temperature acquisition module, network transmission module and remote control module. The three modules operate coordinately to realize acquisition, transformation, storage and monitoring of temperature signals. The joint intelligent fuzzy PID controller is used to jointly process indoor temperature information of greenhouse in the remote control module, so that the static error of the system is adjusted in real time to reduce the static error and oscillation frequency. The fuzzy PID algorithm is used to adjust the output result of the loop, and control the stability and response rate of the system. For the software part of the system, the C5409A XDS510 Emulator is adopted to perform operations such as program compiling, interface control, and compilation connection for indoor temperature control of greenhouse, so as to cooperatively upload the program compilation, and realize autonomous control of greenhouse temperature. The experimental results show that the designed system can significantly improve the oscillation frequency when the controlled temperature is decreased and shorten the system′s response time.
Keywords: IoT; joint intelligence control; greenhouse temperature control; fuzzy PID controller; oscillation frequency reduction; response time shortening
物聯網技術是近些年發展的高新技術,被廣泛用于各種行業,一些專家學者在物聯網發展的基礎上已經對溫度的控制取得了一些研究成果[1],但對大棚溫度的控制效果不明顯,本文在此基礎上對大棚溫度的控制采取進一步研究。傳統基于單片機的大棚溫度控制系統,通過單片機控制溫度模塊、繼電器模塊實現對大棚內溫度的檢測,由于其未采用溫度控制設備,造成溫度控制的振蕩頻率大、響應速率慢的弊端。面對該問題,本文設計基于物聯網的大棚溫度聯合智能控制系統,以提高大棚溫度控制效果。
1 基于物聯網的大棚溫度聯合智能控制系統
物聯網為由感知層、應用層和網絡層共同構成的基礎性結構框架,不同層次間的功能互不影響,同時數據可以進行互通,屬于工作效率較高的底層結構[2],其架構如圖1所示。
本文系統包括溫度采集模塊、網絡傳輸模塊以及遠程控制模塊三部分[3],三個功能模塊分別與物聯網中的數據感知層、網絡層和應用層相對應[4]。溫度采集模塊中的無線網絡采集器將溫度傳感器獲取的溫度信息由原始的模擬信號轉變為數字信號,再將其傳輸到網絡傳輸模塊后采用GPRS網關對溫度信息進行保護,遠程控制模塊以GPRS網關為連接實現用戶直接對大棚內溫度的控制。
傳輸過程中接口為RS 485,可提高數據傳輸的效率和穩定性[5]。遠程控制模塊以GPRS網關為連接實現用戶直接對大棚內溫度的直接控制,該模塊可以實現用戶對歷史數據的查詢、溫度報警數值設置以及對物聯網應用層提供溫度信息的處理,實現遠程控制。
1.2 聯合智能模糊PID控制器設計
本文系統設計聯合智能模糊PID控制器在遠程控制模塊中處理大棚內的溫度信息。模糊PID控制器在溫度處理過程中極易出現靜態誤差,設計的聯合智能模糊PID控制器在模糊PID控制器的功能基礎上,對靜態誤差進行實時調整,具有減弱靜態誤差和降低振蕩頻率的優勢,對大棚內溫度的穩定起到一定的控制效果。圖3為本文聯合智能模糊PID溫度控制原理圖。
由圖3可知,聯合模糊智能PID控制器能夠對回路輸出結果進行調整[6],提高系統的穩定性和響應速率。聯合智能模糊PID控制器的輸出公式為:
[u(t)=KPe(t)+1TI0te(t)dt+TDde(t)dt] (1)
式中:[u(t)]表示控制器回路的輸出結果;[TI]和[TD]分別為積分系數和微分系數[7];[KP]為比例系數。則經過離散化的輸出結果可表示為:
[u(n)=KPe(n)+TTIi=0ne(i)+TDTe(n)-e(n-1)+ u0=uP(n)+uI(n)+uD(n)+u0] (2)
式中:[uP(n)=KPe(n)]和[uI(n)=KPTTIi=0ne(i)]分別為比例項和積分項。
1.3 軟件實現
本文基于物聯網的大棚溫度聯合智能控制系統軟件的設計基于Visual DSP平臺[8],該平臺可實現系統的硬件編程和軟件仿真。系統軟件部分采用C5409A XDS510 Emulator 仿真器實現對大棚室內溫度控制的程序編寫、接口控制以及編譯連接等操作,對中斷程序[INT0]和[INT3]的執行依靠C5409A Device Simulator仿真環境。將中斷向量的地址[INTM]設為0,[IMR]的中斷相應設為1,即可實現對[INTM]和[IMR]的初始化[9]。基于設置的200個物聯網節點、AODV構建的物聯網通信協議以及RTP/AVP協議配置是大棚溫度智能控制系統信息輸入[10],對程序的編譯實施加載,加載過程如下:
Hurrycase Set up???>
[*]The joint to build for /et
Fogyki/nucroughgkes
[*]vi?stevere to bulid for implementation comsgles
[*]Optionscards major control module
[*]U coupling internet
[*]Fancy all kinds of body first
libraryfreeSs???>
上述過程完成對大棚內溫度的軟件自動控制,系統軟件的實現流程如圖4所示。
2 實驗分析
為驗證本文系統的有效性,對本文基于物聯網的大棚溫度聯合智能控制系統進行測試,實驗采用Simulink線性狀態的空間系統模型構建出一個動態的集成環境,借此對本文系統的有效性進行分析,該動態集成環境如圖5所示。
將大棚溫度的仿真模型輸入到Matlab軟件中,采用本文系統對大棚的溫度進行聯合智能溫度控制,獲取的溫度控制方案用控制矩陣表示。實驗仿真的大棚溫度模型為2階,溫度信號以階躍信號的形式被導入至仿真模型中,模型輸出結果為3個支路,3個支路對應輸出的內容分別為聯合模糊智能PID控制器的超調量、溫度控制響應時間以及溫度控制數據。
圖6為采用本文系統控制的大棚溫度效果曲線,表1為溫度控制效果的對比結果。由于本文系統處理大棚內溫度時同時采用了模糊PID控制器以及聯合智能模糊PID控制器,因此實驗需將模糊PID控制器從中分離出來,便于觀察本文系統設計的聯合智能模糊控制器的性能,控制度計算公式為:
[U=Ts0T00+Ts1T01×0.5] (3)
式中:[Ts0]和[Ts1]表示應用本文系統后大棚內終端的溫度值;[T00]和[T01]為理想的溫度值。對比分析兩個溫度控制終端[T00],[T01]和[Ts0],[Ts1]。
分析圖6和表1可知,本文基于物聯網的大棚溫度聯合智能控制系統可以在較短的時間內對大棚內的溫度進行準確的理想控制,且在溫度控制過程中出現的超調量和振蕩次數較少,結果的可信度較高。從溫度控制用時分析得出,本文系統的聯合智能模糊PID控制器溫度控制用時為0.542 s,而模糊PID控制器的溫控響應用時為4.376 s,超出本文系統的溫控響應用時的8倍。因此可以說明本文系統的溫度控制效果較強。
上述實驗分析的大棚環境條件較粗糙,真實的溫室大棚環境情況非常復雜,實驗將高階數的大棚溫度數據導入模型中,獲取如圖7~圖9所示的聯合智能模糊PID控制的[KP],[KI]和[KD]的暫態特性曲線。
分析圖7~圖9可以看出,采用本文系統進行的大棚溫度的智能控制,溫度控制的響應能力顯著。針對階數高的溫度數據也可以進行穩定控制且沒有出現嚴重的振蕩現象,說明本文系統的實用性較強。
3 結 論
本文設計的基于物聯網的大棚溫度聯合智能控制系統,可顯著提升大棚溫度的控制效果,提升溫度控制的響應能力,增強系統的實用性。
參考文獻
[1] 秦琳琳,陸林箭,石春,等.基于物聯網的溫室智能監控系統設計[J].農業機械學報,2015,46(3):261?267.
QIN Linlin, LU Linjian, SHI Chun, et al. Implementation of IoT?based greenhouse intelligent monitoring system [J]. Transactions of the Chinese Society for Agricultural Machinery, 2015, 46(3): 261?267.
[2] BIN L, PEI C Q, TIAN J S, et al. Design and implementation of the intelligent streak camera control system based on Internet of Things [J]. Acta Photonica Sinica, 2017, 46(5): 52?57.
[3] 辛海亮,鐘佩思,朱紹琦,等.基于ZigBee的物聯網智能家居控制系統[J].電子技術應用,2013,39(12):79?81.
XIN Hailiang, ZHONG Peisi, ZHU Shaoqi, et al. Research of smart home furnishing control system by Internet of Things based on ZigBee [J]. Application of electronic technique, 2013, 39(12): 79?81.
[4] 苗鳳娟,高玉峰,陶佰睿,等.基于物聯網與太陽能光伏的智能溫室監控系統設計[J].科技通報,2016,32(9):89?92.
MIAO Fengjuan, GAO Yufeng, TAO Bairui, et al. Design of modern agricultural greenhouse monitoring system based on the Internet of Things and the solar photovoltaic [J]. Bulletin of science and technology, 2016, 32(9): 89?92.
[5] 李和平,陳育新.基于物聯網的礦井智能巡檢機器人控制系統設計[J].機床與液壓,2015,43(11):119?122.
LI Heping, CHEN Yuxin. Design of control system of intelligent mine patrol robot based on Internet of Things [J]. Machine tool & hydraulics, 2015, 43(11): 119?122.
[6] 劉屹,石博強,譚章祿.基于物聯網的煤炭智能裝車系統設計[J].煤炭技術,2015,34(7):226?228.
LIU Yi, SHI Boqiang, TAN Zhanglu. Design of intelligent coal loading system based on Internet of Things [J]. Coal technology, 2015, 34(7): 226?228.
[7] LI Z, WANG J, HIGGS R, et al. Design of an intelligent management system for agricultural greenhouses based on the Internet of Things [C]// Proceedings of IEEE International Conference on Computational Science and Engineering. Guangzhou: IEEE, 2017: 154?160.
[8] CHEN L. Design and implementation of remote control intelligent home system based on Internet of Things [J]. Journal of Shandong Agricultural University (Natural science edition), 2016, 38(1): 265?270.
[9] 鄭麗娜.基于物聯網的電源智能監控系統設計[J].電源技術,2017,41(3):493?494.
ZHENG Lina. Intelligent monitoring system of power based on Internet of Things [J]. Chinese journal of power sources, 2017, 41(3): 493?494.
[10] 孫媛.差異物聯網設備下的數據分發模型仿真分析[J].計算機仿真,2016,33(3):243?246.
SUN Yuan. Simulation and analysis of data distribution model under difference Internet of Things equipment [J]. Computer simulation, 2016, 33(3): 243?246.