Solution for 5 Volts PWM to 12 Volts PWM?

Thread Starter

CircuitNewbie

Joined Dec 20, 2009
15
Hi,

I am new to circuit design and did some searching on the net for solution for converting 5 Volts PWM from a PIC to a 12 Volts PWM. The purpose of the 12 Volts PWM is to be fed into the Gate of a NMOSFET for my Buck converter.

The current situation is that i had a PWM created by my PIC (5 Volts PWM) and a Buck that is trying to control a DC output from 12 Volts to 1 Volts dependent on the duty cycle of the PWM. Due to the Buck requirement, i am running the PWM from the PIC at 400 KHz... :p

I had tried some of the solutions post in some of the treads, but was not successful in the simulation of those circuits... :(

Please do kindly assist....

Thanks in advance! :)
 

SgtWookie

Joined Jul 17, 2007
22,230
First of all, it would speed things up quite a bit if you would post your circuit as it now exists, and give us some more info on what you expect the output to be; ie: voltage, current, amount of ripple.

.png format images are preferred for schematics; they are compact and not "lossy" like .jpg images are.
Use the "Go Advanced" button below the text box, and then "Manage Attachments".
If you're using LTSpice, you can attach the .asc format file.

Secondly, 400kHz is a pretty high frequency to switch a MOSFET on and off. You'll wind up spending a fair amount of power just charging/discharging the MOSFET gate(s). You can usually get the frequency down at the same ripple current/voltage by increasing the size of the inductor. You can also add a filter after the inductor to reduce ripple.
 

Thread Starter

CircuitNewbie

Joined Dec 20, 2009
15
First of all, it would speed things up quite a bit if you would post your circuit as it now exists, and give us some more info on what you expect the output to be; ie: voltage, current, amount of ripple.

.png format images are preferred for schematics; they are compact and not "lossy" like .jpg images are.
Use the "Go Advanced" button below the text box, and then "Manage Attachments".
If you're using LTSpice, you can attach the .asc format file.

Secondly, 400kHz is a pretty high frequency to switch a MOSFET on and off. You'll wind up spending a fair amount of power just charging/discharging the MOSFET gate(s). You can usually get the frequency down at the same ripple current/voltage by increasing the size of the inductor. You can also add a filter after the inductor to reduce ripple.

Hi SgtWookie, thanks for the prompt reply. :D

Attached is what i am tried while referring to an example of Darlington pair from one of the treads in this website, but it does not work... :confused:

Basically, what i am try to achieve is power control... I am trying to use the PWM generated from a PIC MCU to control the output voltage of a Buck Converter. Since, the output range that i am trying to control ranges from 12Volts to 1 Volt (Up to 1.8 to 2 Amps for lower voltage, e.g. 5 Volts...) , the input to my Buck is a 12 Volts DC. Therefore, by adjusting the Duty cycle of the PWM from my PIC, i would be able to suppress the output of my Buck to a desired DC Voltage level... :rolleyes:

However, during my testing, if i would only to pump a 5 Volts PWM into the NMOSFET-Gate of Buck Converter circuit, that has a 12 Volts supply into the NMOSFET-Drain, my output from my Buck Converter, would only be able to be adjusted by the range of <5 Volts to >1 Volts...

But when i tried to pump a 12 Volts PWM, i would be able to control the Buck output from ~11 Volts to ~0.7 Volts...

Please do kindly provide some advice...

Thanks in advance... :)
 

Attachments

Last edited:

SgtWookie

Joined Jul 17, 2007
22,230
Well, there are some problems with your circuit...

If you really want to use an N-ch MOSFET for M2, you'll need a high-side driver.

It'll be a lot easier if you just use a P-ch MOSFET.

Even then, you don't show an inductor on your schematic; that's pretty much a necessity. Perhaps that's off the right edge of your screen.

Anyway, have a look at the attached. The LTSpice .asc file is attached as well.

Everything to the left of M1 is just to convert the 5v PIC PWM output to the level and current required to charge/discharge the P-ch MOSFET gate in a reasonable amount of time. PWM frequency is 10kHz.

[eta]
Corrected orientation of NPN Q3, now Q2
 

Attachments

Last edited:

Thread Starter

CircuitNewbie

Joined Dec 20, 2009
15
Thanks to all who spend their precious time for the reply, i will try it out and post an update soon.. :)

Wishing all an advance Merry X'mas and a Happy New Year!!! :D
 

Thread Starter

CircuitNewbie

Joined Dec 20, 2009
15
I had manage to try the circuit out and it is good.. :)

