cancel
Showing results for 
Search instead for 
Did you mean: 

STM32 FOC V3.2, how do i get the speed (RPM) info?

supakit
Associate II
Posted on January 23, 2014 at 13:58

Hi

In PMSM FOC v3.2

which register store the speed RPM value?

Thanks

3 REPLIES 3
Gigi
ST Employee
Posted on January 23, 2014 at 15:02

Ciao Wong

Can you be a little more precise in your request?

Are you meaning the registers present in the Workbench->Monitor->Registers tab? That basically are the registers defined in the serial protocol implemented between firmware and the Workbench. 

And are you referring to the measured speed, target current speed or final target speed of a ramp command?

Ciao

Gigi

supakit
Associate II
Posted on January 24, 2014 at 04:55

Hi Gigi

yes i'm referring the measured speed in firmware.

how can i access this value. 

Gigi
ST Employee
Posted on January 24, 2014 at 09:51

Ciao Wong

It is pretty easy. You can use the MCI_GetAvrgMecSpeed01Hz function. This function returns the measured speed of the motor expressed in tenths of mechanical Hz.

For example, in the main.c inside the while loop, you can call:

MCI_GetAvrgMecSpeed01Hz(oMCI[0]) * 6 -> Measured speed in RPM

You can take a look at the included Doc\STM32 FOC PMSM FW library v3_x developer Help file.chm -> Modules -> STM32_PMSP_MC_Application -> MCInterface -> MCInterface class exported methods for further details.

Ciao

Gigi