Tuesday, July 26, 2011

Fishing reel mechanisms

I opened up my fishing reel just to make sure everything was clean and running smoothly. I found two mechanisms that looked inspiring.

The first is the spring-loaded mechanism that holds the "line release bar" in either of its two positions. The part that turns has a hole for a short axle that it swings on, and another hole on the side for a bar that is spring loaded. This spring loaded bar flips around the axle and rests in either of two spots. I suppose these are "stable" positions that make use of the unstable position in the middle, where the bar is right under the axle, the spring is fully compressed, and where it's pushing at the most rounded, "teeter-totter" part.

Position 1

Position 2

The part that turns on the axle, with the small hole on the side. The squarish nub also helps guide the turning motion.


The second mechanism is in a tension-adjusting knob. It clicks the nob into different settings. There is a small ball on a spring that presses into a disk with corresponding dimples. The ball rests in one of these dimples and when the knob (the black plastic) gets turn, the ball slides out and pops into the next dimple. The metal disk is stationary, the black plastic is the upturned knob.


Monday, July 25, 2011

Autodesk releases a CAD software version for hobbiests

From hackaday.com: http://hackaday.com/2011/06/10/autodesk-enters-the-hobby-market/

This is pretty old, but better late than never. Autodesk, which makes the industrial and professional CAD software AutoCAD, has released a CAD software for hobbiests. Autdodesk 123D is free and similar to Google Sketchup in some ways, but seems to be more professional. It is geared towards people with CNC machines or 3D printers, as well as anybody who wants the design benefits of CAD for their home projects. I hope to download it sometime and try it out. It is likely good practice for real world use.

Nova: Hunting the Hidden Dimention

www.pbs.org/wgbh/nova/fractals/ - This is Nova's website for their movie/show Hunting the Hidden Dimention, which is about fractals. (Fractals are mathematical objects that basically repeat within themselves, e.x. in a fractal image, you see the same or similar designs as you "zoom in" or get smaller/simpler.) Nova has very good explanations of things, with slideshows and interactive applications.

Hack-a-Day

www.hackaday.com

This resource description is really simple. Hack-a-Day is a blog that compiles hacks* and projects from around the web. They also have forums and some other compiled resources. I follow them and will be posting good finds that I see there.

*hack, meaning to take a product or device and change it to make it better in some way. This might mean opening it up, modifying the electronics, using it for a different purpose, putting something together to "fool" the device so it works to your preference, or just tinkering with it to learn!
I don't mean the negative definition of hack, meaning to maliciously disobey or break security measures. The maker community has a different definition for hacking, which they do in different ways for different purposes. See my other related post here.

Collin's Lab and Make: Presents

On Make: Magazine's Youtube channel there are a lot of great videos and video series. Two of these series are by Collin Cunningham, who explains electronics topics and shows elementary projects. They are very helpful and cover a lot of good ideas.

Collin's Lab

Make: Presents

Some of my favorites:

A way to get analog signals from digital processing


Hacking into a guitar pedal and changing the sound


The origin of the breadboard


The LED

Arduino Piezo buzzer project with personal method

This is a small project I set up with my Arduino Microcontroller. There are a couple of cool things I learned and realized from this buzzer project. I mainly figured out how to generate a tone with the buzzer in a "manual," custom sort of way, without using the basic tone() function.


Resources:
I learned how piezo buzzers made sound and how I could reproduce it through a couple of resources.

Colin Cunningham's "Colin's Lab" videos include his piezo crystal video, where he grows his own crystals for piezo material and then hits them to produce current. He briefly explains the reverse would make the crystal move.


I was further helped by these two videos, where "cmhiekses" shows how he made his stepper motors play music. Stepper motors are very precise motors that are turned in a mechanical, clock like way. Therefore he was able to move and stop them for very short amounts of time, creating tones.

I had recently learned more about the physics of making sound. Pretty much anything that vibrates the air or pushes on it at higher frequencies makes a sound or a tone, including small or basic mechanical sounds that are repeated quickly.

What I did
I could make "mechanical movements" by giving power to a piezo buzzer, which would alter it at sort of a molecular level. If done repeatedly at a high frequency, these movements would make a sound. So I pulsed power to a piezo buzzer I got from an old electronics kit, using my Arduino. I added a potentiometer to control the pitch.

video

I thought this was cool because I was creating the sound almost all by myself. I got it to work using the tone() function in the Arduino library, but then turned the pin on and off myself in the code.

In the video above, you can see the blue plastic part (which came with the buzzer) is like a cone that amplifies the sound of the piezo element inside. Without the cone, I found that the sound would be louder even if I just put the element down on the table, letting the flat surface amplify the sound.