But i realize that the output voltage range when i adjust the PWM is not what i had imagined... I.e. when i pump in the 12 Volts input, and increase the PWM to nearly 0.95 Duty cycle... The Buck should be providing maximum output that i am expecting to be at least near to 11 Volts or a little bit more, but from my simulation, i only managed to get max. of 10.5 Volts... :(

Is it because of the voltage drop across the NMOSfet is too big?

How can we increase the Buck output to a range that is nearer to 12Volts? (Lowest range that i need would be 1 Volt...)

I don't suppose i could ever get 12 Volts by adjusting the PWM due to the losses in the components within the circuit... :p
But if there really is a way, please do advice.. :)

Maybe selecting a most suitable NMOSFET with lesser drop will help? :confused:

Thanks in advance... :)
 

Thread Starter

CircuitNewbie

Joined Dec 20, 2009
15
I also did not managed to find the parameters to adjust the frequency... Is it possible to push the frequency to 400KHz? Or is it more advisable for the circuit to remind at 10kHz? :confused:

How will the load be affected by this frequency if we are only considering resistive loads?

I now it would be even more complex if a capacitive or inductive load comes into the picture... :(

I know that it would result in higher losses and also the consideration for components are also different in higher frequency... :(
Please do kindly advice what are the parameters to take note for the components... For one, i know the inductors and capacitors ERS becomes more significant...

Thanks in advance for any advice... :)
 

SgtWookie

Joined Jul 17, 2007
22,230
I had manage to try the circuit out and it is good.. :)

But i realize that the output voltage range when i adjust the PWM is not what i had imagined... I.e. when i pump in the 12 Volts input, and increase the PWM to nearly 0.95 Duty cycle... The Buck should be providing maximum output that i am expecting to be at least near to 11 Volts or a little bit more, but from my simulation, i only managed to get max. of 10.5 Volts... :(

Is it because of the voltage drop across the NMOSfet is too big?
The IRL9Z24 MOSFET has a value for Rds(on)=0.28 Ohms.
Additionally, I arbitrarily assigned L1 a resistance of 0.4 Ohms and L2 a resistance of 0.1 Ohms.
You must not forget that inductors will have some parasitic resistance, even if they use large gauge wire.

How can we increase the Buck output to a range that is nearer to 12Volts? (Lowest range that i need would be 1 Volt...)
Choose a different P-ch MOSFET, decrease the resistance of L1 and L2. If you are unrealistic in the values you assign, you will get an overly optimistic output.

I don't suppose i could ever get 12 Volts by adjusting the PWM due to the losses in the components within the circuit... :p
But if there really is a way, please do advice.. :)
Sure, replace M1, L1, and L2 with a superconductor. :) Good luck finding a real one though.
 

SgtWookie

Joined Jul 17, 2007
22,230
I also did not managed to find the parameters to adjust the frequency...
Right-click on V1.
You can adjust the frequency by adjusting Tperiod.
Tperiod = 1/frequency.
100u = 100 microseconds = 10kHz.
Is it possible to push the frequency to 400KHz? Or is it more advisable for the circuit to remind at 10kHz? :confused:
You might increase it somewhat, but the driver circuit is not very robust.
You will have to select the MOSFET carefully. A low gate charge is desirable for speed, but a low Rds(on) is desired for high current. These two items are in conflict with each other, because as Rds(on) decreases, the gate charge increases. You must select a compromise between the two.

Also, as the Vdss rating increases, the gate charge increases. Since you are using 12v for your source, you will need a MOSFET that is rated for more than 12v. I suggest the Vdss=20v range.

If you choose the MOSFET carefully, you might get 40kHz to 60kHz out of it. Watch the gate rise/fall waveforms and power dissipation in the MOSFET itself.
How will the load be affected by this frequency if we are only considering resistive loads?
If you reduce PWM frequency, the inductance of L1 and (optionally) L2 must increase to compensate. If you increase the inductance, you must also increase the gauge of the wire used to compensate for the increase in length.

If PWM frequency increases, the inductance of L1 and (optionally) L2 can be decreased, along with their resistance. However, power dissipation in the MOSFET will increase.

