Go Down

Topic: Modified Servo won't stop spinning (Read 275 times) previous topic - next topic

rylech

Hi all!

So I'm doing a quick project and needed significant torque for a cheap price and had heard about turning servos into continuous servos. So I did the modification, detaching the potentiometer from the gears without detaching it from the circuit board and taking the stopping pin off of one of the gears.

I now have the desired effect of the servo being able to spin continuously. . . but it never stops. Doing some step by step test cases, I find that once I attach() the servos they will start spinning. I did some research on this and found that it was the servo trying to re-center itself but the potentiometer won't move. I also read that you can change this auto-centering by write()-ing to the servo before attach()-ing it.

By that thought process, I should be able to set an integer equal to the current read() of the servo, then write() that new integer, finally attach()-ing the servo without it needing to spin to correct itself. However, this does not work. No matter what I write() or writeMicroseconds() to the servo, it will not stop spinning, once I attach() it. Any thoughts?

Thanks!



slipstick

Some confusion there I think...Servo.read() does NOT return the current position of the servo it only finds the latest command that was sent to the servo. If you haven't yet attached the servo then no command has been sent.

You need to manually find the write() value that stops the servo. It should be somewhere close to write(90) but may not be exactly 90 and may not be the same value for all servos. I've used a modified Knob example program with a push button to print the current write() value. Twiddle the knob until the motor stops then note the value.

Steve
 

Johan_Ha

My guess is that, while detatching the pot, you turned it into far left or far right. The sweeper pin gets 0 V or 5 V all the time and no matter what you write(), it spinns in the same direction, trying to get off the far edge.
Either that, or then you got a connection fault to any of the three pins of the pot.
____________________

If you ask for help and write 'u' instead of 'you' because you think it's convenient, I will write 'no' instead of 'yes'. For same reasons.

Go Up