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..

Tuesday, May 17, 2011

The Car Saga - Sucess!! Part one...

repost (sigh)
After 17 months, we are a two car family again!
As those who know me are aware, I undertook the challenge of replacing the clutch on my 1996 Ford Explorer.  At work, it became a bit of a joke, whether the co-worker who was building his own house would finish before I got the car running again.
A bit of history, first.
I had been having trouble with the clutch for a while, which manifested as being increasingly hard to get the car into gear.  Imagine, if you will, having to slam the gearshift into gear, and you've got a pretty good idea.  My dad and I kept attempting to bleed air out of the line, as the books we found indicated that a slipping clutch was an indication of a bald clutch, and that hard shifting was air.  Finally, bleeding at home did not seem to provide relief, so the mechanic power flushed the system, and gave me about another week of driving time on it, with the admonishment that 'the clutch definitely needs attention'.
Within a week, I was unable to start the car in reverse, and struggled to shift.  The weather was fair, I found a local supplier that had a clutch repair kit with a pilot bearing, pressure plate, clutch plate, and a replacement throwout bearing.  Reading in my repair manual, they recommended replacing the slave cylinder as well,so I bought one of those as well.  It being the mild part of fall/winter, I started out working on the driveway, crawling in and out on the concrete.  Surprisingly, it wasn't long before I had all of the pieces off, to some extent or another.  My one 'shortcut' that I took was to not detach the driveshafts from their axles, and instead leave it sitting on the rear engine cross bar mounting point, for the front driveshaft, and on the ground for the rear driveshaft.
To get to the clutch plate, I had to remove:
1. The transfer case skid plate
2. Detach the front and rear driveshafts from the transfer case
3. Remove the transfer case
4. Remove one of the exhaust pipe sections that wraps around the transmission
5. Detach the rear engine crossbar, and lower the transmission and engine, this left the engine attached in the engine compartment, and a little bit of a heartstopping moment as it looked like the engine would hit the fan.
6.Removed the starter motor
7.Disconnected the transmission and attempted to lower it gently onto the ground
At this point, I was just using a lot of sweat and swearing to get the parts off, as I thought it wouldn't be too hard.  I removed the pressure plate, and the clutch plate, and, since it was recommended, also removed the flywheel for resurfacing.  Napa not only resurfaced the flywheel, but also knocked out the old pilot bearing, so I was all set to start putting stuff back on.  Seemed pretty easy!
As I started putting parts back on, I torqued everything down, and made sure that the pressure plate was tightened in quarter turns, in a star pattern, etc, which ensures that the springs inside are compressed evenly.  I was a little surprised by how quickly the torque wrench hit the torque that I had set, but figured the difficulty in getting the bolts off was due to the lock-tight that was applied to them.  Before trying to put the transmission back up, I changed out the slave cylinder.  The transmission was raised in place by a combination of jacks, jackstands, paver bricks, and holding with various arm, leg and shoulders.  Also interesting to get back up was the transfer case, as it has nicely rounded corners, and so was constantly falling or shifting.  Plus, since the transfer case sits just in front of the fuel tank, it took some finagling to get it into place.  Reattachment of the rest of the parts went pretty smoothly.  Bleeding the clutch did invoke a brief incident, as I put the cup inside the passenger compartment, then crawled under to open the valve.  As I crawled out, I caught the tubing with my hand, knocked the cup over, which dropped all of the brake fluid onto my face.  I quickly closed my eyes, and sat up, taking the bottom edge of the door right on the forehead.  I then walked as quickly as I could into the house, with both eyes tightly shut, until I could wash my face off.  Sure enough, had a nice gash in the middle of my forehead.
But wait - you might be wondering why it took me a year and a half to get a working car...
Starting the car up in neutral, I found that once again, I couldn't shift into first.  So, I turned the car off, put it into first, and started the car again.  This time the car lurched forward, heading straight for the garage door, before I let go of the key.  It was clear to me that I had done something wrong...