Author Topic: Boost converter -2 speed ramp  (Read 13510 times)

0 Members and 1 Guest are viewing this topic.

Offline HendriXMLTopic starter

  • Super Contributor
  • ***
  • Posts: 1085
  • Country: nl
    • KiCad-BOM-reporter
Re: Trianglewave generator with a LM358 and regulate boosted voltage
« Reply #50 on: January 06, 2021, 03:04:00 pm »
OK - are you actually trying to build something or is this just a learning exercise?

Not bothered either way, but you are going a bit 'first principles' and there must be some learning resources out-there which will be more efficient.

If you having trouble figuring out the right search terms, try "shoot-through", "cross conduction" and "dead-time".
My knowledge of electronics is indeed a bit limited, but also my ability to process new information is a bit limited as well. (Brain damage). But as a (former) software developer thinking about systems is stil okayisch. However in electronics it is a lot harder to get the dots connected. So great respect for electronics engineers.
So my method is first think and then read a little. For most people it would be more efficient to read a lot and then think  ;D.

But you're right I'm not target driven. I actually don't need those leds in series. Parallel would be fine as well  :-+

Thus for me - after finding out things were more complicated- it indeed became an exercise to understand more so that I don't have to know that much.

« Last Edit: January 06, 2021, 04:18:28 pm by HendriXML »
“I ‘d like to reincarnate as a dung beetle, ‘cause there’s nothing wrong with a shitty life, real misery comes from high expectations”
 

Offline T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 21807
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: Trianglewave generator with a LM358 and regulate boosted voltage
« Reply #51 on: January 06, 2021, 06:18:15 pm »
I'm wondering wether switching frequency is the only determination here wether the mosfet is allowed to open slowly.

The conductor releases its voltage fast (but how fast?), when the mosfet is not fully open by that time it would absorb some energy.

Inductor?

Heh, it is a conductor, after all, just an especially "long" one, in a certain sense...

There are two inductances of particular importance: the converter inductor, and stray switching loop inductance.



L is the converter inductor, here in a buck configuration.  (If we swap Q and D, we also have the boost type.  Through other transformations, we can also cover SEPIC, Ćuk, flyback, etc.)



With first order parasitics added.  In particular, when Q or D turns on or off, the current flow through L is commutated from Vin to GND or vice versa, and this occurs in whatever the switching time (edge rate) is.  For a brief moment, ESL + Ls + Ld and Cq or Cd are active, and give rise to the overshoot and ringing excited by that edge.

Generally, we want switching time longer than the LC 1/4-wave time constant t = pi sqrt(L C ) / 2, to avoid exciting that ringing.

ESL, Ls and Ld are not usually components we add to the circuit, they are parasitic elements that arise from the physical properties of our components -- namely, physical length and geometry.  Space itself has an inductance of ~ 1.257 uH/m.  A wire of 1m length has on the order of 1.2uH inductance -- there is however a geometry factor in there, which typically gives a lower number; but this factor only depends on the cross section of the wire and its surroundings, so we can separate it from the length.

So, a typical capacitor might range from 1nH for a small wide-body ceramic chip (say 0204 size), to 20nH or more for through-hole film types, or more complicated equivalents may be necessary to describe larger value types (electrolytics) that are less well behaved.

Likewise the transistor and diode, a few nH for SMT types, up to 10 or 15nH for TO-247 and other modest-power packages, up to maybe 100nH for large industrial modules.

Mind -- you can always end up with more, particularly with long jumper wires while breadboarding.  Use short jumpers, and place the transistor, diode and capacitor close together.


Okay, so what effect does that have on overall operation, assuming the current or voltage spikes don't exceed any ratings?

The energy stored in those inductances and capacitances, is dissipated every cycle.  As switching frequency rises, those losses are incurred more often.  So, for performance we want them to be small.

Roughly speaking, the ratio between L and (L + ESL + Ls + Ld) gives an upper limit on efficiency.

At something like 10kHz, and with ~mH of L, the strays can be quite large (~uH, implying total lead lengths near a meter) while still giving acceptable efficiency.  You will need slower switching by then, of course; like I said, on the order of µs.

Total strays under 50nH is easily done (even on the breadboard), and switching times of < 100ns and frequencies >= 100kHz, are quite reasonable as a starting point, if you have no other limitations (like slow plodding op-amps :) ).

Tim
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 

Offline HendriXMLTopic starter

  • Super Contributor
  • ***
  • Posts: 1085
  • Country: nl
    • KiCad-BOM-reporter
Re: Trianglewave generator with a LM358 and regulate boosted voltage
« Reply #52 on: January 06, 2021, 08:34:28 pm »
The voltage across a inductor or a long conductor as one might call it, is:
v(t) = L * di(t) / dt

