I am posting this here in case anyone can answer crisply what the duty cycle for pulse width modulation (PWM) should be at the top end of the range of values for Servo control (via the Servo library) - say servo.write(180).
Everywhere I search, explanations of PWM draw into convoluted discussions of PWM frequency. I am hoping someone can offer a crisp answer on duty cycle alone. I am getting results
I believe are odd and wondering if this is normal, if this is a Due bug, or if my Due board is broken:
Whenever I use servo.write() via the servo library, if I use the top end of the value range (for example servo.write(180)), the highest duty cycle I get is around 13%. To a voltmeter it looks like about 0.400 volts. On an oscilloscope it shows up as a 3.3 volt square wave at 13.3% duty cycle, just as you would expect from the voltmeter readings.
Is that normal for servo control? As I adjust the value down from 180, I do see the duty cycle shrink. And If I raise the value up above 180 it remains stuck at that 13.3% value. I found one buried forum via Google that suggests typical servo controls range from around a 10% duty cycle on the low end to a 50% duty cycle or higher (around a 1.5 volt equivalent range).
I believe I have found a workaround for my needs elsewhere in this forum; but the workaround itself makes me highly suspicious that there might be a bug or failure to port functionality in Servo.h for the Due. Basically people who seem to know what they are doing are using means other than Servo.h to get their needs accomplished in recent months; and my board otherwise seems to be functioning fine. Vanilla PWM functionality seems perfect. I am asking both because I want better understanding of PWM especially as it relates to servo control standards, or if my board is not working properly I'd like to know, and if Servo.h needs to be updated I want to make clear duty cycle observations here because all of the other forum discussions seem focused on frequency (which is also important for Servo control - I understand).