Servo movement speed seems to be an intrinsic characteristic of the model of servo.
So, if I want to slow the movement, I guess I have to cheat. I could calculate, for example, the number of degrees to move and then use some simple loop delay approach. On the face of it that would work, but calibration will be a pain in the @$$.
Are there any standard techniques for controlling the speed of a servo?
Are there any standard techniques for controlling the speed of a servo?
Not built into the servo library. Using simple time delays as you describe will work if you are using just one servo and there is nothing else in the main sketch that needs servicing faster then the use of the blocking delay() statements. If you use millis() for tracking elapsed time you can avoid the blocking action of delay() and control the speed of many servos as well as assuring your main loop cycle time is fast enough to handle all else you are doing. See the blink without delay sketch example for how that method can be applied.
There has been a poster (or two?) that said they are working on modifying the servo library (or writing a new one) to use a optional velocity value for the servo.write() command. That would be very useful.
If anyone's interested here's why I want to control the speed. I set myself a rather academic exercise, to move a laser pointer along a wall at constant linear speed. Of course with constant angular speed, the linear speed increases at the sides. The incremental angle dtheta subtends a smaller distance along the wall when it's normal than it does at the sides.
If my calculus is right, for constant linear speed I get that
dtheta/dt = k cos[sup]2[/sup]theta
With theta = 0 (beam normal to wall), cos theta is 1 and dtheta/dt is maxed, and it decreases towards the side.
(Even if the maths* is wrong I know qualitatively that the angular speed needs to be maxed when the beam is normal to the wall and decreases towards the sides :P)