2025-08-11 5:37 AM - edited 2025-08-11 6:03 AM
I'm learning BLDC control using the EVSPIN32G06Q1S1 and MCSDK 6.4.
The inner current loop is implemented in hardware.
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
2025-08-11 6:43 AM
Hello @VictorChiou,
Full MCSDK documentation is available through Workbench tool > About > Documentations > Documentation.
Current sensing is described in the User Manual, Current 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.
2025-08-11 7:12 AM
>> 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.
2025-08-12 4:37 AM
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:
2025-08-14 2:49 AM
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.
This implementation follows the same principles referenced in UM2124, section 3.3.1, Current mode control.
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
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