PID control

A 9V block battery is not usable with motors. Most probably your battery is already empty from preceding experiments.

Try to control your motor first. This test will show whether power, wiring and signals to the driver are okay. You can move the motor in either direction, until its pot will indicate some limit, then reverse the direction until the other limit is reached. Start with slow motion (low analogWrite), then increase the duty cycle to verify that speed control is working. Be prepared for disconnecting the motor power lines manually, until your code works as expected.

If you have another DC motor at hand, you can use it for the first tests. Then you don't risk to damage the pot and gear box of the servo by coding errors.