cancel
Showing results for 
Search instead for 
Did you mean: 

Instructions for encoder alignment

DKASA
Associate II

I have the ST FOC motor control kit (Nucleo F302R8 , X-Nucleo- IMH07M1. I have been successful using FOC with sensorless feedback. I have installed and wired an absolute encoder and configured the number of pulses in the workbench. What I cannot find are instructions for aligning the encoder. I see the GUI in the motor control workbench has a button for "align encoder" but it is not clear to me how the offset is properly set. I have clicked align (small movement) and then start motor but I get no rotation, just high current draw and a locked rotor.

Any help would be appreciated. Thanks!

13 REPLIES 13
Laurent Ca...
Lead II

The question has been moved from the section "Motor Control Hardware" to the "STM32 Motor Control" section (the question is about the STM32 MC SDK). 

Best regards

I guess there's no-one left at ST that knows how this software is meant to work as it is now 3 years on from the original post and the library still does not support the Z-pulse. In fact it seems that very little has changed over the years.

cedric H
ST Employee

Hello @jartim​ 

Could you describe your issue, we will be happy to help you.

For your information, the Z-pulse can be used if you do position control.

Kind Regards

Cedric

Hi, yes as you know I started out using V6. of the firmware only to be told by yourselves, after numerous attempts to get the motor driver working, that V6 isn't yet complete and shouldn't be used. So I reverted to V5.Y.4 which, while working a little better, is still littered with bugs and "strange" coding. I have spent many weeks fixing your driver bugs and removing over 360 incorrect or unnecessary type-casts from one data type to another and adding new ones where they should have been originally. Now I have got to the stage where I need to be able to set a particular angle (mechanical and electrical) from a defined encoder angle, at startup. Not setting zero, but a specific angle which is the angle the encoder starts up at. I have spent many hours on this, but nothing I do gets around the fact that the motor just spins continuously in one direction or another, without stopping at startup. It seems that either the firmware is incorrectly interpreting the encoder position or there is an error in the internal maths that causes it to not see the correct encoder angle. I have found this incredibly difficult to debug your software as it is so badly written as to be almost unintelligible. There are so many variables that are passed around, and no comments on a lot of them to describe what they are doing or how they are doing it. My original comment still stands, this code you wrote over 3 years ago, but it is in the same state now as it was then, and still no sign of a full V6 release with the bugs fixed and the documentation present. Hence my comment that I suspect there is no-one left there that actually understands how the original code was meant to work. And yes, I am really, really pi*sed off with having to use it, and ST's total lack of commitment to their products. Rant over, but please fix it.