Posted on Leave a comment

3D Printed E-Drum and sensor system

This is a build document for a large array of E-Drums I am making to support a VR hyper-instrument project. All of the 3D printed objects, Arduino source code and instrument files will be made available through this website with appropriate copyleft licencing, mostly dependent on the most permissive possible licence of the source materials I am using. The hyper-instrument itself will be covered later in a separate series of posts after the construction of the physical instruments has been completed.

One piece shell and one piece rim printed in ESUN ABS+. The skin is a Remo Silentstroke 6″. Tension Bolts are 75 or 80mm M6. The shell is modified from a set published by RyoKosaka on Thingiverse under the Creative Commons Attribution-ShareAlike licence. In accordance with that licence my modifications and my sensor mount design are licenced similarly.

Get a good printer.

After several years of mostly solid performance, I decided to upgrade my 3D printer. My old refurbished Wanhao Duplicator (Sold as Cocoon through Aldi) had seen me through the construction of the Ambsonic dome, but was unable to reliably print ABS or run overnight. Temperature variations would always detach print jobs from the build plate no matter how much glue stick or hairspray I applied. It was also far too slow for the big, dense prints I needed to create drum shells. I needed a cheap, fast, fully enclosed printer.

The Creality K1 has mixed reviews and comes with many warnings from the cognoscenti of Reddit about poor build quality and recurring print issues. I considered myself experienced enough to fix whatever went wrong and bought one at a good discount. It has jammed only once in several months of hard use. It is fully enclosed and reaches temperatures of up to 50°C internally with heat from the build plate alone. This is not always desirable, so leaving the door open when printing PLA in hot weather is a must.

Printing the drums

I found several sets of designs for drum shells on Thingiverse (a site with a huge selection of free-to-use ready-made 3D print designs) and quickly settled on this collection of shells deconstructed for printing on 20cm print beds. The shells and rims are printed in sections and held together with M3 screws. The K1 is just big enough to print the 6″ shells in one piece, taking 6.5 hours in fine mode. The 6″ rim also prints in one piece, taking 2 hours. Shells printed using both ABS and PLA have held tension with skins installed for around a week with no signs of structural problems. Larger rims, such as the 8″ and 10″ sets have distorted (shown below) but are working well enough and are not losing tension.

Printing a one piece shell in rainbow silk PLA from ESUN.

Making the sensors

E-drums use a type of pressure sensor called a piezo. These are usually sold as flat discs that may have wires already attached. In the type of sensor I am using, force from the drum stick impacting the mesh head is transmitted to the piezo through a cone of soft material. The piezo is sandwiched between the cone and another disc of the same material that insulates the piezo from the frame of the drum. Multi-sensor drums that can detect playing on the rim often mount another peizo directly to the drum frame.

Completed cone sensor for the 6″ Drum. The cone is made from 3 layers of 12mm self-adhesive EVA foam sheet.

The mounting plates for the internal sensors included with the downloaded files made no sense to me, so I quickly designed a new friction-fit sensor sled that allowed for another jack to be installed underneath the drum, to be used for tight arrangements where the sides of the shell might not be accessible. The sensor is patterned after the Roland cone sensors used on their V-drum products. Although ready-made cones are available from aftermarket manufacturers, they are easy to make from materials available from Bunnings, for a fraction of the price

I experimented with several types of foam when developing the cones, including hybrid cones that used softer material for the top half. It didn’t really matter – every foam I tried gave good results, but a cone with a pointed tip such as the one shown above will need to be constructed from a firm material. Having a small point is especially desirable for drums with a centrally mounted sensor as it makes the foam cone harder to hit directly with the drum stick (which usually results in a very, very loud hit that stands out from regular playing). The sensor sled is a tight friction fit inside the drum but is secured with 20mm M3 bolts to keep it in place when plugging leads into the integrated Cliff jack.

Making the cones

I use a 3D printed cone shaping jig and a reciprocating scroll saw to shape the cones. Firmer foams, such as this EVA, can be shaped with a powered wheel sander. Soft foams have a tendency to grab blades and sanding discs/belts and can be dangerous to work with if you are using high-speed equipment, so I would recommend shaping those materials by hand with a scalpel. The jig is designed to replicate the 66° slope of the original Roland cones.

Assembling the sensor sled.

