I am using PCA9685 to drive a MG995 servo motor. I am using the following code to control the servo motor.
import time,Adafruit_PCA9685 def elbow(): pwm = Adafruit_PCA9685.PCA9685() pwm.set_pwm_freq(50) down=565 up=145 pin=3 for i in range(up,down,1): pwm.set_pwm(pin,0,i) time.sleep(0.001) time.sleep(1) for i in range(down,up,-1): pwm.set_pwm(pin,0,i) time.sleep(0.001) if __name__=='__main__': elbow()
The above code works fine but the servo motor rotates very slowly. I have double checked the power requirements of the PCA9685 driver. I am supplying 5V,2A to the V+ pin of the driver and 3.3V( from the Raspberry Pi ) to the Vcc pin of the driver as specified. I have plugged in the servo motor in the Pin number 3 of the PCA driver. Inspite of the correct voltage supply, the motor rotates very slowly. I have tried to change the value of the frequency,
pwm.set_pwm_freq(50) between the range 10 to 60, but it did not work. Beyond 60, the servo motor does not respond at all.
Please help me figure out a way to increase the speed of the servo motor. Thank you.