欢迎来到淘文阁 - 分享文档赚钱的网站! | 帮助中心 好文档才是您的得力助手!
淘文阁 - 分享文档赚钱的网站
全部分类
  • 研究报告>
  • 管理文献>
  • 标准材料>
  • 技术资料>
  • 教育专区>
  • 应用文书>
  • 生活休闲>
  • 考试试题>
  • pptx模板>
  • 工商注册>
  • 期刊短文>
  • 图片设计>
  • ImageVerifierCode 换一换

    p基于FPGA的步进电机细分控制电路的设计.doc

    • 资源ID:15037203       资源大小:581.50KB        全文页数:118页
    • 资源格式: DOC        下载积分:15金币
    快捷下载 游客一键下载
    会员登录下载
    微信登录下载
    三方登录下载: 微信开放平台登录   QQ登录  
    二维码
    微信扫一扫登录
    下载资源需要15金币
    邮箱/手机:
    温馨提示:
    快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。
    如填写123,账号就是123,密码也是123。
    支付方式: 支付宝    微信支付   
    验证码:   换一换

     
    账号:
    密码:
    验证码:   换一换
      忘记密码?
        
    友情提示
    2、PDF文件下载后,可能会被浏览器默认打开,此种情况可以点击浏览器菜单,保存网页到桌面,就可以正常下载了。
    3、本站不支持迅雷下载,请使用电脑自带的IE浏览器,或者360浏览器、谷歌浏览器下载即可。
    4、本站资源下载后的文档和图纸-无水印,预览文档经过压缩,下载后原文更清晰。
    5、试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。

    p基于FPGA的步进电机细分控制电路的设计.doc

    【精品文档】如有侵权,请联系网站删除,仅供学习与交流p基于FPGA的步进电机细分控制电路的设计.精品文档.目 录1 引言12 步进电机简介22.1 步进电机工作原理22.2 步进电机的励磁方式22.2.1 一相励磁22.2.2 二相励磁32.2.3 一-二相励磁32.3 细分驱动原理43 设计方案53.1 各个模块简要介绍63.2 各个部分仿真图介绍84 结论11谢 辞12参考文献13附 录141 引言步进电机是将电脉冲信号转变成角度位移或者线性位移的开环控制元件。在非超载的情况下电机的转速、停止位置只是取决于脉冲信号的频率和脉冲数,而不受负载变化的影响,即给电机加一个脉冲信号,电机则转过一个步距角。这一线性关系的存在,加上步进电机只是周期性的误差而无累计误差的特点,使得步进电机在速度、位置等控制领域操作非常简单。基于步进电机具有转矩大、惯性小、响应频率高、可开环应用等优点,它被广泛应用在工业自动控制、仪器仪表等领域。然而步进电机在低频运行时存在振荡现象并且产生很大的电磁噪声, 另外步进电机的固有步进角多在0. 451. 8之间, 在精密、稳定控制场合, 用普通的方法驱动步进电机不能获得理想的步进控制精度和运行平稳度。因此需要通过步进电机细分技术来改善。步进电机的细分技术实质上是一种电子阻尼技术,细分驱动技术能够大大提高步进电机的步距分辨率, 减小转矩的波动, 避免低频振荡, 降低运行时的噪声,提高电机的运转精度只是细分技术的一个附带功能。比如对于步进角为1.8°的两相混合式步进电机,如果细分驱动器的细分数设置为4,那么电机的运转分辨率为每个脉冲0.45°,电机的精度能否达到或接近0.45°,还取决于细分驱动器的细分电流控制精度等其它因素。不同厂家的细分驱动器精度可能差别很大;细分数越大精度越难控制。 现场可编程门阵列( Field Programmable Gate Array, FPGA)集成度高、通用性好、设计灵活且性能稳定, 能够极大地缩小电路板的面积, 提高电路的稳定性。因此本次设计的步进电机细分驱动器以FPGA为核心, 采用脉宽调制( PulseWidthModulation, PWM)斩波恒流驱动技术,细分数为8。本驱动器可使步进电机带动负载连续平稳地运行, 控制精度高, 灵活性好。2 步进电机简介2.1 步进电机工作原理步进电机有三线制、五线制和六线制,但其控制方式均是相同的,都要以脉冲信号电流来驱动。假设没旋转一圈需要200个脉冲信号来励磁,可以计算出每个励磁信号能使步进电机前进1.8°,其旋转角度与脉冲的个数成正比。步进电机的正反转均是有励磁脉冲产生的顺序来控制。六线制四相步进电机是比较常见的,它的控制等效电路如图1所示,它有四条励磁信号引线A,B,C,D,通过四条引线上励磁脉冲产生的时刻,即可以控制步进电机的转动,每出现一个脉冲信号,步进电机只走一步。因此,只要依照固定的顺序不断送出脉冲信号,步进电机就能够一直连续转动。图1 步进电机的等效电路图2.2 步进电机的励磁方式步进电机的励磁方式分为全步励磁和半步励磁两种。其中全步励磁又有一相励磁和二相励磁之分;半步励磁称为一-二相励磁。假设没旋转一圈需要200个脉冲信号来励磁,可以计算出每个励磁信号呢个使步进电机前进1.8°,简要介绍如下。励磁方式有三种分别为一相励磁、二相励磁和一-二相励磁。2.2.1 一相励磁在每一个瞬间,步进电机只有一个线圈导通。每送一个励磁信号,步进电机旋转1.8度,这是三种励磁方式中最简单的一种。其特点是:精确度好、消耗电力小,但是输出的转矩最小,产生的振动很大。如果以该方式控制步进电机正转,对应的励磁表的顺序如表1所示。如果励磁信号反向传动,则步进电机反转。表中的1和0表示给电机的高电平和低电平。表1 一相励磁顺序表STEPABCD11000201003001040001励磁的顺序说明为:1 -> 2 -> 3 -> 4 -> 1如此循环。2.2.2 二相励磁在每一个瞬间,步进电机有两个线圈同时导通。每送一个励磁信号,步进电机旋转1.8度。其特点是:输出转矩较大,振动比较小。因而成为目前使用最多的励磁方式。如果以该方式控制步进电机的正转,对应的历次方式见表2.若励磁信号反向传送,则步进电机反转。表2 二相励磁顺序表STEPABCD11100201103001141001励磁的顺序说明为:1 -> 2 -> 3 -> 4 -> 1如此循环。2.2.3 一-二相励磁为一相励磁和二相励磁交替导通的方式。每送一个励磁信号,步进电机旋转0.9度。其特点是:分辨率高,运转较平滑,故应用也很广泛。如果以该方式控制步进电机正转,对应的历次顺序见表3.若励磁信号反向传动,则步进电机反转。表3 一-二相励磁顺序表STEPABCD1100021100301004011050010600117000181001励磁的顺序说明为:1 -> 2 -> 3 -> 4 -> 5 -> 6 -> 7 -> 8 -> 1如此循环。本次设计采用是一-二相励磁的方式,顺序为正转。2.3 细分驱动原理 步进电机细分控制的关键在于按照什么样的细分电流波形来控制步进电机各自绕组中的电流。一般有两种实现原理。 (1)使电流按线性规律变化,即把步进电机各相的最大电流进行了M等分。这种方法示意见图2,其转矩角特性曲线见图3。可以看出,各相通电状态转矩角的幅值不相等,步距角也不均匀等分,当通电状态发生变化的时候,各细分微步的步距是不保持均匀的。因此这种驱动方式只是为了提高其运行性能而不是主要用来提高距角的分辨率。图2 步进电机电流等分细分波形图3 电流线性等分细分矩角特性(2) 按等步距角细分。由上述电机各自相互通电的状态下的矩角特性曲线可知,按等步距角细分必须满足各自相矩角特性曲线幅值,位差和形状都相同,如图4所示。图4 理想的细分矩角特性由于等距细分实现起来较为复杂,基于实际需要故本次设计采用按线性电流规律变化进行设计。通过设置导通电流的占空比达到控制电流的目的。3 设计方案本次设计的硬件平台是Altera公司的Cyclone系列中的EP2C8Q208C8。步进电机为5V驱动的4相5线的步进电机,而且是减速步进电机,减速比为1:64,步进角为5.625/64 度。如果需要转动1 圈,那么需要360/5.625*64=4096个脉冲信号。为了对比明显,将没有通过细分的状态和细分状态放在一起进行切换对比,并通过数码管显示细分的状态。图5为本次设计的顶层文件图。图5 本次设计的顶层文件图3.1 各个模块简要介绍 图6为按键电路通过input锁定的按键输入,然后xd模块为消除抖动模块,然后通过通过xf_cont模块来实现电平的反转,首次按下按键的时候xf端口输出为高电平,代表的状态为步进电机细分模式。再次按下时xf为低电平,代表的是步进电机非细分的模式。图6 细分状态切换顶层原件图 图7为电压上升和下降模块,两者通过共同的时钟输入,输出信号到步进电机控制模块。其中pwmc为电压上升模块,pwmd为电压下降模块。 图7 步进电机细分模块和非细分模块 图8为步进电机控制模块,本模块通过接受按键的输入信号来决定步进电机的输出是细分状态还是非细分状态。输出的四个引脚与步进电机ABCD四个脚绑定。图8 步进电机控制模块 图9为步进电机细分状态的显示模块,它通过接收步进电机控制模块发出的二进制控制信号,通过解码现显示出当先步进电机细分的状态。本次设计只有两种模式分别为0细分和8细分模式。图9 步进电机细分状态显示模块3.2 各个部分仿真图介绍本次设计的方针波形主要通过modemsim软件进行仿真,用其编译的脚本文件可以方便对每个模块进行波形仿真,并验证本次设计的正确性。首先验证的是电压上升和下降的细分模式图。本次设计在内部设置了8位寄存器进行了256的细分,程序里设置为每增加或者减小64为一个步进状态。图10为步进电机的电压上升图,由图可以知道输出的占空比为4个状态变化依次从窄到宽,再回到初值状态。图10 步进电机细分电压上升图图11为步进电压下降图,由图可以知道步进电机输出和上升的波形相反。图11 步进电机细分电压下降图图12为步进电机的细分状态模块的方针图,此模块通过接受步进电机控制电路输出的二进制信号,转化成十进制的数字在数码管上显示,如图12可以知道,输出模块很好地实现了二进制转化为十进制的转化。输出波形为数码管的十进制编码。图12 步进电机状态显示模块图13为本次设计的综合模块也就是步进电机的细分控制模块,为了分辨电压上升的状态和电压下降的状态,在此分别输入了不同频率的信号。最下边的数值为步进电机的细分状态值。由图13可知在未细分状态的时候a,b,c,d电压的上升都是直接从0到1完全没有过度过程。而在细分状态的时候,如图14电压上升和下降的时候都会有细分的过度过程,而且上升的的频率和下降的频率分别都和各自输入的clk信号一致。图13 未细分状态时的仿真输出图图 14 细分状态下的输出仿真图4 结论本文介绍了基于FPGA的步进电机细分控制电路的设计,本次设计进行了模块分析和仿真分析,利用FPGA的开发板实现了步进电机细分控制的功能。通过固化程序到开发板上,很明显的感觉到未细分时候,步进电机的振动很厉害,细分之后步进电机能较为平稳地转动。本次设计完整地达到了预期的目的。本文设计方案在自动控制领域中有广泛的应用前景。谢 辞本学期我认真学习了FPGA与CPLD技术这一门课程,这一次设计也是作为研究生的第一个课程设计。首先要感谢老师对我们的辛勤教导,其次要感谢实验室的同学为我提供了FPGA的开发板和技术指导。这次设计,不仅使我更加熟悉Verilog HDL语言和Quartus9.0软件,而且真正体会到了实践出真知的真谛。最后,本次设计虽然是个人探索取得进步的过程,但依然离不开同学之间的相互探讨和帮助,集体的思维是开阔的,集体的智慧是无限的。因此我还要向那些给我帮助的同学们表示感谢。参考文献1 潘松 黄继业EDA技术实用教程(第三版)M北京:科学教育出版社. 20072 王金明,杨吉斌,数字系统设计与Verilog HDLM. 北京:电子工业出版社,20023 潘松,黄继业.EDA技术与VHDL(第三版)M. 北京:清华大学出版社,20094 云创工作室.Verilog HDL程序设计与实践M.北京:人民邮电出版社,20095 Michael D.Ciletti.Verilog HDL 高级数字设计M.6 María Dolores Valdés, Iria Villares, José Fariña, María José. FPGA-based Frequency Measurement System for High-Accuracy QCM Sensors. Moure Department of Electronic Technology University of Vigo, Spain.2002:114-1177 Valdes, M.D. Moure, M.J, Rodriguez, Farina. Implementation of a Frequency Measurement Circuit for High-Accuracy QCM Sensors. Electron. Technol., Univ. of Vigo, Vigo.2004:29-388 Lee, Y.-H.G. Helton, J. Chen. Real-time FPGA-based implementation of digital instantaneous frequency measurement receiver. Wright State Univ, Dayton.2006:35-389 Santos, Edval J. P. Silva, Leonardo B. M. FPGA-based smart sensor implementation with precise frequency to digital converter for flow measurement. Laboratory for Devices and Nanostructures, Electronics and Systems Department, Universidade Federal de Pernambuco.2008:16-30附 录1 消抖模块程序module xd(clk,key_in,key_outinput clk;input key_in;output key_out;reg dout1;reg dout2;reg dout3;reg17:0 count;wire key_done;assign key_done = (dout1 | dout2 | dout3);assign key_out =key_done;always (posedge clk)begin count=count+1'b1;endalways (posedge count17)begindout1 <= key_in;dout2 <= dout1;dout3 <= dout2;end endmodule 2 输入模块程序module xf_cont(in,clk,xf);input clk,in;output xf;reg xf_r=0;assign xf=xf_r;always (negedge in)beginxf_r<=xf_r;endendmodule 3 电压上升模块程序module pwmc(clk,out);input clk;output out;wire out;reg b=0;reg7:0 cnt=0;reg7:0 data=0;reg23:0 cnt1=0;initial begindata=64;endalways (negedge clk)begincnt<=cnt+1'b1;cnt1<=cnt1+1'b1;if(cnt1=249999)begin data<=data+8'd64;cnt1<=0;end endalways (negedge clk)begin if(cnt=0)b<=1;else if(cnt=data) b<=0;end assign out=b;Endmodule4 电压下降模块程序module pwmd(clk,out);input clk;output out;wire out;reg b=0;reg7:0 cnt=0;reg7:0 data=0;reg23:0 cnt1=0;initial begindata=64;endalways (negedge clk)begincnt<=cnt+1'b1;cnt1<=cnt1+1'b1;if(cnt1=249999)begin data<=data+8'd64;cnt1<=0;end endalways (negedge clk)begin if(cnt=0)b<=0;else if(cnt=data) b<=1;end assign out=b;endmodule 5 步进电机控制模块输出模块module abcd(a,b,c,d,pwmc,pwmd,clk,xf,data);input pwmc,pwmd,xf;input clk;output a,b,c,d;output3:0 data;parameter state0=3'b000, state1=3'b001, state2=3'b010, state3=3'b011, state4=3'b100, state5=3'b101, state6=3'b110, state7=3'b111;reg a,b,c,d;reg23:0 cnt=0;reg2:0 state;reg3:0 data=0;initial beginstate<=state0;endalways(negedge clk) begin cnt<=cnt+1; if(cnt=999999)begincnt<=0;case(state)state0:state<=state1;state1:state<=state2;state2:state<=state3;state3:state<=state4;state4:state<=state5;state5:state<=state6;state6:state<=state7;state7:state<=state0; endcaseendendalways(negedge clk)begin/ULN2003是反向驱动器。当输入是0时,输出时1if(xf=1) begincase(state)state0:begin a=1;b=pwmc;c=0;d=0;endstate1:begin a=pwmd;b=1;c=0;d=0;endstate2:begin a=0;b=1;c=pwmc;d=0;endstate3:begin a=0;b=pwmd;c=1;d=0;endstate4:begin a=0;b=0;c=1;d=pwmc;endstate5:begin a=0;b=0;c=pwmd;d=1;endstate6:begin a=pwmc;b=0;c=0;d=1;endstate7:begin a=1;b=0;c=0;d=pwmd;end endcase data<=4'd8; end else if(xf=0) begin case(state)state0: d,c,b,a=4'b0001;state1:d,c,b,a=4'b0011;state2:d,c,b,a=4'b0010;state3:d,c,b,a=4'b0110;state4:d,c,b,a=4'b0100;state5:d,c,b,a=4'b1100;state6:d,c,b,a=4'b1000;state7:d,c,b,a=4'b1001; endcase data<=0; end endendmodule 6 步进电机细分状态显示模块程序module display(clk,data_in,sm_bit,sm_seginput clk;input3:0 data_in;output sm_bit;output7:0 sm_seg;reg23:0 data;reg7:0 sm_seg_r;assign sm_bit = 0;assign sm_seg = sm_seg_r;always (posedge clk)begincase(data_in)4'h0:sm_seg_r = 8'hc0;4'h1:sm_seg_r = 8'hf9;4'h2:sm_seg_r = 8'ha4;4'h3:sm_seg_r = 8'hb0;4'h4:sm_seg_r = 8'h99;4'h5:sm_seg_r = 8'h92;4'h6:sm_seg_r = 8'h82;4'h7:sm_seg_r = 8'hf8;4'h8:sm_seg_r = 8'h80;4'h9:sm_seg_r = 8'h90;4'ha:sm_seg_r = 8'hbf;default:sm_seg_r = 8'hff;endcaseendendmodule 7 本次设计的实物图图15本次设计的硬件实物(英文版 ) easily blame, to prevent the broken window effect. Supervise the leading cadres to play an exemplary role, take the lead in the strict implementation of the < code > and < rule >, lead to safeguard the solemnity and authority of the party discipline, ensure that the party discipline and the laws and regulations for implementation in place. Throughout the discipline in the daily supervision and management, strengthen supervision and inspection, from the thorough investigation of violations of discipline behavior. Strengthen to key areas, key departments and key projects as well as the masses reflect the concentration of the units and departments for supervision. - strengthening supervision, discipline inspection and supervision of cadres to set an example for compliance with the < code > and < rule > is a man must be hexyl, blacksmith needs its own hardware. Discipline inspection organs as the executor of the party discipline, and supervisor of the defenders, for its supervision must be more strictly, discipline inspection and supervision of cadres to firmly establish the awareness of Party Constitution, sense of discipline and rules consciousness, politics loyalty, sense obey. Action speak Ji Ordinance to set an example of the regulations of the rule of law, strengthen supervision and accept the supervision of the firmness and consciousness, do comply with < > and < >. To firmly establish the discipline must first be disciplined, the supervisor will be subject to the supervision of "concept, and consciously safeguard and implement party compasses party, take the lead in practicing" three strict real strict, so loyal, clean, play. To be good at learning, the Constitution and the < code > as morality, politics and brought to fruition; to implement < >, do not want to, dare not, not with disciplinary ruler to supervision; to discipline a ruler, often the control inspection, and consciously in the ideological red line to draw the row Ming Good accumulation is indeed the bottom line, so that the heart has fear, said to have quit, the line has ended. Attached: indifferent to heart, calmly to the table in our life, there are many unpredictable things will happen, some good, some bad things, we cannot control is powerless to stop, but with time, you will find in life sometimes turns out to be not good, some bad things finally turned out to be a good thing, but then we muddy however did not know, this is the life teach us things. 1, life can be complex, can also be simple. Want simple life of precipitation, to have enough time to reflect, to make Become more perfect. Life is the most important thing is not to win, but the struggle; not to have conquered, but to have fought well. 2, the plain is the background of life. Live a plain life, give up on themselves is not a coward, but the wise answers; not disillusioned after the heart, such as ashes, but experience the storm after the enlightenment; not unrewarding perfunctorily, but calm attitude of life of unrestrained self-confidence. Plain living, there is no noise noisy, no earthly troubles, more did not fill in the discontent of desire, some just a calm, a calm. 3, memory of heart will not good things to erase the, life is a When no movie, pain is a beginning, the struggle is a kind of process, death is a kind of ending. Give up this giving up is the helpless, do not give up the abandoned, do not give up this giving up is ignorance, do not give up should not give up is persistent. 4, a thing figured is heaven, think impassability is hell. Since the living, to live better. Sometimes we because of too narrow-minded, too care around the chores and penny wise and pound foolish, not worth the candle. Some things to attract trouble and worry, completely depends on how we look at and deal with it. Don't always take everything back to things, and don't get into a blind alley, don't want to face, don't be narrow-minded. Poke to care, is a kind of open-minded, a free and easy. 5, I am not afraid of others behind me a knife, I afraid to look back and see stab me, is my intention to treat people; I am not afraid of the truth to tell the best friend, I'm afraid he turned to it as a joke to tell don't 6, when we are in a positive frame of mind, you will find many good things; and when we are in a negative state of mind, you will find many depressed things; life happy and worry, all is you of life attitude, optimistic, good luck; loss of sink, Eritrea company. When you are in adversity, may wish to change a point of view to think everything over to the good Think, because good mentality decided the fate of the! 7, people are tired, rest; heart tired, calm. Grow up, mature, this society read. Tired and sad, squat down, to their a hug. Because the world no one can sympathize with you, have mercy on you. You cry, tears is your own; you pain, no one can understand. Then you only tears to smile. 8, each people have youth,Each youth are a story, the life of the world never gets easier, I want what, wish the world all know, as has been the same; now want anything, for fear that others know, or like to lose the same. 9, the heart move, everything in the world is followed by birth, Rangrang, important thing is often the most difficult to open one's mouth, because words will reduce its importance; to let strangers people care about your life in the good things, the original is not easy 10, do not blame, do not laugh at who, also don't envy who

    注意事项

    本文(p基于FPGA的步进电机细分控制电路的设计.doc)为本站会员(豆****)主动上传,淘文阁 - 分享文档赚钱的网站仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知淘文阁 - 分享文档赚钱的网站(点击联系客服),我们立即给予删除!

    温馨提示:如果因为网速或其他原因下载失败请重新下载,重复下载不扣分。




    关于淘文阁 - 版权申诉 - 用户使用规则 - 积分规则 - 联系我们

    本站为文档C TO C交易模式,本站只提供存储空间、用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。本站仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知淘文阁网,我们立即给予删除!客服QQ:136780468 微信:18945177775 电话:18904686070

    工信部备案号:黑ICP备15003705号 © 2020-2023 www.taowenge.com 淘文阁 

    收起
    展开