The sensor sled mounted to the 6″ shell. The Cliff jacks are simply wired with the red wire from the piezo to the tip of the inserted 6.5mm jack.
The tip of the cone should ~2-3mm proud of the height of the shell, allowing it to make good contact with the mesh drumhead. The cone described above comes out at exactly the same height. Take care when tightening the drum head as high tension may cause the sensor to stop working. If a satisfactory tension cannot be reached without stressing the cone, trim a very small amount from the top, taking care to leave a flat, smooth surface.

Bill of Materials

PartMaterialsCost
6″ Drum shellABS or PLA filament55m/165g$4.62
6″ Drum rimABS or PLA filament22.3m /67g$1.86
Sensor sledABS or PLA filament3m/9g$0.18
37mm Piezo In a pack of 25 from Ebay1$0.30
6.5mm Cliff jack Bulk order of 30 from Element142$3.70
37mm disc of EVA foamCut from 400 x 500 x 12mm Adhesive Rubber Mat4$0.80
Hookup wireAnything lying aroundTo taste??
Double sided tapeSomething thin – not foamTo taste??

Files (will be linked soon)

Posted on

Nichrome wire as a controller input for Max Msp

The bow hair has been replaced with strands of nichrome wire. When the wires are connected by contact with a violin string or another piece of metal they form a conductive loop. The aim is to reliably measure the length of that loop and deduce the position of the bow. The electronics packages also contain gyros and bluetooth modules.

Recently I attempted to create a violin controller that used lengths of nichrome wire to replace the horsehair in the bow. The theory was that I could use the predicable resistance of the nichrome to detect where the bow was contacting a conductive element on the violin bridge. It turned out to be a little more complicated than I anticipated.

28 gauge (0.3mm) nichrome wire (Jaycar). 13.77 Ω/m resistance.

What is nichrome?

Nichrome in an alloy of nickel, chromium and (often) iron. It has high resistivity and is used to construct heating elements. DIY types would know it as the hot wire in a home-made foam cutter. The resistance increases linearly with length – a property I thought would make it ideal for constructing my own sensor.

Turning nicrome into a length sensor

Arduinos, and their clones, make measuring resistances very simple. The usual method is to construct a voltage divider using 5v or 3.3v sourced from the Arduino (or a power supply) and a known resistance (usually something in the order of a few kΩ). There are two reasons why this method will not work with the length of nichrome I am using in my project:

The usual way to measure a resistance with an Arduino. Ideally, the known and unknown resistances need to be similar, but that is not possible with my project due to current concerns.

The sensitivity and voltage range of the Arduino

The change in resistance over the length of nichrome I am using is small – only ~16Ω, and I need to measure that small resistance with the highest accuracy I can get.

Using the voltage divider equation, a divider using, for example, a 1k resistor as the known value will give me a tiny range of 5V to 4.92V on my 5V powered Arduino Pro.

The standard Arduino only has a 10 bit resolution for measuring that input voltage – that’s a 0 – 1023 range, of which I can use ~80 with that tiny change in voltage. To make matters worse, in the real world you sacrifice some of that range to ensure that the values you are measuring are all relevant and all captured. A system set up to use all of the input range has no room for values to slip, components to change, or for just the random behavior that seems to creep into home-built hardware. It is possible, however, to tell the Arduino to use a different measure for comparing voltages.

Input voltages are usually measured against a reference voltage that matches the voltage used to power the Arduino. This is convenient, as the Arduino is commonly the voltage source for sensing attached switches and potentiometers. It is possible to set a different reference voltage inside the Arduino, using AnalogReference(). This approach has some limitations, not the least of which is the lack of uniformity across the range of Arduinos and clones. This project began on an Arduino Mega clone, was installed on genuine Arduino Pro units for the final product and was moved to a Duinotech Nano for one of the interfaces. The second round of hardware has spent some time installed on 3.3v Duinotech ESP32s and a 3.3v Arduino Nano 33 BLE Sense (the sense has an optional 12 bit resolution but uses 10 bits for compatibility).

Lets’s look at the available reference voltages for the family of boards that I have used for the first round. Setting anaglogReference(INTERNAL) gives different results on different boards, some values are only available on Mega boards and the standard value differs between 5v and 3.3v versions of the same boards.

