Boost converter -2 speed ramp - Page 1
Forum section: electronics / projects

author: HendriXML
author_rank: Super Contributor
timestamp: December 29, 2020, 03:14:58 pm
content: Hi!,A trianglewave generator with a LM358 does not act like it should. At the moment it only starts oscillating when I measure with a MM between pin 5 & 6.The screenshot is taken in that situation.In that screenshot it looks like the square wave signal (pin 1) bottoms at around 750 mV (after a short dip). That seems rather high, as the LM358 can output near ground.I would have taken a faster opamp, but this is what I had on stock. (Bought them from AliExpress so it might not meet the specs.)My calculations of the resistors take the swing into account, but this behavior was not expected. Maybe someone can explain why the actual signal is like this? What spec for instance should I've taken into account?The purpose of the subcircuit is to have a "triangle like" wave, with a amplitude of more than 1 V. The offset is not critical. It is used to control a PWM signal.The opamp does have a decoupling cap of 1 uF.

author: Kleinstein
author_rank: Super Contributor
timestamp: December 29, 2020, 03:41:43 pm
content: Even if from China I would not expect the LM358 to be fake - at least not poor ones. There are reports from TL072 being fakes and some kind of slightly improved LM358 versions from China.The LM358 is known to have a lot of cross over distortion from the output stage. For a test one could try some 1-5 K from the output the positive supply, to force the output stage to work in class A mode.

author: HendriXML
author_rank: Super Contributor
timestamp: December 29, 2020, 04:52:55 pm
content: Thanks!I've put 2 resistors of 1k between the outputs and 5V. However now it doesn't oscillate anymore, even after the mysterious MM triggering.I'll recalculate the resistors using 700 mV as the low output, so I might end up with a testable situation again.Eventhough I dislike breadboards its probably better to duplicate the subcircuit on one of them.

author: Zero999
author_rank: Super Contributor
timestamp: December 29, 2020, 06:00:18 pm
content: Yes, it looks like crossover distortion. Try connecting the resistors from the outputs to 0V instead. Connecting them to +5V will only make matters worse.You shouldn't rely on the LM358's output being able to reach all the way down to its negative rail and it's a slow op-amp, so the frequency might need to be reduced a little. If that doesn't work try: increasing R101 to 56k or 68k and R103 to 39k.

author: HendriXML
author_rank: Super Contributor
timestamp: December 29, 2020, 06:18:22 pm
content: For those who are also wondering about crossover distortion, here's a link to a video which explains it clearly.https://youtu.be/VgodYtiD_F0

author: fcb
author_rank: Super Contributor
timestamp: December 29, 2020, 07:00:59 pm
content: LM358 is notorious for crossover distortion. If you pull-up/pull-down the output you are essentially forcing it into class-A operation and lowering/eliminating the distortion for that set-point.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: December 29, 2020, 09:27:55 pm
content: The waveform looks typical. I don't know why it doesn't start up. Possibly the low supply voltage has something to do with it.What are you expecting to get out of the PWM, and how are you generating it?If you're expecting to use LM358s the whole way, you'll have to do it at a few kHz tops, to get much useful range out of it.Don't have any LM393s?Tim

