Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Forums > General Electronics Chat


General Electronics Chat This forum is for general chat about electronics, eg: Dont know what a part does? Dont know how to read a circuit? Want to get an opinion?

Reply
 
Thread Tools Display Modes
Old 25th October 2007, 11:53 AM   (permalink)
Default converting PWM to DC voltages using RC

Hello,

I am trying to build a circuit to convert a PWM signal into a DC voltage that correspond to the duty cycle of the PWM signal.

I am not sure how to chose the optimal values for R and C depending on the frequency. is there a relation i can use to approximately find suitable values for R and C

I found this page on wiki, i think my answer may reside inside.. but i can't find it! maybe you can :

http://en.wikipedia.org/wiki/RC_circ...considerations

or maybe you can provide me with the info i need.. that would be very kind of you guys! a smal explanation would be a plus!

thx a lot

EDIT: After further readings on the web, maybe the right question to ask is: Do i have to build my RC circuit so that it's central frequency match the one of the PWM signal?

EDIT 2: No i think i am wrong, accoding to this page http://ontrak.net/pwm.htm the frequency of the PWM is much more important than the banpass frequency of the filter....
__________________
Ibrahim Kamal
check my electronics and robotics page: http://www.ikalogic.com/

Last edited by ikalogic; 25th October 2007 at 12:00 PM.
ikalogic is offline   Reply With Quote
Old 25th October 2007, 12:49 PM   (permalink)
Default

Higher frequency will allow you to use smaller caps and still get good filtering. Common frequencies are 20khz-100khz. If you use too large of a resistor/cap combination the repsonce will be slugish when the duty cycle changes. You want to find the best value that will provide a low rippple but enough responce so you can change the signal at your desired rate.
__________________
"Because I be what I be. I would tell you what you want to know if I
could, mum, but I be a cat, and no cat anywhere ever gave anyone a
straight answer, har har."
Sceadwian is offline   Reply With Quote
Old 25th October 2007, 02:11 PM   (permalink)
Default

Quote:
Originally Posted by Sceadwian
Higher frequency will allow you to use smaller caps and still get good filtering. Common frequencies are 20khz-100khz. If you use too large of a resistor/cap combination the repsonce will be slugish when the duty cycle changes. You want to find the best value that will provide a low rippple but enough responce so you can change the signal at your desired rate.
That's exactly what i want!

now is there a way to calculate it rather than finding it by trial an error?
__________________
Ibrahim Kamal
check my electronics and robotics page: http://www.ikalogic.com/
ikalogic is offline   Reply With Quote
Old 25th October 2007, 03:31 PM   (permalink)
Default

Quote:
Originally Posted by ikalogic
That's exactly what i want!

now is there a way to calculate it rather than finding it by trial an error?
I suspect it requires some analysis as well as calculation to pick the best values. The impedence of the L/C filter will load the PWM output pin so it has to be high enought to not load down the PWM output. The lowest frequency of the PWM will be the determing value such that the low-pass filter corner frequency is a smaller value.

Just as important is the load impedence of the circuit that is going to measure or see the output of the L/C low pass filter, it needs to be a much higher impedenace to not effect the true DC value. OP amp buffer stages are often used in that application.

Lefty
__________________
Measurement changes behavior
Leftyretro is offline   Reply With Quote
Old 25th October 2007, 03:40 PM   (permalink)
Default

Check the MicroChip application notes, if I recall correctly, there are two explaining just what you want!.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is offline   Reply With Quote
Old 26th October 2007, 08:10 AM   (permalink)
Default

Quote:
Originally Posted by Nigel Goodwin
Check the MicroChip application notes, if I recall correctly, there are two explaining just what you want!.
I can't find what i need.. i found this document:
http://ww1.microchip.com/downloads/e...tes/00823a.pdf

but it does'nt have what i search..

can you assist me further more?

thx
__________________
Ibrahim Kamal
check my electronics and robotics page: http://www.ikalogic.com/
ikalogic is offline   Reply With Quote
Old 26th October 2007, 08:58 AM   (permalink)
Default

Attached is a circuit I designed and built for a friend some years ago. The purpose and circuit description are included in the attachment.

It includes a PWM to DC conversion, see Figure 2. It works at the mains frequency (50 Hz) but it could be altered for other frequencies.

Signals A & B are PWM signals whose mark/space ratios are proportional to the phase differences. These signals are converted to "DC" by the averaging circuits around IC6a & IC6b.

See the description for more detail.
Attached Files
File Type: pdf Three Phase Meter.pdf (107.2 KB, 23 views)
__________________
Len
ljcox is offline   Reply With Quote
Old 26th October 2007, 10:04 AM   (permalink)
Default

