I'm using a Fitec FS90R continuous servo with my Raspberry Pi Zero, and trying to make it turn slowly in either direction (it's controlling a small turntable with a display on it).
My test script is below and it works exactly how I want for counter-clockwise, but not in a clockwise direction. No matter what values I try I can't get it to run the same speed in the other direction, and I don't understand why. Am I trying to make it do something it's not meant to?
All help gratefully received.
from datetime import datetime, time, timedelta
from output import *
from time import sleep
import RPi.GPIO as GPIO
pin = 17
for i in range(0, 300):
In response to comments:
I have tried using pigs to find the 'neutral' point where my servo is stopped, and then higher and lower values to go CW and CCW at increasing speeds (I used a loop to steadily go thru every possible value). Close to the middlepoint, the servo is either too fast and juddering, or switching direction back and forth. It was never the slow smooth rotation that I got with the test script included in my question above.
This is confusing to me because I've read so many articles which give this advice (about finding the middlepoint). That's why I started wondering whether this only applies to non-continous servos. It's not alway clear whether advice given only applies to one or both types of servo. It seems like it should be really easy but it's driving me nuts!
Also, the test script above was an example given one of the many articles I read about using servos - and it does work, resulting in the rotation speed I'm looking for, but only in a CCW direction.
My understanding of servos is that they work in the way described on Controlling Servos Using Raspberry Pi & Python - Ray's Blog. Most articles describe it this way. Is this not correct?
@milliways you say GPIO does not support hard PWM, but then why is this so very often the example given? What is the better way to control a server?