Author Topic: Pulse width modulation  (Read 2376 times)

0 Members and 1 Guest are viewing this topic.

Offline mobzTopic starter

  • Jr. Member
  • **
  • Posts: 14
  • Helpful? 0
Pulse width modulation
« on: December 13, 2007, 07:48:01 AM »
Hey there.i have managed to complete my first robot thanks to you guys.but one thing is im not controlling my speed so when turning it crushes into walls.i researched that with pwm,i can give 1 wheel say 20% the other 80% and make a smooth turn.i googlled it but nothing .can somebody help??

And last thing how can i increase my ir sensor range ??im getting small ranges i dont know why??

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: Pulse width modulation
« Reply #1 on: December 13, 2007, 08:05:26 AM »
Can you tell us more about your hardware?

Are you using DC motors? And what kind of motor driver do you have?

PWM is when you turn your motor on and off really really fast. So if its off 50% of the time, your motor will go at about 50% speed. Just send a square wave (off on off on) to your motor controller.

For example:
Code: [Select]
pin_high
delay_5ms
pin_low
delay_5ms
loop

Offline mobzTopic starter

  • Jr. Member
  • **
  • Posts: 14
  • Helpful? 0
Re: Pulse width modulation
« Reply #2 on: December 13, 2007, 08:24:04 AM »
im using GM8 DC motors,quad h bridge and an atmega8.

Offline Mega

  • Full Member
  • ***
  • Posts: 88
  • Helpful? 0
    • MegaBot Blog
Re: Pulse width modulation
« Reply #3 on: December 13, 2007, 10:36:04 AM »
What kind of IR sensors do you use?
Visit my robotics blog at http://megabotblog.blogspot.com/

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: Pulse width modulation
« Reply #4 on: December 13, 2007, 11:01:46 AM »
Quote
quad h bridge and an atmega8.
quad? are you controlling four motors? which pins are you using to control the h-bridges and what are you doing in software?