Wednesday, December 24, 2014

Building a NAS

Network Attached Storage (NAS) is a really useful tools these days. They don't just host files for share in local network, but can also act as servers for a number of functions. I recently needed to build a NAS.

A NAS is an always on device, so the power consumption is more a concern than the performance horse power. I happened to have an Atom based Intel motherboard that is underpowered for desktop use, but is perfect for this application. The board is Intel D525MW that has only two SATA ports. That's not enough. Fortunately the board has a PCI slot. So I got a PCI SATA board for the other disks need to be connected. The board I have is a SYBA 4-port SATA II (SY-PCI40010), and it supports hardware RAID. And here comes the problems.

Intel D525MW RAID Problem

The first problem is that I found that the computer does not boot up any more. After some time spent on elimination, I finally narrowed it down to the board - it would not boot when the board is plugged in. I search around and finally find that RAID was a problem for the Intel D525MW board I have. After an update of the BIOS of the board, everything works perfectly.

Flash the RAID Board

The PCI RAID board is using Silicon Image SiI3124 chip. This is an older chip that only supports RAID up to about 3T. That's not good enough. I know that before buying it. The chip on the board can be flashed to make it non-RAID, since I am going to use the software RAID anyway. Silicon Image website was pretty bad, and there is nothing on the support page (and it plain did not work). Searching up and down the web, the flashing tool (updflash.exe) and the firmware can be found for the SiI3124 chips (that is for another board, but it is the same chip). In the firmware packages, the bxxxx.bin is the non-RAID firmware, and rxxxx.bin is the RAID firmware.

Make a DOS boot USB and run the following command will flash the card with non-RAID firmware.

updflash.exe b6600.bin

Disable the Head Park on WD Green

I am using a few Western Digital Green drives. It is reported that these drives park their head after only 8 seconds of non-use to conserve energy. That drastically reduce the life of the drives. This timeout can be disabled by a WD utility called wdidle3. The use of that utility on the WD Green drive is not documented, but it works. This modification is recommended by people online. So I downloaded the utility and applied. It turns out that the utility only discover and apply to drives that are connected to SATA ports on my motherboard, but not those connected to my SATA card. So I need to repeat the process by connecting my drives to motherboard SATA ports in turns.

At the end, my NAS is finally up running.








Saturday, December 20, 2014

XSVF JTAG Programmer

Now I need to have a device that glitches my Xbox 360. For my pursuit of frugal fun, I chose to use a cheap Coolrunner (I bought off eBay for $8) instead of the Team Xecuter CR4 XL (which is currently $33 plus shipping, not to mention the QSB kit). But there is one more problem. The Coolrunner I bought comes blank (not programmed). The information to program the Coolrunner with (in XSVF file) comes with the JRunner software, and XSVF files are for being written to device through JTAG interface.

I have a Matrix NAND Programmer to read and write NAND from Xbox 360. That process seems to use an interface that is SPI (or very similar to it). On internet, I have seen people post connection diagram for connecting  Maxtrix NAND Programmer to the JTAG interface of the Coolrunner. Interestingly, the programmer does have six connection pads on the side, and the JTAG interface is pretty similar to SPI. Because of that, and also the fact that the other NAND programmers / software can also be used to program JTAG, I had assumed that I can do that same with Matrix NAND Programmer.

It turned out not working. As mentioned in my other post, the Matrix NAND Programmer is compatible to NAND-X with drivers from NandPro 2.0. But it turns out that NandPro 2.0 does not yet accept xsvf option (that programs JTAG using a XSVF file). That feature is added in NandPro 3.0, but the NAND-X driver with NandPro 3.0 would not work with Matrix NAND Programmer.

So I am stuck here. Basically, I would still need to buy a NAND-X or JR Programmer to program the device, or I will have to find some creative way to get it done cheap. I read about the JTAG spec, and it is just four lines which seems to be quite straight forward. Then I found some code about playing XSVF through Bus Pirate. Bus Pirate is a very useful tool I have always wanted. But it is another $28 even though it beats buying CR4 XL. There has to be a better way.

