John Espey

View Original

Sine Waves and Phase Shift for Servo Movement

One of the starting examples for The Analog Thing is calculating a Euler Spiral seen here on a vintage Tektronix oscilloscope.

I recently purchased an analog computer from Analog Paradigm called The Analog Thing. This computer was manufactured in 2022 in Germany with great care but a lot of frustration due to hardware supply issues. It took months to arrive, which gave me time to read and learn more about differential equations. Opamps can be used as integrators and adders, two important functions for doing these equations, and they do them effortlessly. This is the fundamental reason why Analog Paradigm is trying to develop user friendly analog computers to make computation very fast and energy efficient. Instead of running an algorithm on a digital computer which takes many watts of power, they can be run on an analog computer taking less than a watt.

This research did help me design a very slow sine wave circuit using only three op amps. Instead of trying to use the obsolete ICL8038 chip like I did in my previous project, I can use a single quad opamp chip like the MCP6004. The frequency is not voltage controlled though, so this will be useful in applications where the frequency stays constant, not for modular synthesizers.

I also developed a circuit to shift the phase of the input sine wave and I found another circuit online to create a servo PWM from a 0-5V signal. So by combining all of these together, I can create a sine wave, phase shift it, and convert them both to servo PWM. This is the beginning of a metachronal wave for insectoid robots. I found the opamp servo pulse circuit from the very knowledgeable W2AEW on YouTube. Check out his videos, they are amazing ways to learn more analog circuitry.

Schematic of a ~2Hz sine wave 0-5V with phase shift and converted to servo PWM.

I decided to prototype a circuit which would create four servo signals. Two mirrored pairs with slight phase shift. I think this would look beautiful as an update to my butterfly wing flapping mechanism. I surprised myself when the prototype came together pretty easily. Maybe I am actually getting a hang of this analog circuitry design! I created a schematic in KiCad too so I could explore circuit board design and maybe even SMD parts some day!

This circuit works for constant movement but is not easily controlled. The frequency is altered by using different capacitors. Larger capacitors lower the frequency. I could probably add a stage to attenuate and adjust the gain manually with a potentiometer.

What I would really like to accomplish is a way to control the servos on the left and right of the robot independently. I’d like to change the center point of the sine wave as well as the gain using voltage levels. This would require using an analog multiplier. Unfortunately, this is a difficult component to build and source. Analog multiplier chips are expensive. So I am turning back to The Analog Thing computer to see if I can develop a circuit which will give me the control I am looking for.

I am just beginning this new exploration, but I think I could have luck tweaking the classic mass, spring, and damping circuit. With extremely low damping and a loose spring, the wave form is a low frequency sine wave that slowly dies out. Perhaps I can occasionally re-trigger this circuit, like pushing someone on a swing. This would increase the gain suddenly, like a burst of energy in wing flapping. If thrust is not required, the oscillation is allowed to slowly die.

I’ll need to probe the different variables of this equation on the scope and see if there is a way to tap in and control them. Perhaps I can use some kind of sensor or manual control to alter the circuit behavior on the fly (pun intended). This circuit is like a ringing/bell filter or voltage controlled decay of a VCA at only one frequency, without using a multiplier. I’ll post my progress over time!