cancel
Showing results for 
Search instead for 
Did you mean: 

Foc 3 Shunt Current Sensing Bug Report

LahmYang
Associate

MCSDK Version: 6.4.1 Build: 250722.224358

 

uint16_t R3_2_SetADCSampPointSectX_OVM(PWMC_Handle_t *pHdl)

LahmYang_0-1763199178726.png

 

Line 1246.

 

Should there be Tcase2? 

 

Tcase3 here is wrong, Tcase2 with no caller.

1 ACCEPTED SOLUTION

Accepted Solutions
GMA
ST Employee

Hello @LahmYang,

Thank you for your report. The corrected firmware is as follows:

uint16_t R3_2_SetADCSampPointSectX_OVM(PWMC_Handle_t *pHdl)
{
  uint16_t retVal;
... 
      /* In every sector there is always one phase with maximum complementary duty, one with minimum 
       * complementary duty and one with variable complementary duty. In this case, phases with variable
       * complementary duty and with maximum duty are converted and the first will be always the phase
       * with variable complementary duty cycle */
  
      if ( DeltaDuty >= pHandle->pParams_str->Tcase3 )
      {
        SamplingPoint = pHdl->lowDuty - pHandle->pParams_str->Tbefore;
      }
      else
      {
        /* Case 2 (cf user manual) */
        if ( ( pHandle->Half_PWMPeriod - pHdl->lowDuty ) > pHandle->pParams_str->Tcase2 )
        {
          /* ADC trigger edge must be changed from positive to negative */
          pHandle->ADCTriggerEdge = LL_ADC_INJ_TRIG_EXT_FALLING;
          SamplingPoint = pHdl->lowDuty + pHandle->pParams_str->Tbefore;
        }

This issue will be reported to the dedicated team to address and correct it for future deliveries.

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

View solution in original post

1 REPLY 1
GMA
ST Employee

Hello @LahmYang,

Thank you for your report. The corrected firmware is as follows:

uint16_t R3_2_SetADCSampPointSectX_OVM(PWMC_Handle_t *pHdl)
{
  uint16_t retVal;
... 
      /* In every sector there is always one phase with maximum complementary duty, one with minimum 
       * complementary duty and one with variable complementary duty. In this case, phases with variable
       * complementary duty and with maximum duty are converted and the first will be always the phase
       * with variable complementary duty cycle */
  
      if ( DeltaDuty >= pHandle->pParams_str->Tcase3 )
      {
        SamplingPoint = pHdl->lowDuty - pHandle->pParams_str->Tbefore;
      }
      else
      {
        /* Case 2 (cf user manual) */
        if ( ( pHandle->Half_PWMPeriod - pHdl->lowDuty ) > pHandle->pParams_str->Tcase2 )
        {
          /* ADC trigger edge must be changed from positive to negative */
          pHandle->ADCTriggerEdge = LL_ADC_INJ_TRIG_EXT_FALLING;
          SamplingPoint = pHdl->lowDuty + pHandle->pParams_str->Tbefore;
        }

This issue will be reported to the dedicated team to address and correct it for future deliveries.

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