Kestrel technical details

The first stage of this project was to investigate how to control the stepper motors. I ordered three motors from Zapp Automation, without any more guidance than choosing some that looked "quite big", hoping they would be powerful enough.

The first motor control boards came from Quasar Electronics. The boards were described as being able to drive "...any 5, 6 or 8-lead unipolar stepper motor rated up to 6A (5 - 35Vdc) in either Free-Standing or Computer-Controlled mode for CNC type applications". This led to several frustrating weeks of connecting and re-connecting, but the motors and boards were drastically overheating - clearly something was wrong. The motors were drawing so much current that a PCB track began to buckle and deform - not a good sign. I checked and re-checked datasheet specifications, wiring etc, but couldn't find anything.

No reply from two emails to Quasar technical support, so tried their sales address in the hope that it would be checked more regularly. They insisted it was definitely a wiring issue, and so in desperation I tried every single motor wiring combination possible. Still overheating, motor stalling etc. Logically, as the motor coils are connected to the power supply via the MOSFETs on the board, it seemed obvious that the motors would overheat, as they were effectively connecting the power supply in a dead short.

After a lot of dead ends and a Salvador Dali style melted terminal block, I eventually emailed Zapp Automation, who were much more helpful. A chap called Gary asked what I was trying to do, and then the breakthrough came in the form of a comment on the fact that the driver should control the current. The Quasar boards had no current limiting circuitry - I still don't understand how they can claim it can drive "any 5, 6 or 8-lead unipolar stepper motor". Not only that, but it had been insisted that I was doing something wrong, and so that had me stuck for a good few weeks. Okay, I have finished complaining now.

Gary from Zapp recommended some alternative control boards, and they worked absolutely perfectly straight out of the box. They have a current limiting feature, set by a trimpot on the base of the unit. Very easy to set up - the drivers are controlled by on board optocouplers, and so any circuitry that will make an LED flash will interface with the driver board. I have included some links to PDF datasheets at the bottom of this page - they describe everything in more detail.

The next step was to mount all of the electronics onto a plywood board, to keep everything tidy while fiddling with breadboard and programming etc.

I initially tried to send the required pulses to the motor control boards directly from the arduino. The problem was that there were so many pulses needed. The motors have 200 steps making up one revolution on the most basic setup. The new control boards supported "microstepping" - additional steps in between the usual 200. At the highest resolution of 16 this gives a wonderfully smooth motor action, but requires 3200 pulses to complete a single revolution. Driving three motors like this would be tricky, as it would take a lot of processing power, and the arduino prefers to do one thing at a time.

My brother had the great idea of using external oscillators combined with AND gates to free up the arduino to concentrate on the sequencing. I decided to include six oscillators - three to control the speeds of the motors, three slower ones to control the rate at which the motor changed direction. I wasn't sure if I'd need all of the direction changing ones, but I included them for testing, and in case I couldn't get the programming sorted out in time. At first the 555 timer oscillators weren't very stable, with motor speeds changing all over the place depending on direction and which motors were on, which was a problem as the motor movements would eventually have to match the music exactly. A 10uF power supply decoupling capacitor was the solution - still so much electronics to learn every day!

