Monday, August 22, 2016

Idea For A Mass Producible Wooden Storage Box

I like things to be organised.  Over time, I've found the best way to accomplish this is to store similar things in labelled boxes.  It looks neat and tidy and makes it easy to find exactly what you want when you want it.

The exact form factor of the boxes has so far been an iterative process where I learn the pros and cons of each design as I use it.  I currently use cardboard boxes, but the long term goal was always move to wooden boxes.  I have only a few requirements.  They need to be big enough to hold a sheet of A4 paper (297mm x 210mm), and they need to have a lid to prevent dust covering the items I want to store.

The title of this post mentions the term "Mass Producible".  I should clarify that I mean making about 100 boxes, not millions.  With that in mind, I also want to be able to use automated manufacturing methods like CNC routing and laser cutting to make the parts of the boxes.  It would be great if I could get some furniture grade plywood delivered to a workshop, have them cut the pieces, and all that was left was a bit of assembly.  I haven't been able to find that capability yet, but it'll happen one day.

So what have I come up with?  Nothing too ground breaking.  In the image below you can see that there are standard box joints in the corners.  For this job, box joints are pretty much the only way to go.  Although the image below has been rendered with a plain piece of timber, I actually want to use plywood and making the thickness of the ply as small as practical is important as it reduces the weight of and size of the box.  With thin pieces of ply, nailing or screwing into the ends can cause problems with splitting, the box joint eliminates this as an issue.  It also make assembly easy.  Glue and clamp.

Wooden Box
Storage Box with Sliding Lid

With the lid removed you can see the rebate that allows it to slide in and out.

Wooden Box
Rear View of Box with Lid Removed

With the back and side removed you can now see a couple of extra features.  There are grooves cut into the sides that allow removable dividers to be added and removed as needed.  The shape of the base is now visible as well.  Traditionally you would just cut a rebate all around the bottom for the base.  So why have I gone for the convoluted tabs?  Once again, plywood.  Depending on the depth of any rebate and the direction of the grain in that layer of the ply, there is a risk that when a heavy item is placed in the box, the ply could fail.  This stitches the base and sides together for greater strength.

Wooden Box
Rear view of Box with Back and Side Removed

Of course this creates some problems.  If you're laser cutting the tab holes and they go all the way through, everything is fine, but if they only go half way, they need to be routed and need t-bone fillets added to allow the tabs to be inserted.  This is because you can't cut an internal square corner with a router bit.

Wooden Box
Box with Base Removed

I don't have the capability to manufacture these at the moment.  Ideally I'd start off by routing all the features that don't go all the way through on a 1200mm x 2400mm sheet of plywood.  At this point it's still one sheet that's easy to move.  It would then be laser cut to produce the final pieces.  I don't even know if this is something that's done commonly.  The reason for this is that you need the nice square internal corners that a laser produces for nice box joints.  I might be able to play around with the joints to make it a one step process by routing though.

So what's next?  Like I said, I can't manufacture them they way I want yet.  That doesn't mean I can't play around with the form factor though.  Stay tuned.

Wednesday, August 10, 2016

"The directory name is invalid" on the NXP LPC19459 in USB mode

Note - If you've arrived at this page because you're trying to get data off an SD card or USB drive that gives the "The directory name is invalid" error, I suggest trying to access the file via a Linux virtual machine.

Nearly every device you buy now seems to have an ARM core processor in it somewhere.  They're affordable, powerful, and when surrounded by peripherals they make some pretty impressive microcontrollers.  Traditionally I've always been an AVR and PIC person, and they still have their place, but I'd be stupid to ignore such a massive section of the market.  For those reasons I thought it was time to start learning about ARM processors.  

For various reasons I decided to start with the OM13056 evaluation board from NXP that contains an LPC1549 ARM cortex-M3 micro.  I chose this particular device because it has an onboard CAN bus controller and flexible methods for updating the firmware.

ISP Modes