author: HendriXML
author_rank: Super Contributor
timestamp: December 29, 2020, 11:25:16 pm
content: I've now replaced the lm358 with a tc082. That seems a worse candidate, but I had used one of them in a similar generator. For this project I took a genuine one, but it doesn't start. Which make me think wether the previous one was even a tc082.I posted the more complete schematic. Its kind of an experiment to create a current controlled boost converter. Just a few mA to light up leds in series.So I need the trianglewave to have a voltage controlled PWM.I took some measurements:* GND - U101A.1: 1,45577 V ± 90 μV* GND - U101A.2: 1,87974 V ± 110 μV* GND - U101A.3: 1,78243 V ± 100 μV* GND - U101B.7: 1,78279 V ± 100 μV* GND - U101B.5: 1,87998 V ± 110 μV* GND - U101B.6: 1,78341 V ± 100 μVAnd saw on the scope that its stable.It also draws much more current as expected (I've disconnected the mosfet), especially when the supply voltage is 6V or more (>60 mA).did forget to tie the gate to gnd, so that might explain the current draw. So I will remedy that.The difference between U101A.2 and GND - U101A.3 is only a few mV so the output (U101A.1) could be anything.But between U101B.5 and U101B.6 there is a significant difference, so the output (U101B.7) should go near the positive rail. Maybe a genuine tc082 is indeed unsuited?

author: fcb
author_rank: Super Contributor
timestamp: December 30, 2020, 11:13:44 am
content: LM358 will work on 5V, it'll get close to the negative rail and about 1.5V from the positive rail. TL072/082 family won't work below about 7V.

author: HendriXML
author_rank: Super Contributor
timestamp: December 30, 2020, 11:36:03 am
content: Most of the current was indeed drawn by the mosfet. Tied the gate to ground so I could raise the voltage.The measured values at 11 V supply are true, but a bit unlikely:* GND - U101A.1: 10,4420 V ± 400 μV* GND - U101A.2: 4,13911 V ± 170 μV* GND - U101A.3: 4,13888 V ± 170 μV* GND - U101B.7: 4,13888 V ± 170 μV* GND - U101B.5: 4,13908 V ± 170 μV* GND - U101B.6: 4,13888 V ± 170 μVA second time:* GND - U101A.1: 10,7927 V ± 400 μV* GND - U101A.2: 4,13892 V ± 170 μV* GND - U101A.3: 4,13870 V ± 170 μV* GND - U101B.7: 4,13872 V ± 170 μV* GND - U101B.5: 4,13893 V ± 170 μV* GND - U101B.6: 4,13873 V ± 170 μV* GND: -0·10³ nV ± 50 μV* VCC: 11,0087 V ± 400 μVIn this circuit:https://www.eevblog.com/forum/projects/lasertrigger-circuit-signals-invalid-exposure/I used a "TC082" and that circuit works flawlesly at 5 V and even 4 V. So I don't think it was a genuine one.For this circuit I would have like to use a TLC072, but I'd already used them.However at 11 V I would have expect some action.. not those very similar voltages..Here it says R101 should be more than twice the value of R102:https://electronics.stackexchange.com/questions/311648/obtaining-a-triangle-wave-from-a-square-wave-using-a-lm324n-op-amp?rq=1I knew that before but, wanted to understand why. Maybe this is why.. I'll have to give it some thoughts..

author: T3sl4co1l
author_rank: Super Contributor
timestamp: December 30, 2020, 11:50:39 am
content: Y'know, as long as you're writing down all those decimals -- I'm a bit suspicious that the inputs are within a mV of each other. I wonder if it's more of a latchup thing than a stability thing.Are you sure you don't have any comparators? This is doomed to failure with op-amps. At least unless you have an iron-cored inductor.No current mode operation either, it'll start up saturated and never produce an iota of charge. Fsst, bang.Even discrete transistors will do better here, though the circuit is much more involved.Tim

author: HendriXML
author_rank: Super Contributor
timestamp: December 30, 2020, 12:07:00 pm
content: Quote from: T3sl4co1l on December 30, 2020, 11:50:39 amI automated the output of the DMM measurements, the accuracy should be in par with calibration. I went for this route because I'm terrible at copying digits.The inductor is quite large with an iron core. (Scrap). That part of the circuit was tested using a signal generator. At 20 kHz it needs a 30% duty cycle to get 30 V at the requested current. At 1 kHz, only 7,5% duty cycle is needed.

author: HendriXML
author_rank: Super Contributor
timestamp: December 30, 2020, 02:10:24 pm
content: When replacing the opamp a "trace" came loose (R101 & R103 vs U101A.1).Repaired that, I've then also added a 36k resistor across R102, without that it did't oscillate.I've got the following waves at 13V. Before that it won't start oscillating. That voltage is way to high for this application, so the TC082 needs to go. Maybe I replace it with the same fake one I used before.Other resistors could make it oscillate on a lower voltage. But the wave would be narrow (square wave between 1.2 V and 3.5 V). Maybe I'll try that first.

author: HendriXML
author_rank: Super Contributor
timestamp: December 30, 2020, 10:02:26 pm
content: The following:Change R101 value from 39k to 91k.Change R102 value from 36k to 43k.Change R109 value from 120k to 130k.Resulted in an even higher voltage needed to oscillate. (14V)So I changed the genuine TC082 to the same fake one of the previous circuit, and now it works at 5 V and even 4 V!Conclusion fake TC082 is a totally different kind of op amp.Slower also than a genuine one, however it gives just the wave I need, how about that!

author: magic
author_rank: Super Contributor
timestamp: December 30, 2020, 10:37:15 pm
content: TC or TL082?Anyway, it's probably LM358 with fake markings so just use a normal LM358.

author: HendriXML
author_rank: Super Contributor
timestamp: December 30, 2020, 11:33:23 pm
content: Quote from: magic on December 30, 2020, 10:37:15 pmTL082(6x ^)Kleinstein said it might be a bit improved chinees LM358: the distortion seems lessBut than again the LM358 I started with is propably not a genuine one as well. B.t.w. I don't really source my component's on aliexpress anymore, guess why..

author: Hiemal
author_rank: Regular Contributor
timestamp: December 31, 2020, 12:09:45 am
content: As a general rule, I only really buy stuff from aliexpress or eBay if it's a "digital" item where it either works, or it doesn't. Even then, I still generally try to avoid it if possible.Buying analog components like op amps and whatnot just feels ripe for counterfeiting.I can also recommend thehttps://www.onsemi.com/pub/Collateral/NCS20071-D.PDFNCS270072, it's a good op amp that's pretty inexpensive.

author: HendriXML
author_rank: Super Contributor
timestamp: December 31, 2020, 12:24:44 am
content: Quote from: Hiemal on December 31, 2020, 12:09:45 amNice opamp, and indeed not to expensive! No through hole package, a bit more work (dead bug) but doable using perfboards.

author: HendriXML
author_rank: Super Contributor
timestamp: January 02, 2021, 01:51:51 pm
content: I made some changes to the PWM generation and measured the signals going in and out of U102A.To have a clear view I averaged 1000 captures (the ADC steps become visible) and made a graph in Excel.It seems that the opamp output is delayed by a lot. Is this what Time meant?:Quote from: T3sl4co1l on December 30, 2020, 11:50:39 amBut why is it so? Does it need to recover from a saturated situation?

author: fcb
author_rank: Super Contributor
timestamp: January 02, 2021, 01:59:32 pm
content: U102A.1 is also called PWM? That's what it looks like on your schematic?

author: HendriXML
author_rank: Super Contributor
timestamp: January 02, 2021, 02:18:56 pm
content: My mistake it should be U102A.2.Made a black graph to fix this error. (Looks more scope like..)

author: fcb
author_rank: Super Contributor
timestamp: January 02, 2021, 02:35:47 pm
content: So assuming that your 5V is solid, then U102A.2 is affected by the CURRENT SENSE and CURRENT REF. CURRENT REF *should* be stable - what does the sense resistor waveform look like? Might be difficult to measure correctly.

author: HendriXML
author_rank: Super Contributor
timestamp: January 02, 2021, 03:07:14 pm
content: The sense voltage might fluctuate a bit. Will measure it later on. I had to limit the boosted output voltage with a 32V zener to protect the capacitor. So it might have a small spike each time the inductor discharges.However the circuit does not seem to be regulating the current well. (Ref voltage is turned to gnd.)Validating the PWM signal generation seems like a good first step to troubleshoot then. The op amp does not respond like it should taken only the 2 inputs into account.There's always the possibility the schematic wasn't implemented correctly (rerouting, resoldering), but the simple op amp measurements seem solid.

author: HendriXML
author_rank: Super Contributor
timestamp: January 02, 2021, 03:13:12 pm
content: I guess the ringing on the output of the op amp (PWM) near gnd is due to the discharge of the gate capacitance?

author: fcb
author_rank: Super Contributor
timestamp: January 02, 2021, 04:23:01 pm
content: On the basis that the ringing you are seeing is going -ve and you don't have a negative supply, then it's likely to be (1) measurement grounding or (2) coupled from your inductor, back through the MOSFET (miller capacitance), or some mix of the two.If you've got a bench signal generator capable of variable dutycycle, then i'd feed that into your MOSFET and test your assumptions as far as duty cycle and quality of signal on Rsense. If you've got a fixed load (LED's) then it should straighforward to test the circuit and find your noise, etc..The quality of the gate drive may or maynot be an issue - the IRLZ44 is an ancient MOSFET (there are much better ones out there), and at the least I'd build single transistor (open collector with pull-up) driver to reduce the load on your opamp - certainly whilst you're testing.

