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
cedric H
ST Employee

Hello,

the ST Motor control kit supports for now only the incremental encoder.

Could you describe the encoder you use. How many pluses and how many wires does your encoder have ?

Regards

Cedric

DKASA
Associate II

Hi Cedric!

Thanks for the response. I'm using a quadrature single-ended encoder (ABZ pulses) with 2048 ppr. I actually have made process with the running bull motor included in the kit and I am actually able to use sensorless and encoder based feedback (in separate builds) with this motor. However, when i moved the encoder over to a different larger motor I am having issues such that when I click "align encoder" the rotor moves, but when I click "start motor" the shaft is locked and a the unit draws quite a bit of current (2A) but no fault occurs. To be clear with the new motor I have run the motor profiler and I am able to drive this larger motor in sensorless PLL+observer mode without any issue, it's just that when I configure the system for encoder based feedback I cannot get it to spin. I know the encoder works (validated with o-scope) and i'm confident in my settings for PPR and selecting the correct motor model in the workbench.

So I suppose my questions are:

1.Am I correct to assume the only thing that is needed to align the encoder to 90degrees is to set this alignment value in motor control work bench, build the project and then from the monitor click "align encoder" (shaft moves) then "start motor" and the motor should spin? Right now it just locks up.

2.Since the motor is not spinning but locked and drawing current I have tried reversing the counts (from workbench) and re-building, also tried different sequence wiring on the motor. The rotor is still locked, do you have any suggested next steps? This would be greatly appreciated. Thank you! Dan

cedric H
ST Employee

Hello Daniel,

From my experience, your issue could be the connection order of your different motor phases. When using encoder or Hall sensors, you need to respect the U,V,W phases from the motor.

From now, the library does not make use of Z, it means that the angle will not be absolute but relative to the position of the shaft at T0.

Let me know if it works.

Cedric

Hi,Cedric.

I have the same problem with Daniel. I checked the PWM pins defined in "main.h" and the actual connection on my custom board, they are all correct.

Anyway, I switched the "U" and "W" on the motor side, and the motor do working. I ramp the speed to max forward and backward, it looked all fine.

But when I set the speed to 0 without the "Stop motor" instruction, the switch chip was breakdown about 10 Seconds later.

ypu
Associate II

Hello Daniel,

Do you have any update on that, I have the same issue as you now

DKASA
Associate II

Unfortunately I don't. When I learned the library wasn't using the Z pulse this actually changed what I wanted to accomplish. It also explained why the motor moves each time it is re-started, it seems to re-align itself with a given pole and then start counting A&B pulses as a reference point for the rotor position. I did get it work in sensor mode eventually but it is really inconsistent. I was getting speed errors and I have to think that it is due to noise or false edges on the AB signals but I didn't take it any further as I just went sensorless. I would love to know if anyone learns any tips/tricks for this with the library working in sensored mode.

ypu
Associate II

I tried today again and it worked.

THis may help you:

  1. confirm encoder noise, if there is big noise, add capacitor or change pull up resistor
  2. set up the start up, and confirm A+, B+ Phase, if it does not work you may exchange A+ and B+ and try0693W000001cQKgQAM.jpg
  3. a correct align is only one pulse, I attach the waveform Yellow is U phase current, Pink is A+, blue is B+

Start up waveform

0693W000001cQMIQA2.png

align waveform0693W000001cQMDQA2.png

DKASA
Associate II

awesome thanks for the reply and post!

ypu
Associate II

you are welcome!

My motor with encoder control is much better than hall or sensorless now