The period a delay lengthens
Assumes: Two thresholds because there is a floor · One step, computed twice
The previous essay’s two thresholds exist to stop a decision being made more than once. Wire the comparator’s output back to the capacitor on its own input through a resistor and the same two thresholds do something else: they set a period, and the circuit is an oscillator that has nothing to do with resonance, poles or a frequency-selective network.
It is also the second oscillator in this field, and the contrast with the first is worth having in advance. That one’s frequency is set by a network’s phase and its amplitude by a nonlinearity. This one’s amplitude is set by the comparator’s output levels — trivially, exactly, and with no dynamics at all — and its frequency by a charging exponential. Everything difficult about the first is easy here, and vice versa.
The closed form
The capacitor charges towards whichever output level the comparator is at, through the resistor, and the comparator changes state when the capacitor reaches a threshold. Starting from heading for , the time to reach is , and the other half cycle is the same by symmetry:
With 10 kΩ, 100 pF and β = 0.5 that is 2197.2 nanoseconds, or 455 kHz.
There is nothing approximate in it. The exponential is exact, the thresholds are exact, and the symmetry is exact — which is unusual for a design expression in this collection and makes the comparison below clean, because any difference between the marched period and this number is attributable to something identifiable.
The march recovers it
Marching the netlist with an instantaneous comparator and no delay must return that number, and it does as the step shortens:
| steps a cycle | measured period | excess |
|---|---|---|
| 1000 | 2206.0 ns | 8.79 ns |
| 2000 | 2201.6 ns | 4.39 ns |
| 4000 | 2199.4 ns | 2.20 ns |
| 8000 | 2198.3 ns | 1.10 ns |
The excess halves every time the step halves, and it is exactly four times the step at every one of those rows. That is the discretisation and nothing else: the comparator’s flip is applied at a step boundary rather than at the interpolated instant of the crossing, so each transition is late by up to one step, and the capacitor’s overshoot during that lateness lengthens the next half cycle as well.
Which is a small preview of the essay’s whole result, arriving as a numerical artefact before it arrives as physics: a late transition costs more than its own lateness.
That the excess falls by exactly two when the step is halved rather than by four is itself informative, and one step, computed twice is where the expected rate is established: a step response walked forward in time differs from the exact one by the trapezoidal rule’s own error, which falls by a factor of four every time the step is halved. Here the error is first order in the step rather than second, because it is not the integration rule that is wrong — the rule is doing what that essay measures — but the event, which is applied at a step boundary instead of at the interpolated instant of the crossing. A marched circuit with a threshold in it therefore converges more slowly than the same circuit without one, and the distinction is visible in the exponent rather than in the size.
What a real comparator does
A comparator responds late. The threshold is crossed, and some tens of nanoseconds later the output moves — a delay that is a property of the part and is one of the two numbers a comparator is sold on.
The naive accounting is that each half cycle is lengthened by the delay, so the period grows by twice it. The measurement says otherwise:
| delay | excess over the closed form | excess ÷ delay |
|---|---|---|
| 11 ns | 29.1 ns | 2.65 |
| 22 ns | 58.2 ns | 2.65 |
| 44 ns | 116.5 ns | 2.65 |
2.65, not 2. The extra is that during the delay the capacitor does not wait: it keeps charging the way it was going, so when the flip finally happens the capacitor is past the threshold, and the next half cycle starts further out and takes longer to reach the opposite threshold.
The size of that is derivable. During a delay the capacitor moves by to first order; a half cycle that starts further out is longer by ; and adding the delay itself gives a half cycle longer by . Doubling for the two halves:
At β = 0.5 that is 2.667 against a measured 2.650 — 0.63% apart, and the shortfall is the second-order term, since these delays are one to two per cent of the period.
Five divider ratios
A relation with a parameter in it should be checked at more than one value of the parameter, and this one is checked at five:
| β | measured slope | 4/(1+β) | departure |
|---|---|---|---|
| 0.1 | 3.633 | 3.636 | −0.09% |
| 0.3 | 3.050 | 3.077 | −0.87% |
| 0.5 | 2.650 | 2.667 | −0.63% |
| 0.7 | 2.333 | 2.353 | −0.83% |
| 0.9 | 2.100 | 2.105 | −0.25% |
Every departure is negative and under one per cent, which is the signature of a first-order expression being measured at a finite step rather than of a wrong expression. And the whole range is above two: the naive answer is optimistic at every divider ratio there is, most so at small β, where the thresholds are close together and the capacitor is moving fastest when the flip is due.
That last point is the design one. A relaxation oscillator with narrow hysteresis is a relaxation oscillator whose capacitor is travelling quickly through its thresholds, so a fixed delay costs proportionally more of the period — the two effects reinforce rather than cancel.
How the slope is measured
The measurement above needed one piece of care, and it is the only place in this field where the discretisation is visible in a claim rather than in a residual.
The comparator’s flip is applied at a step boundary, so a delay is effectively rounded to a whole number of steps. Measuring the excess at a single delay therefore carries up to half a step of error — which at 50 ns and a 0.27 ns step is half a per cent, but at 5 ns is five per cent, and the first version of this sweep returned slopes of 2.42 and 3.57 that moved with the step count rather than with β.
The repair is to take the slope between two delays that are both exact multiples of the step, so the rounding cancels exactly. The two used are forty and a hundred and sixty steps, which at these values is 11.0 and 43.9 nanoseconds — realistic delays for a fast comparator, and a range over which the second-order term is still under a per cent.
The edge, in the units a designer has
Turn the slope into the question a datasheet has to answer. If a comparator’s delay is and the period must be within a fraction f of the closed form, then
so a 50 ns comparator at β = 0.5 holds one per cent only below 75 kHz. The naive estimate — two delays per period — would have said 100 kHz, so the rule is optimistic by a third exactly where a designer would rely on it.
At a tenth of a per cent it is 7.5 kHz. At β = 0.1, where the slope is 3.64, the same comparator holds one per cent only below 55 kHz.
And a fast comparator does not remove the problem so much as move it: a five-nanosecond part holds one per cent to 750 kHz, above which the period is again being set by the part rather than by the resistor and capacitor the design chose.
What else moves the period
The delay is the interesting term and it is not the largest one in most circuits. For completeness, what else is in the expression:
The resistor and capacitor themselves. A 5% capacitor is 5% of period, directly. This is why a relaxation oscillator is used where a few per cent is acceptable and a crystal where it is not.
That sentence assumes the capacitor is 5% of something, and for the part most likely to be fitted here it is not. The capacitance that is not one number measures a class II ceramic at its rated voltage and finds three different capacitances depending on which question is asked — 2.000 µF as a slope, 5.814 µF as a charge average, 2.105 µF as a bridge reads it — on a part printed as ten. The quantity this circuit is sensitive to is the slope, since the period is set by how much charge moves the voltage a threshold’s worth, and the slope is the smallest of the three. A tolerance band around the printed number therefore says nothing at all about the period: the part can be inside its 5% specification and set a period two and a half times too short. The coefficient that is about one reading closes the escape route, showing that the printed temperature coefficient is a coefficient of the one capacitance a bridge reports at zero bias, that one number cannot determine the two parameters the part has, and that two parts a bridge cannot tell apart differ by 1.80 at the voltage they are used at. A relaxation oscillator built with a C0G dielectric is a few per cent circuit; the same oscillator built with a class II part is not a specified circuit at all.
And the resistor and capacitor are two parts rather than one. The tolerance that is not on any part is the arithmetic for that: the worst case of a combination is the sum of the tolerances and does not improve with the number of parts, while the measured spread of a population shrinks as one over the root of the count — 0.29 of a per cent for four one per cent parts against a worst case of one. So the period of any particular unit is better than the worst case by a factor that is not a design margin, and the number a specification has to carry is the worst case anyway.
The threshold ratio. β enters through a logarithm, so it is the forgiving one: a 1% error in the divider moves by 0.9% at β = 0.5 and by 1.0% at β = 0.1.
The output levels. They cancel exactly in the closed form — the thresholds are proportional to the output and so is the charging target — so a comparator whose output swing changes with temperature has no first-order effect on the period at all. That is the one genuinely good property of this circuit and it is worth noticing, because it is not obvious and it is the reason the topology survives.
Where the thresholds come from. They are solved rather than taken from a divider expression, and two thresholds because there is a floor is where that solve is done and where the obvious expression is found to be nine per cent out — because the input drives through a resistor into a node the comparison holds at the reference, so the two resistors carry currents rather than forming a ratio.
The comparator’s output impedance. Not modelled here. It adds to R directly, so a part with fifty ohms of output impedance driving a ten-kilohm resistor is half a per cent of period.
The half nobody measures: the duty cycle
Everything above is about the period, which is the sum of the two half cycles. The difference between them is a separate quantity and it has a reader downstream.
In the model marched here the two halves are identical by construction: the same delay applies to both transitions, the two output levels are equal and opposite, and the thresholds are symmetric about the reference. So the duty cycle is exactly one half and the delay lengthens both halves equally.
A real part breaks all three. Its rise and fall delays differ — a datasheet quotes both and they are rarely equal — its two output levels are not symmetric about anything unless it is driven from split supplies, and its input offset moves the pair of thresholds together, which lengthens one half and shortens the other. Each of those is a first-order asymmetry in the duty cycle and none of them changes the period much: a comparator whose fall delay is fifty nanoseconds and whose rise delay is thirty adds 2.65 × 40 ns to the period and 20 ns of asymmetry between the halves.
Twenty nanoseconds out of 2.2 microseconds is 0.9% of duty-cycle error, which for a clock is uninteresting and for a transformer drive is not, because the magnetics field has already measured what an asymmetric drive does to a core.
So the interesting asymmetry in this circuit is not in its period at all, and the measurement that would catch it is one this essay does not make: two delays instead of one, marched separately, with the difference between the half cycles reported rather than their sum. It is the clearest thing left open here, and the machinery for it is already in place — the delay is applied by a closure that sees which transition is pending, so giving it two numbers instead of one is a change of a line.
The delay that is two delays makes that change, and three of its results are worth having here because they contradict the estimate above rather than confirming it. The duty cycle moves by 0.28 per cent for twenty nanoseconds of skew, not the 0.40 the obvious expression gives — so the same overshoot that lengthens the period also partly compensates the asymmetry, and the naive arithmetic is pessimistic here having been optimistic there. More hysteresis improves the duty cycle and worsens the volt-seconds at the same time, which means the resistor ratio that this ladder’s rung below chose for noise immunity cannot be chosen for the transformer as well. And ten nanoseconds of skew saturates a hundred-turn core in 231 cycles, which is the number that decides whether any of it matters.
That last one lands on a boundary measured in another field entirely. The flux that walks is why a small asymmetry is not a small error: a drive whose two half-cycles differ by one per cent in volt-seconds adds the same area to the flux every cycle and reaches saturation after 64 of them, and halving the drive gives 128 rather than removing the problem — there is no amplitude at which the design is inside a limit. A boundary in volt-seconds supplies the limit being walked towards, and it is the one quantity in this chain with no frequency in it: N·Ae·Bsat, 3.500 mWb-turn for the core measured there. A comparator’s two propagation delays, quoted in nanoseconds on a data sheet page about switching speed, are an input to that arithmetic.
Two oscillators, side by side
The field now has both classical kinds and it is worth putting the comparison down.
| Wien bridge | relaxation | |
|---|---|---|
| frequency set by | a network’s zero-phase point | a charging exponential |
| amplitude set by | a nonlinearity, measured | the output levels, exactly |
| condition to oscillate | loop gain exactly 1 | loop gain above 1 |
| what the waveform is | nearly a sinusoid | a triangle and a square |
| what a delay costs | a phase shift, 4.45/ρ of frequency | 4/(1+β) times itself |
The row that matters is the third. One of these circuits is specified by an equality and needs a mechanism to hold it; the other is specified by an inequality with three orders of margin. That is why a relaxation oscillator can be built out of anything and a Wien bridge cannot, and why this one’s errors are all in its period while that one’s are all in its amplitude.
The gate
The period grows by 4/(1+β) times the delay, at five divider ratios, to better than one per cent.
And that is more than the naive two at every ratio, which is the essay’s claim rather than the agreement.
The excess falls as the thresholds move apart, monotonically — because a wider swing spends less of itself on the overshoot.
With no delay the marched period converges on the closed form as the step shortens, the excess halving with each halving of the step, so the 4/(1+β) is measured against a number the march agrees with rather than against a formula it was compared to.
The last of those is the one that makes the rest usable. A marched measurement compared against a closed form is only as good as the agreement in the case where the closed form is exactly right, and here that case exists and is checkable: remove the delay and the two must coincide. They do, at a rate the step size predicts. Everything measured with the delay put back is then a difference between two numbers of known provenance rather than a number with an unknown offset in it.
That structure is worth naming because it is available more often than it is used. A model with a parameter that can be set to zero, and a closed form that is exact at zero, gives a free calibration of the whole apparatus at one point — and any measurement made away from that point is then a difference rather than an absolute. What it does not give is a check on the shape away from zero, which is why the slope is measured at five divider ratios rather than one and compared against an expression containing β.
Part 2 on hysteresis
One argument about Hysteresis, and one of 5 essays on it so far, each part numbered by how much of the idea it assumes. What sits either side of it:
What links here
Essays that reach for this one mid-argument — the half of a link its own author cannot write down.
The objects named here
The third axis, after the field and the idea: the things themselves, and every essay that touches each one.
Charging exponentialCompanion modelHysteresisNumerical errorPropagation delayRelaxation oscillator