VESC <硬件篇>

<项目>无刷电机驱动器(VESC)

前言

本项目在本杰明驱动的基础上制作的驱动板,主板采用双层主板,通过排针接耦。上层主板主要功能是控制、采集反馈、交互等。下层主板为3个半桥走大电流。
本项目的方案参考本杰明驱动:
https://vesc-project.com/
https://github.com/vedderb/bldc

本文介绍的所有资料已在github开源。

By:67373

1:准备硬件

1.1:原理图

驱动板-1
驱动板-2
驱动板-3
电源板

1.2:PCB

驱动板

电源板

1.3:实物图

实物图

2:准备固件

2.1:方案1

在github上下载我已经编译好的:https://github.com/linggan17/VESC/tree/main/03_Firmware

2.2:方案2

编译本杰明源码,生成固件。(采用Ubuntu系统,windows系统尝试后未构建成功)参考链接:https://github.com/vedderb/bldc

2.2.1:安装环境(安装时间可能在几十分钟)

sudo apt install git build-essential libgl-dev libxcb-xinerama0 wget git-gui

2.2.2:下载git工具(已下载的可跳过本步骤)

sudo apt install git

2.2.3:拉取仓库

git clone https://github.com/vedderb/bldc.git

2.2.4:进入仓库

cd bldc

2.2.5:切换分支

git checkout origin/master

2.2.6:安装sdk

make arm_sdk_install
make

2.2.7:编译固件

make hd60

2.2.8:然后就能在build文件夹找到对应的固件了
固件

shaolinggan@shaolinggan-virtual-machine:~/桌面/vesc$ sudo apt install git build-essential libgl-dev libxcb-xinerama0 wget git-gui
[sudo] shaolinggan 的密码: 
正在读取软件包列表... 完成
正在分析软件包的依赖关系树... 完成
正在读取状态信息... 完成                 
build-essential 已经是最新版 (12.9ubuntu3)。
libgl-dev 已经是最新版 (1.4.0-1)。
libxcb-xinerama0 已经是最新版 (1.14-3ubuntu3)。
wget 已经是最新版 (1.21.2-2ubuntu1)。
git 已经是最新版 (1:2.34.1-1ubuntu1.10)。
git-gui 已经是最新版 (1:2.34.1-1ubuntu1.10)。
升级了 0 个软件包,新安装了 0 个软件包,要卸载 0 个软件包,有 19 个软件包未被升级。
shaolinggan@shaolinggan-virtual-machine:~/桌面/vesc$ sudo apt install git
正在读取软件包列表... 完成
正在分析软件包的依赖关系树... 完成
正在读取状态信息... 完成                 
git 已经是最新版 (1:2.34.1-1ubuntu1.10)。
升级了 0 个软件包,新安装了 0 个软件包,要卸载 0 个软件包,有 19 个软件包未被升级。
shaolinggan@shaolinggan-virtual-machine:~/桌面/vesc$ git clone https://github.com/vedderb/bldc.git
fatal: 目标路径 'bldc' 已经存在,并且不是一个空目录。
shaolinggan@shaolinggan-virtual-machine:~/桌面/vesc$ cd bldc
shaolinggan@shaolinggan-virtual-machine:~/桌面/vesc/bldc$ git checkout origin/master
HEAD 目前位于 d141b26b Added STM32G4 support to blackmagic
shaolinggan@shaolinggan-virtual-machine:~/桌面/vesc/bldc$ git checkout origin/master
HEAD 目前位于 d141b26b Added STM32G4 support to blackmagic
shaolinggan@shaolinggan-virtual-machine:~/桌面/vesc/bldc$ make arm_sdk_install
/bin/sh: 1: python: not found
# download the source only if it's newer than what we already have
--2023-12-24 21:37:10--  https://developer.arm.com/-/media/Files/downloads/gnu-rm/7-2018q2/gcc-arm-none-eabi-7-2018-q2-update-linux.tar.bz2
正在解析主机 developer.arm.com (developer.arm.com)... 223.119.248.35, 223.119.248.67
正在连接 developer.arm.com (developer.arm.com)|223.119.248.35|:443... 已连接。
已发出 HTTP 请求,正在等待回应... 302 Moved Temporarily
位置:https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu-rm/7-2018q2/gcc-arm-none-eabi-7-2018-q2-update-linux.tar.bz2 [跟随至新的 URL]
--2023-12-24 21:37:16--  https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu-rm/7-2018q2/gcc-arm-none-eabi-7-2018-q2-update-linux.tar.bz2
正在解析主机 armkeil.blob.core.windows.net (armkeil.blob.core.windows.net)... 52.239.137.100
正在连接 armkeil.blob.core.windows.net (armkeil.blob.core.windows.net)|52.239.137.100|:443... 已连接。
已发出 HTTP 请求,正在等待回应... 304 The condition specified using HTTP conditional header(s) is not met.
文件 ‘/home/shaolinggan/桌面/vesc/bldc/downloads/gcc-arm-none-eabi-7-2018-q2-update-linux.tar.bz2’ 在服务器上未被更改。忽略此下载。

