cancel
Showing results for 
Search instead for 
Did you mean: 

Absolute Encoder for St Motor Control library

JEsca.1
Associate II

Dear,

I know that ST Motor control library does not support Absolute encoder, so I am trying with some difficulties to do it, I connected my motor with HALL sensor and also connected my absolute encoder with SPI, I can read the abs position without any problem, so my goal now is to replace the HALL reading sensor functions by my absolute encoder value functions.

If I understood well there are position in s16degree and speed in DDP units, and the angle used in FOC calculation is an electrical angle which is Nbr of pole paires x Mechanical angle.

so the Mechanical angle in s16degree can go from -32767 to 32767 however inside the library in FOC function :

inline uint16_t FOC_CurrControllerM1(void)

{

 qd_t Iqd, Vqd;

 ab_t Iab;

 alphabeta_t Ialphabeta, Valphabeta;

 int16_t hElAngle;

 uint16_t hCodeError;

 SpeednPosFdbk_Handle_t *speedHandle;

 speedHandle = STC_GetSpeedSensor(pSTC[M1]);

 hElAngle = SPD_GetElAngle(speedHandle);

 PWMC_GetPhaseCurrents(pwmcHandle[M1], &Iab);

 Ialphabeta = MCM_Clarke(Iab);

hEIAngle is defined as int16_t also how this is possible since ElAngle is at least 2 times Mechanical angle ?

Regards

3 REPLIES 3
KKuma.3
Associate III

@JEsca.1​  I am also trying to integrate an absolute encoder as you have described , were you able to get the any answer for this question?

JEsca.1
Associate II

Hi I never got answer about that question

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