I was setting up TMC9660 FOC with a BLDC on which an Magnetic Absolute Encoder with SPI is attached (AS5047). I was able to get TMC9660 to access the encoder position through SPI1, and TMC9660 was able to initialize in FOC commutation in 8-SPI Enc mode. But the problem is, when commanding a slow velocity, I got this periodic kick from the motor, which I think is the motor suddenly going to the opposite direction for a short moment, then continuing in the correct direction. I think I managed to locate the problem, that is unexpected behavior in the SPI_ENCODER_COMMUTATION_ANGLE value. I setup the motor to spin at a constant velocity in open loop current mode, and expected this SPI_ENCODER_COMMUTATION_ANGLE value to give me a sawtooth waveform, which it did, but when SPI_ENCODER_POSITION_COUNTER_VALUE overflows, the commutation value jumps up from the expected ramp, then later it jumps back down at a later point. Attached is the plot of both the commutation angle and position value when it happened
Some notes
- BLDC with 7pole pair
- Magnetic enc through SPI with 13 bit of resolution per rotation
- LUT correction enable is set to 0
- TMC9660-EVAL-STP-EVKIT accessed through TMCL-IDE
- Nothing is attached to the motor apart from the diametrical magnet. The motor is spinning freely
- The SPI_ENCODER_OFFSET that was set from the previous FOC Initialization is right now 2057, which is coincidentally the one point when that SPI_ENCODER_COMMUTATION_ANGLE ramp suddenly jumps
Any ideas to why would this happen is greatly appreciated!