I now it would be even more complex if a capacitive or inductive load comes into the picture... :(
Purely capacitive loads should actually help regulation.
Inductive loads such as motors will make regulation more of a problem.

I know that it would result in higher losses and also the consideration for components are also different in higher frequency... :(
Please do kindly advice what are the parameters to take note for the components... For one, i know the inductors and capacitors ERS becomes more significant...

Thanks in advance for any advice... :)
It's ESR (Equivalent Series Resistance).

Keep in mind that the other components I'm using are all "ideal" components; no parasitics. For example, C1 and C2 have an ESR of 0. You'd need to select real-world components with a voltage rating of 25v or better.

I've given you a schematic for a basically functioning buck-type unregulated supply.

How much would you learn if I simply did the whole thing for you?
 

Thread Starter

CircuitNewbie

Joined Dec 20, 2009
15
Thank you so much, Sgt...:D

You really did a detailed explanation to my inquiries... :D

I have learned so much from this forum..

Thanks and have a Merry Merry X'mas! :)
 

Thread Starter

CircuitNewbie

Joined Dec 20, 2009
15
I had mange to go through the circuit and dissected it as attached, is it correct?

I noticed a filter-like circuit behind the Buck Converter, and i would like to know, would it be better if i can integrate the "Filter" into the end of the buck converter circuit? Any advantages for a separated filter behind the buck? Since the Buck already had a filter design at its rear, the additional LC filter circuit after it makes me confuse, as it looks like a "T" filter with a capacitor behind... :confused:

I understand the following from buck converter study:
- that the input capacitor is for managing the input voltage ripple,
- the mosfet is to do the switching for the buck function,
- the inductor is for managing the output current ripple and
- the output capacitor is for managing the output voltage ripple...
Am i correct about the above?

Is there any good "Buck converter component sizing" website or information that can be recommended for my read-up?

Thanks alot in advance... :)
 

Attachments

SgtWookie

Joined Jul 17, 2007
22,230
Why don't you attempt to analyze each component in the circuit I posted, until you understand why they are included in the circuit?

Each component has a reason for it's existence. Otherwise, it would not be in the circuit.

I was trying to keep it as simple as possible.
[eta]
Just in case you're having problems figuring it out:
R1 limits the base current of Q1 to approximately 4.3mA.

When Q1 is turned on, it discharges the gate of M1 via R3 and D1, turning the MOSFET on.

R3 acts as a snubber to keep the gate of the MOSFET from "ringing" at high frequency after charging/discharging.

When Q1 turns off, R2 pulls the base of Q2 high, turning it on. D1 prevents the low voltage on the gate from pulling the base of Q2 low, which would turn Q2 off.

The gate of M1 discharges via R3 and Q2.

R4 is there for safety; in case D1, Q2 or R3 fails, R4 pulls the gate of M1 to the same voltage potential as the source terminal, turning it off.

L1 attempts to keep the current flow constant.
D2 provides a path for current when M1 turns off.
C1 helps to provide a low impedance output, and reduces transients.
L2/C2 are optional, but they help to reduce the P-P ripple.

[eta]
A follow-on to this thread about connecting a pic via USB has been moved here:
http://forum.allaboutcircuits.com/showthread.php?t=32191
 
Last edited:

Thread Starter

CircuitNewbie

Joined Dec 20, 2009
15
Hi All,

I had just calculated the component sizing and put my buck circuit together with the driver circuit and attach is the layout:

I had manage to confirm the following:
- the circuit that converts my 5 Volts PWM to 14 Volts PWM works.
- In actual Buck circuit, it could not produce a reduce output voltage despite Duty cycle changes. (In simulation, the circuit works and i am able to get an output from varying the Duty Cycle of 5Volts PWM.)
- In actual circuit, it seems like the Mosfet is not turning off when Vg is the same voltage as Vs, i.e. Vgs= 0V. (I understand that the P-MOSFET is suppose to turn off when Vgs = 0Volts.) I could only get a constant 14 Volts output with is from Vin.
- I am using the exact P-Mosfet in the simulation, i.e. IRF9Z24S.

I can't seems to figure out what is the issue here... :(

Any advice would be deeply appreciated...

Thanks in advance! :)
 

Attachments

SgtWookie

Joined Jul 17, 2007
22,230
Do you have a load on the output, like a 12v lamp? Or a resistor?

You say you're getting output even with the MOSFET off. That sounds like the MOSFET is shorted. This could have happened due to static electricity, or if D2 had burned open/been installed backwards.
 
Last edited:

Thread Starter

CircuitNewbie

Joined Dec 20, 2009
15
Thanks Sgt...
Yes, i managed to get it working finally... I think i must have "burned" the MOSFET due to long soldering time...

