Society of Robots - Robot Forum

Software => Software => Topic started by: ac2011 on August 23, 2011, 10:59:09 PM

Title: $50 robot servo motor
Post by: ac2011 on August 23, 2011, 10:59:09 PM
I am trying to build the $50 robot.  I got the micro controller built. Loaded the hex file (cut and pasted from the tutorial) into the ATmega8 using the AVRISP mkII programmer. The servo started spinning but it does not stop for any position of the pot.  Is there any way to debug why it is so?

This is my first robot.  Thanks for any help. 

-ac
Title: Re: $50 robot servo motor
Post by: Chuckand on August 24, 2011, 08:05:57 AM
Did you edit the code by removing the /* and */ from the "servo test code" lines before writing to the part?

Also, the pots are very sensitive and it takes a fairly light touch to find the position where the motor stops. you can pass though it without ever knowing it.

That's all I got....

Chuck (in Aaaala Baaama) 
Title: Re: $50 robot servo motor
Post by: ac2011 on August 24, 2011, 11:37:57 PM
Which code samples are you refering to....

I have not started on any programming yet.  I am simply using (cut and paste) the .hex file included in the $50 tutorial to modify a HS-311 servo.  Looks like the .hex file gets loaded into the ATmega8 and the motor spins.  I also dumped the file from the ATmega8 flash and found that it got 4 times larger when it came out, but that could be due to all that extra empty FF bits at the end. 

My big problem is I cannot get the pot to stop the servo from spinning, as the tutorial describes.  No matter how slowly I turn the pot.   

I think if I hook an oscilloscope to the PD0 and PD1 pins I will know what is going on...  Any suggestions.  Did you have to write your own pulse generator?

-ac
Title: Re: $50 robot servo motor
Post by: ac2011 on August 25, 2011, 06:12:16 PM
Solved the problem.  I needed to tie the grounds of the 6V and the 9V supply together.
It was not a software issue...sorry.
-ac