In all specs of this servo that I can find there is a range of 1000-2000ms of duty cycle, for 50 Hz frequency, for the full range of motion. For example:
- http://m.zonesutech.com/Content/upload/2019437687/201908221407356625310.png
- https://www.engineersgarage.com/8051-microcontroller/servo-motor-sg90-9g-with-89c51-microcontroller/
- http://www.ee.ic.ac.uk/pcheung/teaching/DE1_EE/stores/sg90_datasheet.pdf
This should give us a range of 5-10% when sending pulse with:
dc = 5 #[5 - 10]
pwm = GPIO.PWM(pin, 50)
pwm.start(dc)
Why? Because:
dc duration = second in microseconds/frequency*dc percentage
So for example:
1000000/50*0.1 = 2000
1000000/50*0.05 = 1000
Which defines our range. However in practice it's not true. The real dc range is 2.5 - 12.5 and that would translate to:
1000000/50*0.125 = 2500
1000000/50*0.025 = 500
Which can be tested and is even quoted in many places like here:
https://www.raspberrypi.org/forums/viewtopic.php?t=240558#p1468558
So the question is - where am I wrong in my calculations? Why is there a difference?