Other Projects – Neil's Log Book https://nrqm.ca What could possibly go wrong? Sat, 08 Feb 2014 23:16:55 +0000 en-US hourly 1 https://wordpress.org/?v=5.4.1 Strobe Guitar Tuner r2 Design Changes https://nrqm.ca/2014/02/strobe-guitar-tuner-r2/ Wed, 05 Feb 2014 07:14:14 +0000 https://nrqm.ca/?p=991 Circuit board rendered by oshpark.com.

Circuit board rendered by OSH Park.

I’ve learned a bunch about making circuit boards at work recently, so I decided to re-do the ol’ strobe guitar tuner project from 3 or 4 years ago.  The original still works… sort of.  I have to power it from a 3x AA battery holder that’s clipped to the power terminals with alligator clips.  It doesn’t tune the low E string properly for some reason.  The input’s inflexible, and it’s hard to reprogram.

The hardware has been updated in the following ways:

  • I’ve learnt how to use KiCAD for circuit design.  It’s a lovely open source EDA tool that handles schematic design, layout, and automated trace routing.  ExpressPCB was okay for the original tuner, but this board is a bit more complicated, complicated enough that laying the circuit out manually would be difficult, tedious, and error prone.  Plus I need to output gerber files, because…
  • … I’m going to get the PCBs manufactured instead of etching them manually.  At work I needed 24 little boards manufactured for a project and went with OSH Park.  I was very happy with the outcome OSH Park is a great batch service, they can make two-layer boards with silkscreen and soldermask for a reasonable price in low volumes.  The main downside is their lead time is around a month.  I also considered circuits.io, which seems like a really cool idea, but their design tools seem rudimentary (or maybe I’m just not accustomed to them), they use OSH Park on the back end so they’re more expensive, and they don’t allow full control over the board’s source files (that is, you can’t download them in gerber format).
  • The battery supply has been changed from a coin cell to 2x AAA batteries.  The battery holder will mount on the back of the board.  I’m a little concerned that it won’t be as comfortable to hold as the old version, we’ll see.  Battery life is also suspect, I figure a pair of AAAs should last something over 10 hours.  Is that long enough?  Probably, right?  It’s only going to be on for a few minutes at a time and I can program in an automatic shut-down if it gets left on.
  • There’s a real power switch that will disconnect the battery instead of putting the MCU to sleep.
  • There’s a switching regulator now.  I added the regulator, configured to output around 2 V, so that all the LEDs are delivered a constant current over the lifetime of the batteries.  Without the regulator the LEDs get dimmer as the batteries drain.  I chose a switching regulator instead of a linear regulator mainly because it’s cool and I’ve never used a switching regulator before.  Also it has a very low dropout (about 0.05 V) and will be more efficient for most of the battery’s lifetime.  Fun fact: the first regulator I chose was the only cheap 2.0 V fixed-output switching regulator on Digikey, but I failed to notice at first that it’s 1.5 mm long and 1 mm wide.  It fits six surface mount pads in that area, and has no leads.  I’m not soldering that by hand, but I applaud its existence.  Well played, Texas Instruments.
  • There’s a 6-pin PDI port for programming the microcontroller in the circuit.  As you can see the MCU is a TQFP chip that’s soldered directly to the board, so a programming port is necessary.  It would be cool to get a USB-capable MCU so that tunings can be set from a host computer without reprogramming the board, but that’s a feature for the 2018 version.
  • I spent a long time trying to figure out the human-device interface.  My original tuner just had a 6-way switch to select one of the six notes in the standard guitar tuning.  I wanted the interface to be flexible enough to support multiple tunings–not that I’m a competent enough guitar player to need multiple tunings, but it seems like a good idea nonetheless.  I considered two rows of LEDS, one to indicate the current note and one to indicated the selected tuning.  I also considered a dual 7-segment LED display to display the selected note in scientific pitch notation (e.g. E2, A2, G3, D3, B3, E4).  Finally I settled on a single 7-segment display, which I thought was pretty clever until I went back and looked at the project my original tuner is based on and discovered that’s what they’d done in the first place.  The user controls the tuner with two buttons to navigate up and down, and one button to switch mode between tuning select and note select.  Again, how comfortable will be to operate the switches one-handed while holding the tuner without risking electrostatic discharge in the components next door is an open question.
  • The MCU is an ATxmega8E5.  I’m coming around to the xmega line, although it’s kind of caught in the middle between ARM and the old megas.  The xmega library is more sensible than the mega’s library, the xmega has more features, and it costs about the same as an equivalent mega.  Originally I intended to use an ATSAMD20E14A, one of Atmel’s newish ARM Cortex-M0+ chips.  They look like nice MCUs and cost about the same as an equivalent mega/xmega.  One of the reasons I started this project was to get some experience with ARM.  Unfortunately that chip (and other ARM chips I looked at) has a maximum current output of 3 mA on I/O pins when powered with 2 V, so it’s really not suitable for an application that boils down to turning a bunch of 10 to 20 mA LEDs on and off.  The xmegas allow 25 mA per pin.

