Author Topic: Servo mod - gears won't set with hold_servo.hex  (Read 15670 times)

0 Members and 1 Guest are viewing this topic.

Offline BeckyTopic starter

  • Jr. Member
  • **
  • Posts: 38
  • Helpful? 0
  • "Bollocks to the rules" (George Orwell)
Servo mod - gears won't set with hold_servo.hex
« on: March 09, 2009, 12:26:16 PM »
Me again with another easy question - there's a helpful point in it for anyone who makes me go from  :'( to  ;D

I have finished my circuit and I have made a connection with AVRStudio so ready to go... I have a servo plugged in and I upload the hold_servo.hex file to flash and... ...nothing happens.  Gears do not move.

What am I doing wrong?  :-\

Offline superchiku

  • Supreme Robot
  • *****
  • Posts: 952
  • Helpful? 5
  • cooll
Re: Servo mod - gears won't set with hold_servo.hex
« Reply #1 on: March 09, 2009, 12:28:35 PM »
WAT??????????
JAYDEEP ...

IT AND ROBOTICS ENGINEER

"IN THE END IT DOESNT EVEN MATTER"

Offline BeckyTopic starter

  • Jr. Member
  • **
  • Posts: 38
  • Helpful? 0
  • "Bollocks to the rules" (George Orwell)
Re: Servo mod - gears won't set with hold_servo.hex
« Reply #2 on: March 09, 2009, 12:42:59 PM »
Lol sorry I just read that back... I am trying to modify my servos and I have one plugged into my board.  Instructions say upload the hex file and the gears will move until the servo is at 0 or something like that... but nothing happens.  The files uploads correctly as there is no error... but why doesn't it work?

Offline pomprocker

  • Supreme Robot
  • *****
  • Posts: 1,431
  • Helpful? 16
  • Sorry miss, I was giving myself an oil-job.
    • Nerdcore - Programming, Electronics, Mechanics
Re: Servo mod - gears won't set with hold_servo.hex
« Reply #3 on: March 09, 2009, 12:58:10 PM »
Did you take the servo apart yet?

Can you tell us where the servo is plugged in?

Offline superchiku

  • Supreme Robot
  • *****
  • Posts: 952
  • Helpful? 5
  • cooll
Re: Servo mod - gears won't set with hold_servo.hex
« Reply #4 on: March 09, 2009, 12:59:13 PM »
cant understand..wat are u trying to do...? centre the servo or move the servo ...which mcu are u using...
JAYDEEP ...

IT AND ROBOTICS ENGINEER

"IN THE END IT DOESNT EVEN MATTER"

Offline pomprocker

  • Supreme Robot
  • *****
  • Posts: 1,431
  • Helpful? 16
  • Sorry miss, I was giving myself an oil-job.
    • Nerdcore - Programming, Electronics, Mechanics
Re: Servo mod - gears won't set with hold_servo.hex
« Reply #5 on: March 09, 2009, 01:03:26 PM »
She is trying to modify her servos for continuous rotation. I assume following the $50 robot tutorial.

Offline superchiku

  • Supreme Robot
  • *****
  • Posts: 952
  • Helpful? 5
  • cooll
Re: Servo mod - gears won't set with hold_servo.hex
« Reply #6 on: March 09, 2009, 01:03:59 PM »
did u modify the servos right...which pin are u using.. ?  and she..hwo do u know...omg is she the 1st female here
?
« Last Edit: March 09, 2009, 01:04:51 PM by superchiku »
JAYDEEP ...

IT AND ROBOTICS ENGINEER

"IN THE END IT DOESNT EVEN MATTER"

Offline BeckyTopic starter

  • Jr. Member
  • **
  • Posts: 38
  • Helpful? 0
  • "Bollocks to the rules" (George Orwell)
Re: Servo mod - gears won't set with hold_servo.hex
« Reply #7 on: March 09, 2009, 01:04:41 PM »
Did you take the servo apart yet?

Can you tell us where the servo is plugged in?

Hello - yes I have it in the first set of three pins beneath the capacitor and regulator.  I have taken out the screw and removed the gears.

Offline superchiku

  • Supreme Robot
  • *****
  • Posts: 952
  • Helpful? 5
  • cooll
Re: Servo mod - gears won't set with hold_servo.hex
« Reply #8 on: March 09, 2009, 01:05:54 PM »
lol tell the pin name...and number...
JAYDEEP ...

IT AND ROBOTICS ENGINEER

"IN THE END IT DOESNT EVEN MATTER"

Offline pomprocker

  • Supreme Robot
  • *****
  • Posts: 1,431
  • Helpful? 16
  • Sorry miss, I was giving myself an oil-job.
    • Nerdcore - Programming, Electronics, Mechanics
Re: Servo mod - gears won't set with hold_servo.hex
« Reply #9 on: March 09, 2009, 01:06:11 PM »
Which pin exactly?

Offline BeckyTopic starter

  • Jr. Member
  • **
  • Posts: 38
  • Helpful? 0
  • "Bollocks to the rules" (George Orwell)
Re: Servo mod - gears won't set with hold_servo.hex
« Reply #10 on: March 09, 2009, 01:06:37 PM »
cant understand..wat are u trying to do...? centre the servo or move the servo ...which mcu are u using...

Hell I have the ATmega168 variety - I am trying to centre them I believe

Offline BeckyTopic starter

  • Jr. Member
  • **
  • Posts: 38
  • Helpful? 0
  • "Bollocks to the rules" (George Orwell)
Re: Servo mod - gears won't set with hold_servo.hex
« Reply #11 on: March 09, 2009, 01:08:24 PM »
Which pin exactly?

Right OK... I am on the row that connects to pin 27 on microcontroller :)

