Sciencemadness Discussion Board
Not logged in [Login ]
Go To Bottom

Printable Version  
 Pages:  1  2
Author: Subject: Homebrew adjustable switched PSU
Twospoons
International Hazard
*****




Posts: 1374
Registered: 26-7-2004
Location: Middle Earth
Member Is Offline

Mood: A trace of hope...

[*] posted on 23-2-2025 at 16:03


Electronics is a vast field - I've been doing it professionally for 35 years, and I was a hobbyist since age 8, and I'm still learning stuff.
Switching power supplies are one of those things that look simple on the surface, but actually require a lot of knowledge to build a functional device. As usual, the devil in in the details.




Helicopter: "helico" -> spiral, "pter" -> with wings
View user's profile View All Posts By User
Rainwater
National Hazard
****




Posts: 992
Registered: 22-12-2021
Member Is Offline

Mood: Break'n glass & kick'n a's

[*] posted on 23-2-2025 at 17:54


Quote: Originally posted by khlor  

Do you have any reading material to recommend for this kind of project?

These 3 are public domain now.
Oldies but goody.
I keep all 3 on my desk just to have the equations handy and still use the protoboard to test stuff when doing work
https://archive.org/details/Radio_Shack_-_Basic_Electronics_...

https://engineering.unt.edu/ee/files/Radio_Shack_Electronics...

https://www.zpag.net/Electroniques/Kit/Radio_Shack_Electroni...

Here is a free dr level education about semiconductors
https://youtube.com/playlist?list=PLyYrySVqmyVPzvVlPW-TTzHhN...

[Edited on 24-2-2025 by Rainwater]




"You can't do that" - challenge accepted
View user's profile View All Posts By User
Twospoons
International Hazard
*****




Posts: 1374
Registered: 26-7-2004
Location: Middle Earth
Member Is Offline

Mood: A trace of hope...

[*] posted on 23-2-2025 at 20:14


"The Art of Electronics" by Horowitz and Hill is a very good general reference book.



Helicopter: "helico" -> spiral, "pter" -> with wings
View user's profile View All Posts By User
bnull
National Hazard
****




Posts: 847
Registered: 15-1-2024
Location: East Woods
Member Is Offline

Mood: preparing copper salts and enjoying it

[*] posted on 24-2-2025 at 02:00


Quote: Originally posted by khlor  
do you have any reading material to recommend for this kind of project?

Schematics. Coupled with simulations, there is much to learned from them, specially alternative solutions to problems.