author: HendriXML
author_rank: Super Contributor
timestamp: January 02, 2021, 09:27:41 pm
content: Quote from: fcb on January 02, 2021, 04:23:01 pmGood info, I will measure the drain voltage next time.I'm starting to dislike the circuit from the design perspective (things don't turn out as calculated). But from the perspective of getting more experience it's still ok, I guess.I think I'll replace the op amps U102 A & B with a LM7332, much faster and designed for high capacitance load. I even have some on stock. Will be the first time to try out an adapter board. That would make it a pin compatible replacement so to speak.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: January 02, 2021, 10:14:30 pm
content: Yes, anything faster than LM358 will showvastimprovement.I wouldn't recommend LM7332 from a design standpoint, as it does not specify saturation recovery. In practical terms, this is easily tested, and it will be apparent whether it's good or not.You sure you don't have any comparators available? Anywhere?Tim

author: HendriXML
author_rank: Super Contributor
timestamp: January 02, 2021, 10:47:32 pm
content: I've got: lm393, lm311, lm211, lm339, lm319. (Some of them were fakes too)The problem board space is running out. And I need at least one op amp for current sensing.Also having a pull up resistor seemed like a waste of power. The circuit was intended to be battery powered about 50 mA @ 5V.So introducing a comparator would mean start over again. There're quit some traces of copper wire I had to bend and make jumps here and there. So trying a better op amp seems more appealing. But there's a lesson learned. Maybe I should order some gate driver IC for future experiments as well.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: January 02, 2021, 10:52:24 pm
content: Don't worry about current consumption. Make something thatworksfirst, and then optimize it for efficiency.As for space, you're using more op-amps than comparators I would need, I think; this can likewise be optimized. Make it work, and then make it work better!Tim

author: HendriXML
author_rank: Super Contributor
timestamp: January 03, 2021, 04:32:05 pm
content: I measured the voltage of the inductor discharge and the current sense voltage (right axis).The inductor ringing seems indeed to be the cause of the ringing at the gate (PWM).The current measured with the current sense voltage has a big spike, this is probably caused by the zener diode of 32 V. The test load besided the zender diode consists of a 6k2 resistor.The LED's it will eventualy drive will also undergo the same current spikes. I'll try to lower them with a additional ceramic buffer capacitor as well, but I think it will be acceptable.

author: HendriXML
author_rank: Super Contributor
timestamp: January 03, 2021, 07:04:47 pm
content: I've thought about it and will abandon this design. The whole trianglewave stuff is just too fragile.The current circuit starts with a very high current draw before the supply voltage is high enough to have it regulate as it should.Instead I'll use a square wave created by a 7555, that will turn off when the boosted voltage is at a high level (35V), or when the voltage drop on a "boosted side" current limiting transistor is above a certain level.I'll have to lower the boosted low voltage to have some buffer headroom (low..high). Also there will be a extra voltage drop at the current limiter, but in the end the circuit might be more efficient.Thanks for helping me out though!

author: fcb
author_rank: Super Contributor
timestamp: January 03, 2021, 07:13:01 pm
content: You’ll learn more by persevering with the existing design (even if most engineers on-the-clock) would just throw in a controller IC or single chip switcher.

author: Zero999
author_rank: Super Contributor
timestamp: January 03, 2021, 07:16:13 pm
content: You're using an op-amp IC as a comparator, which is never a good idea and it will not drive a MOSFET on its own, at any decent speed. Here's the circuit modified to the LM358 for the op-amps and LM393 for comparators. The LM358 is still a bit slow, but it stands more of a chance of working.I agree with the above: use a dedicated LED driver IC, rather than faffing around with op-amps and comparators. It'll use less board space could even work out cheaper.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: January 03, 2021, 08:05:52 pm
content: Several of these issues are handily solved by using a current mode controller.In the case of a peak current mode control, the inductor current itself is used as the PWM timing ramp. Indeed you're not so much generating PWM at all anymore, you're directly controlling the inductor. Which immediately and obviously means, you're controlling the inductor current, it can never stay latched on or off for too long, or reach an excessive peak current -- it's always under control and doing exactly what you mean it to. (Whereas a naive voltage mode PWM circuit will simply saturate at 100% PWM when commanded to full throttle; which is actually 0% because output can only be delivered when the switch finally turns off -- fatal mistake!)In the case of average current mode control, we still generate a PWM ramp, and a PWM setpoint from an error amplifier, but we control inductor current first. Same thing happens, inductor current can only ever be what it's commanded to (or lagging somewhat behind, on its way towards it).In both cases, we add a second error amplifier which controls inductor current setpoint, so as to regulate output voltage (for a typical constant-voltage (CV) type supply).Besides the reliability aspect, the cascaded error amps also yield benefits from control loop response -- explaining exactly how this works is an advanced topic, but rest assured it's easier to use.Here's an example using discrete parts (comparators and op-amps), to step up a lithium ion battery to power three LEDs in series:https://www.seventransistorlabs.com/Images/Flashlight2Sch.pnghttps://www.seventransistorlabs.com/Images/Flashlight2_Schematic.png- Note that BATSNS is on the low side. This is convenient as the battery is floating. In a common-ground or isolated system, we might use a different kind of current sensor (high-side current sense amp, or isolated Hall effect sensor, for instance). Note also, it has negative sign (V(BATSNS) < 0).- In this case, LED current (LEDSNS) is regulated primarily, to give perfect consistency in light output, for any battery voltage until it's discharged to the point it simply can't supply enough power at all. Voltage is regulated secondarily. This is easily enough changed around thanks to the general error-amp design, and I've used the same circuit with a few modifications for CV supplies.- IC2A is a conventional ramp generator (assisted with Q4, a current source charging C9, thus giving a straight ramp waveform); this is compared with the PWM setpoint voltage by IC2B. (IC1's parallel buffers drive the MOSFET.)- PWMV is in turn set by the current error amp IC3B, which adjusts PWM such that the feedback signal IBATT (= BATSNS) balances the setpoint INSP (R16 and R22 set the gain; again, BATSNS is negative, so this is an inverting error amp and the gain is simply R16/R22). C11, R20 and C15 set the compensation (effectively, how fast the amp responds to changes).- INSP is set by the error amp IC3A, which adjusts current such that the feedback signal ILED (= LEDSNS, a positive signal) equals VREF2 (a setpoint from a shunt regulator IC4, divided by resistors, and adjustable with a pot, thus it's a dimmable LED flashlight). R25 is placed in series, so that a smaller current can pull up on ILED1 mimicking LED current; this is used to introduce three additional feedback sources: when VOUT exceeds D3's 12V zener rating, it acts like raised LED current, thus reducing setpoint current; when BATT drops below about 3V, or thermistor temperature rises too far (about 80°C), output is reduced similarly. (Ah, hrm, interesting, this must be an early version of the schematic; R17 and R18 should be supplied from BATT, not VOUT. That's a typo!)You don't need the UVLO or temp stuff (they are nice to have), and the CCS can be replaced with a resistor for a crummier ramp, but I strongly suggest keeping the current mode control with cascaded error amps (or one error amp and one peak-current-mode stage).For further reading, UC3842 family and appnotes are good.Tim

