Sunday, July 15, 2018

Chua Circuit Chaos Easy Build





Chua Circuit Chaos Easy Build - No Inductor




Here's a phase portrait of a beautiful single scroll chaotic attractor from my oscilloscope! I was able to also confure up a multiple scroll attractor and also a teeny-tiny double scroll illustrating the classic chaotic circuit output. A Strange Attractor is when a bounded chaotic system has some kind of long term pattern that isn’t a simple periodic oscillation or orbit.



Here is how two superimposed attractors form the famous double-scroll attractor:





Here is a video:;







Nice Mobius strip attractor, the only possible attractors in this pattern are limit cycles:







Here is a multile limit cycle attractor as it adds more ovals to become a single scroll chaotic attractor.



My oscilloscope settings for my "newer" scope.

There is a progression from steady state to limit cycle to chaos and bifurcation. Steady state is a dot; an oval signifies a 1 period limit cycle; multiple overlapped ovals show 2 or 3 or 4 limit cycles; once the ovals are plentiful and have a sort of inverted rounded pyramid shape (like mine above) it's a single scroll chaotic attractor. 

The famous double scroll chaotic attracot can have two appearances depending on your setup and equipment: the single chaotic attractor with some extra, lighter ovals underneath it; or sort of a figure 8 shape.



The circuit build is towards the bottom of this post.

Chua's Circuit is basically an oscillator that outputs waveforms that never repeat: chaos! Chua's Circuit is the simplest circuit that can output real chaos. Chaos in the form of a double swoosh set of circles on an oscilloscope screen. This waveform is called an attractor, which demonstrates chaos in a continuous time dynamical system...I like the idea of a waveform generator / oscillator that never repeats. A continuouly evolving, periodic output that never repeats: chaos!

What defines chaos in a system like this: extreme sensitivity to initial conditions; cause and effect are not proportional; and it is nonlinear.

This circuit will also display bifurcation: small, smooth changes lead to a sudden huge change in the system. Tuning a silent radio with a knob that you're barely moving, you keep trying to nudge the timing knob and you all of a sudden loud music starts playing. Or slowly as possible applying more pressure to a mousetrap until it springs shut. The straw that broken the camel's back.

We will make it less simple by replacing the supposedly hard to find, but definatly hard to choose thet correct value for inductor-with a gyrator circuit which acts as an ideal inductor. Just a couple extra cheap parts and it still works.



First off when looking at schematics to build your very own Chua Circuit you need to ignore 99% of the useless schematics out there. The schematics you'll see are for explaining this circuit, but not building it. Here is an example of the classic circuit...that doesn't tell you what you need to know:


You will see on the left side an "L". That denotes a simple 18mH inductor. These inductors are sort of hard to find. You could try and swap in and out various 18mH inductors with less than 30 ohms resistance and play around with that. They are pricey and might not be exactly the spec your circuit needs to operate. We will replace the "L" with a TL082 op-amp acting as a gyrator inductor simulator. It works like an inductor (in this circuit at least) and operates ideally. Simple! The gyrator is known as "The Fifth Linear Element" and basically couples voltage from one source to the current from a different source...and then does the same with the remaining devices' current and voltage. Once working I plan on replacing the gyrator with an actual inductor, since I just found a pile of different sized ones in a drawer. An actual inductor will add parasitic resistance that will have to be counteracted in the circuit.


You will see on the right side of the circuit "NR". That is Chua's Diode...except that there is no such thing as a Chua Diode. You can't buy one in a store, you have to make it. Luckily we can make our own Chua Diode using a second TL082 op-amp. 

There are versions of this circuit which leave the inductor and replace this Chua diode with a memristor, but it involves more potentiometers (knobs) than this way. You will soon learn of my hatred for wiring pots. Anyway Chua’s diode has nothing in common with  a diode; it has a non-linear voltage-current characteristic that makes the oscillator output “unrepeatable”.

Then we'll add in some resistors, capacitors (use metal film, not carbon, for best results), a couple of knobs (potentiometers), and a DC power supply instead of two 9v batteries oddly wired together in many of the circuit designs.


The only other fancy "thing" I've made has been a scanning tunneling electron microscope. This project is very similar in that it used op-amps and the x, y and z inputs on an old oscilloscope. Because this is low voltage you can use a PC computer-based oscilloscope without blowing stuff up-as long as it can handle 9vDC. However if you use a modern fancy standalone digital oscilloscope the swooshing waves of the the output (a Chaotic Attractor) turns into swarms of ugly dots that are really hard to interpret.


