cancel
Showing results for 
Search instead for 
Did you mean: 

some structure(like CSPD_t) in FOC 4.1

iwos2610
Associate
Posted on July 23, 2015 at 11:47

I want to use some other mag encoder(SPI interface) in my project ,now i have finished the driver of it in FOC project,but I don't know how to input the speed data I get ,I find the function :bool SPD_CalcAvrgMecSpeed01Hz(CSPD this, int16_t *pMecSpeed01Hz);

but I don't know what is the class CSPD ,and how can I input my speed data to it.can anyone get me some help?

#foc-4.1 #cspd_t
2 REPLIES 2
Gigi
ST Employee
Posted on September 07, 2015 at 15:08

Ciao

To understand how to build own classes compatible with the FW FOC structure I suggest to read the UM1053 - Advanced developers guide for STM32F MCUs PMSM single/dual

FOC library

And also to take a look to the code itself. In this case into the files

SpeednPosFdbkClass.c

and derived classes:

xxx_SpeednPosFdbkClass.c

The function SPD_CalcAvrgMecSpeed01Hz is used by the FW to get information of the speed of the motor, and it is mandatory that the derived classes implements it.

But it is also mandatory for the derived class to implement the computation of the electrrical angle SPD_CalcAngle and the get of the angle SPD_GetElAngle.

Take a look to the description of each functions inside SpeednPosFdbkClass.c and to the derived Classes for the functions implementation.

Ciao

Gigi

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