Quote:
Originally Posted by ikalogic
I can't find what i need.. i found this document:
http://ww1.microchip.com/downloads/e...tes/00823a.pdf

but it does'nt have what i search..

can you assist me further more?

thx
A simple search for 'pwm' on MicroChip finds this one http://ww1.microchip.com/downloads/e...tes/00538c.pdf
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is offline   Reply With Quote
Old 26th October 2007, 10:19 AM   (permalink)
Default

Quote:
Originally Posted by Nigel Goodwin
A simple search for 'pwm' on MicroChip finds this one http://ww1.microchip.com/downloads/e...tes/00538c.pdf

Thank you very much.
__________________
Ibrahim Kamal
check my electronics and robotics page: http://www.ikalogic.com/
ikalogic is offline   Reply With Quote
Old 30th October 2007, 10:56 AM   (permalink)
Default

hello.. it's me again..

after reading the pdf proposed by Nigel Goodwin, i understood how to chose the right frequency for my PWM signals with regard to the bandwidth of my orriginal signal... however i dont quite understand why...

Let me put it this way: according to that PDF by microchip, i have to design the RC filter with a cut-off frequency equal to the frequency of the orriginal signal. i guess this is the way to get the best response/filtering ratio, right?

Then, what i really don't get, the PWM signal is chosen to have 5 times the frequency of the orriginal signal, why? how pwm signals having a frequency 5 times higher than the cut-off frequency pass through the filter??

can anyone explain it to me in a simple way?
__________________
Ibrahim Kamal
check my electronics and robotics page: http://www.ikalogic.com/
ikalogic is offline   Reply With Quote
Old 30th October 2007, 11:01 AM   (permalink)
Default

The PWM frequency doesn't pass through the filter, that's the whole point!, the filter is there to remove it.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is offline   Reply With Quote
Old 30th October 2007, 12:53 PM   (permalink)
Default

Quote:
Originally Posted by Nigel Goodwin
The PWM frequency doesn't pass through the filter, that's the whole point!, the filter is there to remove it.
ok so instead of passing throught the filter the average voltage will appear. ok.. i think i'll fully understand this when i'll have built this circuit and ran some oscilloscope readings around some points...


thanks again Nigel.
__________________
Ibrahim Kamal
check my electronics and robotics page: http://www.ikalogic.com/
ikalogic is offline   Reply With Quote
Old 31st October 2007, 01:17 PM   (permalink)
Default

The word 'filter' might cause a bit of confusion. A filter that we might use in a water line traps the particles and at some point the particles are discarded with the filter cartridge (or flushed) - the important thing is that they do not reappear in any form downstream.

A simplification that might help to clear things up: some or all of the components of a filter, such as capacitors and inductors, serve to store energy. In the case of the RC filter the 'C' stores energy that is returned to the output. In the case of the PWM the 'C' fills in the off time - so unlike the water filter example the energy that is trapped, in a manner of speaking, does appear downstream at a slightly different time. Current flow thru the 'R' does dissapate some energy so it's not returned.
__________________
stevez
stevez is offline   Reply With Quote
Old 31st October 2007, 01:28 PM   (permalink)
Default

I get the feeling that just confuses the issue further?.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is offline   Reply With Quote
Old 31st October 2007, 02:06 PM   (permalink)
Default

Nigel - not sure, it all depends on where the original poster is at. What I described helped me sort some things out with a young man who is now my mentor (for electronics anyway). As a mechanical engineer I was visualizing a PWM signal on the input - with even more gaps or holes on the output because I was stuck on the idea that the filter only removed energy as a mechanical filter would remove particles. From my point of view the filter, in the PWM case, serves to move the energy around over time rather than just trapping and discarding.
__________________
stevez
stevez is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Latest
Can you help me for Isolated DC to DC gbmewada General Electronics Chat 7 15th October 2007 07:00 AM
Help: Mains Powered DC Motor bobledoux Electronic Projects Design/Ideas/Reviews 4 10th October 2007 09:30 PM
PWM control of BLDC motors (brushless DC motors) jhanus Micro Controllers 6 1st October 2007 04:32 PM
Writing measured voltages to LCD Tamil.selvam Micro Controllers 1 5th September 2006 11:47 AM
Practically converting AC voltages Scubasteve Electronic Projects Design/Ideas/Reviews 5 9th April 2003 01:05 PM



All times are GMT. The time now is 03:15 AM.


Electronic Circuits  |  Electronics Wiki
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.