go away spammer

Author Topic: filtered PWM problem  (Read 1990 times)

0 Members and 1 Guest are viewing this topic.

Offline SomeSabaTopic starter

  • Full Member
  • ***
  • Posts: 75
  • Helpful? 0
filtered PWM problem
« on: February 22, 2008, 12:37:06 AM »
hello everyone

I'm trying to read the PWM from my wireless futaba receiver. Im using a low-pass filter that has a 10k ohm resistor and .1uF capacitor, with the transmiter stick centered the flilter outputs .269 volts, and .185 and .369 for left/right.

The receiver and my atmega168 share a common ground, and i connected the filter's output to my ADC.

After many weeks of tweeking software ive concluded that my ADC value somehow cycles through all 3 apropiate voltage values. For example if i have my LED turn off when the PWM is .185 or .369 and turn on at .269 the LED will basically flash or flicker depending on my ADC prescaler.

Should i changed my low pass filter or just try to read the PWM periods with interupts and timers?

I've spent many weeks on this problem, any help is appreciated

Offline Tsukubadaisei

  • Robot Overlord
  • ****
  • Posts: 293
  • Helpful? 0
Re: filtered PWM problem
« Reply #1 on: February 22, 2008, 03:08:48 AM »
My advise is to use the search feature:

http://www.societyofrobots.com/robotforum/index.php?topic=3099.0

look at the last post, it has source code and everything. I did it by reading the PWM directly(without using the integrator circuit).
A.I.(yes those are my initials)

Offline SomeSabaTopic starter

  • Full Member
  • ***
  • Posts: 75
  • Helpful? 0
Re: filtered PWM problem
« Reply #2 on: February 22, 2008, 02:36:26 PM »
Thank you for your links, but the links you have me tell me how to do what i already am doing/know how to do. I  was wondering if anyone knew why i am experiencing the problem i am with the flashing LEDs, or if i should just give up and switch to reading the PWM
« Last Edit: February 22, 2008, 02:37:59 PM by SomeSaba »

Offline Tsukubadaisei

  • Robot Overlord
  • ****
  • Posts: 293
  • Helpful? 0
Re: filtered PWM problem
« Reply #3 on: February 22, 2008, 08:59:20 PM »
When I tried the integrator circuit I first tried without an op-amp and got almost the some voltages you are getting( 0.2V~0.3V) I think those voltages are very low and I couldnt read the signal very well. When I debbuged using the terminal app that comes with the gcc developer I got lots of random small values. So I connect a op-amp with a 1kΩ and 10kΩ for 10X amplifying and got 2V~3V depending on the PWM. Thanks to that I was able to read the signals with precision.
So I think you could:
1) use an op-amp
2) use the software solution and read the PWM directly (after all it is just software, not a mess with components and cables)
A.I.(yes those are my initials)

 


Get Your Ad Here

data_list