cancel
Showing results for 
Search instead for 
Did you mean: 

Current controller PI gains by SDK code generation looks different from what intended to be through space vector PWM

THA.1
Associate II

(Environment)

MC_SDK 5.Y.3 + STM32CubeMX 6.3.0 with HAL + IAR EWARM 8.5

(What I found)

In page 12, document UM2392, the current controller PI gains are

designed as follows:

​=========================================

...

​The transfer function of block "A" are expressed as:

(12) A = Vbus-dc / 65536

...

​=========================================

Then PI gains can be obtained from this A value together with the other parameters (L, R, B and cut-off frequency of PI controller).

I verified the SDK-generated PI gains(in "drive_parameters.h") are exactly the same of what I calculated from the equations.

I found, however, circle limitation and space vector implementation tell a slightly different value for A.

(a) In circle limitation, maximum voltage are limited to 32767(=max of 16bit-integer), which corresponds to the radius of the inscribed circle of space vector hexagon.

(b) From (a), maximum modulation voltage in space vector PWM becomes (2/sqrt(3) * 32767), which corresponds to the vertex of space vector hexagon.

(c) By the way, maximum modulation voltage for one phase in space vector PWM is (2/3 * Vbus-dc).

(d) From (b) and (c), we get the following correspondence:

(2/3 * Vbus-dc) ===> (2/sqrt(3) * 32767)

           Vbus-dc ===> sqrt(3) * 32767

(e) From (d), the equation (12) is not correct, but A = Vbus-dc / (sqrt(3)*32767)

This results in difference in gain calculation – (12) generates (2/sqrt(3)) times higher gains than the expected ones.

If the above is wrong, please correct my misunderstanding with detail information.

3 REPLIES 3
THA.1
Associate II

Please could someone ST member clarify this issue?

cedric H
ST Employee

Hello @THA.1​ ,

0693W00000KbyNdQAJ.pngIf you look at the picture above, the blue vector is the maximum voltage for one phase. As you mentioned, it is 2/3*Vbus.

The pink vector is the maximum reachable without doing overmodulation. It is sqrt(3)/2*Blue vector, then, sqrt(3)/2* 2/3*Vbus = Vbus/sqrt(3)

As sqrt(3)/2 is the full scale, we set it as 32768, then sqrt(3) is 65536.

If you substitute sqrt(3) by 65536, you end up with the Pink vector = Vbus/65536

I hope it is clear now.

Regards

Cedric

THA.1
Associate II

Hi Cedric,

Thank you for your answer.

I can't understand the last two descriptions:

"As sqrt(3)/2 is the full scale, we set it as 32768, then sqrt(3) is 65536.

If you substitute sqrt(3) by 65536, you end up with the Pink vector = Vbus/65536"

If Vbus=24V, what does it mean "the Pink vector = 24/65536" ?

In my terms, the Pink vector is of the full scale in [s16V] unit, that is 32768.

Vbus/sqrt(3) [Volt] = 32768 [s16V]

Then,

1 [s16V] = Vbus/ (sqrt(3) * 32768) [Volt]

My point is, this unit conversion factor from [s16V] to [Volt] should be the transfer function of block A. It is differently expressed in page 12, document UM2392 as (12) A = Vbus-dc / 65536, which leads to the different PI gains.

Regards,

THA.1