Since that chip is programmed via SPI, I guess this is the best sub forum...?
So, I have that motor driver IC, using it with a BLDC with digital hall sensor output and a ABN rotary encoder, and current measurement resistors in 2 of the phases.
Produced initialization C code with their IDE.
It basically works.
(The motor has a little free-floating load, i.e. a weight not connected to anything, on its axis + bearing on other side, too)
On initialization, the motor moves a little in one direction, then swings a little back and forth like a damped pendulum, and when it rests, the init phase is over and the code switches the IC to velocity mode and the motor spins nicely.
This init phase is done in open loop mode.
The velocity mode uses ABN encoder as a source for the angle.
Now, I'm not quite a motor expert.
I did read their datasheet, which has a nice intro at the beginning, explaining how FOC works.
So, this initial pendulum movement would be the forcing of the rotor to a position of a known electrical angle phi_e, so that the offset between electrical angle and encoder are known, such that the encoder can be used for precise FOC - did I get that right?
I wonder now: if I have a system which is mounted in a stable, repeatable way - can I let the thing determine phi_e once, store it, and for all next powerups, use the stored value instead of wasting time doing the initial pendulum thing every time?
The datasheet
https://www.mouser.de/datasheet/2/256/TMC4671-LA_datasheet_Rev2.00-1880648.pdfhas a section that kinda sounds like it:
4.6.10.3 Encoder Initialization by N Pulse DetectionAfter determination of a correct offset, the value can be used again after power cycle. The encoder’s N
pulse can be used as reference for this. For starters the user can drive the motor in open-loop mode or by
using digital Hall sensor signals. After passing the encoder’s N pulse, the ABN encoder is initialized and
can be used for operation.Alas, they don't tell exactly how to do that (or I don't see it).
I experimented with letting the thing do the initial open loop initialization, then, query the register ABN_DECODER_PHI_E_PHI_M_OFFSET, store the value, and at next powerup, instead of doing the pendulum open loop thing, I wrote the stored value back to the register.
Then it spun to crazy speeds - I realized I forgot the part about letting the ABN go over the index position in open loop first, i.e. not just straight jumping into the code that sets up velocity mode using ABN.
But... am I on the right track generally? How I would know when that ABN went over the index, so that I can stop open-loop-driving, I haven't found yet.
If I got it right, I would end up with the device starting, moving in open loop until the ABN indexed, switch to ABN-based velocity mode, and the whole thing would look pretty seamless, as if the motor just started spinning after powerup (maybe a bit slowly) - well that would be ideal. (later, I may also use position mode)
Would it work like that?
Has anyone done this before and/or knows this?