Depending on the state of the the ISP_0 and ISP_1 pins at boot time, the device can be programmed via the CAN controller, USART, or USB.  The USB mode is the one that interests me the most.  By booting into USB mode the device presents itself as a mass storage device to the computer that when mounted contains a file named firmware.bin that contains the firmware.  You can read this file or drag and drop a new file to the drive to overwrite it to load new firmware.  It's fairly common now, but this was new to me.  In the past I've built PIC and AVR programmers by hand to get my code onto a device and I hated it.  It always got in the way of the task I was actually trying to perform. So this was brilliant.  It would also allow me to make a device that a user could update without extra hardware.

Then reality set in.  I plugged it into my Windows 10 computer, rebooted it in USB mode and was faced with an error message stating that "The directory name is invalid".  I tried everything I could find online to try and fix it but got nowhere.  I didn't know if it was the device or my computer causing the problem, so I tried it in my old laptop.  This time it worked.  So the most you could say at this point is that there's something about the way the device presents itself as a USB drive that allows one computer to read it and not the other.  My desktop was a fresh install of windows 10 64-bit while my laptop is an 32-bit upgrade to windows 10 from windows 7, so maybe there's a driver issue.  Who knows?

error message
Error Message

I still didn't know if my desktop had a driver or hardware issue so I opened the drive in raw mode with a program called HxD.  It hasn't been upgraded in ages, but it's awesome.  Straight away you can see from a cursory glance that the first sector kind of looks what you'd expect the master boot record of a FAT file system to look like.  This tells me that the hardware is at least working to this level.  You could sit there and decode it by hand, but there are better ways to attack this.  "TO LINUX!!!" **Puts on cape and slides down pole into a secret cavern**

Hex data
Accessing the raw data on the USB with HxD

I installed a quick Ubuntu VM in virtual box and passed the "NXP LPC1XXX IFLASH" USB device to it.  This is just here in case anyone doesn't know how to do that.

USB pass through to VM
Pass the USB to the Virtual Machine

Success.  The drive mounts and I can access the file.  From this I surmised that the problem is probably a combination of things.  In some way, the MBR of the flash drive doesn't conform with the FAT standard 100% and the fresh install of Windows 10 is enforcing that rigorously, while the other systems are able to deal with what ever is wrong with it.

Ubuntu file explorer
USB drive mounts in the virtual machine

What else can we find out about the drive?  It's FAT-12 and the size of 264,192 bytes is as expected.  It may seem wrong as the LPC1549 has 256 kiB of memory and this is 258 kiB, but you need to realise that the first 2 kiB of the device is dynamically generated when the computer accesses it.  It's the MBR and FAT and doesn't really exist.  The on board USB boot loader wraps the flash memory up as a file named firmware.bin and presents it to the computer.

disk properties
Disk tool show that the dev board shows up as a FAT-12 partition

We can find out more info by imaging the drive with the dd command and running the file command on the image.  Warning! dd can do bad things, be careful when you use it.

dd if=/dev/sdb bs=512 count=1 of=mbr_usb.bin
file mbr_usb.bin

disk properties
Inspecting the master boot record

The next step was to run the testdisk utility over the drive.  I'm not able to say for certain that this is the problem, but it did show a couple of things as unusual.  Maybe one of these issues is causing my Windows problems.

disk properties
Inspecting the drive with testdisk

Unless this is just a random edge case I don't feel comfortable letting an end user use this method of firmware updating.  I'd much rather try my luck with the USART.

Saturday, July 30, 2016

Using A Dial Gauge To Measure The Shape Of A Surface

Recently I've been trying to measure the shape of a vintage plastic cupboard handle.  For those that aren't up to speed, check out my previous post on how to use a radius gauge, where I explain the motivation for the project.  I was able to determine the basic shape of the profile on the face of the handle, but wanted to quantify it a little more.  After a lot of thinking I figured out a way to do this using a dial gauge with a magnetic base attached to the carriage of a lathe.  It takes patience but gives great results.

Lathe Cross Slide
Measurement Setup
The first thing to do is rigidly mount the object you want to measure in the toolpost of a lathe. In this case I've fitted the handle to a thick sturdy bracket.  The screws in the toolpost weren't long enough to reach it so I've used a lathe tool between the bracket and the centre screw to space it out.

