go_away

Author Topic: Problems with modifying a servo for continuous rotation.  (Read 2814 times)

0 Members and 1 Guest are viewing this topic.

Offline HarbingTarblTopic starter

  • Beginner
  • *
  • Posts: 5
  • Helpful? 0
Problems with modifying a servo for continuous rotation.
« on: May 29, 2009, 06:55:26 PM »
I'm having some trouble getting my servo to work for continuous rotation, I am using a HS-422 servo. I have tried the way described on http://www.societyofrobots.com/member_tutorials/node/82 ( I also tried the traditional method of turning the pot head until the servo stops spinning but my hands are not steady enough for it). Right now I have it setup like this,

Red Wire-Resister-Yellow Wire-Resister-Green Wire.

The yellow wire was the one in the center of the pot so it should be working but when I send it a 1.5ms pulse it just keeps spinning to the left. If I measure the resistance across one of the resisters (Like from the red wire to the yellow) it only comes up at about 1.5kohms, is this normal? The resisters I used are 2.2kohm, 2% tolerance. I didn't think to measure the resisters beforehand but the other resisters from the pack do have near the correct resistance (They are both around 2.16 kohms). 

Here is the code I am using,

Code: [Select]
#include <avr/io.h>
#define F_CPU 100000UL
#include <util/delay.h>


void main(void)
{
DDRB = 0xFF; //Configure all B ports for output
while (1)
{
PORTB = 0xFF;
_delay_ms(1.5);
PORTB = 0x00;
_delay_ms(10);  //Not sure if this should be 10ms or 20ms, though I have tried both

}
}



It seems really simple to me, I don't know what could be wrong with it.

I have seen that some people use timers to get the correct pulses but the book I have been reading about C programming with AVR's says that unless the timer clock is calibrated it has a tendency to be inaccurate, and that calibration requires the use of an external crystal.

Could anyone tell me what I may be doing wrong?

Offline airman00

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 3,653
  • Helpful? 21
  • narobo.com
Re: Problems with modifying a servo for continuous rotation.
« Reply #1 on: May 29, 2009, 09:34:06 PM »
Can you take a picture of how you soldered the resistors?
Check out the Roboduino, Arduino-compatible board!


Link: http://curiousinventor.com/kits/roboduino

www.Narobo.com

Offline HarbingTarblTopic starter

  • Beginner
  • *
  • Posts: 5
  • Helpful? 0
Re: Problems with modifying a servo for continuous rotation.
« Reply #2 on: May 30, 2009, 11:29:16 AM »
Here's the pictures you requested, some of them are fuzzy but it's the best my camera can do.

http://img37.imageshack.us/gal.php?g=0000086.jpg


EDIT: Fixed the problem...Kinda. The motor stops if I send a 1.46ms pulse, but starts again if I touch the motor casing.  I guess needed a 1% tolerance resister to get perfect delay times. Oh well, I will modify the other motor as well and see if it also requires 1.46ms or if I will have to spend some time tweaking it.
« Last Edit: May 30, 2009, 03:36:31 PM by HarbingTarbl »

 


Get Your Ad Here