Comparator circuit seems to be oscillating (well, pulsing, really).  Solutions? - Page 1
Forum section: electronics / beginners

author: mindcrime
author_rank: Unknown
timestamp: July 21, 2022, 01:36:06 am
content: Hey gang, first of all, apologies for not providing a schematic. I am (again) hoping somebody will recognize this general situation just from a description and have some suggestions. I'd post the schematic if I had one drawn up, but I don't yet, and I'm honestly still struggling to find a good schematic drawing package that I like and that I can learn to use effectively. But if nobody can help until I post a schematic, I'll find a way to get one up one way or another.All of that said, here's what I'm dealing with:I have a circuit that uses a TL431 to establish a reference voltage. I then take a signal off of a power rail and compare it to that reference voltage using an LM393 comparator. When the power rail is higher than REF, I know the rail is ready to use, so I take the HIGH signal from the comparator output, AND it together with another signal (that signal comes from "off board", a separate sub-system entirely) that has to be HIGH to switch to this rail, and use that AND gate output as the input to a MOSFET gate driver IC. Said gate driver is taking 10V from a charge pump voltage doubler and sending its output to the gate of an N-Channel MOSFET that is working as a high-side switch, controlling a load that - when this MOSFET is on - is powered by the rail that I'm inspecting with the comparator. The basic idea is, when switching power sources, not to switch to this source until it's "ready enough" to serve the load.The flip side of this is that the HIGH signal sent to that gate driver IC is also sent to an inverter, and the output from that is then sent to the gate of a different MOSFET which switches the other power rail. The whole idea is to have one rail or the other, but not both, serving the load at any given time. Also, just for the sake of completeness, when I say "MOSFET" here I really mean "a pair of MOSFETS connected back to back and with their gates tied together". The idea there is to prevent reverse current flow between the rails, without using a diode and paying the associated forward voltage drop cost.OK, so this all basically works. The switching back and forth is, in and of itself, just fine. But what appears to be happening is that there's a feedback loop between the rail and the component that's monitoring the rail, and so it pulses ever so slightly. That is, when the comparator goes HIGH it enables the rail, which attaches the load, which causes the rail voltage to dip every so slightly... which in turn causes the output from the comparator to change, which changes the voltage going to the gate, which affects the output, and so on and on and on.I don't have a differential probe (yet, one should arrive tomorrow) so I haven't gotten a real clean look at this on the scope, but using the MATH function and the A-B mode, I was able to see relatively clearly that this channel does have some pulsing action going on which seems consistent with my theory. And in the end, while the signal is clean enough that when piping this into my programmable load, you don't really see the pulsing, a Raspberry Pi connected to this output won't boot.Wondering if anyone has any good suggestions for eliminating this? The first ideas that come to my mind include:1. Add a small buffer capacitor on either the comparator output, or input, or maybe even both, to stabilize things.2. Find a different gate driver IC that has a more binary action, if such a thing exists.3. Use an optocoupler and make the input to the gate driver come from the other rail (which is always on and available, except in a pathological case) and use the output of the comparator to turn the optocoupler on and off. As opposed to sending the signal from the comparator straight to the gate driver input.4. Other?5. Profit!Appreciate any thoughts anyone is willing to share. And again, if need be, I'll find some way to cobble together a schematic. Hell, worst case, I'll draw it by hand and take a picture of the page.

author: Ian.M
author_rank: Super Contributor
timestamp: July 21, 2022, 01:59:48 am
content: A picture is worth a thousand words, and as you only used some six hundred of them, yes we *DO* need to see a schematic, and preferably also an over-all block diagram of the system you are trying to build, in case your idea of how you can make it work has you barking up the wrong tree.There's nothing wrong with hand drawn schematics as long as you use a dark pen or properly sharpened 2B pencil on good quality light colored or better pure white paper, and either scan it (vastly preferred) or photo it withextremecare to avoid camera shake and poor focus, get good even lighting, avoiding shadowing, and getting the center of the lens in line with the center of the diagram, normal to its plane to avoid geometric distortions.However learning an electronics CAD package is a big step up in your capabilities, opening the way to SPICE simulation and to cheap PCBs from China. Once you've learned one schematic editor properly, adapting to any other GUI based one is fairly easy as you know what to expect of it.Its very common for a comparator to glitch like that if its output even slightly affects one of it inputs. You probably need to add hysteresis which widens the gap between its rising switching threshold and its falling one, so it will tolerate some voltage droop of the rail its monitoring before switching back. The usual way to do this is by adding a carefully controlled amount of positive feedback.However I suspect that we'll end up directing you towards a dual ideal diode controller designed for power ORing applications, as they generally have the 'smarts' to avoid such load induced oscillation.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: July 21, 2022, 02:41:03 am
content: Just skimming here, but it sounds like you may've fallen victim to the procedural thought experiment trap; that is: the thing should do this, and that causes that, and so on, in exactly such order, and then it's done; but you've forgotten to continue and also consider what happens in the opposite of each of those cases, or what's consequent following the sequence (what's been set in motion, that you want to stop in the middle of, but don't actually stop on anything!).Like for example, I would say it's a fairly common case, that someone wants to use a comparator and driver as a current limiter; sounds great right, current exceeds threshold, comparator senses it, output turns off, what could be better! But wait... now it's off, right? So current is zero, right? So the comparator turns back on... RIGHT?! Yeah... that kind of thing.The most common missing block is just something to maintain state. A flip-flop, that latches the fault state, and stays there forever until reset. Well, maybe you didn't actually want forever, maybe you want it to reset automatically (a timer); well, now that you've got this block in there, these questions come up pretty automatically. You put the thing in, and what does it do, oh right yeah, let's do something about that, etc. So it works once you break through that little mental barrier, and see a few more aspects of the entire system you're building.Mind, not being rude/pejorative/patronizing -- merely speaking from experience. I find I do it a lot myself, when I'm trying to reason through some system that's new to me. Asking these sorts of questions can help break through; or just thinking about it from enough angles, take your time (a few days, weeks?), eventually the synthesis occurs subconsciously, and suddenly you can reason about it as a whole system.Tim