Lathe Cross Slide
Handle Mounting
The next step is to place the magnetic base and dial indicator in a position on the lathe carriage so that they won't get hit if you move the topslide.  Do some tests to make sure that the tip of the dial indicator can reach all parts of the surface you want to measure.

Contact Tip
Probing The Handle
Then comes the tedious part.  Position the handle so that the indicator tip is just to the side of the surface you want to measure.  You then raise the indicator tip, move the topslide a set amount by turning the dial, lower the indicator tip, and then take a reading and repeat.

In my case I decided to take a measurement every 0.1 mm.  In the image below, this means that I had to turn the dial 5 divisions between every reading.  Make sure that you always travel in the same direction when doing this, otherwise the backlash in the topslide will make the measurements worthless.  It's also important to lift the indicator tip when moving the topslide.  If you don't, the surface will push the indicator tip to the side, once again making the readings meaningless.

Lathe Dial
Cross Slide Dial
When taking readings off the dial, estimate the position of the needle if it's between marks.  It may not be exact but it's better than rounding.

Dial Indicator
Dial Indicator
Depending on what dial indicator you have, you may need a new tip for it.  The one I was able to use had a tip that was very round and wasn't sharp enough to access all the areas of the surface I wanted to measure.

Dial Indicator
Dial Indicator
You can see the difference between the tip I used in the above process and the one that comes with the indicator.

Contact Tip
Contact Points
I was able to get a set of dial indicator contact points on eBay for 20 dollars Australian.  They aren't the highest quality things I've ever seen, but they do exactly what I want and that's all that matters.  If you're looking for a set yourself, search for "indicator contact tips" or "indicator contact points".  Searching for 4-48 UNF threads also leads you to these as it seems to be pretty much the only thing that thread is used for.  Some dial indicators use an M2.5 thread, so you may need an adapter.

Contact Tip
Contact Point Set
The point of the tip I used looks to be round, but using radius gauges I was able to tell that it had a radius of less than 0.3mm.  I'm fine with that.

Contact Tip
Sharp Contact Point
When performing measurements I wrote down my results as I went.  I then went way back to the beginning started again and took a measurement every 2.5 mm to make sure that the dial indicator didn't move during the process.  This was just to verify the setup and are the circled data points.

The data was then plotted to reveal the shape of the handle.  When looking at the shape it's important to remember the limitations of the tip geometry.  The three sharp crevasses will appear round because the tip is slightly round and can't get all the way to the bottom of them.  As the tip is conical it will also have trouble measuring the vertical part to the left and right of the central bumps, so these sections will also be slightly distorted.

The red dots in the image below are the verification data points.  This makes me confident that the setup didn't move during the measurement process.

Profile with verification points
Another thing to look out for is that you might not have mounted the object perfectly flat.  Because my object is symmetrical. I can mirror the data, overlay it and see that I do indeed have a small misalignment.

Profile with its mirror image
By lining the two up, I was able to determine that the part was off flat by about 0.5 degrees.  I can now compensate for that later.

Profile with its mirror image rotated 1 degree
Another thing that may happen is that the handle is not mounted perpendicular to the motion of the top-slide.  This would have the effect of stretching the shape side to side.

To be honest this turned out a lot better than I expected.  I need to do more work to clean up the data, but I now have a good reference to work from.

Thursday, July 21, 2016

Using A Radius Gauge

I recently managed to buy unused original 1950's stock of a handle that was used on my grandparents kitchen cupboard and I want to be able to reproduce it in the future.  The first step in this process is measure measure measure!

Replicating the exact mechanical operation of the handle isn't that important, what I'm mainly interested in is being able to reproduce it's aesthetics.  The first part I'm measuring is the radius of the beading on the outside of the handle.  One problem, I had no idea how I was going to do it.

Acetex 44L Handle
My go to tool for something like this would normally be a caliper.  Unfortunately in this case there isn't really anywhere to get the jaws of the calipers around the curve of the beading.  Not even 180 degrees of the beading is available to measure.  So to measure the curve you need to compare it to a set of reference curves.  It turn's out that the tool to use is a radius gauge.  After a longer than expected wait for $10 gauge from eBay, I was able to get started.

