Is the simulator broken? - Page 1
Forum section: electronics / beginners

author: iletthesmokeout
author_rank: Newbie
timestamp: January 16, 2016, 11:27:28 am
content: Hey, gang, I'm trying to build a really basic circuit, a simple sawtooth generator. It seems to me it ought to work, tina thinks it works... for three pulses. Then stops. This has me scratching my head. Seems to me it should work or not. Can anyone explain this observed behavior? Or should I believe tina ti is broken? Here's a screen shot of what I did and what it has to say. Thanks!

author: Rerouter
author_rank: Super Contributor
timestamp: January 16, 2016, 12:15:34 pm
content: for really basic proof of concept stuff i prefer falstads circuit simulator (online java applet), the more powerful the simulation package the more unknowns you have to fill in, so for proofing aim simple,http://www.falstad.com/circuit/

author: awallin
author_rank: Frequent Contributor
timestamp: January 16, 2016, 08:23:38 pm
content: the SPICE engine might suddenly decide to increase the simulation time-step. See if there are adjustments for the maximum time-step and make that 1/100 th of the sawtooth period or smaller.

author: TerminalJack505
author_rank: Super Contributor
timestamp: January 17, 2016, 01:10:09 am
content: The SCR is latching-up and staying on.Try something like this...

author: AlxDroidDev
author_rank: Frequent Contributor
timestamp: January 17, 2016, 02:25:59 am
content: Quote from: TerminalJack505 on January 17, 2016, 01:10:09 amWhat software is that you are using?

author: TerminalJack505
author_rank: Super Contributor
timestamp: January 17, 2016, 02:33:00 am
content: That's the full version of Tina Educational from DesignSoft.You can download a free version from TI called Tina-TI. That's what the OP is using. Tina-TI is somewhat limited--it won't do digital or mixed-mode simulations, for example--but it's still pretty powerful.A lot of people on the forum use LTspice. So if you're looking for a circuit simulator then keep it in mind as well.

author: miguelvp
author_rank: Super Contributor
timestamp: January 17, 2016, 02:33:45 am
content: Link just in case it's hard to findhttp://www.ti.com/tool/tina-ti

author: AlxDroidDev
author_rank: Frequent Contributor
timestamp: January 17, 2016, 02:38:14 am
content: Quote from: TerminalJack505 on January 17, 2016, 02:33:00 amThank you. I downloaded TINA a few days ago, but I didn't install it yet. I'll check it out.

author: iletthesmokeout
author_rank: Newbie
timestamp: January 17, 2016, 02:57:58 am
content: Thanks, yes I understood it was claiming latchup was occurring; I was specifically asking how it could possibly think that occurred after 3 pulses, as opposed to happening right off or not at all. That's the bit I found most confusing.The flaw in my circuit I don't find unexpected; I'm far from expert in circuit design. That said, THANK YOU for the suggestion of inserting that resistor; that may be the solution I was willing to grope toward on my own. You likely save me a pile of time there!Quote from: TerminalJack505 on January 17, 2016, 01:10:09 am

author: TerminalJack505
author_rank: Super Contributor
timestamp: January 17, 2016, 03:11:18 am
content: For what it's worth, when I tried your circuit in Tina 10.2, it pulsed once and then latched up--which is more understandable. So, yeah, the fact that you got three pulses before the latch-up is kind of interesting.

author: iletthesmokeout
author_rank: Newbie
timestamp: January 17, 2016, 03:57:00 am
content: Okay.So it took only a moment to verify that your fix (insertion of that resistor) works, and a bit longer, due to simulation run times, to verify it works really well. I had been experimenting with BE bleed resistors across one or both of those transistors in the SCR, and that worked, but the circuit was very sensitive to component values; when I changed the value of the current source, it broke, and I'd have to tinker the bleed resistor values. Also, the bleed resistor across the pnp was allowing current from the right hand divider to contribute to charging the cap, resulting in my nice straight ramp bowing upwards. So your fix solves all of those problems. I can vary that current source wildly, to change the frequency of the sawtooth, and it continues to work.My current issue is I don't really understand *why* your fix works. The various sources I've found on "make your own SCR" don't discuss anything similar to that. Can you illuminate me on this, please? I'm struggling toward jedi, er, BJT mastery, but obviously have a way yet to go... could it be something subtle like changes in beta with varying collector current? (Guessing wildly here.) Thanks!

author: T3sl4co1l
author_rank: Super Contributor
timestamp: January 17, 2016, 05:01:17 am
content: Poke around with the simulator settings, particularly RELTOL (default 1e-3, try smaller?), ABSTOL, CHGTOL (should be approx. RELTOL * ABSTOL), GMIN and RSHUNT (GMIN = 1/RSHUNT = 1e-9 is pretty reasonable for most), TRTOL (larger makes it change the step size more gradually, related to what awallin said), and select GEAR 2 integration.Tim

author: TerminalJack505
author_rank: Super Contributor
timestamp: January 17, 2016, 05:19:59 am
content: Quote from: iletthesmokeout on January 17, 2016, 03:57:00 amI don't really have a good explanation for how it works since I was just "spitballing" when I came up with it.If you watch the PNP's base during simulation you'll notice that the resistor prevents the PNP's base from being pulled down as low as it would, otherwise. Replacing the resistor with a diode seems to work as well and may be a better solution since it will allow more current to flow through the NPN's collector, which will allow the cap to be discharged faster.If you think about it, the original circuit actuallyshouldn'twork. Or, at least, it is a dodgy design. The SCR probablyshouldact like it does and latch. It is connected to a constant current source, after all, and SCRs stay on until current stops flowing through them. The original design must have relied on the SCR's holding current to be greater than the current that the constant current source provides.

author: iletthesmokeout
author_rank: Newbie
timestamp: January 17, 2016, 06:08:02 am
content: Quote from: TerminalJack505 on January 17, 2016, 05:19:59 amI think it is a little bit cheesy, but it's not quite as bad as all that; remember the divider on the right side. Once the cap is down and the scr's npn starts to shut down, that divider, as it has no RC time constant, can start pulling back up, shutting off the pnp. But with your fix, it's still much better.But I'm still pondering why it works...