Wednesday, December 10, 2014

Dead Space

Mathematically:

f(x) = 0             a < x < b;
f(x) = (x - b)     x > b;
f(x) = (x + a)    x  < a .

The transfer function (from Johnson 'Analog Computer Techniques', 1956, page 115) looks like this:


 Here's my realisation of the circuit (sans vacuum tubes):
The final thing has two separate channels:


Saturday, December 6, 2014

Equality

My second (and this time successful) attempt at what I naively assumed would be a straightforward thing to implement: to test when two voltages are 'equal':


The INA128 (which has very low offset voltage) is configured to give a gain of about 500; any significant difference in X and Y input voltages gives rise to a significant voltage (positive or negative) - the TL071 op amp inverts the output of the INA128; the output of this op amp and the direct output are put through the Schottky diodes - hence regardless of the sign of the voltage difference, the base of the first transistor is driven high when X does not equal Y. The base of the second transistor goes high when X = Y, as does its emitter! 

The actual circuit has two independent X = Y channels:


In the scope display below, the horizontal axis is 20 microseconds / division; the triangle wave (i.e. X) (5 kHz) is 20 mV / division; Y = 0 volts. The X = Y output (which appears on the computer's front panel) is 0 to 10 V. In practice, the circuit detects X = Y when X is within +/- 10 mV of Y, for X and Y in the range -10 V through +10 V.


The DG403 chip (shared between channels) provides normally open and closed switching - these outputs also appear on the front panel.

Sunday, November 30, 2014

Inequality

This circuit detects X < Y - it is what in the old days was called a differential relay (a single pole double throw switch driven by the output of an operational amplifier) - in this circuit the relay of old is realised via a CMOS analog switch (DG403). In my circuit, the output of a INA128 instrumentation amplifier drives a couple of transistors to get the gain up enough so that the output switches for about a 5 mV difference in inputs. An LED on the computer's front panel will indicate X < Y; there is a 10 V output also for this condition.




Next board is X = Y (which is proving surprisingly complicated!)

Saturday, November 22, 2014

Off On a Tangent

Have finally completed the special function circuitry...in the end I moved (temporarily) to the dark side...buying a few AT28C64B EEPROMs and a MiniPro TL866 programmer.

The EEPROM is sandwiched between a AD7820 8 bit ADC and a AD7224 DAC. The ADC drives eight of the (64K) EEPROM's addresses; one is driven by the output of a sign detection op amp; the remaining four address bits are connected to a Lorlin binary-coded (16-position) rotary switch. Each switch position gives a separate function. The ADC / DAC are clocked at about 360 kHz.

The absolute value of the input voltage (scaled so that 0 - 10.2 V input voltage maps to 0 to 5.000 V at the input to the ADC), drives the ADC; the sign of the input voltage drives an address bit of the EEPROM. Hence negative and positive halves of the function's domain occupy separate parts of the memory.

Here's the circuit. The MC14495 display drivers and displays (included in anticipation of the thing not working!) were omitted in the final design.



The contents of the EEPROM was cooked up using a MATLAB program - it's easy enough to have any functions (single-valued!) I like - I've opted for the usual suspects - sine, cosine, tangent; their inverses; their hyperbolic cousins; logarithm, exponentiation...plus some slightly more esoteric things (Bessel, error, gamma...)

sine


tanh

cosh
tangent
Negative and positive overflow are determined by all zeros or all ones from the EEPROM output - using a NOR gate and NAND gate respectively; since the pin-outs of a 4068 and 4078 are the same I got away with piggy-backing the chips:


(Reminds me of when I had a TI-59 calculator - needless to say I dismantled the thing to have a look...I think I am correct in saying that at least one of the chips (TMC 0583?) was soldered (presumably by hand!) directly onto another chip...that was an amazing bit of circuitry - it even had a LM324 quad op amp in there...)

Saturday, September 27, 2014

Sine of the times

The remaining big part of the computer is a means of generating certain special functions (sine, cosine, their inverses, and desirably, Bessel and the like) of a voltage. Two attempts so far. The first (converting a ramp waveform into a sine wave; sampling the sine wave when the input voltage (x) equals the ramp voltage) ended up as being considered too complicated and capricious. The second, resorting to a classical diode function generator (DFG), made the component count of the first attempt look positively pedestrian...


That's a sixteen breakpoint DFG - and (if set correctly!) would do just one function. Even replacing the potentiometers with resistors would leave an awful lot of parts and board space. The third attempt - which is still on the drawing board - is looking a tad digital...

Sunday, September 7, 2014

Roots and Powers

The root and power board returns x^m or x^1/m, where m is equal to 1, 2, 3, 4, 5 or 6 (this choice being governed principally by the availability or otherwise of selector switches).

Based on the Analog Devices' AD538 chip, plus some circuitry to carry the sign through where appropriate.

I've built three of these.



Next is the sine, cosine and the like...

Wednesday, July 23, 2014

Scaling a Simple Jerk System

In this context jerk is the rate of change of acceleration...

Presumably this is all well known to most people, but I find it interesting that (certain?) chaotic systems can be written in jerk form...

dz/dt = J(x,y,z)

where J is (some?) function of x, dx/dt, and d2 x/dt2 i.e. with y = dx/dt and z = dy/dt = d2 x/dt2 .

For example (Sprott [1], equation (10)):

d3x/dt3 = -a d2 x/dt2 + (dx/dt)2 -x .

Which - as Sprott says - is chaotic for 'a small range of the single parameter a around 2.02'.

Writing out the three equations gives something to wire up:

dx/dt = y

dy/dt = z

dz/dt = -a z + y2 - x .

I tried patching these up directly - but the thing overloaded - so nothing for it but to have a go at scaling. After looking in several books (and being not much the wiser - I generally need to construct things for myself using more, smaller, steps than most books seem to offer), I decided to just write down:

u = x/2, v = y/2 and w = z/2 → x = 2u, y = 2v and z = 2w .

Hence

d(2u)/dt = 2v → du/dt = v;

d(2v)/dt = 2w → dv/dt = w;

d(2w)/dt = -2wa + (2v)2 → dw/dt = -aw + 2v2 - u.

I guess it's obvious (in hindsight) that it's the non-linear bit of the equations which ends up with the scaling. I patched these 'scaled' equations up:


One nice things is the elegance of the patching, in the sense that the integrators form a simple chain.

In FAST mode the computer produced this the following. This proved stable - but only for a small range of values for parameter a:



Slowing things down (i.e. 1 μF integrating capacitors / 1 M ohm input resistors) gave the following pen plot - but note it goes awry after half a dozen 'orbits'...


The final part of [1] alludes to jerky Lorenz-like systems, which involve - amongst other things - functions like tan and hyperbolic sine :) But these will have to wait awhile, whilst the final(?) rack of my computer gets some attention...this - it is planned - will furnish sine, cosine, tangent, and their hyperbolic cousins...

