cancel
Showing results for 
Search instead for 
Did you mean: 

How to drive StSPIN32G4's Gate

Szhen.11
Associate II

I spent a long time trying the following three methods, but still failed to drive the grid successfully.

1. I checked Google and found that there was no information or tutorial about it. Then I found a situation similar to mine in the forum. I just wanted to drive its grid, and I didn't plan to use the MCSDK generation project, only the FOC algorithm I wrote.

​https://community.st.com/s/question/0D53W00001ksY7VSAU/stspin32g4-how-to-individually-drive-gate-driver-outputs-for-testing-purposes

According to the method in the forum, I open the ioc file of the project generated by the MCSDK, set the IO of the six drive gate to the GPIO output port, and then change its high and low levels in the code. However, there is no change. The high side gate is always open, and the low gate grid is all closed.

0693W00000Y8oiAQAR.png

0693W00000Y8oitQAB.pngor

0693W00000Y8onUQAR.png

2. The empty project generated by cubemx only sets several IO ports corresponding to the gate drive as GPIO. Then I change the high and low levels of gate IO, but the high side gate is always fully open and the low side gate is fully closed.

3.After reading the data manual again, I found that the internal grid driver needs to be initialized and reset through the I2C bus before it can be used normally. Then I copy stspin32g4.c and stspin32g4.h in the project generated by MCSDK to my project, and after the operation of the following code, it is still in the state that the high side gate is fully open and the low side gate is fully closed.

0693W00000Y8oo8QAB.png

In general, I should be able to ensure that there is no problem with the hardware. My hardware is 100% made by imitating EVSTSPIN32G4. And the code generated by the MCSDK can make the motor move for a while, and then the startup error will be displayed. So this shows that there is no problem with my hardware, and the level of the grid can be changed, but I haven't found any skills in the software that drives the grid

So,​I want the easiest way to drive the gate.

3 REPLIES 3
Szhen.11
Associate II

​I'm sorry, I made a mistake.

At first, I simply thought that when the high-side grid was 8.8V, the high-side grid was turned on. After learning, I learned that a voltage value higher than the power supply voltage will be generated when the high side is on, so it can be considered as high side conduction.

In fact, I have always been in the state that all the gates are closed. I observed the internal register state through I2c, and found that it was Vds overvoltage protection. I had never thought of this reason before, because the project generated by mcsdk was transited several times. Then I canceled the Vds protection by pulling up the SCARF pin. Then control the IO port of the grid. When the low side is on, the high side grid is 0V, the low side grid is 12V, the low side is on, and the high side is off. In this case, it takes a long time to charge the bootstrap capacitor, then turn off the low-side grid and turn on the high-side grid, but the high-side grid is always 8.8V, and the source level is 8.8V.

Basically,​I want to know how to control the conduction of high side MOS. ​

Cristiana SCARAMEL
ST Employee

Hello @Szhen.1​,

the high side drivers supply voltage is generate through a bootstrap technique refer to the STSPIN32G4 datasheet (5.2.4 section and following).

A limitation in a bootstrap architecture is that the high-side MOSFET cannot stay on for an indefinite amount of time. In fact, when the high-side is on, the respective bootstrap capacitor starts discharging. If not recharged, the bootstrap capacitor voltage falls below the UVLO threshold (VBO(On) - VBO(Hyst)).

For this reason, working at 100% duty cycle is possible, but only for a limited number of PWM periods.

I suggest to set a proper PWM instead of high level of GPIO to test the driver section.

By default the VCC value is 8 V, if I understand well you set 12 V for the buck regulator. The voltage drop on the bootstrap capacitors corresponds to the supply of the high-side drivers: can you measure this voltage (for example with a differential probe)?

Where you are measured 8.8 V?

If you feel a post has answered your question, please click "Accept as Solution"
Szhen.11
Associate II

thank you for your help!

A limitation in a bootstrap architecture is that the high-side MOSFET cannot stay on for an indefinite amount of time​,I understand why I can't drive. The bootstrap capacitance of 1uF should not be maintained for too long. I used GPIO to charge and discharge with a 100ms delay, which is too large. After changing the charging and discharging to 1ms, I measured the gate voltage of 21V with a multimeter. Because I don't have an oscilloscope, I can only use a multimeter to measure. I will only be better if I change to a complementary PWM for testing. At the same time, I set a 12V for the buck regulator. When the delay is 100ms, or after power-on, I do nothing. I use a multimeter to measure the voltage between the grid and the ground is 8.8V