I'm building a robotic arm and I cannot adjust the speed of the servos. They would quickly rotate to the specified angle as if it was just a .write() function. How could I control the speed of the servos?
//include custom library to control servos
//Create servo variable
int a = 0; //servo position
int b = 0; //servo position
int c = 0; //servo position
My current code moves the elbow, wrist and swivels the gripper joint at the same time.
The rotation speed of the servo depends on the difference between the starting angle and the target angle, the bigger the difference the faster it turns, and slows down the angle when it is close. So there is no special function to control the rotation speed. But when turning at a large angle, you can use the program to set it into several small angle progressions, which can slow down the speed.
It is also slowed down by delay, but the only way to go fast is to add high voltage .
For 360 degree servos.
The parameters of write() or writeMicroseconds() determine the speed of the servo, but it can also be slowed down by delay() or delayMicroseconds().
Not a problem I've had with VarSpeedServo but since I can't see what you did I can't tell what you did wrong. Did you perhaps set the 3rd parameter in write() which specifically tells the write to WAIT until the move is complete before moving on?