Author Topic: need help with pwm in atmega168  (Read 5385 times)

0 Members and 1 Guest are viewing this topic.

Offline rox2007Topic starter

  • Full Member
  • ***
  • Posts: 95
  • Helpful? 0
need help with pwm in atmega168
« on: January 18, 2008, 09:33:18 PM »
please

Offline hazzer123

  • Supreme Robot
  • *****
  • Posts: 460
  • Helpful? 3
Re: need help with pwm in atmega168
« Reply #1 on: January 19, 2008, 09:13:34 AM »
please post more about your problem
Imperial College Robotics Society
www.icrobotics.co.uk

Offline rox2007Topic starter

  • Full Member
  • ***
  • Posts: 95
  • Helpful? 0
Re: need help with pwm in atmega168
« Reply #2 on: January 19, 2008, 09:22:14 AM »
i have two servos that i would like to control with PWM because i cant seem to get it right anyother way.

Offline Ro-Bot-X

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 1,431
  • Helpful? 25
  • Store: RoBotXDesigns.ca
Re: need help with pwm in atmega168
« Reply #3 on: January 19, 2008, 09:37:27 AM »
You like to be secretive, don't you? We can't guess your setup, you have to explain more.

If you are using Arduino, there is a library that uses Timer1 to generate PWM servo pulses. http://www.arduino.cc/playground/ComponentLib/Servotimetimer1

If you are using $50 robot there is this tutorial: http://mil.ufl.edu/~achamber/servoPWMfaq.html
Check out the uBotino robot controller!

Offline rgcustodio

  • Robot Overlord
  • ****
  • Posts: 217
  • Helpful? 0
  • Use "Search" and ye might find answers!
Re: need help with pwm in atmega168
« Reply #4 on: January 19, 2008, 10:03:11 AM »
i guess rox2007 is referring to his problem posted here:
http://www.societyofrobots.com/robotforum/index.php?topic=2917.0
The best thing one can do when it's raining is to let it rain. - H. W. Longfellow

understanding is the path to enlightenment

Offline rox2007Topic starter

  • Full Member
  • ***
  • Posts: 95
  • Helpful? 0
Re: need help with pwm in atmega168
« Reply #5 on: January 19, 2008, 10:59:42 AM »
yep, would really appreciate any help

Offline rox2007Topic starter

  • Full Member
  • ***
  • Posts: 95
  • Helpful? 0
Re: need help with pwm in atmega168
« Reply #6 on: January 19, 2008, 11:03:19 AM »

If you are using $50 robot there is this tutorial: http://mil.ufl.edu/~achamber/servoPWMfaq.html


how would i modify it for a hacked servo

this tutorial is helpful. it actually leads to this

http://mil.ufl.edu/~achamber/servoPWMwCodeVision.html

but the codevision i have, which is the new one does not look like what was described in that tutorial
« Last Edit: January 19, 2008, 11:04:19 AM by rox2007 »

Offline Ro-Bot-X

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 1,431
  • Helpful? 25
  • Store: RoBotXDesigns.ca
Re: need help with pwm in atmega168
« Reply #7 on: January 20, 2008, 01:41:29 AM »
Quote
how would i modify it for a hacked servo

A modified servo for continuous rotation is controlled exactly the same as a regular servo. If you send a pulse between 1 ms to 1.5 ms, the servo will rotate counterclockwise at a different speed, the 1.5 ms pulse makes the servo stop and a pulse between 1.5 ms and 2 ms will make the servo rotate clockwise at a different speed. It all depends on servo quality. Some servos just rotate at the maximum speed no matter what pulse you give.
Check out the uBotino robot controller!

Offline rox2007Topic starter

  • Full Member
  • ***
  • Posts: 95
  • Helpful? 0
Re: need help with pwm in atmega168
« Reply #8 on: January 20, 2008, 09:46:40 AM »
sorry i didnt say this earlier, but it worked...:)
thanks alot for the link. to use it with an atmega 168 you need the file incompato.h, i found it on google.

 


Get Your Ad Here

data_list