Offline superchiku

  • Supreme Robot
  • *****
  • Posts: 952
  • Helpful? 5
  • cooll
Re: Servo mod - gears won't set with hold_servo.hex
« Reply #12 on: March 09, 2009, 01:08:41 PM »
the .hex was for atmega8 dont know if it will work in atmega168...even if it does i reckon u used the wrong pin...
JAYDEEP ...

IT AND ROBOTICS ENGINEER

"IN THE END IT DOESNT EVEN MATTER"

Offline BeckyTopic starter

  • Jr. Member
  • **
  • Posts: 38
  • Helpful? 0
  • "Bollocks to the rules" (George Orwell)
Re: Servo mod - gears won't set with hold_servo.hex
« Reply #13 on: March 09, 2009, 01:09:36 PM »
did u modify the servos right...which pin are u using.. ?  and she..hwo do u know...omg is she the 1st female here
?

lol I am sure there are loads of girls on here

Offline BeckyTopic starter

  • Jr. Member
  • **
  • Posts: 38
  • Helpful? 0
  • "Bollocks to the rules" (George Orwell)
Re: Servo mod - gears won't set with hold_servo.hex
« Reply #14 on: March 09, 2009, 01:10:43 PM »
the .hex was for atmega8 dont know if it will work in atmega168...even if it does i reckon u used the wrong pin...

Right :( OK then... so does anybody have a code for the 168?  Let me double check my pins...

Offline BeckyTopic starter

  • Jr. Member
  • **
  • Posts: 38
  • Helpful? 0
  • "Bollocks to the rules" (George Orwell)
Re: Servo mod - gears won't set with hold_servo.hex
« Reply #15 on: March 09, 2009, 01:12:39 PM »
http://www.societyofrobots.com/step_by_step_robot_step3C.shtml
I am using the same pins as this bloke ^  ;)

Offline superchiku

  • Supreme Robot
  • *****
  • Posts: 952
  • Helpful? 5
  • cooll
Re: Servo mod - gears won't set with hold_servo.hex
« Reply #16 on: March 09, 2009, 01:13:27 PM »
u used the wrong pin i guess u used one of the adc's pin...and may be the admin never used that one in hex
JAYDEEP ...

IT AND ROBOTICS ENGINEER

"IN THE END IT DOESNT EVEN MATTER"

Offline pomprocker

  • Supreme Robot
  • *****
  • Posts: 1,431
  • Helpful? 16
  • Sorry miss, I was giving myself an oil-job.
    • Nerdcore - Programming, Electronics, Mechanics
Re: Servo mod - gears won't set with hold_servo.hex
« Reply #17 on: March 09, 2009, 01:14:21 PM »
The code will work fine the pins are the same for mega8, 168, 328. You just have to make sure you're running it at 1MHz.

Offline superchiku

  • Supreme Robot
  • *****
  • Posts: 952
  • Helpful? 5
  • cooll
Re: Servo mod - gears won't set with hold_servo.hex
« Reply #18 on: March 09, 2009, 01:15:49 PM »
check oter pins..and the link had the whole $50 tutorial...which pin am i supposed to read amon that
JAYDEEP ...

IT AND ROBOTICS ENGINEER

"IN THE END IT DOESNT EVEN MATTER"

Offline superchiku

  • Supreme Robot
  • *****
  • Posts: 952
  • Helpful? 5
  • cooll
Re: Servo mod - gears won't set with hold_servo.hex
« Reply #19 on: March 09, 2009, 01:18:11 PM »
i dont think she would have modded the mcu frequency....may be some other prob..
JAYDEEP ...

IT AND ROBOTICS ENGINEER

"IN THE END IT DOESNT EVEN MATTER"

Offline BeckyTopic starter

  • Jr. Member
  • **
  • Posts: 38
  • Helpful? 0
  • "Bollocks to the rules" (George Orwell)
Re: Servo mod - gears won't set with hold_servo.hex
« Reply #20 on: March 09, 2009, 01:22:06 PM »
u used the wrong pin i guess u used one of the adc's pin...and may be the admin never used that one in hex

OK then... where do I plug it in to ?

Offline superchiku

  • Supreme Robot
  • *****
  • Posts: 952
  • Helpful? 5
  • cooll
Re: Servo mod - gears won't set with hold_servo.hex
« Reply #21 on: March 09, 2009, 01:22:40 PM »
which pin did the admin mention in the tutorial??
JAYDEEP ...

