cancel
Showing results for 
Search instead for 
Did you mean: 

Document about current loop (EVSPIN32G06Q1S1)

VictorChiou
Associate II

I'm learning BLDC control using the EVSPIN32G06Q1S1 and MCSDK 6.4.

The inner current loop is implemented in hardware.

VictorChiou_0-1754915625093.png

The current feedback goes to an op-amp PI controller (I think?),
then is compared with a reference voltage.
The reference voltage level depends on the TIM17 PWM duty cycle.
The comparison result goes to TIM1 ETR.

There is no documentation for this.
I need a manual or design guide for selecting the capacitor and resistor values in the PI controller.

 

I found a description of current loop control in X-CUBE-SPN7,
UM2124 section 3.3.1 “Current Mode Control,”
but it is not included in the MCSDK or EVSPIN32G06Q1S1 documentation.
The principle looks similar to peak current mode control in switching power.

Can anyone confirm this or provide me with the correct documentation?
After all, UM2124 is not intended for the EVSPIN32G06Q1S1.

Thanks

 

4 REPLIES 4
GMA
ST Employee

Hello @VictorChiou,

Full MCSDK documentation is available through Workbench tool > About > Documentations > Documentation.
Current sensing is described in the User ManualCurrent sampling chapter.
Refer to stspin32g0601 datasheet documentation for system-in-package description.
Workbench tool also provides feature descriptions: external amplification is described in the schematic. For overcurrent protection, the internal comparator is used, so the CPOUT signal is not used.

GMA_0-1754919408368.png

 

  

If you agree with the answer, please accept it by clicking on 'Accept as solution'.
Best regards.
GMA

>> Full MCSDK documentation is available through Workbench tool
>> Refer to stspin32g0601 datasheet documentation for system-in-package description.

This circuit is on the EVSPIN32G06Q1S1 board,
not an STSPIN32G0601 function, and not a software function.

I cannot find any chapter about this circuit in STSPIN32G0601 datasheet or in MCSDK documentation.
Please check.

 

>> For overcurrent protection, the internal comparator is used, so the CPOUT signal is not used.

I already know that OCP uses CIN, which is connected to the internal comparator,
and the VREF is constant 460 mV .

But it is not what I am discussing right now.

 

 

Dear @GMA 

I'm using 6-step, not FOC.
I'm sorry for missing this key information earlier.

Let me organize the information I found and the questions I need to confirm:

  1. From this wiki page,
    I found a current-sensing op amp design that looks almost the same as the EVSPIN32G06Q1S1, but without the capacitor.
    VictorChiou_1-1754998476125.pngVictorChiou_2-1754998496596.png
    Is this the current-sensing method used by EVSPIN32G06Q1S1 in 6-step mode?
  2. Following point 1 —
    in FOC mode, the EVSPIN32G06Q1S1 needs R91 and R39.
    But in the wiki's single-shunt examples, I don't see this design.
    Instead, it looks more like this 3-shunt version .
    VictorChiou_0-1754998376188.png
    Are these two resistors for offset? Or do they do something else?

  3. From this wiki section,
    I see a current loop design that looks almost the same as the EVSPIN32G06Q1S1.
    VictorChiou_3-1754998566090.pngVictorChiou_4-1754998587956.png
    Is this the current loop used by EVSPIN32G06Q1S1 in 6-step mode?

  4. In UM2124, I found a current loop design that looks almost the same as the EVSPIN32G06Q1S1.
    Is this the current loop used by EVSPIN32G06Q1S1 in 6-step mode?

  5. Following point 3 —
    The wiki says: "It must not be used in custom designs yet".
    Does this mean I should not change the current shunt resistor value and should not change the op amp gain?

Hi VictorChiou
Documentation for STMicroelectronics boards is generally available on the STMicroelectronics website. It can be accessed through the MCSDK 6.4.0 workbench documentation using the following link as an example

EVSPIN32G06Q1S1 - 3-phase inverter based on STSPIN32G0601 - STMicroelectronics

You are referring to the "current mode" drive of the 6-step algorithm. The relevant information about this drive mode is available in the MCSDK 6.4.1 Workbench, under the "current sensing" section.FabriceLOUBEYRE_0-1755097077832.png

 

This implementation follows the same principles referenced in UM2124, section 3.3.1, Current mode control.

FabriceLOUBEYRE_1-1754928033924.png

The "shunt current" coming from phases after amplification is compared to a "current reference" generated by the MCU trough a general purpose PWM Timer. As soon as the motor current reaches the "current reference" threshold, the ETR input turns PWM signals off of the Advanced-control timer.

The shunt value and the AOP gain (resistor bridge) must be designed to match the comparison.

The speed PID will deal with the "Current reference" duty cycle. The KP will control  the stability of the speed, and the KI more the speed variation during a change of speed

The schematic of the board is also available on the ST website:

EVSPIN32G06Q1S1 - 3-phase inverter based on STSPIN32G0601 - STMicroelectronics

FabriceLOUBEYRE_1-1755098784963.png

 

 

To answer your questions:

1. Yes, to perform current sensing, you need a shunt resistor (Rs) that is defined based on the current. The boards provide an Rs for a range of currents, which is not optimal. It should have a low resistance to minimize power loss and voltage drop but be high enough to produce a measurable voltage. This voltage is then amplified to enable comparison.

1. Yes, they are placed for offset purposes, in cases where the voltage across a low-value shunt resistor is very small or when DC offset or noise in the measurement chain significantly distorts the current measurement.

3. Yes, this is the comparison between the shunt current and the current reference.

4. Yes, it is.

5. The Rs and AOP gain are designed to match the maximum current of the board. If you have a motor with a lower current, you need to change either Rs or AOP gain to match your requirements.

 

Best Regards.

Fabrice