Monday, February 24, 2014

Macro Images of a Chip

A friend from the Omaha Maker Group gave me an interesting chip a while back. Apparently it is some kind of optically sensitive chip, it has a clear case.


I thought it would be interesting to take some macro photos of it and see if I could capture some of the details of the die. I started out with just some simple shots with the kit lens and extension tubes.


Easy enough to see, but lighting was difficult with the chip as close to the lens as it was. You can see the wires and a little detail of the chip, and the lighting in this one gives a nice shadow on the wires.

I then switched to my long telephoto lens, extension tubes. This let me move the chip back from the lens a few inches, which made getting light in much easier. It didn't produce an image that was any more magnified though.


The chip is about 2.5mm on the short dimension.

From here I added a 10X macro expander lens and also a 10 triplet hand-lens to see if I could get any closer. This was difficult because it's a separate lens and can't easily be mounted on-axis with the camera lens. With a little fiddling around it came out ok. I can see a lot of details, though it's starting to get fuzzy around the outside, only the middle is relatively free of aberration. 


Here's a crop from that image. 


In the original photo the 2.5mm chip is a bit over 1100 pixels across, giving about 2170 nanometers per pixel. The narrowest traces are about 4 pixels wide, about 0.0003 inches. I'm not sure what the aperture was set to, but this is probably not bad performance for a first attempt. I'll have to do some reading and set up my equipment a little more carefully and see if I can sharpen this up a little more.

Edit: with a little more fiddling I got it down to 580 nanometers per pixel. Pretty sure I can take it farther, but I need to set up something to handle adjusting the sample position for fine focus. It's pretty fiddly. Also need to get some bright light onto it so I can see it in the live view. My dim desk lamp doesn't really cast enough light for this.

Saturday, February 22, 2014

Photographic Depth of Field

I was curious why a large aperture on a lens reduces depth of field. To investigate this I set my camera up with a macro extension tube and a subject with lots of depth.


The subject is a potassium sodium tartrate (Rochelle salt) crystal mounted in a brass holder, with a copper contact wire for detecting the crystal's piezoelectric properties. From the perspective of the camera, this setup looks like this:


This image shows a very short field, as is typical with macro photos that are taken from very close to the lens. The focal plane is about 10 degrees off of perpendicular from the surface of the coins, and intersects the subject about where the copper wire wraps around the crystal.

To understand why some parts of the image created when the aperture is large are blurry, it's helpful to visualize the paths the light takes through the lens. I used this simulator to make a simple diagram:


From any given point on the subject on the left, light passes through every point on the lens and is focused onto the camera's sensor. If you imagine a tiny bug with an equally tiny camera walking around on the big lens and taking his own pictures of the subject, you would noticed that depending on where he was standing, his photos would each be slightly different, sometimes from a little higher or lower, or one side or the other. We can simulate the bug camera photos by taking a picture through a pinhole placed in front of the lens.



Because the tiny bug camera has a really tiny aperture, all his photos will have very large depth of field, they'll be sharp all over. My bug-simulator has a fairly large pinhole, you can see it near the top of the image, it's about 2mm wide, so I won't get as much depth of field, but you can definitely see that much more of the depth of the image is in focus, compare to the image above and note how in these both the rubber band near the back of the image and the reeds on the edge of the coin are sharp. Here the bug is walking from one side of the lens to the other:




It's hard to tell in the still images, but the perspective is different in each shot, the angles all change a bit as the bug walks across the lens. It's easier to see this if you user a bigger hole so that you get a full-frame image instead of the circular shot, but it's harder to see the increase in the depth of field. Here is another example with a slot to let in more light. Left side from the top of the lens, right side from the bottom. 



Since the tiny bug camera can only collect a tiny bit of light with each photo, all those slightly-different photos will be quite dark. If we stack them all up to increase the brightness, we get the image we would get from the regular-sized camera. It's a bright, but only the parts that were all the same in the individual images will still look sharp in the combined image. The parts that were all slightly different will be all mixed together, making them appear blurry. 

That's exactly what the big lens is doing, stacking together thousands of different perspectives of the view all taken at the same time. We could get deeper depth of field in the image by using a smaller aperture, but that makes the image darker. To compensate we can increase the light on the subject, leave the shutter open longer, or use a more sensitive sensor.

To really see this effect, it's best to see it in a video, so check this out:


Tuesday, January 15, 2013

Wattvision Meter Reader

Just a quick note about the Wattvision electric meter reader product. I haven't seen one in person, I was just reviewing the website, but this looks like about the simplest solution out there right now. I still like the idea of the RF approach, but visually inspecting the options on the meter is a good option too.

It's a little spendy at $250, but I suppose that's not too bad if it gives you the online tools and such as well. I think that a maker could easily hack together the same system with an Arduino and Wifi shield or Rasberry Pi and Wifi for under a hundred. And I think a couple of AVRs and a cheap RF serial link could do the job for about $30.

Wednesday, December 19, 2012

Underfloor Vacuum

 As a fun afternoon project I decided to try turning an old retired vacuum into an underfloor vacuum system. The idea is that when I'm dust mopping in the dining room and kitchen, rather than picking up with a dust pan, I can sweep it into a vacuum intake on the floor. This probably is not any easier than using a dust pan, but it's more fun :)