After the annoyance with the schematic above I became annoyed with the build schematics I found for one simple reason: they show 4 triangles that are op-amps. So, I assumed I needed four op-amps, but the TL082 is a double-op-amp: each black box with 8 legs (pins) sticking out actually has two triangles inside of it. Four triangles on the schematic = two TL082 op-amps. Nice.

Also, the schematic didn't label the triangles as being A/B pairs. Which I'm not used to. So, when I scribble out my diagrams I'm labeling them A and B. One A/B triangle pair is a single TL082. This will make total sense once you read the next few lines and check the pinouts.


So, the first thing to get straight is the op-amp circuits. While it might look like we'll be using four TL082 circuits we're really only using two of them!


Here's a simple pinout that is for a different op-amp, but which has the same pinout as a TLN082, but it's drawn better. It's much easier to see how each little TL082 microchip is actually a double op-amp. One amp is "A" triangle and the other is "B" triangle. Look at this and the build schematic will make sense:





You can see that there is an "A" op-amp, and a "B" op-amp.

A = pins 1, 2 and 3.
B = pins 5, 6 and 7.

Pins 48 power the entire TL082 (both A and B together).

Inverting inputs are negative (-) inputs.
Non-inverting inputs are positive (+) inputs.

So, in the schematics for Chua circuits (done without an inductor, using a gyrator instead) you will see four triangles. They represent the A & B portions of only two TL082 op-amp circuits.

You will see two triangles near each other, and two other triangles paired up on the other side of the schematic. Each pair of triangles near each other represents a single TL082!

You must treat each triangle as an A or B regarding pins. Decide which triangle in a pair is the "A triangle" and which is the "B triangle".

Anything that goes to the A triangle will only use pins 1, 2 and 3.
Anything that goes to the B triangle will only use pins 5, 6, and 7.
Pins 4 and 8 get the input from your power supply/batteries. It doesn't really matter which triangle those go to, but for simplicity we'll put the 4/8 power to the "A" triangles.

So, on the left side of the circuit where we are not using an inductor, but building a gyrator instead we have two triangles.



Left Side of Schematic-Gyrator Inductor Simulator


Triangle A is on the right:
Pin 1 = OUT A
Pin 2 = Inverting Input A (negative -)
Pin 3 = Noninverting Input A (positive +)
Pin 4 = Negative Power Supply input
Pin 8 = Positive Power Supply input

Triangle B is on the left:
Pin 7 = OUT B
Pin 6 = Inverting Input B (negative -)
Pin 5 = Noninverting Input B (positive +)

There, now you have all 8 pins on one of the TL082 op-amps wired up!




Right Side of Schematic-Chua Diode


Triangle A is on the right:
Pin 1 = OUT A
Pin 2 = Inverting Input A (negative -)
Pin 3 = Noninverting Input A (positive +)
Pin 4 = Negative Power Supply input
Pin 8 = Positive Power Supply input

Triangle B is on the left:
Pin 7 = OUT B
Pin 6 = Inverting Input B (negative -)
Pin 5 = Noninverting Input B (positive +)

There, now you have all 8 pins on your second TL082 op-amps wired up!

BREADBOARD WIRING

Wire Jumpers:

c18-c24
e18-f19
g19-g25
e21-f21
he21-h24
d23-d29
e29-f29
i26-i32
j28-j29
c25-c31
h32-h39
h42-h49
g48-g49
i48-i54
e49-f49
h52-h56
c48-c52
d49-d53
b51-b55
a55-a56
f56-f57
d3-g3
j50 to right power right outside
left power rail inner to b3
left power rail outer to a54
left power rail outer to a26
j50 to right power rail outer
j10 to right power rail inner
j51 to right power rail inner
left power rail outer to a10
j23 to right power rail inner
left power rail inner to b3
i3 to right power rail outer
left power rail outer to a54
left power rail outer to a26
j50 to right power rail outer
j10 to right power rail inner
j51 to right power rail inner
left power rail outer to a10
j23 to right power rail inner

TL082 Chips
Top of chip (with half circle dimple) pins 1 and 8: e23 and f23
Top of chip (with half circle dimple) pins 1 and 8: e51 and f51

