Motor got extremely hot

Hello,
I was testing odrive 3.6 with 6354 motror equipped with amt102 encoder. The encoder cable is shielded and I am using ferrite ring on motor phases. Everything was working totaly fine, until I left the system (1 axis gantry) in controll loop for very long time, which was my mistake. I came back to see that the motor got so hot that it melted its ABS mouting. I checked the surveillance camera footage and I saw that after few hours of holding its position motor started to move slowly until reaching physicall barrier. I don’t know what happend and why. I had my initial guess that for some reason the encoder lost its calibration, but I think that it didn’t slip on motor shaft. I am wondering if it was possible that due to some interference odrive received ‘fake’ pulses from encoder that resulted in motion and probably powering wrong phases that resulted in motor heating?
I haven’t manage to test this motor after the incidend becaouse encoder got destroyed in it but I guess the motor is dead after such temperature?
Do you know how to avoid such problem in future?

What do you have current_lim set to? In case of encoder slippage, my experience is that ODrive tries to compensate by increasing current up to the limit.

Did this happen in position control mode? Was there any load on the motor when it moved? Roughly how long was it running? The excessive heat generation could be encoder slippage, but I’ve personally never seen this kind of unprompted encoder drift before.

A good way to prevent this kind of damage from happening next time would be wiring up and configuring the motor thermistor, this will automatically reduce the current if the motor gets too hot and will disarm the axis if the temperature continues to rise.

It was the position control mode, there is was no load as it is a horizontal axis with no friction. However, it drifted slowly to the mechanical stop after few ours since the slow motion began. Closed loop was running for 4 days and after it the issue happend. I will try to use motor thermistor that is built in the motor (flipsky). Thanks!