本科毕业论文-基于单片机的太阳能寻光系统的设计.doc_第1页
本科毕业论文-基于单片机的太阳能寻光系统的设计.doc_第2页
本科毕业论文-基于单片机的太阳能寻光系统的设计.doc_第3页
本科毕业论文-基于单片机的太阳能寻光系统的设计.doc_第4页
本科毕业论文-基于单片机的太阳能寻光系统的设计.doc_第5页
已阅读5页,还剩14页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

黑龙江农业经济职业学院机电工程系毕业论文黑龙江农业经济职业学院毕业论文基于单片机的太阳能寻光系统的设计姓 名: 指导教师: 专 业: 新能源应用技术 班 级: 2014年10月26日目 录摘 要1前 言21 系统方案设计32 模块方案设计 32.1 主控模块32.2 寻光模块32.3 舵机模块32.4 电源模块33 系统硬件设计43.1 供电电路设计43.2 主控电路设计43.3 寻光电路设计54 系统软件设计54.1 主要程序段概述54.1.1 主程序概述54.1.2 寻光程序逻辑判断程序54.1.3 内置PWM控制舵机程序65 系统程序流程图65.1 整体程序流程图65.2 模拟太阳能电池板追光流程图76 实物展示77 测试与测试9结 论10参考文献11致 谢12附 录13基于单片机的太阳能寻光系统的设计摘 要: 本系统的设计基于单片机对于太阳能电池板的寻光的应用。将模拟太阳能电池板固定在舵机的转臂上,光敏电阻位于模拟太阳能电池板五个方向分布,模拟太阳的东升西落规律,对不同角度的光强进行采集。采用STC单片机作为整套设计系统的主控核心,对光敏电阻采集到的光强信息进行分析处理,从而控制舵机转动,使太阳能电池板始终对准光强最大的方向,保证了太阳能电池板最大效率的采集吸收电能过程。关键词:单片机,太阳能电池板,光敏电阻,舵机,寻光前 言现今社会,在世界范围内,能源主要是石油,但是其供求严重失衡,价格暴涨,影响和波及世界各地的经济发展,给世界经济发展带来极大风险的情况,并且石油能源对环境的污染十分严重。在这样的恶劣环境下,开发其它新型无污染的能源是必然趋势,太阳能就是一种非常符合世界可持续发展的新型能源,它的存储丰富,无污染,但是由于社会科学技术的限制,对太阳能的开发利用效率和范围都不理想,让无穷无尽的太阳能随着时间流逝。为了更高效的开发利用太阳能,本设计系统遵循太阳东起西落的规律,太阳能正射时候的光强最大,意味着此时光能量越大,系统中用于采集吸收太阳能的太阳能电池板将随着太阳在时刻移动,使得太阳能电池板能够始终对准太阳的方向,这样在白天有阳光的情况下,太阳能电池板吸收的光能就最大化。 下面就是设计与制作的过程。 1.系统方案设计本设计是基于单片机对于太阳能电池板的寻光系统的应用。其数据处理和智能控制的核心芯片就是单片机,针对于所需功能,此处采用STC系列单片机,利用光敏电阻特性完成光信号的采集,采集到的数据发送给单片机,单片机经过数据处理,将处理的结果通过舵机转动的角度来反映。单片机能够根据光敏电阻采集的数据可以判断光信号最强的方向,来控制舵机转动将模拟太阳能电池板偏向光强最强的方向。总体框图如图1所示。电源模块 供电 供电供电 模拟太阳能电池板 主控模块单片机STC89C52(处理.控制)寻光模块舵机模块 图1 系统总体框图2. 模块方案设计 2.1 主控模块采用STC单片机作为控制芯片,其处理速度快、应用简单,性价比高;并且有内置的PWM波和AD转换,这样利用此单片机的PWM波来实现舵机的伺服控制就很简单。 2.2 寻光模块 采用光敏电阻检测光源。由于光敏电阻的本身特性,其接受光照面电阻的阻值变化,有光和无光对于电阻的阻值大小起一定作用,在硬件实现上,采用5个光敏电阻,成圆周分布,来探测光源的方向。 2.3 舵机模块 本设计系统中,模拟太阳能板固定在舵机的机臂上,单片机通过控制舵机摆动来带动太阳能电池板偏转,使其能够准确的对准光照最强的方向。 2.4 电源模块 本系统的电源主要分成两部分组成:主控部分和转动部分。为了防止系统的稳定性,故采用了双电源模式,利用可充电锂电池作为主控部分的供电电源;模拟太阳能电池板转动的电能由另外一个电源提供。3.系统的硬件设计 3.1供电电路设计由于此系统用于户外光能采集,供电电源应采用独立电源最为适宜。另外考虑本控制模块与舵机的工作电压为5V单电源,故此系统采用了三端稳压芯片L7805将锂电池的7.2V直流电稳压成DC5V,电路图如图2所示。 图2 DC5V稳压电源电路原理图3.2 主控电路设计主控电路主要是型号为STC89C52的单片机,此款单片机是STC系列中最为常用的一种,功能多,实用性能高。由于本系统中要控制舵机偏转来保证模拟太阳能电池板始终对准光源方向,但是舵机的控制是通过PWM波实现的,恰好STC单片机内部自带PWM功能,这样舵机控制部分就不需要外围电路,使得整体电路简单易行。并且STC单片机功能多,处理速度快。控制模块的电路原理图如图3所示,主要包括单片机、晶振电路、复位电路以及各个控制引脚。晶振电路单片机复位电路 图3 控制模块电路原理图 3.3 寻光电路设计寻光电路主要利用光敏电阻的光特性实现对光源的检测。其电路原理图见图4所示。 图4 寻光电路原理图 4.系统的软件设计4.1主要程序段概述4.1.1 主程序 void main() /主程序 主程序就是本设计系统的软件核心,来控制系统正常运作。主程序主要由各个子程序合理组合搭配构成的,它能够统一调用子程序,控制硬件电路,实现整体功能。任何一个软件都仅有一个主程序,它相当于系统的心脏,缺它不可。4.1.2 寻光信号逻辑判断程序uchar guang_scan() /寻光信号逻辑判断程序 switch(i) /逻辑判断 case . 寻光信号逻辑判断程序主要采用了“switchcase”多条件选择语句,此程序利用“switchcase”语句主要用于选择判断光照信号的方位,以便于控制太阳能电池板能够及时准确地对准太阳,实现最大光能采集,以获取更多的电能用于实际生活生产。4.1.3 内置PWM控制舵机程序void port_init(void) / 单片机IO口定义程序 void timer0_init(void) /时钟初始化程序 void devices_init (void) /电机初始化程序 void delay_short(uint t) / 短延時 void PWM(void) /PWM波控制程序 PWM是一种对模拟信号电平进行数字编码的方法。通过高分辨率计数器的使用,方波的占空比被调制用来对一个具体模拟信号的电平进行编码。PWM信号仍然是数字的,因为在给定的任何时刻,满幅值的直流供电要么完全有(ON),要么完全无(OFF)。电压或电流源是以一种通(ON)或断(OFF)的重复脉冲序列被加到模拟负载上去的。通的时候即是直流供电被加到负载上的时候,断的时候即是供电被断开的时候。只要带宽足够,任何模拟值都可以使用PWM进行编码。6 许多微控制器内部都包含有PWM控制器,本系统利用了STC单片机内置PWM波控制舵机偏转。可以选择接通时间和周期,占空比是接通时间与周期之比;调制频率为周期的倒数。使用PWM的一个优点是从处理器到被控系统信号都是数字形式的,无需进行数模转换。让信号保持为数字形式可将噪声影响降到最小。噪声只有在强到足以将逻辑1改变为逻辑0或将逻辑0改变为逻辑1时,也才能对数字信号产生影响。 对噪声抵抗能力的增强是PWM相对于模拟控制的另外一个优点,而且这也是在某些时候将PWM用于通信的主要原因。从模拟信号转向PWM可以极大地延长通信距离。在接收端,通过适当的RC或LC网络可以滤除调制高频方波并将信号还原为模拟形式。 总之,PWM既经济、节约空间、抗噪性能强。 5.系统程序流程图 5.1 整体程序流程图如图5所示。开始 初始化寻光延时延时判断光强方向舵机偏转不动作 方向改变方向不变 停止 无光照 图5 整体程序流程图5.2 模拟太阳能电池板追光流程图开始如图6所示寻光PC0=0PC0=0PC0=0PC0=0PC0=023542354235423542354 图6 太阳能电池板追光流程图6. 实物展示实物展示包括整体实物展示和各模块实物展示介绍,以下实物图皆拍摄于室内。 图7 系统整体实物展示 图8 舵机模块 图9 供电模块 图10 主控模块 图11 寻光模块7.测试与调试电路测试:利用万用表检测电路,检查电路中是否存在短路或断路,发现问题逐个解决;电路在无输入状态下检查正常时,利用锂电池给电路供电,给予不同角度的光源照射,通过示波器观察单片机PWM波形输出是否正常。在一切准备工作都正常就绪的情况下,在特殊环境下测试寻光源模块能否正常工作,测试过程中记录数据,最后根据测试结果,调整电路性能。模拟测试:利用白炽灯模拟太阳,通过改变白炽灯方向和位置,观察太阳能电池板的动作,与理论情况比较,以便完善程序。同时对太阳能电池板的转动时间定时,记录规定时间内,模拟太阳能电池板转动的角度,与相同时间,太阳能电池板不寻光进行比较,从而判断太阳能板寻光转动的效率。调试:调试工作是个精细的工作。在调试过程中,有些问题是芯片本身损坏引起的,有的时候也是因为焊接问题引起的。因此,排查过程需要显示电路不稳定的问题要特别的耐心,通过对芯片功能的校验,对焊点逐个检查,最后排查出问题所在,当发现问题并解决问题后,系统电路板即可以正常实现其功能。结 论结合当今社会的发展现状,能源危机越来越严重,太阳能作为一种绿色、环保、可再生的能源,越来越受到人们的青睐,一系列太阳能产品相继问世。但是遗憾的是,太阳是在时刻运转的,然而太阳能电池板却只能固定角度采光,这样使得大量光能流失浪费了。本系统基于获得更多的太阳能,设计了太阳能板能够自动寻光追光装置,能够在相同环境下,采集更多的光能。并且实验证明,寻光系统是可行的,如果在电路设计和安装工艺上能够再加改善,效果还是很理想的。此系统在设计和调试过程中,出现了很多错误和缺陷,或者是由于程序不精确,导致实验调试时,系统稳定性差,效果不理想。通过此次设计,发现不论是硬件设计还是编写程序,都需要进行缜密分析,把握整套系统的工作状态。还要进行多次实验调试,记录数据以便分析。一个完善的系统是多次调试的结晶。参考文献1 百度文库. /view/d2603a128e9951e79b892772.html,2008-1.2 李文方.单片机原理与应用M.哈尔滨: 工业大学出版社,2010-8-1.3 百度百科./view/7928861.htm?fr=aladdin,2011-9-1.4 百度百科./view/4202585.htm?fr=aladdin,2009,03.5 百度文库./view/25ed6b63e87101f69f319508.html,2007-6-1.6 王久和.电压型PWM整流器的非线性控制M.北京:机械工业出版社2010-9-1.致 谢这次毕业设计得到了很多人的帮助,其中魏炜老师对我的关心和支持尤为重要,每次遇到难题,我首先想到的就是向魏老师寻求帮助。另外,他严谨的作风使我的论文即使在谨小细微处也给予了纠正,让我的论文无论是结构还是内容变得更加公整、紧凑,感谢魏老师对我的悉心指导。感谢校方给予我这样一次机会,能够独立地完成这样一个设计,作为检验这些年来学习的成果,在这个过程当中,学校给予我们各种方便,使我们在即将离校的最后一段时间里,能够更多学习一些实践应用知识,增强了我们实践操作和动手应用能力,提高了独立思考的能力。再一次对我的母校表示感谢。感谢在整个毕业设计期间和我密切合作的同学,和曾经在各个方面给予过我帮助的伙伴们,正是因为有了你们的帮助,才让我不仅学到了本次课题所涉及的新知识,更让我感觉到了知识以外的东西,那就是团结的力量。附 录#include#include#define uchar unsigned char#define uint unsigned int1寻光信号判断程序:uchar guang_scan() PORTC=i; switch(i) case 0xFE: guang=0x0;case 0xFD: guang =0x1;case 0xFB: guang =0x2;case 0XF7: guang =0x3;case 0xDF: guang =0x4;case 0xBF: guang =0x5;case 0x7F: guang =0x6; else guang =0x7;return guang; 2内置PWM控制舵机程序:void port_init(void) / I/O口定义函数 PORTA = 0x00; DDRA = 0x00; PORTB = BIT(PB3); DDRB = BIT(PB3); PORTC = 0x00; /m103 output onlyDDRC = 0x00; PORTD = 0x00; DDRD = 0x00; void timer0_init(void) / 定时器初始化函数 TCCR0 = 0x00; /stop TCNT0 = 0x01; /set count OCR0? = 0xFF; /set compare TCCR0 = 0x62; /start timer ; 相位修正, 8分頻 void devices_init (void) / 舵机控制初始化程序 CLI(); /disable all interrupts? port_init(); timer0_init(); MCUCR = 0x00; GICR = 0x00; TIMSK = 0x00; /timer interrupt sources? SEI(); /re-enable interrupts? void delay_short(uint t) / 短延时 uint i; for (i=0;it;i+); void PWM(void) / PWM波控制程序uchar guang, OCR0_V; init_devices();OCR0_V = 0xff; while(1) switch(guang) case 0x0: OCR0_V =-90;OCR0 = OCR0_V; ; case 0x1: OCR0_V = -60; OCR0 = OCR0_V; ; case 0x2: OCR0_V =-30; OCR0 = OCR0_V; ; case 0x3: OCR0_V =0; OCR0 = OCR0_V; ; case 0x4: OCR0_V =30; OCR0 = OCR0_V; ; case 0x5: OCR0_V =60; OCR0 = OCR0_V; ; case 0x6: OCR0_V =90; OCR0 = OCR0_V; ;您好,为你提供优秀的毕业论文参考资料,请您删除以下内容,O(_)O谢谢!A large group of tea merchants on camels and horses from Northwest Chinas Shaanxi province pass through a stop on the ancient Silk Road, Gansus Zhangye city during their journey to Kazakhstan, May 5, 2015. The caravan, consisting of more than 100 camels, three horse-drawn carriages and four support vehicles, started the trip from Jingyang county in Shaanxi on Sept 19, 2014. It will pass through Gansu province and Xinjiang Uygur autonomous region, and finally arrive in Almaty, formerly known as Alma-Ata, the largest city in Kazakhstan, and Dungan in Zhambyl province. The trip will cover about 15,000 kilometers and take the caravan more than one year to complete. The caravan is expected to return to Jingyang in March 2016. Then they will come back, carrying specialty products from Kazakhstan A small art troupe founded six decades ago has grown into a household name in the Inner Mongolia autonomous region. In the 1950s, Ulan Muqir Art Troupe was created by nine young musicians, who toured remote villages on horses and performed traditional Mongolian music and dances for nomadic families. The 54-year-old was born in Tongliao, in eastern Inner Mongolia and joined the troupe in 1975.He says there are 74 branch troupes across Inner Mongolia and actors give around 100 shows every year to local nomadic people. I can still recall the days when I toured with the troupe in the early 80s. We sat on the back of pickup trucks for hours. The sky was blue, and we couldnt help but sing the folk songs, Nasun says. The vastness of Inner Mongolia and the lack of entertainment options for people living there, made their lives lonely. The nomadic people were very excited about our visits, Nasun recalls. We didnt have a formal stage. The audience just sat on the grass. Usually, the performances became a big party with local people joining in. For him, the rewarding part about touring isnt just about sharing art with nomadic families but also about gaining inspiration for the music and dance. Ulan Muqir literally translates as red burgeon, and todays performers of the troupe still tour the regions villages and entertain nomadic families, but their fame has spread around the world. On May 16 and 17, nearly 100 singers and dancers from the troupe performed at Beijings Poly Theater. Their show, titled Ulan Muqir on the Grassland, depicted the history and development of the art troupe. Being from the region allowed me to embrace the culture of Inner Mongolia and being a member of the troupe showed me where I belonged, Nasun, the art troupes president, who is also a renowned tenor, tells China Daily. During a tour in 1985, he went to a village and met an elderly local man, who told him a story about his friendship with a solider from Shenyang, capital of Northeast Chinas Liaoning province, decades ago. The solider gave the old man a handmade saddle when they bid farewell. The story inspired Nasun to write Carved Saddle, a song that later became one of his most popular numbers. Now, every year, Nasun recruits young singers and dancers for the troupe. The troupe has also designed a new repertoire, which is mostly based on the daily lives of Mongolian people, especially the lives of nomadic families, and has combined contemporary musical elements with folk songs of the region. Haimu, a 25-year-old khoomei (a local variant of overtone singing) singer, joined the troupe three years ago. Along with a six-member band, he performs fast songs and soft ones that he writesall while playing the horse-head fiddle.Although I learned the piano since childhood and grew up listening to various kinds of music, to me, the folk music of Inner Mongolia is the root, he says. Performing in remote villages is pleasant. I feel at home on the boundless grasslands, and the warm people there make me feel fulfilled. The first round of spring auction season in Beijing ended last week, but it failed to create much spring in the art market. Although two pieces of Chinese painting fetched more than 100 million yuan, the decline in trading volume and sale rate showed a downturn this year. In the “Grand View: Chinese Painting Highlight” session at China Guardian 2015 spring auctions, Pan Tianshous representative work Eagle, Rock and Flora hit a record auction price of 279 million yuan, while Li Kerans masterwork Jinggang Mountain fetched 126.5 million yuan, an unexpected high in recent years. However, the trading volume fells to 1.87 billion yuan from 2.22 billion yuan in the same period the year before. The Huangchen 2015 Spring Auctions, which recorded 42.5 million yuan in total sales, experienced the same. The section number went down to 5 from 12 compared to last year. According to expert Shao Jianwu, the art market did not attract much excitement this year due to the booming stock market and the persistent problems of forgery and fake deals. The two pieces of Chinese painting notched up high price this spring due to their own value not due to a revival in the market. The successful transaction of two works with a hammer price of more than 100 million yuan once again confirms that valuable and rare works of high quality always earn the long-lasting high price. Chinese painting and calligraphy is still the pillar of the market. However, the overall sales rate has dropped slightly, which reflects the demand for the ordinary auction goods has weakened,” said the president of China Guardians Hu Yanyan. Besides, the entry of new buyers also makes certain changes to the direction of purchasing. In a word, the overall market trend is very unpredictable. Although China Guardian 2015 Spring Auctions has achieved remarkable results, it does not mean that the market has walked out of the predicament. We still have to wait for the big economic boom to invigorate the art market.” Even so, the hot pursuit of some special items appeared this spring. A special session of China Guardian Spring Auctions titled “Fine GiltBronze Buddhist Images” achieved a great deal with total sales volume of 41.89 million yuan and 92 percent sale rate. The 5th Shamar Rinpoche Statue from 16-17th century of Tibet was sold for 5.06 million yuan. The Beijing Chengxuan Auctions featured almost 2,800 items of coins and stamps in three sessions with good sale rate. The Huachen Auctions also set a special session of photographs under the condition of large-scale decline of auction sessions. There was a palpable dull thud of disappointment that accompanied the return of the imperial entourage of Zhen Huan to her homeland. It followed a couple years of hushed excitement as Chinese fans were fed tidbits about their proud concubine who was supposed to conquer the high ground of the North American market. Zhen Huan is, of course, the title character of The Legend of Zhen Huan, a 2011 television series that swept China off its feet and later took other Asian countries by storm. Two years ago, it was reported that HBO, a premium cable service headquartered in the United States, was going to air it in North America after some modification. Now, a condensed version that provides English subtitles but no dubbing has finally been made available on Netflix for online streaming. This version, highly anticipated as a milestone in Chinas cultural foray overseas, has been widely panned by its home audience. Retitled Empresses in the Palace, the American version has been shortened from its original 76 episodes at 45 minutes each, to six 90-minute episodes. The quick pacing threw off many native viewers, who are accustomed to a more leisurely daytime-soap-style narrative rhythm. (Chinese TV stations would run two or three episodes every day.) I did not finish the full-length version and found the truncated one not difficult to follow. Whats lost, I believe, are the interesting setups and pauses that illuminate the Chinese art of storytelling. Much of the plot is still there. It is the flavor that was sacrificed. The American edition uses the framework of the Empress Dowager in her senior years reminiscing at the beginning and the end of each episode, hinting at whats to come and recapping the key points. This device, not used in the original, is culturally understandable but artistically mediocre. What puzzles me is the two new songs for the opening and end credits. They were written in English, but sung by Chinese with an uncomfortable accent. They were obviously designed to appeal to an English-speaking base, but do not jibe with the Chinese dialogue. Speaking of the dialogue, the English translation, picked apart by some Chinese, is too literal for my taste. I can imagine a typical American hit by a flurry of royal ranks, addresses and greetings, even multiple names and titles for the same person. The first half hour must be a swamp to wade through, very much like my experience of getting through a Tolstoy tome with its endless inflections of names transliterated into lengthy Chinese. I see the choice of verbatim translation as an effort for conveying exotica. It is fairly competent, with no error that I could detect, but fails to rise above words or capture the essence of the language. A cultural product usually crosses over to a foreign territory first by an emphasis on the commonalities. But whether inside or outside China, the temptation to sell it for the differences is just too great. Sure, the sumptuous sets and costumes are a big attraction, but the narrative technique has becomehow shall I put it?a bit anglicized, which is necessary for cultural export. Judging by the responses, this legend, which, contrary to the claim of the English trailer, is totally fictitious, has departed from China but not yet landed on American shores. I am a big fan of Ralph Waldo Emersons essay titled Self-Reliance. If youve not yet read it, I strongly encourage you to do so. In this essay, the venerable Emerson talks about eschewing the trappings of society and finding ones own path. He urges the reader to find rectitude and lead a moral life. He professes that, only by being self reliant, as opposed to relying on the government and being dictated to by society, can one begin leading a decent and purposeful life. He avers that such a life is the only life worth living. I agree with him.

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论