Motor heating with FOC drive

Hi !
I am using the simpleFOC library example to drive a 260Kv BLDC motor. The motor is controller by DRV8839 drivers and arduino uno. The issue is that the motor heats up after a few minutes. The temperature is so high that one cannot even touch the motor.
I tried running the motor with a simple drone ESC. The motor did not heat when run with the drone esc. How to prevent motor heating with FOC?

I have tried reducing the motor_driver.voltage_limit, but that works only to some extent.

That usually points to incorrect current control or motor parameters in FOC. Double-check your motor KV, phase resistance, and pole pairs, and make sure current sensing (if used) is set up correctly. Excess heating often comes from too much q-axis current or poor tuning, even if the motor is spinning fine. The ESC hides a lot of this for you, while FOC needs proper calibration and limits.