I just brought home a servo that does full rotation, and I'm having a hard time getting it to behave as expected. I think I've figured out the problem in the course of creating this posting, but I'll continue anyways, as it may save others some of the frustration I've had today.
So, the project I have in mind uses something like an analog clock face. It will have one arm that points to the appropriate condition. For this I bought a servo that moves the full 360 degrees. However, it turns out this servo is a "Continuous rotation" servo (SM-S4303R). I didn't think much about that at the time, but the net result seems to be that it cannot be commanded to go to a particular spot on the dial. Instead, this servo is basically a motor, but with fine grain control over the velocity.
I tried following a number of tutorials, but the results never seem as expected. For example, this code snippet...
- Code: Select all
import RPi.GPIO as GPIO
p = GPIO.PWM(17, 50)
...just causes the servo to spin around in one direction or another, varying speed but never stopping at a given location. If I change the time.sleep duration to 60, it will just spin around for a full minute. This being a servo, my expectation was that the servo would stop at a given orientation.
If you think I've got this wrong, please let me know. I will go shopping again tomorrow and try for a 360 servo that is not continuous rotation.