cancel
Showing results for 
Search instead for 
Did you mean: 

STM Studio - STM32 PMSM FOC LIBv4.2 variables

cviolino
Associate II
Posted on October 14, 2015 at 23:54

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.

#stm32-pmsm-foc-set-speed-in-rpm #pmsm #foc-4.2 #stm-studio
2 REPLIES 2
cviolino
Associate II
Posted on October 19, 2015 at 19:11

It worked,

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

thanks.

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