Why DC Motor is shaking?

1:

2: a photo of your hardware

.. so lots to go wrong. So

3: a simple code to move the position from A to B, and what happens when you run it.

My first guess: if there is slack in your system you will ned to include hysteresis or the PID will continually be attempting to compensate. It needs calibration - but PID will not fix a poor mechanical arrangement.