author: fcb
author_rank: Super Contributor
timestamp: January 03, 2021, 08:15:06 pm
content: The LM393 has quite a good open-collector output - I wouldn’t bother with a separate driver yet - you are only switching at 10KHz?Remove the gate driver from the previous post, and the pull-down on the gate. The gate is then being pulled up by the 2K2 and pulled down by the 51R (via o/c LM393).The LM393 will switch in something around 1us, so rubbish for a 100KHz SMPSU but fine for 10KHz.Watch the routing around the sense resistor, grounding WILL fxxx-u-up.

author: Zero999
author_rank: Super Contributor
timestamp: January 03, 2021, 09:59:21 pm
content: Quote from: fcb on January 03, 2021, 08:15:06 pmRemoving the gate driver, just seems like a bad idea. It will take ages to charge the MOSET's gate, via 2k2. You might think it's only 10kHz, which is an on time of 50µs right, but that's only with a duty cycle of 50%.Have you done any calculations? I admit, I haven'tIf cost is an issue, add the usual complementary BJT push-pull stage, between the comparator and MOSFET. In a pinch, you might be able to get away with a single NPN and a diode, but it isn't as good.https://www.diodes.com/assets/Part-Support-Files/ZXGD3002E6/5765287.pdf

author: HendriXML
author_rank: Super Contributor
timestamp: January 03, 2021, 10:58:01 pm
content: Thanks for responding!I made a quick draft of the new idea (just entered some values).It's about having an fixed PWM boosting the voltage until a suspend condition is met, in that case it will suspend for a brief moment.This gives the benefit of having a solid current control, which might even filter the current spikes.The circuit is ment not to drive high power leds, but only 12+ or so red leds in series at 5 mA ..15 mA.It should also be not too power hungry, the used components are ok in that regard.I again used a lm358 as a comparator (with hysteris), but that's probably fine as it does not need to do anything fast.I'm a bit uncertain wether its fast enough for the current control.

author: fcb
author_rank: Super Contributor
timestamp: January 03, 2021, 11:30:26 pm
content: It’s late and I’m not following exactly what you are trying to do. Are you trying to blank the sense signal?

author: HendriXML
author_rank: Super Contributor
timestamp: January 04, 2021, 12:00:34 am
content: The idea is to stop the icm7555 from generating pulses for a moment until the voltage across the current regulator (and also buffer capacitor) is lowered.If a voltage difference of 1 V is allowed, there's 1 mC to drain. At 10 mA that would mean 100 ms of allowed suspension. That are many cycles.There's no PWM anymore only a fixed squarewave of about 20 kHz.It seems that an icm7555 has very low sourcing/sinking capabilites, so that's something that needs sorting out.

author: HendriXML
author_rank: Super Contributor
timestamp: January 04, 2021, 01:14:51 pm
content: For those who also like to know how the reset pin affects the timing, I made a little diagram.In my circuit a reset to low will stop any inductor charging at once. A reset to high after a full discharge of the capacitor would lead to a somewhat longer "charging" of the inductor.(In my schematic I forgot to connect the capacitor. After some calculations I'll fix that).

author: HendriXML
author_rank: Super Contributor
timestamp: January 05, 2021, 10:36:05 pm
content: Quote from: T3sl4co1l on January 03, 2021, 08:05:52 pmThanks for sharing this schematic. It took some time while to get a general understanding of it.Very creative approach!

author: HendriXML
author_rank: Super Contributor
timestamp: January 05, 2021, 10:49:29 pm
content: I've been investigating what kind of gate driver I could use between the 7555 and the mosfet, with the components I've got on hand.Using parallel inverting schmitt triggers came to mind. But there current capabilities is limited.When switching the conductor it seems to me that opening (higher currents / voltage) the mosfet is more critical then closing it (current is lagging).Maybe I'll test a simple totem pole driver first, but something like a MCP1407-E/P seems more suitable.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: January 06, 2021, 03:14:32 am
content: 555 is a latch and two comparators. It can be used as the core component in a peak current mode controller. It's a bit of a forced fit, though:https://www.seventransistorlabs.com/Images/555%20Boost.pdfR13 senses switch current; Q3 (common base amplifier) amplifies the sense voltage, bringing it to the 555's compare threshold (which is also controlled by error amp IC2A). When the switch is turned off, Q2's base is pulled down, allowing C4 to discharge through R10, D2. (D2 I think prevents it from turning back on, when commanded to zero output? It's been a while since I drew this, I forget all the details.) TL431 can usually be used as an error amplifier, but in this case I think the single-supply range of the LM358 (or better yet any RRO amp e.g. TLV2372) is required (TL431 cannot saturate near 0V).As for drivers, the CMOS output of a 7555 is very attractive for a simple bipolar follower,At these frequencies, you'll probably find that drivers aren't necessary; a few mA will drive a modest size gate in a few microseconds.TC4420 and friends is good when you need a lot of speed.Tim

