Generating PWM from PID to control DC motor

Feedback isn't PID. It's what you do with feedback (error signal), via the control algorithm, to create a PID output response.