I think your original wording is a little confusing ... but I think I'm gathering your intent. You know where you WANT it to go (the formulas), but need tips on getting it to do what you want. Right?
... you don't "force encoder values". You vary the input controls to the motors and the encoders are the sensors that provide the feedback to our control loops.
There's a really good paper on PID by Tim Wescott ... called
PID without a PhD. It'll get you started. Then keep asking questions. That's what we're here for.