Monthly Archives: August 2013

10. Line the Fractions up (In Order)

I remember once in a computer class, a fellow student asked the lecturer about “vulgar fractions”. It immediately became obvious that the lecturer didn’t know what a vulgar fraction was. I would not expect that a reader of this post didn’t know what a vulgar fraction is, but the lesson of that class was that one has to allow for the possibility. A vulgar fraction is one that has a horizontal line with a numerator on top and a denominator below. When I was little, this was just called a “fraction”, but in that class all those years ago, the default format for a fraction was a decimal fraction.

One thing about decimal fractions: you know what order they go in. They really do serve us best for many practical purposes for which vulgar fractions used to be more common. I have to admit that I cannot immediately imagine seventeen sixty fourths of an inch. (To save you scratching your head, it is 6.746875 mm) On the other hand, sometimes the vulgar fraction is more natural. My first career was as an acoustician. There used to be a rule of thumb for the design of a rectangular room for listening to music in. The adage used to be “avoid whole number ratios of room dimensions”. There were two things wrong with this. The first, that as a rule of thumb, it really wasn’t good enough, and the second was that it wasn’t really obvious how to do that.

The size and shape of a cuboidal room can be fully specified by three numbers: height h, width w, and length l. The shape (without the size) can be specified by any two of three ratios: w/h, l/w, and l/h. The relationships between these ratios are determined by a single multiplication:
l/h = w/h  x  l/w
The task of exploring this relationship with a single multiplication suggested a slide rule to me. I converted to decimal all vulgar fractions with integer numerators and denominators in the range 1 to 16. There were some simplifications. I chose to look only at fractions that were greater then one. (I could have looked at fractions that were all less than one, and then hung it upside down.) I then sorted the fraction values into numerical order. I placed these on two strips of paper with a log scale. These worked like the “C” and “D” scales on an ordinary slide rule. If you chose a value for (say) the ratio of width to height for a room (w/h), and placed the “1” of the top scale on that value on the lower scale, then complying with the adage amounted to finding a spot where both scales were free of vulgar fractions. This point would correspond to l/h on the top scale, and l/w on the bottom scale.

It was interesting that the vulgar fractions were not evenly spaced, and there were gaps: that is there were opportunities to “avoid whole number ratios”

I have recently recalculated the value of vulgar fractions with numerators and denominators in the range 1 to 16, and I have tabulated them. Here is just a tiny bit of the table I generated:

You can see the whole table here .

In the application, it seemed that the lower the whole numbers were, the more significant the whole number ratio was. I devised the “weight” to give each ratio, evaluated as follows:
Weight = 1/(Numerator * Denominator)
A strange and interesting pattern emerged on my slide rule. I might figure out how to reproduce this pattern to show it to you. I will come back to this.

Some years later, another application for the slide rule emerged. The task was to design a frequency shift keyed (FSK) modulator. The usual scheme at that time was to use a VCO from a phase locked loop chip, and feed the data stream into the voltage control pin. This was easy to set up to nominally give the correct frequencies for a Mark and for a Space, but in the days when the usual tolerances (without paying lots extra) for resistors was plus or minus 5%, and for capacitors was plus or minus 10%, the error budget for the modulator didn’t look too good.

An alternative scheme, was to divide a crystal derived frequency, and to change the divide ratio according to whether a Mark or a Space is required. In principle, this is easy. If the two specified frequencies are:
Mark Frequency = fM
Space frequency = fS,
Then we find the smallest frequency fC for which we can write:
fM =  fC / kM                     (1)
fS =  fC / kS                       (2)
where kM and kS are integers.
We can then start with a clock at frequency fC and divide it by kM to get a Mark, and divide it by kS to get a space.
This is all very well in principle. In practice, we might find that it is not convenient to obtain a clock at exactly fC, but it is convenient to get a clock at some frequency that is close to it. Another problem is that if the integer constants (divide ratios) kM and kS are large numbers, then the hardware required to implement the frequency divisions become excessive, and the frequency fC is inconveniently high. Our error budgeting, will easily show that we can allow ourselves to get pretty sloppy and yet still produce a much more accurate result than with the VCO. How would we choose constants so that instead of the equations (1) and (2), we establish close approximations that give us a very much simpler design. The result might be simpler, but how do we arrive at it? With the reverberant room slide rule! I dug that out, and chose very close approximations for kM and kS, which yielded a design with frequency errors that were a decade lower then with the VCO design, and at lower cost, and no value-critical passive components.

These days we could do all this in software. If we have a spare pin on a processor that is already on the board, we might build the modulator at zero cost. The method for obtaining kM and k might still apply.

