Swivel 2

 

swivel_two

Musical robots… My last few projects have focused on this (obscure) field: I’ve built some mechatronic drums, a mechatronic harmonium, and was involved with the building of MechBass. Since I’m really interested in the musical possibilities of a robotic guitar, I thought that my next project should be a six-string mechatronic instrument able to slide between notes. I decided that it should be MIDI-compatible, able to self-tune, and relatively cheap and modular.

In this writeup, I’ll detail the electronics, actuators, and the means by which I interface with this musical robotic instrument (which I’ve dubbed Swivel 2). I’ll write about my attempts at self-tuning in a future article. First up, though? Some history.

Seattle-based sound artist Trimpin is a constant source of inspiration to me; of particular inspiration in this project is his JackBox sculpture. Also pretty amazing is his If VI Was IX sculpture, capable of self-tuning. Other notable robotic/mechatronic guitars are Eric Singer’s epic and influential GuitarBot from 2003 (PDF), N.A. Baginsky’s Aglaopheme, and the instruments of Compressorhead. I really like guitars that have slide mechanisms, allowing for smooth transitions between pitches (meaning that composers can choose alternative tuning schemes on the fly). After looking at some of those instruments, I decided that one using rotary-motion “fretting” (pitch-shifting) would be kind of novel and potentially pretty cool. I built a prototype, dubbed Swivel 1.0, but ran into problems: it was heavy, expensive, and just general overkill to use big steppers on what amounted to a small instrument. I decided to rebuild Swivel (this time called Swivel 2) using inexpensive hobby/RC servos.

Swivel 1: using two big stepper motors and a big solenoid, this was a pretty bulky system.

Swivel 1: using two big stepper motors and a big solenoid, this was a pretty bulky system.

 

General Overview

A drawing of my SolidWorks model of one of the Swivel 2 modules.

Lighter weight and less bulky than Swivel 1… A drawing of my SolidWorks model of one of the Swivel 2 modules.

Swivel 2 consists of six separate string-playing modules. Each module features four RC servos: one for rotating the pitch-shifting “fretter,” a second to clamp the fretter against the string, a third to pick the string, and a fourth to damp the string. I made heavy use of 3D printed and laser-cut parts, and have mounted the components of each unit on a piece of T-slot aluminum extrusion. Electronics on each module take MIDI in and move the actuators accordingly. The six units are each assigned discrete MIDI channels; I use Ableton Live (but any MIDI sender will work) to send messages to Swivel 2.

But… enough of this general overview. Time to get into the nitty-gritty of designing and building this instrument.

Design

A render of Swivel 2, showing all six string modules.

A render of Swivel 2, showing all six string modules.

I really like designing assemblies in SolidWorks, but I find that it’s really helpful for me to do some higher-level sketches on paper before diving headfirst into that software. After getting a few general drawings put together in my sketchbook, I fired up Solidworks and started putting together the assembly for a single string unit (my idea was to get a single unit up and running before assembly-lining the six-string array). When designing something like this, I have to constantly remind myself of what manufacturing tools I have available; as tempting as it may be to design parts for milling and turning, I kept in mind that everything was going to be made six times and had to be relatively cheap and doable with the tools at hand (I’m lucky enough to have access to an laser cutter and an FDM 3D printer, meaning that most parts will be made of either acrylic or ABS. I’m saving up for some sort of mill and lathe to allow for purpose-designed metal parts in future projects).

I started by picking out the servos I’d need; I opted for some from Hobby King servos (mainly because they were cheap; if cost was no object, I’d go for some Dynamixels, programmable Hitecs, or something similar– as it was, though, I was going to eventually need 24 of them, so I couldn’t go for expensive ones). After choosing the servo, I modeled one up (it’s just a standard-size servo with an extra plastic nubbin at the power entry point).

Swivel 2's fretter: the fretter arm is rotated along the string by the fretter servo. The clamp servo can rotate the fretter against the string.

Swivel 2’s fretter: the fretter arm is rotated along the string by the fretter servo. The clamp servo can rotate the fretter against the string: by pressing the fretter against the string, the string’s pitch is changed.

The first step was to figure out the fretting system. I was inspired by the simple and cheap pan/tilt mechanisms available at Sparkfun. Essentially, I was just after a panning and tilting system: panning to position the fretter along the string (to change the string’s pitch), and then tilting (“clamping”) it to bring it in contact with the string. The simple one that I ended up designing is just made from two laser cut parts (Side note: If I were to redesign it, I’d support the servo shafts with extra ball bearings to keep them from flexing). The fretter arm is just an 8mm aluminum rod which can slide along the string; I designed a simple adapter to hold it to the clamping servo’s horn. This slide holder was to be 3D printed from ABS. The whole fretting mechanism is held away from the string on an acrylic arm.

A pickup on a Swivel 2 module: I wound a lot of enamel-coated copper wire around a spool. A magnet is inserted down the middle of the spool.

A pickup on a Swivel 2 module: I wound a lot of enamel-coated copper wire around a spool. A magnet is inserted down the middle of the spool.

While we’d used optical pickups on Mechbass and other prototypes, I decided to use a traditional magnetic pickup on Swivel 2 — they tend to be a bit easier to position correctly than optical pickups. Their main problem is that they’re excellent at picking up electromagnetic radiation from motors (this is why we went with optical pickups on MechBass). To get around this, I placed all of the actuators as far away from the pickup as possible. I positioned the damper and picking servos at the opposite end of the string, and used shaft extenders supported by ball bearings to position that actual damper and picker affecters right up near the pickup.

Swivel 2's damper: a foam-covered arm is mounted to a servo-connected shaft.

