MCSDK中转速环和电流环PID计算


参考信息

去“电堂科技”网站 搜索视频可以看到具体视频讲解
视频参考了电堂科技-基于MC SDKV5.4电机库的STM32电机控制理论与实战-FOC控制原理上

计算方法

根据视频截图,ST官方采用的是传统的根据传递函数推导的方式,具体计算公式都在视频中出现,那么按照视频中方式进行验证计算,能够推导出与MCSDK显示相同的PI参数就认为成功。

一、MCSDK中电机数值展示

首先对我在MCSDK所用的电机参数进行截图
在这里插入图片描述
电机参数图1
在这里插入图片描述
电机参数图2
在这里插入图片描述
速度环和电流环 kp ki计算

二、电流环计算

在这里插入图片描述
电流环计算公式图

2.1.电流环计算参数

电感LS 截止频率WC 直流母线电压VBUS 采样电阻 Rshunt PWM周期T. 放大器增益AOP

2.2.根据截图得到的参数数值

VBUS=48V Rshunt=0.005 AOP=20 Ls=0.07 ω=2000 RS=0.05

2.3.电流环计算

AB=480.00520/3.3 =1.45
Kp=0.0070.012000/AB= 0.096 =1576.96/16384
Ki=0.05*2000/15000/AB=0.00459= 75/16384

2.4.电流环计算要点

1RS和RSHUNT不是一个电阻,要注意区分
2WB中PID系数除数自动变化,改参数需要时刻注意

三、转速环计算

在这里插入图片描述
转速环计算公式图

3.1.转速环计算参数

转动惯量 J 摩擦阻力 F 放大器增益GOP 采样电阻 Rshunt 反电动势常数ke
极对数p

3.2.根据截图得到的参数数值

J=5 F=10 GOP=20 Rshunt=0.005 ke=8.3 p=10

3.3.转速环计算

Fb_ASR=0.5/51030=30
kr=1.50.81608.3/1000/2/3.14=0.09711
k=65536
0.00520/3.3/kr=20450
kp=5/1000000
k 23.14* Fb_ASR *10/10= 19.25 = 2465/128
ki= kp 1/510/1000=0.0385=630/16384

3.4.转速环计算要点

1放大器增益表示方式和电流环不一致,电流环是AOP 这便是GOP 但是实际物理意义一样
2计算的单位都是mcsdk默认单位,但是实际数值一般都需要进行单位变换

  • 3
    点赞
  • 22
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 2
    评论
V5.4.4完整版/2020年5月 STM32电机控制软件开发套件(MCSDK)- 完整源代码 主要变化: Version 5.4.4 is mostly a bug fix release of X-Cube-MCSDK v5.4.3. It also introduces some new feature. ◾Added Support for PFC on STM32F3. This support is added as an example for the STEVAL-CTM010V1 Dual motor demo board. ◾Atollic TrueSTUDIO & SW4STM32 Deprecation. Atollic TrueSTUDIO and SW4STM32 IDEs are no longer actively developed and ST's strategy is to replace them with STM32CubeIDE. Recent STM32 series like STM32G4 devices for instance, are already not supported by all these IDEs. In a near future release of the Motor Control SDK, support for these IDE will be dropped and it will not be possible anymore to generate a project for them from the Workbench. ◾Introduced a workaround for the issue with injected ADC conversions that exists on STM32G4xx Cut 2.2 devices. See the dedicated section below for more details. ◾Reintroduced the correct ST Motor Profiler version (the same as release 5.4.1 of the SDK). The Motor Profiler delivered with MCSDK 5.4.2 and 5.4.3 was incomplete. ◾Fixed an issue with the faulty setting of the maximum application current for the second drive in dual drive configurations ◾Fixed an issue with Position Control configurations using an absolute position encoder (with Z signal). ◾Fixed another issue with Position Control where a division by 0 was possible. ◾Fixed a bootstrap capacitor charge issue in ICS configurations ◾Fixed a SW Error that could occur during the offset measurement loop ◾Fixed a code generation issue resulting in a compilation error when enabling open loop. ◾Fixed a STM32H7 example compilation issue - missing files have been added. ◾Fixed a generation issue for some STM32G0 and STM32F0 devices where TIM2 does not exist but was referenced in the code anyway. This resulted in a compilation failure. ◾Fixed an issue with STM32F1 HD devices in single shunt configurations ◾In the workbench, the maximum PWM frequency can now be set as high as 500 KHz. ◾Fixed an issue due to the limited RShunt resolution. Now, values such as 0.00025 Ω are accepted. ◾Fixed an issue with NVIC configuration for IHM34V2 inverter boards. ◾Fixed a Workbench issue that resulted in a wrong pin assignment when creating new projects based on the NUCLEO-G431RB control board. See section Pin assignment with NUCLEO-G431RB for more details. ◾Fixed an issue that resulted in incorrect overcurrent settings with some power boards. See section Over current settings correction for some power boards ◾Enable users to select DAC channel 2 with STM32L452
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

超级馒头神

看看谁给我第一个打赏。太感谢您

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

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

打赏作者

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

抵扣说明:

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

余额充值