Periodic Jerk in velocity control mode

Hi,

New here and have tried to search for this issue without luck, perhaps I didn’t have the correct terminology?

I am running Simple FOC Mini, AS5600 and ESP32-C6 Super Mini.

Overall I can get things working, including angle control. However, when I run velocity control to tune the PID parameters there is a periodic jerk in the motion when the speeds are over approx. 50 r/s.

The period of this disruption is around 2 sec, regardless of the speed.

https://youtu.be/O66ddPv0T7E

Any pointers on where I should start to look for a solution?

Thanks,
Mig

Seems I found the problem:

https://www.reddit.com/r/arduino/comments/1iuwcdq/psa_arduino_with_single_core_esp32s_adds_5ms/

Issue with single core ESP32 and Arduino.

Will try running in a separate task.