How to control the speed of dc shunt motor?

hullo buddy out there,i've a prob because i dont know how to control the
speed of dc shunt and series motor,can anybody help me??
Control the voltage going to the motor, of course.
Shunt motors are difficult because their speed is limited only by losses
(like friction and windage) in the motor and mechanism. So if you want
one to run at a precise speed you need a closed−loop controller that's
constantly monitoring the motor speed and adjusting it's drive voltage.
Once you get a circuit that 'knows' the motor speed and can adjust the
drive voltage, though, you can use a traditional PID controller to make
it all work.
Download link