FOC current Torque

Hello everyone, I have couple issue about torque mode (foc current);
I made a table for these issues;

t3, current_sp(black line) = 0.2 ,Iq(Green line), motor state = spining. actually it is like a sine wave.


The table presents experimental results on Field-Oriented Control (FOC) for a torque-controlled motor. Two sets of tests were conducted with different proportional (Kp) and integral (Ki) gains. In the first set (Kp = 20, Ki = 10), oscillations were observed when the motor was at rest, resisting external forces. When the current setpoint (Iq) increased, the motor started spinning, but Iq did not match the target, requiring higher Kp values for acceleration. In the second set (Kp = 5, Ki = 300), oscillations disappeared, but motor current consumption increased significantly (1.5A). When the motor spun, Iq approached the target, but power consumption decreased significantly in some cases (0.18A). The findings indicate that tuning Kp and Ki affects both stability and efficiency, with higher Ki leading to smoother control but increased current consumption.

Are these results expected in the SimpleFOC library? Shouldn’t Iq match the target value I provided? Some values are close, but they are not stable. Am I misunderstanding something? What kind of behavior should I observe in FOC current and torque mode, and how should I tune the PID for better performance?