World Radio History (https://www.worldradiohistory.com/index.htm), formerly known as American Radio History, has a huge collection of electronics and radio books and magazines.




Quod scripsi, scripsi.

B. N. Ull

We have a lot of fun stuff in the Library.

Read The ScienceMadness Guidelines. They exist for a reason.
View user's profile View All Posts By User
khlor
Hazard to Others
***




Posts: 112
Registered: 4-1-2014
Location: Who knows, really...
Member Is Offline

Mood: No Mood

[*] posted on 23-3-2025 at 20:57


Helo Again, sorry for the long hiatus, work scheduled has been hectic the last two months. all time I had was the commute to and from work, so I did simulations on my phone, I used everycircuit and ECStudio, I didn't got to simulate the whole thing as I wanted, but I did simulate bits and pieces just so I got the idea of what to do, these simulators don't play well with the 555, both gave me a hard time, but they did plenty well with linear circuits and simple stuff.

Now, to the business at hand, I did rebuilt the "control board/portion" for the sixth time, this time nothing fried, which is G O O D. the gate drivers I still hadn't changed, but based on rainwater work, I might just change it a little, by replacing the bc327 and 337 for something beefier, I think BD140/139 will do fine.

I considered the idea of elevating the ground, but since the voltage control is done only for the gate driver of the mosfets and the current design is holding its ground, I think I will keep it this way, keep using the 7809 and work at 0 v without that idea f virtual ground. I finished assembly of the board and here are the facts:

controlBoard2.jpg - 362kB
Picture 01: Circuit Diagram update.

As you can see, the 555 is now halted by cutting the reset pin, all is on the same ground level. I did. bit of a "level shifter" on the output pin of the 555 and it feeds on a current divider that feeds the circuit for the mosfet gate driver, which remains the same to date(planned changes after I decided what to do with this mess) this circuit worked just fine, RV-control is the potentimeter I use to regulate voltage and it works fine, like before. I scoped the mosfet gate on both sides and, no more quasi-linearity issues, it is oscillating like it should with Vgs -12v. The problem, like before, remains with current control.
As shown in the diagram, I did as rainwater suggested and made a lowpass filter, but initially it did not quite worked, then I looked at the internet for sugestions and came up with the current control loop you can see the diagram above and situation improved, but it is still very bad, as it can be seen on Picture 02.


ResizedImage_2025-03-24_01-13-31_1.jpg - 753kB
Picture 02: Scoped Output

When the circuit is on voltage control mode, all is smooth, ripple bellow 0.07V(70mV) but once current control starts to kick in, things get ugly and this, on the Picture 02 is the result. it used to be worse, but still, far from tolerable, and everyday that goes one and I think of this, makes me question my decisions in life, I mean, I might just go forth with the idea of switched voltage control and linear current control, if any has a suggestion on this particular issue, I am all ears, however I believe that the way my circuit works won't allow for proper current control, though, in the future, I will make sure to go with the commercial options.

grievances aside, I am glad I decided to "reinvent the wheel" in the hardest way possible because the goal wasn't the wheel(though it was a desired byproduct ) but the learning that came with it was absurd, the amount of things I got to at least get a glance at is incredible and the help you guys gave is truly something else!




"NOOOOOO!!! The mixture is all WROOOOOOONG!"
View user's profile View All Posts By User This user has MSN Messenger
khlor
Hazard to Others
***




Posts: 112
Registered: 4-1-2014
Location: Who knows, really...
Member Is Offline

Mood: No Mood

[*] posted on 4-11-2025 at 01:51


Quote: Originally posted by Rainwater  
When simulating your design, putting everything into the simulation is often a finishing step.
You're not at that point of the design yet, and it's a real pain in the butt.
I prefer idealistic building blocks. they make things much quicker.

so let me diminstrate how I would break this problem down.
after a long time in the field, most of this has become second nature and doesn't require much planning.
its gona take a lot longer to write than to execute.

ultimately, we want a simple buck converter.
this implies we need a pulse width modulated switched power source.
(There are many pwm topologys. Im going to stick with a fixed frequency and varable duty cycle to keep this quick).

we want to drive an n-channel mosfet.
this is the first set of constraints given to us. pull the datasheet
( IRF9540), and we have a
max VDS -100V
VGS(th) -2V ~ -4V
max Vgs +/- 20V
RDS(on)Vgs=-10V 200 mOhm
Td(on) 16ns
Tr 73ns
Td(off) 34ns
Tf 57ns
Rg 1.6 ohms
Qgd 29nC

good stuff, good stuff.
I just now realized you're using a p-channel device.
all the same maths, tho

so we need to drive the gate to less than Vcc - 10V to get that low impedance path to Vcc of 0.20 ohms

easy math here, so expect me to get it wrong.
simulation will correct me.
we have a Vcc of 19 - 10 = 9V
$$ \frac{0.000000029}{9}= 3.2nF $$
so the parasitic gate capacator will be about 3.2nF.
(I really think i just use the delta, which would be 10V and 2.9nf,
but let's go with 9V 3.2nF). Little explanation, the charge required to turn the mosfet fully on is given in columbs, i just converted it to frads. F=q/v

not only do we need Vcc-10V but we have to do it through a parasitic
resistance of 1.6 ohms (not all datasheets give this number, must be an rf
component)

this equals an ideal charge time of 25ns(20MHz) and a rms of 47.3mA peeking at
6250mA

if we want a 60kHz switching frequency, let's target a switching speed 100x that.
For a 16.6us switching frequency, let's target a 166ns switching speed.
if 5*r*c=t
then t/(5c)=r
so 0.000000166÷(5×0.0000000032) = 10.375 ohms
and to doublecheck 5×10.375×0.0000000032=166ns
(so the 5rc is the time it takes to 98% charge a capacator.
just so everyone is on the same page)
this will have an instant current draw of 1034mA and an rms of 6.5mA

so what do these numbers mean?
if we drive the mosfet 'on' in 166ns, it takes (16+73= 89ns) for the gate charge to
take effect and the output to fully rise, so the total transition time between fully off
to fully on will be around 255ns.

to go from fully on to off would be 166+34+57=257ns.
in worst case, we will spend 512ns out of 16.6us in a switching state.
that is about 3% of the duty cycle, just switching

which is about 3% of our alloted time, in the most energy inefficient state, worst
case scenario, we are zero % efficient for 3% of the time, and we have an ideal
efficiency of 97%.

really it will be less b/c those values in the datasheet is for a fast transition, and we will be doing a particularly slow transition. Which is good, we can say that theoretical +97%

base line, we know we need to feed the mosfet driver with 1034mA(6.5mA rms)of current to get this done.

your drawing says your using BC327 and BC337 after reading the datasheet, your
going to need to parrallel them to get the current needed. which is a terrible idea. (https://youtu.be/0ZG11UBoj-o)
max current is 800ma and you need to push 1034.
2 in parallel tempature coupled should do the trick.

so they have a high hfe of >100. meaning if you apply 10ma at the base
you get 1000ma at the emitter. i would seriously consider setting up independent
base resistors and bonding the collectors to smoke at least 1 set before switching
to a properly rated part. if parts arnt flyin, are you tryin?
We will/may need to add some emmitor resistors of low value, (2-5ohms) to prevent
overdriving the drivers but ignore that for now .

simulation time.
https://everycircuit.com/circuit/4609478892847104
notice the 115ma crossover distortion,
this will blow the transistors, their already maxed out.

so we need to introduce a delay to allow the on transistors to fully switch off before
turning the off transistors fully on.
if we parrallel the transistors base with a small capacator, this will delay its on time,
then if we shunt the base resistors with a diode, this will decrease its off time.
https://everycircuit.com/circuit/5579716065099776

there is still a little minor crossover distortion but now the shunted current is less than 1ma for less than 1ns so only your electrician will know. (looks great from the house)

so timeing and current are checked. now lets focus on voltage. spec says Vcc-10 and we are currently dropping 20.
there are a few ways to tackle this problem, datasheet says +/- 20, and we could
ignore it, but we will be within 85% of absolute maximum, so no.
we could use a rubber diode but this can effect our current draw. so no.
we can prep a new voltage plane and use it as ground for the sinking portion of the
driver cycle. shore it up for the high inrush current all without effecting performance. (to the bus)
https://everycircuit.com/circuit/4839481706414080
See what I did there, it will be a pain in the but to implement but for now, we model it as another voltage source, do the hard stiff later

notice how we had to lift the current sink driver circuit by 10V to maintain proper
Vbe biasing, and how I had to half the base resistors, because of the voltage difference.
basicly instead of dealing with a 20v system, we are dealing with a 10v system that starts at 10v up.
simulation allows us to quickly implement the 'ideal' solution for a problem without
having to involve every little perfect detail.

as we approach the next problem, just rinse and repeat the process. use the maths, you do not need a super computer.
so sleepy. got class then work ill add more when I get time, we still got to fully implment the mosfet into the ciruit.


Hello again, I am still hammering on it, though, I discovered some flaws in my circuits, if you look closely, you will see that my current sensing resistor was in series between the output capacitor and the load which was causing oscillations, pure neglect on my part since even the images I posted(the models I got from Analog devices and those I saw from TI) before, one can clearly see that the current sensing resistor is in series before the output capacitor, also rainwater, I have a question, how did you reached this Q=29nC? in the datasheed for the irf9540n I have it says total gate charge 97nC. I did some estimates and reached on almost 10nF as the gate capacitor and came up with a pushpull amp circuit that can swing between 18.6-9.9v not finished but I guess it already can do:

https://everycircuit.com/circuit/5531414468624384

true, paralleling bjts is not fun but it can be done in a simple manner if you clamp the current with another transistor, when I finish it each driving transistor will have it's own clamp, this was inspired on a white paper I've read that states that the output stage they use tens of parallel bjt on an IC, for discrete is impractical but in the future, for fun, I will see how far can I go, also in the future projects I will just buy a gate driver IC, it is fun learning but in order to get stuff done it is impractical to do discrete stuff.

Attachment: IRF9540N.PDF (132kB)
This file has been downloaded 5 times irf9540n datasheet


Attachment: Batch2_Driver19.pdf (7.4MB)
This file has been downloaded 13 times white paper in question.

[Edited on 4-11-2025 by khlor]




"NOOOOOO!!! The mixture is all WROOOOOOONG!"
View user's profile View All Posts By User This user has MSN Messenger
 Pages:  1  2

  Go To Top