After some more search, I found this library of writing XSVF files, called libxsvf. It is an open source project that programs XSVF files to an interface that you can provide. That is great. All I need is a bit-banging interface, and I can program the JTAG. I have thought about building a quick bit-banging interface with an AVR processor, or even an Arduino Pro Mini. But I happened do not have an 3.3V Pro Mini at hand, and my Coolrunner seems is marked 3.3V (but I don't have any data sheet on it). The next option is the well used FTDI USB-Serial interface, and I happened to have one of such (FT232R Breakout) which can be configured to either 5V or 3.3V.

Libxsvf comes with the main code compiled into a library and a couple of sample code that uses the library. One of the simple code is using simple GPIO in synchronous mode, the other one uses FT232H's MPSSE in asynchronous mode. My board is a FT232R, it can not use the later one. Oh well, I will just program the FT232R bit-bang as synchronous GPIO then.

Here come out my compiler and pretty soon I am writing to my Coolrunner. There are a few tricks to get it to run fast enough (mostly dealing with USB latency timers). It is possible to use the asynchronous mode to make it faster, but for the purpose of getting my Xbox 360 to work, that is enough. It takes a couple of minutes to program a 32KB xsvf file.

The source file of my program is xsvf_bang.c. It is based off xsvftool-gpio.c of libxsvf, and I hope I do get the license right. It needs to be linked to libxsvf (compiled as static library) and ftd2xx.lib (download driver from FTDI and extract).

 So after much trouble (all in the name of saving some $40 and having fun), my Coolrunner is ready to work with my Xbox 360.

Friday, December 12, 2014

Cheap programmer to read/write Xbox 360 NAND

In order to mod the Xbox 360, the first step is being able to read/write the NAND on Xbox 360. Apparent somebody has figured out the JTAG signals on the Xbox 360 board, and there are plenty of JTAG/NAND programmers out there.

The most common ones at this time is J-R Programmer v2 by Team Xecuter (at around $27 on Internet, plus shipping). There are also v1 version, and also an older programmer called NAND-X. As I always are, I am trying to find the solution to the problem at the lowest cost. On eBay, I found the Matrix NAND Programmer for around $8 shipped. So that's what I got. (I could go cheaper to build a parallel port adaptor, but that is 30 minutes for each NAND reading. A bit too long.)

It is now not that straight forward to use it (otherwise where is the fun of it). Here is the tricks that I have figured out to get it working.

Wiring to Xbox

The Matrix Programmer is an older device that was developed for use around 2011 (that's why it is cheap). The wiring connection is marked as J1D2.1, etc. The "J1D2" part of the mark refers to the connection headers on the Xbox motherboard, and ".1" part refers to pin 1 of the header. Apparently, that is for an older version of the Xbox. I have a Slim and the "J1D2" is now "J2C1", and "J2B1" is now "J2C3". And here is how it looks like connected to my Xbox Slim (Trinity).


Device Driver

One software that is commonly used is called NandPro by Team Xecuter (currently at v3.0). It is a command line tool that comes with a driver folder. However, none of these drivers work. So I searched up and down, and finally I read a post saying that the Matrix Programmer might be compatible with older versions of NandPro, such as 2.0c. The download can be found at this link. With the driver in that package, the device install well. And it appears as a "XECUTER NAND-X USB"!


Reading NAND

The NAND can be read by the NandPro on commandline. The Trinity has 16M NAND. So the command should be
nandpro usb: -r16 nand1.bin
But Team Xecuter has a better tool called JRunner. It has a graphic interface and makes everything a lot easier. Better yet, because the Matrix Programmer appears to be imitating NAND-X (as shown below in the red rectangle), it can be used directly with JRunner to read NAND.


Creating New ECC

With JRunner, creating becomes a simple operation of a click. No more need to install Python and the crypto pack as before.

Writing NAND

Just when I thought everything is sailing through, writing NAND in JRunner did not work. The operating It maybe because NAND-X has changed the interface. With the ECC generated, I just fall back to the commandline NandPro, and it worked well as intended.
nandpro usb: +w16 image_00000000.ecc


Now all we needed is a chip that glitches the CPU.



Monday, December 8, 2014

Run custom code on Xbox 360

I have a Xbox 360 slim for 3-4 years, and have played it occasionally. Recently I happened to check about running home brew code on Xbox and it turned out there are some amazing engineering done to enable that.

The best of that is a hack called "Reset Glitch". It is discovered by a French guy called Gligli. The whole process is nothing short of AMAZING. First a glitch was found that by asserting CPU_RST line on the processor the CPU will always return 0 for comparison commands (instead of a full CPU reset). So this way, one can assert the line at the "right moment" when the boot code is performing signature verifications so the verification always passes.

The keyword is "right moment". But the CPU is running code at hundreds of mega hertz. How do one find the right moment among the millions of instructions that are executed? It turns out there are ways to significantly slow down the CPU clocks, and different ways for different versions of Xboxes as well. For older Xboxes (called FHAT), the way is to assert CPU_PLL_BYPASS. For newer slim Xboxes, it is to change register value on a chip through I2C. I was thoroughly amazed by how people can probe and reverse-engineer all these from a complex black box system.

Apparently, this has been around for years (since 2011), and I have just learnt it today. I have decided to give it a try.

Sunday, November 30, 2014

AVR ISP Extender

I have played with microprocessors such as PIC and AVR. They both have advantages and disadvantages, and are fun to play with.

One thing about AVR that I have problem with is the ISP interface. The AVR ISP programmers use a 10-pin (or 6-pin) interface arranged in 5x2 (or 3x2). This is rather bread-board unfriendly. In comparison, the PIC ISP programmers use a 5-pin inline interface, which is much easier to connect. With some time in the weekend, I have decided to build a little board that brings AVR ISP into a more breadboard friendly form.

There are a few such attempts by other people on the internet. Here is one that is just expanding the space between the two rows. This is a little circuit board of the same idea from Sparkfun. This guide makes the circuit board yourself, and I like the way how the pin head is connected to the board.

This is quite simple, and I have all the connectors I needed. So I decided to get my soldering iron and make one myself just for the fun. Since I will be using a lot of 8-pin ATtiny processors, I decided to add a DIP8 socket so I can easily program those without needing to connect the wires every time. By the way, I found a nice compact bootloader that works on ATtiny's, so all I need to do is to burn the bootloader on.


 
So here is my AVR ISP extender. I tested it by programming a ATtiny chip, and it works well.
 
By the way, my pin out is as following:
  1. GND
  2. VDD
  3. MOSI
  4. MISO
  5. SCK
  6. RST
This is different from most others on the Internet. I also has two rows of inline connectors, one male and one female so it works with both arrangements when I need it.
 
 


Monday, September 8, 2014

Homemade NAS

My old server is getting too slow, and I decided to separate the CIFS file server. There are a few open source NAS software available on the Internet. The most interesting ones are:
The first two (FreeNAS and NAS4Free) are very much related. NAS4Free is forked out of old FreeNAS when they were acquired. They are all based on FreeBSD, and the files system they used is UFS / ZFS. They seem to be well followed and easy to use. But the ZFS really is getting me uncomfortable. ZFS has a lot of nice features, but from what I read it really make one thing I wanted very difficult (or impossible) to do. That is to swap out a hard drive without going into a RAID configuration. This makes it out of question to grow capacity by swapping in larger drives. Although you can always grow by adding drives, but I prefer to replace the older drives when I do that.

Anyway, along the search I found OpenMediaVault, which is based on Linux. Indeed, it is a package under Debian Linux. What I like about it is that it can use LVM (Linux Volume Manager), which can move data between different physical drives within a same volume group. With that, I can put a new larger drive into a group, move data onto it, and then remove the older drive. Another thing I really like about it is that it can be installed on many hardware platforms where Debian is available. For example, I have installed on x86/x64, Raspberry Pi (with Raspbian, need to follow these special instructions at this time 9/2014), and DreamPlug (with Debian and follow standard procedures).

At this time (September 2014), the installation method of the installation is quite straightforward. The standard procedure is rather straight forward. Now I am off testing it.

Saturday, August 9, 2014

Homemade CNC2 (Electronics - Part 2)

This blog is actually about a small disaster I have with my home made CNC. And I named it "Electronics - Part 2" because I believed that the problem seems to be with the electronics.

So I have GRBL controller on the CNC and everything works fine. The next thing I would do is to machine the end piece again for my Y-axis extension. This time I planned to machine it in aluminum. So I got some 5/16" aluminum, and go really slow with it (0.2mm per pass). It took a long time and I was watching the process, and got really bored. So I closed the enclosure and went on to do something else. When I got back to it after a while, I heard that something is wrong. I rushed in, and went for my panic button.

It was bad. The machine goes to some completely weird path. The end mill bits are broken. Not only the work piece is ruined, it gouged a deep mark onto my compound table. In additional, all the alignment of the machine is all thrown off.

I have been thinking about what went wrong. Eventually I came to a conclusion that this might be an isolation problem with the electronics. The step stick stepper motor driver I am using have both the logic and the driving power supply connected. The noise from the driving power side might get into the processer side and messed with the serial commands. That's just a guess based on logic deduction, and I have no prove for it. That give me an immediate next step work item, that is to build an isolation stage into my controlling electronics.

This really highlights another important aspect of working with machines and tools - the safety is a very important issue that can not be stressed enough. It was fortunate that I have an enclosure for the CNC, so whatever went wrong stays inside the cage. It is also a great practice to have a panic button that can stop all the machine operations right away. Because when you are at that moment, there is not much logic deduction going on. A pre-defined single safety action (such as pushing one button) would be a great feature to have for any machine.

For now, I will stay with machining plastic materials and stay watching it all the time during the process.

Thursday, August 7, 2014

Hot water get into the cold water pipe - Fixing a crosslink

Ever since we moved into our current house, I have noticed that there are hot water in the cold side pipe. Every time when I turn on the cold water, it runs hot for a while before it gets cold. We have been living with it for a few years. But recently it gets worse and worse to the point that I have to waste a lot of water in the shower just for it to get cold enough so I can get in. It is time to roll up the sleeves.

I started with some research to find out what the problem should be. There are a lot of causes, and nothing points to a clear direction. I went around the house opening and closing the valves under the sinks and faucets, but can not figure out what gives. Then all the sudden, an idea comes to my mind: why don't I shut off the valve of the hot water altogether (you can not shut off the cold water, which will shut off everything), and see if there are still hot water coming out of the faucet. Sure enough, it did. There we go, there is a crosslink between the hot and cold sides.

But where is that crosslink in the whole house? It took me some more research and thinking to figure out the method to locate it. But here is what I learned and want to share. There is only a few places in the house where hot water meets cold water. Most faucets have separate hot/cold valves, so you can easily eliminate them. Washing machines and dishwashers can also be easily ruled out too. The culprit is usually the shower where the hot and cold water are mixed together.

To make things complicated, there is usually no easy way to turn off water supply to a shower (of course you can turn off the shower, but that does not show anything). So how do you locate the crosslink? Here is the trick: by listening. Shut off the hot main supply, and run hot water in a faucet. As we said earlier, if there is no crosslink, there should be no hot water from faucet. A running hot faucet with hot water main supply turned off indicates water coming from cold side through the crosslink. Now going around the house listening to the sound of water rushing through the crosslink. It can then be located.

The crosslink in our house is at one of the showers downstairs. I opened it up, and disassembled the thermostat knob. It looked a bit rusty but nothing seems broken. What is strange is that I can not figure out how the water would NOT crosslink. The thermostat is mixing the cold and hot. Further more, replacing all the rubber seals does not seem to fix the problem.

A further research and check found that I have missed the real piece on the shower that keeps the hot and cold separate. It is called "check valves" or "no-return valves". On the Grohe shower we have, it is on both sides of the thermostat mixing chamber. Taking them out found that they are indeed broken and with a lot of hard black stuff grown on the valves.

The rest is easy. Go on Internet, find the part diagram for the shower we have (Grohe AquaTower 2000 - 27018000). From there, get the part number (1411600M). Then do an Internet search on it. I found the best deal on Amazon. The parts looks a bit different from the ones I have, but I think it should work. (Some plumbing stores do sell parts with
the same part number but looks exactly the same as what I have, but at a higher price). By the way, the parts come in pairs so I just need to order one of 1411600M.

The valves arrived in a week. I have them installed. And a test shows that now I have zero crosslink.

Tuesday, July 22, 2014

Homemade CNC2 (Electronics - Part 1)

I needed the electronics to run the CNC. When I started out (and with my last CNC build) I have been running it with Arduino Mega 2560 with a RAMPS shield. You can immediately recognize that this is a 3D printer electronics setup. Indeed, I have converted my last CNC into a 3D printer to learn the in and out of it. So with this CNC2 build, I have also started with the same setup, which I happened to have laying around.

For the firmware, I have been using Marlin. In order for it to run CNC, I have to modify the configuration file to disable temperature sensing otherwise it would not move (this is a safety feature for 3D printer to prevent extruding before the hot end is hot enough). For the host software, I have been using Printrun.

This setup works out fine for a while, but then I felt that I will need more. First of all, the Marlin firmware does not work with inch as unit. In this part of world where I am living, the English system is still commonly in use. It is a lot easier to go down to my local hardware store to buy stuff in English then mail order then on Internet and wait for them to arrive. The second thought is that I know there are CNC specific firmware out there, such as GRBL. If I can have a firmware that not wasting the processing power on checking the temperature, why not go for it? GRBL has been proven working by years of experience in the community and it has a few neat features from what I read (such as command to change steps per distance). The third things is that while using Marlin, I for a few times have the firmware paused in the middle of a long run. I somehow suspect there might be un-found bugs in the Marlin firmware, at the same time GRBL is simpler (thus less chance of bugs), better tested (it is there longer than any 3D printer firmware), and I especially like its soft reset that retains machine coordinate while resets the processor state. So I have set to move to GRBL.

GRBL is very simple and easy to use. It is small enough (I have always loved simpler solution) that fits into the 32K memory of ATmega328P. I happened to have a few Arduino Pro Mini 328 (which I bought for a few bucks on eBay thanks to China). So I pulled out my AVR compiler and build the GRBL. After some struggle with the Arduino bootloader, I am able to load GRBL onto my Arduino (which I essentially used as a ATmega328P breakout board).

Onto my breadboard in a spare box, I have built a test CNC controller running GRBL. And I have added the GRBL soft reset switch to the front panel, as I really needed that "Panic Switch". I will find out why soon.

Thursday, July 17, 2014

Homemade CNC2 (Enclosure)

I have been playing with my new CNC, and have machined some pieces for the Y-axis extension modification. While I am machining the pieces in ABS (which is harder and more brittle compared to HDPE), I noticed that the dust from cutting is getting in the air and making me coughing. Since part of my use of the CNC will be to do circuit board routing, it may produce some other harmful dusts as well (circuit boards are made of fiber glasses, which is really nasty if inhaled). So I decided that it is time to make an enclosure for the CNC to contain the dust from cutting inside. In additional, an enclosure will be very helpful for the safety in case some thing goes wrong or some pieces flying around. (This proved to be very useful in an event happened lately).

So with some quick scratch and using the scrap wood I have laying around in my garage, I spent a couple of days to put together a quick enclosure. In order to leave me with un-obstructed access to my working area, I used a cantilever design so the front of the enclosure is without any supporting column. I am not going to put my weight on the shelves besides my controlling electronics, so this should work pretty well. The only problem with that is from the think Plexiglas sheet I have bought. Since the sheets are the most expensive piece of the enclosure, I went for the thinnest I can get. It still cost me almost $30, but the sheet is so thin that it warps. Without the front columns for it to be fixed on, it leaves some gaps between the front and side shields. Oh well, as we know, a perfect solution is a luxury that a home shop does not have. And that is part of where the fun comes from. I used some tape to keep the pieces straight and together.

So here is my CNC enclosure in place. It is not too bad considering how much it costs me.

Sunday, July 6, 2014

Using AVRDUDE with Arduino bootloader

I am working on a home built CNC project that uses Atmel processors as controller. In the process, I had gone through much trouble to load the firmware using the AVRDUDE through the Arduino bootloader on the chip. Here is to share my finding since I have a little trouble finding this information on the internet.

Basically the Arduino bootloader is default to 57600 baud 8-N-1 (circa 2014). Everywhere I searched on Internet (including the official Arduino bootloader page) has dated information, and specified as 17600.

The other information is that the programmer protocol must be set to "arduino" for AVRDUDE. So here is the correct commandline options for it:

avrdude -v -v -c arduino -b 57600 -P com9 -p atmega328p ....

Note that the baud rate (57600) has to be explicitly specified for this to work. I also found this information mentioned in this Sparkfun forum post, which is where I got the idea originally.

One more small caution with loading with AVRDUDE instead of Arduino IDE is that one will need to make sure that the chips is in bootload mode when AVRDUDE attempts to write to it. One way to do it is to perform a board reset (through a switch or short the right pin). But the modern Arduino bootloaders stays in the bootload mode in a very short time (mine is half a second), so you will have to reset it in a relatively short time window. But if the code is load through Arduino IDE (and proper Arduino hardware setup) there is no such reset needed. The way that Arduino IDE does it without using the reset is to use the DTR line (of the serial communication) to trigger the reset. On my setup I just connect the DTR of my FT232R module to a line marked GRN on my Arduino Mini Pro, and it works well without needing me to press the reset button any more for loading.

A few more words, I am using these Arduino boards essentially as a AVR processor board. The Arduinoo boards are cheap and readily available (thanks to industry scale and China), and it helps me to avoid soldering the tiny surface mount chips.


Thursday, July 3, 2014

Homemade CNC2 (Y Extension - Part 1)

Now I got the CNC working and made some test cuts on wood, plastic, and aluminum. Everything works beautifully. It is tight and precise after calibration. And what I like most about the traditional compound table and fixed head design is that I can change the tool bits between different cuts without losing the X/Y coordinates. This was not possible with my previous ShapeOko build.

While I am continuing back to build things useful, I quickly run into a limitation of this CNC. The Y travel of the compound table is only 43 mm (a bout 1-3/4 inches). That limits the parts machined to a very small size. I have mentioned in my previous blogs that there are a couple of ways to extend the Y range (such as Retromaster and 0xFRED). Personally, I think the method by Fred is a much better solution.

First, I went out and bought some small ball bearings from eBay for a few bucks (thanks to China). The bearing is of the size 6mm ID x 12mm OD x 6mm thick. It is small and fits well into the limited space there. The stock Y axis threaded rod is just a bit short, so I also got M6 threaded rod from McMaster-Carr (a great place to source parts, material, and tools). Note that by convention, the Y axis rod is always left handed, although it does not matter if you don't plan to hand crank it. I may replace it later, but for now the center driving nut is left handed, so to make things simpler, I got a left handed rod.

Since I have a lathe, I decided to turn down the end of the rod. I have also turned a small collar to go on the rod. Since I don't like the holding pin Proxxon originally used, I decided to use a die to thread the end that I have just turned down, and to hold the collar in place with a small nut. This has proven to be a bad idea (which I plan to fix later with a different design). As one can see from the picture here. The rod is made with soft steel, which is very difficult to machine. So the thread I made on it looks terrible. Further more, I found that the holding nut will get loosen after some time. But for now, that has to be it. I will have to make it work so I can use it. Proper solution sometimes is a luxury a home shop could not have.

So after measuring the sizes, I got the CNC to cut a part for itself. (A machine that can be used to build itself - sounds like a neat line) Anyway, I made the pieces with some 1/8 inch ABS plastic I have laying around. ABS is just strong enough for a temporary piece, and if my measurement is off I can make things fit with a utility knife (as shown in the picture above).

In another picture, the moving part of the compound table is sliding beyond the end plate of the Y axis. After everything is assembled together, I got to measure the travel of my new Y axis. It is now a whooping 100mm (just under 4 inches). Now I can finally cut pieces that are wider than 2 inches.

Here is how the new extended Y axis look like now. I will come back to fix the rod with a better design and remake the end plate in aluminum. But for now, it works.





Monday, June 30, 2014

Homemade CNC2 (Y axis)

After finishing the X axis, I started to get on the Y axis. After all, what can I do when I have a one axis CNC?

The pieces for the Y axis is very similar to the X axis. Here is a picture of the original parts. The Y axis of the HF70 milling machine tables has notoriously short travel. People are coming up with various ideas to extend the travel of the Y axis (such as Retromaster and this one). I plan to do one of these at a later time, but for now, I need to push forward to finish the conversion so I can have a working machine.

So the conversion is very similar to what is done on the X axis. Same cylinder shaped piece is replacing the handle. The plastic piece is removed leaving the steel piece in place. When it is done, it looks like this in the picture below.

Next comes the stepper motor. This is much easier than the X axis, as the Y axis is sitting on the base. All I need to do here is to mount the motor somewhere with the right height.

So out come my saw and a measured cut on a wood piece. Here it is, the stepper motor is sitting on its place, connected to the end of the rod with a rotation coupler.

Here is now the completed Y axis look like. Next comes a lot of fun time calibrating the system and making test cuts. I have some left over electronics from my last 3D printer build. So it is easy and quick to get the stepper motors hooked up. And here I have a completed homemade CNC from cheap parts I can get.

Sunday, June 29, 2014

Homemade CNC2 (X axis)

After a long break from this project, I am back to continue working on it. Now it is time to convert the compound sliding table to be controlled by stepper motors.

For the compound table, I used one that is the same as used as MF70. I got it for $90 on Amazon (see my previous post). There are a few articles on Internet that discussed the conversion of MF70 milling machine to CNC. They gave me inspiration and ideas.

The first axis I worked on is the X axis. The disassembly is simple. The only place that is a little tricky is to remove the pin that holds the handle to the end of the threaded rod. I used a small drill bit to punched it out.

The parts looked simple enough. Basically, I just need to make a stepper motor mount and extend it so it is attached to the end of the sliding table. At the end of the sliding table, there originally is a steel piece hold inside a (black) plastic piece. The threaded rod is turned down at the end, and fitted with a sleeve bushing which rides on the steel piece. I decided that the plastic piece is not needed, as long as I keep the steel piece in place. I may want to convert that into a ball bearing later but for now that is good enough.


I have made a small piece on my newly acquired Craftsman 109 lathe. Even though it is a beaten up old lathe from half a century ago, I found that lathe and milling machine are tremendously helpful and complementing each other when making parts. The piece I made was the small cylinder shaped piece at the lower right corner of the picture. It is drilled so the pin can hold it to the end of the rod just like it was for the handle. The coupler then connects the stepper motor to the rod.

Here is a picture when the pieces are put together and assembled on the sliding table. The rotation coupler is not installed. The cylinder piece is pined to the rod, with the sleeve and a washer act as the bearing surface between the rod and the steel piece when the axis is rotated by the stepper motor.

I used this chance to check for alignment and makes sure everything is in place. As one can see, the stepper motor is not perfectly aligned so I spent some time to get that straightened up.

Another thing I do differently here is that I used a two piece aluminum angles to make a U-channel shaped extender. I saw people on the Internet who used U-channels there. I was about to do that originally. But after some thought, I figured that this two piece is a lot easier to assemble onto the sliding table, as you can see the screws holding the steel piece (which holds the extender onto the table) is a bit hard to install if this was a U-channel. On top of that, I don't have a U-channel at hand, but do have these angles.

So finally, here is my X axis, converted to CNC.


Monday, February 3, 2014

Homemade CNC2 (Frame)

After the Z head is ready, I needed to make a frame to hold everything together. Since wood is the easiest material to work with, I put together a quick frame.


It is nothing fancy, just for everything to be put together. And with the Z head and X-Y compound sliding table mounted, the CNC is taking shape.


I did need to put some wood blocks underneath the compound table to get it to the right height. With a little controller I have left previously, I was able to move the Z axial up and down. It is quite a bit tight as one would expect from the imprecise wood construction. But we can improve on that later.


Here is how it is like after a first test cut on a plastic block. I have then used it in the rebuilding of the little Craftsman 109 Lathe.

Thursday, January 30, 2014

Craftsman 109 Lathe - Spindle

It seems is a well known fact that Craftsman 109 has a weak spindle. The spindle is just over 1/2 inch in diameter (0.550"), and is easily bent. On the lathe I bought, with its age, I'd have to assume that it is bent. So when I have it stripped into parts, I took the opportunity to measure it.

I googled and it seems that people are checking the spindle with dial indicators. I have one which I recently bought, but I don't have a holder. Since the dial indicator does not need much force to hold it in place, I just put it on top of a few boxes and blocks and it worked fine.


It is off. So I marked it, took it off the headstock, and whacked it with a hammer. After a few tries, I have finally get it close enough, and on it goes.

Here is the test cut after straightening the spindle. On the left was the best I can get before rebuilding, and on the right is with the newly straighten spindle. It really looks much better.



The advantage of having a weak spindle is that it can be corrected really easily if needed.

Friday, January 24, 2014

Craftsman 109 Lathe - Setup

I have been thinking about getting a lathe for a while. When I was building my 3D printers and CNCs, there is constantly needs to make some parts. Some of the reasons are for lower the cost compared to buying from stores. Some of the reasons are just that the parts needed is not available commercially, and needed to be custom made.

So I finally saw this lathe on Craigslist listed for $160. It is for a Craftsman 109 lathe. I knew nothing about that lathe at the time. After some quick reading, I found that this was a really popular hobbyist's lathe in early part of last century. After a quick negotiation, I got it for $140, and went on to pick it up.

A lot of information on this lathe can be found on Internet. The lathe I have has a model number 109.20630. According to the website, it was on sale on 1945. That puts it at almost 70 years old now.

The guy who sold it to me was kind enough to show me how it works. Before that point, I have never operated a lathe. So all is very exciting. I took it home. Of course the first thing I did is promptly strip it into pieces. This model of lathe comes with thread cutting gears. The last owner has never put it up, so they are all in a tin box. After some study, I found that it is missing a few gears. And a search found that Craftsman 109 (sometimes called AA 109 for Ann Arbor who made it for Sears) is a very popular vintage lathe. Parts are are readily available on eBay and also available in the Home Shop Supply (a shop specializes in Craftsman 109 parts), but quite expensive if to get it complete. Oh well, I will figure out a way later.

The other minor issue with it is that it comes with a 3" chuck with only outside jaws. With a call to the last owner, I was told that that's all he has. Fortunately, there is the Little Machine Shop, which sales all the stuff a home machinist will need. $33 plus tax and shipping gets me a set of inside jaws that works with the chuck. It is not arrived yet when the picture below was taken.


This is how the lathe looks like when everything is put back together, spindle straightened, and everything tightened. It is really not too bad for a piece of 70-year-old machine.

Thursday, January 9, 2014

Homemade CNC2 (Z Head)

The first thing I built for the CNC is the Z head. As a starting point , I went to Ebay and got a cheap linear slider for $20. It is the black metal slider you see in the picture below. It is made by DI, and has a travel range of a bit over 2 inches (which is sufficient for a CNC). I also plan to use the tool holder I have left from my ShapeOko after I have converted it into a 3D printer.

I have been thinking about different materials for the base board. Aluminum is definitely an options. But after some consideration, I decided to use wood. It is very easy to cut and shape, and has great strength weight ratio. It is cheap and easy to acquire too. The only downside of it is that the bulk of the size needed to reach the strength needed. But that is an acceptable trade-off for this build, as I can always replace them later. So here is the top plate of my Z head, with holes drilled for mounting.


These are assembled together as below, with a 300W spindle (which I also got from Ebay) mounted on the tool holder.


Next, we need put together the linear drive. For the Z-axis, I used a simple threaded rod going through a HWPE block. The HWPE block is a low friction plastic and is used here to achieve low backlash linear drive. It is a very simple setup. The threaded rod is hold with flanged bushing that fits into the wood blocks. The bushing is made of bronze with built-in lubrication. Two nylon insert lock nuts are used on each end as the holding points (which rides on the flange of the bushing). The stepper motor mount is made with an angle aluminum with a few drilled holes. Again, the coupler is purchased from Ebay.


Here is how everything are put together. A few more nuts are added for mounting the Z-Head plate to the Z post.



Saturday, January 4, 2014

Homemade CNC2 (Planning)

Since I built my first CNC with ShapeOko (see my previous post) as a learning practice project, I have being thinking about designing one by myself and build it. I have since converted the ShapeOko into a 3D printer and gave it away in a hurry. So for the new build, I will have to start from scratch and bootstrap it again. This is challenging because as we know it usually takes a CNC to build a CNC.

One thing I am thinking differently now is that I may want to build a CNC just as a CNC, instead of a potential CNC / 3D Printer combo. I have looked at a few milling machines and their CNC conversion. Also from my experience playing with my last build, I realize that it maybe advantageous to have a CNC with fixed tool head (and Z axial) with a separate X/Y compound table (as in traditional CNC). One advantage of this configuration is that enables easy change of tools without disturbing X and Y position. It also makes more sturdy and stable machines too, which is more important for CNC machines.

I have looked at the Harbor Freight milling machine (at $600). Another one of interest is Proxxon milling machine MF70 (at $400). But both of them are a little expensive. Then I found that the compound table of the Proxxon machine can be had for $90. That is perfect.

My plan is to build the head and the frame from there, and then put it with the compound table. Afterward, I can use it as a mini milling machine to mill the parts that is need for CNC conversion and go from there.