【正文】
can have the undesirable effect of introducing oscillations (multiple sign changes) into, k, even though y does not change sign. 7. Tracking Parametric Curves Although paths could be constructed with straight line and curve segments, this offers little flexibility. Also, at the junction points between path segments, there would be a discontinuity in curvature which cannot be tracked by real steering mechanisms. Parametric curves, such as a cubic Bspline, are often used to represent planned paths as they offer an attractive tradeoff between the flexibility of higherorder curves and the control and simplicity of lower order curves. Also, they are formulated to give continuity up to the second derivative with respect to their parameter, s (not to be confused with the Laplace trasform variable used earlier), which implies continuity in curvature at the knot points (segment junctions). As the vehicle attempts to track a Bspline, we need to determine the curve parameter value, s, which corresponds to the closest Euclidean distance from the path to the robot. A parametric twodimensional curve has the form ps= (x (s) ) , (y (s) ) To determine a location on the curve where the robot’s position is normal to that curve, we require that: (27) where pg =(xg。 由于電路還未做成PCB,即沒有決定電路板尺寸,所以整個外殼設(shè)計只是在Solid Edge(三維CAD)中仿真設(shè)計的。TIMSKamp。 OCMJ_48(12864)硬件接口協(xié)議為請求/應(yīng)答(REQ/BUSY) 握手方式。break。times=0。 4.OCMJ_48B液晶屏的使用 } PO switch(PINC) { case 0xe7: tempnum=0x00。 case 0xf7: scan=0xfe。 //databuff[5]=Read_from_SPI()。Mega32 內(nèi)部 Flash 是整個系統(tǒng)的主控制器(及核心) ,在系統(tǒng)中主要作用是把各部分功能都協(xié)調(diào)起來,并處理各類數(shù)據(jù)。 ELSIF rising_edge(SCK) THEN MISO=Sign_in(i)。 END PROCESS。 Sign_OUT : OUT STD_LOGIC_VECTOR(7 DOWNTO 0) )。相關(guān)的位是時鐘極性位CPOL和時鐘相位位CPHA,其組合關(guān)系如表2-2。SPI是工業(yè)標準的同步串行接口,是一種全雙工、四線通信的系統(tǒng)。對于PLD產(chǎn)品,一般分為:基于乘積項(ProductTerm)技術(shù),EEPROM(或Flash)工藝的中小規(guī)模PLD,以及基于查找表(LookUp table)技術(shù),SRAM工藝的大規(guī)模PLD/FPGA。由于 AVR 單片機集成度高技術(shù)較成熟,抗干擾能力強等優(yōu)點,可以在系統(tǒng)下載,所以在本系統(tǒng)中采用了AVR單片機ATMega32作為主控制器。單片機和PLD通信的那一部分程序采用自己編程完成通信時序。 8位單片機有68HC05和68HC08以及增強型單片機68HC11和68HC12。主控制器用了一塊ATMega32(AVR)單片機MCU,主要完成:1、鍵盤的操作處理;2、液晶顯示器的顯示處理;3、與 CPLD 接口(檢測)電路進行數(shù)據(jù)通信處理。最后給出了系統(tǒng)功能可以進一步完善的基本思路。所以研制一個測試線纜好壞的儀器是很有必要的(二) M MC CU U 與 與C CP PL LD D 配 配合 合在 在現(xiàn) 現(xiàn)代 代電 電路 路設(shè) 設(shè)計 計中 中的 的應(yīng) 應(yīng)用 用 當今社會是數(shù)字化的社會,是數(shù)字集成電路(微處理器、存貯器以及標準邏輯電路等) 廣泛應(yīng)用的社會。 (三) M CU的選型 1.單片機的類型 單片機的應(yīng)用范圍十分廣泛,主要的應(yīng)用領(lǐng)域有工業(yè)控制、儀器儀表、計算機外部設(shè)備與智能接口、商用產(chǎn)品、家用電器等。其ATtiny、AT90和ATMega系列分別對應(yīng)低、中、高檔產(chǎn)品。這樣的單片機可選PIC和AVR的。匯編語言作為傳統(tǒng)嵌入式系統(tǒng)的編程語言,具有執(zhí)行效率高,容易估算執(zhí)行時間等優(yōu)點,但其編程效率低,且可移植性和可讀性較差,維護不方便。且由于 CPLD 在系統(tǒng)中,只是起輔助作用,但要求I/O數(shù)量在120腳左右,所以選擇了EPM7128兩片(五) AVR與 與CPLD通信協(xié)的選擇 如果單片機與CPLD之間連接只是想驅(qū)動某一功能模塊,那么用幾個I/O就可以(即并行方式) 。SPI接口也可以作為CPU之間通信的方式2.SPI的傳輸原理 SPI的的傳輸原理可參考圖2-2所示,實際上相當于兩個8位移位寄存器首尾相連,每個時鐘周期,數(shù)據(jù)從一個設(shè)備的移位寄存器移出,同時移入了另一個寄存器。時就開始鎖存,也就是說SCK一產(chǎn)生電平變化穩(wěn)定后就開始數(shù)據(jù)鎖存;為1時,表示時鐘相位為180176。 中的索引號左右換一下. POS_1: PROCESS (Start,CP) BEGIN IF Start=39。 其中并串轉(zhuǎn)換和數(shù)據(jù)輸出的那塊(CPLD_MCU)VHDL語言如下: ======================CPLD_MCU VHDLLIBRARY ieee。 如圖3-4所示,是CPLD_MCU 在MAX+plusII中的仿真波形。 本系統(tǒng)中單片機SPI設(shè)計。 在系統(tǒng)中, 鍵盤是用戶完成檢測工作的第一步,也是人機交互的一重要部分。 //行輸入 se 0xeb: tempnum=0x04。break。 ca case 0xdd: tempnum=0x09。times=0。 如向模塊發(fā)出一個完整的顯示漢字的命令,包括坐標及漢字代碼在內(nèi)共需5個字節(jié),模塊在接收到最后一個字節(jié)后才開始執(zhí)行整個命令的內(nèi)部操作,因此,最后一個字節(jié)的應(yīng)答B(yǎng)USY 高電平(BUSY =1)持續(xù)時間較長,具體的時序如圖3-10所示。所以在程序中還加了這樣一段程序,當LCD背光燈點亮后20秒鐘內(nèi)沒被關(guān)閉則自動關(guān)燈。 (二)實驗結(jié)果分析結(jié)論:本系統(tǒng)測試儀滿足48線的要求。 。 參考文獻 [1] 邴志剛,方景林,谷兆麟等.計算機控制[M].北京:清華大學出版社,北京交通大學出版社,2005 [2] 黃任.AVR單片機與CPLD/FPGA綜合應(yīng)用入門[M].北京:北京航空航天大學出版社,2004 [3] 吳雙力,崔劍,王伯嶺.AVRGCC 與AVR單片機C語言開發(fā)司[M].北京:北京航空航天大學出版社,2004 [4] 張亦華, 延明. 數(shù)字電路EDA入門-VHDL程序?qū)嵗痆M]. 北京: 北京郵電大學出版社, 2004 [5] 侯伯亨,顧新.VHDL硬件描述語言與數(shù)字邏輯電路設(shè)計[M].北京:西安電子科技大學出版社,2004 [6] 陳華. 溫度控制系統(tǒng)的設(shè)計與應(yīng)用[J].現(xiàn)代電子技術(shù),2002(9) :7475 [7] 劉光武,劉冬,姚志成.單片機系統(tǒng)實用抗干擾技術(shù)[M].北京:人民郵電出版社, 2003 [8] 可編程邏輯器件中文網(wǎng)站 :// [9] 我們的AVR :// [10] 研學論壇 ://[11] 維普期刊全文數(shù)據(jù)庫 ://[12] 超星數(shù)字圖書館 ://附錄 (一) 系統(tǒng)原理圖 (二) 畢業(yè)設(shè)計過程中所涉及的軟件 (三) 英文論文 Mobile robot tracking of preplanned paths 6. CURVATURE RATE LIMITING In the preceding sections, we assumed that the steering controller could instantaneously assume any desired curvature .The resulting analysis yielded a 4 : 1 ratio between control constants for critically damped response .The graph labelled ‘curvraw’ on Fig. 4 shows the curvature required to correct an error in y when the vehicle is parallel to a stright path but displaced m from it. The graph indicatesthat a large initial step change in curvature is required followed by a sequence of much smaller changes. In real systems, the steering controller will take a finite time to attain this step in demanded curvature, so we must either: (1) Include the dynamics of the steering process in the analysis and repute the optimum ratio of control constants. Figure 4. Step response (k ) with curvature rate limiting. (2) Include in the system a mechanism to spread the change in curvature more evenly over the whole steering process and assume that, to an acceptable accuracy, the real steering mechanism can track the demanded turning curvature. To avoid assuming specific steering control dynamics, here we present a solution based on the second approach. . Filtering demand curvature In order to spread the changes in curvature more evenly across the whole maneuver, the actual curvature passed to the steering controller is the value of the previous curvature plus a fraction of the difference between the demand curvature and previous curvature: (21)where kl is a constant such that {0 kl ≤1g. In the z trans