【正文】
本文通過 FPGA為核心來控制步進電機得到了較好效果,主要優(yōu)點有控制器的尺寸小于傳統(tǒng)控制器,另外鑒于 IP技術(shù)的飛速發(fā)展可以把電機控制系統(tǒng)做成 IP核,從而使得開發(fā)人員很容易獲得多數(shù)通用模塊的可復(fù)用 IP核,減輕了開發(fā)人員的負擔,縮短了開發(fā)周期。 u2:jsq port map(s1=clk,reset,ena,s14=clkin)。 c5: ponent shortage4 is port(ena:in std_logic。 y1,y2,y3,y4:out std_logic_vector( 0 to 6)。 architecture art2 of decoder is signal A:std_logic_vector(2 downto 0)。 then if Q=11111111111111111 then Q=00000000000000000。 分頻器 (24 HZ) library ieee。 begin process(ain4) begin case ain4 is when0000=temp=0111111。 end if。 end process c2。 begin c1:process(clr,sm,ena) begin if clr=39。 endmeasure=39。039。 end if。 entity jsq is port(reset,clk,ena:in std_logic。 elsif ena=39。 FPGA數(shù)字系統(tǒng) 對輸入的 脈沖個數(shù)進行計數(shù),得到信號的 在一分鐘內(nèi) 頻率數(shù), 即一分鐘內(nèi)的轉(zhuǎn)速, 該頻率數(shù)經(jīng)數(shù)碼管顯示。 以往主要是用單片機來做為中央處理控制芯片,然后加入外圍電路, FPGA 的 EDA 等器件及其對應(yīng)描述語言的出現(xiàn)打破了單片機作為控制器的歷史,可以說 FPGA 等器件 及其對應(yīng)描述語言 是人類的創(chuàng)舉。 VHDL 語言是目前應(yīng)用最廣泛的硬件描述語言,它是在 C 語言的基礎(chǔ)上發(fā)展起來的,語法較為 嚴謹 、擁有廣泛的學(xué)習(xí)群體、資源比較豐富,且容易學(xué)簡單易懂。 begin process(clk,ena,reset) begin if reset=39。 use 。event and clk=39。 begin process(clk,reset,start) begin if reset=39。 計數(shù)器復(fù)位 else gate=39。 xs:out std_logic_vector(0 to 3) )。 c2:process(temp)temp做為觸發(fā)信號 begin if temp=0000then carryout=39。 begin process(ena) begin if ena=39。 bout7:out std_logic_vector(0 to 6) )。 bout7=temp。139。 entity decoder is port(clk:in std_logic。 use 。 carryout:out std_logic。 signal s1,s2,s3,s4,s13,s14,s15,s16:in std_logic。 u15:ymq port map(s12,y4)。同時培養(yǎng)了我精益求精,嚴謹認真的工作作風(fēng)。 u5:t10 port map(s16,s15,s2=sm,s3,s6)。 end ponent c5。 architecture art of dj is c1:ponent count is port(reset,ena,clk:in std_logic。139。 end if。 use 。2 when0011=temp=1001111。 end architecture art。 ,當 60s時間到時 ,四位寄存器 ena使能,將寄存器中的數(shù)據(jù)輸出 ,其中 ena與endmeasure相連, 作用為將數(shù)據(jù)存儲。計數(shù)器清零 elsif ena=39。 end if。計數(shù)器復(fù)位 elsif start=39。 clkin=q。 architecture art of jsq is signal temp:integer range 0 to 30。event and clk=39。 本文設(shè)計的數(shù)字轉(zhuǎn)速計有六個模塊組成:轉(zhuǎn)速控制模塊,計數(shù)模塊 ( 十進制和三十進制 ) , 7段顯示譯碼器模塊 ,分頻器模塊 ( 1HZ與 ) ,寄存器模塊 ,掃描模塊 : 本系統(tǒng)由光電傳感器及其調(diào)理電路 、數(shù)碼 顯示電路、 FPGA控制模塊組成。電動機;傳感器; QuartusⅡ Abstract The use of EDA technologies and VHDL language, design of FPGAbased measurement of the electrical Speed display system, enabling the system to sp