Demo code can be downloaded here

Explanatory note


The servos used in this application are HS-55 servos. They take a PWM control signal which varies between approx 0.5ms to 2.5ms at a frequency of a few tens of Hz. I used 50Hz in this case. The servos are driven by PWM outputs from TIM2. I've also added in the LCD and keypad code from earlier work so that the user can change the angle of each of the motors. With very little modification this can also be used for general purpose PWM.