Once again my brother wrote the sequencing code for the arduino, which you can download here. (Update 4th August 2013: Currently working on another stepper motor project, and have now developed some much better code. Email me if curious. I will eventually upload it once the project's done).

By this stage I'd decided on a track called "Kill Bill Vol 4" by Modeselektor. In hindsight, I didn't realise about YouTube's copyrighted content detecting algorithms, and so I probably wouldn't have chosen a popular track that involved a risk of having a video removed. I am hoping not to have to re-program and film the whole thing over again, this time accompanied by an original composition on the bagpipes.

UPDATE: Monkeytown Music / BPitch Control have now authorised the use of the music for the kestrel video - hooray!

A while after choosing that track, I realised that, incredibly, Modeselektor is in fact an anagram of "Mode O'Kestrel"!

The track was opened in an audio editing program, divided into nine main sections, and the lengths of each section was noted for inclusion in the arduino program. The key times at which various events should take place were included in an "array" - a collection of numbers that the program can refer to. It took me a little while to realise that the times should be entered as absolute values along a timeline rather than a collection of "on" times.

An example array, for motor no. 1: {0,295,443,738,1034,1107,1182,1255,1551,1845}. Accompanying this is a boolean array describing whether or not the motor should be activated: {true,false,false,true,true,true,true,true,true,false}. This translates to something like "Up until 29.5 seconds, motor no. 1 should be turned on. After 29.5 seconds, turn motor no. 1 off until 73.8..." etc. Outputs were also assigned to three IRF510 MOSFET transistors, one to directly switch the lasers, two to switch the relays for the smoke machine and strobe.

A second arduino was included to play the music. An MP3 player "shield" (add on board) was ordered from Sparkfun Electronics, who sell loads of cool stuff. I had used this MP3 player before in the musical whisky dispensing machines, and had encountered problems with the little micro SD cards. This time I had another card become unreadable - they seem to be fairly unpredictable. On the same day I also fried an arduino board by shorting it on the metal rim around my coffee table - oops. At the moment the two arduino boards are synched simply by pressing a button that resets both boards at once, but I ought to sort out a bit of code to turn on the music at the right time. An audio buffer circuit was added to protect the MP3 player, which is in turn connected to a line out socket.

That's pretty much all of the electronics. There was a final bit of programming that allowed the left/right rotation of the kestrel to pulse in time, with two little quarter-second pauses to compensate for some bits where the beat goes out of sync after a little fill in in the track, but I can't be bothered to explain that now - you'll have to download the code and take a look.

The mechanical aspects of the project were much more straightforward - I much prefer metalwork to programming. The most interesting challenge was the fact that the pole upon which the kestrel rests has to move up and down as well as rotate left and right. The first motor provides the left/right movement by rotating a "cage" made of two bars, which encapsulate a disc that holds the main kestrel perching rod. The second motor rotates two linkage mechanisms that cause two carriage assemblies to slide on rails. Each carriage has a radial bearing attached, which run against the underside of the disc. The disc can slide up and down the cage, and so is lifted by the sliding carriages, providing the up/down movement of the bird. Both of these motors can of course run at the same time. I enjoyed making some parts using the milling attachment on my lathe.

The main kestrel-moving rod runs inside two sections of tubing, the outer one being structural, the inner one providing the rotary movement for the lasers, driven by the third motor. The tubes are separated by sintered bronze bushings, which allow them to run smoothly. The rotating tube is driven by a timing pulley, much the same way as in the orrery that I made a while ago.

The laser diodes are rated at between 30 and 40 mW, which is fairly powerful. The 3.7V positive supply passes through the frame of the sculpture, and the negative is passed via a loose ball bearing in a retaining sleeve with a spring onto a rotating copper track. The track is insulated from the frame, and has three wires connected to supply the lasers.

The frame has threaded inserts to allow it to be dismantled for transport. It was just about possible to take it on the train for its unveiling at a New Year's Eve party in Dorset. I seem to regularly end up carrying heavy items on the train (pillar drill, welder, bench grinder, CRT projector, modular synthesiser cabinets, giant metal rabbit etc).

I was delighted to receive a review from Frank Key of Hooting Yard, who called the Rave Kestrel "A very splendid thing... though I had to watch with the sound muted."

Datasheets PDFs:

Stepper motors
Driver boards
MP3 shield
AND gate chip

Thanks to:

Gary for help with the stepper motor drivers
Philip for the arduino code
Patrick for use of camera and lights
Paddy and Charlie for use of warehouse space
Rachel & family for a useful deadline and great NYE party

Return to main kestrel page

Return to home page