cancel
Showing results for 
Search instead for 
Did you mean: 

STSPIN32F0 six-step control

ARaj.1
Associate II

Hi, I am quoting from a previous question posted on this forum but hasn't been answered. I wanted an answer to the exact same question:

I am using the STEVAL-SPIN3201 board to control a BLDC motor.

I want to implement a position controller, so I need to hold tight the position of the rotor at a given position (1 phase to Gnd, 1 phase to pulsed Vm, and 1 floating phase).

The problem that I am encountering now, is that the Control logic gate driver embedded inside the STSPIN32F0 does not allow to set both High and Low n-channel mosfet gates at the same position (1 & 1 or 0 & 0). I understand that 1 & 1 causes a short-circuit , but I need 0 & 0 in order to set the floating phase.

Is it possible to set a floating phase on STSPIN32F0?

Thank you in advance.

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @ARaj.1​ 

In my screenshot high side output is actually LOW because it is referred to OUT pin:

  • HS LOW --> GHS - OUT = 0
  • HS HIGH --> GHS - OUT = VBOOT

About your questions:

  • if input voltage is 10V, a high voltage will be 10V, high impedance will be 5V and low voltage will be 0 V?

ANS: I guess it will be probably 10 V. I guess the high impedance value will be probably 10 V.

When the output is in high impedance, it's voltage is easily biased by any leakage. In normal conditions the main leakage comes from the integrated bootstrap diode and rise the output voltage up to VREG12. If supply is 10 V, I expect VREG12 = 10 V --> VOUT = 10 V.

  • If the above is the case what is the reason for this. Why can't both high-side and low-side gates have gate voltages of 0V, why does the output have to be in high-impedance mode when both GPIO's are low

ANS: High side gate driver output must be always referred to the OUT. This because the main objective of the circuit is apply the proper Vgs voltage on the high side MOSFET , where the source is in fact the OUT of the power stage.

Referring the high side gate driver to the ground could cause gate-source breakdown of the MOSFET-

  • As I understand it high-impedance mode is used for communication bus so that it's in a undetermined logic state. However here we are driving motors, so what is the purpose of the high-impedance mode here?

ANS: In motor driving high impedance has the main purpose to impose no current into the windings.

View solution in original post

9 REPLIES 9
Enrico Poli
ST Employee

Hi @ARaj.1​ ,

The gate driver embedded in the STSPIN32F0 implements interlocking and does not allow to turn on both high side and low side MOSFETs of the same half-bridge at the same time (HSx = 1 and LSx = 1). In this case both high side and low side MOSFETs are turned off.

The HSx = 0 and LSx = 0 configuration is valid and properly managed by the gate driver turning off both high side and low side.

This is actually the default condition you have at the start-up.

If you need to force a single phase in high impedance, you should configure the TIM1 outputs connected to that phase accordingly.

You can use the six-step code example in the latest version of the Motor Control SDK (X-CUBE-MCSDK-Y) as guideline.

Kind Regards

Enrico

I understand that HSx and LSx can't be 1 at the same time. The issue is I can't get them to be 0 simultaneously (I have confirmed this by measuring the voltage at the gate of the external high side and low side mosfets). Without setting up the timers, for example if I toggle PB13 (LS1) and PA8 (HS1) low as GPIO Outputs in the ODR, HS1 is always high and LS1 is low (at the output). The only way to drive them both low is to put the IC into standby mode i.e. OC_TH_STDBY1=0, OC_TH_STDBY1=0, which turns off all the phases and is not useful. My question is using just GPIO toggle how can we get both HS1 and LS1 low such that it is floating and the the current path is only through the other two phases.

Hi @ARaj.1​,

From the hardware point of view I can confirm you that the low-low condition is allowed, no circuitry should prevent this condition and it is used in our six-step firmware.

The gate driver die embeds pull-down forcing on all the driving inputs so even an high impedance status of the respective GPIOs should result in a low logic value.

Could you please share the code you used during your tests?

What about the voltages at the power stage output? Is the high side MOSFET on?

Yes the gate to the high side mosfet is on. I don't see how it can be software because all I am doing is initializing all the GPIO pins in CubeMX like this:

static void MX_GPIO_Init(void)

