PWM filtering

Thread Starter

gdallas

Joined Apr 25, 2012
74
Say I have a 12V pwm that provides two duty cycles to control the intensity of a lamp; bright and dim. But lets i want to change this behaviour but I am unable to affect the control system upstream of this.

I want the bulb to be on only with the higher intensity but be off when the lower intensity duty. What would he best method for doing this? Could I use a basic high pas filter?

Current conditions

Large duty = bright

Low duty = dim


New conditions

Large duty = bright

Low duty = off
 

MrChips

Joined Oct 2, 2009
30,824
You need a combination of two circuits which are designed to provide two separate functions:

(1) a circuit to discriminated between two duty cycles,

(2) a switching function to turn on the lamp. This can be a transistor or mechanical relay.

For (1), you can use a monostable multivibrator that is set to trigger halfway between the two pulse widths (digital solution).

You can also use an analog solution by integrating (low pass filter) the PWM signal and use an analog comparator to detect when the average voltage exceeds a given threshold voltage.
 

Thread Starter

gdallas

Joined Apr 25, 2012
74
My initial thoughts were basic pic measuring the duty., then enabling an output only when it detects the signal to be larger duty that. Something like below.


Overkill?
 

Attachments

Thread Starter

gdallas

Joined Apr 25, 2012
74
You need a combination of two circuits which are designed to provide two separate functions:

(1) a circuit to discriminated between two duty cycles,

For (1), you can use a monostable multivibrator that is set to trigger halfway between the two pulse widths (digital solution).
Hi Mr Chips,
Would you mind elaborating on this as i don’t have much experience with mulitibrators or could you point me in the direction of a decent example? how does it discriminate between the two pulse widths and wont its output change state only momentarily, therefore how do i use this output to control the base of my transistor if it doesn’t latch?
 

Kermit2

Joined Feb 5, 2010
4,162
how about just reading light intensity directly with a photocell? that could then be put in a small transistor circuit that drives a relay.
 

Alec_t

Joined Sep 17, 2013
14,335
Even simpler, you could perhaps just integrate the PWM and rely on the fairly sharp switching threshold of a FET :-
PWM-switch.gif

Edit: You may have to adjust the resistor values, depending on the FET used and the two PWM duty cycle values.
 
Last edited:

Thread Starter

gdallas

Joined Apr 25, 2012
74
Even simpler, you could perhaps just integrate the PWM and rely on the fairly sharp switching threshold of a FET :-
View attachment 73870

Edit: You may have to adjust the resistor values, depending on the FET used and the two PWM duty cycle values.
Thanks Alec_t,

would you mind explaining this and advise calculations required to tune this to specific duty's and pulsewdiths
many thanks
 

Alec_t

Joined Sep 17, 2013
14,335
would you mind explaining this
R2 and C1 integrate the PWM signal to give an averaged voltage proportional to the pulse voltage (12V) and the duty cycle. For example, for 50% duty cycle the voltage would be (if we ignore R3) 50% of 12V = 6V. For a lower duty cycle the averaged voltage would be lower. Providing the averaged voltage exceeds the Vgs threshold for the particular FET it will conduct. The trick is to get an optimum voltage which for the 'high' duty cycle exceeds the threshold but for the 'dim' duty cycle does not. Hence the use of R3. R3 forms with R2 a potential divider and can be chosen to give that optimum voltage. The threshold varies from one FET to another (even for FETs of the same type number), so R3 would need to be tweaked accordingly. The values of R2 and C1 should be chosen to give an RC time constant about ten times the period of the PWM signal.
 

Thread Starter

gdallas

Joined Apr 25, 2012
74
I see what you're saying. This is a fantastic solution. Thanks for sharing your thoughts. The dimmed voltage is 2.5v as measured tonight. 11.36 when bright

I'll get about this now.

Thanks
 
Top