[1] Sprott, J. C., 'Simplifications of the Lorenz Attractor', Nonlinear Dynamics, Psychology, and Life Sciences, 2009, Vol. 13, No. 3, pp. 217 - 278.






Friday, July 18, 2014

Another Day, Another Attractor

...a frisky* little quadratic nonlinearity attractor, found in [1]...

dx/dt = -z,

dy/dt = -x2 - y,

dz/dt = 1.7 + 1.7x + y.

(Initial conditions 1, -0.8 and 0.)




* evidently very sensitive to the 1.7 multiplicative factor on the x term.

[1] Elegant Chaos: Algebraically Simple Chaotic Flows (Julien C. Sprott, World Scientific, 2010), Fig 3.9, page 71, SQM.

Thursday, July 17, 2014

Chaotic Behavior and Shil’nikov Homoclinic Orbits

My exploration of chaos continues...equation (5) from Sprott's paper:

dx/dt = -y - z

dy/dt = x

dz/dt = a(y - y2) - bz , with a = b = 0.5.

This was interesting because the first attempt ended in failure (i.e. overload condition on all the amplifiers); a bit of sleuthing uncovered a typo in equation (5) for the dz/dt term (the final x should, in fact, be a z)...and voila...
It is the Rössler prototype-4 system, apparently. The picture below shows how I figured out the patching (I have taught myself to mark up each connection on the diagram with a highlighter pen, as I patch that lead physically on the computer...this avoids my getting into a complete mess...). Also, you can see the crossed out part of the first, wrong, attempt...




Saturday, July 12, 2014

Self Propelled Flowers

