Maker Pro
Maker Pro

Trying to understand PWM / solve relay buzz

timpjeep

Jan 6, 2019
4
Joined
Jan 6, 2019
Messages
4
Hi Everyone. Im working on a 3position switch hookup for some aux driving lights and turns out my 'hi beam on' signal wire is PWM. I understand why that makes the relay buzz but im not sure how to address it. I have found diagrams like this which shows a capacitor but I don't understand why the capacitor goes to ground vs being 'in line' to the circuit. So that's my first question, why does this work? (image grabbed from a post by BobK) From other 'anti flicker' setups I have seen I do know this works but that's not good enough, I want the why too :)
upload_2016-6-27_15-21-5-png.27583


My next question is how would I wire this up with a 3 position switch (maybe knowing the why would help) In position 1 the input is 12v off the battery, position 2 is off, position 3 is PWM.
If I wired it up 'as show' would there be a problem when I had the switch in position 1?
Thanks guys! And sorry if this is a dumb question, I tried googleing around but I lack the vocabulary to ask the right question.
 

BobK

Jan 5, 2010
7,682
Joined
Jan 5, 2010
Messages
7,682
The reason it works is that the capacitor charges while the PWM signal is high, then continues to supply current to the relay when it is low. The diode prevents the current from flowing backwards from the cap to the source of the PWM signal. I don’t recognize that schematic though

Bob
 
Last edited:

timpjeep

Jan 6, 2019
4
Joined
Jan 6, 2019
Messages
4
Thanbs Bob, I understand the capacitor holds the charge I guess maybe I don't understand how it works. I THOUGHT Volts come in one end and go out the other so it would be providing a charge on the ground side in the diagram. What I think im reading from you is it provides the charge on the 'in' side and the ground side is there for …. overflow?
If that's the case then this works just fine on the PWM and steady 12v circuits?
Is there anything you can point me at to understand sizing the capacitor? Other posts for headlight antiflicker says to use 4700uf 35v capacitors. Don't know why that specific size and im assuming I don't need that big of one as im driving a relay vs a whole headlight.
Looking at the diagram again its from a post from 2016 :) https://www.electronicspoint.com/forums/threads/effectively-defeating-pwm-on-jeep-wrangler.279513/
THANKS
 

BobK

Jan 5, 2010
7,682
Joined
Jan 5, 2010
Messages
7,682
Indeed! I must have stolen that from somewhere.

The capacitor, in this usage, is analogpus to a battery that charges when the signal is high and dischages when it is low. The current does not go in one terminal of a battery and come out the other one.

The circuit will work just fine with a steady 12V. It acts just like a battery operated device with the charger plugged in.

The capacitor should be sized such that R times C, where R is the coil resistance is several tmes higher than the PWM period.

For example, if the coil resistance is 100 Ohms and the PWM period is 0.01 seconds (100 Hz,) we might make RC 0.05 seconds.

RC = 0.05

100 C = 0.05

C = 0.0005 = 500 uF

Bob
 

timpjeep

Jan 6, 2019
4
Joined
Jan 6, 2019
Messages
4
Thanks Bob for straightening me out on the capacitor and the math! Makes perfect sense.
tim
 

duke37

Jan 9, 2011
5,364
Joined
Jan 9, 2011
Messages
5,364
I would replace the capacitor with a diode, the relay inductance then is used to give a fairly steady current with little buzz. The diode is smaller, lighter and cheaper than a capacitor.

Even better would be to use a FET instead of a relay to drive the LED. A small capacitor woud be needed across the gate/source and a resistor to discharge the capacitor when the circuit is not energised.
 

BobK

Jan 5, 2010
7,682
Joined
Jan 5, 2010
Messages
7,682
That is an interesting idea, but it would essentially be a buck converter, reducing the voltage based on the duty cycle of the PWM signal.

Bob
 

timpjeep

Jan 6, 2019
4
Joined
Jan 6, 2019
Messages
4
Thanks Duke, I don't know FET's (though I did fine what thats short for) so ill have to go look in to that some.
For the 'drop the capacitor' idea, my goal was to make the buzz go away, first I can hear it though maybe I can wrap it in something and deaden it but second, I didn't think that was good for the relay and would meaningfully shorten the life of the relay.
thanks
tim
 

duke37

Jan 9, 2011
5,364
Joined
Jan 9, 2011
Messages
5,364
BobK has shown up my faulty logic and a simple diode will not do.

Relays or transfomers can buzz for years without trouble. I have encountered relays in old electric fencers which switch about once a second and these fail because the end stops get worn down and the relay then sticks in.

A bit of information on the details of the source and load would help. You have shown separate grounds for source and load, Is this necessary? If a common ground can be used, then a FET is the way to go.
 
Top