Dahlia Zoetrope Design Challenge
Every year StarFish designs a unique holiday gift as a fun way to celebrate the season. This year we developed a zoetrope that creates the illusion of an unfurling, dahlia-like flower sculpture in three dimensions while glowing softly from within. Although this design challenge was not a medical device, it provided a great chance to put our engineering and design expertise to use. You should also take a look into the blog by Kevin Meric on Algorithm Aided Design (AAD).
How It Works
Aside from its mesmerizing appearance, there is some pretty interesting engineering and design under the hood. Maybe that’s not so surprising when the team consisted of a bunch of experienced medical device designers and engineers.
Fundamentally, a zoetrope is an animation. Each frame of the animation is a snapshot of the motion that our eye perceives. In this case, the dahlia sculpture rotates while a field of strobing light emitting diodes (LED) fool us into thinking that each petal is growing, curving and rotating in a 144-frame pattern.
Looking at the sculpture while stationary it might not be immediately apparent that there is a sequence of ever-increasing petals, but if you advance in 137.5° jumps, you traverse every single petal from the smallest in the centre to the largest on the periphery.
The magical effect of petal growth is created simply by flashing the LEDs at the precise time that the next petal passes the same point as the last one. The motor speed is regulated to ensure that the flashing rate is fast enough to be mostly imperceptible. In this case, that means 10 revolutions per second, yielding about 26 frames per second.
At this point, you may already be satisfied with this explanation – maybe I’ve even spoiled the enchantment for you. If so, you can stop reading now. From here on I’m going to dig deeper into some of the mechanisms that we employed to make this happen.
Really How It Works
From a circuit standpoint, the zoetrope is composed of four main circuits: a motor driver; LED drivers; an optical sensor circuit for monitoring the speed of the sculpture and a microcontroller (MCU) as the brains of the system.
The motor requires little power to rotate and only needs to spin in one direction. For these reasons we chose a linear, analog, single quadrant circuit to control the motor. The microcontroller modulates the motor speed by varying an input voltage to the circuit. Although a switch-mode topology might have been more efficient, the simplicity of the linear circuit won out in the end. We might have made a different choice had this been a battery powered device.
There are 15 LEDs on the circuit board, each with red, green and blue elements that shine up into the sculpture. These are driven by three identical circuits – one for each of the three colours. The driver circuit is a constant current topology, the setpoint of which is set by an analog signal from the MCU. The micro also enables the drivers with pulses, creating the strobe effect.
If you look carefully at the ring of LEDs, you may notice there is one extra component visible. This is an infrared reflective sensor. It emits infrared light and each time a spoke of the sculpture passes overhead some of that light is reflected to the sensor’s photodetector.
A challenge with this configuration is that an unpredictable amount of light is reflected by the body of the sculpture and returns to the photodetector between the spokes. Also, because the spokes are far from the sensor the light that returns from the spokes is also uncertain. These issues were overcome with a slightly unconventional circuit. The photodetector is loaded by a low pullup resistor but it is also AC-coupled to a transimpedance amplifier via a capacitor. This capacitor adapts to the variability of the average photocurrent by charging or discharging. The amplifier is configured with a high gain; it is fed into a logic-level input of the MCU. To ensure that the output swing remains centred between the logic low and high thresholds of the MCU, the gain is limited in the negative direction with a diode. This ensures that the capacitor is always reset in the absence of spokes.
The spokes pass by every 90°: there are four of them. The MCU needs to know exactly when 137.5° has passed. The MCU fills this knowledge gap by maintaining a mathematical model of the sculpture angle. Essentially it computes a hypothetical angle of the sculpture based on the present speed of the model. Each time it gets a pulse from the sensor it compares this known angle with the angle of its model. The model speed is then adjusted proportionately to the error in these angles. This is essentially a phase-locked loop. The MCU can confidently strobe the LEDs when the model hits that target angle.
In addition to strobing the LEDs based on its internal motor model, the MCU also uses this model as the basis of the speed control loop. We found that a simple integral control loop worked well for the motor speed. The error between desired speed and the speed of our model accumulates over time to form the motor drive signal. If the motor is too slow, the drive will slowly grow, thereby increasing the motor drive and in turn the motor speed. If the motor gets going too quickly for some reason, the drive is gently reduced.
We thought it would be fun to add some degree of interactivity with the zoetrope. For this reason, we added a rotary encoder control with a built-in push-button. We decided that the pushbutton feature would cycle through different colour modes, allowing the user to choose from a number of palettes. For rotation, we chose to vary the angle increment. The default is 137.5°, which creates the stationary animation. Turning the control Increments away from that value added a number of interesting rotational effects to the animation.
I hope I haven’t spoiled the magic of this year’s Dahlia Zoetrope. It was great fun to be part of the team.
Kenneth MacCallum, PEng, is a Principal Engineering Physicist at StarFish Medical. He works on Medical Device Innovation for a variety of areas including ultrasound applications. Kenneth would enjoy hearing from readers about their reference designs and experiences.
Images: StarFish Medical