or to do eactly like Nigel said but with current feedback
Bascially is sounds like you will need a control-loop
1) voltage-loop
2) current-loop
3) speed-loop
depending on what you want (as nigel said vague) you will need 1,2 or all of the above.
Bascially you will have a demanded voltage/current/speed. you wll also need a voltage/current/speed feedback (ie what the system is actually doing).
using an OPAMP in a diff-amp arrangement you can then get the difference between the two - the error. It is this error that is used to generate the PWM (via comparason with a triangle wave).
Ans as you can see as the error gets closer to zero (ie the output is the demand) then the PWM will go to 50% (if that is how you set it up)