Skip to main content
Low Yik Seong
Associate III
September 4, 2018
Question

function to read current to motor

  • September 4, 2018
  • 7 replies
  • 1769 views

Hi, does anyone knows how to read current to motor by calling a function in SDK 5.2?

    This topic has been closed for replies.

    7 replies

    Fred V.
    ST Employee
    September 4, 2018

    Hello,

    Depending on what you actually want, there are two ways:

    • Use MC_GetPhaseCurrentAmplitudeMotor1() or MC_GetPhaseCurrentAmplitudeMotor2() to get the amplitude (0 to peak value) of the current that globally flows into the motor;
    • Use MC_GetIabMotor1() or MC_GetIabMotor2() to get the values of the motor's phases currents. The function returns Ia, Ib and lets you deduce Ic.

    These values are expressed in S16A unit. To convert them into Amperes, use the formula displayed in the reference documentation for function MC_GetPhaseCurrentAmplitudeMotor1().

    Diandi Zhu
    Associate II
    September 5, 2018

    Hi Fred,

    Where can I get the reference document you mentioned

    Thanks

    Fred V.
    ST Employee
    September 18, 2018

    Hello Diandi,

    Sorry for the late answer. The reference document is accessible from the Motor Control Workbench: in menu "Documentation", select item "Firmware Reference".

    Alternatively, you can browse to the folder where the Motor Control SDK is installed (e.g. C:\Program Files (x86)\STMicroelectronics\MC_SDK_5.2.0) and go in the "Documentation" subdirectory. There, you'll find the MotorControlSDKFirmware.chm file. Simply double-click on it and the reference documentation will open.

    Best Regards,

    Fred.

    frank239955
    Associate II
    April 18, 2019

    Dear Fred

    if i don't call "MC_StartMotor1() " this function but just call "​MC_GetIabMotor1() "

    can i get the current flow to motor?

    VSHAR.7
    Visitor II
    May 8, 2019

    Hello Frank,

    The current will start to flow in the motor only after MC_StartMotor1() is executed, So without this the MC_GetIabMotor1() function will only return 0.

    SkyWork
    Associate III
    April 16, 2020

    Hello VSHAR

    I found that the the phaseCurrent value by calling MC_GetPhaseCurrentAmplitudeMotor1() is not inaccurate during heavy load ex when climbing the hill

    Is there any way to fix this problems?  

    CHuan.8
    Associate
    October 12, 2021

    I am an newbie​ in the motor control + IAR

    Is there any guidance document to teach how to display current in s16a format in IAR debug mode?