【正文】
if(i==7) i=0。 /* /********************************************************/ void motor_rev(uint j) { uchar i=0。 flag=0。 TR1=1。 data_dis()。 if(cout224) cout2=0。 second_dis()。 lcd_wdat(0x20)。\039。 m++。\039。 while(cdis2[m] != 39。 北京理工大學珠海學院 20xx 屆本科生畢業(yè)設(shè)計 29 lcd_pos(0)。 //顯示開,關(guān)光標 delay(5)。 } /********************************************************/ /* /* LCD 初始化設(shè)定 /* /********************************************************/ void lcd_init() { delay(30)。 LCD_RS = 1。 _nop_()。 LCD_EN = 0。為 0 時 ,閑,可寫指令與數(shù)據(jù)。 i++) { } } } /********************************************************/ /* /* 蜂鳴器 /* /********************************************************/ void beep() { uchar j。 uchar code cdis4[ ] = { STOP }。 // T1 發(fā)出脈沖接口 /********************************************************/ /* /* 方位角電機接口定義 /* /********************************************************/ sbit DIR=P3^5。 sbit K6 = P1^5。 /********************************************************/ /* /* 定義電機轉(zhuǎn)動時序 /* /********************************************************/ uchar code FFW[8]={0x1F,0x3F,0x2F,0x6F,0x4F,0xCF,0x8F,0x9F}。 define uchar unsigned char define uint unsigned int define delayNOP()。顯示屏與單片機連接原理圖如圖 83所示。 按鍵 與單片機 輸入 端口及相應(yīng)功能 對應(yīng)關(guān)系 如 表 8— 2所示 。該電路中的核心元件是光敏電阻,它 可以把不同強度光線轉(zhuǎn)化成不同幅值的電壓。 方案 : 綜合電源的質(zhì)量、重量及價格等因素,選用 220V TO 15V 集成電源模塊組作為 15V 直流電源, 5V 是 15V 電源經(jīng) LM7805 線性穩(wěn)壓得到。光照愈強,阻值愈低。改進后的電壓比較器有:滯回比較器和窗口比較器。 力矩 =力 *半徑 力矩與電機有 效體積 *安匝數(shù) *磁密 成正比(只考慮線性狀態(tài)) 因此,電機有效體積越大,勵磁安匝數(shù)越大,定轉(zhuǎn)子間氣隙越小,電機力矩越大,反之亦然。往往采用 AABBBC- CCAA 這種導(dǎo)電狀態(tài),這樣將原來每步 1/3 て改變?yōu)?1/6 て。就是 A,齒 5 就是齒 1) ? 旋轉(zhuǎn): 如 A 相 通電, B, C 相不通電時,由于磁場作用,齒 1 與 A 對齊,(轉(zhuǎn)子不受任何力以下均同)。 步進電機能根據(jù)給定的脈沖信號實現(xiàn)精確的定位控制,而且即使在停止時也有制動轉(zhuǎn)矩,這些特性 全天候跟蹤系統(tǒng)轉(zhuǎn)動 控制都是很有利的。 本系統(tǒng)采用 1602 字符型液晶顯示器 ,圖 1,圖 2,圖 3分別是 1602 的實物,顯示地址, 字符代碼與圖形對應(yīng)圖 。因此,液晶顯示器畫質(zhì)高且不會閃爍。 北京理工大學珠海學院 20xx 屆本科生畢業(yè)設(shè)計 8 89C52 單片機的儲存系統(tǒng) 89C52單片機內(nèi)含有 4K字節(jié)的 Flash 程序存儲器, 128 字節(jié)的片內(nèi) RAM,與80C31內(nèi)部 類似。其主要特點為:采用 Flash 儲存器技術(shù),降低了制造成本;其軟件、硬件與 MCS51 完全兼容,其程序的電可擦特性,使得開發(fā)與試驗比較容易。如圖虛線所包圍的部分相當于一個微控制器 圖 21 單片機的構(gòu)成 微控制器在機器人中完成的主要功能是:首先,把由光傳感器或超聲波傳感器 、無線接收機 取得的信號通過微控制器的輸入端口讀入。因為內(nèi)有 flash 程序存儲器,可以通過編程器十分方便的寫代碼或擦除代碼,擦除次數(shù)達 10000 次以上,而且還提供了禁止讀寫兩層保密技術(shù),其空間大小從 1KB 到 64KB 不等,有的甚至更大。 本課題的研究成功,對創(chuàng)建能源節(jié)約型,環(huán)境友好型社會具有較大的意義,也有較好的市場發(fā)展前景 研究目標、研究內(nèi)容和擬解決的關(guān)鍵問題 ? 研究的目標 本 課題主要是利用單片機知識,設(shè)計一個太陽能全天候跟蹤系統(tǒng),其突破點在對太陽精確位置檢測的系統(tǒng)的設(shè)計、步進電機動作指令系統(tǒng)(與太陽同步偏移 )的設(shè)計、實時顯示系統(tǒng)工作狀態(tài)與人性化時間調(diào)節(jié)的設(shè)計。 ? 定位 步進電機的步進角 , 是太陽跟蹤系統(tǒng)精確定位的 一個基本問題,也可以說,太陽偏移一個微小的角度,步進轉(zhuǎn)動角 度應(yīng)該比太陽偏移角度相等,這就要求步進電機的步進角要足夠小。 I made allweather solar tracking system, the system can track the sun allround, with two degrees of freedom tracking. Through the night or cloudy days, the only one you can track the sun, reliable stability. ATMEL Corporation AT89C52 use of the system control chip, through the op amp device LM354N, LM358 module posed of relatively light on the photosensitive sensor resistance on the intensity and set the parison reference voltage detection, and test results of logical operations, the responsible position angle and elevation angle of the stepping motor control, in order to achieve fulltrack the sun. 1602 LCD Module, Display System on the current work status and time. In the method described in detail the position of the control system structure and working principle. The method uses nine photosensitive resistance on the current ambient light intensity sensor, at different intensity of light, the photosensitive resistor not the same, so the positive parator input voltage is different. If the trackpad is not working on the sun, then the resistance of nine photosensitive not the same, the parator input voltage is not the same, if the input voltage is higher than the set reference voltage, the parator will output a signal to the SCM, SCM parator input signal according to logical operations, and then control the corresponding stepper motor rotation, until 9 photosensitive resistance as light intensity sensor. In an interview with the introduction of single chip control circuit, by taking advantage of its software and hardware resources, the system has superior intelligence, scalability, scalable and easy to operatly weather Genzong the sun provides a reasonable, affordable solutions , a joint trial, the results show that: the system software and hardware design is reasonably practicable, for the followup research foundation. Key words: photosensitive detection elements bined resistance parator module microcontroller (AT89C52) liquid crystal display (1602) 北京理工大學珠海學院 20xx 屆本科生畢業(yè)設(shè)計 2 目 錄 摘要 ?????????????????? ??? ? ? I ABSTRACT ???????????????????? II 1 概論 ? ????? ???????????????? 1 太陽能全天候跟蹤系統(tǒng)發(fā)展現(xiàn)狀 ? ? ?? ??? ???? 1 太陽能全天候跟蹤系統(tǒng)設(shè)計思想 ??? ?? ????? 1 太陽能全天候跟蹤系統(tǒng)研究意義 ?????????? 2 研究目標 .研究內(nèi)容及擬解決關(guān)鍵問題 ??????? 2 2 系統(tǒng)主控制器 ??????????????????? 2 主控制器選用 ? ?????? ?????? ?? ??? 2 控制器介紹 ??? ???????? ?????? ?? 3 2. 3AT89C52???????????????????? 3 3 系統(tǒng)顯示模塊 ??????????????????? 5 顯示模塊選用 ?????????????????? 5 4 驅(qū)動元件 ????????????????????? 7 直流電機與步進電機的比較 ???????????? 7 步進電機控制原理 ???????????????? 7 步進電機正反轉(zhuǎn)控制時序 ??? ???? ? ? ? 8 5 比較器與光敏電阻 ??????????? ?? ??