C prog on SimpleServo,sometimes servo motor spins endlessly

C, C++, and Visual C++
Post Reply
ichudov
Fresh meat
Posts: 1
Joined: Tue Feb 21, 2017 8:59 pm
Contact:

C prog on SimpleServo,sometimes servo motor spins endlessly

Post by ichudov »

I wrote a simple program to talk to a Phidgets servo controller, and hooked up a 9 gram servo to it. It is based on Simple Servo.

The program is contained here:

http://igor.chudov.com/tmp/servo.c

After I wrote it, it was working. Meaning that the servo would rotate as instructed and stopped.

Then I forgot about it for a day, rebooted my Linux system, and after that as soon as I start the program, the servo begins to spin endlessly.

It seems to happen even if I comment out the part responsible for actually actuating the servo and occurs during initialization.

Any idea why a servo would endlessly spin and not stop?
User avatar
mparadis
Site Admin
Posts: 660
Joined: Fri Oct 28, 2011 12:17 pm
Contact:

Re: C prog on SimpleServo,sometimes servo motor spins endles

Post by mparadis »

Are you sure you're setting the min and max pulse width properly with setServoParameters? If the servo is running even when it's not given a target position, that means that the zero position is being interpreted by the servo as something that's not zero. Have a look at this page for more information.
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests