Tuesday, November 6, 2012

Metalworking: Boring Bar Holder

Okay - Here is another metalworking project I did at Xerocraft.  This one was done on the milling machine.

One of the tools that we were missing for the metal lathe was a boring tool that could be used to make precision holes, tapered holes, or holes that are larger than available drills.  Tool holders that fit the KDK quick change tool post on our lathe are hard to find and pretty expensive, so I decided I would make my own.

Rather than go all out and create a holder that fits the dovetail on the tool post, I decided to go the easy route and create a holder that would fit into the 1/2" slot on one of the KDK tool holders and hold a 1/2" round boring bar.

The design is very simple.  Its a block of aluminium (because that is what I had on hand, and its easy to work with).  One side is drilled through with a 1/2" hole, and the other is milled to a 1/2" width to fit in the slot of the tool holder.  The part that fits into the toolholder is slit to allow the setscrews that hold it in the toolholder to compress the hole in order to hold the boring bar.  The photo above shows the boring tool as it is mounted for use.  The shiny part is what I built.

I started by cutting a chunk of 6061 aluminium to the approximate size, then squaring it in the mill.  Next I marked and drilled the hole for the boring tool, first with a center drill, then a small bit to establish a guide hole, and finally the 1/2" drill to fit the boring bar.  I did not ream the hole to size because the precision is not needed for this purpose.

Next I mounted the block directly to the mill table using a 1-2-3 block and some strap/step clamps.  I aligned the block to the axis of the mill with a dial indicator, then cut the steps for the part that mounts into the holder.  I used successive passes to get to the desired depth.  If I were to do it again, I would likely side mill at approximately the same depth to use more of the milling cutter.

I flipped the piece and aligned and cut the other side in the same way.

The final step was to mount a slitting saw with the same clamping setup, and cut a slit on the center line of the 1/2" width slot to the boring bar hole to provide a method for holding the boring bar.

When completed, the boring bar would slide into the hole at the appropriate depth and the 1/2" part would fit into the slot of the tool holder and get clamped into place.  This holds both the block in place, and by compressing the slit in the center, holds the boring bar in place.

The photo below shows an example of the boring bar holder mounted to bore a hole on the lathe.

Sunday, November 4, 2012

Metalworking: Slitting Saw Arbor

Okay, so this is not an electronics project, but it is my blog, and lately I've been spending my hobby time doing metalworking projects at Xerocraft, Tucson's local Hackerspace.

We have a old Logan Lathe and a generic chinese Mill Drill that I've been using primarily to make tooling for the lathe and mill.

Its been a lot of fun reviving the love of machining that I learned from my middle school (called Jr High back then) metal shop class.

This project was to build a bushings that allow our R8 shell mill holder to be used for 1" arbor hole slitting saws (like the one on the picture above), or other side milling cutters.

There were two parts needed to use the arbor for slitting saws.  Both started as a 1-5/8" diameter 1117 free machining steel rod.

The main bushing started as a solid piece of steel.  I mounted it in the three jaw chuck on the lathe and faced both sides square and flat.

Next I center drilled it and drilled progressively large holes through the center in 1/8 increments starting with 1/4" and ending with this 7/8" reduced shank (aka Silver and Deming) bit.

Next I set up a boring tool in the boring bar toolholder I made on the mill, and bored the remaining 1/8" to get the hole to fit the tool with a very close fit.  I did this by first boring to .995", then test-fit and bored a few mils more until I got the desired fit.

The next step was to coat it with blue dye and mark it for milling.  I carefully mounted it in the vice properly aligned so I could mill it directly down the center line for the alignment slots that keep it from turning on the arbor under the milling forces.  This required some careful setup, but was a it easy milling operation.  I actually broke a endmill while milling this.  The slotting operation in steel makes for a much heavier chipload that could not effectively clear out of slot.  If you look closely at the picture above, you can see the very fine chips caused by the cutter cutting its own chips over and over instead of clearing them out of the slot.

I cut the slot a bit too deep and used the lathe to adjust the depth of the slot by facing off the excess material.  Next I turned it around and faced the other size to get the length exactly right.  That finished the first piece.

The second piece was done entirely on the lathe.  First I mounted a small piece of the same 1-5/8" rod in the three jaw chuck and faced one side flat and square.   I drilled a clearance hole for a 3/8" drill.  Again with the same facing tool, I faced out a notch so the part fit perfectly into the top of the bushing.

Next I flipped the piece around and used a different tool to face out an indentation starting at the center hole to fit perfectly over the top of the arbor.

The two pieces fit together in two different ways depending on the width of the slitting or slotting saw used.  If a thin slitting saw such as the one in the picture below is used, the concave side is used so the saw is held tightly on the arbor.  If a thicker saw is used, the convex side is used to give support of the top on the bottom from the arbor, and on top from the machined piece.

The whole part goes together as shown below.

Tuesday, July 24, 2012

Project: OLS Logic Analyzer Hardwood Case

My Bus Pirate Case turned out so well that I decided to use the same approach to create a hardwood case for my Open Bench Logic Sniffer.

This is a open source logic analyzer with some pretty impressive specifications for the price.  It can handle sample speeds up to 200 million samples per second with up to 32 channels,  with varying numbers of samples based on the number of sampled channels, up to 16k samples for 8 channels.

16 of the channels are buffered 5 volt tolerant channels - these are the ones you see at the end of the board (and the only ones I've used so far).  There are another 16 channels (unbuffered 3.3v) on the unpopulated headers on the board.

I spent $50 for mine at Seeedstudios.

There are several software solutions available that talk to it - including the open source Java SUMP toolset that I have been using.  The hardware and software combination includes parallel and multi-step sequential triggering and adjustable pre-trigger storage.

Like the Bus Pirate, the OLS is a bare board, which puts it at risk of shorts from messy work surfaces with conductive things like paper clips and staples laying around.  I had previously hacked together a case from leftover acrylic and MDF, but this one is much better looking and more functional.

I did much of the work for this at Xerocraft -- our new Tucson hackerspace, using the milling machine to cut the openings in the chunk of leftover maple.

See the previous post on the Bus Pirate case for detail on the steps involved.

In short:

  • Cut an appropriate sized chuck of wood with a hand saw.
  • Milled the cavity and USB opening with the mill at 600RPM with a 1/2" end mill. 
  • Squared off the opening with a chisel and sander.
  • Rounded the corners and sanded a smooth shape with a belt sander.
  • Stained with the stuff I had lying around
  • Two coats of polyurethane with a light sanding between.
I again used #4 nylon machine screws and spacers to mount the board.  Because this board only has two mounting holes on one side, I added two extra holes on the other side evenly spaced such that one of then was directly below the buttons.  Nylon mounting parts are very reasonably priced in quantity, and are very easy to cut to exactly the desired size.

I marked the mounting holes with a transfer punch, then drilled and tapped the holes directly in the hardwood.  I screwed the machine screws in using the spacers and cut the excess length from the bottom with a good pair of flush cutters,  The screws with no hole got screwed in to the proper height to support the board from the bottom then cut off the same way.

I think it turned out pretty nice.

Sunday, July 8, 2012

Project: Wixtel adapter for IRXlate

Wixel Adapter board - middle layer in a three layer sandwich between the IRXlate board on the bottom and Wixel on top.
As I prepared to install the IRXlate, I decided that I really did not want to be taking it apart to install new firmware versions as I improve the firmware, and I needed a solid way to connect to it remotely.
Rather than run cable to it, I figured it was time to break out the Wixel Wireless USB Serial link that I got on sale at Pololu during their 2011 Black Friday sale.

It is easy enough to interface the Wixel to the 3.3v UART connector on the IRXlate, except for the fact that I did not route the power supply to the header, oops.  I'll do that with a engineering change -- a fancy name for a wire under the board.

I needed to build an adapter board to connect the Wixel to the UART header on my IR output board.  I could easily have done that with either my pcb mill, or by etching it, but once you've started working with custom manufactured double sided boards, its a bit hard to go back.  At only $9.90 ($14 with shipping), a 5cm x 5cm PCB from SeeedStudios seemed like the way to go.

I only needed about half that size, so I decided to fill the rest with some other useful circuits and adapters.  SeeedStudios allows PCBs to have multiple designs as long as they are only separated by silkscreen.  I also ordered the 0.6mm width boards so they are easy to cut (as in with a pair of scissors).

I added a MCP1604 based boost convertor design using parts from my most recent Digikey purchase.  This is a flexible design that incorporates a 20mm coin cell battery holder footprint and a four pin header with in and out voltages, ground, and the enable pin.  Changing a few components will get me a convertor that can produce 3.3v, 5v, or many other voltages from a lesser voltage battery, either from the coin cell holder, or wired into the through holes on the board or the header.

I also added a linear regulator based supply that can take either or TO-92 or SOT23 sized regulator.  Again it has a header for the breadboard connection, this time a double row with one row for output voltage and the other for ground.  It is intended to plug into a breadboard power rail.  The input side is connected to two 2.1mm coax power jack footprints, one on each side of the board.  One is connected as center positive, the other as center negative.  I will connect one or the other as needed, or just connect a battery to the appropriate through hole pads.

Basically this gives me ten boost convertors and ten linear regulars that can be built in various configurations for use in a breadboard, or in other designs.  All for free with another board that I have an immediate need for.

The base wixel adapter is all routed completely on the top layer.  Its a five pin header that connects to what is basically a 24 pin .600 spaced dip connector.  On the back of the that board, I reused the 24 pin headers to add some additional SMD footprints that are wired to pins on the DIP connector.  This will give me a bunch of extra SMD to DIP adapters from the nine PCBs that I don't need for the Wixel adapter purpose.

Not a bad payback from my $14.  I ordered the PCBs from Seeed on 6/14 and received the completed boards on 7/1.  That's a 18 day turnaround - not bad at all.

Scans of the board:

Top of Wixel Adapter "Panel"

Bottom of Wixel Adapter "Panel"

Project: IRXlate - IR Code Translator/Repeater

IRXlate is an infrared remote control  extender and translator.  The vision is to create a device that will both allow me to locate my A/V equipment any where I want, and also make my multitude of remote controls easy and intuitive to use.

It has always bothered me that when I pick up a remote control to turn the volume of the TV down, it is never the right one, or if it is it takes a while to find the correct volume control button.

Volume is just an example of course, but one that should resonate.  Realistically, there are only a few components where a volume control makes sense, and it is reasonable to send the appropriate volume up or down command to each of those components.  That's what IRXlate is designed to do.

The same thing works for the left, right, up down buttons, play and stop, etc.  Some of these will require storing and making decisions based on the current device "state" - all of which I will eventually do in firmware.

The design is based on a PIC microcontroller (currently a 16F689).  The input side is from a GP1U58Y IR detector that I had in my junk box.  This is a 5V three terminal detector centered on a 38khz detection frequency.  While the PCB footprint is laid out for that particular device, any of the similar detectors with the same pin layout will do the same job.

While working on the breadboard developing the circuit and writing the basic firmware, I found that the device is fairly unstable and sensitive to noise on the ground line as well as random light.  That all went away when it was properly grounded.

The hardware is fairly simple.  It consists of a discrete input board and output board.  

The Input Board:

The input side, which is made up of the GP1U58Y with a bypass capacitor on the 5V power line, and a 5V to 3.3V translation circuit to adapt the 5V output of the IR detector to the 3.3V inputs on the microcontroller.  The IR output has a 1k pullup to the 3.3V line, a 10k series resistor to the RA2 line on the microcontroller.  The RA2 input is diode clamped to the 3.3V line to prevent it from exceeding the 3.3v input.  The RC0 output line on the uC connects to an Error LED via a 470 ohm current limiting resistor.

The input board also has a microprocessor power supply circuit based on a SA57000-33 3.3V LDO regulator in a SOT23/5 package.  

The 3.3v supply feeds the 16F690 uC, and a SST25VF010A 1Mbit SPI Flash memory that is used to hold the IR code translation memory.  These complete the input board, except for the connectors for in-circuit serial programming (ICSP), a SPI header for debugging, a 5V power supply input, the UART connectors, and five IR output lines.

There is a footprint for a current limiting resistor and IR LED that can be populated for testing and debugging, but it is not generally intended to be populated.

The connections that go to the output board are on two .100 spaced headers - one with 8 connections - UART RX, UART TX, Ground, and five IR outputs (RC1 - RC5).

The second connector that goes to the output board is a 5V power input and ground connection on a 2x1 .100 spaced header.

The input board was designed to fit in a small box that I bought on sale from a surplus website -- I can't remember which one.  For my usage, I just soldered a ten conductor cable salvaged from a modem cable directly to the board.

The Output Board:

The output board was designed to be the interface point to the actual IR emitters, the power supply, and the serial communications to the microprocessor.  All of the wires are connected via screw terminal blocks.

It is a very simple design.  It includes a 5V power supply based on an linear regulator (78L05).  It has a polarity protection diode, footprints for input and output bypass capacitors, and an additional footprint for a electrolytic capacitor to handle extra power requirements of five simultaneous IR outputs if needed.

The UART rx/tx lines are routed to a 5x1 .100 header that has a pinout for the Pickit2 UART tool.  Unfortunately I failed to route the power to the appropriate pins, partially because the output board has only 5V power, and the rx/tx signals from the input board are at 3.3v level.  I ended up using my Bus Pirate for most of the debugging, and built a Wixel Adapter to allow wireless connectivity.  At some point in the future I'm planning on wiring all my devices up to a RS-485 network - at which point I'll build another adapter with the same pinout and footprint.

The rest of the board is made up of five copies of a simple transistor booster on the IR outputs.  Each has an NPN transistor pulling the sleeve of a 3.5mm jack to ground.  The base of the NPN transistor is driven by the uC output.  The tip of the 3.5mm jack connects through a limiting resistor to the 5V line.


As mentioned before, the input side was mounted in a IR case with a red IR transparent window in the front.

The output board will be mounted directly into the wall in a standard junction box.  The photo above shows the completed output board mounted to a blank outlet plate that has been drilled with holes for the 3.5mm jacks.  The board is mounted to a 1/2" piece of wood that is then mounted to the faceplate with screws to provide stability.  

The Printed Circuit Boards:

IRXlate "panel" - Top

IRXlate Panel - Bottom

For this project, I decided to order my first professionally produced board.  Seeedstudio offers a very reasonably priced service to produce boards.  This particular design required two separate boards - one for the input and one for the output.  The input board size was determined by the size of the case.  The output board size was determined mostly by the minimum space required by the five 3.5mm IR output jacks.  The only limiting factor is that it mounts to a standard outlet faceplate and fits in a standard outlet box.

After designing the minimum dimensions for both input and output, I found that they would not fit into the 5cm x 10cm size because of the space needed for the IR output jacks, so I arranged them into the 10cm x 10cm size ($25 for 10 copies).  I had quite a bit of unused space, which I filled with SMD adapters to break SMD footprints into standard headers for fitting onto a breadboard.  The final "panel" ended up with:

  • Input PCB
  • Output PCB
  • 3 x SOT23/5 to SIP5
  • 1 x SOIC20 / SSOP20 to DIP20
  • 2 x SOIC8 to DIP8
  • 1 x SOIC28/SSOP28 to SIP28
  • 1 x D2PAK to SIP4
Multiple that by ten copies and I should not be wanting for surface mount adapter boards for a while, at least for these footprints.

The boards ended up very nice - double sided with soldermask and silkscreen.  They are great to work with - especially for the small surface mount parts.  Okay - so none of these are really small surface mount parts - in fact they are huge as surface mount parts go, but they feel pretty small when you are used to dealing with DIP packages.

I did make a few mistakes on the board:
  • All of the TO92 parts - transistors and voltage regulators -- were reversed on the silkscreen.  This was easy enough to work around - simply by soldering the parts on "backwards" from what was shown on the silkscreen.  
  • There also was one pad on the footprint for the 3.5mm jack that was covered by soldermask.  It was an unused pin, so it really did not cause any harm.
  • As mentioned before, there was no power routed to the UART header.  Both of these have been fixed in the V1.1 board design that I'll reference here.

Firmware Development:

The firmware was originally hand written in 8 bit (16F) PIC assembly code for a 16F690 processor on a development board connected to a breadboard circuit.  In that form, I started by analyzing the IR waveforms using my digital storage oscilloscope.   That was not particularly easy to do, but let me get a basic capture and decode process written.  The firmware captures the mark and space timings of up to 100 cycles in RAM, then analyzes the results to encode the NEC or Panasonic formats.  If the format is not recognized, there is a debug mode that can dump the raw space and mark timings for development of additional protocol decoders.  The encoders just do the opposite - split the encoded value into mark and space timings, then send them to the selected IR outputs.

The initial development was done just using the on-chip EEPROM for storage.  It didn't take too long to figure out that I would need a lot more storage than that, so I added the Flash memory.

Partially through the development, I purchased an Open Workbench Logic Sniffer and things got much easier.  Using this inexpensive 32 channel logic analyzer, I found it much easier to capture the input and output IR signals and write them in formats that I could easily use in the MPLAB debugger.

The firmware is specific to my requirements.  The formats that it decodes and sends are the formats that my remote controls use (NEC and Panasonic).

I still intend to add some state specific logic, but I got to a point that I wanted to start using the device to make my life easier.  I have two problems - first I didn't want to have to continually connect and disconnect  the serial cables and use the ICSP connectors to load new firmware.  Second, I was running out of available program memory.

I ignored the second one and went searching for a serial bootloader to solve the first problem.  I still had a bit of memory left to work with.  Too bad that after I found and adapted the tiny bootloader to the 16F689/16F690, I found out that they can only read and not write the program flash memory while running.

The answer to both problems was to switch to a pin compatible PIC with more memory that can self-write program memory.  The 16F1829 fit that bill, so I bought one and soldered it onto a second input board to develop on.  When I get the firmware adapted to the new processor, I'll just swap out the processor chip.  That will be a topic for future blog post.

Friday, June 15, 2012

Fixing a Dell Vostro 1000 Power Supply: part 2

A couple of weeks ago, I posted about fixing my son's laptop that stopped charging the battery and running off of the A/C adapter.  I had isolated it to one component on the motherboard that I thought was a capacitor and took off to find a schematic or at least the part value.

Turns out the part was actually a ferrite chip.  That makes the measurements I made pretty worthless when I was assuming it was a bad cap.  Anyway, thanks to a remarkably quick response from ghn on http://www.notebookforums.com/, I was able to find http://lqv77.com/downloads/  which had a schematic for the laptop.  From that I found that the part in question  (FL1) was a ferrite chip BLM41PG600SN1L.  I found it on Digikey.com at 0.54 for quantity 1.  Of course I bought 5 - they are cheap and worth having on hand for future designs and repairs.  Well, that and about another $50 worth of parts that I had on my wishlist for future projects.

I decided since it was not completely clear that the capacitor PC134 (.01uf 25v Ceramic in a 0402 package) wasn't a problem, so I replaced that also.

My hot air rework station came in handy for this.  I cleaned up the pads with some additional solder and flux to get it to flow, then removed the excess with desolder braid.  Soldering the ferrite chip (a 1806 package) was a piece of cake.  The capacitor - not so much.  The 0402 package is really small, making it ridiculously hard to hold it in place.  I really need to get some really good tweezers to work with parts that small, and maybe a syringe of good solder paste for reflow soldering.

After a bit of fumbling, I managed to get it tacked down, then used the hot air to reflow it.   I cleaned up the excess flux with some alcohol.

I connected the battery, and power switch board, then plugged in the power.  The charging light came on, which I counted as a success.

It took me an hour or so to carefully reassemble the laptop, which has worked perfectly ever since.

For details on the troubleshooting process, see my previous post

Friday, June 8, 2012

Project: Bus Pirate Case

I bought a Bus Pirate v4 with a recent PCB purchase from Seeedstudios Fusion PCB service.  It is an awesome open device for debugging, prototyping and hacking hardware that was created by Dangerous Prototypes.

The Bus Pirate is sold as a bare board, which puts it at risk of shorts from messy work surfaces with conductive things like paper clips and staples laying around.  I've decided I really like this device, so I figured I'd make a case to protect it.

It just so happens that I recently joined Xerocraft -- our new Tucson hackerspace.  We have a milling machine that I have been working with, I decided to use it to mill a case out of hardwood.

I bought a small chunk of maple at a hardwood supplier and took it to the hackerspace to mill it out.  I set the mill spindle to run at about 600 RPM (too fast burns the wood), and mounted a 1/2" end mill in a 1/2" R8 collet.

I cut an appropriately sized piece of the maple with a hand saw (which took some effort - this is some hard wood).

Next I manually milled a cavity of the appropriate size in the piece and cut a slot for the USB connection during Thursday open hours.  This left me with a roughly shaped part, however, because of the size of the end mill I used, I had rounded inside corners instead of squared off corners that would fit the board.

Milling the case

I tried a few things to get the corners squared off - an oscillating tool with a basic plunge blade was the first thing I tried.  It cut well, but was a bit too hard to control.  I found that the best tool was a sharp chisel and a bit of patience.

I finished shaping it with a palm sander, then used a fine sandpaper to prepare it for staining.  I used a bit of stain, then a couple coats of polyurethane to finish it.

Once it was dry and looking good, I drilled appropriately sized mounting holes for #4 machine screws all the way through the bottom of the case, then tapped the hardwood for the mounting screws.

I used four nylon #4 machine screws and nylon spacers to mount the board directly into the cavity.  The screws I used are longer than I needed, but nylon is easy to cut cleanly, so I screwed the board in all the way and marked where they extended through the other side.  I pulled the screws out one by one and cut them to size just a little shorter than the mark.

The final case is quite functional and I think a step above the usual project case in looks.  The dark stained maple has a nice contrast with the red circuit board.

I was originally thinking I would put a clear acrylic top on the case, but I've found it is not really necessary.  I may do that later, but for now, I'm very happy with the results.

I also printed a label with the pinout and pin assignments and stuck it on the bottom of the case for easy reference.

I think I'll make a similar case for my Open Workbench Logic Sniffer board next (another awesome Dangerous Prototypes project).  I'll try to remember to take some photos at each step of that project.

I'm also planning on expanding a bit more about how I am using both the Bus Pirate and logic analyzer in future posts.