author: HendriXML
author_rank: Super Contributor
timestamp: January 06, 2021, 12:38:56 pm
content: 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.Maybe that loss would be minimal because that current trough the mosfet would also lower the voltage generation of the conductor.So just wondering how those things are related and wether that could lead to losses when switching is too slow.(I think the voltage amplification of the mosfet, together with the threshold like behavior limits this issue. But the drain-gate capacitance could interfere with that??)

author: fcb
author_rank: Super Contributor
timestamp: January 06, 2021, 01:14:48 pm
content: If you think about the current in basic boost converters (in discontinuous mode at least).When you switch on the MOSFET the current rise is dependent on the inductor you are 'charging'. So the MOSFET turning on hard instantly is not required or will make much difference. There is a limit to how fast the inductor current will rise.When you switch off the MOSFET you need to suck the charge from the gate quickly so it can go from a lowZ state to highZ (else your boost will loose efficiency).In continuous mode the turn-ON time increases in importance.

author: HendriXML
author_rank: Super Contributor
timestamp: January 06, 2021, 01:58:38 pm
content: Quote from: fcb on January 06, 2021, 01:14:48 pmWhen designing a driver this info could then be used to optimize it.In a way it would be better to flush the gate with a fast mosfet. And having it very close to 5V would be optimal for a low Rson.The totempole driver with 2N3904/06 I can build (on stock) but things got me thinking... If the new method is about suspending the voltage generation, then it could just output any power as long as it's efficient. For instance why wait x-time to generate a new pulse. It could be done right after the inductor is discharged.Also it seems that having a buffer capacitor wich feeds the charging of the inductor would be a solid idea. And then the charging of the inductor could stop when this buffer voltage is dropped to (still) 90%. This way the internal resistance of the batteries could be used to charge it again. So any loss there would be inevitable anyway. In this way no current sensing would be needed.The suspending solution seems suitable because of my low output current and large output capacitor.

author: fcb
author_rank: Super Contributor
timestamp: January 06, 2021, 02:05:12 pm
content: What you are describing is a pulse-skipping converter.This is a mode that alot of current-mode converters can enter under very light load (basically when they can't generate a small enough pulse). In someways pulse-skipping converters can be the most efficient. However filtering the output of pulse-skipping converters is problematic if you require low noise.Build the core of your converter (the 555 etc..) and prove that this works BEFORE closing the loop.

author: HendriXML
author_rank: Super Contributor
timestamp: January 06, 2021, 02:18:53 pm
content: I've made a little diagram to visualise the cycle.Fast switching means:Pushing and pulling. But before a push the pull should be released and visa versa, so there's 4 states of the cycle.Releasing would mean having the push and pull "switches" in HiZ. From what I understand the gate would be stable during that HiZ moment?

author: HendriXML
author_rank: Super Contributor
timestamp: January 06, 2021, 02:25:57 pm
content: Made the diagram more clear..

author: fcb
author_rank: Super Contributor
timestamp: January 06, 2021, 02:30:59 pm
content: 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".

author: HendriXML
author_rank: Super Contributor
timestamp: January 06, 2021, 03:04:00 pm
content: Quote from: fcb on January 06, 2021, 02:30:59 pmMy 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.But you're right I'm not target driven. I actually don't need those leds in series. Parallel would be fine as wellThus 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.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: January 06, 2021, 06:18:15 pm
content: Quote from: HendriXML on January 06, 2021, 12:38:56 pmInductor?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 hason the order of1.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

author: HendriXML
author_rank: Super Contributor
timestamp: January 06, 2021, 08:34:28 pm
content: The voltage across a inductor or a long conductor as one might call it, is:v(t) = L * di(t) / dtSo 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..

author: HendriXML
author_rank: Super Contributor
timestamp: January 06, 2021, 11:09:56 pm
content: 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.)

author: fcb
author_rank: Super Contributor
timestamp: January 06, 2021, 11:49:54 pm
content: 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'.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: January 07, 2021, 12:24:30 am
content: Quote from: HendriXML on January 06, 2021, 08:34:28 pmFor 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.)QuoteI'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; or2. 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.Quote from: HendriXML on January 06, 2021, 11:09:56 pmSo, 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 transistorbegins 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.QuoteDon'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

author: HendriXML
author_rank: Super Contributor
timestamp: January 07, 2021, 02:10:29 am
content: 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.

author: HendriXML
author_rank: Super Contributor
timestamp: January 07, 2021, 03:44:56 pm
content: 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.

author: HendriXML
author_rank: Super Contributor
timestamp: January 07, 2021, 05:11:42 pm
content: Quote from: T3sl4co1l on January 07, 2021, 12:24:30 amYour 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 inductorfrom 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.

author: HendriXML
author_rank: Super Contributor
timestamp: January 07, 2021, 08:18:03 pm
content: 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

author: T3sl4co1l
author_rank: Super Contributor
timestamp: January 07, 2021, 09:37:55 pm
content: 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

author: HendriXML
author_rank: Super Contributor
timestamp: January 08, 2021, 01:39:54 am
content: Quote from: T3sl4co1l on January 07, 2021, 09:37:55 pmWith 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 successrateBut 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..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..)

author: T3sl4co1l
author_rank: Super Contributor
timestamp: January 08, 2021, 04:30:38 am
content: 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