IT AND ROBOTICS ENGINEER

"IN THE END IT DOESNT EVEN MATTER"

Offline superchiku

  • Supreme Robot
  • *****
  • Posts: 952
  • Helpful? 5
  • cooll
Re: Servo mod - gears won't set with hold_servo.hex
« Reply #22 on: March 09, 2009, 01:26:00 PM »
u laterlly inverted it...u shoul have connected eitherto pin 2 or pin 3 that is pd0 or pd1.... instead u connected it to the adc pin
JAYDEEP ...

IT AND ROBOTICS ENGINEER

"IN THE END IT DOESNT EVEN MATTER"

Offline BeckyTopic starter

  • Jr. Member
  • **
  • Posts: 38
  • Helpful? 0
  • "Bollocks to the rules" (George Orwell)
Re: Servo mod - gears won't set with hold_servo.hex
« Reply #23 on: March 09, 2009, 01:26:36 PM »
The code will work fine the pins are the same for mega8, 168, 328. You just have to make sure you're running it at 1MHz.

Are you talking about the ISP frequency?  I have that set to 125.0 kHz ... is that wrong?

Offline pomprocker

  • Supreme Robot
  • *****
  • Posts: 1,431
  • Helpful? 16
  • Sorry miss, I was giving myself an oil-job.
    • Nerdcore - Programming, Electronics, Mechanics
Re: Servo mod - gears won't set with hold_servo.hex
« Reply #24 on: March 09, 2009, 01:27:17 PM »
Yes the pins on the right of the divot are adc pins. The divot on the mcu should be closest to the battery connection side.

Offline BeckyTopic starter

  • Jr. Member
  • **
  • Posts: 38
  • Helpful? 0
  • "Bollocks to the rules" (George Orwell)
Re: Servo mod - gears won't set with hold_servo.hex
« Reply #25 on: March 09, 2009, 01:29:38 PM »
which pin did the admin mention in the tutorial??

From the tutorial:
So the first step would be to open up the servo.
1) First make sure the servohorn is removed from the output shaft. The servohorn attaches to the main output gear (the biggest gear), so removing it helps keep the gears from all falling out when you open the servo up. Also, use a microcontroller to command the servo to rotate to 0 degrees, the point between the maximum and minimum angle the servo can rotate to. You may also do this step by hand, although it might not be as exact.

Note, if you are making The $50 Robot (or at least using the ATmega8 microcontroller), download this .hex file and upload it to your ATmega8. You dont need to compile anything, as I already did that for you. This program will tell the microcontroller to send a signal at 1.5ms, the signal your servos need to hold at the zero position.


it goes on but there is no mention of where to plug it ... ...

Offline pomprocker

  • Supreme Robot
  • *****
  • Posts: 1,431
  • Helpful? 16
  • Sorry miss, I was giving myself an oil-job.
    • Nerdcore - Programming, Electronics, Mechanics
Re: Servo mod - gears won't set with hold_servo.hex
« Reply #26 on: March 09, 2009, 01:29:54 PM »
No, not ISP frequency. I am talking about the speed at which your MCU is running. But like superchiku said, don't worry about it, as I doub't you have fiddled with it. ATmega168's run at 1MHz by default same as ATmega8's

The code will work fine the pins are the same for mega8, 168, 328. You just have to make sure you're running it at 1MHz.

Are you talking about the ISP frequency?  I have that set to 125.0 kHz ... is that wrong?


Offline BeckyTopic starter

  • Jr. Member
  • **
  • Posts: 38
  • Helpful? 0
  • "Bollocks to the rules" (George Orwell)
Re: Servo mod - gears won't set with hold_servo.hex
« Reply #27 on: March 09, 2009, 01:31:09 PM »
No, not ISP frequency. I am talking about the speed at which your MCU is running. But like superchiku said, don't worry about it, as I doub't you have fiddled with it. ATmega168's run at 1MHz by default same as ATmega8's

The code will work fine the pins are the same for mega8, 168, 328. You just have to make sure you're running it at 1MHz.

Are you talking about the ISP frequency?  I have that set to 125.0 kHz ... is that wrong?


Riteo  8)

Offline superchiku

  • Supreme Robot
  • *****
  • Posts: 952
  • Helpful? 5
  • cooll
Re: Servo mod - gears won't set with hold_servo.hex
« Reply #28 on: March 09, 2009, 01:35:17 PM »
check my answer... above u got ursolution there i guess..
JAYDEEP ...

IT AND ROBOTICS ENGINEER

"IN THE END IT DOESNT EVEN MATTER"

Offline BeckyTopic starter

  • Jr. Member
  • **
  • Posts: 38
  • Helpful? 0
  • "Bollocks to the rules" (George Orwell)
Re: Servo mod - gears won't set with hold_servo.hex
« Reply #29 on: March 09, 2009, 01:37:58 PM »
Yes the pins on the right of the divot are adc pins. The divot on the mcu should be closest to the battery connection side.


I was having a mad moment then... I am plugged in to pin 2 RXD PD0