Author Topic: midyfying servos - cant get the pot head to stop rotating  (Read 3658 times)

0 Members and 1 Guest are viewing this topic.

Offline rox2007Topic starter

  • Full Member
  • ***
  • Posts: 95
  • Helpful? 0
midyfying servos - cant get the pot head to stop rotating
« on: January 14, 2008, 02:08:21 PM »
Ok i followed the instructions in the modifying servos tutorial but i cant get the part where you stop the gears by moving the pothead.
I keep turning it left and right but it doesnt work.
Please help

Offline airman00

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 3,653
  • Helpful? 21
  • narobo.com
Re: midyfying servos - cant get the pot head to stop rotating
« Reply #1 on: January 14, 2008, 02:30:32 PM »
move it slowly and make sure you are giving it the right pulse at the corerct oscillator setting
Check out the Roboduino, Arduino-compatible board!


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

www.Narobo.com

Offline rox2007Topic starter

  • Full Member
  • ***
  • Posts: 95
  • Helpful? 0
Re: midyfying servos - cant get the pot head to stop rotating
« Reply #2 on: January 14, 2008, 02:31:27 PM »
what exactly is the right pulse and oscillator setting for an atmega 168. i am passing 1.5ms on the internal 8Mhz clock

Offline rox2007Topic starter

  • Full Member
  • ***
  • Posts: 95
  • Helpful? 0
Re: midyfying servos - cant get the pot head to stop rotating
« Reply #3 on: January 14, 2008, 02:43:12 PM »
i turn and turn and turn. The speed just get's slower or faster. it goes from one extreme to another. fast to slow...slow to fast....theres no midpoint where it just stops

Offline airman00

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 3,653
  • Helpful? 21
  • narobo.com
Re: midyfying servos - cant get the pot head to stop rotating
« Reply #4 on: January 14, 2008, 02:59:14 PM »
turn it very slowly and carefully


also try to give it 1.5ms @ 4mhz


what is your code ?
Check out the Roboduino, Arduino-compatible board!


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

www.Narobo.com

Offline rox2007Topic starter

  • Full Member
  • ***
  • Posts: 95
  • Helpful? 0
Re: midyfying servos - cant get the pot head to stop rotating
« Reply #5 on: January 14, 2008, 03:00:12 PM »
#include <avr/io.h>

//Define functions
//======================
void ioinit(void);      //Initializes IO
void delay_ms(uint16_t x); //General purpose delay
void delay_cycles(unsigned long int cycles);
//======================

int main (void)
{
    ioinit(); //Setup IO pins and defaults

    while(1)
    {
      PORTC = 0xFF;
      PORTB = 0xFF;
      PORTD = 0xFF;
      delay_cycles(35);

      PORTC = 0x00;
      PORTB = 0x00;
      PORTD = 0x00;
      delay_cycles(35);

      //delay_cycles(500);
    }
   
    return(0);
}

void ioinit (void)
{
    //1 = output, 0 = input
    DDRB = 0b11111111; //All outputs
    DDRC = 0b11111111; //All outputs
    DDRD = 0b11111110; //PORTD (RX on PD0)
}
//************DELAY FUNCTIONS************
//wait for X amount of cycles (23 cycles is about .992 milliseconds)
//to calculate: 23/.992*(time in milliseconds) = number of cycles
void delay_cycles(unsigned long int cycles)
   {
   while(cycles > 0)
      cycles--;
   }
//***************************************

Offline rox2007Topic starter

  • Full Member
  • ***
  • Posts: 95
  • Helpful? 0
Re: midyfying servos - cant get the pot head to stop rotating
« Reply #6 on: January 14, 2008, 03:03:10 PM »
that's my code. i was running at 8mhz and sending 1.5ms

Offline airman00

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 3,653
  • Helpful? 21
  • narobo.com
Re: midyfying servos - cant get the pot head to stop rotating
« Reply #7 on: January 14, 2008, 03:04:02 PM »
which servo are you using?
Check out the Roboduino, Arduino-compatible board!


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