# binary only release so just extract it
shaolinggan@shaolinggan-virtual-machine:~/桌面/vesc/bldc$ make
/bin/sh: 1: python: not found

   This Makefile is known to work on Linux and Mac in a standard shell environment.

   Here is a summary of the available targets:

   [Tool Installers]
     arm_sdk_install      - Install the GNU ARM gcc toolchain
     qt_install           - Install the all tools for Qt

   [Big Hammer]
     all_fw               - Build firmware for all boards
     all_fw_package       - Packaage firmware for boards in package list

   [Unit Tests]
     all_ut               - Build all unit tests
     all_ut_xml           - Run all unit tests and capture all XML output to files
     all_ut_run           - Run all unit tests and dump XML output to console

   [Firmware]
     fw   - Build firmware for default target
                            supported boards are: 100_250 100_250_mkiii 100_250_mkiii_no_limits 100_250_no_limits 100_500 100_500_no_limits 140_300 40 410 410_0005ohm 410_005ohm 410_no_limits 45 46 46_0005ohm 46_33k 48 49 60 60_75 60_75_mk2 60_75_mk2_no_limits 60_75_no_limits 60_mk3 60_mk3_no_limits 60_mk4 60_mk4_no_limits 60_mk5 60_mk5_no_limits 60_mk6 60_mk6_hp 60_mk6_hp_no_limits 60_mk6_max 60_mk6_no_limits 60_no_limits 60v2_alva 60v2_alva_mk1 60v2_alva_mk2 75_100 75_100_V2 75_100_V2_0005ohm 75_100_V2_005ohm 75_100_V2_no_limits 75_100_no_limits 75_300 75_300_mkiv 75_300_mkiv_no_limits 75_300_no_limits 75_300_r2 75_300_r2_no_limits 75_300_r3 75_300_r3_no_limits 75_600 75_600_no_limits Cheap_FOCer_2 Cheap_FOCer_2_V09 Cheap_FOCer_2_V09_no_limits Cheap_FOCer_2_no_limits Little_FOCer Little_FOCer_V3 Little_FOCer_V3_1 a200s_v2.1 a200s_v2.2 a200s_v3 a200s_v4 a200s_v41 a50s_v22_12s a50s_v22_12s_hg a50s_v22_6s a50s_v22_6s_hg a50s_v23_12s a50s_v23_20s a50s_v23_6s a50s_v23_8s axiom das_mini das_rs edu edu_no_limits es19 example fsesc_75_200_alu fsesc_75_200_alu_no_limits fsesc_75_300 gesc go_foc_dv6_pro go_foc_dv6_pro_no_limits go_foc_g300 go_foc_g300_no_limits go_foc_hi200 go_foc_hi200_no_limits go_foc_hv200 go_foc_hv200_no_limits go_foc_m100 go_foc_m100_no_limits gp hd60 hd60_no_limits hd75 hd75_no_limits ka160 luna_bbshd luna_m600 luna_m600_Rev5 mbot mini4 mksesc_75_100_old mksesc_75_100_old_no_limits mksesc_75_100_v2 mksesc_75_100_v2_no_limits mksesc_75_100_v2_old mksesc_75_100_v2_old_no_limits mksesc_75_200_v2 mksesc_75_200_v2_no_limits mksesc_75_200_v2_old mksesc_75_200_v2_old_no_limits mksesc_84_100_hp mksesc_84_100_hp_no_limits mksesc_84_200_hp mksesc_84_200_hp_no_limits r2 raiden7 rd2 resc rh solo solo_no_limits spesc stormcore_100d stormcore_100d_no_limits stormcore_100d_parallel stormcore_100d_v2 stormcore_100d_v2_no_limits stormcore_100dx stormcore_100dx_no_limits stormcore_100dx_parallel stormcore_100s stormcore_100s_no_limits stormcore_60d stormcore_60d+ stormcore_60d+_no_limits stormcore_60d_no_limits stormcore_60dxs stormcore_60dxs_no_limits str500 str500_no_limits uavc_omega uavc_qcube ubox_single_100 ubox_single_100_no_limits ubox_single_75 ubox_single_75_no_limits ubox_single_80 ubox_single_80_no_limits ubox_single_85_200 ubox_single_85_200_no_limits ubox_v1_75_micro ubox_v1_75_micro_no_limits ubox_v1_75_typec ubox_v1_75_typec_no_limits ubox_v2_100 ubox_v2_100_no_limits ubox_v2_75 ubox_v2_75_no_limits unity unity_no_limits uxv_sr warrior6
     fw_<board>   - Build firmware for target <board>
     PROJECT=<target> fw   - Build firmware for <target>
     fw_<board>_clean     - Remove firmware for <board>
     fw_<board>_flash     - Use OpenOCD + SWD/JTAG to write firmware to <target>

   Hint: Add V=1 to your command line to see verbose build output.

   Note: All tools will be installed into /home/shaolinggan/桌面/vesc/bldc/tools
         All build output will be placed in /home/shaolinggan/桌面/vesc/bldc/build

