I have a pair of Futaba S3001 servers that I am controlling with a Raspberry Pi, using the pigpio library.
To control the angles of the servos, I set the pulse width according to the formula:
pulse_width = centre + angle * multiplier
where centre is the pulse width required for 0 degrees, and the multiplier is a figure arrived at by trial and error to that represents the pulse width difference required for one degree change.
For one servo, I have arrived at:
multiplier_1 = 9.444444444444445
centre_1 = 1350
and the other:
multiplier_2 = 9.222222222222221
centre_2 = 1315
This seems to work reasonably well, at least within +/- 45 degrees.
At larger angles, I am not so sure it's still within bounds, but it's hard to tell.
My questions are:
Is the relationship between pulse width and angle wholly linear, as I am assuming?
Does the linearity break down more towards the ends of the servo's travel?
What sort of accuracy should I expect from a hobby servo such as this?
Is there a better way to arrive at the function I need?