{

 GPIO_InitTypeDef GPIO_InitStruct = {0};

 /* GPIO Ports Clock Enable */

 __HAL_RCC_GPIOB_CLK_ENABLE();

 __HAL_RCC_GPIOA_CLK_ENABLE();

 __HAL_RCC_GPIOF_CLK_ENABLE();

 /*Configure GPIO pin Output Level */

 HAL_GPIO_WritePin(GPIOB, GPIO_PIN_13|GPIO_PIN_14|GPIO_PIN_15, GPIO_PIN_RESET);

 /*Configure GPIO pin Output Level */

 HAL_GPIO_WritePin(GPIOA, GPIO_PIN_8|GPIO_PIN_9|GPIO_PIN_10, GPIO_PIN_RESET);

 /*Configure GPIO pin Output Level */

 HAL_GPIO_WritePin(GPIOF, GPIO_PIN_6|GPIO_PIN_7, GPIO_PIN_SET);

 /*Configure GPIO pins : PB13 PB14 PB15 */

 GPIO_InitStruct.Pin = GPIO_PIN_13|GPIO_PIN_14|GPIO_PIN_15;

 GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;

 GPIO_InitStruct.Pull = GPIO_PULLDOWN;

 GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;

 HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);

 /*Configure GPIO pins : PA8 PA9 PA10 */

 GPIO_InitStruct.Pin = GPIO_PIN_8|GPIO_PIN_9|GPIO_PIN_10;

 GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;

 GPIO_InitStruct.Pull = GPIO_PULLDOWN;

 GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;

 HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);

 /*Configure GPIO pins : PF6 PF7 */

 GPIO_InitStruct.Pin = GPIO_PIN_6|GPIO_PIN_7;

 GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;

 GPIO_InitStruct.Pull = GPIO_NOPULL;

 GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;

 HAL_GPIO_Init(GPIOF, &GPIO_InitStruct);

}

In the main I am not doing anything, as at the start I just want both HSx and LSx to be low.

Hi @ARaj.1​,

I double checked on my side using the attached project.

All the power stage outputs are in high impedance:

0693W00000Dq3lkQAB.pngIn this condition the power stage output is weakly pull-upped at 12 V by the bootstrap circuitry as expected.

Hi @ARaj.1​ ,

Did you solved the problem? Are you now able to put the power stage phases in high impedance using the low-low inputs?

Hi Enrico, sorry for the late reply. I am trying to understand the diagram you attached. So it looks like the high side gate voltage is HIGH-Impedance not HIGH (i.e. in the middle between low and high?). The low side gate voltage is LOW on your plot.

Just some clarifying questions for my learning:

  • if input voltage is 10V, a high voltage will be 10V, high impedance will be 5V and low voltage will be 0 V?
  • If the above is the case what is the reason for this. Why can't both high-side and low-side gates have gate voltages of 0V, why does the output have to be in high-impedance mode when both GPIO's are low
  • As I understand it high-impedance mode is used for communication bus so that it's in a undetermined logic state. However here we are driving motors, so what is the purpose of the high-impedance mode here?

Thanks

Hi @ARaj.1​ 

In my screenshot high side output is actually LOW because it is referred to OUT pin:

  • HS LOW --> GHS - OUT = 0
  • HS HIGH --> GHS - OUT = VBOOT

About your questions:

  • if input voltage is 10V, a high voltage will be 10V, high impedance will be 5V and low voltage will be 0 V?

ANS: I guess it will be probably 10 V. I guess the high impedance value will be probably 10 V.

When the output is in high impedance, it's voltage is easily biased by any leakage. In normal conditions the main leakage comes from the integrated bootstrap diode and rise the output voltage up to VREG12. If supply is 10 V, I expect VREG12 = 10 V --> VOUT = 10 V.

  • If the above is the case what is the reason for this. Why can't both high-side and low-side gates have gate voltages of 0V, why does the output have to be in high-impedance mode when both GPIO's are low

ANS: High side gate driver output must be always referred to the OUT. This because the main objective of the circuit is apply the proper Vgs voltage on the high side MOSFET , where the source is in fact the OUT of the power stage.

Referring the high side gate driver to the ground could cause gate-source breakdown of the MOSFET-

  • As I understand it high-impedance mode is used for communication bus so that it's in a undetermined logic state. However here we are driving motors, so what is the purpose of the high-impedance mode here?

ANS: In motor driving high impedance has the main purpose to impose no current into the windings.

Thanks for your help. I have a much better understanding now. Will try and run the motor with available six step example.