author: HendriXML
author_rank: Super Contributor
timestamp: January 08, 2021, 11:22:34 am
content: I've got these on stock:74LS08 4 x AND poortenCD4011 4 x AND poortenCD4081BD 4 x AND poorten74LS32 4 x OR poortenCD4071 4 x OR poorten74LS86 4 x XOR poortenTC4030BP 4 x XOR poorten74LS266 4 x XNOR poortenCD4077 4 x XNOR poorten74LS00 4 x NAND poorten74LS02 4 x NOR poortenCD4001 4 x NOR poorten74LS04 6 x NOT poortenCD4069 6 x NOT poortenShould 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.

author: HendriXML
author_rank: Super Contributor
timestamp: January 08, 2021, 11:42:18 am
content: 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.

author: HendriXML
author_rank: Super Contributor
timestamp: January 08, 2021, 01:31:01 pm
content: 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.

author: HendriXML
author_rank: Super Contributor
timestamp: January 08, 2021, 01:59:44 pm
content: Dit some quick calculation in Maxima:49,0 uHWould 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.

author: HendriXML
author_rank: Super Contributor
timestamp: January 08, 2021, 08:07:38 pm
content: 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.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: January 08, 2021, 08:41:50 pm
content: 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

author: HendriXML
author_rank: Super Contributor
timestamp: January 08, 2021, 08:59:10 pm
content: 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.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: January 08, 2021, 09:21:39 pm
content: 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

author: HendriXML
author_rank: Super Contributor
timestamp: January 08, 2021, 09:55:26 pm
content: Quote from: T3sl4co1l on January 08, 2021, 09:21:39 pmThe 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,0Very 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.

author: HendriXML
author_rank: Super Contributor
timestamp: January 08, 2021, 09:58:29 pm
content: 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.

author: HendriXML
author_rank: Super Contributor
timestamp: January 09, 2021, 12:27:33 am
content: 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 uHOut: 60.3032 uHA 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.

author: HendriXML
author_rank: Super Contributor
timestamp: January 09, 2021, 01:02:45 am
content: 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.

