With the incredible variety of projects submitted to our Op-Amp Contest, you’d almost forget that operational amplifiers were originally invented to perform mathematical operations, specifically inside analog computers. One popular “Hello World” kind of program for these computers is the “ball-in-a-box”, in which the computer simulates what happens when you drop a bouncy ball into a rigid box. [wlf647] has recreated this program using a handful of op amps and a classic display, and added a twist by making the system sensitive to gravity.
All the physics simulation work is performed by a set of TL072 JFET input op amps. Four are configured as integrators that simulate the motion of the ball in the X and Y directions, while four others serve as comparators that detect the ball’s collisions with the edges of the box and give it a push in the opposite direction. Three more op amps are connected to form a quadrature oscillator, which makes a set of sine and cosine waves that draw a circle representing the ball.
The simulator’s output signals are connected to a tiny viewfinder CRT as well as a speaker that makes a sound whenever the ball hits one of the screen’s edges. This makes for a great ball-in-box display already, but what really makes this build special is the addition of an analog MEMS accelerometer that modifies the gravity vector in the simulation.
If you tilt or shake the sensor, the virtual box experiences a similar motion, which gives the simulation a beautiful live connection to the real world. You can see the result in a demo video [wlf647] recently posted.
The whole setup is currently sitting on a solderless breadboard, but [wlf647] is planning to integrate everything onto a PCB small enough to mount on the viewfinder, turning it into a self-contained motion simulator. Analog computers are perfect for this kind of work, and while they may seem old-fashioned, new ones are still being developed.
I have wondered before if some digital systems wouldn’t be a hell of a lot simpler if the differentiation and integration modes of analog computing were remembered and op amps used for sensor pre-processing so the FPUless micro doesn’t choke on it.
External analog arithmetic was very plausible in the 80’s and 90’s, but ever since commodity 8 bit MCUs with integrated ALUs became available (and ADCs), fixed point arithmetic has been good/fast enough. Many cheap toy drones only use an 8 bit MCU to do all the stabilisation/control loop magic fed via accelerometer. Not to mention 32 bit MCUs are available for under a dollar nowadays.
The other thing is that analog arithmetic is not perfect unlike digital arithmetic. You have a bunch of noise, offsets and non-linearities to consider, which only grows with system complexity and speed. Analog arithmetic/preprocessors definitely do exist inside accelerometer/radar/wireless ICs themselves, and it’s precisely to stop the user dealing with potentially GHz level samples rates, and instead only MHz level sample rates.
“analog arithmetic is not perfect unlike digital arithmetic”
Neither is perfect.
Digital processing uses limited precision ADCs, DACs and floating point numbers which causes quantization/discretization errors that can be seen as equivalent to noise.
It also is discrete in time (sampled), which results in distortion for frequencies about nyquist limit. Though with adequate filtering this just limits the bandwidth just like analog has bandwidth limitation.
The problem is noise. Even in applications where you could design an analog front end (like a mems accelerometer) you really wouldn’t want to. You usually have a very simple analog filter before the ADC. The more op amps you cascade the more 1/f noise you have. its far easier to have a single adc and then do the digital filtering on the asic after.
In the early days of machine vision ( 80s ), we did a lot of analog ( and digital hardware ) image preprocessing to reduce the workload on the very expensive , relatively under powered computers available at the time. It wasn’t until several million digital transistors became cheaper than 20 ” analog” transistors that we stopped thinking about tasks at hand.