Issue with closed loop with Magnetic PWM sensor

Hello,

I am trying to tune a BLDC motor we have (iPower GM110-8), the motor is interfaced with AS5048-A magnetic sensor and i am using the PWM output of the sensor. I am using an STM32 Nucleo-64 (F446RE) board with SimpleFOC shieled 2.0.4 shield.

The motor works fine and smooth in open loop position and velocity examples. But when i switch to closed loop torque control mode with Torque control technique as Voltage, the motor starts being jittery in its movement and starts making soound, This jittery movement is observed in the angle graph as well when seen through Simple FOC studio. ( kindly refer to the snap below):

I have tried a few things like, trying to get the sensor data via SPI and using STM32 based pwm libraries, but not to much success.

Could you provide me with insights into solving this problem?

So, it looks like when the PWM signal wires of the encoder are close to the Motor phase wires, this noise seems to couple in, separating them well seems to solve this issue. Doing some EMI shielding on the signal wires might work. Also this effect was mostly observed with Closed toop -Torque control - Voltage mode, and was not much observed in closed loop - Torque control - FoC current mode