Recently I was reminded of all this when another completely different application arose for a clear picture of how the vulgar fractions fall when placed in order. I wonder how many different applications there might be.

Time Passes 1

“Time Passes, but will You?” – Graffito on university lavatory wall.

Time does seem to just go on and on, and there is nothing much we can do about that. There are some restricted senses in which we can make it look as if the pace at which time passes varies. “Look as if” that is, to a particular circuit.

I have two examples. One clever one which was not thought up by me, and another one which was not quite as clever as it looked, which was thought up by me. We will look only at the first one in this post.

I was leading a small development team working on a driverless towing tractor system. These battery electric towing tractors followed a wire set in epoxy in a slot in the concrete warehouse floor. The “guidepath” was the magnetic field around the wire from a 6.25kHz sine wave current. Part of the system was that two way communications were required between the controller on the tractor and the central system controller. The communications scheme chosen for the communication from the tractor to the central control (We called this the “Up” direction) was phase reversal keying of a carrier at (if I recall correctly)  15.625kHz, which was obtained at the transmitter by multiplying the guidepath frequency by 2.5 with a phase locked loop. The transmit modulator was an exclusive OR gate. I was fortunate to engage Roger Riordan, a consulting contractor at the time. Roger is famous for having invented a gyrator (Google “Riordan Gyrator”) and will be known to some readers as the person who set up and ran the business which offered the “VET” anti-virus software for many years. Roger was assigned the task of designing a transmitter to impress the signal onto the guidepath wire. His scheme was to use a winding around a ferrite rod of the type used for a.m. radio reception. The arrangement was roughly as shown here.

In this sketch, “1” is the guidepath wire set in epoxy in a slot about 4 mm wide and 10 mm deep cut in the floor. I do not recall how many turns were wound on the rod, but the full winding had a capacitor across and resonated with a high Q. The drive was by way of a tap near the bottom end of the coil.

All that is just background. Now for the real story. As the Q of the tuned circuit was high, it was necessary to tune it. I do not recall the capacitor value, but it might have been 470nF or so. Certainly far too large to make much impact with a trimmer capacitor. Roger’s trick was to make the tuned circuit “pause” for a short while each cycle. In this way, an LC combination with a resonance period that was a little short, could have that period extended to match the excitation frequency. I used to like to say that “Time stands still for the resonant circuit”.

Consider this circuit, which we will imagine for the moment to be made of ideal components.

This seems to be a funny place to put a switch, and one would imagine that closure of the switch would be a disaster. It would discharge the capacitor pretty promptly! The trick is, that the switch is closed when the capacitor has no charge anyway: at a voltage zero crossing. When the switch is closed, the inductor current flows through the switch, and as we are considering ideal components, this current flows forever, until the switch is opened, when the resonance of the L and the C will go on just as if it hadn’t been interfered with. If we use real world components, there will be losses, but if the switch is not kept closed for too long, the loss will not be too great. The picture below shows the voltage waveform that we get with a short duration switch closure.


The time tD is added to the natural period of the LC to give a new “synthetic” resonant period. The transmitted waveform will look like this:

The delay time was only short: just long enough to ensure that the entire production run could be tuned to the transmit carrier frequency. The distortion of the waveform was of no importance in this application.

Here is a block diagram of the scheme. There could well be records extant with more details, but they are not to hand as I write this.

I have corresponded with Roger recently about this clever trick, just to make sure that I should not have been giving someone else credit for the idea. Roger tells me that it was all his own. He also played a major part in the receiver design. There were many troublesome aspects to that project, but once we worked out what phases to expect the signal at at the receiver, this communications channel facility was a trouble free design.

I will come to the other example of the interfering with the passage of time for a circuit in another posting.


Learning about LTspice

(An aside. I have had terrible trouble getting this Blog post to you. WordPress has fought me all the way. I still don’t know why so much user hostility has been programmed into it, but work-arounds have been found and here we are. I would like to acknowledge the help of the people from my site provider, Zuver. Thanks, Guys!)

On Tuesday the 23rd of July, I attended a seminar on LTspice. This was put on by the Arrow people. The speaker was Mike Engelhardt, the author/creator of LTspice. Mike is a proficient and entertaining speaker. We could tell that he was enjoying himself. Well he might, as it seems that he has a lot to crow about. He listed the respects in which he can claim that LTspice is superior to any other spice simulation package that is available to the public. The claims really are big. In taking in the Engelhardt story, we face a stark choice. We have to make one interpretation or the other – seems to me that there is no middle ground. The choice is this: Either we have to conclude that Mike really is laying it on a bit thick, or that LTspice is pretty special, and really is superior to other spice invocations – in spite of the fact that it is free. My bullshit detector did not go off, and I am inclined to the second view.