Motor Control Torque Mode issue

Hello,

I’ve been working with SimpleFOC shield V2.0.4 recently and got into trouble with torque control of the motor under FOC_current mode. So far as I understand (correct me if I’m wrong), the move(a) function under this mode sets the q-axis current setpoint in amps. However, when I set the current setpoint to 500mA, i.e. move(0.5); and monitored the actual Q-axis current using motor.monitor(), the q-axis current readout is 100-200mA. I tried to tune the PID gains for both the D and Q axis, but none helped. What could be the possible reason for that behavior?

The setup I’m using is :
MCU: Teensy4.1
Motor: Maxon ECX Torque 22XL with 4 pole pairs running @ 24Volts
Encoder : AS5047P

When you measured the current, was the motor spinning? You will only see the Iq value reach the setpoint if the load is high enough. Try stalking it and see what the current reaches.