Radius Gauge
The gauge comes with external and internal feelers with radii ranging from 0.3mm to 1.5mm in 0.1mm increments.  The concave gauges can measure radii where around 70 degrees or more of the total circle is available.

Concave Gauges
The convex gauges can measure radii where 180 or less of the circle is available.

Convex Gauges
Ideally when using these gauges you hold them against the surface you want to measure, hold everything up to the light and look for light leakage around the edges.  To take photos I've just put them on the table and placed the gauge against the handle.  You can see that the 1.2mm gauge is slightly too small.

1.2mm Gauge
It's hard to tell from the below photo, but the 1.3mm gauge is almost perfect.  A little to big. but close.  This now gives a range for the radius of 1.2-1.3 mm.

1.3mm Gauge
It should be said that I haven't verified these gauges against a standard, but I plan to take a few measurements in different ways and use them to build up confidence in the profile I measure.  From what I've been able to tell there are 4 beads that make up the central reeding.  They are evenly spaced and there is 7mm between the centres of the outer ones.  The radii of the beads is as seen before about 1.25mm.  The shoulders of the profile are made of two sections.  Coming from the beading is a flat section that I've eyeballed to be about 5 degrees less than horizontal.  I've tested the flatness of this section by placing a razor blade against it and checking for light leakage.  After this section is an unknown curve that is tangent to the other section but stops abruptly at the edge.

Handle Profile
Still a lot of measuring to do. No idea how to do, but I'll figure it out.

Thursday, July 7, 2016

Designing My Ultimate workbench

If you're like me, at some point you've dreamt of how you'd build your ideal desk or workbench. Everyone will have a different vision depending on their needs, but I think most people, even if they don't know it, have a list of requirements floating around in their head.  As a bit of an exercise in CAD, I decided to visualise my ideas so that when I have the space, time, and money I'll be able to build it without too many problems.

Workbench Design
My design is fairly straight forward.  I wanted a lot of open space and also wanted it to be easy to add extra features in the future.  To accomplish this there are equally spaced pre-drilled holes in the rear uprights.  These also allow the desk to be made in bolt together sections so that a single person can transport and assemble it without help.  At this point I've used 50mm x50mm square sections of steel, but I'm not sold on bolting across a hollow tube.  I prefer to bolt flat plates together, but I think it'll be fine though if the steel section is thick enough.

Bolting the bench frame to the uprights.
A welded frame is bolted between uprights to form the bench.  It's made mostly of square steel with some rectangular section cut on an angle welded to the bottom for brackets.

Bench frame
The workbench is made of inch thick pine with a rubber antistatic mat on top.  Once again these components are all easily managed by one person.  Cross bars are also used to mount computer monitors so that they are off the desk.  In the rendering below the monitors are bolted directly to the cross bar.  In reality it's likely that they will be mounted to a swing arm so that they can be moved closer to the user.

The pre-drilled uprights also allow shelves and lights to be easily mounted.  In this case the brackets for these aren't shown, but it's not too hard to imagine a triangular shaped support with internal bracing if needed.  The lights used are 600mm x 1200mm LED panel lights.  The nice even spread of light minimises reflections and shadows cast on the work area.  Ideally I'd also like to have a camera mounted on a swing arm to record any work I'm doing.  That's why I also don't mind over sizing the rear supports as this will minimize vibrations the camera may experience.

Monitors and Lights
The lights are set forward to allow maximum illumination of the bench without wasting light on the shelving.

Location of shelving and lights
At the moment the thing is built like a tank.  I can afford to reduce the size of certain elements to reduce the weight, but at this point it's just to get a feel for the concept.  My bolt holes in the upright are 50 mm apart and 10 mm in diameter.  This is just a first guess and will eventually be different.

Bench Frame

OH NO!!!  Someone broke in and replaced two of my uprights with light sabers.  OK, I may have got a little carried away with the self illuminating materials in Fusion 360.
Add caption

I'd love to know if you have any ideas or examples of your own.  If you have any ideas for things to mount at the back let me know.  I've been thinking along the line of small parts bins or something like that.