Andromeda blog

Top of blog

2-threshold inverter (software) - 4 Oct 2019

Below is the behavior of an accumulating 2-threshold inverter (also known as an inverting schmitt trigger), where the input is 0 V, the output is initially 0 V, and the capacitor is fully charged to 5 V: With time, the voltage across the capacitor falls exponentially toward the input, and as it reaches the (lower) negative-going threshold, it causes the output to go high. In this case, the output of the overall component is the same as the threshold unit (i.e. there is no final trigger unit).

If the output is connected to the input, this becomes a simple binary oscillator. As the output changes value, the capacitor tracks it exponentially, and as the capacitor reaches the (higher) positive-going and (lower) negative-going thresholds, the output changes state again and again: At each moment, the slope of the capacitor curve is proportional to the difference between its current voltage (anywhere from 0-5 V) and the input voltage (only 0 and 5 V).

Below are plots of the output of the 2-threshold inverter oscillator for different values of the slope proportion (rows from 125 V/s per volt difference, up to 2000 V/s per volt), and for different values of the two thresholds (columns from 4.5 to 2.75 V for the upper threshold, and from 0.5 to 2.25 V for the lower threshold). Both of these changes affect the output frequency of the oscillator: (Click image for full size)

The software behaves differently than the corresponding hardware in at least 2 ways:

1. The software capacitor changes slightly faster than the real capacitor. Although the slope of both curves is proportional to the difference in voltage, the software is a discrete program that calculates new points by following the tangent to the curve at existing points. Since this curve is concave up for decreasing values, and concave down for increasing values, the tangent method will calculate new points that are closer to the asymptote than they are for the real capacitor, as if the RC constant was slightly smaller.
2. Again due to the discrete nature of the software, the capacitor curve will slightly exceed the bounds formed by the two threshold lines before the output inverts, whereas the real inverter will switch almost instantaneously, with only a very short delay, whenever the curve reaches the corresponding threshold.

Both of these issues can be mitigated by reducing the software step size, but they can never be completely eliminated. Hopefully these, and other slight differences between the real and software components, will not have an appreciable effect on the general output of the system. Even so, it is important to realize where these differences occur, and in which cases they can be ignored, and in which cases they cannot.

For example, below are plots for a slope proportion of 2500 V/s per volt difference. In the top plot, the software step size was 100 microseconds, while in the bottom plot the step size was 10 us: The impulse response of the 2-threshold inverter depends on both the pulse width (actually the area) and the capacitor slope proportion (the RC constant). Starting from 0 V, the capacitor must charge enough to reach the upper threshold in order to cause the output to switch. At left below are different pulse widths, while at right are narrow pulses but different slope proportions (getting steeper from top to bottom):  (Click images for full size)

Here is a set of 5x5 runs for changing pulse width (from top to bottom) and slope steepness (from left to right). The middle column is the same as the left plot above: (Click image for full size)

Pulses can also be repeated. Below is a set of 6x6 runs varying the periodic pulse ON time (at 5 V) from top to bottom, and the OFF time (at 0 V) from left to right. Plots on the diagonal have equal ON and OFF times, and are therefore square wave signals. The capacitor charge variation must span both threshold lines for sustained switching to occur: (Click image for full size)

Below is a set of 10 runs with inputs consisting of square waves of decreasing frequency. The output of the 2-threshold inverter is a sharp low-pass cutoff of the input, including a slight phase shift (the time to charge the capacitor to the upper threshold). When the input changes quickly, the capacitor does not span both thresholds, and there is no output: (Click image for full size)

In general, we see that for the 2-threshold inverter:

1. The impulse response is either nothing (no change in output, which begins at 5 V), or it is a single (down/up) pulse of about the same width as the input, delayed by the time it takes the capacitor to charge to the upper threshold.
2. As the input impulse becomes longer it eventually qualifies as a step, so that the step response is also a step (down), delayed by the capacitor charging time.
3. With respect to square waves (periodic impulses with the ON time and OFF time equal), the 2-threshold inverter acts as a low-pass cutoff filter, again with a delay.
4. In addition, when self-connected, the 2-threshold inverter generates a binary periodic signal which can be tuned with a resistor and capacitor.

Although these properties may not sound very interesting on their own, they might be able to generate a wide(r) range of behavior when circuits are created with more than one inverter, hooked together in different ways.

Next time: 2-threshold inverter (hardware).