Also, I figured that rather than using the regular vacuum bag, I would experiment with using a vortex bucket to collect some of the trash, rather than filling up the disposable vacuum cleaner filter bags. I have no idea what it takes to make that work, but what the heck, I'll take a stab at it. I've been thinking a dust collection system might be a good project for the workshop, and if a swirly bucket like this works, it would be easier to dump than a shop vac.

I started with a Gamma Seal bucket lid. This is a fantastic product for anyone who reuses 5 gallon buckets. It's a ring that seals tightly onto the bucket better than a regular lid, but the entire center is threaded so it's easy to unscrew it to get to the contents. I figured I'd fix the lid to the ceiling, run the hoses in through the central part, and then when I need to remove the bucket part, I can just unscrew it and leave the lid and everything attached to the ceiling.

The inlet has to be tangent-ish to spin the air, with the outlet in the center, so that hopefully the heavier particles will fall to the bottom before the air exits and goes to the vacuum. I cut out a pathway through the lid for some PVC tubing.


However, I couldn't have the end of the pipe sticking up where it would run into the ceiling, or pinch the hose, so I used the table saw to make it more flexable:


I bent it to the right shape and fixed it in place with some aluminum duct-sealing tape. Most of the lid is held together with this tape. If it all works like it's supposed to I might epoxy it down at some point. Until then the tape will be fine.

To mount the lid I cut a 2x4 to go between the floor joists and drilled a hole for the outlet.


The Gamma lid ring goes on the bucket. Takes a hammer.Not looking forward to taking that thing off again.


The assembled lid with hoses goes on the ceiling. The inlet hose goes through a hole in the ceiling and comes out underneath the front of the dishwasher. For another project I'll make a sheetmetal collection hood with an inlet about half an inch tall and 10 inches wide this will poke out just under the kickplate at the base of the dishwasher.


Finally, the vacuum cleaner. I don't know if this is going to work, so I'm just hanging it with plumbers tape. That should avoid coupling too much noise to the floor.


Obviously I still need a way to turn on the vacuum, which is in the basement, when I'm sweeping in the kitchen. So, X10 appliance module to the rescue. I have a number of wireless X10 controllers that I can use to switch the vacuum from the kitchen. So far so good.

Sunday, December 16, 2012

Zen Toolworks 7x7 Home Switches and Sanguinololu

I've been spending some time upgrading the Zen Toolworks 7x7 mill. I glued in some home switches and wired everything up to to the  the Sanguinololu, and glued some split-loom onto the machine to route wires through. That all came out pretty nice. I mounted the board with some hook-and-loop on the back of the X axis, and placed the switches where the moving parts would contact them.

Here is the back of the machine, showing the Sanguinololu and wiring.



Here are the home switches, Z, X, and Y, respectively.




I was having some trouble getting software onto the Sanguinolol, it wasn't responding to the serial port. I loaded Triffids Teacup firmware on it using the Pololu AVR programmer, and it started sending the initial 'start' and 'ok' messages, but nothing after that. After fiddling with it a bit I hooked up the Bus Pirate in RS232 mode to check at the AVR pins to see whether the messages I was sending were making it through. They were not. Using the Bus Pirate to inject data directly at the AVR pin made it work as it should. This confirmed what I suspected, there was a bad connection between the AVR and the FTDI chip. I touched up the appropriate pins on the FTDI chip, and it started working normally.

So now it's time to start getting into software to convert designs into parts. In the past I used the DOS-based TurboCNC program to control my machine, and previously I was running this machine using it. However, I didn't want to be tied to an old computer with a parallel port, so I decided it was time to move to a USB-connected external board, which is where the Sanguinololu comes in.

I had the option to use a number of Sanguinololu-compatible firmware packages, and I've started with Teacup. I had Kliment's Sprinter on it previously, but I switched to Teacup when I couldn't get Sprinter working (because of the bad solder connection). Now that I've put the effort into configuring Teacup, I'm kind of hoping I don't have to try a different one. Unfortunately, Teacup doesn't support G2/3 arcs, which kind of sucks. I may switch back to Sprinter or something so I don't have to decompose all my arcs into line segments. This would work, but because the ramp acceleration mode does a full start and stop for each segment, it would be very slow. RepRap acceleration mode would get around this, but it's kind of a weird mode that requires the software generating the gcode work a little differently. I'd like to use Grbl, but I'm not sure if it is compatible with the Sanguinololu. I'll have to look into that a little closer.

One of the nice things about TurboCNC is that it has a fairly rich set of gcode commands that make it easy to run existing gcode files that include features like loops, printing messages to the screen while it waits for you to switch tools, tool offsets, fixtures, etc. Teacup doesn't have these, and I kind of like those features. 