I have come across another interesting paper [1] which has several examples of chaotic systems. I've taken to working my way through these systems, beginning with the classic Lorenz attractor.

Amongst other things, the paper gives a set of equations (2), which are derived by applying a linear transformation to Lorenz's original equations, giving

dx/dt = α(y - x)

dy/dt = -xz -γy

dz/dt = xy - β/α - βz ,

where the new dimensionless parameters are given by α = √(σ/r), γ = 1/√(σr), and  β = b/√(σr).

Using Lorenz's (classic butterfly) σ = 10, r = 28, and b = 8/3 values, gives α = 0.598, β = 0.159, and γ = 0.0597. This approach is useful because it allows direct patching on the 10 V computer.

I patched the above system of equations, with the above parameter values, like this:


which looked like this on the actual computer:


The oscilloscope display shows the output with the computer is FAST mode; but it's more fun directing the output to an XY plotter:


...and here are the plots (left is xz-plane, right is xy-plane).














Looking at these plots - especially when on paper, I cannot help but wonder if this type of thing (i.e. analog computer rendering of chaos) had any influence on British 20th century art (i.e. modernism and in particular modern sculpture - e.g. Barbara Hepworth)?


[1] Sprott, J. C., 'Simplifications of the Lorenz Attractor', Nonlinear Dynamics, Psychology, and Life Sciences, 2009, Vol. 13, No. 3, pp. 217 - 278.


Friday, July 4, 2014

A minor bit of circuitry

Just for the record...the +/- 21 V supply is available on the external bus...

...and there's 12 V for a cabinet fan (maybe - if needed).


Monday, June 23, 2014

Strange Attractors

I came across an interesting paper [1] which discusses the Lorenz model of general circulation of the atmosphere. The model comprises the following three nonlinear ordinary differential equations,

dX/dt = -Y2 - Z2 -aX +aF

dY/dt = XY - bXZ - Y + G

dZ/dt = bXY + XZ - Z.

Values of a = 1/4, b = 4 and G = 1 are used in [1]; F is given various values.

What's interesting (for me) is that these equations can be implemented on the analogue computer as it stands - just. It makes something of an interesting case to attempt on the computer in its current state. And a good set of equations to try and implement. The important thing is to have big sheets of paper!

Here's a sketch of how I converted the equations into a patching diagram. (At the moment, I am trying to avoid cases which need re-scaling, and so it's a very direct implementation of the set of equations.)


It uses seven of the eight integrator/summers (3 are configured as integrators), plus three of the four available summers, plus two of the three multipliers, and both squarers. Having never programmed an analogue compute before, it's interesting to see what parts of the machine are actually the most useful. For the current problem, the non-inverting summers proved particularly handy. And being able to configure the integrator/summers as either integrator or summer is very useful.

The biggest problem was a rather mundane one of nearly running out of banana leads (I have more on order):


The results (plotted on a Philips PM8043 X-Y recorder) are shown below, for three different values of parameter F, near to the value of 5.198 used for attractor N of reference [1]. Vertical axis is Z(t) , horizontal axis is X(t). a = 1/4, b = 4 and G = 1, as in [1].

F = 5.1 V

F = 5.2 V

F = 5.3 V

An immediate discovery was that the thing is pretty sensitive to the value of F - in particular, the left hand side of the plots. I guess that's chaos for you. Nevertheless, the right hand side in particular, looks pleasingly similar to that given in [1], reproduced below:

Finally, it's incredibly easy to change something - in this case the value of G from 1 to 2 - just by moving one banana plug...and yielding another interesting plot:

F = 5.2 V; G = 2 V

This whole area of chaotic dynamics obviously has a very great depth...and as Masoller et al rightly say, is a fascinating subject [1].


[1] 'Characterization of Strange Attractors of Lorenz Model of General Circulation of the Atmosphere', C. Masoller et al, Chaos, Solitons and Fractals, Vol. 6, 1995, pp. 357 - 366. 



Thursday, June 5, 2014

3/4 assembled...

Control unit (lower rack); integrators, summing amplifiers, multipliers and divider (middle rack); coefficient potentiometers (upper rack). The plan is to (perhaps) add wooden sides to the racking - plus rear panels need sorting out - including a big 26-way bus connector (none of your USB/e-SATA/Firewire on this beast!)


