I replaced the potentiometer with two 2.2k resistor (I soldered the common ends to the red wire and the other ends to the yellow and green wires) ,but when I run the program the motor just keeps on rotating at the same speed. The program has different values so the servo should rotate at different speeds. What am I doing Wrong!?!?!?

Logged

"God chose to make the world according to very beautiful mathematics."-Paul Dirac**************************************************************Its Hawaii Five-O. Get it?

I'd first try sending the servo an 1 ms and then an 2 ms pulse. The servo should rotate in opposite directions. If it does then start with the 1ms pulse and increase it until it reverses direction. Before you get to the point where it reverses direction you'll find the spot where the servo is standing still (the new "center" position)! You'll need to do this to compensate for the differences in the two resistors values (they're both 2k2 but they're likely of 5% precision). IF the two resistors would have been perfect (and there's no such thing) your servo center would be at exactly 1.5 ms.

The best way to do what I've described here is to use an "Divide and Conquer" algorithm.Here's an example:

As you can see the interval you're looking at gets divided in half with every single test! With a maximum of 7 tests you should find your servo's center point. Once you've got the servo's center point, sending an pulse that's shorter makes the servo turn one way, sanding an longer pulse makes the servo go the other way!

The code I'm using sends a signal for 0, 180, and 360 degrees and I nknow It works because I tried on the another servo. Another site did say that you need 2.4k resistors and I haven't put the gears back in yet, but It should still work without the gears.

Logged

"God chose to make the world according to very beautiful mathematics."-Paul Dirac**************************************************************Its Hawaii Five-O. Get it?

You're saying the servo is rotating at the same speed and in the same direction for all 3 signals: 0, 180, 360? I care more about direction then speed: for my servos speed varies very little in a very narrow band around the midpoint: the motor is stopped at 180, moves slowly a 183, faster at 185, full speed at 190 (just an example, I'm using milliseconds, not degrees to set up my servos)

If 0 and 360 make the motor turn in the same direction and you have checked with an other servo and with the other servo it works as expected (makes the servo turn all the way to one side and then all the way to the other side) then it must be related to your soldering.

I have checked it and there's nothing wrong with the program that I know of. I can't see how I could have gone wrong when soldering its not that hard. Maybe I soldered the resistors to the wrong wires.

Logged

"God chose to make the world according to very beautiful mathematics."-Paul Dirac**************************************************************Its Hawaii Five-O. Get it?