shaolinggan@shaolinggan-virtual-machine:~/桌面/vesc/bldc$ make hd60
/bin/sh: 1: python: not found
********* BUILD: hd60 **********
make[1]: 进入目录“/home/shaolinggan/桌面/vesc/bldc”
Compiling crt0_v7m.s
Compiling chcoreasm_v7m.s
Compiling crt1.c
Compiling vectors.c
Compiling chsys.c
Compiling chdebug.c
Compiling chvt.c
Compiling chschd.c
Compiling chthreads.c
Compiling chtm.c
Compiling chdynamic.c
Compiling chregistry.c
Compiling chsem.c
Compiling chmtx.c
Compiling chcond.c
Compiling chevents.c
Compiling chmsg.c
Compiling chmboxes.c
Compiling chqueues.c
Compiling chmemcore.c
Compiling chheap.c
Compiling chmempools.c
Compiling chcore.c
Compiling chcore_v7m.c
Compiling osal.c
Compiling hal.c
Compiling st.c
Compiling hal_queues.c
Compiling hal_mmcsd.c
Compiling can.c
Compiling i2c.c
Compiling icu.c
Compiling pal.c
Compiling serial.c
Compiling serial_usb.c
Compiling spi.c
Compiling usb.c
Compiling nvic.c
Compiling stm32_dma.c
Compiling hal_lld.c
Compiling st_lld.c
Compiling can_lld.c
Compiling pal_lld.c
Compiling i2c_lld.c
Compiling usb_lld.c
Compiling spi_lld.c
Compiling icu_lld.c
Compiling serial_lld.c
Compiling chprintf.c
Compiling syscalls.c
Compiling main.c
Compiling irq_handlers.c
Compiling terminal.c
Compiling conf_general.c
Compiling timeout.c
Compiling flash_helper.c
Compiling confgenerator.c
Compiling bms.c
Compiling events.c
Compiling board.c
Compiling hw.c
Compiling drv8301.c
Compiling drv8305.c
Compiling drv8320s.c
Compiling drv8323s.c
Compiling luna_display_serial.c
Compiling luna_m600_display.c
Compiling si8900.c
Compiling shutdown.c
Compiling app.c
Compiling app_ppm.c
Compiling app_adc.c
Compiling app_sten.c
Compiling app_uartcomm.c
Compiling app_nunchuk.c
Compiling app_pas.c
Compiling app_custom.c
Compiling canard.c
Compiling canard_driver.c
Compiling esc_Status.c
Compiling esc_RawCommand.c
Compiling esc_RPMCommand.c
Compiling protocol_GetNodeInfo.c
Compiling protocol_HardwareVersion.c
Compiling protocol_NodeStatus.c
Compiling protocol_SoftwareVersion.c
Compiling param_Empty.c
Compiling param_ExecuteOpcode.c
Compiling param_GetSet.c
Compiling param_NumericValue.c
Compiling param_Value.c
Compiling file_BeginFirmwareUpdate.c
Compiling file_Read.c
Compiling vesc_RTData.c
Compiling mpu9150.c
Compiling icm20948.c
Compiling ahrs.c
Compiling imu.c
Compiling bmi160.c
Compiling bmi160_wrapper.c
Compiling lsm6ds3.c
Compiling FusionAhrs.c
Compiling FusionBias.c
Compiling FusionCompass.c
Compiling bm_if.c
Compiling swdptap.c
Compiling timing.c
Compiling platform.c
Compiling exception.c
Compiling swdptap_generic.c
Compiling target.c
Compiling adiv5_swdp.c
Compiling adiv5.c
Compiling cortexm.c
Compiling nrf51.c
Compiling stm32f1.c
Compiling stm32f4.c
Compiling stm32h7.c
Compiling stm32l0.c
Compiling stm32l4.c
Compiling qmlui.c
Compiling encoder.c
Compiling encoder_cfg.c
Compiling enc_abi.c
Compiling enc_ad2s1205.c
Compiling enc_as5x47u.c
Compiling enc_as504x.c
Compiling enc_bissc.c
Compiling enc_mt6816.c
Compiling enc_sincos.c
Compiling enc_tle5012.c
Compiling enc_ts5700n8501.c
Compiling conf_custom.c
Compiling env.c
Compiling fundamental.c
Compiling heap.c
Compiling lbm_memory.c
Compiling print.c
Compiling stack.c
Compiling symrepr.c
Compiling tokpar.c
Compiling extensions.c
Compiling lispbm.c
Compiling eval_cps.c
Compiling platform_mutex.c
Compiling lbm_channel.c
Compiling lbm_c_interop.c
Compiling lbm_variables.c
Compiling lbm_custom_type.c
Compiling lbm_flags.c
Compiling lbm_flat_value.c
Compiling lbm_prof.c
Compiling array_extensions.c
Compiling math_extensions.c
Compiling string_extensions.c
Compiling lispif.c
Compiling lispif_vesc_extensions.c
Compiling lispif_vesc_dynamic_loader.c
Compiling lispif_c_lib.c
Compiling commands.c
Compiling comm_usb_serial.c
Compiling comm_usb.c
Compiling comm_can.c
Compiling packet.c
Compiling log.c
Compiling foc_math.c
Compiling gpdrive.c
Compiling mc_interface.c
Compiling mcpwm.c
Compiling mcpwm_foc.c
Compiling virtual_motor.c
Compiling buffer.c
Compiling crc.c
Compiling digital_filter.c
Compiling mempools.c
Compiling utils_math.c
Compiling utils_sys.c
Compiling worker.c
Compiling minilzo.c
Compiling eeprom.c
Compiling i2c_bb.c
Compiling ledpwm.c
Compiling servo_dec.c
Compiling servo_simple.c
Compiling spi_bb.c
Compiling timer.c
Compiling SX1278.c
Compiling lora.c
Compiling SX1278_hw.c
Compiling spi_sw.c
Compiling rf.c
Compiling rfhelp.c
Compiling nrf_driver.c
Compiling misc.c
Compiling stm32f4xx_adc.c
Compiling stm32f4xx_dma.c
Compiling stm32f4xx_exti.c
Compiling stm32f4xx_flash.c
Compiling stm32f4xx_rcc.c
Compiling stm32f4xx_syscfg.c
Compiling stm32f4xx_tim.c
Compiling stm32f4xx_iwdg.c
Compiling stm32f4xx_wwdg.c
Linking /home/shaolinggan/桌面/vesc/bldc/build/hd60/hd60.elf
Creating /home/shaolinggan/桌面/vesc/bldc/build/hd60/hd60.hex
Creating /home/shaolinggan/桌面/vesc/bldc/build/hd60/hd60.bin
Creating /home/shaolinggan/桌面/vesc/bldc/build/hd60/hd60.dmp

   text	   data	    bss	    dec	    hex	filename
 454284	   4516	 173036	 631836	  9a41c	/home/shaolinggan/桌面/vesc/bldc/build/hd60/hd60.elf