And there's space for another rack...with, inter alia, special functions...


Thursday, May 29, 2014

Another rack completed

Initially I thought this rack would be a few potentiometers in an otherwise rather empty box, but of course it turned out to be a bit more involved...



Well, that completes all the main electronics - for the time being - special functions are next - but before that I'll do a bit of the hardware to hold the three completed racks, plus making up the bus cable interconnects and some miscellaneous wiring (e.g. the two meter outputs are buffered and will appear at BNC sockets on the rear panel...)

Saturday, May 3, 2014

Coefficient Attenuators

Allows coefficients to be set in the range -1 to +1. There are fifteen of these circuits. Each uses a 10 turn potentiometer. Based on the circuit from Ulmann's book, Fig 4.26, right.

Of course nothing being as straightforward as it seems, it turned out that there was a problem when the gain is set to zero - i.e. with the potentiometer wiper halfway along its track. Had my retrospectoscope been fully operational maybe this would have been obvious (i.e. the op amp is attempting to find difference of two large voltages - not a problem at DC, but...). At several kHz noise becomes a big problem and the output isn't zero, but a noisy, relatively large amplitude (> 100 mV) waveform. Oddly, it doesn't seem connected with the fact the potentiometers are wire wound (and hence inductive).

Apparently, making an op amp circuit with zero gain is not as easy as it sounds, at least at several kHz. After much thought and some experimentation, the problem was solved with the addition of a small amount of capacitance from the non-inverting pin to ground. It's very specific - an 82 pF plus trimmer (5 - 60 pF) in parallel does the job. Adjusting the trimmer gets the output noise right down to a few mV, with the 10 turn potentiometer set halfway.


The switching (via relays) allows the op amp's output to be sent to the panel meter with either (a) input switched to an internal reference voltage (1 V or 10 V), or (b), input from panel jack. There is an (on) off (on) momentary switch on front panel to do this, which switches the relays. One switch for each op amp. Relays needed because an (on) on (on) double pole switch seemed impossibly difficult to procure, whereas I could obtain a huge number of dpdt relays via eBay at about 20 pence each(!). 

The switching idea is taken from Jackson (Analog Computation, 1960), Fig 12-41 (c).


And here's one of the trimmers, with 82 pF capacitor behind...


Friday, April 18, 2014

The Butterfly Effect

Integrator rack completed. Banana plugs purchased and leads made up.

And now for a first attempt at a serious bit of programming. Following in the footsteps of many others suggests solving the Lorenz equations...three coupled, first-order, nonlinear differential equations which describe the trajectory of a particle through time, originally derived by Edward N. Lorenz (1963) as a model of atmospheric convection (there's even part of MIT named after him). (It's either that or 'hello world'!)

The equations describe the evolution of the spatial variables x, y, and z, given the parameters σ, β, and ρ, through the specification of the time-derivatives of the spatial variables:

dx/dt = σ(yx)
dy/dt = x(ρ − z) − y
dz/dt = xy − βz .

Now, given I haven't built the potentiometer rack yet (it's next on my list), I am a bit limited as to parameter choice, and I can't readily use the values Mr Lorenz used (σ = 10, β = 8/3 and  ρ = 28). After some thought, I've opted for σ = 5, β = 1, and ρ = 7. These I can effect without the potentiometer rack: σ and β are integrator/summer input multiplicands and and ρ = 7 volts (which I can cook up from 2 x 3 V plus 1 V). Also, these values give a solution which (I thought) lies within +/- 10 volts, and also it's a reasonably interesting solution.

To get (minus) x we just integrate the first equation and so on. Two multipliers are used to create the xy and x(ρ − z) parts respectively, and all the bits are added together as required. Here's a sketch of my thinking:

...and here's the plugged up integrator rack:


which yields the plot, below right:


The left hand plot is taken from a very useful online resource written by Andrew Baxter:

http://highfellow.github.io/lorenz-attractor/attractor.html

for the above parameter values, the squares are 2.5 units (i.e. volts) for the left hand plot, and the oscilloscope is set at 2 V per division.

I think the discrepancy on the right side of output from the analog computer is because the thing went outside the -10 V limit on summing amplifier number 2 (this cooks up the xy − βz term). Clearly I have yet to get to grips with the mysterious business of scaling problems on the analog computer.