Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

RC filter dillemma

Status
Not open for further replies.

fabbie

New Member
OK, after doing some reading and learning up the basic calculation on RC filters (thx to Nigel's recommendation), i finally used the RC filter to filter PWM pulses. :oops:
However, i have several problems
Firstly, the ripples are too large or if i increase my capacitor or resistor value, my PWM pulses voltage seem to have dropped from 5V to 1V after being filtered.
If there anyway i can maintain my voltage level with slight ripples?

Thx.
 
fabbie said:
OK, after doing some reading and learning up the basic calculation on RC filters (thx to Nigel's recommendation), i finally used the RC filter to filter PWM pulses. :oops:
However, i have several problems
Firstly, the ripples are too large or if i increase my capacitor or resistor value, my PWM pulses voltage seem to have dropped from 5V to 1V after being filtered.
If there anyway i can maintain my voltage level with slight ripples?

You give almost no information?.

What frequency is your PWM?.

What mark/space ratio are you using?.

What frequency is your filter designed for?.

What are the source and load impedances on the filter?.

What filter values are you using?.

What about posting the circuit?.

If you have excessive ripple, your filter is too high a frequency, if your filter is too low it should only affect it's response time, not the output. If you mark/space ratio is 20%, with a 5V rail you would expect to get 1V out.

Filtering PWM with an RC filter is an EXTREMELY! common technique, most TV sets use it in five or more places!.
 
sorry about that.

First of all, i designed my filter for 1000Hz frequency. My PWM is 4kHz.

I used the formula R = 1 / ( 2 x pi x f x c)
Initially i set the C=0.1 uF, therefore i get R= approximately 1.5Kohm.

The space ratio u meant was duty cycle? i used 30%. Strange though. My PR2 register for my PIC was set at 14(which would mean 16 steps), and my PWM was set to run at STEP 7(which is 50%).But it could out around 30%. But i'll continue with my testing.

Sorry but i dont understand the "source and load impedance" part.
Do u meant by Z= squareroot ( R.square x Xc.square)?

PLS tell me if i did anything wrongly. THX
 

Attachments

  • rc.jpg
    rc.jpg
    6.9 KB · Views: 796
fabbie said:
First of all, i designed my filter for 1000Hz frequency. My PWM is 4kHz.

I would suggest that's FAR too high, I've never got involved in designing a filter for a PWM output, but a simple RC filter isn't going to attenuate much at only four times it's roll-off frequency. Try calculating the reactance of the 0.1uF at 4KHz, and work out the attenuation of the resulting potential divider.

A quick glance at a TV service manual (Tatung 190 series) which uses PWM for volume, brightness etc. shows that it uses a 270K resistor, and a 1uF electrolytic capacitor, buffered by emitter followers. But I don't know what the PWM speed of it is.

What actually are you trying to do anyway?.
 
When u mentioned that it is TOO HIGH, what you meant is i should use a lower frequency filter?

I intend to monitor the current of my hbridge using a sense resistor. However, since the current is going to be in pulses, i want to smoothen it. 1 thing for sure is that i cant have high attenuation, as it may affect my current reading.

One more thing, when u mentioned i should work out the potential divider, how can i measure the voltage drop across the capacitor? since it is in DC pulses. use oscilloscope? a MM wont be able to measure DC pulses.
 
you shouldn't get pulses, esp with an inductive load (and you should get negitive then going positive current with a resistive load).

sounds like you have it in the wrong place

Where have you placed the sense resistor - it should be placed in the continuous current path. It sounds like you have placed it
 
fabbie said:
When u mentioned that it is TOO HIGH, what you meant is i should use a lower frequency filter?

Yes a MUCH lower frequency!

I intend to monitor the current of my hbridge using a sense resistor. However, since the current is going to be in pulses, i want to smoothen it. 1 thing for sure is that i cant have high attenuation, as it may affect my current reading.

Same thing, an RC filter!. Attenuation is irrelevant, you don't need to know a specific figure anyway - just if it's above a certain figure. This will produce a voltage based on the AVERAGE current - which may?, or may not?, be what you want. Or you could just measure the instantaneous current at the peaks?.

One more thing, when u mentioned i should work out the potential divider, how can i measure the voltage drop across the capacitor? since it is in DC pulses. use oscilloscope? a MM wont be able to measure DC pulses.

You can measure the voltage with a DC meter, after all the whole point of the circuit is to produce a DC voltage!.

To do the calculation assume it's AC, of the frequency you're using, and work out the reactance of the capacitor at that frequency. Use that reactance value, along with the series resistor, to work out the attenuation of the potential divider at that frequency.
 
fabbie said:
Firstly, the ripples are too large or if i increase my capacitor or resistor value, my PWM pulses voltage seem to have dropped from 5V to 1V after being filtered.
If there anyway i can maintain my voltage level with slight ripples?

Thx.

What do you expact to get out of the filter?
If you pass a PWM signal through a low pass filter, you will get DC.
The time constant of the filter must be long compared with the period of the pwm waveform, or to put it the other way around, the cut off frequency of the filter must be low compared with the frequency of the PWM.

Example
If you have a pulse wave with a peak value of 10 volts and a mark/space ratio of 10%, you will get 1volt out of your filter.
If you increase the mark/space ratio to 50%, you will get 5 volts out of your low pass filter.

This is what you are seeing already I think. Some "bumpy DC" out of your filter. That is what I would expect.

JimB
 
[/quote]

Same thing, an RC filter!. Attenuation is irrelevant, you don't need to know a specific figure anyway - just if it's above a certain figure. This will produce a voltage based on the AVERAGE current - which may?, or may not?, be what you want. Or you could just measure the instantaneous current at the peaks?.
[/quote]

If i wan to measure instantaneous current how can i do that? using a sense resistor. Use the PIC?
 
fabbie said:
If i wan to measure instantaneous current how can i do that? using a sense resistor. Use the PIC?

Use the PIC to sample at a high rate, pick the highest reading over a certain time - personally I would suggest averaging it with an RC filter, it would give a more useful value.
 
I've just had a quick play with my scope at work!.

Like most scopes, it's got a 1KHz p-p squarewave output on the front for calibrating probes.

I fed this through a 10K resistor to the probe, then connected different capacitors from the probe to ground.

A 4.7uF electrolytic produced only 5mV p-p ripple, and a 22uF only 2mV p-p ripple. Both of these were too small to see on the original scope setting, and required the gain turning up considerably (actually to 5mV/cm and 2mV/cm). With a 1uF, ripple was visible on the original 200mV/cm setting - actually measured at 20mV p-p.

In all cases (included 0.1uF, where the ripple was too bad to use) the DC output was 0.5V - half the 1V p-p of the original squarewave - as it had to be!.

EDIT:

Bit more info, I've just been checking it on a TV, PWM is commonly used for the tuning voltage. The particular model I just tested uses 25KHz PWM, it's 33V p-p (using the usual precision 33V reference chip). The filter consists of a 15K resistor, and a 0.1uF capacitor - there's NO visible ripple on the scope, it's below the noise levels on the chassis.
 
Status
Not open for further replies.

Latest threads

Back
Top