ST MotorControl Workbench 6.2.1 使用总结

目录

前言

软件安装

根据自己硬件配置参数

生成代码

开发板运行

​ 总结


前言

好久没有玩ST的电机库了,已经更新到了MotorControl Workbench 6.2.1,6以上的版本比5的版本界面操作有很大的不同,核心算法有些增加。最近体验了一把使用自定义硬件配置生成代码运行,感受就是如果用官方的硬件,直接配置更容易,但是使用自己的硬件,配置起来就比较麻烦,这里总结一下遇到的一些坑。

主要用到的软件:

cubemx 6.10.0

MCSDK 6.2.1

Keil V5

硬件:

自己设计的Demo板

软件安装

这一步没啥好说的,无脑安装就行了,安装好后桌面上会有这几个软件,分别是CubeMX, Keil, MCSDK6.2, 还有一个上位机。

根据自己硬件配置参数

这一步不像是5.x的版本,可以自定义硬件,用起来会更麻烦。先在Tools里配置自己的硬件。

 核心就是配置自己的功率板和控制板,因为Demo板是自定义的 ,功率和控制都整合在一起了,所以需要做一些调整,除此之外采样电阻,运放增益,母线电压分压比等需要根据实际进行配置。

不像老版本可视化配置,还可以自动计算增益。这里需要用脚本来编辑,如下脚本的代码量不是很多,Power部分主要配置运放,发波频率,发波极性,分压,温度等,代码很容易能看懂。

 Control部分也一样,主要配置引脚功能,通道,芯片型号等。配置好后就可以开始整合了。

1.设置项目名,选择电机类型控制方式

2. 选择电机,这一步可以随便选择一个,后面再配置,配置好自己的电机后会在这里出现可选的电机。

 3.前面通过脚本配置了自己的板子后,就可以在功率板这里找到相应的配置信息,并可以选择,不然只能选官方的。

4. 控制板也是如此,可以选中。

 最后的Bridge根据自己的需要可以在配置控制板的时候设置是否需要,不需要的话就不会有这个选项。

一切配置好后就来到了这个界面,在这里就和之前的版本一样了,选择传感器,配置启动参数,电机等,无非就是位置不一样了。

 可以看到电流的采样通道,运放增益和自己硬件配置的就一样了。其他母线电压采样也是如此,具体的配置细节这里不多说,内容比较多,这里先把流程搞通。

生成代码

根据使用的工具链生成代码,千万不要用中文路径,不然会报错。

 打开软件目录,一个是配置信息,一个是生成的Keil软件工程。进入软件目录,打开Keil的工程文件就可以编译了。

 编译报错了,添加下图的汇编文件即可。

Not enough information to list image symbols.
Not enough information to list load addresses in the image map.
Finished: 2 information, 0 warning and 1 error messages.
"F401_Motor105_621\F401_Motor105_621.axf" - 1 Error(s), 0 Warning(s). 

开发板运行

下载程序后,可以直接用开发板的启动按钮开机,打开Motor Pilot 6.2.1软件。

 选择上位机界面

 

 这个界面就和老板本很像了,点击连接。

 还可以点波形,查看变量的变化。

 总结

到这里,基于MotorControl Workbench 6.2.1 电机库的安装,下载运行,上位机调试的流程就结束了。很想吐槽下!!!

开发板和电机链接

This manual describes the X-CUBE-MCSDK and X-CUBE-MCSDK-FUL STM32 motor control software development kits (SDKs) designed for, and to be used with, STM32 microcontrollers. The SDKs contain a software library that implements the field oriented control (FOC) drive of 3-phase permanent magnet synchronous motors (PMSMs), both surface mounted (SMPMSM) and interior (I-PMSM). The STM32 family of 32-bit Flash microcontrollers is specifically developed for embedded applications. It is based on the following ARM® Cortex®-M cores: the Cortex®-M0 for the STM32F0, the Cortex®-M3 for the STM32F1 and STM32F2, and the Cortex®-M4 for the STM32F3, STM32F4 and STM32L4, and the Cortex®-M7 for the STM32F7. These microcontrollers combine high performance with first-class peripherals that make them suitable for performing three-phase motor FOC. The PMSM FOC library can be used to quickly evaluate ST microcontrollers, to complete ST application platforms, and to save time when developing motor control algorithms to be run on ST microcontrollers. It is written in the C language, and implements the core motor control algorithms, as well as sensor reading/decoding algorithms and sensor-less algorithms for rotor position reconstruction. This library can be easily configured to make use of the STM32F30x's embedded advanced analog peripherals (fast comparators and programmable gain amplifiers (PGAs)) for current sensing and protection, thus simplifying application boards. When deployed with the STM32F103 (Flash memory from 256 Kbytes to 1Mbyte), STM32F303 or STM32F4 devices, the library allows two motors to be driven simultaneously. The library can be customized to suit user application parameters (motor, sensors, power stage, control stage, pin-out assignment) and provides a ready-to-use application programming interface (API). A PC graphical user interface (GUI), the ST motor control workbench, allows complete and easy customization of the PMSM FOC library. Thanks to this, the user can run a PMSM motor in a very short time. A set of ready-to-use examples is provided to explain the use of the motor control API and its most commonly used features. These projects usually provide a UART interface that allows convenient real-time fine-tuning of the motor control subsystem with a remote control tool, the STM32 motor control monitor. The STM32 motor control SDK is delivered as an expansion pack for the STM32 CubeMX tool, and the PMSM FOC library is based on the STM32 Cube Firmware libraries. The list of supported STM32 microcontrollers is provided in the release note delivered with the SDK.
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

卡洛斯伊

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值