I have a motion trajectory class (uses discrete integration for efficiency. i.e. all calculations are addition/subtraction) which generates theoretical position of a motor each time the function is called.
The theoretical position/set point is calculated 500/sec (I've also tried 250/sec and 1000/sec) and the result and encoder count is used by the Arduino PID library to generate a PWM output Arduino Playground  PIDLibrary.
During acceleration the motor jerks quite a bit as the velocity increases. I've found that the motion is more jerky at the beginning of acceleration and smoothes out towards the middle and end.
My possible explanations are as follows:

PID parameters need tuning. I've tried a variety of different values and the effect is negligible  in all cases little to no change in jerkiness.

PWM resolution (8bits?) is too low.

Set point is calculated too frequently or infrequently. Again, I've tried several values and there's little impact.

Encoder library is missing counts.
Are there any other possible explanations you guys have? Which seems most likely to you?
And, can anyone explain why the jerkiness eases as the velocity increases? Could this be to do with the momentum of the motor increasing as it speeds up...?
Any help is greatly appreciated.
Thanks