cancel
Showing results for 
Search instead for 
Did you mean: 

Errors in motor control library

Davide Zanni
Associate II
Posted on July 11, 2018 at 11:21

I use the SDK 4.3 and I have found this errors:

- in open loop mode when enabled the V/F mode and reverse rotation the OL_Calc when increase the absolute speed, the voltage decrease

void OL_Calc(COL this)

{

  pVars_t pVars = CLASS_VARS;

  if (pVars->VFMode == TRUE)

  {

    /* V/F mode TRUE means enabled */

    int16_t hMecSpeed01Hz = SPD_GetAvrgMecSpeed001Hz(pVars->oVSS);

    if (hMecSpeed01Hz >= 0)

    {

      int16_t hOLVoltage = pParams->hVFOffset + (pParams->hVFSlope*hMecSpeed01Hz);

      pVars->hVoltage = hOLVoltage;

    }

    else

    {

      int16_t hOLVoltage = pParams->hVFOffset - (pParams->hVFSlope*hMecSpeed01Hz);

      pVars->hVoltage = -hOLVoltage;

    }

  }

}

- when enable the startup on the fly, sometimes the initial speed is high (when the motor is stopped) because the read of the current is wrong. The source of the problem is the procedure of calibration. To solve the problem in the file MCTask.c I initialize the variable Iab to zero in functions TSK_HighFrequencyTask and FOC_CurrController

Curr_Components Iab = {0,0}

- in the startup on the fly sometimes with GCC and optimization enabled (-O2) the function RUC_Exec could go in HardFault_Handler. The source of the problem is the use of a NULL pointer for read the duration of the phase. Infact the pointer pVars->pPhaseParams could be NULL

  pRUCPhasesParams_t pPhaseParams = pVars->pPhaseParams;

  uint16_t hDurationms = pPhaseParams->hDurationms; /*Duration of the rev up phase*/
8 REPLIES 8
cedric H
ST Employee

Dear Davide,

I would like to understand why do you still use the 4.3 version of the library.

This version is not maintained and will not be patched. It would be a great help if you explain us why do you still use it. Perhaps did you face some issue with the 5.x . Or some limitation we are not aware of.

Thanks for your feedback

Regards

Cedric

KF Lam
Associate II

Davide Zanni, Thanks. I modified the code you posted and the "startup on the fly" feature becomes much more stable than before.

Davide Zanni
Associate II

I have founded another error in the startup on the fly. The first two current reading from the ADC are wrong, so I dischaged it. In function FOC_CurrController when the state is START, then for two times after the call to PWMC_GetPhaseCurrents, I set the components of the variable Iab to 0.

This error is present also in version 5.2

PBo
Associate III

Dear Davide,

Thanks a lot for your shared feedback. We will investigate about it, and let you know about the outcome.

Best Regards

Patrice

Davide Zanni
Associate II
--- Messaggio Automatico ---
Questa mail verra' disabilitata a breve.
Prego inviare nuove mail all'indirizzo d.zanni@signal.it
Claire O.
ST Employee

Dear all,

For your information, this problem has been fixed in last SDK5.3 release.

Thanks and best regards,

Claire

Davide Zanni
Associate II
--- Messaggio Automatico ---
Questa mail verra' disabilitata a breve.
Prego inviare nuove mail all'indirizzo d.zanni@signal.it
Laurent Ca...
Lead II

The question has been moved from the "Motor Control Hardware" section to the "STM32 Motor Control" section (the question is about the STM32 MC SDK). 

Best regards