Author Topic: Understanding some Basics of Servo's and AtMega  (Read 5653 times)

0 Members and 1 Guest are viewing this topic.

Offline silent069Topic starter

  • Full Member
  • ***
  • Posts: 49
  • Helpful? 0
Understanding some Basics of Servo's and AtMega
« on: July 03, 2008, 05:53:42 PM »
Hi all, I hope this isn't a huge repost. If it is I do apologize but the main purpose around this post is to gather some information to help guide the new comers to robotics as it will be posted in my $50 robot guide.

1) Some detailed info on understanding how a servo can distinguish between which direction to rotate. I know by centering the servo we are than tricking it into thinking its running at a certain resistance which results in it moving either forward or backwards. My questions is, how do you distinguish which numbers would result in which direction. Do all servo's follow this guideline, or do you have to do some math to figure out which numbers will do what.

2) I haven't been able to find any info i can truly understand that best describes how to configure your own makefiles ect. I have been picking away at admins makefile and source code for the $50 robot but I just cant seem to make total sense of most things. I know this has a lot to do with my lack of programing experience. Would any of you suggest anything to read that may have helped you when you were first introduced into robotics?
 I have read the PDF I have linked here and it has definitely helped. But anything else that could describe why things are being done would be much appreciated.  http://www.swrtec.de/swrtec/clinux/avrgcc/UOP_ATMega_Handbook_1_0.pdf   


That all I Have right now off the top of my head. Just remember, this post is intended to be used on my members page as a GUIDE to help all the newcomers best understand the basics of robotics.

**UPDATE** I just stumbled upon http://www.avrbeginners.net/ looks like a good starting point for anyone!
« Last Edit: July 03, 2008, 09:41:10 PM by silent069 »

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: Understanding some Basics of Servo's and AtMega
« Reply #1 on: July 19, 2008, 02:09:14 PM »
Quote
My questions is, how do you distinguish which numbers would result in which direction. Do all servo's follow this guideline, or do you have to do some math to figure out which numbers will do what.
All you are doing is creating a square wave, with a specific pulse width.

If the servo detects a high signal for ~1.5ms, it will center. For ~2ms, it will go one way, and with ~1ms, the other way. This is default for all servos of all brands.


As for that makefile, I didn't write 95% of it. Forgot where I got it from, but I think it was from the MFile program that came with WinAVR.

Offline izua

  • Supreme Robot
  • *****
  • Posts: 682
  • Helpful? 0
    • izua electronics
Re: Understanding some Basics of Servo's and AtMega
« Reply #2 on: July 19, 2008, 02:26:31 PM »
Quote
1) I know by centering the servo we are than tricking it into thinking its running at a certain resistance which results in it moving either forward or backwards.

A standard servo maps angular position to pulse width. If there is a mechanical offset, your center will not be the center of the pulse (1.5ms) but something else. A hacked servo maps pulse width to speed (to some small degree). Any value lower than center means one direction, any value higher than center means the other direction. This also accounts that in your hack you haven't inverted the motor's wires (easy way to command two servos in opposite direction with the same signal, for driving forward or backward).

A servo has nothing to do with resistance. The signal is read and interpreted by the servo chip. Okay, so maybe in analog, the signal triggers an oscillator, but the servo is digital by nature (signal is digital) and it should be interpreted as such.
« Last Edit: August 25, 2008, 09:23:59 AM by izua »
Check out my homepage for in depth tutorials on microcontrollers and electronics.

 


Get Your Ad Here