野火电子论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 10043|回复: 2

基于STM32F0+L6474步进驱动开源分享:源码+原理图+BOM表等全部开源

[复制链接]
发表于 2018-12-13 18:11:31 | 显示全部楼层 |阅读模式
基于STM32F0+L6474步进驱动开源分享:源码+原理图+BOM表等全部开源
基本功能:细分设置、电流设置、软件启动、停止、正反转、加减速、回原点、回参考点等你想到的功能都有
主芯片:STM32F030R8T6(NUCLEO板都支持)
软件:KEIL MDK打开(5.0以上版本)
资料下载:见附件
原创:锝臻科技——游名
//-----Increase deceleration while running

  /* Increase deceleration of device 0 to 480 step/s^2 */ //减速度测试
  BSP_MotorControl_SetDeceleration(0,480); //设置减速度为480
  HAL_Delay(5000); //延时5S

  /* Decrease speed of device 0 to 1200 step/s */
  BSP_MotorControl_SetMaxSpeed(0,1200); //设置最高速度为1200
  HAL_Delay(5000); //延时5S

  /* Get current speed */
  mySpeed = BSP_MotorControl_GetCurrentSpeed(0); //获取当前速度

//----- Soft stopped required while running                                 //电机运转时:软件停止电机运转测试

  /* Request soft stop of device 0 */
  BSP_MotorControl_SoftStop(0); //发送软件停止指令

  /* Wait for the motor of device 0 ends moving */  
  BSP_MotorControl_WaitWhileActive(0); //等待电机停止运转

  /* Wait for 2 seconds */
  HAL_Delay(2000); //延时2S

//----- Run stopped by hardstop

  /* Request device 0 to run in FORWARD direction */
  BSP_MotorControl_Run(0,FORWARD);                                          //电机正转
  HAL_Delay(5000); //延时5S
  
  /* Request device 0 to immediatly stop */
  BSP_MotorControl_HardStop(0); //电机硬件停止
  BSP_MotorControl_WaitWhileActive(0); //等待电机停转

  /* Request device 0 to disable bridge */
  BSP_MotorControl_CmdDisable(0); //关闭电机驱动H桥, 关闭后,手旋转电机就可以转的动,要不然转不动;
  
  /* Wait for 2 seconds */
  HAL_Delay(2000); //延时2S
  
//----- GOTO stopped by softstop //移动到目标点过程中:软件停止测试

/* Request device 0 to go to position 20000  */
  BSP_MotorControl_GoTo(0,20000);   //发送移动20000步命令
  HAL_Delay(5000); //延时5S

  /* Request device 0 to perform a soft stop */
  BSP_MotorControl_SoftStop(0); //软件停止
  BSP_MotorControl_WaitWhileActive(0); //等待电机停止

1

1

2

2
基于STM32F0+L6474步进驱动开源分享:源码+原理图+BOM表等全部开源.rar (8.09 MB, 下载次数: 28)

3

3

4

4

5

5

  /* Wait for 2 seconds */
  HAL_Delay(2000);   //延时2S

步进电机正反转(加减速测试视频).rar

2.2 MB, 下载次数: 36

5

l6474(芯片手册).pdf

950.75 KB, 下载次数: 34

4

IHM01A1-DG-V1.0.1(源码).rar

4.23 MB, 下载次数: 79

3

IHM01A1-DG(原理图).pdf

545.83 KB, 下载次数: 32

2

回复

使用道具 举报

 楼主| 发表于 2018-12-13 18:12:08 | 显示全部楼层
厉害的。。。。。
回复

使用道具 举报

 楼主| 发表于 2018-12-18 18:10:31 | 显示全部楼层
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

联系站长|手机版|野火电子官网|野火淘宝店铺|野火电子论坛 ( 粤ICP备14069197号 ) 大学生ARM嵌入式2群

GMT+8, 2024-4-26 21:06 , Processed in 0.030553 second(s), 26 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表