Servos are controlled by pulse width, the pulse width determines the horn angle.
A typical servo responds to pulse widths in the range 1000 to 2000 µs.
A pulse width of 1500 µs moves the servo to angle 0. Each 10 µs increase in pulse width typically moves the servo 1 degree more clockwise. Each 10 µs decrease in pulse width typically moves the servo 1 degree more anticlockwise.
Small 9g servos typically have an extended range and may respond to pulse widths in the range 500 to 2500 µs.
Why do people think servos are controlled by duty cycle? Because servos are typically given 50 pulses per second (50 Hz). So each pulse is potentially a maximum of 20000 µs (1 million divided by 50). A duty cycle is the percentage on time. 100% will be a 20000 µs pulse, way outside the range accepted by a servo.
Do some calculations at 50 Hz for sample pulse widths.
500 / 20000 = 0.025 or 2.5 % dutycycle
1000 / 20000 = 0.05 or 5.0 % dutycycle
1500 / 20000 = 0.075 or 7.5 % dutycycle
2000 / 20000 = 0.1 or 10.0 % dutycycle
2500 / 20000 = 0.125 or 12.5 % dutycycle
Don't use dutycycles, if possible use pulse widths, and think in pulse widths. If you send pulses at 60 Hz by duty cycle the servo will go to the wrong position.
(angle/180 × 10) + 2
....(0/180×10)+2 = 2
....(180/180×10)+2 = 12
....(90/180×10)+2 = 7
– jsotola Feb 07 '20 at 02:36