top of page

Linear Harmonic Oscillator

Linear Harmonic Oscillator Frontal View

This was an improvisation to realize a linear programmable harmonic oscillator—a device that provides translational movements in accordance to some specified displacement function. It is linear, for it moves in only a single direction; and it is harmonic, for it was originally intended to provide periodic, sinusoidal oscillations.


In general the device is capable of replicating any movement—sinusoidal or not—though, because it is a tethered device, a non-periodic displacement might eventually bring the device beyond the reach of the wires..

Linear Harmonic Oscillator Top View

Two motors drive rubber wheels beneath the platform through a 1:3 up-gearing, in order to maximize the achievable oscillation speeds. This can be changed to a lower ratio if the intended load is too heavy. The wheels are wide with shallow treads, to increase grip and minimize vibrations. 


A large blue plastic surface serves as a general-purpose platform, on which the intended load can be placed. Red fenders cover the front and rear of the device, so that any spillages from liquid-containing loads would not wet the wheels and ruin traction.

Linear Harmonic Oscillator Skeleton

The internal structure is quite simplistic, with a grid of beams and braces to provide structural rigidity. The point is to keep the structure lightweight, to reduce load on the motors. Two longitudinal beams, one on each side, holds everything together and bear the majority of the load.

We'll discuss briefly on the software implementation. The idea is that the linear oscillator would follow a specified mathematical expression for displacement, say,                                          , faithfully.

To keep things simple, a time-stepping control approach was used. At each time step, we evaluate the required velocity; and by consulting a power-velocity chart, we determine the required motor power setting, and pass that along to the internal motor controls. We then wait for a short amount of time, say 10 milliseconds, and proceed to the next iteration with a correspondingly incremented time-stamp.

The power-velocity chart is needed because the torque produced by the motor is not expected to vary completely linearly with power setting. We perform a characterization with a test load, measuring the average speed through video velocimetry. We use a cubic polynomial for fitting, since it is reasonably cheap to compute on the NXT controller.

Power-Velocity Calibration Curve
Control Code

The implementation of the control scheme is shown above, written in RobotC. The time step size can be manually tweaked to adjust movement accuracy, for instance in cases when the evaluation of the motor power settings take a considerable amount of time. We had run some tests to verify that the oscillator functions as intended, using the Tracker software to analyze recorded footage of oscillator displacements. Indeed, we see a satisfactory degree of consistency between the programmed and measured displacements.

Displacement Verification
Displacement Verification

With that out of the way, the oscillator can now be put to use—swirling a cup of coffee, for instance. In fact, this was precisely the impetus for making this in the first place!

Linear Harmonic Oscillator Lab Use

Physics of Swirling Fluids

International Young Physicists' Tournament 2014

Problem Seventeen: Coffee Cup

Physicists like drinking coffee, however walking between laboratories with a cup of coffee can be problematic. Investigate how the shape of the cup, speed of walking and other parameters affect the likelihood of coffee being spilt while walking.

Like the Biaxial Material Characterization Jig, the origins of the need for this device has to do with the International Young Physicists' Tournament. I was involved in research into problem seventeen, as listed above. Investigation into this topic, at minimum, requires analysis of two components—the dynamics of walking, and the response of the fluid to such dynamics.

The first refers to understanding how a person moves when walking with different gaits and speeds. We essentially need to characterize the acceleration patterns as a person walks with a cup of coffee (or any other fluid) in his hand. This can be done, say, by attaching a small three-axis accelerometer to the cup. We can then convert to the frequency domain through Fourier transform and replicate the patterns. The second component involves understanding how the fluid behaves, when the cup accelerates in some characteristic fashion. Being able to replicate the movement patterns in a controlled, reproducible manner is why this harmonic oscillator is needed.

In the video above, we see that at low frequencies (and amplitude), the fluid flow typically remains laminar, and analytical descriptions are possible; but turbulence comes into play at higher frequencies, and computational fluid dynamics becomes necessary to predict fluid behaviour. We also see that the fluid behaviour depends heavily on initial conditions—if the fluid has some initial rotational velocity, there is a possibility of transitioning into a rather violent swirling motion upon excitation. In the laminar flow regime, a crude analytical model can be arrived at by treating the fluid surface as a membrane, whose vibrational modes are excited by the various frequency components in the movement patterns. In this respect, we can say that different oscillatory modes of the fluid may be excited, depending on initial conditions and excitation patterns. The idealized vibrational modes of a circular membrane is extensively documented in literature, and we show some of these modes in the animation below:

Normal Modes of Circular Membrane

Elaboration on the generation of the animation above, and the physics of membranes, can be found on my blog page here. Essentially, each mode can be described by orders m and n, as labelled. Qualitatively we may understand that m dictates the number of radial nodes on the membrane, and n dictates the number of concentric circular nodes. We note, in particular, that the frequency of the (1,1)-mode in a typical cup is usually around 3 Hz, which is close to the step frequency of a casual walking pace. It is hence expected that the (1,1)-mode be strongly excited. Of course, we have presumed that the step frequency component is significant even at the stabilized hand, which can be verified through an FFT of accelerometer data.

In actuality, the oscillator built here did not manage to see much use. We quickly realized that a one-dimensional account of the movements of a human hand is much too crude a simplification, and hence built a successor, a biaxial harmonic oscillator, which is in essence two of these stacked atop each other.

Biaxial Harmonic Oscillator

A major change was that we switched from a self-driven design to a towed one; the driving motors were moved off-platform onto separate modules, which pull the oscillator platform by means of a string. This reduces the driven weight, allowing greater maximum accelerations. Six motors drive the lower stage, and four drive the upper stage. Four NXT controllers, synchronized via Bluetooth, manage the various outputs.

Digital models and building instructions are available for download below.

bottom of page