Trying it out on an oscilloscope
I wanted to try hooking this up to an oscilloscope just to see what it would look like. I know someone who has one and they let me use it quickly. I was quite surprised at what I saw. Since I'm just turning the pin on and off with simple timing, you would think it would look like a basic square wave, like so:

But in fact it looked like the one below, when the leads were connected in parallel with the piezo speaker.
I'm not exactly sure why it looks this way. I'm guessing it has something to do with the fact that a piezo element will give off current when "moved," as Colin's video above shows. So if the current from the Arduino modifies the element (or it gets modified because it settles down to its original state when the pin is off), it gives off some extra current that show up as the spikes. That would be something like back emf on motors or inductors. I don't know, when I work that out and what it might look like in my head, it doesn't match up. And I don't really know why it would spike so far down in the "off" sections.

The code
The code listens to the potentiometer and translates its value (with a linear equation) to an appropriate tone. It calculates the period of the tone (frequency is how often the repeating event repeats, ex. times per second, where the period is how long one cycle or event is, ex. time it takes for the event to start doing the same thing again), then turns the pin on and off for half a period each.

The conversion
Someone asked me how I figured out the scaling/multiplying factor/the linear equation. Technically you could use some algebra, but I just figured it out in my own unique way. (That's the cool part about understanding the math to make things work.)
First I searched for a note and frequency table online and found some reasonable frequencies I could play that would actually make sounds (2 Hz clearly won't make much of a sound, while I think 20,000Hz is the max for human hearing). I thought between 3500 Hz and 650 Hz was OK. The period is the frequency inverted (so, on a calculator, period = 1 / freq). So the periods would range from 300-6000 microseconds (I made these nice, even numbers since in practice the period is really what I care about).
For the conversion, I had 0-1023 from the analog input and I wanted 300-6000. So, I could multiply the analog input by some scaling factor and make it equal 0-XX, then add 300 to make it 300-6000. Well XX here would be 6000 subtract 300 = 5700 (I'm working backwards here). I divided 5700/1023 to find the scaling factor, which is 5.57184751*. So my equation is (analog input) * 5.57184751 + 300 = new, scaled value(s).

If you're fresh on your middle school algebra, you could treat the IN and OUT values as points on a graph, or points in a function. Then you can use the simple method to find the slope, plug in a point to find the y intercept (which is clearly 300 here anyways), or plug into point-slope form and convert into slope-intercept form.
Or if you're lazy, you could use WolframAlpha, an online computational search engine from Wolfram Research.
http://www.wolframalpha.com/input/?i=equation+of+line+through+%280%2C+300%29%2C+%281023%2C+6000%29
http://www.wolframalpha.com/input/?i=graph+points+%280%2C+300%29%2C+%281023%2C+6000%29


Here is the code: (zoom to see it much better)
Please note that this can be better done with the tone() function (example tutorial), but that my code is a custom method that I used for personal experimentation. I believe some people are copying and using my code for basic buzzer purposes, which is fine, but certainly not the normal method for learning or doing something basic!


/********************
 * Custom Tone 4
 * Ben L
 * 08/14/2011
 * http://noeticbrainwaves.blogspot.com/2011/07/arduino-piezo-buzzer-project.html
 * 
 * Creates a tone on a pezio buzzer in a custom way without the tone() function.
 * This version uses the adequate delayMicroseconds() fuction, instead of the delay()
 * function. It also has an analog input (potentiometer). It uses the more accurate
 * conversion constant, 5.57184751, rather than the previous, mismatched 4.86510264.
 * 
 * This program "pulses" the buzzer's power by rapidly turning voltage on and off.
 * This vibrates the buzzer at frequencies capable of producing sound.
 * The pitch can be set with analog input 0.
 * 
 * The analog input is converted into the period of a reasonable frequency to play
 * on the buzzer, then the period is halved. The buzzer's digital pin is turned
 * both on and off, each with the length of the halved period. The tone will be a 
 * square wave with a 50% duty cycle.
 * 
 * Analog input range is 0-1023,
 * period can be between 300 and 6000 microseconds,
 * frequency can be between 3333Hz and 166Hz
 * e.x. the note A4 has a period of 2272 microseconds and a frequency of 440Hz
 * 
 * Setup: wire a pezio buzzer to digital pin 8 and ground. Wire a potentiometer
 * to analog pin 0 (middle lead goes to pin 0, side leads go to power and ground;
 * if the pezio buzzer has a middle or third lead, just ignore it).
 ********************/


double period;
double wait;


void setup()
{
  pinMode(8, OUTPUT);    //set up DIO pin 8 as an output
}


void loop()
{
  //getting sensor reading and calculating
  period = analogRead(0) * 5.57184751 + 300;    //converting
  wait = period / 2;


  //creating sound by "pulsing" power to the pezio buzzer
  digitalWrite(8, HIGH);     //ON
  delayMicroseconds(wait);   //wait 1/2 period
  digitalWrite(8, LOW);      //OFF
  delayMicroseconds(wait);   //wait 1/2 period
}

Sunday, July 17, 2011

The Awesome Button: a custom USB button How-To

From Makezine.com: http://blog.makezine.com/archive/2011/04/the-awesome-button.html

A nice, simple How-to for repurposing the Staples Easy Button into a USB device. It can be connected to a computer and act like a keyboard or mouse, in this case automatically typing out a synonym for "awesome" when pressed. It uses a TeensyUSB, a spin off (version?) of the Arduino platform connected to the main switch for the button. I really like this hack because it's so simple and opens up a lot of possibilities.

Fixing my OTHER white desk fan

My family has another fan just like the one I tried to improve before. This one is white, and it also didn't work at all. When you would turn it on, it would struggle to start and move. So I was "commissioned" to fix it.

The fan was quite dusty, so I thought maybe a carpet hair or a piece of dust was stuck somewhere. I blew it with our garage air compressor and wiped it down with a rag, but that didn't do anything (I wasn't expecting much). I opened it up, this time going for the motor, instead of the swivel point like the last fan. It works after taking it apart and putting it back together. I think the motor was scraping against its housing or a pesky piece of dust, which stopped it. It might have been an electrical problem, though, but I think that's less likely.

View photos here on Google Web Albums with explanations of the process in the captions. These photos follow parts of the "story" of taking the fan apart.

Note that you should probably look at my first fan fixing post, since I won't explain some of the parts already seen and explained there.

Thursday, July 7, 2011

My thoughts on "I, Robot" by Isaac Asimov

I read this classic book recently and I thought it was good enough to write down my thoughts about it. These are put together without real form – they are rough, but I’m not trying to write an essay. Also, if you want to understand me, you probably should read the book first.


Here’s a summary: I, Robot is a collection of short stories within the same “universe” in the future. They all involve Dr. Susan Calvin, a “robopsychologist,” in some way, as she analyzes the problems with the robots in the scenarios. She works for U.S. Robots and Mechanical Men Inc., a company that revolutionized robotics and made the “positronic brain,” the mechanism or device that allows robots to think on the level of humans. But, since humans made the robots basically from scratch, there are overlooked, complex problems that arise. The short stories involve various situations that could happen, such as an advanced robot that thinks humans are inferior, robots being confronted with paradoxes or contradictions, or problems with allowing robots to deal with more danger. One strong element that the book is remembered for is Asimov’s 3 Laws of Robotics, which were his thoughts on how we would have to deal with robots and make them safe. Roughly: robots can’t harm a human being, they must obey human orders, and they must be able to protect their own existence, but in that order of priority.

-Asimov does express well the idea of robots being common, to the point that the humans take them for granted.
            -reporter and Dr. Calvin talk about the time before robots, reporter doesn’t recognize it
            -the family in the beginning and the scientists who aren’t roboticists deal with robots as if they don’t care about interacting with them on a deeper level, where they understand what is going on in the robot. We can see this today too with robots, but now people will just shy away and not interact at all. Asimov shows how it would be like if robots became much more “common.”

-On that last thought, the people don’t recognize the importance of what is going on when something goes wrong.
            - Even though the robots are so variable and flexible to understand human thinking, they should be precise (by today’s standards).
            - Breaking the 3 laws means something is seriously wrong in that world, and there should be more safeguards against it.
            -The humans shouldn’t get annoyed and act like the robot is just “stupid,” or like their coffee maker broke and they can’t have their coffee.
            -We see this today with cars and computers, but these robots are much more complex and concern more important implications. It’s like a fighter jet that breaks in flight and the pilot has to figure out what happened and land quickly because his life is in danger.

-The technology:
            -The positronic brain (Data!) is truly this fix-all technology. Asimov doesn’t really even consider that it is a powerful computer. Multiple indications show that it is not computer-based, specifically that it isn’t really “programmed,” it is mostly just “made.”
            -The name implies it is a quantum computer, allowing for smaller, faster, and more natural computing. This seems plausible (people are researching it now). But only if it is based off the positron particle, or some principle or interaction related to it. or only using the positron briefly on in a reaction. This is because the positron is an antiparticle (the “opposite” of an electron) and annihilates when it touches other matter. It would seem difficult to build with and use.
            -The emphasis on mechanics and mathematics instead of electronics and programming is clear. The robots are very mechanical, use more metal instead of some plastic here or there, not much mention of electronics, wires, or circuits (though I don’t think people were that far in electronics when this book was published). A lot of gears, etc. are mentioned, instead of what we would find prevalent in robots today.
            -The don’t realize how prevalent computers would become! “Oh, these calculations are so difficult! They must have a computer here in this facility that we can use!” “When the drawing board and slide-rule men said it was ok…” That’s why sometimes the robots are so wondrous, because Asimov didn’t really know how they could be made. He really only knew that we would have to recreate humans from scratch, so to speak, and there are many emotional things that are difficult and would cause problems.
            -I find it interesting how the first “talking robots” were a big advancement, and that robots with emotion came first. Now a days we would think it would be the other way around, that we would have talking robots that didn’t fully understand what they were saying because they didn’t have emotion, but that robots with emotion would come later.

-The 3 Laws are “built” into the brain. Human actions are so complex, I don’t know how this could be accomplished. It’s difficult enough to make a machine that understands and truly copies human qualities, but I think more difficult is that it recognizes bad situations on its own. (But I guess if you have wondrous technology that can do the former, it could do many other difficult things too).
            -The robots go “insane” when confronted with a contradiction or paradox concerning the 3 laws. Modern robots would likely have better, careful safeguards and would be able to recognize when something is wrong, either on a large or small scale. It would be testing itself and communicate with humans if something went wrong.
            -The robots are so good at displaying emotion that they do it in extraneous ways. “Oh my, hurt coming to humans! My goodness, what a thought!” I think modern robots would be much more precise and not frivolous.

Saturday, July 2, 2011

Fixing my wobbly desk fan

I unscrewed and opened up my desk fan to try and see if I could keep it from being so loose and wobbly. I thought maybe something could just be tightened. I found that the looseness comes from two things: the arm that pushes and pulls the fan from side to side is purposefully designed to be loose, and the turning axle does not have a good fit. Since the first is on purpose because of how the fan is designed, I can't really fix that (bad design of fan, then?). The second is too hard to fix, since I can't easily make a new axle or add material to make the fit tighter. See the pictures below for more details on the various things I saw.


Overall Pictures








Here's the arm that pushes and pulls the fan side to side. It's the double-angled piece of metal that is attached to a large plastic gear and the fan's base. The gear turns and pushes and pulls against the base, which stays still, so the fan moves. One of the holes on the arm is oblong and both screws are very loose. This makes it flexible and not bind up when it moves through all possible angles, but also makes the connection loose. It moves fine, but it will wiggle a lot if touched.


Here's the switch, which looks like a variable resistor with 4 states.


Here's a closeup on the magnetic coils for the motor. The coils are the black plastic underneath the main metal housing and behind the large gear. Notice the laminated iron core going through the coils and around the motor to strengthen the magnetic field and reduce eddy currents.


Here's the inside of a gearbox that directs power from the motor/fan blades to the side-to-side motion of the fan.
The silver axle extending towards the viewer comes from the motor and is a worm gear. I don't remember checking to see if there was a worm gear attached, milled into the axle, or if there are indications of the end of the axle having normal screw threads. I wonder if the last option might be easier to manufacture.
The knob lifts the white gear up out of the worm gear, turning off this motion. This seems to be a good way of  getting "in and out of gear."


Here's the hole with the screw that holds the turning axis in place.





Without the screw.


Here's the tiny screw that is used for the above pictures. Not very strong, I would guess. Is this the source of the wiggle? Does it need to be tightened or replaced with a longer, bigger one? Further research indicates not really.


Here's the axle connection. The metal ring seems to a bearing so that things don't scrape too much.


Here's the axle after the screw is taken out. Now we see that there is a groove all the way around the axle where the screw fits in, keeping the fan attached to the base. So the screw and this groove are what take the weight in this area when the fan is picked up from above. Noting the size of the screw above, not a design I would trust.


Nothing much to see from this view.


Another axle picture. The bearing is sort of loose and slides up and down a bit, you can see the gap here.


I tried to get a picture of the other end of the axle to see how it was attached. All I can see is the hole in the metal where it is attached. Clearly it was put on there before the fan and motor assembly was attached to that large metal bar, because you can't reach it now.


Here's two views on how the turning gears engage and disengage. I've always wanted to see this from the inside. As explained before, this is all done with the worm gear that ultimately powers the small gear seen here. So it actually doesn't matter how these gears end up meshing. I would have thought that these were the gears to engage and disengage.


Here in the disengaged mode, these gears are still together, which doesn't matter.