本(ben)發明專利屬于(yu)迷宮(gong)機(ji)器(qi)人領域,尤(you)其涉及一種基于(yu)freertos的迷宮(gong)機(ji)器(qi)人實時操作控制系統。
背景技術:
1、隨著(zhu)科技水平的(de)(de)(de)(de)(de)進(jin)步與(yu)發(fa)展(zhan)(zhan),移動式(shi)(shi)機(ji)(ji)(ji)(ji)(ji)器(qi)(qi)人(ren)(ren)走(zou)進(jin)大(da)眾(zhong)視野(ye)并豐富人(ren)(ren)們(men)的(de)(de)(de)(de)(de)生(sheng)活(huo),在方便人(ren)(ren)們(men)日(ri)常生(sheng)活(huo)的(de)(de)(de)(de)(de)同時(shi)(shi),機(ji)(ji)(ji)(ji)(ji)器(qi)(qi)人(ren)(ren)競賽(sai)的(de)(de)(de)(de)(de)方式(shi)(shi)也吸引了各大(da)高(gao)校學(xue)(xue)生(sheng)的(de)(de)(de)(de)(de)目光。作為移動式(shi)(shi)機(ji)(ji)(ji)(ji)(ji)器(qi)(qi)人(ren)(ren)的(de)(de)(de)(de)(de)一(yi)個(ge)分支,嵌入式(shi)(shi)迷(mi)(mi)宮(gong)(gong)機(ji)(ji)(ji)(ji)(ji)器(qi)(qi)人(ren)(ren)作為一(yi)種具有(you)“記憶功能(neng)”的(de)(de)(de)(de)(de)競速型機(ji)(ji)(ji)(ji)(ji)器(qi)(qi)人(ren)(ren),因其自身所具備的(de)(de)(de)(de)(de)實(shi)踐與(yu)研究價值,深(shen)受過(guo)國(guo)內外(wai)(wai)研究學(xue)(xue)者的(de)(de)(de)(de)(de)喜愛(ai);迷(mi)(mi)宮(gong)(gong)機(ji)(ji)(ji)(ji)(ji)器(qi)(qi)人(ren)(ren)是多(duo)學(xue)(xue)科交叉的(de)(de)(de)(de)(de)產物,可(ke)在多(duo)個(ge)技術領域對(dui)移動式(shi)(shi)機(ji)(ji)(ji)(ji)(ji)器(qi)(qi)人(ren)(ren)進(jin)行(xing)延伸(shen)與(yu)發(fa)展(zhan)(zhan)。當(dang)前(qian)迷(mi)(mi)宮(gong)(gong)機(ji)(ji)(ji)(ji)(ji)器(qi)(qi)人(ren)(ren)主要出現在國(guo)內外(wai)(wai)迷(mi)(mi)宮(gong)(gong)機(ji)(ji)(ji)(ji)(ji)器(qi)(qi)人(ren)(ren)走(zou)迷(mi)(mi)宮(gong)(gong)比(bi)(bi)賽(sai)當(dang)中,而比(bi)(bi)賽(sai)中由于迷(mi)(mi)宮(gong)(gong)環(huan)境復雜且要求(qiu)迷(mi)(mi)宮(gong)(gong)機(ji)(ji)(ji)(ji)(ji)器(qi)(qi)人(ren)(ren)更(geng)快(kuai)更(geng)穩(wen),就(jiu)需要迷(mi)(mi)宮(gong)(gong)機(ji)(ji)(ji)(ji)(ji)器(qi)(qi)人(ren)(ren)的(de)(de)(de)(de)(de)軟、硬(ying)件開發(fa)環(huan)境達到最(zui)優。當(dang)前(qian)的(de)(de)(de)(de)(de)迷(mi)(mi)宮(gong)(gong)機(ji)(ji)(ji)(ji)(ji)器(qi)(qi)人(ren)(ren)雖(sui)可(ke)以完成比(bi)(bi)賽(sai)任務(wu),但單一(yi)追求(qiu)速度的(de)(de)(de)(de)(de)競賽(sai)任務(wu)逐漸呈現疲態(tai),且當(dang)前(qian)開發(fa)的(de)(de)(de)(de)(de)迷(mi)(mi)宮(gong)(gong)機(ji)(ji)(ji)(ji)(ji)器(qi)(qi)人(ren)(ren)大(da)多(duo)為裸機(ji)(ji)(ji)(ji)(ji)開發(fa),環(huan)境適應(ying)能(neng)力差(cha)、實(shi)時(shi)(shi)性(xing)差(cha)且多(duo)功能(neng)擴展(zhan)(zhan)性(xing)較(jiao)差(cha),不利于迷(mi)(mi)宮(gong)(gong)機(ji)(ji)(ji)(ji)(ji)器(qi)(qi)人(ren)(ren)多(duo)功能(neng)性(xing)擴展(zhan)(zhan)的(de)(de)(de)(de)(de)發(fa)展(zhan)(zhan)趨(qu)勢(shi)。針對(dui)以上背(bei)景,基(ji)于freertos實(shi)時(shi)(shi)操作系統的(de)(de)(de)(de)(de)開發(fa)顯得尤為重要。
技術實現思路
1、針(zhen)對上述問(wen)題,本發明公開(kai)了一(yi)種基于freertos的(de)(de)迷(mi)宮機器人實時(shi)操作(zuo)控(kong)制(zhi)系統,通過將控(kong)制(zhi)系統進(jin)行分層管理,結合freertos的(de)(de)多任務(wu)架構特點,劃分多個獨立任務(wu)并(bing)根據(ju)功能(neng)由相應的(de)(de)硬件(jian)模塊作(zuo)為(wei)支撐來完成(cheng)相應的(de)(de)完整迷(mi)宮任務(wu)。
2、為了實現上述目的(de),本(ben)發明采用(yong)如下(xia)的(de)具體方案:
3、采(cai)用(yong)支(zhi)持(chi)freertos嵌入式實(shi)時(shi)操(cao)作(zuo)(zuo)系(xi)統(tong)運行的(de)stm32f407vgt6內核作(zuo)(zuo)為主(zhu)控(kong)(kong)(kong)制器展開(kai)一(yi)系(xi)列周圍電(dian)路模(mo)塊設(she)計并基(ji)于freertos實(shi)時(shi)操(cao)作(zuo)(zuo)系(xi)統(tong)功能構建出一(yi)個四(si)層(ceng)(ceng)控(kong)(kong)(kong)制系(xi)統(tong)軟(ruan)件(jian)(jian)架構,其中(zhong)包括(kuo):任(ren)(ren)務應(ying)用(yong)層(ceng)(ceng)、操(cao)作(zuo)(zuo)系(xi)統(tong)層(ceng)(ceng)、硬(ying)件(jian)(jian)模(mo)塊層(ceng)(ceng)、硬(ying)件(jian)(jian)驅(qu)動層(ceng)(ceng);主(zhu)控(kong)(kong)(kong)制器按(an)照相應(ying)的(de)調(diao)度算法與任(ren)(ren)務優先(xian)級(ji)大小(xiao)合理(li)分配(pei)cpu的(de)使(shi)(shi)用(yong)權,極大提高(gao)cpu的(de)使(shi)(shi)用(yong)效率(lv),從而對各項任(ren)(ren)務精(jing)準有效調(diao)控(kong)(kong)(kong)。
4、所(suo)述迷(mi)(mi)宮(gong)(gong)機器(qi)人控制系(xi)(xi)統(tong)軟件(jian)架(jia)構采用分(fen)層(ceng)(ceng)(ceng)設計(ji),共分(fen)為4層(ceng)(ceng)(ceng);任務(wu)應用層(ceng)(ceng)(ceng)根(gen)據迷(mi)(mi)宮(gong)(gong)機器(qi)人執行(xing)迷(mi)(mi)宮(gong)(gong)任務(wu)時(shi)的(de)(de)運(yun)行(xing)機制劃分(fen)出各個獨(du)立(li)任務(wu);操作系(xi)(xi)統(tong)層(ceng)(ceng)(ceng)主(zhu)要(yao)采用相(xiang)應的(de)(de)api函數對任務(wu)應用層(ceng)(ceng)(ceng)中的(de)(de)任務(wu)進(jin)行(xing)任務(wu)調(diao)度(du)和任務(wu)同(tong)步;硬(ying)件(jian)模塊層(ceng)(ceng)(ceng)將硬(ying)件(jian)系(xi)(xi)統(tong)模塊化,便于對迷(mi)(mi)宮(gong)(gong)機器(qi)人硬(ying)件(jian)故障信息精確(que)排查(cha);硬(ying)件(jian)驅動層(ceng)(ceng)(ceng)主(zhu)要(yao)對迷(mi)(mi)宮(gong)(gong)機器(qi)人運(yun)行(xing)時(shi)所(suo)需外設進(jin)行(xing)初始化配置(zhi),提供底層(ceng)(ceng)(ceng)硬(ying)件(jian)驅動。
5、進一步(bu)的(de)(de)(de),所述(shu)迷(mi)宮機器(qi)人控制(zhi)系(xi)統軟件架構(gou)的(de)(de)(de)任(ren)務(wu)(wu)(wu)應用(yong)(yong)層主要包括:系(xi)統初始化(hua)任(ren)務(wu)(wu)(wu)、狀態選擇任(ren)務(wu)(wu)(wu)、電(dian)量檢測(ce)任(ren)務(wu)(wu)(wu)、電(dian)源管(guan)理任(ren)務(wu)(wu)(wu)、搜索任(ren)務(wu)(wu)(wu)、普通沖刺(ci)任(ren)務(wu)(wu)(wu)、45度(du)斜向沖刺(ci)任(ren)務(wu)(wu)(wu)、數據(ju)采(cai)(cai)集(ji)與運動控制(zhi)任(ren)務(wu)(wu)(wu);主控制(zhi)器(qi)采(cai)(cai)用(yong)(yong)freertos中的(de)(de)(de)管(guan)理機制(zhi)采(cai)(cai)用(yong)(yong)相應的(de)(de)(de)調度(du)算法合理調度(du)這(zhe)些任(ren)務(wu)(wu)(wu),保證(zheng)系(xi)統的(de)(de)(de)正常運行。
6、進(jin)一步的(de),所述迷宮(gong)機器人控制系統軟件(jian)架構(gou)的(de)操(cao)作系統層主要(yao)包括:任(ren)(ren)(ren)務(wu)(wu)(wu)(wu)(wu)(wu)(wu)(wu)(wu)(wu)調(diao)度、任(ren)(ren)(ren)務(wu)(wu)(wu)(wu)(wu)(wu)(wu)(wu)(wu)(wu)管理(li)、任(ren)(ren)(ren)務(wu)(wu)(wu)(wu)(wu)(wu)(wu)(wu)(wu)(wu)通(tong)信(xin)、內存(cun)管理(li);主控制器通(tong)過相(xiang)(xiang)應的(de)api函數對(dui)各(ge)項任(ren)(ren)(ren)務(wu)(wu)(wu)(wu)(wu)(wu)(wu)(wu)(wu)(wu)進(jin)行(xing)任(ren)(ren)(ren)務(wu)(wu)(wu)(wu)(wu)(wu)(wu)(wu)(wu)(wu)調(diao)度;在對(dui)任(ren)(ren)(ren)務(wu)(wu)(wu)(wu)(wu)(wu)(wu)(wu)(wu)(wu)進(jin)行(xing)管理(li)時,需(xu)要(yao)根據迷宮(gong)機器人執行(xing)迷宮(gong)任(ren)(ren)(ren)務(wu)(wu)(wu)(wu)(wu)(wu)(wu)(wu)(wu)(wu)時的(de)任(ren)(ren)(ren)務(wu)(wu)(wu)(wu)(wu)(wu)(wu)(wu)(wu)(wu)工(gong)作流程來合理(li)分(fen)配(pei)各(ge)項任(ren)(ren)(ren)務(wu)(wu)(wu)(wu)(wu)(wu)(wu)(wu)(wu)(wu)的(de)任(ren)(ren)(ren)務(wu)(wu)(wu)(wu)(wu)(wu)(wu)(wu)(wu)(wu)優先級與堆(dui)棧(zhan)空(kong)間(jian);狀(zhuang)態選擇任(ren)(ren)(ren)務(wu)(wu)(wu)(wu)(wu)(wu)(wu)(wu)(wu)(wu)、搜索(suo)任(ren)(ren)(ren)務(wu)(wu)(wu)(wu)(wu)(wu)(wu)(wu)(wu)(wu)、普通(tong)沖(chong)刺任(ren)(ren)(ren)務(wu)(wu)(wu)(wu)(wu)(wu)(wu)(wu)(wu)(wu)、45度斜向沖(chong)刺任(ren)(ren)(ren)務(wu)(wu)(wu)(wu)(wu)(wu)(wu)(wu)(wu)(wu)之間(jian)需(xu)要(yao)進(jin)行(xing)任(ren)(ren)(ren)務(wu)(wu)(wu)(wu)(wu)(wu)(wu)(wu)(wu)(wu)通(tong)信(xin),電量檢測任(ren)(ren)(ren)務(wu)(wu)(wu)(wu)(wu)(wu)(wu)(wu)(wu)(wu)與電源管理(li)任(ren)(ren)(ren)務(wu)(wu)(wu)(wu)(wu)(wu)(wu)(wu)(wu)(wu)也(ye)需(xu)要(yao)進(jin)行(xing)任(ren)(ren)(ren)務(wu)(wu)(wu)(wu)(wu)(wu)(wu)(wu)(wu)(wu)通(tong)信(xin);在操(cao)作系統中堆(dui)棧(zhan)總(zong)空(kong)間(jian)相(xiang)(xiang)對(dui)有(you)限,若劃(hua)分(fen)多個(ge)任(ren)(ren)(ren)務(wu)(wu)(wu)(wu)(wu)(wu)(wu)(wu)(wu)(wu),則需(xu)要(yao)對(dui)各(ge)個(ge)任(ren)(ren)(ren)務(wu)(wu)(wu)(wu)(wu)(wu)(wu)(wu)(wu)(wu)進(jin)行(xing)內存(cun)管理(li),分(fen)配(pei)合適的(de)堆(dui)棧(zhan)空(kong)間(jian)保證(zheng)各(ge)任(ren)(ren)(ren)務(wu)(wu)(wu)(wu)(wu)(wu)(wu)(wu)(wu)(wu)的(de)有(you)序運行(xing)。
7、進(jin)一步的(de)(de),所述迷(mi)(mi)宮(gong)(gong)機(ji)(ji)器(qi)(qi)(qi)(qi)(qi)人(ren)(ren)控(kong)制系(xi)統軟件架構的(de)(de)硬(ying)件模(mo)(mo)(mo)塊(kuai)層主(zhu)要(yao)包括:紅(hong)外(wai)避障模(mo)(mo)(mo)塊(kuai)、主(zhu)控(kong)制器(qi)(qi)(qi)(qi)(qi)模(mo)(mo)(mo)塊(kuai)、電(dian)(dian)(dian)(dian)機(ji)(ji)控(kong)制模(mo)(mo)(mo)塊(kuai)、角(jiao)度測量模(mo)(mo)(mo)塊(kuai)、電(dian)(dian)(dian)(dian)量檢測模(mo)(mo)(mo)塊(kuai)、供電(dian)(dian)(dian)(dian)管(guan)理模(mo)(mo)(mo)塊(kuai);供電(dian)(dian)(dian)(dian)管(guan)理模(mo)(mo)(mo)塊(kuai)與其余(yu)模(mo)(mo)(mo)塊(kuai)相(xiang)連并(bing)根據不(bu)同(tong)模(mo)(mo)(mo)塊(kuai)所需驅(qu)動電(dian)(dian)(dian)(dian)壓(ya)要(yao)求進(jin)行供電(dian)(dian)(dian)(dian);紅(hong)外(wai)避障模(mo)(mo)(mo)塊(kuai)主(zhu)要(yao)將迷(mi)(mi)宮(gong)(gong)機(ji)(ji)器(qi)(qi)(qi)(qi)(qi)人(ren)(ren)距離障礙物(wu)的(de)(de)位置信息通過a/d轉(zhuan)換(huan)的(de)(de)方式(shi)反饋(kui)(kui)至主(zhu)控(kong)制器(qi)(qi)(qi)(qi)(qi)模(mo)(mo)(mo)塊(kuai);主(zhu)控(kong)制器(qi)(qi)(qi)(qi)(qi)模(mo)(mo)(mo)塊(kuai)控(kong)制各個模(mo)(mo)(mo)塊(kuai)工作并(bing)通過freertos的(de)(de)調度算法進(jin)行任務(wu)調度與任務(wu)同(tong)步;電(dian)(dian)(dian)(dian)機(ji)(ji)控(kong)制模(mo)(mo)(mo)塊(kuai)接(jie)收(shou)來(lai)自主(zhu)控(kong)制器(qi)(qi)(qi)(qi)(qi)模(mo)(mo)(mo)塊(kuai)傳送的(de)(de)速度位置信息對迷(mi)(mi)宮(gong)(gong)機(ji)(ji)器(qi)(qi)(qi)(qi)(qi)人(ren)(ren)進(jin)行相(xiang)應(ying)的(de)(de)直行、左(zuo)轉(zhuan)、右轉(zhuan)、掉頭等指(zhi)令(ling);角(jiao)度測量模(mo)(mo)(mo)塊(kuai)及時將迷(mi)(mi)宮(gong)(gong)機(ji)(ji)器(qi)(qi)(qi)(qi)(qi)人(ren)(ren)轉(zhuan)彎時的(de)(de)角(jiao)度信息通過a/d轉(zhuan)換(huan)的(de)(de)方式(shi)反饋(kui)(kui)至主(zhu)控(kong)制器(qi)(qi)(qi)(qi)(qi)模(mo)(mo)(mo)塊(kuai);電(dian)(dian)(dian)(dian)量檢測模(mo)(mo)(mo)塊(kuai)將當前鋰電(dian)(dian)(dian)(dian)池的(de)(de)電(dian)(dian)(dian)(dian)壓(ya)信息反饋(kui)(kui)至主(zhu)控(kong)制器(qi)(qi)(qi)(qi)(qi)模(mo)(mo)(mo)塊(kuai)。
8、進一步的(de)(de),所述(shu)迷(mi)宮(gong)(gong)機器人(ren)(ren)控制系(xi)統(tong)軟件架構的(de)(de)硬(ying)件驅(qu)動(dong)(dong)層(ceng)主要包括(kuo):led驅(qu)動(dong)(dong)、timer驅(qu)動(dong)(dong)、adc驅(qu)動(dong)(dong)、dma驅(qu)動(dong)(dong)、直(zhi)流電機驅(qu)動(dong)(dong)、紅外傳感器等;這些底層(ceng)驅(qu)動(dong)(dong)設計的(de)(de)優良與合理性直(zhi)接決(jue)定(ding)了迷(mi)宮(gong)(gong)機器人(ren)(ren)的(de)(de)性能(neng)優劣,比如直(zhi)線前進n個單(dan)位迷(mi)宮(gong)(gong)格、定(ding)時(shi)中斷處理任務、adc+dma及時(shi)采集當前所處迷(mi)宮(gong)(gong)格周圍墻壁(bi)距離、左(zuo)右轉彎角度信息等;對于所需硬(ying)件資源全部初始(shi)化才能(neng)保證迷(mi)宮(gong)(gong)機器人(ren)(ren)硬(ying)件模(mo)塊層(ceng)的(de)(de)正常工作。
9、本發(fa)明具(ju)有(you)如下優點和(he)積極(ji)效果:
10、第一:迷(mi)宮(gong)機(ji)器人(ren)在迷(mi)宮(gong)環境中運動需要不(bu)斷通過二階對數擬(ni)合(he)法(fa)和線(xian)性插(cha)值法(fa)計(ji)算(suan)當前距(ju)離迷(mi)宮(gong)格四(si)周墻壁的位(wei)置(zhi)信息,stm32f103系(xi)(xi)列的迷(mi)宮(gong)機(ji)器人(ren)容易(yi)因為(wei)運算(suan)時間不(bu)足導(dao)致轉彎(wan)出(chu)現問題(ti)(ti);采用stm32f407系(xi)(xi)列的迷(mi)宮(gong)機(ji)器人(ren)作(zuo)為(wei)硬件支(zhi)撐并(bing)基于freertos嵌入(ru)式實(shi)時操作(zuo)系(xi)(xi)統(tong),提高(gao)了系(xi)(xi)統(tong)的運行(xing)效(xiao)率,計(ji)算(suan)性能更為(wei)強大,克服了運算(suan)效(xiao)率低的問題(ti)(ti)。
11、第二(er):目(mu)前(qian)迷宮(gong)機器(qi)人單一(yi)追求競速的(de)比賽任務(wu)逐(zhu)漸呈現疲態,未來比賽風格將向多任務(wu)化競賽的(de)方向發(fa)展;基于freertos嵌(qian)入式實(shi)時操(cao)作系(xi)統(tong)的(de)迷宮(gong)機器(qi)人可將當前(qian)迷宮(gong)機器(qi)人的(de)執(zhi)行(xing)任務(wu)劃(hua)分為多個獨立(li)的(de)任務(wu),利用freertos的(de)資源傳遞信息(xi)與任務(wu)同步(bu)特(te)點,保證了迷宮(gong)機器(qi)人系(xi)統(tong)的(de)實(shi)時穩(wen)定性(xing),方便該系(xi)統(tong)后續(xu)多功能擴展性(xing)開(kai)發(fa)工作。
1.一種(zhong)基于(yu)(yu)freertos的迷宮機器人實時操作控制系(xi)統,其特(te)征在(zai)于(yu)(yu)包括:
2.根(gen)據權(quan)利要求(qiu)1所述的(de)(de)控(kong)制系(xi)統(tong),其特征在于(yu)(yu):所述迷宮機器人(ren)(ren)控(kong)制系(xi)統(tong)軟件架(jia)構采用(yong)分(fen)層設計,共分(fen)為4層;任(ren)(ren)(ren)(ren)務(wu)應(ying)用(yong)層根(gen)據迷宮機器人(ren)(ren)執行(xing)迷宮任(ren)(ren)(ren)(ren)務(wu)時(shi)的(de)(de)運(yun)行(xing)機制劃分(fen)出各個獨(du)立任(ren)(ren)(ren)(ren)務(wu);操作(zuo)系(xi)統(tong)層主要采用(yong)相應(ying)的(de)(de)api函(han)數對(dui)任(ren)(ren)(ren)(ren)務(wu)應(ying)用(yong)層中(zhong)的(de)(de)任(ren)(ren)(ren)(ren)務(wu)進行(xing)任(ren)(ren)(ren)(ren)務(wu)調度和任(ren)(ren)(ren)(ren)務(wu)同步(bu);硬件模(mo)塊(kuai)層將硬件系(xi)統(tong)模(mo)塊(kuai)化(hua),便(bian)于(yu)(yu)對(dui)迷宮機器人(ren)(ren)硬件故障信息精確排查;硬件驅(qu)動層主要對(dui)迷宮機器人(ren)(ren)運(yun)行(xing)時(shi)所需外設進行(xing)初始化(hua)配置,提供底(di)層硬件驅(qu)動。
3.根據(ju)權利要求1所述的控(kong)制系(xi)統(tong),其(qi)特征在于:所述迷宮機(ji)器人控(kong)制系(xi)統(tong)軟件架(jia)構的任(ren)務(wu)(wu)(wu)應用(yong)(yong)(yong)層主(zhu)要包括:系(xi)統(tong)初始化(hua)任(ren)務(wu)(wu)(wu)、狀態選(xuan)擇(ze)任(ren)務(wu)(wu)(wu)、電量檢測任(ren)務(wu)(wu)(wu)、電源管(guan)理(li)任(ren)務(wu)(wu)(wu)、搜索任(ren)務(wu)(wu)(wu)、普(pu)通沖刺(ci)任(ren)務(wu)(wu)(wu)、45度(du)斜向沖刺(ci)任(ren)務(wu)(wu)(wu)、數據(ju)采集與運動控(kong)制任(ren)務(wu)(wu)(wu);主(zhu)控(kong)制器采用(yong)(yong)(yong)freertos中(zhong)的管(guan)理(li)機(ji)制采用(yong)(yong)(yong)相應的調度(du)算法(fa)合理(li)調度(du)這(zhe)些任(ren)務(wu)(wu)(wu),保證系(xi)統(tong)的正(zheng)常運行。
4.根據權利要求1所(suo)述的(de)(de)(de)控制系(xi)統(tong)(tong),其特征在(zai)于:所(suo)述迷宮機器(qi)人控制系(xi)統(tong)(tong)軟件架構的(de)(de)(de)操作系(xi)統(tong)(tong)層(ceng)主要包括:任(ren)(ren)(ren)務(wu)(wu)(wu)(wu)(wu)調度、任(ren)(ren)(ren)務(wu)(wu)(wu)(wu)(wu)管(guan)(guan)理(li)、任(ren)(ren)(ren)務(wu)(wu)(wu)(wu)(wu)通(tong)信、內(nei)存管(guan)(guan)理(li);主控制器(qi)通(tong)過(guo)相應的(de)(de)(de)api函數(shu)對各(ge)項任(ren)(ren)(ren)務(wu)(wu)(wu)(wu)(wu)進(jin)行(xing)(xing)任(ren)(ren)(ren)務(wu)(wu)(wu)(wu)(wu)調度;在(zai)對任(ren)(ren)(ren)務(wu)(wu)(wu)(wu)(wu)進(jin)行(xing)(xing)管(guan)(guan)理(li)時,需(xu)要根據迷宮機器(qi)人執行(xing)(xing)迷宮任(ren)(ren)(ren)務(wu)(wu)(wu)(wu)(wu)時的(de)(de)(de)任(ren)(ren)(ren)務(wu)(wu)(wu)(wu)(wu)工作流程來合理(li)分配各(ge)項任(ren)(ren)(ren)務(wu)(wu)(wu)(wu)(wu)的(de)(de)(de)任(ren)(ren)(ren)務(wu)(wu)(wu)(wu)(wu)優先級與(yu)(yu)堆(dui)棧(zhan)空間;狀態選擇任(ren)(ren)(ren)務(wu)(wu)(wu)(wu)(wu)、搜索(suo)任(ren)(ren)(ren)務(wu)(wu)(wu)(wu)(wu)、普通(tong)沖刺(ci)任(ren)(ren)(ren)務(wu)(wu)(wu)(wu)(wu)、45度斜向(xiang)沖刺(ci)任(ren)(ren)(ren)務(wu)(wu)(wu)(wu)(wu)之間需(xu)要進(jin)行(xing)(xing)任(ren)(ren)(ren)務(wu)(wu)(wu)(wu)(wu)通(tong)信,電量檢測(ce)任(ren)(ren)(ren)務(wu)(wu)(wu)(wu)(wu)與(yu)(yu)電源(yuan)管(guan)(guan)理(li)任(ren)(ren)(ren)務(wu)(wu)(wu)(wu)(wu)也(ye)需(xu)要進(jin)行(xing)(xing)任(ren)(ren)(ren)務(wu)(wu)(wu)(wu)(wu)通(tong)信;在(zai)操作系(xi)統(tong)(tong)中堆(dui)棧(zhan)總空間相對有(you)限(xian),若劃分多個任(ren)(ren)(ren)務(wu)(wu)(wu)(wu)(wu),則需(xu)要對各(ge)個任(ren)(ren)(ren)務(wu)(wu)(wu)(wu)(wu)進(jin)行(xing)(xing)內(nei)存管(guan)(guan)理(li),分配合適(shi)的(de)(de)(de)堆(dui)棧(zhan)空間保證各(ge)任(ren)(ren)(ren)務(wu)(wu)(wu)(wu)(wu)的(de)(de)(de)正常有(you)序(xu)運行(xing)(xing)。
5.根(gen)據(ju)權利要(yao)(yao)求1所(suo)述(shu)的(de)(de)(de)控(kong)(kong)(kong)制(zhi)(zhi)(zhi)系統,其特征在于:所(suo)述(shu)迷(mi)宮(gong)(gong)機器(qi)(qi)人控(kong)(kong)(kong)制(zhi)(zhi)(zhi)系統軟件架構(gou)的(de)(de)(de)硬件模(mo)(mo)(mo)塊(kuai)(kuai)(kuai)層(ceng)主要(yao)(yao)包括:紅外避(bi)障模(mo)(mo)(mo)塊(kuai)(kuai)(kuai)、主控(kong)(kong)(kong)制(zhi)(zhi)(zhi)器(qi)(qi)模(mo)(mo)(mo)塊(kuai)(kuai)(kuai)、電(dian)機控(kong)(kong)(kong)制(zhi)(zhi)(zhi)模(mo)(mo)(mo)塊(kuai)(kuai)(kuai)、角(jiao)度(du)(du)測量(liang)(liang)模(mo)(mo)(mo)塊(kuai)(kuai)(kuai)、電(dian)量(liang)(liang)檢測模(mo)(mo)(mo)塊(kuai)(kuai)(kuai)、供電(dian)管(guan)理(li)模(mo)(mo)(mo)塊(kuai)(kuai)(kuai);供電(dian)管(guan)理(li)模(mo)(mo)(mo)塊(kuai)(kuai)(kuai)與(yu)其余模(mo)(mo)(mo)塊(kuai)(kuai)(kuai)相(xiang)(xiang)連(lian)并(bing)根(gen)據(ju)不(bu)同模(mo)(mo)(mo)塊(kuai)(kuai)(kuai)所(suo)需驅動電(dian)壓要(yao)(yao)求進(jin)行(xing)供電(dian);紅外避(bi)障模(mo)(mo)(mo)塊(kuai)(kuai)(kuai)主要(yao)(yao)將迷(mi)宮(gong)(gong)機器(qi)(qi)人距離障礙物的(de)(de)(de)位置信息(xi)通(tong)過(guo)a/d轉(zhuan)(zhuan)換的(de)(de)(de)方式反饋至主控(kong)(kong)(kong)制(zhi)(zhi)(zhi)器(qi)(qi)模(mo)(mo)(mo)塊(kuai)(kuai)(kuai);主控(kong)(kong)(kong)制(zhi)(zhi)(zhi)器(qi)(qi)模(mo)(mo)(mo)塊(kuai)(kuai)(kuai)控(kong)(kong)(kong)制(zhi)(zhi)(zhi)各個模(mo)(mo)(mo)塊(kuai)(kuai)(kuai)工作并(bing)通(tong)過(guo)freertos的(de)(de)(de)調度(du)(du)算法進(jin)行(xing)任務調度(du)(du)與(yu)任務同步;電(dian)機控(kong)(kong)(kong)制(zhi)(zhi)(zhi)模(mo)(mo)(mo)塊(kuai)(kuai)(kuai)接收來自主控(kong)(kong)(kong)制(zhi)(zhi)(zhi)器(qi)(qi)模(mo)(mo)(mo)塊(kuai)(kuai)(kuai)傳送的(de)(de)(de)速度(du)(du)位置信息(xi)對迷(mi)宮(gong)(gong)機器(qi)(qi)人進(jin)行(xing)相(xiang)(xiang)應的(de)(de)(de)直(zhi)行(xing)、左轉(zhuan)(zhuan)、右轉(zhuan)(zhuan)、掉(diao)頭等指令;角(jiao)度(du)(du)測量(liang)(liang)模(mo)(mo)(mo)塊(kuai)(kuai)(kuai)及時將迷(mi)宮(gong)(gong)機器(qi)(qi)人轉(zhuan)(zhuan)彎時的(de)(de)(de)角(jiao)度(du)(du)信息(xi)通(tong)過(guo)a/d轉(zhuan)(zhuan)換的(de)(de)(de)方式反饋至主控(kong)(kong)(kong)制(zhi)(zhi)(zhi)器(qi)(qi)模(mo)(mo)(mo)塊(kuai)(kuai)(kuai);電(dian)量(liang)(liang)檢測模(mo)(mo)(mo)塊(kuai)(kuai)(kuai)將當前鋰(li)電(dian)池的(de)(de)(de)電(dian)壓信息(xi)反饋至主控(kong)(kong)(kong)制(zhi)(zhi)(zhi)器(qi)(qi)模(mo)(mo)(mo)塊(kuai)(kuai)(kuai)。
6.根據權利要求1所述的(de)控(kong)(kong)制系統(tong),其特征在于:所述迷宮機(ji)器(qi)人(ren)控(kong)(kong)制系統(tong)軟件架(jia)構的(de)硬(ying)件驅(qu)動(dong)(dong)層(ceng)主(zhu)要包括:led驅(qu)動(dong)(dong)、timer驅(qu)動(dong)(dong)、adc驅(qu)動(dong)(dong)、dma驅(qu)動(dong)(dong)、直流電(dian)機(ji)驅(qu)動(dong)(dong)、紅外(wai)傳(chuan)感器(qi)等(deng);這些底層(ceng)驅(qu)動(dong)(dong)設計的(de)優(you)良與(yu)合理(li)性(xing)直接決定(ding)了迷宮機(ji)器(qi)人(ren)的(de)性(xing)能優(you)劣,比如直線前進(jin)n個單位(wei)迷宮格、定(ding)時中斷處(chu)理(li)任(ren)務、adc+dma采(cai)集(ji)當前所處(chu)迷宮格周圍墻壁距(ju)離、左右轉彎角度(du)信息等(deng);對于所需硬(ying)件資源全部(bu)初始化才能保證迷宮機(ji)器(qi)人(ren)硬(ying)件模塊層(ceng)的(de)正(zheng)常(chang)工作。