cancel
Showing results for 
Search instead for 
Did you mean: 

function to read current to motor

Low Yik Seong
Associate III

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

7 REPLIES 7
Fred V.
ST Employee

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 III

Hi Fred,

Where can I get the reference document you mentioned

Thanks

Fred V.
ST Employee

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

Dear Fred

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

can i get the current flow to motor?

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

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 II

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?