So the voltage across it seems limited using an ideal switch by di, delta current. In the case of an ideal switch and the boost circuit, the charging of the capacitor would "reverse" delta current for a moment. Going from no current to some charging current (and ending in no current again).

However in an non ideal switch (mosfet) the initial current after opening would not become zero. Some current still flows and is wasted,  even if the inductor was just a conductor without inductance.
However in the case of a inductor the delta current starts generating an extra voltage, that is also wasted in the mosfet. In fact all energy could be wasted if the boosted voltage would be too high or the mosfet opened too slow or the charge current was too low.

My intuition says it's best to have it opened as fast as possible. But that would also mean a small dt and large di, thus higher momentous voltage. So not completely obvious..


« Last Edit: January 06, 2021, 09:21:01 pm by HendriXML »
“I ‘d like to reincarnate as a dung beetle, ‘cause there’s nothing wrong with a shitty life, real misery comes from high expectations”
 

Offline HendriXMLTopic starter

  • Super Contributor
  • ***
  • Posts: 1085
  • Country: nl
    • KiCad-BOM-reporter
Re: Trianglewave generator with a LM358 and regulate boosted voltage
« Reply #53 on: January 06, 2021, 11:09:56 pm »
So to explain the post above a bit further.
When we look at the graph below, to my understanding at the rise of the inductor voltage (red trace - 5V) everything below 30 V is wasted energy.  It wouldn't surprise me if it was directly related to the area beneath the curve. So in this case not a large proportion.
However its a large inductor ( :-+ I almost wrote conductor again) and the charge current is probably high.

This might matter when trying to design a booster not with primary a high frequency per se, but with a high duty cycle of the inductor.
A way to do that is having it timed by the inductor response. This could lead to a much higher frequency of shorter pulses. And thus more losses when driven to slow.

Sensing that the inductor is done in a reliable way might be challenging.  Having a voltage divider on the inductor output is quite a waste. On startup, when the boosted output is still rising,  the inductor response will be also different.
Some ideas that came to mind:
Place a opto coupler between inductor and capacitor (loss of a few volts)  :--
Sense the inductor current to the capacitor (is above vcc so problematic)  :--
Have a tab on the inductor wich outputs only a fraction of the 30V (is above vcc so problematic, but less waste when using a divider)  :--
Sense the current to the inductor (relative to the charge current, the discharge current is small.)  :--
« Last Edit: January 06, 2021, 11:16:05 pm by HendriXML »
“I ‘d like to reincarnate as a dung beetle, ‘cause there’s nothing wrong with a shitty life, real misery comes from high expectations”
 

Offline fcb

  • Super Contributor
  • ***
  • Posts: 2122
  • Country: gb
  • Test instrument designer/G1YWC
    • Electron Plus
Re: Trianglewave generator with a LM358 and regulate boosted voltage
« Reply #54 on: January 06, 2021, 11:49:54 pm »
The inductive kick from the current sense resistor is normal.

Many current-mode controller IC's and single chip boost converters include a blanking circuit to eliminate the effect this can have.  In the worst case's this kick can upset (and damage!) the amplifier connected to this node.  You can't just 'filter' this spike as you smear (intergrate) it's energy into the 'useful portion'.
https://electron.plus Power Analysers, VI Signature Testers, Voltage References, Picoammeters, Curve Tracers.
 

Offline T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 21807
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: Trianglewave generator with a LM358 and regulate boosted voltage
« Reply #55 on: January 07, 2021, 12:24:30 am »
The voltage across a inductor or a long conductor as one might call it, is:
v(t) = L * di(t) / dt

So the voltage across it seems limited using an ideal switch by di, delta current. In the case of an ideal switch and the boost circuit, the charging of the capacitor would "reverse" delta current for a moment. Going from no current to some charging current (and ending in no current again).

For consistency's sake -- which circuit, and component, are we talking about here?

For the main filter choke, notice that v(t) is always perfectly constrained by diodes or switches.  Therefore di/dt is always well defined.  In particular, the voltages are piecewise constant, and the integral of a constant is a diagonal line.  Hence we get a triangle current waveform.

The stray inductances have a harder time, with V and dI/dt defined by the switching action.

An energy argument suffices to reason about switching losses from these reactive components (stray L and C).  Their current/voltage always goes between peak and zero, every cycle, and there is no conservative sink for that energy; therefore it is dissipated, through whatever resistance is available (might be their own internal resistance (shown on my equivalent diagram), external snubbing, or in the transistor).

