2015-07-23 02:47 AM
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_t2015-09-07 06:08 AM
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 Gigi2021-06-27 10:53 PM
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