MacroFab Engineering Podcast #226
Al Williams returns to the podcast to discuss FPGA documentation and meat balloons.
Stephen brings up alternative uses for assembly layers in PCB design and Parker uses OctoPrint!
Al Williams returns to talk about FPGAs (Field Programmable Gate Arrays) and how to get started.
Simulations
Al Williams is one of the authors behind Hackaday, a website that features electronic projects and other things that appeal to people interested in computers, electronics, and technology.
Parker is an Electrical Engineer with backgrounds in Embedded System Design and Digital Signal Processing. He got his start in 2005 by hacking Nintendo consoles into portable gaming units. The following year he designed and produced an Atari 2600 video mod to allow the Atari to display a crisp, RF fuzz free picture on newer TVs. Over a thousand Atari video mods where produced by Parker from 2006 to 2011 and the mod is still made by other enthusiasts in the Atari community.
In 2006, Parker enrolled at The University of Texas at Austin as a Petroleum Engineer. After realizing electronics was his passion he switched majors in 2007 to Electrical and Computer Engineering. Following his previous background in making the Atari 2600 video mod, Parker decided to take more board layout classes and circuit design classes. Other areas of study include robotics, microcontroller theory and design, FPGA development with VHDL and Verilog, and image and signal processing with DSPs. In 2010, Parker won a Ti sponsored Launchpad programming and design contest that was held by the IEEE CS chapter at the University. Parker graduated with a BS in Electrical and Computer Engineering in the Spring of 2012.
In the Summer of 2012, Parker was hired on as an Electrical Engineer at Dynamic Perception to design and prototype new electronic products. Here, Parker learned about full product development cycles and honed his board layout skills. Seeing the difficulties in managing operations and FCC/CE compliance testing, Parker thought there had to be a better way for small electronic companies to get their product out in customer's hands.
Parker also runs the blog, longhornengineer.com, where he posts his personal projects, technical guides, and appnotes about board layout design and components.
Stephen Kraig began his electronics career by building musical oriented circuits in 2003. Stephen is an avid guitar player and, in his down time, manufactures audio electronics including guitar amplifiers, pedals, and pro audio gear. Stephen graduated with a BS in Electrical Engineering from Texas A&M University.
Special thanks to whixr over at Tymkrs for the intro and outro!
Hello, and welcome to the macro fab engineering podcast. I'm your guest al Williams.
And we are your hosts Parker, Dolman.
And Steven Craig.
This is episode 226.
Al Williams is one of the authors behind Hackaday, a website that features electronic projects and other things that appeal to people interested in computers, electronics and technology. Al has worked on everything from underwater technology to the International Space Station, and just about everything in between.
So Al has also been on previous podcast episodes 5794 and 160. So for his fourth time back, thank you, Al for coming onto our podcast.
This time, we're gonna get it right, I
think that's the Fourth time's a charm. Fourth time's the charm. So this time, we're going to be talking about simulation, which is a topic that actually surprisingly, in 2019, we've been going a little bit deeper into. So we're going to kind of take a bit of a deep dive and figure out quite a bit more about to hear, because al Williams is a complete expert in simulation, right?
I don't think I'd go that far. But I do enjoy working. You know, I think it's the same reason I like 3d printers, right? I always said, boy, when they were first coming out, I said, Man, I really need a 3d printer, because I can imagine a lot of things, but I'm too clumsy to build a lot of things. So, you know, me building stuff is always a recipe for disaster and frustration, and I'll eventually get it done. But you know, I have seen people who just say, Hey, I have an idea and throw it together in five minutes. And then oh, wait, let me change this, I'll pull these three pieces out and redo it. I'm lucky to get it built once and not have it look like a hot mess. So. So I really enjoy being able to say draw something on CAD and then have it pop out of the 3d printer. And I really think simulations a lot like that, especially now, I mean, we have so many great simulation tools, many of which are either very affordable or free. You know, back in the, you know, back when I was in school back in the dark ages, you know, you punched cards, despise literally punched cards, and drop them in that wasn't very conducive, and nobody liked that. But now, you know, you can sit and deal with it on the screen and the graphs change. And you get the FFT plot and all that. And it's really very cool. So I don't know if I build myself as an expert on on any of that. But I do think it's an interesting part of the world is to be able to, you know, sit and play on the computer and then have something that comes out to be relatively close to the real life. And that's really the key right is how close can you get to real life? So I mean, you guys use some simulation tools, I'm sure right. We were we were kind of, bordering on that before the show. What what are you guys using these days?
Well, for me, I use Well, I, for the longest time I was a piece by user, because we not only were we taught that in school, basically every lab, we had to run in school required a pre lab, that was all done in PSPACE. So you had, you know, frankly, I'm gonna go off on a quick little rant here. But but for the most part, there was this grand idea that these labs were supposed to teach you. But they never really, at least at my school, they were they were very bad at getting you to like actually figure out that grand thing. So you would simulate everything, you'd get a bunch of numbers each go to the lab, and then you wouldn't get those numbers in real life. And then they'd say, Well, you were supposed to, and this is what it was supposed to be and like you get confused more than than anything and if you and knowing that if you went back and redid it, but like, Oh, this is great. I get it now, you know, but But ya know, a piece place was was mainly from school, but given its expense, I've actually never worked at a place that was willing to actually purchase PSPACE. So I recently jumped over to Lt spice because it's readily available and equally as powerful in my opinion.
It's excellent. I really enjoy using it and it actually runs nicely under wine, which is a big thing for me because I just despise booting into Windows if I don't have to. I even moved my Surface Book over to Linux. So I'm I still have Windows on it just because they're you always have to have some window box. You can boot in an emergency, right? But I've almost completely gotten off Windows. So how about you, Parker? What are you simulating these days?
So I typically don't do a lot of simulation. Because I mainly do digital stuff. Any kind of I think the last thing I'd simulated was a an analog filter that I needed for. I can't remember what project that was for. It's been such a long time. It's just one of those. You know, most time I'm doing microcontroller stuff, but like Steven, when I was in school did a lot of DSP stuff and we did simulations for that, but I can't remember the program, it must have worked with National Instruments stuff. What's there?
You mean, the lab lab? You still have
you? Yeah. But there's, there's another module for that that's for simulation, we did a lot of that. And our DSP classes because you had to, you had to write code and then simulate what it was going to do. Like, kind of like beforehand, because you couldn't have your, your DSP board, you know, everywhere with you. Well, you
know, actually, there's a lot of work now in CO simulation, where you have a microcontroller simulator, and analog and digital and all that sort of stuff. So I mean, you see that with some of the system on chip stuff now. But we ran an article, I was actually looking for it. There's several of this Arduino programs that will do that, like sim, you ID Ed. I've seen it. Yeah. Where, you know, you can write your code and you can have it, you know, blink, the proverbial led, or whatever the it shows the LED blinking, right? There's a couple of those. And there's one that I think Proteus I think, but it's pricey relative, you know, pricey. For hobbyist. It's not quite, it's not P spice pricey, but it's, it's relatively pricey, but there's a couple of free options for that. And there's actually a website that I was looking for the other day, that actually has some like puzzles you can do. And I think that's another interesting part to simulation, just like you brought up is a lot of times you can use that for student work. And if it's good enough, right, then that's something that you can do. Did you ever see the EDA is edX, right, MIT started that online university kind of stuff. And a lot of universities have jumped on it. But they've got that one electrical engineering course, that was like one of the first ones they did, and it's excellent. Though, what's the professor's name that did that OG roll, I think or something like that. But the work they did on that you would have a problem. And it would say, like, well, here's an oscillator, and you know, get the output to be 2000 Hertz. You know, with a certain, you know, characteristics, you would do that, and it would all be simulated, and you could even like route the output of the simulation to your PC speakers. So this is all online. And it's just, you know, talking about going into the lab and trying to have that that aha moment, like you say, that was really the closest they could do without having to say, Okay, go buy this kit of parts. And, you know, get your oscilloscope out, it was all there in your browser screen. I was very impressed with that.
Yeah, just I haven't really found a, a way to simulate some, like, I know, there's some Arduino simulators where you can put in code, and it will simulate what the output of the, you know, 80 Mega 320 P will do. But like, a lot of times, I'm not doing Arduino stuff I'm doing like pic, or I'm doing silicon lab stuff. And there doesn't seem to really be any really good simulators for that. So a lot of times it's it's flash it on the on the chip, and then pause the program at a certain spot and see what the output is. Oh, you're lucky
to have that, you know, we used to just always look a scope up to one pin. And if you went high, that meant you got to that part of the code, right? That's
exactly yeah. No, that's that was actually the first digital logic class. We were programming Freescale nine as twelves. And we had to do it in assembly, and that was our debug method was you light up the LED on the board when you got through a certain section of code? Yeah. So you would do that for your interrupts like, okay, good. I actually programmed the interrupt section, right? So
actually just didn't know if you ever got out of it. But yeah.
Do you know what the Arduino the Arduino version of that is? Just print two F's of like, hello, or I'm here, like all over the place?
You say that? I do that all the time when writing Python scripts.
There you go. So yeah, so there are some mixed signal stuff. But you know, I've been very interested. I mean, there's a lot of opportunity to do analog and digital with a lot of the simulators that are out there now. And you know, we were talking a little bit before that,
sorry to interrupt that. I do remember the last time that simulation is we simulated MOSFET driving for my Pinball Controller, I'm developing. Oh, okay. Yeah, gate
capacitance effects and things like that. Yes, we were trying
to figure out okay, given a certain rate for these MOSFETs are we going to make sure we're turning them on and off fast enough? Or slow enough basically, so you don't burn them up? So yes, we actually did to do some simulation. I guess that's picking up
the models from the manufacturer to do that or
correct. That was done in we actually did that in P spice and P splice had a default library for the manufacturer. Like that's that's one of the big benefits in my opinion of PSPACE is that they have just their their libraries or they feel way more complete like you with LT spice you get you get Lt parts. And
yeah, we've got a vested interest, right. But of course, the nice thing is though, you can use regular SPICE models with it right, you just have to know how. So they don't prevent you from doing it. They just don't make it trivial. It's not point and click to get those those other vendors models in there.
And I'd love for that. Honestly, though, for me, I'm not I'm not a coding kind of guy. It just just not. And that's one of the hardest part about spice is that it just seems like there's a lot of information that you just have to know, in order to get things working. And it doesn't feel complete, it feels a little bit hacky to me, but once you do get it, you get it, it's just like, Well, how was I supposed to know how to do that, you know. And luckily, luckily, there's a lot of resources. You know,
there are a lot of other programs out there that are comparable, and some of them are not vendor locked to where you've got to, you know, you do have a broader library. I mentioned earlier, we before the podcast, you know, one of the things we talked about in Hackaday, recently was micro cap 12, which was some commercial product that I think basically one guy developed. And it's really great. It looks, it looks awesome. But it's got a large library, it does all sorts of things like noise analysis, and Monte Carlo analysis and things like that, that you don't normally associate with something like that. And I think he was selling it for don't quote me, but I think it's about $6,000. And he had been selling it for quite some time. Well, I guess he retired, and essentially just dumped it out onto the internet as a freebie. So a lot of people have been making YouTube tutorials about that it's not a trivial program to use, like you might expect. I mean, actually LT spices and either you just everybody's been using it for a while, because it's been around a long time. But I think you're you know, to your point, I've always found that to be true, too. There's a lot of little tribal knowledge, things like if you ever build an oscillator, and most of the spice programs, it doesn't work, right. And so you have to know, well, I have to kick it with this, or I have to make sure the capacitors are modeled this way. Because the trap has always been, you know, there's always these little things you gotta go tweak to get an oscillator to actually do it, it'll really do on the bench. Or I did an article probably four or five years ago on Hackaday, about simulating transformers. You know, that ought to be pretty easy, right? But it's not. And you have to kind of do this black magic thing and make two inductors. And what's the, what's the coefficient of coupling between them? Well, that's on the datasheet. Right, you know, so especially if I'm hand winding, I'm on a t 50, toroid or something, you know, what was the coefficient coupling? I don't know, if I knew that I would need to simulate the circuit, right. So. So there's a lot of things like that. And I agree, we've got a long way to go to, to really get there. There are a lot of different choices, you know, and good new caps out there. There's one that I don't think gets enough love and it's called Zeiss. I'm actually working on an article that right now you guys ever hear as ice? No, how's that spelled? Bice is spilled. I'm gonna look it up because I don't know it's x, y. C. E. Zeiss. And I wouldn't have been able to pronounce that other than the first thing on its website says, rhymes with spice.
They're self aware.
It's from Sandia National Laboratory. So it's probably got you know, it's probably looking over your shoulder. Who knows? No, I'm kidding. But but it's actually a spice derivative, but it's made for like massively parallel processing. And it doesn't have to have that. But apparently, it can simulate really big circuits. Because you know, that's the other thing. What do you do an LT spice like Parker said, you know, you do a filter, you do a, but you're not really going to say, Oh, I'm building a single sideband transceiver. I'm gonna simulate all of it from start to finish. But I think this thing could do it and have reasonable runtimes. Wow. So I always want to kind of play with that. And I don't ever really have a project big enough. There's another vendor that's got a spice out that's kind of interesting, which is Tina. Ti has some version of that. And I don't know if that I don't think the TI and Tina actually stands for TI I think it's just a coincidence because I think is it Infineon or one of the other houses actually has a licensed version of that also that you can get for free. And it's pretty professional. But the freebie versions have some limit, right, you know, 100 components or something. But I almost never hear of anybody using that. So as successful as Lt spice has been at getting everybody to use that. I never I mean, you guys ever see anybody use Tina, are you ever heard of it before?
Or never heard of it? I'm
looking at it right now. Yeah. So I mean, it's out there and you know, there's big companies behind it, but it just no one seems to know what's there. So, you know, I guess that's a you know, LT spice is like, you know, they always say coke has so many products because that keeps the other products off the shelves, right? Once you have to stock 40 Coke products, so maybe that's the LT spice effect as they've just kind of eclipsed all the other. All the other little offerings like that,
you know, right on the front page. Oh, of the Tina, they call out they have something like 1400 microcontrollers, including pix AVR is at 50 ones, and some st micros and stuff that you can do in mixed circuit analysis, which that's awesome. That's really good.
So I wonder how those work does it? Is it also simulating, like, the peripherals in that microcontroller? That should? I guess so?
It has it says it has a built in MCU assembler, so I would think it would Oh, yeah,
then yeah, yeah. I got that. That's because that's actually that's, that's what I'm looking for. Is Did I did I set up my spy bus hardware correctly, so it spits out the right stuff? Without having to program and compile cuz you know, it's like 30 seconds to compile, then you gotta run it, then you gotta check your DLA. See if your outputs right. But it'd be nice just to see that if it was right.
You know, I'm older than you guys. This is a first world problem. It takes me 30 seconds to compile. I'm thinking I don't have to spend three hours erasing an EEPROM I'm pretty happy, you know. So. Anyway. But yeah, you ought to check that out. And there's a couple others out there that do that same sort of thing. Like I say, I think Proteus, I think is that the way it was one of them that does that. I think they have a variety of processors. And there's several others that we've covered that, you know, I've talked about the Arduino ones, but that's really just an Atmel chip, which is owned by microchip now. Anyway, so there's, there's quite a few options there in that area.
Alright, so Okay, so my controllers, three, six, but FPGA stuff down at the hand is like 10 minutes.
Yeah, yeah, well, so you try doing some of mine, I got some that, you know, you go to bed and wait for it in the morning. And then that's always a problem, because you sit and go, gee, you know, what was the change? I made that, you know, six hours ago. So yeah, there's, there's some of those FPGAs are, especially the more expensive ones, they're getting really large. So it takes a long time to get everything packed up on those. Speaking of FPGAs, though, you know, that is one of my favorite simulators to just go knock something out in is that EDA playground, I think, maybe we talked about that on one of the previous podcasts. But that's, uh, you know, you go on that website, and there's all these. Now that's simulation of a different sort, right, it's Verilog, or VHDL. They do have Python and system C, and you know, things like that. But you can go on there and use some really expensive commercial tools for free. And, you know, I'm sure they know, nobody is going to go put their top secret encryption algorithms in this browser, text editor. So I'm sure they might be surprised. Like, it's, well, yeah, might not be. But normal people, you know, people that actually matter are going to not do that. But it's a great way to go play with some of those tools. And actually, you don't have to install anything, I can't tell you how many times I've been at somebody else's computer and want to talk about something and just say, oh, here, because I don't have to go, what version of this do you have? Let's go install it. Or a Sir, let's do this, you know, just put that on there. and off you go. So I really liked that. I don't know how they can afford to do it. And I'm sure the vendors support some of that, but it's really cool. And there's a lot of little spice hanging around and other websites like that right? Like easy EDA. I don't know if you guys have ever seen that or not. It's actually a pretty credible PC for layout program in a browser, but it also has spice. I don't know, you guys may have a different perspective than I do. But I never find my PC board layout. Schematic Capture is very conducive for spice, right, because it's just different goals. So I, you know, if I'm going to do spice, I usually do that in some program like LT spice that I'm going to use. And then when I want to do schematic capture for the board, I'm in some other program, but a lot of them I mean, chi cat or however you want to pronounce that that has an integration with I think ng spice now, you know, I can say EZ EDA does that DigiKey has some site that I can't remember now, but it will do simulation and schematic capture all in your browser with nothing to install. So that's kind of an interesting trend too. But the false did when you know that's the one that just did run on, I think it was a flash program, and then somebody converted it to HTML five. But I love that one. And of course, if you're interested in like physics and stuff, that site has all sorts of physics simulations. But the circuit simulator is really awesome. You know, for just a quickie. And especially we were talking about educational uses. I use that all the time when I'm talking to students, because it's not very complicated to use. It's got a bunch of sample circuits. And it does something that almost no other product I've seen does, which it visualizes the current as little animated dots, right? So if something's drawing a lot of current you can visibly see you know, all the little dots marching along, the electrons are flowing, and if the transistor shuts off, well, those dots slow down. Start Stop and write or you watch a capacitor charge, you can really see that the current flow visualized. And that's really powerful. If you're trying to, you know, do something in education. I do a lot of Hackaday articles where we'll do simulation. And you can actually take something simulated in foul stead. I don't know if I'm saying that, right, but I think it's felsted. And you can actually convert that into a link, run that through tiny URL, and then if somebody clicks on that link, they come right back to the screen, you were on with all the simulation and all the monitoring and the parameters. So that's really powerful. When you're writing, you know, you can say, you know, here's a, I don't know, a common base, amplifier, and that, and if you look, click here, and you can change our one to double the value, what happens, right, you know, and I think that's really an important thing. And I think you guys have heard me say this before, but you know, I go around the schools, sometimes I tell the kids, probably the teachers don't like this, I'll say, you know, the purpose of math for engineering is frequently not to get the right answer is to develop intuition about processes. So if I tweak this number over here, what does the number over here? Do? Does it go up? Does it go down? Does it go up as the same rate or twice as fast or exponentially? That's really important. And I think simulators answered or can answer that same question.
At least. Yeah, and well, especially I think, too, we I see a lot of people who don't fully use simulators, because they just use it like you would build a breadboard and then probe on it, right. But one of the real powerful things is almost all the simulators, including LT spice will let you do a step right. So you can say, well, this resistor, I want it to go between 10 ohms, and 100, ohms, and five ohm steps, and then plot all of it out in a big messy graph. And I can look and see, oh, well, when it was five ohms. You know, this is what happened when it was 15 ohms. This is what happened. And I think that's great for developing that kind of intuition. I don't think people do enough of that.
You know, same above and beyond that with stepping temperature, you can you can get deep into that, honestly, the steppin along with like Monte Carlo and worst case, analysis is fantastic. I use that on a regular basis just to see like, yeah, sure, we calculated this is where the, you know, in this resistive divider, this is what we, the number says it's going to be but in reality, if we have 1% resistors, and we go across temperature, where's it actually going to be?
You really ought to check out that micro cap 12, it really has a lot of features for that sort of thing. Very nicely done, it runs pretty well under wine, I don't think I've got the 64 bit version to run under wine, and whether that was just because it won't, or because I was too lazy to do the requisite voodoo to I didn't kill enough chickens and spread the spread tea leaves or whatever you have to do to do that. But the 32 bit version worked, at least seemingly Well, from what I did with it. So but I think that, you know, like, for instance, that's interesting to me, that microcap 12. Because if I'm going to do something, I want that kind of power, right. But if I'm doing it like for students, unless they're like college students, and really advanced this would be you know, you glaze over some junior high kid with that, that's where things like that Falstad simulator is really powerful, because it's, it's approachable, it's easy. I think even LT spice is pretty approachable, it's got some features that if you know how to use it as are daunting, but you don't have to do those things, right. And I like that. One of the things I've focused on the last couple of years on Hackaday, though, is maybe doing more simulation, if you will by hand. And so I'll take a spreadsheet and say, you know, we're talking about, I don't know, an amplifier, and I'll model the amplifier on the spreadsheet. And you know how that is right? Nobody's really going to do that. Not when you can go get all these nice commercial tools that will let you do it. But sometimes, just being able to look at some manageable spreadsheet with 20 equations on it and work through the equations and go change, make changes in it yourself and see what happens. Sometimes, that's kind of important, I think, to develop that intuition. I know you're
good. In that case, you can build your model, and then you know how the models work. Again, you know, when you change the value, okay, that actually changed. Or it goes into this formula, which models this part of that amplifier, so to speak.
Yeah, yeah, so I've done a lot of that and I always think Jupyter Notebooks would be good for that although I haven't really done that yet. But I'm sure you guys have seen Jupiter but or you know, there's all sorts of kind of what sage math and there's a bunch of different things like that but but I think that would be really interesting to get into that now. Whether that's approachable to junior high student or high school student, I don't know remains to be seen but the You know, the the other one that I've done, I know we talked about the FPGA boot camp last time I was or maybe not the last time one of the one of the times I've been on. But that one, if you look at Boot Camp zero, that one's about digital logic, and it actually uses false dead and the way that I talked about right, so you, you know, it says, well, here's a flip flop, and it's to cross coupled gates. And you can see that here, right, and you can actually go see it, play with it, toggle the states watch it change, you know, see what all the internal signals are doing. And it actually ends up with a very nice traffic light simulation, all done and felsted in the browser, and it's a state machine. And so that was that's number zero, because I didn't want to introduce FPGAs yet, right? So if you already know digital logic, you skip that one. But then on the subsequent ones, it's all in Verilog. And except for the one that's very specific for one piece of hardware, it's all done on that EDA playground. So it's the same way, you know, you say, Okay, we're gonna build this state machine, this is what it would look like. And by the way, not just here it is, go type it in yourself, you can click this link, and you're in an editor in a simulator, and you can do it. So I think that's a really powerful way to use simulation.
You know, kind of just a quick story on doing simulation with spreadsheets, I did something recently with that. There's a, there's a kind of a classic circuit that's been around for, I don't know, 3040 years for doing a triangle wave to a sine wave shaping in the analog domain. Well, one of the one of the ICS, in that, or at least one version of the IC is going obsolete. So it's, you know, it's time it's 2020. Let's, let's develop a new way of doing that. But we still want to do in the analog domain. And so I developed I developed a kind of a concept around it, but I didn't necessarily want to jump immediately to LTE spice. Because the biggest thing is I didn't know which components in my concept were, I guess the way I would live them as like strong components, which ones are weak, like, if I change this resistor by 100 ohms does it just blow the whole signal out, and if I change this one by 100 kilo ohms, it doesn't do anything you know. So so instead of going jumping right to Lt spice, I just developed the entire thing in an Excel basically, and I had Excel plot, its version of a perfect sine wave, and then the output of my circuit, and I just messed with values in in Excel until they looked the same, right? And then moved to Lt spice and fine tuned everything. And it made it made the whole circuit only take an afternoon of just, you know, it's way faster to change a cell in Excel than change the value and Lt spice and rerun and then figure it out. And so worked out really well.
Let's see Parker wants to digital but you guys ever seen the little man computer? No, what's that? It's it's a little educational computer built in a spreadsheet. And because of that, I actually went and as a Hackaday article on this, of course, write everything you know, that's all I talk about. Right? So there's actually the old AT and T cardiac computer, I reimplemented it in both a spreadsheet. And an FPGA Actually, that might have been in Dr. Dobbs, now that I think about it, but uh, but I think I've probably talked about it in Hackaday, too. So you guys aren't old enough to remember cardiac but in the late 60s, early 70s. AT and T was sending out these little cardboard kits. And there was like a little slide rule. And it was this computer called cardiac. So you know it had you wrote your program and the little slots and then the little cardboard piece moved in, it was like location five, that means take from this box to that box and erase it from that box and write it in that box. So it was all manual. But it taught kids the idea behind the computer. And so a simulator of a different kinds they were all bring it back to oh, I'm saying computer in my my Alexa. Course it does that so we have to not use the C word out you may want to edit that out. So anyway, I did the spreadsheet and FPGA implementation of that fake computer so but you know, it's interesting to have Parker was mentioned in Python we did an article a while back and I say we It wasn't me. Somebody else wrote it on Hackaday but there was somebody who has a really nice Python bridge for LT spice. So that's kind of the best of both worlds like you're talking about because sometimes it is a pain to do stuff that you want to do an LT spice but you can almost like script it in Python and pick up the values and stuff so you might want to check that out. I haven't not used it myself so I can't vouch for it but it seems like an interesting idea.
I was actually when you said little main computer I almost thought though I learned assembly on a computer called LC which is little computer. I thought it was the same thing I looked up little man computer wasn't the same thing.
You know I missed that though. Because I learned to program on a computer called two tack, which was part of a tutor text. And that was didn't exist, right? It was one of these things, you know, just conceptual and, and of course, the Knuth had mixed, which was the same thing. A lot of people learn to program by programming mix, which didn't exist. Caxton Foster had blue, that he used to teach computer architecture. And I know that was never built. Because when I did the FPGA implementation of it, there were problems with going undetected for 30 years, right. And so if you work on open cores, you can find my implementation of blue on FPGA and with a lot of extensions. But But I really think there's some value to that. Because you know, if you were say, you're starting out new today, and somebody says, hey, Steven, here you go, here's the x86 assembly, manual thunk, right? It's 5000 pages or whatever, wow, where do you start? That's pretty daunting, you know, but if you say, well, here's 38 instructions, and you get the concepts, and then you can kind of pick up things as you go. Next thing, you know that x86 manuals a lot less intimidating. So I kind of missed that. I think there should be more of that, where you don't immediately jump in and put your hands on everything and start writing real code and kind of focus on concepts. And I think simulation kind of lets you do that, to some degree to write you can work on little things in isolation. I need a constant current source, what does that look like? Doesn't matter. Right? It's, it's a box I drag from over here. I don't have to know what a Wilson current mirror is, or, or anything else. But it was interesting. Going back to your Pinball Controller, Parker, I mean, you know, the reason I asked you about the models is because you live and die on the models, right? And, and if you don't, if you really do it for real world, the quality of the model or the, or the lack of fidelity on the model will will make or break it. So I've had some pretty weird experiences with that, because a lot of people have that what I call calculator syndrome, right? You know, what's nine plus two? And you say, well, I put it in the calculator, and because I messed up, but I don't realize that it says 8714. So that must be the answer. And now I'm gonna defend that answer to the death because it says so right on the calculator. And I've seen that a little bit where people will simulate a piece of hardware, but it's just totally not accurate for the model, and then they'll make assumptions of it. So I've got a I got a quick story about that. So
I was about to say, because earlier, we said the right answers, not always the correct thing. So it'd be like, oh, yeah, it's somewhere around 10 and 44. Right?
Yeah. Well, there you go. You if you if your model is that there should be like GPS as the what is it the circle of certainty or whatever uncertainty? Maybe that's maybe that's the concept we need for for simulation, but
years ago, the whole number, right? Yeah, it's
a number. It's a number between you. That's how you'd be the correct weatherman, right? Tomorrow, it will either rain or it won't rain. So I'm always right.
Tomorrow, weather happens.
Unless you're in Southern California, that's always sunny. And you're right 90% of the time. So But years ago, I worked for a group that did failure analysis on microcontrollers. And we had a technology assessment group. So I don't know if you ever deal with how that sort of thing works. But you know, do you ever wonder how they know like, well, this EEPROM will hold data for 38 years when they haven't been making them at that time for 38 years, or whatever the number is. So they do all sorts of things where they stress the parts and then extrapolate. Right? So we oh, we pulsed it with this current and million times. And that's equivalent to a year and I don't know, I can't explain the science behind it. I don't know if I agree or not. But now they just have time machines. But that's what they do. Yeah, right. Yeah. We asked, we asked the Terminator, we have the Terminator so. So one day, and these guys were mostly physicists, and one guy came in, he says, and this is always funny to me, because it you know, if all you see is bad parts all day, which is what we did, and you don't have any other experience, then you kind of think, well, electronic parts are pretty unreliable, and they don't work a lot of the time. Because that's all you see. So the guy came up to me, and you know, you got to be careful answering questions, because people ask questions, and then you realize you don't want to answer that question. You need to drive into the question that really they need to have answered. And he said, Can you recommend a replacement for this transistor? And he had some transistor number? And I said, Well, what are you doing with it? And he said, Well, he says, you know, we're doing this quarter this driver for these parts. And every time we go to RadioShack, and buy one of these transistors, they're bad. And I'm like, What do you mean every time and he's like, Well, they, you know, 10 times it's been bad. And I'm like, Well, that seems unbelievable to me, right? Oh, no, no, you know, they're they're bad. And we simulated the circuit. It's all you know, I know it's works. It's just we're getting bad transistors. I'm like, now it's a draw me the circuit and he sent me the schematic I'm looking at it. I'm like, No, you know, it looks okay. And it was it was essentially a digital signal switching NPN bipolar transistor, there was a resistor in the emitter, so it had a constant current. And it was basically just pulsing that current on and off. And so looking at it, it looked very simple look very straightforward, and Till I found out I finally said, Well, let me go see what you're doing, I'm thinking, well, maybe they're putting the transistor in backwards and I was looking for something like that. Turns out, what I found was, they were driving an enormous number of parts. And so the current going through the transistor was substantial. And it wasn't that the transistor couldn't handle it, it was a power transistor, but the emitter resistor was wire wound. Now, if you model that resistor as just a resistor, it works great. But if you modeled it in real life, it would have been a lot of inductance. Well, what happens when you have that little change in emitter current in the inductor giant voltage, right based on the rate of change. And so I think even my speculation was even just the early effect, and the transistor was causing enough shift of current that it was just immediately popping the transistor. So of course, we fixed that I had to actually do a little research on that. I don't know if you guys do you guys probably know this, but they actually make low inductance, wire wound resistors, they wind, I can't tell if they wind one coil and then back the other way, or if they use two coils winding in opposite directions, but there's some winding trick they use to lower the inductance and resistors.
Yeah, they're trying to cancel out that magnetic coupling between the
so you have to go shop for those, you don't get them ordinarily. But so that was a good case of where, you know, the model was correct, it just wasn't correct for your part, and that they had a very big, real world effect. I've done that, too. We had a simulated opto isolator circuit for current loop transceiver. And it worked great in simulation until we found out that that part did not have the slew rate to handle the baud rate that we wanted to do, right. So of course, in the simulator, sure, you know, you could probably throw a pic a second pulse through that opto isolator and it would come out the other side. But in real life, of course, that was not the case. So that was a couple of long weekends getting that circuit working. So we could ship something. So
yeah, I've it kind of in the same vein, I've noticed that diode, diode ON characteristics don't always seem to match simulations very well. Like there's, there's there's quite a bit of extra impedance that gets involved there. And they try their best don't get me wrong, the models are pretty intense. But they're not always spot on. We've been dealing with that recently about some some diodes that we've we've thrown into an oscillator circuit. And the oscillator works fantastic, but it just doesn't work as good as the simulation.
Well, and there's even production differences, right? You were talking about 1% resistors. You know, there's always a, and I don't know, have you ever tried to match resistors. And notice that some of the vendors actually take out the closer values, right. So like, if you get, say, 20%, resistors, there, none of them are going to be right around the center, because they sort them out.
They just core out the point why so they
they basically, you know, filter out the point ones and filter out the ones and filter out the fives that filter out the 10s. And so it's a lot of times if you plot, you know, a bunch of resistor values, you'll have the dip in the middle because they've taken them out. So therefore, none of your resistors are the actual value you think they are there within tolerance.
That's interesting that they would they've been then basically,
yeah, I'm not sure everybody does that. But I have seen that done where you know, you have a pack of resistors. And they they're none of them are the nominal value. But I think it's interesting, too, that it depends a lot on your domain you're working in, right. So like, for example, we think of 1% resistors, or even lower right point 1%. Those are quality components. But like a capacitor, you know, those are iffy, right, if you know, they're temperature sensitive, they're not. But if you look like on an icy die, you know, take you back a long time that 68 HC 11 had an A to D converter on it. And that A to D converter used a charge device that dependent on the ratio of capacitors, to capacitors. So if you think about it, you know, especially in those days processes were not as has been, you know, a number of years ago, I'll just leave it at that. But you know, when the 68 HC 11 was current and a hot topic, ion implanting a resistor on the die was iffy at best. And so what was its value, I don't know, plus or minus 20%, maybe. But the actual ratio between the thickness of two plates and the size of those plates, that's all photographically controlled well the thickness isn't but you know, it's process controlled. It the thickness is going to be the same regardless whether it's more or less than you think it is. And the size is not going to be off at all. So the capacitors turned out to be the very precise component you need on the die. But if you built that same A to D on your breadboard out of parts, it would have been a disaster. So you know again models everything right if you if you model your capacitors is perfect, well The not really view model, the resistors is perfect, not really even wire, right wire is not perfect. So
I had a, I had a grad student in in school, tell me once like, well, he, the first thing he told me is don't go to grad school, just flat out. But but but he was he was saying like, one of the first things when he got to grad school, and he noticed that his colleagues were doing the same thing was like, you know, we've made it, we've got a past undergrad, and like, now it's time to like, consider everything. So there's simulations where, you know, the inductance, the capacitance of the wire to every other component and the resistance and, and, and it just their circuits, their simple circuits would get so unbelievably massive that they couldn't even control all of their inputs. And the biggest lesson they had to learn is what to neglect and what to like, just say like, we don't care about this, you know, right?
Well, I think, again, that goes to, you know, what, what's the intuition about the circuit? You know, so yeah, you're right at DC, five feet of wire, I don't really care. But on the other hand, you know, two gigahertz by feedwater, it's pretty significant so unworkable even so what do you do? And I think that's a key. But I think that's the kind of thing a good simulation can actually give you intuition for. Speaking of RF, one of the things I think is hilarious on that falsehood. simulator, I should bring it up. So I say the right thing, but there's actually a radio antenna component in it that a lot of people haven't noticed. Unless the I think it's one of the examples circuits. If you look at Yeah, you look at the diode example circuits, there's one called am detector. And so it's got the antenna, and it's a little crystal radio. And there's actually three signals coming out of that antenna that you can demodulate. So if you change the tune circuit, you can actually tune to the different frequencies that are being transmitted over that. I think that is just such a cool, I think that's just sentimental. My dad had taken a little radio school before he got thrown out of it for hop and trains, believe it or not. And so when I was a really young kid, that was the first circuit he showed me, yeah, you're shaking your head that you know it's true. explains so much, right. But that was the first circuit he showed me was the crystal radio, right, you know, the antenna, that tuned circuit, and he, he vaguely understood it, because like I said, he had six weeks of radio school or something. And so I think maybe that's why I'm kind of sentimental about that way. But I think that is so awesome, that you can build a crystal radio in your browser and tune three different frequencies on it and see how that works. I just love that.
Super cool. Yeah, I'm checking this out. And like, just the whole radio world is is generally foreign to me. So this is kind of fun.
Yeah, I never got my crystal radio as a kid that work?
No, where's the ground, that's always the key. Gotta have a ground.
I don't think I could ever figure that part out in the instructions.
That's the problem. I remember at a&m, there was there was a class that they were doing, where they'd go to the roof of the engineering building, and they'd get a rusty razor blade, a coat hanger and some other stuff. And they, they'd have to tune a radio, which I don't know, seems very an engineering, but also kind of awesome.
Well, if you're ever a prisoner of war, that'll come in handy. You know, that's a whole thing is the pow radios, right? All these handmade foxhole
radios? foxhole
radios? Yeah. Super cool. Well, so I think that's the key, though, is models and intuition about processes? I think that's the that's that's my take on simulation. I think,
you know, it kind of goes back to what we were saying earlier. And I think there's something you can use simulations to get a feel for a circuit, but it also helps to have a feel for the circuit before you go to the simulation like their hand in hand for sure.
Yeah, well, I think that depends on what you're doing. If you're doing Parker's thing, and you're trying to characterize a part. Yes, I think for educational purposes, maybe that's what you're trying to develop? Is that intuition. Right? Sure. Sorry, Parker. I mean, interrupt you.
No, no, is that was the thing is, for my my, let's say my Pinball Controller, as an example is the really the only thing I wasn't too sure about was, you know, I have to hit the certain frequency for the MOSFETs for PWM in let's say, a coil, but I know that that's gonna be fine for that, but I'm like, Okay, what about my drive out of my micro stroller is 20 Milla amps through a snubbing resistor of 100 ohms going to be enough drive, so I can hit that Frequency and not basically keep the MOSFET in what would be unsaturation mode? And yeah, we basically plotted it out ran a couple simulations were like, Okay, now it's gonna turn on all the time. That's good. And fast enough, if fast enough, so and then we fired it up and didn't blow up any MOSFETs.
So I told you, I used to do failure analysis for well as Motorola, I guess I can say that now that they're pretty much long gone. But I won't mention the carmaker involved though. One of the car makers had said, Boy, we've been trying this prototype out with one of your parts, and it's destroying them. And there's just nothing wrong with it. And it was the same kind of thing. They were driving from an output pin. And we finally found out what they were driving with it was an incandescent lamp. And so yeah, the incandescent lamp was rated at you know, five milliamps, which was okay for the drive. But when that filament was cold, it was drawing, you know, 150 milliamps for, you know, a couple of milliseconds till it got hot. And so we had to have a little discussion about inrush current and educate them on.
You know, just because of that I love driving filaments off of constant current devices, because they just take care of that for you, you know, yes. And you can put them in series and everything, and everyone's happy, right? As long as you have enough voltage.
So you're saying your Christmas lights are constant current driven is?
Sure. You know, actually another thing kind of with the the theme of like figuring out or feel and getting a feeling for a circuit, I've been working on a design with a buddy of mine. And he has like, it's, we're doing an amplifier that does similar to common emitter style configurations of transistors or tubes. And one of the things he knows how to do is set up a stage. But if somebody asked him like, Hey, can you make this have a cut off of 100 Hertz? Or hey, like, what resistor? Would you change to increase gain? Or what would you change to decrease gain or whatever? He doesn't really have a feel for that yet. And what would be what's really cool about simulation is you can just figure that out. You can just say, Oh, hey, let's let's multiply this cap by a factor of 10. And see what it does, you know.
So now you know how I passed RF circuits. When I was working on my master's. I really had that epiphany of why am I trying to figure this out? Just tell it scan that capacitor until like, oh, look, they're 50 ohms? Ooh, you know, so yeah, that was,
I can't tell you how often I do that at work, when we're when we're trying to find like, a general range for like, say, we have a trim pot that we're using for a calibration. What value do you use for that trim pot? Well, I what I do is I sweep a giant resistor across, find what works? Well add, you know, two standard deviations on the side. And there's my trim pot, you know, and it takes one step in LTS place to do that, or One Step simulation. Yeah, super easy.
Yeah, I did a tutorial set of tutorial videos for Hackaday, probably about four years ago or so on spice. And I'm pretty sure we talk about that in those videos, but they're on YouTube on the Hackaday channel. And it's I don't know, three or four different ones. But I hadn't started it then. But the series I've been working on in the last year or so we call it circuit VR. So you know, because in my mind the simulators kind of virtual reality in the circuit world, so you don't have to actually build it. But you can still, you can build it, but not really build it. And so you know, we've done a lot of that sort of thing. And I'm trying to think I don't really have a list, we finally got the site where it'll show you different series like a series like that, if you're on one of them, you can find all of them because that used to be a problem. But I know we've done like a charge pump common emitter current mirrors, I think I did the wind bridge oscillator, which is always a fun one. And so just kind of take fun circuits like that, do them NLT spice, and kind of talk about why they work. And again, you know, it's a lot different just reading in the book, or then you can go actually tweak it and play with the numbers. And oh, when I change this, the frequency didn't change, but the duty cycle changed. Oh, I see, you know, and it kind of helps you develop that. So circuit VR.
Well, you know, speaking about VR, what do you think the future of circuit simulation is?
Well, I appreciate that spontaneous question. So my son and I were actually talking about a year ago, because he's really big into the VR headset stuff. And I've got a couple you know, I've got the Google one. That's they just shot through the head and I've got one of the cheaper Oculus ones. And I was thinking, you know, I don't know how yet, but I keep wanting to dream up some way that especially for FPGAs, right, where you could actually fly through your design in some meaningful way. Right? I think even for analog electronics that way. would be really cool. If you could somehow experience that design as though you were in it, not just looking at it and looking at the graphs and charts, but I don't really have a plan they are right. That's just kind of a wild dream. You're an electron. Yeah. Are you gonna be Tron? Right? If you like going into the especially for you with the mixed mode stuff?
It's just like a roller coaster, you know, simulator.
Right, the master control program wants to see you, Parker. But no, I somehow I think there's something to that, but I don't know what it is yet. So, you know, the other thing that I keep thinking somebody's going to do, and I've seen some abortive attempts to it. But But nothing that really struck me as finished. As you know, this goes to your very earlier point, Barker, I mean, you know, you'd like to have some box that your simulator knew about that you could actually generate real time signals out of and accept real time signals. And so you know, you see a lot of that in especially like in the aerospace business where you're doing hardware in the loop simulation. But that's all very custom, you know, very, one of a kind, special one off kind of stuff. And it almost seems like that's a product that's right on the edge of being possible, is to say, Here's, uh, you know, National Instruments kind of has that. Not really with the simulation, though, right? Because you can do you know, LabVIEW, I can do all this stuff in LabVIEW. And there's a box hooked up to my USB port that, you know, magically reads my accounts and frequencies and voltages and all this kind of stuff. But it would be very interesting to see something affordable, which that kind of rules out National Instruments, but affordable and usable to say, well, on my bench, I've got this box that I can say, well, let me do this circuit. But, you know, I want to see how that really sounds on a speaker, or I want to China, I want to put it on my MOSFET. Right. So your MOSFET goes in there. But all the drives circuitry is just virtual and simulated. But to do that, you got to have real time simulation, right? You really can't do that, you know, you can't sit and take two minutes to figure out what the next convergence is. So I don't know that might be the near term future, but I'm still dreaming about the, you know, being able to fly through my circuits and watch the current Koba. And
you see what's going through my mind is even an evolution of that you're not not only flying through your circuit, you're flying through an active simulation of your board. So you can fly into your PCB and see all the traces and everything. There you go. I would
like more, I guess I haven't tried it yet. But since I'd do mostly digital stuff, but having a your microcontroller simulated and your entire board layout simulated, mainly for like current surges and stuff. I think a couple of EDA tools try to do that. But mainly for like, FCC compliance, like, are you going are you making a ginormous radiator somewhere?
Yeah, I'm gonna design rule checkers that will sit there and give you that kind of feedback, right to say, but and, you know, I don't know the, the value of running through the boards would be, you'd have to simulate my jumper wires that I always have to put down, right. Told you, I'm not good at the mechanical stuff. So there you go.
You know, what the biggest simulation that I think would be phenomenon, I've seen things sort of like it. But if I could get a heat map that would show voltage, I guess, various voltages on a ground plane. Like, I've got heavy currents flowing through this side of my ground ground plane, therefore, it is point oh, one volts higher than the rest of the grab, like that kind of stuff, you know, ground shifts and things would be but I'm sure that's ridiculous to simulate.
I don't know you think you could do it? I mean, we certainly have the computing power now. I always get the feeling that we all have computers now that could be doing lots of things in there. Not right there's checking Facebook or whatever. So
making cat memes. cat memes. There you go. That's I'm wondering though, I mean, simulator. Now,
I was wondering of that microcap maybe has some heat mapping type stuff that seems familiar to me, but it might not have been on ground planes. But it did seem like it had some heat mapping of the search for that.
I as a as a kind of a side note on simulation, I just started dipping my toes into heat simulation in Fusion 360. And they do quite a bit of, I mean, I've seen some good tutorials on like, here's a 202 20 package transistor attached to a block of aluminum this big and you're hammering it with five watts of power. You know, what is the heat distribution look like and where's your hotspot is going to be? And it looks really fun to do, but on a hobby level. It's like you'll spend your entire weekend defining materials and things just Just to figure out, yeah, it gets hot.
Well, and you always wonder how accurate I mean, I guess, probably the thermodynamic guys know that. But, you know, it's kind of like economics. You took economics in school, and they say, Well, this happens when this happens, you know, how do you measure that? Oh, well, you really can't, right? Or the weather, which the weather has gotten better in the last 40 or 50 years, but they, they clearly don't know how to actually make that model work. Or else they would say, the hurricane is going to arrive at, you know, eight o'clock right here. And that's just not how that works is we know all too well, where we will. So yeah, I think there's some some value to that thermal stuff. But I always wonder when I see that how really accurate that is, especially on any kind of tools that you're using, right? If I'm sure if NASA has got a tool somewhere or something, but you know, what are we using? I don't know.
Well, once again, with all simulations, like you were saying earlier, it all comes down into the models, right? So if you have everything defined perfectly, then you might have a chance of it being well.
Apart this way, even NASA still tests things in the real world.
Well, that's true. I was looking, I don't see the heat mapping on that. But somehow that just really rang a bell with me that maybe they had the they do have the nice digital stuff, though. Parker, magnetic models transient else, they have the smoke test, which is always nice, right? Where you can do the derating. So like I say, you ought to check that out. I don't know how much. You know, I think the thing is, since the guy retired, I don't think there's gonna be any support. And I don't think he and I'm talking about the microcap 12 Again, I don't think he opened the source up. So I think it's just the kind of let you download the distribution media free and you don't have to have a license or anything. So I don't know that like any community support is forthcoming, but but it's still a very impressive package and something you would have had to pay a lot for a year ago or however long ago it was that he opened.
I feel bad for the very last guy who paid for it.
Yeah, I wondered about that, too. Right here. Here's a check. Oh, by the way. Yeah.
It's always you know, like some some department stores will give you a credit if like, you bought it the day before a sale or whatever. Like how far back would that be reasonable to ask for your money back? Yeah. Maybe your last purchase was the built that that was the ability for that guy to go on retirements right? Because number he needed right.
There you go trip point. That could be alright, well, very good. Guy. You guys got anything else you want to add to it?
No, I think I'm good. I just like to thank owl for coming back on the podcast again. It's always a treat.
Well, I appreciate it. I always enjoy being here. So and this is one we didn't even do face to face I didn't get the benefit of your company. But still we're all it's the modern thing. Right? We all video conference. Now. That's our lives.
Well, thanks a lot for coming on now. Would you like to sign us out?
Of course. That was the macro fab engineering podcast and I was and still am your guest al Williams. And we were
your host, Parker Dolman and Steven Craig. Later, take it easy.
Al Williams returns to talk about FPGAs (Field Programmable Gate Arrays) and how to get started.
Al Williams returns to the podcast to discuss FPGA documentation and meat balloons.
Stephen brings up alternative uses for assembly layers in PCB design and Parker uses OctoPrint!