# STM32_SimpleFOC
Port of SimpleFOC (https://github.com/simplefoc/Arduino-FOC/tree/v2.0.2) to STM32 environment.
Current hardware used:
* SimpleFOCShield v1.3.3
* Nucleo-H743ZI (caution board number is: MB1364, which means this is the correct user manual:
https://www.st.com/resource/en/user_manual/dm00499160-stm32h7-nucleo144-boards-mb1364-stmicroelectronics.pdf
Things to fix/change/add/general thoughts on future improvements/work:
* change PWM pins on driver board to all use TIM1.
Advantage of this is avoiding timer synchronisation issues.
At the moment use default pins 9/6/5 for PWM outputs. These pins map to PD15/PE9/PE11 on the STM32 board respectively,
and these pins have the following timer connections: TIM4(CH4) / TIM1(CH1) / TIM1(CH2).
Suggested change:
| Signal | Arduino pin name | STM32 pin name | Function |
| --------- | ---------------- | -------------- | ----------- |
| PWM A | 3 | PE13 | TIM1(CH3) |
| PWM B | 6 | PE9 | TIM1(CH1) |
| PWM C | 5 | P11 | TIM1(CH2) |
| Enable | 8 | PF3 | GPIO_Output |
| Encoder A | A2 | PC3 | GPIO_EXTI3 |
| Encoder B | A1 | PC0 | GPIO_EXTI0 |
* Avoid pulse_counter overflow. Count number of rotations, and keep pulse_counter between 0 - CPR
* Switch to dedicated timer hardware for encoder pulse count. Requires hardware signal re-routing.
Unresolved questions:
* Operating in FOC position control, encoder pulse counter does not increment properly when motor is externally
pushed out of position. Hence, motor can be successfully pushed away from target position set point. Would expect this
not to happen. Something to do with electrical angle normalisation?
* When switch to SimpleFOCShield v2.0.2 (using inline phase current sensing) make sure to align encoder 0 count to Iq = 0.
没有合适的资源?快使用搜索试试~ 我知道了~
STM32_SimpleFOC:SimpleFOC的端口(https
共99个文件
h:60个
c:23个
cpp:9个
需积分: 47 40 下载量 185 浏览量
2021-03-18
08:31:56
上传
评论 8
收藏 893KB ZIP 举报
温馨提示
STM32_SimpleFOC 将SimpleFOC( )移植到STM32环境。 当前使用的硬件: SimpleFOCShield v1.3.3 Nucleo-H743ZI(警告板编号是:MB1364,这意味着这是正确的用户手册: ://www.st.com/resource/zh/user_manual/dm00499160-stm32h7-nucleo144-boards-mb1364-stmicroelectronics.pdf 修复/更改/添加/对未来改进/工作的一般想法: 将驱动板上的PWM引脚更改为全部使用TIM1。这样做的好处是避免了计时器同步问题。目前,将默认引脚9/6/5用于PWM输出。这些引脚分别映射到STM32板上的PD15 / PE9 / PE11,并且这些引脚具有以下计时器连接:TIM4(CH4)/ TIM1(CH1)/ TIM1(CH2)。建议更改: 信
资源详情
资源评论
资源推荐
收起资源包目录
STM32_SimpleFOC-main.zip (99个子文件)
STM32_SimpleFOC-main
.gitignore 175B
README.md 2KB
nucleo144_H743
STM32H743ZITX_RAM.ld 5KB
nucleo144_H743.ioc 10KB
nucleo144_H743 Debug.launch 8KB
Drivers
STM32H7xx_HAL_Driver
Src
stm32h7xx_hal_i2c_ex.c 11KB
stm32h7xx_hal_dma.c 69KB
stm32h7xx_hal_hsem.c 15KB
stm32h7xx_hal_flash.c 36KB
stm32h7xx_hal_mdma.c 63KB
stm32h7xx_hal_tim.c 250KB
stm32h7xx_hal_cortex.c 19KB
stm32h7xx_hal_gpio.c 19KB
stm32h7xx_hal_exti.c 26KB
stm32h7xx_hal_pwr_ex.c 77KB
stm32h7xx_hal_dma_ex.c 25KB
stm32h7xx_hal.c 44KB
stm32h7xx_hal_i2c.c 220KB
stm32h7xx_hal_tim_ex.c 94KB
stm32h7xx_hal_rcc.c 64KB
stm32h7xx_hal_pwr.c 33KB
stm32h7xx_hal_rcc_ex.c 118KB
stm32h7xx_hal_flash_ex.c 64KB
Inc
stm32h7xx_hal_dma_ex.h 16KB
stm32h7xx_hal_pwr.h 38KB
stm32h7xx_hal_pwr_ex.h 32KB
stm32h7xx_hal_tim.h 141KB
stm32h7xx_hal_i2c_ex.h 8KB
stm32h7xx_hal_tim_ex.h 31KB
stm32h7xx_hal_gpio_ex.h 23KB
Legacy
stm32_hal_legacy.h 209KB
stm32h7xx_hal_gpio.h 13KB
stm32h7xx_hal_hsem.h 7KB
stm32h7xx_hal_rcc.h 500KB
stm32h7xx_hal_rcc_ex.h 210KB
stm32h7xx_hal_flash.h 50KB
stm32h7xx_hal_dma.h 72KB
stm32h7xx_hal_i2c.h 37KB
stm32h7xx_hal.h 66KB
stm32h7xx_hal_flash_ex.h 46KB
stm32h7xx_hal_cortex.h 19KB
stm32h7xx_hal_exti.h 28KB
stm32h7xx_hal_mdma.h 47KB
stm32h7xx_hal_def.h 7KB
CMSIS
Include
core_cm4.h 121KB
core_sc300.h 108KB
core_armv8mml.h 165KB
core_cm33.h 171KB
cmsis_iccarm.h 28KB
cmsis_gcc.h 61KB
core_sc000.h 46KB
core_cm3.h 109KB
cmsis_compiler.h 9KB
cmsis_armcc.h 28KB
tz_context.h 3KB
core_cm7.h 145KB
core_cm1.h 42KB
mpu_armv7.h 11KB
cmsis_version.h 2KB
cmsis_armclang.h 55KB
core_cm0plus.h 49KB
mpu_armv8.h 11KB
core_armv8mbl.h 96KB
core_cm0.h 41KB
core_cm23.h 102KB
Device
ST
STM32H7xx
Include
system_stm32h7xx.h 2KB
stm32h7xx.h 9KB
stm32h743xx.h 2MB
STM32H743ZITX_FLASH.ld 5KB
Core
Startup
startup_stm32h743zitx.s 34KB
Src
sysmem.c 3KB
system_stm32h7xx.c 14KB
syscalls.c 3KB
stm32h7xx_hal_msp.c 6KB
motor_drivers
BLDCDriver3PWM.h 1KB
BLDCDriver3PWM.cpp 2KB
stm32h7xx_it.c 7KB
main.cpp 19KB
common
pid.h 1KB
time_utils.cpp 350B
base_classes
FOCMotor.cpp 8KB
Sensor.h 2KB
FOCMotor.h 7KB
BLDCDriver.h 916B
foc_utils.cpp 3KB
defaults.h 1KB
lowpass_filter.cpp 749B
time_utils.h 553B
pid.cpp 2KB
lowpass_filter.h 707B
foc_utils.h 1KB
BLDCMotor.cpp 14KB
sensors
Encoder.cpp 5KB
Encoder.h 3KB
Inc
stm32h7xx_hal_conf.h 19KB
main.h 3KB
SimpleFOC.h 641B
BLDCMotor.h 3KB
stm32h7xx_it.h 2KB
共 99 条
- 1
biuh
- 粉丝: 28
- 资源: 4736
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0