cancel
Showing results for 
Search instead for 
Did you mean: 

MC Workbench Position/Speed/Torque

Zek_De
Senior

Hi everyone, I am seeing  MC library doesnt support Position/Speed/Torque Mode in same application. Is it true? Or library support but user app functions are produced for spesific mode?

Zek_De_0-1733412610081.png

 

4 REPLIES 4
Zek_De
Senior

It looks like Position mode contains Speed and Speed mode contains torque mode. To be able to use all modes, using position mode. I compared a few .c files between Position and Speed modes, and I have seen some extra functions have been added on speed mode.

Zek_De
Senior

For example,
**************mc_tasks_foc.c **************
=====Position Mode
MCI_ExecSpeedRamp(&Mci[M1],
STC_GetMecSpeedRefUnitDefault(pSTC[M1]),0); /* First command to STC */
=====Speed Mode 
MCI_ExecSpeedRamp(&Mci[M1],
STC_GetMecSpeedRefUnitDefault(pSTC[M1]),0); /* First command to STC */
=====Torque Mode
MCI_ExecTorqueRamp(&Mci[M1], STC_GetDefaultIqdref(pSTC[M1]).q, 0);

But for torque mode, contaning functions is not valid. Assume Position Mode in project, then I can use position/speed together also torque mode is coming naturally with this modes. Is it true? My Motor control knowledge little limited which I am learning with this way.

Hello @Zek_De,

As mentioned on Release Notes for X-Cube-MCSDK 6.3.2 available through "Workbench tool">About>Documentations>Documentation>"Release Notes":

  • Position Control Mode. Position Control is possible for motor control applications using encoders for speed and position measurement (Project Build time feature. No switch to/from Torque or Speed Control modes is possible at run time when Position control mode is enabled)

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

interesting I thought this is possible because of code below.

mc_api.c
__weak void MC_ProgramSpeedRampMotor1(int16_t hFinalSpeed, uint16_t hDurationms)
{
  MCI_ExecSpeedRamp(pMCI[M1], hFinalSpeed, hDurationms);
}
__weak void MC_ProgramTorqueRampMotor1(int16_t hFinalTorque, uint16_t hDurationms)
{
  MCI_ExecTorqueRamp(pMCI[M1], hFinalTorque, hDurationms);
}
__weak void MC_ProgramPositionCommandMotor1(float_t fTargetPosition, float_t fDuration)
{
  MCI_ExecPositionCommand(pMCI[M1], fTargetPosition, fDuration);
}

This project created as position mode and I compared every .c files and I have seen position mode involve the speed mode(it means position mode include speed mode functions as extra. Why I cant call the "MC_ProgramSpeedRampMotor1" and "MC_ProgramPositionCommandMotor1" functions in the same application.