欢迎来到三一办公! | 帮助中心 三一办公31ppt.com(应用文档模板下载平台)
三一办公
全部分类
  • 办公文档>
  • PPT模板>
  • 建筑/施工/环境>
  • 毕业设计>
  • 工程图纸>
  • 教育教学>
  • 素材源码>
  • 生活休闲>
  • 临时分类>
  • ImageVerifierCode 换一换
    首页 三一办公 > 资源分类 > DOCX文档下载  

    基于Verilog的FPGA步进电机控制.docx

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

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

    基于Verilog的FPGA步进电机控制.docx

    基于Verilog的FPGA步进电机控制基于FPGA步进电机控制: 电机为四相步进电机,单四拍工作. Speed为电机运行状态输入; Direct 为电机转动方向输入; Out 为电机控制信号输出; 程序控制电机加速减速,采用计数原理,不同计数值控制电机旋转速度,再利用一个另外计数值控制特定速度运行时间,时间到则转到下一速度,设定有最大速度值,加速到最大速度自动进入匀速过程. module motor1(speed,rst,out,direct,clk, ); /运行状态输入 input 1:0 speed; /加速 parameter ups=2'b01; /减速 parameter dns=2'b10; /停止 parameter stop=2'b11; /最大速度 parameter aver=4'b1000; /电机运行方向,复位,时钟输入 input direct,rst,clk; /控制电机信号输出 output 3:0 out; reg 3:0 out; /加速速度转换计数 reg 3:0count1; /减速速度转换计数 reg 3:0count2; /加速速度数字代表 reg 3:0countup; /减速速度数字代表 reg 3:0countdn; /特定速度运行时间计数 reg 6:0count; /特定速度运行时间到标志 parameter countmax=7'b1111111; always(posedge clk or negedge rst) if(!rst) begin countup<=4'b1111; count1<=4'b1111; count2<=4'b1000; countdn<=4'b1000; count<=7'b0; end else if(speed=ups)|(speed=dns) begin count<=count+1; if(speed=ups) begin if(count1=0)count1<=countup; if(count1!=0) count1<=count1-1; if(countup>=4'b1001)&&(count=countmax) begin countup<=countup-1; count1<=countup-1; count=7'b0; end if(countup=aver)&&(count=countmax) begin count1<=aver; countdn<=aver; count<=7'b0; end end else if(speed=dns) begin count1=4'b1111; if(count2=0) count2<=countdn; if(count2!=0) count2<=count2-1; if(countdn<=4'b1110)&&(count=countmax) begin countdn<=countdn+1; count2<=countdn+1; count<=7'b0; end if(countdn=4'b1111)&&(count=countmax) begin count2<=4'b1111; count<=7'b0; end end end else if(speed=stop) begin countup<=4'b1111; countdn<=aver; count1<=4'b1111; count<=7'b0; end always(count1 or count2 or rst) if(!rst) out<=4'b1001; else if(count1=0)|(count2=0) begin if(speed=stop) out<=out; else if(speed=ups)|(speed=dns) begin if(direct=1) out<=out2:0,out3; else if(direct=0) out<=out0,out3:1; end end endmodule

    注意事项

    本文(基于Verilog的FPGA步进电机控制.docx)为本站会员(牧羊曲112)主动上传,三一办公仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知三一办公(点击联系客服),我们立即给予删除!

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




    备案号:宁ICP备20000045号-2

    经营许可证:宁B2-20210002

    宁公网安备 64010402000987号

    三一办公
    收起
    展开