However, there is another issue... :(

- I manage to adjust the PWM Duty Cycle from 10 to 80+%. (The higher the duty circuit, the higher voltage i got for the output.)
- I am using 10ohms as load. The load is rated 10 watts. (I am planning to get a 20ohms test load that can take 10 watts, so that i can take the full range of the testing....)
- The weird part is when i try to push the output voltage from 1volts (at 1 volts/ interval) all the way to 8 Volts, the output seems fine. But when i tried to push for a 9 volts output, the PWM run out of space and the driver circuit (That converts the 5V PWM to 14V PWM) gave way (I.e. drops to zero)... :confused:

Where had i done wrong? the calculations and simulation shows that i should be able to hit 12 volts output...

Is it because of the MOSFET/component choices? :confused:

Thanks in advance for any advice...
 

SgtWookie

Joined Jul 17, 2007
22,230
Is your power supply shutting down under the load? What is the rating of your power supply? You'll start drawing over 1A with a 10 Ohm load when you approach 10v. Try a 20 Ohm load.

If you are powering it from an ATX-type computer power supply that has been modified to a bench supply, it will shut down when the load pulls more than about 0.8A. That would be consistent with what you are seeing.

I don't know what you mean by "the PWM run out of space"
If the driver circuit dropped to 0v, the MOSFET would be turned on constantly, and you would see supply voltage on the output - unless the supply itself had shut down.
 

Thread Starter

CircuitNewbie

Joined Dec 20, 2009
15
Hi Sgt,

Thanks for the prompt reply. :)

Is your power supply shutting down under the load? What is the rating of your power supply? You'll start drawing over 1A with a 10 Ohm load when you approach 10v. Try a 20 Ohm load.
I am actually trying to use a 20 ohms resistive load. However, if i were to test out up to 10 volts, i should be getting:
I= V/R,
I= 10V/ 20Ω,
I= 0.5 Amps

So my load should be able to take:
P= I2R
P= (0.5A)(0.5)(20Ω)
P= 5Watts

I would need to get the correct rating, and i have to cater for 11Volts and 12 Volts too... So the load would need to be around 8 Watts... (i.e. 12Volts at 20Ω, would need 7.2Watts)

I would need some time to get a resistor with such rating... ;)


If you are powering it from an ATX-type computer power supply that has been modified to a bench supply, it will shut down when the load pulls more than about 0.8A. That would be consistent with what you are seeing.
The supply that i am using is a bench DC power supply with those adjustable DC current rating, it is in a work laboratory... The voltage and current supply can be adjusted... So i could set the supply current to more than 0.8A... So, i am pretty sure it is not power supply insufficient for the load... (If there is an overload, it would also be indicated on the DC power supply....)


I don't know what you mean by "the PWM run out of space"
If the driver circuit dropped to 0v, the MOSFET would be turned on constantly, and you would see supply voltage on the output - unless the supply itself had shut down.
I was trying the following when i adjusted the PWM:
My buck input would be- 5V PWM (From my MCU with varying Duty cycle for control) and 14 Volts (From DC power supply).
My Buck output should be from a range of 1V to 12Volts (As possible in my simulation.)

When i simulated with the circuit:
> The buck circuit is able to provide output from 1 volts to 12 volts when i vary my PWM from 10% ON Duty Cycle to 85% ON Duty Cycle...

However, when i simulated, the following are the result:
> Input of 8% "ON" Duty Cycle, Buck Circuit output 1V.
.
.
.
> Input of 85% "ON Duty Cycle, Buck Circuit output 8V.

Therefore, i have no "headroom" to increase the Duty cycle anymore... Once i increase the Duty Cycle beyond 85%, the transistor driver circuit (Which converts the 5V PWM to an inverted 14V PWM) at the front part of the Buck Converter, went to flat 0% On Duty cycle...

I could not figure out what went wrong... :confused:
Perhaps i could make some adjustment to the component rating, so that when i pump 60% ON Duty Cycle PWM, i could get 8Volts output? So that i can have the PWM "Headroom" (I could then have 61% to maybe 80% PWM ON Duty Cycle for 9V to 12Vs) for adjustment to get output...

Maybe its the frequency that i am operating? I am using 40KHz for my 5 Volts PWM...

Another note that i notice during the actual hardware testing:
- I remember that on my research on Buck Converter, the "duty cycle verses output voltage" should be proportional, (i.e. when i increase the PWM Duty cycle, the output voltage should also increase proportionally.)
- But during testing, i realize that the voltage was only proportional from 1 volts output all the way till 6 volts, once i tried to achieve for 7 volts onwards, the PWM % required is very much higher then the previous steps used.

For example: From 1 volts to 2 volts output the adjustment for PWM is from 8% ON Duty Cycle to 14% ON Duty Cycle. I.e. a step of 6%.
This is applicable for each 1 volts steps, but only applicable for 1 volts to 6 volts output.. But to achieve 7 volts output, the PWM need to be increase by around 14% PWM On step increase...


Thanks in advance for any advice... :)
 
Top