Skip to content

v0.6.2

Choose a tag to compare

@github-actions github-actions released this 05 Oct 14:20
· 39 commits to main since this release
2cb9195

Patch Changes

  • 119fa20: A chip whose ground is wired to a breadboard rail that leads nowhere no longer freezes the simulation. Wiring a 555 blinker grounds-first, with pin 1, the timing capacitor and the LED's cathode on a bottom rail not yet joined to the battery, stalled it: the status showed SETTLING with fail=1/1 and the clock stood still until the rail was bridged. The 555's supply current had no way back to the battery except through the 555 itself, so it could never stay powered. Switched on, it pulled the loose rail up to its own supply and starved itself; switched off, the rail fell back to 0 V and powered it again, and the solver never settled between the two. A chip whose supply has no return path outside it now counts as unpowered for as long as it is wired that way: it and anything it drives stay off, the clock keeps running, and the circuit starts the moment the rail is connected. This covers the 555, 74xx and CD4000 logic, the 28C16 and 28C256 EEPROMs, the HD44780 and MAX7219 displays and the LM393, including several of them sharing the loose rail. It does not yet cover a rail that reaches the battery only through a part that cannot carry the chip's supply current, such as a capacitor or an open switch: switching a running 9 V blinker's power off, or pulling its ground wire, can still freeze it, and a separate fix follows. A logic chip wired that way could also read as powered before, its outputs showing levels while no current could flow; it now reads unpowered, like one whose ground pin is not wired at all. Circuits in which every chip's supply is connected are bit-identical.

  • f1dca71: A circuit whose supply drops to 0 V no longer stops converging for good as it settles. Switch an LM317 driving an LED to a 0 V supply and the voltages it has left shrink about 2e14-fold per step; some 20 steps later they are below 1e-308, where floating-point numbers lose their relative precision. The check that each linear solve is accurate compared the solve's error with the size of its solution, and at that size a single rounding step read as an error of 5e-6, over the 1e-8 a step may have, so the step was rejected. A rejected step changes nothing, so every later step met the same state and was rejected too: the simulation stalled with the solver reporting non-convergence, for 16 of 46 load resistors between 50 and 500 ohm. That count is for the solver small circuits use; the one larger circuits use sums the error in another order and got all 46 right, but stalls the same way at other values. The check now compares the error with a scale of at least 1e-300, so those steps pass and the voltages settle at exactly 0 V. Any solve with larger values, which is any circuit carrying a measurable voltage or current, is checked exactly as before, and singular or ill-conditioned circuits are reported as before.

  • b872148: A current-limited bench supply now holds its limit cleanly in two cases where it did not.

    A supply only slightly overloaded crawled. It left constant-current mode as soon as its rail climbed past 98% of the setpoint, so a load drawing just over the limit, whose current-limited rail sits between 98% and 100% of the setpoint (5 V with a 0.1 A limit into 49.9 ohm holds 4.99 V), left CC after every step and re-entered it inside the next one. The readings were right, but the supply's CV/CC state flickered on every step and the adaptive stepper rejected every other step as a regime change, holding the step at 10-15 ns: 50 ms of that circuit took at least 4 million accepted steps, and now takes 25. A load drawing exactly the limit (5 V and 0.1 A into 50 ohm) flickered and crawled the same way.

    A supply with a capacitor across its output delivered past its limit. Settled at 5 V with 100 uF on its rail, a supply whose load stepped to 20% over a 0.1 A limit stayed at exactly 5 V and delivered 0.12 A for as long as the simulation ran. Within each step the supply checks whether its current-limited output comes back at the setpoint, so that a supply whose load is removed holds its setpoint instead of pushing the limit current into nothing. That check accepted anything within a few microvolts under the setpoint, and the capacitor lets an overloaded rail fall only a few microvolts per step at fine steps, so the supply never left CV.

    The supply now leaves CC exactly when its current-limited output reaches the setpoint, and is back in CV in that same step; for a resistive load that is when its draw at the setpoint is back within the limit. An overloaded supply delivers the limit from the first step, a capacitor-backed rail sags toward the current-limited voltage as the capacitor discharges, and a supply whose load is removed still holds its setpoint from the next step. A supply within its limit, including a cold start whose inrush stays under it, never enters CC. Negative setpoints behave the same way, mirrored. DeviceContext.useCurrentLimitComplianceClamp takes a new optional fourth argument, toleranceBelow, how far below the compliance voltage a candidate still counts as reaching it; left out, it is the existing band of 1e-9 + 1e-6 * max(1, V), so custom devices that call it are unchanged.

  • f198ed9: A current-limited regulator (the DC-DC converter, a fixed linear regulator such as the 7805, or the LM317) now holds its limit cleanly in two cases where it did not.

    A regulator only slightly overloaded crawled. The DC-DC converter left its limit as soon as its output climbed past 98% of the voltage it can hold, a fixed linear regulator as soon as its output came within 50 mV of the setpoint, and an LM317 as soon as its output-to-ADJ voltage came within 50 mV of its 1.25 V reference, about 200 mV of output with a 240/720 ohm divider. So a load drawing just over the limit, whose limited output sits in that margin (a 5 V, 1 A 7805 into 4.97 ohm holds 4.97 V), left the limit after every step and re-entered it inside the next one. A fixed linear regulator in dropout did the same at any overload, because every current-limited one short of input headroom was switched to dropout whatever its load. An LM317 measures that headroom from its ADJ pin, which falls as its output sags, so in dropout it did the same only while slightly overloaded: at 6.5 V in with a 240/720 ohm divider, up to about 3.7% over. The readings were right, 4.97 V at 1 A, but the regulator's state flickered on every step and the adaptive stepper rejected one attempted step in three to five as a regime change, so the simulation crawled at about 12 ns steps: 20,000 steps covered at most 0.2 ms, where 50 ms now takes 25 steps.

    A regulator with a capacitor on its output delivered past its limit. Settled at 5 V with 100 uF on its output, a 1 A regulator whose load stepped to 0.2% over the limit stayed at exactly 5 V and delivered 1.002 A, and an LM317 at 4.97 V with a 0.1 A limit delivered 0.121 A when its load stepped to 21% over, with the state flickering on every step and the adaptive stepper stuck at its first, finest steps. Within each step the regulator checks whether its current-limited output comes back at the voltage it can hold, so that one whose load is removed holds its setpoint instead of pushing the limit current into nothing. That check accepted anything within a few microvolts under that voltage, and at fine steps the capacitor lets an overloaded output fall only a fraction of a microvolt per step, so the regulator never left regulation. Loads a few parts per million over the limit flickered the same way.

    Each regulator now leaves its limit exactly when its output reaches the voltage it can hold, the setpoint or the dropout ceiling, and stays in current limit until then; for a resistive load that is when the load's draw there is back within the limit. An overloaded regulator delivers its limit from the first step, a capacitor on its output discharges toward the current-limited voltage, and a regulator whose load is removed still holds its setpoint from the next step. A regulator within its limit is unchanged, and one charging a capacitor through a resistor still leaves current limit when the charging current falls to the limit, on the same trajectory.