C prog on SimpleServo,sometimes servo motor spins endlessly

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

C prog on SimpleServo,sometimes servo motor spins endlessly

Postby ichudov » Tue Feb 21, 2017 9:04 pm

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:


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
Site Admin
Posts: 743
Joined: Fri Oct 28, 2011 12:17 pm

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

Postby mparadis » Wed Feb 22, 2017 8:29 am

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.

Return to “C/C++”

Who is online

Users browsing this forum: No registered users and 1 guest