author: mindcrime
author_rank: Unknown
timestamp: July 21, 2022, 02:52:28 am
content: Quote from: T3sl4co1l on July 21, 2022, 02:41:03 amI don't take that as rude or patronizing at all. What you describe has been a constant cycle for me over the last couple of months. I just don't have the experience yet to see in my head all of the interdependencies and cascading effects and what-not, that come into play with something like this. Of course a lot of that is just general lack of knowledge about how certain things work, and then going off and reading a datasheet, or Googling for something, or asking here or on electronics.se, and getting one step further down the path, only to run into the next weird glitch.And while that is frustrating, this has been an amazing learning experience (which is about 50% of the point of this whole exercise). I think I might have said this before, but I've been involved in hobby electronics to some degree for nigh on 40 years now (albeit not continuously). And I may have learned more in the last 4 months than I did in the preceding 39 point whatever years. But that's the way I like to learn: take on a project that is frankly beyond my current understanding / knowledge / skill level and force myself to level up as I go. That approach is how I've managed to stay gainfully employed as a software developer for the last 22 years or so at least.I just wish in hindsight that I'd gone with my original idea of doing a double major in CS and EE back when I was in college all those years ago.

author: Terry Bites
author_rank: Super Contributor
timestamp: July 21, 2022, 03:18:45 pm
content: So a power good check- without seeing the schematic its not possible to say much about your circuit.There are few candidates: A lack of comparator hysteresis, poor decoupling and wiring.Do you really need a gate driver for a mosfet on off switch? The time it spends in the linear region is short, no?You can use the TL431 as both the ref and as the comparator. See attached.