Creating /home/shaolinggan/桌面/vesc/bldc/build/hd60/hd60.list

Done
make[1]: 离开目录“/home/shaolinggan/桌面/vesc/bldc”
shaolinggan@shaolinggan-virtual-machine:~/桌面/vesc/bldc$ 

3:烧录固件

使用stlink将刚才编译好的固件下载到驱动板上。(这个固件可以理解为方便和上位机互连的测试固件,下面还会在上位机中更新boot loader和正式固件)
在这里插入图片描述

4:下载上位机

在本杰明驱动的官网上下载。
官网链接:https://vesc-project.com/vesc_tool

5:连接上位机调试

5.1:将主板和电机、电源、电脑连接。(电源电压根据电机的参数来定。最大48V)
连接实物图
2:打开上位机并连接到驱动板,下载bootloader和固件。
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

这里最新的固件不支持,如果有人弄懂请跟我说一声。谢谢!!!

最新的固件会弹出:Detection failed. Reason: Under voltage fault , check voltage is adove set limit. If using power supply make sure the current limit is high enough.
我使用的是可调电源供电:16V、 6.1A(max)

5.2:测试主板

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

注意:电机刚开始运行时会有啸叫声,属于正常现象。

未完待续。。。

参考资料

项目资料:https://github.com/linggan17/VESC

  • 11
    点赞
  • 27
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值