cancel
Showing results for 
Search instead for 
Did you mean: 

STM Studio - STM32 PMSM FOC LIBv4.2 - Speed Variable

cviolino
Associate II
Posted on October 19, 2015 at 13:36

Hi, 

I am running the STM32 PMSM FOC LIBv4.2, using encoder and I am trying to visualize the variables values through the STM Studio. 

The variable names used here are the default used in the 

STM32 PMSM FOC LIBv4.2

I didn't have problems to visualize current values and speed reference like: MCIpool[0].Vars_str.hFinalSpeed and FOCVars[0].Iqdref.qI_Component1. 

I haven't found the variable that represents the current rotor speed value. I thought that would be  MCTpool[0].Vars_str.MCTuningInitStruct.oSpeedSensorMain, but this variable does not change its value when the speed is changed. It Doesn't matter the value of the rotor speed shown by the ST Motor Control Workbench (That changes correctly when I change the speed reference), the MCTpool[0].Vars_str.MCTuningInitStruct.oSpeedSensorMain keeps its value in 536872924.

My question is: 

Is the variable MCTpool[0].Vars_str.MCTuningInitStruct.oSpeedSensorMain the one that shows the current rotor speed?

Regards.

#stm-studio #stm32-pmsm-foc-set-speed-in-rpm #stm32-pmsm-foc #motor-control
1 REPLY 1
cviolino
Associate II
Posted on October 19, 2015 at 19:06

It worked,

speed = (int32_t)(MCI_GetAvrgMecSpeed01Hz(oMCI[0]) * 6); // speed in rpm

thanks.