coverting PWM to a more steady voltage - Page 1
Forum section: electronics / projects

author: Simon
author_rank: Unknown
timestamp: November 08, 2009, 12:54:12 pm
content: I have a PWM output 0-100 % of 12-15 volts @ 2 A, i would like to pass this through an LC filter to obtain a roughly steady voltage (some ripple is fine), what values should I choose for L and C ? I'm runing 10 - 25 KHz trying to compromise on space and switching frequency.

author: Zero999
author_rank: Super Contributor
timestamp: November 14, 2009, 01:13:43 am
content: Is this for the dynamo coil?There is no need for any filter, providing you use a free wheeling diode and a high enough frequency the inductance of the coil will smooth the current.The fact that the voltage across the inductor is PWM is unimportant; it's the current flowing through the inductor that matters.EDIT:Here's a simulation of the current through L1.The V1 is a 12V 50% duty cycle 20kHz square wave. Ignoring the ripple, the current grows in a an inverse exponential curve until it reaches a value determined by R!, V1 and the duty cycle, in this case (12*0.5)/5 = 1.2A. The larger the inductor, the higher the duty cycle, the smaller the current ripple will be.

author: Simon
author_rank: Unknown
timestamp: November 14, 2009, 08:00:50 am
content: I have actually abandones the idea and will be PWM the coil but will add a resistor that will allow some surrent into the coil when the controlling mosfet is off, this will help keep a steady flow while not be enough to over load the field coil and so will produce a smoother output (and this is how the original one works)

author: Zero999
author_rank: Super Contributor
timestamp: November 15, 2009, 10:12:34 pm
content: Quote from: Simon on November 14, 2009, 08:00:50 amYou'll be throwing your power away by adding a resistor.The job of the diode is to allow current to keep flowing in between pulses.The resistor in my schematic is just the inductor's internal resistance; I probably didn't make that clear.At 20kHz a 1N4001 probably won't be fast enough, I'd recommend a Schottky.The diode doesn't need to be rated at 3A since it doesn't conduct the full current all the time, 0.75A would do, but I'd recommend 1A to be on the safe side.

author: Simon
author_rank: Unknown
timestamp: November 16, 2009, 07:50:29 am
content: the resistor I'm adding will be the original resistor in the old regulator. I'll just leave it in

author: Zero999
author_rank: Super Contributor
timestamp: November 16, 2009, 11:28:22 am
content: Please post a schematic of the old design and your proposed changes.The chances are, the old design worked on a totally different principle to what you're trying to do.Old dynamos had a resistor which was used as a load dump, when the voltage across the terminals exceeded a certain voltage.

author: Simon
author_rank: Unknown
timestamp: November 16, 2009, 12:43:56 pm
content: the voltage regulation of the original regulator was achived with a relay this would cut current from the coil when a certain voltage was exceeded, in paralel with the relay switch gos a resistor so that the current is never totaly absent but reduced, this probably helped smooth things out in a very crude circuits, it may also have been a way of preventing back emf in the days diodes did not exist.

author: Zero999
author_rank: Super Contributor
timestamp: November 16, 2009, 01:46:35 pm
content: Did the old circuit have a free wheeling diode?I doubt it.What was the value of the resistor?The resistor was probably only there to prevent the relay contacts from being destroyed by the back EMF and probably only clamped the voltage to a couple of 100V.I doubt the high voltage pulses are coming from the dynamo - you're putting the transient protection in the wrong place. The high voltage is more likely coming from the ignition system.I tried simulating the dynamo in Electronics Workbench but it didn't work; it only allows it to be used as a motor.I'm not sure if you understand the current smoothing action of the coil so forgive me if I'm over-explaining things.A good analogy to use is riding a pedal cycle: the current is the momentum, the inductance is the inertia, the voltage is the force applied to the pedals, the free-wheel diode is the ratchet and the friction is the resistance. If you pedal just as hard continuously you're reach a speed determined determined by the force on the pedals and the friction. If you pedal just as hard for bursts of 2 seconds each with a duty cycle of 50%, you won't reach the same speed but you'll never stop since the ratchet will allow you to free wheel but your speed will increase and decrease all the time.Now look at the coil with the MOSFET, the diode and resistance, a voltage is applied to the coil, the current builds up to a certain level, the MOSFET is switched of but the current carries on flowing thanks to the diode.Here's the EWB version.Paste the contents of the code tags into a text editor and save the file with a .ewb extension.Where are the high voltage spikes?The red waveform is the voltage across the inductor.The black is the voltage across the inductor's internal resistance, EWB doesn't support the plotting of a current waveform.You can replace the 10kHz 12V voltage source with a MOSFET connected to 12V and a pulse generator connected to the gate if you like but you still won't see any high voltage spikes.Code:EWB Circuit File/4.83EFPCFABBFENFAOEEEIJNELEIDHPFGLEBCKOOEJAEGAMOGMEIGEOKGMFJEHPJEHFEAAOCFAAAFGIJEPBNBKOKFIEIFFNPFGFDBHNGFDBEHCNPAOHDEJJKGMFIEHPJEHFGAAPDFDBHFENFBNEMEIJLFKFME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OJDBCFAAMIFAAAFENIAODCCDILFKEIEOPFFFEFAANOELGJBGLGAOGCEJIAEGFIFGOHFGEHAAIACJAAFEMFAFHOFNIFEKEIEFMCEGCGGGMDELAAGJOEBPGCEJJGGMCPCGOJEHEHALMIGNAEHOOIAHHOFPJJFKEIFINPCLCKGOLHELAAGCMFCEHDFJJLGCFJEHOJFKEHHG

author: Zero999
author_rank: Super Contributor
timestamp: November 16, 2009, 03:50:03 pm
content: Here's the LTSpice version with the MOSFET.Paste into a .asc file.Where are the high voltage spikes?Code:Version 4SHEET 1 880 728WIRE 192 -16 -112 -16WIRE 272 -16 192 -16WIRE 272 16 272 -16WIRE -112 64 -112 -16WIRE 192 80 192 -16WIRE 272 112 272 96WIRE -112 176 -112 144WIRE 192 208 192 144WIRE 272 208 272 192WIRE 272 208 192 208WIRE 272 272 272 208WIRE 224 352 -112 352WIRE -112 432 -112 352WIRE -112 528 -112 512WIRE 272 528 272 368FLAG -112 528 0FLAG 272 528 0FLAG -112 176 0SYMBOL voltage -112 416 R0WINDOW 123 0 0 Left 0WINDOW 39 0 0 Left 0SYMATTR InstName V2SYMATTR Value PULSE(0 12 0 1n 1n 25u 50u)SYMBOL ind 256 0 R0SYMATTR InstName L1SYMATTR Value 5mHSYMBOL schottky 208 144 R180WINDOW 0 24 72 Left 0WINDOW 3 24 0 Left 0SYMATTR InstName D1SYMATTR Value 1N5817SYMATTR Description DiodeSYMATTR Type diodeSYMBOL Misc\\EuropeanResistor 256 96 R0SYMATTR InstName R1SYMATTR Value 5RSYMBOL nmos 224 272 R0SYMATTR InstName M1SYMATTR Value IRF3717SYMBOL voltage -112 48 R0WINDOW 123 0 0 Left 0WINDOW 39 0 0 Left 0SYMATTR InstName V1SYMATTR Value 12VTEXT -184 600 Left 0 !.tran 10m

author: collingtech
author_rank: Contributor
timestamp: March 02, 2016, 02:11:29 am
content: elegant solution mate