So, to address this, I've taken the TurboCNC source code, which is normally compiled in Borland Turbo Pascal under DOS, and pulled it into Delphi7 and generally torn it into itty bitty bits. I removed all the UI code (which was based on a third party library that worked similarly to the TurboVision UI package), and eliminated all of the stepper code, and kept mostly the gcode handling routines. I replaced the calls to step-generation routines with calls that output basic gcode commands, which allows Teacup to handle the step generation. I've also added an OpenGL-based tool-path viewer, so it's easy to do a dry-run and see if it looks sane. The viewer will track what has been sent to the machine, but it doesn't yet watch for the block-completed messages, so it isn't very smart about knowing where in the list of queued commands Teacup is. This really only shows up when making long moves, but it would be nice if I could make it more precise.

At this point it will handle some gcode features that Teacup will not (loops, gotos, etc), and does not decompose arcs into line segments (I'll have to add that as a feature for completeness, as much as I'd prefer to have it in hardware), and showing messages while waiting for the user, but it's still missing some of the more advanced features that I want it to have. In particular I'd like to get it working with a touch probe. 

Here's how it looks after running a simple sample file:


For testing purposes I just have it output the generated gcode to a text file that I feed to the machine with a debug terminal. And, since I don't want to get it mounted with a cutting tool yet, I figured I'd make a little ballpoint pen attachment that fits in my Dremel Flextool holder:




While I was looking around on the web for something I ran across the TkkrLab wiki, where they are building pretty much the same setup as I've got here. In fact, I was surprised to see a link at the bottom of the page back to my flexshaft mount blog post :) It looks like they've run into the same problem with Teacup not supporting arcs. I'll have to keep an eye on their progress and see if one of the other options works for them.

Anyway, here's the mill running the sample file:

If you compare to the tool path preview in the screenshot above you can see where it skips the G2/3 arcs. Other than that it's working fairly well. At this point I probably need to spend some more time working on my Windows derivative to TurboCNC, and maybe see what I can do about evaluating other firmwares with arc support.

Saturday, November 17, 2012

3D Printed Model Airplane Motor Mount

Last time I had my plane out to fly I had a rather hard landing that broke the motor mount. I expect that I'll probably do that a few more times, so I built a model of a mount and 3D printed a few of them on the Omaha Maker Group's 3D printer. I made the model to the exact size, so I had to do some filing before I could get it to fit properly. I'll have to keep the oversized printing in mind next time.

The plan is for the mount to break along the print layers next time I crash, to avoid damaging the motor shaft. I'm sure that plan will be tested.


Monday, March 12, 2012

Dremel Flex-Shaft Mount for Zen Toolworks 7x7 Mill

I wanted to try out AutoDesk 123D for designing parts to be 3D printed on the RepRap, so I designed a holder for a Dremel Flex-Shaft so I can mount it on my Zen Toolsworks 7x7 Mill.

Drawing the model in 123D was fast and easy. I'm looking forward to using it for other things. I constructed this by starting a sketch in the XY plane and drawing the long rectangle, the two concentric circles for the holder part, two three-point arcs for the fillets (it may be able to do that automatically, I didn't experiment with that), and a couple of rectangles for the tabs. The sketch lets you multi-select the areas defined by the lines, so you can then extrude just the parts of the sketch you want. For the horizontal holes I started sketches on the faces where the holes needed to be (just a circle), then push/pulled it through the solid. Very simple construction process, and it maintains all the sketches and push/pull operations in the Browser, so you can easily go back and change them later.


I drew all the holes to the exact size. I know that the RepRap typically makes the holes a little small, but I wasn't sure if it would be better to draw them a little bigger or drill them out.

Once I had the model done I saved it as a .stl file and got it going on the printer. This is about as easy as it could be. The printer has home switches on all the axes, so it's just a matter of opening the file and clicking 'print'. It takes it a minute or two to warm up, then it's off and printing.


It took about 15 minutes to get both parts printed. They came out pretty good. The horizontal mount holes are only 5mm from the edge, and I noticed that the layers were a little wobbly on that narrow part, but nothing serious. I think in the future I should probably try to provide more material around horizontal holes like that.

I ran a drill bit through all the holes to bring them to the target size. It seems to make them about 0.5mm too small. That works out pretty well because the drilled surface is more precise and smooth anyway. Since the back of the part that mounts to the tool plate on the mill is a bit wavy I decided I'd face it on the mill to make it flat and square with the bottom of the part( which is glass-smooth from the bed of the printer).

Milling the plastic part works pretty well, but you have to be careful to not go too deep. Because the interior of the part is an open network (I'm using 30% fill) you can't cut away very much wall and retain the strength of the part. Also, where the filaments stick to each other isn't nearly as strong as the  plastic itself, so if you try to cut nearly through a layer it'll tend to peel off in strings. It's probably best to plan to cut not more than halfway through the filament depth, or possibly to impregnate the part with epoxy (or maybe wax) before milling. I ran the parts on the big mill with a fly-cutter, and other than tearing up a few filaments, the milled face came out great.


Mounting the part on the mill was fast and easy, all the holes were exactly where they were supposed to be, and it was all square and flat. It bolted right up and is good to go.


Fortunately, my Flex-Shaft is the old-style with a simple 12mm tube, so no funky ergonomic shapes to deal with.

I think next I'll make an adapter plate system with some magnets in it so I can quickly swap out simple tools, like a pen holder, magnetic field sensor, touch probe, etc.