author: mindcrime
author_rank: Unknown
timestamp: July 21, 2022, 09:42:16 pm
content: Quote from: Terry Bites on July 21, 2022, 03:18:45 pmI currently have no hysteresis on the comparator at all, so that is very likely a big part of the problem. I did some reading at work today and it sounds like that would absolutely be needed for what I'm trying to do, which is to effectively turn an analog signal into a digital signal. If I'm following this right, what I'm basically trying to build is a Schmitt Trigger. So I'll be doing some more research on that point and looking at adding the necessary hysteresis.I also got my differential probe in the mail today, so hopefully that will make it a little easier to visualize what's happening on the scope.The gate driver is there because I'm using an N-Channel MOSFET as a high-side switch. The overall system runs at 5V, so I need a higher gate voltage to turn the FET on, IIUC. Hence the charge pump and the gate driver (the gate drivers I had on hand were the kind that don't have their own internal charge pump, if you're wondering why I'm using two components for that).I'm about 1/3'rd of the way through drawing the schematic, so I'll upload that once I have it all ready. This is a very tedious process, but it will be nice to finally have this properly documented. I'll do a block diagram as well, to reflect the overall system design.It also occurred to me that, since the output from the comparator goes to one input of a 7408 AND gate that it might help if I switched to a 7408 with Schmitt Trigger inputs. The one I'm using now is not of that type, but I think I have some of those lying around here somewhere. If not, if anyone thinks that would be better for what I'm doing, I'll order up some.Thanks to everybody who has chimed in so far. Your help is greatly appreciated.

author: tggzzz
author_rank: Super Contributor
timestamp: July 21, 2022, 10:03:18 pm
content: How can we see what you've missed out in your circuit and description if we can't see the circuit?You will learn a lot about your circuit by being forced to state it in the form of a schematic.So will we.Then implementation of the schematic can introduce failures. Hence we need to see the implementation. Fortunately that is trivial nowadays.General points....Decoupling.Switching currents in PSU leads, especially 0V.Solderless breadboards: spend your life debugging the board rather than you circuit.Implement and test one part of the circuit at a time, not the whole lot at once.

author: mindcrime
author_rank: Unknown
timestamp: July 22, 2022, 01:30:47 am
content: OK gang, still working on that schematic. I probably have it halfway drawn now, usingQElectroTechas my drawing package. I should have it ready by sometime this weekend.In the meantime... I did some experimenting with the circuit and with my newMicsig DP10007differential probe. I started out by using the new probe to view the output signal that was causing the problem, and it made it a lot easier to see the pulsing behavior and the weird jaggies associated with it. Having that makes me feel a lot more confident that I'll be able to tell when the problem is fixed, without having to connect a live load to the device, where said "live load" is a moderately valuable Raspberry Pi. I documented inanother threadthe lesson I learned about connecting valuable equipment to sketchy developmental power related circuitry! So trying not to make that mistake again.After establishing that I could view the signal, I made one small tweak to my circuit - adding a 10M resistor for hysteresis between the output of the LM393 and the non-inverting input. Why 10M? Honestly, I don't know how you calculate that value. If anybody can tell me, I'd appreciate it. As it happens, thedatasheetdoesn't seem to have any explanation of how you arrive at a particular value for that. But their sample circuit diagram showed using 10M, so I figured "WTF, might as well start with that and see what happens." That did seem to help a little, but definitely was not "the fix." Probably 10M is not the right value to use there, but I'm pretty lost as to how to figure out the right value, other than trial and error.After that, I made the change of swapping the 7408 AND gate that receives the signal from the comparator from a 74LS08 to a 74HCT08, where the latter has Schmitt Trigger inputs. Andthatwas a "night and day" difference. Viewing the signal on the scope after making that change, all of the pulsing and jaggies went away completely. The signal now looks just like what it does when the battery rail is the one that is live (that rail doesn't go through any of this comparator stuff, because it's just always on).Now that is probably an example of papering over the underlying problem, even if it "works". I didn't connect the Pi and test yet because it was getting late, but even if the Pi boots now, this feels like a band-aid to some extent. I feel like I need to continue learning more about the comparator circuit and hysteresis and what-not, until I know how to make that output actually stable. That said,ifthis works, it would make me happy if I could use this board this way as a stop-gap while I continue to learn and iterate on improving it.One last thing: I can't say enough about how much that new probe helped. For anybody who is working without a differential probe, consider one of those little Micsig jobbies (or something similar). They aren't too crazy expensive and it really helps when viewing signals like this that aren't ground referenced. And no, I don't work for Micsig or have any financial stake or interest in them or their products. I'm just a happy customer.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: July 22, 2022, 02:43:37 am
content: https://www.daycounter.com/Calculators/Comparator-Hysteresis-Calculator.phtmlIt's not about the chip, it's dumb, it just does what it says. It's what you put around it that matters.Tim

author: mindcrime
author_rank: Unknown
timestamp: July 23, 2022, 12:32:11 am
content: Hey gang, a couple of notes:1. I'm still working on that schematic. Getting close on it now. Will definitely have it ready by sometime over the weekend.2. With the changes I made last night, my board is now functional!Now I'm sure the design is still not optimal, and probably any real EE would look at it and laugh their arse off. But as of right this minute, it actually serves the desired purpose. I can connect a Raspberry Pi to the output, connect a USB "powerbank" style battery pack to input 1, connect a USB charger to input 2, and it will switch back and forth between the battery and the charger as the charger is plugged in or unplugged, and the Pi never sees enough of an interruption to trigger a reboot.The only noticeable issue is that the Pi will occasionally emit an undervoltage warning. The voltage drop through my board with the Pi running appears to be about 40 millivolts, so I suspect most of that is down to the connectors I used, having wires that are too long (I'm working on shortening up a lot of that stuff now), perhaps a low quality USB-C cable that is the last hop to the Pi, etc. Now that the basics are working, I'm going to start looking at improving all of that. The output cable is probably too long and most of it's length is the remnants of an el-cheapo USB cable that I cut one end off of. So I can get rid of that and use better and shorter wire and that alone will probably help a bit. I bought board mount USB-A connectors, so the next iteration of this board will actually put the USB-A output connection right on the board, instead of using a cut off piece of a USB extension cable.Anyway... thanks again for all the help and advice. And I will still post the schematic, because I still want to learn more and I'd appreciate feedback on what I could do different / better on this, even though I have something that is "working".

author: MrAl
author_rank: Super Contributor
timestamp: July 23, 2022, 02:53:15 am
content: Hello there,This is a common problem and from your description i can see it is very common.The problem is that when the load turns on the drive decreases because the load pulls down the power rail and the drive depends on the power rail voltage.The most common solution is to decouple the power rail from the driver circuit power rail. The simplest implementation is a small value resistor and a somewhat large value capacitor with low ESR. The resistor goes in series with the cap, and instead of taking the drive power from the main rail you take the power from across this new capacitor. This RC circuit behaves as a low pass filter and so as the load pulses the drive power rail stays much more constant.In more severe cases you might use an inductor and capacitor as a low pass filter instead of an RC low pass filter. That offers a 2nd order filtering response which is better than the first order RC. The RC may in fact be enough though if the capacitor is larger enough. You cant make the resistor too high in value though because the driver has to have enough average power to work right. A tiny bit of experimenting will get you there, or you could publish your pulse timing and we can calculate values for R and C that will allow this to work on the first try.In case you solved this in another way that's ok, this is a general approach that works in probably every case if done right.

author: mindcrime
author_rank: Unknown
timestamp: July 24, 2022, 03:57:00 am
content: Quote from: tggzzz on July 21, 2022, 10:03:18 pmCase in point. I am very close to finishing the schematic, but just realized that I appear to have completely mis-wired the TL431 voltage reference chip. The board is packaged up in the case right now so I can't easily reference it, but looking at the pictures I took, it seems like I glanced at the datasheet, saw the pinout for the SC-70 package, and used that instead of the pinout for the DIP-8 package. Which is all the more amazing when you realize that those packages don't even have the same number of pins!Apparently it is pure happenstance that the output from this version was able to be dialed in to the voltage I wanted anyway.sighI guess I'll go ahead and finish the schematic as it was intended to be, and solicit feedback from you all based on that, and then fix the physical board later. Since I may even wind up changing the entire design based on the feedback I get here, I guess that's the most straightforward way to go for now.Despite the errors in this though, it does actually work quite well now. I finished assembling everything earlier today, unplugged the AC mains cord, put the thing in my car, drove to Barnes & Noble, plugged it back in, and the Pi never rebooted or had any glitches. That's exactly the scenario I wanted to support. Heck, I even had the hubris to do a "live demo" of the switching stuff with a friend of mine watching over my shoulder once I got to B&N, and - miracle of miracles - the Live Demo Gods didnotchoose to smite me! The way I look at it, you can't really say something "works" until it works with somebody else watching in real-time.

author: mindcrime
author_rank: Unknown
timestamp: July 24, 2022, 04:51:43 am
content: OK, technically this is still a WIP, but I think it's complete enough to convey the basic idea of what's going on. The only things missing (that I know of) are three resistors, a 330 ohm resistor on the Vcc connection for IC1, and 1 220 ohm on each of the two inputs to IC1 that are used. Those are all just there to help avoid latchup. Also in the name of brevity (eg, I'm lazy) I left out the supporting components for the charge pump IC (a capacitor and a couple of diodes). The charge pump works fine, so I don't think that omission will hurt too much. I can add those in the next version though. I just wanted to get something out for now that included the core essence of the thing.EDIT: there is one other omission. I forgot that new 10M resistor I added for hysteresis on the LM393. That was a late addition and it totally slipped my mind until just now. I'll add that in as well in a subsequent version.EDIT: just found another mistake (in the diagram, not the actual board). The inputs to IC4 and IC5 are swapped around. IC4 is controlling Q1/Q2 for Vbat and so it takes the inverted signal from the AND gate and IC5 takes the normal signal. Another thing I'll fix shortly and then republish an updated version.The other glaring mistake that I hope you all will indulge me and ignore is this: I dropped the IC symbols on up-side down. So please ignore the little dot for now and assume that in each case pin 1 is in the lower left hand corner (eg, the chips are aligned as though the shown text were physically marked on the chip). I'll fix that later.As noted above, the actual board has the TL431 wired wrong, so that will also get fixed in subsequent revision.I'll do a system block diagram as well, but here's the basic description of what's going on:1. Voltage source Vbat represents a USB "Power bank" battery that is assumed to always be present (except for the pathological case where the battery dies).2. Voltage source Vmains represents a standard USB charger. Right now I'm using a 60W RAVPower charger.3. The two pairs of N-Channel MOSFETS (Q1/Q2 and Q3/Q4) each control connecting / disconnecting one or the other of Vbat or Vmains to the load (shown as the "Output" connector in the schematic. What will be connected there is a Raspberry Pi). The pairs of MOSFETS are connected Source to Source and the Gates of each pair are bonded together so they turn on or off together.4. Most of what's left relates to the switching logic. IC1 is an AND gate that takes two inputs and sends a HIGH signal when both are true. Those two condition are: (1) the Vmains voltage is greater than about 4.9, and (b) a separate signal coming from another power supply connected to the same AC plug is HIGH. When both of these conditions are true, Q3/Q4 are ON and the charger is powering the Pi. Otherwise, Q3 and Q4 are OFF.5. The signal from the AND gate is also fed to an inverter, and the inverted version of the signal controls the other pair of MOSFETS (Q1/Q2). The net result is that either Q1/Q2 are ON and Q3/Q4 are OFF, or the other way around. So one source or the other is powering the load at any given time.6. The "extra" signal thing is kinda weird and I think I can eliminate it now. It's a legacy of an earlier stage of development of this when I was having trouble dealing with the "soft" shutdown characteristic of the USB charger. I needed a way to know *immediately* when the charger was starting to go away, so I could switch to the battery fast enough to avoid causing the Pi to reboot. At the time I experimented the the whole TL431/LM393 "edge detection" stuff and actually had that working, but decided it was simpler to use another power supply. I know, I know, that doesn't sound right. Again, legacy stuff. The case I'm using for this project is a gutted out 90's era boombox and when I gutted it, I actually left all their power supply circuitry hanging around. So to use that power supply, all I had to do was splice it back into the AC cord and bring a wire from the DC output of their board, to my board. That signal disappears immediately when you yank the mains cord out of the wall, and so gives me the fast switching I need when going from Vmains -> Vbat.But as you can see, I added the "edge detection" stuff back in anyway. That turns out to be for the opposite reason.. to deal with the "soft start" nature of the USB charger. Without something like that, the AND gate would go high and disconnect the battery before the charger was ready and it would cause the Pi to reboot. I left the hybrid version since I already had so much of that stuff in place. But in a future version of the board, I think I can just use the comparator based approach for both transition conditions, and rip out all of the associated components (like the LM338, which is there to regulate that incoming DC signal down to 5V). That would also let me get rid of the AND gate since there would only be one condition to switch on. At least I think that's the case. I need to sketch things out on paper and think through that some more.7. There's 50,000uf worth of capacitance across the output to act as a reservoir to buffer the switching time. I arrived at that value through empirical observation (eg, trial and error) during an earlier phase of this and I suspect I'll be able to drop that value down.8. As noted above, the only reason for the charge pump IC is because the gate drivers I had handy are not the kind with an integrated charge pump. And I need a higher voltage to drive the MOSFET gates since I'm using N-Channel MOSFETS as a high-side switch. I could switch to different gate drivers and get rid of that charge pump, I think.

author: mindcrime
author_rank: Unknown
timestamp: July 24, 2022, 05:10:04 am
content: And for those who just really like pictures:The "edge detection" stuff is on a daughter-board since it was added late and I was basically out of room on the main board anyway.I screwed up and put those MOSFETS too close together, so I threw a sheet of rubber taken from an old inner tube in between them as an insulator. That will also get fixed in a subsequent rev of the board.This old boom box houses things. This isn't fully assembled of course. Those capacitors have since been moved to the battery compartment of the former boom box, and some other small tweaks made with a Dremel tool to allow everything to fit inside. That said, shrinking the size of this board is still a desirable goal since I have other stuff that eventually needs to fit in here.

author: Ian.M
author_rank: Super Contributor
timestamp: July 24, 2022, 05:34:28 am
content: That's a wiring diagram, not a schematic. The difference is a schematic uses symbols to represent the internal function of each IC, and is drawn with stuff rearranged (but not re-connected) for clarity, preferably (by convention) to maintain a left to right signal flow and to show voltage rails most positive at the top, most negative at the bottom. Sometimes you have to ignore the convention and locally reverse the signal flow. A wiring diagram however shows you the interconnects you need to make and the layout of the terminals they go to.Although its *possible* to turn a wiring diagram back into a schematic so it can be comprehended, its a *LOT* of work to do so, looking up pinouts in datasheets, and redrafting it completely. and I and many others certainly wont bother unless we are being paid our $$$ consulting rates to do so, (min. half day), so its probably the worst format to present your circuit in when seeking free advice on these or other fora.

author: tggzzz
author_rank: Super Contributor
timestamp: July 24, 2022, 01:36:10 pm
content: Quote from: Ian.M on July 24, 2022, 05:34:28 amBeat me to it.The othermajorfeature of a schematic is that it shows thenamesof the pins, not thenumbers.For example, IC4 has pins 4 and 5 wired together. I have no idea whether that is sensible, and I'm not going to waste my little remaining life digging out a datasheet and comparing it with the layout.QuoteAgreed.In addition previously I made four points without having seen the schematic or implementation. Having seen that, I'd still make three of them...Decoupling.Switching currents in PSU leads, especially 0V.Solderless breadboards: spend your life debugging the board rather than you circuit.Implement and test one part of the circuit at a time, not the whole lot at once.

author: ledtester
author_rank: Super Contributor
timestamp: July 24, 2022, 01:38:46 pm
content: I have to agree with Ian.M comments about a wiring diagram vs. schematic. In fact, the first thing I would do if I were to analyze the design is to draw out a schematic from your diagram.One thing I noticed is that you have placed Q1 and Q2 in series (and likewise for Q3/Q4). It would seem more logical to put them in parallel to combine their current drive. Or perhaps this is just a mistake in your diagram? Or maybe you have them back-to-back?

author: mindcrime
author_rank: Unknown
timestamp: July 24, 2022, 02:45:04 pm
content: Thanks guys! I am still a little fuzzy on the details of the distinction between a wiring diagram versus a schematic, but I'll continue to research the topic. One obvious question that comes to mind though, based on one of comment about how a schematic contains symbols that represent the internal function of IC's: I can see that you could use, for example, an AND gate symbol for the 7408 and an inverter symbol for the 7404, etc. But I can't imagine that there are unique symbols for every IC out there, and I have no idea what representation you would use for something like the MAX1044 charge pump or the TC4422 gate driver, etc. How exactly is that handled in a proper schematic?Quote from: ledtester on July 24, 2022, 01:38:46 pmThey are back to back. It's hard to tell here since QElectroTech doesn't seem to have distinct symbols for N-Channel and P-Channel MOSFET's. It could only find the one generic MOSFET symbol.One thing I can already see is that I won't be using that program for my next stab at a schematic. Probably I'll try switching to KiCad. I had mentally pigeon-holed it as just being for PCB design, but some Googling showed that it supports making schematics as well (which makes sense, given how closely related those two things are, now that I think about it).Quote from: tggzzz on July 24, 2022, 01:36:10 pmAh. OK, that helps a bit, and I can see how that would be better.Quote from: tggzzz on July 24, 2022, 01:36:10 pmI assume you mean using decoupling capacitors here? If so, any general advice on how to know exactly when/where to use them and how to select values? Not asking you to write a massive screed mind you, but if there's anything more you can say. Or if you have a pointer to a good reference handy that you would like to mention? Would be greatly appreciated.Quote from: tggzzz on July 24, 2022, 01:36:10 pmI'm afraid I can't follow what you mean here at all.Quote from: tggzzz on July 24, 2022, 01:36:10 pmNow that I did. At least on the later attempts at building this. The first few, I pretty much built up the whole thing first because I thought this would be easy. (WTF was I thinking???) but after failing about six times, I started to realize the value of piecing things together incrementally, testing in stages, and building the thing up from known working subsystems as much as possible. So yeah, I definitely appreciate that point after having gone through this exercise to date!

author: mindcrime
author_rank: Unknown
timestamp: July 24, 2022, 03:26:30 pm
content: FWIW, I currently have three books on schematics in my library (and obviously I haven't spent enough time with them!), but aside from these three, are there any particular resources any of you would recommend, for learning how to make proper schematics?Beginner’s Guide to Reading Schematics - Stan GibiliscoEngineer's Mini-Notebook: Schematic Symbols, Device Packages, Design and Testing - Forrest Mims IIIMastering Electrical Schematics Drawings How to Read Schematics. A Must Skill for All Electrical Electronics Engineers - Muhammad Kashif

author: ledtester
author_rank: Super Contributor
timestamp: July 24, 2022, 07:51:38 pm
content: Just like reading a lot of books is a good way to become a better writer, reading other schematics is a good way to improve your schematic layout skills.A good source of well-drawn schematics is datasheets. The really good datasheets (like the TI ones) will come with a lot of examples of how to use the component such as the TL431 or a 3-terminal voltage regulator. And it's likely the way you are using the component is similar to one of those examples so you can just copy the layout from there. Larger circuits are made from smaller sub-circuits and you can make your design easier to understand by using the conventional layouts and representations of those sub-circuits in your schematic.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: July 24, 2022, 09:06:00 pm
content: Obvious problem: TC4422 is a 9A low side MOSFET driver. Your MOSFETs are high side N-ch. They will not switch, as such.Also did you mean to have them in series-series? Not anti-series? Note the substrate diode (the little triangle into the channel), there's a straight path through both in one direction. That's what that means in the symbol (yay for symbolic meaning!).You must use an isolated gate driver for high side switching.Tim

author: mindcrime
author_rank: Unknown
timestamp: July 24, 2022, 10:41:04 pm
content: Quote from: T3sl4co1l on July 24, 2022, 09:06:00 pmYeah, those were just what I had here. I have some optically isolated MOSFET drivers on the way that are designed more specifically for high-side switching.That said, this configuration actually works just fine in practice so far. I send ~10V to the gates and these are "logic level" FETs that purport to turn on with a vgs(threshold) of 4V. I haven't seen any issues with the FETs to date. I tested this with the bench load and pulled 2A through this setup and the FETs didn't even get warm to the touch, and there was no significant voltage drop.QuoteThat's just an artifact of the tool I was using not having the symbols I really needed. These MOSFETs are connected "back to back" so as to prevent reverse current flow on a given rail when it's mean to be off.I'll be switching to a better schematic drawing program (and, of course, learning more about drawing proper schematics) as I move forward.I expect to do another rev of this board soon'ish that fixes some issues with the current one. I think I can eliminate a few components for one thing, and I'll fix that miswired TL431. A poster above mentioned that I can actually do my comparison with the TL431, so hopefully I can ditch the LM393. I think I'll also be able to get rid of the LM317 and associated pots, and the 7408 AND gate. In which case, hopefully I can fit it all one one board, and that's before even getting into the possibility of going to SMT components.Another improvement will be to ditch the pigtail wires soldered to the board, and put actual USB-A connectors on the board for the inputs and outputs. And hopefully I can also shrink the size of that capacitor bank on the output, although that's not ahugedeal at the moment.If / when I ever get to the point that the design is fundamentally sound (enough) my next goal is to learn KiCad well enough to design an actual custom PCB and have it fabbed. But that's probably putting the cart before the horse at this point!And just to be clear, in case anybody was wondering: this is purely a "one off" for my personal use. This isn't intended to be creating something that will ever be a product for sale or anything. So strictly speaking, I can settle for "good enough" in many areas. But I don't necessarily want to do that too much, because I always want to keep learning and pushing my knowledge boundaries.Ultimately what this is in service of, is my interest in AI research, and specifically embodied AI research. The whole "portable Raspberry Pi in an old boom-box" thing is a research platform. Eventually the Pi will have a GPS module, microphone, accelerometers, camera, etc. attached so I carry it around with me and let it experience the physical world on a real-time continuous basis. Of course a Pi doesn't have the computing horsepower to do a lot of "AI stuff" so in the end, it'll be more of a data collection device and interface device, and the heavy lifting computationally will be in "the cloud".

author: tggzzz
author_rank: Super Contributor
timestamp: July 25, 2022, 12:13:46 am
content: Quote from: mindcrime on July 24, 2022, 10:41:04 pmWell there's a glory for you. Perhaps you should amputate the haggis before asking other people for their help.(With apologies to Lewis Carroll and Humpty Dumpty, but those were the words/tools I have available)

author: mindcrime
author_rank: Unknown
timestamp: July 25, 2022, 12:26:34 am
content: Quote from: tggzzz on July 25, 2022, 12:13:46 amI don't know what either of those sentences means, but all I can say vis-a-vis "asking other people for their help" is that I'm learning as I go here, I don't know what I don't know, and nobody likes the guy who shows up on the forum and says "Hey, I need a circuit to do X, do my homework for me." I prefer to be the guy who only asks for help when I've obviously reached the limits of my knowledge in some regard, can't proceed, and have at least given it "the old college try", ya know?

author: ledtester
author_rank: Super Contributor
timestamp: July 25, 2022, 02:38:20 am
content: Quote from: mindcrime on July 24, 2022, 10:41:04 pmI downloaded it and whereas you can rotate a symbol what QElectroTech is missing is the ability to flip a symbol horizontally or vertically which is how one would draw back-to-back MOSFETs in most other schematic capture programs.

author: JDubU
author_rank: Frequent Contributor
timestamp: July 25, 2022, 03:08:25 am
content: QElectroTech looks to be a program for drawingelectricalwiring diagrams (like for washing machines and industrial equipment). This is not the right tool for drawingelectronicschematics.There are a bunch of free programs available for drawing electronic schematics.Here are a few examples:https://www.altium.com/circuitmakerhttps://www.digikey.com/schemeit/project/https://easyeda.com/

author: T3sl4co1l
author_rank: Super Contributor
timestamp: July 25, 2022, 05:19:07 am
content: Also:https://www.circuitlab.com/Tim

author: tggzzz
author_rank: Super Contributor
timestamp: July 25, 2022, 07:58:06 am
content: Quote from: mindcrime on July 25, 2022, 12:26:34 amIt helps to include the context in which replies are made, not to snip it. Here it is...Quote from: mindcrime on July 24, 2022, 10:41:04 pmBoth my sentences are a point about using the right tool in way that helps other people help you; English in my point, a drawing tool in yours.This quote is fondly remembered from the mid 19th century, and is still often used to make the point.Quote from: Through the Looking-Glass by Lewis Carroll, Ch7I'll admit I my comment was a little too snippy, but you have seemed resistant to people's suggestions.As for schematic tools. I suspect, never having used it, that KiCad will be an unnecessarily large learning curve for you. It would, however, be a good learning curve to climb if you intend to make complex PCBs in the future.I have no specific suggestion as to which schematic tool to use; there are many available, some very simple. Google is your friend.

author: Ian.M
author_rank: Super Contributor
timestamp: July 25, 2022, 10:50:42 am
content: When I needed a quick and dirty logic patch for combining limit switches on my 3D printer, it only took me an hour or so to learn enough of the stripboard/protoboard layout packageVeeCADand its preferred schematic entry packageTinyCADto lay out a very compact stripboard layout for the 74HC00, handful of passives and headers it needed. VeeCAD can also be used with KiCad and a number of other schematic editors.You can customize the protoboard track and pad layout, and I've just done that to give it a board compatible with yourGikfun GK1007420 tie-point protoboards. Strip the .txt extension from the second attachment (leaving the .per), drop it in the VeeCAD program folder's "Patterns" sub-folder, select it from the list VeeCAD menu Board=>Strips gives you, and enjoy.N.B. VeeCAD cant handle the 0.05" lateral offset of the GK1007 bus strips, so I drew them 0.05" to the left of where they should be, on the same grid as the central block of 5 way strips. That shouldn't be an issue for any axial or radial leaded component but *DON'T* place any DIL packages straddling from the rails to the 5 way strips!You *SHOULD* try to design the whole schematic, including header pins for external connections (even if you intend to solder wires direct to the strips) *BEFORE* you start layout in VeeCAD, However you can make changes and re-import the netlist, but if you make a big change or many changes, its frustrating having to rip up and manually reroute what VeeCAD now flags as errors.Hint: if you don't RTFM you wont easily discover that in VeeCAD, to 'stretch' the leads of a component or angle it to an offset hole, you can shift-drag its connection to the strip or pad.YMMV for time to learn TinyCAD +VeeCAD, as I would certainly qualify as a LTspice power user and back in the dark ages was competent with pre-Autodesk takeover Eagle so schematic entry and layout was already very familiar to me. However for me, it was quicker to learn the new tools, design and layout the board and build it, than it would have been to do it old-skool, sketching the schematic on paper then layout the board and its track cuts as I built it, and it certainly let me build a far more compact layout that worked first time.Edit: corrected .dsn to .per in "... attachment (leaving the .per), drop it ..."

author: mindcrime
author_rank: Unknown
timestamp: July 25, 2022, 02:38:35 pm
content: Quote from: tggzzz on July 25, 2022, 07:58:06 amGotcha.QuoteAh. Indeed. It's been some time since I read Lewis Carroll and I forgot all about that.QuoteHuh. I don't think I've been resistant at all. In fact, I've called out a number of things I intend to do in the future specifically in response to various suggestions people have made. You may be confusing my tendency to explain / discuss things (I probably over-communicate at times) with arguing or resistance. Anyway, ,that's on me, sorry.QuoteKiCad has been on my list of things to learn for quite a while anyway, so I think I'm at least going to give it a shot. The whole thing with QElectroTech was just me stumbling around in the dark trying with the first tool I ran across that looked suitable. My whole mindset is rooted in iterating and continual learning though. It might, at times, take me a while to get there, but I usually do in the end.

author: mindcrime
author_rank: Unknown
timestamp: July 25, 2022, 02:43:42 pm
content: Quote from: Ian.M on July 25, 2022, 10:50:42 amRad. I'll give that a shot. I had earlier dismissed TinyCAD from consideration since the webpage showed it as being "for Windows" and I don't run Windows. But it seems to be the case that it will run under Wine, so I'll give that a spin.QuoteAwesome, thanks!QuoteSounds good. Thanks again.

author: Ian.M
author_rank: Super Contributor
timestamp: July 25, 2022, 03:13:47 pm
content: Correction: "... attachment (leaving the .per), drop it ..."If TinyCAD isn't impeccably behaved under WINE, use a native install of KiCad, which is worth learning anyway.Its always worth saying up-front that you don't run Windows if there's any chance software may come up, as far too many electronics industry software tools and utilities are Windows only.

author: mindcrime
author_rank: Unknown
timestamp: July 25, 2022, 09:55:02 pm
content: Quote from: Ian.M on July 25, 2022, 03:13:47 pmNo doubt. I've had KiCad on my list of "things to lean eventually" for a long time anyway, so maybe now is the time to just bite the bullet. Or maybe I'll dabble with both for a while and see what role both can fill in my workflow.The thing about KiCad is, I definitely do want to learn to design my own PCB's eventually, including ones based on SMD components. DIP and solderable breadboards are fine for prototyping most things, but some components don't even come in DIP packages anymore, and I'm sure there will be projects I'll take on eventually where space will be a bigger factor. Heck, even on this project it's been a minor issue, in that I overflowed one of those Gickfun boards and had to use another. I do think I'll be able to collapse that down to one again without going SMD in the short-term, but having the ability to design my own custom boards would be nice.QuoteThat's a fair point. Yeah, I'm a Linux only guy in my personal life.Basically the only time I've used Windows in the last 30 years or so has been when I worked somewhere that required it.

author: tggzzz
author_rank: Super Contributor
timestamp: July 25, 2022, 10:20:02 pm
content: Quote from: mindcrime on July 25, 2022, 09:55:02 pmI occasionally find it useful to point out I'm not clever enough to run Windows. The difficulty of knowing how to avoid viruses, find and install drivers, cope with the ever changing directory structures and this years fashionable GUI.And then there's the registry. I'm glad Lennart Poettering (perpetrator of systemd) has buggered off to Microsoft; they are a marriage made in heaven.

author: mindcrime
author_rank: Unknown
timestamp: July 27, 2022, 01:18:17 am
content: Running through some KiCad tutorials now. It might be a while before I feel like I've learned enough to take a stab at a proper schematic for this using KiCad, but when I have something ready I'll definitely post it and see if things come out better this time. (Or I may take a stab at the TinyCAD approach depending on how quickly I think I'm progressing with KiCad).Thanks again for all of the help and tips, all! This is a very frustrating process, but I try to stay positive by reminding myself that:A. I actually have a working board to use in the near-term, even if the design is not optimalandB. I'm learning a TON from all of this and I'm going to come out of this experiencemuchbetter equipped for my next project!

author: tggzzz
author_rank: Super Contributor
timestamp: July 27, 2022, 06:40:16 am
content: That's the way all of us started!The best we can achieve is to make new mistakes.

author: Terry Bites
author_rank: Super Contributor
timestamp: July 27, 2022, 05:29:58 pm
content: A quick pencil sketch will do for the purposes of an illustration.

author: Tandogan
author_rank: Newbie
timestamp: April 28, 2024, 10:35:38 am
content: HiI need your help.I have checked the capacitors on my digital piano and got the following results in ESR levels. I used the peak ATLAS ESR70 gold.10000 uF 25V - ESR 0.012200 uF 25V - ESR 0.02470 uF 10V - ESR 0.20100 uF 25V - ESR 0.4347 uF 16V - ESR 0.6410 uF 16V - ESR 1.011 uF 50V - ESR 1.10I am especially suspicious about ther results for 10 micro and 1 micro F. They should be around 8 and 5 respectively. Do these results mean that I need to change the 10 micro and 1 micro D capacitors?Thanks for your replies.Tan

author: T3sl4co1l
author_rank: Super Contributor
timestamp: April 28, 2024, 11:45:36 am
content: Quote from: Tandogan on April 28, 2024, 10:35:38 amPlease start a new thread; this bears no relation to the topic above.

author: Terry Bites
author_rank: Super Contributor
timestamp: April 28, 2024, 12:19:50 pm
content: How about an actual schematic instead of vague blurb?

author: MrAl
author_rank: Super Contributor
timestamp: April 28, 2024, 03:58:11 pm
content: Quote from: Terry Bites on April 28, 2024, 12:19:50 pmThis thread has been hijacked. The original thread had no relation to this new topic and was a few years ago.