author: HendriXML
author_rank: Super Contributor
timestamp: January 09, 2021, 01:00:21 pm
content: So I first improved the setup.The wire I used had significant resitance and capacitance. I measured them, will report on them later.Now I used the attached adapter (connected to a T-splitter, one BNC to scope), on wich the inductor could be screwed on. (Those are screw terminals as well)I measured the resitance/capacitance of it: much better.Next a made a new graph with a wider pulse. In the end the signal reaches very close to zero. But it takes a lot more time than the simulated a ideal inductor.I also simulated a inductor of 75% of the calculated inductance. That matches the curves much better at the beginning to mid of the voltage.I still think only measuring 25%-75% of the voltage range will lead to a better calculation of the inductance. Now the lower voltages are too influential.(But something tells me I won't be able to get the math right)Also the discharge spike seems to behaves better. So maybe I should shift focus to that one.

author: HendriXML
author_rank: Super Contributor
timestamp: January 09, 2021, 04:13:41 pm
content: Found a nice video on driving power mosfets:https://youtu.be/of_v2N5f788

author: HendriXML
author_rank: Super Contributor
timestamp: January 09, 2021, 09:12:35 pm
content: I now used the discharge wave to calculate the energy transfer at each sample. The summed energy was then used to calculate the inductance.Which should be around:46,5 uHThen I simulated the discharge curve using that inductance to compare the real vs simu (ideal).I'm pleased with the result! This can very much be used to calculate inductances of (large) inductors and in a way that matches the application of energy transfer.When using that inductor value, the charge simulation also matches quite nicely with the charging wave.Using the discharge curve has the benefit of an energy calculation V*I*dt when they're both high, and when they're both low. So the values near ground (wich seem a bit off) are not that influential.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: January 10, 2021, 12:41:09 am
content: Could you post your data series (e.g., Excel, CSV would be fine)?Tim

author: HendriXML
author_rank: Super Contributor
timestamp: January 10, 2021, 01:03:23 am
content: I have got a xml file. It's what I load into Excel.Made a how to import over here:https://github.com/HendriXML/XMLScripts-Project-WaveCapture/wiki/Making-a-Excel-graph-step-by-stepI can also produce a csv file, but that'll have to wait until tomorrow.

author: HendriXML
author_rank: Super Contributor
timestamp: January 10, 2021, 01:14:34 pm
content: I converted the xml files to csv files.I'll try to curve fit the discharge one in Maxima.

author: HendriXML
author_rank: Super Contributor
timestamp: January 10, 2021, 02:24:25 pm
content: When fitting the discharge curve, Maxima takes:49.04105718614097 uH as the best matchHowever, maxima doesn't know the voltage near gnd are less influential energy wise. In my opinion thus not a better fit..

author: T3sl4co1l
author_rank: Super Contributor
timestamp: January 10, 2021, 02:40:02 pm
content: Interesting, it definitely drops faster at the outset than later.What kind of inductor is it?Tim

author: HendriXML
author_rank: Super Contributor
timestamp: January 10, 2021, 03:39:17 pm
content: One inductor has a ferrite core cylinder style and the newly calculated "larger" one probably also, but ring style.This inductor which I used in the circuit and will continue to use is now measured, it's calculated inductance is around 275 uH

author: HendriXML
author_rank: Super Contributor
timestamp: January 11, 2021, 12:41:48 pm
content: Previously I did a function fit with discharge voltage. But that won't weigh voltages related to energy.So each sample got its calculated instantaneous power and I fitted that data set to the instantaneous power function.With my method of summing the instantaneous power of each sample * time, I got a inductance of: 46,5 uHThe function fitting results in: 46.835 uHThe diagrams speak for them selve. I also really like the vector output in pdf format. For this reason I will drop Excel as my primary the tool to make graphs.

author: HendriXML
author_rank: Super Contributor
timestamp: January 13, 2021, 03:05:20 pm
content: I went sketching around the voltage booster circuit. I used concepts on Android, wich needs to mature some more to be really handy. (Things like grid support).The first thing I added was the energy transfer. When doing calculations this would be most important.Another this I added to the sketch was a stare diagram of 6 states of sinking/sourcing the gate of the power mosfet.I separated hard (low Z) / soft (high Z) driving. And then I mapped the transition conditions to voltages that can be sensed. Each transition should latch some of the driving transistors.For me this is not an example of a successful attempt, but rather an example of how this approach can end up requiring a lot of components. Such an approach might turn out to be better when designing an IC.Also it might be though to get the conditions reliable (input offsets comparators). Also the cycles should be self starting and suspendable. (Haven't got that one figured out yet)In "software design" this all could be implemented in less time than it took to draw. In electronics design there're a lot of caveats and real world limitations.Also every extra component one needs, comes with a cost.. Writing some lines of code extra doesn't.At least I've got a better understanding of how feasible this approach is/was. The method of charging the inductor this way also adds neg spikes/noise to the supply voltage.. I think that was mentioned..

author: T3sl4co1l
author_rank: Super Contributor
timestamp: January 13, 2021, 03:39:28 pm
content: Hm, what purpose does the soft gate drive serve? It's not clear what the timing is supposed to be, if that's all supposed to happen during commutation, or spread out during a full switching cycle?(Also, your PMOS are backwards!)Offhand, there are very few applications for that. The first that comes to mind, is large industrial drives, to implement fault protection. Namely, with say a 1200V 600A IGBT, in the event that short-circuit current should happen to flow, load current rises rapidly, towards a peak of say 4kA. If this were turned off at the normal rate (of gate drive current, and resulting output dI/dt), the peak voltage would destroy the transistor (IGBTs are less robust to avalanche breakdown, than MOSFETs are). So, often a protection circuit monitors either load current or transistor voltage drop, and when a limit is exceeded while the gate voltage is high, gate drive is disabled, and a slower turn-off transistor is enabled. Switching loss is quite high of course (maybe the ~4kA decays over a microsecond), but it's a one-time event, after which the control receives the fault signal and disables operation immediately.Arguably, RF amps and drives might be similar in a way, but their drives are usually furnished by a matching network, and anyway, for some applications, the gradually-changing gate voltage is still detrimental, there's just no better way to do it (e.g. class E amplifiers at 100s MHz, or GHz for that matter).You may find a similar approach is more convenient for switching circuits, too. For example, a ferrite bead instead of a series gate resistor, furnishes the same RF resistance required to suppress oscillation, and dampens the rise/fall waveform, but also saturates during large peak currents so that the bulk of the edge is not slowed, only delayed (and this delay really only amounts to a ns or a few, most of the time).Or a R || (R+D) network, which allows asymmetrical rise and fall times.Tim

author: HendriXML
author_rank: Super Contributor
timestamp: January 13, 2021, 04:47:38 pm
content: Quote from: T3sl4co1l on January 13, 2021, 03:39:28 pmThe timer was added to:Separate things from happening at the same time.Control max frequency.And maybe start/stop the cycles.However I didn't figured that out yet. Also some conditions could be dropped if another condition is always later, such as a timed "event" vs discharge of conductor.The soft gate driving was added to ensure the state of the gate of the power mosfet, before "hard" driving it the opposite way (without much cross conduction).Something a mosfet driver normally handles. But I was wondering if it could be part of the cycle.The benefit would be loosing effect of the ds-capacitance of the opposing driver mosfet.(Edit: the hard driving mosfets still have ds-capacitance) Using bipolar transistors might not fully close the mosfet, I would need to test that. From what I know is higher gate voltage is lower Rds, even above threshold.However this 2x2 driving adds extra states to the cycle, which also need "transition conditions" making it more complex. But its not the design complexity that holds me back, but rather the implementation (and reliability).

author: T3sl4co1l
author_rank: Super Contributor
timestamp: January 13, 2021, 05:37:11 pm
content: Just concentrate on making a stable and reliable loop.Your basic peak current mode is:State 0: Gate low.State 1: Gate high.0 --> 1: triggered by independent clock oscillator, or timer.1 --> 0: triggered by switch current exceeding the threshold.Only need one flip-flop to count this out.If timed, timer is started by current threshold. If independent, you can still model it as a timer, which just restarts itself by the same 0-1 trigger.Typical hardware implementation would be a clock trigger pulse which is very short, into an R-S flip-flop; or a normal width pulse that clocks a D-type flip-flop with D = 1, PRE = 0, and RST = current threshold.(If we wished to add incremental steps to describe the switching events themselves, we could; but we learn nothing, because there's no input to interrupt such an event, they always transition immediately from one to the next state. It'd be a trivial expansion.)This, is so simple it's almost trivial. The actual interesting stuff happens in the analog domain. Which, is continuous state, not easily represented by an FSM diagram, so I won't attempt to create one... We can model it as a system of difference equations (with equivalence to reality as dt --> 0) and play around with it easily enough in the DSP (discrete time) domain, but it's not necessary to do so. (It would, of course, if we were doing a full digital control.) (Such LTI networks are easily solved in closed form, and we usually approach it from the frequency domain, where the system manifests as a rational polynomial.)Tim

author: HendriXML
author_rank: Super Contributor
timestamp: January 13, 2021, 09:15:18 pm
content: I'll have to give it some thought.Meanwhile I calculated the awg's internal resistor to the highest accuracy (with accuracy indication) I can manage.I also remeasured the discharge curve, but now using 7 volts. This way I could set the scope to 2V/div and have a bit more resoltution.The voltages where also validated and near enough, soo I think its the best measurement of inductance I can produce.Will clean the Maxima code some bit and post it as well.Measured valuesohmInductor :73,50 mΩ ± 200 μΩohmWireAndDmm1A :212,50 mΩ ± 200 μΩohmSingleWire :25,30 mΩ ± 200 μΩampLoadcurrent :99,22 mA ± 100 μAvoltSupply :4,99364 V ± 200 μVintermediateohmTotalResistance :50,33 Ω ± 50 mΩprovidesohmInternalResistance :50,09 Ω ± 50 mΩohmInductorLoadResistance :50,16 Ω ± 50 mΩ

author: HendriXML
author_rank: Super Contributor
timestamp: January 13, 2021, 09:38:23 pm
content: The measured/calculated value new style is:By energy summing: 305.77 uHFunction fit: 298.66 uHI attached the datafile + wxMaxima script in a zip file. I had to figure some stuff out which might benefit others as well.wxMaxima can be dowloaded at:https://sourceforge.net/projects/maxima/

author: T3sl4co1l
author_rank: Super Contributor
timestamp: January 14, 2021, 06:51:24 am
content: Looks pretty linear.

author: HendriXML
author_rank: Super Contributor
timestamp: January 14, 2021, 01:08:17 pm
content: I think I may have found a way a traversing states in a reliable way. I know it will become somewhat of a monstrosity. But at least going through the design fase would be a good learning experience. Basically it would be a time based cycle like a 555 does, but with logic to speed some fases up. The idea is to pull down voltage dividers which discharge the timing capacitor to a certain voltage using a diode. This will bring the cycle rapidly through the next fases.The sensing of a discharged inductor will not force the timer voltage, but speed it up. So that the final fases are always processed, but more rapidly.

author: HendriXML
author_rank: Super Contributor
timestamp: January 14, 2021, 01:19:29 pm
content: Quote from: T3sl4co1l on January 14, 2021, 06:51:24 amThis zoom in will give a better view.

author: HendriXML
author_rank: Super Contributor
timestamp: January 14, 2021, 02:26:40 pm
content: I've thought some more about the differences between software system and electronic system design.In software when you read a certain value / state one gets a copy of that state (referenced stuff aside). In (analog) electronics some value / state is most likely changing. Thus changing the decisions that where based on it as well. If one doesn't like that, a state needs to be saved in something like a capacitor or flip-flop.In software this difference could be mimicked by using a (root) event handler. Getting the values/states of a certain moment. This handler would "be stateless", when something from a previous event is needed to make a decision, some state would need to be saved. This is off course easily done in a global variable. However for mimicking the behavior it would good to pass that saved state, along with the other values/states through another handler.I'm not sure yet, but I think I could "model" the monstrosity I came up this way. It doesn't need to actually simulate the circuit, its more about modeling component's and interactions.As a software developer I made my share of diagrams and stuff, but most of the time just by starting coding the solution would unfold by itself.So that would be one reason for this exercise, the other would be to experience the differences/similarities between electronics design and software design.

author: HendriXML
author_rank: Super Contributor
timestamp: January 14, 2021, 08:57:53 pm
content: Did some drawing on the monstrosity circuitUsing this I'll try to fill in the gap between the "triggers" and controlling the 4 driver mosfets using the mentioned coding.I've not really used logic IC's before, so I'm wondering how much of them would be needed.In that process things like how a reset would actually function should come to light as well.

author: HendriXML
author_rank: Super Contributor
timestamp: January 15, 2021, 02:22:09 pm
content: I had a play around with modelling the circuit in Delphi/Pascal, without filling the gaps.For me the modelling has benefits:Things get identifiers, which are "spell checked", in other documents one could refer to themIts easy to add commentsThe document in the IDE is navigatableThere's usable type checking, syntax highlightingDifference between "static, stateless, statefull" can be expressedLogic and interactions can be expressedLogic can be tested running the programDoes it modell every thing? No, but that's the case with a lot of modelling techniques.So next step would be filling in the gaps (line 80). One thing that needs modelling too, is the reset of the ramp and the effect it has on the logic side.(Some resetting indication needs to be introduced.)

author: HendriXML
author_rank: Super Contributor
timestamp: January 15, 2021, 02:51:35 pm
content: I added the logic needed to control the driving mosfets.The used boolean expressions can be implemented by logic gates. Before resetting the ramp an IsResetting signal should be "implemented", which could be unset when the rampvoltage is at its highest level again.I don't think the circuit is self starting yet. Which I think can be solved by converting it to a ramp up instead of down.

author: HendriXML
author_rank: Super Contributor
timestamp: January 15, 2021, 11:31:55 pm
content: One reason to have a ramp down was the ability to set the timer cap voltage to a certain value, speeding up the traversing of states.Using a pull down resistors and a diode wasn't really a fancy option, but with a ramp up, things got even less fancy.The constant current for the ramp will be done using an opamp with some reference voltage. So one way to speed up the traversing of states would be to implement a way to switch to a larger constant current, speeding up the timings a lot.The stopping this "speed up" could be done by using the output of the triggers and digital logic.The circuit would be designed to function without speed ups, but because of "margins" that need to be taken it would not be able to transfer maximum power.I'm starting to like this monstrosityIt may not be the best way to design a boost converter, but it gives plenty of opportunity to investigate and trouble shoot parts of it and learn from it.Also for the sake of self education I'm not designing for low power consumption anymore.

author: HendriXML
author_rank: Super Contributor
timestamp: January 17, 2021, 04:48:12 pm
content: The circuit needs a 2 speed constant current source to charge a capacitor (resulting in a 2 speed ramp, wich needs to be resettable.I think the attached circuit will do this task.

author: HendriXML
author_rank: Super Contributor
timestamp: January 18, 2021, 02:39:59 pm
content: Calculated the component values and also needed to improve the circuit to have a larger range in which the ramp is regulated well (92 mV - 3.5 V).I think I'll build this circuit and test its behavior using 2 channels of an awg. I would like to know how fast the actual speedup reacts to the request of it (delay times).Going fast the ramp is about 10x steeper.

author: HendriXML
author_rank: Super Contributor
timestamp: January 18, 2021, 11:01:57 pm
content: I think the previous circuit could get stuck in the state where the output of U202A would stay at gnd.So I converted it to a situation where there's alwas some pull at the capacitor, so that the current mirror can regulate.I had to choose the voltage divider R205/R207 in such way that the pull up transistor Q201 would not conduct at the max output level of the LM358 (VCC - 2V). But also conduct when needed.That got me wondering can't the LM358 go higher (HighZ state?) when it doesn't need to sink that much?

author: HendriXML
author_rank: Super Contributor
timestamp: January 18, 2021, 11:11:23 pm
content: I think the datasheet graph below answers my question. In the posted circuit VCC - 1.3V could be taken just as well.