1
\$\begingroup\$

This is the working circuit :

Final Image

I have researched it quite a lot in the past few hours but still I don't understand what the error is about.

The problem

When I add a switch, it gives an error (I am quite a noob with Proteus and electronics):

Another Problem Circuit

Textual Error Details

\$\endgroup\$

2 Answers 2

1
\$\begingroup\$

Ground the switch, not the positive and before doing the simulation, turn off the switch, then do the simulation and you can put it on. I had a similar problem and it worked.

\$\endgroup\$
0
\$\begingroup\$

Switches are not easy to model, particularly ideal ones. These introduce instantaneous current discontinuities.

Circuit modeling software is just a differential equation solver with a circuit-based interface. A variable discontinuity in time is what is known as a “shock” in diffeq parlance.

Shocks require specialized algorithms to handle them. A normal algorithm would just try to reduce the simulation time step size until it hits the resolution limit, that’s the error you are getting.

You should be able to model it by making the switch more real, by placing a very small capacitor (a few pF) in parallel with it. But there is no guarantee as a discontinuity in a branch current will still be present.

The proper way would be to specify a switch model that avoids all the discontinuities altogether (e.g., a resistor whose value quickly increases), but I am not sure if Proteus allows for that.

\$\endgroup\$
4
  • \$\begingroup\$ Thanks Edgar, I did try that, although nothing changed, it still gives the same error : "[SPICE] TRAN: Timestep too small; timestep = 5.55112e-017: trouble with node #00006." \$\endgroup\$ Commented Nov 2, 2018 at 17:03
  • \$\begingroup\$ Try a big capacitor to see if it will work, look at the time step, then lower it as needed. \$\endgroup\$ Commented Nov 2, 2018 at 17:06
  • \$\begingroup\$ What is a time step and what am I to look for into it ? Like should it be low , or should it be higher , something like that ? \$\endgroup\$ Commented Nov 3, 2018 at 2:16
  • \$\begingroup\$ Well, the simulator is telling you that 5.5*10^-17 is too small. So it should be higher than that. The time step is the time resolution of the simulation, and it will depend on other parameters like the voltage resolution desired. If your circuit generates a 1Hz sinusoid, you would likely have a time step of at least 10ms to be able to represent it (100 samples per cycle). \$\endgroup\$ Commented Nov 3, 2018 at 2:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.