cancel
Showing results for 
Search instead for 
Did you mean: 

QUESTION: FOC motor library. X-CUBE-MCSDK. Use hall sen for encoder align

Bmuha.1
Associate

​Hello I have a question directed for the developers of the "X-CUBE-MCSDK: FOC motor control library" or anyone who has knowlege on the subject.

Question: My understanding of the FOC (field oriented control) tech is that encoders are not needed due to the fact that that voltage sensors are used on the phase contacts to measure "back EMF" in order to know location and implement control of the motors rotor using algorithms like Cordic,PLL. My question is about the inner workings of the motor control library. I have chosen to use an encoder as the main commutation device and the motors hall sensor as the second auxilary sensor. Now my understanding is if an encoder is going to be used as the main commutation device it must first be aligned.

And as stated in the FOC library documention if an encoder is chosen as the main device in addition to a secondary sensorless "virtual sensor device(cordic,etc.)" that uppon the first start of the motor the encoder will be aligned using the "virtual sensor device(FOC, Cordic, etc.)".

But the docs doesnt state anything about the hall sensor use for encoder alignment uppon first start.

So if my setup has an encoder as main sensor and a hall sensor as auxilary sensor will the encoder be aligned at first start using the hall sensor? ​ ​

My PMSM Moror has a quadrature encoder​ and also a hall sensor.

Motor control board STM32H7

Motor Amp Device: ​x-nucleo-ihm08m1 

4 REPLIES 4
Laurent Ca...
Lead II

Dear @Bmuha.1​ 

Is it a general question or do you work specifically on a motor model?

Best regards

==

Laurent Ca...

Bmuha.1
Associate

It's basically a general question pertaining to the underworkings of the MCSDK. ​

No specific motor model. But the model I am using as of now has a hall sensor and encoder. Just was wanting to know the under workings of the MCSDK when it comes to aligning ( zeroing at start up ).

I know that sensorless device is used as commutation device as default but I have chosen the encoder as main commutation device. So uppon start up does the foc algorithm use the sensorless device to align encoder am I correct? Even though I have chosen encoder as main?

FBuer.1
Associate II

Hi Bmuha.1

As far as I could find out looking at the code, the file virtual_speed_sensor.c is used for alignment of the quadrature main encoder.

So far you cannot use hall and quadrature encoder at the same time as stated in this thread, except if you rewrite the timer function .

So yes, even if you use quadrature encoder as main encoder will the alignment/revup anyway be done using a virtual speed sensor. But it is possible, to write your own functions to replace the virtual_speed_sensor ones (even if I wasn't successful doing so yet).

Best regards

Laurent Ca...
Lead II

The question has been set only to the "STM32 Motor Control" topic (the question is only about the STM32 SDK). 

Best regards

Laurent Ca...