Arduino AVR style internal reference voltages: 
5V (5V power supply) or 3.3V (3.3V power supply)
INTERNAL: 1.1 volts on the ATmega168 or ATmega328P and 2.56 volts on the ATmega32U4 and ATmega8 (not available on the Arduino Mega)
INTERNAL1V1: a built-in 1.1V reference (Arduino Mega only)
INTERNAL2V56: a built-in 2.56V reference (Arduino Mega only)

So why not maximise the voltage available for measurement by using a known resistance similar in value to my length of nichrome? Because that would be very dangerous for my Arduino. The nichrome in the bow forms a loop when the two strands are bridged by a metal contact, so the total resistance would be < ~14Ω when in use (you won’t usually use the very ends of the bow, so you won’t see the full 16Ω). Even if we double that and use a 25Ω resistor, with a 5v source that is is ~200mA (1W @ 5v!). I’ve looked through the specifications for a few models of Arduino, and they have all had a 40mA maximum for IO pins. So how do we do it safely?

Safe sensing

Connecting a constant current source to the Arduino.

We can measure low resistances safely using an external constant current source. R = V / I, so with a known voltage and current we can measure resistance without presenting a risk to the Arduino. The LM317 regulator shown in the diagram provides a known 104mA. We can round this down to 100mA (0.01A) and see that R = 10V. My 14Ω usable resistance range is now a manageable voltage range of 0 – 1.4V of 1.6V total range measured against 5V. That immediately improves the 5V Arduinos measurement resolution to ~287 of ~328. The hardware will be re re-implemented on newer 3.3V modules which improves the Arduinos performance to ~434 of ~496. The 3.3V Nano 33 BLE SENSE has an optional 12 bit mode (0 – 4095) that improves the bow reading accuracy again to ~1736 of ~1984.

Making it Better

There are some easy ways to make the hardware better – the most obvious being altering the current source, but these modules are already built and I’d like them to be useful for other low resistance tasks, so they’ll stay at 100mA for now. There is, however, a simple way of drastically improving the apparent resolution of a hardware sampling system without touching the hardware at all:

Next installment: oversampling

LM317 modules in action:

Bow electronics package. The LM317 is visible on the bottom right.
Another electronics package for the body of the violin, to sense a nichrome replacement for one of the violin strings. The LM317 and 12Ω resistor are visible on the middle right.

Posted on

Making keys for the uniform keyboard

It was immediately obvious that painting over the top of re-shaped keys was just not going to be good enough. The existing keyboard I had been shown was functional but looked like a mess. These keyboards would probably see heavy use by students so I needed something very durable that also felt natural. It’s hard enough learning a new way of playing a keyed instrument without the distraction of paint coming off under your fingers.

I decided to re-cast the tops of the raised keys (previously the sharps and flats) in solid white resin. This increases the mass of the key a little, but that is not a drawback. The more expensive Korgs that use this keybed have weights installed to give them a better feel and even out the stronger spring response of the shorter keys. The extra weight of my solid tops is improving the keyboard!

Posted on

Bilinear Uniform Chromatic Keyboard

This is an interesting project. I’ve just been commissioned to alter a Korg Triton LE keyboard to the bilinear uniform chromatic keyboard standard.  It fairly obvious to anyone who has studied keyed instruments that the traditional keyboard is exactly the sort of mess that you end up with when you extend an interface far past what is was originally meant to do. We can’t undo the unholy dog’s breakfast that is tempered tuning, but at least we can address the crazy lopsided way we approach the piano keyboard. If you are interested in how it works, there is a great explanation here.

All of the previously ‘white’ keys need to be trimmed to a symmetrical shape and widened. There are more ‘black’ keys than before, so I’ll have to order some in as parts. Luckily the Triton was a very popularkeyboard, so parts are easy to find. Shaping and re-casting the keys will the tricky part.The Triton is very easy to take apart and the screws are large and mostly restricted to two sizes, making eventual reassembly much easier. After lifting off the bottom plate the whole keybed comes out as one unit. The keys clip in and out of the bed easily. I’ve arranged the ‘black’ keys where I need them, but five more need to be ordered to fill the gap.

That’s the easy part. I’ve measured the keys and laid out my replacement white key in Solvespace. Now it’s time to make a mold and start cutting them up.