(There are conservative snubber circuits, which recycle or "stir" their energy back into the supply, at least in part.  Though they aren't as easy to use as one would hope.  Alternately, a resonant circuit can be used: some energy leftover from the previous cycle pushes the circuit into a state that is ready to switch with very little loss (ZVS); the downside is, juggling that leftover energy requires tricky timing.  It's a lot harder to reason about the V/I and control characteristics of such circuits, so I don't suggest we cover them here, at least just yet.)


Quote
However in an non ideal switch (mosfet) the initial current after opening would not become zero. Some current still flows and is wasted,  even if the inductor was just a conductor without inductance.
However in the case of a inductor the delta current starts generating an extra voltage, that is also wasted in the mosfet. In fact all energy could be wasted if the boosted voltage would be too high or the mosfet opened too slow or the charge current was too low.

My intuition says it's best to have it opened as fast as possible. But that would also mean a small dt and large di, thus higher momentous voltage. So not completely obvious..

I'm not exactly sure what events you're referring to.

So, switching terminology maybe isn't great here.  It also doesn't help that a real (mechanical) switch, is actually incredibly complex when you zoom in on it, at short time scales -- you get fast and often repetitive contacts, arcing, contact bounce, and a huge on/off ratio (e.g. TΩ+ off, <mΩ on).

Naively, it would be nice to have something that's just... magically "on" and "off" from one instant to the next.  This is impossible in the real world: current flows propagate at the speed of light, at most.  Indeed, the parasitic terms in the diagram, are a low-frequency modeling of that fact -- and, obviously, a greater distance means a longer response time, which is very roughly why inductance and capacitance scale proportionally with length.

So, there are fields and waves and propagation at work here, and we do need to be careful that, whatever model we're working with, it's not losing sync with these facts.

So the parasitic elements, are modelling the system to some degree of approximation, and as long as our model and expectations remain consistent with that approximation, we're fine.

Which is all to say -- yes, in general, faster switching is better, but:
1. we are limited by the approximated parameters in the system, so that we shouldn't try to go faster than they can allow, lest we release the magic smoke; or
2. at some point, we might be asking a question that cannot even be answered with this model.  This isn't actually even imaginary anymore: the new generation of power GaN devices, are fast enough that we can potentially excite new resonant/wave modes of our circuits, if we use apply them carelessly, to circuits unsuitable for them -- in which case, if nothing else, we must revise our model, but we might even have to revise it so far that we're better off using a different approach (instead of L and C elements, transmission line elements; or even full transient wave simulations -- which are quite doable, it's just the tools to do so are rather pricey!).

The equivalent form of #1 is that, if we want to switch faster, we need to construct a circuit which has parasitics small enough to behave.

Anyway, modeling of switches -- SPICE takes a reasonable approach here, modeling an ideal switch as a variable resistance.  The ratio is typically smaller (say 1mΩ to 1GΩ), and it changes smoothly, typically with a gain factor relative to the input signal, which itself changes smoothly (SPICE typically requires smooth equations to produce solutions -- some hacks are used to deal with situations when they aren't smooth, but they may not produce great results, in terms of accuracy or speed or stability).  This still isn't a great model for a MOSFET, but it's at least a starting point.

With smooth changes, we also have smooth, and finite, dV/dt and dI/dt.


So to explain the post above a bit further.
When we look at the graph below, to my understanding at the rise of the inductor voltage (red trace - 5V) everything below 30 V is wasted energy.  It wouldn't surprise me if it was directly related to the area beneath the curve. So in this case not a large proportion.
However its a large inductor ( :-+ I almost wrote conductor again) and the charge current is probably high.

So, also not sure what you mean about wasted energy -- but if you're counting it the way I think you are, don't forget the falling edge and the ringdown.  There's about as much energy there, too!  And again, when the transistor turns on, discharging the node capacitance to 0V, some energy.

If you look very closely at the drain voltage rising edge, you'll see it rises along a curve.  If you also plot drain or source current at the same time, you should find the current doesn't actually drop much at all.  We can make a cartoon diagram like this:

https://www.researchgate.net/profile/Mohamed_Salem47/publication/325487018/figure/fig2/AS:633301366759429@1528002220169/Current-and-voltage-waveforms-of-hard-and-soft-switching-at-turn-on-and-turn-off.png
(not sure how well this embeds from the forum, I'll just leave it a link..)

In the conventional case (what we're discussing), drain voltage is in blue and drain current is dashed (left).  At the moment the transistor begins to turn on, its current draw increases slightly (from zero), discharging node capacitances.  In the case of the boost or buck circuit, this includes charging the diode capacitance, which returns through the switching loop's stray inductance.  So at the instant of turn-on, we have an LC circuit, and the energy loss associated with those capacitances.  (This loss is typically dissipated in the transistor.)

Slightly later, current begins to rise in earnest.  If the filter choke is carrying no current (was fully discharged last cycle), well, it starts from zero of course.  If it hadn't finished discharging, then the diode is forcibly turned off (hard switching, reverse recovery); in the process, the transistor has to carry at least the full load current, and this current again is carried by the switching loop, thus we will incur losses associated with that load current and the loop inductance.

Finally, everything settles, drain voltage is small, load current is increasing gradually (filter choke dI/dt at applied voltage).

Actually, these plots are for a nearly resistive load, not an inductive load.  In the inductive case here, the voltage curve may not begin to drop until the current reaches full load level!

Likewise on turn-off, the voltage follows the dashed curve: voltage rises first, and then current falls (again, overlapped even more than shown here).

With real parts, the drain capacitance does tend to help out.  In your simulation, the gradual toe-in for the drain voltage waveform occurs most likely because drain capacitance is very high when Vds is very low.  Cdss is very nonlinear -- its value depends on Vds.  This skews the waveforms significantly, so that transistor current may have a chance to drop nearly to zero, while the drain voltage has risen only modestly -- and consequently, drain dV/dt can be very high indeed!

But again, this can be dangerous, the loop needs to be designed properly so everything operates within ratings.


Quote
This might matter when trying to design a booster not with primary a high frequency per se, but with a high duty cycle of the inductor.
A way to do that is having it timed by the inductor response. This could lead to a much higher frequency of shorter pulses. And thus more losses when driven to slow.

Don't worry about the control method too much.  There are, of course, standard approaches!

First a terminology: when filter choke current reaches zero between cycles, its current is discontinuous.  This is called discontinuous conduction mode (DCM).

When current is continuous (not allowed to reach zero), it's CCM (continuous conduction mode).

When it reaches exactly zero, it's BCM (boundary conduction mode).

Your suggestion is essentially to use up all the energy stored in the inductor, every cycle.  This sounds effective enough.  Be careful, though: it takes longer to charge up to higher currents, too.  A BCM boost converter must operate with frequency inversely proportional to load current.  The significance of this may not seem all that obvious, but it leads to a cluster of downsides:
1. We need very high peak current ratings for the inductor (twice the average input current);
2. Input and output filters need to be designed for the worst-case (full throttle, lowest) operating frequency;
3. The switch and control needs to be designed for worst case (low throttle, highest) frequency, and may end up dissipating a ton of power by itself, even if the output side is well behaved (i.e. operating in BCM quasi-resonant);
4. Losses are quite high, due to the high peak current and wide frequency range.  Conduction losses in the switches and inductor (at high peak currents), and core loss in the inductor (which tends to be worst at low frequencies).
5. Inevitably we won't be able to maintain BCM (when load drops arbitrarily small).  We still need to deal with DCM.

BTW, controls designed for this type of operation, do indeed sense inductor current.  A cheap way to do so, is either to capacitively couple the voltage (sensing the down-swing after current falls below zero), or to add a secondary winding and just measure that voltage (again, sensing when it drops below zero).  The impedance of this path can be large (10s, 100s kohms) so the losses are small. :)

Such controls are always complicated by the fact that BCM can never be perfectly maintained, so have some way to deal with DCM operation at light load.  BCM is particularly attractive for PFC (active power factor correction) circuits, because it uses peak current control to draw constant input current, but these always perform poorly at light loads.

Tim
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 
The following users thanked this post: HendriXML

Offline HendriXMLTopic starter

  • Super Contributor
  • ***
  • Posts: 1085
  • Country: nl
    • KiCad-BOM-reporter
Re: Trianglewave generator with a LM358 and regulate boosted voltage
« Reply #56 on: January 07, 2021, 02:10:29 am »
I like the idea of a second winding. Will do that and measure it response.

I don't think the issue I wrote about came through.. (it might in practice alo not be very influential) But I'll try again.

In case of a charged inductor which purpose it is to keep a boosted voltage (30 V) above that level, then every voltage below that level that meets resistance is wasted. When the mosfet is not fully opened it (and its capacitance) will resist and consume some of the inductors energy.

That is a different kind of switching loss than the loss which occurs when there is (still) some sink ("charge") current and some Vds, which would also occur when switching a resistive load.

I don't think its bad to talk about ideal situation / component to point out what should happen, to explain the effects of an non ideal component.

So in the case of the charged inductor and an ideal off switch: it should rise immediately to the voltage at which it would meet some resistance.
Looking at the slope in the graph (red), it seems to take time: thus the mosfet wasted some of the inductors energy.
Hypothesis: slower switching speeds, lower charge currents make it worse.



“I ‘d like to reincarnate as a dung beetle, ‘cause there’s nothing wrong with a shitty life, real misery comes from high expectations”
 

Offline HendriXMLTopic starter

  • Super Contributor
  • ***
  • Posts: 1085
  • Country: nl
    • KiCad-BOM-reporter
Re: Trianglewave generator with a LM358 and regulate boosted voltage
« Reply #57 on: January 07, 2021, 03:44:56 pm »
I've added a second winding (CH2) and made a plot. That second windings voltage curve follows the other winding beautifully.

I also replaced the IRLZ44N with an IRL2703PBF.

That one has a much lower gate capacitance (about 3x). However the body diode truncates the voltage at 32 V, a little lower than voltage the zenerdiode truncated to. So its hard to compare both situations. Also the input current is now lesser.

I've also made a zoomed graph as well, but nothing seems to stands out.
“I ‘d like to reincarnate as a dung beetle, ‘cause there’s nothing wrong with a shitty life, real misery comes from high expectations”
 

Offline HendriXMLTopic starter

  • Super Contributor
  • ***
  • Posts: 1085
  • Country: nl
    • KiCad-BOM-reporter
Re: Trianglewave generator with a LM358 and regulate boosted voltage
« Reply #58 on: January 07, 2021, 05:11:42 pm »

Your suggestion is essentially to use up all the energy stored in the inductor, every cycle.  This sounds effective enough.  Be careful, though: it takes longer to charge up to higher currents, too.  A BCM boost converter must operate with frequency inversely proportional to load current.  The significance of this may not seem all that obvious, but it leads to a cluster of downsides:
1. We need very high peak current ratings for the inductor (twice the average input current);
2. Input and output filters need to be designed for the worst-case (full throttle, lowest) operating frequency;
3. The switch and control needs to be designed for worst case (low throttle, highest) frequency, and may end up dissipating a ton of power by itself, even if the output side is well behaved (i.e. operating in BCM quasi-resonant);
4. Losses are quite high, due to the high peak current and wide frequency range.  Conduction losses in the switches and inductor (at high peak currents), and core loss in the inductor (which tends to be worst at low frequencies).
5. Inevitably we won't be able to maintain BCM (when load drops arbitrarily small).  We still need to deal with DCM.

BTW, controls designed for this type of operation, do indeed sense inductor current.  A cheap way to do so, is either to capacitively couple the voltage (sensing the down-swing after current falls below zero), or to add a secondary winding and just measure that voltage (again, sensing when it drops below zero).  The impedance of this path can be large (10s, 100s kohms) so the losses are small. :)

Such controls are always complicated by the fact that BCM can never be perfectly maintained, so have some way to deal with DCM operation at light load.  BCM is particularly attractive for PFC (active power factor correction) circuits, because it uses peak current control to draw constant input current, but these always perform poorly at light loads.

Tim
Your post is very interesting to read. It gives some idea of the complexity of it all.

Reading it gives food for thought. For instance previously I might have thought it might hurt the efficiency a lot to start charging the inductor again before it was completely discharged. Now I understand that a lot of that energy is restored to the inductor.

But I must also mention my little experiments are not in the same league.. :-[

I took the most shiny inductor  :P from a scrap pcb. And some low-level opamp. But that's fine because the circuit has a low bar to meet, just light up a few leds.

But while thinking about driving the mosfet the (for me) interesting new problem arises: how to design a system that repeatetly cycles through 4 states. Which ultimately would optimize the driving of the mosfet (and maybe very inefficient in other regards). This fast driving would not be a real worry, but more like a challenge.
As said designing a system globally might be easy,  but to connect the dots at a lower level, that is though in electronics.



« Last Edit: January 07, 2021, 09:27:03 pm by HendriXML »
“I ‘d like to reincarnate as a dung beetle, ‘cause there’s nothing wrong with a shitty life, real misery comes from high expectations”
 

Offline HendriXMLTopic starter

  • Super Contributor
  • ***
  • Posts: 1085
  • Country: nl
    • KiCad-BOM-reporter
Re: Trianglewave generator with a LM358 and regulate boosted voltage
« Reply #59 on: January 07, 2021, 08:18:03 pm »
I've done some evaluation on a factor why connecting the dots is though. Mostly I'll try to create circuits that work on 5 V. Single supply, using old school components. The voltage ranges one can work with are quite small than. BJT/ diodes take away 0.7V Power mosfets need at least x V. Some stuff doesn't work near ground, or positive rail or both. And don't talk about output swings...
So probably I need to get more modern components or use supply voltages that give more headroom.
But I'm progressing because I started with buying fancy lm741's thinking 0,25ct/pcs was a bargain  :-+
(Yeh, as a jong adolescent I had played with electronics before.)
So next project I'll go with -12 / +12 V :-+
“I ‘d like to reincarnate as a dung beetle, ‘cause there’s nothing wrong with a shitty life, real misery comes from high expectations”
 

Offline T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 21807
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: Trianglewave generator with a LM358 and regulate boosted voltage
« Reply #60 on: January 07, 2021, 09:37:55 pm »
5V is plenty, but you do need to strategize a little differently.  You can't be wasting Vbe's all over the place.  RRIO amps are a good investment, e.g. TLV2372.  Even the best RRO amps can't pull perfectly all the way to the rails, so you need to plan some padding range, where the actual useful voltage range is, say, 0.1 to 4.9V or something.

Handily, 74HC logic is right at home at 5V, so you can interface digital logic functions with analog circuits.  Arduino as well (ATmega328P and relatives).

12V, single-supply parts (like LM358, which functions with inputs near GND and its output can pull nearly to GND, but falls apart near +V) and CD4000 logic are a good combination, when you need more voltage than speed.  Lots of old parts, but lots are still around, too.

These days, doing everything at 3.3V (or even less) is attractive.  Most MCUs run at 3.3V or below, and have more than enough CPU power to solve anything you would otherwise want to do in analog.  The downside being, a lot of stuff still needs 5V+ interfaces.  So you tend to use a lot of interface chips this way (e.g. RS232, load switches, 4-20mA drivers, op-amps).  Acceptable for commercial applications, where the development time of all that low-level software can be handled, and pressure for miniaturization and battery life demand digital solutions.

Tim
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 

Offline HendriXMLTopic starter

  • Super Contributor
  • ***
  • Posts: 1085
  • Country: nl
    • KiCad-BOM-reporter
Re: Trianglewave generator with a LM358 and regulate boosted voltage
« Reply #61 on: January 08, 2021, 01:39:54 am »
5V is plenty, but you do need to strategize a little differently. 
With strategize lies the problem when one is lacking knowledge, like forseeing how things will turn out.

As an experienced person one might not even explicitly think about the nitty gritty details that ruins a "beginners project".

Having some failures is good, but better due to design mistakes than a "misunderstood parameter" of a component. Knowlegde about component parameters can then be gained when optimizing a design.

In a way I do like the messy, non digital world of analog electronics. As a (former) software developper Arduino is a lot easier, much higher successrate  :-+

But when engaging with ripples, noise, limiting parameters (10+) my software oriented mind sometimes really wants to shout.. what??

On the otherhand there are specialized components which handle some of the details for the designer. Thus larger building blocks.

However using only one building block and some components is not really designing for fun. Might be different for a professional, or when doing larger scale projects.

So back to the nitty gritty details..  :popcorn:

The TLV2372's are in the basket and also some TLC072's.

As a 2N7002 "complement" I found the ZVP2106A p-channel mosfet.

 (I'm gathering a basket full of stuff on Mouser so that shipping is for free..)
“I ‘d like to reincarnate as a dung beetle, ‘cause there’s nothing wrong with a shitty life, real misery comes from high expectations”
 

Offline T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 21807
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: Trianglewave generator with a LM358 and regulate boosted voltage
« Reply #62 on: January 08, 2021, 04:30:38 am »
BSS84 is closer to complementary, I think -- but don't worry too much about that, there's not truly a complementary MOSFET, in the way there is for BJTs.  Because physics. :)

If you haven't grabbed any logic, it might be worth picking up a few 74HC04 or 14, 00, 02, 08, 74, 86, etc.  The basic gates can be used for whatever, give or take if you're planning on anything more complicated than a handful of states -- and the flip-flops are great for holding onto those states.  Perfect use, the latch in a peak current mode controller.  Or with one strapped as a toggle flip-flop, you can make TL494 and UCC3808 style functions too.

Tim
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 

Offline HendriXMLTopic starter

  • Super Contributor
  • ***
  • Posts: 1085
  • Country: nl
    • KiCad-BOM-reporter
Re: Trianglewave generator with a LM358 and regulate boosted voltage
« Reply #63 on: January 08, 2021, 11:22:34 am »
I've got these on stock:

74LS08      4 x AND poorten 
CD4011      4 x AND poorten 
CD4081BD    4 x AND poorten 
74LS32       4 x OR poorten 
CD4071       4 x OR poorten 
74LS86      4 x XOR poorten 
TC4030BP    4 x XOR poorten 
74LS266    4 x XNOR poorten 
CD4077     4 x XNOR poorten 
74LS00     4 x NAND poorten 
74LS02      4 x NOR poorten 
CD4001      4 x NOR poorten 
74LS04      6 x NOT poorten 
CD4069      6 x NOT poorten 

Should add flip flops indeed. And also shift registers.
The BSS84 doesn't exist in a tht package, but is a lot cheaper, soo maybe worth some extra hassle.
“I ‘d like to reincarnate as a dung beetle, ‘cause there’s nothing wrong with a shitty life, real misery comes from high expectations”
 

Offline HendriXMLTopic starter

  • Super Contributor
  • ***
  • Posts: 1085
  • Country: nl
    • KiCad-BOM-reporter
Re: Trianglewave generator with a LM358 and regulate boosted voltage
« Reply #64 on: January 08, 2021, 11:42:18 am »
In further investigation of inductors, I want to calculate the inductance using a scope and a awg, a poor man's LCR meter.

The setup is very simple, let the inductor be charged and discharged through the 50 ohm resistor of the signal generator and measure the response across it.

The graphs are the result. With a vertical log-scale it's a (somewhat) straight line, the slope of this line is to my knowledge related to the inductance.

I have to figure out the math, but I guess it's not hard to show the calculated inductance at each point. When these are shown it's possible to see how much it fluctuates, which gives a sense of accuracy.

The precision of the voltage measurements is not really great and maybe the internal resistor is also not very precise, but it might be good enough.
“I ‘d like to reincarnate as a dung beetle, ‘cause there’s nothing wrong with a shitty life, real misery comes from high expectations”
 

Offline HendriXMLTopic starter

  • Super Contributor
  • ***
  • Posts: 1085
  • Country: nl
    • KiCad-BOM-reporter
Re: Trianglewave generator with a LM358 and regulate boosted voltage
« Reply #65 on: January 08, 2021, 01:31:01 pm »
Another approach would be to calculate the stored or released energy. (As done for the charge curve, 2nd axis)

Energy can be calculated easily between samples and can be automated more easily.

Maybe by taking an average between the charge and discharge energy some resistive losses can be cancelled out.

I think I'll go that route.
“I ‘d like to reincarnate as a dung beetle, ‘cause there’s nothing wrong with a shitty life, real misery comes from high expectations”
 

Offline HendriXMLTopic starter

  • Super Contributor
  • ***
  • Posts: 1085
  • Country: nl
    • KiCad-BOM-reporter
Re: Trianglewave generator with a LM358 and regulate boosted voltage
« Reply #66 on: January 08, 2021, 01:59:44 pm »
Dit some quick calculation in Maxima:

49,0 uH

Would be the inductance of the inductor I measured, not the one I used btw.

This is without averaging charge & discharge. A final solution would be to calculate it all, including the discharge slope in a script, which is easier than playing around in Excel.

Can known and accurate inductors be found in scrap electronics? Would be nice to validate this method.
« Last Edit: January 08, 2021, 02:01:50 pm by HendriXML »
“I ‘d like to reincarnate as a dung beetle, ‘cause there’s nothing wrong with a shitty life, real misery comes from high expectations”
 

Offline HendriXMLTopic starter

  • Super Contributor
  • ***
  • Posts: 1085
  • Country: nl
    • KiCad-BOM-reporter
Re: Trianglewave generator with a LM358 and regulate boosted voltage
« Reply #67 on: January 08, 2021, 08:07:38 pm »
Found a gem of a presentation over here:
https://hackaday.com/2017/06/12/design-a-coil-for-a-specific-inductance/

Scratches only the surface of inductors, but very pleasant to watch.
“I ‘d like to reincarnate as a dung beetle, ‘cause there’s nothing wrong with a shitty life, real misery comes from high expectations”
 

Offline T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 21807
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: Trianglewave generator with a LM358 and regulate boosted voltage
« Reply #68 on: January 08, 2021, 08:41:50 pm »
Right, using waveforms you can get a good measurement.  What you'll want to do is solve for at least two parameters, using a least-squares curve fit approach.  Easy enough to do in Excel (Solver plugin) or Python or etc.  Don't forget that the inductor has resistance, and you're measuring midway along both resistances (source resistance and DCR).  So the total is a bit more than 50 ohms.

Another way is to use a sine wave, and adjust it for sqrt(2)/2 amplitude, were X_L = R.  Obviously, this only gets you inductance at one frequency; in general, inductance varies with frequency, only slightly over the useful frequency range of the part, but it changes dramatically outside of that range (at low frequencies where DCR dominates, or high frequency where core loss or stray capacitance dominates -- a capacitance is of course equivalent to a rapidly changing negative inductance!).

Tim
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 

Offline HendriXMLTopic starter

  • Super Contributor
  • ***
  • Posts: 1085
  • Country: nl
    • KiCad-BOM-reporter
Re: Trianglewave generator with a LM358 and regulate boosted voltage
« Reply #69 on: January 08, 2021, 08:59:10 pm »
Maxima can fit curves too. Will check the outcome using it.

I guess using the energy transfer at each sample (1000 x 14k total) might be the inductance calculation which is regarding the voltage booster application the most meaningfull method of calculating the inductance. So function fitting could be skipped, but it's nice to compare them.

One thing I'll try to optimize away using a better setup is the ringing at the start of charge and discharge. I don't think it harms the method, but better safe than sorry.
“I ‘d like to reincarnate as a dung beetle, ‘cause there’s nothing wrong with a shitty life, real misery comes from high expectations”
 

Offline T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 21807
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: Trianglewave generator with a LM358 and regulate boosted voltage
« Reply #70 on: January 08, 2021, 09:21:39 pm »
Also, for a pulsed test it may help to use a much lower frequency, so that initial current is nearly zero; or at least be aware to subtract the initial current from the previous (half) cycle.  Then, I think, the log(waveform) should give a cleaner result.

Tim
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 

Offline HendriXMLTopic starter

  • Super Contributor
  • ***
  • Posts: 1085
  • Country: nl
    • KiCad-BOM-reporter
Re: Trianglewave generator with a LM358 and regulate boosted voltage
« Reply #71 on: January 08, 2021, 09:55:26 pm »
Also, for a pulsed test it may help to use a much lower frequency, so that initial current is nearly zero; or at least be aware to subtract the initial current from the previous (half) cycle.  Then, I think, the log(waveform) should give a cleaner result.

Tim

The graph is generated using:

WVTP,PULSE,FRQ,5000HZ,PERI,0.0002S,AMP,5V,AMPVRMS,2.5Vrms,OFST,2.5V,HLEV,5V,LLEV,0V,DUTY,2.5,WIDTH,5e-06,RISE,1.68e-08S,FALL,1.68e-08S,DLY,0


Very low duty cycle so pulses are not related to each other. Everything is consumed by the internal awg resistor in each pulse.

That's also the reason that changing the frequency does not change the waveform. I also added some noise to get rid of quantization while averaging.

“I ‘d like to reincarnate as a dung beetle, ‘cause there’s nothing wrong with a shitty life, real misery comes from high expectations”
 

Offline HendriXMLTopic starter

  • Super Contributor
  • ***
  • Posts: 1085
  • Country: nl
    • KiCad-BOM-reporter
Re: Trianglewave generator with a LM358 and regulate boosted voltage
« Reply #72 on: January 08, 2021, 09:58:29 pm »
This is the applied signal to the inductor on the same timebase etc.

Longer pulses don't change the graph either, so I made the smaller to fit both in a same graph.

Also I don't want short the signal too long and heat up the resistor.
« Last Edit: January 08, 2021, 10:01:53 pm by HendriXML »
“I ‘d like to reincarnate as a dung beetle, ‘cause there’s nothing wrong with a shitty life, real misery comes from high expectations”
 

Offline HendriXMLTopic starter

  • Super Contributor
  • ***
  • Posts: 1085
  • Country: nl
    • KiCad-BOM-reporter
Re: Trianglewave generator with a LM358 and regulate boosted voltage
« Reply #73 on: January 09, 2021, 12:27:33 am »
In Excel I generated 1000 rows of simulated data.

That data is "correct", so doing the same process calculating energy transfer at each step would lead to the same inductor value as the input.

In : 60.3343 uH
Out: 60.3032 uH

A small difference because we took steps and did a current * voltage calculation. Smaller steps more row would make the difference very small. Also simu time should be "infinite".

The inductance of 60.3343 uH was taken because I made a mistake in the previous current calculation.

The simulated data can now be compared to the measured one. One thing stands out:
The measured data does not reach zero volts fast enough. Because of the high current this will lead to an overestimate of the energy that gets into the conductor.

A way to conquer this is to measure between 25% * V and 75% * V this would lead to X % of the energy, from which the total energy can be determined.
In this way low current * high voltage and high current * low voltage, which are very sensitive to errors can be left out.

Maybe alsoe optimize the voltage measurement (calibrate scope) or maybe the discharge curve is more suited.
« Last Edit: January 09, 2021, 02:38:02 am by HendriXML »
“I ‘d like to reincarnate as a dung beetle, ‘cause there’s nothing wrong with a shitty life, real misery comes from high expectations”
 

Offline HendriXMLTopic starter

  • Super Contributor
  • ***
  • Posts: 1085
  • Country: nl
    • KiCad-BOM-reporter
Re: Trianglewave generator with a LM358 and regulate boosted voltage
« Reply #74 on: January 09, 2021, 01:02:45 am »
The error is not in the scope measurement, the opencircuit low voltage is very close to 0V as can be seen.

I'll measure some resistances, the leads to the inductor where too long, something I knew then that had to improve.

So first implement the method in a script, then take very short BNC cable to inductor.
“I ‘d like to reincarnate as a dung beetle, ‘cause there’s nothing wrong with a shitty life, real misery comes from high expectations”
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf