前言
本文介绍了如何在ST的MCSDK 6.x中,通过撰写配置文件,以实现自定义的控制套件。
关键词:FOC
,MCSDK
,STM32
,STMC Board Manager
准备
在启动MCSDK后,需要选择电机,控制器和驱动器。对于Modular
,需要分别配置Power Board
和Control Board
,Inverter
只需要配置单个文件即可。
在主页面 点击Tools -> Boards Manager
,即可对配置文件进行编辑。如图1所示,可以查看、复制现有的配置文件,或者创建新配置文件。
图1:STMC Board Manager
创建配置文件
点击Inverter
,点击右下角的+
,创建新的文件。
图1:STMC Board Manager
基础配置
按照提示,随便填些参数
{
"type": "inverter",
"descVersion": 4,
"contentVersion": "1.0",
"name": "my_self_control",
"PN": "0",
"mcu": "STM32",
"clockFrequency": 170,
"clockSource": "1",
"motorDrives": []
}
其中mcu
, clockSource
, motorDrives
的具体参数我们不知道并且没提示。
在软件安装目录下\MC_SDK_6.2.1\Utilities\PC_Software\STMCWB\assets\hardware\mcu
,有所有支持的mcu
配置文件, 我们能配置的MCU
型号只能从其中选择。这里我们选择STM32G431KBUx
。
clockSource
可以参考官方wiki 2.3.1 Specific properties 一节,对应的有四个参数:
Value | Description | supported MCUs |
---|---|---|
internal_osc | The source of the clock is the internal oscillator. | All MCUs |
8_crystal | The source of the clock is an 8 MHz crystal. | All MCUs |
24_crystal | The source of the clock is a 24 MHz crystal. | STM32G4xx and STM32G0xx |
48_crystal | The source of the clock is a 48 MHz crystal. | STM32G4xx |
选择自己驱动板对应的即可。
motorDrives
参考别的配置文件,motorDrives
配置较为复杂,还好有部分提示,跟着提示先一步一步填。
Missing property "name".
Missing property "maxRatedVoltage".
Missing property "minRatedVoltage".
Missing property "maxRatedCurrent".
Missing property "features".
前4个参数填起来轻轻松松,按照实际电路填写即可。
"motorDrives": [
{
"name": "M1&