Next step: reviewing and tweaking the PCB design and ordering a few boards.  They should be here in a month or so.

]]>
Robotic Monochord Guitar Version 1.0 https://nrqm.ca/2013/09/robotic-monochord-guitar-version-1-0/ Sun, 29 Sep 2013 02:51:17 +0000 https://nrqm.ca/?p=967 More like version 0.1, every part of it was bad in some way.  We did robotic self-tuning monochords—single-string musical instruments—last spring in the mechatronics class.  The students did pretty well.

Most of their robots were designed along similar lines: they had a servo with a pick to pluck the string, an electric guitar pickup from which the robot read the string’s frequency, and a stepper motor to spin a machine head to adjust the string’s tension (and thereby change the frequency).  The design had some issues that the students didn’t have time to fix before they had to move on to their next projects.  We found that the biggest problem was that the tension controls weren’t responsive.  The machine heads are made more for precision than speed—with a guitar you have to tune a string precisely, but you shouldn’t have to do it very often so it doesn’t matter if it’s slow.  One team adjusted the tension using a linear actuator that stretched the string by moving a bar back and forth, which was a novel idea but which also suffered from unresponsiveness since they necessarily used a lead screw as a linear actuator.

I figure a robot should be inherently precise compared to a human, so machine heads are the wrong tool for the job.  We ought to be able to find a speedier way of adjusting the string frequency.  Instead of adjusting the tension I wanted to try adjusting the string length like you do with your fingers in most real stringed instruments.

First try at a guitarbot.

First try at a guitarbot.

For my first try I printed out a herringbone rack and pinion and screwed it to a board with some countersunk screws.  That was the most successful part of the project: the pinion, mounted to a stepper motor, moved smoothly back and forth along the rack in spite of the screws interrupting the rack teeth.

The stepper had two roller bearings functioning as wheels holding it up in back, and it was supported in front by the rack.  I printed a wheel to apply pressure to the string (simulating the finger/fret), and a v-shaped support to raise the wheel above the pinion and to centre it.  Originally I had the wheel mounted to just one of the motor’s screw holes, but since it was off-centre the pressure from the string pushed the motor on its side.  The wheel rolled smoothly along the string, so that was cool too.  The string was held by a couple of eye bolts with grooves cut in them to keep the string in place (replacing the guitar’s nut and bridge), and was connected to a machine head for easy tensioning.  The stepper was controlled by an Arduino with two buttons to make the motor turn back and forth.

The things that sucked:

  • I sanded a groove into the wood platform to keep the wheels straight, but it was too shallow and didn’t do its job
  • It was super-hard to get the printed rack straight, and it didn’t line up with the string all the way along the robot
  • The robot was way too short and didn’t produce an interesting range of sounds.  The rack was like 18″ long, and less than half of that was usable since the string just damps out if it’s too short (like plucking the string that leads from the machine head to the nut on a real guitar)
  • The stepper had too much inertia and its centre of mass was too far back.  I was hoping that between the herringbone teeth on the rack and pinion, the wheel groove, and the downward force from the string, the motor would move relatively smoothly.  Unfortunately it couldn’t move at high speed accurately and stably.  At a certain point on the rack it would just twist itself off.
  • In order to adjust the pressure of the wheel on the string, I needed to de-string the guitar, screw the eye bolts in or out, and re-string the guitar
  • The plastic wheel damped the string a bit compared to a metal fret

I didn’t bother installing a plucking system or a frequency sensor.  Instead I started work on version 2, which uses a Makerslide linear bearing and a more traditional belt-and-pully system for moving the carriage back and forth, kind of like in the MechBass video that I linked to above.  I like the idea of having the string “fingered” by a wheel instead of fingers à la MechBass, it ought to produce a neat slide-guitar effect and will also make it very easy to add vibrato to a note.  Anyway, version 2 is underway and I think it will solve most or all of the problems from version 1 that I listed above.  Alas, I didn’t order enough parts and our 3D printer broke, so as of this writing development is paused.

]]>
Ruminations on guitar tuner mkII https://nrqm.ca/2010/12/ruminations-on-guitar-tuner-mkii/ Sat, 25 Dec 2010 08:45:21 +0000 https://nrqm.ca/?p=351 Moooooooo.

The old guitar tuner I made works fine, but I’m thinking of some improvements:

  • The first priority is to switch the power supply from a 16 mm coin cell to a 20 mm coin cell.  20 mm cells are way easier to find: the dollar store down the street carries 2032 cells (2032 means 20 mm diameter, 3.2 mm height), but 1632 cells are expensive and hard to find.  Right now I’m clamping a 3x AA battery holder to the tuner’s + and – power pins, which is not comfortable.
  • The rotary switch is too expensive.  A 0.1″ two-row header with a jumper to select the tuner’s frequency will be cheaper, and won’t be an ugly blue box.  This is still not as flexible as the 7-segment display the original project used.
  • I’d like to use a low profile DIP switch to turn the power on and off instead of (or in addition to) mucking around with sleep mode.
  • It would be cool to use a surface mount microcontroller and crystal.  Getting an STK 600 routing card for 14-pin SOIC AVR chips might be worth it if I find money somewhere.

I considered replacing the microcontroller with a 555 timer, but I don’t think the 555 timer will generate sufficiently precise frequencies because of the tolerances in the resistors and capacitors.

]]>