Swivel 2’s damper: a foam-covered arm is mounted to a servo-connected shaft.

The string is stretched between two acrylic pieces: the bridge and the nut (as a side note, a really fast way for me to get better tone out of Swivel 2 would be to replace this setup with a proper guitar-style setup instead of two pieces of plastic). The strings go through regular machine heads and are secured at the other end with a plate that holds the string’s ferrule against the bridge assembly.

The picking system on one of the modules: a servo mounted pick can reciprocally strike the string.

The picking system on one of the modules: a servo mounted pick can reciprocally strike the string.

While Swivel 2 is fully modular and designed to be set up in any configuration that allows MIDI cable and power to reach it, I built an aluminum frame that could hold all six of the string units in a compact semi-portable array. The individual Swivel modules are attached to the frame with laser-cut acrylic brackets.

Swivel 2's six modules: pickers, dampers, pickups, and fretters can be seen.

Swivel 2’s six modules: pickers, dampers, pickups, and fretters can be seen.

Electronics and Power

Swivel 2's PCB. Each module has one of these; the modules connect together (and to a host device) via MIDI.

Swivel 2’s PCB. Each module has one of these; the modules connect together (and to a host device) via MIDI.

The electronics for each Swivel unit had to fulfill two main criteria: to be able to operate on a MIDI bus and to be able to output MIDI-derived commands to RC-style servos. I chose to make an AVR microcontroller-based PCB assembly, capable of running the Arduino bootloader. I designed the PCB in Altium and had it printed at Seeed Studio.

swivel_2_flow_smallThe resulting PCB is 5cm x 10cm and uses at ATMEGA328 microcontroller. I program it using an AVRISPMKII, which plugs into the six-pin socket on the board. The microcontroller can output variable-duty cycle pulsetrains to up to four servos. Additionally, the PCB’s MIDI channel can be selected with a rotary hexadecimal switch. The microcontroller’s firmware is is pretty work-a-day (here’s a link), just handling incoming MIDI and outputting appropriate commands to the servos (the flowchart below illustrates the firmware’s behavior).

swivel_2_flowchart

Each module contains a regulator to convert the 7.5 V DC from the power supply to the 5 V needed by the microcontroller. The power supply is a Mean Well NES-150-7.5.

Assembly

After building a test unit, I set up an assembly line to build the six Swivel 2 modules. It was a pretty big undertaking, and I used Tom’s Planner to help with the time management. Without it, I’d probably still be somewhere about halfway done with this.

Building a bunch of Swivel 2 modules. Lots of screwing brackets into 80/20.

Building a bunch of Swivel 2 modules. Lots of screwing brackets into 80/20.

After getting everything cut, printed, and soldered up, here are the steps for the final assembly:
1) Mount the fretting system.
2) Attach the picker and damper servos, shaft extenders, and affecters.
3) Attach headstock and bridge plates.
4) Mount the electronics.
5) Attach the string.
6) Mount the whole assembly to the aluminum frame.

Testing

I found that the servos on different modules were not very consistent, requiring a good bit of individual calibration for each unit: each actuator’s range is manually mapped to prevent it from traveling outside of its desired workspace (in early tests, I neglected to restrict this travel, and managed to burn out one or two servos when they crashed into the frame and tried to move to an unreachable setpoint. A burnt servo smells bad).

Swivel all set up and in the process of getting its servos' travels dialed in.

Swivel all set up and in the process of getting its servos’ travels dialed in.

Making Music Sounds

I decided to make the firmware of Swivel 2 as “open-ended” as possible: on MechBass, a single command results in a single note being played. This is good for playing back traditional music and tonal sounds, but is less ideal for the type of weird noises that I’m interested in making with Swivel 2. Rather than playing a whole fret-undamp-pick-damp cycle in response to a single command, each action responds to a separate command: to play a note on Swivel 2, the user must input a MIDI pitchbend command to direct the fretter to a position above the string; the user must then send the unit a MIDI CC8 message to clamp the fretter arm against the string (this value ranges from 0-127, with different values adjusting the fretter arm clamping servo’s angle and “clamp intensity”); next, the user may choose to undamp the string with a CC9 message of 127. Finally, the user sends a CC7 value of 127 to pick the string.

Pretty involved, huh? Yeah— playing a single note is like writing an assembly language routine, and future work has gone into condensing these actions into fewer actions. In spite of its complexity, I still feel that Swivel 2 benefits from this open-ended signaling scheme, allowing the timing between events to be subtly manipulated without the need to re-flash each module’s firmware. Future posts will detail the self-tuning scheme, which sits between the composer and the microcontroller.

Swivel 2 all set up at Wellington, NZ's City Gallery.

Swivel 2 all set up at Wellington, NZ’s City Gallery.

Here’s a video of a demonstration piece made with Swivel 2. I’m interested in creating these kinds of compositions, wherein strange sounds that might be difficult to repeat precisely can, with the aid of motors and electronics, be looped and turned into strange soundscapes. I do think that Swivel 2 should be capable of the playback of existing songs, but I’m not particularly interested in using it for that… if you are, I encourage you to make your own and have fun! There’s a lot of room for innovation and exploration in the world of mechatronic/robotic instruments, and I’d love to hear from you if you’ve had a go at making some of your own.

A back view of Swivel 2.

A back view of Swivel 2.

Anyway, check out this page for a little more info about Swivel 2. You can also find some more writings about it and my other instruments here. Finally, don’t hesitate to contact me if you’ve got any comments or questions! Thanks to VUW ECS for funding, tools, help, and workshop space for this project.

One thought on “Swivel 2

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>