Sunday, October 23, 2011

Arduino explorations, part three : Research and design

Truth be told, I didn't set out to use the Arduino on this application, because I had only seen the Arduino used for robotic applications.  My original intent, therefore, was to use circuit logic, i.e. AND and OR gates.  Because I wanted a display, I figured I would need 10 of the 7-segment displays, 5 for the target windings, and 5 for the current winding count.  Additionally, I would need a bank of decade counters, some way to set a target count to compare against, and a bunch of AND gates, and either a 7segment driver, or even more gates.  I was beginning to get discouraged, when the Arduino was recommended to me. Suddenly, all of my logic problems could be solved in code - and a whole slew of compatible items were available. Display The first order of business was to find a suitable display - since my original idea had been scuttled by the complexity of the seven - segment display integration, I was concerned that I would have a similar problem.  My sister, and arduino mentor, pointed out the LOL Shield- a nifty set of leds that are designed to fit directly on top of the arduino board. This came as a kit, which maent that one of the purposes it served was as practice in remembering how to solder - 120 leds with two leads apiece makes for a lot of practice. Finally, all soldered, and the test patterns not creating strange blinkiness due to badly soldered joints, amd I discovered that it didn't have enough resolution to display the text I needed to display. Another delivery from Sparkfun got me a two line lcd display. This I happily soldered wires to, got displaying text, and was pleased with the result. Readable text, scrolling and wrapping, a nice font, all good. But I had a mess of wires coming out of my Arduino, because I wasn't using a breadboard. I then desoldered the wires from the lcd, soldered in header pins, snuggled it down in my breadboard... and swapped voltage in and ground. I didn't realize my mistake at first, except for a strange smell, until I couldn't get anything to display. After checking my wiring, my heart sank as I realized I'd fried it. Another shipment from Sparkfun and I got the replacement. User Input Reviewing the stated requirements, I could see that I had three different types of input needed. I needed a numerical input for entering the target, a dial input for controlling the rotation speed, and button inputs for starting and stopping. The numerical input was solved by a purchase from Sparkfun of their 12 key number pad, which gave two non-numerical inputs ( * and #) that may end up being the 'enter' and 'reset' buttons. I had a bit of difficulty getting the test sketch to work with the numerical keypad, so in frustration I took a pair of wirecutters, popped open the case, and figured out from the circuit board how the key-to-lead wiring worked. Suffice to say that I had incorrectly read the sketch and both the sketch and the cookbook were right. A potentiometer from Radio Shack became the dial input. Next will be the mechanical engineering portion of the winder

Saturday, October 22, 2011

Arduino Exporations: part four - mechanical engineering

The purpose of this project is to wind the pickups, so the main requirement is to have a method of spinning the bobbin. All of the electronics are just to help out. This means that there needs to be a method to mount the bobbin to a shaft, and spin the shaft. Because of the electronic integration, I wanted a rotary encoder to be able to count the number of windings. From ServoCity.com, I purchased: A quarter inch shaft, Two thrust washers, ABS plastic, Two bearings, A wheel hub, A servo mount gear, A shaft mount gear, And a shaft collet. The idea I had was to have the shaft supported on both ends by passing through panels - wood in the prototype, and so the bearings were to ensure smooth turning. The thrust bearings were to ensure that the collet, which would hold the shaft in place on one side of the interior support panel, wouldn't rub during operation. The second thrust bearing, coupled with a spring I bought from Ace Hardware, would go on the other side of the interior panel, with the spring between the thrust bearing and the shaft mount gear. The idea was to both hold the shaft in place, and to allow the user a way to unseat the gear, rotate the shaft manually, then reseat the gear when ready to operate. I'm not sure how well that idea will work out, since the rotary encoder has to remain in a small slot between the IR emitter and detector. The nice thing about the spring is that, since it doesn't rely on a set screw to hold it in place, I can be pretty confident that it won't slip. The ABS plastic became my rotary encoder, with some slots carved in with the Dremel tool. I debated about how many to put in, since this was only going to count rotations, rather than be a robot inertial guidance system. I wanted more than one, since there was no way to determine where the slot might be when starting, and so the count could be off by a whole turn. As a friend pointed out, when you're winding 5,000 times, what's the big deal with +/- 1 turn, but I wanted to be a bit more accurate. Therefore, I decided on 5 slots, since I found a Binary Coded Decimal (BCD) chip in my dad's electronic parts. This is a base ten, or decimal counter, but uses a four bit binary register to count. This means, that instead of the four bits counting from 0 to 15 as in normal binary, the four bits count from 0 to 9. The design of the chip also allowed me to react to a state change when the count hit five and ten. The main reason for using the chip was to allow the Arduino to only be interrupted on each full rotation, rather than on every slit. Thin plywood was chosen for the prototype enclosure, with the main box being 9" x 11" x 11". The 11" width will hopefully counter balance the weight of the wire. The remaining dimensions were mostly chosen to ensure that the bobbin wouldn't stick out, and the rotary encoder wouldn't rub inside. With the wood cut out, I hope to have some pictures soon of the assembled prototype.

Thursday, October 13, 2011

Arduino explorations, part two: requirements

First I decided that I would approach this as if it was a project for work- namely before I srarted soldering parts, I would determine what I wanted it to do, then use that to guide what I would work on researching.
Requirements
1. System shall be able to wind pickup coil on a spindle of a standard configuration
2. System shall count the number of windings as spindle rotates
3. System shall allow the user to ready the spindle for winding, and account for any windings manually applied.
4. System shall allow automatic winding, with user able to control the speed.
5. User will be able to stop the winder through a 'panic' type button
6. User will enter a desired number of windings, and system shall stop automatically winding when the number is reached

Secondary requirements
Possibly to be added:
a. System may include guide to ensure windings are neatly laid on the spindle.
    This one is inspired by the winder from Stewart MacDonald, their winder has a smooth bar with set screw collets that act as the manual limit stops.

Design Elements
Some of these I had in mind writing the requirements, but in some cases I have ended up with something different than what I was thinking of when I wrote the requirements.  That's one of the advantages of requirements-driven design.  As engineers, we want to jump in and start coding, soldering, or assembling, but by working out what we're really trying to do first, then we can be open to solutions that may be easier, cheaper, or better than our preconceived notions.

1. User will be able to set target winding number - some type of numerical keypad needed
2. User will be able to see the current winding and their target - some type of display needed
3. User will be able to start, stop, and adjust the speed of the winding.  Buttons and a potentiometer
4. And of course, a motor to wind with.

Saturday, October 8, 2011

Arduino explorations

I have been asked to blog about my current project, that has led me to start exploring and experimenting with the Arduino microcontroller.
First, alittle background as to why I chose the Arduino.
This project actually started with a request from a co-worker fuor an Electric Upright Bass - his daughter is currently attending university as a music major, and he wanted something easier to transport across campus than a full size acoustic bass.  This led me to start researching how musical instruments are designed and built, and how electric guitars/basses transform the string movement into sound.
Suffice to say, that I quickly realized that the electric pickups to support a bowed instrument are not readily available, so I began looking for what I would need to be able to design/make pickups that supported a curved fingerboard.
There were two basic designs and one fancy design for translating string vibration into electrical signals. Piezo-electric, magnetic, and for the fancy one, light.  I could only find one manufacturer for the light based, and they only offered it built in to their own guitars,  so quickly rejected that option.  Piezo seems best-suited for pizacatto (plucking), and magnetic pickups seem better for arco (bowed) styles.  This led me to consider having both built in to the instrument.
The most flexible onfiguration for the magnetic pickups seemed to be the humbucking layout.  If so-called 'coil taps' are added, the musician has additional options within the instrument for tonal production, before the amp begins processing the sound.  The next issue that I had to deal with was how to produce the two coils necessary for proper humbucking - ideally both coils would have the same amount of windings to ensure that the common noise (hum) is cancelled out between them.  Coil winding machines are available, and there are many low-tech ideas of coil winding as well.  One involved clamping a drill to a workbench, mounting the coil spindle in its chuck, then using another clamp on its trigger to start and control the speed.  Another added an enclosure and a shaft, plus a counter to show how many turns had been put on the spindle.  Using the second as my inspiration, I began designing..