www.Narobo.com

Offline rox2007Topic starter

  • Full Member
  • ***
  • Posts: 95
  • Helpful? 0
Re: midyfying servos - cant get the pot head to stop rotating
« Reply #8 on: January 14, 2008, 03:05:50 PM »
HS-311, the ones recommended by the tutorial
« Last Edit: January 14, 2008, 03:14:10 PM by rox2007 »

Offline rox2007Topic starter

  • Full Member
  • ***
  • Posts: 95
  • Helpful? 0
Re: midyfying servos - cant get the pot head to stop rotating
« Reply #9 on: January 14, 2008, 03:25:33 PM »
I finally got it to work...Thanx alot

Offline ed1380

  • Supreme Robot
  • *****
  • Posts: 1,478
  • Helpful? 3
Problems making the $50 robot circuit board?
click here. http://www.societyofrobots.com/robotforum/index.php?topic=3292.msg25198#msg25198

Offline Rebelgium

  • Supreme Robot
  • *****
  • Posts: 638
  • Helpful? 0
  • It's called the future ... We like it here
Re: midyfying servos - cant get the pot head to stop rotating
« Reply #11 on: January 14, 2008, 03:55:44 PM »
Help people with the same problem, tell us what was the problem and how you fixed it.
To relax after some hard work on robotics: A very fun free online text based MMORPG
orgcrime.net

Offline rox2007Topic starter

  • Full Member
  • ***
  • Posts: 95
  • Helpful? 0
Re: midyfying servos - cant get the pot head to stop rotating
« Reply #12 on: January 14, 2008, 04:10:49 PM »
well, i sent a 1.5ms pulse and ran my atmega168 at 4 mhz...and i rotated the pot until the gears stopped
« Last Edit: January 14, 2008, 05:02:35 PM by rox2007 »

Offline airman00

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 3,653
  • Helpful? 21
  • narobo.com
Re: midyfying servos - cant get the pot head to stop rotating
« Reply #13 on: January 14, 2008, 04:42:11 PM »
at what mhz?
Check out the Roboduino, Arduino-compatible board!


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

www.Narobo.com

Offline javafiend

  • Robot Overlord
  • ****
  • Posts: 125
  • Helpful? 0
Re: midyfying servos - cant get the pot head to stop rotating
« Reply #14 on: February 12, 2008, 10:58:14 AM »
Since nothing else seems to be working, I used the OP's code but can't see where to change the frequency.  I'm using AVR Studio.

Offline garriwilson

  • Supreme Robot
  • *****
  • Posts: 345
  • Helpful? 0
Re: midyfying servos - cant get the pot head to stop rotating
« Reply #15 on: February 12, 2008, 07:39:31 PM »
at what mhz?

Quote
well, i sent a 1.5ms pulse and ran my atmega168 at 4 mhz...and i rotated the pot until the gears stopped

 ;D

Offline airman00

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 3,653
  • Helpful? 21
  • narobo.com
Re: midyfying servos - cant get the pot head to stop rotating
« Reply #16 on: February 12, 2008, 09:28:46 PM »
at what mhz?

Quote
well, i sent a 1.5ms pulse and ran my atmega168 at 4 mhz...and i rotated the pot until the gears stopped

 ;D

to garriwilson

the 4mhz was edited in his post AFTER I replied   ;)
Check out the Roboduino, Arduino-compatible board!


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

www.Narobo.com

Offline rox2007Topic starter

  • Full Member
  • ***
  • Posts: 95
  • Helpful? 0
Re: midyfying servos - cant get the pot head to stop rotating
« Reply #17 on: February 13, 2008, 01:27:08 AM »
i did, sorry about that

Offline garriwilson

  • Supreme Robot
  • *****
  • Posts: 345
  • Helpful? 0
Re: midyfying servos - cant get the pot head to stop rotating
« Reply #18 on: February 13, 2008, 07:22:15 PM »
Oh my bad  ;)

 


Get Your Ad Here