Resistors
220 b10-b13
220 i10-i13
1k b21-b24
2.2k b25-b28
1k h25-h28
100 g26-g29
3.3k i39-i42
22k a48-a51
22k c53-c56
3.3k left power rail inner to a52
3.3k i39-i42
2.2k g50-g53
2.2k g54-g57
220 j53-j56

Capacitors (film metal not ceramic)
10nf j42 to right power rail outer
100nf a21-a25
100nf j26 to right power rail outer

LEDs
left power rail inner to to a13
j13 to right power rail outer

Batteries
9v Battery 1: red positive to c3 / black negative to c10
9v Battery 2: red positive to h10 / black negative to h3

Ground wire for oscilloscope probe ground clips
right power rail outer (last bottom, right hole)

Oscilloscope probe to leg of capacitor sticking out of hole j26
Oscilloscope probe to left of capacitor sticking out of hole j42

Potentiometers/Trim Pots
Pot 1: middle pin b31 / either other pin left power rail innter / 3rd pin unused
Pot 2: middle pin f39 / either other pin f42 / 3rd in unused

The left side of the breadboard usually has positive and negative...but in this circuit both columns are negative.

The right side of the breadboard is positve on inner column, negative on the outer column closest to the edge of the board.

10k linear potentiometers are recommended because they're easier to turn and are more precise. I used 10k trim pots with are less precise and have to be turned with a screwdriver--bad choice!




