- Driving a three-phase brushless DC motor with Arduino – Part 1. Theory
- Brushless DC (BLDC) motor with Arduino – Part 2. Circuit and Software
In this final part of the trilogy I am describing the hardware part of the stroboscope project and the making of the zoetrope animations themselves, in hopes that my visitors can take this further and come up with their own animations, which I would absolutely love to see. More details below!During my search for a perfect donor DVD-RW drive for a (still coming) miniature laser cutter project, I came into possession of some insane amount of broken CD,DVD and Bluray drives and at some point I came across a bunch of broken Xbox 360 drives for sale on eBay that piqued my interest. Once I got them I realized that their main feature is not so much the laser sled positioning mechanism which I was after but rather the three phase BLDC spindle motor that rather basic design which is very compatible with DIY process – no ribbon cables were used. All three windings are conveniently traced to the outside PCB that’s easily solderable. I would have to say that at least one of the Xbox drives I’ve looked into did have a ribbon cable but the ribbon cable ends were not too close together and rather easily solderable themselves. So, if you are interested in this project or just generally in playing with small BLDC motors, definitely do look up broken Xbox drives – they are plentiful and very cheap.
The Xbox 360 DVD drive has donated another important part of the project – the frame which holds both the spindle drive and the LED. It already had the mounting holes for the BLDC motor and devising a bracket to hold the LED was just a matter of bending some sheet aluminum left over from another DVD drive teardown.
I opted to have the business end of the stroboscope – the motor and the LED – to be detachable from the Arduino “brains” because I wanted to do a lot of testing and playing with other motors using the same electronics. But if you’re making it a stationary device, the connector between the Arduino Development Shield and the motor frame is completely optional. Additionally, I imagine that with a bit of tweaking the Arduino stack can actually be mounted to the underside of the motor frame (which will have to be raised on some sort of standoffs) to make the entire device even smaller.The circuit itself was built on an Arduino Breadboard Development Shield, sans the breadboard. I like the flexibility of the Development Shield even though this circuit could have been implemented using the Motor control shield instead. By the way, I have a feeling that Arduino Breadboard Development Shield no longer refers to a particular PCB because there are at least a couple of different ones out there that I saw. But any kind will do for this project – very limited space is actually needed, just one 16-pin IC, a 5-pin connector, a button and an LED (normally a part of any development shield) and a space for a potentiometer. Please note: even though the photo shows two orange pots on the left of the shield, I ended up using only one to control the rotational speed of the zoetrope animation. The second pot was supposed to control the duration of the flash but I’ve since found that the said duration can only be within a very narrow range (2 to 4ms or 1/500 to 1/250 for you photography enthusiasts out there) and I simply set it with a constant in the code instead. Being able to control the flash duration in real time did not seem to add much to the project.
Only a few more components were added to the circuit diagram from the Part 2 of this series of posts, the one that describes the circuit and the software for controlling the BLDC motor. The added parts are the MCU itself (Arduino) and a few controls – the RPM control pot and the direction control button (with the LED to show the direction). The fourth quarter of the QUADRUPLE Half-H Driver SN754410, unused in the previous circuit, is now used to drive the flash LED.
One part of the new scheme that requires some further explanation is the jumpers JP1 and JP2. I have found that the SN754410NE driver gets pretty hot if the stroboscope is left on for a long time. The resistivity of the windings is only 4.3Ω measured across two windings in series (the only way to measure without access to the center point) which means that if we feed the motor control part of SN754410 with the same supply voltage as its logic part +5V, we have more than 1A flowing through it at any given moment, which is higher than what the IC was deigned for. So, I’ve tried two ways of lowering the load supply voltage: lower it some 0.7V by first passing it through the D1 diode (short JP2, open JP1) or take the 3.3V output from Arduino (short JP1, open JP2).
The latter seems to be the best way of controlling overheating. It could have been dropped even more but in the actual DVD I believe the motor is commutated with 1.8V and we don’t have such low source on a *uino. I’ve been too lazy to check for sure but I’ve seen an 1.8V regulator pretty much every time next to the DVD driver IC. Please be warned, however, that the current the motor draws from the Arduino 3.3V regulator seems a bit too much (still pretty high @ 767mA ) and the Arduino’s USB communication stops working. Does not seem to cause any lasting damage but is a major annoyance if you’re trying to load a sketch.
Early in the design process I decided that I will have 12-frame animations. It looked like the figures could be far enough apart and yet enough of them will fit onto a rim of a CD to show a motion complex enough to build this whole project for.
My zoetrope animations (the physical disks with figures) are just throwaway CDs and DVDs with laser-cut foam figures glued at equal intervals 30° apart. The size of the figures was picked specifically to fit a laser cutter made from a DVD. Therefore the length of each piece is limited to only 1.5″. However, I think it’s a perfect size for the diameter of a CD anyway. The source files are included in both SVG and NGC (CNC) format. So, if you don’t have a laser cutter, even a DIY one, you can print the figures out on a card stock paper and cut them out with scissors (this will be tough) or, quite possibly, make use of an electronic cutter machine connected to a PC. I have an older PC paper cutter called SILHOUETTE – maybe I’ll dust it off one day and give it a try.
The first animation is called Rumba because I created it by cutting 12 frames, spaced equally apart, from a video of a Rumba dancer. Then I separated the actual figure from the background, vectorized it with Inkscape, resized to fit the tiny laser cutter and converted into the CNC code using the Inkscape Laserengraver extension. It is quite a bit of work – the disk you see on the picture is probably solid 4-5 hours worth of work, especially if you do it for the first time. Additionally, I didn’t do much choreography research before embarking on this “Rumba” sub-project. If I did, I would have found that Rumba is actually an 8-step dance which is a bit awkward to reproduce with 12 frames. 8 of those are important body positions but I needed to add 4 more and they all have to be equally spaced apart in time, which is almost impossible. In other words with an 8-step dance, 8 frames (or 16 if you feel ambitious) are rather naturally spaces equally apart but 12 frames are not. Instead of going 1-1-1-1… they go 1-1.5-1-1.5… and so what I have in the end is not much of Rumba anymore (which explains why you actually hear Samba in the background on the video at the top of the page …
Anyhow, sorry for the digression, not being a dancer myself I never had to think about these things and this project made me to, which was an unexpected bit of fun in and of itself.
For the second animation I picked a much safer subject – stick figures! The figure itself is a result of my fiddling with Stykz – a fine piece of freeware dedicated to creating and animating stick figures. Stykz Linux, according to their site exists but hasn’t been generally released yet. But I was able to run it on Wine just fine.
Had I known more about choreography or dance, I’m sure I could do much better by Stykz and so my hopes are that my readers will be able to use the software to its full potential and amaze my with the results by sending me some photos of their own animations.
Once you’ve cut the figures from your medium of choice, be sure to keep them in the exact order before gluing them to the CD and, preferably, glue them on right away. The order is extremely important and many figures will look very much alike except for some fine details you may not immediately recognize, but if the animation is out of sequence, you’ll be unpleasantly surprised…
I made a little template in the form of a 120mm disk (diameter of a CD) with 12 sectors which you can use to mark the CD before placing the figures. It’s included in the Zip file with the animations.
Loctite Gel Control Super Glue works best for gluing the figures in place. It grabs each piece with enough force and dries fast enough for you to move onto another piece as soon as you positioned the one before it.
The SVG and NGC files with animations and the disk template are here: Zoetrope animations and templates for the Arduino Stroboscope project
The Arduino sketch for the stroboscope is the PWM version from the previous post, I’ll link to it here as well: Arduino Sketch for controlling 3-phase brushless DC (BLDC) motor please note that 12-frame animations are hard-coded into the sketch. In other words, the software does not make calculations for the required flash delay based on a number of frames different than 12. It is entirely possible, especially if the number of frames you’re interested in is divisible by 3, but the code will need to be adjusted.
So, this is it. I hope the three part series has been informative. It has certainly been fun for me. I’ve learned a lot about brushless DC motors and, while working on this particular project, quite a few other ideas were planted in my head and I will most likely be working more with BLDC motors.