AS5048A - SPI connection noise/or aslo something else

Hi everyone! I have been dealing with this problem for last two weeks. First i will tell about my setup.

I’m using herlea x8311s kv140 motor, as5048a encoder and odrive3.6 56V board. Firmware I’m running is latest 0.5.1 version. My power supply is laboratory power supply able to give voltage and current up to 30V and 30A.
At first I was getting ENCODER_ERROR_ABS_SPI_COM_FAIL . I wasn’t able to calibrate encoder when my voltage was higher than 20V. From what other people expirienced on this forum I started to suspect noise in spi connection from motor current. So i decided to put shielded cable on my spi connection, and it did improve dramaticaly. I’m now able to calibrate motor with higher voltages. But the before mentioned error still apears sometimes. Some people think that the problem might be with the error flag:
towen - error flag
Can anybody confirm this?
Also I still have a problem with position control (torque and velocity control is satisfying so far). When I run closed loop control, my motor starts producing low key but quite enough to hear noise. And when i set it for example to position 0 it starts oscillating without stopping. Is the problem with pid parameters of controller or something else is at play here?
Video of oscillating motor:
ezgif.com-video-to-gif (1)

What was your procedure for tuning the gains?

I don’t have any particular procedure. You think problem is with gains? But this doesn’t seem to me as oscillating due to gains. Its kind of too big. Am I wrong?

In your video, is it trying to hold position the whole time? or is it moving between two positions (deliberately) and oscillating around one of them?

If it’s trying to hold position then I agree, it’s probably not the gains, since it’s not a sinusoidal oscillation.

If you put it into current mode, and drive a high torque but (carefully) hold it with your hand, is the torque smooth as you slowly rotate it?

1 Like

Thank you for your answer! I played with my pid parameters and it works now.

2 Likes