Connect the two halves of the circuit with some wires, knobs, outputs to oscilloscope or a USB PC computer-based oscilloscope (with a huge resistor on the outputs so you don't fry your computer or digital scope) and you're good to go. I have real oscilloscopes that are analog/tube and can handle high voltage inputs. Your digital and computer PC scopes might blow up if you try and put more than 3v into them. Read your specs. This thing basically has two 9vDC input spots that may total 18vDC if you mess things up.

As always my nemesis is the humble potentiometer (volume knob). On some projects you need to use all 3 pins, but some only 2...and the circuit schematics almost never tell you which. Is it a voltage divider (might be 3 pins) or is it a current adjuster (2 pins?) or is it a volume knob for audio (3 pins?) or a variable resistor (2 pins!)?

************On the most popular "fritzing" diagram for Chua circuits they show 3 wires going to the potentiometers but in the explanation 8 pages later they state that the third wire isn't wired to anything, it's just there to physically keep the pot from moving on the table as you spin the little knob!!!!!!!!!!!!!!!!! I'm so annoyed I spent so much time trying to figure out why/where that third wire was going to!!!! Use only two wires for your Chua circuit pots/knobs: the middle one and one on either side.


I had similar issues with my scanning electron microscope build: five pots labeled V1-V5 for variable resistor, and one of them showing connection to: ground, -negative voltage (which in a DC circuit is the same as the ground) and then the incoming wiper wire from ??? Ugh! Anyway, here we go:



PARTS


100 ohm x1

1k ohm x2

220 ohm x4

2.2k ohm x2

22k ohm x2

3.3k ohm x2

TL082 IC Op Amp Chips x2

LEDs x2

On/Off switch x1 (DPDT double pole/double throw 6 contact)

Potentiometers x2

9vDC power supply or two 9v batteries and wires.

Breadboard (or not).

Analog oscilloscope with two probes (or three if you use the "z" input on the back too). Or coax cables with fittings at one end (probably RG-58 BNC-connector 50ohm) to plug into analog scope inputs, and cut off the other ends to hook to the Chua Circuit. Or you could get some BNC female sockets and put them in your Chua's Circuit...but short lengths of coax wire with BNC connectors are super cheap on Amazon and eBay, so I buy them and cut them in half quite a bit: each coax cable cut in have gives me: two BNC to bare-wire cables. BNC plugs into oscilloscope or function generator or Geiger counter, etc. and the other end I solder to whatever circuit I'm building. Some of them were 75ohm, and some were even old 1970s cable TV wires that weren't marked. Whatever. 

Bits of wire, wire strippers, solder and iron if you're going to not use breadboard.

Two 1M resistors only if hooking up to digital oscilloscope or computer. Old analog oscilloscope don’t need them.

Just hook old analog oscilloscope probes to Capacitor 1 and Capacitor 2 (the two near each other) and then ground the probe ground clips to -9vDC (black) on the side rail of the breadboard.


This will be my first ever breadboard project, so I’ll be following Valentin Siderskiy’s instructions pretty much step-by step, but adding my own clarifying notes. Such as: you can leave a wire off of each potentiometer, they only need two in this circuit! Or the ever popular "I think LEDs are polarized so you have to stick them in the right way or they won't light up."



Also, you could easily (I think) leave off: 

On/off switch; 
Two LEDs; 
Resistors for the LEDs; 
Two more resistors that just smooth down the 5k pots to 2.5k--but then you'd need to probably buy actual 2.5k pots. Dumbing down 5k or 10k pots to only 2.5k makes it easier to make slight adjustments to the circuit while turning the knobs. 


Since this is my first breadboard I'm going to leave all that stuff in--when I point-to-point wire it up I'll be able to actually tell how to leave them off without breaking connections. I still think in "point-to-point" and not breadboard or circuit board layouts.

Running the circuit
I used a couple different oscilloscopes. One had 3 inputs: channel a and b (verticals) and a horizontal channel. I just used a and b and set the dial for A vs B to plot the voltages against eachother to get the single scroll chaotic attractor. This gave the same results as my older oscilloscope with a single vertical and single horizontal input (x vs y).

The slightest turn of the potentiometers resulted in HUGE changes to the image on the oscilloscope. This is called bifurcation. 

One of my potentiometers measured only 1.3k instead of 10k when tested on a multimeter: so I replaced it and immediately got better results. I'll probably invest in two full sized pots with convenient knobs to twist.

I had two old mismatched batteries, I'll add new ones.

When I unhook the oscillscope ground clips from the ground wire the whole circuit becomes very sensitive to hand movements. 
Bifurcation was observed: tiny, smooth changes to a paremeter (knob twist) results in huge changes to the output (dot turned into a chaotic attractor). Hysterisis (like my previous post about neon lamp bulbs) was observed: the spot where the chaotic attractor turns on is different from where it turns off--plus there's two knobs that influence eachother. 

Unplugging the inside leg of the 10nf capacitor gave an extremely small, single trace of the famous double scroll attractor. It was very low resolution: it looked like a number "8" written in Old English font! 

Here are some attractors that resulted when I changed one, then both of the pots from 10k to 5k:





Here are some sweet toroidal Class 1 Eigenvalue = 10 (sort of) attractors.







Here are some results after putting in two 5k pots, then replacing one of the batteries with a 9vDC power supply...but varying the DC voltages from around 1.3vDC to 10vDC:






Here is the shape you see right before the classic double scroll: I was playing with the voltage (I replaced one of the 9v batteries with a DC bench power supply and going from 1.3vDC to 10vDC. One of the IC chips was getting pretty warm though):


It's a homoclinic bifurcation, the periodic orbit grew units it collided with the saddle point.







Multiscroll attractor:









You can see how this double-double scroll attractor developed from multiple loops:


The Logusz Attractor (double-double or chaotic quad-attractor as I'm thinking of naming it)...although it's actually pretty close to what others have found as a projection of the Vc2 / IL plane or the Vc / IL1 plane. The literature on this and others:

Anshan, H. [1988] "A Study of the Chaotic Phenomena in Chua's Circuit," Proceedings of 1988 IEEE International Symposium on Circuits and Systems (Cat. No.88CH2458-8). IEEE. vol.1, pp.273-276.

Bartissol, P., Chua, L.O. [1988] "The Double Hook (Nonlinear Chaotic Circuits)," IEEE Transactions on Circuits & Systems, vol.35, no.12, pp.1512-1522.



Anshan in particular backs up what I discovered myself: op-amp voltage adjustments can lead to lots of new patterns and attractors. Of course he found this out in the 1980s--and I'm just playing around in my basement as something to do besides mow my lawn...it's nice to see my "weird" non-perfect, non-double scroll attractors have actual mathematical explanations in eigenvalues (weird math) but also voltages.














Great sources of information that I ripped off:


Professor Leon Chua, the inventor of this chaotic circuit.

"Jim" who made http://www.chaotic-circuits.com/

Valentin Siderskiy, Vikram Kapila and Aatif Mohammed of http://www.chuacircuits.com and published papers and a great Instructable post. Check out "Chua's Circuit for experimenters using readily available parts from a hobby electronics store".

"Chua’s Circuit for High School Students" by Gandhi, Gauruv., Muthuswamy, Bharathwaj2 and Roska, Tamas.

This list of awesomeness; hover your mouse over the titles and you can click and be rewarded with actual PDFs of the articles (and not just crummy citations): http://people.eecs.berkeley.edu/~chua/circuitrefs.html