Change velocity motor shake

I have a motor with velocity mode, and is runs good with simplefoc. The only problom is that the the motor shark suddenly with one second when start or stop to move.
With power on, the motor is stop, and I send M1 from SimpleFocStudio, the motor suddenly shark, and then run smooly with 1 rad/s, then if I send M0,the motor also shake and stoped.
So how to avoid the motor shake at begin and stop. Thank you!
Start and stop screenshot:

This looks like this can be solved by tuning the velocity PID values. Did you already try to toy with P, I and D? I would start with a lower P (let’s say P=1), a higher I (let’s say I=5) and D=0.

Thank you for your reply. I tested p=5 i=1 d=0.003 runs well expect start and stop. But is p need be small values?