cancel
Showing results for 
Search instead for 
Did you mean: 

EVSPIN32G4 driver protection glitching during boot-up

jimmydvr
Associate II

Hi 

Recently, I am working on a 3-phase hub motor with hall sensor to be able to drive low speed accurately. I came across the EVSPIN32G4 and works fine with sensorless-PLL speed sensing by using the MC Workbench V6.3.2. I precedeed to modify the hardware board to a single-shunt resistor (Instead of 3 shunk resistors)

When changing the speed sensing to hall sensing, I started to see driver protection fault errors. Occasionally when I start ST Motor Pilot V1.2.12, the Driver Protection flickers between Orange and red, with no way of clearing the fault condition, unless I reset the STSPIN32G4 (Reset button). 

I tried increasing the Driver protection digital filter duration (Default 47.06 ns) to 941.18ns but it made no difference.

I tried unplugging the hall sensor, but the fault condition still happens. 

I checked the cubeMX code configuration and the driver protection pin (PE15) is set to Open drain with pull-up. 

I later found out that it's something to do with boot-up issue, by checking the Motor Pilot Terminal FAULTS_FLAGS (Code: 0x0019). 

Why does this happen when switching sensorless-PLL to hall sensing? Is there a way to check why it is not booting up correctly (Every time I run in debug on the STM32CubeIDE and step execute the code, it does not error out) - The firmware is as is from the code generated from the MC Workbench?

Any guidance on where to look for is greatly appreciated, as I am stomp on this situation.

 

Kind regards,

Jimmy

8 REPLIES 8
GMA
ST Employee

Hello @jimmydvr,

There is a race condition at STSPIN32G4 driver component initialization end that could trig such error (then not visible when debugging).
Could you try adding driver protection error clear after MCboot() function stpin32g4 initialization process in mc_task.c file?

    /*************************************************/
    /*   STSPIN32G4 driver component initialization  */
    /*************************************************/
    STSPIN32G4_init(&HdlSTSPING4);
    STSPIN32G4_reset(&HdlSTSPING4);
    STSPIN32G4_setVCC(&HdlSTSPING4, (STSPIN32G4_confVCC){.voltage = _12V,
                                                         .useNFAULT = true,
                                                         .useREADY = false });
    STSPIN32G4_setVDSP(&HdlSTSPING4, (STSPIN32G4_confVDSP){.deglitchTime = _4us,
                                                           .useNFAULT = true });
    STSPIN32G4_clearFaults(&HdlSTSPING4);
    /* 2ms delay for nFault signal end of process */
    HAL_Delay(2);  /* New */
    /* Clear pending BreakIn flag due to STSPIN32G4 initialization */
    LL_TIM_ClearFlag_BRK(TIM1); /* New */

    /* Applicative hook in MCBoot() */
    MC_APP_BootHook();

 

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

Hi @GMA,

Adding the clearFaults and ClearFlag still causes the same output (Toggling between FAULT_OVER / FAULT_NOW). 

The FAULTS_FLAGS is still code 0x0019

GMA
ST Employee

Hello @jimmydvr,

Could you share your generated project?

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

Hi,

I have uploaded the code, but Motor Pilot stop getting response. Checking the SFR USART1 (RDR) register, I can see it is receiving the bytes, but no transmit is happening. Before this happened (Going back yesterday), it was causing driver protection fault. 

 

Hello @jimmydvr,

Can you provide the full project directory (containing .ioc file, full code directories...)?

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

Hi,

Yes, provided as below.

 

GMA
ST Employee

Hello @jimmydvr,

I’m able to connect the MC Pilot and spin a motor with your project.
Did you modify your board according to "5.7 Single-shunt conversion" chapter in UM2850 document?
Have you made any other modifications besides those for the single shunt?

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

Hi GMA,

 

Yes, I have modified the board according to 5.7 in UM2850. At one point I have changed the gain resistors R45/R51/R54 from x7.3 to x110 (With a changed shunt resistor to 0.5mR) but reverted back to 5mR. 

 

Other modification made before the current gain changes, were to decrease the pull-up of the hall-effect sensor R78/R79/R80 (From 10K to 330R), R81/R82/R83 (From 10K to 1K8) and changed the capacitors C34/C35/C36 (From 1nf to 10nf).